diff -Nru openjdk-11-11~19/bin/nashorn/runopt.sh openjdk-11-11~24/bin/nashorn/runopt.sh --- openjdk-11-11~19/bin/nashorn/runopt.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/bin/nashorn/runopt.sh 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -75,7 +75,6 @@ # # see above - already in place, copy the flags down here to disable ENABLE_FLIGHT_RECORDER_FLAGS="\ - -XX:+UnlockCommercialFeatures \ -XX:+FlightRecorder \ -XX:FlightRecorderOptions=defaultrecording=true,disk=true,dumponexit=true,dumponexitpath=$JFR_FILENAME,stackdepth=1024" diff -Nru openjdk-11-11~19/debian/changelog openjdk-11-11~24/debian/changelog --- openjdk-11-11~19/debian/changelog 2018-06-25 09:13:52.000000000 +0000 +++ openjdk-11-11~24/debian/changelog 2018-07-27 09:43:54.000000000 +0000 @@ -1,8 +1,53 @@ -openjdk-11 (11~19-1~18.04) bionic; urgency=medium +openjdk-11 (11~24-1~18.04) bionic; urgency=medium * PPA upload. - -- Matthias Klose Mon, 25 Jun 2018 11:13:52 +0200 + -- Matthias Klose Fri, 27 Jul 2018 11:43:54 +0200 + +openjdk-11 (11~24-1) unstable; urgency=medium + + * OpenJDK 11 build 24. + * jhsdb is not available on ia64 and m68k either. + * Update the m68k support (Adrian Glaubitz). Closes: #904204. + + -- Matthias Klose Fri, 27 Jul 2018 05:41:39 +0200 + +openjdk-11 (11~23-1) unstable; urgency=medium + + * OpenJDK 11 build 23. + * Explicitly build-depend on libfontconfig1-dev, explicitly depend + on libfontconfig1. LP: #1780151. + * jhsdb is not available on armel, mipsel and mips64el. Closes: #903631. + * Build using GCC 8. + * Configure with --with-native-debug-symbols=internal. + + -- Matthias Klose Thu, 19 Jul 2018 20:03:05 +0200 + +openjdk-11 (11~22-2) unstable; urgency=medium + + * jhsdb is not available on mips. + + -- Matthias Klose Fri, 13 Jul 2018 07:48:13 +0200 + +openjdk-11 (11~22-1) unstable; urgency=medium + + * OpenJDK 11 build 22. + * jhsdb is not available on powerpc, s390x and x32. + + -- Matthias Klose Thu, 12 Jul 2018 17:00:12 +0200 + +openjdk-11 (11~21-2) unstable; urgency=medium + + * jaotc is only available on amd64 and arm64. + + -- Matthias Klose Sun, 08 Jul 2018 08:22:34 +0200 + +openjdk-11 (11~21-1) unstable; urgency=medium + + * OpenJDK 11 build 21. + * Fix the jre/jdk split again. + + -- Matthias Klose Fri, 06 Jul 2018 07:10:53 +0200 openjdk-11 (11~19-1) unstable; urgency=medium diff -Nru openjdk-11-11~19/debian/control openjdk-11-11~24/debian/control --- openjdk-11-11~19/debian/control 2018-06-25 09:13:52.000000000 +0000 +++ openjdk-11-11~24/debian/control 2018-07-27 09:43:30.000000000 +0000 @@ -9,14 +9,14 @@ autoconf, automake, autotools-dev, ant, ant-optional, g++-7, openjdk-10-jdk-headless | openjdk-11-jdk-headless, - libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, libcups2-dev, libasound2-dev, liblcms2-dev, libfreetype6-dev (>= 2.2.1), libxinerama-dev, libkrb5-dev, xsltproc, libpcsclite-dev, libgtk-3-dev, libelf-dev, + libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, libcups2-dev, libasound2-dev, liblcms2-dev, libfreetype6-dev (>= 2.2.1), libxinerama-dev, libkrb5-dev, xsltproc, libpcsclite-dev, libgtk-3-dev, libelf-dev, libfontconfig1-dev, libffi-dev, zlib1g-dev, libattr1-dev, libpng-dev, libjpeg-dev, libgif-dev, libnss3-dev (>= 2:3.17.1), jtreg (>= 4.2-b10-1~), xvfb, xauth, xfonts-base, libgl1-mesa-dri [!x32], twm | metacity, twm | dbus-x11, x11-xkb-utils, time, openjdk-11-jdk-headless , Build-Depends-Indep: graphviz, pandoc, -Standards-Version: 4.1.4 +Standards-Version: 4.1.5 Homepage: http://openjdk.java.net/ Vcs-Bzr: http://bazaar.launchpad.net/~openjdk/openjdk/openjdk11 Vcs-Browser: https://code.launchpad.net/~openjdk/openjdk/openjdk11 @@ -33,6 +33,8 @@ java7-sdk-headless, java8-sdk-headless, java9-sdk-headless, java10-sdk-headless, java11-sdk-headless, java-compiler +Conflicts: openjdk-11-jre-headless (<< 11~19-2) +Replaces: openjdk-11-jre-headless (<< 11~19-2) Description: OpenJDK Development Kit (JDK) (headless) OpenJDK is a development environment for building applications, applets, and components using the Java programming language. @@ -73,6 +75,8 @@ Provides: java-sdk, java2-sdk, java5-sdk, java6-sdk, java7-sdk, java8-sdk, java9-sdk, java10-sdk, java11-sdk, java-compiler +Conflicts: openjdk-11-jre-headless (<< 11~19-2) +Replaces: openjdk-11-jre-headless (<< 11~19-2) Description: OpenJDK Development Kit (JDK) OpenJDK is a development environment for building applications, applets, and components using the Java programming language. diff -Nru openjdk-11-11~19/debian/control.in openjdk-11-11~24/debian/control.in --- openjdk-11-11~19/debian/control.in 2018-06-19 06:04:21.000000000 +0000 +++ openjdk-11-11~24/debian/control.in 2018-07-19 07:52:34.000000000 +0000 @@ -16,7 +16,7 @@ @bd_jtreg@ @bd_xvfb@ time, @bd_cross@ Build-Depends-Indep: graphviz, pandoc, -Standards-Version: 4.1.4 +Standards-Version: 4.1.5 Homepage: http://openjdk.java.net/ Vcs-Bzr: http://bazaar.launchpad.net/~openjdk/openjdk/openjdk11 Vcs-Browser: https://code.launchpad.net/~openjdk/openjdk/openjdk11 @@ -33,6 +33,8 @@ java7-sdk-headless, java8-sdk-headless, java9-sdk-headless, java10-sdk-headless, java11-sdk-headless, java-compiler +Conflicts: openjdk-11-jre-headless (<< 11~19-2) +Replaces: openjdk-11-jre-headless (<< 11~19-2) Description: OpenJDK Development Kit (JDK) (headless) OpenJDK is a development environment for building applications, applets, and components using the Java programming language. @@ -73,6 +75,8 @@ Provides: java-sdk, java2-sdk, java5-sdk, java6-sdk, java7-sdk, java8-sdk, java9-sdk, java10-sdk, java11-sdk, java-compiler +Conflicts: openjdk-11-jre-headless (<< 11~19-2) +Replaces: openjdk-11-jre-headless (<< 11~19-2) Description: OpenJDK Development Kit (JDK) OpenJDK is a development environment for building applications, applets, and components using the Java programming language. diff -Nru openjdk-11-11~19/debian/patches/default-jvm-cfg.diff openjdk-11-11~24/debian/patches/default-jvm-cfg.diff --- openjdk-11-11~19/debian/patches/default-jvm-cfg.diff 2018-06-14 18:53:17.000000000 +0000 +++ openjdk-11-11~24/debian/patches/default-jvm-cfg.diff 2018-07-19 18:16:03.000000000 +0000 @@ -1,8 +1,6 @@ -Index: b/src/java.base/share/native/libjli/java.c -=================================================================== --- a/src/java.base/share/native/libjli/java.c +++ b/src/java.base/share/native/libjli/java.c -@@ -2084,7 +2084,7 @@ jint +@@ -2067,7 +2067,7 @@ jint ReadKnownVMs(const char *jvmCfgName, jboolean speculative) { FILE *jvmCfg; @@ -11,7 +9,7 @@ int cnt = 0; int lineno = 0; jlong start, end; -@@ -2099,6 +2099,11 @@ ReadKnownVMs(const char *jvmCfgName, jbo +@@ -2082,6 +2082,11 @@ ReadKnownVMs(const char *jvmCfgName, jbo jvmCfg = fopen(jvmCfgName, "r"); if (jvmCfg == NULL) { diff -Nru openjdk-11-11~19/debian/patches/jdk-freetypeScaler-crash.diff openjdk-11-11~24/debian/patches/jdk-freetypeScaler-crash.diff --- openjdk-11-11~19/debian/patches/jdk-freetypeScaler-crash.diff 2018-06-08 19:17:08.000000000 +0000 +++ openjdk-11-11~24/debian/patches/jdk-freetypeScaler-crash.diff 2018-07-19 18:15:59.000000000 +0000 @@ -1,5 +1,3 @@ -Index: b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c -=================================================================== --- a/src/java.desktop/share/native/libfontmanager/freetypeScaler.c +++ b/src/java.desktop/share/native/libfontmanager/freetypeScaler.c @@ -48,16 +48,6 @@ @@ -80,7 +78,7 @@ free(scalerInfo); return 0; } -@@ -373,8 +375,10 @@ static int setupFTContext(JNIEnv *env, +@@ -386,8 +388,10 @@ static int setupFTContext(JNIEnv *env, FTScalerContext *context) { int errCode = 0; diff -Nru openjdk-11-11~19/debian/patches/jtreg-location.diff openjdk-11-11~24/debian/patches/jtreg-location.diff --- openjdk-11-11~19/debian/patches/jtreg-location.diff 2018-04-15 04:38:04.000000000 +0000 +++ openjdk-11-11~24/debian/patches/jtreg-location.diff 2018-07-19 18:16:13.000000000 +0000 @@ -1,5 +1,3 @@ -Index: b/make/autoconf/toolchain.m4 -=================================================================== --- a/make/autoconf/toolchain.m4 +++ b/make/autoconf/toolchain.m4 @@ -1052,7 +1052,7 @@ AC_DEFUN_ONCE([TOOLCHAIN_SETUP_JTREG], @@ -29,11 +27,9 @@ AC_MSG_WARN([Ignoring jtreg from path since a valid jtreg home cannot be found]) JT_HOME= JTREGEXE= -Index: b/make/RunTests.gmk -=================================================================== --- a/make/RunTests.gmk +++ b/make/RunTests.gmk -@@ -548,7 +548,7 @@ define SetupRunJtregTestBody +@@ -550,7 +550,7 @@ define SetupRunJtregTestBody $$(call MakeDir, $$($1_TEST_RESULTS_DIR) $$($1_TEST_SUPPORT_DIR)) $$(call ExecuteWithLog, $$($1_TEST_SUPPORT_DIR)/jtreg, \ $$(JAVA) $$($1_JTREG_LAUNCHER_OPTIONS) \ @@ -42,8 +38,6 @@ $$($1_JTREG_BASIC_OPTIONS) \ -testjdk:$$(JDK_IMAGE_DIR) \ -dir:$$(JTREG_TOPDIR) \ -Index: b/make/test/BuildFailureHandler.gmk -=================================================================== --- a/make/test/BuildFailureHandler.gmk +++ b/make/test/BuildFailureHandler.gmk @@ -39,7 +39,7 @@ FH_BASEDIR := $(TOPDIR)/test/failure_han diff -Nru openjdk-11-11~19/debian/patches/m68k-support.diff openjdk-11-11~24/debian/patches/m68k-support.diff --- openjdk-11-11~19/debian/patches/m68k-support.diff 2018-03-14 17:12:43.000000000 +0000 +++ openjdk-11-11~24/debian/patches/m68k-support.diff 2018-07-26 07:29:02.000000000 +0000 @@ -1,14 +1,14 @@ # HG changeset patch -# User John Paul Adrian Glaubitz -# Date 1512049131 -3600 -# Thu Nov 30 14:38:51 2017 +0100 -# Node ID 51758c6896cf6d4722754f1c11adf668f894b9f1 -# Parent c54d8eb70311ed092fe85ba3456e77f82f589862 +# User glaubitz +# Date 1532184301 -7200 +# Sat Jul 21 16:45:01 2018 +0200 +# Node ID 418a697aef91a730b942129d5d41b6c68a871cd8 +# Parent b0fcf59be3918afcaa13d1f97343968c2c467ffe JDK-NNNNNNN: Zero needs alignment fixes for linux-m68k -diff -r c54d8eb70311 -r 51758c6896cf make/data/x11wrappergen/sizes.32-linux-m68k +diff -r b0fcf59be391 -r 418a697aef91 make/data/x11wrappergen/sizes-32-linux-m68k.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 -+++ b/make/data/x11wrappergen/sizes.32-linux-m68k Thu Nov 30 14:38:51 2017 +0100 ++++ b/make/data/x11wrappergen/sizes-32-linux-m68k.txt Sat Jul 21 16:45:01 2018 +0200 @@ -0,0 +1,1017 @@ +long 4 +int 4 @@ -1027,58 +1027,56 @@ +XTextProperty.format 8 +XTextProperty.nitems 12 +XTextProperty 16 -diff -r c54d8eb70311 -r 51758c6896cf make/gensrc/GensrcX11Wrappers.gmk ---- a/make/gensrc/GensrcX11Wrappers.gmk Wed Nov 29 23:23:34 2017 +0100 -+++ b/make/gensrc/GensrcX11Wrappers.gmk Thu Nov 30 14:38:51 2017 +0100 -@@ -57,12 +57,16 @@ - GENSRC_X11_VERSION := 32 64 - endif - endif +diff -r b0fcf59be391 -r 418a697aef91 make/gensrc/GensrcX11Wrappers.gmk +--- a/make/gensrc/GensrcX11Wrappers.gmk Fri Jul 20 14:48:41 2018 -0700 ++++ b/make/gensrc/GensrcX11Wrappers.gmk Sat Jul 21 16:45:01 2018 +0200 +@@ -33,9 +33,14 @@ + # Put the generated Java classes used to interface X11 from awt here. + GENSRC_X11WRAPPERS_OUTPUTDIR := $(GENSRC_X11WRAPPERS_OUTPUT_TOP)/sun/awt/X11 + +GENSRC_X11_VERSION_VARIANT := +ifeq ($(OPENJDK_TARGET_OS)-$(OPENJDK_TARGET_CPU), linux-m68k) + GENSRC_X11_VERSION_VARIANT := -linux-m68k +endif ++ + # The pre-calculated offset file are stored here: + GENSRC_X11WRAPPERS_DATADIR := $(TOPDIR)/make/data/x11wrappergen +-GENSRC_X11WRAPPERS_DATA := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(OPENJDK_TARGET_CPU_BITS).txt ++GENSRC_X11WRAPPERS_DATA := $(GENSRC_X11WRAPPERS_DATADIR)/sizes-$(OPENJDK_TARGET_CPU_BITS)$(GENSRC_X11_VERSION_VARIANT).txt - GENSRC_X11_SIZES_USED := $(addprefix $(GENSRC_X11WRAPPERS_TMP)/sizes., $(GENSRC_X11_VERSION)) + # Run the tool on the offset files to generate several Java classes used in awt. + $(GENSRC_X11WRAPPERS_MARKER): $(BUILD_TOOLS_JDK) $(GENSRC_X11WRAPPERS_DATA) \ +diff -r b0fcf59be391 -r 418a697aef91 src/hotspot/share/memory/allocation.hpp +--- a/src/hotspot/share/memory/allocation.hpp Fri Jul 20 14:48:41 2018 -0700 ++++ b/src/hotspot/share/memory/allocation.hpp Sat Jul 21 16:45:01 2018 +0200 +@@ -209,7 +209,7 @@ - # Copy only the sizes.* files that are actually needed. WrapperGenerator picks up any it finds from the - # file prefix it is given so those not needed need to be hidden. --$(GENSRC_X11WRAPPERS_TMP)/sizes.%: $(GENSRC_SIZER_DIR)/sizes.% -+$(GENSRC_X11WRAPPERS_TMP)/sizes.%: $(GENSRC_SIZER_DIR)/sizes.%$(GENSRC_X11_VERSION_VARIANT) - $(call MakeDir, $(@D)) - $(RM) '$@' - $(SORT) $< > $@ -diff -r c54d8eb70311 -r 51758c6896cf src/hotspot/share/memory/allocation.hpp ---- a/src/hotspot/share/memory/allocation.hpp Wed Nov 29 23:23:34 2017 +0100 -+++ b/src/hotspot/share/memory/allocation.hpp Thu Nov 30 14:38:51 2017 +0100 -@@ -172,7 +172,7 @@ - throw(); - void operator delete(void* p); - void operator delete [] (void* p); + void operator delete(void* p) { FreeHeap(p); } + void operator delete [] (void* p) { FreeHeap(p); } -}; +} __attribute__ ((aligned (4))); // Base class for objects allocated on the stack only. // Calling new or delete will result in fatal error. -@@ -186,7 +186,7 @@ +@@ -223,7 +223,7 @@ #endif void operator delete(void* p); void operator delete [](void* p); -}; +} __attribute__ ((aligned (4))); - // Base class for objects used as value objects. - // Calling new or delete will result in fatal error. -@@ -212,7 +212,7 @@ - void operator delete(void* p); - void* operator new [](size_t size) throw(); - void operator delete [](void* p); + // Base class for objects stored in Metaspace. + // Calling delete will result in fatal error. +@@ -311,7 +311,7 @@ + // that should be read-only by default. See symbol.hpp for an example. This function + // is used by the templates in metaspaceClosure.hpp + static bool is_read_only_by_default() { return false; } -}; +} __attribute__ ((aligned (4))); + // Base class for classes that constitute name spaces. - // Base class for objects stored in Metaspace. -@@ -377,7 +377,7 @@ +@@ -401,7 +401,7 @@ void operator delete(void* p); void operator delete [](void* p); @@ -1087,9 +1085,9 @@ // One of the following macros must be used when allocating an array // or object to determine whether it should reside in the C heap on in -diff -r c54d8eb70311 -r 51758c6896cf src/hotspot/share/oops/constMethod.hpp ---- a/src/hotspot/share/oops/constMethod.hpp Wed Nov 29 23:23:34 2017 +0100 -+++ b/src/hotspot/share/oops/constMethod.hpp Thu Nov 30 14:38:51 2017 +0100 +diff -r b0fcf59be391 -r 418a697aef91 src/hotspot/share/oops/constMethod.hpp +--- a/src/hotspot/share/oops/constMethod.hpp Fri Jul 20 14:48:41 2018 -0700 ++++ b/src/hotspot/share/oops/constMethod.hpp Sat Jul 21 16:45:01 2018 +0200 @@ -559,6 +559,6 @@ // Verify @@ -1098,20 +1096,20 @@ +} __attribute__ ((aligned (4))); #endif // SHARE_VM_OOPS_CONSTMETHODOOP_HPP -diff -r c54d8eb70311 -r 51758c6896cf src/hotspot/share/oops/oop.hpp ---- a/src/hotspot/share/oops/oop.hpp Wed Nov 29 23:23:34 2017 +0100 -+++ b/src/hotspot/share/oops/oop.hpp Thu Nov 30 14:38:51 2017 +0100 -@@ -369,6 +369,6 @@ +diff -r b0fcf59be391 -r 418a697aef91 src/hotspot/share/oops/oop.hpp +--- a/src/hotspot/share/oops/oop.hpp Fri Jul 20 14:48:41 2018 -0700 ++++ b/src/hotspot/share/oops/oop.hpp Sat Jul 21 16:45:01 2018 +0200 +@@ -331,6 +331,6 @@ + assert(has_klass_gap(), "only applicable to compressed klass pointers"); + return klass_offset_in_bytes() + sizeof(narrowKlass); } - - static bool is_archive_object(oop p) NOT_CDS_JAVA_HEAP_RETURN_(false); -}; +} __attribute__ ((aligned (4))); #endif // SHARE_VM_OOPS_OOP_HPP -diff -r c54d8eb70311 -r 51758c6896cf src/java.base/unix/native/libjli/java_md_solinux.c ---- a/src/java.base/unix/native/libjli/java_md_solinux.c Wed Nov 29 23:23:34 2017 +0100 -+++ b/src/java.base/unix/native/libjli/java_md_solinux.c Thu Nov 30 14:38:51 2017 +0100 +diff -r b0fcf59be391 -r 418a697aef91 src/java.base/unix/native/libjli/java_md_solinux.c +--- a/src/java.base/unix/native/libjli/java_md_solinux.c Fri Jul 20 14:48:41 2018 -0700 ++++ b/src/java.base/unix/native/libjli/java_md_solinux.c Sat Jul 21 16:45:01 2018 +0200 @@ -727,12 +727,24 @@ } } diff -Nru openjdk-11-11~19/debian/patches/mips-sigset.diff openjdk-11-11~24/debian/patches/mips-sigset.diff --- openjdk-11-11~19/debian/patches/mips-sigset.diff 2018-06-14 18:54:50.000000000 +0000 +++ openjdk-11-11~24/debian/patches/mips-sigset.diff 2018-07-19 18:16:21.000000000 +0000 @@ -1,8 +1,6 @@ -Index: b/src/hotspot/os/linux/os_linux.cpp -=================================================================== --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp -@@ -4485,14 +4485,16 @@ bool os::Linux::signal_handlers_are_inst +@@ -4487,14 +4487,16 @@ bool os::Linux::signal_handlers_are_inst // For signal-chaining struct sigaction sigact[NSIG]; @@ -23,7 +21,7 @@ struct sigaction* os::Linux::get_chained_signal_action(int sig) { struct sigaction *actp = NULL; -@@ -4567,7 +4569,7 @@ bool os::Linux::chained_handler(int sig, +@@ -4569,7 +4571,7 @@ bool os::Linux::chained_handler(int sig, } struct sigaction* os::Linux::get_preinstalled_handler(int sig) { @@ -32,7 +30,7 @@ return &sigact[sig]; } return NULL; -@@ -4576,7 +4578,7 @@ struct sigaction* os::Linux::get_preinst +@@ -4578,7 +4580,7 @@ struct sigaction* os::Linux::get_preinst void os::Linux::save_preinstalled_handler(int sig, struct sigaction& oldAct) { assert(sig > 0 && sig < NSIG, "vm signal out of expected range"); sigact[sig] = oldAct; diff -Nru openjdk-11-11~19/debian/patches/parallel-build-fix.diff openjdk-11-11~24/debian/patches/parallel-build-fix.diff --- openjdk-11-11~19/debian/patches/parallel-build-fix.diff 2018-06-19 04:17:14.000000000 +0000 +++ openjdk-11-11~24/debian/patches/parallel-build-fix.diff 2018-07-19 18:15:36.000000000 +0000 @@ -2,15 +2,6 @@ =================================================================== --- a/make/hotspot/gensrc/GensrcJfr.gmk +++ b/make/hotspot/gensrc/GensrcJfr.gmk -@@ -27,7 +27,7 @@ - # Build tools needed for the JFR source code generation - - JFR_TOOLS_SRCDIR := $(TOPDIR)/make/src/classes --JFR_TOOLS_OUTPUTDIR := $(OUTPUTDIR)/buildtools/tools_classes -+JFR_TOOLS_OUTPUTDIR := $(JVM_VARIANT_OUTPUTDIR)/tools/jfr - - $(eval $(call SetupJavaCompiler, GENERATE_JFRBYTECODE, \ - JAVAC := $(JAVAC), \ @@ -41,6 +41,7 @@ $(eval $(call SetupJavaCompilation, BUIL SETUP := GENERATE_JFRBYTECODE, \ SRC := $(JFR_TOOLS_SRCDIR), \ diff -Nru openjdk-11-11~19/debian/patches/s390x-zEC12.diff openjdk-11-11~24/debian/patches/s390x-zEC12.diff --- openjdk-11-11~19/debian/patches/s390x-zEC12.diff 2018-06-08 19:17:18.000000000 +0000 +++ openjdk-11-11~24/debian/patches/s390x-zEC12.diff 2018-07-19 18:16:10.000000000 +0000 @@ -1,8 +1,6 @@ -Index: b/make/autoconf/flags-cflags.m4 -=================================================================== --- a/make/autoconf/flags-cflags.m4 +++ b/make/autoconf/flags-cflags.m4 -@@ -715,6 +715,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], +@@ -720,6 +720,9 @@ AC_DEFUN([FLAGS_SETUP_CFLAGS_CPU_DEP], fi elif test "x$FLAGS_CPU" = xs390x; then $1_CFLAGS_CPU="-mbackchain -march=z10" diff -Nru openjdk-11-11~19/debian/patches/series openjdk-11-11~24/debian/patches/series --- openjdk-11-11~19/debian/patches/series 2018-06-22 09:04:07.000000000 +0000 +++ openjdk-11-11~24/debian/patches/series 2018-07-22 09:37:03.000000000 +0000 @@ -31,3 +31,4 @@ hotspot-libpath.diff generated-headers.patch parallel-build-fix.diff +m68k-support.diff diff -Nru openjdk-11-11~19/debian/patches/system-pcsclite.diff openjdk-11-11~24/debian/patches/system-pcsclite.diff --- openjdk-11-11~19/debian/patches/system-pcsclite.diff 2018-06-14 18:53:06.000000000 +0000 +++ openjdk-11-11~24/debian/patches/system-pcsclite.diff 2018-07-19 18:15:51.000000000 +0000 @@ -1,5 +1,3 @@ -Index: b/make/autoconf/lib-bundled.m4 -=================================================================== --- a/make/autoconf/lib-bundled.m4 +++ b/make/autoconf/lib-bundled.m4 @@ -37,6 +37,7 @@ AC_DEFUN_ONCE([LIB_SETUP_BUNDLED_LIBS], @@ -52,11 +50,9 @@ + + AC_SUBST(USE_EXTERNAL_PCSCLITE) +]) -Index: b/make/autoconf/spec.gmk.in -=================================================================== --- a/make/autoconf/spec.gmk.in +++ b/make/autoconf/spec.gmk.in -@@ -730,6 +730,7 @@ ENABLE_AOT:=@ENABLE_AOT@ +@@ -734,6 +734,7 @@ ENABLE_AOT:=@ENABLE_AOT@ ENABLE_INTREE_EC:=@ENABLE_INTREE_EC@ USE_EXTERNAL_LIBJPEG:=@USE_EXTERNAL_LIBJPEG@ USE_EXTERNAL_LIBGIF:=@USE_EXTERNAL_LIBGIF@ @@ -64,8 +60,6 @@ USE_EXTERNAL_LIBZ:=@USE_EXTERNAL_LIBZ@ LIBZ_CFLAGS:=@LIBZ_CFLAGS@ LIBZ_LIBS:=@LIBZ_LIBS@ -Index: b/make/lib/Lib-java.smartcardio.gmk -=================================================================== --- a/make/lib/Lib-java.smartcardio.gmk +++ b/make/lib/Lib-java.smartcardio.gmk @@ -30,12 +30,12 @@ include LibCommon.gmk @@ -84,8 +78,6 @@ LIBS_windows := winscard.lib, \ )) -Index: b/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.c -=================================================================== --- a/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.c +++ b/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.c @@ -36,6 +36,7 @@ @@ -132,8 +124,6 @@ #endif // __APPLE__ +#endif } -Index: b/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.h -=================================================================== --- a/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.h +++ b/src/java.smartcardio/unix/native/libj2pcsc/pcsc_md.h @@ -23,6 +23,8 @@ diff -Nru openjdk-11-11~19/debian/patches/workaround_expand_exec_shield_cs_limit.diff openjdk-11-11~24/debian/patches/workaround_expand_exec_shield_cs_limit.diff --- openjdk-11-11~19/debian/patches/workaround_expand_exec_shield_cs_limit.diff 2018-06-14 18:53:20.000000000 +0000 +++ openjdk-11-11~24/debian/patches/workaround_expand_exec_shield_cs_limit.diff 2018-07-19 18:16:06.000000000 +0000 @@ -1,5 +1,3 @@ -Index: b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp -=================================================================== --- a/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp +++ b/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp @@ -841,7 +841,7 @@ void os::verify_stack_alignment() { @@ -11,11 +9,9 @@ size_t page_size = os::vm_page_size(); /* -Index: b/src/hotspot/os/linux/os_linux.cpp -=================================================================== --- a/src/hotspot/os/linux/os_linux.cpp +++ b/src/hotspot/os/linux/os_linux.cpp -@@ -5034,7 +5034,7 @@ jint os::init_2(void) { +@@ -5036,7 +5036,7 @@ jint os::init_2(void) { Linux::capture_initial_stack(JavaThread::stack_size_at_create()); } diff -Nru openjdk-11-11~19/debian/rules openjdk-11-11~24/debian/rules --- openjdk-11-11~19/debian/rules 2018-06-22 13:47:06.000000000 +0000 +++ openjdk-11-11~24/debian/rules 2018-07-27 03:21:54.000000000 +0000 @@ -248,10 +248,12 @@ # FIXME: still hotspot core dumps with GCC 6 export CC = $(DEB_HOST_GNU_TYPE)-gcc-6 export CXX = $(DEB_HOST_GNU_TYPE)-g++-6 -else - # FIXME: still hotspot core dumps with GCC 7 +else ifneq (,$(filter $(distrel),artful bionic)) export CC = $(DEB_HOST_GNU_TYPE)-gcc-7 export CXX = $(DEB_HOST_GNU_TYPE)-g++-7 +else + export CC = $(DEB_HOST_GNU_TYPE)-gcc-8 + export CXX = $(DEB_HOST_GNU_TYPE)-g++-8 endif with_pulse = yes @@ -322,15 +324,6 @@ EXTRA_BUILD_ENV += LIBFFI_LIBS=-lffi_pic -# http://mail.openjdk.java.net/pipermail/distro-pkg-dev/2014-March/026450.html -# plus needs explicit --disable-debug-symbols -EXTRA_BUILD_ENV += \ - DEBUG_BINARIES=true \ - FULL_DEBUG_SYMBOLS=0 \ - ZIP_DEBUGINFO_FILES=0 \ - STRIP_POLICY=none \ - POST_STRIP_CMD=true - ifeq ($(with_pulse),yes) CONFIGURE_ARGS += --enable-pulse-java endif @@ -396,6 +389,7 @@ COMMON_CONFIGURE_ARGS += \ --with-debug-level=release \ + --with-native-debug-symbols=internal \ --enable-unlimited-crypto \ --with-zlib=system \ --with-giflib=system \ @@ -455,21 +449,25 @@ # (most) jre and jdk tools handled by the alternatives system. # dups in heimdal-clients, krb5-user: kinit, klist, ktab, no alternatives -# use javaws from icedtea-next # have jrunscript in the jdk packages -all_jre_tools = $(filter-out jrunscript, $(notdir $(wildcard $(builddir)/$(sdkimg)/bin/*))) -# no tools in $(p_jre) -jre_tools = -jre_hl_tools := $(filter-out $(jre_tools), $(all_jre_tools)) -jre_hl_tools_alt= $(jre_hl_tools) -jre_tools_alt = $(jre_tools) +all_tools = $(notdir $(wildcard $(builddir)/$(sdkimg)/bin/*)) -all_jdk_tools = $(notdir $(wildcard build/$(sdkimg)/bin/*)) +jdk_hl_tools = jar jarsigner javac javadoc javap jcmd jdb \ + jdeprscan jdeps jimage jinfo jlink jmap jmod jps \ + jrunscript jshell jstack jstat jstatd rmic serialver +ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64)) + jdk_hl_tools += jaotc +endif +ifeq (,$(filter $(DEB_HOST_ARCH), armel ia64 m68k mips mipsel mips64el powerpc s390x x32)) + jdk_hl_tools += jhsdb +endif jdk_tools = jconsole -jdk_tools_alt = $(jdk_tools) -jdk_hl_tools = $(filter-out $(all_jre_tools) $(jdk_tools), $(all_jdk_tools)) -jdk_hl_tools_alt= $(jdk_hl_tools) + +all_jre_tools = $(filter-out $(jdk_hl_tools) $(jdk_tools), $(all_tools)) +# no tools in $(p_jre) +jre_tools = +jre_hl_tools := $(filter-out $(jre_tools), $(all_jre_tools)) # build dependencies bd_autotools = autoconf, automake, autotools-dev, @@ -489,8 +487,10 @@ bd_gcc = g++-5 [$(hotspot_archs)], g++-4.9 [$(strip $(foreach a,$(hotspot_archs), !$(a)))], g++-4.9 [arm64], else ifneq (,$(filter $(distrel),stretch)) bd_gcc = g++-6, -else +else ifneq (,$(filter $(distrel),artful bionic)) bd_gcc = g++-7, +else + bd_gcc = g++-8, endif bd_syslibs = zlib1g-dev, libattr1-dev, ifneq (,$(filter $(distrel),squeeze lucid)) @@ -506,7 +506,7 @@ libxtst-dev, libxi-dev, libxt-dev, libxaw7-dev, libxrender-dev, libcups2-dev, \ libasound2-dev, liblcms2-dev, libfreetype6-dev (>= 2.2.1), \ libxinerama-dev, libkrb5-dev, xsltproc, libpcsclite-dev, libgtk-3-dev, \ - libelf-dev, + libelf-dev, libfontconfig1-dev, pkg_ffidev = libffi-dev @@ -539,11 +539,12 @@ libcups2, liblcms2-2, ifneq (,$(filter $(distrel),squeeze lucid)) dlopen_hl_depends += libjpeg62, -else ifneq (,$(filter $(distrel), jessie stretch sid)) +else ifneq (,$(filter $(distrel), jessie stretch buster sid)) dlopen_hl_depends += libjpeg62-turbo, else dlopen_hl_depends += libjpeg8, endif +dlopen_hl_depends += libfontconfig1, ifneq ($(with_nss),no) ifneq (,$(filter $(distrel),squeeze lucid precise)) dlopen_hl_depends += , libnss3-1d (>= 3.12.3) @@ -703,10 +704,10 @@ -e 's/@priority@/$(priority)/g' \ -e 's/@mantag@/$(mantag)/g' \ -e 's/@multiarch@/$(DEB_HOST_MULTIARCH)/g' \ - -e 's/@jre_hl_tools@/$(jre_hl_tools_alt)/g' \ - -e 's/@jre_tools@/$(jre_tools_alt)/g' \ - -e 's/@jdk_hl_tools@/$(jdk_hl_tools_alt)/g' \ - -e 's/@jdk_tools@/$(jdk_tools_alt)/g' \ + -e 's/@jre_hl_tools@/$(jre_hl_tools)/g' \ + -e 's/@jre_tools@/$(jre_tools)/g' \ + -e 's/@jdk_hl_tools@/$(jdk_hl_tools)/g' \ + -e 's/@jdk_tools@/$(jdk_tools)/g' \ -e 's/@corba_tools@/$(corba_tools)/g' \ -e 's,@j2se_lib@,$(j2se_lib),g' \ -e 's,@j2se_share@,$(j2se_share),g' \ @@ -1248,7 +1249,8 @@ $$([ -f $(d)/$(basedir)/conf/security/nss.cfg ] && echo conf/security/nss.cfg) \ $(if $(findstring ca-cert,$(pkg_certs)),,lib/security/cacerts) \ lib/security/default.policy \ - lib/security/blacklisted.certs; \ + lib/security/blacklisted.certs \ + lib/security/public_suffix_list.dat; \ do \ dest=$$(echo $$i | sed 's,^[^/]*/,,'); \ mv $(d)/$(basedir)/$$i $(d)/$(etcdir)/$$dest; \ @@ -1581,27 +1583,27 @@ >> $(d_jrehl).links endif - @echo JRE_HL_TOOLS: $(jre_hl_tools_alt) jexec - @echo JRE_TOOLS: $(jre_tools_alt) - @echo JDK_HL_TOOLS: $(jdk_hl_tools_alt) - @echo JDK_TOOLS: $(jdk_tools_alt) + @echo JRE_HL_TOOLS: $(jre_hl_tools) jexec + @echo JRE_TOOLS: $(jre_tools) + @echo JDK_HL_TOOLS: $(jdk_hl_tools) + @echo JDK_TOOLS: $(jdk_tools) ( \ echo 'name=$(jdirname)'; \ echo 'alias=$(jdiralias)'; \ echo 'priority=$(priority)'; \ echo 'section=main'; \ echo ''; \ - for i in $(jre_hl_tools_alt); do \ + for i in $(jre_hl_tools); do \ echo "hl $$i /$(basedir)/bin/$$i"; \ done; \ echo "hl jexec /$(basedir)/lib/jexec"; \ - for i in $(jre_tools_alt); do \ + for i in $(jre_tools); do \ echo "jre $$i /$(basedir)/bin/$$i"; \ done; \ - for i in $(jdk_hl_tools_alt); do \ + for i in $(jdk_hl_tools); do \ echo "jdkhl $$i /$(basedir)/bin/$$i"; \ done; \ - for i in $(jdk_tools_alt); do \ + for i in $(jdk_tools); do \ echo "jdk $$i /$(basedir)/bin/$$i"; \ done; \ ) > $(d_jrehl)/$(TOP)/.$(jdiralias).jinfo @@ -1748,8 +1750,8 @@ dh_builddeb -a $(nodemo) $(nojrez) #$(bd_options) #is_release = yes -hg_project = jdk -hg_tag = jdk-11+19 +hg_project = jdk11 +hg_tag = jdk-11+24 package_version = $(subst jdk-,,$(hg_tag)) ifneq ($(is_release),yes) package_version := $(subst +,~,$(package_version)) diff -Nru openjdk-11-11~19/doc/building.html openjdk-11-11~24/doc/building.html --- openjdk-11-11~19/doc/building.html 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/doc/building.html 2018-07-25 15:36:46.000000000 +0000 @@ -4,7 +4,7 @@ - Building OpenJDK + Building the JDK - - - - - Java(tm) Plug-in Demo Page - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - -
JAVA™ PLUG-IN   -
Demonstration Applets  -
Java -Plug-in home page | FAQ -| Documentation   -
-  - - - - -
- - - - - - -
- - - - - - - - - - - -
-
-
- - - - - - - - - - - - - - - - - - -
- -

The examples on this page provide demonstration applets for -the purpose of demonstrating and evaluating Java Plug-in. Hence, the HTML -of each page explicitly specifies the use of the JavaTMPlug-in -rather than the default Java virtual machine contained in your browser.  - -

Java Plug-in is installed as part of the public JavaTM SE Runtime Environment. -Once installed, the Java Plug-in loads automatically -and transparently to render Java applets.  - -

All of these applets leverage JavaTM SE Development Kit MKTG_VERSION features, and are thus dependent -on features in that version.  For information on compatibility, see Compatibility -with Previous Releases.   The applets include those in the demo -directory of the Java SE Development Kit, plus a few extras.  Each applet is viewed -by opening the respective web page (see the links below) in your -Web browser.  - -

-Educational Applets

- - - -

-Utilities

- - - -

-For Programmers Only

- - - -

-Applets to Enhance a Web Page

- - - -

-JFC Applets

- - -
-
- - - diff -Nru openjdk-11-11~19/src/demo/share/jfc/Stylepad/HelloWorld.java openjdk-11-11~24/src/demo/share/jfc/Stylepad/HelloWorld.java --- openjdk-11-11~19/src/demo/share/jfc/Stylepad/HelloWorld.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/Stylepad/HelloWorld.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,208 @@ +/* + * + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +import java.awt.Color; +import java.util.HashMap; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.text.BadLocationException; +import javax.swing.text.DefaultStyledDocument; +import javax.swing.text.Style; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyleContext; + + +/** + * hack to load attributed content. + */ +public class HelloWorld { + + HelloWorld(DefaultStyledDocument doc, StyleContext styles) { + this.doc = doc; + this.styles = styles; + runAttr = new HashMap(); + } + + void loadDocument() { + createStyles(); + for (int i = 0; i < data.length; i++) { + Paragraph p = data[i]; + addParagraph(p); + } + } + + void addParagraph(Paragraph p) { + try { + Style s = null; + for (int i = 0; i < p.data.length; i++) { + Run run = p.data[i]; + s = runAttr.get(run.attr); + doc.insertString(doc.getLength(), run.content, s); + } + + // set logical style + Style ls = styles.getStyle(p.logical); + doc.setLogicalStyle(doc.getLength() - 1, ls); + doc.insertString(doc.getLength(), "\n", null); + } catch (BadLocationException e) { + System.err.println("Internal error: " + e); + } + } + + void createStyles() { + // no attributes defined + Style s = styles.addStyle(null, null); + runAttr.put("none", s); + s = styles.addStyle(null, null); + StyleConstants.setItalic(s, true); + StyleConstants.setForeground(s, new Color(153, 153, 102)); + runAttr.put("cquote", s); // catepillar quote + + s = styles.addStyle(null, null); + StyleConstants.setItalic(s, true); + StyleConstants.setForeground(s, new Color(51, 102, 153)); + runAttr.put("aquote", s); // alice quote + + try { + ResourceBundle resources = ResourceBundle.getBundle( + "resources.Stylepad", + Locale.getDefault()); + s = styles.addStyle(null, null); + Icon alice = new ImageIcon(resources.getString("aliceGif")); + StyleConstants.setIcon(s, alice); + runAttr.put("alice", s); // alice + + s = styles.addStyle(null, null); + Icon caterpillar = new ImageIcon(resources.getString( + "caterpillarGif")); + StyleConstants.setIcon(s, caterpillar); + runAttr.put("caterpillar", s); // caterpillar + + s = styles.addStyle(null, null); + Icon hatter = new ImageIcon(resources.getString("hatterGif")); + StyleConstants.setIcon(s, hatter); + runAttr.put("hatter", s); // hatter + + + } catch (MissingResourceException mre) { + // can't display image + } + + Style def = styles.getStyle(StyleContext.DEFAULT_STYLE); + + Style heading = styles.addStyle("heading", def); + //StyleConstants.setFontFamily(heading, "SansSerif"); + StyleConstants.setBold(heading, true); + StyleConstants.setAlignment(heading, StyleConstants.ALIGN_CENTER); + StyleConstants.setSpaceAbove(heading, 10); + StyleConstants.setSpaceBelow(heading, 10); + StyleConstants.setFontSize(heading, 18); + + // Title + Style sty = styles.addStyle("title", heading); + StyleConstants.setFontSize(sty, 32); + + // edition + sty = styles.addStyle("edition", heading); + StyleConstants.setFontSize(sty, 16); + + // author + sty = styles.addStyle("author", heading); + StyleConstants.setItalic(sty, true); + StyleConstants.setSpaceBelow(sty, 25); + + // subtitle + sty = styles.addStyle("subtitle", heading); + StyleConstants.setSpaceBelow(sty, 35); + + // normal + sty = styles.addStyle("normal", def); + StyleConstants.setLeftIndent(sty, 10); + StyleConstants.setRightIndent(sty, 10); + //StyleConstants.setFontFamily(sty, "SansSerif"); + StyleConstants.setFontSize(sty, 14); + StyleConstants.setSpaceAbove(sty, 4); + StyleConstants.setSpaceBelow(sty, 4); + } + DefaultStyledDocument doc; + StyleContext styles; + HashMap runAttr; + + + static class Paragraph { + + Paragraph(String logical, Run[] data) { + this.logical = logical; + this.data = data; + } + String logical; + Run[] data; + } + + + static class Run { + + Run(String attr, String content) { + this.attr = attr; + this.content = content; + } + String attr; + String content; + } + Paragraph[] data = new Paragraph[] { + new Paragraph("title", new Run[] { + new Run("none", "Hello from Cupertino") + }), + new Paragraph("title", new Run[] { + new Run("none", "\u53F0\u5317\u554F\u5019\u60A8\u0021") + }), + new Paragraph("title", new Run[] { + new Run("none", "\u0391\u03B8\u03B7\u03BD\u03B1\u03B9\u0020" // Greek + + "\u03B1\u03C3\u03C0\u03B1\u03B6\u03BF\u03BD" + + "\u03C4\u03B1\u03B9\u0020\u03C5\u03BC\u03B1" + + "\u03C2\u0021") + }), + new Paragraph("title", new Run[] { + new Run("none", "\u6771\u4eac\u304b\u3089\u4eca\u65e5\u306f") + }), + new Paragraph("title", new Run[] { + new Run("none", "\u05e9\u05dc\u05d5\u05dd \u05de\u05d9\u05e8\u05d5" + + "\u05e9\u05dc\u05d9\u05dd") + }), + new Paragraph("title", new Run[] { + new Run("none", "\u0633\u0644\u0627\u0645") + }), }; +} diff -Nru openjdk-11-11~19/src/demo/share/jfc/Stylepad/README.txt openjdk-11-11~24/src/demo/share/jfc/Stylepad/README.txt --- openjdk-11-11~19/src/demo/share/jfc/Stylepad/README.txt 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/Stylepad/README.txt 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,11 @@ + +To run the Stylepad demo: + + java -jar Stylepad.jar + +These instructions assume that this installation's version of the java +command is in your path. If it isn't, then you should either +specify the complete path to the java command or update your +PATH environment variable as described in the installation +instructions for the Java(TM) SE Development Kit. + Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/alice.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/alice.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/bold.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/bold.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/bullets.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/bullets.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/caterpillar.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/caterpillar.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/center.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/center.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/fg.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/fg.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/hatter.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/hatter.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/italic.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/italic.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/left.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/left.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/rabbit2.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/rabbit2.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/rabbit.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/rabbit.gif differ Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/right.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/right.gif differ diff -Nru openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/Stylepad_ja.properties openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/Stylepad_ja.properties --- openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/Stylepad_ja.properties 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/Stylepad_ja.properties 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,58 @@ +# +# Resource strings for Stylepad example + +Title=\u30B9\u30BF\u30A4\u30EB\u30D1\u30C3\u30C9 + +# Menu labels +colorLabel=\u30AB\u30E9\u30FC +Red=\u8D64 +Green=\u7DD1 +Blue=\u9752 + +boldLabel=\u592A\u5B57 +italicLabel=\u30A4\u30BF\u30EA\u30C3\u30AF + +# font menu + +fontLabel=\u30D5\u30A9\u30F3\u30C8 +family1Label=SansSerif +family2Label=\u30E2\u30CE\u30B9\u30DA\u30FC\u30B9 +family3Label=Serif +family4Label=Lucida Sans +size1Label=10 +size2Label=12 +size3Label=18 +size4Label=24 +size5Label=48 +boldLabel=\u592A\u5B57 +italicLabel=\u30A4\u30BF\u30EA\u30C3\u30AF +underlineLabel=\u4E0B\u7DDA + +# +# debug Menu definition +# +debugLabel=\u30C7\u30D0\u30C3\u30B0 +dumpLabel=\u30E2\u30C7\u30EB\u3092System.err\u306B\u30C0\u30F3\u30D7 +showElementTreeLabel=\u8981\u7D20\u306E\u8868\u793A + + +# toolbar definition +boldImage=resources/bold.gif +boldTooltip=\u592A\u5B57 +italicImage=resources/italic.gif +italicTooltip=\u30A4\u30BF\u30EA\u30C3\u30AF +underlineImage=resources/underline.gif +underlineTooltip=\u4E0B\u7DDA +foregroundImage=resources/fg.gif +leftImage=resources/left.gif +leftTooltip=\u5DE6\u63C3\u3048 +centerImage=resources/center.gif +centerTooltip=\u4E2D\u592E\u63C3\u3048 +rightImage=resources/right.gif +rightTooltip=\u53F3\u63C3\u3048 +bulletsImage=resources/bullets.gif + +# wonderland example images +aliceGif=resources/alice.gif +caterpillarGif=resources/caterpillar.gif +hatterGif=resources/hatter.gif diff -Nru openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/Stylepad.properties openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/Stylepad.properties --- openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/Stylepad.properties 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/Stylepad.properties 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,58 @@ +# +# Resource strings for Stylepad example + +Title=Stylepad + +# Menu labels +colorLabel=Color +Red=Red +Green=Green +Blue=Blue + +boldLabel=Bold +italicLabel=Italic + +# font menu + +fontLabel=Font +family1Label=SansSerif +family2Label=Monospaced +family3Label=Serif +family4Label=Lucida Sans +size1Label=10 +size2Label=12 +size3Label=18 +size4Label=24 +size5Label=48 +boldLabel=Bold +italicLabel=Italic +underlineLabel=Underline + +# +# debug Menu definition +# +debugLabel=Debug +dumpLabel=Dump model to System.err +showElementTreeLabel=Show Elements + + +# toolbar definition +boldImage=resources/bold.gif +boldTooltip=Bold +italicImage=resources/italic.gif +italicTooltip=Italic +underlineImage=resources/underline.gif +underlineTooltip=Underline +foregroundImage=resources/fg.gif +leftImage=resources/left.gif +leftTooltip=Left Justify +centerImage=resources/center.gif +centerTooltip=Center Justify +rightImage=resources/right.gif +rightTooltip=Right Justify +bulletsImage=resources/bullets.gif + +# wonderland example images +aliceGif=resources/alice.gif +caterpillarGif=resources/caterpillar.gif +hatterGif=resources/hatter.gif diff -Nru openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/StylepadSystem.properties openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/StylepadSystem.properties --- openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/StylepadSystem.properties 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/StylepadSystem.properties 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,23 @@ +# +# Non-translatable properties for Stylepad example + +ViewportBackingStore=true + +family1Action=font-family-SansSerif +family2Action=font-family-Monospaced +family3Action=font-family-Serif +family4Action=font-family-LucidaSans +size1Action=font-size-10 +size2Action=font-size-12 +size3Action=font-size-18 +size4Action=font-size-24 +size5Action=font-size-48 +boldAction=font-bold +italicAction=font-italic +underlineAction=font-underline + +dumpAction=dump-model + +leftAction=left-justify +centerAction=center-justify +rightAction=right-justify \ No newline at end of file diff -Nru openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/Stylepad_zh_CN.properties openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/Stylepad_zh_CN.properties --- openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/Stylepad_zh_CN.properties 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/Stylepad_zh_CN.properties 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,58 @@ +# +# Resource strings for Stylepad example + +Title=StylePad + +# Menu labels +colorLabel=\u989C\u8272 +Red=\u7EA2\u8272 +Green=\u7EFF\u8272 +Blue=\u84DD\u8272 + +boldLabel=\u7C97\u4F53 +italicLabel=\u659C\u4F53 + +# font menu + +fontLabel=\u5B57\u4F53 +family1Label=SansSerif +family2Label=Monospaced +family3Label=Serif +family4Label=Lucida Sans +size1Label=10 +size2Label=12 +size3Label=18 +size4Label=24 +size5Label=48 +boldLabel=\u7C97\u4F53 +italicLabel=\u659C\u4F53 +underlineLabel=\u4E0B\u5212\u7EBF + +# +# debug Menu definition +# +debugLabel=\u8C03\u8BD5 +dumpLabel=\u5C06\u6A21\u578B\u8F6C\u50A8\u5230 System.err +showElementTreeLabel=\u663E\u793A\u5143\u7D20 + + +# toolbar definition +boldImage=resources/bold.gif +boldTooltip=\u7C97\u4F53 +italicImage=resources/italic.gif +italicTooltip=\u659C\u4F53 +underlineImage=resources/underline.gif +underlineTooltip=\u4E0B\u5212\u7EBF +foregroundImage=resources/fg.gif +leftImage=resources/left.gif +leftTooltip=\u5DE6\u5BF9\u9F50 +centerImage=resources/center.gif +centerTooltip=\u4E2D\u95F4\u5BF9\u9F50 +rightImage=resources/right.gif +rightTooltip=\u53F3\u5BF9\u9F50 +bulletsImage=resources/bullets.gif + +# wonderland example images +aliceGif=resources/alice.gif +caterpillarGif=resources/caterpillar.gif +hatterGif=resources/hatter.gif Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/demo/share/jfc/Stylepad/resources/underline.gif and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/demo/share/jfc/Stylepad/resources/underline.gif differ diff -Nru openjdk-11-11~19/src/demo/share/jfc/Stylepad/Stylepad.java openjdk-11-11~24/src/demo/share/jfc/Stylepad/Stylepad.java --- openjdk-11-11~19/src/demo/share/jfc/Stylepad/Stylepad.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/Stylepad/Stylepad.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,409 @@ +/* + * + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +import java.awt.BorderLayout; +import java.awt.Color; +import java.awt.Component; +import java.awt.FileDialog; +import java.awt.Frame; +import java.awt.Graphics; +import java.awt.GraphicsEnvironment; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutput; +import java.io.ObjectOutputStream; +import java.lang.reflect.InvocationTargetException; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import java.util.logging.Level; +import java.util.logging.Logger; +import javax.swing.AbstractAction; +import javax.swing.Action; +import javax.swing.Icon; +import javax.swing.JButton; +import javax.swing.JComboBox; +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JTextPane; +import javax.swing.SwingUtilities; +import javax.swing.text.DefaultStyledDocument; +import javax.swing.text.Document; +import javax.swing.text.JTextComponent; +import javax.swing.text.StyleContext; +import javax.swing.text.StyledEditorKit; +import javax.swing.text.TextAction; + + +/** + * Sample application using JTextPane. + * + * @author Timothy Prinzing + */ +@SuppressWarnings("serial") +public class Stylepad extends Notepad { + + private static ResourceBundle resources; + private FileDialog fileDialog; + + private static final String[] MENUBAR_KEYS = {"file", "edit", "color", + "font", "debug"}; + private static final String[] FONT_KEYS = {"family1", "family2", "family3", + "family4", "-", "size1", "size2", "size3", "size4", "size5", "-", + "bold", "italic", "underline"}; + private static final String[] TOOLBAR_KEYS = {"new", "open", "save", "-", + "cut", "copy", "paste", "-", "bold", "italic", "underline", "-", + "left", "center", "right"}; + + + static { + try { + properties.load(Stylepad.class.getResourceAsStream( + "resources/StylepadSystem.properties")); + resources = ResourceBundle.getBundle("resources.Stylepad"); + } catch (MissingResourceException | IOException mre) { + System.err.println("Stylepad.properties or StylepadSystem.properties not found"); + System.exit(0); + } + } + + public Stylepad() { + super(); + } + + public static void main(String[] args) { + try { + SwingUtilities.invokeAndWait(new Runnable() { + + public void run() { + JFrame frame = new JFrame(); + frame.setTitle(resources.getString("Title")); + frame.setBackground(Color.lightGray); + frame.getContentPane(). + setLayout(new BorderLayout()); + Stylepad stylepad = new Stylepad(); + frame.getContentPane().add("Center", stylepad); + frame.setJMenuBar(stylepad.createMenubar()); + frame.addWindowListener(new AppCloser()); + frame.pack(); + frame.setSize(600, 480); + frame.setVisible(true); + } + }); + } catch (InterruptedException ex) { + Logger.getLogger(Stylepad.class.getName()).log(Level.SEVERE, null, + ex); + } catch (InvocationTargetException ex) { + Logger.getLogger(Stylepad.class.getName()).log(Level.SEVERE, null, + ex); + } + } + + /** + * Fetch the list of actions supported by this + * editor. It is implemented to return the list + * of actions supported by the superclass + * augmented with the actions defined locally. + */ + @Override + public Action[] getActions() { + Action[] defaultActions = { + new NewAction(), + new OpenAction(), + new SaveAction(), + new StyledEditorKit.FontFamilyAction("font-family-SansSerif", + "SansSerif"), }; + Action[] a = TextAction.augmentList(super.getActions(), defaultActions); + return a; + } + + /** + * Try and resolve the resource name in the local + * resource file, and if not found fall back to + * the superclass resource file. + */ + @Override + protected String getResourceString(String nm) { + String str; + try { + str = Stylepad.resources.getString(nm); + } catch (MissingResourceException mre) { + str = super.getResourceString(nm); + } + return str; + } + + /** + * Create an editor to represent the given document. + */ + @Override + protected JTextComponent createEditor() { + StyleContext sc = new StyleContext(); + DefaultStyledDocument doc = new DefaultStyledDocument(sc); + initDocument(doc, sc); + JTextPane p = new JTextPane(doc); + p.setDragEnabled(true); + + //p.getCaret().setBlinkRate(0); + + return p; + } + + /** + * Create a menu for the app. This is redefined to trap + * a couple of special entries for now. + */ + @Override + protected JMenu createMenu(String key) { + if (key.equals("color")) { + return createColorMenu(); + } + return super.createMenu(key); + } + + @Override + protected String[] getItemKeys(String key) { + switch (key) { + case "font": + return FONT_KEYS; + default: + return super.getItemKeys(key); + } + } + + @Override + protected String[] getMenuBarKeys() { + return MENUBAR_KEYS; + } + + @Override + protected String[] getToolBarKeys() { + return TOOLBAR_KEYS; + } + + // this will soon be replaced + JMenu createColorMenu() { + ActionListener a; + JMenuItem mi; + JMenu menu = new JMenu(getResourceString("color" + labelSuffix)); + mi = new JMenuItem(resources.getString("Red")); + mi.setHorizontalTextPosition(JButton.RIGHT); + mi.setIcon(new ColoredSquare(Color.red)); + a = + new StyledEditorKit.ForegroundAction("set-foreground-red", + Color.red); + //a = new ColorAction(se, Color.red); + mi.addActionListener(a); + menu.add(mi); + mi = new JMenuItem(resources.getString("Green")); + mi.setHorizontalTextPosition(JButton.RIGHT); + mi.setIcon(new ColoredSquare(Color.green)); + a = new StyledEditorKit.ForegroundAction("set-foreground-green", + Color.green); + //a = new ColorAction(se, Color.green); + mi.addActionListener(a); + menu.add(mi); + mi = new JMenuItem(resources.getString("Blue")); + mi.setHorizontalTextPosition(JButton.RIGHT); + mi.setIcon(new ColoredSquare(Color.blue)); + a = new StyledEditorKit.ForegroundAction("set-foreground-blue", + Color.blue); + //a = new ColorAction(se, Color.blue); + mi.addActionListener(a); + menu.add(mi); + + return menu; + } + + void initDocument(DefaultStyledDocument doc, StyleContext sc) { + Wonderland w = new Wonderland(doc, sc); + w.loadDocument(); + } + + JComboBox createFamilyChoices() { + JComboBox b = new JComboBox(); + String[] fontNames = GraphicsEnvironment.getLocalGraphicsEnvironment(). + getAvailableFontFamilyNames(); + for (String fontName : fontNames) { + b.addItem(fontName); + } + return b; + } + + + /** + * Trys to read a file which is assumed to be a + * serialization of a document. + */ + class OpenAction extends AbstractAction { + + OpenAction() { + super(openAction); + } + + @Override + public void actionPerformed(ActionEvent e) { + Frame frame = getFrame(); + if (fileDialog == null) { + fileDialog = new FileDialog(frame); + } + fileDialog.setMode(FileDialog.LOAD); + fileDialog.setVisible(true); + + String file = fileDialog.getFile(); + if (file == null) { + return; + } + String directory = fileDialog.getDirectory(); + File f = new File(directory, file); + if (f.exists()) { + try { + FileInputStream fin = new FileInputStream(f); + ObjectInputStream istrm = new ObjectInputStream(fin); + Document doc = (Document) istrm.readObject(); + if (getEditor().getDocument() != null) { + getEditor().getDocument().removeUndoableEditListener( + undoHandler); + } + getEditor().setDocument(doc); + doc.addUndoableEditListener(undoHandler); + resetUndoManager(); + frame.setTitle(file); + validate(); + } catch (IOException io) { + // should put in status panel + System.err.println("IOException: " + io.getMessage()); + } catch (ClassNotFoundException cnf) { + // should put in status panel + System.err.println("Class not found: " + cnf.getMessage()); + } + } else { + // should put in status panel + System.err.println("No such file: " + f); + } + } + } + + + /** + * Trys to write the document as a serialization. + */ + class SaveAction extends AbstractAction { + + SaveAction() { + super(saveAction); + } + + @Override + public void actionPerformed(ActionEvent e) { + Frame frame = getFrame(); + if (fileDialog == null) { + fileDialog = new FileDialog(frame); + } + fileDialog.setMode(FileDialog.SAVE); + fileDialog.setVisible(true); + String file = fileDialog.getFile(); + if (file == null) { + return; + } + String directory = fileDialog.getDirectory(); + File f = new File(directory, file); + try { + FileOutputStream fstrm = new FileOutputStream(f); + ObjectOutput ostrm = new ObjectOutputStream(fstrm); + ostrm.writeObject(getEditor().getDocument()); + ostrm.flush(); + frame.setTitle(f.getName()); + } catch (IOException io) { + // should put in status panel + System.err.println("IOException: " + io.getMessage()); + } + } + } + + + /** + * Creates an empty document. + */ + class NewAction extends AbstractAction { + + NewAction() { + super(newAction); + } + + @Override + public void actionPerformed(ActionEvent e) { + if (getEditor().getDocument() != null) { + getEditor().getDocument().removeUndoableEditListener(undoHandler); + } + getEditor().setDocument(new DefaultStyledDocument()); + getEditor().getDocument().addUndoableEditListener(undoHandler); + resetUndoManager(); + getFrame().setTitle(resources.getString("Title")); + validate(); + } + } + + + class ColoredSquare implements Icon { + + Color color; + + public ColoredSquare(Color c) { + this.color = c; + } + + @Override + public void paintIcon(Component c, Graphics g, int x, int y) { + Color oldColor = g.getColor(); + g.setColor(color); + g.fill3DRect(x, y, getIconWidth(), getIconHeight(), true); + g.setColor(oldColor); + } + + @Override + public int getIconWidth() { + return 12; + } + + @Override + public int getIconHeight() { + return 12; + } + } +} diff -Nru openjdk-11-11~19/src/demo/share/jfc/Stylepad/Wonderland.java openjdk-11-11~24/src/demo/share/jfc/Stylepad/Wonderland.java --- openjdk-11-11~19/src/demo/share/jfc/Stylepad/Wonderland.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/Stylepad/Wonderland.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,299 @@ +/* + * + * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * - Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * - Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * - Neither the name of Oracle nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +import java.awt.Color; +import java.util.HashMap; +import java.util.Locale; +import java.util.MissingResourceException; +import java.util.ResourceBundle; +import javax.swing.Icon; +import javax.swing.ImageIcon; +import javax.swing.text.BadLocationException; +import javax.swing.text.DefaultStyledDocument; +import javax.swing.text.Style; +import javax.swing.text.StyleConstants; +import javax.swing.text.StyleContext; + + +/** + * hack to load attributed content + */ +public class Wonderland { + + Wonderland(DefaultStyledDocument doc, StyleContext styles) { + this.doc = doc; + this.styles = styles; + runAttr = new HashMap(); + } + + void loadDocument() { + createStyles(); + for (int i = 0; i < data.length; i++) { + Paragraph p = data[i]; + addParagraph(p); + } + } + + void addParagraph(Paragraph p) { + try { + Style s = null; + for (int i = 0; i < p.data.length; i++) { + Run run = p.data[i]; + s = runAttr.get(run.attr); + doc.insertString(doc.getLength(), run.content, s); + } + + // set logical style + Style ls = styles.getStyle(p.logical); + doc.setLogicalStyle(doc.getLength() - 1, ls); + doc.insertString(doc.getLength(), "\n", null); + } catch (BadLocationException e) { + System.err.println("Internal error: " + e); + } + } + + void createStyles() { + // no attributes defined + Style s = styles.addStyle(null, null); + runAttr.put("none", s); + s = styles.addStyle(null, null); + StyleConstants.setItalic(s, true); + StyleConstants.setForeground(s, new Color(153, 153, 102)); + runAttr.put("cquote", s); // catepillar quote + + s = styles.addStyle(null, null); + StyleConstants.setItalic(s, true); + StyleConstants.setForeground(s, new Color(51, 102, 153)); + runAttr.put("aquote", s); // alice quote + + try { + ResourceBundle resources = ResourceBundle.getBundle( + "resources.Stylepad", + Locale.getDefault()); + s = styles.addStyle(null, null); + Icon alice = + new ImageIcon(getClass(). + getResource(resources.getString("aliceGif"))); + StyleConstants.setIcon(s, alice); + runAttr.put("alice", s); // alice + + s = styles.addStyle(null, null); + Icon caterpillar = + new ImageIcon(getClass(). + getResource(resources.getString("caterpillarGif"))); + StyleConstants.setIcon(s, caterpillar); + runAttr.put("caterpillar", s); // caterpillar + + s = styles.addStyle(null, null); + Icon hatter = + new ImageIcon(getClass(). + getResource(resources.getString("hatterGif"))); + StyleConstants.setIcon(s, hatter); + runAttr.put("hatter", s); // hatter + + + } catch (MissingResourceException mre) { + // can't display image + } + + Style def = styles.getStyle(StyleContext.DEFAULT_STYLE); + + Style heading = styles.addStyle("heading", def); + StyleConstants.setFontFamily(heading, "SansSerif"); + StyleConstants.setBold(heading, true); + StyleConstants.setAlignment(heading, StyleConstants.ALIGN_CENTER); + StyleConstants.setSpaceAbove(heading, 10); + StyleConstants.setSpaceBelow(heading, 10); + StyleConstants.setFontSize(heading, 18); + + // Title + Style sty = styles.addStyle("title", heading); + StyleConstants.setFontSize(sty, 32); + + // edition + sty = styles.addStyle("edition", heading); + StyleConstants.setFontSize(sty, 16); + + // author + sty = styles.addStyle("author", heading); + StyleConstants.setItalic(sty, true); + StyleConstants.setSpaceBelow(sty, 25); + + // subtitle + sty = styles.addStyle("subtitle", heading); + StyleConstants.setSpaceBelow(sty, 35); + + // normal + sty = styles.addStyle("normal", def); + StyleConstants.setLeftIndent(sty, 10); + StyleConstants.setRightIndent(sty, 10); + StyleConstants.setFontFamily(sty, "SansSerif"); + StyleConstants.setFontSize(sty, 14); + StyleConstants.setSpaceAbove(sty, 4); + StyleConstants.setSpaceBelow(sty, 4); + } + DefaultStyledDocument doc; + StyleContext styles; + HashMap runAttr; + + + static class Paragraph { + + Paragraph(String logical, Run[] data) { + this.logical = logical; + this.data = data; + } + String logical; + Run[] data; + } + + + static class Run { + + Run(String attr, String content) { + this.attr = attr; + this.content = content; + } + String attr; + String content; + } + Paragraph[] data = new Paragraph[] { + new Paragraph("title", new Run[] { + new Run("none", "ALICE'S ADVENTURES IN WONDERLAND") + }), + new Paragraph("author", new Run[] { + new Run("none", "Lewis Carroll") + }), + new Paragraph("heading", new Run[] { + new Run("alice", " ") + }), + new Paragraph("edition", new Run[] { + new Run("none", "THE MILLENNIUM FULCRUM EDITION 3.0") + }), + new Paragraph("heading", new Run[] { + new Run("none", "CHAPTER V") + }), + new Paragraph("subtitle", new Run[] { + new Run("none", "Advice from a Caterpillar") + }), + new Paragraph("normal", new Run[] { + new Run("none", " "), }), + new Paragraph("normal", new Run[] { + new Run("none", + "The Caterpillar and Alice looked at each other for some time in " + + "silence: at last the Caterpillar took the hookah out " + + "of its mouth, and addressed her in a languid, sleepy " + + "voice.") + }), + new Paragraph("normal", new Run[] { + new Run("cquote", "Who are YOU? "), + new Run("none", "said the Caterpillar.") + }), + new Paragraph("normal", + new Run[] { + new Run("none", + "This was not an encouraging opening for a conversation. Alice " + + "replied, rather shyly, "), + new Run("aquote", + "I--I hardly know, sir, just at present--at least I know who I WAS " + + "when I got up this morning, but I think I must have " + + "been changed several times since then. "), }), + new Paragraph("heading", new Run[] { + new Run("caterpillar", " ") + }), + new Paragraph("normal", new Run[] { + new Run("cquote", "What do you mean by that? "), + new Run("none", " said the Caterpillar sternly. "), + new Run("cquote", "Explain yourself!"), }), + new Paragraph("normal", new Run[] { + new Run("aquote", "I can't explain MYSELF, I'm afraid, sir"), + new Run("none", " said Alice, "), + new Run("aquote", "because I'm not myself, you see."), }), + new Paragraph("normal", new Run[] { + new Run("cquote", "I don't see,"), + new Run("none", " said the Caterpillar."), }), + new Paragraph("normal", + new Run[] { + new Run("aquote", "I'm afraid I can't put it more clearly, "), + new Run("none", "Alice replied very politely, "), + new Run("aquote", + "for I can't understand it myself to begin with; and being so many " + + "different sizes in a day is very confusing."), }), + new Paragraph("normal", new Run[] { + new Run("cquote", "It isn't, "), + new Run("none", "said the Caterpillar.") + }), + new Paragraph("normal", new Run[] { + new Run("aquote", "Well, perhaps you haven't found it so yet,"), + new Run("none", " said Alice; "), + new Run("aquote", + "but when you have to turn into a chrysalis--you will some day, " + + "you know--and then after that into a butterfly, I " + + "should think you'll feel it a little queer, won't you?") + }), + new Paragraph("normal", new Run[] { + new Run("cquote", "Not a bit, "), + new Run("none", "said the Caterpillar.") + }), + new Paragraph("normal", + new Run[] { + new Run("aquote", "Well, perhaps your feelings may be different,"), + new Run("none", " said Alice; "), + new Run("aquote", "all I know is, it would feel very queer to ME."), + }), + new Paragraph("normal", new Run[] { + new Run("cquote", "You!"), + new Run("none", " said the Caterpillar contemptuously. "), + new Run("cquote", "Who are YOU?"), }), + new Paragraph("normal", new Run[] { + new Run("normal", + "Which brought them back again to the beginning of the " + + "conversation. Alice felt a little irritated at the " + + "Caterpillar's making such VERY short remarks, and she " + + "drew herself up and said, very gravely, "), + new Run("aquote", + "I think, you ought to tell me who YOU are, first."), }), + new Paragraph("normal", new Run[] { + new Run("cquote", "Why? "), + new Run("none", "said the Caterpillar."), }), + new Paragraph("heading", new Run[] { + new Run("hatter", " ") + }), + new Paragraph("normal", new Run[] { + new Run("none", " "), }), + new Paragraph("normal", new Run[] { + new Run("none", " "), }), + new Paragraph("normal", new Run[] { + new Run("none", " "), }) + }; +} diff -Nru openjdk-11-11~19/src/demo/share/jfc/SwingApplet/README.txt openjdk-11-11~24/src/demo/share/jfc/SwingApplet/README.txt --- openjdk-11-11~19/src/demo/share/jfc/SwingApplet/README.txt 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/SwingApplet/README.txt 1970-01-01 00:00:00.000000000 +0000 @@ -1,14 +0,0 @@ -SwingApplet illustrates how it's possible to run a Swing-based -applet, as long as the Swing classes are in the browser's class -path. In the Java 2 platform, Standard Edition, the Swing classes -are core, and thus are always in the class path. For example, -you can run SwingApplet with this command: - - appletviewer SwingApplet.html - -These instructions assume that this installation's version of appletviewer -command is in your path. If it isn't, then you should either -specify the complete path to the appletviewer command or update -your PATH environment variable as described in the installation -instructions for the Java(TM) SE Development Kit. - diff -Nru openjdk-11-11~19/src/demo/share/jfc/SwingApplet/SwingApplet.html openjdk-11-11~24/src/demo/share/jfc/SwingApplet/SwingApplet.html --- openjdk-11-11~19/src/demo/share/jfc/SwingApplet/SwingApplet.html 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/SwingApplet/SwingApplet.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,7 +0,0 @@ - - -Swing Applet - - - - diff -Nru openjdk-11-11~19/src/demo/share/jfc/SwingApplet/SwingApplet.java openjdk-11-11~24/src/demo/share/jfc/SwingApplet/SwingApplet.java --- openjdk-11-11~19/src/demo/share/jfc/SwingApplet/SwingApplet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/demo/share/jfc/SwingApplet/SwingApplet.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,100 +0,0 @@ -/* - * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * - Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * - * - Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * - Neither the name of Oracle nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * This source code is provided to illustrate the usage of a given feature - * or technique and has been deliberately simplified. Additional steps - * required for a production-quality application, such as security checks, - * input validation and proper error handling, might not be present in - * this sample code. - */ - - - -import java.awt.FlowLayout; -import java.lang.reflect.InvocationTargetException; -import java.util.logging.Level; -import java.util.logging.Logger; -import javax.swing.JApplet; -import javax.swing.JButton; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; - - -/** - * A very simple applet. - */ -@SuppressWarnings("serial") -public class SwingApplet extends JApplet { - - JButton button; - - private void initUI() { - // Trying to set Nimbus look and feel - try { - UIManager.setLookAndFeel("javax.swing.plaf.nimbus.NimbusLookAndFeel"); - } catch (Exception ex) { - Logger.getLogger(SwingApplet.class.getName()). - log(Level.SEVERE, "Failed to apply Nimbus look and feel", ex); - } - getContentPane().setLayout(new FlowLayout()); - button = new JButton("Hello, I'm a Swing Button!"); - getContentPane().add(button); - getContentPane().doLayout(); - } - - @Override - public void init() { - try { - SwingUtilities.invokeAndWait(new Runnable() { - - @Override - public void run() { - initUI(); - } - }); - } catch (InterruptedException ex) { - Logger.getLogger(SwingApplet.class.getName()). - log(Level.SEVERE, null, ex); - } catch (InvocationTargetException ex) { - Logger.getLogger(SwingApplet.class.getName()). - log(Level.SEVERE, null, ex); - } - } - - @Override - public void stop() { - if (button != null) { - getContentPane().remove(button); - button = null; - } - } -} diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/aarch64.ad openjdk-11-11~24/src/hotspot/cpu/aarch64/aarch64.ad --- openjdk-11-11~19/src/hotspot/cpu/aarch64/aarch64.ad 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/aarch64.ad 2018-07-25 15:36:46.000000000 +0000 @@ -1193,21 +1193,28 @@ // MemBarRelease // MemBarCPUOrder // StoreX[mo_release] {CardMark}-optional + // MemBarCPUOrder // MemBarVolatile // - // n.b. as an aside, the cpuorder membar is not itself subject to + // n.b. as an aside, a cpuorder membar is not itself subject to // matching and translation by adlc rules. However, the rule // predicates need to detect its presence in order to correctly // select the desired adlc rules. // - // Inlined unsafe volatile gets manifest as a somewhat different - // node sequence to a normal volatile get + // Inlined unsafe volatile gets manifest as a slightly different + // node sequence to a normal volatile get because of the + // introduction of some CPUOrder memory barriers to bracket the + // Load. However, but the same basic skeleton of a LoadX feeding a + // MemBarAcquire, possibly thorugh an optional DecodeN, is still + // present // // MemBarCPUOrder // || \\ - // MemBarAcquire LoadX[mo_acquire] - // || - // MemBarCPUOrder + // MemBarCPUOrder LoadX[mo_acquire] + // || | + // || {DecodeN} optional + // || / + // MemBarAcquire // // In this case the acquire membar does not directly depend on the // load. However, we can be sure that the load is generated from an @@ -1314,8 +1321,8 @@ MemBarNode *child_membar(const MemBarNode *n) { - ProjNode *ctl = n->proj_out(TypeFunc::Control); - ProjNode *mem = n->proj_out(TypeFunc::Memory); + ProjNode *ctl = n->proj_out_or_null(TypeFunc::Control); + ProjNode *mem = n->proj_out_or_null(TypeFunc::Memory); // MemBar needs to have both a Ctl and Mem projection if (! ctl || ! mem) @@ -1432,6 +1439,8 @@ // | \ / // | MergeMem // | / + // {MemBarCPUOrder} -- optional + // { || } // MemBarVolatile // // where @@ -1453,6 +1462,8 @@ // | MergeMem // | / // || / + // {MemBarCPUOrder} -- optional + // { || } // MemBarVolatile // // i.e. the leading membar feeds Ctl to a CastP2X (which converts @@ -1460,7 +1471,7 @@ // Ctl+Mem to a StoreB node (which does the actual card mark). // // n.b. a StoreCM node will only appear in this configuration when - // using CMS. StoreCM differs from a normal card mark write (StoreB) + // using CMS or G1. StoreCM differs from a normal card mark write (StoreB) // because it implies a requirement to order visibility of the card // mark (StoreCM) relative to the object put (StoreP/N) using a // StoreStore memory barrier (arguably this ought to be represented @@ -1470,16 +1481,12 @@ // the sequence // // dmb ishst - // stlrb + // strb // - // However, in the case of a volatile put if we can recognise this - // configuration and plant an stlr for the object write then we can - // omit the dmb and just plant an strb since visibility of the stlr - // is ordered before visibility of subsequent stores. StoreCM nodes - // also arise when using G1 or using CMS with conditional card - // marking. In these cases (as we shall see) we don't need to insert - // the dmb when translating StoreCM because there is already an - // intervening StoreLoad barrier between it and the StoreP/N. + // However, when using G1 or CMS with conditional card marking (as + // we shall see) we don't need to insert the dmb when translating + // StoreCM because there is already an intervening StoreLoad barrier + // between it and the StoreP/N. // // It is also possible to perform the card mark conditionally on it // currently being unmarked in which case the volatile put graph @@ -1505,6 +1512,7 @@ // | / // MergeMem // | + // {MemBarCPUOrder} // MemBarVolatile // // This is referred to as a *normal* subgraph. It can easily be @@ -1567,7 +1575,7 @@ // object put and the corresponding conditional card mark. CMS // employs a post-write GC barrier while G1 employs both a pre- and // post-write GC barrier. Of course the extra nodes may be absent -- - // they are only inserted for object puts. This significantly + // they are only inserted for object puts/swaps. This significantly // complicates the task of identifying whether a MemBarRelease, // StoreX[mo_release] or MemBarVolatile forms part of a volatile put // when using these GC configurations (see below). It adds similar @@ -1575,8 +1583,8 @@ // CompareAndSwapX or MemBarAcquire forms part of a CAS. // // In both cases the post-write subtree includes an auxiliary - // MemBarVolatile (StoreLoad barrier) separating the object put and - // the read of the corresponding card. This poses two additional + // MemBarVolatile (StoreLoad barrier) separating the object put/swap + // and the read of the corresponding card. This poses two additional // problems. // // Firstly, a card mark MemBarVolatile needs to be distinguished @@ -1615,7 +1623,7 @@ // which looks like this // // MemBarRelease - // MemBarCPUOrder_(leading)__________________ + // {MemBarCPUOrder}_(leading)_________________ // C | M \ \\ C \ // | \ StoreN/P[mo_release] CastP2X // | Bot \ / @@ -1638,6 +1646,7 @@ // | . . . \ / Bot // | MergeMem // | | + // {MemBarCPUOrder} // MemBarVolatile (trailing) // // The first MergeMem merges the AliasIdxBot Mem slice from the @@ -1647,53 +1656,39 @@ // from the StoreCM into the trailing membar (n.b. the latter // proceeds via a Phi associated with the If region). // - // The graph for a CAS varies slightly, the obvious difference being + // The graph for a CAS varies slightly, the difference being // that the StoreN/P node is replaced by a CompareAndSwapP/N node // and the trailing MemBarVolatile by a MemBarCPUOrder + - // MemBarAcquire pair. The other important difference is that the - // CompareAndSwap node's SCMemProj is not merged into the card mark - // membar - it still feeds the trailing MergeMem. This also means - // that the card mark membar receives its Mem feed directly from the - // leading membar rather than via a MergeMem. + // MemBarAcquire pair (also the MemBarCPUOrder nodes are not optional). // // MemBarRelease - // MemBarCPUOrder__(leading)_________________________ - // || \\ C \ - // MemBarVolatile (card mark) CompareAndSwapN/P CastP2X - // C | || M | | - // | LoadB | ______/| - // | | | / | - // | Cmp | / SCMemProj - // | / | / | - // If | / / - // | \ | / / - // IfFalse IfTrue | / / - // \ / \ |/ prec / - // \ / StoreCM / - // \ / | / - // Region . . . / - // | \ / - // | . . . \ / Bot + // MemBarCPUOrder_(leading)_______________ + // C | M \ \\ C \ + // | \ CompareAndSwapN/P CastP2X + // | \ | + // | \ SCMemProj + // | Bot \ / + // | MergeMem + // | / + // MemBarVolatile (card mark) + // C | || M | + // | LoadB | + // | | | + // | Cmp |\ + // | / | \ + // If | \ + // | \ | \ + // IfFalse IfTrue | \ + // \ / \ | \ + // \ / StoreCM | + // \ / | | + // Region . . . | + // | \ / + // | . . . \ / Bot // | MergeMem // | | // MemBarCPUOrder - // MemBarAcquire (trailing) - // - // This has a slightly different memory subgraph to the one seen - // previously but the core of it is the same as for the CAS normal - // sungraph - // - // MemBarRelease - // MemBarCPUOrder____ - // || \ . . . - // MemBarVolatile CompareAndSwapX . . . - // | \ | - // . . . SCMemProj - // | / . . . - // MergeMem - // | - // MemBarCPUOrder - // MemBarAcquire + // MemBarVolatile (trailing) // // // G1 is quite a lot more complicated. The nodes inserted on behalf @@ -1717,7 +1712,8 @@ // So with G1 the pre-write and releasing store subgraph looks like // this (the nested Ifs are omitted). // - // MemBarRelease (leading)____________ + // MemBarRelease + // {MemBarCPUOrder}_(leading)___________ // C | || M \ M \ M \ M \ . . . // | LoadB \ LoadL LoadN \ // | / \ \ @@ -1742,15 +1738,13 @@ // (post write subtree elided) // . . . // C \ M / - // MemBarVolatile (trailing) + // \ / + // {MemBarCPUOrder} + // MemBarVolatile (trailing) // // n.b. the LoadB in this subgraph is not the card read -- it's a // read of the SATB queue active flag. // - // Once again the CAS graph is a minor variant on the above with the - // expected substitutions of CompareAndSawpX for StoreN/P and - // MemBarCPUOrder + MemBarAcquire for trailing MemBarVolatile. - // // The G1 post-write subtree is also optional, this time when the // new value being written is either null or can be identified as a // newly allocated (young gen) object with no intervening control @@ -1773,7 +1767,8 @@ // checking if card_val != young). n.b. although this test requires // a pre-read of the card it can safely be done before the StoreLoad // barrier. However that does not bypass the need to reread the card - // after the barrier. + // after the barrier. A final, 4th If tests if the card is already + // marked. // // (pre-write subtree elided) // . . . . . . . . . . . . @@ -1826,6 +1821,7 @@ // | | | / Bot // \ MergeMem // \ / + // {MemBarCPUOrder} // MemBarVolatile // // As with CMS the initial MergeMem merges the AliasIdxBot Mem slice @@ -1845,26 +1841,29 @@ // otherwise it is 3. // // The CAS graph when using G1GC also includes a pre-write subgraph - // and an optional post-write subgraph. Teh sam evarioations are + // and an optional post-write subgraph. The same variations are // introduced as for CMS with conditional card marking i.e. the - // StoreP/N is swapped for a CompareAndSwapP/N, the tariling - // MemBarVolatile for a MemBarCPUOrder + MemBarAcquire pair and the - // Mem feed from the CompareAndSwapP/N includes a precedence - // dependency feed to the StoreCM and a feed via an SCMemProj to the - // trailing membar. So, as before the configuration includes the - // normal CAS graph as a subgraph of the memory flow. - // - // So, the upshot is that in all cases the volatile put graph will - // include a *normal* memory subgraph betwen the leading membar and - // its child membar, either a volatile put graph (including a - // releasing StoreX) or a CAS graph (including a CompareAndSwapX). - // When that child is not a card mark membar then it marks the end - // of the volatile put or CAS subgraph. If the child is a card mark - // membar then the normal subgraph will form part of a volatile put - // subgraph if and only if the child feeds an AliasIdxBot Mem feed - // to a trailing barrier via a MergeMem. That feed is either direct - // (for CMS) or via 2 or 3 Phi nodes merging the leading barrier - // memory flow (for G1). + // StoreP/N is swapped for a CompareAndSwapP/N with a following + // SCMemProj, the trailing MemBarVolatile for a MemBarCPUOrder + + // MemBarAcquire pair. There may be an extra If test introduced in + // the CAS case, when the boolean result of the CAS is tested by the + // caller. In that case an extra Region and AliasIdxBot Phi may be + // introduced before the MergeMem + // + // So, the upshot is that in all cases the subgraph will include a + // *normal* memory subgraph betwen the leading membar and its child + // membar: either a normal volatile put graph including a releasing + // StoreX and terminating with a trailing volatile membar or card + // mark volatile membar; or a normal CAS graph including a + // CompareAndSwapX + SCMemProj pair and terminating with a card mark + // volatile membar or a trailing cpu order and acquire membar + // pair. If the child membar is not a (volatile) card mark membar + // then it marks the end of the volatile put or CAS subgraph. If the + // child is a card mark membar then the normal subgraph will form + // part of a larger volatile put or CAS subgraph if and only if the + // child feeds an AliasIdxBot Mem feed to a trailing barrier via a + // MergeMem. That feed is either direct (for CMS) or via 2, 3 or 4 + // Phi nodes merging the leading barrier memory flow (for G1). // // The predicates controlling generation of instructions for store // and barrier nodes employ a few simple helper functions (described @@ -1907,37 +1906,59 @@ } } + // helper to determine the maximum number of Phi nodes we may need to + // traverse when searching from a card mark membar for the merge mem + // feeding a trailing membar or vice versa + + int max_phis() + { + if (UseG1GC) { + return 4; + } else if (UseConcMarkSweepGC && UseCondCardMark) { + return 1; + } else { + return 0; + } + } // leading_to_normal // - //graph traversal helper which detects the normal case Mem feed from - // a release membar (or, optionally, its cpuorder child) to a - // dependent volatile membar i.e. it ensures that one or other of - // the following Mem flow subgraph is present. + // graph traversal helper which detects the normal case Mem feed + // from a release membar (or, optionally, its cpuorder child) to a + // dependent volatile or acquire membar i.e. it ensures that one of + // the following 3 Mem flow subgraphs is present. // // MemBarRelease - // MemBarCPUOrder {leading} + // {MemBarCPUOrder} {leading} // | \ . . . // | StoreN/P[mo_release] . . . // | / // MergeMem // | + // {MemBarCPUOrder} // MemBarVolatile {trailing or card mark} // // MemBarRelease // MemBarCPUOrder {leading} - // | \ . . . - // | CompareAndSwapX . . . - // | - // . . . SCMemProj - // \ | - // | MergeMem - // | / - // MemBarCPUOrder - // MemBarAcquire {trailing} + // | \ . . . + // | CompareAndSwapX . . . + // | / + // MergeMem + // | + // MemBarVolatile {card mark} + // + // MemBarRelease + // MemBarCPUOrder {leading} + // | \ . . . + // | CompareAndSwapX . . . + // | / + // MergeMem + // | + // MemBarCPUOrder + // MemBarAcquire {trailing} // // if the correct configuration is present returns the trailing - // membar otherwise NULL. + // or cardmark membar otherwise NULL. // // the input membar is expected to be either a cpuorder membar or a // release membar. in the latter case it should not have a cpu membar @@ -1991,61 +2012,65 @@ return NULL; } - // must have a merge if we also have st - if (st && !mm) { + // must have a merge + if (!mm) { return NULL; } - Node *y = NULL; + Node *feed = NULL; if (cas) { // look for an SCMemProj for (DUIterator_Fast imax, i = cas->fast_outs(imax); i < imax; i++) { x = cas->fast_out(i); - if (x->is_Proj()) { - y = x; + if (x->Opcode() == Op_SCMemProj) { + feed = x; break; } } - if (y == NULL) { + if (feed == NULL) { return NULL; } - // the proj must feed a MergeMem - for (DUIterator_Fast imax, i = y->fast_outs(imax); i < imax; i++) { - x = y->fast_out(i); - if (x->is_MergeMem()) { - mm = x->as_MergeMem(); - break; - } - } - if (mm == NULL) - return NULL; } else { - // ensure the store feeds the existing mergemem; - for (DUIterator_Fast imax, i = st->fast_outs(imax); i < imax; i++) { - if (st->fast_out(i) == mm) { - y = st; - break; - } - } - if (y == NULL) { - return NULL; + feed = st; + } + // ensure the feed node feeds the existing mergemem; + for (DUIterator_Fast imax, i = feed->fast_outs(imax); i < imax; i++) { + x = feed->fast_out(i); + if (x == mm) { + break; } } + if (x != mm) { + return NULL; + } MemBarNode *mbar = NULL; // ensure the merge feeds to the expected type of membar for (DUIterator_Fast imax, i = mm->fast_outs(imax); i < imax; i++) { x = mm->fast_out(i); if (x->is_MemBar()) { - int opcode = x->Opcode(); - if (opcode == Op_MemBarVolatile && st) { - mbar = x->as_MemBar(); - } else if (cas && opcode == Op_MemBarCPUOrder) { + if (x->Opcode() == Op_MemBarCPUOrder) { + // with a store any cpu order membar should precede a + // trailing volatile membar. with a cas it should precede a + // trailing acquire membar. in either case try to skip to + // that next membar MemBarNode *y = x->as_MemBar(); y = child_membar(y); - if (y != NULL && y->Opcode() == Op_MemBarAcquire) { - mbar = y; + if (y != NULL) { + // skip to this new membar to do the check + x = y; } + + } + if (x->Opcode() == Op_MemBarVolatile) { + mbar = x->as_MemBar(); + // for a volatile store this can be either a trailing membar + // or a card mark membar. for a cas it must be a card mark + // membar + guarantee(cas == NULL || is_card_mark_membar(mbar), + "in CAS graph volatile membar must be a card mark"); + } else if (cas != NULL && x->Opcode() == Op_MemBarAcquire) { + mbar = x->as_MemBar(); } break; } @@ -2059,28 +2084,36 @@ // graph traversal helper which detects the normal case Mem feed // from either a card mark or a trailing membar to a preceding // release membar (optionally its cpuorder child) i.e. it ensures - // that one or other of the following Mem flow subgraphs is present. + // that one of the following 3 Mem flow subgraphs is present. // // MemBarRelease - // MemBarCPUOrder {leading} + // {MemBarCPUOrder} {leading} // | \ . . . // | StoreN/P[mo_release] . . . // | / // MergeMem // | - // MemBarVolatile {card mark or trailing} + // {MemBarCPUOrder} + // MemBarVolatile {trailing or card mark} // // MemBarRelease // MemBarCPUOrder {leading} - // | \ . . . - // | CompareAndSwapX . . . - // | - // . . . SCMemProj - // \ | - // | MergeMem - // | / - // MemBarCPUOrder - // MemBarAcquire {trailing} + // | \ . . . + // | CompareAndSwapX . . . + // | / + // MergeMem + // | + // MemBarVolatile {card mark} + // + // MemBarRelease + // MemBarCPUOrder {leading} + // | \ . . . + // | CompareAndSwapX . . . + // | / + // MergeMem + // | + // MemBarCPUOrder + // MemBarAcquire {trailing} // // this predicate checks for the same flow as the previous predicate // but starting from the bottom rather than the top. @@ -2097,20 +2130,19 @@ assert((barrier->Opcode() == Op_MemBarVolatile || barrier->Opcode() == Op_MemBarAcquire), "expecting a volatile or an acquire membar"); - Node *x; - bool is_cas = barrier->Opcode() == Op_MemBarAcquire; + bool barrier_is_acquire = barrier->Opcode() == Op_MemBarAcquire; - // if we have an acquire membar then it must be fed via a CPUOrder - // membar + // if we have an intervening cpu order membar then start the + // search from it + + Node *x = parent_membar(barrier); - if (is_cas) { - // skip to parent barrier which must be a cpuorder - x = parent_membar(barrier); - if (x->Opcode() != Op_MemBarCPUOrder) - return NULL; - } else { - // start from the supplied barrier + if (x == NULL) { + // stick with the original barrier x = (Node *)barrier; + } else if (x->Opcode() != Op_MemBarCPUOrder) { + // any other barrier means this is not the graph we want + return NULL; } // the Mem feed to the membar should be a merge @@ -2120,30 +2152,8 @@ MergeMemNode *mm = x->as_MergeMem(); - if (is_cas) { - // the merge should be fed from the CAS via an SCMemProj node - x = NULL; - for (uint idx = 1; idx < mm->req(); idx++) { - if (mm->in(idx)->Opcode() == Op_SCMemProj) { - x = mm->in(idx); - break; - } - } - if (x == NULL) { - return NULL; - } - // check for a CAS feeding this proj - x = x->in(0); - int opcode = x->Opcode(); - if (!is_CAS(opcode)) { - return NULL; - } - // the CAS should get its mem feed from the leading membar - x = x->in(MemNode::Memory); - } else { - // the merge should get its Bottom mem feed from the leading membar - x = mm->in(Compile::AliasIdxBot); - } + // the merge should get its Bottom mem feed from the leading membar + x = mm->in(Compile::AliasIdxBot); // ensure this is a non control projection if (!x->is_Proj() || x->is_CFG()) { @@ -2184,19 +2194,39 @@ } } - // we should not have both a store and a cas - if (st == NULL & cas == NULL) { + // we cannot have both a store and a cas + if (st == NULL && cas == NULL) { + // we have neither -- this is not a normal graph return NULL; } - if (st == NULL) { - // nothing more to check - return leading; - } else { - // we should not have a store if we started from an acquire - if (is_cas) { - return NULL; + // if we started from a volatile membar and found a CAS then the + // original membar ought to be for a card mark + guarantee((barrier_is_acquire || is_card_mark_membar(barrier)), + "unexpected volatile barrier (i.e. not card mark) in CAS graph"); + // check that the CAS feeds the merge we used to get here via an + // intermediary SCMemProj + Node *scmemproj = NULL; + for (DUIterator_Fast imax, i = cas->fast_outs(imax); i < imax; i++) { + x = cas->fast_out(i); + if (x->Opcode() == Op_SCMemProj) { + scmemproj = x; + break; + } + } + if (scmemproj == NULL) { + return NULL; } + for (DUIterator_Fast imax, i = scmemproj->fast_outs(imax); i < imax; i++) { + x = scmemproj->fast_out(i); + if (x == mm) { + return leading; + } + } + } else { + // we should not have found a store if we started from an acquire + guarantee(!barrier_is_acquire, + "unexpected trailing acquire barrier in volatile store graph"); // the store should feed the merge we used to get here for (DUIterator_Fast imax, i = st->fast_outs(imax); i < imax; i++) { @@ -2227,8 +2257,9 @@ // Bot | / // MergeMem // | - // | - // MemBarVolatile {trailing} + // {MemBarCPUOrder} OR MemBarCPUOrder + // MemBarVolatile {trailing} MemBarAcquire {trailing} + // // // 2) // MemBarRelease/CPUOrder (leading) @@ -2246,8 +2277,8 @@ // Bot | / // MergeMem // | - // MemBarVolatile {trailing} - // + // {MemBarCPUOrder} OR MemBarCPUOrder + // MemBarVolatile {trailing} MemBarAcquire {trailing} // // 3) // MemBarRelease/CPUOrder (leading) @@ -2269,12 +2300,44 @@ // MergeMem // | // | - // MemBarVolatile {trailing} + // {MemBarCPUOrder} OR MemBarCPUOrder + // MemBarVolatile {trailing} MemBarAcquire {trailing} + // + // 4) + // MemBarRelease/CPUOrder (leading) + // | + // |\ + // | \ + // | \ + // | \ + // |\ \ + // | \ \ + // | \ \ . . . + // | \ \ | + // |\ \ \ MemBarVolatile (card mark) + // | \ \ \ / | + // | \ \ \ / StoreCM . . . + // | \ \ Phi + // \ \ \ / + // \ \ Phi + // \ \ / + // \ Phi + // \ / + // Phi . . . + // Bot | / + // MergeMem + // | + // | + // MemBarCPUOrder + // MemBarAcquire {trailing} // // configuration 1 is only valid if UseConcMarkSweepGC && // UseCondCardMark // - // configurations 2 and 3 are only valid if UseG1GC. + // configuration 2, is only valid if UseConcMarkSweepGC && + // UseCondCardMark or if UseG1GC + // + // configurations 3 and 4 are only valid if UseG1GC. // // if a valid configuration is present returns the trailing membar // otherwise NULL. @@ -2292,8 +2355,8 @@ Node *x; MergeMemNode *mm = NULL; - const int MAX_PHIS = 3; // max phis we will search through - int phicount = 0; // current search count + const int MAX_PHIS = max_phis(); // max phis we will search through + int phicount = 0; // current search count bool retry_feed = true; while (retry_feed) { @@ -2308,7 +2371,7 @@ } if (mm) { retry_feed = false; - } else if (UseG1GC & phicount++ < MAX_PHIS) { + } else if (phicount++ < MAX_PHIS) { // the barrier may feed indirectly via one or two Phi nodes PhiNode *phi = NULL; for (DUIterator_Fast imax, i = feed->fast_outs(imax); i < imax; i++) { @@ -2331,15 +2394,27 @@ } // sanity check this feed turns up as the expected slice - assert(mm->as_MergeMem()->in(Compile::AliasIdxBot) == feed, "expecting membar to feed AliasIdxBot slice to Merge"); + guarantee(mm->as_MergeMem()->in(Compile::AliasIdxBot) == feed, "expecting membar to feed AliasIdxBot slice to Merge"); MemBarNode *trailing = NULL; - // be sure we have a trailing membar the merge + // be sure we have a trailing membar fed by the merge for (DUIterator_Fast imax, i = mm->fast_outs(imax); i < imax; i++) { x = mm->fast_out(i); - if (x->is_MemBar() && x->Opcode() == Op_MemBarVolatile) { - trailing = x->as_MemBar(); - break; + if (x->is_MemBar()) { + // if this is an intervening cpu order membar skip to the + // following membar + if (x->Opcode() == Op_MemBarCPUOrder) { + MemBarNode *y = x->as_MemBar(); + y = child_membar(y); + if (y != NULL) { + x = y; + } + } + if (x->Opcode() == Op_MemBarVolatile || + x->Opcode() == Op_MemBarAcquire) { + trailing = x->as_MemBar(); + } + break; } } @@ -2360,18 +2435,33 @@ // otherwise NULL // // n.b. the supplied membar is expected to be a trailing - // MemBarVolatile i.e. the caller must ensure the input node has the - // correct opcode + // MemBarVolatile or MemBarAcquire i.e. the caller must ensure the + // input node has the correct opcode MemBarNode *trailing_to_card_mark(const MemBarNode *trailing) { - assert(trailing->Opcode() == Op_MemBarVolatile, - "expecting a volatile membar"); + assert(trailing->Opcode() == Op_MemBarVolatile || + trailing->Opcode() == Op_MemBarAcquire, + "expecting a volatile or acquire membar"); assert(!is_card_mark_membar(trailing), "not expecting a card mark membar"); + Node *x = (Node *)trailing; + + // look for a preceding cpu order membar + MemBarNode *y = parent_membar(x->as_MemBar()); + if (y != NULL) { + // make sure it is a cpu order membar + if (y->Opcode() != Op_MemBarCPUOrder) { + // this is nto the graph we were looking for + return NULL; + } + // start the search from here + x = y; + } + // the Mem feed to the membar should be a merge - Node *x = trailing->in(TypeFunc::Memory); + x = x->in(TypeFunc::Memory); if (!x->is_MergeMem()) { return NULL; } @@ -2382,20 +2472,20 @@ // with G1 we may possibly see a Phi or two before we see a Memory // Proj from the card mark membar - const int MAX_PHIS = 3; // max phis we will search through - int phicount = 0; // current search count + const int MAX_PHIS = max_phis(); // max phis we will search through + int phicount = 0; // current search count bool retry_feed = !x->is_Proj(); while (retry_feed) { - if (UseG1GC && x->is_Phi() && phicount++ < MAX_PHIS) { + if (x->is_Phi() && phicount++ < MAX_PHIS) { PhiNode *phi = x->as_Phi(); ProjNode *proj = NULL; PhiNode *nextphi = NULL; bool found_leading = false; for (uint i = 1; i < phi->req(); i++) { x = phi->in(i); - if (x->is_Phi()) { + if (x->is_Phi() && x->adr_type() == TypePtr::BOTTOM) { nextphi = x->as_Phi(); } else if (x->is_Proj()) { int opcode = x->in(0)->Opcode(); @@ -2475,10 +2565,8 @@ return leading; } - // nothing more to do if this is an acquire - if (trailing->Opcode() == Op_MemBarAcquire) { - return NULL; - } + // there is no normal path from trailing to leading membar. see if + // we can arrive via a card mark membar MemBarNode *card_mark_membar = trailing_to_card_mark(trailing); @@ -2506,15 +2594,6 @@ // with a bogus read dependency on it's preceding load. so in those // cases we will find the load node at the PARMS offset of the // acquire membar. n.b. there may be an intervening DecodeN node. - // - // a volatile load derived from an inlined unsafe field access - // manifests as a cpuorder membar with Ctl and Mem projections - // feeding both an acquire membar and a LoadX[mo_acquire]. The - // acquire then feeds another cpuorder membar via Ctl and Mem - // projections. The load has no output dependency on these trailing - // membars because subsequent nodes inserted into the graph take - // their control feed from the final membar cpuorder meaning they - // are all ordered after the load. Node *x = barrier->lookup(TypeFunc::Parms); if (x) { @@ -2537,61 +2616,7 @@ return (x->is_Load() && x->as_Load()->is_acquire()); } - // now check for an unsafe volatile get - - // need to check for - // - // MemBarCPUOrder - // || \\ - // MemBarAcquire* LoadX[mo_acquire] - // || - // MemBarCPUOrder - // - // where * tags node we were passed - // and || or \\ are Ctl+Mem feeds via intermediate Proj Nodes - - // check for a parent MemBarCPUOrder - ProjNode *ctl; - ProjNode *mem; - MemBarNode *parent = parent_membar(barrier); - if (!parent || parent->Opcode() != Op_MemBarCPUOrder) - return false; - ctl = parent->proj_out(TypeFunc::Control); - mem = parent->proj_out(TypeFunc::Memory); - if (!ctl || !mem) { - return false; - } - // ensure the proj nodes both feed a LoadX[mo_acquire] - LoadNode *ld = NULL; - for (DUIterator_Fast imax, i = ctl->fast_outs(imax); i < imax; i++) { - x = ctl->fast_out(i); - // if we see a load we keep hold of it and stop searching - if (x->is_Load()) { - ld = x->as_Load(); - break; - } - } - // it must be an acquiring load - if (ld && ld->is_acquire()) { - - for (DUIterator_Fast imax, i = mem->fast_outs(imax); i < imax; i++) { - x = mem->fast_out(i); - // if we see the same load we drop it and stop searching - if (x == ld) { - ld = NULL; - break; - } - } - // we must have dropped the load - if (ld == NULL) { - // check for a child cpuorder membar - MemBarNode *child = child_membar(barrier->as_MemBar()); - if (child && child->Opcode() == Op_MemBarCPUOrder) - return true; - } - } - - // final option for unnecessary mebar is that it is a trailing node + // other option for unnecessary membar is that it is a trailing node // belonging to a CAS MemBarNode *leading = trailing_to_leading(barrier->as_MemBar()); @@ -2647,39 +2672,7 @@ return true; } - // now check for an unsafe volatile get - - // check if Ctl and Proj feed comes from a MemBarCPUOrder - // - // MemBarCPUOrder - // || \\ - // MemBarAcquire* LoadX[mo_acquire] - // || - // MemBarCPUOrder - - MemBarNode *membar; - - membar = parent_membar(ld); - - if (!membar || !membar->Opcode() == Op_MemBarCPUOrder) { - return false; - } - - // ensure that there is a CPUOrder->Acquire->CPUOrder membar chain - - membar = child_membar(membar); - - if (!membar || !membar->Opcode() == Op_MemBarAcquire) { - return false; - } - - membar = child_membar(membar); - - if (!membar || !membar->Opcode() == Op_MemBarCPUOrder) { - return false; - } - - return true; + return false; } bool unnecessary_release(const Node *n) @@ -2739,7 +2732,7 @@ } // ok, if it's not a card mark then we still need to check if it is - // a trailing membar of a volatile put hgraph. + // a trailing membar of a volatile put graph. return (trailing_to_leading(mbvol) != NULL); } @@ -2836,8 +2829,8 @@ // the barrier must be a cpuorder mmebar fed by a release membar - assert(barrier->Opcode() == Op_MemBarCPUOrder, - "CAS not fed by cpuorder membar!"); + guarantee(barrier->Opcode() == Op_MemBarCPUOrder, + "CAS not fed by cpuorder membar!"); MemBarNode *b = parent_membar(barrier); assert ((b != NULL && b->Opcode() == Op_MemBarRelease), @@ -2846,9 +2839,17 @@ // does this lead a normal subgraph? MemBarNode *mbar = leading_to_normal(barrier); - assert(mbar != NULL, "CAS not embedded in normal graph!"); + guarantee(mbar != NULL, "CAS not embedded in normal graph!"); + + // if this is a card mark membar check we have a trailing acquire + + if (is_card_mark_membar(mbar)) { + mbar = card_mark_to_trailing(mbar); + } + + guarantee(mbar != NULL, "card mark membar for CAS not embedded in normal graph!"); - assert(mbar->Opcode() == Op_MemBarAcquire, "trailing membar should be an acquire"); + guarantee(mbar->Opcode() == Op_MemBarAcquire, "trailing membar should be an acquire"); #endif // ASSERT // so we can just return true here return true; @@ -2863,50 +2864,17 @@ { assert(storecm->Opcode() == Op_StoreCM, "expecting a StoreCM"); - // we only ever need to generate a dmb ishst between an object put - // and the associated card mark when we are using CMS without - // conditional card marking + // we need to generate a dmb ishst between an object put and the + // associated card mark when we are using CMS without conditional + // card marking - if (!UseConcMarkSweepGC || UseCondCardMark) { - return true; - } - - // if we are implementing volatile puts using barriers then the - // object put as an str so we must insert the dmb ishst - - if (UseBarriersForVolatile) { - return false; - } - - // we can omit the dmb ishst if this StoreCM is part of a volatile - // put because in thta case the put will be implemented by stlr - // - // we need to check for a normal subgraph feeding this StoreCM. - // that means the StoreCM must be fed Memory from a leading membar, - // either a MemBarRelease or its dependent MemBarCPUOrder, and the - // leading membar must be part of a normal subgraph - - Node *x = storecm->in(StoreNode::Memory); - - if (!x->is_Proj()) { - return false; - } - - x = x->in(0); - - if (!x->is_MemBar()) { + if (UseConcMarkSweepGC && !UseCondCardMark) { return false; } - MemBarNode *leading = x->as_MemBar(); - - // reject invalid candidates - if (!leading_membar(leading)) { - return false; - } + // a storestore is unnecesary in all other cases - // we can omit the StoreStore if it is the head of a normal subgraph - return (leading_to_normal(leading) != NULL); + return true; } @@ -8397,7 +8365,8 @@ predicate(unnecessary_storestore(n)); ins_cost(INSN_COST); - format %{ "strb zr, $mem\t# byte" %} + format %{ "storestore (elided)\n\t" + "strb zr, $mem\t# byte" %} ins_encode(aarch64_enc_strb0(mem)); @@ -8411,8 +8380,9 @@ match(Set mem (StoreCM mem zero)); ins_cost(INSN_COST * 2); - format %{ "dmb ishst" - "\n\tstrb zr, $mem\t# byte" %} + format %{ "storestore\n\t" + "dmb ishst" + "\n\tstrb zr, $mem\t# byte" %} ins_encode(aarch64_enc_strb0_ordered(mem)); @@ -9190,7 +9160,8 @@ match(MemBarAcquire); ins_cost(VOLATILE_REF_COST); - format %{ "membar_acquire" %} + format %{ "membar_acquire\n\t" + "dmb ish" %} ins_encode %{ __ block_comment("membar_acquire"); @@ -9243,7 +9214,8 @@ match(MemBarRelease); ins_cost(VOLATILE_REF_COST); - format %{ "membar_release" %} + format %{ "membar_release\n\t" + "dmb ish" %} ins_encode %{ __ block_comment("membar_release"); @@ -9295,7 +9267,8 @@ match(MemBarVolatile); ins_cost(VOLATILE_REF_COST*100); - format %{ "membar_volatile" %} + format %{ "membar_volatile\n\t" + "dmb ish"%} ins_encode %{ __ block_comment("membar_volatile"); @@ -15849,81 +15822,88 @@ %} instruct string_compareU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, - iRegI_R0 result, iRegP_R10 tmp1, rFlagsReg cr) + iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, rFlagsReg cr) %{ predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UU); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); - effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); + effect(KILL tmp1, KILL tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # KILL $tmp1" %} ins_encode %{ // Count is in 8-bit bytes; non-Compact chars are 16 bits. __ string_compare($str1$$Register, $str2$$Register, $cnt1$$Register, $cnt2$$Register, $result$$Register, - $tmp1$$Register, - fnoreg, fnoreg, StrIntrinsicNode::UU); + $tmp1$$Register, $tmp2$$Register, + fnoreg, fnoreg, fnoreg, StrIntrinsicNode::UU); %} ins_pipe(pipe_class_memory); %} instruct string_compareL(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, - iRegI_R0 result, iRegP_R10 tmp1, rFlagsReg cr) + iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, rFlagsReg cr) %{ predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LL); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); - effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); + effect(KILL tmp1, KILL tmp2, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # KILL $tmp1" %} ins_encode %{ __ string_compare($str1$$Register, $str2$$Register, $cnt1$$Register, $cnt2$$Register, $result$$Register, - $tmp1$$Register, - fnoreg, fnoreg, StrIntrinsicNode::LL); + $tmp1$$Register, $tmp2$$Register, + fnoreg, fnoreg, fnoreg, StrIntrinsicNode::LL); %} ins_pipe(pipe_class_memory); %} instruct string_compareUL(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, - iRegI_R0 result, vRegD vtmp1, vRegD vtmp2, iRegP_R10 tmp1, rFlagsReg cr) + iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, + vRegD_V0 vtmp1, vRegD_V1 vtmp2, vRegD_V2 vtmp3, rFlagsReg cr) %{ predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::UL); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); - effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, TEMP vtmp1, TEMP vtmp2, KILL cr); + effect(KILL tmp1, KILL tmp2, KILL vtmp1, KILL vtmp2, KILL vtmp3, + USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); - format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # KILL $tmp1" %} + format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # KILL $tmp1, $tmp2, $vtmp1, $vtmp2, $vtmp3" %} ins_encode %{ __ string_compare($str1$$Register, $str2$$Register, $cnt1$$Register, $cnt2$$Register, $result$$Register, - $tmp1$$Register, - $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, StrIntrinsicNode::UL); + $tmp1$$Register, $tmp2$$Register, + $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, + $vtmp3$$FloatRegister, StrIntrinsicNode::UL); %} ins_pipe(pipe_class_memory); %} instruct string_compareLU(iRegP_R1 str1, iRegI_R2 cnt1, iRegP_R3 str2, iRegI_R4 cnt2, - iRegI_R0 result, vRegD vtmp1, vRegD vtmp2, iRegP_R10 tmp1, rFlagsReg cr) + iRegI_R0 result, iRegP_R10 tmp1, iRegL_R11 tmp2, + vRegD_V0 vtmp1, vRegD_V1 vtmp2, vRegD_V2 vtmp3, rFlagsReg cr) %{ predicate(((StrCompNode*)n)->encoding() == StrIntrinsicNode::LU); match(Set result (StrComp (Binary str1 cnt1) (Binary str2 cnt2))); - effect(KILL tmp1, USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, TEMP vtmp1, TEMP vtmp2, KILL cr); + effect(KILL tmp1, KILL tmp2, KILL vtmp1, KILL vtmp2, KILL vtmp3, + USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, KILL cr); - format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # KILL $tmp1" %} + format %{ "String Compare $str1,$cnt1,$str2,$cnt2 -> $result # KILL $tmp1, $tmp2, $vtmp1, $vtmp2, $vtmp3" %} ins_encode %{ __ string_compare($str1$$Register, $str2$$Register, $cnt1$$Register, $cnt2$$Register, $result$$Register, - $tmp1$$Register, - $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, StrIntrinsicNode::LU); + $tmp1$$Register, $tmp2$$Register, + $vtmp1$$FloatRegister, $vtmp2$$FloatRegister, + $vtmp3$$FloatRegister,StrIntrinsicNode::LU); %} ins_pipe(pipe_class_memory); %} instruct string_indexofUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, - iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) + iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, + iRegINoSp tmp4, iRegINoSp tmp5, iRegINoSp tmp6, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UU); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, - TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr); + TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6, KILL cr); format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (UU)" %} ins_encode %{ @@ -15931,18 +15911,20 @@ $cnt1$$Register, $cnt2$$Register, $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, $tmp4$$Register, + $tmp5$$Register, $tmp6$$Register, -1, $result$$Register, StrIntrinsicNode::UU); %} ins_pipe(pipe_class_memory); %} instruct string_indexofLL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, - iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) + iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, + iRegINoSp tmp4, iRegINoSp tmp5, iRegINoSp tmp6, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LL); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, - TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr); + TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6, KILL cr); format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (LL)" %} ins_encode %{ @@ -15950,18 +15932,20 @@ $cnt1$$Register, $cnt2$$Register, $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, $tmp4$$Register, + $tmp5$$Register, $tmp6$$Register, -1, $result$$Register, StrIntrinsicNode::LL); %} ins_pipe(pipe_class_memory); %} instruct string_indexofUL(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, - iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) + iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, + iRegINoSp tmp4, iRegINoSp tmp5, iRegINoSp tmp6, rFlagsReg cr) %{ predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::UL); match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, - TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr); + TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, TEMP tmp5, TEMP tmp6, KILL cr); format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (UL)" %} ins_encode %{ @@ -15969,30 +15953,12 @@ $cnt1$$Register, $cnt2$$Register, $tmp1$$Register, $tmp2$$Register, $tmp3$$Register, $tmp4$$Register, + $tmp5$$Register, $tmp6$$Register, -1, $result$$Register, StrIntrinsicNode::UL); %} ins_pipe(pipe_class_memory); %} -instruct string_indexofLU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, iRegI_R2 cnt2, - iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) -%{ - predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LU); - match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 cnt2))); - effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, USE_KILL cnt2, - TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr); - format %{ "String IndexOf $str1,$cnt1,$str2,$cnt2 -> $result (LU)" %} - - ins_encode %{ - __ string_indexof($str1$$Register, $str2$$Register, - $cnt1$$Register, $cnt2$$Register, - $tmp1$$Register, $tmp2$$Register, - $tmp3$$Register, $tmp4$$Register, - -1, $result$$Register, StrIntrinsicNode::LU); - %} - ins_pipe(pipe_class_memory); -%} - instruct string_indexof_conUU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, immI_le_4 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) @@ -16008,7 +15974,7 @@ __ string_indexof($str1$$Register, $str2$$Register, $cnt1$$Register, zr, $tmp1$$Register, $tmp2$$Register, - $tmp3$$Register, $tmp4$$Register, + $tmp3$$Register, $tmp4$$Register, zr, zr, icnt2, $result$$Register, StrIntrinsicNode::UU); %} ins_pipe(pipe_class_memory); @@ -16029,7 +15995,7 @@ __ string_indexof($str1$$Register, $str2$$Register, $cnt1$$Register, zr, $tmp1$$Register, $tmp2$$Register, - $tmp3$$Register, $tmp4$$Register, + $tmp3$$Register, $tmp4$$Register, zr, zr, icnt2, $result$$Register, StrIntrinsicNode::LL); %} ins_pipe(pipe_class_memory); @@ -16050,33 +16016,12 @@ __ string_indexof($str1$$Register, $str2$$Register, $cnt1$$Register, zr, $tmp1$$Register, $tmp2$$Register, - $tmp3$$Register, $tmp4$$Register, + $tmp3$$Register, $tmp4$$Register, zr, zr, icnt2, $result$$Register, StrIntrinsicNode::UL); %} ins_pipe(pipe_class_memory); %} -instruct string_indexof_conLU(iRegP_R1 str1, iRegI_R4 cnt1, iRegP_R3 str2, - immI_1 int_cnt2, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, - iRegINoSp tmp3, iRegINoSp tmp4, rFlagsReg cr) -%{ - predicate(((StrIndexOfNode*)n)->encoding() == StrIntrinsicNode::LU); - match(Set result (StrIndexOf (Binary str1 cnt1) (Binary str2 int_cnt2))); - effect(USE_KILL str1, USE_KILL str2, USE_KILL cnt1, - TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, KILL cr); - format %{ "String IndexOf $str1,$cnt1,$str2,$int_cnt2 -> $result (LU)" %} - - ins_encode %{ - int icnt2 = (int)$int_cnt2$$constant; - __ string_indexof($str1$$Register, $str2$$Register, - $cnt1$$Register, zr, - $tmp1$$Register, $tmp2$$Register, - $tmp3$$Register, $tmp4$$Register, - icnt2, $result$$Register, StrIntrinsicNode::LU); - %} - ins_pipe(pipe_class_memory); -%} - instruct string_indexofU_char(iRegP_R1 str1, iRegI_R2 cnt1, iRegI_R3 ch, iRegI_R0 result, iRegINoSp tmp1, iRegINoSp tmp2, iRegINoSp tmp3, rFlagsReg cr) @@ -16193,7 +16138,7 @@ // fast byte[] to char[] inflation instruct string_inflate(Universe dummy, iRegP_R0 src, iRegP_R1 dst, iRegI_R2 len, - vRegD tmp1, vRegD tmp2, vRegD tmp3, iRegP_R3 tmp4, rFlagsReg cr) + vRegD_V0 tmp1, vRegD_V1 tmp2, vRegD_V2 tmp3, iRegP_R3 tmp4, rFlagsReg cr) %{ match(Set dummy (StrInflatedCopy src (Binary dst len))); effect(TEMP tmp1, TEMP tmp2, TEMP tmp3, TEMP tmp4, USE_KILL src, USE_KILL dst, USE_KILL len, KILL cr); diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/assembler_aarch64.hpp openjdk-11-11~24/src/hotspot/cpu/aarch64/assembler_aarch64.hpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/assembler_aarch64.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/assembler_aarch64.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1638,12 +1638,14 @@ #undef INSN // Conditional compare (both kinds) - void conditional_compare(unsigned op, int o2, int o3, + void conditional_compare(unsigned op, int o1, int o2, int o3, Register Rn, unsigned imm5, unsigned nzcv, unsigned cond) { + starti; f(op, 31, 29); f(0b11010010, 28, 21); f(cond, 15, 12); + f(o1, 11); f(o2, 10); f(o3, 4); f(nzcv, 3, 0); @@ -1652,15 +1654,12 @@ #define INSN(NAME, op) \ void NAME(Register Rn, Register Rm, int imm, Condition cond) { \ - starti; \ - f(0, 11); \ - conditional_compare(op, 0, 0, Rn, (uintptr_t)Rm, imm, cond); \ + int regNumber = (Rm == zr ? 31 : (uintptr_t)Rm); \ + conditional_compare(op, 0, 0, 0, Rn, regNumber, imm, cond); \ } \ \ - void NAME(Register Rn, int imm5, int imm, Condition cond) { \ - starti; \ - f(1, 11); \ - conditional_compare(op, 0, 0, Rn, imm5, imm, cond); \ + void NAME(Register Rn, int imm5, int imm, Condition cond) { \ + conditional_compare(op, 1, 0, 0, Rn, imm5, imm, cond); \ } INSN(ccmnw, 0b001); @@ -2025,6 +2024,57 @@ fmovd(Vn, zr); } + // Floating-point rounding + // type: half-precision = 11 + // single = 00 + // double = 01 + // rmode: A = Away = 100 + // I = current = 111 + // M = MinusInf = 010 + // N = eveN = 000 + // P = PlusInf = 001 + // X = eXact = 110 + // Z = Zero = 011 + void float_round(unsigned type, unsigned rmode, FloatRegister Rd, FloatRegister Rn) { + starti; + f(0b00011110, 31, 24); + f(type, 23, 22); + f(0b1001, 21, 18); + f(rmode, 17, 15); + f(0b10000, 14, 10); + rf(Rn, 5), rf(Rd, 0); + } +#define INSN(NAME, type, rmode) \ + void NAME(FloatRegister Vd, FloatRegister Vn) { \ + float_round(type, rmode, Vd, Vn); \ + } + +public: + INSN(frintah, 0b11, 0b100); + INSN(frintih, 0b11, 0b111); + INSN(frintmh, 0b11, 0b010); + INSN(frintnh, 0b11, 0b000); + INSN(frintph, 0b11, 0b001); + INSN(frintxh, 0b11, 0b110); + INSN(frintzh, 0b11, 0b011); + + INSN(frintas, 0b00, 0b100); + INSN(frintis, 0b00, 0b111); + INSN(frintms, 0b00, 0b010); + INSN(frintns, 0b00, 0b000); + INSN(frintps, 0b00, 0b001); + INSN(frintxs, 0b00, 0b110); + INSN(frintzs, 0b00, 0b011); + + INSN(frintad, 0b01, 0b100); + INSN(frintid, 0b01, 0b111); + INSN(frintmd, 0b01, 0b010); + INSN(frintnd, 0b01, 0b000); + INSN(frintpd, 0b01, 0b001); + INSN(frintxd, 0b01, 0b110); + INSN(frintzd, 0b01, 0b011); +#undef INSN + /* SIMD extensions * * We just use FloatRegister in the following. They are exactly the same @@ -2294,6 +2344,42 @@ #undef INSN +#define INSN(NAME, op1, op2) \ + void NAME(FloatRegister Vd, SIMD_Arrangement T, FloatRegister Vn, FloatRegister Vm, int index = 0) { \ + starti; \ + assert(T == T2S || T == T4S || T == T2D, "invalid arrangement"); \ + assert(index >= 0 && ((T == T2D && index <= 1) || (T != T2D && index <= 3)), "invalid index"); \ + f(0, 31), f((int)T & 1, 30), f(op1, 29); f(0b011111, 28, 23); \ + f(T == T2D ? 1 : 0, 22), f(T == T2D ? 0 : index & 1, 21), rf(Vm, 16); \ + f(op2, 15, 12), f(T == T2D ? index : (index >> 1), 11), f(0, 10); \ + rf(Vn, 5), rf(Vd, 0); \ + } + + // FMLA/FMLS - Vector - Scalar + INSN(fmlavs, 0, 0b0001); + INSN(fmlsvs, 0, 0b0001); + // FMULX - Vector - Scalar + INSN(fmulxvs, 1, 0b1001); + +#undef INSN + + // Floating-point Reciprocal Estimate + void frecpe(FloatRegister Vd, FloatRegister Vn, SIMD_RegVariant type) { + assert(type == D || type == S, "Wrong type for frecpe"); + starti; + f(0b010111101, 31, 23); + f(type == D ? 1 : 0, 22); + f(0b100001110110, 21, 10); + rf(Vn, 5), rf(Vd, 0); + } + + // (double) {a, b} -> (a + b) + void faddpd(FloatRegister Vd, FloatRegister Vn) { + starti; + f(0b0111111001110000110110, 31, 10); + rf(Vn, 5), rf(Vd, 0); + } + void ins(FloatRegister Vd, SIMD_RegVariant T, FloatRegister Vn, int didx, int sidx) { starti; assert(T != Q, "invalid register variant"); diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/c1_LIRGenerator_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -745,6 +745,14 @@ } void LIRGenerator::do_MathIntrinsic(Intrinsic* x) { + assert(x->number_of_arguments() == 1 || (x->number_of_arguments() == 2 && x->id() == vmIntrinsics::_dpow), "wrong type"); + if (x->id() == vmIntrinsics::_dexp || x->id() == vmIntrinsics::_dlog || + x->id() == vmIntrinsics::_dpow || x->id() == vmIntrinsics::_dcos || + x->id() == vmIntrinsics::_dsin || x->id() == vmIntrinsics::_dtan || + x->id() == vmIntrinsics::_dlog10) { + do_LibmIntrinsic(x); + return; + } switch (x->id()) { case vmIntrinsics::_dabs: case vmIntrinsics::_dsqrt: { @@ -754,61 +762,100 @@ LIR_Opr dst = rlock_result(x); switch (x->id()) { - case vmIntrinsics::_dsqrt: { - __ sqrt(value.result(), dst, LIR_OprFact::illegalOpr); - break; - } - case vmIntrinsics::_dabs: { - __ abs(value.result(), dst, LIR_OprFact::illegalOpr); - break; - } + case vmIntrinsics::_dsqrt: { + __ sqrt(value.result(), dst, LIR_OprFact::illegalOpr); + break; + } + case vmIntrinsics::_dabs: { + __ abs(value.result(), dst, LIR_OprFact::illegalOpr); + break; + } } break; } - case vmIntrinsics::_dlog10: // fall through - case vmIntrinsics::_dlog: // fall through - case vmIntrinsics::_dsin: // fall through - case vmIntrinsics::_dtan: // fall through - case vmIntrinsics::_dcos: // fall through - case vmIntrinsics::_dexp: { - assert(x->number_of_arguments() == 1, "wrong type"); + } +} - address runtime_entry = NULL; - switch (x->id()) { - case vmIntrinsics::_dsin: - runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); - break; - case vmIntrinsics::_dcos: - runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); - break; - case vmIntrinsics::_dtan: - runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); - break; - case vmIntrinsics::_dlog: - runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); - break; - case vmIntrinsics::_dlog10: - runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10); - break; - case vmIntrinsics::_dexp: - runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dexp); - break; - default: - ShouldNotReachHere(); - } +void LIRGenerator::do_LibmIntrinsic(Intrinsic* x) { + LIRItem value(x->argument_at(0), this); + value.set_destroys_register(); + + LIR_Opr calc_result = rlock_result(x); + LIR_Opr result_reg = result_register_for(x->type()); + + CallingConvention* cc = NULL; + + if (x->id() == vmIntrinsics::_dpow) { + LIRItem value1(x->argument_at(1), this); + + value1.set_destroys_register(); + + BasicTypeList signature(2); + signature.append(T_DOUBLE); + signature.append(T_DOUBLE); + cc = frame_map()->c_calling_convention(&signature); + value.load_item_force(cc->at(0)); + value1.load_item_force(cc->at(1)); + } else { + BasicTypeList signature(1); + signature.append(T_DOUBLE); + cc = frame_map()->c_calling_convention(&signature); + value.load_item_force(cc->at(0)); + } - LIR_Opr result = call_runtime(x->argument_at(0), runtime_entry, x->type(), NULL); - set_result(x, result); + switch (x->id()) { + case vmIntrinsics::_dexp: + if (StubRoutines::dexp() != NULL) { + __ call_runtime_leaf(StubRoutines::dexp(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dexp), getThreadTemp(), result_reg, cc->args()); + } break; - } - case vmIntrinsics::_dpow: { - assert(x->number_of_arguments() == 2, "wrong type"); - address runtime_entry = CAST_FROM_FN_PTR(address, SharedRuntime::dpow); - LIR_Opr result = call_runtime(x->argument_at(0), x->argument_at(1), runtime_entry, x->type(), NULL); - set_result(x, result); + case vmIntrinsics::_dlog: + if (StubRoutines::dlog() != NULL) { + __ call_runtime_leaf(StubRoutines::dlog(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog), getThreadTemp(), result_reg, cc->args()); + } break; - } + case vmIntrinsics::_dlog10: + if (StubRoutines::dlog10() != NULL) { + __ call_runtime_leaf(StubRoutines::dlog10(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dlog10), getThreadTemp(), result_reg, cc->args()); + } + break; + case vmIntrinsics::_dpow: + if (StubRoutines::dpow() != NULL) { + __ call_runtime_leaf(StubRoutines::dpow(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dpow), getThreadTemp(), result_reg, cc->args()); + } + break; + case vmIntrinsics::_dsin: + if (StubRoutines::dsin() != NULL) { + __ call_runtime_leaf(StubRoutines::dsin(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dsin), getThreadTemp(), result_reg, cc->args()); + } + break; + case vmIntrinsics::_dcos: + if (StubRoutines::dcos() != NULL) { + __ call_runtime_leaf(StubRoutines::dcos(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dcos), getThreadTemp(), result_reg, cc->args()); + } + break; + case vmIntrinsics::_dtan: + if (StubRoutines::dtan() != NULL) { + __ call_runtime_leaf(StubRoutines::dtan(), getThreadTemp(), result_reg, cc->args()); + } else { + __ call_runtime_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::dtan), getThreadTemp(), result_reg, cc->args()); + } + break; + default: ShouldNotReachHere(); } + __ move(result_reg, calc_result); } diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -166,7 +166,6 @@ tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); } else { eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); - incr_allocated_bytes(noreg, var_size_in_bytes, con_size_in_bytes, t1); } } diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/c1_Runtime1_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -265,9 +265,11 @@ __ push(RegSet::range(r0, r29), sp); // integer registers except lr & sp if (save_fpu_registers) { - for (int i = 30; i >= 0; i -= 2) - __ stpd(as_FloatRegister(i), as_FloatRegister(i+1), - Address(__ pre(sp, -2 * wordSize))); + for (int i = 31; i>= 0; i -= 4) { + __ sub(sp, sp, 4 * wordSize); // no pre-increment for st1. Emulate it without modifying other registers + __ st1(as_FloatRegister(i-3), as_FloatRegister(i-2), as_FloatRegister(i-1), + as_FloatRegister(i), __ T1D, Address(sp)); + } } else { __ add(sp, sp, -32 * wordSize); } @@ -277,9 +279,9 @@ static void restore_live_registers(StubAssembler* sasm, bool restore_fpu_registers = true) { if (restore_fpu_registers) { - for (int i = 0; i < 32; i += 2) - __ ldpd(as_FloatRegister(i), as_FloatRegister(i+1), - Address(__ post(sp, 2 * wordSize))); + for (int i = 0; i < 32; i += 4) + __ ld1(as_FloatRegister(i), as_FloatRegister(i+1), as_FloatRegister(i+2), + as_FloatRegister(i+3), __ T1D, Address(__ post(sp, 4 * wordSize))); } else { __ add(sp, sp, 32 * wordSize); } @@ -290,9 +292,9 @@ static void restore_live_registers_except_r0(StubAssembler* sasm, bool restore_fpu_registers = true) { if (restore_fpu_registers) { - for (int i = 0; i < 32; i += 2) - __ ldpd(as_FloatRegister(i), as_FloatRegister(i+1), - Address(__ post(sp, 2 * wordSize))); + for (int i = 0; i < 32; i += 4) + __ ld1(as_FloatRegister(i), as_FloatRegister(i+1), as_FloatRegister(i+2), + as_FloatRegister(i+3), __ T1D, Address(__ post(sp, 4 * wordSize))); } else { __ add(sp, sp, 32 * wordSize); } @@ -685,8 +687,11 @@ __ set_info("fast new_instance init check", dont_gc_arguments); } + // If TLAB is disabled, see if there is support for inlining contiguous + // allocations. + // Otherwise, just go to the slow path. if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) && - UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { + !UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { Label slow_path; Register obj_size = r2; Register t1 = r19; @@ -722,7 +727,6 @@ __ ldrw(obj_size, Address(klass, Klass::layout_helper_offset())); __ eden_allocate(obj, obj_size, 0, t1, slow_path); - __ incr_allocated_bytes(rthread, obj_size, 0, rscratch1); __ initialize_object(obj, klass, obj_size, 0, t1, t2, /* is_tlab_allocated */ false); __ verify_oop(obj); @@ -798,7 +802,10 @@ } #endif // ASSERT - if (UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { + // If TLAB is disabled, see if there is support for inlining contiguous + // allocations. + // Otherwise, just go to the slow path. + if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { Register arr_size = r4; Register t1 = r2; Register t2 = r5; @@ -823,7 +830,6 @@ __ andr(arr_size, arr_size, ~MinObjAlignmentInBytesMask); __ eden_allocate(obj, arr_size, 0, t1, slow_path); // preserves arr_size - __ incr_allocated_bytes(rthread, arr_size, 0, rscratch1); __ initialize_header(obj, klass, length, t1, t2); __ ldrb(t1, Address(klass, in_bytes(Klass::layout_helper_offset()) + (Klass::_lh_header_size_shift / BitsPerByte))); diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/frame_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/frame_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/frame_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/frame_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -71,9 +71,20 @@ return false; } - // unextended sp must be within the stack and above or equal sp - bool unextended_sp_safe = (unextended_sp < thread->stack_base()) && - (unextended_sp >= sp); + // When we are running interpreted code the machine stack pointer, SP, is + // set low enough so that the Java expression stack can grow and shrink + // without ever exceeding the machine stack bounds. So, ESP >= SP. + + // When we call out of an interpreted method, SP is incremented so that + // the space between SP and ESP is removed. The SP saved in the callee's + // frame is the SP *before* this increment. So, when we walk a stack of + // interpreter frames the sender's SP saved in a frame might be less than + // the SP at the point of call. + + // So unextended sp must be within the stack but we need not to check + // that unextended sp >= sp + + bool unextended_sp_safe = (unextended_sp < thread->stack_base()); if (!unextended_sp_safe) { return false; diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/gc/g1/g1BarrierSetAssembler_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,6 @@ #include "precompiled.hpp" #include "asm/macroAssembler.inline.hpp" -#include "c1/c1_LIRAssembler.hpp" -#include "c1/c1_MacroAssembler.hpp" -#include "gc/g1/c1/g1BarrierSetC1.hpp" #include "gc/g1/g1BarrierSet.hpp" #include "gc/g1/g1BarrierSetAssembler.hpp" #include "gc/g1/g1BarrierSetRuntime.hpp" @@ -38,12 +35,17 @@ #include "runtime/thread.hpp" #include "interpreter/interp_masm.hpp" #include "runtime/sharedRuntime.hpp" +#ifdef COMPILER1 +#include "c1/c1_LIRAssembler.hpp" +#include "c1/c1_MacroAssembler.hpp" +#include "gc/g1/c1/g1BarrierSetC1.hpp" +#endif #define __ masm-> void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count, RegSet saved_regs) { - bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0; + bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0; if (!dest_uninitialized) { __ push(saved_regs, sp); if (count == c_rarg0) { diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -24,7 +24,9 @@ #include "precompiled.hpp" #include "gc/shared/barrierSetAssembler.hpp" +#include "gc/shared/collectedHeap.hpp" #include "runtime/jniHandles.hpp" +#include "runtime/thread.hpp" #define __ masm-> @@ -35,14 +37,14 @@ bool in_heap = (decorators & IN_HEAP) != 0; bool in_native = (decorators & IN_NATIVE) != 0; - bool oop_not_null = (decorators & OOP_NOT_NULL) != 0; + bool is_not_null = (decorators & IS_NOT_NULL) != 0; switch (type) { case T_OBJECT: case T_ARRAY: { if (in_heap) { if (UseCompressedOops) { __ ldrw(dst, src); - if (oop_not_null) { + if (is_not_null) { __ decode_heap_oop_not_null(dst); } else { __ decode_heap_oop(dst); @@ -121,3 +123,109 @@ __ andr(obj, obj, ~JNIHandles::weak_tag_mask); __ ldr(obj, Address(obj, 0)); // *obj } + +// Defines obj, preserves var_size_in_bytes, okay for t2 == var_size_in_bytes. +void BarrierSetAssembler::tlab_allocate(MacroAssembler* masm, Register obj, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1, + Register t2, + Label& slow_case) { + assert_different_registers(obj, t2); + assert_different_registers(obj, var_size_in_bytes); + Register end = t2; + + // verify_tlab(); + + __ ldr(obj, Address(rthread, JavaThread::tlab_top_offset())); + if (var_size_in_bytes == noreg) { + __ lea(end, Address(obj, con_size_in_bytes)); + } else { + __ lea(end, Address(obj, var_size_in_bytes)); + } + __ ldr(rscratch1, Address(rthread, JavaThread::tlab_end_offset())); + __ cmp(end, rscratch1); + __ br(Assembler::HI, slow_case); + + // update the tlab top pointer + __ str(end, Address(rthread, JavaThread::tlab_top_offset())); + + // recover var_size_in_bytes if necessary + if (var_size_in_bytes == end) { + __ sub(var_size_in_bytes, var_size_in_bytes, obj); + } + // verify_tlab(); +} + +// Defines obj, preserves var_size_in_bytes +void BarrierSetAssembler::eden_allocate(MacroAssembler* masm, Register obj, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1, + Label& slow_case) { + assert_different_registers(obj, var_size_in_bytes, t1); + if (!Universe::heap()->supports_inline_contig_alloc()) { + __ b(slow_case); + } else { + Register end = t1; + Register heap_end = rscratch2; + Label retry; + __ bind(retry); + { + unsigned long offset; + __ adrp(rscratch1, ExternalAddress((address) Universe::heap()->end_addr()), offset); + __ ldr(heap_end, Address(rscratch1, offset)); + } + + ExternalAddress heap_top((address) Universe::heap()->top_addr()); + + // Get the current top of the heap + { + unsigned long offset; + __ adrp(rscratch1, heap_top, offset); + // Use add() here after ARDP, rather than lea(). + // lea() does not generate anything if its offset is zero. + // However, relocs expect to find either an ADD or a load/store + // insn after an ADRP. add() always generates an ADD insn, even + // for add(Rn, Rn, 0). + __ add(rscratch1, rscratch1, offset); + __ ldaxr(obj, rscratch1); + } + + // Adjust it my the size of our new object + if (var_size_in_bytes == noreg) { + __ lea(end, Address(obj, con_size_in_bytes)); + } else { + __ lea(end, Address(obj, var_size_in_bytes)); + } + + // if end < obj then we wrapped around high memory + __ cmp(end, obj); + __ br(Assembler::LO, slow_case); + + __ cmp(end, heap_end); + __ br(Assembler::HI, slow_case); + + // If heap_top hasn't been changed by some other thread, update it. + __ stlxr(rscratch2, end, rscratch1); + __ cbnzw(rscratch2, retry); + + incr_allocated_bytes(masm, var_size_in_bytes, con_size_in_bytes, t1); + } +} + +void BarrierSetAssembler::incr_allocated_bytes(MacroAssembler* masm, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1) { + assert(t1->is_valid(), "need temp reg"); + + __ ldr(t1, Address(rthread, in_bytes(JavaThread::allocated_bytes_offset()))); + if (var_size_in_bytes->is_valid()) { + __ add(t1, t1, var_size_in_bytes); + } else { + __ add(t1, t1, con_size_in_bytes); + } + __ str(t1, Address(rthread, in_bytes(JavaThread::allocated_bytes_offset()))); +} + diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp openjdk-11-11~24/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/gc/shared/barrierSetAssembler_aarch64.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -30,6 +30,11 @@ #include "oops/access.hpp" class BarrierSetAssembler: public CHeapObj { +private: + void incr_allocated_bytes(MacroAssembler* masm, + Register var_size_in_bytes, int con_size_in_bytes, + Register t1 = noreg); + public: virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, bool is_oop, Register addr, Register count, RegSet saved_regs) {} @@ -46,6 +51,22 @@ virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, Register obj, Register tmp, Label& slowpath); + virtual void tlab_allocate(MacroAssembler* masm, + Register obj, // result: pointer to object after successful allocation + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register + Register t2, // temp register + Label& slow_case // continuation point if fast allocation fails + ); + + void eden_allocate(MacroAssembler* masm, + Register obj, // result: pointer to object after successful allocation + Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise + int con_size_in_bytes, // object size in bytes if known at compile time + Register t1, // temp register + Label& slow_case // continuation point if fast allocation fails + ); virtual void barrier_stubs_init() {} }; diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/gc/shared/cardTableBarrierSetAssembler_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -91,9 +91,9 @@ void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Address dst, Register val, Register tmp1, Register tmp2) { bool in_heap = (decorators & IN_HEAP) != 0; - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; bool needs_post_barrier = val != noreg && in_heap; BarrierSetAssembler::store_at(masm, decorators, type, dst, val, noreg, noreg); diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/globals_aarch64.hpp openjdk-11-11~24/src/hotspot/cpu/aarch64/globals_aarch64.hpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/globals_aarch64.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/globals_aarch64.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -164,7 +164,7 @@ product(int, SoftwarePrefetchHintDistance, -1, \ "Use prfm hint with specified distance in compiled code." \ "Value -1 means off.") \ - range(-1, 32760) + range(-1, 4096) #endif diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/macroAssembler_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -739,11 +739,19 @@ || entry.rspec().type() == relocInfo::static_call_type || entry.rspec().type() == relocInfo::virtual_call_type, "wrong reloc type"); - unsigned int start_offset = offset(); - if (far_branches() && !Compile::current()->in_scratch_emit_size()) { - address stub = emit_trampoline_stub(start_offset, entry.target()); - if (stub == NULL) { - return NULL; // CodeCache is full + // We need a trampoline if branches are far. + if (far_branches()) { + // We don't want to emit a trampoline if C2 is generating dummy + // code during its branch shortening phase. + CompileTask* task = ciEnv::current()->task(); + bool in_scratch_emit_size = + (task != NULL && is_c2_compile(task->comp_level()) && + Compile::current()->in_scratch_emit_size()); + if (!in_scratch_emit_size) { + address stub = emit_trampoline_stub(offset(), entry.target()); + if (stub == NULL) { + return NULL; // CodeCache is full + } } } @@ -2127,8 +2135,7 @@ bind(not_weak); // Resolve (untagged) jobject. - access_load_at(T_OBJECT, IN_CONCURRENT_ROOT, value, Address(value, 0), tmp, - thread); + access_load_at(T_OBJECT, IN_NATIVE, value, Address(value, 0), tmp, thread); verify_oop(value); bind(done); } @@ -2440,24 +2447,6 @@ #undef ATOMIC_XCHG -void MacroAssembler::incr_allocated_bytes(Register thread, - Register var_size_in_bytes, - int con_size_in_bytes, - Register t1) { - if (!thread->is_valid()) { - thread = rthread; - } - assert(t1->is_valid(), "need temp reg"); - - ldr(t1, Address(thread, in_bytes(JavaThread::allocated_bytes_offset()))); - if (var_size_in_bytes->is_valid()) { - add(t1, t1, var_size_in_bytes); - } else { - add(t1, t1, con_size_in_bytes); - } - str(t1, Address(thread, in_bytes(JavaThread::allocated_bytes_offset()))); -} - #ifndef PRODUCT extern "C" void findpc(intptr_t x); #endif @@ -3661,8 +3650,7 @@ // ((OopHandle)result).resolve(); void MacroAssembler::resolve_oop_handle(Register result, Register tmp) { // OopHandle::resolve is an indirection. - access_load_at(T_OBJECT, IN_CONCURRENT_ROOT, - result, Address(result, 0), tmp, noreg); + access_load_at(T_OBJECT, IN_NATIVE, result, Address(result, 0), tmp, noreg); } void MacroAssembler::load_mirror(Register dst, Register method, Register tmp) { @@ -4009,7 +3997,7 @@ void MacroAssembler::load_heap_oop_not_null(Register dst, Address src, Register tmp1, Register thread_tmp, DecoratorSet decorators) { - access_load_at(T_OBJECT, IN_HEAP | OOP_NOT_NULL | decorators, dst, src, tmp1, thread_tmp); + access_load_at(T_OBJECT, IN_HEAP | IS_NOT_NULL | decorators, dst, src, tmp1, thread_tmp); } void MacroAssembler::store_heap_oop(Address dst, Register src, Register tmp1, @@ -4085,30 +4073,18 @@ Register t1, Register t2, Label& slow_case) { - assert_different_registers(obj, t2); - assert_different_registers(obj, var_size_in_bytes); - Register end = t2; - - // verify_tlab(); - - ldr(obj, Address(rthread, JavaThread::tlab_top_offset())); - if (var_size_in_bytes == noreg) { - lea(end, Address(obj, con_size_in_bytes)); - } else { - lea(end, Address(obj, var_size_in_bytes)); - } - ldr(rscratch1, Address(rthread, JavaThread::tlab_end_offset())); - cmp(end, rscratch1); - br(Assembler::HI, slow_case); - - // update the tlab top pointer - str(end, Address(rthread, JavaThread::tlab_top_offset())); + BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->tlab_allocate(this, obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); +} - // recover var_size_in_bytes if necessary - if (var_size_in_bytes == end) { - sub(var_size_in_bytes, var_size_in_bytes, obj); - } - // verify_tlab(); +// Defines obj, preserves var_size_in_bytes +void MacroAssembler::eden_allocate(Register obj, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1, + Label& slow_case) { + BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->eden_allocate(this, obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); } // Zero words; len is in bytes @@ -4173,61 +4149,6 @@ cbnz(len, loop); } -// Defines obj, preserves var_size_in_bytes -void MacroAssembler::eden_allocate(Register obj, - Register var_size_in_bytes, - int con_size_in_bytes, - Register t1, - Label& slow_case) { - assert_different_registers(obj, var_size_in_bytes, t1); - if (!Universe::heap()->supports_inline_contig_alloc()) { - b(slow_case); - } else { - Register end = t1; - Register heap_end = rscratch2; - Label retry; - bind(retry); - { - unsigned long offset; - adrp(rscratch1, ExternalAddress((address) Universe::heap()->end_addr()), offset); - ldr(heap_end, Address(rscratch1, offset)); - } - - ExternalAddress heap_top((address) Universe::heap()->top_addr()); - - // Get the current top of the heap - { - unsigned long offset; - adrp(rscratch1, heap_top, offset); - // Use add() here after ARDP, rather than lea(). - // lea() does not generate anything if its offset is zero. - // However, relocs expect to find either an ADD or a load/store - // insn after an ADRP. add() always generates an ADD insn, even - // for add(Rn, Rn, 0). - add(rscratch1, rscratch1, offset); - ldaxr(obj, rscratch1); - } - - // Adjust it my the size of our new object - if (var_size_in_bytes == noreg) { - lea(end, Address(obj, con_size_in_bytes)); - } else { - lea(end, Address(obj, var_size_in_bytes)); - } - - // if end < obj then we wrapped around high memory - cmp(end, obj); - br(Assembler::LO, slow_case); - - cmp(end, heap_end); - br(Assembler::HI, slow_case); - - // If heap_top hasn't been changed by some other thread, update it. - stlxr(rscratch2, end, rscratch1); - cbnzw(rscratch2, retry); - } -} - void MacroAssembler::verify_tlab() { #ifdef ASSERT if (UseTLAB && VerifyOops) { @@ -4401,8 +4322,10 @@ Register cnt2, Register cnt1, Register tmp1, Register tmp2, Register tmp3, Register tmp4, + Register tmp5, Register tmp6, int icnt1, Register result, int ae) { - Label BM, LINEARSEARCH, DONE, NOMATCH, MATCH; + // NOTE: tmp5, tmp6 can be zr depending on specific method version + Label LINEARSEARCH, LINEARSTUB, LINEAR_MEDIUM, DONE, NOMATCH, MATCH; Register ch1 = rscratch1; Register ch2 = rscratch2; @@ -4431,18 +4354,21 @@ // if (substr.count > string.count) return -1; // if (substr.count == 0) return 0; -// We have two strings, a source string in str2, cnt2 and a pattern string -// in str1, cnt1. Find the 1st occurence of pattern in source or return -1. + // We have two strings, a source string in str2, cnt2 and a pattern string + // in str1, cnt1. Find the 1st occurence of pattern in source or return -1. -// For larger pattern and source we use a simplified Boyer Moore algorithm. -// With a small pattern and source we use linear scan. + // For larger pattern and source we use a simplified Boyer Moore algorithm. + // With a small pattern and source we use linear scan. if (icnt1 == -1) { - cmp(cnt1, 256); // Use Linear Scan if cnt1 < 8 || cnt1 >= 256 - ccmp(cnt1, 8, 0b0000, LO); // Can't handle skip >= 256 because we use - br(LO, LINEARSEARCH); // a byte array. - cmp(cnt1, cnt2, LSR, 2); // Source must be 4 * pattern for BM - br(HS, LINEARSEARCH); + sub(result_tmp, cnt2, cnt1); + cmp(cnt1, 8); // Use Linear Scan if cnt1 < 8 || cnt1 >= 256 + br(LT, LINEARSEARCH); + dup(v0, T16B, cnt1); // done in separate FPU pipeline. Almost no penalty + cmp(cnt1, 256); + lsr(tmp1, cnt2, 2); + ccmp(cnt1, tmp1, 0b0000, LT); // Source must be 4 * pattern for BM + br(GE, LINEARSTUB); } // The Boyer Moore alogorithm is based on the description here:- @@ -4462,7 +4388,9 @@ // // http://en.wikipedia.org/wiki/Boyer-Moore-Horspool_algorithm // -// #define ASIZE 128 +// This particular implementation has few java-specific optimizations. +// +// #define ASIZE 256 // // int bm(unsigned char *x, int m, unsigned char *y, int n) { // int i, j; @@ -4471,11 +4399,16 @@ // // /* Preprocessing */ // for (i = 0; i < ASIZE; ++i) -// bc[i] = 0; +// bc[i] = m; // for (i = 0; i < m - 1; ) { // c = x[i]; // ++i; -// if (c < ASIZE) bc[c] = i; +// // c < 256 for Latin1 string, so, no need for branch +// #ifdef PATTERN_STRING_IS_LATIN1 +// bc[c] = m - i; +// #else +// if (c < ASIZE) bc[c] = m - i; +// #endif // } // // /* Searching */ @@ -4485,84 +4418,160 @@ // if (x[m-1] == c) // for (i = m - 2; i >= 0 && x[i] == y[i + j]; --i); // if (i < 0) return j; +// // c < 256 for Latin1 string, so, no need for branch +// #ifdef SOURCE_STRING_IS_LATIN1 +// // LL case: (c< 256) always true. Remove branch +// j += bc[y[j+m-1]]; +// #endif +// #ifndef PATTERN_STRING_IS_UTF +// // UU case: need if (c if not. // if (c < ASIZE) -// j = j - bc[y[j+m-1]] + m; +// j += bc[y[j+m-1]]; // else -// j += 1; // Advance by 1 only if char >= ASIZE +// j += m +// #endif // } // } if (icnt1 == -1) { - BIND(BM); - - Label ZLOOP, BCLOOP, BCSKIP, BMLOOPSTR2, BMLOOPSTR1, BMSKIP; - Label BMADV, BMMATCH, BMCHECKEND; - + Label BCLOOP, BCSKIP, BMLOOPSTR2, BMLOOPSTR1, BMSKIP, BMADV, BMMATCH, + BMLOOPSTR1_LASTCMP, BMLOOPSTR1_CMP, BMLOOPSTR1_AFTER_LOAD, BM_INIT_LOOP; Register cnt1end = tmp2; Register str2end = cnt2; Register skipch = tmp2; - // Restrict ASIZE to 128 to reduce stack space/initialisation. - // The presence of chars >= ASIZE in the target string does not affect - // performance, but we must be careful not to initialise them in the stack - // array. - // The presence of chars >= ASIZE in the source string may adversely affect - // performance since we can only advance by one when we encounter one. - - stp(zr, zr, pre(sp, -128)); - for (int i = 1; i < 8; i++) - stp(zr, zr, Address(sp, i*16)); + // str1 length is >=8, so, we can read at least 1 register for cases when + // UTF->Latin1 conversion is not needed(8 LL or 4UU) and half register for + // UL case. We'll re-read last character in inner pre-loop code to have + // single outer pre-loop load + const int firstStep = isL ? 7 : 3; + + const int ASIZE = 256; + const int STORED_BYTES = 32; // amount of bytes stored per instruction + sub(sp, sp, ASIZE); + mov(tmp5, ASIZE/STORED_BYTES); // loop iterations + mov(ch1, sp); + BIND(BM_INIT_LOOP); + stpq(v0, v0, Address(post(ch1, STORED_BYTES))); + subs(tmp5, tmp5, 1); + br(GT, BM_INIT_LOOP); - mov(cnt1tmp, 0); - sub(cnt1end, cnt1, 1); + sub(cnt1tmp, cnt1, 1); + mov(tmp5, str2); + add(str2end, str2, result_tmp, LSL, str2_chr_shift); + sub(ch2, cnt1, 1); + mov(tmp3, str1); BIND(BCLOOP); - (this->*str1_load_1chr)(ch1, Address(str1, cnt1tmp, Address::lsl(str1_chr_shift))); - cmp(ch1, 128); - add(cnt1tmp, cnt1tmp, 1); - br(HS, BCSKIP); - strb(cnt1tmp, Address(sp, ch1)); + (this->*str1_load_1chr)(ch1, Address(post(tmp3, str1_chr_size))); + if (!str1_isL) { + cmp(ch1, ASIZE); + br(HS, BCSKIP); + } + strb(ch2, Address(sp, ch1)); BIND(BCSKIP); - cmp(cnt1tmp, cnt1end); - br(LT, BCLOOP); - - mov(result_tmp, str2); + subs(ch2, ch2, 1); + br(GT, BCLOOP); - sub(cnt2, cnt2, cnt1); - add(str2end, str2, cnt2, LSL, str2_chr_shift); + add(tmp6, str1, cnt1, LSL, str1_chr_shift); // address after str1 + if (str1_isL == str2_isL) { + // load last 8 bytes (8LL/4UU symbols) + ldr(tmp6, Address(tmp6, -wordSize)); + } else { + ldrw(tmp6, Address(tmp6, -wordSize/2)); // load last 4 bytes(4 symbols) + // convert Latin1 to UTF. We'll have to wait until load completed, but + // it's still faster than per-character loads+checks + lsr(tmp3, tmp6, BitsPerByte * (wordSize/2 - str1_chr_size)); // str1[N-1] + ubfx(ch1, tmp6, 8, 8); // str1[N-2] + ubfx(ch2, tmp6, 16, 8); // str1[N-3] + andr(tmp6, tmp6, 0xFF); // str1[N-4] + orr(ch2, ch1, ch2, LSL, 16); + orr(tmp6, tmp6, tmp3, LSL, 48); + orr(tmp6, tmp6, ch2, LSL, 16); + } BIND(BMLOOPSTR2); - sub(cnt1tmp, cnt1, 1); - (this->*str1_load_1chr)(ch1, Address(str1, cnt1tmp, Address::lsl(str1_chr_shift))); (this->*str2_load_1chr)(skipch, Address(str2, cnt1tmp, Address::lsl(str2_chr_shift))); - cmp(ch1, skipch); + sub(cnt1tmp, cnt1tmp, firstStep); // cnt1tmp is positive here, because cnt1 >= 8 + if (str1_isL == str2_isL) { + // re-init tmp3. It's for free because it's executed in parallel with + // load above. Alternative is to initialize it before loop, but it'll + // affect performance on in-order systems with 2 or more ld/st pipelines + lsr(tmp3, tmp6, BitsPerByte * (wordSize - str1_chr_size)); + } + if (!isL) { // UU/UL case + lsl(ch2, cnt1tmp, 1); // offset in bytes + } + cmp(tmp3, skipch); br(NE, BMSKIP); - subs(cnt1tmp, cnt1tmp, 1); - br(LT, BMMATCH); + ldr(ch2, Address(str2, isL ? cnt1tmp : ch2)); + mov(ch1, tmp6); + if (isL) { + b(BMLOOPSTR1_AFTER_LOAD); + } else { + sub(cnt1tmp, cnt1tmp, 1); // no need to branch for UU/UL case. cnt1 >= 8 + b(BMLOOPSTR1_CMP); + } BIND(BMLOOPSTR1); (this->*str1_load_1chr)(ch1, Address(str1, cnt1tmp, Address::lsl(str1_chr_shift))); (this->*str2_load_1chr)(ch2, Address(str2, cnt1tmp, Address::lsl(str2_chr_shift))); - cmp(ch1, ch2); - br(NE, BMSKIP); + BIND(BMLOOPSTR1_AFTER_LOAD); subs(cnt1tmp, cnt1tmp, 1); - br(GE, BMLOOPSTR1); - BIND(BMMATCH); - sub(result, str2, result_tmp); - if (!str2_isL) lsr(result, result, 1); - add(sp, sp, 128); - b(DONE); - BIND(BMADV); - add(str2, str2, str2_chr_size); - b(BMCHECKEND); + br(LT, BMLOOPSTR1_LASTCMP); + BIND(BMLOOPSTR1_CMP); + cmp(ch1, ch2); + br(EQ, BMLOOPSTR1); BIND(BMSKIP); - cmp(skipch, 128); - br(HS, BMADV); - ldrb(ch2, Address(sp, skipch)); - add(str2, str2, cnt1, LSL, str2_chr_shift); - sub(str2, str2, ch2, LSL, str2_chr_shift); - BIND(BMCHECKEND); + if (!isL) { + // if we've met UTF symbol while searching Latin1 pattern, then we can + // skip cnt1 symbols + if (str1_isL != str2_isL) { + mov(result_tmp, cnt1); + } else { + mov(result_tmp, 1); + } + cmp(skipch, ASIZE); + br(HS, BMADV); + } + ldrb(result_tmp, Address(sp, skipch)); // load skip distance + BIND(BMADV); + sub(cnt1tmp, cnt1, 1); + add(str2, str2, result_tmp, LSL, str2_chr_shift); cmp(str2, str2end); br(LE, BMLOOPSTR2); - add(sp, sp, 128); + add(sp, sp, ASIZE); b(NOMATCH); + BIND(BMLOOPSTR1_LASTCMP); + cmp(ch1, ch2); + br(NE, BMSKIP); + BIND(BMMATCH); + sub(result, str2, tmp5); + if (!str2_isL) lsr(result, result, 1); + add(sp, sp, ASIZE); + b(DONE); + + BIND(LINEARSTUB); + cmp(cnt1, 16); // small patterns still should be handled by simple algorithm + br(LT, LINEAR_MEDIUM); + mov(result, zr); + RuntimeAddress stub = NULL; + if (isL) { + stub = RuntimeAddress(StubRoutines::aarch64::string_indexof_linear_ll()); + assert(stub.target() != NULL, "string_indexof_linear_ll stub has not been generated"); + } else if (str1_isL) { + stub = RuntimeAddress(StubRoutines::aarch64::string_indexof_linear_ul()); + assert(stub.target() != NULL, "string_indexof_linear_ul stub has not been generated"); + } else { + stub = RuntimeAddress(StubRoutines::aarch64::string_indexof_linear_uu()); + assert(stub.target() != NULL, "string_indexof_linear_uu stub has not been generated"); + } + trampoline_call(stub); + b(DONE); } BIND(LINEARSEARCH); @@ -4578,15 +4587,12 @@ cmp(cnt1, str1_isL == str2_isL ? 4 : 2); br(LT, DOSHORT); - - sub(cnt2, cnt2, cnt1); - mov(result_tmp, cnt2); - + BIND(LINEAR_MEDIUM); + (this->*str1_load_1chr)(first, Address(str1)); lea(str1, Address(str1, cnt1, Address::lsl(str1_chr_shift))); - lea(str2, Address(str2, cnt2, Address::lsl(str2_chr_shift))); sub(cnt1_neg, zr, cnt1, LSL, str1_chr_shift); - sub(cnt2_neg, zr, cnt2, LSL, str2_chr_shift); - (this->*str1_load_1chr)(first, Address(str1, cnt1_neg)); + lea(str2, Address(str2, result_tmp, Address::lsl(str2_chr_shift))); + sub(cnt2_neg, zr, result_tmp, LSL, str2_chr_shift); BIND(FIRST_LOOP); (this->*str2_load_1chr)(ch2, Address(str2, cnt2_neg)); @@ -4624,10 +4630,9 @@ Label CH1_LOOP; (this->*load_4chr)(ch1, str1); - sub(cnt2, cnt2, 4); - mov(result_tmp, cnt2); - lea(str2, Address(str2, cnt2, Address::lsl(str2_chr_shift))); - sub(cnt2_neg, zr, cnt2, LSL, str2_chr_shift); + sub(result_tmp, cnt2, 4); + lea(str2, Address(str2, result_tmp, Address::lsl(str2_chr_shift))); + sub(cnt2_neg, zr, result_tmp, LSL, str2_chr_shift); BIND(CH1_LOOP); (this->*load_4chr)(ch2, Address(str2, cnt2_neg)); @@ -4636,18 +4641,18 @@ adds(cnt2_neg, cnt2_neg, str2_chr_size); br(LE, CH1_LOOP); b(NOMATCH); - } + } if ((icnt1 == -1 && str1_isL == str2_isL) || icnt1 == 2) { Label CH1_LOOP; BIND(DO2); (this->*load_2chr)(ch1, str1); - sub(cnt2, cnt2, 2); - mov(result_tmp, cnt2); - lea(str2, Address(str2, cnt2, Address::lsl(str2_chr_shift))); - sub(cnt2_neg, zr, cnt2, LSL, str2_chr_shift); - + if (icnt1 == 2) { + sub(result_tmp, cnt2, 2); + } + lea(str2, Address(str2, result_tmp, Address::lsl(str2_chr_shift))); + sub(cnt2_neg, zr, result_tmp, LSL, str2_chr_shift); BIND(CH1_LOOP); (this->*load_2chr)(ch2, Address(str2, cnt2_neg)); cmp(ch1, ch2); @@ -4663,12 +4668,11 @@ BIND(DO3); (this->*load_2chr)(first, str1); (this->*str1_load_1chr)(ch1, Address(str1, 2*str1_chr_size)); - - sub(cnt2, cnt2, 3); - mov(result_tmp, cnt2); - lea(str2, Address(str2, cnt2, Address::lsl(str2_chr_shift))); - sub(cnt2_neg, zr, cnt2, LSL, str2_chr_shift); - + if (icnt1 == 3) { + sub(result_tmp, cnt2, 3); + } + lea(str2, Address(str2, result_tmp, Address::lsl(str2_chr_shift))); + sub(cnt2_neg, zr, result_tmp, LSL, str2_chr_shift); BIND(FIRST_LOOP); (this->*load_2chr)(ch2, Address(str2, cnt2_neg)); cmpw(first, ch2); @@ -4687,30 +4691,23 @@ } if (icnt1 == -1 || icnt1 == 1) { - Label CH1_LOOP, HAS_ZERO; - Label DO1_SHORT, DO1_LOOP; + Label CH1_LOOP, HAS_ZERO, DO1_SHORT, DO1_LOOP; BIND(DO1); (this->*str1_load_1chr)(ch1, str1); cmp(cnt2, 8); br(LT, DO1_SHORT); + sub(result_tmp, cnt2, 8/str2_chr_size); + sub(cnt2_neg, zr, result_tmp, LSL, str2_chr_shift); + mov(tmp3, str2_isL ? 0x0101010101010101 : 0x0001000100010001); + lea(str2, Address(str2, result_tmp, Address::lsl(str2_chr_shift))); + if (str2_isL) { - if (!str1_isL) { - tst(ch1, 0xff00); - br(NE, NOMATCH); - } orr(ch1, ch1, ch1, LSL, 8); } orr(ch1, ch1, ch1, LSL, 16); orr(ch1, ch1, ch1, LSL, 32); - - sub(cnt2, cnt2, 8/str2_chr_size); - mov(result_tmp, cnt2); - lea(str2, Address(str2, cnt2, Address::lsl(str2_chr_shift))); - sub(cnt2_neg, zr, cnt2, LSL, str2_chr_shift); - - mov(tmp3, str2_isL ? 0x0101010101010101 : 0x0001000100010001); BIND(CH1_LOOP); ldr(ch2, Address(str2, cnt2_neg)); eor(ch2, ch1, ch2); @@ -4818,12 +4815,13 @@ // Compare strings. void MacroAssembler::string_compare(Register str1, Register str2, - Register cnt1, Register cnt2, Register result, - Register tmp1, - FloatRegister vtmp, FloatRegister vtmpZ, int ae) { - Label LENGTH_DIFF, DONE, SHORT_LOOP, SHORT_STRING, - NEXT_WORD, DIFFERENCE; + Register cnt1, Register cnt2, Register result, Register tmp1, Register tmp2, + FloatRegister vtmp1, FloatRegister vtmp2, FloatRegister vtmp3, int ae) { + Label DONE, SHORT_LOOP, SHORT_STRING, SHORT_LAST, TAIL, STUB, + DIFFERENCE, NEXT_WORD, SHORT_LOOP_TAIL, SHORT_LAST2, SHORT_LAST_INIT, + SHORT_LOOP_START, TAIL_CHECK; + const int STUB_THRESHOLD = 64 + 8; bool isLL = ae == StrIntrinsicNode::LL; bool isLU = ae == StrIntrinsicNode::LU; bool isUL = ae == StrIntrinsicNode::UL; @@ -4835,7 +4833,9 @@ int str2_chr_shift = str2_isL ? 0 : 1; int str1_chr_size = str1_isL ? 1 : 2; int str2_chr_size = str2_isL ? 1 : 2; + int minCharsInWord = isLL ? wordSize : wordSize/2; + FloatRegister vtmpZ = vtmp1, vtmp = vtmp2; chr_insn str1_load_chr = str1_isL ? (chr_insn)&MacroAssembler::ldrb : (chr_insn)&MacroAssembler::ldrh; chr_insn str2_load_chr = str2_isL ? (chr_insn)&MacroAssembler::ldrb : @@ -4851,73 +4851,116 @@ if (!str2_isL) asrw(cnt2, cnt2, 1); // Compute the minimum of the string lengths and save the difference. - subsw(tmp1, cnt1, cnt2); + subsw(result, cnt1, cnt2); cselw(cnt2, cnt1, cnt2, Assembler::LE); // min // A very short string - cmpw(cnt2, isLL ? 8:4); + cmpw(cnt2, minCharsInWord); br(Assembler::LT, SHORT_STRING); - // Check if the strings start at the same location. - cmp(str1, str2); - br(Assembler::EQ, LENGTH_DIFF); - // Compare longwords + // load first parts of strings and finish initialization while loading { - subw(cnt2, cnt2, isLL ? 8:4); // The last longword is a special case - - // Move both string pointers to the last longword of their - // strings, negate the remaining count, and convert it to bytes. - lea(str1, Address(str1, cnt2, Address::uxtw(str1_chr_shift))); - lea(str2, Address(str2, cnt2, Address::uxtw(str2_chr_shift))); - if (isLU || isUL) { + if (str1_isL == str2_isL) { // LL or UU + ldr(tmp1, Address(str1)); + cmp(str1, str2); + br(Assembler::EQ, DONE); + ldr(tmp2, Address(str2)); + cmp(cnt2, STUB_THRESHOLD); + br(GE, STUB); + subsw(cnt2, cnt2, minCharsInWord); + br(EQ, TAIL_CHECK); + lea(str2, Address(str2, cnt2, Address::uxtw(str2_chr_shift))); + lea(str1, Address(str1, cnt2, Address::uxtw(str1_chr_shift))); + sub(cnt2, zr, cnt2, LSL, str2_chr_shift); + } else if (isLU) { + ldrs(vtmp, Address(str1)); + cmp(str1, str2); + br(Assembler::EQ, DONE); + ldr(tmp2, Address(str2)); + cmp(cnt2, STUB_THRESHOLD); + br(GE, STUB); + subsw(cnt2, cnt2, 4); + br(EQ, TAIL_CHECK); + eor(vtmpZ, T16B, vtmpZ, vtmpZ); + lea(str1, Address(str1, cnt2, Address::uxtw(str1_chr_shift))); + lea(str2, Address(str2, cnt2, Address::uxtw(str2_chr_shift))); + zip1(vtmp, T8B, vtmp, vtmpZ); sub(cnt1, zr, cnt2, LSL, str1_chr_shift); + sub(cnt2, zr, cnt2, LSL, str2_chr_shift); + add(cnt1, cnt1, 4); + fmovd(tmp1, vtmp); + } else { // UL case + ldr(tmp1, Address(str1)); + cmp(str1, str2); + br(Assembler::EQ, DONE); + ldrs(vtmp, Address(str2)); + cmp(cnt2, STUB_THRESHOLD); + br(GE, STUB); + subsw(cnt2, cnt2, 4); + br(EQ, TAIL_CHECK); + lea(str1, Address(str1, cnt2, Address::uxtw(str1_chr_shift))); eor(vtmpZ, T16B, vtmpZ, vtmpZ); - } - sub(cnt2, zr, cnt2, LSL, str2_chr_shift); - - // Loop, loading longwords and comparing them into rscratch2. + lea(str2, Address(str2, cnt2, Address::uxtw(str2_chr_shift))); + sub(cnt1, zr, cnt2, LSL, str1_chr_shift); + zip1(vtmp, T8B, vtmp, vtmpZ); + sub(cnt2, zr, cnt2, LSL, str2_chr_shift); + add(cnt1, cnt1, 8); + fmovd(tmp2, vtmp); + } + adds(cnt2, cnt2, isUL ? 4 : 8); + br(GE, TAIL); + eor(rscratch2, tmp1, tmp2); + cbnz(rscratch2, DIFFERENCE); + // main loop bind(NEXT_WORD); - if (isLU) { + if (str1_isL == str2_isL) { + ldr(tmp1, Address(str1, cnt2)); + ldr(tmp2, Address(str2, cnt2)); + adds(cnt2, cnt2, 8); + } else if (isLU) { ldrs(vtmp, Address(str1, cnt1)); + ldr(tmp2, Address(str2, cnt2)); + add(cnt1, cnt1, 4); zip1(vtmp, T8B, vtmp, vtmpZ); - umov(result, vtmp, D, 0); - } else { - ldr(result, Address(str1, isUL ? cnt1:cnt2)); - } - if (isUL) { + fmovd(tmp1, vtmp); + adds(cnt2, cnt2, 8); + } else { // UL ldrs(vtmp, Address(str2, cnt2)); + ldr(tmp1, Address(str1, cnt1)); zip1(vtmp, T8B, vtmp, vtmpZ); - umov(rscratch1, vtmp, D, 0); - } else { - ldr(rscratch1, Address(str2, cnt2)); - } - adds(cnt2, cnt2, isUL ? 4:8); - if (isLU || isUL) add(cnt1, cnt1, isLU ? 4:8); - eor(rscratch2, result, rscratch1); + add(cnt1, cnt1, 8); + fmovd(tmp2, vtmp); + adds(cnt2, cnt2, 4); + } + br(GE, TAIL); + + eor(rscratch2, tmp1, tmp2); + cbz(rscratch2, NEXT_WORD); + b(DIFFERENCE); + bind(TAIL); + eor(rscratch2, tmp1, tmp2); cbnz(rscratch2, DIFFERENCE); - br(Assembler::LT, NEXT_WORD); - // Last longword. In the case where length == 4 we compare the // same longword twice, but that's still faster than another // conditional branch. - - if (isLU) { + if (str1_isL == str2_isL) { + ldr(tmp1, Address(str1)); + ldr(tmp2, Address(str2)); + } else if (isLU) { ldrs(vtmp, Address(str1)); + ldr(tmp2, Address(str2)); zip1(vtmp, T8B, vtmp, vtmpZ); - umov(result, vtmp, D, 0); - } else { - ldr(result, Address(str1)); - } - if (isUL) { + fmovd(tmp1, vtmp); + } else { // UL ldrs(vtmp, Address(str2)); + ldr(tmp1, Address(str1)); zip1(vtmp, T8B, vtmp, vtmpZ); - umov(rscratch1, vtmp, D, 0); - } else { - ldr(rscratch1, Address(str2)); + fmovd(tmp2, vtmp); } - eor(rscratch2, result, rscratch1); - cbz(rscratch2, LENGTH_DIFF); + bind(TAIL_CHECK); + eor(rscratch2, tmp1, tmp2); + cbz(rscratch2, DONE); // Find the first different characters in the longwords and // compute their difference. @@ -4925,31 +4968,78 @@ rev(rscratch2, rscratch2); clz(rscratch2, rscratch2); andr(rscratch2, rscratch2, isLL ? -8 : -16); - lsrv(result, result, rscratch2); - (this->*ext_chr)(result, result); - lsrv(rscratch1, rscratch1, rscratch2); - (this->*ext_chr)(rscratch1, rscratch1); - subw(result, result, rscratch1); + lsrv(tmp1, tmp1, rscratch2); + (this->*ext_chr)(tmp1, tmp1); + lsrv(tmp2, tmp2, rscratch2); + (this->*ext_chr)(tmp2, tmp2); + subw(result, tmp1, tmp2); b(DONE); } + bind(STUB); + RuntimeAddress stub = NULL; + switch(ae) { + case StrIntrinsicNode::LL: + stub = RuntimeAddress(StubRoutines::aarch64::compare_long_string_LL()); + break; + case StrIntrinsicNode::UU: + stub = RuntimeAddress(StubRoutines::aarch64::compare_long_string_UU()); + break; + case StrIntrinsicNode::LU: + stub = RuntimeAddress(StubRoutines::aarch64::compare_long_string_LU()); + break; + case StrIntrinsicNode::UL: + stub = RuntimeAddress(StubRoutines::aarch64::compare_long_string_UL()); + break; + default: + ShouldNotReachHere(); + } + assert(stub.target() != NULL, "compare_long_string stub has not been generated"); + trampoline_call(stub); + b(DONE); + bind(SHORT_STRING); // Is the minimum length zero? - cbz(cnt2, LENGTH_DIFF); - + cbz(cnt2, DONE); + // arrange code to do most branches while loading and loading next characters + // while comparing previous + (this->*str1_load_chr)(tmp1, Address(post(str1, str1_chr_size))); + subs(cnt2, cnt2, 1); + br(EQ, SHORT_LAST_INIT); + (this->*str2_load_chr)(cnt1, Address(post(str2, str2_chr_size))); + b(SHORT_LOOP_START); bind(SHORT_LOOP); - (this->*str1_load_chr)(result, Address(post(str1, str1_chr_size))); + subs(cnt2, cnt2, 1); + br(EQ, SHORT_LAST); + bind(SHORT_LOOP_START); + (this->*str1_load_chr)(tmp2, Address(post(str1, str1_chr_size))); + (this->*str2_load_chr)(rscratch1, Address(post(str2, str2_chr_size))); + cmp(tmp1, cnt1); + br(NE, SHORT_LOOP_TAIL); + subs(cnt2, cnt2, 1); + br(EQ, SHORT_LAST2); + (this->*str1_load_chr)(tmp1, Address(post(str1, str1_chr_size))); + (this->*str2_load_chr)(cnt1, Address(post(str2, str2_chr_size))); + cmp(tmp2, rscratch1); + br(EQ, SHORT_LOOP); + sub(result, tmp2, rscratch1); + b(DONE); + bind(SHORT_LOOP_TAIL); + sub(result, tmp1, cnt1); + b(DONE); + bind(SHORT_LAST2); + cmp(tmp2, rscratch1); + br(EQ, DONE); + sub(result, tmp2, rscratch1); + + b(DONE); + bind(SHORT_LAST_INIT); (this->*str2_load_chr)(cnt1, Address(post(str2, str2_chr_size))); - subw(result, result, cnt1); - cbnz(result, DONE); - sub(cnt2, cnt2, 1); - cbnz(cnt2, SHORT_LOOP); - - // Strings are equal up to min length. Return the length difference. - bind(LENGTH_DIFF); - mov(result, tmp1); + bind(SHORT_LAST); + cmp(tmp1, cnt1); + br(EQ, DONE); + sub(result, tmp1, cnt1); - // That's it bind(DONE); BLOCK_COMMENT("} string_compare"); @@ -5013,9 +5103,8 @@ void MacroAssembler::arrays_equals(Register a1, Register a2, Register tmp3, Register tmp4, Register tmp5, Register result, - Register cnt1, int elem_size) -{ - Label DONE; + Register cnt1, int elem_size) { + Label DONE, SAME; Register tmp1 = rscratch1; Register tmp2 = rscratch2; Register cnt2 = tmp2; // cnt2 only used in array length compare @@ -5037,21 +5126,21 @@ BLOCK_COMMENT(comment); } #endif + + // if (a1 == a2) + // return true; + cmpoop(a1, a2); // May have read barriers for a1 and a2. + br(EQ, SAME); + if (UseSimpleArrayEquals) { - Label NEXT_WORD, SHORT, SAME, TAIL03, TAIL01, A_MIGHT_BE_NULL, A_IS_NOT_NULL; - // if (a1==a2) - // return true; - // if (a==null || a2==null) + Label NEXT_WORD, SHORT, TAIL03, TAIL01, A_MIGHT_BE_NULL, A_IS_NOT_NULL; + // if (a1 == null || a2 == null) // return false; // a1 & a2 == 0 means (some-pointer is null) or // (very-rare-or-even-probably-impossible-pointer-values) // so, we can save one branch in most cases - cmpoop(a1, a2); - br(EQ, SAME); - eor(rscratch1, a1, a2); tst(a1, a2); mov(result, false); - cbz(rscratch1, SAME); br(EQ, A_MIGHT_BE_NULL); // if (a1.length != a2.length) // return false; @@ -5117,22 +5206,18 @@ cbnzw(tmp5, DONE); } } - bind(SAME); - mov(result, true); } else { - Label NEXT_DWORD, A_IS_NULL, SHORT, TAIL, TAIL2, STUB, EARLY_OUT, - CSET_EQ, LAST_CHECK, LEN_IS_ZERO, SAME; - cbz(a1, A_IS_NULL); + Label NEXT_DWORD, SHORT, TAIL, TAIL2, STUB, EARLY_OUT, + CSET_EQ, LAST_CHECK; + mov(result, false); + cbz(a1, DONE); ldrw(cnt1, Address(a1, length_offset)); - cbz(a2, A_IS_NULL); + cbz(a2, DONE); ldrw(cnt2, Address(a2, length_offset)); - mov(result, false); // on most CPUs a2 is still "locked"(surprisingly) in ldrw and it's // faster to perform another branch before comparing a1 and a2 cmp(cnt1, elem_per_word); br(LE, SHORT); // short or same - cmpoop(a1, a2); - br(EQ, SAME); ldr(tmp3, Address(pre(a1, base_offset))); cmp(cnt1, stubBytesThreshold); br(GE, STUB); @@ -5184,23 +5269,15 @@ trampoline_call(stub); b(DONE); - bind(SAME); - mov(result, true); - b(DONE); - bind(A_IS_NULL); - // a1 or a2 is null. if a2 == a2 then return true. else return false - cmp(a1, a2); - b(CSET_EQ); bind(EARLY_OUT); // (a1 != null && a2 == null) || (a1 != null && a2 != null && a1 == a2) // so, if a2 == null => return false(0), else return true, so we can return a2 mov(result, a2); b(DONE); - bind(LEN_IS_ZERO); - cmp(cnt2, zr); - b(CSET_EQ); bind(SHORT); - cbz(cnt1, LEN_IS_ZERO); + cmp(cnt2, cnt1); + br(NE, DONE); + cbz(cnt1, SAME); sub(tmp5, zr, cnt1, LSL, 3 + log_elem_size); ldr(tmp3, Address(a1, base_offset)); ldr(tmp4, Address(a2, base_offset)); @@ -5210,8 +5287,11 @@ cmp(tmp5, zr); bind(CSET_EQ); cset(result, EQ); + b(DONE); } + bind(SAME); + mov(result, true); // That's it. bind(DONE); @@ -5503,65 +5583,103 @@ FloatRegister Vtmp1, FloatRegister Vtmp2, FloatRegister Vtmp3, FloatRegister Vtmp4) { - Label DONE, NEXT_32, LOOP_8, NEXT_8, LOOP_1, NEXT_1; - Register tmp1 = rscratch1; + Label DONE, SET_RESULT, NEXT_32, NEXT_32_PRFM, LOOP_8, NEXT_8, LOOP_1, NEXT_1, + NEXT_32_START, NEXT_32_PRFM_START; + Register tmp1 = rscratch1, tmp2 = rscratch2; mov(result, len); // Save initial len #ifndef BUILTIN_SIM - subs(len, len, 32); - br(LT, LOOP_8); - -// The following code uses the SIMD 'uqxtn' and 'uqxtn2' instructions -// to convert chars to bytes. These set the 'QC' bit in the FPSR if -// any char could not fit in a byte, so clear the FPSR so we can test it. - clear_fpsr(); - - BIND(NEXT_32); - ld1(Vtmp1, Vtmp2, Vtmp3, Vtmp4, T8H, src); - uqxtn(Vtmp1, T8B, Vtmp1, T8H); // uqxtn - write bottom half - uqxtn(Vtmp1, T16B, Vtmp2, T8H); // uqxtn2 - write top half - uqxtn(Vtmp2, T8B, Vtmp3, T8H); - uqxtn(Vtmp2, T16B, Vtmp4, T8H); // uqxtn2 - get_fpsr(tmp1); - cbnzw(tmp1, LOOP_8); - st1(Vtmp1, Vtmp2, T16B, post(dst, 32)); - subs(len, len, 32); + cmp(len, 8); // handle shortest strings first + br(LT, LOOP_1); + cmp(len, 32); + br(LT, NEXT_8); + // The following code uses the SIMD 'uzp1' and 'uzp2' instructions + // to convert chars to bytes + if (SoftwarePrefetchHintDistance >= 0) { + ld1(Vtmp1, Vtmp2, Vtmp3, Vtmp4, T8H, src); + cmp(len, SoftwarePrefetchHintDistance/2 + 16); + br(LE, NEXT_32_START); + b(NEXT_32_PRFM_START); + BIND(NEXT_32_PRFM); + ld1(Vtmp1, Vtmp2, Vtmp3, Vtmp4, T8H, src); + BIND(NEXT_32_PRFM_START); + prfm(Address(src, SoftwarePrefetchHintDistance)); + orr(v4, T16B, Vtmp1, Vtmp2); + orr(v5, T16B, Vtmp3, Vtmp4); + uzp1(Vtmp1, T16B, Vtmp1, Vtmp2); + uzp1(Vtmp3, T16B, Vtmp3, Vtmp4); + stpq(Vtmp1, Vtmp3, dst); + uzp2(v5, T16B, v4, v5); // high bytes + umov(tmp2, v5, D, 1); + fmovd(tmp1, v5); + orr(tmp1, tmp1, tmp2); + cbnz(tmp1, LOOP_8); + sub(len, len, 32); + add(dst, dst, 32); + add(src, src, 64); + cmp(len, SoftwarePrefetchHintDistance/2 + 16); + br(GE, NEXT_32_PRFM); + cmp(len, 32); + br(LT, LOOP_8); + BIND(NEXT_32); + ld1(Vtmp1, Vtmp2, Vtmp3, Vtmp4, T8H, src); + BIND(NEXT_32_START); + } else { + BIND(NEXT_32); + ld1(Vtmp1, Vtmp2, Vtmp3, Vtmp4, T8H, src); + } + prfm(Address(src, SoftwarePrefetchHintDistance)); + uzp1(v4, T16B, Vtmp1, Vtmp2); + uzp1(v5, T16B, Vtmp3, Vtmp4); + stpq(v4, v5, dst); + orr(Vtmp1, T16B, Vtmp1, Vtmp2); + orr(Vtmp3, T16B, Vtmp3, Vtmp4); + uzp2(Vtmp1, T16B, Vtmp1, Vtmp3); // high bytes + umov(tmp2, Vtmp1, D, 1); + fmovd(tmp1, Vtmp1); + orr(tmp1, tmp1, tmp2); + cbnz(tmp1, LOOP_8); + sub(len, len, 32); + add(dst, dst, 32); add(src, src, 64); + cmp(len, 32); br(GE, NEXT_32); + cbz(len, DONE); BIND(LOOP_8); - adds(len, len, 32-8); + cmp(len, 8); br(LT, LOOP_1); - clear_fpsr(); // QC may be set from loop above, clear again BIND(NEXT_8); ld1(Vtmp1, T8H, src); - uqxtn(Vtmp1, T8B, Vtmp1, T8H); - get_fpsr(tmp1); - cbnzw(tmp1, LOOP_1); - st1(Vtmp1, T8B, post(dst, 8)); - subs(len, len, 8); + uzp1(Vtmp2, T16B, Vtmp1, Vtmp1); // low bytes + uzp2(Vtmp3, T16B, Vtmp1, Vtmp1); // high bytes + strd(Vtmp2, dst); + fmovd(tmp1, Vtmp3); + cbnz(tmp1, NEXT_1); + + sub(len, len, 8); + add(dst, dst, 8); add(src, src, 16); + cmp(len, 8); br(GE, NEXT_8); BIND(LOOP_1); - adds(len, len, 8); - br(LE, DONE); -#else - cbz(len, DONE); #endif + cbz(len, DONE); BIND(NEXT_1); ldrh(tmp1, Address(post(src, 2))); - tst(tmp1, 0xff00); - br(NE, DONE); strb(tmp1, Address(post(dst, 1))); + tst(tmp1, 0xff00); + br(NE, SET_RESULT); subs(len, len, 1); br(GT, NEXT_1); - BIND(DONE); + BIND(SET_RESULT); sub(result, result, len); // Return index where we stopped // Return len == 0 if we processed all // characters + BIND(DONE); } @@ -5569,26 +5687,24 @@ void MacroAssembler::byte_array_inflate(Register src, Register dst, Register len, FloatRegister vtmp1, FloatRegister vtmp2, FloatRegister vtmp3, Register tmp4) { - Label big, done; + Label big, done, after_init, to_stub; assert_different_registers(src, dst, len, tmp4, rscratch1); - fmovd(vtmp1 , zr); - lsrw(rscratch1, len, 3); - - cbnzw(rscratch1, big); - + fmovd(vtmp1, zr); + lsrw(tmp4, len, 3); + bind(after_init); + cbnzw(tmp4, big); // Short string: less than 8 bytes. { - Label loop, around, tiny; - - subsw(len, len, 4); - andw(len, len, 3); - br(LO, tiny); + Label loop, tiny; + cmpw(len, 4); + br(LT, tiny); // Use SIMD to do 4 bytes. ldrs(vtmp2, post(src, 4)); zip1(vtmp3, T8B, vtmp2, vtmp1); + subw(len, len, 4); strd(vtmp3, post(dst, 8)); cbzw(len, done); @@ -5602,35 +5718,65 @@ bind(tiny); cbnz(len, loop); - bind(around); b(done); } + if (SoftwarePrefetchHintDistance >= 0) { + bind(to_stub); + RuntimeAddress stub = RuntimeAddress(StubRoutines::aarch64::large_byte_array_inflate()); + assert(stub.target() != NULL, "large_byte_array_inflate stub has not been generated"); + trampoline_call(stub); + b(after_init); + } + // Unpack the bytes 8 at a time. bind(big); - andw(len, len, 7); - { - Label loop, around; - - bind(loop); - ldrd(vtmp2, post(src, 8)); - sub(rscratch1, rscratch1, 1); - zip1(vtmp3, T16B, vtmp2, vtmp1); - st1(vtmp3, T8H, post(dst, 16)); - cbnz(rscratch1, loop); + Label loop, around, loop_last, loop_start; - bind(around); + if (SoftwarePrefetchHintDistance >= 0) { + const int large_loop_threshold = (64 + 16)/8; + ldrd(vtmp2, post(src, 8)); + andw(len, len, 7); + cmp(tmp4, large_loop_threshold); + br(GE, to_stub); + b(loop_start); + + bind(loop); + ldrd(vtmp2, post(src, 8)); + bind(loop_start); + subs(tmp4, tmp4, 1); + br(EQ, loop_last); + zip1(vtmp2, T16B, vtmp2, vtmp1); + ldrd(vtmp3, post(src, 8)); + st1(vtmp2, T8H, post(dst, 16)); + subs(tmp4, tmp4, 1); + zip1(vtmp3, T16B, vtmp3, vtmp1); + st1(vtmp3, T8H, post(dst, 16)); + br(NE, loop); + b(around); + bind(loop_last); + zip1(vtmp2, T16B, vtmp2, vtmp1); + st1(vtmp2, T8H, post(dst, 16)); + bind(around); + cbz(len, done); + } else { + andw(len, len, 7); + bind(loop); + ldrd(vtmp2, post(src, 8)); + sub(tmp4, tmp4, 1); + zip1(vtmp3, T16B, vtmp2, vtmp1); + st1(vtmp3, T8H, post(dst, 16)); + cbnz(tmp4, loop); + } } // Do the tail of up to 8 bytes. - sub(src, src, 8); - add(src, src, len, ext::uxtw, 0); - ldrd(vtmp2, Address(src)); - sub(dst, dst, 16); + add(src, src, len); + ldrd(vtmp3, Address(src, -8)); add(dst, dst, len, ext::uxtw, 1); - zip1(vtmp3, T16B, vtmp2, vtmp1); - st1(vtmp3, T8H, Address(dst)); + zip1(vtmp3, T16B, vtmp3, vtmp1); + strq(vtmp3, Address(dst, -16)); bind(done); } diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp openjdk-11-11~24/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/macroAssembler_aarch64.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -866,10 +866,6 @@ void zero_memory(Register addr, Register len, Register t1); void verify_tlab(); - void incr_allocated_bytes(Register thread, - Register var_size_in_bytes, int con_size_in_bytes, - Register t1 = noreg); - // interface method calling void lookup_interface_method(Register recv_klass, Register intf_klass, @@ -1216,8 +1212,8 @@ void string_compare(Register str1, Register str2, Register cnt1, Register cnt2, Register result, - Register tmp1, - FloatRegister vtmp, FloatRegister vtmpZ, int ae); + Register tmp1, Register tmp2, FloatRegister vtmp1, + FloatRegister vtmp2, FloatRegister vtmp3, int ae); void has_negatives(Register ary1, Register len, Register result); @@ -1251,11 +1247,25 @@ Register cnt1, Register cnt2, Register tmp1, Register tmp2, Register tmp3, Register tmp4, + Register tmp5, Register tmp6, int int_cnt1, Register result, int ae); void string_indexof_char(Register str1, Register cnt1, Register ch, Register result, Register tmp1, Register tmp2, Register tmp3); -private: + void fast_log(FloatRegister vtmp0, FloatRegister vtmp1, FloatRegister vtmp2, + FloatRegister vtmp3, FloatRegister vtmp4, FloatRegister vtmp5, + FloatRegister tmpC1, FloatRegister tmpC2, FloatRegister tmpC3, + FloatRegister tmpC4, Register tmp1, Register tmp2, + Register tmp3, Register tmp4, Register tmp5); + void generate_dsin_dcos(bool isCos, address npio2_hw, address two_over_pi, + address pio2, address dsin_coef, address dcos_coef); + private: + // begin trigonometric functions support block + void generate__ieee754_rem_pio2(address npio2_hw, address two_over_pi, address pio2); + void generate__kernel_rem_pio2(address two_over_pi, address pio2); + void generate_kernel_sin(FloatRegister x, bool iyIsOne, address dsin_coef); + void generate_kernel_cos(FloatRegister x, address dcos_coef); + // end trigonometric functions support block void add2_with_carry(Register final_dest_hi, Register dest_hi, Register dest_lo, Register src1, Register src2); void add2_with_carry(Register dest_hi, Register dest_lo, Register src1, Register src2) { diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/macroAssembler_aarch64_log.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,365 @@ +/* Copyright (c) 2018, Cavium. All rights reserved. (By BELLSOFT) + * Copyright (c) 2016, Intel Corporation. + * Intel Math Library (LIBM) Source Code + * + * 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 "asm/assembler.hpp" +#include "asm/assembler.inline.hpp" +#include "macroAssembler_aarch64.hpp" + +// Algorithm idea is taken from x86 hotspot intrinsic and adapted for AARCH64. +// +// For mathematical background please refer to the following literature: +// +// Tang, Ping-Tak Peter. +// Table-driven implementation of the logarithm function +// in IEEE floating-point arithmetic. +// ACM Transactions on Mathematical Software (TOMS) 16, no. 4, 1990: 378-400. + +/******************************************************************************/ +// ALGORITHM DESCRIPTION - LOG() +// --------------------- +// +// x=2^k * mx, mx in [1,2) +// +// Get B~1/mx based on the output of frecpe instruction (B0) +// B = int((B0*2^7+0.5))/2^7 +// +// Reduced argument: r=B*mx-1.0 (computed accurately in high and low parts) +// +// Result: k*log(2) - log(B) + p(r) if |x-1| >= small value (2^-6) and +// p(r) is a degree 7 polynomial +// -log(B) read from data table (high, low parts) +// Result is formed from high and low parts +// +// Special cases: +// 1. log(NaN) = quiet NaN +// 2. log(+INF) = that INF +// 3. log(0) = -INF +// 4. log(1) = +0 +// 5. log(x) = NaN if x < -0, including -INF +// +/******************************************************************************/ + +// Table with p(r) polynomial coefficients +// and table representation of logarithm values (hi and low parts) +__attribute__ ((aligned(64))) juint _L_tbl[] = +{ + // coefficients of p(r) polynomial: + // _coeff[] + 0x00000000UL, 0xbfd00000UL, // C1_0 = -0.25 + 0x92492492UL, 0x3fc24924UL, // C1_1 = 0.14285714285714285 + 0x55555555UL, 0x3fd55555UL, // C2_0 = 0.3333333333333333 + 0x3d6fb175UL, 0xbfc5555eUL, // C2_1 = -0.16666772842235003 + 0x00000000UL, 0xbfe00000UL, // C3_0 = -0.5 + 0x9999999aUL, 0x3fc99999UL, // C3_1 = 0.2 + // _log2[] + 0xfefa3800UL, 0x3fa62e42UL, // C4_0 = 0.043321698784993146 + 0x93c76730UL, 0x3ceef357UL, // C4_1 = 3.436201886692732e-15 + // _L_tbl[] with logarithm values (hi and low parts) + 0xfefa3800UL, 0x3fe62e42UL, 0x93c76730UL, 0x3d2ef357UL, 0xaa241800UL, + 0x3fe5ee82UL, 0x0cda46beUL, 0x3d220238UL, 0x5c364800UL, 0x3fe5af40UL, + 0xac10c9fbUL, 0x3d2dfa63UL, 0x26bb8c00UL, 0x3fe5707aUL, 0xff3303ddUL, + 0x3d09980bUL, 0x26867800UL, 0x3fe5322eUL, 0x5d257531UL, 0x3d05ccc4UL, + 0x835a5000UL, 0x3fe4f45aUL, 0x6d93b8fbUL, 0xbd2e6c51UL, 0x6f970c00UL, + 0x3fe4b6fdUL, 0xed4c541cUL, 0x3cef7115UL, 0x27e8a400UL, 0x3fe47a15UL, + 0xf94d60aaUL, 0xbd22cb6aUL, 0xf2f92400UL, 0x3fe43d9fUL, 0x481051f7UL, + 0xbcfd984fUL, 0x2125cc00UL, 0x3fe4019cUL, 0x30f0c74cUL, 0xbd26ce79UL, + 0x0c36c000UL, 0x3fe3c608UL, 0x7cfe13c2UL, 0xbd02b736UL, 0x17197800UL, + 0x3fe38ae2UL, 0xbb5569a4UL, 0xbd218b7aUL, 0xad9d8c00UL, 0x3fe35028UL, + 0x9527e6acUL, 0x3d10b83fUL, 0x44340800UL, 0x3fe315daUL, 0xc5a0ed9cUL, + 0xbd274e93UL, 0x57b0e000UL, 0x3fe2dbf5UL, 0x07b9dc11UL, 0xbd17a6e5UL, + 0x6d0ec000UL, 0x3fe2a278UL, 0xe797882dUL, 0x3d206d2bUL, 0x1134dc00UL, + 0x3fe26962UL, 0x05226250UL, 0xbd0b61f1UL, 0xd8bebc00UL, 0x3fe230b0UL, + 0x6e48667bUL, 0x3d12fc06UL, 0x5fc61800UL, 0x3fe1f863UL, 0xc9fe81d3UL, + 0xbd2a7242UL, 0x49ae6000UL, 0x3fe1c078UL, 0xed70e667UL, 0x3cccacdeUL, + 0x40f23c00UL, 0x3fe188eeUL, 0xf8ab4650UL, 0x3d14cc4eUL, 0xf6f29800UL, + 0x3fe151c3UL, 0xa293ae49UL, 0xbd2edd97UL, 0x23c75c00UL, 0x3fe11af8UL, + 0xbb9ddcb2UL, 0xbd258647UL, 0x8611cc00UL, 0x3fe0e489UL, 0x07801742UL, + 0x3d1c2998UL, 0xe2d05400UL, 0x3fe0ae76UL, 0x887e7e27UL, 0x3d1f486bUL, + 0x0533c400UL, 0x3fe078bfUL, 0x41edf5fdUL, 0x3d268122UL, 0xbe760400UL, + 0x3fe04360UL, 0xe79539e0UL, 0xbd04c45fUL, 0xe5b20800UL, 0x3fe00e5aUL, + 0xb1727b1cUL, 0xbd053ba3UL, 0xaf7a4800UL, 0x3fdfb358UL, 0x3c164935UL, + 0x3d0085faUL, 0xee031800UL, 0x3fdf4aa7UL, 0x6f014a8bUL, 0x3d12cde5UL, + 0x56b41000UL, 0x3fdee2a1UL, 0x5a470251UL, 0x3d2f27f4UL, 0xc3ddb000UL, + 0x3fde7b42UL, 0x5372bd08UL, 0xbd246550UL, 0x1a272800UL, 0x3fde148aUL, + 0x07322938UL, 0xbd1326b2UL, 0x484c9800UL, 0x3fddae75UL, 0x60dc616aUL, + 0xbd1ea42dUL, 0x46def800UL, 0x3fdd4902UL, 0xe9a767a8UL, 0x3d235bafUL, + 0x18064800UL, 0x3fdce42fUL, 0x3ec7a6b0UL, 0xbd0797c3UL, 0xc7455800UL, + 0x3fdc7ff9UL, 0xc15249aeUL, 0xbd29b6ddUL, 0x693fa000UL, 0x3fdc1c60UL, + 0x7fe8e180UL, 0x3d2cec80UL, 0x1b80e000UL, 0x3fdbb961UL, 0xf40a666dUL, + 0x3d27d85bUL, 0x04462800UL, 0x3fdb56faUL, 0x2d841995UL, 0x3d109525UL, + 0x5248d000UL, 0x3fdaf529UL, 0x52774458UL, 0xbd217cc5UL, 0x3c8ad800UL, + 0x3fda93edUL, 0xbea77a5dUL, 0x3d1e36f2UL, 0x0224f800UL, 0x3fda3344UL, + 0x7f9d79f5UL, 0x3d23c645UL, 0xea15f000UL, 0x3fd9d32bUL, 0x10d0c0b0UL, + 0xbd26279eUL, 0x43135800UL, 0x3fd973a3UL, 0xa502d9f0UL, 0xbd152313UL, + 0x635bf800UL, 0x3fd914a8UL, 0x2ee6307dUL, 0xbd1766b5UL, 0xa88b3000UL, + 0x3fd8b639UL, 0xe5e70470UL, 0xbd205ae1UL, 0x776dc800UL, 0x3fd85855UL, + 0x3333778aUL, 0x3d2fd56fUL, 0x3bd81800UL, 0x3fd7fafaUL, 0xc812566aUL, + 0xbd272090UL, 0x687cf800UL, 0x3fd79e26UL, 0x2efd1778UL, 0x3d29ec7dUL, + 0x76c67800UL, 0x3fd741d8UL, 0x49dc60b3UL, 0x3d2d8b09UL, 0xe6af1800UL, + 0x3fd6e60eUL, 0x7c222d87UL, 0x3d172165UL, 0x3e9c6800UL, 0x3fd68ac8UL, + 0x2756eba0UL, 0x3d20a0d3UL, 0x0b3ab000UL, 0x3fd63003UL, 0xe731ae00UL, + 0xbd2db623UL, 0xdf596000UL, 0x3fd5d5bdUL, 0x08a465dcUL, 0xbd0a0b2aUL, + 0x53c8d000UL, 0x3fd57bf7UL, 0xee5d40efUL, 0x3d1fadedUL, 0x0738a000UL, + 0x3fd522aeUL, 0x8164c759UL, 0x3d2ebe70UL, 0x9e173000UL, 0x3fd4c9e0UL, + 0x1b0ad8a4UL, 0xbd2e2089UL, 0xc271c800UL, 0x3fd4718dUL, 0x0967d675UL, + 0xbd2f27ceUL, 0x23d5e800UL, 0x3fd419b4UL, 0xec90e09dUL, 0x3d08e436UL, + 0x77333000UL, 0x3fd3c252UL, 0xb606bd5cUL, 0x3d183b54UL, 0x76be1000UL, + 0x3fd36b67UL, 0xb0f177c8UL, 0x3d116ecdUL, 0xe1d36000UL, 0x3fd314f1UL, + 0xd3213cb8UL, 0xbd28e27aUL, 0x7cdc9000UL, 0x3fd2bef0UL, 0x4a5004f4UL, + 0x3d2a9cfaUL, 0x1134d800UL, 0x3fd26962UL, 0xdf5bb3b6UL, 0x3d2c93c1UL, + 0x6d0eb800UL, 0x3fd21445UL, 0xba46baeaUL, 0x3d0a87deUL, 0x635a6800UL, + 0x3fd1bf99UL, 0x5147bdb7UL, 0x3d2ca6edUL, 0xcbacf800UL, 0x3fd16b5cUL, + 0xf7a51681UL, 0x3d2b9acdUL, 0x8227e800UL, 0x3fd1178eUL, 0x63a5f01cUL, + 0xbd2c210eUL, 0x67616000UL, 0x3fd0c42dUL, 0x163ceae9UL, 0x3d27188bUL, + 0x604d5800UL, 0x3fd07138UL, 0x16ed4e91UL, 0x3cf89cdbUL, 0x5626c800UL, + 0x3fd01eaeUL, 0x1485e94aUL, 0xbd16f08cUL, 0x6cb3b000UL, 0x3fcf991cUL, + 0xca0cdf30UL, 0x3d1bcbecUL, 0xe4dd0000UL, 0x3fcef5adUL, 0x65bb8e11UL, + 0xbcca2115UL, 0xffe71000UL, 0x3fce530eUL, 0x6041f430UL, 0x3cc21227UL, + 0xb0d49000UL, 0x3fcdb13dUL, 0xf715b035UL, 0xbd2aff2aUL, 0xf2656000UL, + 0x3fcd1037UL, 0x75b6f6e4UL, 0xbd084a7eUL, 0xc6f01000UL, 0x3fcc6ffbUL, + 0xc5962bd2UL, 0xbcf1ec72UL, 0x383be000UL, 0x3fcbd087UL, 0x595412b6UL, + 0xbd2d4bc4UL, 0x575bd000UL, 0x3fcb31d8UL, 0x4eace1aaUL, 0xbd0c358dUL, + 0x3c8ae000UL, 0x3fca93edUL, 0x50562169UL, 0xbd287243UL, 0x07089000UL, + 0x3fc9f6c4UL, 0x6865817aUL, 0x3d29904dUL, 0xdcf70000UL, 0x3fc95a5aUL, + 0x58a0ff6fUL, 0x3d07f228UL, 0xeb390000UL, 0x3fc8beafUL, 0xaae92cd1UL, + 0xbd073d54UL, 0x6551a000UL, 0x3fc823c1UL, 0x9a631e83UL, 0x3d1e0ddbUL, + 0x85445000UL, 0x3fc7898dUL, 0x70914305UL, 0xbd1c6610UL, 0x8b757000UL, + 0x3fc6f012UL, 0xe59c21e1UL, 0xbd25118dUL, 0xbe8c1000UL, 0x3fc6574eUL, + 0x2c3c2e78UL, 0x3d19cf8bUL, 0x6b544000UL, 0x3fc5bf40UL, 0xeb68981cUL, + 0xbd127023UL, 0xe4a1b000UL, 0x3fc527e5UL, 0xe5697dc7UL, 0x3d2633e8UL, + 0x8333b000UL, 0x3fc4913dUL, 0x54fdb678UL, 0x3d258379UL, 0xa5993000UL, + 0x3fc3fb45UL, 0x7e6a354dUL, 0xbd2cd1d8UL, 0xb0159000UL, 0x3fc365fcUL, + 0x234b7289UL, 0x3cc62fa8UL, 0x0c868000UL, 0x3fc2d161UL, 0xcb81b4a1UL, + 0x3d039d6cUL, 0x2a49c000UL, 0x3fc23d71UL, 0x8fd3df5cUL, 0x3d100d23UL, + 0x7e23f000UL, 0x3fc1aa2bUL, 0x44389934UL, 0x3d2ca78eUL, 0x8227e000UL, + 0x3fc1178eUL, 0xce2d07f2UL, 0x3d21ef78UL, 0xb59e4000UL, 0x3fc08598UL, + 0x7009902cUL, 0xbd27e5ddUL, 0x39dbe000UL, 0x3fbfe891UL, 0x4fa10afdUL, + 0xbd2534d6UL, 0x830a2000UL, 0x3fbec739UL, 0xafe645e0UL, 0xbd2dc068UL, + 0x63844000UL, 0x3fbda727UL, 0x1fa71733UL, 0x3d1a8940UL, 0x01bc4000UL, + 0x3fbc8858UL, 0xc65aacd3UL, 0x3d2646d1UL, 0x8dad6000UL, 0x3fbb6ac8UL, + 0x2bf768e5UL, 0xbd139080UL, 0x40b1c000UL, 0x3fba4e76UL, 0xb94407c8UL, + 0xbd0e42b6UL, 0x5d594000UL, 0x3fb9335eUL, 0x3abd47daUL, 0x3d23115cUL, + 0x2f40e000UL, 0x3fb8197eUL, 0xf96ffdf7UL, 0x3d0f80dcUL, 0x0aeac000UL, + 0x3fb700d3UL, 0xa99ded32UL, 0x3cec1e8dUL, 0x4d97a000UL, 0x3fb5e95aUL, + 0x3c5d1d1eUL, 0xbd2c6906UL, 0x5d208000UL, 0x3fb4d311UL, 0x82f4e1efUL, + 0xbcf53a25UL, 0xa7d1e000UL, 0x3fb3bdf5UL, 0xa5db4ed7UL, 0x3d2cc85eUL, + 0xa4472000UL, 0x3fb2aa04UL, 0xae9c697dUL, 0xbd20b6e8UL, 0xd1466000UL, + 0x3fb1973bUL, 0x560d9e9bUL, 0xbd25325dUL, 0xb59e4000UL, 0x3fb08598UL, + 0x7009902cUL, 0xbd17e5ddUL, 0xc006c000UL, 0x3faeea31UL, 0x4fc93b7bUL, + 0xbd0e113eUL, 0xcdddc000UL, 0x3faccb73UL, 0x47d82807UL, 0xbd1a68f2UL, + 0xd0fb0000UL, 0x3faaaef2UL, 0x353bb42eUL, 0x3d20fc1aUL, 0x149fc000UL, + 0x3fa894aaUL, 0xd05a267dUL, 0xbd197995UL, 0xf2d4c000UL, 0x3fa67c94UL, + 0xec19afa2UL, 0xbd029efbUL, 0xd42e0000UL, 0x3fa466aeUL, 0x75bdfd28UL, + 0xbd2c1673UL, 0x2f8d0000UL, 0x3fa252f3UL, 0xe021b67bUL, 0x3d283e9aUL, + 0x89e74000UL, 0x3fa0415dUL, 0x5cf1d753UL, 0x3d0111c0UL, 0xec148000UL, + 0x3f9c63d2UL, 0x3f9eb2f3UL, 0x3d2578c6UL, 0x28c90000UL, 0x3f984925UL, + 0x325a0c34UL, 0xbd2aa0baUL, 0x25980000UL, 0x3f9432a9UL, 0x928637feUL, + 0x3d098139UL, 0x58938000UL, 0x3f902056UL, 0x06e2f7d2UL, 0xbd23dc5bUL, + 0xa3890000UL, 0x3f882448UL, 0xda74f640UL, 0xbd275577UL, 0x75890000UL, + 0x3f801015UL, 0x999d2be8UL, 0xbd10c76bUL, 0x59580000UL, 0x3f700805UL, + 0xcb31c67bUL, 0x3d2166afUL, 0x00000000UL, 0x00000000UL, 0x00000000UL, + 0x80000000UL +}; + +// BEGIN dlog PSEUDO CODE: +// double dlog(double X) { +// // p(r) polynomial coefficients initialized from _L_tbl table +// double C1_0 = _L_tbl[0]; +// double C1_1 = _L_tbl[1]; +// double C2_0 = _L_tbl[2]; +// double C2_1 = _L_tbl[3]; +// double C3_0 = _L_tbl[4]; +// double C3_1 = _L_tbl[5]; +// double C4_0 = _L_tbl[6]; +// double C4_1 = _L_tbl[7]; +// // NOTE: operations with coefficients above are mostly vectorized in assembly +// // Check corner cases first +// if (X == 1.0d || AS_LONG_BITS(X) + 0x0010000000000000 <= 0x0010000000000000) { +// // NOTE: AS_LONG_BITS(X) + 0x0010000000000000 <= 0x0010000000000000 means +// // that X < 0 or X >= 0x7FF0000000000000 (0x7FF* is NaN or INF) +// if (X < 0 || X is NaN) return NaN; +// if (X == 1.0d) return 0.0d; +// if (X == 0.0d) return -INFINITY; +// if (X is INFINITY) return INFINITY; +// } +// // double representation is 2^exponent * mantissa +// // split X into two multipliers: 2^exponent and 1.0 * mantissa +// // pseudo function: zeroExponent(X) return value of X with exponent == 0 +// float vtmp5 = 1/(float)(zeroExponent(X)); // reciprocal estimate +// // pseudo function: HI16(X) returns high 16 bits of double value +// int hiWord = HI16(X); +// double vtmp1 = (double) 0x77F0 << 48 | mantissa(X); +// hiWord -= 16; +// if (AS_LONG_BITS(hiWord) > 0x8000) { +// // SMALL_VALUE branch +// vtmp0 = vtmp1 = vtmp0 * AS_DOUBLE_BITS(0x47F0000000000000); +// hiWord = HI16(vtmp1); +// vtmp0 = AS_DOUBLE_BITS(AS_LONG_BITS(vtmp0) |= 0x3FF0000000000000); +// vtmp5 = (double) (1/(float)vtmp0); +// vtmp1 <<= 12; +// vtmp1 >>= 12; +// } +// // MAIN branch +// double vtmp3 = AS_LONG_BITS(vtmp1) & 0xffffe00000000000; // hi part +// int intB0 = AS_INT_BITS(vtmp5) + 0x8000; +// double vtmp0 = AS_DOUBLE_BITS(0xffffe00000000000 & (intB0<<29)); +// int index = (intB0 >> 16) && 0xFF; +// double hiTableValue = _L_tbl[8+index]; // vtmp2[0] +// double lowTableValue = _L_tbl[16+index]; // vtmp2[1] +// vtmp5 = AS_DOUBLE_BITS(hiWord & 0x7FF0 - 0x3FE0); // 0x3FE = 1023 << 4 +// vtmp1 -= vtmp3; // low part +// vtmp3 = vtmp3*vtmp0 - 1.0; +// hiTableValue += C4_0 * vtmp5; +// lowTableValue += C4_1 * vtmp5; +// double r = vtmp1 * vtmp0 + vtmp3; // r = B*mx-1.0, computed in hi and low parts +// vtmp0 = hiTableValue + r; +// hiTableValue -= vtmp0; +// double r2 = r*r; +// double r3 = r2*r; +// double p7 = C3_0*r2 + C2_0*r3 + C1_0*r2*r2 + C3_1*r3*r2 + C2_1*r3*r3 +// + C1_1*r3*r2*r2; // degree 7 polynomial +// return p7 + (vtmp0 + ((r + hiTableValue) + lowTableValue)); +// } +// +// END dlog PSEUDO CODE + + +// Generate log(X). X passed in register v0. Return log(X) into v0. +// Generator parameters: 10 temporary FPU registers and temporary general +// purpose registers +void MacroAssembler::fast_log(FloatRegister vtmp0, FloatRegister vtmp1, + FloatRegister vtmp2, FloatRegister vtmp3, + FloatRegister vtmp4, FloatRegister vtmp5, + FloatRegister C1, FloatRegister C2, + FloatRegister C3, FloatRegister C4, + Register tmp1, Register tmp2, Register tmp3, + Register tmp4, Register tmp5) { + Label DONE, CHECK_CORNER_CASES, SMALL_VALUE, MAIN, + CHECKED_CORNER_CASES, RETURN_MINF_OR_NAN; + const long INF_OR_NAN_PREFIX = 0x7FF0; + const long MINF_OR_MNAN_PREFIX = 0xFFF0; + const long ONE_PREFIX = 0x3FF0; + movz(tmp2, ONE_PREFIX, 48); + movz(tmp4, 0x0010, 48); + fmovd(rscratch1, v0); // rscratch1 = AS_LONG_BITS(X) + lea(rscratch2, ExternalAddress((address)_L_tbl)); + movz(tmp5, 0x7F); + add(tmp1, rscratch1, tmp4); + cmp(tmp2, rscratch1); + lsr(tmp3, rscratch1, 29); + ccmp(tmp1, tmp4, 0b1101 /* LE */, NE); + bfm(tmp3, tmp5, 41, 8); + fmovs(vtmp5, tmp3); + // Load coefficients from table. All coefficients are organized to be + // in specific order, because load below will load it in vectors to be used + // later in vector instructions. Load will be performed in parallel while + // branches are taken. C1 will contain vector of {C1_0, C1_1}, C2 = + // {C2_0, C2_1}, C3 = {C3_0, C3_1}, C4 = {C4_0, C4_1} + ld1(C1, C2, C3, C4, T2D, post(rscratch2, 64)); + br(LE, CHECK_CORNER_CASES); + bind(CHECKED_CORNER_CASES); + // all corner cases are handled + frecpe(vtmp5, vtmp5, S); // vtmp5 ~= 1/vtmp5 + lsr(tmp2, rscratch1, 48); + movz(tmp4, 0x77f0, 48); + fmovd(vtmp4, 1.0d); + movz(tmp1, INF_OR_NAN_PREFIX, 48); + bfm(tmp4, rscratch1, 0, 51); // tmp4 = 0x77F0 << 48 | mantissa(X) + // vtmp1 = AS_DOUBLE_BITS(0x77F0 << 48 | mantissa(X)) == mx + fmovd(vtmp1, tmp4); + subw(tmp2, tmp2, 16); + cmp(tmp2, 0x8000); + br(GE, SMALL_VALUE); + bind(MAIN); + fmovs(tmp3, vtmp5); // int intB0 = AS_INT_BITS(B); + mov(tmp5, 0x3FE0); + mov(rscratch1, 0xffffe00000000000); + andr(tmp2, tmp2, tmp1, LSR, 48); // hiWord & 0x7FF0 + sub(tmp2, tmp2, tmp5); // tmp2 = hiWord & 0x7FF0 - 0x3FE0 + scvtfwd(vtmp5, tmp2); // vtmp5 = (double)tmp2; + addw(tmp3, tmp3, 0x8000); // tmp3 = B + andr(tmp4, tmp4, rscratch1); // tmp4 == hi_part(mx) + andr(rscratch1, rscratch1, tmp3, LSL, 29); // rscratch1 = hi_part(B) + ubfm(tmp3, tmp3, 16, 23); // int index = (intB0 >> 16) && 0xFF + ldrq(vtmp2, Address(rscratch2, tmp3, Address::lsl(4))); // vtmp2 = _L_tbl[index] + // AS_LONG_BITS(vtmp1) & 0xffffe00000000000 // hi_part(mx) + fmovd(vtmp3, tmp4); + fmovd(vtmp0, rscratch1); // vtmp0 = hi_part(B) + fsubd(vtmp1, vtmp1, vtmp3); // vtmp1 -= vtmp3; // low_part(mx) + fnmsub(vtmp3, vtmp3, vtmp0, vtmp4); // vtmp3 = vtmp3*vtmp0 - vtmp4 + fmlavs(vtmp2, T2D, C4, vtmp5, 0); // vtmp2 += {C4} * vtmp5 + // vtmp1 = r = vtmp1 * vtmp0 + vtmp3 == low_part(mx) * hi_part(B) + (hi_part(mx)*hi_part(B) - 1.0) + fmaddd(vtmp1, vtmp1, vtmp0, vtmp3); + ins(vtmp5, D, vtmp2, 0, 1); // vtmp5 = vtmp2[1]; + faddd(vtmp0, vtmp2, vtmp1); // vtmp0 = vtmp2 + vtmp1 + fmlavs(C3, T2D, C2, vtmp1, 0); // {C3} += {C2}*vtmp1 + fsubd(vtmp2, vtmp2, vtmp0); // vtmp2 -= vtmp0 + fmuld(vtmp3, vtmp1, vtmp1); // vtmp3 = vtmp1*vtmp1 + faddd(C4, vtmp1, vtmp2); // C4[0] = vtmp1 + vtmp2 + fmlavs(C3, T2D, C1, vtmp3, 0); // {C3} += {C1}*vtmp3 + faddd(C4, C4, vtmp5); // C4 += vtmp5 + fmuld(vtmp4, vtmp3, vtmp1); // vtmp4 = vtmp3*vtmp1 + faddd(vtmp0, vtmp0, C4); // vtmp0 += C4 + fmlavs(C3, T2D, vtmp4, C3, 1); // {C3} += {vtmp4}*C3[1] + fmaddd(vtmp0, C3, vtmp3, vtmp0); // vtmp0 = C3 * vtmp3 + vtmp0 + ret(lr); + + block_comment("if (AS_LONG_BITS(hiWord) > 0x8000)"); { + bind(SMALL_VALUE); + movz(tmp2, 0x47F0, 48); + fmovd(vtmp1, tmp2); + fmuld(vtmp0, vtmp1, v0); + fmovd(vtmp1, vtmp0); + umov(tmp2, vtmp1, S, 3); + orr(vtmp0, T16B, vtmp0, vtmp4); + ushr(vtmp5, T2D, vtmp0, 27); + ushr(vtmp5, T4S, vtmp5, 2); + frecpe(vtmp5, vtmp5, S); + shl(vtmp1, T2D, vtmp1, 12); + ushr(vtmp1, T2D, vtmp1, 12); + b(MAIN); + } + + block_comment("Corner cases"); { + bind(RETURN_MINF_OR_NAN); + movz(tmp1, MINF_OR_MNAN_PREFIX, 48); + orr(rscratch1, rscratch1, tmp1); + fmovd(v0, rscratch1); + ret(lr); + bind(CHECK_CORNER_CASES); + movz(tmp1, INF_OR_NAN_PREFIX, 48); + cmp(rscratch1, zr); + br(LE, RETURN_MINF_OR_NAN); + cmp(rscratch1, tmp1); + br(GE, DONE); + cmp(rscratch1, tmp2); + br(NE, CHECKED_CORNER_CASES); + fmovd(v0, 0.0d); + } + bind(DONE); + ret(lr); +} diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/macroAssembler_aarch64_trig.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1488 @@ +/* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, Cavium. All rights reserved. (By BELLSOFT) + * 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 "asm/assembler.hpp" +#include "asm/assembler.inline.hpp" +#include "runtime/stubRoutines.hpp" +#include "macroAssembler_aarch64.hpp" + +// The following code is a optimized version of fdlibm sin/cos implementation +// (C code is in share/runtime/sharedRuntimeTrig.cpp) adapted for AARCH64. + +// Please refer to sin/cos approximation via polynomial and +// trigonometric argument reduction techniques to the following literature: +// +// [1] Muller, Jean-Michel, Nicolas Brisebarre, Florent De Dinechin, +// Claude-Pierre Jeannerod, Vincent Lefevre, Guillaume Melquiond, +// Nathalie Revol, Damien Stehlé, and Serge Torres: +// Handbook of floating-point arithmetic. +// Springer Science & Business Media, 2009. +// [2] K. C. Ng +// Argument Reduction for Huge Arguments: Good to the Last Bit +// July 13, 1992, SunPro +// +// HOW TO READ THIS CODE: +// This code consists of several functions. Each function has following header: +// 1) Description +// 2) C-pseudo code with differences from fdlibm marked by comments starting +// with "NOTE". Check unmodified fdlibm code in +// share/runtime/SharedRuntimeTrig.cpp +// 3) Brief textual description of changes between fdlibm and current +// implementation along with optimization notes (if applicable) +// 4) Assumptions, input and output +// 5) (Optional) additional notes about intrinsic implementation +// Each function is separated in blocks which follow the pseudo-code structure +// +// HIGH-LEVEL ALGORITHM DESCRIPTION: +// - entry point: generate_dsin_dcos(...); +// - check corner cases: NaN, INF, tiny argument. +// - check if |x| < Pi/4. Then approximate sin/cos via polynomial (kernel_sin/kernel_cos) +// -- else proceed to argument reduction routine (__ieee754_rem_pio2) and +// use reduced argument to get result via kernel_sin/kernel_cos +// +// HIGH-LEVEL CHANGES BETWEEN INTRINSICS AND FDLIBM: +// 1) two_over_pi table fdlibm representation is int[], while intrinsic version +// has these int values converted to double representation to load converted +// double values directly (see stubRoutines_aarch4::_two_over_pi) +// 2) Several loops are unrolled and vectorized: see comments in code after +// labels: SKIP_F_LOAD, RECOMP_FOR1_CHECK, RECOMP_FOR2 +// 3) fdlibm npio2_hw table now has "prefix" with constants used in +// calculation. These constants are loaded from npio2_hw table instead of +// constructing it in code (see stubRoutines_aarch64.cpp) +// 4) Polynomial coefficients for sin and cos are moved to table sin_coef +// and cos_coef to use the same optimization as in 3). It allows to load most of +// required constants via single instruction +// +// +// +///* __ieee754_rem_pio2(x,y) +// * +// * returns the remainder of x rem pi/2 in y[0]+y[1] (i.e. like x div pi/2) +// * x is input argument, y[] is hi and low parts of reduced argument (x) +// * uses __kernel_rem_pio2() +// */ +// // use tables(see stubRoutines_aarch64.cpp): two_over_pi and modified npio2_hw +// +// BEGIN __ieee754_rem_pio2 PSEUDO CODE +// +//static int __ieee754_rem_pio2(double x, double *y) { +// double z,w,t,r,fn; +// double tx[3]; +// int e0,i,j,nx,n,ix,hx,i0; +// +// i0 = ((*(int*)&two24A)>>30)^1; /* high word index */ +// hx = *(i0+(int*)&x); /* high word of x */ +// ix = hx&0x7fffffff; +// if(ix<0x4002d97c) { /* |x| < 3pi/4, special case with n=+-1 */ +// if(hx>0) { +// z = x - pio2_1; +// if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */ +// y[0] = z - pio2_1t; +// y[1] = (z-y[0])-pio2_1t; +// } else { /* near pi/2, use 33+33+53 bit pi */ +// z -= pio2_2; +// y[0] = z - pio2_2t; +// y[1] = (z-y[0])-pio2_2t; +// } +// return 1; +// } else { /* negative x */ +// z = x + pio2_1; +// if(ix!=0x3ff921fb) { /* 33+53 bit pi is good enough */ +// y[0] = z + pio2_1t; +// y[1] = (z-y[0])+pio2_1t; +// } else { /* near pi/2, use 33+33+53 bit pi */ +// z += pio2_2; +// y[0] = z + pio2_2t; +// y[1] = (z-y[0])+pio2_2t; +// } +// return -1; +// } +// } +// if(ix<=0x413921fb) { /* |x| ~<= 2^19*(pi/2), medium size */ +// t = fabsd(x); +// n = (int) (t*invpio2+half); +// fn = (double)n; +// r = t-fn*pio2_1; +// w = fn*pio2_1t; /* 1st round good to 85 bit */ +// // NOTE: y[0] = r-w; is moved from if/else below to be before "if" +// y[0] = r-w; +// if(n<32&&ix!=npio2_hw[n-1]) { +// // y[0] = r-w; /* quick check no cancellation */ // NOTE: moved earlier +// } else { +// j = ix>>20; +// // y[0] = r-w; // NOTE: moved earlier +// i = j-(((*(i0+(int*)&y[0]))>>20)&0x7ff); +// if(i>16) { /* 2nd iteration needed, good to 118 */ +// t = r; +// w = fn*pio2_2; +// r = t-w; +// w = fn*pio2_2t-((t-r)-w); +// y[0] = r-w; +// i = j-(((*(i0+(int*)&y[0]))>>20)&0x7ff); +// if(i>49) { /* 3rd iteration need, 151 bits acc */ +// t = r; /* will cover all possible cases */ +// w = fn*pio2_3; +// r = t-w; +// w = fn*pio2_3t-((t-r)-w); +// y[0] = r-w; +// } +// } +// } +// y[1] = (r-y[0])-w; +// if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} +// else return n; +// } +// /* +// * all other (large) arguments +// */ +// // NOTE: this check is removed, because it was checked in dsin/dcos +// // if(ix>=0x7ff00000) { /* x is inf or NaN */ +// // y[0]=y[1]=x-x; return 0; +// // } +// /* set z = scalbn(|x|,ilogb(x)-23) */ +// *(1-i0+(int*)&z) = *(1-i0+(int*)&x); +// e0 = (ix>>20)-1046; /* e0 = ilogb(z)-23; */ +// *(i0+(int*)&z) = ix - (e0<<20); +// +// // NOTE: "for" loop below in unrolled. See comments in asm code +// for(i=0;i<2;i++) { +// tx[i] = (double)((int)(z)); +// z = (z-tx[i])*two24A; +// } +// +// tx[2] = z; +// nx = 3; +// +// // NOTE: while(tx[nx-1]==zeroA) nx--; is unrolled. See comments in asm code +// while(tx[nx-1]==zeroA) nx--; /* skip zero term */ +// +// n = __kernel_rem_pio2(tx,y,e0,nx,2,two_over_pi); +// if(hx<0) {y[0] = -y[0]; y[1] = -y[1]; return -n;} +// return n; +//} +// +// END __ieee754_rem_pio2 PSEUDO CODE +// +// Changes between fdlibm and intrinsic for __ieee754_rem_pio2: +// 1. INF/NaN check for huge argument is removed in comparison with fdlibm +// code, because this check is already done in dcos/dsin code +// 2. Most constants are now loaded from table instead of direct initialization +// 3. Two loops are unrolled +// Assumptions: +// 1. Assume |X| >= PI/4 +// 2. Assume rscratch1 = 0x3fe921fb00000000 (~ PI/4) +// 3. Assume ix = r3 +// Input and output: +// 1. Input: X = r0 +// 2. Return n in r2, y[0] == y0 == v4, y[1] == y1 == v5 +// NOTE: general purpose register names match local variable names in C code +// NOTE: fpu registers are actively reused. See comments in code about their usage +void MacroAssembler::generate__ieee754_rem_pio2(address npio2_hw, + address two_over_pi, address pio2) { + const long PIO2_1t = 0x3DD0B4611A626331UL; + const long PIO2_2 = 0x3DD0B4611A600000UL; + const long PIO2_2t = 0x3BA3198A2E037073UL; + Label X_IS_NEGATIVE, X_IS_MEDIUM_OR_LARGE, X_IS_POSITIVE_LONG_PI, LARGE_ELSE, + REDUCTION_DONE, X_IS_MEDIUM_BRANCH_DONE, X_IS_LARGE, NX_SET, + X_IS_NEGATIVE_LONG_PI; + Register X = r0, n = r2, ix = r3, jv = r4, tmp5 = r5, jx = r6, + tmp3 = r7, iqBase = r10, ih = r11, i = r17; + // initializing constants first + // rscratch1 = 0x3fe921fb00000000 (see assumptions) + movk(rscratch1, 0x3ff9, 48); // was 0x3fe921fb0..0 now it's 0x3ff921fb0..0 + mov(rscratch2, 0x4002d97c); // 3*PI/4 high word + movk(rscratch1, 0x5440, 16); // now rscratch1 == PIO2_1 + fmovd(v1, rscratch1); // v1 = PIO2_1 + cmp(rscratch2, ix); + br(LE, X_IS_MEDIUM_OR_LARGE); + + block_comment("if(ix<0x4002d97c) {... /* |x| ~< 3pi/4 */ "); { + cmp(X, zr); + br(LT, X_IS_NEGATIVE); + + block_comment("if(hx>0) {"); { + fsubd(v2, v0, v1); // v2 = z = x - pio2_1 + cmp(ix, rscratch1, LSR, 32); + mov(n, 1); + br(EQ, X_IS_POSITIVE_LONG_PI); + + block_comment("case: hx > 0 && ix!=0x3ff921fb {"); { /* 33+53 bit pi is good enough */ + mov(rscratch2, PIO2_1t); + fmovd(v27, rscratch2); + fsubd(v4, v2, v27); // v4 = y[0] = z - pio2_1t; + fsubd(v5, v2, v4); + fsubd(v5, v5, v27); // v5 = y[1] = (z-y[0])-pio2_1t + b(REDUCTION_DONE); + } + + block_comment("case: hx > 0 &*& ix==0x3ff921fb {"); { /* near pi/2, use 33+33+53 bit pi */ + bind(X_IS_POSITIVE_LONG_PI); + mov(rscratch1, PIO2_2); + mov(rscratch2, PIO2_2t); + fmovd(v27, rscratch1); + fmovd(v6, rscratch2); + fsubd(v2, v2, v27); // z-= pio2_2 + fsubd(v4, v2, v6); // y[0] = z - pio2_2t + fsubd(v5, v2, v4); + fsubd(v5, v5, v6); // v5 = (z - y[0]) - pio2_2t + b(REDUCTION_DONE); + } + } + + block_comment("case: hx <= 0)"); { + bind(X_IS_NEGATIVE); + faddd(v2, v0, v1); // v2 = z = x + pio2_1 + cmp(ix, rscratch1, LSR, 32); + mov(n, -1); + br(EQ, X_IS_NEGATIVE_LONG_PI); + + block_comment("case: hx <= 0 && ix!=0x3ff921fb) {"); { /* 33+53 bit pi is good enough */ + mov(rscratch2, PIO2_1t); + fmovd(v27, rscratch2); + faddd(v4, v2, v27); // v4 = y[0] = z + pio2_1t; + fsubd(v5, v2, v4); + faddd(v5, v5, v27); // v5 = y[1] = (z-y[0]) + pio2_1t + b(REDUCTION_DONE); + } + + block_comment("case: hx <= 0 && ix==0x3ff921fb"); { /* near pi/2, use 33+33+53 bit pi */ + bind(X_IS_NEGATIVE_LONG_PI); + mov(rscratch1, PIO2_2); + mov(rscratch2, PIO2_2t); + fmovd(v27, rscratch1); + fmovd(v6, rscratch2); + faddd(v2, v2, v27); // z += pio2_2 + faddd(v4, v2, v6); // y[0] = z + pio2_2t + fsubd(v5, v2, v4); + faddd(v5, v5, v6); // v5 = (z - y[0]) + pio2_2t + b(REDUCTION_DONE); + } + } + } + bind(X_IS_MEDIUM_OR_LARGE); + mov(rscratch1, 0x413921fb); + cmp(ix, rscratch1); // ix < = 0x413921fb ? + br(GT, X_IS_LARGE); + + block_comment("|x| ~<= 2^19*(pi/2), medium size"); { + lea(ih, ExternalAddress(npio2_hw)); + ld1(v4, v5, v6, v7, T1D, ih); + fabsd(v31, v0); // v31 = t = |x| + add(ih, ih, 64); + fmaddd(v2, v31, v5, v4); // v2 = t * invpio2 + half (invpio2 = 53 bits of 2/pi, half = 0.5) + fcvtzdw(n, v2); // n = (int) v2 + frintzd(v2, v2); + fmsubd(v3, v2, v6, v31); // v3 = r = t - fn * pio2_1 + fmuld(v26, v2, v7); // v26 = w = fn * pio2_1t + fsubd(v4, v3, v26); // y[0] = r - w. Calculated before branch + cmp(n, 32); + br(GT, LARGE_ELSE); + subw(tmp5, n, 1); // tmp5 = n - 1 + ldrw(jv, Address(ih, tmp5, Address::lsl(2))); + cmp(ix, jv); + br(NE, X_IS_MEDIUM_BRANCH_DONE); + + block_comment("else block for if(n<32&&ix!=npio2_hw[n-1])"); { + bind(LARGE_ELSE); + fmovd(jx, v4); + lsr(tmp5, ix, 20); // j = ix >> 20 + lsl(jx, jx, 1); + sub(tmp3, tmp5, jx, LSR, 32 + 20 + 1); // r7 = j-(((*(i0+(int*)&y[0]))>>20)&0x7ff); + + block_comment("if(i>16)"); { + cmp(tmp3, 16); + br(LE, X_IS_MEDIUM_BRANCH_DONE); + // i > 16. 2nd iteration needed + ldpd(v6, v7, Address(ih, -32)); + fmovd(v28, v3); // t = r + fmuld(v29, v2, v6); // w = v29 = fn * pio2_2 + fsubd(v3, v28, v29); // r = t - w + fsubd(v31, v28, v3); // v31 = (t - r) + fsubd(v31, v29, v31); // v31 = w - (t - r) = - ((t - r) - w) + fmaddd(v26, v2, v7, v31); // v26 = w = fn*pio2_2t - ((t - r) - w) + fsubd(v4, v3, v26); // y[0] = r - w + fmovd(jx, v4); + lsl(jx, jx, 1); + sub(tmp3, tmp5, jx, LSR, 32 + 20 + 1); // r7 = j-(((*(i0+(int*)&y[0]))>>20)&0x7ff); + + block_comment("if(i>49)"); { + cmp(tmp3, 49); + br(LE, X_IS_MEDIUM_BRANCH_DONE); + // 3rd iteration need, 151 bits acc + ldpd(v6, v7, Address(ih, -16)); + fmovd(v28, v3); // save "r" + fmuld(v29, v2, v6); // v29 = fn * pio2_3 + fsubd(v3, v28, v29); // r = r - w + fsubd(v31, v28, v3); // v31 = (t - r) + fsubd(v31, v29, v31); // v31 = w - (t - r) = - ((t - r) - w) + fmaddd(v26, v2, v7, v31); // v26 = w = fn*pio2_3t - ((t - r) - w) + fsubd(v4, v3, v26); // y[0] = r - w + } + } + } + block_comment("medium x tail"); { + bind(X_IS_MEDIUM_BRANCH_DONE); + fsubd(v5, v3, v4); // v5 = y[1] = (r - y[0]) + fsubd(v5, v5, v26); // v5 = y[1] = (r - y[0]) - w + cmp(X, zr); + br(GT, REDUCTION_DONE); + fnegd(v4, v4); + negw(n, n); + fnegd(v5, v5); + b(REDUCTION_DONE); + } + } + + block_comment("all other (large) arguments"); { + bind(X_IS_LARGE); + lsr(rscratch1, ix, 20); // ix >> 20 + movz(tmp5, 0x4170, 48); + subw(rscratch1, rscratch1, 1046); // e0 + fmovd(v10, tmp5); // init two24A value + subw(jv, ix, rscratch1, LSL, 20); // ix - (e0<<20) + lsl(jv, jv, 32); + subw(rscratch2, rscratch1, 3); + bfm(jv, X, 0, 31); // jv = z + movw(i, 24); + fmovd(v26, jv); // v26 = z + + block_comment("unrolled for(i=0;i<2;i++) {tx[i] = (double)((int)(z));z = (z-tx[i])*two24A;}"); { + // tx[0,1,2] = v6,v7,v26 + frintzd(v6, v26); // v6 = (double)((int)v26) + sdivw(jv, rscratch2, i); // jv = (e0 - 3)/24 + fsubd(v26, v26, v6); + sub(sp, sp, 560); + fmuld(v26, v26, v10); + frintzd(v7, v26); // v7 = (double)((int)v26) + movw(jx, 2); // calculate jx as nx - 1, which is initially 2. Not a part of unrolled loop + fsubd(v26, v26, v7); + } + + block_comment("nx calculation with unrolled while(tx[nx-1]==zeroA) nx--;"); { + fcmpd(v26, 0.0d); // if NE then jx == 2. else it's 1 or 0 + add(iqBase, sp, 480); // base of iq[] + fmuld(v3, v26, v10); + br(NE, NX_SET); + fcmpd(v7, 0.0d); // v7 == 0 => jx = 0. Else jx = 1 + csetw(jx, NE); + } + bind(NX_SET); + generate__kernel_rem_pio2(two_over_pi, pio2); + // now we have y[0] = v4, y[1] = v5 and n = r2 + cmp(X, zr); + br(GE, REDUCTION_DONE); + fnegd(v4, v4); + fnegd(v5, v5); + negw(n, n); + } + bind(REDUCTION_DONE); +} + +///* +// * __kernel_rem_pio2(x,y,e0,nx,prec,ipio2) +// * double x[],y[]; int e0,nx,prec; int ipio2[]; +// * +// * __kernel_rem_pio2 return the last three digits of N with +// * y = x - N*pi/2 +// * so that |y| < pi/2. +// * +// * The method is to compute the integer (mod 8) and fraction parts of +// * (2/pi)*x without doing the full multiplication. In general we +// * skip the part of the product that are known to be a huge integer ( +// * more accurately, = 0 mod 8 ). Thus the number of operations are +// * independent of the exponent of the input. +// * +// * NOTE: 2/pi int representation is converted to double +// * // (2/pi) is represented by an array of 24-bit integers in ipio2[]. +// * +// * Input parameters: +// * x[] The input value (must be positive) is broken into nx +// * pieces of 24-bit integers in double precision format. +// * x[i] will be the i-th 24 bit of x. The scaled exponent +// * of x[0] is given in input parameter e0 (i.e., x[0]*2^e0 +// * match x's up to 24 bits. +// * +// * Example of breaking a double positive z into x[0]+x[1]+x[2]: +// * e0 = ilogb(z)-23 +// * z = scalbn(z,-e0) +// * for i = 0,1,2 +// * x[i] = floor(z) +// * z = (z-x[i])*2**24 +// * +// * +// * y[] ouput result in an array of double precision numbers. +// * The dimension of y[] is: +// * 24-bit precision 1 +// * 53-bit precision 2 +// * 64-bit precision 2 +// * 113-bit precision 3 +// * The actual value is the sum of them. Thus for 113-bit +// * precsion, one may have to do something like: +// * +// * long double t,w,r_head, r_tail; +// * t = (long double)y[2] + (long double)y[1]; +// * w = (long double)y[0]; +// * r_head = t+w; +// * r_tail = w - (r_head - t); +// * +// * e0 The exponent of x[0] +// * +// * nx dimension of x[] +// * +// * prec an interger indicating the precision: +// * 0 24 bits (single) +// * 1 53 bits (double) +// * 2 64 bits (extended) +// * 3 113 bits (quad) +// * +// * NOTE: ipio2[] array below is converted to double representation +// * //ipio2[] +// * // integer array, contains the (24*i)-th to (24*i+23)-th +// * // bit of 2/pi after binary point. The corresponding +// * // floating value is +// * +// * ipio2[i] * 2^(-24(i+1)). +// * +// * Here is the description of some local variables: +// * +// * jk jk+1 is the initial number of terms of ipio2[] needed +// * in the computation. The recommended value is 2,3,4, +// * 6 for single, double, extended,and quad. +// * +// * jz local integer variable indicating the number of +// * terms of ipio2[] used. +// * +// * jx nx - 1 +// * +// * jv index for pointing to the suitable ipio2[] for the +// * computation. In general, we want +// * ( 2^e0*x[0] * ipio2[jv-1]*2^(-24jv) )/8 +// * is an integer. Thus +// * e0-3-24*jv >= 0 or (e0-3)/24 >= jv +// * Hence jv = max(0,(e0-3)/24). +// * +// * jp jp+1 is the number of terms in PIo2[] needed, jp = jk. +// * +// * q[] double array with integral value, representing the +// * 24-bits chunk of the product of x and 2/pi. +// * +// * q0 the corresponding exponent of q[0]. Note that the +// * exponent for q[i] would be q0-24*i. +// * +// * PIo2[] double precision array, obtained by cutting pi/2 +// * into 24 bits chunks. +// * +// * f[] ipio2[] in floating point +// * +// * iq[] integer array by breaking up q[] in 24-bits chunk. +// * +// * fq[] final product of x*(2/pi) in fq[0],..,fq[jk] +// * +// * ih integer. If >0 it indicates q[] is >= 0.5, hence +// * it also indicates the *sign* of the result. +// * +// */ +// +// Use PIo2 table(see stubRoutines_aarch64.cpp) +// +// BEGIN __kernel_rem_pio2 PSEUDO CODE +// +//static int __kernel_rem_pio2(double *x, double *y, int e0, int nx, int prec, /* NOTE: converted to double */ const double *ipio2 // const int *ipio2) { +// int jz,jx,jv,jp,jk,carry,n,iq[20],i,j,k,m,q0,ih; +// double z,fw,f[20],fq[20],q[20]; +// +// /* initialize jk*/ +// // jk = init_jk[prec]; // NOTE: prec==2 for double. jk is always 4. +// jp = jk; // NOTE: always 4 +// +// /* determine jx,jv,q0, note that 3>q0 */ +// jx = nx-1; +// jv = (e0-3)/24; if(jv<0) jv=0; +// q0 = e0-24*(jv+1); +// +// /* set up f[0] to f[jx+jk] where f[jx+jk] = ipio2[jv+jk] */ +// j = jv-jx; m = jx+jk; +// +// // NOTE: split into two for-loops: one with zeroB and one with ipio2[j]. It +// // allows the use of wider loads/stores +// for(i=0;i<=m;i++,j++) f[i] = (j<0)? zeroB : /* NOTE: converted to double */ ipio2[j]; //(double) ipio2[j]; +// +// // NOTE: unrolled and vectorized "for". See comments in asm code +// /* compute q[0],q[1],...q[jk] */ +// for (i=0;i<=jk;i++) { +// for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw; +// } +// +// jz = jk; +//recompute: +// /* distill q[] into iq[] reversingly */ +// for(i=0,j=jz,z=q[jz];j>0;i++,j--) { +// fw = (double)((int)(twon24* z)); +// iq[i] = (int)(z-two24B*fw); +// z = q[j-1]+fw; +// } +// +// /* compute n */ +// z = scalbnA(z,q0); /* actual value of z */ +// z -= 8.0*floor(z*0.125); /* trim off integer >= 8 */ +// n = (int) z; +// z -= (double)n; +// ih = 0; +// if(q0>0) { /* need iq[jz-1] to determine n */ +// i = (iq[jz-1]>>(24-q0)); n += i; +// iq[jz-1] -= i<<(24-q0); +// ih = iq[jz-1]>>(23-q0); +// } +// else if(q0==0) ih = iq[jz-1]>>23; +// else if(z>=0.5) ih=2; +// +// if(ih>0) { /* q > 0.5 */ +// n += 1; carry = 0; +// for(i=0;i0) { /* rare case: chance is 1 in 12 */ +// switch(q0) { +// case 1: +// iq[jz-1] &= 0x7fffff; break; +// case 2: +// iq[jz-1] &= 0x3fffff; break; +// } +// } +// if(ih==2) { +// z = one - z; +// if(carry!=0) z -= scalbnA(one,q0); +// } +// } +// +// /* check if recomputation is needed */ +// if(z==zeroB) { +// j = 0; +// for (i=jz-1;i>=jk;i--) j |= iq[i]; +// if(j==0) { /* need recomputation */ +// for(k=1;iq[jk-k]==0;k++); /* k = no. of terms needed */ +// +// for(i=jz+1;i<=jz+k;i++) { /* add q[jz+1] to q[jz+k] */ +// f[jx+i] = /* NOTE: converted to double */ ipio2[jv+i]; //(double) ipio2[jv+i]; +// for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; +// q[i] = fw; +// } +// jz += k; +// goto recompute; +// } +// } +// +// /* chop off zero terms */ +// if(z==0.0) { +// jz -= 1; q0 -= 24; +// while(iq[jz]==0) { jz--; q0-=24;} +// } else { /* break z into 24-bit if necessary */ +// z = scalbnA(z,-q0); +// if(z>=two24B) { +// fw = (double)((int)(twon24*z)); +// iq[jz] = (int)(z-two24B*fw); +// jz += 1; q0 += 24; +// iq[jz] = (int) fw; +// } else iq[jz] = (int) z ; +// } +// +// /* convert integer "bit" chunk to floating-point value */ +// fw = scalbnA(one,q0); +// for(i=jz;i>=0;i--) { +// q[i] = fw*(double)iq[i]; fw*=twon24; +// } +// +// /* compute PIo2[0,...,jp]*q[jz,...,0] */ +// for(i=jz;i>=0;i--) { +// for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k]; +// fq[jz-i] = fw; +// } +// +// // NOTE: switch below is eliminated, because prec is always 2 for doubles +// /* compress fq[] into y[] */ +// //switch(prec) { +// //case 0: +// // fw = 0.0; +// // for (i=jz;i>=0;i--) fw += fq[i]; +// // y[0] = (ih==0)? fw: -fw; +// // break; +// //case 1: +// //case 2: +// fw = 0.0; +// for (i=jz;i>=0;i--) fw += fq[i]; +// y[0] = (ih==0)? fw: -fw; +// fw = fq[0]-fw; +// for (i=1;i<=jz;i++) fw += fq[i]; +// y[1] = (ih==0)? fw: -fw; +// // break; +// //case 3: /* painful */ +// // for (i=jz;i>0;i--) { +// // fw = fq[i-1]+fq[i]; +// // fq[i] += fq[i-1]-fw; +// // fq[i-1] = fw; +// // } +// // for (i=jz;i>1;i--) { +// // fw = fq[i-1]+fq[i]; +// // fq[i] += fq[i-1]-fw; +// // fq[i-1] = fw; +// // } +// // for (fw=0.0,i=jz;i>=2;i--) fw += fq[i]; +// // if(ih==0) { +// // y[0] = fq[0]; y[1] = fq[1]; y[2] = fw; +// // } else { +// // y[0] = -fq[0]; y[1] = -fq[1]; y[2] = -fw; +// // } +// //} +// return n&7; +//} +// +// END __kernel_rem_pio2 PSEUDO CODE +// +// Changes between fdlibm and intrinsic: +// 1. One loop is unrolled and vectorized (see comments in code) +// 2. One loop is split into 2 loops (see comments in code) +// 3. Non-double code is removed(last switch). Sevaral variables became +// constants because of that (see comments in code) +// 4. Use of jx, which is nx-1 instead of nx +// Assumptions: +// 1. Assume |X| >= PI/4 +// Input and output: +// 1. Input: X = r0, jx == nx - 1 == r6, e0 == rscratch1 +// 2. Return n in r2, y[0] == y0 == v4, y[1] == y1 == v5 +// NOTE: general purpose register names match local variable names in C code +// NOTE: fpu registers are actively reused. See comments in code about their usage +void MacroAssembler::generate__kernel_rem_pio2(address two_over_pi, address pio2) { + Label Q_DONE, JX_IS_0, JX_IS_2, COMP_INNER_LOOP, RECOMP_FOR2, Q0_ZERO_CMP_LT, + RECOMP_CHECK_DONE_NOT_ZERO, Q0_ZERO_CMP_DONE, COMP_FOR, Q0_ZERO_CMP_EQ, + INIT_F_ZERO, RECOMPUTE, IH_FOR_INCREMENT, IH_FOR_STORE, RECOMP_CHECK_DONE, + Z_IS_LESS_THAN_TWO24B, Z_IS_ZERO, FW_Y1_NO_NEGATION, + RECOMP_FW_UPDATED, Z_ZERO_CHECK_DONE, FW_FOR1, IH_AFTER_SWITCH, IH_HANDLED, + CONVERTION_FOR, FW_Y0_NO_NEGATION, FW_FOR1_DONE, FW_FOR2, FW_FOR2_DONE, + IH_FOR, SKIP_F_LOAD, RECOMP_FOR1, RECOMP_FIRST_FOR, INIT_F_COPY, + RECOMP_FOR1_CHECK; + Register tmp2 = r1, n = r2, jv = r4, tmp5 = r5, jx = r6, + tmp3 = r7, iqBase = r10, ih = r11, tmp4 = r12, tmp1 = r13, + jz = r14, j = r15, twoOverPiBase = r16, i = r17, qBase = r18; + // jp = jk == init_jk[prec] = init_jk[2] == {2,3,4,6}[2] == 4 + // jx = nx - 1 + lea(twoOverPiBase, ExternalAddress(two_over_pi)); + cmpw(jv, zr); + addw(tmp4, jx, 4); // tmp4 = m = jx + jk = jx + 4. jx is in {0,1,2} so m is in [4,5,6] + cselw(jv, jv, zr, GE); + fmovd(v26, 0.0d); + addw(tmp5, jv, 1); // jv+1 + subsw(j, jv, jx); + add(qBase, sp, 320); // base of q[] + msubw(rscratch1, i, tmp5, rscratch1); // q0 = e0-24*(jv+1) + // use double f[20], fq[20], q[20], iq[20] on stack, which is + // (20 + 20 + 20) x 8 + 20 x 4 = 560 bytes. From lower to upper addresses it + // will contain f[20], fq[20], q[20], iq[20] + // now initialize f[20] indexes 0..m (inclusive) + // for(i=0;i<=m;i++,j++) f[i] = (j<0)? zeroB : /* NOTE: converted to double */ ipio2[j]; // (double) ipio2[j]; + mov(tmp5, sp); + + block_comment("for(i=0;i<=m;i++,j++) f[i] = (j<0)? zeroB : /* NOTE: converted to double */ ipio2[j]; // (double) ipio2[j];"); { + eorw(i, i, i); + br(GE, INIT_F_COPY); + bind(INIT_F_ZERO); + stpq(v26, v26, Address(post(tmp5, 32))); + addw(i, i, 4); + addsw(j, j, 4); + br(LT, INIT_F_ZERO); + subw(i, i, j); + movw(j, zr); + bind(INIT_F_COPY); + add(tmp1, twoOverPiBase, j, LSL, 3); // ipio2[j] start address + ld1(v18, v19, v20, v21, T16B, tmp1); + add(tmp5, sp, i, ext::uxtx, 3); + st1(v18, v19, v20, v21, T16B, tmp5); + } + // v18..v21 can actually contain f[0..7] + cbz(i, SKIP_F_LOAD); // i == 0 => f[i] == f[0] => already loaded + ld1(v18, v19, v20, v21, T2D, Address(sp)); // load f[0..7] + bind(SKIP_F_LOAD); + // calculate 2^q0 and 2^-q0, which we'll need further. + // q0 is exponent. So, calculate biased exponent(q0+1023) + negw(tmp4, rscratch1); + addw(tmp5, rscratch1, 1023); + addw(tmp4, tmp4, 1023); + // Unroll following for(s) depending on jx in [0,1,2] + // for (i=0;i<=jk;i++) { + // for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; q[i] = fw; + // } + // Unrolling for jx == 0 case: + // q[0] = x[0] * f[0] + // q[1] = x[0] * f[1] + // q[2] = x[0] * f[2] + // q[3] = x[0] * f[3] + // q[4] = x[0] * f[4] + // + // Vectorization for unrolled jx == 0 case: + // {q[0], q[1]} = {f[0], f[1]} * x[0] + // {q[2], q[3]} = {f[2], f[3]} * x[0] + // q[4] = f[4] * x[0] + // + // Unrolling for jx == 1 case: + // q[0] = x[0] * f[1] + x[1] * f[0] + // q[1] = x[0] * f[2] + x[1] * f[1] + // q[2] = x[0] * f[3] + x[1] * f[2] + // q[3] = x[0] * f[4] + x[1] * f[3] + // q[4] = x[0] * f[5] + x[1] * f[4] + // + // Vectorization for unrolled jx == 1 case: + // {q[0], q[1]} = {f[0], f[1]} * x[1] + // {q[2], q[3]} = {f[2], f[3]} * x[1] + // q[4] = f[4] * x[1] + // {q[0], q[1]} += {f[1], f[2]} * x[0] + // {q[2], q[3]} += {f[3], f[4]} * x[0] + // q[4] += f[5] * x[0] + // + // Unrolling for jx == 2 case: + // q[0] = x[0] * f[2] + x[1] * f[1] + x[2] * f[0] + // q[1] = x[0] * f[3] + x[1] * f[2] + x[2] * f[1] + // q[2] = x[0] * f[4] + x[1] * f[3] + x[2] * f[2] + // q[3] = x[0] * f[5] + x[1] * f[4] + x[2] * f[3] + // q[4] = x[0] * f[6] + x[1] * f[5] + x[2] * f[4] + // + // Vectorization for unrolled jx == 2 case: + // {q[0], q[1]} = {f[0], f[1]} * x[2] + // {q[2], q[3]} = {f[2], f[3]} * x[2] + // q[4] = f[4] * x[2] + // {q[0], q[1]} += {f[1], f[2]} * x[1] + // {q[2], q[3]} += {f[3], f[4]} * x[1] + // q[4] += f[5] * x[1] + // {q[0], q[1]} += {f[2], f[3]} * x[0] + // {q[2], q[3]} += {f[4], f[5]} * x[0] + // q[4] += f[6] * x[0] + block_comment("unrolled and vectorized computation of q[0]..q[jk]"); { + cmpw(jx, 1); + lsl(tmp5, tmp5, 52); // now it's 2^q0 double value + lsl(tmp4, tmp4, 52); // now it's 2^-q0 double value + br(LT, JX_IS_0); + add(i, sp, 8); + ldpq(v26, v27, i); // load f[1..4] + br(GT, JX_IS_2); + // jx == 1 + fmulxvs(v28, T2D, v18, v7); // f[0,1] * x[1] + fmulxvs(v29, T2D, v19, v7); // f[2,3] * x[1] + fmuld(v30, v20, v7); // f[4] * x[1] + fmlavs(v28, T2D, v26, v6, 0); + fmlavs(v29, T2D, v27, v6, 0); + fmlavs(v30, T2D, v6, v20, 1); // v30 += f[5] * x[0] + b(Q_DONE); + bind(JX_IS_2); + fmulxvs(v28, T2D, v18, v3); // f[0,1] * x[2] + fmulxvs(v29, T2D, v19, v3); // f[2,3] * x[2] + fmuld(v30, v20, v3); // f[4] * x[2] + fmlavs(v28, T2D, v26, v7, 0); + fmlavs(v29, T2D, v27, v7, 0); + fmlavs(v30, T2D, v7, v20, 1); // v30 += f[5] * x[1] + fmlavs(v28, T2D, v19, v6, 0); + fmlavs(v29, T2D, v20, v6, 0); + fmlavs(v30, T2D, v6, v21, 0); // v30 += f[6] * x[0] + b(Q_DONE); + bind(JX_IS_0); + fmulxvs(v28, T2D, v18, v6); // f[0,1] * x[0] + fmulxvs(v29, T2D, v19, v6); // f[2,3] * x[0] + fmuld(v30, v20, v6); // f[4] * x[0] + bind(Q_DONE); + st1(v28, v29, v30, T2D, Address(qBase)); // save calculated q[0]...q[jk] + } + movz(i, 0x3E70, 48); + movw(jz, 4); + fmovd(v17, i); // v17 = twon24 + fmovd(v30, tmp5); // 2^q0 + fmovd(v21, 0.125d); + fmovd(v20, 8.0d); + fmovd(v22, tmp4); // 2^-q0 + + block_comment("recompute loop"); { + bind(RECOMPUTE); + // for(i=0,j=jz,z=q[jz];j>0;i++,j--) { + // fw = (double)((int)(twon24* z)); + // iq[i] = (int)(z-two24A*fw); + // z = q[j-1]+fw; + // } + block_comment("distill q[] into iq[] reversingly"); { + eorw(i, i, i); + movw(j, jz); + add(tmp2, qBase, jz, LSL, 3); // q[jz] address + ldrd(v18, post(tmp2, -8)); // z = q[j] and moving address to q[j-1] + bind(RECOMP_FIRST_FOR); + ldrd(v27, post(tmp2, -8)); + fmuld(v29, v17, v18); // twon24*z + frintzd(v29, v29); // (double)(int) + fmsubd(v28, v10, v29, v18); // v28 = z-two24A*fw + fcvtzdw(tmp1, v28); // (int)(z-two24A*fw) + strw(tmp1, Address(iqBase, i, Address::lsl(2))); + faddd(v18, v27, v29); + add(i, i, 1); + subs(j, j, 1); + br(GT, RECOMP_FIRST_FOR); + } + // compute n + fmuld(v18, v18, v30); + fmuld(v2, v18, v21); + frintmd(v2, v2); // v2 = floor(v2) == rounding towards -inf + fmsubd(v18, v2, v20, v18); // z -= 8.0*floor(z*0.125); + movw(ih, 2); + frintzd(v2, v18); // v2 = (double)((int)z) + fcvtzdw(n, v18); // n = (int) z; + fsubd(v18, v18, v2); // z -= (double)n; + + block_comment("q0-dependent initialization"); { + cmpw(rscratch1, 0); // if (q0 > 0) + br(LT, Q0_ZERO_CMP_LT); + subw(j, jz, 1); // j = jz - 1 + ldrw(tmp2, Address(iqBase, j, Address::lsl(2))); // tmp2 = iq[jz-1] + br(EQ, Q0_ZERO_CMP_EQ); + movw(tmp4, 24); + subw(tmp4, tmp4, rscratch1); // == 24 - q0 + lsrvw(i, tmp2, tmp4); // i = iq[jz-1] >> (24-q0) + lslvw(tmp5, i, tmp4); + subw(tmp2, tmp2, tmp5); // iq[jz-1] -= i<<(24-q0); + strw(tmp2, Address(iqBase, j, Address::lsl(2))); // store iq[jz-1] + subw(rscratch2, tmp4, 1); // == 23 - q0 + addw(n, n, i); // n+=i + lsrvw(ih, tmp2, rscratch2); // ih = iq[jz-1] >> (23-q0) + b(Q0_ZERO_CMP_DONE); + bind(Q0_ZERO_CMP_EQ); + lsr(ih, tmp2, 23); // ih = iq[z-1] >> 23 + b(Q0_ZERO_CMP_DONE); + bind(Q0_ZERO_CMP_LT); + fmovd(v4, 0.5d); + fcmpd(v18, v4); + cselw(ih, zr, ih, LT); // if (z<0.5) ih = 0 + } + bind(Q0_ZERO_CMP_DONE); + cmpw(ih, zr); + br(LE, IH_HANDLED); + + block_comment("if(ih>) {"); { + // use rscratch2 as carry + + block_comment("for(i=0;i0) {"); { + cmpw(rscratch1, zr); + br(LE, IH_AFTER_SWITCH); + // tmp3 still has iq[jz-1] value. no need to reload + // now, zero high tmp3 bits (rscratch1 number of bits) + movw(j, -1); + subw(i, jz, 1); // set i to jz-1 + lsrv(j, j, rscratch1); + andw(tmp3, tmp3, j, LSR, 8); // we have 24-bit-based constants + strw(tmp3, Address(iqBase, i, Address::lsl(2))); // save iq[jz-1] + } + bind(IH_AFTER_SWITCH); + cmpw(ih, 2); + br(NE, IH_HANDLED); + + block_comment("if(ih==2) {"); { + fmovd(v25, 1.0d); + fsubd(v18, v25, v18); // z = one - z; + cbzw(rscratch2, IH_HANDLED); + fsubd(v18, v18, v30); // z -= scalbnA(one,q0); + } + } + bind(IH_HANDLED); + // check if recomputation is needed + fcmpd(v18, 0.0d); + br(NE, RECOMP_CHECK_DONE_NOT_ZERO); + + block_comment("if(z==zeroB) {"); { + + block_comment("for (i=jz-1;i>=jk;i--) j |= iq[i];"); { + subw(i, jz, 1); + eorw(j, j, j); + b(RECOMP_FOR1_CHECK); + bind(RECOMP_FOR1); + ldrw(tmp1, Address(iqBase, i, Address::lsl(2))); + orrw(j, j, tmp1); + subw(i, i, 1); + bind(RECOMP_FOR1_CHECK); + cmpw(i, 4); + br(GE, RECOMP_FOR1); + } + cbnzw(j, RECOMP_CHECK_DONE); + + block_comment("if(j==0) {"); { + // for(k=1;iq[jk-k]==0;k++); // let's unroll it. jk == 4. So, read + // iq[3], iq[2], iq[1], iq[0] until non-zero value + ldp(tmp1, tmp3, iqBase); // iq[0..3] + movw(j, 2); + cmp(tmp3, zr); + csel(tmp1, tmp1, tmp3, EQ); // set register for further consideration + cselw(j, j, zr, EQ); // set initial k. Use j as k + cmp(zr, tmp1, LSR, 32); + addw(i, jz, 1); + csincw(j, j, j, NE); + + block_comment("for(i=jz+1;i<=jz+k;i++) {...}"); { + addw(jz, i, j); // i = jz+1, j = k-1. j+i = jz+k (which is a new jz) + bind(RECOMP_FOR2); + addw(tmp1, jv, i); + ldrd(v29, Address(twoOverPiBase, tmp1, Address::lsl(3))); + addw(tmp2, jx, i); + strd(v29, Address(sp, tmp2, Address::lsl(3))); + // f[jx+i] = /* NOTE: converted to double */ ipio2[jv+i]; //(double) ipio2[jv+i]; + // since jx = 0, 1 or 2 we can unroll it: + // for(j=0,fw=0.0;j<=jx;j++) fw += x[j]*f[jx+i-j]; + // f[jx+i-j] == (for first iteration) f[jx+i], which is already v29 + add(tmp2, sp, tmp2, ext::uxtx, 3); // address of f[jx+i] + ldpd(v4, v5, Address(tmp2, -16)); // load f[jx+i-2] and f[jx+i-1] + fmuld(v26, v6, v29); // initial fw + cbzw(jx, RECOMP_FW_UPDATED); + fmaddd(v26, v7, v5, v26); + cmpw(jx, 1); + br(EQ, RECOMP_FW_UPDATED); + fmaddd(v26, v3, v4, v26); + bind(RECOMP_FW_UPDATED); + strd(v26, Address(qBase, i, Address::lsl(3))); // q[i] = fw; + addw(i, i, 1); + cmpw(i, jz); // jz here is "old jz" + k + br(LE, RECOMP_FOR2); + } + b(RECOMPUTE); + } + } + } + bind(RECOMP_CHECK_DONE); + // chop off zero terms + fcmpd(v18, 0.0d); + br(EQ, Z_IS_ZERO); + + block_comment("else block of if(z==0.0) {"); { + bind(RECOMP_CHECK_DONE_NOT_ZERO); + fmuld(v18, v18, v22); + fcmpd(v18, v10); // v10 is stil two24A + br(LT, Z_IS_LESS_THAN_TWO24B); + fmuld(v1, v18, v17); // twon24*z + frintzd(v1, v1); // v1 = (double)(int)(v1) + fmaddd(v2, v10, v1, v18); + fcvtzdw(tmp3, v1); // (int)fw + fcvtzdw(tmp2, v2); // double to int + strw(tmp2, Address(iqBase, jz, Address::lsl(2))); + addw(rscratch1, rscratch1, 24); + addw(jz, jz, 1); + strw(tmp3, Address(iqBase, jz, Address::lsl(2))); // iq[jz] = (int) fw + b(Z_ZERO_CHECK_DONE); + bind(Z_IS_LESS_THAN_TWO24B); + fcvtzdw(tmp3, v18); // (int)z + strw(tmp3, Address(iqBase, jz, Address::lsl(2))); // iq[jz] = (int) z + b(Z_ZERO_CHECK_DONE); + } + + block_comment("if(z==0.0) {"); { + bind(Z_IS_ZERO); + subw(jz, jz, 1); + ldrw(tmp1, Address(iqBase, jz, Address::lsl(2))); + subw(rscratch1, rscratch1, 24); + cbz(tmp1, Z_IS_ZERO); + } + bind(Z_ZERO_CHECK_DONE); + // convert integer "bit" chunk to floating-point value + // v17 = twon24 + // update v30, which was scalbnA(1.0, ); + addw(tmp2, rscratch1, 1023); // biased exponent + lsl(tmp2, tmp2, 52); // put at correct position + mov(i, jz); + fmovd(v30, tmp2); + + block_comment("for(i=jz;i>=0;i--) {q[i] = fw*(double)iq[i]; fw*=twon24;}"); { + bind(CONVERTION_FOR); + ldrw(tmp1, Address(iqBase, i, Address::lsl(2))); + scvtfwd(v31, tmp1); + fmuld(v31, v31, v30); + strd(v31, Address(qBase, i, Address::lsl(3))); + fmuld(v30, v30, v17); + subsw(i, i, 1); + br(GE, CONVERTION_FOR); + } + add(rscratch2, sp, 160); // base for fq + // reusing twoOverPiBase + lea(twoOverPiBase, ExternalAddress(pio2)); + + block_comment("compute PIo2[0,...,jp]*q[jz,...,0]. for(i=jz;i>=0;i--) {...}"); { + movw(i, jz); + movw(tmp2, zr); // tmp2 will keep jz - i == 0 at start + bind(COMP_FOR); + // for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k]; + fmovd(v30, 0.0d); + add(tmp5, qBase, i, LSL, 3); // address of q[i+k] for k==0 + movw(tmp3, 4); + movw(tmp4, zr); // used as k + cmpw(tmp2, 4); + add(tmp1, qBase, i, LSL, 3); // used as q[i] address + cselw(tmp3, tmp2, tmp3, LE); // min(jz - i, jp) + + block_comment("for(fw=0.0,k=0;k<=jp&&k<=jz-i;k++) fw += PIo2[k]*q[i+k];"); { + bind(COMP_INNER_LOOP); + ldrd(v18, Address(tmp1, tmp4, Address::lsl(3))); // q[i+k] + ldrd(v19, Address(twoOverPiBase, tmp4, Address::lsl(3))); // PIo2[k] + fmaddd(v30, v18, v19, v30); // fw += PIo2[k]*q[i+k]; + addw(tmp4, tmp4, 1); // k++ + cmpw(tmp4, tmp3); + br(LE, COMP_INNER_LOOP); + } + strd(v30, Address(rscratch2, tmp2, Address::lsl(3))); // fq[jz-i] + add(tmp2, tmp2, 1); + subsw(i, i, 1); + br(GE, COMP_FOR); + } + + block_comment("switch(prec) {...}. case 2:"); { + // compress fq into y[] + // remember prec == 2 + + block_comment("for (i=jz;i>=0;i--) fw += fq[i];"); { + fmovd(v4, 0.0d); + mov(i, jz); + bind(FW_FOR1); + ldrd(v1, Address(rscratch2, i, Address::lsl(3))); + subsw(i, i, 1); + faddd(v4, v4, v1); + br(GE, FW_FOR1); + } + bind(FW_FOR1_DONE); + // v1 contains fq[0]. so, keep it so far + fsubd(v5, v1, v4); // fw = fq[0] - fw + cbzw(ih, FW_Y0_NO_NEGATION); + fnegd(v4, v4); + bind(FW_Y0_NO_NEGATION); + + block_comment("for (i=1;i<=jz;i++) fw += fq[i];"); { + movw(i, 1); + cmpw(jz, 1); + br(LT, FW_FOR2_DONE); + bind(FW_FOR2); + ldrd(v1, Address(rscratch2, i, Address::lsl(3))); + addw(i, i, 1); + cmp(i, jz); + faddd(v5, v5, v1); + br(LE, FW_FOR2); + } + bind(FW_FOR2_DONE); + cbz(ih, FW_Y1_NO_NEGATION); + fnegd(v5, v5); + bind(FW_Y1_NO_NEGATION); + add(sp, sp, 560); + } +} + +///* __kernel_sin( x, y, iy) +// * kernel sin function on [-pi/4, pi/4], pi/4 ~ 0.7854 +// * Input x is assumed to be bounded by ~pi/4 in magnitude. +// * Input y is the tail of x. +// * Input iy indicates whether y is 0. (if iy=0, y assume to be 0). +// * +// * Algorithm +// * 1. Since sin(-x) = -sin(x), we need only to consider positive x. +// * 2. if x < 2^-27 (hx<0x3e400000 0), return x with inexact if x!=0. +// * 3. sin(x) is approximated by a polynomial of degree 13 on +// * [0,pi/4] +// * 3 13 +// * sin(x) ~ x + S1*x + ... + S6*x +// * where +// * +// * |sin(x) 2 4 6 8 10 12 | -58 +// * |----- - (1+S1*x +S2*x +S3*x +S4*x +S5*x +S6*x )| <= 2 +// * | x | +// * +// * 4. sin(x+y) = sin(x) + sin'(x')*y +// * ~ sin(x) + (1-x*x/2)*y +// * For better accuracy, let +// * 3 2 2 2 2 +// * r = x *(S2+x *(S3+x *(S4+x *(S5+x *S6)))) +// * then 3 2 +// * sin(x) = x + (S1*x + (x *(r-y/2)+y)) +// */ +//static const double +//S1 = -1.66666666666666324348e-01, /* 0xBFC55555, 0x55555549 */ +//S2 = 8.33333333332248946124e-03, /* 0x3F811111, 0x1110F8A6 */ +//S3 = -1.98412698298579493134e-04, /* 0xBF2A01A0, 0x19C161D5 */ +//S4 = 2.75573137070700676789e-06, /* 0x3EC71DE3, 0x57B1FE7D */ +//S5 = -2.50507602534068634195e-08, /* 0xBE5AE5E6, 0x8A2B9CEB */ +//S6 = 1.58969099521155010221e-10; /* 0x3DE5D93A, 0x5ACFD57C */ +// +// NOTE: S1..S6 were moved into a table: StubRoutines::aarch64::_dsin_coef +// +// BEGIN __kernel_sin PSEUDO CODE +// +//static double __kernel_sin(double x, double y, bool iy) +//{ +// double z,r,v; +// +// // NOTE: not needed. moved to dsin/dcos +// //int ix; +// //ix = high(x)&0x7fffffff; /* high word of x */ +// +// // NOTE: moved to dsin/dcos +// //if(ix<0x3e400000) /* |x| < 2**-27 */ +// // {if((int)x==0) return x;} /* generate inexact */ +// +// z = x*x; +// v = z*x; +// r = S2+z*(S3+z*(S4+z*(S5+z*S6))); +// if(iy==0) return x+v*(S1+z*r); +// else return x-((z*(half*y-v*r)-y)-v*S1); +//} +// +// END __kernel_sin PSEUDO CODE +// +// Changes between fdlibm and intrinsic: +// 1. Removed |x| < 2**-27 check, because if was done earlier in dsin/dcos +// 2. Constants are now loaded from table dsin_coef +// 3. C code parameter "int iy" was modified to "bool iyIsOne", because +// iy is always 0 or 1. Also, iyIsOne branch was moved into +// generation phase instead of taking it during code execution +// Input ans output: +// 1. Input for generated function: X argument = x +// 2. Input for generator: x = register to read argument from, iyIsOne +// = flag to use low argument low part or not, dsin_coef = coefficients +// table address +// 3. Return sin(x) value in v0 +void MacroAssembler::generate_kernel_sin(FloatRegister x, bool iyIsOne, + address dsin_coef) { + FloatRegister y = v5, z = v6, v = v7, r = v16, S1 = v17, S2 = v18, + S3 = v19, S4 = v20, S5 = v21, S6 = v22, half = v23; + lea(rscratch2, ExternalAddress(dsin_coef)); + ldpd(S5, S6, Address(rscratch2, 32)); + fmuld(z, x, x); // z = x*x; + ld1(S1, S2, S3, S4, T1D, Address(rscratch2)); + fmuld(v, z, x); // v = z*x; + + block_comment("calculate r = S2+z*(S3+z*(S4+z*(S5+z*S6)))"); { + fmaddd(r, z, S6, S5); + // initialize "half" in current block to utilize 2nd FPU. However, it's + // not a part of this block + fmovd(half, 0.5); + fmaddd(r, z, r, S4); + fmaddd(r, z, r, S3); + fmaddd(r, z, r, S2); + } + + if (!iyIsOne) { + // return x+v*(S1+z*r); + fmaddd(S1, z, r, S1); + fmaddd(v0, v, S1, x); + } else { + // return x-((z*(half*y-v*r)-y)-v*S1); + fmuld(S6, half, y); // half*y + fmsubd(S6, v, r, S6); // half*y-v*r + fmsubd(S6, z, S6, y); // y - z*(half*y-v*r) = - (z*(half*y-v*r)-y) + fmaddd(S6, v, S1, S6); // - (z*(half*y-v*r)-y) + v*S1 == -((z*(half*y-v*r)-y)-v*S1) + faddd(v0, x, S6); + } +} + +///* +// * __kernel_cos( x, y ) +// * kernel cos function on [-pi/4, pi/4], pi/4 ~ 0.785398164 +// * Input x is assumed to be bounded by ~pi/4 in magnitude. +// * Input y is the tail of x. +// * +// * Algorithm +// * 1. Since cos(-x) = cos(x), we need only to consider positive x. +// * 2. if x < 2^-27 (hx<0x3e400000 0), return 1 with inexact if x!=0. +// * 3. cos(x) is approximated by a polynomial of degree 14 on +// * [0,pi/4] +// * 4 14 +// * cos(x) ~ 1 - x*x/2 + C1*x + ... + C6*x +// * where the remez error is +// * +// * | 2 4 6 8 10 12 14 | -58 +// * |cos(x)-(1-.5*x +C1*x +C2*x +C3*x +C4*x +C5*x +C6*x )| <= 2 +// * | | +// * +// * 4 6 8 10 12 14 +// * 4. let r = C1*x +C2*x +C3*x +C4*x +C5*x +C6*x , then +// * cos(x) = 1 - x*x/2 + r +// * since cos(x+y) ~ cos(x) - sin(x)*y +// * ~ cos(x) - x*y, +// * a correction term is necessary in cos(x) and hence +// * cos(x+y) = 1 - (x*x/2 - (r - x*y)) +// * For better accuracy when x > 0.3, let qx = |x|/4 with +// * the last 32 bits mask off, and if x > 0.78125, let qx = 0.28125. +// * Then +// * cos(x+y) = (1-qx) - ((x*x/2-qx) - (r-x*y)). +// * Note that 1-qx and (x*x/2-qx) is EXACT here, and the +// * magnitude of the latter is at least a quarter of x*x/2, +// * thus, reducing the rounding error in the subtraction. +// */ +// +//static const double +//C1 = 4.16666666666666019037e-02, /* 0x3FA55555, 0x5555554C */ +//C2 = -1.38888888888741095749e-03, /* 0xBF56C16C, 0x16C15177 */ +//C3 = 2.48015872894767294178e-05, /* 0x3EFA01A0, 0x19CB1590 */ +//C4 = -2.75573143513906633035e-07, /* 0xBE927E4F, 0x809C52AD */ +//C5 = 2.08757232129817482790e-09, /* 0x3E21EE9E, 0xBDB4B1C4 */ +//C6 = -1.13596475577881948265e-11; /* 0xBDA8FAE9, 0xBE8838D4 */ +// +// NOTE: C1..C6 were moved into a table: StubRoutines::aarch64::_dcos_coef +// +// BEGIN __kernel_cos PSEUDO CODE +// +//static double __kernel_cos(double x, double y) +//{ +// double a,h,z,r,qx=0; +// +// // NOTE: ix is already initialized in dsin/dcos. Reuse value from register +// //int ix; +// //ix = high(x)&0x7fffffff; /* ix = |x|'s high word*/ +// +// // NOTE: moved to dsin/dcos +// //if(ix<0x3e400000) { /* if x < 2**27 */ +// // if(((int)x)==0) return one; /* generate inexact */ +// //} +// +// z = x*x; +// r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6))))); +// if(ix < 0x3FD33333) /* if |x| < 0.3 */ +// return one - (0.5*z - (z*r - x*y)); +// else { +// if(ix > 0x3fe90000) { /* x > 0.78125 */ +// qx = 0.28125; +// } else { +// set_high(&qx, ix-0x00200000); /* x/4 */ +// set_low(&qx, 0); +// } +// h = 0.5*z-qx; +// a = one-qx; +// return a - (h - (z*r-x*y)); +// } +//} +// +// END __kernel_cos PSEUDO CODE +// +// Changes between fdlibm and intrinsic: +// 1. Removed |x| < 2**-27 check, because if was done earlier in dsin/dcos +// 2. Constants are now loaded from table dcos_coef +// Input and output: +// 1. Input for generated function: X argument = x +// 2. Input for generator: x = register to read argument from, dcos_coef +// = coefficients table address +// 2. Return cos(x) value in v0 +void MacroAssembler::generate_kernel_cos(FloatRegister x, address dcos_coef) { + Register ix = r3; + FloatRegister qx = v1, h = v2, a = v3, y = v5, z = v6, r = v7, C1 = v18, + C2 = v19, C3 = v20, C4 = v21, C5 = v22, C6 = v23, one = v25, half = v26; + Label IX_IS_LARGE, SET_QX_CONST, DONE, QX_SET; + lea(rscratch2, ExternalAddress(dcos_coef)); + ldpd(C5, C6, Address(rscratch2, 32)); // load C5, C6 + fmuld(z, x, x); // z=x^2 + ld1(C1, C2, C3, C4, T1D, Address(rscratch2)); // load C1..C3\4 + block_comment("calculate r = z*(C1+z*(C2+z*(C3+z*(C4+z*(C5+z*C6)))))"); { + fmaddd(r, z, C6, C5); + fmovd(half, 0.5d); + fmaddd(r, z, r, C4); + fmuld(y, x, y); + fmaddd(r, z, r, C3); + mov(rscratch1, 0x3FD33333); + fmaddd(r, z, r, C2); + fmuld(x, z, z); // x = z^2 + fmaddd(r, z, r, C1); // r = C1+z(C2+z(C4+z(C5+z*C6))) + } + // need to multiply r by z to have "final" r value + fmovd(one, 1.0d); + cmp(ix, rscratch1); + br(GT, IX_IS_LARGE); + block_comment("if(ix < 0x3FD33333) return one - (0.5*z - (z*r - x*y))"); { + // return 1.0 - (0.5*z - (z*r - x*y)) = 1.0 - (0.5*z + (x*y - z*r)) + fmsubd(v0, x, r, y); + fmaddd(v0, half, z, v0); + fsubd(v0, one, v0); + b(DONE); + } + block_comment("if(ix >= 0x3FD33333)"); { + bind(IX_IS_LARGE); + movz(rscratch2, 0x3FE9, 16); + cmp(ix, rscratch2); + br(GT, SET_QX_CONST); + block_comment("set_high(&qx, ix-0x00200000); set_low(&qx, 0);"); { + subw(rscratch2, ix, 0x00200000); + lsl(rscratch2, rscratch2, 32); + fmovd(qx, rscratch2); + } + b(QX_SET); + bind(SET_QX_CONST); + block_comment("if(ix > 0x3fe90000) qx = 0.28125;"); { + fmovd(qx, 0.28125d); + } + bind(QX_SET); + fnmsub(C6, x, r, y); // z*r - xy + fnmsub(h, half, z, qx); // h = 0.5*z - qx + fsubd(a, one, qx); // a = 1-qx + fsubd(C6, h, C6); // = h - (z*r - x*y) + fsubd(v0, a, C6); + } + bind(DONE); +} + +// generate_dsin_dcos creates stub for dsin and dcos +// Generation is done via single call because dsin and dcos code is almost the +// same(see C code below). These functions work as follows: +// 1) handle corner cases: |x| ~< pi/4, x is NaN or INF, |x| < 2**-27 +// 2) perform argument reduction if required +// 3) call kernel_sin or kernel_cos which approximate sin/cos via polynomial +// +// BEGIN dsin/dcos PSEUDO CODE +// +//dsin_dcos(jdouble x, bool isCos) { +// double y[2],z=0.0; +// int n, ix; +// +// /* High word of x. */ +// ix = high(x); +// +// /* |x| ~< pi/4 */ +// ix &= 0x7fffffff; +// if(ix <= 0x3fe921fb) return isCos ? __kernel_cos : __kernel_sin(x,z,0); +// +// /* sin/cos(Inf or NaN) is NaN */ +// else if (ix>=0x7ff00000) return x-x; +// else if (ix<0x3e400000) { /* if ix < 2**27 */ +// if(((int)x)==0) return isCos ? one : x; /* generate inexact */ +// } +// /* argument reduction needed */ +// else { +// n = __ieee754_rem_pio2(x,y); +// switch(n&3) { +// case 0: return isCos ? __kernel_cos(y[0],y[1]) : __kernel_sin(y[0],y[1], true); +// case 1: return isCos ? -__kernel_sin(y[0],y[1],true) : __kernel_cos(y[0],y[1]); +// case 2: return isCos ? -__kernel_cos(y[0],y[1]) : -__kernel_sin(y[0],y[1], true); +// default: +// return isCos ? __kernel_sin(y[0],y[1],1) : -__kernel_cos(y[0],y[1]); +// } +// } +//} +// END dsin/dcos PSEUDO CODE +// +// Changes between fdlibm and intrinsic: +// 1. Moved ix < 2**27 from kernel_sin/kernel_cos into dsin/dcos +// 2. Final switch use equivalent bit checks(tbz/tbnz) +// Input ans output: +// 1. Input for generated function: X = r0 +// 2. Input for generator: isCos = generate sin or cos, npio2_hw = address +// of npio2_hw table, two_over_pi = address of two_over_pi table, +// pio2 = address if pio2 table, dsin_coef = address if dsin_coef table, +// dcos_coef = address of dcos_coef table +// 3. Return result in v0 +// NOTE: general purpose register names match local variable names in C code +void MacroAssembler::generate_dsin_dcos(bool isCos, address npio2_hw, + address two_over_pi, address pio2, address dsin_coef, address dcos_coef) { + const int POSITIVE_INFINITY_OR_NAN_PREFIX = 0x7FF0; + + Label DONE, ARG_REDUCTION, TINY_X, RETURN_SIN, EARLY_CASE; + Register X = r0, absX = r1, n = r2, ix = r3; + FloatRegister y0 = v4, y1 = v5; + block_comment("check |x| ~< pi/4, NaN, Inf and |x| < 2**-27 cases"); { + fmovd(X, v0); + mov(rscratch2, 0x3e400000); + mov(rscratch1, 0x3fe921fb00000000); // pi/4. shifted to reuse later + ubfm(absX, X, 0, 62); // absX + movz(r10, POSITIVE_INFINITY_OR_NAN_PREFIX, 48); + cmp(rscratch2, absX, LSR, 32); + lsr(ix, absX, 32); // set ix + br(GT, TINY_X); // handle tiny x (|x| < 2^-27) + cmp(ix, rscratch1, LSR, 32); + br(LE, EARLY_CASE); // if(ix <= 0x3fe921fb) return + cmp(absX, r10); + br(LT, ARG_REDUCTION); + // X is NaN or INF(i.e. 0x7FF* or 0xFFF*). Return NaN (mantissa != 0). + // Set last bit unconditionally to make it NaN + orr(r10, r10, 1); + fmovd(v0, r10); + ret(lr); + } + block_comment("kernel_sin/kernel_cos: if(ix<0x3e400000) {}"); { + bind(TINY_X); + if (isCos) { + fmovd(v0, 1.0d); + } + ret(lr); + } + bind(ARG_REDUCTION); /* argument reduction needed */ + block_comment("n = __ieee754_rem_pio2(x,y);"); { + generate__ieee754_rem_pio2(npio2_hw, two_over_pi, pio2); + } + block_comment("switch(n&3) {case ... }"); { + if (isCos) { + eorw(absX, n, n, LSR, 1); + tbnz(n, 0, RETURN_SIN); + } else { + tbz(n, 0, RETURN_SIN); + } + generate_kernel_cos(y0, dcos_coef); + if (isCos) { + tbz(absX, 0, DONE); + } else { + tbz(n, 1, DONE); + } + fnegd(v0, v0); + ret(lr); + bind(RETURN_SIN); + generate_kernel_sin(y0, true, dsin_coef); + if (isCos) { + tbz(absX, 0, DONE); + } else { + tbz(n, 1, DONE); + } + fnegd(v0, v0); + ret(lr); + } + bind(EARLY_CASE); + eor(y1, T8B, y1, y1); + if (isCos) { + generate_kernel_cos(v0, dcos_coef); + } else { + generate_kernel_sin(v0, false, dsin_coef); + } + bind(DONE); + ret(lr); +} diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1351,9 +1351,9 @@ BLOCK_COMMENT("Entry:"); } - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -1425,9 +1425,9 @@ __ cmp(rscratch1, count, Assembler::LSL, exact_log2(size)); __ br(Assembler::HS, nooverlap_target); - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; + DecoratorSet decorators = IN_HEAP | IS_ARRAY; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -1789,10 +1789,10 @@ } #endif //ASSERT - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_CHECKCAST; bool is_oop = true; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); @@ -3990,6 +3990,701 @@ return entry; } + address generate_dsin_dcos(bool isCos) { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", isCos ? "libmDcos" : "libmDsin"); + address start = __ pc(); + __ generate_dsin_dcos(isCos, (address)StubRoutines::aarch64::_npio2_hw, + (address)StubRoutines::aarch64::_two_over_pi, + (address)StubRoutines::aarch64::_pio2, + (address)StubRoutines::aarch64::_dsin_coef, + (address)StubRoutines::aarch64::_dcos_coef); + return start; + } + + address generate_dlog() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "dlog"); + address entry = __ pc(); + FloatRegister vtmp0 = v0, vtmp1 = v1, vtmp2 = v2, vtmp3 = v3, vtmp4 = v4, + vtmp5 = v5, tmpC1 = v16, tmpC2 = v17, tmpC3 = v18, tmpC4 = v19; + Register tmp1 = r0, tmp2 = r1, tmp3 = r2, tmp4 = r3, tmp5 = r4; + __ fast_log(vtmp0, vtmp1, vtmp2, vtmp3, vtmp4, vtmp5, tmpC1, tmpC2, tmpC3, + tmpC4, tmp1, tmp2, tmp3, tmp4, tmp5); + return entry; + } + + // code for comparing 16 bytes of strings with same encoding + void compare_string_16_bytes_same(Label &DIFF1, Label &DIFF2) { + Register result = r0, str1 = r1, cnt1 = r2, str2 = r3, tmp1 = r10, tmp2 = r11; + __ ldr(rscratch1, Address(__ post(str1, 8))); + __ eor(rscratch2, tmp1, tmp2); + __ ldr(cnt1, Address(__ post(str2, 8))); + __ cbnz(rscratch2, DIFF1); + __ ldr(tmp1, Address(__ post(str1, 8))); + __ eor(rscratch2, rscratch1, cnt1); + __ ldr(tmp2, Address(__ post(str2, 8))); + __ cbnz(rscratch2, DIFF2); + } + + // code for comparing 16 characters of strings with Latin1 and Utf16 encoding + void compare_string_16_x_LU(Register tmpL, Register tmpU, Label &DIFF1, + Label &DIFF2) { + Register cnt1 = r2, tmp1 = r10, tmp2 = r11, tmp3 = r12; + FloatRegister vtmp = v1, vtmpZ = v0, vtmp3 = v2; + + __ ldrq(vtmp, Address(__ post(tmp2, 16))); + __ ldr(tmpU, Address(__ post(cnt1, 8))); + __ zip1(vtmp3, __ T16B, vtmp, vtmpZ); + // now we have 32 bytes of characters (converted to U) in vtmp:vtmp3 + + __ fmovd(tmpL, vtmp3); + __ eor(rscratch2, tmp3, tmpL); + __ cbnz(rscratch2, DIFF2); + + __ ldr(tmp3, Address(__ post(cnt1, 8))); + __ umov(tmpL, vtmp3, __ D, 1); + __ eor(rscratch2, tmpU, tmpL); + __ cbnz(rscratch2, DIFF1); + + __ zip2(vtmp, __ T16B, vtmp, vtmpZ); + __ ldr(tmpU, Address(__ post(cnt1, 8))); + __ fmovd(tmpL, vtmp); + __ eor(rscratch2, tmp3, tmpL); + __ cbnz(rscratch2, DIFF2); + + __ ldr(tmp3, Address(__ post(cnt1, 8))); + __ umov(tmpL, vtmp, __ D, 1); + __ eor(rscratch2, tmpU, tmpL); + __ cbnz(rscratch2, DIFF1); + } + + // r0 = result + // r1 = str1 + // r2 = cnt1 + // r3 = str2 + // r4 = cnt2 + // r10 = tmp1 + // r11 = tmp2 + address generate_compare_long_string_different_encoding(bool isLU) { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", isLU + ? "compare_long_string_different_encoding LU" + : "compare_long_string_different_encoding UL"); + address entry = __ pc(); + Label SMALL_LOOP, TAIL, TAIL_LOAD_16, LOAD_LAST, DIFF1, DIFF2, + DONE, CALCULATE_DIFFERENCE, LARGE_LOOP_PREFETCH, SMALL_LOOP_ENTER, + LARGE_LOOP_PREFETCH_REPEAT1, LARGE_LOOP_PREFETCH_REPEAT2; + Register result = r0, str1 = r1, cnt1 = r2, str2 = r3, cnt2 = r4, + tmp1 = r10, tmp2 = r11, tmp3 = r12, tmp4 = r14; + FloatRegister vtmpZ = v0, vtmp = v1, vtmp3 = v2; + RegSet spilled_regs = RegSet::of(tmp3, tmp4); + + int prefetchLoopExitCondition = MAX(32, SoftwarePrefetchHintDistance/2); + + __ eor(vtmpZ, __ T16B, vtmpZ, vtmpZ); + // cnt2 == amount of characters left to compare + // Check already loaded first 4 symbols(vtmp and tmp2(LU)/tmp1(UL)) + __ zip1(vtmp, __ T8B, vtmp, vtmpZ); + __ add(str1, str1, isLU ? wordSize/2 : wordSize); + __ add(str2, str2, isLU ? wordSize : wordSize/2); + __ fmovd(isLU ? tmp1 : tmp2, vtmp); + __ subw(cnt2, cnt2, 8); // Already loaded 4 symbols. Last 4 is special case. + __ add(str1, str1, cnt2, __ LSL, isLU ? 0 : 1); + __ eor(rscratch2, tmp1, tmp2); + __ add(str2, str2, cnt2, __ LSL, isLU ? 1 : 0); + __ mov(rscratch1, tmp2); + __ cbnz(rscratch2, CALCULATE_DIFFERENCE); + Register strU = isLU ? str2 : str1, + strL = isLU ? str1 : str2, + tmpU = isLU ? rscratch1 : tmp1, // where to keep U for comparison + tmpL = isLU ? tmp1 : rscratch1; // where to keep L for comparison + __ push(spilled_regs, sp); + __ sub(tmp2, strL, cnt2); // strL pointer to load from + __ sub(cnt1, strU, cnt2, __ LSL, 1); // strU pointer to load from + + __ ldr(tmp3, Address(__ post(cnt1, 8))); + + if (SoftwarePrefetchHintDistance >= 0) { + __ cmp(cnt2, prefetchLoopExitCondition); + __ br(__ LT, SMALL_LOOP); + __ bind(LARGE_LOOP_PREFETCH); + __ prfm(Address(tmp2, SoftwarePrefetchHintDistance)); + __ mov(tmp4, 2); + __ prfm(Address(cnt1, SoftwarePrefetchHintDistance)); + __ bind(LARGE_LOOP_PREFETCH_REPEAT1); + compare_string_16_x_LU(tmpL, tmpU, DIFF1, DIFF2); + __ subs(tmp4, tmp4, 1); + __ br(__ GT, LARGE_LOOP_PREFETCH_REPEAT1); + __ prfm(Address(cnt1, SoftwarePrefetchHintDistance)); + __ mov(tmp4, 2); + __ bind(LARGE_LOOP_PREFETCH_REPEAT2); + compare_string_16_x_LU(tmpL, tmpU, DIFF1, DIFF2); + __ subs(tmp4, tmp4, 1); + __ br(__ GT, LARGE_LOOP_PREFETCH_REPEAT2); + __ sub(cnt2, cnt2, 64); + __ cmp(cnt2, prefetchLoopExitCondition); + __ br(__ GE, LARGE_LOOP_PREFETCH); + } + __ cbz(cnt2, LOAD_LAST); // no characters left except last load + __ subs(cnt2, cnt2, 16); + __ br(__ LT, TAIL); + __ b(SMALL_LOOP_ENTER); + __ bind(SMALL_LOOP); // smaller loop + __ subs(cnt2, cnt2, 16); + __ bind(SMALL_LOOP_ENTER); + compare_string_16_x_LU(tmpL, tmpU, DIFF1, DIFF2); + __ br(__ GE, SMALL_LOOP); + __ cbz(cnt2, LOAD_LAST); + __ bind(TAIL); // 1..15 characters left + __ cmp(cnt2, -8); + __ br(__ GT, TAIL_LOAD_16); + __ ldrd(vtmp, Address(tmp2)); + __ zip1(vtmp3, __ T8B, vtmp, vtmpZ); + + __ ldr(tmpU, Address(__ post(cnt1, 8))); + __ fmovd(tmpL, vtmp3); + __ eor(rscratch2, tmp3, tmpL); + __ cbnz(rscratch2, DIFF2); + __ umov(tmpL, vtmp3, __ D, 1); + __ eor(rscratch2, tmpU, tmpL); + __ cbnz(rscratch2, DIFF1); + __ b(LOAD_LAST); + __ bind(TAIL_LOAD_16); + __ ldrq(vtmp, Address(tmp2)); + __ ldr(tmpU, Address(__ post(cnt1, 8))); + __ zip1(vtmp3, __ T16B, vtmp, vtmpZ); + __ zip2(vtmp, __ T16B, vtmp, vtmpZ); + __ fmovd(tmpL, vtmp3); + __ eor(rscratch2, tmp3, tmpL); + __ cbnz(rscratch2, DIFF2); + + __ ldr(tmp3, Address(__ post(cnt1, 8))); + __ umov(tmpL, vtmp3, __ D, 1); + __ eor(rscratch2, tmpU, tmpL); + __ cbnz(rscratch2, DIFF1); + + __ ldr(tmpU, Address(__ post(cnt1, 8))); + __ fmovd(tmpL, vtmp); + __ eor(rscratch2, tmp3, tmpL); + __ cbnz(rscratch2, DIFF2); + + __ umov(tmpL, vtmp, __ D, 1); + __ eor(rscratch2, tmpU, tmpL); + __ cbnz(rscratch2, DIFF1); + __ b(LOAD_LAST); + __ bind(DIFF2); + __ mov(tmpU, tmp3); + __ bind(DIFF1); + __ pop(spilled_regs, sp); + __ b(CALCULATE_DIFFERENCE); + __ bind(LOAD_LAST); + __ pop(spilled_regs, sp); + + __ ldrs(vtmp, Address(strL)); + __ ldr(tmpU, Address(strU)); + __ zip1(vtmp, __ T8B, vtmp, vtmpZ); + __ fmovd(tmpL, vtmp); + + __ eor(rscratch2, tmpU, tmpL); + __ cbz(rscratch2, DONE); + + // Find the first different characters in the longwords and + // compute their difference. + __ bind(CALCULATE_DIFFERENCE); + __ rev(rscratch2, rscratch2); + __ clz(rscratch2, rscratch2); + __ andr(rscratch2, rscratch2, -16); + __ lsrv(tmp1, tmp1, rscratch2); + __ uxthw(tmp1, tmp1); + __ lsrv(rscratch1, rscratch1, rscratch2); + __ uxthw(rscratch1, rscratch1); + __ subw(result, tmp1, rscratch1); + __ bind(DONE); + __ ret(lr); + return entry; + } + + // r0 = result + // r1 = str1 + // r2 = cnt1 + // r3 = str2 + // r4 = cnt2 + // r10 = tmp1 + // r11 = tmp2 + address generate_compare_long_string_same_encoding(bool isLL) { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", isLL + ? "compare_long_string_same_encoding LL" + : "compare_long_string_same_encoding UU"); + address entry = __ pc(); + Register result = r0, str1 = r1, cnt1 = r2, str2 = r3, cnt2 = r4, + tmp1 = r10, tmp2 = r11; + Label SMALL_LOOP, LARGE_LOOP_PREFETCH, CHECK_LAST, DIFF2, TAIL, + LENGTH_DIFF, DIFF, LAST_CHECK_AND_LENGTH_DIFF, + DIFF_LAST_POSITION, DIFF_LAST_POSITION2; + // exit from large loop when less than 64 bytes left to read or we're about + // to prefetch memory behind array border + int largeLoopExitCondition = MAX(64, SoftwarePrefetchHintDistance)/(isLL ? 1 : 2); + // cnt1/cnt2 contains amount of characters to compare. cnt1 can be re-used + // update cnt2 counter with already loaded 8 bytes + __ sub(cnt2, cnt2, wordSize/(isLL ? 1 : 2)); + // update pointers, because of previous read + __ add(str1, str1, wordSize); + __ add(str2, str2, wordSize); + if (SoftwarePrefetchHintDistance >= 0) { + __ bind(LARGE_LOOP_PREFETCH); + __ prfm(Address(str1, SoftwarePrefetchHintDistance)); + __ prfm(Address(str2, SoftwarePrefetchHintDistance)); + compare_string_16_bytes_same(DIFF, DIFF2); + compare_string_16_bytes_same(DIFF, DIFF2); + __ sub(cnt2, cnt2, isLL ? 64 : 32); + compare_string_16_bytes_same(DIFF, DIFF2); + __ cmp(cnt2, largeLoopExitCondition); + compare_string_16_bytes_same(DIFF, DIFF2); + __ br(__ GT, LARGE_LOOP_PREFETCH); + __ cbz(cnt2, LAST_CHECK_AND_LENGTH_DIFF); // no more chars left? + // less than 16 bytes left? + __ subs(cnt2, cnt2, isLL ? 16 : 8); + __ br(__ LT, TAIL); + } + __ bind(SMALL_LOOP); + compare_string_16_bytes_same(DIFF, DIFF2); + __ subs(cnt2, cnt2, isLL ? 16 : 8); + __ br(__ GE, SMALL_LOOP); + __ bind(TAIL); + __ adds(cnt2, cnt2, isLL ? 16 : 8); + __ br(__ EQ, LAST_CHECK_AND_LENGTH_DIFF); + __ subs(cnt2, cnt2, isLL ? 8 : 4); + __ br(__ LE, CHECK_LAST); + __ eor(rscratch2, tmp1, tmp2); + __ cbnz(rscratch2, DIFF); + __ ldr(tmp1, Address(__ post(str1, 8))); + __ ldr(tmp2, Address(__ post(str2, 8))); + __ sub(cnt2, cnt2, isLL ? 8 : 4); + __ bind(CHECK_LAST); + if (!isLL) { + __ add(cnt2, cnt2, cnt2); // now in bytes + } + __ eor(rscratch2, tmp1, tmp2); + __ cbnz(rscratch2, DIFF); + __ ldr(rscratch1, Address(str1, cnt2)); + __ ldr(cnt1, Address(str2, cnt2)); + __ eor(rscratch2, rscratch1, cnt1); + __ cbz(rscratch2, LENGTH_DIFF); + // Find the first different characters in the longwords and + // compute their difference. + __ bind(DIFF2); + __ rev(rscratch2, rscratch2); + __ clz(rscratch2, rscratch2); + __ andr(rscratch2, rscratch2, isLL ? -8 : -16); + __ lsrv(rscratch1, rscratch1, rscratch2); + if (isLL) { + __ lsrv(cnt1, cnt1, rscratch2); + __ uxtbw(rscratch1, rscratch1); + __ uxtbw(cnt1, cnt1); + } else { + __ lsrv(cnt1, cnt1, rscratch2); + __ uxthw(rscratch1, rscratch1); + __ uxthw(cnt1, cnt1); + } + __ subw(result, rscratch1, cnt1); + __ b(LENGTH_DIFF); + __ bind(DIFF); + __ rev(rscratch2, rscratch2); + __ clz(rscratch2, rscratch2); + __ andr(rscratch2, rscratch2, isLL ? -8 : -16); + __ lsrv(tmp1, tmp1, rscratch2); + if (isLL) { + __ lsrv(tmp2, tmp2, rscratch2); + __ uxtbw(tmp1, tmp1); + __ uxtbw(tmp2, tmp2); + } else { + __ lsrv(tmp2, tmp2, rscratch2); + __ uxthw(tmp1, tmp1); + __ uxthw(tmp2, tmp2); + } + __ subw(result, tmp1, tmp2); + __ b(LENGTH_DIFF); + __ bind(LAST_CHECK_AND_LENGTH_DIFF); + __ eor(rscratch2, tmp1, tmp2); + __ cbnz(rscratch2, DIFF); + __ bind(LENGTH_DIFF); + __ ret(lr); + return entry; + } + + void generate_compare_long_strings() { + StubRoutines::aarch64::_compare_long_string_LL + = generate_compare_long_string_same_encoding(true); + StubRoutines::aarch64::_compare_long_string_UU + = generate_compare_long_string_same_encoding(false); + StubRoutines::aarch64::_compare_long_string_LU + = generate_compare_long_string_different_encoding(true); + StubRoutines::aarch64::_compare_long_string_UL + = generate_compare_long_string_different_encoding(false); + } + + // R0 = result + // R1 = str2 + // R2 = cnt1 + // R3 = str1 + // R4 = cnt2 + // This generic linear code use few additional ideas, which makes it faster: + // 1) we can safely keep at least 1st register of pattern(since length >= 8) + // in order to skip initial loading(help in systems with 1 ld pipeline) + // 2) we can use "fast" algorithm of finding single character to search for + // first symbol with less branches(1 branch per each loaded register instead + // of branch for each symbol), so, this is where constants like + // 0x0101...01, 0x00010001...0001, 0x7f7f...7f, 0x7fff7fff...7fff comes from + // 3) after loading and analyzing 1st register of source string, it can be + // used to search for every 1st character entry, saving few loads in + // comparison with "simplier-but-slower" implementation + // 4) in order to avoid lots of push/pop operations, code below is heavily + // re-using/re-initializing/compressing register values, which makes code + // larger and a bit less readable, however, most of extra operations are + // issued during loads or branches, so, penalty is minimal + address generate_string_indexof_linear(bool str1_isL, bool str2_isL) { + const char* stubName = str1_isL + ? (str2_isL ? "indexof_linear_ll" : "indexof_linear_ul") + : "indexof_linear_uu"; + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", stubName); + address entry = __ pc(); + + int str1_chr_size = str1_isL ? 1 : 2; + int str2_chr_size = str2_isL ? 1 : 2; + int str1_chr_shift = str1_isL ? 0 : 1; + int str2_chr_shift = str2_isL ? 0 : 1; + bool isL = str1_isL && str2_isL; + // parameters + Register result = r0, str2 = r1, cnt1 = r2, str1 = r3, cnt2 = r4; + // temporary registers + Register tmp1 = r20, tmp2 = r21, tmp3 = r22, tmp4 = r23; + RegSet spilled_regs = RegSet::range(tmp1, tmp4); + // redefinitions + Register ch1 = rscratch1, ch2 = rscratch2, first = tmp3; + + __ push(spilled_regs, sp); + Label L_LOOP, L_LOOP_PROCEED, L_SMALL, L_HAS_ZERO, L_SMALL_MATCH_LOOP, + L_HAS_ZERO_LOOP, L_CMP_LOOP, L_CMP_LOOP_NOMATCH, L_SMALL_PROCEED, + L_SMALL_HAS_ZERO_LOOP, L_SMALL_CMP_LOOP_NOMATCH, L_SMALL_CMP_LOOP, + L_POST_LOOP, L_CMP_LOOP_LAST_CMP, L_HAS_ZERO_LOOP_NOMATCH, + L_SMALL_CMP_LOOP_LAST_CMP, L_SMALL_CMP_LOOP_LAST_CMP2, + L_CMP_LOOP_LAST_CMP2, DONE, NOMATCH; + // Read whole register from str1. It is safe, because length >=8 here + __ ldr(ch1, Address(str1)); + // Read whole register from str2. It is safe, because length >=8 here + __ ldr(ch2, Address(str2)); + __ andr(first, ch1, str1_isL ? 0xFF : 0xFFFF); + if (str1_isL != str2_isL) { + __ eor(v0, __ T16B, v0, v0); + } + __ mov(tmp1, str2_isL ? 0x0101010101010101 : 0x0001000100010001); + __ mul(first, first, tmp1); + // check if we have less than 1 register to check + __ subs(cnt2, cnt2, wordSize/str2_chr_size - 1); + if (str1_isL != str2_isL) { + __ fmovd(v1, ch1); + } + __ br(__ LE, L_SMALL); + __ eor(ch2, first, ch2); + if (str1_isL != str2_isL) { + __ zip1(v1, __ T16B, v1, v0); + } + __ sub(tmp2, ch2, tmp1); + __ orr(ch2, ch2, str2_isL ? 0x7f7f7f7f7f7f7f7f : 0x7fff7fff7fff7fff); + __ bics(tmp2, tmp2, ch2); + if (str1_isL != str2_isL) { + __ fmovd(ch1, v1); + } + __ br(__ NE, L_HAS_ZERO); + __ subs(cnt2, cnt2, wordSize/str2_chr_size); + __ add(result, result, wordSize/str2_chr_size); + __ add(str2, str2, wordSize); + __ br(__ LT, L_POST_LOOP); + __ BIND(L_LOOP); + __ ldr(ch2, Address(str2)); + __ eor(ch2, first, ch2); + __ sub(tmp2, ch2, tmp1); + __ orr(ch2, ch2, str2_isL ? 0x7f7f7f7f7f7f7f7f : 0x7fff7fff7fff7fff); + __ bics(tmp2, tmp2, ch2); + __ br(__ NE, L_HAS_ZERO); + __ BIND(L_LOOP_PROCEED); + __ subs(cnt2, cnt2, wordSize/str2_chr_size); + __ add(str2, str2, wordSize); + __ add(result, result, wordSize/str2_chr_size); + __ br(__ GE, L_LOOP); + __ BIND(L_POST_LOOP); + __ cmp(cnt2, -wordSize/str2_chr_size); // no extra characters to check + __ br(__ LE, NOMATCH); + __ ldr(ch2, Address(str2)); + __ sub(cnt2, zr, cnt2, __ LSL, LogBitsPerByte + str2_chr_shift); + __ eor(ch2, first, ch2); + __ sub(tmp2, ch2, tmp1); + __ orr(ch2, ch2, str2_isL ? 0x7f7f7f7f7f7f7f7f : 0x7fff7fff7fff7fff); + __ mov(tmp4, -1); // all bits set + __ b(L_SMALL_PROCEED); + __ align(OptoLoopAlignment); + __ BIND(L_SMALL); + __ sub(cnt2, zr, cnt2, __ LSL, LogBitsPerByte + str2_chr_shift); + __ eor(ch2, first, ch2); + if (str1_isL != str2_isL) { + __ zip1(v1, __ T16B, v1, v0); + } + __ sub(tmp2, ch2, tmp1); + __ mov(tmp4, -1); // all bits set + __ orr(ch2, ch2, str2_isL ? 0x7f7f7f7f7f7f7f7f : 0x7fff7fff7fff7fff); + if (str1_isL != str2_isL) { + __ fmovd(ch1, v1); // move converted 4 symbols + } + __ BIND(L_SMALL_PROCEED); + __ lsrv(tmp4, tmp4, cnt2); // mask. zeroes on useless bits. + __ bic(tmp2, tmp2, ch2); + __ ands(tmp2, tmp2, tmp4); // clear useless bits and check + __ rbit(tmp2, tmp2); + __ br(__ EQ, NOMATCH); + __ BIND(L_SMALL_HAS_ZERO_LOOP); + __ clz(tmp4, tmp2); // potentially long. Up to 4 cycles on some cpu's + __ cmp(cnt1, wordSize/str2_chr_size); + __ br(__ LE, L_SMALL_CMP_LOOP_LAST_CMP2); + if (str2_isL) { // LL + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte); // address of "index" + __ ldr(ch2, Address(str2)); // read whole register of str2. Safe. + __ lslv(tmp2, tmp2, tmp4); // shift off leading zeroes from match info + __ add(result, result, tmp4, __ LSR, LogBitsPerByte); + __ lsl(tmp2, tmp2, 1); // shift off leading "1" from match info + } else { + __ mov(ch2, 0xE); // all bits in byte set except last one + __ andr(ch2, ch2, tmp4, __ LSR, LogBitsPerByte); // byte shift amount + __ ldr(ch2, Address(str2, ch2)); // read whole register of str2. Safe. + __ lslv(tmp2, tmp2, tmp4); + __ add(result, result, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ lsl(tmp2, tmp2, 1); // shift off leading "1" from match info + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + } + __ cmp(ch1, ch2); + __ mov(tmp4, wordSize/str2_chr_size); + __ br(__ NE, L_SMALL_CMP_LOOP_NOMATCH); + __ BIND(L_SMALL_CMP_LOOP); + str1_isL ? __ ldrb(first, Address(str1, tmp4, Address::lsl(str1_chr_shift))) + : __ ldrh(first, Address(str1, tmp4, Address::lsl(str1_chr_shift))); + str2_isL ? __ ldrb(ch2, Address(str2, tmp4, Address::lsl(str2_chr_shift))) + : __ ldrh(ch2, Address(str2, tmp4, Address::lsl(str2_chr_shift))); + __ add(tmp4, tmp4, 1); + __ cmp(tmp4, cnt1); + __ br(__ GE, L_SMALL_CMP_LOOP_LAST_CMP); + __ cmp(first, ch2); + __ br(__ EQ, L_SMALL_CMP_LOOP); + __ BIND(L_SMALL_CMP_LOOP_NOMATCH); + __ cbz(tmp2, NOMATCH); // no more matches. exit + __ clz(tmp4, tmp2); + __ add(result, result, 1); // advance index + __ add(str2, str2, str2_chr_size); // advance pointer + __ b(L_SMALL_HAS_ZERO_LOOP); + __ align(OptoLoopAlignment); + __ BIND(L_SMALL_CMP_LOOP_LAST_CMP); + __ cmp(first, ch2); + __ br(__ NE, L_SMALL_CMP_LOOP_NOMATCH); + __ b(DONE); + __ align(OptoLoopAlignment); + __ BIND(L_SMALL_CMP_LOOP_LAST_CMP2); + if (str2_isL) { // LL + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte); // address of "index" + __ ldr(ch2, Address(str2)); // read whole register of str2. Safe. + __ lslv(tmp2, tmp2, tmp4); // shift off leading zeroes from match info + __ add(result, result, tmp4, __ LSR, LogBitsPerByte); + __ lsl(tmp2, tmp2, 1); // shift off leading "1" from match info + } else { + __ mov(ch2, 0xE); // all bits in byte set except last one + __ andr(ch2, ch2, tmp4, __ LSR, LogBitsPerByte); // byte shift amount + __ ldr(ch2, Address(str2, ch2)); // read whole register of str2. Safe. + __ lslv(tmp2, tmp2, tmp4); + __ add(result, result, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ lsl(tmp2, tmp2, 1); // shift off leading "1" from match info + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + } + __ cmp(ch1, ch2); + __ br(__ NE, L_SMALL_CMP_LOOP_NOMATCH); + __ b(DONE); + __ align(OptoLoopAlignment); + __ BIND(L_HAS_ZERO); + __ rbit(tmp2, tmp2); + __ clz(tmp4, tmp2); // potentially long. Up to 4 cycles on some CPU's + // Now, perform compression of counters(cnt2 and cnt1) into one register. + // It's fine because both counters are 32bit and are not changed in this + // loop. Just restore it on exit. So, cnt1 can be re-used in this loop. + __ orr(cnt2, cnt2, cnt1, __ LSL, BitsPerByte * wordSize / 2); + __ sub(result, result, 1); + __ BIND(L_HAS_ZERO_LOOP); + __ mov(cnt1, wordSize/str2_chr_size); + __ cmp(cnt1, cnt2, __ LSR, BitsPerByte * wordSize / 2); + __ br(__ GE, L_CMP_LOOP_LAST_CMP2); // case of 8 bytes only to compare + if (str2_isL) { + __ lsr(ch2, tmp4, LogBitsPerByte + str2_chr_shift); // char index + __ ldr(ch2, Address(str2, ch2)); // read whole register of str2. Safe. + __ lslv(tmp2, tmp2, tmp4); + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ add(tmp4, tmp4, 1); + __ add(result, result, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ lsl(tmp2, tmp2, 1); + __ mov(tmp4, wordSize/str2_chr_size); + } else { + __ mov(ch2, 0xE); + __ andr(ch2, ch2, tmp4, __ LSR, LogBitsPerByte); // byte shift amount + __ ldr(ch2, Address(str2, ch2)); // read whole register of str2. Safe. + __ lslv(tmp2, tmp2, tmp4); + __ add(tmp4, tmp4, 1); + __ add(result, result, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte); + __ lsl(tmp2, tmp2, 1); + __ mov(tmp4, wordSize/str2_chr_size); + __ sub(str2, str2, str2_chr_size); + } + __ cmp(ch1, ch2); + __ mov(tmp4, wordSize/str2_chr_size); + __ br(__ NE, L_CMP_LOOP_NOMATCH); + __ BIND(L_CMP_LOOP); + str1_isL ? __ ldrb(cnt1, Address(str1, tmp4, Address::lsl(str1_chr_shift))) + : __ ldrh(cnt1, Address(str1, tmp4, Address::lsl(str1_chr_shift))); + str2_isL ? __ ldrb(ch2, Address(str2, tmp4, Address::lsl(str2_chr_shift))) + : __ ldrh(ch2, Address(str2, tmp4, Address::lsl(str2_chr_shift))); + __ add(tmp4, tmp4, 1); + __ cmp(tmp4, cnt2, __ LSR, BitsPerByte * wordSize / 2); + __ br(__ GE, L_CMP_LOOP_LAST_CMP); + __ cmp(cnt1, ch2); + __ br(__ EQ, L_CMP_LOOP); + __ BIND(L_CMP_LOOP_NOMATCH); + // here we're not matched + __ cbz(tmp2, L_HAS_ZERO_LOOP_NOMATCH); // no more matches. Proceed to main loop + __ clz(tmp4, tmp2); + __ add(str2, str2, str2_chr_size); // advance pointer + __ b(L_HAS_ZERO_LOOP); + __ align(OptoLoopAlignment); + __ BIND(L_CMP_LOOP_LAST_CMP); + __ cmp(cnt1, ch2); + __ br(__ NE, L_CMP_LOOP_NOMATCH); + __ b(DONE); + __ align(OptoLoopAlignment); + __ BIND(L_CMP_LOOP_LAST_CMP2); + if (str2_isL) { + __ lsr(ch2, tmp4, LogBitsPerByte + str2_chr_shift); // char index + __ ldr(ch2, Address(str2, ch2)); // read whole register of str2. Safe. + __ lslv(tmp2, tmp2, tmp4); + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ add(tmp4, tmp4, 1); + __ add(result, result, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ lsl(tmp2, tmp2, 1); + } else { + __ mov(ch2, 0xE); + __ andr(ch2, ch2, tmp4, __ LSR, LogBitsPerByte); // byte shift amount + __ ldr(ch2, Address(str2, ch2)); // read whole register of str2. Safe. + __ lslv(tmp2, tmp2, tmp4); + __ add(tmp4, tmp4, 1); + __ add(result, result, tmp4, __ LSR, LogBitsPerByte + str2_chr_shift); + __ add(str2, str2, tmp4, __ LSR, LogBitsPerByte); + __ lsl(tmp2, tmp2, 1); + __ sub(str2, str2, str2_chr_size); + } + __ cmp(ch1, ch2); + __ br(__ NE, L_CMP_LOOP_NOMATCH); + __ b(DONE); + __ align(OptoLoopAlignment); + __ BIND(L_HAS_ZERO_LOOP_NOMATCH); + // 1) Restore "result" index. Index was wordSize/str2_chr_size * N until + // L_HAS_ZERO block. Byte octet was analyzed in L_HAS_ZERO_LOOP, + // so, result was increased at max by wordSize/str2_chr_size - 1, so, + // respective high bit wasn't changed. L_LOOP_PROCEED will increase + // result by analyzed characters value, so, we can just reset lower bits + // in result here. Clear 2 lower bits for UU/UL and 3 bits for LL + // 2) restore cnt1 and cnt2 values from "compressed" cnt2 + // 3) advance str2 value to represent next str2 octet. result & 7/3 is + // index of last analyzed substring inside current octet. So, str2 in at + // respective start address. We need to advance it to next octet + __ andr(tmp2, result, wordSize/str2_chr_size - 1); // symbols analyzed + __ lsr(cnt1, cnt2, BitsPerByte * wordSize / 2); + __ bfm(result, zr, 0, 2 - str2_chr_shift); + __ sub(str2, str2, tmp2, __ LSL, str2_chr_shift); // restore str2 + __ movw(cnt2, cnt2); + __ b(L_LOOP_PROCEED); + __ align(OptoLoopAlignment); + __ BIND(NOMATCH); + __ mov(result, -1); + __ BIND(DONE); + __ pop(spilled_regs, sp); + __ ret(lr); + return entry; + } + + void generate_string_indexof_stubs() { + StubRoutines::aarch64::_string_indexof_linear_ll = generate_string_indexof_linear(true, true); + StubRoutines::aarch64::_string_indexof_linear_uu = generate_string_indexof_linear(false, false); + StubRoutines::aarch64::_string_indexof_linear_ul = generate_string_indexof_linear(true, false); + } + + void inflate_and_store_2_fp_registers(bool generatePrfm, + FloatRegister src1, FloatRegister src2) { + Register dst = r1; + __ zip1(v1, __ T16B, src1, v0); + __ zip2(v2, __ T16B, src1, v0); + if (generatePrfm) { + __ prfm(Address(dst, SoftwarePrefetchHintDistance), PSTL1STRM); + } + __ zip1(v3, __ T16B, src2, v0); + __ zip2(v4, __ T16B, src2, v0); + __ st1(v1, v2, v3, v4, __ T16B, Address(__ post(dst, 64))); + } + + // R0 = src + // R1 = dst + // R2 = len + // R3 = len >> 3 + // V0 = 0 + // v1 = loaded 8 bytes + address generate_large_byte_array_inflate() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "large_byte_array_inflate"); + address entry = __ pc(); + Label LOOP, LOOP_START, LOOP_PRFM, LOOP_PRFM_START, DONE; + Register src = r0, dst = r1, len = r2, octetCounter = r3; + const int large_loop_threshold = MAX(64, SoftwarePrefetchHintDistance)/8 + 4; + + // do one more 8-byte read to have address 16-byte aligned in most cases + // also use single store instruction + __ ldrd(v2, __ post(src, 8)); + __ sub(octetCounter, octetCounter, 2); + __ zip1(v1, __ T16B, v1, v0); + __ zip1(v2, __ T16B, v2, v0); + __ st1(v1, v2, __ T16B, __ post(dst, 32)); + __ ld1(v3, v4, v5, v6, __ T16B, Address(__ post(src, 64))); + __ cmp(octetCounter, large_loop_threshold); + __ br(__ LE, LOOP_START); + __ b(LOOP_PRFM_START); + __ bind(LOOP_PRFM); + __ ld1(v3, v4, v5, v6, __ T16B, Address(__ post(src, 64))); + __ bind(LOOP_PRFM_START); + __ prfm(Address(src, SoftwarePrefetchHintDistance)); + __ sub(octetCounter, octetCounter, 8); + __ cmp(octetCounter, large_loop_threshold); + inflate_and_store_2_fp_registers(true, v3, v4); + inflate_and_store_2_fp_registers(true, v5, v6); + __ br(__ GT, LOOP_PRFM); + __ cmp(octetCounter, 8); + __ br(__ LT, DONE); + __ bind(LOOP); + __ ld1(v3, v4, v5, v6, __ T16B, Address(__ post(src, 64))); + __ bind(LOOP_START); + __ sub(octetCounter, octetCounter, 8); + __ cmp(octetCounter, 8); + inflate_and_store_2_fp_registers(false, v3, v4); + inflate_and_store_2_fp_registers(false, v5, v6); + __ br(__ GE, LOOP); + __ bind(DONE); + __ ret(lr); + return entry; + } /** * Arguments: @@ -5044,6 +5739,18 @@ if (UseCRC32CIntrinsics) { StubRoutines::_updateBytesCRC32C = generate_updateBytesCRC32C(); } + + if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dlog)) { + StubRoutines::_dlog = generate_dlog(); + } + + if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dsin)) { + StubRoutines::_dsin = generate_dsin_dcos(/* isCos = */ false); + } + + if (vmIntrinsics::is_intrinsic_available(vmIntrinsics::_dcos)) { + StubRoutines::_dcos = generate_dsin_dcos(/* isCos = */ true); + } } void generate_all() { @@ -5078,6 +5785,13 @@ StubRoutines::aarch64::_large_array_equals = generate_large_array_equals(); } + generate_compare_long_strings(); + + generate_string_indexof_stubs(); + + // byte_array_inflate stub for large arrays. + StubRoutines::aarch64::_large_byte_array_inflate = generate_large_byte_array_inflate(); + if (UseMultiplyToLenIntrinsic) { StubRoutines::_multiplyToLen = generate_multiplyToLen(); } diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/stubRoutines_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -48,6 +48,14 @@ address StubRoutines::aarch64::_has_negatives = NULL; address StubRoutines::aarch64::_has_negatives_long = NULL; address StubRoutines::aarch64::_large_array_equals = NULL; +address StubRoutines::aarch64::_compare_long_string_LL = NULL; +address StubRoutines::aarch64::_compare_long_string_UU = NULL; +address StubRoutines::aarch64::_compare_long_string_LU = NULL; +address StubRoutines::aarch64::_compare_long_string_UL = NULL; +address StubRoutines::aarch64::_string_indexof_linear_ll = NULL; +address StubRoutines::aarch64::_string_indexof_linear_uu = NULL; +address StubRoutines::aarch64::_string_indexof_linear_ul = NULL; +address StubRoutines::aarch64::_large_byte_array_inflate = NULL; bool StubRoutines::aarch64::_completed = false; /** @@ -278,3 +286,87 @@ 0x02D578EDUL, 0x7DAEED62UL, // word swap 0xD502ED78UL, 0xAE7D62EDUL, // byte swap of word swap }; + +juint StubRoutines::aarch64::_npio2_hw[] __attribute__ ((aligned(64))) = { + // first, various coefficient values: 0.5, invpio2, pio2_1, pio2_1t, pio2_2, + // pio2_2t, pio2_3, pio2_3t + // This is a small optimization wich keeping double[8] values in int[] table + // to have less address calculation instructions + // + // invpio2: 53 bits of 2/pi (enough for cases when trigonometric argument is small) + // pio2_1: first 33 bit of pi/2 + // pio2_1t: pi/2 - pio2_1 + // pio2_2: second 33 bit of pi/2 + // pio2_2t: pi/2 - (pio2_1+pio2_2) + // pio2_3: third 33 bit of pi/2 + // pio2_3t: pi/2 - (pio2_1+pio2_2+pio2_3) + 0x00000000, 0x3fe00000, // 0.5 + 0x6DC9C883, 0x3FE45F30, // invpio2 = 6.36619772367581382433e-01 + 0x54400000, 0x3FF921FB, // pio2_1 = 1.57079632673412561417e+00 + 0x1A626331, 0x3DD0B461, // pio2_1t = 6.07710050650619224932e-11 + 0x1A600000, 0x3DD0B461, // pio2_2 = 6.07710050630396597660e-11 + 0x2E037073, 0x3BA3198A, // pio2_2t = 2.02226624879595063154e-21 + 0x2E000000, 0x3BA3198A, // pio2_3 = 2.02226624871116645580e-21 + 0x252049C1, 0x397B839A, // pio2_3t = 8.47842766036889956997e-32 + // now, npio2_hw itself + 0x3FF921FB, 0x400921FB, 0x4012D97C, 0x401921FB, 0x401F6A7A, 0x4022D97C, + 0x4025FDBB, 0x402921FB, 0x402C463A, 0x402F6A7A, 0x4031475C, 0x4032D97C, + 0x40346B9C, 0x4035FDBB, 0x40378FDB, 0x403921FB, 0x403AB41B, 0x403C463A, + 0x403DD85A, 0x403F6A7A, 0x40407E4C, 0x4041475C, 0x4042106C, 0x4042D97C, + 0x4043A28C, 0x40446B9C, 0x404534AC, 0x4045FDBB, 0x4046C6CB, 0x40478FDB, + 0x404858EB, 0x404921FB +}; + +// Coefficients for sin(x) polynomial approximation: S1..S6. +// See kernel_sin comments in macroAssembler_aarch64_trig.cpp for details +jdouble StubRoutines::aarch64::_dsin_coef[] __attribute__ ((aligned(64))) = { + -1.66666666666666324348e-01, // 0xBFC5555555555549 + 8.33333333332248946124e-03, // 0x3F8111111110F8A6 + -1.98412698298579493134e-04, // 0xBF2A01A019C161D5 + 2.75573137070700676789e-06, // 0x3EC71DE357B1FE7D + -2.50507602534068634195e-08, // 0xBE5AE5E68A2B9CEB + 1.58969099521155010221e-10 // 0x3DE5D93A5ACFD57C +}; + +// Coefficients for cos(x) polynomial approximation: C1..C6. +// See kernel_cos comments in macroAssembler_aarch64_trig.cpp for details +jdouble StubRoutines::aarch64::_dcos_coef[] __attribute__ ((aligned(64))) = { + 4.16666666666666019037e-02, // c0x3FA555555555554C + -1.38888888888741095749e-03, // 0xBF56C16C16C15177 + 2.48015872894767294178e-05, // 0x3EFA01A019CB1590 + -2.75573143513906633035e-07, // 0xBE927E4F809C52AD + 2.08757232129817482790e-09, // 0x3E21EE9EBDB4B1C4 + -1.13596475577881948265e-11 // 0xBDA8FAE9BE8838D4 +}; + +// Table of constants for 2/pi, 396 Hex digits (476 decimal) of 2/pi. +// Used in cases of very large argument. 396 hex digits is enough to support +// required precision. +// Converted to double to avoid unnecessary conversion in code +// NOTE: table looks like original int table: {0xA2F983, 0x6E4E44,...} with +// only (double) conversion added +jdouble StubRoutines::aarch64::_two_over_pi[] __attribute__ ((aligned(64))) = { + (double)0xA2F983, (double)0x6E4E44, (double)0x1529FC, (double)0x2757D1, (double)0xF534DD, (double)0xC0DB62, + (double)0x95993C, (double)0x439041, (double)0xFE5163, (double)0xABDEBB, (double)0xC561B7, (double)0x246E3A, + (double)0x424DD2, (double)0xE00649, (double)0x2EEA09, (double)0xD1921C, (double)0xFE1DEB, (double)0x1CB129, + (double)0xA73EE8, (double)0x8235F5, (double)0x2EBB44, (double)0x84E99C, (double)0x7026B4, (double)0x5F7E41, + (double)0x3991D6, (double)0x398353, (double)0x39F49C, (double)0x845F8B, (double)0xBDF928, (double)0x3B1FF8, + (double)0x97FFDE, (double)0x05980F, (double)0xEF2F11, (double)0x8B5A0A, (double)0x6D1F6D, (double)0x367ECF, + (double)0x27CB09, (double)0xB74F46, (double)0x3F669E, (double)0x5FEA2D, (double)0x7527BA, (double)0xC7EBE5, + (double)0xF17B3D, (double)0x0739F7, (double)0x8A5292, (double)0xEA6BFB, (double)0x5FB11F, (double)0x8D5D08, + (double)0x560330, (double)0x46FC7B, (double)0x6BABF0, (double)0xCFBC20, (double)0x9AF436, (double)0x1DA9E3, + (double)0x91615E, (double)0xE61B08, (double)0x659985, (double)0x5F14A0, (double)0x68408D, (double)0xFFD880, + (double)0x4D7327, (double)0x310606, (double)0x1556CA, (double)0x73A8C9, (double)0x60E27B, (double)0xC08C6B, +}; + +// Pi over 2 value +jdouble StubRoutines::aarch64::_pio2[] __attribute__ ((aligned(64))) = { + 1.57079625129699707031e+00, // 0x3FF921FB40000000 + 7.54978941586159635335e-08, // 0x3E74442D00000000 + 5.39030252995776476554e-15, // 0x3CF8469880000000 + 3.28200341580791294123e-22, // 0x3B78CC5160000000 + 1.27065575308067607349e-29, // 0x39F01B8380000000 + 1.22933308981111328932e-36, // 0x387A252040000000 + 2.73370053816464559624e-44, // 0x36E3822280000000 + 2.16741683877804819444e-51, // 0x3569F31D00000000 +}; diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp openjdk-11-11~24/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/stubRoutines_aarch64.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -41,7 +41,7 @@ enum platform_dependent_constants { code_size1 = 19000, // simply increase if too small (assembler will crash if too small) - code_size2 = 22000 // simply increase if too small (assembler will crash if too small) + code_size2 = 28000 // simply increase if too small (assembler will crash if too small) }; class aarch64 { @@ -66,6 +66,14 @@ static address _has_negatives; static address _has_negatives_long; static address _large_array_equals; + static address _compare_long_string_LL; + static address _compare_long_string_LU; + static address _compare_long_string_UL; + static address _compare_long_string_UU; + static address _string_indexof_linear_ll; + static address _string_indexof_linear_uu; + static address _string_indexof_linear_ul; + static address _large_byte_array_inflate; static bool _completed; public: @@ -136,6 +144,38 @@ return _large_array_equals; } + static address compare_long_string_LL() { + return _compare_long_string_LL; + } + + static address compare_long_string_LU() { + return _compare_long_string_LU; + } + + static address compare_long_string_UL() { + return _compare_long_string_UL; + } + + static address compare_long_string_UU() { + return _compare_long_string_UU; + } + + static address string_indexof_linear_ul() { + return _string_indexof_linear_ul; + } + + static address string_indexof_linear_ll() { + return _string_indexof_linear_ll; + } + + static address string_indexof_linear_uu() { + return _string_indexof_linear_uu; + } + + static address large_byte_array_inflate() { + return _large_byte_array_inflate; + } + static bool complete() { return _completed; } @@ -146,7 +186,13 @@ private: static juint _crc_table[]; - + // begin trigonometric tables block. See comments in .cpp file + static juint _npio2_hw[]; + static jdouble _two_over_pi[]; + static jdouble _pio2[]; + static jdouble _dsin_coef[]; + static jdouble _dcos_coef[]; + // end trigonometric tables block }; #endif // CPU_AARCH64_VM_STUBROUTINES_AARCH64_HPP diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/templateInterpreterGenerator_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -247,26 +247,54 @@ address fn; switch (kind) { case Interpreter::java_lang_math_sin : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); + if (StubRoutines::dsin() == NULL) { + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dsin); + } else { + fn = CAST_FROM_FN_PTR(address, StubRoutines::dsin()); + } break; case Interpreter::java_lang_math_cos : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); + if (StubRoutines::dcos() == NULL) { + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dcos); + } else { + fn = CAST_FROM_FN_PTR(address, StubRoutines::dcos()); + } break; case Interpreter::java_lang_math_tan : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); + if (StubRoutines::dtan() == NULL) { + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dtan); + } else { + fn = CAST_FROM_FN_PTR(address, StubRoutines::dtan()); + } break; case Interpreter::java_lang_math_log : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); + if (StubRoutines::dlog() == NULL) { + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog); + } else { + fn = CAST_FROM_FN_PTR(address, StubRoutines::dlog()); + } break; case Interpreter::java_lang_math_log10 : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10); + if (StubRoutines::dlog10() == NULL) { + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dlog10); + } else { + fn = CAST_FROM_FN_PTR(address, StubRoutines::dlog10()); + } break; case Interpreter::java_lang_math_exp : - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dexp); + if (StubRoutines::dexp() == NULL) { + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dexp); + } else { + fn = CAST_FROM_FN_PTR(address, StubRoutines::dexp()); + } break; case Interpreter::java_lang_math_pow : fpargs = 2; - fn = CAST_FROM_FN_PTR(address, SharedRuntime::dpow); + if (StubRoutines::dpow() == NULL) { + fn = CAST_FROM_FN_PTR(address, SharedRuntime::dpow); + } else { + fn = CAST_FROM_FN_PTR(address, StubRoutines::dpow()); + } break; default: ShouldNotReachHere(); diff -Nru openjdk-11-11~19/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp openjdk-11-11~24/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp --- openjdk-11-11~19/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/aarch64/templateTable_aarch64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -761,7 +761,7 @@ // r1: index index_check(r0, r1); // leaves index in r1, kills rscratch1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_INT) >> 2); - __ access_load_at(T_INT, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(2)), noreg, noreg); + __ access_load_at(T_INT, IN_HEAP | IS_ARRAY, r0, Address(r0, r1, Address::uxtw(2)), noreg, noreg); } void TemplateTable::laload() @@ -773,7 +773,7 @@ // r1: index index_check(r0, r1); // leaves index in r1, kills rscratch1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_LONG) >> 3); - __ access_load_at(T_LONG, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(3)), noreg, noreg); + __ access_load_at(T_LONG, IN_HEAP | IS_ARRAY, r0, Address(r0, r1, Address::uxtw(3)), noreg, noreg); } void TemplateTable::faload() @@ -785,7 +785,7 @@ // r1: index index_check(r0, r1); // leaves index in r1, kills rscratch1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_FLOAT) >> 2); - __ access_load_at(T_FLOAT, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(2)), noreg, noreg); + __ access_load_at(T_FLOAT, IN_HEAP | IS_ARRAY, r0, Address(r0, r1, Address::uxtw(2)), noreg, noreg); } void TemplateTable::daload() @@ -797,7 +797,7 @@ // r1: index index_check(r0, r1); // leaves index in r1, kills rscratch1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_DOUBLE) >> 3); - __ access_load_at(T_DOUBLE, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(3)), noreg, noreg); + __ access_load_at(T_DOUBLE, IN_HEAP | IS_ARRAY, r0, Address(r0, r1, Address::uxtw(3)), noreg, noreg); } void TemplateTable::aaload() @@ -812,7 +812,7 @@ do_oop_load(_masm, Address(r0, r1, Address::uxtw(LogBytesPerHeapOop)), r0, - IN_HEAP_ARRAY); + IS_ARRAY); } void TemplateTable::baload() @@ -824,7 +824,7 @@ // r1: index index_check(r0, r1); // leaves index in r1, kills rscratch1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_BYTE) >> 0); - __ access_load_at(T_BYTE, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(0)), noreg, noreg); + __ access_load_at(T_BYTE, IN_HEAP | IS_ARRAY, r0, Address(r0, r1, Address::uxtw(0)), noreg, noreg); } void TemplateTable::caload() @@ -836,7 +836,7 @@ // r1: index index_check(r0, r1); // leaves index in r1, kills rscratch1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1); - __ access_load_at(T_CHAR, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(1)), noreg, noreg); + __ access_load_at(T_CHAR, IN_HEAP | IS_ARRAY, r0, Address(r0, r1, Address::uxtw(1)), noreg, noreg); } // iload followed by caload frequent pair @@ -853,7 +853,7 @@ // r1: index index_check(r0, r1); // leaves index in r1, kills rscratch1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1); - __ access_load_at(T_CHAR, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(1)), noreg, noreg); + __ access_load_at(T_CHAR, IN_HEAP | IS_ARRAY, r0, Address(r0, r1, Address::uxtw(1)), noreg, noreg); } void TemplateTable::saload() @@ -865,7 +865,7 @@ // r1: index index_check(r0, r1); // leaves index in r1, kills rscratch1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_SHORT) >> 1); - __ access_load_at(T_SHORT, IN_HEAP | IN_HEAP_ARRAY, r0, Address(r0, r1, Address::uxtw(1)), noreg, noreg); + __ access_load_at(T_SHORT, IN_HEAP | IS_ARRAY, r0, Address(r0, r1, Address::uxtw(1)), noreg, noreg); } void TemplateTable::iload(int n) @@ -1059,7 +1059,7 @@ // r3: array index_check(r3, r1); // prefer index in r1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_INT) >> 2); - __ access_store_at(T_INT, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(2)), r0, noreg, noreg); + __ access_store_at(T_INT, IN_HEAP | IS_ARRAY, Address(r3, r1, Address::uxtw(2)), r0, noreg, noreg); } void TemplateTable::lastore() { @@ -1071,7 +1071,7 @@ // r3: array index_check(r3, r1); // prefer index in r1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_LONG) >> 3); - __ access_store_at(T_LONG, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(3)), r0, noreg, noreg); + __ access_store_at(T_LONG, IN_HEAP | IS_ARRAY, Address(r3, r1, Address::uxtw(3)), r0, noreg, noreg); } void TemplateTable::fastore() { @@ -1083,7 +1083,7 @@ // r3: array index_check(r3, r1); // prefer index in r1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_FLOAT) >> 2); - __ access_store_at(T_FLOAT, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(2)), noreg /* ftos */, noreg, noreg); + __ access_store_at(T_FLOAT, IN_HEAP | IS_ARRAY, Address(r3, r1, Address::uxtw(2)), noreg /* ftos */, noreg, noreg); } void TemplateTable::dastore() { @@ -1095,7 +1095,7 @@ // r3: array index_check(r3, r1); // prefer index in r1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_DOUBLE) >> 3); - __ access_store_at(T_DOUBLE, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(3)), noreg /* dtos */, noreg, noreg); + __ access_store_at(T_DOUBLE, IN_HEAP | IS_ARRAY, Address(r3, r1, Address::uxtw(3)), noreg /* dtos */, noreg, noreg); } void TemplateTable::aastore() { @@ -1136,7 +1136,7 @@ // Get the value we will store __ ldr(r0, at_tos()); // Now store using the appropriate barrier - do_oop_store(_masm, element_address, r0, IN_HEAP_ARRAY); + do_oop_store(_masm, element_address, r0, IS_ARRAY); __ b(done); // Have a NULL in r0, r3=array, r2=index. Store NULL at ary[idx] @@ -1144,7 +1144,7 @@ __ profile_null_seen(r2); // Store a NULL - do_oop_store(_masm, element_address, noreg, IN_HEAP_ARRAY); + do_oop_store(_masm, element_address, noreg, IS_ARRAY); // Pop stack arguments __ bind(done); @@ -1172,7 +1172,7 @@ __ bind(L_skip); __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_BYTE) >> 0); - __ access_store_at(T_BYTE, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(0)), r0, noreg, noreg); + __ access_store_at(T_BYTE, IN_HEAP | IS_ARRAY, Address(r3, r1, Address::uxtw(0)), r0, noreg, noreg); } void TemplateTable::castore() @@ -1185,7 +1185,7 @@ // r3: array index_check(r3, r1); // prefer index in r1 __ add(r1, r1, arrayOopDesc::base_offset_in_bytes(T_CHAR) >> 1); - __ access_store_at(T_CHAR, IN_HEAP | IN_HEAP_ARRAY, Address(r3, r1, Address::uxtw(1)), r0, noreg, noreg); + __ access_store_at(T_CHAR, IN_HEAP | IS_ARRAY, Address(r3, r1, Address::uxtw(1)), r0, noreg, noreg); } void TemplateTable::sastore() @@ -3362,22 +3362,45 @@ // r2: receiver // r3: flags + // First check for Object case, then private interface method, + // then regular interface method. + // Special case of invokeinterface called for virtual method of - // java.lang.Object. See cpCacheOop.cpp for details. - // This code isn't produced by javac, but could be produced by - // another compliant java compiler. - Label notMethod; - __ tbz(r3, ConstantPoolCacheEntry::is_forced_virtual_shift, notMethod); + // java.lang.Object. See cpCache.cpp for details. + Label notObjectMethod; + __ tbz(r3, ConstantPoolCacheEntry::is_forced_virtual_shift, notObjectMethod); invokevirtual_helper(rmethod, r2, r3); - __ bind(notMethod); + __ bind(notObjectMethod); + + Label no_such_interface; + + // Check for private method invocation - indicated by vfinal + Label notVFinal; + __ tbz(r3, ConstantPoolCacheEntry::is_vfinal_shift, notVFinal); + + // Get receiver klass into r3 - also a null check + __ null_check(r2, oopDesc::klass_offset_in_bytes()); + __ load_klass(r3, r2); + + Label subtype; + __ check_klass_subtype(r3, r0, r4, subtype); + // If we get here the typecheck failed + __ b(no_such_interface); + __ bind(subtype); + + __ profile_final_call(r0); + __ profile_arguments_type(r0, rmethod, r4, true); + __ jump_from_interpreted(rmethod, r0); + + __ bind(notVFinal); // Get receiver klass into r3 - also a null check __ restore_locals(); __ null_check(r2, oopDesc::klass_offset_in_bytes()); __ load_klass(r3, r2); - Label no_such_interface, no_such_method; + Label no_such_method; // Preserve method for throw_AbstractMethodErrorVerbose. __ mov(r16, rmethod); @@ -3562,7 +3585,6 @@ // r3: instance size in bytes if (allow_shared_alloc) { __ eden_allocate(r0, r3, 0, r10, slow_case); - __ incr_allocated_bytes(rthread, r3, 0, rscratch1); } } diff -Nru openjdk-11-11~19/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp openjdk-11-11~24/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp --- openjdk-11-11~19/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/arm/c1_Runtime1_arm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -546,9 +546,10 @@ const Register result = R0; const Register klass = R1; - if (UseTLAB && Universe::heap()->supports_inline_contig_alloc() && id != new_instance_id) { - // We come here when TLAB allocation failed. - // In this case we try to allocate directly from eden. + // If TLAB is disabled, see if there is support for inlining contiguous + // allocations. + // Otherwise, just go to the slow path. + if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc() && id != new_instance_id) { Label slow_case, slow_case_no_pop; // Make sure the class is fully initialized @@ -616,9 +617,10 @@ const Register klass = R1; const Register length = R2; - if (UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { - // We come here when TLAB allocation failed. - // In this case we try to allocate directly from eden. + // If TLAB is disabled, see if there is support for inlining contiguous + // allocations. + // Otherwise, just go to the slow path. + if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { Label slow_case, slow_case_no_pop; #ifdef AARCH64 diff -Nru openjdk-11-11~19/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp openjdk-11-11~24/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp --- openjdk-11-11~19/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/arm/gc/g1/g1BarrierSetAssembler_arm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -53,7 +53,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count, int callee_saved_regs) { - bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0; + bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0; if (!dest_uninitialized) { assert( addr->encoding() < callee_saved_regs, "addr must be saved"); assert(count->encoding() < callee_saved_regs, "count must be saved"); @@ -321,9 +321,10 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Address obj, Register new_val, Register tmp1, Register tmp2, Register tmp3, bool is_null) { bool in_heap = (decorators & IN_HEAP) != 0; - bool in_concurrent_root = (decorators & IN_CONCURRENT_ROOT) != 0; + bool as_normal = (decorators & AS_NORMAL) != 0; + assert((decorators & IS_DEST_UNINITIALIZED) == 0, "unsupported"); - bool needs_pre_barrier = in_heap || in_concurrent_root; + bool needs_pre_barrier = as_normal; bool needs_post_barrier = (new_val != noreg) && in_heap; // flatten object address if needed @@ -360,7 +361,7 @@ g1_write_barrier_post(masm, store_addr, new_val, tmp1, tmp2, tmp3); } } -}; +} #ifdef COMPILER1 diff -Nru openjdk-11-11~19/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp openjdk-11-11~24/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp --- openjdk-11-11~19/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/arm/gc/shared/cardTableBarrierSetAssembler_arm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -75,9 +75,9 @@ void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Address obj, Register new_val, Register tmp1, Register tmp2, Register tmp3, bool is_null) { - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; if (is_null) { BarrierSetAssembler::store_at(masm, decorators, type, obj, new_val, tmp1, tmp2, tmp3, true); diff -Nru openjdk-11-11~19/src/hotspot/cpu/arm/macroAssembler_arm.cpp openjdk-11-11~24/src/hotspot/cpu/arm/macroAssembler_arm.cpp --- openjdk-11-11~19/src/hotspot/cpu/arm/macroAssembler_arm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/arm/macroAssembler_arm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2140,7 +2140,7 @@ b(done); bind(not_weak); // Resolve (untagged) jobject. - access_load_at(T_OBJECT, IN_CONCURRENT_ROOT, + access_load_at(T_OBJECT, IN_NATIVE, Address(value, 0), value, tmp1, tmp2, noreg); verify_oop(value); bind(done); diff -Nru openjdk-11-11~19/src/hotspot/cpu/arm/sharedRuntime_arm.cpp openjdk-11-11~24/src/hotspot/cpu/arm/sharedRuntime_arm.cpp --- openjdk-11-11~19/src/hotspot/cpu/arm/sharedRuntime_arm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/arm/sharedRuntime_arm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -513,6 +513,7 @@ case T_ARRAY: case T_OBJECT: case T_ADDRESS: + case T_METADATA: #ifndef __ABI_HARD__ case T_FLOAT: #endif // !__ABI_HARD__ diff -Nru openjdk-11-11~19/src/hotspot/cpu/arm/stubGenerator_arm.cpp openjdk-11-11~24/src/hotspot/cpu/arm/stubGenerator_arm.cpp --- openjdk-11-11~19/src/hotspot/cpu/arm/stubGenerator_arm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/arm/stubGenerator_arm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2945,7 +2945,7 @@ __ push(LR); #endif // AARCH64 - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; + DecoratorSet decorators = IN_HEAP | IS_ARRAY; if (disjoint) { decorators |= ARRAYCOPY_DISJOINT; } @@ -3217,7 +3217,7 @@ pushed+=1; #endif // AARCH64 - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_CHECKCAST; BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); bs->arraycopy_prologue(_masm, decorators, true, to, count, callee_saved_regs); diff -Nru openjdk-11-11~19/src/hotspot/cpu/arm/templateTable_arm.cpp openjdk-11-11~24/src/hotspot/cpu/arm/templateTable_arm.cpp --- openjdk-11-11~19/src/hotspot/cpu/arm/templateTable_arm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/arm/templateTable_arm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -943,7 +943,7 @@ const Register Rindex = R0_tos; index_check(Rarray, Rindex); - do_oop_load(_masm, R0_tos, get_array_elem_addr(T_OBJECT, Rarray, Rindex, Rtemp), IN_HEAP_ARRAY); + do_oop_load(_masm, R0_tos, get_array_elem_addr(T_OBJECT, Rarray, Rindex, Rtemp), IS_ARRAY); } @@ -1328,7 +1328,7 @@ __ add(Raddr_1, Raddr_1, AsmOperand(Rindex_4, lsl, LogBytesPerHeapOop)); // Now store using the appropriate barrier - do_oop_store(_masm, Raddr_1, Rvalue_2, Rtemp, R0_tmp, R3_tmp, false, IN_HEAP_ARRAY); + do_oop_store(_masm, Raddr_1, Rvalue_2, Rtemp, R0_tmp, R3_tmp, false, IS_ARRAY); __ b(done); __ bind(throw_array_store); @@ -1344,7 +1344,7 @@ __ profile_null_seen(R0_tmp); // Store a NULL - do_oop_store(_masm, Address::indexed_oop(Raddr_1, Rindex_4), Rvalue_2, Rtemp, R0_tmp, R3_tmp, true, IN_HEAP_ARRAY); + do_oop_store(_masm, Address::indexed_oop(Raddr_1, Rindex_4), Rvalue_2, Rtemp, R0_tmp, R3_tmp, true, IS_ARRAY); // Pop stack arguments __ bind(done); @@ -4276,25 +4276,41 @@ const Register Rinterf = R5_tmp; const Register Rindex = R4_tmp; const Register Rflags = R3_tmp; - const Register Rklass = R3_tmp; + const Register Rklass = R2_tmp; // Note! Same register with Rrecv prepare_invoke(byte_no, Rinterf, Rmethod, Rrecv, Rflags); - // Special case of invokeinterface called for virtual method of - // java.lang.Object. See cpCacheOop.cpp for details. - // This code isn't produced by javac, but could be produced by - // another compliant java compiler. - Label notMethod; - __ tbz(Rflags, ConstantPoolCacheEntry::is_forced_virtual_shift, notMethod); + // First check for Object case, then private interface method, + // then regular interface method. + // Special case of invokeinterface called for virtual method of + // java.lang.Object. See cpCache.cpp for details. + Label notObjectMethod; + __ tbz(Rflags, ConstantPoolCacheEntry::is_forced_virtual_shift, notObjectMethod); invokevirtual_helper(Rmethod, Rrecv, Rflags); - __ bind(notMethod); + __ bind(notObjectMethod); // Get receiver klass into Rklass - also a null check __ load_klass(Rklass, Rrecv); + // Check for private method invocation - indicated by vfinal Label no_such_interface; + Label notVFinal; + __ tbz(Rflags, ConstantPoolCacheEntry::is_vfinal_shift, notVFinal); + + Label subtype; + __ check_klass_subtype(Rklass, Rinterf, R1_tmp, R3_tmp, noreg, subtype); + // If we get here the typecheck failed + __ b(no_such_interface); + __ bind(subtype); + + // do the call + __ profile_final_call(R0_tmp); + __ jump_from_interpreted(Rmethod); + + __ bind(notVFinal); + // Receiver subtype check against REFC. __ lookup_interface_method(// inputs: rec. class, interface Rklass, Rinterf, noreg, diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/assembler_ppc.hpp openjdk-11-11~24/src/hotspot/cpu/ppc/assembler_ppc.hpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/assembler_ppc.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/assembler_ppc.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1635,6 +1635,7 @@ // TEXASR bit description enum transaction_failure_reason { // Upper half (TEXASRU): + tm_failure_code = 0, // The Failure Code is copied from tabort or treclaim operand. tm_failure_persistent = 7, // The failure is likely to recur on each execution. tm_disallowed = 8, // The instruction is not permitted. tm_nesting_of = 9, // The maximum transaction level was exceeded. @@ -1650,6 +1651,7 @@ tm_failure_summary = 36, // Failure has been detected and recorded. tm_tfiar_exact = 37, // Value in the TFIAR is exact. tm_rot = 38, // Rollback-only transaction. + tm_transaction_level = 52, // Transaction level (nesting depth + 1). }; // PPC 1, section 2.4.1 Branch Instructions diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/frame_ppc.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/frame_ppc.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/frame_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/frame_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -49,14 +49,134 @@ bool frame::safe_for_sender(JavaThread *thread) { bool safe = false; - address cursp = (address)sp(); - address curfp = (address)fp(); - if ((cursp != NULL && curfp != NULL && - (cursp <= thread->stack_base() && cursp >= thread->stack_base() - thread->stack_size())) && - (curfp <= thread->stack_base() && curfp >= thread->stack_base() - thread->stack_size())) { - safe = true; + address sp = (address)_sp; + address fp = (address)_fp; + address unextended_sp = (address)_unextended_sp; + + // Consider stack guards when trying to determine "safe" stack pointers + static size_t stack_guard_size = os::uses_stack_guard_pages() ? + JavaThread::stack_red_zone_size() + JavaThread::stack_yellow_reserved_zone_size() : 0; + size_t usable_stack_size = thread->stack_size() - stack_guard_size; + + // sp must be within the usable part of the stack (not in guards) + bool sp_safe = (sp < thread->stack_base()) && + (sp >= thread->stack_base() - usable_stack_size); + + + if (!sp_safe) { + return false; + } + + // Unextended sp must be within the stack and above or equal sp + bool unextended_sp_safe = (unextended_sp < thread->stack_base()) && (unextended_sp >= sp); + + if (!unextended_sp_safe) { + return false; + } + + // An fp must be within the stack and above (but not equal) sp. + bool fp_safe = (fp <= thread->stack_base()) && (fp > sp); + // an interpreter fp must be within the stack and above (but not equal) sp + bool fp_interp_safe = (fp <= thread->stack_base()) && (fp > sp) && + ((fp - sp) >= (ijava_state_size + top_ijava_frame_abi_size)); + + // We know sp/unextended_sp are safe, only fp is questionable here + + // If the current frame is known to the code cache then we can attempt to + // to construct the sender and do some validation of it. This goes a long way + // toward eliminating issues when we get in frame construction code + + if (_cb != NULL ){ + // Entry frame checks + if (is_entry_frame()) { + // An entry frame must have a valid fp. + return fp_safe && is_entry_frame_valid(thread); + } + + // Now check if the frame is complete and the test is + // reliable. Unfortunately we can only check frame completeness for + // runtime stubs and nmethods. Other generic buffer blobs are more + // problematic so we just assume they are OK. Adapter blobs never have a + // complete frame and are never OK + if (!_cb->is_frame_complete_at(_pc)) { + if (_cb->is_compiled() || _cb->is_adapter_blob() || _cb->is_runtime_stub()) { + return false; + } + } + + // Could just be some random pointer within the codeBlob. + if (!_cb->code_contains(_pc)) { + return false; + } + + if (is_interpreted_frame() && !fp_interp_safe) { + return false; + } + + abi_minframe* sender_abi = (abi_minframe*) fp; + intptr_t* sender_sp = (intptr_t*) fp; + address sender_pc = (address) sender_abi->lr;; + + // We must always be able to find a recognizable pc. + CodeBlob* sender_blob = CodeCache::find_blob_unsafe(sender_pc); + if (sender_blob == NULL) { + return false; + } + + // Could be a zombie method + if (sender_blob->is_zombie() || sender_blob->is_unloaded()) { + return false; + } + + // It should be safe to construct the sender though it might not be valid. + + frame sender(sender_sp, sender_pc); + + // Do we have a valid fp? + address sender_fp = (address) sender.fp(); + + // sender_fp must be within the stack and above (but not + // equal) current frame's fp. + if (sender_fp > thread->stack_base() || sender_fp <= fp) { + return false; + } + + // If the potential sender is the interpreter then we can do some more checking. + if (Interpreter::contains(sender_pc)) { + return sender.is_interpreted_frame_valid(thread); + } + + // Could just be some random pointer within the codeBlob. + if (!sender.cb()->code_contains(sender_pc)) { + return false; + } + + // We should never be able to see an adapter if the current frame is something from code cache. + if (sender_blob->is_adapter_blob()) { + return false; + } + + if (sender.is_entry_frame()) { + return sender.is_entry_frame_valid(thread); + } + + // Frame size is always greater than zero. If the sender frame size is zero or less, + // something is really weird and we better give up. + if (sender_blob->frame_size() <= 0) { + return false; + } + + return true; } - return safe; + + // Must be native-compiled frame. Since sender will try and use fp to find + // linkages it must be safe + + if (!fp_safe) { + return false; + } + + return true; } bool frame::is_interpreted_frame() const { diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/gc/g1/g1BarrierSetAssembler_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -44,7 +44,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators, Register from, Register to, Register count, Register preserve1, Register preserve2) { - bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0; + bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0; // With G1, don't generate the call if we statically know that the target in uninitialized if (!dest_uninitialized) { int spill_slots = 3; @@ -107,7 +107,7 @@ void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, DecoratorSet decorators, Register obj, RegisterOrConstant ind_or_offs, Register pre_val, Register tmp1, Register tmp2, bool needs_frame) { - bool not_null = (decorators & OOP_NOT_NULL) != 0, + bool not_null = (decorators & IS_NOT_NULL) != 0, preloaded = obj == noreg; Register nv_save = noreg; @@ -205,7 +205,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, DecoratorSet decorators, Register store_addr, Register new_val, Register tmp1, Register tmp2, Register tmp3) { - bool not_null = (decorators & OOP_NOT_NULL) != 0; + bool not_null = (decorators & IS_NOT_NULL) != 0; Label runtime, filtered; assert_different_registers(store_addr, new_val, tmp1, tmp2); @@ -279,9 +279,9 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register base, RegisterOrConstant ind_or_offs, Register val, Register tmp1, Register tmp2, Register tmp3, bool needs_frame) { - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; // Load and record the previous value. g1_write_barrier_pre(masm, decorators, base, ind_or_offs, tmp1, tmp2, tmp3, needs_frame); @@ -318,7 +318,7 @@ // these parameters the pre-barrier does not generate // the load of the previous value // We only reach here if value is not null. - g1_write_barrier_pre(masm, decorators | OOP_NOT_NULL, noreg /* obj */, (intptr_t)0, dst /* pre_val */, + g1_write_barrier_pre(masm, decorators | IS_NOT_NULL, noreg /* obj */, (intptr_t)0, dst /* pre_val */, tmp1, tmp2, needs_frame); } __ bind(done); diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/gc/shared/barrierSetAssembler_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -35,7 +35,7 @@ Register tmp1, Register tmp2, Register tmp3, bool needs_frame) { bool in_heap = (decorators & IN_HEAP) != 0; bool in_native = (decorators & IN_NATIVE) != 0; - bool not_null = (decorators & OOP_NOT_NULL) != 0; + bool not_null = (decorators & IS_NOT_NULL) != 0; assert(in_heap || in_native, "where?"); assert_different_registers(base, val, tmp1, tmp2, R0); @@ -68,7 +68,7 @@ Register tmp1, Register tmp2, bool needs_frame, Label *L_handle_null) { bool in_heap = (decorators & IN_HEAP) != 0; bool in_native = (decorators & IN_NATIVE) != 0; - bool not_null = (decorators & OOP_NOT_NULL) != 0; + bool not_null = (decorators & IS_NOT_NULL) != 0; assert(in_heap || in_native, "where?"); assert_different_registers(ind_or_offs.register_or_noreg(), dst, R0); diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/gc/shared/cardTableBarrierSetAssembler_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -93,9 +93,9 @@ void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register base, RegisterOrConstant ind_or_offs, Register val, Register tmp1, Register tmp2, Register tmp3, bool needs_frame) { - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; BarrierSetAssembler::store_at(masm, decorators, type, base, ind_or_offs, val, tmp1, tmp2, tmp3, needs_frame); diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/macroAssembler_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2046,7 +2046,7 @@ assert_different_registers(mtype_reg, mh_reg, temp_reg); // Compare method type against that of the receiver. load_heap_oop(temp_reg, delayed_value(java_lang_invoke_MethodHandle::type_offset_in_bytes, temp_reg), mh_reg, - noreg, noreg, false, OOP_NOT_NULL); + noreg, noreg, false, IS_NOT_NULL); cmpd(CCR0, temp_reg, mtype_reg); bne(CCR0, wrong_method_type); } @@ -2412,7 +2412,7 @@ // Update rtm_counters based on abort status // input: abort_status -// rtm_counters (RTMLockingCounters*) +// rtm_counters_Reg (RTMLockingCounters*) void MacroAssembler::rtm_counters_update(Register abort_status, Register rtm_counters_Reg) { // Mapping to keep PreciseRTMLockingStatistics similar to x86. // x86 ppc (! means inverted, ? means not the same) @@ -2422,52 +2422,96 @@ // 3 10 Set if an internal buffer overflowed. // 4 ?12 Set if a debug breakpoint was hit. // 5 ?32 Set if an abort occurred during execution of a nested transaction. - const int tm_failure_bit[] = {Assembler::tm_tabort, // Note: Seems like signal handler sets this, too. - Assembler::tm_failure_persistent, // inverted: transient - Assembler::tm_trans_cf, - Assembler::tm_footprint_of, - Assembler::tm_non_trans_cf, - Assembler::tm_suspended}; - const bool tm_failure_inv[] = {false, true, false, false, false, false}; - assert(sizeof(tm_failure_bit)/sizeof(int) == RTMLockingCounters::ABORT_STATUS_LIMIT, "adapt mapping!"); + const int failure_bit[] = {tm_tabort, // Signal handler will set this too. + tm_failure_persistent, + tm_non_trans_cf, + tm_trans_cf, + tm_footprint_of, + tm_failure_code, + tm_transaction_level}; + + const int num_failure_bits = sizeof(failure_bit) / sizeof(int); + const int num_counters = RTMLockingCounters::ABORT_STATUS_LIMIT; + + const int bit2counter_map[][num_counters] = + // 0 = no map; 1 = mapped, no inverted logic; -1 = mapped, inverted logic + // Inverted logic means that if a bit is set don't count it, or vice-versa. + // Care must be taken when mapping bits to counters as bits for a given + // counter must be mutually exclusive. Otherwise, the counter will be + // incremented more than once. + // counters: + // 0 1 2 3 4 5 + // abort , persist, conflict, overflow, debug , nested bits: + {{ 1 , 0 , 0 , 0 , 0 , 0 }, // abort + { 0 , -1 , 0 , 0 , 0 , 0 }, // failure_persistent + { 0 , 0 , 1 , 0 , 0 , 0 }, // non_trans_cf + { 0 , 0 , 1 , 0 , 0 , 0 }, // trans_cf + { 0 , 0 , 0 , 1 , 0 , 0 }, // footprint_of + { 0 , 0 , 0 , 0 , -1 , 0 }, // failure_code = 0xD4 + { 0 , 0 , 0 , 0 , 0 , 1 }}; // transaction_level > 1 + // ... + + // Move abort_status value to R0 and use abort_status register as a + // temporary register because R0 as third operand in ld/std is treated + // as base address zero (value). Likewise, R0 as second operand in addi + // is problematic because it amounts to li. + const Register temp_Reg = abort_status; + const Register abort_status_R0 = R0; + mr(abort_status_R0, abort_status); - const Register addr_Reg = R0; - // Keep track of offset to where rtm_counters_Reg had pointed to. + // Increment total abort counter. int counters_offs = RTMLockingCounters::abort_count_offset(); - addi(addr_Reg, rtm_counters_Reg, counters_offs); - const Register temp_Reg = rtm_counters_Reg; - - //atomic_inc_ptr(addr_Reg, temp_Reg); We don't increment atomically - ldx(temp_Reg, addr_Reg); + ld(temp_Reg, counters_offs, rtm_counters_Reg); addi(temp_Reg, temp_Reg, 1); - stdx(temp_Reg, addr_Reg); + std(temp_Reg, counters_offs, rtm_counters_Reg); + // Increment specific abort counters. if (PrintPreciseRTMLockingStatistics) { - int counters_offs_delta = RTMLockingCounters::abortX_count_offset() - counters_offs; - //mftexasr(abort_status); done by caller - for (int i = 0; i < RTMLockingCounters::ABORT_STATUS_LIMIT; i++) { - counters_offs += counters_offs_delta; - li(temp_Reg, counters_offs_delta); // can't use addi with R0 - add(addr_Reg, addr_Reg, temp_Reg); // point to next counter - counters_offs_delta = sizeof(uintx); - - Label check_abort; - rldicr_(temp_Reg, abort_status, tm_failure_bit[i], 0); - if (tm_failure_inv[i]) { - bne(CCR0, check_abort); - } else { - beq(CCR0, check_abort); + // #0 counter offset. + int abortX_offs = RTMLockingCounters::abortX_count_offset(); + + for (int nbit = 0; nbit < num_failure_bits; nbit++) { + for (int ncounter = 0; ncounter < num_counters; ncounter++) { + if (bit2counter_map[nbit][ncounter] != 0) { + Label check_abort; + int abort_counter_offs = abortX_offs + (ncounter << 3); + + if (failure_bit[nbit] == tm_transaction_level) { + // Don't check outer transaction, TL = 1 (bit 63). Hence only + // 11 bits in the TL field are checked to find out if failure + // occured in a nested transaction. This check also matches + // the case when nesting_of = 1 (nesting overflow). + rldicr_(temp_Reg, abort_status_R0, failure_bit[nbit], 10); + } else if (failure_bit[nbit] == tm_failure_code) { + // Check failure code for trap or illegal caught in TM. + // Bits 0:7 are tested as bit 7 (persistent) is copied from + // tabort or treclaim source operand. + // On Linux: trap or illegal is TM_CAUSE_SIGNAL (0xD4). + rldicl(temp_Reg, abort_status_R0, 8, 56); + cmpdi(CCR0, temp_Reg, 0xD4); + } else { + rldicr_(temp_Reg, abort_status_R0, failure_bit[nbit], 0); + } + + if (bit2counter_map[nbit][ncounter] == 1) { + beq(CCR0, check_abort); + } else { + bne(CCR0, check_abort); + } + + // We don't increment atomically. + ld(temp_Reg, abort_counter_offs, rtm_counters_Reg); + addi(temp_Reg, temp_Reg, 1); + std(temp_Reg, abort_counter_offs, rtm_counters_Reg); + + bind(check_abort); + } } - //atomic_inc_ptr(addr_Reg, temp_Reg); We don't increment atomically - ldx(temp_Reg, addr_Reg); - addi(temp_Reg, temp_Reg, 1); - stdx(temp_Reg, addr_Reg); - bind(check_abort); } } - li(temp_Reg, -counters_offs); // can't use addi with R0 - add(rtm_counters_Reg, addr_Reg, temp_Reg); // restore + // Restore abort_status. + mr(abort_status, abort_status_R0); } // Branch if (random & (count-1) != 0), count is 2^n @@ -2569,8 +2613,28 @@ void MacroAssembler::rtm_retry_lock_on_abort(Register retry_count_Reg, Register abort_status_Reg, Label& retryLabel, Label* checkRetry) { Label doneRetry; + + // Don't retry if failure is persistent. + // The persistent bit is set when a (A) Disallowed operation is performed in + // transactional state, like for instance trying to write the TFHAR after a + // transaction is started; or when there is (B) a Nesting Overflow (too many + // nested transactions); or when (C) the Footprint overflows (too many + // addressess touched in TM state so there is no more space in the footprint + // area to track them); or in case of (D) a Self-Induced Conflict, i.e. a + // store is performed to a given address in TM state, then once in suspended + // state the same address is accessed. Failure (A) is very unlikely to occur + // in the JVM. Failure (D) will never occur because Suspended state is never + // used in the JVM. Thus mostly (B) a Nesting Overflow or (C) a Footprint + // Overflow will set the persistent bit. rldicr_(R0, abort_status_Reg, tm_failure_persistent, 0); bne(CCR0, doneRetry); + + // Don't retry if transaction was deliberately aborted, i.e. caused by a + // tabort instruction. + rldicr_(R0, abort_status_Reg, tm_tabort, 0); + bne(CCR0, doneRetry); + + // Retry if transaction aborted due to a conflict with another thread. if (checkRetry) { bind(*checkRetry); } addic_(retry_count_Reg, retry_count_Reg, -1); blt(CCR0, doneRetry); diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp openjdk-11-11~24/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/macroAssembler_ppc.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2012, 2015 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -329,7 +329,7 @@ inline void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators, Register base, RegisterOrConstant ind_or_offs, Register val, Register tmp1, Register tmp2, Register tmp3, bool needs_frame) { - assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_NATIVE | OOP_NOT_NULL | + assert((decorators & ~(AS_RAW | IN_HEAP | IN_NATIVE | IS_ARRAY | IS_NOT_NULL | ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator"); BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); bool as_raw = (decorators & AS_RAW) != 0; @@ -348,7 +348,7 @@ inline void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, Register base, RegisterOrConstant ind_or_offs, Register dst, Register tmp1, Register tmp2, bool needs_frame, Label *L_handle_null) { - assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_NATIVE | OOP_NOT_NULL | + assert((decorators & ~(AS_RAW | IN_HEAP | IN_NATIVE | IS_ARRAY | IS_NOT_NULL | ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator"); BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); decorators = AccessInternal::decorator_fixup(decorators); diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/methodHandles_ppc.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/methodHandles_ppc.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/methodHandles_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/methodHandles_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -174,13 +174,13 @@ // Load the invoker, as MH -> MH.form -> LF.vmentry __ verify_oop(recv); __ load_heap_oop(method_temp, NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes()), recv, - temp2, noreg, false, OOP_NOT_NULL); + temp2, noreg, false, IS_NOT_NULL); __ verify_oop(method_temp); __ load_heap_oop(method_temp, NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes()), method_temp, - temp2, noreg, false, OOP_NOT_NULL); + temp2, noreg, false, IS_NOT_NULL); __ verify_oop(method_temp); __ load_heap_oop(method_temp, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), method_temp, - temp2, noreg, false, OOP_NOT_NULL); + temp2, noreg, false, IS_NOT_NULL); __ verify_oop(method_temp); __ ld(method_temp, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), method_temp); @@ -342,7 +342,7 @@ Label L_ok; Register temp2_defc = temp2; __ load_heap_oop(temp2_defc, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg, - temp3, noreg, false, OOP_NOT_NULL); + temp3, noreg, false, IS_NOT_NULL); load_klass_from_Class(_masm, temp2_defc, temp3, temp4); __ verify_klass_ptr(temp2_defc); __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, temp4, L_ok); @@ -370,7 +370,7 @@ verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp2); } __ load_heap_oop(R19_method, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg, - temp3, noreg, false, OOP_NOT_NULL); + temp3, noreg, false, IS_NOT_NULL); __ ld(R19_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), R19_method); break; @@ -379,7 +379,7 @@ verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp2); } __ load_heap_oop(R19_method, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes()), member_reg, - temp3, noreg, false, OOP_NOT_NULL); + temp3, noreg, false, IS_NOT_NULL); __ ld(R19_method, NONZERO(java_lang_invoke_ResolvedMethodName::vmtarget_offset_in_bytes()), R19_method); break; @@ -422,7 +422,7 @@ Register temp2_intf = temp2; __ load_heap_oop(temp2_intf, NONZERO(java_lang_invoke_MemberName::clazz_offset_in_bytes()), member_reg, - temp3, noreg, false, OOP_NOT_NULL); + temp3, noreg, false, IS_NOT_NULL); load_klass_from_Class(_masm, temp2_intf, temp3, temp4); __ verify_klass_ptr(temp2_intf); diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/sharedRuntime_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2029,6 +2029,13 @@ // -------------------------------------------------------------------------- vep_start_pc = (intptr_t)__ pc(); + if (UseRTMLocking) { + // Abort RTM transaction before calling JNI + // because critical section can be large and + // abort anyway. Also nmethod can be deoptimized. + __ tabort_(); + } + __ save_LR_CR(r_temp_1); __ generate_stack_overflow_check(frame_size_in_bytes); // Check before creating frame. __ mr(r_callers_sp, R1_SP); // Remember frame pointer. @@ -2947,6 +2954,11 @@ InterpreterMacroAssembler* masm = new InterpreterMacroAssembler(&buffer); address start = __ pc(); + if (UseRTMLocking) { + // Abort RTM transaction before possible nmethod deoptimization. + __ tabort_(); + } + Register unroll_block_reg = R21_tmp1; Register klass_index_reg = R22_tmp2; Register unc_trap_reg = R23_tmp3; @@ -3090,6 +3102,13 @@ return_pc_location = RegisterSaver::return_pc_is_thread_saved_exception_pc; } + if (UseRTMLocking) { + // Abort RTM transaction before calling runtime + // because critical section can be large and so + // will abort anyway. Also nmethod can be deoptimized. + __ tabort_(); + } + // Save registers, fpu state, and flags. Set R31 = return pc. map = RegisterSaver::push_frame_reg_args_and_save_live_registers(masm, &frame_size_in_bytes, diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/stubGenerator_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -725,18 +725,6 @@ return start; } - // Fairer handling of safepoints for native methods. - // - // Generate code which reads from the polling page. This special handling is needed as the - // linux-ppc64 kernel before 2.6.6 doesn't set si_addr on some segfaults in 64bit mode - // (cf. http://www.kernel.org/pub/linux/kernel/v2.6/ChangeLog-2.6.6), especially when we try - // to read from the safepoint polling page. - address generate_load_from_poll() { - StubCodeMark mark(this, "StubRoutines", "generate_load_from_poll"); - address start = __ function_entry(); - __ unimplemented("StubRoutines::verify_oop", 95); // TODO PPC port - return start; - } // -XX:+OptimizeFill : convert fill/copy loops into intrinsic // @@ -2024,9 +2012,9 @@ STUB_ENTRY(arrayof_oop_disjoint_arraycopy) : STUB_ENTRY(oop_disjoint_arraycopy); - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; + DecoratorSet decorators = IN_HEAP | IS_ARRAY; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -2063,9 +2051,9 @@ address start = __ function_entry(); assert_positive_int(R5_ARG3); - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -2159,9 +2147,9 @@ } #endif - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_CHECKCAST; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/templateTable_ppc_64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -688,7 +688,7 @@ Rtemp2 = R31; __ index_check(Rarray, R17_tos /* index */, UseCompressedOops ? 2 : LogBytesPerWord, Rtemp, Rload_addr); do_oop_load(_masm, Rload_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), R17_tos, Rtemp, Rtemp2, - IN_HEAP_ARRAY); + IS_ARRAY); __ verify_oop(R17_tos); //__ dcbt(R17_tos); // prefetch } @@ -1015,14 +1015,14 @@ __ bind(Lis_null); do_oop_store(_masm, Rstore_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), noreg /* 0 */, - Rscratch, Rscratch2, Rscratch3, IN_HEAP_ARRAY); + Rscratch, Rscratch2, Rscratch3, IS_ARRAY); __ profile_null_seen(Rscratch, Rscratch2); __ b(Ldone); // Store is OK. __ bind(Lstore_ok); do_oop_store(_masm, Rstore_addr, arrayOopDesc::base_offset_in_bytes(T_OBJECT), R17_tos /* value */, - Rscratch, Rscratch2, Rscratch3, IN_HEAP_ARRAY | OOP_NOT_NULL); + Rscratch, Rscratch2, Rscratch3, IS_ARRAY | IS_NOT_NULL); __ bind(Ldone); // Adjust sp (pops array, index and value). @@ -3320,9 +3320,9 @@ // - byte_no // // Output: -// - Rmethod: The method to invoke next. +// - Rmethod: The method to invoke next or i-klass (invokeinterface). // - Rret_addr: The return address to return to. -// - Rindex: MethodType (invokehandle) or CallSite obj (invokedynamic) +// - Rindex: MethodType (invokehandle), CallSite obj (invokedynamic) or Method (invokeinterface) // - Rrecv: Cache for "this" pointer, might be noreg if static call. // - Rflags: Method flags from const pool cache. // @@ -3332,7 +3332,7 @@ void TemplateTable::prepare_invoke(int byte_no, Register Rmethod, // linked method (or i-klass) Register Rret_addr,// return address - Register Rindex, // itable index, MethodType, etc. + Register Rindex, // itable index, MethodType, Method, etc. Register Rrecv, // If caller wants to see it. Register Rflags, // If caller wants to test it. Register Rscratch @@ -3583,14 +3583,46 @@ prepare_invoke(byte_no, Rinterface_klass, Rret_addr, Rmethod, Rreceiver, Rflags, Rscratch1); - // Get receiver klass. + // First check for Object case, then private interface method, + // then regular interface method. + + // Get receiver klass - this is also a null check __ null_check_throw(Rreceiver, oopDesc::klass_offset_in_bytes(), Rscratch2); __ load_klass(Rrecv_klass, Rreceiver); // Check corner case object method. - Label LobjectMethod, L_no_such_interface, Lthrow_ame; + // Special case of invokeinterface called for virtual method of + // java.lang.Object. See ConstantPoolCacheEntry::set_method() for details: + // The invokeinterface was rewritten to a invokevirtual, hence we have + // to handle this corner case. + + Label LnotObjectMethod, Lthrow_ame; __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_forced_virtual_shift); - __ btrue(CCR0, LobjectMethod); + __ bfalse(CCR0, LnotObjectMethod); + invokeinterface_object_method(Rrecv_klass, Rret_addr, Rflags, Rmethod, Rscratch1, Rscratch2); + __ bind(LnotObjectMethod); + + // Check for private method invocation - indicated by vfinal + Label LnotVFinal, L_no_such_interface, L_subtype; + + __ testbitdi(CCR0, R0, Rflags, ConstantPoolCacheEntry::is_vfinal_shift); + __ bfalse(CCR0, LnotVFinal); + + __ check_klass_subtype(Rrecv_klass, Rinterface_klass, Rscratch1, Rscratch2, L_subtype); + // If we get here the typecheck failed + __ b(L_no_such_interface); + __ bind(L_subtype); + + // do the call + + Register Rscratch = Rflags; // Rflags is dead now. + + __ profile_final_call(Rscratch1, Rscratch); + __ profile_arguments_type(Rmethod, Rscratch, Rrecv_klass /* scratch */, true); + + __ call_from_interpreter(Rmethod, Rret_addr, Rscratch, Rrecv_klass /* scratch */); + + __ bind(LnotVFinal); __ lookup_interface_method(Rrecv_klass, Rinterface_klass, noreg, noreg, Rscratch1, Rscratch2, L_no_such_interface, /*return_method=*/false); @@ -3631,14 +3663,6 @@ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_IncompatibleClassChangeErrorVerbose), Rrecv_klass, Rinterface_klass); DEBUG_ONLY( __ should_not_reach_here(); ) - - // Special case of invokeinterface called for virtual method of - // java.lang.Object. See ConstantPoolCacheEntry::set_method() for details: - // The invokeinterface was rewritten to a invokevirtual, hence we have - // to handle this corner case. This code isn't produced by javac, but could - // be produced by another compliant java compiler. - __ bind(LobjectMethod); - invokeinterface_object_method(Rrecv_klass, Rret_addr, Rflags, Rmethod, Rscratch1, Rscratch2); } void TemplateTable::invokedynamic(int byte_no) { diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/vm_version_ext_ppc.cpp openjdk-11-11~24/src/hotspot/cpu/ppc/vm_version_ext_ppc.cpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/vm_version_ext_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/vm_version_ext_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,19 +25,30 @@ #include "jvm.h" #include "memory/allocation.hpp" #include "memory/allocation.inline.hpp" +#include "runtime/vm_version.hpp" #include "vm_version_ext_ppc.hpp" // VM_Version_Ext statics int VM_Version_Ext::_no_of_threads = 0; int VM_Version_Ext::_no_of_cores = 0; int VM_Version_Ext::_no_of_sockets = 0; +bool VM_Version_Ext::_initialized = false; char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0}; char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0}; // get cpu information. -bool VM_Version_Ext::initialize_cpu_information(void) { - // Not yet implemented. - return false; +void VM_Version_Ext::initialize_cpu_information(void) { + // do nothing if cpu info has been initialized + if (_initialized) { + return; + } + + _no_of_cores = os::processor_count(); + _no_of_threads = _no_of_cores; + _no_of_sockets = _no_of_cores; + snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE, "PowerPC POWER%lu", PowerArchitecturePPC64); + snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "PPC %s", features_string()); + _initialized = true; } int VM_Version_Ext::number_of_threads(void) { @@ -56,9 +67,7 @@ } const char* VM_Version_Ext::cpu_name(void) { - if (!initialize_cpu_information()) { - return NULL; - } + initialize_cpu_information(); char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing); if (NULL == tmp) { return NULL; @@ -68,9 +77,7 @@ } const char* VM_Version_Ext::cpu_description(void) { - if (!initialize_cpu_information()) { - return NULL; - } + initialize_cpu_information(); char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing); if (NULL == tmp) { return NULL; diff -Nru openjdk-11-11~19/src/hotspot/cpu/ppc/vm_version_ext_ppc.hpp openjdk-11-11~24/src/hotspot/cpu/ppc/vm_version_ext_ppc.hpp --- openjdk-11-11~19/src/hotspot/cpu/ppc/vm_version_ext_ppc.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/ppc/vm_version_ext_ppc.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -43,10 +43,11 @@ static int _no_of_threads; static int _no_of_cores; static int _no_of_sockets; + static bool _initialized; static char _cpu_name[CPU_TYPE_DESC_BUF_SIZE]; static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE]; - static bool initialize_cpu_information(void); + static void initialize_cpu_information(void); public: diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp openjdk-11-11~24/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp --- openjdk-11-11~19/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/gc/g1/g1BarrierSetAssembler_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -46,7 +46,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count) { - bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0; + bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0; // With G1, don't generate the call if we statically know that the target is uninitialized. if (!dest_uninitialized) { @@ -108,7 +108,7 @@ if (on_oop && on_reference) { // Generate the G1 pre-barrier code to log the value of // the referent field in an SATB buffer. - g1_write_barrier_pre(masm, decorators | OOP_NOT_NULL, + g1_write_barrier_pre(masm, decorators | IS_NOT_NULL, NULL /* obj */, dst /* pre_val */, noreg/* preserve */ , @@ -127,7 +127,7 @@ bool pre_val_needed // Save Rpre_val across runtime call, caller uses it. ) { - bool not_null = (decorators & OOP_NOT_NULL) != 0, + bool not_null = (decorators & IS_NOT_NULL) != 0, preloaded = obj == NULL; const Register Robj = obj ? obj->base() : noreg, @@ -260,7 +260,7 @@ void G1BarrierSetAssembler::g1_write_barrier_post(MacroAssembler* masm, DecoratorSet decorators, Register Rstore_addr, Register Rnew_val, Register Rtmp1, Register Rtmp2, Register Rtmp3) { - bool not_null = (decorators & OOP_NOT_NULL) != 0; + bool not_null = (decorators & IS_NOT_NULL) != 0; assert_different_registers(Rstore_addr, Rnew_val, Rtmp1, Rtmp2); // Most probably, Rnew_val == Rtmp3. @@ -372,9 +372,9 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, const Address& dst, Register val, Register tmp1, Register tmp2, Register tmp3) { - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; // Load and record the previous value. g1_write_barrier_pre(masm, decorators, &dst, tmp3, val, tmp1, tmp2, false); diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp openjdk-11-11~24/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp --- openjdk-11-11~19/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/gc/shared/barrierSetAssembler_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -39,7 +39,7 @@ const Address& addr, Register dst, Register tmp1, Register tmp2, Label *L_handle_null) { bool in_heap = (decorators & IN_HEAP) != 0; bool in_native = (decorators & IN_NATIVE) != 0; - bool not_null = (decorators & OOP_NOT_NULL) != 0; + bool not_null = (decorators & IS_NOT_NULL) != 0; assert(in_heap || in_native, "where?"); switch (type) { @@ -69,7 +69,7 @@ const Address& addr, Register val, Register tmp1, Register tmp2, Register tmp3) { bool in_heap = (decorators & IN_HEAP) != 0; bool in_native = (decorators & IN_NATIVE) != 0; - bool not_null = (decorators & OOP_NOT_NULL) != 0; + bool not_null = (decorators & IS_NOT_NULL) != 0; assert(in_heap || in_native, "where?"); assert_different_registers(val, tmp1, tmp2); diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp openjdk-11-11~24/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp --- openjdk-11-11~19/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/gc/shared/cardTableBarrierSetAssembler_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -156,9 +156,9 @@ void CardTableBarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, const Address& dst, Register val, Register tmp1, Register tmp2, Register tmp3) { - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; BarrierSetAssembler::store_at(masm, decorators, type, dst, val, tmp1, tmp2, tmp3); diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/macroAssembler_s390.cpp openjdk-11-11~24/src/hotspot/cpu/s390/macroAssembler_s390.cpp --- openjdk-11-11~19/src/hotspot/cpu/s390/macroAssembler_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/macroAssembler_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -4051,7 +4051,7 @@ void MacroAssembler::access_store_at(BasicType type, DecoratorSet decorators, const Address& addr, Register val, Register tmp1, Register tmp2, Register tmp3) { - assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_NATIVE | OOP_NOT_NULL | + assert((decorators & ~(AS_RAW | IN_HEAP | IN_NATIVE | IS_ARRAY | IS_NOT_NULL | ON_UNKNOWN_OOP_REF)) == 0, "unsupported decorator"); BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); decorators = AccessInternal::decorator_fixup(decorators); @@ -4070,7 +4070,7 @@ void MacroAssembler::access_load_at(BasicType type, DecoratorSet decorators, const Address& addr, Register dst, Register tmp1, Register tmp2, Label *is_null) { - assert((decorators & ~(AS_RAW | IN_HEAP | IN_HEAP_ARRAY | IN_NATIVE | OOP_NOT_NULL | + assert((decorators & ~(AS_RAW | IN_HEAP | IN_NATIVE | IS_ARRAY | IS_NOT_NULL | ON_PHANTOM_OOP_REF | ON_WEAK_OOP_REF)) == 0, "unsupported decorator"); BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); decorators = AccessInternal::decorator_fixup(decorators); diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/methodHandles_s390.cpp openjdk-11-11~24/src/hotspot/cpu/s390/methodHandles_s390.cpp --- openjdk-11-11~19/src/hotspot/cpu/s390/methodHandles_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/methodHandles_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -198,17 +198,17 @@ __ load_heap_oop(method_temp, Address(recv, NONZERO(java_lang_invoke_MethodHandle::form_offset_in_bytes())), - noreg, noreg, OOP_NOT_NULL); + noreg, noreg, IS_NOT_NULL); __ verify_oop(method_temp); __ load_heap_oop(method_temp, Address(method_temp, NONZERO(java_lang_invoke_LambdaForm::vmentry_offset_in_bytes())), - noreg, noreg, OOP_NOT_NULL); + noreg, noreg, IS_NOT_NULL); __ verify_oop(method_temp); __ load_heap_oop(method_temp, Address(method_temp, NONZERO(java_lang_invoke_MemberName::method_offset_in_bytes())), - noreg, noreg, OOP_NOT_NULL); + noreg, noreg, IS_NOT_NULL); __ verify_oop(method_temp); __ z_lg(method_temp, Address(method_temp, @@ -409,7 +409,7 @@ Register temp2_defc = temp2; __ load_heap_oop(temp2_defc, member_clazz, - noreg, noreg, OOP_NOT_NULL); + noreg, noreg, IS_NOT_NULL); load_klass_from_Class(_masm, temp2_defc, temp3, temp4); __ verify_klass_ptr(temp2_defc); __ check_klass_subtype(temp1_recv_klass, temp2_defc, temp3, temp4, L_ok); @@ -436,7 +436,7 @@ verify_ref_kind(_masm, JVM_REF_invokeSpecial, member_reg, temp3); } __ load_heap_oop(Z_method, member_vmtarget, - noreg, noreg, OOP_NOT_NULL); + noreg, noreg, IS_NOT_NULL); __ z_lg(Z_method, vmtarget_method); method_is_live = true; break; @@ -446,7 +446,7 @@ verify_ref_kind(_masm, JVM_REF_invokeStatic, member_reg, temp3); } __ load_heap_oop(Z_method, member_vmtarget, - noreg, noreg, OOP_NOT_NULL); + noreg, noreg, IS_NOT_NULL); __ z_lg(Z_method, vmtarget_method); method_is_live = true; break; @@ -488,7 +488,7 @@ Register temp3_intf = temp3; __ load_heap_oop(temp3_intf, member_clazz, - noreg, noreg, OOP_NOT_NULL); + noreg, noreg, IS_NOT_NULL); load_klass_from_Class(_masm, temp3_intf, temp2, temp4); Register Z_index = Z_method; diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/s390.ad openjdk-11-11~24/src/hotspot/cpu/s390/s390.ad --- openjdk-11-11~19/src/hotspot/cpu/s390/s390.ad 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/s390.ad 2018-07-25 15:36:46.000000000 +0000 @@ -9839,7 +9839,7 @@ match(Set index (PartialSubtypeCheck sub super)); effect(KILL pcc, KILL scratch1, KILL scratch2); ins_cost(10 * DEFAULT_COST); - size(12); + // TODO: s390 port size(FIXED_SIZE); format %{ " CALL PartialSubtypeCheck\n" %} ins_encode %{ AddressLiteral stub_address(StubRoutines::zarch::partial_subtype_check()); diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/stubGenerator_s390.cpp openjdk-11-11~24/src/hotspot/cpu/s390/stubGenerator_s390.cpp --- openjdk-11-11~19/src/hotspot/cpu/s390/stubGenerator_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/stubGenerator_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1300,9 +1300,9 @@ unsigned int start_off = __ offset(); // Remember stub start address (is rtn value). unsigned int size = UseCompressedOops ? 4 : 8; - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -1392,9 +1392,9 @@ // Branch to disjoint_copy (if applicable) before pre_barrier to avoid double pre_barrier. array_overlap_test(nooverlap_target, shift); // Branch away to nooverlap_target if disjoint. - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; + DecoratorSet decorators = IN_HEAP | IS_ARRAY; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/templateTable_s390.cpp openjdk-11-11~24/src/hotspot/cpu/s390/templateTable_s390.cpp --- openjdk-11-11~19/src/hotspot/cpu/s390/templateTable_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/templateTable_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -853,7 +853,7 @@ index_check(Z_tmp_1, index, shift); // Now load array element. do_oop_load(_masm, Address(Z_tmp_1, index, arrayOopDesc::base_offset_in_bytes(T_OBJECT)), Z_tos, - Z_tmp_2, Z_tmp_3, IN_HEAP_ARRAY); + Z_tmp_2, Z_tmp_3, IS_ARRAY); __ verify_oop(Z_tos); } @@ -1197,7 +1197,7 @@ // Store a NULL. do_oop_store(_masm, Address(Rstore_addr, (intptr_t)0), noreg, - tmp3, tmp2, tmp1, IN_HEAP_ARRAY); + tmp3, tmp2, tmp1, IS_ARRAY); __ z_bru(done); // Come here on success. @@ -1205,7 +1205,7 @@ // Now store using the appropriate barrier. do_oop_store(_masm, Address(Rstore_addr, (intptr_t)0), Rvalue, - tmp3, tmp2, tmp1, IN_HEAP_ARRAY | OOP_NOT_NULL); + tmp3, tmp2, tmp1, IS_ARRAY | IS_NOT_NULL); // Pop stack arguments. __ bind(done); @@ -3610,23 +3610,45 @@ BLOCK_COMMENT("invokeinterface {"); - prepare_invoke(byte_no, interface, method, // Get f1 klassOop, f2 itable index. + prepare_invoke(byte_no, interface, method, // Get f1 klassOop, f2 Method*. receiver, flags); // Z_R14 (== Z_bytecode) : return entry + // First check for Object case, then private interface method, + // then regular interface method. + // Special case of invokeinterface called for virtual method of - // java.lang.Object. See cpCacheOop.cpp for details. - // This code isn't produced by javac, but could be produced by - // another compliant java compiler. - NearLabel notMethod, no_such_interface, no_such_method; + // java.lang.Object. See cpCache.cpp for details. + NearLabel notObjectMethod, no_such_method; __ testbit(flags, ConstantPoolCacheEntry::is_forced_virtual_shift); - __ z_brz(notMethod); + __ z_brz(notObjectMethod); invokevirtual_helper(method, receiver, flags); - __ bind(notMethod); + __ bind(notObjectMethod); + + // Check for private method invocation - indicated by vfinal + NearLabel notVFinal; + __ testbit(flags, ConstantPoolCacheEntry::is_vfinal_shift); + __ z_brz(notVFinal); + + // Get receiver klass into klass - also a null check. + __ load_klass(klass, receiver); + + NearLabel subtype, no_such_interface; + + __ check_klass_subtype(klass, interface, Z_tmp_2, flags/*scratch*/, subtype); + // If we get here the typecheck failed + __ z_bru(no_such_interface); + __ bind(subtype); + + // do the call + __ profile_final_call(Z_tmp_2); + __ profile_arguments_type(Z_tmp_2, method, Z_ARG5, true); + __ jump_from_interpreted(method, Z_tmp_2); + + __ bind(notVFinal); // Get receiver klass into klass - also a null check. - __ restore_locals(); __ load_klass(klass, receiver); __ lookup_interface_method(klass, interface, noreg, noreg, /*temp*/Z_ARG1, @@ -3657,7 +3679,7 @@ // interpreter entry point and a conditional jump to it in case of a null // method. __ compareU64_and_branch(method2, (intptr_t) 0, - Assembler::bcondZero, no_such_method); + Assembler::bcondZero, no_such_method); __ profile_arguments_type(Z_tmp_1, method2, Z_tmp_2, true); @@ -3672,8 +3694,6 @@ __ bind(no_such_method); // Throw exception. - __ restore_bcp(); // Bcp must be correct for exception handler (was destroyed). - __ restore_locals(); // Make sure locals pointer is correct as well (was destroyed). // Pass arguments for generating a verbose error message. __ z_lgr(Z_tmp_1, method); // Prevent register clash. __ call_VM(noreg, @@ -3686,8 +3706,6 @@ __ bind(no_such_interface); // Throw exception. - __ restore_bcp(); // Bcp must be correct for exception handler (was destroyed). - __ restore_locals(); // Make sure locals pointer is correct as well (was destroyed). // Pass arguments for generating a verbose error message. __ call_VM(noreg, CAST_FROM_FN_PTR(address, diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/vm_version_ext_s390.cpp openjdk-11-11~24/src/hotspot/cpu/s390/vm_version_ext_s390.cpp --- openjdk-11-11~19/src/hotspot/cpu/s390/vm_version_ext_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/vm_version_ext_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,13 +31,23 @@ int VM_Version_Ext::_no_of_threads = 0; int VM_Version_Ext::_no_of_cores = 0; int VM_Version_Ext::_no_of_sockets = 0; +bool VM_Version_Ext::_initialized = false; char VM_Version_Ext::_cpu_name[CPU_TYPE_DESC_BUF_SIZE] = {0}; char VM_Version_Ext::_cpu_desc[CPU_DETAILED_DESC_BUF_SIZE] = {0}; // get cpu information. -bool VM_Version_Ext::initialize_cpu_information(void) { - // Not yet implemented. - return false; +void VM_Version_Ext::initialize_cpu_information(void) { + // do nothing if cpu info has been initialized + if (_initialized) { + return; + } + + _no_of_cores = os::processor_count(); + _no_of_threads = _no_of_cores; + _no_of_sockets = _no_of_cores; + snprintf(_cpu_name, CPU_TYPE_DESC_BUF_SIZE, "s390 %s", VM_Version::get_model_string()); + snprintf(_cpu_desc, CPU_DETAILED_DESC_BUF_SIZE, "zArch %s", features_string()); + _initialized = true; } int VM_Version_Ext::number_of_threads(void) { @@ -56,9 +66,7 @@ } const char* VM_Version_Ext::cpu_name(void) { - if (!initialize_cpu_information()) { - return NULL; - } + initialize_cpu_information(); char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_TYPE_DESC_BUF_SIZE, mtTracing); if (NULL == tmp) { return NULL; @@ -68,9 +76,7 @@ } const char* VM_Version_Ext::cpu_description(void) { - if (!initialize_cpu_information()) { - return NULL; - } + initialize_cpu_information(); char* tmp = NEW_C_HEAP_ARRAY_RETURN_NULL(char, CPU_DETAILED_DESC_BUF_SIZE, mtTracing); if (NULL == tmp) { return NULL; diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/vm_version_ext_s390.hpp openjdk-11-11~24/src/hotspot/cpu/s390/vm_version_ext_s390.hpp --- openjdk-11-11~19/src/hotspot/cpu/s390/vm_version_ext_s390.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/vm_version_ext_s390.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -43,10 +43,11 @@ static int _no_of_threads; static int _no_of_cores; static int _no_of_sockets; + static bool _initialized; static char _cpu_name[CPU_TYPE_DESC_BUF_SIZE]; static char _cpu_desc[CPU_DETAILED_DESC_BUF_SIZE]; - static bool initialize_cpu_information(void); + static void initialize_cpu_information(void); public: diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/vm_version_s390.cpp openjdk-11-11~24/src/hotspot/cpu/s390/vm_version_s390.cpp --- openjdk-11-11~19/src/hotspot/cpu/s390/vm_version_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/vm_version_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2016, 2017 SAP SE. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018 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 @@ -36,6 +36,7 @@ # include bool VM_Version::_is_determine_features_test_running = false; +const char* VM_Version::_model_string; unsigned long VM_Version::_features[_features_buffer_len] = {0, 0, 0, 0}; unsigned long VM_Version::_cipher_features[_features_buffer_len] = {0, 0, 0, 0}; @@ -210,6 +211,10 @@ FLAG_SET_DEFAULT(UseSHA512Intrinsics, false); } + if (!(UseSHA1Intrinsics || UseSHA256Intrinsics || UseSHA512Intrinsics)) { + FLAG_SET_DEFAULT(UseSHA, false); + } + if (FLAG_IS_DEFAULT(UseMultiplyToLenIntrinsic)) { FLAG_SET_DEFAULT(UseMultiplyToLenIntrinsic, true); } @@ -244,32 +249,40 @@ void VM_Version::set_features_string() { unsigned int ambiguity = 0; + _model_string = z_name[0]; if (is_z13()) { _features_string = "System z G7-z13 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB, Cond Load/Store, Interlocked Update, TxM, VectorInstr)"; + _model_string = z_name[7]; ambiguity++; } if (is_ec12()) { _features_string = "System z G6-EC12 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB, Cond Load/Store, Interlocked Update, TxM)"; + _model_string = z_name[6]; ambiguity++; } if (is_z196()) { _features_string = "System z G5-z196 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB, Cond Load/Store, Interlocked Update)"; + _model_string = z_name[5]; ambiguity++; } if (is_z10()) { _features_string = "System z G4-z10 (LDISP_fast, ExtImm, PCrel Load/Store, CmpB)"; + _model_string = z_name[4]; ambiguity++; } if (is_z9()) { _features_string = "System z G3-z9 (LDISP_fast, ExtImm), out-of-support as of 2016-04-01"; + _model_string = z_name[3]; ambiguity++; } if (is_z990()) { _features_string = "System z G2-z990 (LDISP_fast), out-of-support as of 2014-07-01"; + _model_string = z_name[2]; ambiguity++; } if (is_z900()) { _features_string = "System z G1-z900 (LDISP), out-of-support as of 2014-07-01"; + _model_string = z_name[1]; ambiguity++; } diff -Nru openjdk-11-11~19/src/hotspot/cpu/s390/vm_version_s390.hpp openjdk-11-11~24/src/hotspot/cpu/s390/vm_version_s390.hpp --- openjdk-11-11~19/src/hotspot/cpu/s390/vm_version_s390.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/s390/vm_version_s390.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,6 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * Copyright (c) 2016 SAP SE. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018 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 @@ -131,6 +131,7 @@ static unsigned int _Dcache_lineSize; static unsigned int _Icache_lineSize; static bool _is_determine_features_test_running; + static const char* _model_string; static bool test_feature_bit(unsigned long* featureBuffer, int featureNum, unsigned int bufLen); static void set_features_string(); @@ -346,6 +347,7 @@ static bool is_determine_features_test_running() { return _is_determine_features_test_running; } // CPU feature query functions + static const char* get_model_string() { return _model_string; } static bool has_StoreFacilityListExtended() { return (_features[0] & StoreFacilityListExtendedMask) == StoreFacilityListExtendedMask; } static bool has_Crypto() { return (_features[0] & CryptoFacilityMask) == CryptoFacilityMask; } static bool has_ETF2() { return (_features[0] & ETF2Mask) == ETF2Mask; } diff -Nru openjdk-11-11~19/src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp openjdk-11-11~24/src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp --- openjdk-11-11~19/src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/sparc/c1_Runtime1_sparc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -407,8 +407,11 @@ __ set_info("fast new_instance init check", dont_gc_arguments); } + // If TLAB is disabled, see if there is support for inlining contiguous + // allocations. + // Otherwise, just go to the slow path. if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) && - UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { + !UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { Label slow_path; Register G1_obj_size = G1; Register G3_t1 = G3; diff -Nru openjdk-11-11~19/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp openjdk-11-11~24/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp --- openjdk-11-11~19/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/sparc/gc/g1/g1BarrierSetAssembler_sparc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -43,7 +43,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count) { - bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0; + bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0; // With G1, don't generate the call if we statically know that the target in uninitialized if (!dest_uninitialized) { Register tmp = O5; @@ -400,15 +400,16 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register val, Address dst, Register tmp) { bool in_heap = (decorators & IN_HEAP) != 0; - bool in_concurrent_root = (decorators & IN_CONCURRENT_ROOT) != 0; + bool as_normal = (decorators & AS_NORMAL) != 0; + assert((decorators & IS_DEST_UNINITIALIZED) == 0, "unsupported"); - bool needs_pre_barrier = in_heap || in_concurrent_root; + bool needs_pre_barrier = as_normal; // No need for post barrier if storing NULL bool needs_post_barrier = val != G0 && in_heap; - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; Register index = dst.has_index() ? dst.index() : noreg; int disp = dst.has_disp() ? dst.disp() : 0; diff -Nru openjdk-11-11~19/src/hotspot/cpu/sparc/gc/shared/barrierSetAssembler_sparc.cpp openjdk-11-11~24/src/hotspot/cpu/sparc/gc/shared/barrierSetAssembler_sparc.cpp --- openjdk-11-11~19/src/hotspot/cpu/sparc/gc/shared/barrierSetAssembler_sparc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/sparc/gc/shared/barrierSetAssembler_sparc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,7 @@ Register val, Address dst, Register tmp) { bool in_heap = (decorators & IN_HEAP) != 0; bool in_native = (decorators & IN_NATIVE) != 0; - bool oop_not_null = (decorators & OOP_NOT_NULL) != 0; + bool is_not_null = (decorators & IS_NOT_NULL) != 0; switch (type) { case T_ARRAY: @@ -47,7 +47,7 @@ } if (UseCompressedOops) { assert(dst.base() != val, "not enough registers"); - if (oop_not_null) { + if (is_not_null) { __ encode_heap_oop_not_null(val); } else { __ encode_heap_oop(val); @@ -70,7 +70,7 @@ Address src, Register dst, Register tmp) { bool in_heap = (decorators & IN_HEAP) != 0; bool in_native = (decorators & IN_NATIVE) != 0; - bool oop_not_null = (decorators & OOP_NOT_NULL) != 0; + bool is_not_null = (decorators & IS_NOT_NULL) != 0; switch (type) { case T_ARRAY: @@ -83,7 +83,7 @@ } if (UseCompressedOops) { __ lduw(src, dst); - if (oop_not_null) { + if (is_not_null) { __ decode_heap_oop_not_null(dst); } else { __ decode_heap_oop(dst); diff -Nru openjdk-11-11~19/src/hotspot/cpu/sparc/gc/shared/cardTableBarrierSetAssembler_sparc.cpp openjdk-11-11~24/src/hotspot/cpu/sparc/gc/shared/cardTableBarrierSetAssembler_sparc.cpp --- openjdk-11-11~19/src/hotspot/cpu/sparc/gc/shared/cardTableBarrierSetAssembler_sparc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/sparc/gc/shared/cardTableBarrierSetAssembler_sparc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,4 +1,3 @@ - /* * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. @@ -90,9 +89,9 @@ Register val, Address dst, Register tmp) { bool in_heap = (decorators & IN_HEAP) != 0; - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; // No need for post barrier if storing NULL bool needs_post_barrier = val != G0 && in_heap; diff -Nru openjdk-11-11~19/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp openjdk-11-11~24/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp --- openjdk-11-11~19/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/sparc/macroAssembler_sparc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -182,8 +182,7 @@ br (Assembler::always, true, Assembler::pt, done); delayed()->nop(); bind(not_weak); - access_load_at(T_OBJECT, IN_CONCURRENT_ROOT, - Address(value, 0), value, tmp); + access_load_at(T_OBJECT, IN_NATIVE, Address(value, 0), value, tmp); verify_oop(value); bind(done); } @@ -3402,8 +3401,7 @@ // ((OopHandle)result).resolve(); void MacroAssembler::resolve_oop_handle(Register result, Register tmp) { // OopHandle::resolve is an indirection. - access_load_at(T_OBJECT, IN_CONCURRENT_ROOT, - Address(result, 0), result, tmp); + access_load_at(T_OBJECT, IN_NATIVE, Address(result, 0), result, tmp); } void MacroAssembler::load_mirror(Register mirror, Register method, Register tmp) { diff -Nru openjdk-11-11~19/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp openjdk-11-11~24/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp --- openjdk-11-11~19/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/sparc/stubGenerator_sparc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2269,9 +2269,9 @@ BLOCK_COMMENT("Entry:"); } - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -2326,9 +2326,9 @@ array_overlap_test(nooverlap_target, LogBytesPerHeapOop); - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; + DecoratorSet decorators = IN_HEAP | IS_ARRAY; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -2446,9 +2446,9 @@ BLOCK_COMMENT("Entry:"); } - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_CHECKCAST; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler(); diff -Nru openjdk-11-11~19/src/hotspot/cpu/sparc/templateTable_sparc.cpp openjdk-11-11~24/src/hotspot/cpu/sparc/templateTable_sparc.cpp --- openjdk-11-11~19/src/hotspot/cpu/sparc/templateTable_sparc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/sparc/templateTable_sparc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -697,7 +697,7 @@ arrayOopDesc::base_offset_in_bytes(T_OBJECT), Otos_i, G3_scratch, - IN_HEAP_ARRAY); + IS_ARRAY); __ verify_oop(Otos_i); } @@ -997,13 +997,13 @@ // Store is OK. __ bind(store_ok); - do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Otos_i, G3_scratch, IN_HEAP_ARRAY); + do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), Otos_i, G3_scratch, IS_ARRAY); __ ba(done); __ delayed()->inc(Lesp, 3* Interpreter::stackElementSize); // adj sp (pops array, index and value) __ bind(is_null); - do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), G0, G4_scratch, IN_HEAP_ARRAY); + do_oop_store(_masm, O1, noreg, arrayOopDesc::base_offset_in_bytes(T_OBJECT), G0, G4_scratch, IS_ARRAY); __ profile_null_seen(G3_scratch); __ inc(Lesp, 3* Interpreter::stackElementSize); // adj sp (pops array, index and value) @@ -3202,28 +3202,56 @@ prepare_invoke(byte_no, Rinterface, Rret, Rmethod, O0_recv, O1_flags); - // get receiver klass + // First check for Object case, then private interface method, + // then regular interface method. + + // get receiver klass - this is also a null check __ null_check(O0_recv, oopDesc::klass_offset_in_bytes()); __ load_klass(O0_recv, O2_Klass); // Special case of invokeinterface called for virtual method of - // java.lang.Object. See cpCacheOop.cpp for details. - // This code isn't produced by javac, but could be produced by - // another compliant java compiler. - Label notMethod; + // java.lang.Object. See cpCache.cpp for details. + Label notObjectMethod; __ set((1 << ConstantPoolCacheEntry::is_forced_virtual_shift), Rscratch); __ btst(O1_flags, Rscratch); - __ br(Assembler::zero, false, Assembler::pt, notMethod); + __ br(Assembler::zero, false, Assembler::pt, notObjectMethod); __ delayed()->nop(); invokeinterface_object_method(O2_Klass, Rinterface, Rret, O1_flags); - __ bind(notMethod); - - Register Rtemp = O1_flags; + __ bind(notObjectMethod); Label L_no_such_interface; + // Check for private method invocation - indicated by vfinal + Label notVFinal; + { + __ set((1 << ConstantPoolCacheEntry::is_vfinal_shift), Rscratch); + __ btst(O1_flags, Rscratch); + __ br(Assembler::zero, false, Assembler::pt, notVFinal); + __ delayed()->nop(); + + Label subtype; + Register Rtemp = O1_flags; + __ check_klass_subtype(O2_Klass, Rinterface, Rscratch, Rtemp, subtype); + // If we get here the typecheck failed + __ ba(L_no_such_interface); + __ delayed()->nop(); + __ bind(subtype); + + // do the call + Register Rcall = Rinterface; + __ mov(Rmethod, G5_method); + assert_different_registers(Rcall, G5_method, Gargs, Rret); + + __ profile_arguments_type(G5_method, Rcall, Gargs, true); + __ profile_final_call(Rscratch); + __ call_from_interpreter(Rcall, Gargs, Rret); + } + __ bind(notVFinal); + + Register Rtemp = O1_flags; + // Receiver subtype check against REFC. __ lookup_interface_method(// inputs: rec. class, interface, itable index O2_Klass, Rinterface, noreg, diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/assembler_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/assembler_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/assembler_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/assembler_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -133,6 +133,8 @@ _index = noreg; _scale = no_scale; _disp = disp; + _xmmindex = xnoreg; + _isxmmindex = false; switch (rtype) { case relocInfo::external_word_type: _rspec = external_word_Relocation::spec(loc); @@ -172,6 +174,8 @@ _scale = no_scale; _disp = (intptr_t) loc; _rspec = spec; + _xmmindex = xnoreg; + _isxmmindex = false; } #endif // _LP64 @@ -604,6 +608,21 @@ emit_operand((Register)reg, base, index, scale, disp, rspec); } +void Assembler::emit_operand(XMMRegister reg, Register base, XMMRegister index, + Address::ScaleFactor scale, int disp, + RelocationHolder const& rspec) { + if (UseAVX > 2) { + int xreg_enc = reg->encoding(); + int xmmindex_enc = index->encoding(); + XMMRegister new_reg = as_XMMRegister(xreg_enc & 0xf); + XMMRegister new_index = as_XMMRegister(xmmindex_enc & 0xf); + emit_operand((Register)new_reg, base, (Register)new_index, scale, disp, rspec); + } else { + emit_operand((Register)reg, base, (Register)index, scale, disp, rspec); + } +} + + // Secret local extension to Assembler::WhichOperand: #define end_pc_operand (_WhichOperand_limit) @@ -1104,8 +1123,12 @@ } void Assembler::emit_operand(XMMRegister reg, Address adr) { - emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, - adr._rspec); + if (adr.isxmmindex()) { + emit_operand(reg, adr._base, adr._xmmindex, adr._scale, adr._disp, adr._rspec); + } else { + emit_operand(reg, adr._base, adr._index, adr._scale, adr._disp, + adr._rspec); + } } // MMX operations @@ -1303,6 +1326,16 @@ emit_int8(0xC0 | encode); } +void Assembler::vaesdec(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { + assert(VM_Version::supports_vaes(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8((unsigned char)0xDE); + emit_int8((unsigned char)(0xC0 | encode)); +} + + void Assembler::aesdeclast(XMMRegister dst, Address src) { assert(VM_Version::supports_aes(), ""); InstructionMark im(this); @@ -1320,6 +1353,15 @@ emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::vaesdeclast(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { + assert(VM_Version::supports_vaes(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8((unsigned char)0xDF); + emit_int8((unsigned char)(0xC0 | encode)); +} + void Assembler::aesenc(XMMRegister dst, Address src) { assert(VM_Version::supports_aes(), ""); InstructionMark im(this); @@ -3400,6 +3442,15 @@ emit_int8(imm8); } +void Assembler::evpermi2q(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x76); + emit_int8((unsigned char)(0xC0 | encode)); +} + void Assembler::pause() { emit_int8((unsigned char)0xF3); @@ -3851,6 +3902,17 @@ emit_operand(dst, src); } +void Assembler::vpmovzxbw(XMMRegister dst, XMMRegister src, int vector_len) { + assert(vector_len == AVX_128bit? VM_Version::supports_avx() : + vector_len == AVX_256bit? VM_Version::supports_avx2() : + vector_len == AVX_512bit? VM_Version::supports_avx512bw() : 0, ""); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x30); + emit_int8((unsigned char) (0xC0 | encode)); +} + + void Assembler::evpmovzxbw(XMMRegister dst, KRegister mask, Address src, int vector_len) { assert(is_vector_masking(), ""); assert(VM_Version::supports_avx512vlbw(), ""); @@ -3864,7 +3926,6 @@ emit_int8(0x30); emit_operand(dst, src); } - void Assembler::evpmovwb(Address dst, XMMRegister src, int vector_len) { assert(VM_Version::supports_avx512vlbw(), ""); assert(src != xnoreg, "sanity"); @@ -3892,6 +3953,28 @@ emit_operand(src, dst); } +void Assembler::evpmovdb(Address dst, XMMRegister src, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(src != xnoreg, "sanity"); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ true, /* uses_vl */ false); + attributes.set_address_attributes(/* tuple_type */ EVEX_QVM, /* input_size_in_bits */ EVEX_NObit); + attributes.set_is_evex_instruction(); + vex_prefix(dst, 0, src->encoding(), VEX_SIMD_F3, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x31); + emit_operand(src, dst); +} + +void Assembler::vpmovzxwd(XMMRegister dst, XMMRegister src, int vector_len) { + assert(vector_len == AVX_128bit? VM_Version::supports_avx() : + vector_len == AVX_256bit? VM_Version::supports_avx2() : + vector_len == AVX_512bit? VM_Version::supports_evex() : 0, " "); + InstructionAttr attributes(vector_len, /* rex_w */ false, /* legacy_mode */ _legacy_mode_bw, /* no_mask_reg */ true, /* uses_vl */ false); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x33); + emit_int8((unsigned char)(0xC0 | encode)); +} + // generic void Assembler::pop(Register dst) { int encode = prefix_and_encode(dst->encoding()); @@ -4391,6 +4474,15 @@ emit_int8(imm8); } +void Assembler::evalignq(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(AVX_512bit, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_3A, &attributes); + emit_int8(0x3); + emit_int8((unsigned char)(0xC0 | encode)); + emit_int8(imm8); +} + void Assembler::pblendw(XMMRegister dst, XMMRegister src, int imm8) { assert(VM_Version::supports_sse4_1(), ""); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ true, /* no_mask_reg */ true, /* uses_vl */ false); @@ -6052,6 +6144,24 @@ emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::evpsrlvw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x10); + emit_int8((unsigned char)(0xC0 | encode)); +} + +void Assembler::evpsllvw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { + assert(VM_Version::supports_avx512bw(), ""); + InstructionAttr attributes(vector_len, /* rex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_is_evex_instruction(); + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x12); + emit_int8((unsigned char)(0xC0 | encode)); +} + // Shift packed integers arithmetically right by specified number of bits. void Assembler::psraw(XMMRegister dst, int shift) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); @@ -6153,6 +6263,15 @@ emit_operand(dst, src); } +void Assembler::vpandq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xDB); + emit_int8((unsigned char)(0xC0 | encode)); +} + + void Assembler::pandn(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionAttr attributes(AVX_128bit, /* vex_w */ VM_Version::supports_evex(), /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); @@ -6188,6 +6307,15 @@ emit_operand(dst, src); } +void Assembler::vporq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len) { + assert(VM_Version::supports_evex(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + int encode = vex_prefix_and_encode(dst->encoding(), nds->encoding(), src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F, &attributes); + emit_int8((unsigned char)0xEB); + emit_int8((unsigned char)(0xC0 | encode)); +} + + void Assembler::pxor(XMMRegister dst, XMMRegister src) { NOT_LP64(assert(VM_Version::supports_sse2(), "")); InstructionAttr attributes(AVX_128bit, /* rex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); @@ -6708,7 +6836,29 @@ emit_int8(0x59); emit_operand(dst, src); } +void Assembler::evbroadcasti64x2(XMMRegister dst, XMMRegister src, int vector_len) { + assert(vector_len != Assembler::AVX_128bit, ""); + assert(VM_Version::supports_avx512dq(), ""); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_rex_vex_w_reverted(); + int encode = vex_prefix_and_encode(dst->encoding(), 0, src->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x5A); + emit_int8((unsigned char)(0xC0 | encode)); +} +void Assembler::evbroadcasti64x2(XMMRegister dst, Address src, int vector_len) { + assert(vector_len != Assembler::AVX_128bit, ""); + assert(VM_Version::supports_avx512dq(), ""); + assert(dst != xnoreg, "sanity"); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ true, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_rex_vex_w_reverted(); + attributes.set_address_attributes(/* tuple_type */ EVEX_T2, /* input_size_in_bits */ EVEX_64bit); + // swap src<->dst for encoding + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8(0x5A); + emit_operand(dst, src); +} // scalar single/double precision replicate @@ -6799,6 +6949,20 @@ emit_int8((unsigned char)(0xC0 | encode)); } +void Assembler::evpgatherdd(XMMRegister dst, KRegister mask, Address src, int vector_len) { + assert(VM_Version::supports_evex(), ""); + assert(dst != xnoreg, "sanity"); + InstructionMark im(this); + InstructionAttr attributes(vector_len, /* vex_w */ false, /* legacy_mode */ false, /* no_mask_reg */ false, /* uses_vl */ true); + attributes.set_address_attributes(/* tuple_type */ EVEX_T1S, /* input_size_in_bits */ EVEX_64bit); + attributes.reset_is_clear_context(); + attributes.set_embedded_opmask_register_specifier(mask); + attributes.set_is_evex_instruction(); + // swap src<->dst for encoding + vex_prefix(src, 0, dst->encoding(), VEX_SIMD_66, VEX_OPCODE_0F_38, &attributes); + emit_int8((unsigned char)0x90); + emit_operand(dst, src); +} // Carry-Less Multiplication Quadword void Assembler::pclmulqdq(XMMRegister dst, XMMRegister src, int mask) { @@ -7424,7 +7588,12 @@ void Assembler::vex_prefix(Address adr, int nds_enc, int xreg_enc, VexSimdPrefix pre, VexOpcode opc, InstructionAttr *attributes) { bool vex_r = ((xreg_enc & 8) == 8) ? 1 : 0; bool vex_b = adr.base_needs_rex(); - bool vex_x = adr.index_needs_rex(); + bool vex_x; + if (adr.isxmmindex()) { + vex_x = adr.xmmindex_needs_rex(); + } else { + vex_x = adr.index_needs_rex(); + } set_attributes(attributes); attributes->set_current_assembler(this); @@ -7461,7 +7630,13 @@ if (UseAVX > 2 && !attributes->is_legacy_mode()) { bool evex_r = (xreg_enc >= 16); - bool evex_v = (nds_enc >= 16); + bool evex_v; + // EVEX.V' is set to true when VSIB is used as we may need to use higher order XMM registers (16-31) + if (adr.isxmmindex()) { + evex_v = ((adr._xmmindex->encoding() > 15) ? true : false); + } else { + evex_v = (nds_enc >= 16); + } attributes->set_is_evex_instruction(); evex_prefix(vex_r, vex_b, vex_x, evex_r, evex_v, nds_enc, pre, opc); } else { diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/assembler_x86.hpp openjdk-11-11~24/src/hotspot/cpu/x86/assembler_x86.hpp --- openjdk-11-11~19/src/hotspot/cpu/x86/assembler_x86.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/assembler_x86.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -184,8 +184,10 @@ private: Register _base; Register _index; + XMMRegister _xmmindex; ScaleFactor _scale; int _disp; + bool _isxmmindex; RelocationHolder _rspec; // Easily misused constructors make them private @@ -201,8 +203,10 @@ Address() : _base(noreg), _index(noreg), + _xmmindex(xnoreg), _scale(no_scale), - _disp(0) { + _disp(0), + _isxmmindex(false){ } // No default displacement otherwise Register can be implicitly @@ -211,15 +215,19 @@ Address(Register base, int disp) : _base(base), _index(noreg), + _xmmindex(xnoreg), _scale(no_scale), - _disp(disp) { + _disp(disp), + _isxmmindex(false){ } Address(Register base, Register index, ScaleFactor scale, int disp = 0) : _base (base), _index(index), + _xmmindex(xnoreg), _scale(scale), - _disp (disp) { + _disp (disp), + _isxmmindex(false) { assert(!index->is_valid() == (scale == Address::no_scale), "inconsistent address"); } @@ -227,13 +235,26 @@ Address(Register base, RegisterOrConstant index, ScaleFactor scale = times_1, int disp = 0) : _base (base), _index(index.register_or_noreg()), + _xmmindex(xnoreg), _scale(scale), - _disp (disp + (index.constant_or_zero() * scale_size(scale))) { + _disp (disp + (index.constant_or_zero() * scale_size(scale))), + _isxmmindex(false){ if (!index.is_register()) scale = Address::no_scale; assert(!_index->is_valid() == (scale == Address::no_scale), "inconsistent address"); } + Address(Register base, XMMRegister index, ScaleFactor scale, int disp = 0) + : _base (base), + _index(noreg), + _xmmindex(index), + _scale(scale), + _disp(disp), + _isxmmindex(true) { + assert(!index->is_valid() == (scale == Address::no_scale), + "inconsistent address"); + } + Address plus_disp(int disp) const { Address a = (*this); a._disp += disp; @@ -269,24 +290,29 @@ Address(Register base, ByteSize disp) : _base(base), _index(noreg), + _xmmindex(xnoreg), _scale(no_scale), - _disp(in_bytes(disp)) { + _disp(in_bytes(disp)), + _isxmmindex(false){ } Address(Register base, Register index, ScaleFactor scale, ByteSize disp) : _base(base), _index(index), + _xmmindex(xnoreg), _scale(scale), - _disp(in_bytes(disp)) { + _disp(in_bytes(disp)), + _isxmmindex(false){ assert(!index->is_valid() == (scale == Address::no_scale), "inconsistent address"); } - Address(Register base, RegisterOrConstant index, ScaleFactor scale, ByteSize disp) : _base (base), _index(index.register_or_noreg()), + _xmmindex(xnoreg), _scale(scale), - _disp (in_bytes(disp) + (index.constant_or_zero() * scale_size(scale))) { + _disp (in_bytes(disp) + (index.constant_or_zero() * scale_size(scale))), + _isxmmindex(false) { if (!index.is_register()) scale = Address::no_scale; assert(!_index->is_valid() == (scale == Address::no_scale), "inconsistent address"); @@ -298,8 +324,10 @@ bool uses(Register reg) const { return _base == reg || _index == reg; } Register base() const { return _base; } Register index() const { return _index; } + XMMRegister xmmindex() const { return _xmmindex; } ScaleFactor scale() const { return _scale; } int disp() const { return _disp; } + bool isxmmindex() const { return _isxmmindex; } // Convert the raw encoding form into the form expected by the constructor for // Address. An index of 4 (rsp) corresponds to having no index, so convert @@ -317,6 +345,10 @@ return _index != noreg &&_index->encoding() >= 8; } + bool xmmindex_needs_rex() const { + return _xmmindex != xnoreg && _xmmindex->encoding() >= 8; + } + relocInfo::relocType reloc() const { return _rspec.type(); } friend class Assembler; @@ -683,6 +715,10 @@ RelocationHolder const& rspec, int rip_relative_correction = 0); + void emit_operand(XMMRegister reg, Register base, XMMRegister index, + Address::ScaleFactor scale, + int disp, RelocationHolder const& rspec); + void emit_operand(Register reg, Address adr, int rip_relative_correction = 0); // operands that only take the original 32bit registers @@ -926,7 +962,8 @@ void aesenc(XMMRegister dst, XMMRegister src); void aesenclast(XMMRegister dst, Address src); void aesenclast(XMMRegister dst, XMMRegister src); - + void vaesdec(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); + void vaesdeclast(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void andl(Address dst, int32_t imm32); void andl(Register dst, int32_t imm32); @@ -1553,6 +1590,7 @@ void vpermq(XMMRegister dst, XMMRegister src, int imm8); void vperm2i128(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8); void vperm2f128(XMMRegister dst, XMMRegister nds, XMMRegister src, int imm8); + void evpermi2q(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void pause(); @@ -1619,11 +1657,16 @@ void pmovzxbw(XMMRegister dst, Address src); void vpmovzxbw( XMMRegister dst, Address src, int vector_len); + void vpmovzxbw(XMMRegister dst, XMMRegister src, int vector_len); void evpmovzxbw(XMMRegister dst, KRegister mask, Address src, int vector_len); void evpmovwb(Address dst, XMMRegister src, int vector_len); void evpmovwb(Address dst, KRegister mask, XMMRegister src, int vector_len); + void vpmovzxwd(XMMRegister dst, XMMRegister src, int vector_len); + + void evpmovdb(Address dst, XMMRegister src, int vector_len); + #ifndef _LP64 // no 32bit push/pop on amd64 void popl(Address dst); #endif @@ -1739,6 +1782,7 @@ void palignr(XMMRegister dst, XMMRegister src, int imm8); void vpalignr(XMMRegister dst, XMMRegister src1, XMMRegister src2, int imm8, int vector_len); + void evalignq(XMMRegister dst, XMMRegister nds, XMMRegister src, uint8_t imm8); void pblendw(XMMRegister dst, XMMRegister src, int imm8); @@ -2024,6 +2068,8 @@ void vpsrlw(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len); void vpsrld(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len); void vpsrlq(XMMRegister dst, XMMRegister src, XMMRegister shift, int vector_len); + void evpsrlvw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); + void evpsllvw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); // Arithmetic shift right packed integers (only shorts and ints, no instructions for longs) void psraw(XMMRegister dst, int shift); @@ -2039,6 +2085,7 @@ void pand(XMMRegister dst, XMMRegister src); void vpand(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void vpand(XMMRegister dst, XMMRegister nds, Address src, int vector_len); + void vpandq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); // Andn packed integers void pandn(XMMRegister dst, XMMRegister src); @@ -2047,6 +2094,7 @@ void por(XMMRegister dst, XMMRegister src); void vpor(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void vpor(XMMRegister dst, XMMRegister nds, Address src, int vector_len); + void vporq(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); // Xor packed integers void pxor(XMMRegister dst, XMMRegister src); @@ -2102,6 +2150,9 @@ void evpbroadcastq(XMMRegister dst, XMMRegister src, int vector_len); void evpbroadcastq(XMMRegister dst, Address src, int vector_len); + void evbroadcasti64x2(XMMRegister dst, XMMRegister src, int vector_len); + void evbroadcasti64x2(XMMRegister dst, Address src, int vector_len); + // scalar single/double precision replicate void evpbroadcastss(XMMRegister dst, XMMRegister src, int vector_len); void evpbroadcastss(XMMRegister dst, Address src, int vector_len); @@ -2114,6 +2165,8 @@ void evpbroadcastd(XMMRegister dst, Register src, int vector_len); void evpbroadcastq(XMMRegister dst, Register src, int vector_len); + void evpgatherdd(XMMRegister dst, KRegister k1, Address src, int vector_len); + // Carry-Less Multiplication Quadword void pclmulqdq(XMMRegister dst, XMMRegister src, int mask); void vpclmulqdq(XMMRegister dst, XMMRegister nds, XMMRegister src, int mask); diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -139,10 +139,9 @@ // Defines obj, preserves var_size_in_bytes void C1_MacroAssembler::try_allocate(Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, Label& slow_case) { if (UseTLAB) { - tlab_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); + tlab_allocate(noreg, obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); } else { - eden_allocate(obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); - incr_allocated_bytes(noreg, var_size_in_bytes, con_size_in_bytes, t1); + eden_allocate(noreg, obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); } } diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/c1_Runtime1_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1013,7 +1013,10 @@ __ set_info("fast new_instance init check", dont_gc_arguments); } - if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) && UseTLAB + // If TLAB is disabled, see if there is support for inlining contiguous + // allocations. + // Otherwise, just go to the slow path. + if ((id == fast_new_instance_id || id == fast_new_instance_init_check_id) && !UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { Label slow_path; Register obj_size = rcx; @@ -1046,18 +1049,13 @@ } #endif // ASSERT - // if we got here then the TLAB allocation failed, so try - // refilling the TLAB or allocating directly from eden. - Label retry_tlab, try_eden; const Register thread = NOT_LP64(rdi) LP64_ONLY(r15_thread); NOT_LP64(__ get_thread(thread)); - __ bind(try_eden); // get the instance size (size is postive so movl is fine for 64bit) __ movl(obj_size, Address(klass, Klass::layout_helper_offset())); - __ eden_allocate(obj, obj_size, 0, t1, slow_path); - __ incr_allocated_bytes(thread, obj_size, 0); + __ eden_allocate(thread, obj, obj_size, 0, t1, slow_path); __ initialize_object(obj, klass, obj_size, 0, t1, t2, /* is_tlab_allocated */ false); __ verify_oop(obj); @@ -1134,9 +1132,10 @@ } #endif // ASSERT - // If we got here, the TLAB allocation failed, so try allocating from - // eden if inline contiguous allocations are supported. - if (UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { + // If TLAB is disabled, see if there is support for inlining contiguous + // allocations. + // Otherwise, just go to the slow path. + if (!UseTLAB && Universe::heap()->supports_inline_contig_alloc()) { Register arr_size = rsi; Register t1 = rcx; // must be rcx for use as shift count Register t2 = rdi; @@ -1155,12 +1154,10 @@ __ addptr(arr_size, MinObjAlignmentInBytesMask); // align up __ andptr(arr_size, ~MinObjAlignmentInBytesMask); - __ eden_allocate(obj, arr_size, 0, t1, slow_path); // preserves arr_size - // Using t2 for non 64-bit. const Register thread = NOT_LP64(t2) LP64_ONLY(r15_thread); NOT_LP64(__ get_thread(thread)); - __ incr_allocated_bytes(thread, arr_size, 0); + __ eden_allocate(thread, obj, arr_size, 0, t1, slow_path); // preserves arr_size __ initialize_header(obj, klass, length, t1, t2); __ movb(t1, Address(klass, in_bytes(Klass::layout_helper_offset()) + (Klass::_lh_header_size_shift / BitsPerByte))); diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/gc/g1/g1BarrierSetAssembler_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -43,7 +43,7 @@ void G1BarrierSetAssembler::gen_write_ref_array_pre_barrier(MacroAssembler* masm, DecoratorSet decorators, Register addr, Register count) { - bool dest_uninitialized = (decorators & AS_DEST_NOT_INITIALIZED) != 0; + bool dest_uninitialized = (decorators & IS_DEST_UNINITIALIZED) != 0; if (!dest_uninitialized) { Register thread = NOT_LP64(rax) LP64_ONLY(r15_thread); @@ -349,9 +349,10 @@ void G1BarrierSetAssembler::oop_store_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Address dst, Register val, Register tmp1, Register tmp2) { bool in_heap = (decorators & IN_HEAP) != 0; - bool in_concurrent_root = (decorators & IN_CONCURRENT_ROOT) != 0; + bool as_normal = (decorators & AS_NORMAL) != 0; + assert((decorators & IS_DEST_UNINITIALIZED) == 0, "unsupported"); - bool needs_pre_barrier = in_heap || in_concurrent_root; + bool needs_pre_barrier = as_normal; bool needs_post_barrier = val != noreg && in_heap; Register tmp3 = LP64_ONLY(r8) NOT_LP64(rsi); diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,10 @@ #include "precompiled.hpp" #include "gc/shared/barrierSetAssembler.hpp" +#include "gc/shared/collectedHeap.hpp" #include "interpreter/interp_masm.hpp" #include "runtime/jniHandles.hpp" +#include "runtime/thread.hpp" #define __ masm-> @@ -33,7 +35,7 @@ Register dst, Address src, Register tmp1, Register tmp_thread) { bool in_heap = (decorators & IN_HEAP) != 0; bool in_native = (decorators & IN_NATIVE) != 0; - bool oop_not_null = (decorators & OOP_NOT_NULL) != 0; + bool is_not_null = (decorators & IS_NOT_NULL) != 0; bool atomic = (decorators & MO_RELAXED) != 0; switch (type) { @@ -43,7 +45,7 @@ #ifdef _LP64 if (UseCompressedOops) { __ movl(dst, src); - if (oop_not_null) { + if (is_not_null) { __ decode_heap_oop_not_null(dst); } else { __ decode_heap_oop(dst); @@ -98,7 +100,7 @@ Address dst, Register val, Register tmp1, Register tmp2) { bool in_heap = (decorators & IN_HEAP) != 0; bool in_native = (decorators & IN_NATIVE) != 0; - bool oop_not_null = (decorators & OOP_NOT_NULL) != 0; + bool is_not_null = (decorators & IS_NOT_NULL) != 0; bool atomic = (decorators & MO_RELAXED) != 0; switch (type) { @@ -106,7 +108,7 @@ case T_ARRAY: { if (in_heap) { if (val == noreg) { - assert(!oop_not_null, "inconsistent access"); + assert(!is_not_null, "inconsistent access"); #ifdef _LP64 if (UseCompressedOops) { __ movl(dst, (int32_t)NULL_WORD); @@ -120,7 +122,7 @@ #ifdef _LP64 if (UseCompressedOops) { assert(!dst.uses(val), "not enough registers"); - if (oop_not_null) { + if (is_not_null) { __ encode_heap_oop_not_null(val); } else { __ encode_heap_oop(val); @@ -213,3 +215,110 @@ __ clear_jweak_tag(obj); __ movptr(obj, Address(obj, 0)); } + +void BarrierSetAssembler::tlab_allocate(MacroAssembler* masm, + Register thread, Register obj, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1, + Register t2, + Label& slow_case) { + assert_different_registers(obj, t1, t2); + assert_different_registers(obj, var_size_in_bytes, t1); + Register end = t2; + if (!thread->is_valid()) { +#ifdef _LP64 + thread = r15_thread; +#else + assert(t1->is_valid(), "need temp reg"); + thread = t1; + __ get_thread(thread); +#endif + } + + __ verify_tlab(); + + __ movptr(obj, Address(thread, JavaThread::tlab_top_offset())); + if (var_size_in_bytes == noreg) { + __ lea(end, Address(obj, con_size_in_bytes)); + } else { + __ lea(end, Address(obj, var_size_in_bytes, Address::times_1)); + } + __ cmpptr(end, Address(thread, JavaThread::tlab_end_offset())); + __ jcc(Assembler::above, slow_case); + + // update the tlab top pointer + __ movptr(Address(thread, JavaThread::tlab_top_offset()), end); + + // recover var_size_in_bytes if necessary + if (var_size_in_bytes == end) { + __ subptr(var_size_in_bytes, obj); + } + __ verify_tlab(); +} + +// Defines obj, preserves var_size_in_bytes +void BarrierSetAssembler::eden_allocate(MacroAssembler* masm, + Register thread, Register obj, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1, + Label& slow_case) { + assert(obj == rax, "obj must be in rax, for cmpxchg"); + assert_different_registers(obj, var_size_in_bytes, t1); + if (!Universe::heap()->supports_inline_contig_alloc()) { + __ jmp(slow_case); + } else { + Register end = t1; + Label retry; + __ bind(retry); + ExternalAddress heap_top((address) Universe::heap()->top_addr()); + __ movptr(obj, heap_top); + if (var_size_in_bytes == noreg) { + __ lea(end, Address(obj, con_size_in_bytes)); + } else { + __ lea(end, Address(obj, var_size_in_bytes, Address::times_1)); + } + // if end < obj then we wrapped around => object too long => slow case + __ cmpptr(end, obj); + __ jcc(Assembler::below, slow_case); + __ cmpptr(end, ExternalAddress((address) Universe::heap()->end_addr())); + __ jcc(Assembler::above, slow_case); + // Compare obj with the top addr, and if still equal, store the new top addr in + // end at the address of the top addr pointer. Sets ZF if was equal, and clears + // it otherwise. Use lock prefix for atomicity on MPs. + __ locked_cmpxchgptr(end, heap_top); + __ jcc(Assembler::notEqual, retry); + incr_allocated_bytes(masm, thread, var_size_in_bytes, con_size_in_bytes, thread->is_valid() ? noreg : t1); + } +} + +void BarrierSetAssembler::incr_allocated_bytes(MacroAssembler* masm, Register thread, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1) { + if (!thread->is_valid()) { +#ifdef _LP64 + thread = r15_thread; +#else + assert(t1->is_valid(), "need temp reg"); + thread = t1; + __ get_thread(thread); +#endif + } + +#ifdef _LP64 + if (var_size_in_bytes->is_valid()) { + __ addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); + } else { + __ addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes); + } +#else + if (var_size_in_bytes->is_valid()) { + __ addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); + } else { + __ addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes); + } + __ adcl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())+4), 0); +#endif +} diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp openjdk-11-11~24/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp --- openjdk-11-11~19/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/gc/shared/barrierSetAssembler_x86.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -32,7 +32,12 @@ class InterpreterMacroAssembler; class BarrierSetAssembler: public CHeapObj { -protected: +private: + void incr_allocated_bytes(MacroAssembler* masm, Register thread, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1); + public: virtual void arraycopy_prologue(MacroAssembler* masm, DecoratorSet decorators, BasicType type, Register src, Register dst, Register count) {} @@ -60,6 +65,19 @@ virtual void try_resolve_jobject_in_native(MacroAssembler* masm, Register jni_env, Register obj, Register tmp, Label& slowpath); + virtual void tlab_allocate(MacroAssembler* masm, + Register thread, Register obj, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1, Register t2, + Label& slow_case); + virtual void eden_allocate(MacroAssembler* masm, + Register thread, Register obj, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1, + Label& slow_case); + virtual void barrier_stubs_init() {} }; diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/gc/shared/cardTableBarrierSetAssembler_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -135,9 +135,9 @@ Address dst, Register val, Register tmp1, Register tmp2) { bool in_heap = (decorators & IN_HEAP) != 0; - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; bool needs_post_barrier = val != noreg && in_heap; diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/macroAssembler_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/macroAssembler_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/macroAssembler_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2959,40 +2959,6 @@ #endif // !LP64 || C1 || !C2 || INCLUDE_JVMCI -// Defines obj, preserves var_size_in_bytes -void MacroAssembler::eden_allocate(Register obj, - Register var_size_in_bytes, - int con_size_in_bytes, - Register t1, - Label& slow_case) { - assert(obj == rax, "obj must be in rax, for cmpxchg"); - assert_different_registers(obj, var_size_in_bytes, t1); - if (!Universe::heap()->supports_inline_contig_alloc()) { - jmp(slow_case); - } else { - Register end = t1; - Label retry; - bind(retry); - ExternalAddress heap_top((address) Universe::heap()->top_addr()); - movptr(obj, heap_top); - if (var_size_in_bytes == noreg) { - lea(end, Address(obj, con_size_in_bytes)); - } else { - lea(end, Address(obj, var_size_in_bytes, Address::times_1)); - } - // if end < obj then we wrapped around => object too long => slow case - cmpptr(end, obj); - jcc(Assembler::below, slow_case); - cmpptr(end, ExternalAddress((address) Universe::heap()->end_addr())); - jcc(Assembler::above, slow_case); - // Compare obj with the top addr, and if still equal, store the new top addr in - // end at the address of the top addr pointer. Sets ZF if was equal, and clears - // it otherwise. Use lock prefix for atomicity on MPs. - locked_cmpxchgptr(end, heap_top); - jcc(Assembler::notEqual, retry); - } -} - void MacroAssembler::enter() { push(rbp); mov(rbp, rsp); @@ -3604,6 +3570,15 @@ } } +void MacroAssembler::evmovdquq(XMMRegister dst, AddressLiteral src, int vector_len, Register rscratch) { + if (reachable(src)) { + Assembler::evmovdquq(dst, as_Address(src), vector_len); + } else { + lea(rscratch, src); + Assembler::evmovdquq(dst, Address(rscratch, 0), vector_len); + } +} + void MacroAssembler::movdqa(XMMRegister dst, AddressLiteral src) { if (reachable(src)) { Assembler::movdqa(dst, as_Address(src)); @@ -5272,8 +5247,7 @@ jmp(done); bind(not_weak); // Resolve (untagged) jobject. - access_load_at(T_OBJECT, IN_CONCURRENT_ROOT, - value, Address(value, 0), tmp, thread); + access_load_at(T_OBJECT, IN_NATIVE, value, Address(value, 0), tmp, thread); verify_oop(value); bind(done); } @@ -5310,38 +5284,24 @@ } // Defines obj, preserves var_size_in_bytes, okay for t2 == var_size_in_bytes. -void MacroAssembler::tlab_allocate(Register obj, +void MacroAssembler::tlab_allocate(Register thread, Register obj, Register var_size_in_bytes, int con_size_in_bytes, Register t1, Register t2, Label& slow_case) { - assert_different_registers(obj, t1, t2); - assert_different_registers(obj, var_size_in_bytes, t1); - Register end = t2; - Register thread = NOT_LP64(t1) LP64_ONLY(r15_thread); - - verify_tlab(); - - NOT_LP64(get_thread(thread)); - - movptr(obj, Address(thread, JavaThread::tlab_top_offset())); - if (var_size_in_bytes == noreg) { - lea(end, Address(obj, con_size_in_bytes)); - } else { - lea(end, Address(obj, var_size_in_bytes, Address::times_1)); - } - cmpptr(end, Address(thread, JavaThread::tlab_end_offset())); - jcc(Assembler::above, slow_case); - - // update the tlab top pointer - movptr(Address(thread, JavaThread::tlab_top_offset()), end); + BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->tlab_allocate(this, thread, obj, var_size_in_bytes, con_size_in_bytes, t1, t2, slow_case); +} - // recover var_size_in_bytes if necessary - if (var_size_in_bytes == end) { - subptr(var_size_in_bytes, obj); - } - verify_tlab(); +// Defines obj, preserves var_size_in_bytes +void MacroAssembler::eden_allocate(Register thread, Register obj, + Register var_size_in_bytes, + int con_size_in_bytes, + Register t1, + Label& slow_case) { + BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler(); + bs->eden_allocate(this, thread, obj, var_size_in_bytes, con_size_in_bytes, t1, slow_case); } // Preserves the contents of address, destroys the contents length_in_bytes and temp. @@ -5400,36 +5360,6 @@ bind(done); } -void MacroAssembler::incr_allocated_bytes(Register thread, - Register var_size_in_bytes, - int con_size_in_bytes, - Register t1) { - if (!thread->is_valid()) { -#ifdef _LP64 - thread = r15_thread; -#else - assert(t1->is_valid(), "need temp reg"); - thread = t1; - get_thread(thread); -#endif - } - -#ifdef _LP64 - if (var_size_in_bytes->is_valid()) { - addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); - } else { - addq(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes); - } -#else - if (var_size_in_bytes->is_valid()) { - addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), var_size_in_bytes); - } else { - addl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())), con_size_in_bytes); - } - adcl(Address(thread, in_bytes(JavaThread::allocated_bytes_offset())+4), 0); -#endif -} - // Look up the method for a megamorphic invokeinterface call. // The target method is determined by . // The receiver klass is in recv_klass. @@ -6294,7 +6224,7 @@ // Only 64 bit platforms support GCs that require a tmp register // Only IN_HEAP loads require a thread_tmp register // OopHandle::resolve is an indirection like jobject. - access_load_at(T_OBJECT, IN_CONCURRENT_ROOT, + access_load_at(T_OBJECT, IN_NATIVE, result, Address(result, 0), tmp, /*tmp_thread*/noreg); } @@ -6365,7 +6295,7 @@ // Doesn't do verfication, generates fixed size code void MacroAssembler::load_heap_oop_not_null(Register dst, Address src, Register tmp1, Register thread_tmp, DecoratorSet decorators) { - access_load_at(T_OBJECT, IN_HEAP | OOP_NOT_NULL | decorators, dst, src, tmp1, thread_tmp); + access_load_at(T_OBJECT, IN_HEAP | IS_NOT_NULL | decorators, dst, src, tmp1, thread_tmp); } void MacroAssembler::store_heap_oop(Address dst, Register src, Register tmp1, diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/macroAssembler_x86.hpp openjdk-11-11~24/src/hotspot/cpu/x86/macroAssembler_x86.hpp --- openjdk-11-11~19/src/hotspot/cpu/x86/macroAssembler_x86.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/macroAssembler_x86.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -504,6 +504,7 @@ // allocation void eden_allocate( + Register thread, // Current thread Register obj, // result: pointer to object after successful allocation Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise int con_size_in_bytes, // object size in bytes if known at compile time @@ -511,6 +512,7 @@ Label& slow_case // continuation point if fast allocation fails ); void tlab_allocate( + Register thread, // Current thread Register obj, // result: pointer to object after successful allocation Register var_size_in_bytes, // object size in bytes if unknown at compile time; invalid otherwise int con_size_in_bytes, // object size in bytes if known at compile time @@ -520,10 +522,6 @@ ); void zero_memory(Register address, Register length_in_bytes, int offset_in_bytes, Register temp); - void incr_allocated_bytes(Register thread, - Register var_size_in_bytes, int con_size_in_bytes, - Register t1 = noreg); - // interface method calling void lookup_interface_method(Register recv_klass, Register intf_klass, @@ -1097,6 +1095,10 @@ void vmovdqu(XMMRegister dst, Address src); void vmovdqu(XMMRegister dst, XMMRegister src); void vmovdqu(XMMRegister dst, AddressLiteral src); + void evmovdquq(XMMRegister dst, Address src, int vector_len) { Assembler::evmovdquq(dst, src, vector_len); } + void evmovdquq(XMMRegister dst, XMMRegister src, int vector_len) { Assembler::evmovdquq(dst, src, vector_len); } + void evmovdquq(Address dst, XMMRegister src, int vector_len) { Assembler::evmovdquq(dst, src, vector_len); } + void evmovdquq(XMMRegister dst, AddressLiteral src, int vector_len, Register rscratch); // Move Aligned Double Quadword void movdqa(XMMRegister dst, Address src) { Assembler::movdqa(dst, src); } @@ -1210,6 +1212,8 @@ void vpcmpeqw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); void vpmovzxbw(XMMRegister dst, Address src, int vector_len); + void vpmovzxbw(XMMRegister dst, XMMRegister src, int vector_len) { Assembler::vpmovzxbw(dst, src, vector_len); } + void vpmovmskb(Register dst, XMMRegister src); void vpmullw(XMMRegister dst, XMMRegister nds, XMMRegister src, int vector_len); diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp openjdk-11-11~24/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/stubGenerator_x86_32.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -837,9 +837,9 @@ __ jcc(Assembler::zero, L_0_count); } - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -1026,9 +1026,9 @@ __ jcc(Assembler::zero, L_0_count); } - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; + DecoratorSet decorators = IN_HEAP | IS_ARRAY; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -1383,9 +1383,9 @@ Address to_element_addr(end_to, count, Address::times_ptr, 0); Address elem_klass_addr(elem, oopDesc::klass_offset_in_bytes()); - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_CHECKCAST; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } BasicType type = T_OBJECT; diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp openjdk-11-11~24/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/stubGenerator_x86_64.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1832,9 +1832,9 @@ setup_arg_regs(); // from => rdi, to => rsi, count => rdx // r9 and r10 may be used to save non-volatile registers - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -1926,9 +1926,9 @@ setup_arg_regs(); // from => rdi, to => rsi, count => rdx // r9 and r10 may be used to save non-volatile registers - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; + DecoratorSet decorators = IN_HEAP | IS_ARRAY; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -2030,9 +2030,9 @@ // r9 and r10 may be used to save non-volatile registers // 'from', 'to' and 'qword_count' are now valid - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -2123,9 +2123,9 @@ // r9 and r10 may be used to save non-volatile registers // 'from', 'to' and 'qword_count' are now valid - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_DISJOINT; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_DISJOINT; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } if (aligned) { decorators |= ARRAYCOPY_ALIGNED; @@ -2306,9 +2306,9 @@ Address from_element_addr(end_from, count, TIMES_OOP, 0); Address to_element_addr(end_to, count, TIMES_OOP, 0); - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY | ARRAYCOPY_CHECKCAST; + DecoratorSet decorators = IN_HEAP | IS_ARRAY | ARRAYCOPY_CHECKCAST; if (dest_uninitialized) { - decorators |= AS_DEST_NOT_INITIALIZED; + decorators |= IS_DEST_UNINITIALIZED; } BasicType type = T_OBJECT; @@ -4084,6 +4084,312 @@ return start; } +void roundDec(XMMRegister xmm_reg) { + __ vaesdec(xmm1, xmm1, xmm_reg, Assembler::AVX_512bit); + __ vaesdec(xmm2, xmm2, xmm_reg, Assembler::AVX_512bit); + __ vaesdec(xmm3, xmm3, xmm_reg, Assembler::AVX_512bit); + __ vaesdec(xmm4, xmm4, xmm_reg, Assembler::AVX_512bit); + __ vaesdec(xmm5, xmm5, xmm_reg, Assembler::AVX_512bit); + __ vaesdec(xmm6, xmm6, xmm_reg, Assembler::AVX_512bit); + __ vaesdec(xmm7, xmm7, xmm_reg, Assembler::AVX_512bit); + __ vaesdec(xmm8, xmm8, xmm_reg, Assembler::AVX_512bit); +} + +void roundDeclast(XMMRegister xmm_reg) { + __ vaesdeclast(xmm1, xmm1, xmm_reg, Assembler::AVX_512bit); + __ vaesdeclast(xmm2, xmm2, xmm_reg, Assembler::AVX_512bit); + __ vaesdeclast(xmm3, xmm3, xmm_reg, Assembler::AVX_512bit); + __ vaesdeclast(xmm4, xmm4, xmm_reg, Assembler::AVX_512bit); + __ vaesdeclast(xmm5, xmm5, xmm_reg, Assembler::AVX_512bit); + __ vaesdeclast(xmm6, xmm6, xmm_reg, Assembler::AVX_512bit); + __ vaesdeclast(xmm7, xmm7, xmm_reg, Assembler::AVX_512bit); + __ vaesdeclast(xmm8, xmm8, xmm_reg, Assembler::AVX_512bit); +} + + void ev_load_key(XMMRegister xmmdst, Register key, int offset, XMMRegister xmm_shuf_mask = NULL) { + __ movdqu(xmmdst, Address(key, offset)); + if (xmm_shuf_mask != NULL) { + __ pshufb(xmmdst, xmm_shuf_mask); + } else { + __ pshufb(xmmdst, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + } + __ evshufi64x2(xmmdst, xmmdst, xmmdst, 0x0, Assembler::AVX_512bit); + + } + +address generate_cipherBlockChaining_decryptVectorAESCrypt() { + assert(VM_Version::supports_vaes(), "need AES instructions and misaligned SSE support"); + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "cipherBlockChaining_decryptAESCrypt"); + address start = __ pc(); + + const Register from = c_rarg0; // source array address + const Register to = c_rarg1; // destination array address + const Register key = c_rarg2; // key array address + const Register rvec = c_rarg3; // r byte array initialized from initvector array address + // and left with the results of the last encryption block +#ifndef _WIN64 + const Register len_reg = c_rarg4; // src len (must be multiple of blocksize 16) +#else + const Address len_mem(rbp, 6 * wordSize); // length is on stack on Win64 + const Register len_reg = r11; // pick the volatile windows register +#endif + + Label Loop, Loop1, L_128, L_256, L_192, KEY_192, KEY_256, Loop2, Lcbc_dec_rem_loop, + Lcbc_dec_rem_last, Lcbc_dec_ret, Lcbc_dec_rem, Lcbc_exit; + + __ enter(); + +#ifdef _WIN64 + // on win64, fill len_reg from stack position + __ movl(len_reg, len_mem); +#else + __ push(len_reg); // Save +#endif + __ push(rbx); + __ vzeroupper(); + + // Temporary variable declaration for swapping key bytes + const XMMRegister xmm_key_shuf_mask = xmm1; + __ movdqu(xmm_key_shuf_mask, ExternalAddress(StubRoutines::x86::key_shuffle_mask_addr())); + + // Calculate number of rounds from key size: 44 for 10-rounds, 52 for 12-rounds, 60 for 14-rounds + const Register rounds = rbx; + __ movl(rounds, Address(key, arrayOopDesc::length_offset_in_bytes() - arrayOopDesc::base_offset_in_bytes(T_INT))); + + const XMMRegister IV = xmm0; + // Load IV and broadcast value to 512-bits + __ evbroadcasti64x2(IV, Address(rvec, 0), Assembler::AVX_512bit); + + // Temporary variables for storing round keys + const XMMRegister RK0 = xmm30; + const XMMRegister RK1 = xmm9; + const XMMRegister RK2 = xmm18; + const XMMRegister RK3 = xmm19; + const XMMRegister RK4 = xmm20; + const XMMRegister RK5 = xmm21; + const XMMRegister RK6 = xmm22; + const XMMRegister RK7 = xmm23; + const XMMRegister RK8 = xmm24; + const XMMRegister RK9 = xmm25; + const XMMRegister RK10 = xmm26; + + // Load and shuffle key + // the java expanded key ordering is rotated one position from what we want + // so we start from 1*16 here and hit 0*16 last + ev_load_key(RK1, key, 1 * 16, xmm_key_shuf_mask); + ev_load_key(RK2, key, 2 * 16, xmm_key_shuf_mask); + ev_load_key(RK3, key, 3 * 16, xmm_key_shuf_mask); + ev_load_key(RK4, key, 4 * 16, xmm_key_shuf_mask); + ev_load_key(RK5, key, 5 * 16, xmm_key_shuf_mask); + ev_load_key(RK6, key, 6 * 16, xmm_key_shuf_mask); + ev_load_key(RK7, key, 7 * 16, xmm_key_shuf_mask); + ev_load_key(RK8, key, 8 * 16, xmm_key_shuf_mask); + ev_load_key(RK9, key, 9 * 16, xmm_key_shuf_mask); + ev_load_key(RK10, key, 10 * 16, xmm_key_shuf_mask); + ev_load_key(RK0, key, 0*16, xmm_key_shuf_mask); + + // Variables for storing source cipher text + const XMMRegister S0 = xmm10; + const XMMRegister S1 = xmm11; + const XMMRegister S2 = xmm12; + const XMMRegister S3 = xmm13; + const XMMRegister S4 = xmm14; + const XMMRegister S5 = xmm15; + const XMMRegister S6 = xmm16; + const XMMRegister S7 = xmm17; + + // Variables for storing decrypted text + const XMMRegister B0 = xmm1; + const XMMRegister B1 = xmm2; + const XMMRegister B2 = xmm3; + const XMMRegister B3 = xmm4; + const XMMRegister B4 = xmm5; + const XMMRegister B5 = xmm6; + const XMMRegister B6 = xmm7; + const XMMRegister B7 = xmm8; + + __ cmpl(rounds, 44); + __ jcc(Assembler::greater, KEY_192); + __ jmp(Loop); + + __ BIND(KEY_192); + const XMMRegister RK11 = xmm27; + const XMMRegister RK12 = xmm28; + ev_load_key(RK11, key, 11*16, xmm_key_shuf_mask); + ev_load_key(RK12, key, 12*16, xmm_key_shuf_mask); + + __ cmpl(rounds, 52); + __ jcc(Assembler::greater, KEY_256); + __ jmp(Loop); + + __ BIND(KEY_256); + const XMMRegister RK13 = xmm29; + const XMMRegister RK14 = xmm31; + ev_load_key(RK13, key, 13*16, xmm_key_shuf_mask); + ev_load_key(RK14, key, 14*16, xmm_key_shuf_mask); + + __ BIND(Loop); + __ cmpl(len_reg, 512); + __ jcc(Assembler::below, Lcbc_dec_rem); + __ BIND(Loop1); + __ subl(len_reg, 512); + __ evmovdquq(S0, Address(from, 0 * 64), Assembler::AVX_512bit); + __ evmovdquq(S1, Address(from, 1 * 64), Assembler::AVX_512bit); + __ evmovdquq(S2, Address(from, 2 * 64), Assembler::AVX_512bit); + __ evmovdquq(S3, Address(from, 3 * 64), Assembler::AVX_512bit); + __ evmovdquq(S4, Address(from, 4 * 64), Assembler::AVX_512bit); + __ evmovdquq(S5, Address(from, 5 * 64), Assembler::AVX_512bit); + __ evmovdquq(S6, Address(from, 6 * 64), Assembler::AVX_512bit); + __ evmovdquq(S7, Address(from, 7 * 64), Assembler::AVX_512bit); + __ leaq(from, Address(from, 8 * 64)); + + __ evpxorq(B0, S0, RK1, Assembler::AVX_512bit); + __ evpxorq(B1, S1, RK1, Assembler::AVX_512bit); + __ evpxorq(B2, S2, RK1, Assembler::AVX_512bit); + __ evpxorq(B3, S3, RK1, Assembler::AVX_512bit); + __ evpxorq(B4, S4, RK1, Assembler::AVX_512bit); + __ evpxorq(B5, S5, RK1, Assembler::AVX_512bit); + __ evpxorq(B6, S6, RK1, Assembler::AVX_512bit); + __ evpxorq(B7, S7, RK1, Assembler::AVX_512bit); + + __ evalignq(IV, S0, IV, 0x06); + __ evalignq(S0, S1, S0, 0x06); + __ evalignq(S1, S2, S1, 0x06); + __ evalignq(S2, S3, S2, 0x06); + __ evalignq(S3, S4, S3, 0x06); + __ evalignq(S4, S5, S4, 0x06); + __ evalignq(S5, S6, S5, 0x06); + __ evalignq(S6, S7, S6, 0x06); + + roundDec(RK2); + roundDec(RK3); + roundDec(RK4); + roundDec(RK5); + roundDec(RK6); + roundDec(RK7); + roundDec(RK8); + roundDec(RK9); + roundDec(RK10); + + __ cmpl(rounds, 44); + __ jcc(Assembler::belowEqual, L_128); + roundDec(RK11); + roundDec(RK12); + + __ cmpl(rounds, 52); + __ jcc(Assembler::belowEqual, L_192); + roundDec(RK13); + roundDec(RK14); + + __ BIND(L_256); + roundDeclast(RK0); + __ jmp(Loop2); + + __ BIND(L_128); + roundDeclast(RK0); + __ jmp(Loop2); + + __ BIND(L_192); + roundDeclast(RK0); + + __ BIND(Loop2); + __ evpxorq(B0, B0, IV, Assembler::AVX_512bit); + __ evpxorq(B1, B1, S0, Assembler::AVX_512bit); + __ evpxorq(B2, B2, S1, Assembler::AVX_512bit); + __ evpxorq(B3, B3, S2, Assembler::AVX_512bit); + __ evpxorq(B4, B4, S3, Assembler::AVX_512bit); + __ evpxorq(B5, B5, S4, Assembler::AVX_512bit); + __ evpxorq(B6, B6, S5, Assembler::AVX_512bit); + __ evpxorq(B7, B7, S6, Assembler::AVX_512bit); + __ evmovdquq(IV, S7, Assembler::AVX_512bit); + + __ evmovdquq(Address(to, 0 * 64), B0, Assembler::AVX_512bit); + __ evmovdquq(Address(to, 1 * 64), B1, Assembler::AVX_512bit); + __ evmovdquq(Address(to, 2 * 64), B2, Assembler::AVX_512bit); + __ evmovdquq(Address(to, 3 * 64), B3, Assembler::AVX_512bit); + __ evmovdquq(Address(to, 4 * 64), B4, Assembler::AVX_512bit); + __ evmovdquq(Address(to, 5 * 64), B5, Assembler::AVX_512bit); + __ evmovdquq(Address(to, 6 * 64), B6, Assembler::AVX_512bit); + __ evmovdquq(Address(to, 7 * 64), B7, Assembler::AVX_512bit); + __ leaq(to, Address(to, 8 * 64)); + __ jmp(Loop); + + __ BIND(Lcbc_dec_rem); + __ evshufi64x2(IV, IV, IV, 0x03, Assembler::AVX_512bit); + + __ BIND(Lcbc_dec_rem_loop); + __ subl(len_reg, 16); + __ jcc(Assembler::carrySet, Lcbc_dec_ret); + + __ movdqu(S0, Address(from, 0)); + __ evpxorq(B0, S0, RK1, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK2, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK3, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK4, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK5, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK6, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK7, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK8, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK9, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK10, Assembler::AVX_512bit); + __ cmpl(rounds, 44); + __ jcc(Assembler::belowEqual, Lcbc_dec_rem_last); + + __ vaesdec(B0, B0, RK11, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK12, Assembler::AVX_512bit); + __ cmpl(rounds, 52); + __ jcc(Assembler::belowEqual, Lcbc_dec_rem_last); + + __ vaesdec(B0, B0, RK13, Assembler::AVX_512bit); + __ vaesdec(B0, B0, RK14, Assembler::AVX_512bit); + + __ BIND(Lcbc_dec_rem_last); + __ vaesdeclast(B0, B0, RK0, Assembler::AVX_512bit); + + __ evpxorq(B0, B0, IV, Assembler::AVX_512bit); + __ evmovdquq(IV, S0, Assembler::AVX_512bit); + __ movdqu(Address(to, 0), B0); + __ leaq(from, Address(from, 16)); + __ leaq(to, Address(to, 16)); + __ jmp(Lcbc_dec_rem_loop); + + __ BIND(Lcbc_dec_ret); + __ movdqu(Address(rvec, 0), IV); + + // Zero out the round keys + __ evpxorq(RK0, RK0, RK0, Assembler::AVX_512bit); + __ evpxorq(RK1, RK1, RK1, Assembler::AVX_512bit); + __ evpxorq(RK2, RK2, RK2, Assembler::AVX_512bit); + __ evpxorq(RK3, RK3, RK3, Assembler::AVX_512bit); + __ evpxorq(RK4, RK4, RK4, Assembler::AVX_512bit); + __ evpxorq(RK5, RK5, RK5, Assembler::AVX_512bit); + __ evpxorq(RK6, RK6, RK6, Assembler::AVX_512bit); + __ evpxorq(RK7, RK7, RK7, Assembler::AVX_512bit); + __ evpxorq(RK8, RK8, RK8, Assembler::AVX_512bit); + __ evpxorq(RK9, RK9, RK9, Assembler::AVX_512bit); + __ evpxorq(RK10, RK10, RK10, Assembler::AVX_512bit); + __ cmpl(rounds, 44); + __ jcc(Assembler::belowEqual, Lcbc_exit); + __ evpxorq(RK11, RK11, RK11, Assembler::AVX_512bit); + __ evpxorq(RK12, RK12, RK12, Assembler::AVX_512bit); + __ cmpl(rounds, 52); + __ jcc(Assembler::belowEqual, Lcbc_exit); + __ evpxorq(RK13, RK13, RK13, Assembler::AVX_512bit); + __ evpxorq(RK14, RK14, RK14, Assembler::AVX_512bit); + + __ BIND(Lcbc_exit); + __ pop(rbx); +#ifdef _WIN64 + __ movl(rax, len_mem); +#else + __ pop(rax); // return length +#endif + __ leave(); // required for proper stackwalking of RuntimeStub frame + __ ret(0); + return start; +} + // byte swap x86 long address generate_ghash_long_swap_mask() { __ align(CodeEntryAlignment); @@ -4241,6 +4547,408 @@ return start; } + //base64 character set + address base64_charset_addr() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "base64_charset"); + address start = __ pc(); + __ emit_data64(0x0000004200000041, relocInfo::none); + __ emit_data64(0x0000004400000043, relocInfo::none); + __ emit_data64(0x0000004600000045, relocInfo::none); + __ emit_data64(0x0000004800000047, relocInfo::none); + __ emit_data64(0x0000004a00000049, relocInfo::none); + __ emit_data64(0x0000004c0000004b, relocInfo::none); + __ emit_data64(0x0000004e0000004d, relocInfo::none); + __ emit_data64(0x000000500000004f, relocInfo::none); + __ emit_data64(0x0000005200000051, relocInfo::none); + __ emit_data64(0x0000005400000053, relocInfo::none); + __ emit_data64(0x0000005600000055, relocInfo::none); + __ emit_data64(0x0000005800000057, relocInfo::none); + __ emit_data64(0x0000005a00000059, relocInfo::none); + __ emit_data64(0x0000006200000061, relocInfo::none); + __ emit_data64(0x0000006400000063, relocInfo::none); + __ emit_data64(0x0000006600000065, relocInfo::none); + __ emit_data64(0x0000006800000067, relocInfo::none); + __ emit_data64(0x0000006a00000069, relocInfo::none); + __ emit_data64(0x0000006c0000006b, relocInfo::none); + __ emit_data64(0x0000006e0000006d, relocInfo::none); + __ emit_data64(0x000000700000006f, relocInfo::none); + __ emit_data64(0x0000007200000071, relocInfo::none); + __ emit_data64(0x0000007400000073, relocInfo::none); + __ emit_data64(0x0000007600000075, relocInfo::none); + __ emit_data64(0x0000007800000077, relocInfo::none); + __ emit_data64(0x0000007a00000079, relocInfo::none); + __ emit_data64(0x0000003100000030, relocInfo::none); + __ emit_data64(0x0000003300000032, relocInfo::none); + __ emit_data64(0x0000003500000034, relocInfo::none); + __ emit_data64(0x0000003700000036, relocInfo::none); + __ emit_data64(0x0000003900000038, relocInfo::none); + __ emit_data64(0x0000002f0000002b, relocInfo::none); + return start; + } + + //base64 url character set + address base64url_charset_addr() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "base64url_charset"); + address start = __ pc(); + __ emit_data64(0x0000004200000041, relocInfo::none); + __ emit_data64(0x0000004400000043, relocInfo::none); + __ emit_data64(0x0000004600000045, relocInfo::none); + __ emit_data64(0x0000004800000047, relocInfo::none); + __ emit_data64(0x0000004a00000049, relocInfo::none); + __ emit_data64(0x0000004c0000004b, relocInfo::none); + __ emit_data64(0x0000004e0000004d, relocInfo::none); + __ emit_data64(0x000000500000004f, relocInfo::none); + __ emit_data64(0x0000005200000051, relocInfo::none); + __ emit_data64(0x0000005400000053, relocInfo::none); + __ emit_data64(0x0000005600000055, relocInfo::none); + __ emit_data64(0x0000005800000057, relocInfo::none); + __ emit_data64(0x0000005a00000059, relocInfo::none); + __ emit_data64(0x0000006200000061, relocInfo::none); + __ emit_data64(0x0000006400000063, relocInfo::none); + __ emit_data64(0x0000006600000065, relocInfo::none); + __ emit_data64(0x0000006800000067, relocInfo::none); + __ emit_data64(0x0000006a00000069, relocInfo::none); + __ emit_data64(0x0000006c0000006b, relocInfo::none); + __ emit_data64(0x0000006e0000006d, relocInfo::none); + __ emit_data64(0x000000700000006f, relocInfo::none); + __ emit_data64(0x0000007200000071, relocInfo::none); + __ emit_data64(0x0000007400000073, relocInfo::none); + __ emit_data64(0x0000007600000075, relocInfo::none); + __ emit_data64(0x0000007800000077, relocInfo::none); + __ emit_data64(0x0000007a00000079, relocInfo::none); + __ emit_data64(0x0000003100000030, relocInfo::none); + __ emit_data64(0x0000003300000032, relocInfo::none); + __ emit_data64(0x0000003500000034, relocInfo::none); + __ emit_data64(0x0000003700000036, relocInfo::none); + __ emit_data64(0x0000003900000038, relocInfo::none); + __ emit_data64(0x0000005f0000002d, relocInfo::none); + + return start; + } + + address base64_bswap_mask_addr() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "bswap_mask_base64"); + address start = __ pc(); + __ emit_data64(0x0504038002010080, relocInfo::none); + __ emit_data64(0x0b0a098008070680, relocInfo::none); + __ emit_data64(0x0908078006050480, relocInfo::none); + __ emit_data64(0x0f0e0d800c0b0a80, relocInfo::none); + __ emit_data64(0x0605048003020180, relocInfo::none); + __ emit_data64(0x0c0b0a8009080780, relocInfo::none); + __ emit_data64(0x0504038002010080, relocInfo::none); + __ emit_data64(0x0b0a098008070680, relocInfo::none); + + return start; + } + + address base64_right_shift_mask_addr() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "right_shift_mask"); + address start = __ pc(); + __ emit_data64(0x0006000400020000, relocInfo::none); + __ emit_data64(0x0006000400020000, relocInfo::none); + __ emit_data64(0x0006000400020000, relocInfo::none); + __ emit_data64(0x0006000400020000, relocInfo::none); + __ emit_data64(0x0006000400020000, relocInfo::none); + __ emit_data64(0x0006000400020000, relocInfo::none); + __ emit_data64(0x0006000400020000, relocInfo::none); + __ emit_data64(0x0006000400020000, relocInfo::none); + + return start; + } + + address base64_left_shift_mask_addr() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "left_shift_mask"); + address start = __ pc(); + __ emit_data64(0x0000000200040000, relocInfo::none); + __ emit_data64(0x0000000200040000, relocInfo::none); + __ emit_data64(0x0000000200040000, relocInfo::none); + __ emit_data64(0x0000000200040000, relocInfo::none); + __ emit_data64(0x0000000200040000, relocInfo::none); + __ emit_data64(0x0000000200040000, relocInfo::none); + __ emit_data64(0x0000000200040000, relocInfo::none); + __ emit_data64(0x0000000200040000, relocInfo::none); + + return start; + } + + address base64_and_mask_addr() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "and_mask"); + address start = __ pc(); + __ emit_data64(0x3f003f003f000000, relocInfo::none); + __ emit_data64(0x3f003f003f000000, relocInfo::none); + __ emit_data64(0x3f003f003f000000, relocInfo::none); + __ emit_data64(0x3f003f003f000000, relocInfo::none); + __ emit_data64(0x3f003f003f000000, relocInfo::none); + __ emit_data64(0x3f003f003f000000, relocInfo::none); + __ emit_data64(0x3f003f003f000000, relocInfo::none); + __ emit_data64(0x3f003f003f000000, relocInfo::none); + return start; + } + + address base64_gather_mask_addr() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "gather_mask"); + address start = __ pc(); + __ emit_data64(0xffffffffffffffff, relocInfo::none); + return start; + } + +// Code for generating Base64 encoding. +// Intrinsic function prototype in Base64.java: +// private void encodeBlock(byte[] src, int sp, int sl, byte[] dst, int dp, boolean isURL) { + address generate_base64_encodeBlock() { + __ align(CodeEntryAlignment); + StubCodeMark mark(this, "StubRoutines", "implEncode"); + address start = __ pc(); + __ enter(); + + // Save callee-saved registers before using them + __ push(r12); + __ push(r13); + __ push(r14); + __ push(r15); + __ push(rbx); + + // arguments + const Register source = c_rarg0; // Source Array + const Register start_offset = c_rarg1; // start offset + const Register end_offset = c_rarg2; // end offset + const Register dest = c_rarg3; // destination array + +#ifndef _WIN64 + const Register dp = c_rarg4; // Position for writing to dest array + const Register isURL = c_rarg5;// Base64 or URL character set +#else + const Address dp_mem(rbp, 6 * wordSize); // length is on stack on Win64 + const Address isURL_mem(rbp, 7 * wordSize); + const Register isURL = r10; // pick the volatile windows register + const Register dp = r12; + __ movl(dp, dp_mem); + __ movl(isURL, isURL_mem); +#endif + + const Register length = r14; + Label L_process80, L_process32, L_process3, L_exit, L_processdata; + + // calculate length from offsets + __ movl(length, end_offset); + __ subl(length, start_offset); + __ cmpl(length, 0); + __ jcc(Assembler::lessEqual, L_exit); + + // Save k1 value in rbx + __ kmovql(rbx, k1); + __ lea(r11, ExternalAddress(StubRoutines::x86::base64_charset_addr())); + // check if base64 charset(isURL=0) or base64 url charset(isURL=1) needs to be loaded + __ cmpl(isURL, 0); + __ jcc(Assembler::equal, L_processdata); + __ lea(r11, ExternalAddress(StubRoutines::x86::base64url_charset_addr())); + + // load masks required for encoding data + __ BIND(L_processdata); + __ movdqu(xmm16, ExternalAddress(StubRoutines::x86::base64_gather_mask_addr())); + // Set 64 bits of K register. + __ evpcmpeqb(k1, xmm16, xmm16, Assembler::AVX_512bit); + __ evmovdquq(xmm12, ExternalAddress(StubRoutines::x86::base64_bswap_mask_addr()), Assembler::AVX_256bit, r13); + __ evmovdquq(xmm13, ExternalAddress(StubRoutines::x86::base64_right_shift_mask_addr()), Assembler::AVX_512bit, r13); + __ evmovdquq(xmm14, ExternalAddress(StubRoutines::x86::base64_left_shift_mask_addr()), Assembler::AVX_512bit, r13); + __ evmovdquq(xmm15, ExternalAddress(StubRoutines::x86::base64_and_mask_addr()), Assembler::AVX_512bit, r13); + + // Vector Base64 implementation, producing 96 bytes of encoded data + __ BIND(L_process80); + __ cmpl(length, 80); + __ jcc(Assembler::below, L_process32); + __ evmovdquq(xmm0, Address(source, start_offset, Address::times_1, 0), Assembler::AVX_256bit); + __ evmovdquq(xmm1, Address(source, start_offset, Address::times_1, 24), Assembler::AVX_256bit); + __ evmovdquq(xmm2, Address(source, start_offset, Address::times_1, 48), Assembler::AVX_256bit); + + //permute the input data in such a manner that we have continuity of the source + __ vpermq(xmm3, xmm0, 148, Assembler::AVX_256bit); + __ vpermq(xmm4, xmm1, 148, Assembler::AVX_256bit); + __ vpermq(xmm5, xmm2, 148, Assembler::AVX_256bit); + + //shuffle input and group 3 bytes of data and to it add 0 as the 4th byte. + //we can deal with 12 bytes at a time in a 128 bit register + __ vpshufb(xmm3, xmm3, xmm12, Assembler::AVX_256bit); + __ vpshufb(xmm4, xmm4, xmm12, Assembler::AVX_256bit); + __ vpshufb(xmm5, xmm5, xmm12, Assembler::AVX_256bit); + + //convert byte to word. Each 128 bit register will have 6 bytes for processing + __ vpmovzxbw(xmm3, xmm3, Assembler::AVX_512bit); + __ vpmovzxbw(xmm4, xmm4, Assembler::AVX_512bit); + __ vpmovzxbw(xmm5, xmm5, Assembler::AVX_512bit); + + // Extract bits in the following pattern 6, 4+2, 2+4, 6 to convert 3, 8 bit numbers to 4, 6 bit numbers + __ evpsrlvw(xmm0, xmm3, xmm13, Assembler::AVX_512bit); + __ evpsrlvw(xmm1, xmm4, xmm13, Assembler::AVX_512bit); + __ evpsrlvw(xmm2, xmm5, xmm13, Assembler::AVX_512bit); + + __ evpsllvw(xmm3, xmm3, xmm14, Assembler::AVX_512bit); + __ evpsllvw(xmm4, xmm4, xmm14, Assembler::AVX_512bit); + __ evpsllvw(xmm5, xmm5, xmm14, Assembler::AVX_512bit); + + __ vpsrlq(xmm0, xmm0, 8, Assembler::AVX_512bit); + __ vpsrlq(xmm1, xmm1, 8, Assembler::AVX_512bit); + __ vpsrlq(xmm2, xmm2, 8, Assembler::AVX_512bit); + + __ vpsllq(xmm3, xmm3, 8, Assembler::AVX_512bit); + __ vpsllq(xmm4, xmm4, 8, Assembler::AVX_512bit); + __ vpsllq(xmm5, xmm5, 8, Assembler::AVX_512bit); + + __ vpandq(xmm3, xmm3, xmm15, Assembler::AVX_512bit); + __ vpandq(xmm4, xmm4, xmm15, Assembler::AVX_512bit); + __ vpandq(xmm5, xmm5, xmm15, Assembler::AVX_512bit); + + // Get the final 4*6 bits base64 encoding + __ vporq(xmm3, xmm3, xmm0, Assembler::AVX_512bit); + __ vporq(xmm4, xmm4, xmm1, Assembler::AVX_512bit); + __ vporq(xmm5, xmm5, xmm2, Assembler::AVX_512bit); + + // Shift + __ vpsrlq(xmm3, xmm3, 8, Assembler::AVX_512bit); + __ vpsrlq(xmm4, xmm4, 8, Assembler::AVX_512bit); + __ vpsrlq(xmm5, xmm5, 8, Assembler::AVX_512bit); + + // look up 6 bits in the base64 character set to fetch the encoding + // we are converting word to dword as gather instructions need dword indices for looking up encoding + __ vextracti64x4(xmm6, xmm3, 0); + __ vpmovzxwd(xmm0, xmm6, Assembler::AVX_512bit); + __ vextracti64x4(xmm6, xmm3, 1); + __ vpmovzxwd(xmm1, xmm6, Assembler::AVX_512bit); + + __ vextracti64x4(xmm6, xmm4, 0); + __ vpmovzxwd(xmm2, xmm6, Assembler::AVX_512bit); + __ vextracti64x4(xmm6, xmm4, 1); + __ vpmovzxwd(xmm3, xmm6, Assembler::AVX_512bit); + + __ vextracti64x4(xmm4, xmm5, 0); + __ vpmovzxwd(xmm6, xmm4, Assembler::AVX_512bit); + + __ vextracti64x4(xmm4, xmm5, 1); + __ vpmovzxwd(xmm7, xmm4, Assembler::AVX_512bit); + + __ kmovql(k2, k1); + __ evpgatherdd(xmm4, k2, Address(r11, xmm0, Address::times_4, 0), Assembler::AVX_512bit); + __ kmovql(k2, k1); + __ evpgatherdd(xmm5, k2, Address(r11, xmm1, Address::times_4, 0), Assembler::AVX_512bit); + __ kmovql(k2, k1); + __ evpgatherdd(xmm8, k2, Address(r11, xmm2, Address::times_4, 0), Assembler::AVX_512bit); + __ kmovql(k2, k1); + __ evpgatherdd(xmm9, k2, Address(r11, xmm3, Address::times_4, 0), Assembler::AVX_512bit); + __ kmovql(k2, k1); + __ evpgatherdd(xmm10, k2, Address(r11, xmm6, Address::times_4, 0), Assembler::AVX_512bit); + __ kmovql(k2, k1); + __ evpgatherdd(xmm11, k2, Address(r11, xmm7, Address::times_4, 0), Assembler::AVX_512bit); + + //Down convert dword to byte. Final output is 16*6 = 96 bytes long + __ evpmovdb(Address(dest, dp, Address::times_1, 0), xmm4, Assembler::AVX_512bit); + __ evpmovdb(Address(dest, dp, Address::times_1, 16), xmm5, Assembler::AVX_512bit); + __ evpmovdb(Address(dest, dp, Address::times_1, 32), xmm8, Assembler::AVX_512bit); + __ evpmovdb(Address(dest, dp, Address::times_1, 48), xmm9, Assembler::AVX_512bit); + __ evpmovdb(Address(dest, dp, Address::times_1, 64), xmm10, Assembler::AVX_512bit); + __ evpmovdb(Address(dest, dp, Address::times_1, 80), xmm11, Assembler::AVX_512bit); + + __ addq(dest, 96); + __ addq(source, 72); + __ subq(length, 72); + __ jmp(L_process80); + + // Vector Base64 implementation generating 32 bytes of encoded data + __ BIND(L_process32); + __ cmpl(length, 32); + __ jcc(Assembler::below, L_process3); + __ evmovdquq(xmm0, Address(source, start_offset), Assembler::AVX_256bit); + __ vpermq(xmm0, xmm0, 148, Assembler::AVX_256bit); + __ vpshufb(xmm6, xmm0, xmm12, Assembler::AVX_256bit); + __ vpmovzxbw(xmm6, xmm6, Assembler::AVX_512bit); + __ evpsrlvw(xmm2, xmm6, xmm13, Assembler::AVX_512bit); + __ evpsllvw(xmm3, xmm6, xmm14, Assembler::AVX_512bit); + + __ vpsrlq(xmm2, xmm2, 8, Assembler::AVX_512bit); + __ vpsllq(xmm3, xmm3, 8, Assembler::AVX_512bit); + __ vpandq(xmm3, xmm3, xmm15, Assembler::AVX_512bit); + __ vporq(xmm1, xmm2, xmm3, Assembler::AVX_512bit); + __ vpsrlq(xmm1, xmm1, 8, Assembler::AVX_512bit); + __ vextracti64x4(xmm9, xmm1, 0); + __ vpmovzxwd(xmm6, xmm9, Assembler::AVX_512bit); + __ vextracti64x4(xmm9, xmm1, 1); + __ vpmovzxwd(xmm5, xmm9, Assembler::AVX_512bit); + __ kmovql(k2, k1); + __ evpgatherdd(xmm8, k2, Address(r11, xmm6, Address::times_4, 0), Assembler::AVX_512bit); + __ kmovql(k2, k1); + __ evpgatherdd(xmm10, k2, Address(r11, xmm5, Address::times_4, 0), Assembler::AVX_512bit); + __ evpmovdb(Address(dest, dp, Address::times_1, 0), xmm8, Assembler::AVX_512bit); + __ evpmovdb(Address(dest, dp, Address::times_1, 16), xmm10, Assembler::AVX_512bit); + __ subq(length, 24); + __ addq(dest, 32); + __ addq(source, 24); + __ jmp(L_process32); + + // Scalar data processing takes 3 bytes at a time and produces 4 bytes of encoded data + /* This code corresponds to the scalar version of the following snippet in Base64.java + ** int bits = (src[sp0++] & 0xff) << 16 |(src[sp0++] & 0xff) << 8 |(src[sp0++] & 0xff); + ** dst[dp0++] = (byte)base64[(bits >> > 18) & 0x3f]; + ** dst[dp0++] = (byte)base64[(bits >> > 12) & 0x3f]; + ** dst[dp0++] = (byte)base64[(bits >> > 6) & 0x3f]; + ** dst[dp0++] = (byte)base64[bits & 0x3f];*/ + __ BIND(L_process3); + __ cmpl(length, 3); + __ jcc(Assembler::below, L_exit); + // Read 1 byte at a time + __ movzbl(rax, Address(source, start_offset)); + __ shll(rax, 0x10); + __ movl(r15, rax); + __ movzbl(rax, Address(source, start_offset, Address::times_1, 1)); + __ shll(rax, 0x8); + __ movzwl(rax, rax); + __ orl(r15, rax); + __ movzbl(rax, Address(source, start_offset, Address::times_1, 2)); + __ orl(rax, r15); + // Save 3 bytes read in r15 + __ movl(r15, rax); + __ shrl(rax, 0x12); + __ andl(rax, 0x3f); + // rax contains the index, r11 contains base64 lookup table + __ movb(rax, Address(r11, rax, Address::times_4)); + // Write the encoded byte to destination + __ movb(Address(dest, dp, Address::times_1, 0), rax); + __ movl(rax, r15); + __ shrl(rax, 0xc); + __ andl(rax, 0x3f); + __ movb(rax, Address(r11, rax, Address::times_4)); + __ movb(Address(dest, dp, Address::times_1, 1), rax); + __ movl(rax, r15); + __ shrl(rax, 0x6); + __ andl(rax, 0x3f); + __ movb(rax, Address(r11, rax, Address::times_4)); + __ movb(Address(dest, dp, Address::times_1, 2), rax); + __ movl(rax, r15); + __ andl(rax, 0x3f); + __ movb(rax, Address(r11, rax, Address::times_4)); + __ movb(Address(dest, dp, Address::times_1, 3), rax); + __ subl(length, 3); + __ addq(dest, 4); + __ addq(source, 3); + __ jmp(L_process3); + __ BIND(L_exit); + // restore k1 register value + __ kmovql(k1, rbx); + __ pop(rbx); + __ pop(r15); + __ pop(r14); + __ pop(r13); + __ pop(r12); + __ leave(); + __ ret(0); + return start; + } + /** * Arguments: * @@ -5078,7 +5786,11 @@ StubRoutines::_aescrypt_encryptBlock = generate_aescrypt_encryptBlock(); StubRoutines::_aescrypt_decryptBlock = generate_aescrypt_decryptBlock(); StubRoutines::_cipherBlockChaining_encryptAESCrypt = generate_cipherBlockChaining_encryptAESCrypt(); - StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel(); + if (VM_Version::supports_vaes() && VM_Version::supports_avx512vl() && VM_Version::supports_avx512dq() ) { + StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptVectorAESCrypt(); + } else { + StubRoutines::_cipherBlockChaining_decryptAESCrypt = generate_cipherBlockChaining_decryptAESCrypt_Parallel(); + } } if (UseAESCTRIntrinsics){ StubRoutines::x86::_counter_shuffle_mask_addr = generate_counter_shuffle_mask(); @@ -5118,6 +5830,17 @@ StubRoutines::_ghash_processBlocks = generate_ghash_processBlocks(); } + if (UseBASE64Intrinsics) { + StubRoutines::x86::_and_mask = base64_and_mask_addr(); + StubRoutines::x86::_bswap_mask = base64_bswap_mask_addr(); + StubRoutines::x86::_base64_charset = base64_charset_addr(); + StubRoutines::x86::_url_charset = base64url_charset_addr(); + StubRoutines::x86::_gather_mask = base64_gather_mask_addr(); + StubRoutines::x86::_left_shift_mask = base64_left_shift_mask_addr(); + StubRoutines::x86::_right_shift_mask = base64_right_shift_mask_addr(); + StubRoutines::_base64_encodeBlock = generate_base64_encodeBlock(); + } + // Safefetch stubs. generate_safefetch("SafeFetch32", sizeof(int), &StubRoutines::_safefetch32_entry, &StubRoutines::_safefetch32_fault_pc, diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/stubRoutines_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/stubRoutines_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/stubRoutines_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/stubRoutines_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -45,6 +45,15 @@ address StubRoutines::x86::_k256_W_adr = NULL; address StubRoutines::x86::_k512_W_addr = NULL; address StubRoutines::x86::_pshuffle_byte_flip_mask_addr_sha512 = NULL; +// Base64 masks +address StubRoutines::x86::_bswap_mask = NULL; +address StubRoutines::x86::_base64_charset = NULL; +address StubRoutines::x86::_gather_mask = NULL; +address StubRoutines::x86::_right_shift_mask = NULL; +address StubRoutines::x86::_left_shift_mask = NULL; +address StubRoutines::x86::_and_mask = NULL; +address StubRoutines::x86::_url_charset = NULL; + #endif address StubRoutines::x86::_pshuffle_byte_flip_mask_addr = NULL; diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/stubRoutines_x86.hpp openjdk-11-11~24/src/hotspot/cpu/x86/stubRoutines_x86.hpp --- openjdk-11-11~19/src/hotspot/cpu/x86/stubRoutines_x86.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/stubRoutines_x86.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -138,6 +138,14 @@ static address _k512_W_addr; // byte flip mask for sha512 static address _pshuffle_byte_flip_mask_addr_sha512; + // Masks for base64 + static address _base64_charset; + static address _bswap_mask; + static address _gather_mask; + static address _right_shift_mask; + static address _left_shift_mask; + static address _and_mask; + static address _url_charset; #endif // byte flip mask for sha256 static address _pshuffle_byte_flip_mask_addr; @@ -198,6 +206,13 @@ static address k256_W_addr() { return _k256_W_adr; } static address k512_W_addr() { return _k512_W_addr; } static address pshuffle_byte_flip_mask_addr_sha512() { return _pshuffle_byte_flip_mask_addr_sha512; } + static address base64_charset_addr() { return _base64_charset; } + static address base64url_charset_addr() { return _url_charset; } + static address base64_bswap_mask_addr() { return _bswap_mask; } + static address base64_gather_mask_addr() { return _gather_mask; } + static address base64_right_shift_mask_addr() { return _right_shift_mask; } + static address base64_left_shift_mask_addr() { return _left_shift_mask; } + static address base64_and_mask_addr() { return _and_mask; } #endif static address pshuffle_byte_flip_mask_addr() { return _pshuffle_byte_flip_mask_addr; } static void generate_CRC32C_table(bool is_pclmulqdq_supported); diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/templateTable_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/templateTable_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/templateTable_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/templateTable_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -770,7 +770,7 @@ // rax: index // rdx: array index_check(rdx, rax); // kills rbx - __ access_load_at(T_INT, IN_HEAP | IN_HEAP_ARRAY, rax, + __ access_load_at(T_INT, IN_HEAP | IS_ARRAY, rax, Address(rdx, rax, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_INT)), noreg, noreg); @@ -783,7 +783,7 @@ index_check(rdx, rax); // kills rbx NOT_LP64(__ mov(rbx, rax)); // rbx,: index - __ access_load_at(T_LONG, IN_HEAP | IN_HEAP_ARRAY, noreg /* ltos */, + __ access_load_at(T_LONG, IN_HEAP | IS_ARRAY, noreg /* ltos */, Address(rdx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG)), noreg, noreg); @@ -796,7 +796,7 @@ // rax: index // rdx: array index_check(rdx, rax); // kills rbx - __ access_load_at(T_FLOAT, IN_HEAP | IN_HEAP_ARRAY, noreg /* ftos */, + __ access_load_at(T_FLOAT, IN_HEAP | IS_ARRAY, noreg /* ftos */, Address(rdx, rax, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_FLOAT)), @@ -808,7 +808,7 @@ // rax: index // rdx: array index_check(rdx, rax); // kills rbx - __ access_load_at(T_DOUBLE, IN_HEAP | IN_HEAP_ARRAY, noreg /* dtos */, + __ access_load_at(T_DOUBLE, IN_HEAP | IS_ARRAY, noreg /* dtos */, Address(rdx, rax, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_DOUBLE)), @@ -825,7 +825,7 @@ UseCompressedOops ? Address::times_4 : Address::times_ptr, arrayOopDesc::base_offset_in_bytes(T_OBJECT)), rax, - IN_HEAP_ARRAY); + IS_ARRAY); } void TemplateTable::baload() { @@ -833,7 +833,7 @@ // rax: index // rdx: array index_check(rdx, rax); // kills rbx - __ access_load_at(T_BYTE, IN_HEAP | IN_HEAP_ARRAY, rax, + __ access_load_at(T_BYTE, IN_HEAP | IS_ARRAY, rax, Address(rdx, rax, Address::times_1, arrayOopDesc::base_offset_in_bytes(T_BYTE)), noreg, noreg); } @@ -843,7 +843,7 @@ // rax: index // rdx: array index_check(rdx, rax); // kills rbx - __ access_load_at(T_CHAR, IN_HEAP | IN_HEAP_ARRAY, rax, + __ access_load_at(T_CHAR, IN_HEAP | IS_ARRAY, rax, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)), noreg, noreg); } @@ -858,7 +858,7 @@ // rax: index // rdx: array index_check(rdx, rax); // kills rbx - __ access_load_at(T_CHAR, IN_HEAP | IN_HEAP_ARRAY, rax, + __ access_load_at(T_CHAR, IN_HEAP | IS_ARRAY, rax, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)), noreg, noreg); } @@ -869,7 +869,7 @@ // rax: index // rdx: array index_check(rdx, rax); // kills rbx - __ access_load_at(T_SHORT, IN_HEAP | IN_HEAP_ARRAY, rax, + __ access_load_at(T_SHORT, IN_HEAP | IS_ARRAY, rax, Address(rdx, rax, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_SHORT)), noreg, noreg); } @@ -1063,7 +1063,7 @@ // rbx: index // rdx: array index_check(rdx, rbx); // prefer index in rbx - __ access_store_at(T_INT, IN_HEAP | IN_HEAP_ARRAY, + __ access_store_at(T_INT, IN_HEAP | IS_ARRAY, Address(rdx, rbx, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_INT)), rax, noreg, noreg); @@ -1077,7 +1077,7 @@ // rdx: high(value) index_check(rcx, rbx); // prefer index in rbx, // rbx,: index - __ access_store_at(T_LONG, IN_HEAP | IN_HEAP_ARRAY, + __ access_store_at(T_LONG, IN_HEAP | IS_ARRAY, Address(rcx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_LONG)), noreg /* ltos */, noreg, noreg); @@ -1091,7 +1091,7 @@ // rbx: index // rdx: array index_check(rdx, rbx); // prefer index in rbx - __ access_store_at(T_FLOAT, IN_HEAP | IN_HEAP_ARRAY, + __ access_store_at(T_FLOAT, IN_HEAP | IS_ARRAY, Address(rdx, rbx, Address::times_4, arrayOopDesc::base_offset_in_bytes(T_FLOAT)), noreg /* ftos */, noreg, noreg); @@ -1104,7 +1104,7 @@ // rbx: index // rdx: array index_check(rdx, rbx); // prefer index in rbx - __ access_store_at(T_DOUBLE, IN_HEAP | IN_HEAP_ARRAY, + __ access_store_at(T_DOUBLE, IN_HEAP | IS_ARRAY, Address(rdx, rbx, Address::times_8, arrayOopDesc::base_offset_in_bytes(T_DOUBLE)), noreg /* dtos */, noreg, noreg); @@ -1148,7 +1148,7 @@ __ movptr(rax, at_tos()); __ movl(rcx, at_tos_p1()); // index // Now store using the appropriate barrier - do_oop_store(_masm, element_address, rax, IN_HEAP_ARRAY); + do_oop_store(_masm, element_address, rax, IS_ARRAY); __ jmp(done); // Have a NULL in rax, rdx=array, ecx=index. Store NULL at ary[idx] @@ -1156,7 +1156,7 @@ __ profile_null_seen(rbx); // Store a NULL - do_oop_store(_masm, element_address, noreg, IN_HEAP_ARRAY); + do_oop_store(_masm, element_address, noreg, IS_ARRAY); // Pop stack arguments __ bind(done); @@ -1180,7 +1180,7 @@ __ jccb(Assembler::zero, L_skip); __ andl(rax, 1); // if it is a T_BOOLEAN array, mask the stored value to 0/1 __ bind(L_skip); - __ access_store_at(T_BYTE, IN_HEAP | IN_HEAP_ARRAY, + __ access_store_at(T_BYTE, IN_HEAP | IS_ARRAY, Address(rdx, rbx,Address::times_1, arrayOopDesc::base_offset_in_bytes(T_BYTE)), rax, noreg, noreg); @@ -1193,7 +1193,7 @@ // rbx: index // rdx: array index_check(rdx, rbx); // prefer index in rbx - __ access_store_at(T_CHAR, IN_HEAP | IN_HEAP_ARRAY, + __ access_store_at(T_CHAR, IN_HEAP | IS_ARRAY, Address(rdx, rbx, Address::times_2, arrayOopDesc::base_offset_in_bytes(T_CHAR)), rax, noreg, noreg); @@ -3792,30 +3792,61 @@ prepare_invoke(byte_no, rax, rbx, // get f1 Klass*, f2 Method* rcx, rdx); // recv, flags - // rax: reference klass (from f1) + // rax: reference klass (from f1) if interface method // rbx: method (from f2) // rcx: receiver // rdx: flags + // First check for Object case, then private interface method, + // then regular interface method. + // Special case of invokeinterface called for virtual method of - // java.lang.Object. See cpCacheOop.cpp for details. - // This code isn't produced by javac, but could be produced by - // another compliant java compiler. - Label notMethod; + // java.lang.Object. See cpCache.cpp for details. + Label notObjectMethod; __ movl(rlocals, rdx); __ andl(rlocals, (1 << ConstantPoolCacheEntry::is_forced_virtual_shift)); + __ jcc(Assembler::zero, notObjectMethod); + invokevirtual_helper(rbx, rcx, rdx); + // no return from above + __ bind(notObjectMethod); - __ jcc(Assembler::zero, notMethod); + Label no_such_interface; // for receiver subtype check + Register recvKlass; // used for exception processing - invokevirtual_helper(rbx, rcx, rdx); - __ bind(notMethod); + // Check for private method invocation - indicated by vfinal + Label notVFinal; + __ movl(rlocals, rdx); + __ andl(rlocals, (1 << ConstantPoolCacheEntry::is_vfinal_shift)); + __ jcc(Assembler::zero, notVFinal); + + // Get receiver klass into rlocals - also a null check + __ null_check(rcx, oopDesc::klass_offset_in_bytes()); + __ load_klass(rlocals, rcx); + + Label subtype; + __ check_klass_subtype(rlocals, rax, rbcp, subtype); + // If we get here the typecheck failed + recvKlass = rdx; + __ mov(recvKlass, rlocals); // shuffle receiver class for exception use + __ jmp(no_such_interface); + + __ bind(subtype); + + // do the call - rbx is actually the method to call + + __ profile_final_call(rdx); + __ profile_arguments_type(rdx, rbx, rbcp, true); + + __ jump_from_interpreted(rbx, rdx); + // no return from above + __ bind(notVFinal); // Get receiver klass into rdx - also a null check __ restore_locals(); // restore r14 __ null_check(rcx, oopDesc::klass_offset_in_bytes()); __ load_klass(rdx, rcx); - Label no_such_interface, no_such_method; + Label no_such_method; // Preserve method for throw_AbstractMethodErrorVerbose. __ mov(rcx, rbx); @@ -3877,12 +3908,12 @@ __ restore_locals(); // make sure locals pointer is correct as well (was destroyed) // Pass arguments for generating a verbose error message. #ifdef _LP64 - Register recvKlass = c_rarg1; + recvKlass = c_rarg1; Register method = c_rarg2; if (recvKlass != rdx) { __ movq(recvKlass, rdx); } if (method != rcx) { __ movq(method, rcx); } #else - Register recvKlass = rdx; + recvKlass = rdx; Register method = rcx; #endif __ call_VM(noreg, CAST_FROM_FN_PTR(address, InterpreterRuntime::throw_AbstractMethodErrorVerbose), @@ -4013,7 +4044,7 @@ #endif // _LP64 if (UseTLAB) { - __ tlab_allocate(rax, rdx, 0, rcx, rbx, slow_case); + __ tlab_allocate(thread, rax, rdx, 0, rcx, rbx, slow_case); if (ZeroTLAB) { // the fields have been already cleared __ jmp(initialize_header); @@ -4025,10 +4056,7 @@ // Allocation in the shared Eden, if allowed. // // rdx: instance size in bytes - if (allow_shared_alloc) { - __ eden_allocate(rax, rdx, 0, rbx, slow_case); - __ incr_allocated_bytes(thread, rdx, 0); - } + __ eden_allocate(thread, rax, rdx, 0, rbx, slow_case); } // If UseTLAB or allow_shared_alloc are true, the object is created above and diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/vm_version_ext_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/vm_version_ext_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/vm_version_ext_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/vm_version_ext_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -470,8 +470,8 @@ } size_t VM_Version_Ext::cpu_write_support_string(char* const buf, size_t buf_len) { - assert(buf != NULL, "buffer is NULL!"); - assert(buf_len > 0, "buffer len not enough!"); + guarantee(buf != NULL, "buffer is NULL!"); + guarantee(buf_len > 0, "buffer len not enough!"); unsigned int flag = 0; unsigned int fi = 0; @@ -481,8 +481,7 @@ #define WRITE_TO_BUF(string) \ { \ int res = jio_snprintf(&buf[written], buf_len - written, "%s%s", prefix, string); \ - if (res < 0 || (size_t) res >= buf_len - 1) { \ - buf[buf_len-1] = '\0'; \ + if (res < 0) { \ return buf_len - 1; \ } \ written += res; \ @@ -592,7 +591,7 @@ _cpuid_info.ext_cpuid1_edx); if (outputLen < 0 || (size_t) outputLen >= buf_len - 1) { - buf[buf_len-1] = '\0'; + if (buf_len > 0) { buf[buf_len-1] = '\0'; } return OS_ERR; } diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/vm_version_ext_x86.hpp openjdk-11-11~24/src/hotspot/cpu/x86/vm_version_ext_x86.hpp --- openjdk-11-11~19/src/hotspot/cpu/x86/vm_version_ext_x86.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/vm_version_ext_x86.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -63,6 +63,7 @@ static bool cpu_is_em64t(void); static bool is_netburst(void); + // Returns bytes written excluding termninating null byte. static size_t cpu_write_support_string(char* const buf, size_t buf_len); static void resolve_cpu_information_details(void); static jlong max_qualified_cpu_freq_from_brand_string(void); diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/vm_version_x86.cpp openjdk-11-11~24/src/hotspot/cpu/x86/vm_version_x86.cpp --- openjdk-11-11~19/src/hotspot/cpu/x86/vm_version_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/vm_version_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -666,6 +666,7 @@ _features &= ~CPU_AVX512VL; _features &= ~CPU_AVX512_VPOPCNTDQ; _features &= ~CPU_VPCLMULQDQ; + _features &= ~CPU_VAES; } if (UseAVX < 2) @@ -855,6 +856,17 @@ FLAG_SET_DEFAULT(UseGHASHIntrinsics, false); } + // Base64 Intrinsics (Check the condition for which the intrinsic will be active) + if ((UseAVX > 2) && supports_avx512vl() && supports_avx512bw()) { + if (FLAG_IS_DEFAULT(UseBASE64Intrinsics)) { + UseBASE64Intrinsics = true; + } + } else if (UseBASE64Intrinsics) { + if (!FLAG_IS_DEFAULT(UseBASE64Intrinsics)) + warning("Base64 intrinsic requires EVEX instructions on this CPU"); + FLAG_SET_DEFAULT(UseBASE64Intrinsics, false); + } + if (supports_fma() && UseSSE >= 2) { // Check UseSSE since FMA code uses SSE instructions if (FLAG_IS_DEFAULT(UseFMA)) { UseFMA = true; diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/vm_version_x86.hpp openjdk-11-11~24/src/hotspot/cpu/x86/vm_version_x86.hpp --- openjdk-11-11~19/src/hotspot/cpu/x86/vm_version_x86.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/vm_version_x86.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -335,6 +335,7 @@ #define CPU_VZEROUPPER ((uint64_t)UCONST64(0x1000000000)) // Vzeroupper instruction #define CPU_AVX512_VPOPCNTDQ ((uint64_t)UCONST64(0x2000000000)) // Vector popcount #define CPU_VPCLMULQDQ ((uint64_t)UCONST64(0x4000000000)) //Vector carryless multiplication +#define CPU_VAES ((uint64_t)UCONST64(0x8000000000)) // Vector AES instructions enum Extended_Family { // AMD @@ -545,6 +546,8 @@ result |= CPU_AVX512_VPOPCNTDQ; if (_cpuid_info.sef_cpuid7_ecx.bits.vpclmulqdq != 0) result |= CPU_VPCLMULQDQ; + if (_cpuid_info.sef_cpuid7_ecx.bits.vaes != 0) + result |= CPU_VAES; } } if(_cpuid_info.sef_cpuid7_ebx.bits.bmi1 != 0) @@ -823,6 +826,7 @@ static bool supports_vzeroupper() { return (_features & CPU_VZEROUPPER) != 0; } static bool supports_vpopcntdq() { return (_features & CPU_AVX512_VPOPCNTDQ) != 0; } static bool supports_vpclmulqdq() { return (_features & CPU_VPCLMULQDQ) != 0; } + static bool supports_vaes() { return (_features & CPU_VAES) != 0; } // Intel features static bool is_intel_family_core() { return is_intel() && diff -Nru openjdk-11-11~19/src/hotspot/cpu/x86/x86.ad openjdk-11-11~24/src/hotspot/cpu/x86/x86.ad --- openjdk-11-11~19/src/hotspot/cpu/x86/x86.ad 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/x86/x86.ad 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ // -// Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -1444,6 +1444,7 @@ case Op_CMoveVF: if (vlen != 8) ret_value = false; + break; case Op_CMoveVD: if (vlen != 4) ret_value = false; diff -Nru openjdk-11-11~19/src/hotspot/cpu/zero/methodHandles_zero.cpp openjdk-11-11~24/src/hotspot/cpu/zero/methodHandles_zero.cpp --- openjdk-11-11~19/src/hotspot/cpu/zero/methodHandles_zero.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/zero/methodHandles_zero.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,7 @@ #include "precompiled.hpp" #include "interpreter/cppInterpreterGenerator.hpp" #include "interpreter/interpreter.hpp" +#include "interpreter/interpreterRuntime.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/method.inline.hpp" @@ -65,6 +66,37 @@ } +void MethodHandles::throw_AME(Klass* rcvr, Method* interface_method, TRAPS) { + + JavaThread *thread = (JavaThread *) THREAD; + // Set up the frame anchor if it isn't already + bool has_last_Java_frame = thread->has_last_Java_frame(); + if (!has_last_Java_frame) { + intptr_t *sp = thread->zero_stack()->sp(); + ZeroFrame *frame = thread->top_zero_frame(); + while (frame) { + if (frame->is_interpreter_frame()) { + interpreterState istate = + frame->as_interpreter_frame()->interpreter_state(); + if (istate->self_link() == istate) + break; + } + + sp = ((intptr_t *) frame) + 1; + frame = frame->next(); + } + + assert(frame != NULL, "must be"); + thread->set_last_Java_frame(frame, sp); + } + InterpreterRuntime::throw_AbstractMethodErrorVerbose(thread, rcvr, interface_method); + // Reset the frame anchor if necessary + if (!has_last_Java_frame) { + thread->reset_last_Java_frame(); + } + +} + int MethodHandles::method_handle_entry_invokeBasic(Method* method, intptr_t UNUSED, TRAPS) { JavaThread *thread = (JavaThread *) THREAD; @@ -124,8 +156,15 @@ itableMethodEntry* im = ki->first_method_entry(recv->klass()); Method* vmtarget = im[vmindex].method(); - - invoke_target(vmtarget, THREAD); + // Check that the vmtarget entry is non-null. A null entry means + // that the method no longer exists (got deleted) or is private. + // Private class methods can never be an implementation of an + // interface method. In those cases, throw AME. + if (vmtarget != NULL) { + invoke_target(vmtarget, THREAD); + } else { + throw_AME(recv->klass(), target, THREAD); + } return 0; } diff -Nru openjdk-11-11~19/src/hotspot/cpu/zero/methodHandles_zero.hpp openjdk-11-11~24/src/hotspot/cpu/zero/methodHandles_zero.hpp --- openjdk-11-11~19/src/hotspot/cpu/zero/methodHandles_zero.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/cpu/zero/methodHandles_zero.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -32,6 +32,7 @@ private: static oop popFromStack(TRAPS); static void invoke_target(Method* method, TRAPS); + static void throw_AME(Klass* rcvr, Method* interface_method, TRAPS); static int method_handle_entry_invokeBasic(Method* method, intptr_t UNUSED, TRAPS); static int method_handle_entry_linkToStaticOrSpecial(Method* method, intptr_t UNUSED, TRAPS); static int method_handle_entry_linkToVirtual(Method* method, intptr_t UNUSED, TRAPS); diff -Nru openjdk-11-11~19/src/hotspot/.mx.jvmci/eclipse-settings/org.eclipse.jdt.core.prefs openjdk-11-11~24/src/hotspot/.mx.jvmci/eclipse-settings/org.eclipse.jdt.core.prefs --- openjdk-11-11~19/src/hotspot/.mx.jvmci/eclipse-settings/org.eclipse.jdt.core.prefs 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/.mx.jvmci/eclipse-settings/org.eclipse.jdt.core.prefs 2018-07-25 15:36:46.000000000 +0000 @@ -1 +1,2 @@ org.eclipse.jdt.core.compiler.problem.invalidJavadocTagsNotVisibleRef=disabled +org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled diff -Nru openjdk-11-11~19/src/hotspot/os/aix/misc_aix.cpp openjdk-11-11~24/src/hotspot/os/aix/misc_aix.cpp --- openjdk-11-11~19/src/hotspot/os/aix/misc_aix.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/aix/misc_aix.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -49,16 +49,3 @@ const int rc = pthread_mutex_unlock(cs); assert0(rc == 0); } - -bool MiscUtils::is_readable_pointer(const void* p) { - if (!CanUseSafeFetch32()) { - return true; - } - int* const aligned = (int*) align_down(p, 4); - int cafebabe = 0xcafebabe; - int deadbeef = 0xdeadbeef; - return (SafeFetch32(aligned, cafebabe) != cafebabe) || - (SafeFetch32(aligned, deadbeef) != deadbeef); -} - - diff -Nru openjdk-11-11~19/src/hotspot/os/aix/misc_aix.hpp openjdk-11-11~24/src/hotspot/os/aix/misc_aix.hpp --- openjdk-11-11~19/src/hotspot/os/aix/misc_aix.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/aix/misc_aix.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -88,13 +88,6 @@ _pcsobj->leave(); } }; - - // Returns true if pointer can be dereferenced without triggering a segment - // violation. Returns false if pointer is invalid. - // Note: Depends on stub routines; prior to stub routine generation, will - // always return true. Use CanUseSafeFetch32 to handle this case. - bool is_readable_pointer(const void* p); - } #endif // OS_AIX_VM_MISC_AIX_HPP diff -Nru openjdk-11-11~19/src/hotspot/os/aix/os_perf_aix.cpp openjdk-11-11~24/src/hotspot/os/aix/os_perf_aix.cpp --- openjdk-11-11~19/src/hotspot/os/aix/os_perf_aix.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/aix/os_perf_aix.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1041,3 +1041,49 @@ cpu_info = *_cpu_info; // shallow copy assignment return OS_OK; } + +class NetworkPerformanceInterface::NetworkPerformance : public CHeapObj { + friend class NetworkPerformanceInterface; + private: + NetworkPerformance(); + NetworkPerformance(const NetworkPerformance& rhs); // no impl + NetworkPerformance& operator=(const NetworkPerformance& rhs); // no impl + bool initialize(); + ~NetworkPerformance(); + int network_utilization(NetworkInterface** network_interfaces) const; +}; + +NetworkPerformanceInterface::NetworkPerformance::NetworkPerformance() { + +} + +bool NetworkPerformanceInterface::NetworkPerformance::initialize() { + return true; +} + +NetworkPerformanceInterface::NetworkPerformance::~NetworkPerformance() { +} + +int NetworkPerformanceInterface::NetworkPerformance::network_utilization(NetworkInterface** network_interfaces) const +{ + return FUNCTIONALITY_NOT_IMPLEMENTED; +} + +NetworkPerformanceInterface::NetworkPerformanceInterface() { + _impl = NULL; +} + +NetworkPerformanceInterface::~NetworkPerformanceInterface() { + if (_impl != NULL) { + delete _impl; + } +} + +bool NetworkPerformanceInterface::initialize() { + _impl = new NetworkPerformanceInterface::NetworkPerformance(); + return _impl != NULL && _impl->initialize(); +} + +int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const { + return _impl->network_utilization(network_interfaces); +} diff -Nru openjdk-11-11~19/src/hotspot/os/aix/porting_aix.cpp openjdk-11-11~24/src/hotspot/os/aix/porting_aix.cpp --- openjdk-11-11~19/src/hotspot/os/aix/porting_aix.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/aix/porting_aix.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -142,7 +142,7 @@ // in that case I try reading the traceback table unsafe - I rather risk secondary crashes in // error files than not having a callstack.) #define CHECK_POINTER_READABLE(p) \ - if (!MiscUtils::is_readable_pointer(p)) { \ + if (!os::is_readable_pointer(p)) { \ trcVerbose("pc not readable"); \ return false; \ } @@ -230,7 +230,7 @@ const short l = MIN2(*((short*)pc2), namelen - 1); // Be very careful. int i = 0; char* const p = (char*)pc2 + sizeof(short); - while (i < l && MiscUtils::is_readable_pointer(p + i)) { + while (i < l && os::is_readable_pointer(p + i)) { p_name[i] = p[i]; i++; } @@ -489,7 +489,7 @@ const struct tbtable* tb = NULL; int displacement = -1; - if (!MiscUtils::is_readable_pointer(pc)) { + if (!os::is_readable_pointer(pc)) { st->print("(invalid)"); return; } @@ -697,7 +697,7 @@ print_info_for_pc(st, cur_iar, buf, buf_size, demangle); st->cr(); - if (cur_iar && MiscUtils::is_readable_pointer(cur_iar)) { + if (cur_iar && os::is_readable_pointer(cur_iar)) { decode_instructions_at_pc( "Decoded instructions at iar:", cur_iar, 32, 16, st); @@ -710,7 +710,7 @@ print_info_for_pc(st, cur_lr, buf, buf_size, demangle); st->cr(); - if (cur_lr && MiscUtils::is_readable_pointer(cur_lr)) { + if (cur_lr && os::is_readable_pointer(cur_lr)) { decode_instructions_at_pc( "Decoded instructions at lr:", cur_lr, 32, 16, st); @@ -729,7 +729,7 @@ // Check and print rtoc. st->print("rtoc: " PTR64_FORMAT " ", p2i(cur_rtoc)); if (cur_rtoc == NULL || cur_rtoc == (codeptr_t)-1 || - !MiscUtils::is_readable_pointer(cur_rtoc)) { + !os::is_readable_pointer(cur_rtoc)) { st->print("(invalid)"); } else if (((uintptr_t)cur_rtoc) & 0x7) { st->print("(unaligned)"); diff -Nru openjdk-11-11~19/src/hotspot/os/aix/safepointMechanism_aix.cpp openjdk-11-11~24/src/hotspot/os/aix/safepointMechanism_aix.cpp --- openjdk-11-11~19/src/hotspot/os/aix/safepointMechanism_aix.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/aix/safepointMechanism_aix.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -38,7 +38,7 @@ // Allocate one protected page char* map_address = (char*)MAP_FAILED; - const size_t page_size = os::vm_page_size(); + const size_t map_size = ThreadLocalHandshakes ? 2 * os::vm_page_size() : os::vm_page_size(); const int prot = PROT_READ; const int flags = MAP_PRIVATE | MAP_ANONYMOUS; @@ -68,7 +68,7 @@ // AIX: AIX needs MAP_FIXED if we provide an address and mmap will // fail if the address is already mapped. map_address = (char*) ::mmap(address_wishes[i], - page_size, prot, + map_size, prot, flags | MAP_FIXED, -1, 0); log_debug(os)("SafePoint Polling Page address: %p (wish) => %p", @@ -81,24 +81,27 @@ if (map_address != (char*)MAP_FAILED) { // Map succeeded, but polling_page is not at wished address, unmap and continue. - ::munmap(map_address, page_size); + ::munmap(map_address, map_size); map_address = (char*)MAP_FAILED; } // Map failed, continue loop. } } if (map_address == (char*)MAP_FAILED) { - map_address = (char*) ::mmap(NULL, page_size, prot, flags, -1, 0); + map_address = (char*) ::mmap(NULL, map_size, prot, flags, -1, 0); } - guarantee(map_address != (char*)MAP_FAILED, "SafepointMechanism::pd_initialize: failed to allocate polling page"); + guarantee(map_address != (char*)MAP_FAILED && map_address != NULL, + "SafepointMechanism::pd_initialize: failed to allocate polling page"); log_info(os)("SafePoint Polling address: " INTPTR_FORMAT, p2i(map_address)); os::set_polling_page((address)(map_address)); // Use same page for ThreadLocalHandshakes without SIGTRAP if (ThreadLocalHandshakes) { set_uses_thread_local_poll(); - intptr_t bad_page_val = reinterpret_cast(map_address); - _poll_armed_value = reinterpret_cast(bad_page_val | poll_bit()); - _poll_disarmed_value = NULL; // Readable on AIX + os::make_polling_page_unreadable(); + intptr_t bad_page_val = reinterpret_cast(map_address), + good_page_val = bad_page_val + os::vm_page_size(); + _poll_armed_value = reinterpret_cast(bad_page_val + poll_bit()); + _poll_disarmed_value = reinterpret_cast(good_page_val); } } diff -Nru openjdk-11-11~19/src/hotspot/os/bsd/os_perf_bsd.cpp openjdk-11-11~24/src/hotspot/os/bsd/os_perf_bsd.cpp --- openjdk-11-11~19/src/hotspot/os/bsd/os_perf_bsd.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/bsd/os_perf_bsd.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -34,6 +34,10 @@ #include #include #include + #include + #include + #include + #include #endif static const double NANOS_PER_SEC = 1000000000.0; @@ -403,3 +407,85 @@ cpu_info = *_cpu_info; // shallow copy assignment return OS_OK; } + +class NetworkPerformanceInterface::NetworkPerformance : public CHeapObj { + friend class NetworkPerformanceInterface; + private: + NetworkPerformance(); + NetworkPerformance(const NetworkPerformance& rhs); // no impl + NetworkPerformance& operator=(const NetworkPerformance& rhs); // no impl + bool initialize(); + ~NetworkPerformance(); + int network_utilization(NetworkInterface** network_interfaces) const; +}; + +NetworkPerformanceInterface::NetworkPerformance::NetworkPerformance() { +} + +bool NetworkPerformanceInterface::NetworkPerformance::initialize() { + return true; +} + +NetworkPerformanceInterface::NetworkPerformance::~NetworkPerformance() { +} + +int NetworkPerformanceInterface::NetworkPerformance::network_utilization(NetworkInterface** network_interfaces) const { + size_t len; + int mib[] = {CTL_NET, PF_ROUTE, /* protocol number */ 0, /* address family */ 0, NET_RT_IFLIST2, /* NET_RT_FLAGS mask*/ 0}; + if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), NULL, &len, NULL, 0) != 0) { + return OS_ERR; + } + uint8_t* buf = NEW_RESOURCE_ARRAY(uint8_t, len); + if (sysctl(mib, sizeof(mib) / sizeof(mib[0]), buf, &len, NULL, 0) != 0) { + return OS_ERR; + } + + size_t index = 0; + NetworkInterface* ret = NULL; + while (index < len) { + if_msghdr* msghdr = reinterpret_cast(buf + index); + index += msghdr->ifm_msglen; + + if (msghdr->ifm_type != RTM_IFINFO2) { + continue; + } + + if_msghdr2* msghdr2 = reinterpret_cast(msghdr); + sockaddr_dl* sockaddr = reinterpret_cast(msghdr2 + 1); + + // The interface name is not necessarily NUL-terminated + char name_buf[128]; + size_t name_len = MIN2(sizeof(name_buf) - 1, static_cast(sockaddr->sdl_nlen)); + strncpy(name_buf, sockaddr->sdl_data, name_len); + name_buf[name_len] = '\0'; + + uint64_t bytes_in = msghdr2->ifm_data.ifi_ibytes; + uint64_t bytes_out = msghdr2->ifm_data.ifi_obytes; + + NetworkInterface* cur = new NetworkInterface(name_buf, bytes_in, bytes_out, ret); + ret = cur; + } + + *network_interfaces = ret; + + return OS_OK; +} + +NetworkPerformanceInterface::NetworkPerformanceInterface() { + _impl = NULL; +} + +NetworkPerformanceInterface::~NetworkPerformanceInterface() { + if (_impl != NULL) { + delete _impl; + } +} + +bool NetworkPerformanceInterface::initialize() { + _impl = new NetworkPerformanceInterface::NetworkPerformance(); + return _impl != NULL && _impl->initialize(); +} + +int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const { + return _impl->network_utilization(network_interfaces); +} diff -Nru openjdk-11-11~19/src/hotspot/os/linux/os_linux.cpp openjdk-11-11~24/src/hotspot/os/linux/os_linux.cpp --- openjdk-11-11~19/src/hotspot/os/linux/os_linux.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/linux/os_linux.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2108,7 +2108,9 @@ // special case for debian if (file_exists("/etc/debian_version")) { strncpy(buf, "Debian ", buflen); - parse_os_info(&buf[7], buflen-7, "/etc/debian_version"); + if (buflen > 7) { + parse_os_info(&buf[7], buflen-7, "/etc/debian_version"); + } } else { strncpy(buf, "Linux", buflen); } @@ -2820,8 +2822,8 @@ } int os::Linux::get_existing_num_nodes() { - size_t node; - size_t highest_node_number = Linux::numa_max_node(); + int node; + int highest_node_number = Linux::numa_max_node(); int num_nodes = 0; // Get the total number of nodes in the system including nodes without memory. @@ -2834,14 +2836,15 @@ } size_t os::numa_get_leaf_groups(int *ids, size_t size) { - size_t highest_node_number = Linux::numa_max_node(); + int highest_node_number = Linux::numa_max_node(); size_t i = 0; - // Map all node ids in which is possible to allocate memory. Also nodes are + // Map all node ids in which it is possible to allocate memory. Also nodes are // not always consecutively available, i.e. available from 0 to the highest - // node number. - for (size_t node = 0; node <= highest_node_number; node++) { - if (Linux::isnode_in_configured_nodes(node)) { + // node number. If the nodes have been bound explicitly using numactl membind, + // then allocate memory from those nodes only. + for (int node = 0; node <= highest_node_number; node++) { + if (Linux::isnode_in_bound_nodes((unsigned int)node)) { ids[i++] = node; } } @@ -2942,6 +2945,8 @@ libnuma_dlsym(handle, "numa_bitmask_isbitset"))); set_numa_distance(CAST_TO_FN_PTR(numa_distance_func_t, libnuma_dlsym(handle, "numa_distance"))); + set_numa_get_membind(CAST_TO_FN_PTR(numa_get_membind_func_t, + libnuma_v2_dlsym(handle, "numa_get_membind"))); if (numa_available() != -1) { set_numa_all_nodes((unsigned long*)libnuma_dlsym(handle, "numa_all_nodes")); @@ -3006,17 +3011,23 @@ unsigned long *cpu_map = NEW_C_HEAP_ARRAY(unsigned long, cpu_map_size, mtInternal); for (size_t i = 0; i < node_num; i++) { // Check if node is configured (not a memory-less node). If it is not, find - // the closest configured node. - if (!isnode_in_configured_nodes(nindex_to_node()->at(i))) { + // the closest configured node. Check also if node is bound, i.e. it's allowed + // to allocate memory from the node. If it's not allowed, map cpus in that node + // to the closest node from which memory allocation is allowed. + if (!isnode_in_configured_nodes(nindex_to_node()->at(i)) || + !isnode_in_bound_nodes(nindex_to_node()->at(i))) { closest_distance = INT_MAX; // Check distance from all remaining nodes in the system. Ignore distance - // from itself and from another non-configured node. + // from itself, from another non-configured node, and from another non-bound + // node. for (size_t m = 0; m < node_num; m++) { - if (m != i && isnode_in_configured_nodes(nindex_to_node()->at(m))) { + if (m != i && + isnode_in_configured_nodes(nindex_to_node()->at(m)) && + isnode_in_bound_nodes(nindex_to_node()->at(m))) { distance = numa_distance(nindex_to_node()->at(i), nindex_to_node()->at(m)); // If a closest node is found, update. There is always at least one - // configured node in the system so there is always at least one node - // close. + // configured and bound node in the system so there is always at least + // one node close. if (distance != 0 && distance < closest_distance) { closest_distance = distance; closest_node = nindex_to_node()->at(m); @@ -3066,6 +3077,7 @@ os::Linux::numa_set_bind_policy_func_t os::Linux::_numa_set_bind_policy; os::Linux::numa_bitmask_isbitset_func_t os::Linux::_numa_bitmask_isbitset; os::Linux::numa_distance_func_t os::Linux::_numa_distance; +os::Linux::numa_get_membind_func_t os::Linux::_numa_get_membind; unsigned long* os::Linux::_numa_all_nodes; struct bitmask* os::Linux::_numa_all_nodes_ptr; struct bitmask* os::Linux::_numa_nodes_ptr; @@ -5047,8 +5059,9 @@ if (!Linux::libnuma_init()) { UseNUMA = false; } else { - if ((Linux::numa_max_node() < 1)) { - // There's only one node(they start from 0), disable NUMA. + if ((Linux::numa_max_node() < 1) || Linux::isbound_to_single_node()) { + // If there's only one node (they start from 0) or if the process + // is bound explicitly to a single node using membind, disable NUMA. UseNUMA = false; } } @@ -5572,14 +5585,18 @@ static jlong slow_thread_cpu_time(Thread *thread, bool user_sys_cpu_time); -static clockid_t thread_cpu_clockid(Thread* thread) { - pthread_t tid = thread->osthread()->pthread_id(); - clockid_t clockid; - - // Get thread clockid - int rc = os::Linux::pthread_getcpuclockid(tid, &clockid); - assert(rc == 0, "pthread_getcpuclockid is expected to return 0 code"); - return clockid; +static jlong fast_cpu_time(Thread *thread) { + clockid_t clockid; + int rc = os::Linux::pthread_getcpuclockid(thread->osthread()->pthread_id(), + &clockid); + if (rc == 0) { + return os::Linux::fast_thread_cpu_time(clockid); + } else { + // It's possible to encounter a terminated native thread that failed + // to detach itself from the VM - which should result in ESRCH. + assert_status(rc == ESRCH, rc, "pthread_getcpuclockid failed"); + return -1; + } } // current_thread_cpu_time(bool) and thread_cpu_time(Thread*, bool) @@ -5601,7 +5618,7 @@ jlong os::thread_cpu_time(Thread* thread) { // consistent with what current_thread_cpu_time() returns if (os::Linux::supports_fast_thread_cpu_time()) { - return os::Linux::fast_thread_cpu_time(thread_cpu_clockid(thread)); + return fast_cpu_time(thread); } else { return slow_thread_cpu_time(thread, true /* user + sys */); } @@ -5617,7 +5634,7 @@ jlong os::thread_cpu_time(Thread *thread, bool user_sys_cpu_time) { if (user_sys_cpu_time && os::Linux::supports_fast_thread_cpu_time()) { - return os::Linux::fast_thread_cpu_time(thread_cpu_clockid(thread)); + return fast_cpu_time(thread); } else { return slow_thread_cpu_time(thread, user_sys_cpu_time); } diff -Nru openjdk-11-11~19/src/hotspot/os/linux/os_linux.hpp openjdk-11-11~24/src/hotspot/os/linux/os_linux.hpp --- openjdk-11-11~19/src/hotspot/os/linux/os_linux.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/linux/os_linux.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -228,6 +228,7 @@ typedef int (*numa_tonode_memory_func_t)(void *start, size_t size, int node); typedef void (*numa_interleave_memory_func_t)(void *start, size_t size, unsigned long *nodemask); typedef void (*numa_interleave_memory_v2_func_t)(void *start, size_t size, struct bitmask* mask); + typedef struct bitmask* (*numa_get_membind_func_t)(void); typedef void (*numa_set_bind_policy_func_t)(int policy); typedef int (*numa_bitmask_isbitset_func_t)(struct bitmask *bmp, unsigned int n); @@ -244,6 +245,7 @@ static numa_set_bind_policy_func_t _numa_set_bind_policy; static numa_bitmask_isbitset_func_t _numa_bitmask_isbitset; static numa_distance_func_t _numa_distance; + static numa_get_membind_func_t _numa_get_membind; static unsigned long* _numa_all_nodes; static struct bitmask* _numa_all_nodes_ptr; static struct bitmask* _numa_nodes_ptr; @@ -259,6 +261,7 @@ static void set_numa_set_bind_policy(numa_set_bind_policy_func_t func) { _numa_set_bind_policy = func; } static void set_numa_bitmask_isbitset(numa_bitmask_isbitset_func_t func) { _numa_bitmask_isbitset = func; } static void set_numa_distance(numa_distance_func_t func) { _numa_distance = func; } + static void set_numa_get_membind(numa_get_membind_func_t func) { _numa_get_membind = func; } static void set_numa_all_nodes(unsigned long* ptr) { _numa_all_nodes = ptr; } static void set_numa_all_nodes_ptr(struct bitmask **ptr) { _numa_all_nodes_ptr = (ptr == NULL ? NULL : *ptr); } static void set_numa_nodes_ptr(struct bitmask **ptr) { _numa_nodes_ptr = (ptr == NULL ? NULL : *ptr); } @@ -299,7 +302,7 @@ if (_numa_bitmask_isbitset != NULL && _numa_all_nodes_ptr != NULL) { return _numa_bitmask_isbitset(_numa_all_nodes_ptr, n); } else - return 0; + return false; } // Check if numa node exists in the system (including zero memory nodes). static bool isnode_in_existing_nodes(unsigned int n) { @@ -318,7 +321,42 @@ // substitute. return _numa_bitmask_isbitset(_numa_all_nodes_ptr, n); } else - return 0; + return false; + } + // Check if node is in bound node set. + static bool isnode_in_bound_nodes(int node) { + if (_numa_get_membind != NULL && _numa_bitmask_isbitset != NULL) { + return _numa_bitmask_isbitset(_numa_get_membind(), node); + } else { + return false; + } + } + // Check if bound to only one numa node. + // Returns true if bound to a single numa node, otherwise returns false. + static bool isbound_to_single_node() { + int nodes = 0; + struct bitmask* bmp = NULL; + unsigned int node = 0; + unsigned int highest_node_number = 0; + + if (_numa_get_membind != NULL && _numa_max_node != NULL && _numa_bitmask_isbitset != NULL) { + bmp = _numa_get_membind(); + highest_node_number = _numa_max_node(); + } else { + return false; + } + + for (node = 0; node <= highest_node_number; node++) { + if (_numa_bitmask_isbitset(bmp, node)) { + nodes++; + } + } + + if (nodes == 1) { + return true; + } else { + return false; + } } }; diff -Nru openjdk-11-11~19/src/hotspot/os/linux/os_perf_linux.cpp openjdk-11-11~24/src/hotspot/os/linux/os_perf_linux.cpp --- openjdk-11-11~19/src/hotspot/os/linux/os_perf_linux.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/linux/os_perf_linux.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -44,6 +44,8 @@ #include #include #include +#include +#include /** /proc/[number]/stat @@ -1048,3 +1050,94 @@ cpu_info = *_cpu_info; // shallow copy assignment return OS_OK; } + +class NetworkPerformanceInterface::NetworkPerformance : public CHeapObj { + friend class NetworkPerformanceInterface; + private: + NetworkPerformance(); + NetworkPerformance(const NetworkPerformance& rhs); // no impl + NetworkPerformance& operator=(const NetworkPerformance& rhs); // no impl + bool initialize(); + ~NetworkPerformance(); + int64_t read_counter(const char* iface, const char* counter) const; + int network_utilization(NetworkInterface** network_interfaces) const; +}; + +NetworkPerformanceInterface::NetworkPerformance::NetworkPerformance() { + +} + +bool NetworkPerformanceInterface::NetworkPerformance::initialize() { + return true; +} + +NetworkPerformanceInterface::NetworkPerformance::~NetworkPerformance() { +} + +int64_t NetworkPerformanceInterface::NetworkPerformance::read_counter(const char* iface, const char* counter) const { + char buf[128]; + + snprintf(buf, sizeof(buf), "/sys/class/net/%s/statistics/%s", iface, counter); + + int fd = open(buf, O_RDONLY); + if (fd == -1) { + return -1; + } + + ssize_t num_bytes = read(fd, buf, sizeof(buf)); + close(fd); + if ((num_bytes == -1) || (num_bytes >= static_cast(sizeof(buf))) || (num_bytes < 1)) { + return -1; + } + + buf[num_bytes] = '\0'; + int64_t value = strtoll(buf, NULL, 10); + + return value; +} + +int NetworkPerformanceInterface::NetworkPerformance::network_utilization(NetworkInterface** network_interfaces) const +{ + ifaddrs* addresses; + ifaddrs* cur_address; + + if (getifaddrs(&addresses) != 0) { + return OS_ERR; + } + + NetworkInterface* ret = NULL; + for (cur_address = addresses; cur_address != NULL; cur_address = cur_address->ifa_next) { + if (cur_address->ifa_addr->sa_family != AF_PACKET) { + continue; + } + + int64_t bytes_in = read_counter(cur_address->ifa_name, "rx_bytes"); + int64_t bytes_out = read_counter(cur_address->ifa_name, "tx_bytes"); + + NetworkInterface* cur = new NetworkInterface(cur_address->ifa_name, bytes_in, bytes_out, ret); + ret = cur; + } + + *network_interfaces = ret; + + return OS_OK; +} + +NetworkPerformanceInterface::NetworkPerformanceInterface() { + _impl = NULL; +} + +NetworkPerformanceInterface::~NetworkPerformanceInterface() { + if (_impl != NULL) { + delete _impl; + } +} + +bool NetworkPerformanceInterface::initialize() { + _impl = new NetworkPerformanceInterface::NetworkPerformance(); + return _impl != NULL && _impl->initialize(); +} + +int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const { + return _impl->network_utilization(network_interfaces); +} diff -Nru openjdk-11-11~19/src/hotspot/os/linux/perfMemory_linux.cpp openjdk-11-11~24/src/hotspot/os/linux/perfMemory_linux.cpp --- openjdk-11-11~19/src/hotspot/os/linux/perfMemory_linux.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/linux/perfMemory_linux.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -534,15 +534,14 @@ // directory search char* oldest_user = NULL; time_t oldest_ctime = 0; - char buffer[TMP_BUFFER_LEN]; + char buffer[MAXPATHLEN + 1]; int searchpid; char* tmpdirname = (char *)os::get_temp_directory(); assert(strlen(tmpdirname) == 4, "No longer using /tmp - update buffer size"); if (nspid == -1) { searchpid = vmid; - } - else { + } else { jio_snprintf(buffer, MAXPATHLEN, "/proc/%d/root%s", vmid, tmpdirname); tmpdirname = buffer; searchpid = nspid; diff -Nru openjdk-11-11~19/src/hotspot/os/solaris/os_perf_solaris.cpp openjdk-11-11~24/src/hotspot/os/solaris/os_perf_solaris.cpp --- openjdk-11-11~19/src/hotspot/os/solaris/os_perf_solaris.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/solaris/os_perf_solaris.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -754,3 +754,88 @@ cpu_info = *_cpu_info; // shallow copy assignment return OS_OK; } + +class NetworkPerformanceInterface::NetworkPerformance : public CHeapObj { + friend class NetworkPerformanceInterface; + private: + NetworkPerformance(); + NetworkPerformance(const NetworkPerformance& rhs); // no impl + NetworkPerformance& operator=(const NetworkPerformance& rhs); // no impl + bool initialize(); + ~NetworkPerformance(); + int network_utilization(NetworkInterface** network_interfaces) const; +}; + +NetworkPerformanceInterface::NetworkPerformance::NetworkPerformance() { + +} + +bool NetworkPerformanceInterface::NetworkPerformance::initialize() { + return true; +} + +NetworkPerformanceInterface::NetworkPerformance::~NetworkPerformance() { + +} + +int NetworkPerformanceInterface::NetworkPerformance::network_utilization(NetworkInterface** network_interfaces) const +{ + kstat_ctl_t* ctl = kstat_open(); + if (ctl == NULL) { + return OS_ERR; + } + + NetworkInterface* ret = NULL; + for (kstat_t* k = ctl->kc_chain; k != NULL; k = k->ks_next) { + if (strcmp(k->ks_class, "net") != 0) { + continue; + } + if (strcmp(k->ks_module, "link") != 0) { + continue; + } + + if (kstat_read(ctl, k, NULL) == -1) { + return OS_ERR; + } + + uint64_t bytes_in = UINT64_MAX; + uint64_t bytes_out = UINT64_MAX; + for (int i = 0; i < k->ks_ndata; ++i) { + kstat_named_t* data = &reinterpret_cast(k->ks_data)[i]; + if (strcmp(data->name, "rbytes64") == 0) { + bytes_in = data->value.ui64; + } + else if (strcmp(data->name, "obytes64") == 0) { + bytes_out = data->value.ui64; + } + } + + if ((bytes_in != UINT64_MAX) && (bytes_out != UINT64_MAX)) { + NetworkInterface* cur = new NetworkInterface(k->ks_name, bytes_in, bytes_out, ret); + ret = cur; + } + } + + *network_interfaces = ret; + + return OS_OK; +} + +NetworkPerformanceInterface::NetworkPerformanceInterface() { + _impl = NULL; +} + +NetworkPerformanceInterface::~NetworkPerformanceInterface() { + if (_impl != NULL) { + delete _impl; + } +} + +bool NetworkPerformanceInterface::initialize() { + _impl = new NetworkPerformanceInterface::NetworkPerformance(); + return _impl != NULL && _impl->initialize(); +} + +int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const { + return _impl->network_utilization(network_interfaces); +} diff -Nru openjdk-11-11~19/src/hotspot/os/windows/iphlp_interface.cpp openjdk-11-11~24/src/hotspot/os/windows/iphlp_interface.cpp --- openjdk-11-11~19/src/hotspot/os/windows/iphlp_interface.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/windows/iphlp_interface.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "iphlp_interface.hpp" +#include "runtime/os.hpp" + +// IPHLP API +typedef DWORD(WINAPI *GetIfTable2_Fn)(PMIB_IF_TABLE2*); +typedef DWORD(WINAPI *FreeMibTable_Fn)(PVOID); + +// IPHLP statics +GetIfTable2_Fn IphlpDll::_GetIfTable2 = NULL; +FreeMibTable_Fn IphlpDll::_FreeMibTable = NULL; + +LONG IphlpDll::_critical_section = 0; +LONG IphlpDll::_initialized = 0; +LONG IphlpDll::_iphlp_reference_count = 0; +HMODULE IphlpDll::_hModule = NULL; + +void IphlpDll::initialize(void) { + _hModule = os::win32::load_Windows_dll("iphlpapi.dll", NULL, 0); + + if (NULL == _hModule) { + return; + } + + // The 'A' at the end means the ANSI (not the UNICODE) vesions of the methods + _GetIfTable2 = (GetIfTable2_Fn)::GetProcAddress(_hModule, "GetIfTable2"); + _FreeMibTable = (FreeMibTable_Fn)::GetProcAddress(_hModule, "FreeMibTable"); + + // interlock is used for fencing + InterlockedExchange(&_initialized, 1); +} + +bool IphlpDll::IphlpDetach(void) { + LONG prev_ref_count = InterlockedExchangeAdd(&_iphlp_reference_count, -1); + BOOL ret = false; + + if (1 == prev_ref_count) { + if (_initialized && _hModule != NULL) { + ret = FreeLibrary(_hModule); + if (ret) { + _hModule = NULL; + _GetIfTable2 = NULL; + _FreeMibTable = NULL; + InterlockedExchange(&_initialized, 0); + } + } + } + return ret != 0; +} + +bool IphlpDll::IphlpAttach(void) { + InterlockedExchangeAdd(&_iphlp_reference_count, 1); + + if (1 == _initialized) { + return true; + } + + while (InterlockedCompareExchange(&_critical_section, 1, 0) == 1); + + if (0 == _initialized) { + initialize(); + } + + while (InterlockedCompareExchange(&_critical_section, 0, 1) == 0); + + return (_GetIfTable2 != NULL && _FreeMibTable != NULL); +} + +DWORD IphlpDll::GetIfTable2(PMIB_IF_TABLE2* Table) { + assert(_initialized && _GetIfTable2 != NULL, + "IphlpAttach() not yet called"); + + return _GetIfTable2(Table); +} + +DWORD IphlpDll::FreeMibTable(PVOID Memory) { + assert(_initialized && _FreeMibTable != NULL, + "IphlpAttach() not yet called"); + + return _FreeMibTable(Memory); +} diff -Nru openjdk-11-11~19/src/hotspot/os/windows/iphlp_interface.hpp openjdk-11-11~24/src/hotspot/os/windows/iphlp_interface.hpp --- openjdk-11-11~19/src/hotspot/os/windows/iphlp_interface.hpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/windows/iphlp_interface.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef OS_WINDOWS_VM_IPHLP_INTERFACE_HPP +#define OS_WINDOWS_VM_IPHLP_INTERFACE_HPP + +#include "memory/allocation.hpp" +#include "utilities/macros.hpp" +#include +#include +#include + +class IphlpDll : public AllStatic { + private: + static LONG _iphlp_reference_count; + static LONG _critical_section; + static LONG _initialized; + static HMODULE _hModule; + static void initialize(void); + static DWORD(WINAPI *_GetIfTable2)(PMIB_IF_TABLE2*); + static DWORD(WINAPI *_FreeMibTable)(PVOID); + + public: + static DWORD GetIfTable2(PMIB_IF_TABLE2*); + static DWORD FreeMibTable(PVOID); + static bool IphlpAttach(void); + static bool IphlpDetach(void); +}; + +#endif // OS_WINDOWS_VM_IPHLP_INTERFACE_HPP diff -Nru openjdk-11-11~19/src/hotspot/os/windows/os_perf_windows.cpp openjdk-11-11~24/src/hotspot/os/windows/os_perf_windows.cpp --- openjdk-11-11~19/src/hotspot/os/windows/os_perf_windows.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os/windows/os_perf_windows.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -23,14 +23,15 @@ */ #include "precompiled.hpp" +#include "iphlp_interface.hpp" #include "logging/log.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" #include "pdh_interface.hpp" #include "runtime/os_perf.hpp" #include "runtime/os.hpp" -#include "vm_version_ext_x86.hpp" #include "utilities/macros.hpp" +#include "vm_version_ext_x86.hpp" #include #include #include @@ -1380,3 +1381,78 @@ cpu_info = *_cpu_info; // shallow copy assignment return OS_OK; } + +class NetworkPerformanceInterface::NetworkPerformance : public CHeapObj { + friend class NetworkPerformanceInterface; + private: + bool _iphlp_attached; + + NetworkPerformance(); + NetworkPerformance(const NetworkPerformance& rhs); // no impl + NetworkPerformance& operator=(const NetworkPerformance& rhs); // no impl + bool initialize(); + ~NetworkPerformance(); + int network_utilization(NetworkInterface** network_interfaces) const; +}; + +NetworkPerformanceInterface::NetworkPerformance::NetworkPerformance() +: _iphlp_attached(false) { +} + +bool NetworkPerformanceInterface::NetworkPerformance::initialize() { + _iphlp_attached = IphlpDll::IphlpAttach(); + return _iphlp_attached; +} + +NetworkPerformanceInterface::NetworkPerformance::~NetworkPerformance() { + if (_iphlp_attached) { + IphlpDll::IphlpDetach(); + } +} + +int NetworkPerformanceInterface::NetworkPerformance::network_utilization(NetworkInterface** network_interfaces) const { + MIB_IF_TABLE2* table; + + if (IphlpDll::GetIfTable2(&table) != NO_ERROR) { + return OS_ERR; + } + + NetworkInterface* ret = NULL; + for (ULONG i = 0; i < table->NumEntries; ++i) { + if (table->Table[i].InterfaceAndOperStatusFlags.FilterInterface) { + continue; + } + + char buf[256]; + if (WideCharToMultiByte(CP_UTF8, 0, table->Table[i].Description, -1, buf, sizeof(buf), NULL, NULL) == 0) { + continue; + } + + NetworkInterface* cur = new NetworkInterface(buf, table->Table[i].InOctets, table->Table[i].OutOctets, ret); + ret = cur; + } + + IphlpDll::FreeMibTable(table); + *network_interfaces = ret; + + return OS_OK; +} + +NetworkPerformanceInterface::NetworkPerformanceInterface() { + _impl = NULL; +} + +NetworkPerformanceInterface::~NetworkPerformanceInterface() { + if (_impl != NULL) { + delete _impl; + } +} + +bool NetworkPerformanceInterface::initialize() { + _impl = new NetworkPerformanceInterface::NetworkPerformance(); + return _impl != NULL && _impl->initialize(); +} + +int NetworkPerformanceInterface::network_utilization(NetworkInterface** network_interfaces) const { + return _impl->network_utilization(network_interfaces); +} diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp openjdk-11-11~24/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_ppc/os_linux_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -603,7 +603,9 @@ st->print_cr("Register to memory mapping:"); st->cr(); - // this is only for the "general purpose" registers + st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->nip); + st->print("lr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->link); + st->print("ctr ="); print_location(st, (intptr_t)uc->uc_mcontext.regs->ctr); for (int i = 0; i < 32; i++) { st->print("r%-2d=", i); print_location(st, uc->uc_mcontext.regs->gpr[i]); diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp openjdk-11-11~24/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_ppc/thread_linux_ppc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -42,16 +42,60 @@ } bool JavaThread::pd_get_top_frame_for_profiling(frame* fr_addr, void* ucontext, bool isInJava) { - ucontext_t* uc = (ucontext_t*) ucontext; - *fr_addr = frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/], - (address)uc->uc_mcontext.regs->nip); - return true; + assert(this->is_Java_thread(), "must be JavaThread"); + + // If we have a last_Java_frame, then we should use it even if + // isInJava == true. It should be more reliable than ucontext info. + if (has_last_Java_frame() && frame_anchor()->walkable()) { + *fr_addr = pd_last_frame(); + return true; + } + + // At this point, we don't have a last_Java_frame, so + // we try to glean some information out of the ucontext + // if we were running Java code when SIGPROF came in. + if (isInJava) { + ucontext_t* uc = (ucontext_t*) ucontext; + frame ret_frame((intptr_t*)uc->uc_mcontext.regs->gpr[1/*REG_SP*/], + (address)uc->uc_mcontext.regs->nip); + + if (ret_frame.pc() == NULL) { + // ucontext wasn't useful + return false; + } + + if (ret_frame.is_interpreted_frame()) { + frame::ijava_state* istate = ret_frame.get_ijava_state(); + if (!((Method*)(istate->method))->is_metaspace_object()) { + return false; + } + uint64_t reg_bcp = uc->uc_mcontext.regs->gpr[14/*R14_bcp*/]; + uint64_t istate_bcp = istate->bcp; + uint64_t code_start = (uint64_t)(((Method*)(istate->method))->code_base()); + uint64_t code_end = (uint64_t)(((Method*)istate->method)->code_base() + ((Method*)istate->method)->code_size()); + if (istate_bcp >= code_start && istate_bcp < code_end) { + // we have a valid bcp, don't touch it, do nothing + } else if (reg_bcp >= code_start && reg_bcp < code_end) { + istate->bcp = reg_bcp; + } else { + return false; + } + } + if (!ret_frame.safe_for_sender(this)) { + // nothing else to try if the frame isn't good + return false; + } + *fr_addr = ret_frame; + return true; + } + // nothing else to try + return false; } // Forte Analyzer AsyncGetCallTrace profiling support is not implemented on Linux/PPC. bool JavaThread::pd_get_top_frame_for_signal_handler(frame* fr_addr, void* ucontext, bool isInJava) { - Unimplemented(); - return false; + assert(this->is_Java_thread(), "must be JavaThread"); + return pd_get_top_frame_for_profiling(fr_addr, ucontext, isInJava); } void JavaThread::cache_global_variables() { } diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp openjdk-11-11~24/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_s390/os_linux_s390.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -628,7 +628,19 @@ } void os::print_register_info(outputStream *st, const void *context) { - st->print("Not ported\n"); + if (context == NULL) return; + + const ucontext_t *uc = (const ucontext_t*)context; + + st->print_cr("Register to memory mapping:"); + st->cr(); + + st->print("pc ="); print_location(st, (intptr_t)uc->uc_mcontext.psw.addr); + for (int i = 0; i < 16; i++) { + st->print("r%-2d=", i); + print_location(st, uc->uc_mcontext.gregs[i]); + } + st->cr(); } #ifndef PRODUCT diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.cpp openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.cpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -28,7 +28,6 @@ #include "gc/z/zErrno.hpp" #include "gc/z/zLargePages.inline.hpp" #include "logging/log.hpp" -#include "runtime/init.hpp" #include "runtime/os.hpp" #include "utilities/align.hpp" #include "utilities/debug.hpp" @@ -47,10 +46,6 @@ // Sysfs file for transparent huge page on tmpfs #define ZFILENAME_SHMEM_ENABLED "/sys/kernel/mm/transparent_hugepage/shmem_enabled" -// Default mount points -#define ZMOUNTPOINT_TMPFS "/dev/shm" -#define ZMOUNTPOINT_HUGETLBFS "/hugepages" - // Java heap filename #define ZFILENAME_HEAP "java_heap" @@ -79,13 +74,30 @@ #define HUGETLBFS_MAGIC 0x958458f6 #endif +// Preferred tmpfs mount points, ordered by priority +static const char* z_preferred_tmpfs_mountpoints[] = { + "/dev/shm", + "/run/shm", + NULL +}; + +// Preferred hugetlbfs mount points, ordered by priority +static const char* z_preferred_hugetlbfs_mountpoints[] = { + "/dev/hugepages", + "/hugepages", + NULL +}; + static int z_memfd_create(const char *name, unsigned int flags) { return syscall(__NR_memfd_create, name, flags); } +bool ZBackingFile::_hugetlbfs_mmap_retry = true; + ZBackingFile::ZBackingFile() : _fd(-1), _filesystem(0), + _available(0), _initialized(false) { // Create backing file @@ -94,39 +106,47 @@ return; } - // Get filesystem type + // Get filesystem statistics struct statfs statfs_buf; if (fstatfs(_fd, &statfs_buf) == -1) { ZErrno err; - log_error(gc, init)("Failed to determine filesystem type for backing file (%s)", err.to_string()); + log_error(gc, init)("Failed to determine filesystem type for backing file (%s)", + err.to_string()); return; } + _filesystem = statfs_buf.f_type; + _available = statfs_buf.f_bavail * statfs_buf.f_bsize; // Make sure we're on a supported filesystem if (!is_tmpfs() && !is_hugetlbfs()) { - log_error(gc, init)("Backing file must be located on a %s or a %s filesystem", ZFILESYSTEM_TMPFS, ZFILESYSTEM_HUGETLBFS); + log_error(gc, init)("Backing file must be located on a %s or a %s filesystem", + ZFILESYSTEM_TMPFS, ZFILESYSTEM_HUGETLBFS); return; } // Make sure the filesystem type matches requested large page type if (ZLargePages::is_transparent() && !is_tmpfs()) { - log_error(gc, init)("-XX:+UseTransparentHugePages can only be enable when using a %s filesystem", ZFILESYSTEM_TMPFS); + log_error(gc, init)("-XX:+UseTransparentHugePages can only be enable when using a %s filesystem", + ZFILESYSTEM_TMPFS); return; } if (ZLargePages::is_transparent() && !tmpfs_supports_transparent_huge_pages()) { - log_error(gc, init)("-XX:+UseTransparentHugePages on a %s filesystem not supported by kernel", ZFILESYSTEM_TMPFS); + log_error(gc, init)("-XX:+UseTransparentHugePages on a %s filesystem not supported by kernel", + ZFILESYSTEM_TMPFS); return; } if (ZLargePages::is_explicit() && !is_hugetlbfs()) { - log_error(gc, init)("-XX:+UseLargePages (without -XX:+UseTransparentHugePages) can only be enabled when using a %s filesystem", ZFILESYSTEM_HUGETLBFS); + log_error(gc, init)("-XX:+UseLargePages (without -XX:+UseTransparentHugePages) can only be enabled when using a %s filesystem", + ZFILESYSTEM_HUGETLBFS); return; } if (!ZLargePages::is_explicit() && is_hugetlbfs()) { - log_error(gc, init)("-XX:+UseLargePages must be enabled when using a %s filesystem", ZFILESYSTEM_HUGETLBFS); + log_error(gc, init)("-XX:+UseLargePages must be enabled when using a %s filesystem", + ZFILESYSTEM_HUGETLBFS); return; } @@ -149,17 +169,21 @@ return -1; } - log_debug(gc, init)("Heap backed by file /memfd:%s", filename); + log_info(gc, init)("Heap backed by file: /memfd:%s", filename); return fd; } int ZBackingFile::create_file_fd(const char* name) const { - const char* const filesystem = ZLargePages::is_explicit() ? ZFILESYSTEM_HUGETLBFS : ZFILESYSTEM_TMPFS; - const char* const mountpoint = ZLargePages::is_explicit() ? ZMOUNTPOINT_HUGETLBFS : ZMOUNTPOINT_TMPFS; + const char* const filesystem = ZLargePages::is_explicit() + ? ZFILESYSTEM_HUGETLBFS + : ZFILESYSTEM_TMPFS; + const char** const preferred_mountpoints = ZLargePages::is_explicit() + ? z_preferred_hugetlbfs_mountpoints + : z_preferred_tmpfs_mountpoints; // Find mountpoint - ZBackingPath path(filesystem, mountpoint); + ZBackingPath path(filesystem, preferred_mountpoints); if (path.get() == NULL) { log_error(gc, init)("Use -XX:ZPath to specify the path to a %s filesystem", filesystem); return -1; @@ -170,7 +194,7 @@ const int fd_anon = open(path.get(), O_TMPFILE|O_EXCL|O_RDWR|O_CLOEXEC, S_IRUSR|S_IWUSR); if (fd_anon == -1) { ZErrno err; - log_debug(gc, init)("Failed to create anonymouns file in %s (%s)", path.get(), + log_debug(gc, init)("Failed to create anonymous file in %s (%s)", path.get(), (err == EINVAL ? "Not supported" : err.to_string())); } else { // Get inode number for anonymous file @@ -181,7 +205,7 @@ return -1; } - log_debug(gc, init)("Heap backed by file %s/#" UINT64_FORMAT, path.get(), (uint64_t)stat_buf.st_ino); + log_info(gc, init)("Heap backed by file: %s/#" UINT64_FORMAT, path.get(), (uint64_t)stat_buf.st_ino); return fd_anon; } @@ -207,7 +231,7 @@ return -1; } - log_debug(gc, init)("Heap backed by file %s", filename); + log_info(gc, init)("Heap backed by file: %s", filename); return fd; } @@ -224,7 +248,7 @@ return fd; } - log_debug(gc, init)("Falling back to searching for an accessible moint point"); + log_debug(gc, init)("Falling back to searching for an accessible mount point"); } return create_file_fd(name); @@ -238,6 +262,10 @@ return _fd; } +size_t ZBackingFile::available() const { + return _available; +} + bool ZBackingFile::is_tmpfs() const { return _filesystem == TMPFS_MAGIC; } @@ -292,12 +320,12 @@ return true; } -bool ZBackingFile::expand_tmpfs(size_t offset, size_t length) const { +bool ZBackingFile::try_expand_tmpfs(size_t offset, size_t length) const { assert(is_tmpfs(), "Wrong filesystem"); return try_expand_tmpfs(offset, length, os::vm_page_size()); } -bool ZBackingFile::expand_hugetlbfs(size_t offset, size_t length) const { +bool ZBackingFile::try_expand_hugetlbfs(size_t offset, size_t length) const { assert(is_hugetlbfs(), "Wrong filesystem"); // Prior to kernel 4.3, hugetlbfs did not support posix_fallocate(). @@ -320,11 +348,11 @@ // process being returned to the huge page pool and made available for new // allocations. void* addr = MAP_FAILED; - const int max_attempts = 3; + const int max_attempts = 5; for (int attempt = 1; attempt <= max_attempts; attempt++) { addr = mmap(0, length, PROT_READ|PROT_WRITE, MAP_SHARED, _fd, offset); - if (addr != MAP_FAILED || is_init_completed()) { - // Mapping was successful or initialization phase has completed + if (addr != MAP_FAILED || !_hugetlbfs_mmap_retry) { + // Mapping was successful or mmap retry is disabled break; } @@ -337,6 +365,11 @@ sleep(1); } + // Disable mmap retry from now on + if (_hugetlbfs_mmap_retry) { + _hugetlbfs_mmap_retry = false; + } + if (addr == MAP_FAILED) { // Not enough huge pages left ZErrno err; @@ -355,6 +388,39 @@ return true; } -bool ZBackingFile::expand(size_t offset, size_t length) const { - return is_hugetlbfs() ? expand_hugetlbfs(offset, length) : expand_tmpfs(offset, length); +bool ZBackingFile::try_expand_tmpfs_or_hugetlbfs(size_t offset, size_t length, size_t alignment) const { + assert(is_aligned(offset, alignment), "Invalid offset"); + assert(is_aligned(length, alignment), "Invalid length"); + + log_debug(gc)("Expanding heap from " SIZE_FORMAT "M to " SIZE_FORMAT "M", offset / M, (offset + length) / M); + + return is_hugetlbfs() ? try_expand_hugetlbfs(offset, length) : try_expand_tmpfs(offset, length); +} + +size_t ZBackingFile::try_expand(size_t offset, size_t length, size_t alignment) const { + size_t start = offset; + size_t end = offset + length; + + // Try to expand + if (try_expand_tmpfs_or_hugetlbfs(start, length, alignment)) { + // Success + return end; + } + + // Failed, try to expand as much as possible + for (;;) { + length = align_down((end - start) / 2, alignment); + if (length < alignment) { + // Done, don't expand more + return start; + } + + if (try_expand_tmpfs_or_hugetlbfs(start, length, alignment)) { + // Success, try expand more + start += length; + } else { + // Failed, try expand less + end -= length; + } + } } diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.hpp openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.hpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zBackingFile_linux_x86.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,8 +28,11 @@ class ZBackingFile { private: + static bool _hugetlbfs_mmap_retry; + int _fd; uint64_t _filesystem; + size_t _available; bool _initialized; int create_mem_fd(const char* name) const; @@ -42,9 +45,9 @@ bool try_split_and_expand_tmpfs(size_t offset, size_t length, size_t alignment) const; bool try_expand_tmpfs(size_t offset, size_t length, size_t alignment) const; - bool expand_tmpfs(size_t offset, size_t length) const; - - bool expand_hugetlbfs(size_t offset, size_t length) const; + bool try_expand_tmpfs(size_t offset, size_t length) const; + bool try_expand_hugetlbfs(size_t offset, size_t length) const; + bool try_expand_tmpfs_or_hugetlbfs(size_t offset, size_t length, size_t alignment) const; public: ZBackingFile(); @@ -52,7 +55,9 @@ bool is_initialized() const; int fd() const; - bool expand(size_t offset, size_t length) const; + size_t available() const; + + size_t try_expand(size_t offset, size_t length, size_t alignment) const; }; #endif // OS_CPU_LINUX_X86_ZBACKINGFILE_LINUX_X86_HPP diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.cpp openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.cpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -33,13 +33,13 @@ // Mount information, see proc(5) for more details. #define PROC_SELF_MOUNTINFO "/proc/self/mountinfo" -ZBackingPath::ZBackingPath(const char* filesystem, const char* preferred_path) { +ZBackingPath::ZBackingPath(const char* filesystem, const char** preferred_mountpoints) { if (ZPath != NULL) { // Use specified path _path = strdup(ZPath); } else { // Find suitable path - _path = find_mountpoint(filesystem, preferred_path); + _path = find_mountpoint(filesystem, preferred_mountpoints); } } @@ -52,8 +52,8 @@ char* line_mountpoint = NULL; char* line_filesystem = NULL; - // Parse line and return a newly allocated string containing the mountpoint if - // the line contains a matching filesystem and the mountpoint is accessible by + // Parse line and return a newly allocated string containing the mount point if + // the line contains a matching filesystem and the mount point is accessible by // the current user. if (sscanf(line, "%*u %*u %*u:%*u %*s %ms %*[^-]- %ms", &line_mountpoint, &line_filesystem) != 2 || strcmp(line_filesystem, filesystem) != 0 || @@ -68,7 +68,7 @@ return line_mountpoint; } -void ZBackingPath::get_mountpoints(ZArray* mountpoints, const char* filesystem) const { +void ZBackingPath::get_mountpoints(const char* filesystem, ZArray* mountpoints) const { FILE* fd = fopen(PROC_SELF_MOUNTINFO, "r"); if (fd == NULL) { ZErrno err; @@ -98,37 +98,45 @@ mountpoints->clear(); } -char* ZBackingPath::find_mountpoint(const char* filesystem, const char* preferred_mountpoint) const { +char* ZBackingPath::find_preferred_mountpoint(const char* filesystem, + ZArray* mountpoints, + const char** preferred_mountpoints) const { + // Find preferred mount point + ZArrayIterator iter1(mountpoints); + for (char* mountpoint; iter1.next(&mountpoint);) { + for (const char** preferred = preferred_mountpoints; *preferred != NULL; preferred++) { + if (!strcmp(mountpoint, *preferred)) { + // Preferred mount point found + return strdup(mountpoint); + } + } + } + + // Preferred mount point not found + log_error(gc, init)("More than one %s filesystem found:", filesystem); + ZArrayIterator iter2(mountpoints); + for (char* mountpoint; iter2.next(&mountpoint);) { + log_error(gc, init)(" %s", mountpoint); + } + + return NULL; +} + +char* ZBackingPath::find_mountpoint(const char* filesystem, const char** preferred_mountpoints) const { char* path = NULL; ZArray mountpoints; - get_mountpoints(&mountpoints, filesystem); + get_mountpoints(filesystem, &mountpoints); if (mountpoints.size() == 0) { - // No filesystem found + // No mount point found log_error(gc, init)("Failed to find an accessible %s filesystem", filesystem); } else if (mountpoints.size() == 1) { - // One filesystem found + // One mount point found path = strdup(mountpoints.at(0)); - } else if (mountpoints.size() > 1) { - // More than one filesystem found - ZArrayIterator iter(&mountpoints); - for (char* mountpoint; iter.next(&mountpoint);) { - if (!strcmp(mountpoint, preferred_mountpoint)) { - // Preferred mount point found - path = strdup(mountpoint); - break; - } - } - - if (path == NULL) { - // Preferred mount point not found - log_error(gc, init)("More than one %s filesystem found:", filesystem); - ZArrayIterator iter2(&mountpoints); - for (char* mountpoint; iter2.next(&mountpoint);) { - log_error(gc, init)(" %s", mountpoint); - } - } + } else { + // More than one mount point found + path = find_preferred_mountpoint(filesystem, &mountpoints, preferred_mountpoints); } free_mountpoints(&mountpoints); diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.hpp openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.hpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zBackingPath_linux_x86.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,13 +31,19 @@ private: char* _path; - char* get_mountpoint(const char* line, const char* filesystem) const; - void get_mountpoints(ZArray* mountpoints, const char* filesystem) const; + char* get_mountpoint(const char* line, + const char* filesystem) const; + void get_mountpoints(const char* filesystem, + ZArray* mountpoints) const; void free_mountpoints(ZArray* mountpoints) const; - char* find_mountpoint(const char* filesystem, const char* preferred_mountpoint) const; + char* find_preferred_mountpoint(const char* filesystem, + ZArray* mountpoints, + const char** preferred_mountpoints) const; + char* find_mountpoint(const char* filesystem, + const char** preferred_mountpoints) const; public: - ZBackingPath(const char* filesystem, const char* preferred_path); + ZBackingPath(const char* filesystem, const char** preferred_mountpoints); ~ZBackingPath(); const char* get() const; diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zNUMA_linux_x86.cpp openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zNUMA_linux_x86.cpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zNUMA_linux_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zNUMA_linux_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,11 +31,11 @@ #include #ifndef MPOL_F_NODE -#define MPOL_F_NODE (1<<0) /* return next IL mode instead of node mask */ +#define MPOL_F_NODE (1<<0) // Return next IL mode instead of node mask #endif #ifndef MPOL_F_ADDR -#define MPOL_F_ADDR (1<<1) /* look up vma using address */ +#define MPOL_F_ADDR (1<<1) // Look up VMA using address #endif static int z_get_mempolicy(uint32_t* mode, const unsigned long *nmask, unsigned long maxnode, uintptr_t addr, int flags) { diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.cpp openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.cpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -52,8 +52,15 @@ _file(), _granule_size(granule_size) { - // Check and warn if max map count seems too low + if (!_file.is_initialized()) { + return; + } + + // Check and warn if max map count is too low check_max_map_count(max_capacity, granule_size); + + // Check and warn if available space on filesystem is too low + check_available_space_on_filesystem(max_capacity); } void ZPhysicalMemoryBacking::check_max_map_count(size_t max_capacity, size_t granule_size) const { @@ -61,7 +68,7 @@ FILE* const file = fopen(filename, "r"); if (file == NULL) { // Failed to open file, skip check - log_debug(gc)("Failed to open %s", filename); + log_debug(gc, init)("Failed to open %s", filename); return; } @@ -70,7 +77,7 @@ fclose(file); if (result != 1) { // Failed to read file, skip check - log_debug(gc)("Failed to read %s", filename); + log_debug(gc, init)("Failed to read %s", filename); return; } @@ -81,15 +88,43 @@ // We speculate that we need another 20% to allow for non-ZGC subsystems to map memory. const size_t required_max_map_count = (max_capacity / granule_size) * 3 * 1.2; if (actual_max_map_count < required_max_map_count) { - log_warning(gc)("The system limit on number of memory mappings " - "per process might be too low for the given"); - log_warning(gc)("Java heap size (" SIZE_FORMAT "M). Please " - "adjust %s to allow for at least", max_capacity / M, filename); - log_warning(gc)(SIZE_FORMAT " mappings (current limit is " SIZE_FORMAT "). " - "Continuing execution with the current limit could", - required_max_map_count, actual_max_map_count); - log_warning(gc)("lead to a fatal error down the line, due to failed " - "attempts to map memory."); + log_warning(gc, init)("***** WARNING! INCORRECT SYSTEM CONFIGURATION DETECTED! *****"); + log_warning(gc, init)("The system limit on number of memory mappings per process might be too low " + "for the given"); + log_warning(gc, init)("max Java heap size (" SIZE_FORMAT "M). Please adjust %s to allow for at", + max_capacity / M, filename); + log_warning(gc, init)("least " SIZE_FORMAT " mappings (current limit is " SIZE_FORMAT "). Continuing " + "execution with the current", required_max_map_count, actual_max_map_count); + log_warning(gc, init)("limit could lead to a fatal error, due to failure to map memory."); + } +} + +void ZPhysicalMemoryBacking::check_available_space_on_filesystem(size_t max_capacity) const { + // Note that the available space on a tmpfs or a hugetlbfs filesystem + // will be zero if no size limit was specified when it was mounted. + const size_t available = _file.available(); + if (available == 0) { + // No size limit set, skip check + log_info(gc, init)("Available space on backing filesystem: N/A"); + return; + } + + log_info(gc, init)("Available space on backing filesystem: " SIZE_FORMAT "M", + available / M); + + // Warn if the filesystem doesn't currently have enough space available to hold + // the max heap size. The max heap size will be capped if we later hit this limit + // when trying to expand the heap. + if (available < max_capacity) { + log_warning(gc, init)("***** WARNING! INCORRECT SYSTEM CONFIGURATION DETECTED! *****"); + log_warning(gc, init)("Not enough space available on the backing filesystem to hold the current " + "max Java heap"); + log_warning(gc, init)("size (" SIZE_FORMAT "M). Please adjust the size of the backing filesystem " + "accordingly (available", max_capacity / M); + log_warning(gc, init)("space is currently " SIZE_FORMAT "M). Continuing execution with the current " + "filesystem size could", available / M); + log_warning(gc, init)("lead to a premature OutOfMemoryError being thrown, due to failure to map " + "memory."); } } @@ -97,18 +132,16 @@ return _file.is_initialized(); } -bool ZPhysicalMemoryBacking::expand(size_t from, size_t to) { - const size_t size = to - from; +size_t ZPhysicalMemoryBacking::try_expand(size_t old_capacity, size_t new_capacity) { + assert(old_capacity < new_capacity, "Invalid old/new capacity"); - // Expand - if (!_file.expand(from, size)) { - return false; + const size_t capacity = _file.try_expand(old_capacity, new_capacity - old_capacity, _granule_size); + if (capacity > old_capacity) { + // Add expanded capacity to free list + _manager.free(old_capacity, capacity - old_capacity); } - // Add expanded space to free list - _manager.free(from, size); - - return true; + return capacity; } ZPhysicalMemory ZPhysicalMemoryBacking::alloc(size_t size) { diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.hpp openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.hpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/gc/z/zPhysicalMemoryBacking_linux_x86.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,6 +37,7 @@ const size_t _granule_size; void check_max_map_count(size_t max_capacity, size_t granule_size) const; + void check_available_space_on_filesystem(size_t max_capacity) const; void map_failed(ZErrno err) const; void advise_view(uintptr_t addr, size_t size) const; @@ -49,7 +50,8 @@ bool is_initialized() const; - bool expand(size_t from, size_t to); + size_t try_expand(size_t old_capacity, size_t new_capacity); + ZPhysicalMemory alloc(size_t size); void free(ZPhysicalMemory pmem); diff -Nru openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp --- openjdk-11-11~19/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/os_cpu/linux_x86/os_linux_x86.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -96,11 +96,11 @@ address os::current_stack_pointer() { #ifdef SPARC_WORKS register void *esp; - __asm__("mov %%"SPELL_REG_SP", %0":"=r"(esp)); + __asm__("mov %%" SPELL_REG_SP ", %0":"=r"(esp)); return (address) ((char*)esp + sizeof(long)*2); #elif defined(__clang__) intptr_t* esp; - __asm__ __volatile__ ("mov %%"SPELL_REG_SP", %0":"=r"(esp):); + __asm__ __volatile__ ("mov %%" SPELL_REG_SP ", %0":"=r"(esp):); return (address) esp; #else register void *esp __asm__ (SPELL_REG_SP); @@ -234,10 +234,10 @@ intptr_t* _get_previous_fp() { #ifdef SPARC_WORKS register intptr_t **ebp; - __asm__("mov %%"SPELL_REG_FP", %0":"=r"(ebp)); + __asm__("mov %%" SPELL_REG_FP ", %0":"=r"(ebp)); #elif defined(__clang__) intptr_t **ebp; - __asm__ __volatile__ ("mov %%"SPELL_REG_FP", %0":"=r"(ebp):); + __asm__ __volatile__ ("mov %%" SPELL_REG_FP ", %0":"=r"(ebp):); #else register intptr_t **ebp __asm__ (SPELL_REG_FP); #endif diff -Nru openjdk-11-11~19/src/hotspot/share/adlc/archDesc.cpp openjdk-11-11~24/src/hotspot/share/adlc/archDesc.cpp --- openjdk-11-11~19/src/hotspot/share/adlc/archDesc.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/adlc/archDesc.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ // -// Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. +// Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. // DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. // // This code is free software; you can redistribute it and/or modify it @@ -543,14 +543,18 @@ } // Identify index position among ideal operands - intptr_t index = _last_opcode; - const char *indexStr = node ? node->_opType : (char *) " "; - index = (intptr_t)_idealIndex[indexStr]; + intptr_t index = _last_opcode; + const char *indexStr = node ? node->_opType : (char *) " "; + index = (intptr_t)_idealIndex[indexStr]; if (index == 0) { fprintf(stderr, "error: operand \"%s\" not found\n", indexStr); assert(0, "fatal error"); } + if (node == NULL) { + fprintf(stderr, "error: node is NULL\n"); + assert(0, "fatal error"); + } // Build MatchLists for children // Check each child for an internal operand name, and use that name // for the parent's matchlist entry if it exists diff -Nru openjdk-11-11~19/src/hotspot/share/adlc/arena.cpp openjdk-11-11~24/src/hotspot/share/adlc/arena.cpp --- openjdk-11-11~19/src/hotspot/share/adlc/arena.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/adlc/arena.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ while( k ) { Chunk *tmp = k->_next; // clear out this chunk (to detect allocation bugs) - memset(k, 0xBAADBABE, k->_len); + memset(k, 0xBE, k->_len); free(k); // Free chunk (was malloc'd) k = tmp; } diff -Nru openjdk-11-11~19/src/hotspot/share/adlc/dfa.cpp openjdk-11-11~24/src/hotspot/share/adlc/dfa.cpp --- openjdk-11-11~19/src/hotspot/share/adlc/dfa.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/adlc/dfa.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -502,9 +502,11 @@ case '"': // such as: #line 10 "myfile.ad"\n mypredicate return true; case '|': - if( prev != pred && *(prev-1) == '|' ) return true; + if (prev != pred && *(prev-1) == '|') return true; + break; case '&': - if( prev != pred && *(prev-1) == '&' ) return true; + if (prev != pred && *(prev-1) == '&') return true; + break; default: return false; } @@ -717,21 +719,21 @@ // Preserve use of external name which has a zero value if( c1->_external_name != NULL ) { - sprintf( string_buffer, "%s", c1->as_string()); + sprintf(string_buffer, "%s", c1->as_string()); if( !c2->is_zero() ) { - strcat( string_buffer, "+"); - strcat( string_buffer, c2->as_string()); + strncat(string_buffer, "+", STRING_BUFFER_LENGTH); + strncat(string_buffer, c2->as_string(), STRING_BUFFER_LENGTH); } result = strdup(string_buffer); } else if( c2->_external_name != NULL ) { if( !c1->is_zero() ) { - sprintf( string_buffer, "%s", c1->as_string()); - strcat( string_buffer, " + "); + sprintf(string_buffer, "%s", c1->as_string()); + strncat(string_buffer, " + ", STRING_BUFFER_LENGTH); } else { string_buffer[0] = '\0'; } - strcat( string_buffer, c2->_external_name ); + strncat(string_buffer, c2->_external_name, STRING_BUFFER_LENGTH); result = strdup(string_buffer); } return result; @@ -741,8 +743,8 @@ if( !c1->is_zero() ) { sprintf( string_buffer, "%s", c1->_expr); if( !c2->is_zero() ) { - strcat( string_buffer, "+"); - strcat( string_buffer, c2->_expr); + strncat(string_buffer, "+", STRING_BUFFER_LENGTH); + strncat(string_buffer, c2->_expr, STRING_BUFFER_LENGTH); } } else if( !c2->is_zero() ) { diff -Nru openjdk-11-11~19/src/hotspot/share/adlc/filebuff.cpp openjdk-11-11~24/src/hotspot/share/adlc/filebuff.cpp --- openjdk-11-11~19/src/hotspot/share/adlc/filebuff.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/adlc/filebuff.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,8 +95,11 @@ va_start(args, fmt); switch (flag) { case 0: _AD._warnings += _AD.emit_msg(0, flag, linenum, fmt, args); + break; case 1: _AD._syntax_errs += _AD.emit_msg(0, flag, linenum, fmt, args); + break; case 2: _AD._semantic_errs += _AD.emit_msg(0, flag, linenum, fmt, args); + break; default: assert(0, ""); break; } va_end(args); diff -Nru openjdk-11-11~19/src/hotspot/share/adlc/formssel.cpp openjdk-11-11~24/src/hotspot/share/adlc/formssel.cpp --- openjdk-11-11~19/src/hotspot/share/adlc/formssel.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/adlc/formssel.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3634,7 +3634,7 @@ && (is_load_from_memory(mRule2->_opType) == data_type) // reg vs. (load memory) && (name_left != NULL) // NOT (load) && (name_right == NULL) ) { // NOT (load memory foo) - const Form *form2_left = name_left ? globals[name_left] : NULL; + const Form *form2_left = globals[name_left]; if( form2_left && form2_left->is_cisc_mem(globals) ) { cisc_spillable = Is_cisc_spillable; operand = _name; @@ -3645,7 +3645,7 @@ } } // Detect reg vs memory - else if( form->is_cisc_reg(globals) && form2->is_cisc_mem(globals) ) { + else if (form->is_cisc_reg(globals) && form2 != NULL && form2->is_cisc_mem(globals)) { cisc_spillable = Is_cisc_spillable; operand = _name; reg_type = _result; @@ -3710,8 +3710,12 @@ } // Check right operands: recursive walk to identify reg->mem operand - if( (_rChild == NULL) && (mRule2->_rChild == NULL) ) { - right_spillable = Maybe_cisc_spillable; + if (_rChild == NULL) { + if (mRule2->_rChild == NULL) { + right_spillable = Maybe_cisc_spillable; + } else { + assert(0, "_rChild should not be NULL"); + } } else { right_spillable = _rChild->cisc_spill_match(globals, registers, mRule2->_rChild, operand, reg_type); } diff -Nru openjdk-11-11~19/src/hotspot/share/adlc/main.cpp openjdk-11-11~24/src/hotspot/share/adlc/main.cpp --- openjdk-11-11~19/src/hotspot/share/adlc/main.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/adlc/main.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -142,7 +142,7 @@ const char *base = strip_ext(strdup(argv[i])); char *temp = base_plus_suffix("dfa_",base); AD._DFA_file._name = base_plus_suffix(temp,".cpp"); - delete temp; + delete[] temp; temp = base_plus_suffix("ad_",base); AD._CPP_file._name = base_plus_suffix(temp,".cpp"); AD._CPP_CLONE_file._name = base_plus_suffix(temp,"_clone.cpp"); @@ -153,13 +153,13 @@ AD._CPP_PEEPHOLE_file._name = base_plus_suffix(temp,"_peephole.cpp"); AD._CPP_PIPELINE_file._name = base_plus_suffix(temp,"_pipeline.cpp"); AD._HPP_file._name = base_plus_suffix(temp,".hpp"); - delete temp; + delete[] temp; temp = base_plus_suffix("adGlobals_",base); AD._VM_file._name = base_plus_suffix(temp,".hpp"); - delete temp; + delete[] temp; temp = base_plus_suffix("bugs_",base); AD._bug_file._name = base_plus_suffix(temp,".out"); - delete temp; + delete[] temp; } // End of files vs options... } // End of while have command line arguments diff -Nru openjdk-11-11~19/src/hotspot/share/adlc/output_c.cpp openjdk-11-11~24/src/hotspot/share/adlc/output_c.cpp --- openjdk-11-11~19/src/hotspot/share/adlc/output_c.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/adlc/output_c.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1936,6 +1936,7 @@ _AD.syntax_err( _ins_encode._linenum, "Parameter %s not passed to enc_class %s from instruct %s.\n", rep_var, _encoding._name, _inst._ident); + assert(false, "inst_rep_var == NULL, cannot continue."); } // Check if instruction's actual parameter is a local name in the instruction @@ -1976,8 +1977,8 @@ } else { // Check for unimplemented functionality before hard failure - assert( strcmp(opc->_ident,"label")==0, "Unimplemented() Label"); - assert( false, "ShouldNotReachHere()"); + assert(opc != NULL && strcmp(opc->_ident, "label") == 0, "Unimplemented Label"); + assert(false, "ShouldNotReachHere()"); } } // done checking which operand this is. } else { @@ -2450,8 +2451,8 @@ } else { // Check for unimplemented functionality before hard failure - assert( strcmp(opc->_ident,"label")==0, "Unimplemented() Label"); - assert( false, "ShouldNotReachHere()"); + assert(opc != NULL && strcmp(opc->_ident, "label") == 0, "Unimplemented Label"); + assert(false, "ShouldNotReachHere()"); } // all done } @@ -3305,9 +3306,11 @@ // Output the definitions for machine node specific pipeline data _machnodes.reset(); - for ( ; (machnode = (MachNodeForm*)_machnodes.iter()) != NULL; ) { - fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %sNode::pipeline() const { return (&pipeline_class_%03d); }\n", - machnode->_ident, ((class PipeClassForm *)_pipeline->_classdict[machnode->_machnode_pipe])->_num); + if (_pipeline != NULL) { + for ( ; (machnode = (MachNodeForm*)_machnodes.iter()) != NULL; ) { + fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %sNode::pipeline() const { return (&pipeline_class_%03d); }\n", + machnode->_ident, ((class PipeClassForm *)_pipeline->_classdict[machnode->_machnode_pipe])->_num); + } } fprintf(_CPP_PIPELINE_file._fp, "\n"); @@ -3315,13 +3318,15 @@ // Output the definitions for instruction pipeline static data references _instructions.reset(); - for ( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) { - if (instr->_ins_pipe && _pipeline->_classlist.search(instr->_ins_pipe)) { - fprintf(_CPP_PIPELINE_file._fp, "\n"); - fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline_class() { return (&pipeline_class_%03d); }\n", - max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num); - fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline() const { return (&pipeline_class_%03d); }\n", - max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num); + if (_pipeline != NULL) { + for ( ; (instr = (InstructForm*)_instructions.iter()) != NULL; ) { + if (instr->_ins_pipe && _pipeline->_classlist.search(instr->_ins_pipe)) { + fprintf(_CPP_PIPELINE_file._fp, "\n"); + fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline_class() { return (&pipeline_class_%03d); }\n", + max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num); + fprintf(_CPP_PIPELINE_file._fp, "const Pipeline * %*sNode::pipeline() const { return (&pipeline_class_%03d); }\n", + max_ident_len, instr->_ident, ((class PipeClassForm *)_pipeline->_classdict[instr->_ins_pipe])->_num); + } } } } diff -Nru openjdk-11-11~19/src/hotspot/share/aot/aotCodeHeap.cpp openjdk-11-11~24/src/hotspot/share/aot/aotCodeHeap.cpp --- openjdk-11-11~19/src/hotspot/share/aot/aotCodeHeap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/aot/aotCodeHeap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -29,7 +29,7 @@ #include "classfile/javaAssertions.hpp" #include "gc/shared/cardTable.hpp" #include "gc/shared/cardTableBarrierSet.hpp" -#include "gc/shared/collectedHeap.hpp" +#include "gc/shared/gcConfig.hpp" #include "gc/g1/heapRegion.hpp" #include "interpreter/abstractInterpreter.hpp" #include "jvmci/compilerRuntime.hpp" @@ -160,10 +160,15 @@ // Check configuration size verify_flag(_config->_config_size, AOTConfiguration::CONFIG_SIZE, "AOT configuration size"); + // Check GC + CollectedHeap::Name gc = (CollectedHeap::Name)_config->_gc; + if (_valid && !GCConfig::is_gc_selected(gc)) { + handle_config_error("Shared file %s error: used '%s' is different from current '%s'", _name, GCConfig::hs_err_name(gc), GCConfig::hs_err_name()); + } + // Check flags verify_flag(_config->_useCompressedOops, UseCompressedOops, "UseCompressedOops"); verify_flag(_config->_useCompressedClassPointers, UseCompressedClassPointers, "UseCompressedClassPointers"); - verify_flag(_config->_useG1GC, UseG1GC, "UseG1GC"); verify_flag(_config->_useTLAB, UseTLAB, "UseTLAB"); verify_flag(_config->_useBiasedLocking, UseBiasedLocking, "UseBiasedLocking"); verify_flag(_config->_objectAlignment, ObjectAlignmentInBytes, "ObjectAlignmentInBytes"); @@ -450,6 +455,7 @@ SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_object_notify", address, JVMCIRuntime::object_notify); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_object_notifyAll", address, JVMCIRuntime::object_notifyAll); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_OSR_migration_end", address, SharedRuntime::OSR_migration_end); + SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_enable_stack_reserved_zone", address, SharedRuntime::enable_stack_reserved_zone); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_resolve_dynamic_invoke", address, CompilerRuntime::resolve_dynamic_invoke); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_resolve_string_by_symbol", address, CompilerRuntime::resolve_string_by_symbol); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_resolve_klass_by_symbol", address, CompilerRuntime::resolve_klass_by_symbol); @@ -520,6 +526,7 @@ SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_stub_routines_counterMode_AESCrypt", address, StubRoutines::_counterMode_AESCrypt); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_stub_routines_ghash_processBlocks", address, StubRoutines::_ghash_processBlocks); + SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_stub_routines_base64_encodeBlock", address, StubRoutines::_base64_encodeBlock); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_stub_routines_crc32c_table_addr", address, StubRoutines::_crc32c_table_addr); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_stub_routines_updateBytesCRC32C", address, StubRoutines::_updateBytesCRC32C); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_stub_routines_updateBytesAdler32", address, StubRoutines::_updateBytesAdler32); @@ -548,7 +555,7 @@ _lib_symbols_initialized = true; CollectedHeap* heap = Universe::heap(); - SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_card_table_address", address, ci_card_table_address()); + SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_card_table_address", address, (BarrierSet::barrier_set()->is_a(BarrierSet::CardTableBarrierSet) ? ci_card_table_address() : NULL)); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_top_address", address, (heap->supports_inline_contig_alloc() ? heap->top_addr() : NULL)); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_heap_end_address", address, (heap->supports_inline_contig_alloc() ? heap->end_addr() : NULL)); SET_AOT_GLOBAL_SYMBOL_VALUE("_aot_polling_page", address, os::get_polling_page()); diff -Nru openjdk-11-11~19/src/hotspot/share/aot/aotCodeHeap.hpp openjdk-11-11~24/src/hotspot/share/aot/aotCodeHeap.hpp --- openjdk-11-11~19/src/hotspot/share/aot/aotCodeHeap.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/aot/aotCodeHeap.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -92,8 +92,8 @@ } AOTHeader; typedef struct { - enum { CONFIG_SIZE = 7 * jintSize + 12 }; - // 7 int values + enum { CONFIG_SIZE = 8 * jintSize + 11 }; + // 8 int values int _config_size; int _narrowOopShift; int _narrowKlassShift; @@ -101,12 +101,12 @@ int _fieldsAllocationStyle; int _objectAlignment; int _codeSegmentSize; - // byte[12] array map to boolean values here + int _gc; + // byte[11] array map to boolean values here bool _debug_VM; bool _useCompressedOops; bool _useCompressedClassPointers; bool _compactFields; - bool _useG1GC; bool _useTLAB; bool _useBiasedLocking; bool _tieredAOT; diff -Nru openjdk-11-11~19/src/hotspot/share/aot/aotCompiledMethod.cpp openjdk-11-11~24/src/hotspot/share/aot/aotCompiledMethod.cpp --- openjdk-11-11~19/src/hotspot/share/aot/aotCompiledMethod.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/aot/aotCompiledMethod.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -272,6 +272,7 @@ if (md != _method) f(md); } } else if (iter.type() == relocInfo::virtual_call_type) { + ResourceMark rm; // Check compiledIC holders associated with this nmethod CompiledIC *ic = CompiledIC_at(&iter); if (ic->is_icholder_call()) { @@ -444,6 +445,7 @@ return; } + ResourceMark rm; RelocIterator iter(this); while (iter.next()) { iter.reloc()->clear_inline_cache(); diff -Nru openjdk-11-11~19/src/hotspot/share/asm/codeBuffer.cpp openjdk-11-11~24/src/hotspot/share/asm/codeBuffer.cpp --- openjdk-11-11~19/src/hotspot/share/asm/codeBuffer.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/asm/codeBuffer.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -187,7 +187,7 @@ cs->_limit = new_limit; cs->_locs_limit = new_locs_limit; cs->_frozen = true; - if (!next_cs->is_allocated() && !next_cs->is_frozen()) { + if (next_cs != NULL && !next_cs->is_allocated() && !next_cs->is_frozen()) { // Give remaining buffer space to the following section. next_cs->initialize(new_limit, old_limit - new_limit); next_cs->initialize_shared_locs(new_locs_limit, @@ -494,10 +494,13 @@ // Compute initial padding; assign it to the previous non-empty guy. // Cf. figure_expanded_capacities. csize_t padding = cs->align_at_start(buf_offset) - buf_offset; - if (padding != 0) { - buf_offset += padding; - assert(prev_dest_cs != NULL, "sanity"); - prev_dest_cs->_limit += padding; + if (prev_dest_cs != NULL) { + if (padding != 0) { + buf_offset += padding; + prev_dest_cs->_limit += padding; + } + } else { + guarantee(padding == 0, "In first iteration no padding should be needed."); } #ifdef ASSERT if (prev_cs != NULL && prev_cs->is_frozen() && n < (SECT_LIMIT - 1)) { diff -Nru openjdk-11-11~19/src/hotspot/share/c1/c1_IR.cpp openjdk-11-11~24/src/hotspot/share/c1/c1_IR.cpp --- openjdk-11-11~19/src/hotspot/share/c1/c1_IR.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/c1/c1_IR.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1386,7 +1386,7 @@ n->values_do(this); // need to remove this instruction from the instruction stream if (n->subst() != n) { - assert(last != NULL, "must have last"); + guarantee(last != NULL, "must have last"); last->set_next(n->next()); } else { last = n; diff -Nru openjdk-11-11~19/src/hotspot/share/c1/c1_LinearScan.cpp openjdk-11-11~24/src/hotspot/share/c1/c1_LinearScan.cpp --- openjdk-11-11~19/src/hotspot/share/c1/c1_LinearScan.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/c1/c1_LinearScan.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3954,7 +3954,7 @@ if (!processed_interval) { // no move could be processed because there is a cycle in the move list // (e.g. r1 -> r2, r2 -> r1), so one interval must be spilled to memory - assert(spill_candidate != -1, "no interval in register for spilling found"); + guarantee(spill_candidate != -1, "no interval in register for spilling found"); // create a new spill interval and assign a stack slot to it Interval* from_interval = _mapping_from.at(spill_candidate); @@ -6301,7 +6301,8 @@ assert(prev_branch->cond() == prev_cmp->condition(), "should be the same"); } } - assert(prev_cmp != NULL, "should have found comp instruction for branch"); + // Guarantee because it is dereferenced below. + guarantee(prev_cmp != NULL, "should have found comp instruction for branch"); if (prev_branch->block() == code->at(i + 1) && prev_branch->info() == NULL) { TRACE_LINEAR_SCAN(3, tty->print_cr("Negating conditional branch and deleting unconditional branch at end of block B%d", block->block_id())); diff -Nru openjdk-11-11~19/src/hotspot/share/c1/c1_LIRGenerator.cpp openjdk-11-11~24/src/hotspot/share/c1/c1_LIRGenerator.cpp --- openjdk-11-11~19/src/hotspot/share/c1/c1_LIRGenerator.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/c1/c1_LIRGenerator.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1602,7 +1602,7 @@ array_store_check(value.result(), array.result(), store_check_info, x->profiled_method(), x->profiled_bci()); } - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; + DecoratorSet decorators = IN_HEAP | IS_ARRAY; if (x->check_boolean()) { decorators |= C1_MASK_BOOLEAN; } @@ -1847,7 +1847,7 @@ } } - DecoratorSet decorators = IN_HEAP | IN_HEAP_ARRAY; + DecoratorSet decorators = IN_HEAP | IS_ARRAY; LIR_Opr result = rlock_result(x, x->elt_type()); access_load_at(decorators, x->elt_type(), @@ -2311,7 +2311,9 @@ if (compilation()->env()->comp_level() == CompLevel_full_profile && UseSwitchProfiling) { ciMethod* method = x->state()->scope()->method(); ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(x->state()->bci()); + assert(data != NULL, "must have profiling data"); assert(data->is_MultiBranchData(), "bad profile data?"); int default_count_offset = md->byte_offset_of_slot(data, MultiBranchData::default_count_offset()); LIR_Opr md_reg = new_register(T_METADATA); @@ -2367,7 +2369,9 @@ if (compilation()->env()->comp_level() == CompLevel_full_profile && UseSwitchProfiling) { ciMethod* method = x->state()->scope()->method(); ciMethodData* md = method->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(x->state()->bci()); + assert(data != NULL, "must have profiling data"); assert(data->is_MultiBranchData(), "bad profile data?"); int default_count_offset = md->byte_offset_of_slot(data, MultiBranchData::default_count_offset()); LIR_Opr md_reg = new_register(T_METADATA); @@ -3076,6 +3080,7 @@ if (compilation()->profile_arguments()) { int bci = x->bci_of_invoke(); ciMethodData* md = x->method()->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(bci); if (data != NULL) { if ((data->is_CallTypeData() && data->as_CallTypeData()->has_arguments()) || @@ -3212,6 +3217,7 @@ void LIRGenerator::do_ProfileReturnType(ProfileReturnType* x) { int bci = x->bci_of_invoke(); ciMethodData* md = x->method()->method_data_or_null(); + assert(md != NULL, "Sanity"); ciProfileData* data = md->bci_to_data(bci); if (data != NULL) { assert(data->is_CallTypeData() || data->is_VirtualCallTypeData(), "wrong profile data type"); diff -Nru openjdk-11-11~19/src/hotspot/share/ci/ciEnv.cpp openjdk-11-11~24/src/hotspot/share/ci/ciEnv.cpp --- openjdk-11-11~19/src/hotspot/share/ci/ciEnv.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/ci/ciEnv.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -938,9 +938,9 @@ _inc_decompile_count_on_failure = false; record_failure("call site target change"); } else if (Dependencies::is_klass_type(result)) { - record_failure("invalid non-klass dependency"); - } else { record_failure("concurrent class loading"); + } else { + record_failure("invalid non-klass dependency"); } } } diff -Nru openjdk-11-11~19/src/hotspot/share/ci/ciField.cpp openjdk-11-11~24/src/hotspot/share/ci/ciField.cpp --- openjdk-11-11~19/src/hotspot/share/ci/ciField.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/ci/ciField.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -70,22 +70,22 @@ ciField::ciField(ciInstanceKlass* klass, int index) : _known_to_link_with_put(NULL), _known_to_link_with_get(NULL) { ASSERT_IN_VM; - CompilerThread *thread = CompilerThread::current(); + CompilerThread *THREAD = CompilerThread::current(); assert(ciObjectFactory::is_initialized(), "not a shared field"); assert(klass->get_instanceKlass()->is_linked(), "must be linked before using its constant-pool"); - constantPoolHandle cpool(thread, klass->get_instanceKlass()->constants()); + constantPoolHandle cpool(THREAD, klass->get_instanceKlass()->constants()); // Get the field's name, signature, and type. Symbol* name = cpool->name_ref_at(index); - _name = ciEnv::current(thread)->get_symbol(name); + _name = ciEnv::current(THREAD)->get_symbol(name); int nt_index = cpool->name_and_type_ref_index_at(index); int sig_index = cpool->signature_ref_index_at(nt_index); Symbol* signature = cpool->symbol_at(sig_index); - _signature = ciEnv::current(thread)->get_symbol(signature); + _signature = ciEnv::current(THREAD)->get_symbol(signature); BasicType field_type = FieldType::basic_type(signature); @@ -95,12 +95,12 @@ bool ignore; // This is not really a class reference; the index always refers to the // field's type signature, as a symbol. Linkage checks do not apply. - _type = ciEnv::current(thread)->get_klass_by_index(cpool, sig_index, ignore, klass); + _type = ciEnv::current(THREAD)->get_klass_by_index(cpool, sig_index, ignore, klass); } else { _type = ciType::make(field_type); } - _name = (ciSymbol*)ciEnv::current(thread)->get_symbol(name); + _name = (ciSymbol*)ciEnv::current(THREAD)->get_symbol(name); // Get the field's declared holder. // @@ -109,7 +109,7 @@ int holder_index = cpool->klass_ref_index_at(index); bool holder_is_accessible; - ciKlass* generic_declared_holder = ciEnv::current(thread)->get_klass_by_index(cpool, holder_index, + ciKlass* generic_declared_holder = ciEnv::current(THREAD)->get_klass_by_index(cpool, holder_index, holder_is_accessible, klass); @@ -126,7 +126,7 @@ // handling in ciField::will_link and will result in a // java.lang.NoSuchFieldError exception being thrown by the compiled // code (the expected behavior in this case). - _holder = ciEnv::current(thread)->Object_klass(); + _holder = ciEnv::current(THREAD)->Object_klass(); _offset = -1; _is_constant = false; return; @@ -164,10 +164,22 @@ // to check access because it can erroneously succeed. If this check fails, // propagate the declared holder to will_link() which in turn will bail out // compilation for this field access. - if (!Reflection::verify_field_access(klass->get_Klass(), declared_holder->get_Klass(), canonical_holder, field_desc.access_flags(), true)) { + bool can_access = Reflection::verify_member_access(klass->get_Klass(), + declared_holder->get_Klass(), + canonical_holder, + field_desc.access_flags(), + true, false, THREAD); + if (!can_access) { _holder = declared_holder; _offset = -1; _is_constant = false; + // It's possible the access check failed due to a nestmate access check + // encountering an exception. We can't propagate the exception from here + // so we have to clear it. If the access check happens again in a different + // context then the exception will be thrown there. + if (HAS_PENDING_EXCEPTION) { + CLEAR_PENDING_EXCEPTION; + } return; } diff -Nru openjdk-11-11~19/src/hotspot/share/ci/ciStreams.cpp openjdk-11-11~24/src/hotspot/share/ci/ciStreams.cpp --- openjdk-11-11~19/src/hotspot/share/ci/ciStreams.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/ci/ciStreams.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -255,8 +255,7 @@ // constant. constantTag ciBytecodeStream::get_constant_pool_tag(int index) const { VM_ENTRY_MARK; - BasicType bt = _method->get_Method()->constants()->basic_type_for_constant_at(index); - return constantTag::ofBasicType(bt); + return _method->get_Method()->constants()->constant_tag_at(index); } // ------------------------------------------------------------------ diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/classFileParser.cpp openjdk-11-11~24/src/hotspot/share/classfile/classFileParser.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/classFileParser.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/classFileParser.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -955,9 +955,10 @@ if (!interf->is_interface()) { THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), - err_msg("Class %s can not implement %s, because it is not an interface", + err_msg("class %s can not implement %s, because it is not an interface (%s)", _class_name->as_klass_external_name(), - interf->class_loader_and_module_name())); + interf->external_name(), + interf->class_in_module_of_loader())); } if (InstanceKlass::cast(interf)->has_nonstatic_concrete_methods()) { @@ -3148,7 +3149,6 @@ _inner_classes = inner_classes; int index = 0; - const int cp_size = _cp->length(); cfs->guarantee_more(8 * length, CHECK_0); // 4-tuples of u2 for (int n = 0; n < length; n++) { // Inner class index @@ -3222,6 +3222,38 @@ return length; } +u2 ClassFileParser::parse_classfile_nest_members_attribute(const ClassFileStream* const cfs, + const u1* const nest_members_attribute_start, + TRAPS) { + const u1* const current_mark = cfs->current(); + u2 length = 0; + if (nest_members_attribute_start != NULL) { + cfs->set_current(nest_members_attribute_start); + cfs->guarantee_more(2, CHECK_0); // length + length = cfs->get_u2_fast(); + } + const int size = length; + Array* const nest_members = MetadataFactory::new_array(_loader_data, size, CHECK_0); + _nest_members = nest_members; + + int index = 0; + cfs->guarantee_more(2 * length, CHECK_0); + for (int n = 0; n < length; n++) { + const u2 class_info_index = cfs->get_u2_fast(); + check_property( + valid_klass_reference_at(class_info_index), + "Nest member class_info_index %u has bad constant type in class file %s", + class_info_index, CHECK_0); + nest_members->at_put(index++, class_info_index); + } + assert(index == size, "wrong size"); + + // Restore buffer's current position. + cfs->set_current(current_mark); + + return length; +} + void ClassFileParser::parse_classfile_synthetic_attribute(TRAPS) { set_class_synthetic_flag(true); } @@ -3329,10 +3361,14 @@ // Set inner classes attribute to default sentinel _inner_classes = Universe::the_empty_short_array(); + // Set nest members attribute to default sentinel + _nest_members = Universe::the_empty_short_array(); cfs->guarantee_more(2, CHECK); // attributes_count u2 attributes_count = cfs->get_u2_fast(); bool parsed_sourcefile_attribute = false; bool parsed_innerclasses_attribute = false; + bool parsed_nest_members_attribute = false; + bool parsed_nest_host_attribute = false; bool parsed_enclosingmethod_attribute = false; bool parsed_bootstrap_methods_attribute = false; const u1* runtime_visible_annotations = NULL; @@ -3350,6 +3386,9 @@ u4 inner_classes_attribute_length = 0; u2 enclosing_method_class_index = 0; u2 enclosing_method_method_index = 0; + const u1* nest_members_attribute_start = NULL; + u4 nest_members_attribute_length = 0; + // Iterate over attributes while (attributes_count--) { cfs->guarantee_more(6, CHECK); // attribute_name_index, attribute_length @@ -3498,6 +3537,40 @@ assert(runtime_invisible_type_annotations != NULL, "null invisible type annotations"); } cfs->skip_u1(attribute_length, CHECK); + } else if (_major_version >= JAVA_11_VERSION) { + if (tag == vmSymbols::tag_nest_members()) { + // Check for NestMembers tag + if (parsed_nest_members_attribute) { + classfile_parse_error("Multiple NestMembers attributes in class file %s", CHECK); + } else { + parsed_nest_members_attribute = true; + } + if (parsed_nest_host_attribute) { + classfile_parse_error("Conflicting NestHost and NestMembers attributes in class file %s", CHECK); + } + nest_members_attribute_start = cfs->current(); + nest_members_attribute_length = attribute_length; + cfs->skip_u1(nest_members_attribute_length, CHECK); + } else if (tag == vmSymbols::tag_nest_host()) { + if (parsed_nest_host_attribute) { + classfile_parse_error("Multiple NestHost attributes in class file %s", CHECK); + } else { + parsed_nest_host_attribute = true; + } + if (parsed_nest_members_attribute) { + classfile_parse_error("Conflicting NestMembers and NestHost attributes in class file %s", CHECK); + } + if (_need_verify) { + guarantee_property(attribute_length == 2, "Wrong NestHost attribute length in class file %s", CHECK); + } + cfs->guarantee_more(2, CHECK); + u2 class_info_index = cfs->get_u2_fast(); + check_property( + valid_klass_reference_at(class_info_index), + "Nest-host class_info_index %u has bad constant type in class file %s", + class_info_index, CHECK); + _nest_host = class_info_index; + } } else { // Unknown attribute cfs->skip_u1(attribute_length, CHECK); @@ -3526,13 +3599,25 @@ enclosing_method_class_index, enclosing_method_method_index, CHECK); - if (parsed_innerclasses_attribute &&_need_verify && _major_version >= JAVA_1_5_VERSION) { + if (parsed_innerclasses_attribute && _need_verify && _major_version >= JAVA_1_5_VERSION) { guarantee_property( inner_classes_attribute_length == sizeof(num_of_classes) + 4 * sizeof(u2) * num_of_classes, "Wrong InnerClasses attribute length in class file %s", CHECK); } } + if (parsed_nest_members_attribute) { + const u2 num_of_classes = parse_classfile_nest_members_attribute( + cfs, + nest_members_attribute_start, + CHECK); + if (_need_verify) { + guarantee_property( + nest_members_attribute_length == sizeof(num_of_classes) + sizeof(u2) * num_of_classes, + "Wrong NestMembers attribute length in class file %s", CHECK); + } + } + if (_max_bootstrap_specifier_index >= 0) { guarantee_property(parsed_bootstrap_methods_attribute, "Missing BootstrapMethods attribute in class file %s", CHECK); @@ -3595,6 +3680,8 @@ this_klass->set_fields(_fields, java_fields_count); this_klass->set_methods(_methods); this_klass->set_inner_classes(_inner_classes); + this_klass->set_nest_members(_nest_members); + this_klass->set_nest_host_index(_nest_host); this_klass->set_local_interfaces(_local_interfaces); this_klass->set_annotations(_combined_annotations); // Delay the setting of _transitive_interfaces until after initialize_supers() in @@ -4525,12 +4612,17 @@ InstanceKlass::cast(super), vca_result); if (msg == NULL) { + bool same_module = (this_klass->module() == super->module()); Exceptions::fthrow( THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalAccessError(), - "class %s cannot access its superclass %s", + "class %s cannot access its %ssuperclass %s (%s%s%s)", this_klass->external_name(), - super->external_name()); + super->is_abstract() ? "abstract " : "", + super->external_name(), + (same_module) ? this_klass->joint_in_module_of_loader(super) : this_klass->class_in_module_of_loader(), + (same_module) ? "" : "; ", + (same_module) ? "" : super->class_in_module_of_loader()); } else { // Add additional message content. Exceptions::fthrow( @@ -4559,12 +4651,16 @@ InstanceKlass::cast(k), vca_result); if (msg == NULL) { + bool same_module = (this_klass->module() == k->module()); Exceptions::fthrow( THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalAccessError(), - "class %s cannot access its superinterface %s", + "class %s cannot access its superinterface %s (%s%s%s)", this_klass->external_name(), - k->external_name()); + k->external_name(), + (same_module) ? this_klass->joint_in_module_of_loader(k) : this_klass->class_in_module_of_loader(), + (same_module) ? "" : "; ", + (same_module) ? "" : k->class_in_module_of_loader()); } else { // Add additional message content. Exceptions::fthrow( @@ -4605,24 +4701,26 @@ } if (super_m->is_final() && !super_m->is_static() && - // matching method in super is final, and not static - (Reflection::verify_field_access(this_klass, - super_m->method_holder(), - super_m->method_holder(), - super_m->access_flags(), false)) - // this class can access super final method and therefore override - ) { - ResourceMark rm(THREAD); - Exceptions::fthrow( - THREAD_AND_LOCATION, - vmSymbols::java_lang_VerifyError(), - "class %s overrides final method %s.%s%s", - this_klass->external_name(), - super_m->method_holder()->external_name(), - name->as_C_string(), - signature->as_C_string() - ); - return; + !super_m->access_flags().is_private()) { + // matching method in super is final, and not static or private + bool can_access = Reflection::verify_member_access(this_klass, + super_m->method_holder(), + super_m->method_holder(), + super_m->access_flags(), + false, false, CHECK); + if (can_access) { + // this class can access super final method and therefore override + ResourceMark rm(THREAD); + Exceptions::fthrow(THREAD_AND_LOCATION, + vmSymbols::java_lang_VerifyError(), + "class %s overrides final method %s.%s%s", + this_klass->external_name(), + super_m->method_holder()->external_name(), + name->as_C_string(), + signature->as_C_string() + ); + return; + } } // continue to look from super_m's holder's super. @@ -5470,6 +5568,7 @@ assert(NULL == _fields, "invariant"); assert(NULL == _methods, "invariant"); assert(NULL == _inner_classes, "invariant"); + assert(NULL == _nest_members, "invariant"); assert(NULL == _local_interfaces, "invariant"); assert(NULL == _combined_annotations, "invariant"); @@ -5739,6 +5838,8 @@ _fields(NULL), _methods(NULL), _inner_classes(NULL), + _nest_members(NULL), + _nest_host(0), _local_interfaces(NULL), _transitive_interfaces(NULL), _combined_annotations(NULL), @@ -5843,6 +5944,7 @@ _fields = NULL; _methods = NULL; _inner_classes = NULL; + _nest_members = NULL; _local_interfaces = NULL; _combined_annotations = NULL; _annotations = _type_annotations = NULL; @@ -5868,6 +5970,10 @@ MetadataFactory::free_array(_loader_data, _inner_classes); } + if (_nest_members != NULL && _nest_members != Universe::the_empty_short_array()) { + MetadataFactory::free_array(_loader_data, _nest_members); + } + // Free interfaces InstanceKlass::deallocate_interfaces(_loader_data, _super_klass, _local_interfaces, _transitive_interfaces); diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/classFileParser.hpp openjdk-11-11~24/src/hotspot/share/classfile/classFileParser.hpp --- openjdk-11-11~19/src/hotspot/share/classfile/classFileParser.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/classFileParser.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -97,6 +97,8 @@ Array* _fields; Array* _methods; Array* _inner_classes; + Array* _nest_members; + u2 _nest_host; Array* _local_interfaces; Array* _transitive_interfaces; Annotations* _combined_annotations; @@ -290,6 +292,10 @@ u2 enclosing_method_method_index, TRAPS); + u2 parse_classfile_nest_members_attribute(const ClassFileStream* const cfs, + const u1* const nest_members_attribute_start, + TRAPS); + void parse_classfile_attributes(const ClassFileStream* const cfs, ConstantPool* cp, ClassAnnotationCollector* parsed_annotations, diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/classLoaderData.cpp openjdk-11-11~24/src/hotspot/share/classfile/classLoaderData.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/classLoaderData.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/classLoaderData.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -109,10 +109,9 @@ // it will be available for error messages, logging, JFR, etc. The name // and klass are available after the class_loader oop is no longer alive, // during unloading. -void ClassLoaderData::initialize_name_and_klass(Handle class_loader) { +void ClassLoaderData::initialize_name(Handle class_loader) { Thread* THREAD = Thread::current(); ResourceMark rm(THREAD); - _class_loader_klass = class_loader->klass(); // Obtain the class loader's name. If the class loader's name was not // explicitly set during construction, the CLD's _name field will be null. @@ -159,6 +158,7 @@ if (!h_class_loader.is_null()) { _class_loader = _handles.add(h_class_loader()); + _class_loader_klass = h_class_loader->klass(); } if (!is_anonymous) { @@ -832,9 +832,7 @@ oop* ptr = h.ptr_raw(); if (ptr != NULL) { assert(_handles.owner_of(ptr), "Got unexpected handle " PTR_FORMAT, p2i(ptr)); - // This root is not walked in safepoints, and hence requires an appropriate - // decorator that e.g. maintains the SATB invariant in SATB collectors. - NativeAccess::oop_store(ptr, oop(NULL)); + NativeAccess<>::oop_store(ptr, oop(NULL)); } } @@ -951,9 +949,11 @@ const char* ClassLoaderData::loader_name_and_id() const { if (_class_loader_klass == NULL) { return "'" BOOTSTRAP_LOADER_NAME "'"; - } else { - assert(_name_and_id != NULL, "encountered a class loader null name and id"); + } else if (_name_and_id != NULL) { return _name_and_id->as_C_string(); + } else { + // May be called in a race before _name_and_id is initialized. + return _class_loader_klass->external_name(); } } @@ -1069,10 +1069,10 @@ ClassLoaderData* ClassLoaderDataGraph::add(Handle loader, bool is_anonymous) { ClassLoaderData* loader_data = add_to_graph(loader, is_anonymous); - // Initialize name and class after the loader data is added to the CLDG - // because adding the Symbol for the name might safepoint. + // Initialize _name and _name_and_id after the loader data is added to the + // CLDG because adding the Symbol for _name and _name_and_id might safepoint. if (loader.not_null()) { - loader_data->initialize_name_and_klass(loader); + loader_data->initialize_name(loader); } return loader_data; } diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/classLoaderData.hpp openjdk-11-11~24/src/hotspot/share/classfile/classLoaderData.hpp --- openjdk-11-11~19/src/hotspot/share/classfile/classLoaderData.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/classLoaderData.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -210,7 +210,7 @@ friend class ClassLoaderDataGraphKlassIteratorAtomic; friend class ClassLoaderDataGraphKlassIteratorStatic; friend class ClassLoaderDataGraphMetaspaceIterator; - friend class InstanceKlass; + friend class Klass; friend class MetaDataFactory; friend class Method; @@ -305,7 +305,7 @@ Dictionary* create_dictionary(); - void initialize_name_and_klass(Handle class_loader); + void initialize_name(Handle class_loader); public: // GC interface. void clear_claimed() { _claimed = 0; } diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp openjdk-11-11~24/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/classLoaderHierarchyDCmd.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -36,11 +36,13 @@ ClassLoaderHierarchyDCmd::ClassLoaderHierarchyDCmd(outputStream* output, bool heap) - : DCmdWithParser(output, heap) - , _show_classes("show-classes", "Print loaded classes.", "BOOLEAN", false, "false") - , _verbose("verbose", "Print detailed information.", "BOOLEAN", false, "false") { + : DCmdWithParser(output, heap), + _show_classes("show-classes", "Print loaded classes.", "BOOLEAN", false, "false"), + _verbose("verbose", "Print detailed information.", "BOOLEAN", false, "false"), + _fold("fold", "Show loaders of the same name and class as one.", "BOOLEAN", true, "true") { _dcmdparser.add_dcmd_option(&_show_classes); _dcmdparser.add_dcmd_option(&_verbose); + _dcmdparser.add_dcmd_option(&_fold); } @@ -127,10 +129,12 @@ class LoaderTreeNode : public ResourceObj { // We walk the CLDG and, for each CLD which is non-anonymous, add - // a tree node. To add a node we need its parent node; if it itself - // does not exist yet, we add a preliminary node for it. This preliminary - // node just contains its loader oop; later, when encountering its CLD in - // our CLDG walk, we complete the missing information in this node. + // a tree node. + // To add a node we need its parent node; if the parent node does not yet + // exist - because we have not yet encountered the CLD for the parent loader - + // we add a preliminary empty LoaderTreeNode for it. This preliminary node + // just contains the loader oop and nothing else. Once we encounter the CLD of + // this parent loader, we fill in all the other details. const oop _loader_oop; const ClassLoaderData* _cld; @@ -144,6 +148,12 @@ LoadedClassInfo* _anon_classes; int _num_anon_classes; + // In default view, similar tree nodes (same loader class, same name or no name) + // are folded into each other to make the output more readable. + // _num_folded contains the number of nodes which have been folded into this + // one. + int _num_folded; + void print_with_childs(outputStream* st, BranchTracker& branchtracker, bool print_classes, bool verbose) const { @@ -170,7 +180,9 @@ st->print(" \"%s\",", loader_name->as_C_string()); } st->print(" %s", loader_klass != NULL ? loader_klass->external_name() : "??"); - st->print(" {" PTR_FORMAT "}", p2i(_loader_oop)); + if (_num_folded > 0) { + st->print(" (+ %d more)", _num_folded); + } } st->cr(); @@ -193,6 +205,8 @@ if (verbose) { branchtracker.print(st); + st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Oop:", p2i(_loader_oop)); + branchtracker.print(st); st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Data:", p2i(_cld)); branchtracker.print(st); st->print_cr("%*s " PTR_FORMAT, indentation, "Loader Klass:", p2i(loader_klass)); @@ -246,7 +260,7 @@ // For anonymous classes, also print CLD if verbose. Should be a different one than the primary CLD. assert(lci->_cld != _cld, "must be"); if (verbose) { - st->print(" (CLD: " PTR_FORMAT ")", p2i(lci->_cld)); + st->print(" (Loader Data: " PTR_FORMAT ")", p2i(lci->_cld)); } st->cr(); } @@ -272,13 +286,22 @@ } + // Helper: Attempt to fold this node into the target node. If success, returns true. + // Folding can be done if both nodes are leaf nodes and they refer to the same loader class + // and they have the same name or no name (note: leaf check is done by caller). + bool can_fold_into(LoaderTreeNode* target_node) const { + assert(is_leaf() && target_node->is_leaf(), "must be leaf"); + return _cld->class_loader_klass() == target_node->_cld->class_loader_klass() && + _cld->name() == target_node->_cld->name(); + } + public: LoaderTreeNode(const oop loader_oop) - : _loader_oop(loader_oop), _cld(NULL) - , _child(NULL), _next(NULL) - , _classes(NULL), _anon_classes(NULL) - , _num_classes(0), _num_anon_classes(0) {} + : _loader_oop(loader_oop), _cld(NULL), _child(NULL), _next(NULL), + _classes(NULL), _anon_classes(NULL), _num_classes(0), _num_anon_classes(0), + _num_folded(0) + {} void set_cld(const ClassLoaderData* cld) { _cld = cld; @@ -331,6 +354,39 @@ return result; } + bool is_leaf() const { return _child == NULL; } + + // Attempt to fold similar nodes among this node's children. We only fold leaf nodes + // (no child class loaders). + // For non-leaf nodes (class loaders with child class loaders), do this recursivly. + void fold_children() { + LoaderTreeNode* node = _child; + LoaderTreeNode* prev = NULL; + while (node != NULL) { + LoaderTreeNode* matching_node = NULL; + if (node->is_leaf()) { + // Look among the preceeding node siblings for a match. + for (LoaderTreeNode* node2 = _child; node2 != node && matching_node == NULL; + node2 = node2->_next) { + if (node2->is_leaf() && node->can_fold_into(node2)) { + matching_node = node2; + } + } + } else { + node->fold_children(); + } + if (matching_node != NULL) { + // Increase fold count for the matching node and remove folded node from the child list. + matching_node->_num_folded ++; + assert(prev != NULL, "Sanity"); // can never happen since we do not fold the first node. + prev->_next = node->_next; + } else { + prev = node; + } + node = node->_next; + } + } + void print_with_childs(outputStream* st, bool print_classes, bool print_add_info) const { BranchTracker bwt; print_with_childs(st, bwt, print_classes, print_add_info); @@ -433,6 +489,10 @@ fill_in_classes(info, cld); } + void fold() { + _root->fold_children(); + } + }; @@ -440,9 +500,10 @@ outputStream* const _out; const bool _show_classes; const bool _verbose; + const bool _fold; public: - ClassLoaderHierarchyVMOperation(outputStream* out, bool show_classes, bool verbose) : - _out(out), _show_classes(show_classes), _verbose(verbose) + ClassLoaderHierarchyVMOperation(outputStream* out, bool show_classes, bool verbose, bool fold) : + _out(out), _show_classes(show_classes), _verbose(verbose), _fold(fold) {} VMOp_Type type() const { @@ -454,12 +515,18 @@ ResourceMark rm; LoaderInfoScanClosure cl (_show_classes, _verbose); ClassLoaderDataGraph::cld_do(&cl); + // In non-verbose and non-show-classes mode, attempt to fold the tree. + if (_fold) { + if (!_verbose && !_show_classes) { + cl.fold(); + } + } cl.print_results(_out); } }; // This command needs to be executed at a safepoint. void ClassLoaderHierarchyDCmd::execute(DCmdSource source, TRAPS) { - ClassLoaderHierarchyVMOperation op(output(), _show_classes.value(), _verbose.value()); + ClassLoaderHierarchyVMOperation op(output(), _show_classes.value(), _verbose.value(), _fold.value()); VMThread::execute(&op); } diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/classLoaderHierarchyDCmd.hpp openjdk-11-11~24/src/hotspot/share/classfile/classLoaderHierarchyDCmd.hpp --- openjdk-11-11~19/src/hotspot/share/classfile/classLoaderHierarchyDCmd.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/classLoaderHierarchyDCmd.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ class ClassLoaderHierarchyDCmd: public DCmdWithParser { DCmdArgument _show_classes; DCmdArgument _verbose; + DCmdArgument _fold; public: ClassLoaderHierarchyDCmd(outputStream* output, bool heap); diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/javaClasses.cpp openjdk-11-11~24/src/hotspot/share/classfile/javaClasses.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/javaClasses.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/javaClasses.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1265,10 +1265,10 @@ return size; } -void java_lang_Class::set_oop_size(oop java_class, int size) { +void java_lang_Class::set_oop_size(HeapWord* java_class, int size) { assert(_oop_size_offset != 0, "must be set"); assert(size > 0, "Oop size must be greater than zero, not %d", size); - java_class->int_field_put(_oop_size_offset, size); + *(int*)(((char*)java_class) + _oop_size_offset) = size; } int java_lang_Class::static_oop_field_count(oop java_class) { @@ -4425,6 +4425,12 @@ return obj->obj_field(_owner_offset); } +#if INCLUDE_CDS +void java_util_concurrent_locks_AbstractOwnableSynchronizer::serialize(SerializeClosure* f) { + AOS_FIELDS_DO(FIELD_SERIALIZE_OFFSET); +} +#endif + static int member_offset(int hardcoded_offset) { return (hardcoded_offset * heapOopSize) + instanceOopDesc::base_offset_in_bytes(); } diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/javaClasses.hpp openjdk-11-11~24/src/hotspot/share/classfile/javaClasses.hpp --- openjdk-11-11~19/src/hotspot/share/classfile/javaClasses.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/javaClasses.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -270,7 +270,7 @@ static oop module(oop java_class); static int oop_size(oop java_class); - static void set_oop_size(oop java_class, int size); + static void set_oop_size(HeapWord* java_class, int size); static int static_oop_field_count(oop java_class); static void set_static_oop_field_count(oop java_class, int size); @@ -1488,6 +1488,7 @@ public: static void compute_offsets(); static oop get_owner_threadObj(oop obj); + static void serialize(SerializeClosure* f) NOT_CDS_RETURN; }; // Use to declare fields that need to be injected into Java classes diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/klassFactory.cpp openjdk-11-11~24/src/hotspot/share/classfile/klassFactory.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/klassFactory.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/klassFactory.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -197,6 +197,9 @@ ClassFileStream* old_stream = stream; + // increment counter + THREAD->statistical_info().incr_define_class_count(); + // Skip this processing for VM anonymous classes if (host_klass == NULL) { stream = check_class_file_load_hook(stream, diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/moduleEntry.cpp openjdk-11-11~24/src/hotspot/share/classfile/moduleEntry.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/moduleEntry.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/moduleEntry.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -387,7 +387,8 @@ entry->set_is_patched(); if (log_is_enabled(Trace, module, patch)) { ResourceMark rm; - log_trace(module, patch)("Marked module %s as patched from --patch-module", name->as_C_string()); + log_trace(module, patch)("Marked module %s as patched from --patch-module", + name != NULL ? name->as_C_string() : UNNAMED_MODULE); } } diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/moduleEntry.hpp openjdk-11-11~24/src/hotspot/share/classfile/moduleEntry.hpp --- openjdk-11-11~19/src/hotspot/share/classfile/moduleEntry.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/moduleEntry.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -40,10 +40,12 @@ #include "jfr/support/jfrTraceIdExtension.hpp" #endif -#define UNNAMED_MODULE "Unnamed Module" +#define UNNAMED_MODULE "unnamed module" +#define UNNAMED_MODULE_LEN 14 #define JAVAPKG "java" #define JAVAPKG_LEN 4 #define JAVA_BASE_NAME "java.base" +#define JAVA_BASE_NAME_LEN 9 class ModuleClosure; diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/stackMapTableFormat.hpp openjdk-11-11~24/src/hotspot/share/classfile/stackMapTableFormat.hpp --- openjdk-11-11~19/src/hotspot/share/classfile/stackMapTableFormat.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/stackMapTableFormat.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -150,7 +150,7 @@ case ITEM_Object: st->print("Object[#%d]", cpool_index()); break; default: - assert(false, "Bad verification_type_info"); + st->print("BAD:%d", tag()); break; } } }; diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/stringTable.cpp openjdk-11-11~24/src/hotspot/share/classfile/stringTable.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/stringTable.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/stringTable.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -499,7 +499,6 @@ StringTableDeleteCheck stdc; StringTableDoDelete stdd; - bool interrupted = false; { TraceTime timer("Clean", TRACETIME_LOG(Debug, stringtable, perf)); while(bdt.do_task(jt, stdc, stdd)) { @@ -507,15 +506,8 @@ { ThreadBlockInVM tbivm(jt); } - if (!bdt.cont(jt)) { - interrupted = true; - break; - } + bdt.cont(jt); } - } - if (interrupted) { - _has_work = true; - } else { bdt.done(jt); } log_debug(stringtable)("Cleaned %ld of %ld", stdc._count, stdc._item); diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/systemDictionary.cpp openjdk-11-11~24/src/hotspot/share/classfile/systemDictionary.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/systemDictionary.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/systemDictionary.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -245,10 +245,6 @@ // Forwards to resolve_instance_class_or_null Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader, Handle protection_domain, TRAPS) { - assert(THREAD->can_call_java(), - "can not load classes with compiler thread: class=%s, classloader=%s", - class_name->as_C_string(), - class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()); if (FieldType::is_array(class_name)) { return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD); } else if (FieldType::is_obj(class_name)) { @@ -692,6 +688,10 @@ PlaceholderEntry* placeholder; Symbol* superclassname = NULL; + assert(THREAD->can_call_java(), + "can not load classes with compiler thread: class=%s, classloader=%s", + name->as_C_string(), + class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()); { MutexLocker mu(SystemDictionary_lock, THREAD); InstanceKlass* check = find_class(d_hash, name, dictionary); @@ -1364,18 +1364,18 @@ // notify a class loaded from shared object ClassLoadingService::notify_class_loaded(ik, true /* shared class */); - } - ik->set_has_passed_fingerprint_check(false); - if (UseAOT && ik->supers_have_passed_fingerprint_checks()) { - uint64_t aot_fp = AOTLoader::get_saved_fingerprint(ik); - uint64_t cds_fp = ik->get_stored_fingerprint(); - if (aot_fp != 0 && aot_fp == cds_fp) { - // This class matches with a class saved in an AOT library - ik->set_has_passed_fingerprint_check(true); - } else { - ResourceMark rm; - log_info(class, fingerprint)("%s : expected = " PTR64_FORMAT " actual = " PTR64_FORMAT, ik->external_name(), aot_fp, cds_fp); + ik->set_has_passed_fingerprint_check(false); + if (UseAOT && ik->supers_have_passed_fingerprint_checks()) { + uint64_t aot_fp = AOTLoader::get_saved_fingerprint(ik); + uint64_t cds_fp = ik->get_stored_fingerprint(); + if (aot_fp != 0 && aot_fp == cds_fp) { + // This class matches with a class saved in an AOT library + ik->set_has_passed_fingerprint_check(true); + } else { + ResourceMark rm; + log_info(class, fingerprint)("%s : expected = " PTR64_FORMAT " actual = " PTR64_FORMAT, ik->external_name(), aot_fp, cds_fp); + } } } return ik; @@ -2709,11 +2709,11 @@ java_lang_invoke_MemberName::set_flags(mname(), MethodHandles::ref_kind_to_flags(ref_kind)); if (ref_kind == JVM_REF_invokeVirtual && - callee->name() == vmSymbols::java_lang_invoke_MethodHandle() && - (name == vmSymbols::invoke_name() || name == vmSymbols::invokeExact_name())) { - // Skip resolution for j.l.i.MethodHandle.invoke()/invokeExact(). - // They are public signature polymorphic methods, but require appendix argument - // which MemberName resolution doesn't handle. There's special logic on JDK side to handle them + MethodHandles::is_signature_polymorphic_public_name(callee, name)) { + // Skip resolution for public signature polymorphic methods such as + // j.l.i.MethodHandle.invoke()/invokeExact() and those on VarHandle + // They require appendix argument which MemberName resolution doesn't handle. + // There's special logic on JDK side to handle them // (see MethodHandles.linkMethodHandleConstant() and MethodHandles.findVirtualForMH()). } else { MethodHandles::resolve_MemberName(mname, caller, /*speculative_resolve*/false, CHECK_(empty)); diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/systemDictionaryShared.cpp openjdk-11-11~24/src/hotspot/share/classfile/systemDictionaryShared.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/systemDictionaryShared.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/systemDictionaryShared.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -766,10 +766,11 @@ SharedDictionaryEntry* entry = ((SharedDictionary*)(k->class_loader_data()->dictionary()))->find_entry_for(k); ResourceMark rm; // Lambda classes are not archived and will be regenerated at runtime. - if (entry == NULL && strstr(k->name()->as_C_string(), "Lambda$") != NULL) { + if (entry == NULL) { + guarantee(strstr(k->name()->as_C_string(), "Lambda$") != NULL, + "class should be in dictionary before being verified"); return true; } - assert(entry != NULL, "class should be in dictionary before being verified"); entry->add_verification_constraint(name, from_name, from_field_is_protected, from_is_array, from_is_object); if (entry->is_builtin()) { diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/verifier.cpp openjdk-11-11~24/src/hotspot/share/classfile/verifier.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/verifier.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/verifier.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -719,7 +719,8 @@ ResourceMark rm(THREAD); LogStream ls(lt); current_frame.print_on(&ls); - lt.print("offset = %d, opcode = %s", bci, Bytecodes::name(opcode)); + lt.print("offset = %d, opcode = %s", bci, + opcode == Bytecodes::_illegal ? "illegal" : Bytecodes::name(opcode)); } // Make sure wide instruction is in correct format diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/vmSymbols.cpp openjdk-11-11~24/src/hotspot/share/classfile/vmSymbols.cpp --- openjdk-11-11~19/src/hotspot/share/classfile/vmSymbols.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/vmSymbols.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -735,6 +735,9 @@ case vmIntrinsics::_ghash_processBlocks: if (!UseGHASHIntrinsics) return true; break; + case vmIntrinsics::_base64_encodeBlock: + if (!UseBASE64Intrinsics) return true; + break; case vmIntrinsics::_updateBytesCRC32C: case vmIntrinsics::_updateDirectByteBufferCRC32C: if (!UseCRC32CIntrinsics) return true; diff -Nru openjdk-11-11~19/src/hotspot/share/classfile/vmSymbols.hpp openjdk-11-11~24/src/hotspot/share/classfile/vmSymbols.hpp --- openjdk-11-11~19/src/hotspot/share/classfile/vmSymbols.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/classfile/vmSymbols.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -142,6 +142,8 @@ /* class file format tags */ \ template(tag_source_file, "SourceFile") \ template(tag_inner_classes, "InnerClasses") \ + template(tag_nest_members, "NestMembers") \ + template(tag_nest_host, "NestHost") \ template(tag_constant_value, "ConstantValue") \ template(tag_code, "Code") \ template(tag_exceptions, "Exceptions") \ @@ -1015,6 +1017,12 @@ do_name( implCompressMB_name, "implCompressMultiBlock0") \ do_signature(implCompressMB_signature, "([BII)I") \ \ + /* support for java.util.Base64.Encoder*/ \ + do_class(java_util_Base64_Encoder, "java/util/Base64$Encoder") \ + do_intrinsic(_base64_encodeBlock, java_util_Base64_Encoder, encodeBlock_name, encodeBlock_signature, F_R) \ + do_name(encodeBlock_name, "encodeBlock") \ + do_signature(encodeBlock_signature, "([BII[BIZ)V") \ + \ /* support for com.sun.crypto.provider.GHASH */ \ do_class(com_sun_crypto_provider_ghash, "com/sun/crypto/provider/GHASH") \ do_intrinsic(_ghash_processBlocks, com_sun_crypto_provider_ghash, processBlocks_name, ghash_processBlocks_signature, F_S) \ diff -Nru openjdk-11-11~19/src/hotspot/share/code/codeCache.cpp openjdk-11-11~24/src/hotspot/share/code/codeCache.cpp --- openjdk-11-11~19/src/hotspot/share/code/codeCache.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/code/codeCache.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1363,22 +1363,22 @@ const char *msg1 = msg1_stream.as_string(); const char *msg2 = msg2_stream.as_string(); - log_warning(codecache)(msg1); - log_warning(codecache)(msg2); - warning(msg1); - warning(msg2); + log_warning(codecache)("%s", msg1); + log_warning(codecache)("%s", msg2); + warning("%s", msg1); + warning("%s", msg2); } else { const char *msg1 = "CodeCache is full. Compiler has been disabled."; const char *msg2 = "Try increasing the code cache size using -XX:ReservedCodeCacheSize="; - log_warning(codecache)(msg1); - log_warning(codecache)(msg2); - warning(msg1); - warning(msg2); + log_warning(codecache)("%s", msg1); + log_warning(codecache)("%s", msg2); + warning("%s", msg1); + warning("%s", msg2); } ResourceMark rm; stringStream s; - // Dump code cache into a buffer before locking the tty, + // Dump code cache into a buffer before locking the tty. { MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); print_summary(&s); diff -Nru openjdk-11-11~19/src/hotspot/share/code/codeHeapState.cpp openjdk-11-11~24/src/hotspot/share/code/codeHeapState.cpp --- openjdk-11-11~19/src/hotspot/share/code/codeHeapState.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/code/codeHeapState.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -117,23 +117,24 @@ _outbuf->print("%s", termString); #endif -const char blobTypeChar[] = {' ', 'N', 'I', 'X', 'Z', 'U', 'R', '?', 'D', 'T', 'E', 'S', 'A', 'M', 'B', 'L' }; +const char blobTypeChar[] = {' ', 'C', 'N', 'I', 'X', 'Z', 'U', 'R', '?', 'D', 'T', 'E', 'S', 'A', 'M', 'B', 'L' }; const char* blobTypeName[] = {"noType" - , "nMethod (active)" - , "nMethod (inactive)" - , "nMethod (deopt)" - , "nMethod (zombie)" - , "nMethod (unloaded)" - , "runtime stub" - , "ricochet stub" - , "deopt stub" - , "uncommon trap stub" - , "exception stub" - , "safepoint stub" - , "adapter blob" - , "MH adapter blob" - , "buffer blob" - , "lastType" + , "nMethod (under construction)" + , "nMethod (active)" + , "nMethod (inactive)" + , "nMethod (deopt)" + , "nMethod (zombie)" + , "nMethod (unloaded)" + , "runtime stub" + , "ricochet stub" + , "deopt stub" + , "uncommon trap stub" + , "exception stub" + , "safepoint stub" + , "adapter blob" + , "MH adapter blob" + , "buffer blob" + , "lastType" }; const char* compTypeName[] = { "none", "c1", "c2", "jvmci" }; @@ -156,7 +157,8 @@ static unsigned int nBlocks_t2 = 0; // counting "in_use" nmethods only. static unsigned int nBlocks_alive = 0; // counting "not_used" and "not_entrant" nmethods only. static unsigned int nBlocks_dead = 0; // counting "zombie" and "unloaded" methods only. -static unsigned int nBlocks_unloaded = 0; // counting "unloaded" nmethods only. This is a transien state. +static unsigned int nBlocks_inconstr = 0; // counting "inconstruction" nmethods only. This is a transient state. +static unsigned int nBlocks_unloaded = 0; // counting "unloaded" nmethods only. This is a transient state. static unsigned int nBlocks_stub = 0; static struct FreeBlk* FreeArray = NULL; @@ -226,6 +228,7 @@ nBlocks_t2 = CodeHeapStatArray[ix].nBlocks_t2; nBlocks_alive = CodeHeapStatArray[ix].nBlocks_alive; nBlocks_dead = CodeHeapStatArray[ix].nBlocks_dead; + nBlocks_inconstr = CodeHeapStatArray[ix].nBlocks_inconstr; nBlocks_unloaded = CodeHeapStatArray[ix].nBlocks_unloaded; nBlocks_stub = CodeHeapStatArray[ix].nBlocks_stub; FreeArray = CodeHeapStatArray[ix].FreeArray; @@ -248,6 +251,7 @@ nBlocks_t2 = 0; nBlocks_alive = 0; nBlocks_dead = 0; + nBlocks_inconstr = 0; nBlocks_unloaded = 0; nBlocks_stub = 0; FreeArray = NULL; @@ -274,6 +278,7 @@ CodeHeapStatArray[ix].nBlocks_t2 = nBlocks_t2; CodeHeapStatArray[ix].nBlocks_alive = nBlocks_alive; CodeHeapStatArray[ix].nBlocks_dead = nBlocks_dead; + CodeHeapStatArray[ix].nBlocks_inconstr = nBlocks_inconstr; CodeHeapStatArray[ix].nBlocks_unloaded = nBlocks_unloaded; CodeHeapStatArray[ix].nBlocks_stub = nBlocks_stub; CodeHeapStatArray[ix].FreeArray = FreeArray; @@ -554,6 +559,7 @@ nBlocks_t2 = 0; nBlocks_alive = 0; nBlocks_dead = 0; + nBlocks_inconstr = 0; nBlocks_unloaded = 0; nBlocks_stub = 0; @@ -587,6 +593,7 @@ size_t disconnSpace = 0; size_t notentrSpace = 0; size_t deadSpace = 0; + size_t inconstrSpace = 0; size_t unloadedSpace = 0; size_t stubSpace = 0; size_t freeSpace = 0; @@ -692,6 +699,10 @@ nBlocks_dead++; deadSpace += hb_bytelen; break; + case nMethod_inconstruction: + nBlocks_inconstr++; + inconstrSpace += hb_bytelen; + break; default: break; } @@ -846,6 +857,7 @@ StatArray[ix_beg].level = comp_lvl; StatArray[ix_beg].compiler = cType; break; + case nMethod_inconstruction: // let's count "in construction" nmethods here. case nMethod_alive: StatArray[ix_beg].tx_count++; StatArray[ix_beg].tx_space += (unsigned short)hb_len; @@ -902,6 +914,7 @@ StatArray[ix_end].level = comp_lvl; StatArray[ix_end].compiler = cType; break; + case nMethod_inconstruction: // let's count "in construction" nmethods here. case nMethod_alive: StatArray[ix_beg].tx_count++; StatArray[ix_beg].tx_space += (unsigned short)beg_space; @@ -949,6 +962,7 @@ StatArray[ix].level = comp_lvl; StatArray[ix].compiler = cType; break; + case nMethod_inconstruction: // let's count "in construction" nmethods here. case nMethod_alive: StatArray[ix].tx_count++; StatArray[ix].tx_space += (unsigned short)(granule_size>>log2_seg_size); @@ -971,11 +985,6 @@ } } } - if (n_methods > 0) { - avgTemp = hotnessAccumulator/n_methods; - } else { - avgTemp = 0; - } done = true; if (!insane) { @@ -990,6 +999,7 @@ ast->print_cr(" Alive Space = " SIZE_FORMAT_W(8) "k, nBlocks_alive = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", aliveSpace/(size_t)K, nBlocks_alive, (100.0*aliveSpace)/size, (100.0*aliveSpace)/res_size); ast->print_cr(" disconnected = " SIZE_FORMAT_W(8) "k, nBlocks_disconn = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", disconnSpace/(size_t)K, nBlocks_disconn, (100.0*disconnSpace)/size, (100.0*disconnSpace)/res_size); ast->print_cr(" not entrant = " SIZE_FORMAT_W(8) "k, nBlocks_notentr = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", notentrSpace/(size_t)K, nBlocks_notentr, (100.0*notentrSpace)/size, (100.0*notentrSpace)/res_size); + ast->print_cr(" inconstrSpace = " SIZE_FORMAT_W(8) "k, nBlocks_inconstr = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", inconstrSpace/(size_t)K, nBlocks_inconstr, (100.0*inconstrSpace)/size, (100.0*inconstrSpace)/res_size); ast->print_cr(" unloadedSpace = " SIZE_FORMAT_W(8) "k, nBlocks_unloaded = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", unloadedSpace/(size_t)K, nBlocks_unloaded, (100.0*unloadedSpace)/size, (100.0*unloadedSpace)/res_size); ast->print_cr(" deadSpace = " SIZE_FORMAT_W(8) "k, nBlocks_dead = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", deadSpace/(size_t)K, nBlocks_dead, (100.0*deadSpace)/size, (100.0*deadSpace)/res_size); ast->print_cr(" stubSpace = " SIZE_FORMAT_W(8) "k, nBlocks_stub = %6d, %10.3f%% of capacity, %10.3f%% of max_capacity", stubSpace/(size_t)K, nBlocks_stub, (100.0*stubSpace)/size, (100.0*stubSpace)/res_size); @@ -1009,9 +1019,15 @@ printBox(ast, '-', "Method hotness information at time of this analysis", NULL); ast->print_cr("Highest possible method temperature: %12d", reset_val); ast->print_cr("Threshold for method to be considered 'cold': %12.3f", -reset_val + reverse_free_ratio * NmethodSweepActivity); - ast->print_cr("min. hotness = %6d", minTemp); - ast->print_cr("avg. hotness = %6d", avgTemp); - ast->print_cr("max. hotness = %6d", maxTemp); + if (n_methods > 0) { + avgTemp = hotnessAccumulator/n_methods; + ast->print_cr("min. hotness = %6d", minTemp); + ast->print_cr("avg. hotness = %6d", avgTemp); + ast->print_cr("max. hotness = %6d", maxTemp); + } else { + avgTemp = 0; + ast->print_cr("No hotness data available"); + } STRINGSTREAM_FLUSH("\n") // This loop is intentionally printing directly to "out". @@ -1024,6 +1040,9 @@ if (StatArray[ix].t2_count > granule_segs) { out->print_cr("t2_count[%d] = %d", ix, StatArray[ix].t2_count); } + if (StatArray[ix].tx_count > granule_segs) { + out->print_cr("tx_count[%d] = %d", ix, StatArray[ix].tx_count); + } if (StatArray[ix].stub_count > granule_segs) { out->print_cr("stub_count[%d] = %d", ix, StatArray[ix].stub_count); } @@ -1036,6 +1055,9 @@ if (StatArray[ix].t2_space > granule_segs) { out->print_cr("t2_space[%d] = %d", ix, StatArray[ix].t2_space); } + if (StatArray[ix].tx_space > granule_segs) { + out->print_cr("tx_space[%d] = %d", ix, StatArray[ix].tx_space); + } if (StatArray[ix].stub_space > granule_segs) { out->print_cr("stub_space[%d] = %d", ix, StatArray[ix].stub_space); } @@ -1043,11 +1065,11 @@ out->print_cr("dead_space[%d] = %d", ix, StatArray[ix].dead_space); } // this cast is awful! I need it because NT/Intel reports a signed/unsigned mismatch. - if ((size_t)(StatArray[ix].t1_count+StatArray[ix].t2_count+StatArray[ix].stub_count+StatArray[ix].dead_count) > granule_segs) { - out->print_cr("t1_count[%d] = %d, t2_count[%d] = %d, stub_count[%d] = %d", ix, StatArray[ix].t1_count, ix, StatArray[ix].t2_count, ix, StatArray[ix].stub_count); + if ((size_t)(StatArray[ix].t1_count+StatArray[ix].t2_count+StatArray[ix].tx_count+StatArray[ix].stub_count+StatArray[ix].dead_count) > granule_segs) { + out->print_cr("t1_count[%d] = %d, t2_count[%d] = %d, tx_count[%d] = %d, stub_count[%d] = %d", ix, StatArray[ix].t1_count, ix, StatArray[ix].t2_count, ix, StatArray[ix].tx_count, ix, StatArray[ix].stub_count); } - if ((size_t)(StatArray[ix].t1_space+StatArray[ix].t2_space+StatArray[ix].stub_space+StatArray[ix].dead_space) > granule_segs) { - out->print_cr("t1_space[%d] = %d, t2_space[%d] = %d, stub_space[%d] = %d", ix, StatArray[ix].t1_space, ix, StatArray[ix].t2_space, ix, StatArray[ix].stub_space); + if ((size_t)(StatArray[ix].t1_space+StatArray[ix].t2_space+StatArray[ix].tx_space+StatArray[ix].stub_space+StatArray[ix].dead_space) > granule_segs) { + out->print_cr("t1_space[%d] = %d, t2_space[%d] = %d, tx_space[%d] = %d, stub_space[%d] = %d", ix, StatArray[ix].t1_space, ix, StatArray[ix].t2_space, ix, StatArray[ix].tx_space, ix, StatArray[ix].stub_space); } } @@ -1131,7 +1153,7 @@ if (!done || (nBlocks_free == 0)) { if (nBlocks_free == 0) { - printBox(ast, '-', "no free blocks found in", heapName); + printBox(ast, '-', "no free blocks found in ", heapName); } else if (!done) { ast->print_cr("Free block count mismatch could not be resolved."); ast->print_cr("Try to run \"aggregate\" function to update counters"); @@ -1261,9 +1283,10 @@ ast->print("%5d", nm->hotness_counter()); //---< name and signature >--- ast->fill_to(67+6); - if (nm->is_in_use()) {blob_name = nm->method()->name_and_sig_as_C_string(); } - if (nm->is_not_entrant()) {blob_name = nm->method()->name_and_sig_as_C_string(); } - if (nm->is_zombie()) {ast->print("%14s", " zombie method"); } + if (nm->is_in_use()) {blob_name = nm->method()->name_and_sig_as_C_string(); } + if (nm->is_not_entrant()) {blob_name = nm->method()->name_and_sig_as_C_string(); } + if (nm->is_not_installed()) {ast->print("%s", " not (yet) installed method "); } + if (nm->is_zombie()) {ast->print("%s", " zombie method "); } ast->print("%s", blob_name); } else { //---< block size in hex >--- @@ -1657,7 +1680,7 @@ { if (nBlocks_alive > 0) { - printBox(ast, '-', "not_used/not_entrant nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL); + printBox(ast, '-', "not_used/not_entrant/not_installed nMethod count only, 0x1..0xf. '*' indicates >= 16 blocks, ' ' indicates empty", NULL); STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; @@ -1846,7 +1869,7 @@ { if (nBlocks_alive > 0) { - printBox(ast, '-', "not_used/not_entrant space consumption. ' ' indicates empty, '*' indicates full", NULL); + printBox(ast, '-', "not_used/not_entrant/not_installed space consumption. ' ' indicates empty, '*' indicates full", NULL); granules_per_line = 128; for (unsigned int ix = 0; ix < alloc_granules; ix++) { @@ -2016,7 +2039,7 @@ { if (nBlocks_alive > 0) { - printBox(ast, '-', "not_used/not_entrant age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL); + printBox(ast, '-', "not_used/not_entrant/not_installed age distribution. '0' indicates youngest 1/256, '8': oldest half, ' ': no age information", NULL); STRINGSTREAM_FLUSH_LOCKED("") granules_per_line = 128; @@ -2106,8 +2129,8 @@ bool blob_initialized = (this_blob != NULL) && (this_blob->header_size() >= 0) && (this_blob->relocation_size() >= 0) && ((address)this_blob + this_blob->header_size() == (address)(this_blob->relocation_begin())) && ((address)this_blob + CodeBlob::align_code_offset(this_blob->header_size() + this_blob->relocation_size()) == (address)(this_blob->content_begin())) && - is_readable_pointer((address)(this_blob->relocation_begin())) && - is_readable_pointer(this_blob->content_begin()); + os::is_readable_pointer((address)(this_blob->relocation_begin())) && + os::is_readable_pointer(this_blob->content_begin()); // blob could have been flushed, freed, and merged. // this_blob < last_blob is an indicator for that. if (blob_initialized && (this_blob > last_blob)) { @@ -2122,7 +2145,7 @@ } // this_blob->name() could return NULL if no name was given to CTOR. Inlined, maybe invisible on stack const char* blob_name = this_blob->name(); - if ((blob_name == NULL) || !is_readable_pointer(blob_name)) { + if ((blob_name == NULL) || !os::is_readable_pointer(blob_name)) { blob_name = ""; } @@ -2146,8 +2169,8 @@ // this_blob->as_nmethod_or_null() is safe. Inlined, maybe invisible on stack. nmethod* nm = this_blob->as_nmethod_or_null(); Method* method = (nm == NULL) ? NULL : nm->method(); // may be uninitialized, i.e. != NULL, but invalid - if ((nm != NULL) && (method != NULL) && (cbType != nMethod_dead) && - is_readable_pointer(method) && is_readable_pointer(method->constants())) { + if ((nm != NULL) && (method != NULL) && (cbType != nMethod_dead) && (cbType != nMethod_inconstruction) && + os::is_readable_pointer(method) && os::is_readable_pointer(method->constants())) { ResourceMark rm; //---< collect all data to locals as quickly as possible >--- unsigned int total_size = nm->total_size(); @@ -2346,7 +2369,7 @@ } CodeHeapState::blobType CodeHeapState::get_cbType(CodeBlob* cb) { - if ((cb != NULL) && is_readable_pointer(cb)) { + if ((cb != NULL) && os::is_readable_pointer(cb)) { if (cb->is_runtime_stub()) return runtimeStub; if (cb->is_deoptimization_stub()) return deoptimizationStub; if (cb->is_uncommon_trap_stub()) return uncommonTrapStub; @@ -2358,27 +2381,14 @@ nmethod* nm = cb->as_nmethod_or_null(); if (nm != NULL) { // no is_readable check required, nm = (nmethod*)cb. + if (nm->is_not_installed()) return nMethod_inconstruction; if (nm->is_zombie()) return nMethod_dead; if (nm->is_unloaded()) return nMethod_unloaded; + if (nm->is_in_use()) return nMethod_inuse; if (nm->is_alive() && !(nm->is_not_entrant())) return nMethod_notused; if (nm->is_alive()) return nMethod_alive; - if (nm->is_in_use()) return nMethod_inuse; return nMethod_dead; } } return noType; } - -// Check if pointer can be read from (4-byte read access). -// Helps to prove validity of a not-NULL pointer. -// Returns true in very early stages of VM life when stub is not yet generated. -#define SAFEFETCH_DEFAULT true -bool CodeHeapState::is_readable_pointer(const void* p) { - if (!CanUseSafeFetch32()) { - return SAFEFETCH_DEFAULT; - } - int* const aligned = (int*) align_down((intptr_t)p, 4); - int cafebabe = 0xcafebabe; // tester value 1 - int deadbeef = 0xdeadbeef; // tester value 2 - return (SafeFetch32(aligned, cafebabe) != cafebabe) || (SafeFetch32(aligned, deadbeef) != deadbeef); -} diff -Nru openjdk-11-11~19/src/hotspot/share/code/codeHeapState.hpp openjdk-11-11~24/src/hotspot/share/code/codeHeapState.hpp --- openjdk-11-11~19/src/hotspot/share/code/codeHeapState.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/code/codeHeapState.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -43,26 +43,28 @@ }; enum blobType { - noType = 0, // must be! due to initialization by memset to zero - // The nMethod_* values correspond 1:1 to the CompiledMethod enum values. - nMethod_inuse, // executable. This is the "normal" state for a nmethod. - nMethod_notused, // assumed inactive, marked not entrant. Could be revived if necessary. - nMethod_notentrant, // no new activations allowed, marked for deoptimization. Old activations may still exist. - // Will transition to "zombie" after all activations are gone. - nMethod_zombie, // No more activations exist, ready for purge (remove from code cache). - nMethod_unloaded, // No activations exist, should not be called. Transient state on the way to "zombie". - nMethod_alive = nMethod_notentrant, // Combined state: nmethod may have activations, thus can't be purged. - nMethod_dead = nMethod_zombie, // Combined state: nmethod does not have any activations. - runtimeStub = nMethod_unloaded + 1, - ricochetStub, - deoptimizationStub, - uncommonTrapStub, - exceptionStub, - safepointStub, - adapterBlob, - mh_adapterBlob, - bufferBlob, - lastType + noType = 0, // must be! due to initialization by memset to zero + // The nMethod_* values correspond to the CompiledMethod enum values. + // We can't use the CompiledMethod values 1:1 because we depend on noType == 0. + nMethod_inconstruction, // under construction. Very soon, the type will transition to "in_use". + nMethod_inuse, // executable. This is the "normal" state for a nmethod. + nMethod_notused, // assumed inactive, marked not entrant. Could be revived if necessary. + nMethod_notentrant, // no new activations allowed, marked for deoptimization. Old activations may still exist. + // Will transition to "zombie" after all activations are gone. + nMethod_zombie, // No more activations exist, ready for purge (remove from code cache). + nMethod_unloaded, // No activations exist, should not be called. Transient state on the way to "zombie". + nMethod_alive = nMethod_notentrant, // Combined state: nmethod may have activations, thus can't be purged. + nMethod_dead = nMethod_zombie, // Combined state: nmethod does not have any activations. + runtimeStub = nMethod_unloaded + 1, + ricochetStub, + deoptimizationStub, + uncommonTrapStub, + exceptionStub, + safepointStub, + adapterBlob, + mh_adapterBlob, + bufferBlob, + lastType }; private: @@ -93,7 +95,6 @@ static void print_line_delim(outputStream* out, bufferedStream *sst, char* low_bound, unsigned int ix, unsigned int gpl); static void print_line_delim(outputStream* out, outputStream *sst, char* low_bound, unsigned int ix, unsigned int gpl); static blobType get_cbType(CodeBlob* cb); - static bool is_readable_pointer(const void* p); public: static void discard(outputStream* out, CodeHeap* heap); @@ -214,6 +215,7 @@ unsigned int nBlocks_t2; unsigned int nBlocks_alive; unsigned int nBlocks_dead; + unsigned int nBlocks_inconstr; unsigned int nBlocks_unloaded; unsigned int nBlocks_stub; // FreeBlk data diff -Nru openjdk-11-11~19/src/hotspot/share/code/compiledMethod.cpp openjdk-11-11~24/src/hotspot/share/code/compiledMethod.cpp --- openjdk-11-11~19/src/hotspot/share/code/compiledMethod.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/code/compiledMethod.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -325,6 +325,7 @@ // Clear ICStubs of all compiled ICs void CompiledMethod::clear_ic_stubs() { assert_locked_or_safepoint(CompiledIC_lock); + ResourceMark rm; RelocIterator iter(this); while(iter.next()) { if (iter.type() == relocInfo::virtual_call_type) { @@ -547,6 +548,7 @@ bool CompiledMethod::cleanup_inline_caches_impl(bool parallel, bool unloading_occurred, bool clean_all) { assert_locked_or_safepoint(CompiledIC_lock); bool postponed = false; + ResourceMark rm; // Find all calls in an nmethod and clear the ones that point to non-entrant, // zombie and unloaded nmethods. diff -Nru openjdk-11-11~19/src/hotspot/share/code/dependencies.cpp openjdk-11-11~24/src/hotspot/share/code/dependencies.cpp --- openjdk-11-11~19/src/hotspot/share/code/dependencies.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/code/dependencies.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -33,6 +33,7 @@ #include "compiler/compileBroker.hpp" #include "compiler/compileTask.hpp" #include "memory/resourceArea.hpp" +#include "oops/klass.hpp" #include "oops/oop.inline.hpp" #include "oops/objArrayKlass.hpp" #include "runtime/flags/flagSetting.hpp" @@ -1228,8 +1229,9 @@ } else if (!k->is_instance_klass()) { return false; // no methods to find in an array type } else { - // Search class hierarchy first. - Method* m = InstanceKlass::cast(k)->find_instance_method(_name, _signature); + // Search class hierarchy first, skipping private implementations + // as they never override any inherited methods + Method* m = InstanceKlass::cast(k)->find_instance_method(_name, _signature, Klass::skip_private); if (!Dependencies::is_concrete_method(m, k)) { // Check for re-abstraction of method if (!k->is_interface() && m != NULL && m->is_abstract()) { diff -Nru openjdk-11-11~19/src/hotspot/share/code/nmethod.cpp openjdk-11-11~24/src/hotspot/share/code/nmethod.cpp --- openjdk-11-11~19/src/hotspot/share/code/nmethod.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/code/nmethod.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1691,7 +1691,6 @@ ls.print("" PTR_FORMAT "[offset=%d] detected scavengable oop " PTR_FORMAT " (found at " PTR_FORMAT ") ", p2i(_print_nm), (int)((intptr_t)p - (intptr_t)_print_nm), p2i(*p), p2i(p)); - (*p)->print_value_on(&ls); ls.cr(); } } @@ -2599,6 +2598,16 @@ st->move_to(column); if (sd->bci() == SynchronizationEntryBCI) { st->print(";*synchronization entry"); + } else if (sd->bci() == AfterBci) { + st->print(";* method exit (unlocked if synchronized)"); + } else if (sd->bci() == UnwindBci) { + st->print(";* unwind (locked if synchronized)"); + } else if (sd->bci() == AfterExceptionBci) { + st->print(";* unwind (unlocked if synchronized)"); + } else if (sd->bci() == UnknownBci) { + st->print(";* unknown"); + } else if (sd->bci() == InvalidFrameStateBci) { + st->print(";* invalid frame state"); } else { if (sd->method() == NULL) { st->print("method is NULL"); diff -Nru openjdk-11-11~19/src/hotspot/share/compiler/compileBroker.cpp openjdk-11-11~24/src/hotspot/share/compiler/compileBroker.cpp --- openjdk-11-11~19/src/hotspot/share/compiler/compileBroker.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/compiler/compileBroker.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -530,7 +530,6 @@ void CompileBroker::print_compile_queues(outputStream* st) { st->print_cr("Current compiles: "); - MutexLocker locker(MethodCompileQueue_lock); char buf[2000]; int buflen = sizeof(buf); @@ -546,7 +545,7 @@ } void CompileQueue::print(outputStream* st) { - assert(MethodCompileQueue_lock->owned_by_self(), "must own lock"); + assert_locked_or_safepoint(MethodCompileQueue_lock); st->print_cr("%s:", name()); CompileTask* task = _first; if (task == NULL) { @@ -1638,12 +1637,6 @@ * out to be a problem. */ void CompileBroker::shutdown_compiler_runtime(AbstractCompiler* comp, CompilerThread* thread) { - // Free buffer blob, if allocated - if (thread->get_buffer_blob() != NULL) { - MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); - CodeCache::free(thread->get_buffer_blob()); - } - if (comp->should_perform_shutdown()) { // There are two reasons for shutting down the compiler // 1) compiler runtime initialization failed diff -Nru openjdk-11-11~19/src/hotspot/share/compiler/compileLog.cpp openjdk-11-11~24/src/hotspot/share/compiler/compileLog.cpp --- openjdk-11-11~19/src/hotspot/share/compiler/compileLog.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/compiler/compileLog.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -217,14 +217,17 @@ file->print_raw_cr("'>"); size_t nr; // number read into buf from partial log + // In case of unsuccessful completion, read returns -1. + ssize_t bytes_read; // Copy data up to the end of the last element: julong to_read = log->_file_end; while (to_read > 0) { if (to_read < (julong)buflen) nr = (size_t)to_read; else nr = buflen; - nr = read(partial_fd, buf, (int)nr); - if (nr <= 0) break; + bytes_read = read(partial_fd, buf, (int)nr); + if (bytes_read <= 0) break; + nr = bytes_read; to_read -= (julong)nr; file->write(buf, nr); } @@ -232,7 +235,8 @@ // Copy any remaining data inside a quote: bool saw_slop = false; int end_cdata = 0; // state machine [0..2] watching for too many "]]" - while ((nr = read(partial_fd, buf, buflen-1)) > 0) { + while ((bytes_read = read(partial_fd, buf, buflen-1)) > 0) { + nr = bytes_read; buf[buflen-1] = '\0'; if (!saw_slop) { file->print_raw_cr(""); diff -Nru openjdk-11-11~19/src/hotspot/share/compiler/compilerDefinitions.cpp openjdk-11-11~24/src/hotspot/share/compiler/compilerDefinitions.cpp --- openjdk-11-11~19/src/hotspot/share/compiler/compilerDefinitions.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/compiler/compilerDefinitions.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -253,17 +253,18 @@ if (FLAG_IS_DEFAULT(OnStackReplacePercentage)) { FLAG_SET_DEFAULT(OnStackReplacePercentage, 933); } + // JVMCI needs values not less than defaults if (FLAG_IS_DEFAULT(ReservedCodeCacheSize)) { - FLAG_SET_DEFAULT(ReservedCodeCacheSize, 64*M); + FLAG_SET_DEFAULT(ReservedCodeCacheSize, MAX2(64*M, ReservedCodeCacheSize)); } if (FLAG_IS_DEFAULT(InitialCodeCacheSize)) { - FLAG_SET_DEFAULT(InitialCodeCacheSize, 16*M); + FLAG_SET_DEFAULT(InitialCodeCacheSize, MAX2(16*M, InitialCodeCacheSize)); } if (FLAG_IS_DEFAULT(MetaspaceSize)) { - FLAG_SET_DEFAULT(MetaspaceSize, 12*M); + FLAG_SET_DEFAULT(MetaspaceSize, MAX2(12*M, MetaspaceSize)); } if (FLAG_IS_DEFAULT(NewSizeThreadIncrease)) { - FLAG_SET_DEFAULT(NewSizeThreadIncrease, 4*K); + FLAG_SET_DEFAULT(NewSizeThreadIncrease, MAX2(4*K, NewSizeThreadIncrease)); } if (TieredStopAtLevel != CompLevel_full_optimization) { // Currently JVMCI compiler can only work at the full optimization level diff -Nru openjdk-11-11~19/src/hotspot/share/compiler/compilerDefinitions.hpp openjdk-11-11~24/src/hotspot/share/compiler/compilerDefinitions.hpp --- openjdk-11-11~19/src/hotspot/share/compiler/compilerDefinitions.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/compiler/compilerDefinitions.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -41,7 +41,13 @@ // Handy constants for deciding which compiler mode to use. enum MethodCompilation { - InvocationEntryBci = -1 // i.e., not a on-stack replacement compilation + InvocationEntryBci = -1, // i.e., not a on-stack replacement compilation + BeforeBci = InvocationEntryBci, + AfterBci = -2, + UnwindBci = -3, + AfterExceptionBci = -4, + UnknownBci = -5, + InvalidFrameStateBci = -6 }; // Enumeration to distinguish tiers of compilation diff -Nru openjdk-11-11~19/src/hotspot/share/compiler/disassembler.cpp openjdk-11-11~24/src/hotspot/share/compiler/disassembler.cpp --- openjdk-11-11~19/src/hotspot/share/compiler/disassembler.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/compiler/disassembler.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -122,7 +122,7 @@ _decode_instructions_virtual = CAST_TO_FN_PTR(Disassembler::decode_func_virtual, os::dll_lookup(_library, decode_instructions_virtual_name)); } - if (_decode_instructions_virtual == NULL) { + if (_decode_instructions_virtual == NULL && _library != NULL) { // could not spot in new version, try old version _decode_instructions = CAST_TO_FN_PTR(Disassembler::decode_func, os::dll_lookup(_library, decode_instructions_name)); diff -Nru openjdk-11-11~19/src/hotspot/share/compiler/methodLiveness.cpp openjdk-11-11~24/src/hotspot/share/compiler/methodLiveness.cpp --- openjdk-11-11~19/src/hotspot/share/compiler/methodLiveness.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/compiler/methodLiveness.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -484,7 +484,7 @@ while (block == NULL && t > 0) { block = _block_map->at(--t); } - assert( block != NULL, "invalid bytecode index; must be instruction index" ); + guarantee(block != NULL, "invalid bytecode index; must be instruction index"); assert(bci >= block->start_bci() && bci < block->limit_bci(), "block must contain bci."); answer = block->get_liveness_at(method(), bci); diff -Nru openjdk-11-11~19/src/hotspot/share/compiler/oopMap.cpp openjdk-11-11~24/src/hotspot/share/compiler/oopMap.cpp --- openjdk-11-11~19/src/hotspot/share/compiler/oopMap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/compiler/oopMap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -571,14 +571,14 @@ const ImmutableOopMap* ImmutableOopMapSet::find_map_at_offset(int pc_offset) const { ImmutableOopMapPair* pairs = get_pairs(); - ImmutableOopMapPair* last = NULL; - for (int i = 0; i < _count; ++i) { + int i; + for (i = 0; i < _count; ++i) { if (pairs[i].pc_offset() >= pc_offset) { - last = &pairs[i]; break; } } + ImmutableOopMapPair* last = &pairs[i]; assert(last->pc_offset() == pc_offset, "oopmap not found"); return last->get_from(this); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/cmsOopClosures.cpp openjdk-11-11~24/src/hotspot/share/gc/cms/cmsOopClosures.cpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/cmsOopClosures.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/cmsOopClosures.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "gc/cms/cmsOopClosures.inline.hpp" -#include "gc/cms/cms_specialized_oop_closures.hpp" -#include "memory/iterator.inline.hpp" - -// Generate CMS specialized oop_oop_iterate functions. -SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(ALL_KLASS_OOP_OOP_ITERATE_DEFN) diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/cmsOopClosures.hpp openjdk-11-11~24/src/hotspot/share/gc/cms/cmsOopClosures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/cmsOopClosures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/cmsOopClosures.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -44,22 +44,17 @@ void do_oop(oop obj); \ template inline void do_oop_work(T* p); -// TODO: This duplication of the MetadataAwareOopClosure class is only needed +// TODO: This duplication of the MetadataVisitingOopIterateClosure class is only needed // because some CMS OopClosures derive from OopsInGenClosure. It would be // good to get rid of them completely. -class MetadataAwareOopsInGenClosure: public OopsInGenClosure { +class MetadataVisitingOopsInGenClosure: public OopsInGenClosure { public: - virtual bool do_metadata() { return do_metadata_nv(); } - inline bool do_metadata_nv() { return true; } - + virtual bool do_metadata() { return true; } virtual void do_klass(Klass* k); - void do_klass_nv(Klass* k); - - virtual void do_cld(ClassLoaderData* cld) { do_cld_nv(cld); } - void do_cld_nv(ClassLoaderData* cld); + virtual void do_cld(ClassLoaderData* cld); }; -class MarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { +class MarkRefsIntoClosure: public MetadataVisitingOopsInGenClosure { private: const MemRegion _span; CMSBitMap* _bitMap; @@ -71,7 +66,7 @@ virtual void do_oop(narrowOop* p); }; -class ParMarkRefsIntoClosure: public MetadataAwareOopsInGenClosure { +class ParMarkRefsIntoClosure: public MetadataVisitingOopsInGenClosure { private: const MemRegion _span; CMSBitMap* _bitMap; @@ -85,7 +80,7 @@ // A variant of the above used in certain kinds of CMS // marking verification. -class MarkRefsIntoVerifyClosure: public MetadataAwareOopsInGenClosure { +class MarkRefsIntoVerifyClosure: public MetadataVisitingOopsInGenClosure { private: const MemRegion _span; CMSBitMap* _verification_bm; @@ -100,7 +95,7 @@ }; // The non-parallel version (the parallel version appears further below). -class PushAndMarkClosure: public MetadataAwareOopClosure { +class PushAndMarkClosure: public MetadataVisitingOopIterateClosure { private: CMSCollector* _collector; MemRegion _span; @@ -120,8 +115,6 @@ bool concurrent_precleaning); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; // In the parallel case, the bit map and the @@ -130,7 +123,7 @@ // synchronization (for instance, via CAS). The marking stack // used in the non-parallel case above is here replaced with // an OopTaskQueue structure to allow efficient work stealing. -class ParPushAndMarkClosure: public MetadataAwareOopClosure { +class ParPushAndMarkClosure: public MetadataVisitingOopIterateClosure { private: CMSCollector* _collector; MemRegion _span; @@ -146,12 +139,10 @@ OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; // The non-parallel version (the parallel version appears further below). -class MarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { +class MarkRefsIntoAndScanClosure: public MetadataVisitingOopsInGenClosure { private: MemRegion _span; CMSBitMap* _bit_map; @@ -175,8 +166,6 @@ bool concurrent_precleaning); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); void set_freelistLock(Mutex* m) { _freelistLock = m; @@ -192,7 +181,7 @@ // stack and the bitMap are shared, so access needs to be suitably // synchronized. An OopTaskQueue structure, supporting efficient // work stealing, replaces a CMSMarkStack for storing grey objects. -class ParMarkRefsIntoAndScanClosure: public MetadataAwareOopsInGenClosure { +class ParMarkRefsIntoAndScanClosure: public MetadataVisitingOopsInGenClosure { private: MemRegion _span; CMSBitMap* _bit_map; @@ -209,8 +198,6 @@ OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); void trim_queue(uint size); }; @@ -218,7 +205,7 @@ // This closure is used during the concurrent marking phase // following the first checkpoint. Its use is buried in // the closure MarkFromRootsClosure. -class PushOrMarkClosure: public MetadataAwareOopClosure { +class PushOrMarkClosure: public MetadataVisitingOopIterateClosure { private: CMSCollector* _collector; MemRegion _span; @@ -238,8 +225,6 @@ MarkFromRootsClosure* parent); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); // Deal with a stack overflow condition void handle_stack_overflow(HeapWord* lost); @@ -251,7 +236,7 @@ // This closure is used during the concurrent marking phase // following the first checkpoint. Its use is buried in // the closure ParMarkFromRootsClosure. -class ParPushOrMarkClosure: public MetadataAwareOopClosure { +class ParPushOrMarkClosure: public MetadataVisitingOopIterateClosure { private: CMSCollector* _collector; MemRegion _whole_span; @@ -275,8 +260,6 @@ ParMarkFromRootsClosure* parent); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); // Deal with a stack overflow condition void handle_stack_overflow(HeapWord* lost); @@ -290,7 +273,7 @@ // processing phase of the CMS final checkpoint step, as // well as during the concurrent precleaning of the discovered // reference lists. -class CMSKeepAliveClosure: public MetadataAwareOopClosure { +class CMSKeepAliveClosure: public MetadataVisitingOopIterateClosure { private: CMSCollector* _collector; const MemRegion _span; @@ -306,11 +289,9 @@ bool concurrent_precleaning() const { return _concurrent_precleaning; } virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; -class CMSInnerParMarkAndPushClosure: public MetadataAwareOopClosure { +class CMSInnerParMarkAndPushClosure: public MetadataVisitingOopIterateClosure { private: CMSCollector* _collector; MemRegion _span; @@ -324,14 +305,12 @@ OopTaskQueue* work_queue); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; // A parallel (MT) version of the above, used when // reference processing is parallel; the only difference // is in the do_oop method. -class CMSParKeepAliveClosure: public MetadataAwareOopClosure { +class CMSParKeepAliveClosure: public MetadataVisitingOopIterateClosure { private: MemRegion _span; OopTaskQueue* _work_queue; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/cmsOopClosures.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -32,42 +32,38 @@ #include "oops/compressedOops.inline.hpp" #include "oops/oop.inline.hpp" -// MetadataAwareOopClosure and MetadataAwareOopsInGenClosure are duplicated, +// MetadataVisitingOopIterateClosure and MetadataVisitingOopsInGenClosure are duplicated, // until we get rid of OopsInGenClosure. -inline void MetadataAwareOopsInGenClosure::do_klass_nv(Klass* k) { +inline void MetadataVisitingOopsInGenClosure::do_klass(Klass* k) { ClassLoaderData* cld = k->class_loader_data(); - do_cld_nv(cld); + MetadataVisitingOopsInGenClosure::do_cld(cld); } -inline void MetadataAwareOopsInGenClosure::do_klass(Klass* k) { do_klass_nv(k); } -inline void MetadataAwareOopsInGenClosure::do_cld_nv(ClassLoaderData* cld) { +inline void MetadataVisitingOopsInGenClosure::do_cld(ClassLoaderData* cld) { bool claim = true; // Must claim the class loader data before processing. cld->oops_do(this, claim); } // Decode the oop and call do_oop on it. -#define DO_OOP_WORK_IMPL(cls) \ - template void cls::do_oop_work(T* p) { \ - T heap_oop = RawAccess<>::oop_load(p); \ - if (!CompressedOops::is_null(heap_oop)) { \ - oop obj = CompressedOops::decode_not_null(heap_oop); \ - do_oop(obj); \ - } \ - } - -#define DO_OOP_WORK_NV_IMPL(cls) \ - DO_OOP_WORK_IMPL(cls) \ - void cls::do_oop_nv(oop* p) { cls::do_oop_work(p); } \ - void cls::do_oop_nv(narrowOop* p) { cls::do_oop_work(p); } +#define DO_OOP_WORK_IMPL(cls) \ + template void cls::do_oop_work(T* p) { \ + T heap_oop = RawAccess<>::oop_load(p); \ + if (!CompressedOops::is_null(heap_oop)) { \ + oop obj = CompressedOops::decode_not_null(heap_oop); \ + do_oop(obj); \ + } \ + } \ + inline void cls::do_oop(oop* p) { do_oop_work(p); } \ + inline void cls::do_oop(narrowOop* p) { do_oop_work(p); } DO_OOP_WORK_IMPL(MarkRefsIntoClosure) DO_OOP_WORK_IMPL(ParMarkRefsIntoClosure) DO_OOP_WORK_IMPL(MarkRefsIntoVerifyClosure) -DO_OOP_WORK_NV_IMPL(PushAndMarkClosure) -DO_OOP_WORK_NV_IMPL(ParPushAndMarkClosure) -DO_OOP_WORK_NV_IMPL(MarkRefsIntoAndScanClosure) -DO_OOP_WORK_NV_IMPL(ParMarkRefsIntoAndScanClosure) +DO_OOP_WORK_IMPL(PushAndMarkClosure) +DO_OOP_WORK_IMPL(ParPushAndMarkClosure) +DO_OOP_WORK_IMPL(MarkRefsIntoAndScanClosure) +DO_OOP_WORK_IMPL(ParMarkRefsIntoAndScanClosure) // Trim our work_queue so its length is below max at return inline void ParMarkRefsIntoAndScanClosure::trim_queue(uint max) { @@ -84,10 +80,10 @@ } } -DO_OOP_WORK_NV_IMPL(PushOrMarkClosure) -DO_OOP_WORK_NV_IMPL(ParPushOrMarkClosure) -DO_OOP_WORK_NV_IMPL(CMSKeepAliveClosure) -DO_OOP_WORK_NV_IMPL(CMSInnerParMarkAndPushClosure) +DO_OOP_WORK_IMPL(PushOrMarkClosure) +DO_OOP_WORK_IMPL(ParPushOrMarkClosure) +DO_OOP_WORK_IMPL(CMSKeepAliveClosure) +DO_OOP_WORK_IMPL(CMSInnerParMarkAndPushClosure) DO_OOP_WORK_IMPL(CMSParKeepAliveClosure) #endif // SHARE_VM_GC_CMS_CMSOOPCLOSURES_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/cms_specialized_oop_closures.hpp openjdk-11-11~24/src/hotspot/share/gc/cms/cms_specialized_oop_closures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/cms_specialized_oop_closures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/cms_specialized_oop_closures.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,63 +0,0 @@ -/* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_GC_CMS_CMS_SPECIALIZED_OOP_CLOSURES_HPP -#define SHARE_GC_CMS_CMS_SPECIALIZED_OOP_CLOSURES_HPP - -// The following OopClosure types get specialized versions of -// "oop_oop_iterate" that invoke the closures' do_oop methods -// non-virtually, using a mechanism defined in this file. Extend these -// macros in the obvious way to add specializations for new closures. - -// Forward declarations. - -// ParNew -class ParScanWithBarrierClosure; -class ParScanWithoutBarrierClosure; - -// CMS -class MarkRefsIntoAndScanClosure; -class ParMarkRefsIntoAndScanClosure; -class PushAndMarkClosure; -class ParPushAndMarkClosure; -class PushOrMarkClosure; -class ParPushOrMarkClosure; -class CMSKeepAliveClosure; -class CMSInnerParMarkAndPushClosure; - -#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f) \ - f(ParScanWithBarrierClosure,_nv) \ - f(ParScanWithoutBarrierClosure,_nv) - -#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f) \ - f(MarkRefsIntoAndScanClosure,_nv) \ - f(ParMarkRefsIntoAndScanClosure,_nv) \ - f(PushAndMarkClosure,_nv) \ - f(ParPushAndMarkClosure,_nv) \ - f(PushOrMarkClosure,_nv) \ - f(ParPushOrMarkClosure,_nv) \ - f(CMSKeepAliveClosure,_nv) \ - f(CMSInnerParMarkAndPushClosure,_nv) - -#endif // SHARE_GC_CMS_CMS_SPECIALIZED_OOP_CLOSURES_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp openjdk-11-11~24/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/compactibleFreeListSpace.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -30,12 +30,14 @@ #include "gc/cms/concurrentMarkSweepThread.hpp" #include "gc/shared/blockOffsetTable.inline.hpp" #include "gc/shared/collectedHeap.inline.hpp" +#include "gc/shared/genOopClosures.inline.hpp" #include "gc/shared/space.inline.hpp" #include "gc/shared/spaceDecorator.hpp" #include "logging/log.hpp" #include "logging/logStream.hpp" #include "memory/allocation.inline.hpp" #include "memory/binaryTreeDictionary.inline.hpp" +#include "memory/iterator.inline.hpp" #include "memory/resourceArea.hpp" #include "memory/universe.hpp" #include "oops/access.inline.hpp" @@ -843,13 +845,13 @@ void walk_mem_region_with_cl_nopar(MemRegion mr, \ HeapWord* bottom, HeapWord* top, \ ClosureType* cl) - walk_mem_region_with_cl_DECL(ExtendedOopClosure); + walk_mem_region_with_cl_DECL(OopIterateClosure); walk_mem_region_with_cl_DECL(FilteringClosure); public: FreeListSpaceDCTOC(CompactibleFreeListSpace* sp, CMSCollector* collector, - ExtendedOopClosure* cl, + OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary, bool parallel) : @@ -929,11 +931,11 @@ // (There are only two of these, rather than N, because the split is due // only to the introduction of the FilteringClosure, a local part of the // impl of this abstraction.) -FreeListSpaceDCTOC__walk_mem_region_with_cl_DEFN(ExtendedOopClosure) +FreeListSpaceDCTOC__walk_mem_region_with_cl_DEFN(OopIterateClosure) FreeListSpaceDCTOC__walk_mem_region_with_cl_DEFN(FilteringClosure) DirtyCardToOopClosure* -CompactibleFreeListSpace::new_dcto_cl(ExtendedOopClosure* cl, +CompactibleFreeListSpace::new_dcto_cl(OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary, bool parallel) { @@ -965,7 +967,7 @@ } // Apply the given closure to each oop in the space. -void CompactibleFreeListSpace::oop_iterate(ExtendedOopClosure* cl) { +void CompactibleFreeListSpace::oop_iterate(OopIterateClosure* cl) { assert_lock_strong(freelistLock()); HeapWord *cur, *limit; size_t curSize; @@ -2433,7 +2435,7 @@ } }; -class VerifyAllOopsClosure: public OopClosure { +class VerifyAllOopsClosure: public BasicOopIterateClosure { private: const CMSCollector* _collector; const CompactibleFreeListSpace* _sp; @@ -2522,9 +2524,8 @@ VerifyAllOopsClosure cl(_collector, this, span, past_remark, _collector->markBitMap()); - // Iterate over all oops in the heap. Uses the _no_header version - // since we are not interested in following the klass pointers. - CMSHeap::heap()->oop_iterate_no_header(&cl); + // Iterate over all oops in the heap. + CMSHeap::heap()->oop_iterate(&cl); } if (VerifyObjectStartArray) { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp openjdk-11-11~24/src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/compactibleFreeListSpace.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -433,7 +433,7 @@ Mutex* freelistLock() const { return &_freelistLock; } // Iteration support - void oop_iterate(ExtendedOopClosure* cl); + void oop_iterate(OopIterateClosure* cl); void object_iterate(ObjectClosure* blk); // Apply the closure to each object in the space whose references @@ -463,7 +463,7 @@ ObjectClosureCareful* cl); // Override: provides a DCTO_CL specific to this kind of space. - DirtyCardToOopClosure* new_dcto_cl(ExtendedOopClosure* cl, + DirtyCardToOopClosure* new_dcto_cl(OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary, bool parallel); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp openjdk-11-11~24/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2467,7 +2467,7 @@ } void -ConcurrentMarkSweepGeneration::oop_iterate(ExtendedOopClosure* cl) { +ConcurrentMarkSweepGeneration::oop_iterate(OopIterateClosure* cl) { if (freelistLock()->owned_by_self()) { Generation::oop_iterate(cl); } else { @@ -3305,7 +3305,7 @@ pst->all_tasks_completed(); } -class ParConcMarkingClosure: public MetadataAwareOopClosure { +class ParConcMarkingClosure: public MetadataVisitingOopIterateClosure { private: CMSCollector* _collector; CMSConcMarkingTask* _task; @@ -3318,7 +3318,7 @@ public: ParConcMarkingClosure(CMSCollector* collector, CMSConcMarkingTask* task, OopTaskQueue* work_queue, CMSBitMap* bit_map, CMSMarkStack* overflow_stack): - MetadataAwareOopClosure(collector->ref_processor()), + MetadataVisitingOopIterateClosure(collector->ref_processor()), _collector(collector), _task(task), _span(collector->_span), @@ -3382,9 +3382,6 @@ } } -void ParConcMarkingClosure::do_oop(oop* p) { ParConcMarkingClosure::do_oop_work(p); } -void ParConcMarkingClosure::do_oop(narrowOop* p) { ParConcMarkingClosure::do_oop_work(p); } - void ParConcMarkingClosure::trim_queue(size_t max) { while (_work_queue->size() > max) { oop new_oop; @@ -4065,9 +4062,9 @@ } class PrecleanCLDClosure : public CLDClosure { - MetadataAwareOopsInGenClosure* _cm_closure; + MetadataVisitingOopsInGenClosure* _cm_closure; public: - PrecleanCLDClosure(MetadataAwareOopsInGenClosure* oop_closure) : _cm_closure(oop_closure) {} + PrecleanCLDClosure(MetadataVisitingOopsInGenClosure* oop_closure) : _cm_closure(oop_closure) {} void do_cld(ClassLoaderData* cld) { if (cld->has_accumulated_modified_oops()) { cld->clear_accumulated_modified_oops(); @@ -4429,7 +4426,7 @@ ResourceMark rm; GrowableArray* array = ClassLoaderDataGraph::new_clds(); for (int i = 0; i < array->length(); i++) { - par_mrias_cl.do_cld_nv(array->at(i)); + Devirtualizer::do_cld(&par_mrias_cl, array->at(i)); } // We don't need to keep track of new CLDs anymore. @@ -4970,7 +4967,7 @@ ResourceMark rm; GrowableArray* array = ClassLoaderDataGraph::new_clds(); for (int i = 0; i < array->length(); i++) { - mrias_cl.do_cld_nv(array->at(i)); + Devirtualizer::do_cld(&mrias_cl, array->at(i)); } // We don't need to keep track of new CLDs anymore. @@ -5803,9 +5800,6 @@ } } -void MarkRefsIntoClosure::do_oop(oop* p) { MarkRefsIntoClosure::do_oop_work(p); } -void MarkRefsIntoClosure::do_oop(narrowOop* p) { MarkRefsIntoClosure::do_oop_work(p); } - ParMarkRefsIntoClosure::ParMarkRefsIntoClosure( MemRegion span, CMSBitMap* bitMap): _span(span), @@ -5825,9 +5819,6 @@ } } -void ParMarkRefsIntoClosure::do_oop(oop* p) { ParMarkRefsIntoClosure::do_oop_work(p); } -void ParMarkRefsIntoClosure::do_oop(narrowOop* p) { ParMarkRefsIntoClosure::do_oop_work(p); } - // A variant of the above, used for CMS marking verification. MarkRefsIntoVerifyClosure::MarkRefsIntoVerifyClosure( MemRegion span, CMSBitMap* verification_bm, CMSBitMap* cms_bm): @@ -5856,9 +5847,6 @@ } } -void MarkRefsIntoVerifyClosure::do_oop(oop* p) { MarkRefsIntoVerifyClosure::do_oop_work(p); } -void MarkRefsIntoVerifyClosure::do_oop(narrowOop* p) { MarkRefsIntoVerifyClosure::do_oop_work(p); } - ////////////////////////////////////////////////// // MarkRefsIntoAndScanClosure ////////////////////////////////////////////////// @@ -5933,9 +5921,6 @@ } } -void MarkRefsIntoAndScanClosure::do_oop(oop* p) { MarkRefsIntoAndScanClosure::do_oop_work(p); } -void MarkRefsIntoAndScanClosure::do_oop(narrowOop* p) { MarkRefsIntoAndScanClosure::do_oop_work(p); } - void MarkRefsIntoAndScanClosure::do_yield_work() { assert(ConcurrentMarkSweepThread::cms_thread_has_cms_token(), "CMS thread should hold CMS token"); @@ -6016,9 +6001,6 @@ } } -void ParMarkRefsIntoAndScanClosure::do_oop(oop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } -void ParMarkRefsIntoAndScanClosure::do_oop(narrowOop* p) { ParMarkRefsIntoAndScanClosure::do_oop_work(p); } - // This closure is used to rescan the marked objects on the dirty cards // in the mod union table and the card table proper. size_t ScanMarkedObjectsAgainCarefullyClosure::do_object_careful_m( @@ -6597,7 +6579,7 @@ CMSCollector* collector, MemRegion span, CMSBitMap* verification_bm, CMSBitMap* cms_bm, CMSMarkStack* mark_stack): - MetadataAwareOopClosure(collector->ref_processor()), + MetadataVisitingOopIterateClosure(collector->ref_processor()), _collector(collector), _span(span), _verification_bm(verification_bm), @@ -6654,7 +6636,7 @@ MemRegion span, CMSBitMap* bitMap, CMSMarkStack* markStack, HeapWord* finger, MarkFromRootsClosure* parent) : - MetadataAwareOopClosure(collector->ref_processor()), + MetadataVisitingOopIterateClosure(collector->ref_processor()), _collector(collector), _span(span), _bitMap(bitMap), @@ -6671,7 +6653,7 @@ HeapWord* finger, HeapWord* volatile* global_finger_addr, ParMarkFromRootsClosure* parent) : - MetadataAwareOopClosure(collector->ref_processor()), + MetadataVisitingOopIterateClosure(collector->ref_processor()), _collector(collector), _whole_span(collector->_span), _span(span), @@ -6752,9 +6734,6 @@ } } -void PushOrMarkClosure::do_oop(oop* p) { PushOrMarkClosure::do_oop_work(p); } -void PushOrMarkClosure::do_oop(narrowOop* p) { PushOrMarkClosure::do_oop_work(p); } - void ParPushOrMarkClosure::do_oop(oop obj) { // Ignore mark word because we are running concurrent with mutators. assert(oopDesc::is_oop_or_null(obj, true), "Expected an oop or NULL at " PTR_FORMAT, p2i(obj)); @@ -6801,9 +6780,6 @@ } } -void ParPushOrMarkClosure::do_oop(oop* p) { ParPushOrMarkClosure::do_oop_work(p); } -void ParPushOrMarkClosure::do_oop(narrowOop* p) { ParPushOrMarkClosure::do_oop_work(p); } - PushAndMarkClosure::PushAndMarkClosure(CMSCollector* collector, MemRegion span, ReferenceDiscoverer* rd, @@ -6811,7 +6787,7 @@ CMSBitMap* mod_union_table, CMSMarkStack* mark_stack, bool concurrent_precleaning): - MetadataAwareOopClosure(rd), + MetadataVisitingOopIterateClosure(rd), _collector(collector), _span(span), _bit_map(bit_map), @@ -6883,7 +6859,7 @@ ReferenceDiscoverer* rd, CMSBitMap* bit_map, OopTaskQueue* work_queue): - MetadataAwareOopClosure(rd), + MetadataVisitingOopIterateClosure(rd), _collector(collector), _span(span), _bit_map(bit_map), @@ -6892,9 +6868,6 @@ assert(ref_discoverer() != NULL, "ref_discoverer shouldn't be NULL"); } -void PushAndMarkClosure::do_oop(oop* p) { PushAndMarkClosure::do_oop_work(p); } -void PushAndMarkClosure::do_oop(narrowOop* p) { PushAndMarkClosure::do_oop_work(p); } - // Grey object rescan during second checkpoint phase -- // the parallel version. void ParPushAndMarkClosure::do_oop(oop obj) { @@ -6937,9 +6910,6 @@ } } -void ParPushAndMarkClosure::do_oop(oop* p) { ParPushAndMarkClosure::do_oop_work(p); } -void ParPushAndMarkClosure::do_oop(narrowOop* p) { ParPushAndMarkClosure::do_oop_work(p); } - void CMSPrecleanRefsYieldClosure::do_yield_work() { Mutex* bml = _collector->bitMapLock(); assert_lock_strong(bml); @@ -7606,9 +7576,6 @@ } } -void CMSKeepAliveClosure::do_oop(oop* p) { CMSKeepAliveClosure::do_oop_work(p); } -void CMSKeepAliveClosure::do_oop(narrowOop* p) { CMSKeepAliveClosure::do_oop_work(p); } - // CMSParKeepAliveClosure: a parallel version of the above. // The work queues are private to each closure (thread), // but (may be) available for stealing by other threads. @@ -7629,9 +7596,6 @@ } } -void CMSParKeepAliveClosure::do_oop(oop* p) { CMSParKeepAliveClosure::do_oop_work(p); } -void CMSParKeepAliveClosure::do_oop(narrowOop* p) { CMSParKeepAliveClosure::do_oop_work(p); } - void CMSParKeepAliveClosure::trim_queue(uint max) { while (_work_queue->size() > max) { oop new_oop; @@ -7677,9 +7641,6 @@ } } -void CMSInnerParMarkAndPushClosure::do_oop(oop* p) { CMSInnerParMarkAndPushClosure::do_oop_work(p); } -void CMSInnerParMarkAndPushClosure::do_oop(narrowOop* p) { CMSInnerParMarkAndPushClosure::do_oop_work(p); } - ////////////////////////////////////////////////////////////////// // CMSExpansionCause ///////////////////////////// ////////////////////////////////////////////////////////////////// diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp openjdk-11-11~24/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/concurrentMarkSweepGeneration.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1190,7 +1190,7 @@ void save_sweep_limit(); // More iteration support - virtual void oop_iterate(ExtendedOopClosure* cl); + virtual void oop_iterate(OopIterateClosure* cl); virtual void safe_object_iterate(ObjectClosure* cl); virtual void object_iterate(ObjectClosure* cl); @@ -1307,7 +1307,7 @@ // The following closures are used to do certain kinds of verification of // CMS marking. -class PushAndMarkVerifyClosure: public MetadataAwareOopClosure { +class PushAndMarkVerifyClosure: public MetadataVisitingOopIterateClosure { CMSCollector* _collector; MemRegion _span; CMSBitMap* _verification_bm; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/parNewGeneration.cpp openjdk-11-11~24/src/hotspot/share/gc/cms/parNewGeneration.cpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/parNewGeneration.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/parNewGeneration.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -51,6 +51,7 @@ #include "gc/shared/workgroup.hpp" #include "logging/log.hpp" #include "logging/logStream.hpp" +#include "memory/iterator.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/access.inline.hpp" #include "oops/compressedOops.inline.hpp" @@ -502,12 +503,6 @@ _boundary = _g->reserved().end(); } -void ParScanWithBarrierClosure::do_oop(oop* p) { ParScanClosure::do_oop_work(p, true, false); } -void ParScanWithBarrierClosure::do_oop(narrowOop* p) { ParScanClosure::do_oop_work(p, true, false); } - -void ParScanWithoutBarrierClosure::do_oop(oop* p) { ParScanClosure::do_oop_work(p, false, false); } -void ParScanWithoutBarrierClosure::do_oop(narrowOop* p) { ParScanClosure::do_oop_work(p, false, false); } - void ParRootScanWithBarrierTwoGensClosure::do_oop(oop* p) { ParScanClosure::do_oop_work(p, true, true); } void ParRootScanWithBarrierTwoGensClosure::do_oop(narrowOop* p) { ParScanClosure::do_oop_work(p, true, true); } @@ -519,9 +514,6 @@ : ScanWeakRefClosure(g), _par_scan_state(par_scan_state) {} -void ParScanWeakRefClosure::do_oop(oop* p) { ParScanWeakRefClosure::do_oop_work(p); } -void ParScanWeakRefClosure::do_oop(narrowOop* p) { ParScanWeakRefClosure::do_oop_work(p); } - #ifdef WIN32 #pragma warning(disable: 4786) /* identifier was truncated to '255' characters in the browser information */ #endif @@ -684,17 +676,17 @@ void /*ParNewGeneration::*/ParKeepAliveClosure::do_oop_work(T* p) { #ifdef ASSERT { - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); // We never expect to see a null reference being processed // as a weak reference. assert(oopDesc::is_oop(obj), "expected an oop while scanning weak refs"); } #endif // ASSERT - _par_cl->do_oop_nv(p); + Devirtualizer::do_oop_no_verify(_par_cl, p); if (CMSHeap::heap()->is_in_reserved(p)) { - oop obj = RawAccess::oop_load(p);; + oop obj = RawAccess::oop_load(p);; _rs->write_ref_field_gc_par(p, obj); } } @@ -710,17 +702,17 @@ void /*ParNewGeneration::*/KeepAliveClosure::do_oop_work(T* p) { #ifdef ASSERT { - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); // We never expect to see a null reference being processed // as a weak reference. assert(oopDesc::is_oop(obj), "expected an oop while scanning weak refs"); } #endif // ASSERT - _cl->do_oop_nv(p); + Devirtualizer::do_oop_no_verify(_cl, p); if (CMSHeap::heap()->is_in_reserved(p)) { - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); _rs->write_ref_field_gc_par(p, obj); } } @@ -737,7 +729,7 @@ oop new_obj = obj->is_forwarded() ? obj->forwardee() : _g->DefNewGeneration::copy_to_survivor_space(obj); - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); } if (_gc_barrier) { // If p points to a younger generation, mark the card. diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/parOopClosures.cpp openjdk-11-11~24/src/hotspot/share/gc/cms/parOopClosures.cpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/parOopClosures.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/parOopClosures.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "gc/cms/parOopClosures.inline.hpp" -#include "gc/cms/cms_specialized_oop_closures.hpp" -#include "memory/iterator.inline.hpp" - -// Generate ParNew specialized oop_oop_iterate functions. -SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(ALL_KLASS_OOP_OOP_ITERATE_DEFN); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/parOopClosures.hpp openjdk-11-11~24/src/hotspot/share/gc/cms/parOopClosures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/parOopClosures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/parOopClosures.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -57,8 +57,6 @@ ParScanClosure(g, par_scan_state) {} virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; class ParScanWithoutBarrierClosure: public ParScanClosure { @@ -68,8 +66,6 @@ ParScanClosure(g, par_scan_state) {} virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; class ParRootScanWithBarrierTwoGensClosure: public ParScanClosure { @@ -99,8 +95,6 @@ ParScanThreadState* par_scan_state); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; class ParEvacuateFollowersClosure: public VoidClosure { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/cms/parOopClosures.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/cms/parOopClosures.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/cms/parOopClosures.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/cms/parOopClosures.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -37,7 +37,7 @@ #include "oops/oop.inline.hpp" template inline void ParScanWeakRefClosure::do_oop_work(T* p) { - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); // weak references are sometimes scanned twice; must check // that to-space doesn't already contain this object if ((HeapWord*)obj < _boundary && !_g->to()->is_in_reserved(obj)) { @@ -53,16 +53,16 @@ new_obj = ((ParNewGeneration*)_g)->copy_to_survivor_space(_par_scan_state, obj, obj_sz, m); } - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); } } -inline void ParScanWeakRefClosure::do_oop_nv(oop* p) { ParScanWeakRefClosure::do_oop_work(p); } -inline void ParScanWeakRefClosure::do_oop_nv(narrowOop* p) { ParScanWeakRefClosure::do_oop_work(p); } +inline void ParScanWeakRefClosure::do_oop(oop* p) { ParScanWeakRefClosure::do_oop_work(p); } +inline void ParScanWeakRefClosure::do_oop(narrowOop* p) { ParScanWeakRefClosure::do_oop_work(p); } template inline void ParScanClosure::par_do_barrier(T* p) { assert(generation()->is_in_reserved(p), "expected ref in generation"); - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); // If p points to a younger generation, mark the card. if ((HeapWord*)obj < gen_boundary()) { rs()->write_ref_field_gc_par(p, obj); @@ -112,14 +112,14 @@ oop new_obj; if (m->is_marked()) { // Contains forwarding pointer. new_obj = ParNewGeneration::real_forwardee(obj); - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); log_develop_trace(gc, scavenge)("{%s %s ( " PTR_FORMAT " ) " PTR_FORMAT " -> " PTR_FORMAT " (%d)}", "forwarded ", new_obj->klass()->internal_name(), p2i(p), p2i((void *)obj), p2i((void *)new_obj), new_obj->size()); } else { size_t obj_sz = obj->size_given_klass(objK); new_obj = _g->copy_to_survivor_space(_par_scan_state, obj, obj_sz, m); - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); if (root_scan) { // This may have pushed an object. If we have a root // category with a lot of roots, can't let the queue get too @@ -137,10 +137,10 @@ } } -inline void ParScanWithBarrierClosure::do_oop_nv(oop* p) { ParScanClosure::do_oop_work(p, true, false); } -inline void ParScanWithBarrierClosure::do_oop_nv(narrowOop* p) { ParScanClosure::do_oop_work(p, true, false); } +inline void ParScanWithBarrierClosure::do_oop(oop* p) { ParScanClosure::do_oop_work(p, true, false); } +inline void ParScanWithBarrierClosure::do_oop(narrowOop* p) { ParScanClosure::do_oop_work(p, true, false); } -inline void ParScanWithoutBarrierClosure::do_oop_nv(oop* p) { ParScanClosure::do_oop_work(p, false, false); } -inline void ParScanWithoutBarrierClosure::do_oop_nv(narrowOop* p) { ParScanClosure::do_oop_work(p, false, false); } +inline void ParScanWithoutBarrierClosure::do_oop(oop* p) { ParScanClosure::do_oop_work(p, false, false); } +inline void ParScanWithoutBarrierClosure::do_oop(narrowOop* p) { ParScanClosure::do_oop_work(p, false, false); } #endif // SHARE_VM_GC_CMS_PAROOPCLOSURES_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/epsilon/epsilonHeap.hpp openjdk-11-11~24/src/hotspot/share/gc/epsilon/epsilonHeap.hpp --- openjdk-11-11~19/src/hotspot/share/gc/epsilon/epsilonHeap.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/epsilon/epsilonHeap.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -121,6 +121,11 @@ safe_object_iterate(cl); } + // Object pinning support: every object is implicitly pinned + virtual bool supports_object_pinning() const { return true; } + virtual oop pin_object(JavaThread* thread, oop obj) { return obj; } + virtual void unpin_object(JavaThread* thread, oop obj) { } + // No support for block parsing. virtual HeapWord* block_start(const void* addr) const { return NULL; } virtual size_t block_size(const HeapWord* addr) const { return 0; } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/c1/g1BarrierSetC1.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -52,11 +52,6 @@ LIR_Opr pre_val, CodeEmitInfo* info) { LIRGenerator* gen = access.gen(); DecoratorSet decorators = access.decorators(); - bool in_heap = (decorators & IN_HEAP) != 0; - bool in_conc_root = (decorators & IN_CONCURRENT_ROOT) != 0; - if (!in_heap && !in_conc_root) { - return; - } // First we test whether marking is in progress. BasicType flag_type; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1Arguments.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1Arguments.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1Arguments.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1Arguments.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -54,10 +54,10 @@ } void G1Arguments::parse_verification_type(const char* type) { - if (strcmp(type, "young-only") == 0) { - G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyYoungOnly); - } else if (strcmp(type, "initial-mark") == 0) { - G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyInitialMark); + if (strcmp(type, "young-normal") == 0) { + G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyYoungNormal); + } else if (strcmp(type, "concurrent-start") == 0) { + G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyConcurrentStart); } else if (strcmp(type, "mixed") == 0) { G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyMixed); } else if (strcmp(type, "remark") == 0) { @@ -68,7 +68,7 @@ G1HeapVerifier::enable_verification_type(G1HeapVerifier::G1VerifyFull); } else { log_warning(gc, verify)("VerifyGCType: '%s' is unknown. Available types are: " - "young-only, initial-mark, mixed, remark, cleanup and full", type); + "young-normal, concurrent-start, mixed, remark, cleanup and full", type); } } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1BarrierSet.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,7 @@ template inline void G1BarrierSet::write_ref_field_pre(T* field) { - if (HasDecorator::value || + if (HasDecorator::value || HasDecorator::value) { return; } @@ -98,12 +98,10 @@ template inline void G1BarrierSet::AccessBarrier:: oop_store_not_in_heap(T* addr, oop new_value) { - if (HasDecorator::value) { - // For roots not scanned in a safepoint, we have to apply SATB barriers - // even for roots. - G1BarrierSet *bs = barrier_set_cast(BarrierSet::barrier_set()); - bs->write_ref_field_pre(addr); - } + // Apply SATB barriers for all non-heap references, to allow + // concurrent scanning of such references. + G1BarrierSet *bs = barrier_set_cast(BarrierSet::barrier_set()); + bs->write_ref_field_pre(addr); Raw::oop_store(addr, new_value); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1CollectedHeap.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1CollectedHeap.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1CollectedHeap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2813,15 +2813,19 @@ GCTraceCPUTime tcpu; G1HeapVerifier::G1VerifyType verify_type; - FormatBuffer<> gc_string("Pause "); + FormatBuffer<> gc_string("Pause Young "); if (collector_state()->in_initial_mark_gc()) { - gc_string.append("Initial Mark"); - verify_type = G1HeapVerifier::G1VerifyInitialMark; + gc_string.append("(Concurrent Start)"); + verify_type = G1HeapVerifier::G1VerifyConcurrentStart; } else if (collector_state()->in_young_only_phase()) { - gc_string.append("Young"); - verify_type = G1HeapVerifier::G1VerifyYoungOnly; + if (collector_state()->in_young_gc_before_mixed()) { + gc_string.append("(Prepare Mixed)"); + } else { + gc_string.append("(Normal)"); + } + verify_type = G1HeapVerifier::G1VerifyYoungNormal; } else { - gc_string.append("Mixed"); + gc_string.append("(Mixed)"); verify_type = G1HeapVerifier::G1VerifyMixed; } GCTraceTime(Info, gc) tm(gc_string, NULL, gc_cause(), true); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1ConcurrentMark.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1024,11 +1024,17 @@ uint _num_regions_selected_for_rebuild; // The number of regions actually selected for rebuild. - void update_remset_before_rebuild(HeapRegion * hr) { + void update_remset_before_rebuild(HeapRegion* hr) { G1RemSetTrackingPolicy* tracking_policy = _g1h->g1_policy()->remset_tracker(); - size_t const live_bytes = _cm->liveness(hr->hrm_index()) * HeapWordSize; - bool selected_for_rebuild = tracking_policy->update_before_rebuild(hr, live_bytes); + bool selected_for_rebuild; + if (hr->is_humongous()) { + bool const is_live = _cm->liveness(hr->humongous_start_region()->hrm_index()) > 0; + selected_for_rebuild = tracking_policy->update_humongous_before_rebuild(hr, is_live); + } else { + size_t const live_bytes = _cm->liveness(hr->hrm_index()); + selected_for_rebuild = tracking_policy->update_before_rebuild(hr, live_bytes); + } if (selected_for_rebuild) { _num_regions_selected_for_rebuild++; } @@ -2116,7 +2122,7 @@ G1CMOopClosure::G1CMOopClosure(G1CollectedHeap* g1h, G1CMTask* task) - : MetadataAwareOopClosure(get_cm_oop_closure_ref_processor(g1h)), + : MetadataVisitingOopIterateClosure(get_cm_oop_closure_ref_processor(g1h)), _g1h(g1h), _task(task) { } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1ConcurrentMark.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,7 @@ #include "gc/g1/g1ConcurrentMark.hpp" #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp" #include "gc/g1/g1ConcurrentMarkObjArrayProcessor.inline.hpp" +#include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1Policy.hpp" #include "gc/g1/g1RegionMarkStatsCache.inline.hpp" #include "gc/g1/g1RemSetTrackingPolicy.hpp" diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1EvacFailure.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1EvacFailure.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1EvacFailure.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1EvacFailure.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -38,7 +38,7 @@ #include "oops/compressedOops.inline.hpp" #include "oops/oop.inline.hpp" -class UpdateRSetDeferred : public ExtendedOopClosure { +class UpdateRSetDeferred : public BasicOopIterateClosure { private: G1CollectedHeap* _g1h; DirtyCardQueue* _dcq; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCAdjustTask.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -34,6 +34,7 @@ #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/referenceProcessor.hpp" #include "logging/log.hpp" +#include "memory/iterator.inline.hpp" class G1AdjustLiveClosure : public StackObj { G1AdjustClosure* _adjust_closure; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCMarker.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCMarker.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCMarker.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCMarker.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/g1/g1FullGCMarker.inline.hpp" #include "gc/shared/referenceProcessor.hpp" +#include "memory/iterator.inline.hpp" G1FullGCMarker::G1FullGCMarker(uint worker_id, PreservedMarks* preserved_stack, G1CMBitMap* bitmap) : _worker_id(worker_id), diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCMarker.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -28,6 +28,7 @@ #include "gc/g1/g1Allocator.inline.hpp" #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp" #include "gc/g1/g1FullGCMarker.hpp" +#include "gc/g1/g1FullGCOopClosures.inline.hpp" #include "gc/g1/g1StringDedup.hpp" #include "gc/g1/g1StringDedupQueue.hpp" #include "gc/shared/preservedMarks.inline.hpp" @@ -119,8 +120,7 @@ if (VerifyDuringGC) { _verify_closure.set_containing_obj(array); - NoHeaderExtendedOopClosure no(&_verify_closure); - array->oop_iterate_range(&no, beg_index, end_index); + array->oop_iterate_range(&_verify_closure, beg_index, end_index); if (_verify_closure.failures()) { assert(false, "Failed"); } @@ -140,7 +140,7 @@ return; } _verify_closure.set_containing_obj(obj); - obj->oop_iterate_no_header(&_verify_closure); + obj->oop_iterate(&_verify_closure); if (_verify_closure.failures()) { log_warning(gc, verify)("Failed after %d", _verify_closure._cc); assert(false, "Failed"); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCMarkTask.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ #include "gc/g1/g1FullGCReferenceProcessorExecutor.hpp" #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/referenceProcessor.hpp" +#include "memory/iterator.inline.hpp" G1FullGCMarkTask::G1FullGCMarkTask(G1FullCollector* collector) : G1FullGCTask("G1 Parallel Marking Task", collector), diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCOopClosures.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,32 +26,12 @@ #include "gc/g1/g1CollectedHeap.hpp" #include "gc/g1/g1FullGCMarker.inline.hpp" #include "gc/g1/g1FullGCOopClosures.inline.hpp" -#include "gc/g1/g1_specialized_oop_closures.hpp" #include "logging/logStream.hpp" +#include "memory/iterator.inline.hpp" #include "oops/access.inline.hpp" #include "oops/compressedOops.inline.hpp" #include "oops/oop.inline.hpp" -void G1MarkAndPushClosure::do_oop(oop* p) { - do_oop_nv(p); -} - -void G1MarkAndPushClosure::do_oop(narrowOop* p) { - do_oop_nv(p); -} - -bool G1MarkAndPushClosure::do_metadata() { - return do_metadata_nv(); -} - -void G1MarkAndPushClosure::do_klass(Klass* k) { - do_klass_nv(k); -} - -void G1MarkAndPushClosure::do_cld(ClassLoaderData* cld) { - do_cld_nv(cld); -} - void G1FollowStackClosure::do_void() { _marker->drain_stack(); } void G1FullKeepAliveClosure::do_oop(oop* p) { do_oop_work(p); } @@ -75,7 +55,7 @@ #endif // PRODUCT } -template void G1VerifyOopClosure::do_oop_nv(T* p) { +template void G1VerifyOopClosure::do_oop_work(T* p) { T heap_oop = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(heap_oop)) { _cc++; @@ -121,8 +101,5 @@ } } -template void G1VerifyOopClosure::do_oop_nv(oop*); -template void G1VerifyOopClosure::do_oop_nv(narrowOop*); - -// Generate G1 full GC specialized oop_oop_iterate functions. -SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1FULL(ALL_KLASS_OOP_OOP_ITERATE_DEFN) +template void G1VerifyOopClosure::do_oop_work(oop*); +template void G1VerifyOopClosure::do_oop_work(narrowOop*); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCOopClosures.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCOopClosures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCOopClosures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCOopClosures.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -55,7 +55,7 @@ virtual void do_oop(narrowOop* p); }; -class G1MarkAndPushClosure : public ExtendedOopClosure { +class G1MarkAndPushClosure : public OopIterateClosure { G1FullGCMarker* _marker; uint _worker_id; @@ -63,33 +63,28 @@ G1MarkAndPushClosure(uint worker, G1FullGCMarker* marker, ReferenceDiscoverer* ref) : _marker(marker), _worker_id(worker), - ExtendedOopClosure(ref) { } + OopIterateClosure(ref) { } - template inline void do_oop_nv(T* p); + template inline void do_oop_work(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); virtual bool do_metadata(); - bool do_metadata_nv(); - virtual void do_klass(Klass* k); - void do_klass_nv(Klass* k); - virtual void do_cld(ClassLoaderData* cld); - void do_cld_nv(ClassLoaderData* cld); }; -class G1AdjustClosure : public ExtendedOopClosure { +class G1AdjustClosure : public BasicOopIterateClosure { template static inline void adjust_pointer(T* p); public: - template void do_oop_nv(T* p) { adjust_pointer(p); } + template void do_oop_work(T* p) { adjust_pointer(p); } virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; } }; -class G1VerifyOopClosure: public OopClosure { +class G1VerifyOopClosure: public BasicOopIterateClosure { private: G1CollectedHeap* _g1h; bool _failures; @@ -107,10 +102,10 @@ bool failures() { return _failures; } void print_object(outputStream* out, oop obj); - template void do_oop_nv(T* p); + template void do_oop_work(T* p); - void do_oop(oop* p) { do_oop_nv(p); } - void do_oop(narrowOop* p) { do_oop_nv(p); } + void do_oop(oop* p) { do_oop_work(p); } + void do_oop(narrowOop* p) { do_oop_work(p); } }; class G1FollowStackClosure: public VoidClosure { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCOopClosures.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -36,19 +36,27 @@ #include "oops/oop.inline.hpp" template -inline void G1MarkAndPushClosure::do_oop_nv(T* p) { +inline void G1MarkAndPushClosure::do_oop_work(T* p) { _marker->mark_and_push(p); } -inline bool G1MarkAndPushClosure::do_metadata_nv() { +inline void G1MarkAndPushClosure::do_oop(oop* p) { + do_oop_work(p); +} + +inline void G1MarkAndPushClosure::do_oop(narrowOop* p) { + do_oop_work(p); +} + +inline bool G1MarkAndPushClosure::do_metadata() { return true; } -inline void G1MarkAndPushClosure::do_klass_nv(Klass* k) { +inline void G1MarkAndPushClosure::do_klass(Klass* k) { _marker->follow_klass(k); } -inline void G1MarkAndPushClosure::do_cld_nv(ClassLoaderData* cld) { +inline void G1MarkAndPushClosure::do_cld(ClassLoaderData* cld) { _marker->follow_cld(cld); } @@ -78,11 +86,11 @@ // Forwarded, just update. assert(Universe::heap()->is_in_reserved(forwardee), "should be in object space"); - RawAccess::oop_store(p, forwardee); + RawAccess::oop_store(p, forwardee); } -inline void G1AdjustClosure::do_oop(oop* p) { do_oop_nv(p); } -inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_nv(p); } +inline void G1AdjustClosure::do_oop(oop* p) { do_oop_work(p); } +inline void G1AdjustClosure::do_oop(narrowOop* p) { do_oop_work(p); } inline bool G1IsAliveClosure::do_object_b(oop p) { return _bitmap->is_marked(p) || G1ArchiveAllocator::is_closed_archive_object(p); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCPrepareTask.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -35,6 +35,7 @@ #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/referenceProcessor.hpp" #include "logging/log.hpp" +#include "memory/iterator.inline.hpp" #include "oops/oop.inline.hpp" #include "utilities/ticks.hpp" diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1FullGCReferenceProcessorExecutor.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -30,6 +30,7 @@ #include "gc/g1/g1FullGCReferenceProcessorExecutor.hpp" #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/referenceProcessor.hpp" +#include "memory/iterator.inline.hpp" G1FullGCReferenceProcessingExecutor::G1FullGCReferenceProcessingExecutor(G1FullCollector* collector) : _collector(collector), diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1HeapVerifier.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1HeapVerifier.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1HeapVerifier.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1HeapVerifier.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -37,6 +37,7 @@ #include "gc/g1/g1StringDedup.hpp" #include "logging/log.hpp" #include "logging/logStream.hpp" +#include "memory/iterator.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/access.inline.hpp" #include "oops/compressedOops.inline.hpp" @@ -61,7 +62,7 @@ bool failures() { return _failures; } - template void do_oop_nv(T* p) { + template void do_oop_work(T* p) { T heap_oop = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(heap_oop)) { oop obj = CompressedOops::decode_not_null(heap_oop); @@ -76,8 +77,8 @@ } } - void do_oop(oop* p) { do_oop_nv(p); } - void do_oop(narrowOop* p) { do_oop_nv(p); } + void do_oop(oop* p) { do_oop_work(p); } + void do_oop(narrowOop* p) { do_oop_work(p); } }; class G1VerifyCodeRootOopClosure: public OopClosure { @@ -179,7 +180,7 @@ } }; -class VerifyLivenessOopClosure: public OopClosure { +class VerifyLivenessOopClosure: public BasicOopIterateClosure { G1CollectedHeap* _g1h; VerifyOption _vo; public: @@ -225,7 +226,7 @@ guarantee(!_g1h->is_obj_dead(o), "Full GC marking and concurrent mark mismatch"); } - o->oop_iterate_no_header(&isLive); + o->oop_iterate(&isLive); if (!_hr->obj_allocated_since_prev_marking(o)) { size_t obj_size = o->size(); // Make sure we don't overflow _live_bytes += (obj_size * HeapWordSize); @@ -235,7 +236,7 @@ size_t live_bytes() { return _live_bytes; } }; -class VerifyArchiveOopClosure: public OopClosure { +class VerifyArchiveOopClosure: public BasicOopIterateClosure { HeapRegion* _hr; public: VerifyArchiveOopClosure(HeapRegion *hr) @@ -268,7 +269,7 @@ void do_object(oop o) { VerifyArchiveOopClosure checkOop(_hr); assert(o != NULL, "Should not be here for NULL oops"); - o->oop_iterate_no_header(&checkOop); + o->oop_iterate(&checkOop); } }; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1HeapVerifier.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1HeapVerifier.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1HeapVerifier.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1HeapVerifier.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -42,13 +42,13 @@ public: enum G1VerifyType { - G1VerifyYoungOnly = 1, // -XX:VerifyGCType=young-only - G1VerifyInitialMark = 2, // -XX:VerifyGCType=initial-mark - G1VerifyMixed = 4, // -XX:VerifyGCType=mixed - G1VerifyRemark = 8, // -XX:VerifyGCType=remark - G1VerifyCleanup = 16, // -XX:VerifyGCType=cleanup - G1VerifyFull = 32, // -XX:VerifyGCType=full - G1VerifyAll = -1 + G1VerifyYoungNormal = 1, // -XX:VerifyGCType=young-normal + G1VerifyConcurrentStart = 2, // -XX:VerifyGCType=concurrent-start + G1VerifyMixed = 4, // -XX:VerifyGCType=mixed + G1VerifyRemark = 8, // -XX:VerifyGCType=remark + G1VerifyCleanup = 16, // -XX:VerifyGCType=cleanup + G1VerifyFull = 32, // -XX:VerifyGCType=full + G1VerifyAll = -1 }; G1HeapVerifier(G1CollectedHeap* heap) : _g1h(heap) {} diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1OopClosures.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1OopClosures.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1OopClosures.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1OopClosures.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,6 @@ #include "gc/g1/g1CollectedHeap.inline.hpp" #include "gc/g1/g1OopClosures.inline.hpp" #include "gc/g1/g1ParScanThreadState.hpp" -#include "gc/g1/g1_specialized_oop_closures.hpp" #include "memory/iterator.inline.hpp" #include "utilities/stack.inline.hpp" @@ -61,6 +60,3 @@ } _count++; } - -// Generate G1 specialized oop_oop_iterate functions. -SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(ALL_KLASS_OOP_OOP_ITERATE_DEFN) diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1OopClosures.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1OopClosures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1OopClosures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1OopClosures.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -39,7 +39,7 @@ class G1CMTask; class ReferenceProcessor; -class G1ScanClosureBase : public ExtendedOopClosure { +class G1ScanClosureBase : public BasicOopIterateClosure { protected: G1CollectedHeap* _g1h; G1ParScanThreadState* _par_scan_state; @@ -71,9 +71,9 @@ uint worker_i) : G1ScanClosureBase(g1h, pss), _worker_i(worker_i) { } - template void do_oop_nv(T* p); - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } - virtual void do_oop(oop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } }; // Used during the Scan RS phase to scan cards from the remembered set during garbage collection. @@ -83,9 +83,9 @@ G1ParScanThreadState* par_scan_state): G1ScanClosureBase(g1h, par_scan_state) { } - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; // This closure is applied to the fields of the objects that have just been copied during evacuation. @@ -94,9 +94,9 @@ G1ScanEvacuatedObjClosure(G1CollectedHeap* g1h, G1ParScanThreadState* par_scan_state) : G1ScanClosureBase(g1h, par_scan_state) { } - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } void set_ref_discoverer(ReferenceDiscoverer* rd) { set_ref_discoverer_internal(rd); @@ -167,18 +167,18 @@ }; // Closure for iterating over object fields during concurrent marking -class G1CMOopClosure : public MetadataAwareOopClosure { +class G1CMOopClosure : public MetadataVisitingOopIterateClosure { G1CollectedHeap* _g1h; G1CMTask* _task; public: G1CMOopClosure(G1CollectedHeap* g1h,G1CMTask* task); - template void do_oop_nv(T* p); - virtual void do_oop( oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop( oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; // Closure to scan the root regions during concurrent marking -class G1RootRegionScanClosure : public MetadataAwareOopClosure { +class G1RootRegionScanClosure : public MetadataVisitingOopIterateClosure { private: G1CollectedHeap* _g1h; G1ConcurrentMark* _cm; @@ -186,12 +186,12 @@ public: G1RootRegionScanClosure(G1CollectedHeap* g1h, G1ConcurrentMark* cm, uint worker_id) : _g1h(g1h), _cm(cm), _worker_id(worker_id) { } - template void do_oop_nv(T* p); - virtual void do_oop( oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop( oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } }; -class G1ConcurrentRefineOopClosure: public ExtendedOopClosure { +class G1ConcurrentRefineOopClosure: public BasicOopIterateClosure { G1CollectedHeap* _g1h; uint _worker_i; @@ -204,21 +204,21 @@ // This closure needs special handling for InstanceRefKlass. virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERED_AND_DISCOVERY; } - template void do_oop_nv(T* p); - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } - virtual void do_oop(oop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(narrowOop* p) { do_oop_work(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } }; -class G1RebuildRemSetClosure : public ExtendedOopClosure { +class G1RebuildRemSetClosure : public BasicOopIterateClosure { G1CollectedHeap* _g1h; uint _worker_id; public: G1RebuildRemSetClosure(G1CollectedHeap* g1h, uint worker_id) : _g1h(g1h), _worker_id(worker_id) { } - template void do_oop_nv(T* p); - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + template void do_oop_work(T* p); + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } // This closure needs special handling for InstanceRefKlass. virtual ReferenceIterationMode reference_iteration_mode() { return DO_DISCOVERED_AND_DISCOVERY; } }; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1OopClosures.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -72,7 +72,7 @@ } template -inline void G1ScanEvacuatedObjClosure::do_oop_nv(T* p) { +inline void G1ScanEvacuatedObjClosure::do_oop_work(T* p) { T heap_oop = RawAccess<>::oop_load(p); if (CompressedOops::is_null(heap_oop)) { @@ -92,12 +92,12 @@ } template -inline void G1CMOopClosure::do_oop_nv(T* p) { +inline void G1CMOopClosure::do_oop_work(T* p) { _task->deal_with_reference(p); } template -inline void G1RootRegionScanClosure::do_oop_nv(T* p) { +inline void G1RootRegionScanClosure::do_oop_work(T* p) { T heap_oop = RawAccess::oop_load(p); if (CompressedOops::is_null(heap_oop)) { return; @@ -128,7 +128,7 @@ } template -inline void G1ConcurrentRefineOopClosure::do_oop_nv(T* p) { +inline void G1ConcurrentRefineOopClosure::do_oop_work(T* p) { T o = RawAccess::oop_load(p); if (CompressedOops::is_null(o)) { return; @@ -157,7 +157,7 @@ } template -inline void G1ScanObjsDuringUpdateRSClosure::do_oop_nv(T* p) { +inline void G1ScanObjsDuringUpdateRSClosure::do_oop_work(T* p) { T o = RawAccess<>::oop_load(p); if (CompressedOops::is_null(o)) { return; @@ -183,7 +183,7 @@ } template -inline void G1ScanObjsDuringScanRSClosure::do_oop_nv(T* p) { +inline void G1ScanObjsDuringScanRSClosure::do_oop_work(T* p) { T heap_oop = RawAccess<>::oop_load(p); if (CompressedOops::is_null(heap_oop)) { return; @@ -256,7 +256,7 @@ forwardee = _par_scan_state->copy_to_survivor_space(state, obj, m); } assert(forwardee != NULL, "forwardee should not be NULL"); - RawAccess::oop_store(p, forwardee); + RawAccess::oop_store(p, forwardee); if (do_mark_object != G1MarkNone && forwardee != obj) { // If the object is self-forwarded we don't need to explicitly // mark it, the evacuation failure protocol will do so. @@ -280,7 +280,7 @@ trim_queue_partially(); } -template void G1RebuildRemSetClosure::do_oop_nv(T* p) { +template void G1RebuildRemSetClosure::do_oop_work(T* p) { oop const obj = RawAccess::oop_load(p); if (obj == NULL) { return; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1ParScanThreadState.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -266,7 +266,7 @@ Prefetch::write(obj_ptr, PrefetchCopyIntervalInBytes); const oop obj = oop(obj_ptr); - const oop forward_ptr = old->forward_to_atomic(obj); + const oop forward_ptr = old->forward_to_atomic(obj, memory_order_relaxed); if (forward_ptr == NULL) { Copy::aligned_disjoint_words((HeapWord*) old, obj_ptr, word_sz); @@ -356,7 +356,7 @@ oop G1ParScanThreadState::handle_evacuation_failure_par(oop old, markOop m) { assert(_g1h->is_in_cset(old), "Object " PTR_FORMAT " should be in the CSet", p2i(old)); - oop forward_ptr = old->forward_to_atomic(old); + oop forward_ptr = old->forward_to_atomic(old, memory_order_relaxed); if (forward_ptr == NULL) { // Forward-to-self succeeded. We are the "owner" of the object. HeapRegion* r = _g1h->heap_region_containing(old); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1ParScanThreadState.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -32,7 +32,7 @@ template void G1ParScanThreadState::do_oop_evac(T* p) { // Reference should not be NULL here as such are never pushed to the task queue. - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); // Although we never intentionally push references outside of the collection // set, due to (benign) races in the claim mechanism during RSet scanning more @@ -47,7 +47,7 @@ } else { obj = copy_to_survivor_space(in_cset_state, obj, m); } - RawAccess::oop_store(p, obj); + RawAccess::oop_store(p, obj); } else if (in_cset_state.is_humongous()) { _g1h->set_humongous_is_live(obj); } else { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -29,10 +29,6 @@ #include "gc/g1/heapRegionRemSet.hpp" #include "runtime/safepoint.hpp" -bool G1RemSetTrackingPolicy::is_interesting_humongous_region(HeapRegion* r) const { - return r->is_humongous() && oop(r->humongous_start_region()->bottom())->is_typeArray(); -} - bool G1RemSetTrackingPolicy::needs_scan_for_rebuild(HeapRegion* r) const { // All non-free, non-young, non-closed archive regions need to be scanned for references; // At every gc we gather references to other regions in young, and closed archive @@ -64,51 +60,81 @@ /* nothing to do */ } -bool G1RemSetTrackingPolicy::update_before_rebuild(HeapRegion* r, size_t live_bytes) { +static void print_before_rebuild(HeapRegion* r, bool selected_for_rebuild, size_t total_live_bytes, size_t live_bytes) { + log_trace(gc, remset, tracking)("Before rebuild region %u " + "(ntams: " PTR_FORMAT ") " + "total_live_bytes " SIZE_FORMAT " " + "selected %s " + "(live_bytes " SIZE_FORMAT " " + "next_marked " SIZE_FORMAT " " + "marked " SIZE_FORMAT " " + "type %s)", + r->hrm_index(), + p2i(r->next_top_at_mark_start()), + total_live_bytes, + BOOL_TO_STR(selected_for_rebuild), + live_bytes, + r->next_marked_bytes(), + r->marked_bytes(), + r->get_type_str()); +} + +bool G1RemSetTrackingPolicy::update_humongous_before_rebuild(HeapRegion* r, bool is_live) { assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); + assert(r->is_humongous(), "Region %u should be humongous", r->hrm_index()); + + if (r->is_archive()) { + return false; + } + + assert(!r->rem_set()->is_updating(), "Remembered set of region %u is updating before rebuild", r->hrm_index()); bool selected_for_rebuild = false; + // For humongous regions, to be of interest for rebuilding the remembered set the following must apply: + // - We always try to update the remembered sets of humongous regions containing + // type arrays as they might have been reset after full gc. + if (is_live && oop(r->humongous_start_region()->bottom())->is_typeArray() && !r->rem_set()->is_tracked()) { + r->rem_set()->set_state_updating(); + selected_for_rebuild = true; + } + + size_t const live_bytes = is_live ? HeapRegion::GrainBytes : 0; + print_before_rebuild(r, selected_for_rebuild, live_bytes, live_bytes); + + return selected_for_rebuild; +} + +bool G1RemSetTrackingPolicy::update_before_rebuild(HeapRegion* r, size_t live_bytes) { + assert(SafepointSynchronize::is_at_safepoint(), "should be at safepoint"); + assert(!r->is_humongous(), "Region %u is humongous", r->hrm_index()); // Only consider updating the remembered set for old gen regions - excluding archive regions // which never move (but are "Old" regions). - if (r->is_old_or_humongous() && !r->is_archive()) { - size_t between_ntams_and_top = (r->top() - r->next_top_at_mark_start()) * HeapWordSize; - size_t total_live_bytes = live_bytes + between_ntams_and_top; - // Completely free regions after rebuild are of no interest wrt rebuilding the - // remembered set. - assert(!r->rem_set()->is_updating(), "Remembered set of region %u is updating before rebuild", r->hrm_index()); - // To be of interest for rebuilding the remembered set the following must apply: - // - They must contain some live data in them. - // - We always try to update the remembered sets of humongous regions containing - // type arrays if they are empty as they might have been reset after full gc. - // - Only need to rebuild non-complete remembered sets. - // - Otherwise only add those old gen regions which occupancy is low enough that there - // is a chance that we will ever evacuate them in the mixed gcs. - if ((total_live_bytes > 0) && - (is_interesting_humongous_region(r) || CollectionSetChooser::region_occupancy_low_enough_for_evac(total_live_bytes)) && - !r->rem_set()->is_tracked()) { + if (!r->is_old() || r->is_archive()) { + return false; + } - r->rem_set()->set_state_updating(); - selected_for_rebuild = true; - } - log_trace(gc, remset, tracking)("Before rebuild region %u " - "(ntams: " PTR_FORMAT ") " - "total_live_bytes " SIZE_FORMAT " " - "selected %s " - "(live_bytes " SIZE_FORMAT " " - "next_marked " SIZE_FORMAT " " - "marked " SIZE_FORMAT " " - "type %s)", - r->hrm_index(), - p2i(r->next_top_at_mark_start()), - total_live_bytes, - BOOL_TO_STR(selected_for_rebuild), - live_bytes, - r->next_marked_bytes(), - r->marked_bytes(), - r->get_type_str()); + assert(!r->rem_set()->is_updating(), "Remembered set of region %u is updating before rebuild", r->hrm_index()); + + size_t between_ntams_and_top = (r->top() - r->next_top_at_mark_start()) * HeapWordSize; + size_t total_live_bytes = live_bytes + between_ntams_and_top; + + bool selected_for_rebuild = false; + // For old regions, to be of interest for rebuilding the remembered set the following must apply: + // - They must contain some live data in them. + // - Only need to rebuild non-complete remembered sets. + // - Otherwise only add those old gen regions which occupancy is low enough that there + // is a chance that we will ever evacuate them in the mixed gcs. + if ((total_live_bytes > 0) && + CollectionSetChooser::region_occupancy_low_enough_for_evac(total_live_bytes) && + !r->rem_set()->is_tracked()) { + + r->rem_set()->set_state_updating(); + selected_for_rebuild = true; } + print_before_rebuild(r, selected_for_rebuild, total_live_bytes, live_bytes); + return selected_for_rebuild; } @@ -149,4 +175,3 @@ r->rem_set()->mem_size()); } } - diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1RemSetTrackingPolicy.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,6 @@ // the remembered set, ie. when it should be tracked, and if/when the remembered // set is complete. class G1RemSetTrackingPolicy : public CHeapObj { -private: - // Is the given region an interesting humongous region to start remembered set tracking - // for? - bool is_interesting_humongous_region(HeapRegion* r) const; public: // Do we need to scan the given region to get all outgoing references for remembered // set rebuild? @@ -45,6 +41,9 @@ // called at any time. The caller makes sure that the changes to the remembered // set state are visible to other threads. void update_at_allocate(HeapRegion* r); + // Update remembered set tracking state for humongous regions before we are going to + // rebuild remembered sets. Called at safepoint in the remark pause. + bool update_humongous_before_rebuild(HeapRegion* r, bool is_live); // Update remembered set tracking state before we are going to rebuild remembered // sets. Called at safepoint in the remark pause. bool update_before_rebuild(HeapRegion* r, size_t live_bytes); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/g1_specialized_oop_closures.hpp openjdk-11-11~24/src/hotspot/share/gc/g1/g1_specialized_oop_closures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/g1_specialized_oop_closures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/g1_specialized_oop_closures.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_VM_GC_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP -#define SHARE_VM_GC_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP - -// The following OopClosure types get specialized versions of -// "oop_oop_iterate" that invoke the closures' do_oop methods -// non-virtually, using a mechanism defined in this file. Extend these -// macros in the obvious way to add specializations for new closures. - -// Forward declarations. - -class G1ScanEvacuatedObjClosure; - -class G1ScanObjsDuringUpdateRSClosure; -class G1ScanObjsDuringScanRSClosure; -class G1ConcurrentRefineOopClosure; - -class G1CMOopClosure; -class G1RootRegionScanClosure; - -class G1MarkAndPushClosure; -class G1AdjustClosure; - -class G1RebuildRemSetClosure; - -#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f) \ - f(G1ScanEvacuatedObjClosure,_nv) \ - f(G1ScanObjsDuringUpdateRSClosure,_nv) \ - f(G1ScanObjsDuringScanRSClosure,_nv) \ - f(G1ConcurrentRefineOopClosure,_nv) \ - f(G1CMOopClosure,_nv) \ - f(G1RootRegionScanClosure,_nv) \ - f(G1RebuildRemSetClosure,_nv) - -#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1FULL(f) \ - f(G1MarkAndPushClosure,_nv) \ - f(G1AdjustClosure,_nv) - -#endif // SHARE_VM_GC_G1_G1_SPECIALIZED_OOP_CLOSURES_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/g1/heapRegion.cpp openjdk-11-11~24/src/hotspot/share/gc/g1/heapRegion.cpp --- openjdk-11-11~19/src/hotspot/share/gc/g1/heapRegion.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/g1/heapRegion.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -37,7 +37,7 @@ #include "gc/shared/space.inline.hpp" #include "logging/log.hpp" #include "logging/logStream.hpp" -#include "memory/iterator.hpp" +#include "memory/iterator.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/access.inline.hpp" #include "oops/compressedOops.inline.hpp" @@ -450,7 +450,7 @@ p2i(prev_top_at_mark_start()), p2i(next_top_at_mark_start()), rem_set()->get_state_str()); } -class G1VerificationClosure : public ExtendedOopClosure { +class G1VerificationClosure : public BasicOopIterateClosure { protected: G1CollectedHeap* _g1h; G1CardTable *_ct; @@ -608,7 +608,7 @@ }; // Closure that applies the given two closures in sequence. -class G1Mux2Closure : public ExtendedOopClosure { +class G1Mux2Closure : public BasicOopIterateClosure { OopClosure* _c1; OopClosure* _c2; public: diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/immutableSpace.cpp openjdk-11-11~24/src/hotspot/share/gc/parallel/immutableSpace.cpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/immutableSpace.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/immutableSpace.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "gc/parallel/immutableSpace.hpp" +#include "memory/iterator.inline.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" #include "utilities/macros.hpp" @@ -39,7 +40,7 @@ _end = end; } -void ImmutableSpace::oop_iterate(ExtendedOopClosure* cl) { +void ImmutableSpace::oop_iterate(OopIterateClosure* cl) { HeapWord* obj_addr = bottom(); HeapWord* t = end(); // Could call objects iterate, but this is easier. diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/immutableSpace.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/immutableSpace.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/immutableSpace.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/immutableSpace.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -59,7 +59,7 @@ virtual size_t capacity_in_words(Thread*) const { return capacity_in_words(); } // Iteration. - virtual void oop_iterate(ExtendedOopClosure* cl); + virtual void oop_iterate(OopIterateClosure* cl); virtual void object_iterate(ObjectClosure* cl); // Debugging diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/mutableSpace.cpp openjdk-11-11~24/src/hotspot/share/gc/parallel/mutableSpace.cpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/mutableSpace.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/mutableSpace.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/parallel/mutableSpace.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "memory/iterator.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" #include "runtime/safepoint.hpp" @@ -214,12 +215,12 @@ return Atomic::cmpxchg(obj, top_addr(), expected_top) == expected_top; } -void MutableSpace::oop_iterate_no_header(OopClosure* cl) { +void MutableSpace::oop_iterate(OopIterateClosure* cl) { HeapWord* obj_addr = bottom(); HeapWord* t = top(); // Could call objects iterate, but this is easier. while (obj_addr < t) { - obj_addr += oop(obj_addr)->oop_iterate_no_header(cl); + obj_addr += oop(obj_addr)->oop_iterate_size(cl); } } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/mutableSpace.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/mutableSpace.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/mutableSpace.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/mutableSpace.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -134,7 +134,7 @@ bool cas_deallocate(HeapWord *obj, size_t size); // Iteration. - void oop_iterate_no_header(OopClosure* cl); + void oop_iterate(OopIterateClosure* cl); void object_iterate(ObjectClosure* cl); // Debugging diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psCardTable.cpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psCardTable.cpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psCardTable.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psCardTable.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ #include "gc/parallel/psScavenge.hpp" #include "gc/parallel/psTasks.hpp" #include "gc/parallel/psYoungGen.hpp" +#include "memory/iterator.inline.hpp" #include "oops/access.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/prefetch.inline.hpp" @@ -38,7 +39,7 @@ // Checks an individual oop for missing precise marks. Mark // may be either dirty or newgen. -class CheckForUnmarkedOops : public OopClosure { +class CheckForUnmarkedOops : public BasicOopIterateClosure { private: PSYoungGen* _young_gen; PSCardTable* _card_table; @@ -88,7 +89,7 @@ // fail unless the object head is also unmarked. virtual void do_object(oop obj) { CheckForUnmarkedOops object_check(_young_gen, _card_table); - obj->oop_iterate_no_header(&object_check); + obj->oop_iterate(&object_check); if (object_check.has_unmarked_oop()) { guarantee(_card_table->addr_is_marked_imprecise(obj), "Found unmarked young_gen object"); } @@ -96,14 +97,14 @@ }; // Checks for precise marking of oops as newgen. -class CheckForPreciseMarks : public OopClosure { +class CheckForPreciseMarks : public BasicOopIterateClosure { private: PSYoungGen* _young_gen; PSCardTable* _card_table; protected: template void do_oop_work(T* p) { - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); if (_young_gen->is_in_reserved(obj)) { assert(_card_table->addr_is_marked_precise(p), "Found unmarked precise oop"); _card_table->set_card_newgen(p); @@ -335,7 +336,7 @@ CheckForPreciseMarks check(heap->young_gen(), this); - old_gen->oop_iterate_no_header(&check); + old_gen->oop_iterate(&check); verify_all_young_refs_precise_helper(old_gen->object_space()->used_region()); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psCompactionManager.cpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psCompactionManager.cpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psCompactionManager.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psCompactionManager.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -140,7 +140,11 @@ // everything else. ParCompactionManager::MarkAndPushClosure cl(cm); - InstanceKlass::oop_oop_iterate_oop_maps(obj, &cl); + if (UseCompressedOops) { + InstanceKlass::oop_oop_iterate_oop_maps(obj, &cl); + } else { + InstanceKlass::oop_oop_iterate_oop_maps(obj, &cl); + } } void InstanceMirrorKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { @@ -169,7 +173,11 @@ } ParCompactionManager::MarkAndPushClosure cl(cm); - oop_oop_iterate_statics(obj, &cl); + if (UseCompressedOops) { + oop_oop_iterate_statics(obj, &cl); + } else { + oop_oop_iterate_statics(obj, &cl); + } } void InstanceClassLoaderKlass::oop_pc_follow_contents(oop obj, ParCompactionManager* cm) { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psCompactionManager.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psCompactionManager.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psCompactionManager.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psCompactionManager.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -175,13 +175,13 @@ void update_contents(oop obj); - class MarkAndPushClosure: public ExtendedOopClosure { + class MarkAndPushClosure: public BasicOopIterateClosure { private: ParCompactionManager* _compaction_manager; public: MarkAndPushClosure(ParCompactionManager* cm) : _compaction_manager(cm) { } - template void do_oop_nv(T* p); + template void do_oop_work(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psCompactionManager.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -85,12 +85,12 @@ } template -inline void ParCompactionManager::MarkAndPushClosure::do_oop_nv(T* p) { +inline void ParCompactionManager::MarkAndPushClosure::do_oop_work(T* p) { _compaction_manager->mark_and_push(p); } -inline void ParCompactionManager::MarkAndPushClosure::do_oop(oop* p) { do_oop_nv(p); } -inline void ParCompactionManager::MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_nv(p); } +inline void ParCompactionManager::MarkAndPushClosure::do_oop(oop* p) { do_oop_work(p); } +inline void ParCompactionManager::MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_work(p); } inline void ParCompactionManager::follow_klass(Klass* klass) { oop holder = klass->klass_holder(); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psMarkSweepDecorator.cpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psMarkSweepDecorator.cpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psMarkSweepDecorator.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psMarkSweepDecorator.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -32,6 +32,7 @@ #include "gc/parallel/psParallelCompact.inline.hpp" #include "gc/serial/markSweep.inline.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "memory/iterator.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/prefetch.inline.hpp" diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psOldGen.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psOldGen.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psOldGen.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psOldGen.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -192,7 +192,7 @@ HeapWord* allocate(size_t word_size); // Iteration. - void oop_iterate_no_header(OopClosure* cl) { object_space()->oop_iterate_no_header(cl); } + void oop_iterate(OopIterateClosure* cl) { object_space()->oop_iterate(cl); } void object_iterate(ObjectClosure* cl) { object_space()->object_iterate(cl); } // Debugging - do not use for time critical operations diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psParallelCompact.cpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psParallelCompact.cpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psParallelCompact.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psParallelCompact.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "aot/aotLoader.hpp" +#include "classfile/javaClasses.inline.hpp" #include "classfile/stringTable.hpp" #include "classfile/symbolTable.hpp" #include "classfile/systemDictionary.hpp" @@ -53,8 +54,10 @@ #include "gc/shared/spaceDecorator.hpp" #include "gc/shared/weakProcessor.hpp" #include "logging/log.hpp" +#include "memory/iterator.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/access.inline.hpp" +#include "oops/instanceClassLoaderKlass.inline.hpp" #include "oops/instanceKlass.inline.hpp" #include "oops/instanceMirrorKlass.inline.hpp" #include "oops/methodData.hpp" @@ -3069,14 +3072,22 @@ void InstanceKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { PSParallelCompact::AdjustPointerClosure closure(cm); - oop_oop_iterate_oop_maps(obj, &closure); + if (UseCompressedOops) { + oop_oop_iterate_oop_maps(obj, &closure); + } else { + oop_oop_iterate_oop_maps(obj, &closure); + } } void InstanceMirrorKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { InstanceKlass::oop_pc_update_pointers(obj, cm); PSParallelCompact::AdjustPointerClosure closure(cm); - oop_oop_iterate_statics(obj, &closure); + if (UseCompressedOops) { + oop_oop_iterate_statics(obj, &closure); + } else { + oop_oop_iterate_statics(obj, &closure); + } } void InstanceClassLoaderKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { @@ -3118,7 +3129,11 @@ void ObjArrayKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { assert(obj->is_objArray(), "obj must be obj array"); PSParallelCompact::AdjustPointerClosure closure(cm); - oop_oop_iterate_elements(objArrayOop(obj), &closure); + if (UseCompressedOops) { + oop_oop_iterate_elements(objArrayOop(obj), &closure); + } else { + oop_oop_iterate_elements(objArrayOop(obj), &closure); + } } void TypeArrayKlass::oop_pc_update_pointers(oop obj, ParCompactionManager* cm) { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psParallelCompact.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psParallelCompact.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psParallelCompact.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psParallelCompact.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -934,13 +934,13 @@ virtual bool do_object_b(oop p); }; - class AdjustPointerClosure: public ExtendedOopClosure { + class AdjustPointerClosure: public BasicOopIterateClosure { public: AdjustPointerClosure(ParCompactionManager* cm) { assert(cm != NULL, "associate ParCompactionManage should not be NULL"); _cm = cm; } - template void do_oop_nv(T* p); + template void do_oop_work(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psParallelCompact.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -119,17 +119,17 @@ if (new_obj != NULL) { assert(ParallelScavengeHeap::heap()->is_in_reserved(new_obj), "should be in object space"); - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); } } } template -void PSParallelCompact::AdjustPointerClosure::do_oop_nv(T* p) { +void PSParallelCompact::AdjustPointerClosure::do_oop_work(T* p) { adjust_pointer(p, _cm); } -inline void PSParallelCompact::AdjustPointerClosure::do_oop(oop* p) { do_oop_nv(p); } -inline void PSParallelCompact::AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_nv(p); } +inline void PSParallelCompact::AdjustPointerClosure::do_oop(oop* p) { do_oop_work(p); } +inline void PSParallelCompact::AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_work(p); } #endif // SHARE_VM_GC_PARALLEL_PSPARALLELCOMPACT_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psPromotionManager.cpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psPromotionManager.cpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psPromotionManager.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psPromotionManager.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,7 @@ */ #include "precompiled.hpp" +#include "classfile/javaClasses.inline.hpp" #include "gc/parallel/gcTaskManager.hpp" #include "gc/parallel/mutableSpace.hpp" #include "gc/parallel/parallelScavengeHeap.hpp" @@ -35,12 +36,14 @@ #include "logging/log.hpp" #include "logging/logStream.hpp" #include "memory/allocation.inline.hpp" +#include "memory/iterator.inline.hpp" #include "memory/memRegion.hpp" #include "memory/padded.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/access.inline.hpp" #include "oops/arrayOop.inline.hpp" #include "oops/compressedOops.inline.hpp" +#include "oops/instanceClassLoaderKlass.inline.hpp" #include "oops/instanceKlass.inline.hpp" #include "oops/instanceMirrorKlass.inline.hpp" #include "oops/objArrayKlass.inline.hpp" @@ -394,19 +397,19 @@ } } -class PushContentsClosure : public ExtendedOopClosure { +class PushContentsClosure : public BasicOopIterateClosure { PSPromotionManager* _pm; public: PushContentsClosure(PSPromotionManager* pm) : _pm(pm) {} - template void do_oop_nv(T* p) { + template void do_oop_work(T* p) { if (PSScavenge::should_scavenge(p)) { _pm->claim_or_forward_depth(p); } } - virtual void do_oop(oop* p) { do_oop_nv(p); } - virtual void do_oop(narrowOop* p) { do_oop_nv(p); } + virtual void do_oop(oop* p) { do_oop_work(p); } + virtual void do_oop(narrowOop* p) { do_oop_work(p); } // Don't use the oop verification code in the oop_oop_iterate framework. debug_only(virtual bool should_verify_oops() { return false; }) @@ -414,7 +417,11 @@ void InstanceKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { PushContentsClosure cl(pm); - oop_oop_iterate_oop_maps_reverse(obj, &cl); + if (UseCompressedOops) { + oop_oop_iterate_oop_maps_reverse(obj, &cl); + } else { + oop_oop_iterate_oop_maps_reverse(obj, &cl); + } } void InstanceMirrorKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { @@ -425,7 +432,11 @@ InstanceKlass::oop_ps_push_contents(obj, pm); PushContentsClosure cl(pm); - oop_oop_iterate_statics(obj, &cl); + if (UseCompressedOops) { + oop_oop_iterate_statics(obj, &cl); + } else { + oop_oop_iterate_statics(obj, &cl); + } } void InstanceClassLoaderKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { @@ -469,7 +480,11 @@ void ObjArrayKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { assert(obj->is_objArray(), "obj must be obj array"); PushContentsClosure cl(pm); - oop_oop_iterate_elements(objArrayOop(obj), &cl); + if (UseCompressedOops) { + oop_oop_iterate_elements(objArrayOop(obj), &cl); + } else { + oop_oop_iterate_elements(objArrayOop(obj), &cl); + } } void TypeArrayKlass::oop_ps_push_contents(oop obj, PSPromotionManager* pm) { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -50,14 +50,14 @@ template inline void PSPromotionManager::claim_or_forward_internal_depth(T* p) { if (p != NULL) { // XXX: error if p != NULL here - oop o = RawAccess::oop_load(p); + oop o = RawAccess::oop_load(p); if (o->is_forwarded()) { o = o->forwardee(); // Card mark if (PSScavenge::is_obj_in_young(o)) { PSScavenge::card_table()->inline_write_ref_field_gc(p, o); } - RawAccess::oop_store(p, o); + RawAccess::oop_store(p, o); } else { push_depth(p); } @@ -281,7 +281,7 @@ inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) { assert(should_scavenge(p, true), "revisiting object?"); - oop o = RawAccess::oop_load(p); + oop o = RawAccess::oop_load(p); oop new_obj = o->is_forwarded() ? o->forwardee() : copy_to_survivor_space(o); @@ -294,7 +294,7 @@ new_obj->klass()->internal_name(), p2i((void *)o), p2i((void *)new_obj), new_obj->size()); } - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); // We cannot mark without test, as some code passes us pointers // that are outside the heap. These pointers are either from roots diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psScavenge.cpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psScavenge.cpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psScavenge.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psScavenge.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -97,7 +97,7 @@ } template void do_oop_work(T* p) { - assert (oopDesc::is_oop(RawAccess::oop_load(p)), + assert (oopDesc::is_oop(RawAccess::oop_load(p)), "expected an oop while scanning weak refs"); // Weak refs may be visited more than once. diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psScavenge.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psScavenge.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psScavenge.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psScavenge.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -48,7 +48,7 @@ template inline bool PSScavenge::should_scavenge(T* p, MutableSpace* to_space) { if (should_scavenge(p)) { - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); // Skip objects copied to to_space since the scavenge started. HeapWord* const addr = (HeapWord*)obj; return addr < to_space_top_before_gc() || addr >= to_space->end(); @@ -109,7 +109,7 @@ } else { new_obj = _pm->copy_to_survivor_space(o); } - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); if (PSScavenge::is_obj_in_young(new_obj)) { do_cld_barrier(); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/parallel/psYoungGen.hpp openjdk-11-11~24/src/hotspot/share/gc/parallel/psYoungGen.hpp --- openjdk-11-11~19/src/hotspot/share/gc/parallel/psYoungGen.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/parallel/psYoungGen.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -168,7 +168,7 @@ HeapWord** end_addr() const { return eden_space()->end_addr(); } // Iteration. - void oop_iterate(ExtendedOopClosure* cl); + void oop_iterate(OopIterateClosure* cl); void object_iterate(ObjectClosure* cl); virtual void reset_after_change(); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/serial/defNewGeneration.cpp openjdk-11-11~24/src/hotspot/share/gc/serial/defNewGeneration.cpp --- openjdk-11-11~19/src/hotspot/share/gc/serial/defNewGeneration.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/serial/defNewGeneration.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -46,7 +46,7 @@ #include "gc/shared/strongRootsScope.hpp" #include "gc/shared/weakProcessor.hpp" #include "logging/log.hpp" -#include "memory/iterator.hpp" +#include "memory/iterator.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/instanceRefKlass.hpp" #include "oops/oop.inline.hpp" @@ -112,18 +112,12 @@ _boundary = _g->reserved().end(); } -void ScanClosure::do_oop(oop* p) { ScanClosure::do_oop_work(p); } -void ScanClosure::do_oop(narrowOop* p) { ScanClosure::do_oop_work(p); } - FastScanClosure::FastScanClosure(DefNewGeneration* g, bool gc_barrier) : OopsInClassLoaderDataOrGenClosure(g), _g(g), _gc_barrier(gc_barrier) { _boundary = _g->reserved().end(); } -void FastScanClosure::do_oop(oop* p) { FastScanClosure::do_oop_work(p); } -void FastScanClosure::do_oop(narrowOop* p) { FastScanClosure::do_oop_work(p); } - void CLDScanClosure::do_cld(ClassLoaderData* cld) { NOT_PRODUCT(ResourceMark rm); log_develop_trace(gc, scavenge)("CLDScanClosure::do_cld " PTR_FORMAT ", %s, dirty: %s", @@ -155,9 +149,6 @@ _boundary = _g->reserved().end(); } -void ScanWeakRefClosure::do_oop(oop* p) { ScanWeakRefClosure::do_oop_work(p); } -void ScanWeakRefClosure::do_oop(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); } - DefNewGeneration::DefNewGeneration(ReservedSpace rs, size_t initial_size, const char* policy) diff -Nru openjdk-11-11~19/src/hotspot/share/gc/serial/defNewGeneration.hpp openjdk-11-11~24/src/hotspot/share/gc/serial/defNewGeneration.hpp --- openjdk-11-11~19/src/hotspot/share/gc/serial/defNewGeneration.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/serial/defNewGeneration.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -96,8 +96,8 @@ PreservedMarksSet _preserved_marks_set; // Promotion failure handling - ExtendedOopClosure *_promo_failure_scan_stack_closure; - void set_promo_failure_scan_stack_closure(ExtendedOopClosure *scan_stack_closure) { + OopIterateClosure *_promo_failure_scan_stack_closure; + void set_promo_failure_scan_stack_closure(OopIterateClosure *scan_stack_closure) { _promo_failure_scan_stack_closure = scan_stack_closure; } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/serial/defNewGeneration.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/serial/defNewGeneration.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/serial/defNewGeneration.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/serial/defNewGeneration.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,12 +40,12 @@ { // We never expect to see a null reference being processed // as a weak reference. - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); assert (oopDesc::is_oop(obj), "expected an oop while scanning weak refs"); } #endif // ASSERT - _cl->do_oop_nv(p); + Devirtualizer::do_oop_no_verify(_cl, p); // Card marking is trickier for weak refs. // This oop is a 'next' field which was filled in while we @@ -61,7 +61,7 @@ // dirty cards in the young gen are never scanned, so the // extra check probably isn't worthwhile. if (GenCollectedHeap::heap()->is_in_reserved(p)) { - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); _rs->inline_write_ref_field_gc(p, obj); } } @@ -72,17 +72,17 @@ { // We never expect to see a null reference being processed // as a weak reference. - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); assert (oopDesc::is_oop(obj), "expected an oop while scanning weak refs"); } #endif // ASSERT - _cl->do_oop_nv(p); + Devirtualizer::do_oop_no_verify(_cl, p); // Optimized for Defnew generation if it's the youngest generation: // we set a younger_gen card if we have an older->youngest // generation pointer. - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); if (((HeapWord*)obj < _boundary) && GenCollectedHeap::heap()->is_in_reserved(p)) { _rs->inline_write_ref_field_gc(p, obj); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/serial/markSweep.cpp openjdk-11-11~24/src/hotspot/share/gc/serial/markSweep.cpp --- openjdk-11-11~19/src/hotspot/share/gc/serial/markSweep.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/serial/markSweep.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,6 @@ #include "precompiled.hpp" #include "compiler/compileBroker.hpp" #include "gc/serial/markSweep.inline.hpp" -#include "gc/serial/serial_specialized_oop_closures.hpp" #include "gc/shared/collectedHeap.inline.hpp" #include "gc/shared/gcTimer.hpp" #include "gc/shared/gcTrace.hpp" @@ -63,48 +62,6 @@ CLDToOopClosure MarkSweep::follow_cld_closure(&mark_and_push_closure); CLDToOopClosure MarkSweep::adjust_cld_closure(&adjust_pointer_closure); -inline void MarkSweep::mark_object(oop obj) { - // some marks may contain information we need to preserve so we store them away - // and overwrite the mark. We'll restore it at the end of markSweep. - markOop mark = obj->mark_raw(); - obj->set_mark_raw(markOopDesc::prototype()->set_marked()); - - if (mark->must_be_preserved(obj)) { - preserve_mark(obj, mark); - } -} - -template inline void MarkSweep::mark_and_push(T* p) { - T heap_oop = RawAccess<>::oop_load(p); - if (!CompressedOops::is_null(heap_oop)) { - oop obj = CompressedOops::decode_not_null(heap_oop); - if (!obj->mark_raw()->is_marked()) { - mark_object(obj); - _marking_stack.push(obj); - } - } -} - -inline void MarkSweep::follow_klass(Klass* klass) { - oop op = klass->klass_holder(); - MarkSweep::mark_and_push(&op); -} - -inline void MarkSweep::follow_cld(ClassLoaderData* cld) { - MarkSweep::follow_cld_closure.do_cld(cld); -} - -template -inline void MarkAndPushClosure::do_oop_nv(T* p) { MarkSweep::mark_and_push(p); } -void MarkAndPushClosure::do_oop(oop* p) { do_oop_nv(p); } -void MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_nv(p); } -inline bool MarkAndPushClosure::do_metadata_nv() { return true; } -bool MarkAndPushClosure::do_metadata() { return do_metadata_nv(); } -inline void MarkAndPushClosure::do_klass_nv(Klass* k) { MarkSweep::follow_klass(k); } -void MarkAndPushClosure::do_klass(Klass* k) { do_klass_nv(k); } -inline void MarkAndPushClosure::do_cld_nv(ClassLoaderData* cld) { MarkSweep::follow_cld(cld); } -void MarkAndPushClosure::do_cld(ClassLoaderData* cld) { do_cld_nv(cld); } - template inline void MarkSweep::KeepAliveClosure::do_oop_work(T* p) { mark_and_push(p); } @@ -216,11 +173,6 @@ AdjustPointerClosure MarkSweep::adjust_pointer_closure; -template -void AdjustPointerClosure::do_oop_nv(T* p) { MarkSweep::adjust_pointer(p); } -void AdjustPointerClosure::do_oop(oop* p) { do_oop_nv(p); } -void AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_nv(p); } - void MarkSweep::adjust_marks() { assert( _preserved_oop_stack.size() == _preserved_mark_stack.size(), "inconsistent preserved oop stacks"); @@ -269,6 +221,3 @@ MarkSweep::_gc_timer = new (ResourceObj::C_HEAP, mtGC) STWGCTimer(); MarkSweep::_gc_tracer = new (ResourceObj::C_HEAP, mtGC) SerialOldTracer(); } - -// Generate MS specialized oop_oop_iterate functions. -SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_MS(ALL_KLASS_OOP_OOP_ITERATE_DEFN) diff -Nru openjdk-11-11~19/src/hotspot/share/gc/serial/markSweep.hpp openjdk-11-11~24/src/hotspot/share/gc/serial/markSweep.hpp --- openjdk-11-11~19/src/hotspot/share/gc/serial/markSweep.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/serial/markSweep.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -56,7 +56,7 @@ // // Inline closure decls // - class FollowRootClosure: public OopsInGenClosure { + class FollowRootClosure: public BasicOopsInGenClosure { public: virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); @@ -170,29 +170,24 @@ static void follow_array_chunk(objArrayOop array, int index); }; -class MarkAndPushClosure: public ExtendedOopClosure { +class MarkAndPushClosure: public OopIterateClosure { public: - template void do_oop_nv(T* p); + template void do_oop_work(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - virtual bool do_metadata(); - bool do_metadata_nv(); - + virtual bool do_metadata() { return true; } virtual void do_klass(Klass* k); - void do_klass_nv(Klass* k); - virtual void do_cld(ClassLoaderData* cld); - void do_cld_nv(ClassLoaderData* cld); void set_ref_discoverer(ReferenceDiscoverer* rd) { set_ref_discoverer_internal(rd); } }; -class AdjustPointerClosure: public OopsInGenClosure { +class AdjustPointerClosure: public BasicOopsInGenClosure { public: - template void do_oop_nv(T* p); + template void do_oop_work(T* p); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); virtual ReferenceIterationMode reference_iteration_mode() { return DO_FIELDS; } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/serial/markSweep.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/serial/markSweep.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/serial/markSweep.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/serial/markSweep.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ #ifndef SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP #define SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP +#include "classfile/classLoaderData.inline.hpp" #include "gc/serial/markSweep.hpp" #include "memory/metaspaceShared.hpp" #include "memory/universe.hpp" @@ -32,11 +33,46 @@ #include "oops/access.inline.hpp" #include "oops/compressedOops.inline.hpp" #include "oops/oop.inline.hpp" +#include "utilities/stack.inline.hpp" -inline int MarkSweep::adjust_pointers(oop obj) { - return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure); +inline void MarkSweep::mark_object(oop obj) { + // some marks may contain information we need to preserve so we store them away + // and overwrite the mark. We'll restore it at the end of markSweep. + markOop mark = obj->mark_raw(); + obj->set_mark_raw(markOopDesc::prototype()->set_marked()); + + if (mark->must_be_preserved(obj)) { + preserve_mark(obj, mark); + } +} + +template inline void MarkSweep::mark_and_push(T* p) { + T heap_oop = RawAccess<>::oop_load(p); + if (!CompressedOops::is_null(heap_oop)) { + oop obj = CompressedOops::decode_not_null(heap_oop); + if (!obj->mark_raw()->is_marked()) { + mark_object(obj); + _marking_stack.push(obj); + } + } } +inline void MarkSweep::follow_klass(Klass* klass) { + oop op = klass->klass_holder(); + MarkSweep::mark_and_push(&op); +} + +inline void MarkSweep::follow_cld(ClassLoaderData* cld) { + MarkSweep::follow_cld_closure.do_cld(cld); +} + +template +inline void MarkAndPushClosure::do_oop_work(T* p) { MarkSweep::mark_and_push(p); } +inline void MarkAndPushClosure::do_oop(oop* p) { do_oop_work(p); } +inline void MarkAndPushClosure::do_oop(narrowOop* p) { do_oop_work(p); } +inline void MarkAndPushClosure::do_klass(Klass* k) { MarkSweep::follow_klass(k); } +inline void MarkAndPushClosure::do_cld(ClassLoaderData* cld) { MarkSweep::follow_cld(cld); } + template inline void MarkSweep::adjust_pointer(T* p) { T heap_oop = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(heap_oop)) { @@ -54,9 +90,19 @@ if (new_obj != NULL) { assert(Universe::heap()->is_in_reserved(new_obj), "should be in object space"); - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); } } } +template +void AdjustPointerClosure::do_oop_work(T* p) { MarkSweep::adjust_pointer(p); } +inline void AdjustPointerClosure::do_oop(oop* p) { do_oop_work(p); } +inline void AdjustPointerClosure::do_oop(narrowOop* p) { do_oop_work(p); } + + +inline int MarkSweep::adjust_pointers(oop obj) { + return obj->oop_iterate_size(&MarkSweep::adjust_pointer_closure); +} + #endif // SHARE_VM_GC_SERIAL_MARKSWEEP_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/serial/serial_specialized_oop_closures.hpp openjdk-11-11~24/src/hotspot/share/gc/serial/serial_specialized_oop_closures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/serial/serial_specialized_oop_closures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/serial/serial_specialized_oop_closures.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_GC_SERIAL_SERIAL_SPECIALIZED_OOP_CLOSURES_HPP -#define SHARE_GC_SERIAL_SERIAL_SPECIALIZED_OOP_CLOSURES_HPP - -// The following OopClosure types get specialized versions of -// "oop_oop_iterate" that invoke the closures' do_oop methods -// non-virtually, using a mechanism defined in this file. Extend these -// macros in the obvious way to add specializations for new closures. - -// Forward declarations. - -// DefNew -class ScanClosure; -class FastScanClosure; -class FilteringClosure; - -// MarkSweep -class MarkAndPushClosure; -class AdjustPointerClosure; - -#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f) \ - f(ScanClosure,_nv) \ - f(FastScanClosure,_nv) \ - f(FilteringClosure,_nv) - -#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_MS(f) \ - f(MarkAndPushClosure,_nv) \ - f(AdjustPointerClosure,_nv) - -#endif // SHARE_GC_SERIAL_SERIAL_SPECIALIZED_OOP_CLOSURES_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/c1/barrierSetC1.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -40,7 +40,7 @@ LIR_Opr BarrierSetC1::resolve_address(LIRAccess& access, bool resolve_in_register) { DecoratorSet decorators = access.decorators(); - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0; LIRItem& base = access.base().item(); @@ -48,7 +48,7 @@ LIRGenerator *gen = access.gen(); LIR_Opr addr_opr; - if (on_array) { + if (is_array) { addr_opr = LIR_OprFact::address(gen->emit_array_address(base.result(), offset, access.type())); } else if (needs_patching) { // we need to patch the offset in the instruction so don't allow diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/c1/modRefBarrierSetC1.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,7 @@ void ModRefBarrierSetC1::store_at_resolved(LIRAccess& access, LIR_Opr value) { DecoratorSet decorators = access.decorators(); - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; if (access.is_oop()) { @@ -45,7 +45,7 @@ BarrierSetC1::store_at_resolved(access, value); if (access.is_oop()) { - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; LIR_Opr post_addr = precise ? access.resolved_addr() : access.base().opr(); post_barrier(access, post_addr, value); } @@ -87,9 +87,9 @@ DecoratorSet decorators = access.decorators(); bool needs_patching = (decorators & C1_NEEDS_PATCHING) != 0; bool is_write = (decorators & C1_WRITE_ACCESS) != 0; - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool on_anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; - bool precise = on_array || on_anonymous; + bool precise = is_array || on_anonymous; resolve_in_register |= !needs_patching && is_write && access.is_oop() && precise; return BarrierSetC1::resolve_address(access, resolve_in_register); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/c2/modRefBarrierSetC2.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,10 @@ const TypePtr* adr_type = access.addr().type(); Node* adr = access.addr().node(); - bool on_array = (decorators & IN_HEAP_ARRAY) != 0; + bool is_array = (decorators & IS_ARRAY) != 0; bool anonymous = (decorators & ON_UNKNOWN_OOP_REF) != 0; bool in_heap = (decorators & IN_HEAP) != 0; - bool use_precise = on_array || anonymous; + bool use_precise = is_array || anonymous; if (!access.is_oop() || (!in_heap && !anonymous)) { return BarrierSetC2::store_at_resolved(access, val); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/cardTableRS.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/cardTableRS.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/cardTableRS.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/cardTableRS.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,7 @@ #include "gc/shared/generation.hpp" #include "gc/shared/space.inline.hpp" #include "memory/allocation.inline.hpp" +#include "memory/iterator.inline.hpp" #include "oops/access.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" @@ -329,7 +330,7 @@ } -class VerifyCleanCardClosure: public OopClosure { +class VerifyCleanCardClosure: public BasicOopIterateClosure { private: HeapWord* _boundary; HeapWord* _begin; @@ -429,7 +430,7 @@ VerifyCleanCardClosure verify_blk(gen_boundary, begin, end); for (HeapWord* cur = start_block; cur < end; cur += s->block_size(cur)) { if (s->block_is_obj(cur) && s->obj_is_alive(cur)) { - oop(cur)->oop_iterate_no_header(&verify_blk, mr); + oop(cur)->oop_iterate(&verify_blk, mr); } } } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/collectedHeap.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/collectedHeap.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/collectedHeap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/collectedHeap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -33,6 +33,7 @@ #include "gc/shared/gcTrace.hpp" #include "gc/shared/gcTraceTime.inline.hpp" #include "gc/shared/gcWhen.hpp" +#include "gc/shared/memAllocator.hpp" #include "gc/shared/vmGCOperations.hpp" #include "logging/log.hpp" #include "memory/metaspace.hpp" @@ -46,6 +47,7 @@ #include "runtime/vmThread.hpp" #include "services/heapDumper.hpp" #include "utilities/align.hpp" +#include "utilities/copy.hpp" class ClassLoaderData; @@ -327,15 +329,6 @@ } #ifndef PRODUCT -void CollectedHeap::check_for_bad_heap_word_value(HeapWord* addr, size_t size) { - if (CheckMemoryInitialization && ZapUnusedHeapArea) { - for (size_t slot = 0; slot < size; slot += 1) { - assert((*(intptr_t*) (addr + slot)) != ((intptr_t) badHeapWordVal), - "Found badHeapWordValue in post-allocation check"); - } - } -} - void CollectedHeap::check_for_non_bad_heap_word_value(HeapWord* addr, size_t size) { if (CheckMemoryInitialization && ZapUnusedHeapArea) { for (size_t slot = 0; slot < size; slot += 1) { @@ -346,118 +339,6 @@ } #endif // PRODUCT -#ifdef ASSERT -void CollectedHeap::check_for_valid_allocation_state() { - Thread *thread = Thread::current(); - // How to choose between a pending exception and a potential - // OutOfMemoryError? Don't allow pending exceptions. - // This is a VM policy failure, so how do we exhaustively test it? - assert(!thread->has_pending_exception(), - "shouldn't be allocating with pending exception"); - if (StrictSafepointChecks) { - assert(thread->allow_allocation(), - "Allocation done by thread for which allocation is blocked " - "by No_Allocation_Verifier!"); - // Allocation of an oop can always invoke a safepoint, - // hence, the true argument - thread->check_for_valid_safepoint_state(true); - } -} -#endif - -HeapWord* CollectedHeap::obj_allocate_raw(Klass* klass, size_t size, - bool* gc_overhead_limit_was_exceeded, TRAPS) { - if (UseTLAB) { - HeapWord* result = allocate_from_tlab(klass, size, THREAD); - if (result != NULL) { - return result; - } - } - - return allocate_outside_tlab(klass, size, gc_overhead_limit_was_exceeded, THREAD); -} - -HeapWord* CollectedHeap::allocate_from_tlab_slow(Klass* klass, size_t size, TRAPS) { - HeapWord* obj = NULL; - - // In assertion mode, check that there was a sampling collector present - // in the stack. This enforces checking that no path is without a sampling - // collector. - // Only check if the sampler could actually sample something in this call path. - assert(!JvmtiExport::should_post_sampled_object_alloc() - || !JvmtiSampledObjectAllocEventCollector::object_alloc_is_safe_to_sample() - || THREAD->heap_sampler().sampling_collector_present(), - "Sampling collector not present."); - - if (ThreadHeapSampler::enabled()) { - // Try to allocate the sampled object from TLAB, it is possible a sample - // point was put and the TLAB still has space. - obj = THREAD->tlab().allocate_sampled_object(size); - - if (obj != NULL) { - return obj; - } - } - - ThreadLocalAllocBuffer& tlab = THREAD->tlab(); - - // Retain tlab and allocate object in shared space if - // the amount free in the tlab is too large to discard. - if (tlab.free() > tlab.refill_waste_limit()) { - tlab.record_slow_allocation(size); - return NULL; - } - - // Discard tlab and allocate a new one. - // To minimize fragmentation, the last TLAB may be smaller than the rest. - size_t new_tlab_size = tlab.compute_size(size); - - tlab.clear_before_allocation(); - - if (new_tlab_size == 0) { - return NULL; - } - - // Allocate a new TLAB requesting new_tlab_size. Any size - // between minimal and new_tlab_size is accepted. - size_t actual_tlab_size = 0; - size_t min_tlab_size = ThreadLocalAllocBuffer::compute_min_size(size); - obj = Universe::heap()->allocate_new_tlab(min_tlab_size, new_tlab_size, &actual_tlab_size); - if (obj == NULL) { - assert(actual_tlab_size == 0, "Allocation failed, but actual size was updated. min: " SIZE_FORMAT ", desired: " SIZE_FORMAT ", actual: " SIZE_FORMAT, - min_tlab_size, new_tlab_size, actual_tlab_size); - return NULL; - } - assert(actual_tlab_size != 0, "Allocation succeeded but actual size not updated. obj at: " PTR_FORMAT " min: " SIZE_FORMAT ", desired: " SIZE_FORMAT, - p2i(obj), min_tlab_size, new_tlab_size); - - AllocTracer::send_allocation_in_new_tlab(klass, obj, actual_tlab_size * HeapWordSize, size * HeapWordSize, THREAD); - - if (ZeroTLAB) { - // ..and clear it. - Copy::zero_to_words(obj, actual_tlab_size); - } else { - // ...and zap just allocated object. -#ifdef ASSERT - // Skip mangling the space corresponding to the object header to - // ensure that the returned space is not considered parsable by - // any concurrent GC thread. - size_t hdr_size = oopDesc::header_size(); - Copy::fill_to_words(obj + hdr_size, actual_tlab_size - hdr_size, badHeapWordVal); -#endif // ASSERT - } - - // Send the thread information about this allocation in case a sample is - // requested. - if (ThreadHeapSampler::enabled()) { - size_t tlab_bytes_since_last_sample = THREAD->tlab().bytes_since_last_sample_point(); - THREAD->heap_sampler().check_for_sampling(obj, size, tlab_bytes_since_last_sample); - } - - tlab.fill(obj, obj + size, actual_tlab_size); - return obj; -} - size_t CollectedHeap::max_tlab_size() const { // TLABs can't be bigger than we can fill with a int[Integer.MAX_VALUE]. // This restriction could be removed by enabling filling with multiple arrays. @@ -509,9 +390,8 @@ const size_t len = payload_size * HeapWordSize / sizeof(jint); assert((int)len >= 0, "size too large " SIZE_FORMAT " becomes %d", words, (int)len); - // Set the length first for concurrent GC. - ((arrayOop)start)->set_length((int)len); - post_allocation_setup_common(Universe::intArrayKlassObj(), start); + ObjArrayAllocator allocator(Universe::intArrayKlassObj(), words, (int)len, /* do_zero */ false); + allocator.initialize(start); DEBUG_ONLY(zap_filler_array(start, words, zap);) } @@ -524,7 +404,8 @@ fill_with_array(start, words, zap); } else if (words > 0) { assert(words == min_fill_size(), "unaligned size"); - post_allocation_setup_common(SystemDictionary::Object_klass(), start); + ObjAllocator allocator(SystemDictionary::Object_klass(), words); + allocator.initialize(start); } } @@ -566,6 +447,21 @@ return NULL; } +oop CollectedHeap::obj_allocate(Klass* klass, int size, TRAPS) { + ObjAllocator allocator(klass, size, THREAD); + return allocator.allocate(); +} + +oop CollectedHeap::array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS) { + ObjArrayAllocator allocator(klass, size, length, do_zero, THREAD); + return allocator.allocate(); +} + +oop CollectedHeap::class_allocate(Klass* klass, int size, TRAPS) { + ClassAllocator allocator(klass, size, THREAD); + return allocator.allocate(); +} + void CollectedHeap::ensure_parsability(bool retire_tlabs) { // The second disjunct in the assertion below makes a concession // for the start-up verification done while the VM is being diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/collectedHeap.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/collectedHeap.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/collectedHeap.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/collectedHeap.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -95,6 +95,7 @@ friend class VMStructs; friend class JVMCIVMStructs; friend class IsGCActiveMark; // Block structured external access to _is_gc_active + friend class MemAllocator; private: #ifdef ASSERT @@ -141,13 +142,6 @@ // Reinitialize tlabs before resuming mutators. virtual void resize_all_tlabs(); - // Allocate from the current thread's TLAB, with broken-out slow path. - inline static HeapWord* allocate_from_tlab(Klass* klass, size_t size, TRAPS); - static HeapWord* allocate_from_tlab_slow(Klass* klass, size_t size, TRAPS); - - inline static HeapWord* allocate_outside_tlab(Klass* klass, size_t size, - bool* gc_overhead_limit_was_exceeded, TRAPS); - // Raw memory allocation facilities // The obj and array allocate methods are covers for these methods. // mem_allocate() should never be @@ -155,29 +149,6 @@ virtual HeapWord* mem_allocate(size_t size, bool* gc_overhead_limit_was_exceeded) = 0; - // Allocate an uninitialized block of the given size, or returns NULL if - // this is impossible. - inline static HeapWord* common_mem_allocate_noinit(Klass* klass, size_t size, TRAPS); - - // Like allocate_init, but the block returned by a successful allocation - // is guaranteed initialized to zeros. - inline static HeapWord* common_mem_allocate_init(Klass* klass, size_t size, TRAPS); - - // Helper functions for (VM) allocation. - inline static void post_allocation_setup_common(Klass* klass, HeapWord* obj); - inline static void post_allocation_setup_no_klass_install(Klass* klass, - HeapWord* objPtr); - - inline static void post_allocation_setup_obj(Klass* klass, HeapWord* obj, int size); - - inline static void post_allocation_setup_array(Klass* klass, - HeapWord* obj, int length); - - inline static void post_allocation_setup_class(Klass* klass, HeapWord* obj, int size); - - // Clears an allocated object. - inline static void init_obj(HeapWord* obj, size_t size); - // Filler object utilities. static inline size_t filler_array_hdr_size(); static inline size_t filler_array_min_size(); @@ -194,21 +165,7 @@ virtual void trace_heap(GCWhen::Type when, const GCTracer* tracer); - // Internal allocation methods. - inline static HeapWord* common_allocate_memory(Klass* klass, int size, - void (*post_setup)(Klass*, HeapWord*, int), - int size_for_post, bool init_memory, - TRAPS); - - // Internal allocation method for common obj/class/array allocations. - inline static HeapWord* allocate_memory(Klass* klass, int size, - void (*post_setup)(Klass*, HeapWord*, int), - int size_for_post, bool init_memory, - TRAPS); - // Verification functions - virtual void check_for_bad_heap_word_value(HeapWord* addr, size_t size) - PRODUCT_RETURN; virtual void check_for_non_bad_heap_word_value(HeapWord* addr, size_t size) PRODUCT_RETURN; debug_only(static void check_for_valid_allocation_state();) @@ -328,18 +285,9 @@ } GCCause::Cause gc_cause() { return _gc_cause; } - // General obj/array allocation facilities. - inline static oop obj_allocate(Klass* klass, int size, TRAPS); - inline static oop array_allocate(Klass* klass, int size, int length, TRAPS); - inline static oop array_allocate_nozero(Klass* klass, int size, int length, TRAPS); - inline static oop class_allocate(Klass* klass, int size, TRAPS); - - // Raw memory allocation. This may or may not use TLAB allocations to satisfy the - // allocation. A GC implementation may override this function to satisfy the allocation - // in any way. But the default is to try a TLAB allocation, and otherwise perform - // mem_allocate. - virtual HeapWord* obj_allocate_raw(Klass* klass, size_t size, - bool* gc_overhead_limit_was_exceeded, TRAPS); + virtual oop obj_allocate(Klass* klass, int size, TRAPS); + virtual oop array_allocate(Klass* klass, int size, int length, bool do_zero, TRAPS); + virtual oop class_allocate(Klass* klass, int size, TRAPS); // Utilities for turning raw memory into filler objects. // diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/collectedHeap.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/collectedHeap.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/collectedHeap.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/collectedHeap.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,297 +25,9 @@ #ifndef SHARE_VM_GC_SHARED_COLLECTEDHEAP_INLINE_HPP #define SHARE_VM_GC_SHARED_COLLECTEDHEAP_INLINE_HPP -#include "classfile/javaClasses.hpp" -#include "gc/shared/allocTracer.hpp" #include "gc/shared/collectedHeap.hpp" -#include "gc/shared/threadLocalAllocBuffer.inline.hpp" -#include "memory/universe.hpp" -#include "oops/arrayOop.hpp" #include "oops/oop.inline.hpp" -#include "prims/jvmtiExport.hpp" -#include "runtime/sharedRuntime.hpp" -#include "runtime/handles.inline.hpp" -#include "runtime/thread.inline.hpp" -#include "services/lowMemoryDetector.hpp" #include "utilities/align.hpp" -#include "utilities/copy.hpp" - -// Inline allocation implementations. - -void CollectedHeap::post_allocation_setup_common(Klass* klass, - HeapWord* obj_ptr) { - post_allocation_setup_no_klass_install(klass, obj_ptr); - oop obj = (oop)obj_ptr; -#if (INCLUDE_G1GC || INCLUDE_CMSGC) - // Need a release store to ensure array/class length, mark word, and - // object zeroing are visible before setting the klass non-NULL, for - // concurrent collectors. - obj->release_set_klass(klass); -#else - obj->set_klass(klass); -#endif -} - -void CollectedHeap::post_allocation_setup_no_klass_install(Klass* klass, - HeapWord* obj_ptr) { - oop obj = (oop)obj_ptr; - - assert(obj != NULL, "NULL object pointer"); - if (UseBiasedLocking && (klass != NULL)) { - obj->set_mark_raw(klass->prototype_header()); - } else { - // May be bootstrapping - obj->set_mark_raw(markOopDesc::prototype()); - } -} - -// Support for jvmti and dtrace -inline void post_allocation_notify(Klass* klass, oop obj, int size) { - // support low memory notifications (no-op if not enabled) - LowMemoryDetector::detect_low_memory_for_collected_pools(); - - // support for JVMTI VMObjectAlloc event (no-op if not enabled) - JvmtiExport::vm_object_alloc_event_collector(obj); - - if (DTraceAllocProbes) { - // support for Dtrace object alloc event (no-op most of the time) - if (klass != NULL && klass->name() != NULL) { - SharedRuntime::dtrace_object_alloc(obj, size); - } - } -} - -void CollectedHeap::post_allocation_setup_obj(Klass* klass, - HeapWord* obj_ptr, - int size) { - post_allocation_setup_common(klass, obj_ptr); - oop obj = (oop)obj_ptr; - assert(Universe::is_bootstrapping() || - !obj->is_array(), "must not be an array"); - // notify jvmti and dtrace - post_allocation_notify(klass, obj, size); -} - -void CollectedHeap::post_allocation_setup_class(Klass* klass, - HeapWord* obj_ptr, - int size) { - // Set oop_size field before setting the _klass field because a - // non-NULL _klass field indicates that the object is parsable by - // concurrent GC. - oop new_cls = (oop)obj_ptr; - assert(size > 0, "oop_size must be positive."); - java_lang_Class::set_oop_size(new_cls, size); - post_allocation_setup_common(klass, obj_ptr); - assert(Universe::is_bootstrapping() || - !new_cls->is_array(), "must not be an array"); - // notify jvmti and dtrace - post_allocation_notify(klass, new_cls, size); -} - -void CollectedHeap::post_allocation_setup_array(Klass* klass, - HeapWord* obj_ptr, - int length) { - // Set array length before setting the _klass field because a - // non-NULL klass field indicates that the object is parsable by - // concurrent GC. - assert(length >= 0, "length should be non-negative"); - ((arrayOop)obj_ptr)->set_length(length); - post_allocation_setup_common(klass, obj_ptr); - oop new_obj = (oop)obj_ptr; - assert(new_obj->is_array(), "must be an array"); - // notify jvmti and dtrace (must be after length is set for dtrace) - post_allocation_notify(klass, new_obj, new_obj->size()); -} - -HeapWord* CollectedHeap::common_mem_allocate_noinit(Klass* klass, size_t size, TRAPS) { - - // Clear unhandled oops for memory allocation. Memory allocation might - // not take out a lock if from tlab, so clear here. - CHECK_UNHANDLED_OOPS_ONLY(THREAD->clear_unhandled_oops();) - - if (HAS_PENDING_EXCEPTION) { - NOT_PRODUCT(guarantee(false, "Should not allocate with exception pending")); - return NULL; // caller does a CHECK_0 too - } - - bool gc_overhead_limit_was_exceeded = false; - CollectedHeap* heap = Universe::heap(); - HeapWord* result = heap->obj_allocate_raw(klass, size, &gc_overhead_limit_was_exceeded, THREAD); - - if (result != NULL) { - return result; - } - - if (!gc_overhead_limit_was_exceeded) { - // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support - report_java_out_of_memory("Java heap space"); - - if (JvmtiExport::should_post_resource_exhausted()) { - JvmtiExport::post_resource_exhausted( - JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR | JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP, - "Java heap space"); - } - - THROW_OOP_0(Universe::out_of_memory_error_java_heap()); - } else { - // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support - report_java_out_of_memory("GC overhead limit exceeded"); - - if (JvmtiExport::should_post_resource_exhausted()) { - JvmtiExport::post_resource_exhausted( - JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR | JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP, - "GC overhead limit exceeded"); - } - - THROW_OOP_0(Universe::out_of_memory_error_gc_overhead_limit()); - } -} - -HeapWord* CollectedHeap::common_mem_allocate_init(Klass* klass, size_t size, TRAPS) { - HeapWord* obj = common_mem_allocate_noinit(klass, size, CHECK_NULL); - init_obj(obj, size); - return obj; -} - -HeapWord* CollectedHeap::allocate_from_tlab(Klass* klass, size_t size, TRAPS) { - assert(UseTLAB, "should use UseTLAB"); - - HeapWord* obj = THREAD->tlab().allocate(size); - if (obj != NULL) { - return obj; - } - // Otherwise... - obj = allocate_from_tlab_slow(klass, size, THREAD); - assert(obj == NULL || !HAS_PENDING_EXCEPTION, - "Unexpected exception, will result in uninitialized storage"); - return obj; -} - -HeapWord* CollectedHeap::allocate_outside_tlab(Klass* klass, size_t size, - bool* gc_overhead_limit_was_exceeded, TRAPS) { - HeapWord* result = Universe::heap()->mem_allocate(size, gc_overhead_limit_was_exceeded); - if (result == NULL) { - return result; - } - - NOT_PRODUCT(Universe::heap()->check_for_non_bad_heap_word_value(result, size)); - assert(!HAS_PENDING_EXCEPTION, - "Unexpected exception, will result in uninitialized storage"); - size_t size_in_bytes = size * HeapWordSize; - THREAD->incr_allocated_bytes(size_in_bytes); - - AllocTracer::send_allocation_outside_tlab(klass, result, size_in_bytes, THREAD); - - if (ThreadHeapSampler::enabled()) { - THREAD->heap_sampler().check_for_sampling(result, size_in_bytes); - } - - return result; -} - -void CollectedHeap::init_obj(HeapWord* obj, size_t size) { - assert(obj != NULL, "cannot initialize NULL object"); - const size_t hs = oopDesc::header_size(); - assert(size >= hs, "unexpected object size"); - ((oop)obj)->set_klass_gap(0); - Copy::fill_to_aligned_words(obj + hs, size - hs); -} - -HeapWord* CollectedHeap::common_allocate_memory(Klass* klass, int size, - void (*post_setup)(Klass*, HeapWord*, int), - int size_for_post, bool init_memory, - TRAPS) { - HeapWord* obj; - if (init_memory) { - obj = common_mem_allocate_init(klass, size, CHECK_NULL); - } else { - obj = common_mem_allocate_noinit(klass, size, CHECK_NULL); - } - post_setup(klass, obj, size_for_post); - return obj; -} - -HeapWord* CollectedHeap::allocate_memory(Klass* klass, int size, - void (*post_setup)(Klass*, HeapWord*, int), - int size_for_post, bool init_memory, - TRAPS) { - HeapWord* obj; - - assert(JavaThread::current()->heap_sampler().add_sampling_collector(), - "Should never return false."); - - if (JvmtiExport::should_post_sampled_object_alloc()) { - HandleMark hm(THREAD); - Handle obj_h; - { - JvmtiSampledObjectAllocEventCollector collector; - obj = common_allocate_memory(klass, size, post_setup, size_for_post, - init_memory, CHECK_NULL); - // If we want to be sampling, protect the allocated object with a Handle - // before doing the callback. The callback is done in the destructor of - // the JvmtiSampledObjectAllocEventCollector. - obj_h = Handle(THREAD, (oop) obj); - } - obj = (HeapWord*) obj_h(); - } else { - obj = common_allocate_memory(klass, size, post_setup, size_for_post, - init_memory, CHECK_NULL); - } - - assert(JavaThread::current()->heap_sampler().remove_sampling_collector(), - "Should never return false."); - return obj; -} - -oop CollectedHeap::obj_allocate(Klass* klass, int size, TRAPS) { - debug_only(check_for_valid_allocation_state()); - assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); - assert(size >= 0, "int won't convert to size_t"); - HeapWord* obj = allocate_memory(klass, size, post_allocation_setup_obj, - size, true, CHECK_NULL); - NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); - return (oop)obj; -} - -oop CollectedHeap::class_allocate(Klass* klass, int size, TRAPS) { - debug_only(check_for_valid_allocation_state()); - assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); - assert(size >= 0, "int won't convert to size_t"); - HeapWord* obj = allocate_memory(klass, size, post_allocation_setup_class, - size, true, CHECK_NULL); - NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); - return (oop)obj; -} - -oop CollectedHeap::array_allocate(Klass* klass, - int size, - int length, - TRAPS) { - debug_only(check_for_valid_allocation_state()); - assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); - assert(size >= 0, "int won't convert to size_t"); - HeapWord* obj = allocate_memory(klass, size, post_allocation_setup_array, - length, true, CHECK_NULL); - NOT_PRODUCT(Universe::heap()->check_for_bad_heap_word_value(obj, size)); - return (oop)obj; -} - -oop CollectedHeap::array_allocate_nozero(Klass* klass, - int size, - int length, - TRAPS) { - debug_only(check_for_valid_allocation_state()); - assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); - assert(size >= 0, "int won't convert to size_t"); - - HeapWord* obj = allocate_memory(klass, size, post_allocation_setup_array, - length, false, CHECK_NULL); -#ifndef PRODUCT - const size_t hs = oopDesc::header_size()+1; - Universe::heap()->check_for_non_bad_heap_word_value(obj+hs, size-hs); -#endif - return (oop)obj; -} inline HeapWord* CollectedHeap::align_allocation_or_fail(HeapWord* addr, HeapWord* end, diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/gcConfig.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/gcConfig.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/gcConfig.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/gcConfig.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -226,6 +226,15 @@ return "unknown gc"; } +const char* GCConfig::hs_err_name(CollectedHeap::Name name) { + FOR_EACH_SUPPORTED_GC(gc) { + if (gc->_name == name) { + return gc->_hs_err_name; + } + } + return "unknown gc"; +} + GCArguments* GCConfig::arguments() { assert(_arguments != NULL, "Not initialized"); return _arguments; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/gcConfig.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/gcConfig.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/gcConfig.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/gcConfig.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -50,6 +50,7 @@ static bool is_gc_selected_ergonomically(); static const char* hs_err_name(); + static const char* hs_err_name(CollectedHeap::Name name); static GCArguments* arguments(); }; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/genCollectedHeap.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/genCollectedHeap.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/genCollectedHeap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/genCollectedHeap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -275,9 +275,6 @@ HeapWord* GenCollectedHeap::mem_allocate_work(size_t size, bool is_tlab, bool* gc_overhead_limit_was_exceeded) { - debug_only(check_for_valid_allocation_state()); - assert(no_gc_in_progress(), "Allocation during gc not allowed"); - // In general gc_overhead_limit_was_exceeded should be false so // set it so here and reset it to true only if the gc time // limit is being exceeded as checked below. @@ -1042,12 +1039,7 @@ } #endif -void GenCollectedHeap::oop_iterate_no_header(OopClosure* cl) { - NoHeaderExtendedOopClosure no_header_cl(cl); - oop_iterate(&no_header_cl); -} - -void GenCollectedHeap::oop_iterate(ExtendedOopClosure* cl) { +void GenCollectedHeap::oop_iterate(OopIterateClosure* cl) { _young_gen->oop_iterate(cl); _old_gen->oop_iterate(cl); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/genCollectedHeap.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/genCollectedHeap.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/genCollectedHeap.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/genCollectedHeap.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -258,8 +258,7 @@ virtual void verify_nmethod(nmethod* nmethod); // Iteration functions. - void oop_iterate_no_header(OopClosure* cl); - void oop_iterate(ExtendedOopClosure* cl); + void oop_iterate(OopIterateClosure* cl); void object_iterate(ObjectClosure* cl); void safe_object_iterate(ObjectClosure* cl); Space* space_containing(const void* addr) const; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/generation.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/generation.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/generation.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/generation.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -253,15 +253,15 @@ class GenerationOopIterateClosure : public SpaceClosure { public: - ExtendedOopClosure* _cl; + OopIterateClosure* _cl; virtual void do_space(Space* s) { s->oop_iterate(_cl); } - GenerationOopIterateClosure(ExtendedOopClosure* cl) : + GenerationOopIterateClosure(OopIterateClosure* cl) : _cl(cl) {} }; -void Generation::oop_iterate(ExtendedOopClosure* cl) { +void Generation::oop_iterate(OopIterateClosure* cl) { GenerationOopIterateClosure blk(cl); space_iterate(&blk); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/generation.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/generation.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/generation.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/generation.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -474,7 +474,7 @@ // Iterate over all the ref-containing fields of all objects in the // generation, calling "cl.do_oop" on each. - virtual void oop_iterate(ExtendedOopClosure* cl); + virtual void oop_iterate(OopIterateClosure* cl); // Iterate over all objects in the generation, calling "cl.do_object" on // each. diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/genOopClosures.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/genOopClosures.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/genOopClosures.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/genOopClosures.cpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,37 +0,0 @@ -/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#include "precompiled.hpp" -#include "gc/shared/genOopClosures.inline.hpp" -#include "memory/iterator.inline.hpp" -#if INCLUDE_SERIALGC -#include "gc/serial/serial_specialized_oop_closures.hpp" -#endif - -void FilteringClosure::do_oop(oop* p) { do_oop_nv(p); } -void FilteringClosure::do_oop(narrowOop* p) { do_oop_nv(p); } - -#if INCLUDE_SERIALGC -// Generate Serial GC specialized oop_oop_iterate functions. -SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(ALL_KLASS_OOP_OOP_ITERATE_DEFN) -#endif diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/genOopClosures.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/genOopClosures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/genOopClosures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/genOopClosures.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -40,7 +40,7 @@ // method at the end of their own do_oop method! // Note: no do_oop defined, this is an abstract class. -class OopsInGenClosure : public ExtendedOopClosure { +class OopsInGenClosure : public OopIterateClosure { private: Generation* _orig_gen; // generation originally set in ctor Generation* _gen; // generation being scanned @@ -62,7 +62,7 @@ template void par_do_barrier(T* p); public: - OopsInGenClosure() : ExtendedOopClosure(NULL), + OopsInGenClosure() : OopIterateClosure(NULL), _orig_gen(NULL), _gen(NULL), _gen_boundary(NULL), _rs(NULL) {}; OopsInGenClosure(Generation* gen); @@ -81,11 +81,21 @@ }; +class BasicOopsInGenClosure: public OopsInGenClosure { + public: + BasicOopsInGenClosure() : OopsInGenClosure() {} + BasicOopsInGenClosure(Generation* gen); + + virtual bool do_metadata() { return false; } + virtual void do_klass(Klass* k) { ShouldNotReachHere(); } + virtual void do_cld(ClassLoaderData* cld) { ShouldNotReachHere(); } +}; + // Super class for scan closures. It contains code to dirty scanned class loader data. -class OopsInClassLoaderDataOrGenClosure: public OopsInGenClosure { +class OopsInClassLoaderDataOrGenClosure: public BasicOopsInGenClosure { ClassLoaderData* _scanned_cld; public: - OopsInClassLoaderDataOrGenClosure(Generation* g) : OopsInGenClosure(g), _scanned_cld(NULL) {} + OopsInClassLoaderDataOrGenClosure(Generation* g) : BasicOopsInGenClosure(g), _scanned_cld(NULL) {} void set_scanned_cld(ClassLoaderData* cld) { assert(cld == NULL || _scanned_cld == NULL, "Must be"); _scanned_cld = cld; @@ -110,8 +120,6 @@ ScanClosure(DefNewGeneration* g, bool gc_barrier); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; // Closure for scanning DefNewGeneration. @@ -129,8 +137,6 @@ FastScanClosure(DefNewGeneration* g, bool gc_barrier); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; #endif // INCLUDE_SERIALGC @@ -146,22 +152,21 @@ void do_cld(ClassLoaderData* cld); }; -class FilteringClosure: public ExtendedOopClosure { +class FilteringClosure: public OopIterateClosure { private: HeapWord* _boundary; - ExtendedOopClosure* _cl; + OopIterateClosure* _cl; protected: template inline void do_oop_work(T* p); public: - FilteringClosure(HeapWord* boundary, ExtendedOopClosure* cl) : - ExtendedOopClosure(cl->ref_discoverer()), _boundary(boundary), + FilteringClosure(HeapWord* boundary, OopIterateClosure* cl) : + OopIterateClosure(cl->ref_discoverer()), _boundary(boundary), _cl(cl) {} virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); - virtual bool do_metadata() { return do_metadata_nv(); } - inline bool do_metadata_nv() { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; } + virtual bool do_metadata() { assert(!_cl->do_metadata(), "assumption broken, must change to 'return _cl->do_metadata()'"); return false; } + virtual void do_klass(Klass*) { ShouldNotReachHere(); } + virtual void do_cld(ClassLoaderData*) { ShouldNotReachHere(); } }; #if INCLUDE_SERIALGC @@ -179,8 +184,6 @@ ScanWeakRefClosure(DefNewGeneration* g); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); - inline void do_oop_nv(oop* p); - inline void do_oop_nv(narrowOop* p); }; #endif // INCLUDE_SERIALGC diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/genOopClosures.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/genOopClosures.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/genOopClosures.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/genOopClosures.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -38,7 +38,7 @@ #endif inline OopsInGenClosure::OopsInGenClosure(Generation* gen) : - ExtendedOopClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) { + OopIterateClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) { set_generation(gen); } @@ -73,6 +73,9 @@ } } +inline BasicOopsInGenClosure::BasicOopsInGenClosure(Generation* gen) : OopsInGenClosure(gen) { +} + inline void OopsInClassLoaderDataOrGenClosure::do_cld_barrier() { assert(_scanned_cld != NULL, "Must be"); if (!_scanned_cld->has_modified_oops()) { @@ -93,7 +96,7 @@ assert(!_g->to()->is_in_reserved(obj), "Scanning field twice?"); oop new_obj = obj->is_forwarded() ? obj->forwardee() : _g->copy_to_survivor_space(obj); - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); } if (is_scanning_a_cld()) { @@ -105,8 +108,8 @@ } } -inline void ScanClosure::do_oop_nv(oop* p) { ScanClosure::do_oop_work(p); } -inline void ScanClosure::do_oop_nv(narrowOop* p) { ScanClosure::do_oop_work(p); } +inline void ScanClosure::do_oop(oop* p) { ScanClosure::do_oop_work(p); } +inline void ScanClosure::do_oop(narrowOop* p) { ScanClosure::do_oop_work(p); } // NOTE! Any changes made here should also be made // in ScanClosure::do_oop_work() @@ -119,7 +122,7 @@ assert(!_g->to()->is_in_reserved(obj), "Scanning field twice?"); oop new_obj = obj->is_forwarded() ? obj->forwardee() : _g->copy_to_survivor_space(obj); - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); if (is_scanning_a_cld()) { do_cld_barrier(); } else if (_gc_barrier) { @@ -130,8 +133,8 @@ } } -inline void FastScanClosure::do_oop_nv(oop* p) { FastScanClosure::do_oop_work(p); } -inline void FastScanClosure::do_oop_nv(narrowOop* p) { FastScanClosure::do_oop_work(p); } +inline void FastScanClosure::do_oop(oop* p) { FastScanClosure::do_oop_work(p); } +inline void FastScanClosure::do_oop(narrowOop* p) { FastScanClosure::do_oop_work(p); } #endif // INCLUDE_SERIALGC @@ -145,26 +148,26 @@ } } -void FilteringClosure::do_oop_nv(oop* p) { FilteringClosure::do_oop_work(p); } -void FilteringClosure::do_oop_nv(narrowOop* p) { FilteringClosure::do_oop_work(p); } +inline void FilteringClosure::do_oop(oop* p) { FilteringClosure::do_oop_work(p); } +inline void FilteringClosure::do_oop(narrowOop* p) { FilteringClosure::do_oop_work(p); } #if INCLUDE_SERIALGC // Note similarity to ScanClosure; the difference is that // the barrier set is taken care of outside this closure. template inline void ScanWeakRefClosure::do_oop_work(T* p) { - oop obj = RawAccess::oop_load(p); + oop obj = RawAccess::oop_load(p); // weak references are sometimes scanned twice; must check // that to-space doesn't already contain this object if ((HeapWord*)obj < _boundary && !_g->to()->is_in_reserved(obj)) { oop new_obj = obj->is_forwarded() ? obj->forwardee() : _g->copy_to_survivor_space(obj); - RawAccess::oop_store(p, new_obj); + RawAccess::oop_store(p, new_obj); } } -inline void ScanWeakRefClosure::do_oop_nv(oop* p) { ScanWeakRefClosure::do_oop_work(p); } -inline void ScanWeakRefClosure::do_oop_nv(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); } +inline void ScanWeakRefClosure::do_oop(oop* p) { ScanWeakRefClosure::do_oop_work(p); } +inline void ScanWeakRefClosure::do_oop(narrowOop* p) { ScanWeakRefClosure::do_oop_work(p); } #endif // INCLUDE_SERIALGC diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/memAllocator.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/memAllocator.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/memAllocator.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/memAllocator.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,442 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "classfile/javaClasses.hpp" +#include "gc/shared/allocTracer.hpp" +#include "gc/shared/collectedHeap.hpp" +#include "gc/shared/memAllocator.hpp" +#include "gc/shared/threadLocalAllocBuffer.inline.hpp" +#include "memory/universe.hpp" +#include "oops/arrayOop.hpp" +#include "oops/oop.inline.hpp" +#include "prims/jvmtiExport.hpp" +#include "runtime/sharedRuntime.hpp" +#include "runtime/handles.inline.hpp" +#include "runtime/thread.inline.hpp" +#include "services/lowMemoryDetector.hpp" +#include "utilities/align.hpp" +#include "utilities/copy.hpp" + +class MemAllocator::Allocation: StackObj { + friend class MemAllocator; + + const MemAllocator& _allocator; + Thread* _thread; + oop* _obj_ptr; + bool _overhead_limit_exceeded; + bool _allocated_outside_tlab; + size_t _allocated_tlab_size; + bool _tlab_end_reset_for_sample; + + bool check_out_of_memory(); + void verify_before(); + void verify_after(); + void notify_allocation(); + void notify_allocation_jvmti_allocation_event(); + void notify_allocation_jvmti_sampler(); + void notify_allocation_low_memory_detector(); + void notify_allocation_jfr_sampler(); + void notify_allocation_dtrace_sampler(); + void check_for_bad_heap_word_value() const; +#ifdef ASSERT + void check_for_valid_allocation_state() const; +#endif + + class PreserveObj; + +public: + Allocation(const MemAllocator& allocator, oop* obj_ptr) + : _allocator(allocator), + _thread(Thread::current()), + _obj_ptr(obj_ptr), + _overhead_limit_exceeded(false), + _allocated_outside_tlab(false), + _allocated_tlab_size(0), + _tlab_end_reset_for_sample(false) + { + verify_before(); + } + + ~Allocation() { + if (!check_out_of_memory()) { + verify_after(); + notify_allocation(); + } + } + + oop obj() const { return *_obj_ptr; } +}; + +class MemAllocator::Allocation::PreserveObj: StackObj { + HandleMark _handle_mark; + Handle _handle; + oop* const _obj_ptr; + +public: + PreserveObj(Thread* thread, oop* obj_ptr) + : _handle_mark(thread), + _handle(thread, *obj_ptr), + _obj_ptr(obj_ptr) + { + *obj_ptr = NULL; + } + + ~PreserveObj() { + *_obj_ptr = _handle(); + } + + oop operator()() const { + return _handle(); + } +}; + +bool MemAllocator::Allocation::check_out_of_memory() { + Thread* THREAD = _thread; + assert(!HAS_PENDING_EXCEPTION, "Unexpected exception, will result in uninitialized storage"); + + if (obj() != NULL) { + return false; + } + + if (!_overhead_limit_exceeded) { + // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support + report_java_out_of_memory("Java heap space"); + + if (JvmtiExport::should_post_resource_exhausted()) { + JvmtiExport::post_resource_exhausted( + JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR | JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP, + "Java heap space"); + } + THROW_OOP_(Universe::out_of_memory_error_java_heap(), true); + } else { + // -XX:+HeapDumpOnOutOfMemoryError and -XX:OnOutOfMemoryError support + report_java_out_of_memory("GC overhead limit exceeded"); + + if (JvmtiExport::should_post_resource_exhausted()) { + JvmtiExport::post_resource_exhausted( + JVMTI_RESOURCE_EXHAUSTED_OOM_ERROR | JVMTI_RESOURCE_EXHAUSTED_JAVA_HEAP, + "GC overhead limit exceeded"); + } + + THROW_OOP_(Universe::out_of_memory_error_gc_overhead_limit(), true); + } +} + +void MemAllocator::Allocation::verify_before() { + // Clear unhandled oops for memory allocation. Memory allocation might + // not take out a lock if from tlab, so clear here. + Thread* THREAD = _thread; + CHECK_UNHANDLED_OOPS_ONLY(THREAD->clear_unhandled_oops();) + assert(!HAS_PENDING_EXCEPTION, "Should not allocate with exception pending"); + debug_only(check_for_valid_allocation_state()); + assert(!Universe::heap()->is_gc_active(), "Allocation during gc not allowed"); +} + +void MemAllocator::Allocation::verify_after() { + NOT_PRODUCT(check_for_bad_heap_word_value();) +} + +void MemAllocator::Allocation::check_for_bad_heap_word_value() const { + MemRegion obj_range = _allocator.obj_memory_range(obj()); + HeapWord* addr = obj_range.start(); + size_t size = obj_range.word_size(); + if (CheckMemoryInitialization && ZapUnusedHeapArea) { + for (size_t slot = 0; slot < size; slot += 1) { + assert((*(intptr_t*) (addr + slot)) != ((intptr_t) badHeapWordVal), + "Found badHeapWordValue in post-allocation check"); + } + } +} + +#ifdef ASSERT +void MemAllocator::Allocation::check_for_valid_allocation_state() const { + // How to choose between a pending exception and a potential + // OutOfMemoryError? Don't allow pending exceptions. + // This is a VM policy failure, so how do we exhaustively test it? + assert(!_thread->has_pending_exception(), + "shouldn't be allocating with pending exception"); + if (StrictSafepointChecks) { + assert(_thread->allow_allocation(), + "Allocation done by thread for which allocation is blocked " + "by No_Allocation_Verifier!"); + // Allocation of an oop can always invoke a safepoint, + // hence, the true argument + _thread->check_for_valid_safepoint_state(true); + } +} +#endif + +void MemAllocator::Allocation::notify_allocation_jvmti_sampler() { + // support for JVMTI VMObjectAlloc event (no-op if not enabled) + JvmtiExport::vm_object_alloc_event_collector(obj()); + + if (!ThreadHeapSampler::enabled()) { + // Sampling disabled + return; + } + + if (!_allocated_outside_tlab && _allocated_tlab_size == 0 && !_tlab_end_reset_for_sample) { + // Sample if it's a non-TLAB allocation, or a TLAB allocation that either refills the TLAB + // or expands it due to taking a sampler induced slow path. + return; + } + + assert(JavaThread::current()->heap_sampler().add_sampling_collector(), + "Should never return false."); + + // Only check if the sampler could actually sample something in this path. + assert(!JvmtiExport::should_post_sampled_object_alloc() || + !JvmtiSampledObjectAllocEventCollector::object_alloc_is_safe_to_sample() || + _thread->heap_sampler().sampling_collector_present(), + "Sampling collector not present."); + + if (JvmtiExport::should_post_sampled_object_alloc()) { + // If we want to be sampling, protect the allocated object with a Handle + // before doing the callback. The callback is done in the destructor of + // the JvmtiSampledObjectAllocEventCollector. + PreserveObj obj_h(_thread, _obj_ptr); + JvmtiSampledObjectAllocEventCollector collector; + size_t size_in_bytes = _allocator._word_size * HeapWordSize; + ThreadLocalAllocBuffer& tlab = _thread->tlab(); + size_t bytes_since_last = _allocated_outside_tlab ? 0 : tlab.bytes_since_last_sample_point(); + _thread->heap_sampler().check_for_sampling(obj_h(), size_in_bytes, bytes_since_last); + } + + assert(JavaThread::current()->heap_sampler().remove_sampling_collector(), "Should never return false."); + + if (_tlab_end_reset_for_sample || _allocated_tlab_size != 0) { + _thread->tlab().set_sample_end(); + } +} + +void MemAllocator::Allocation::notify_allocation_low_memory_detector() { + // support low memory notifications (no-op if not enabled) + LowMemoryDetector::detect_low_memory_for_collected_pools(); +} + +void MemAllocator::Allocation::notify_allocation_jfr_sampler() { + HeapWord* mem = (HeapWord*)obj(); + size_t size_in_bytes = _allocator._word_size * HeapWordSize; + + if (_allocated_outside_tlab) { + AllocTracer::send_allocation_outside_tlab(_allocator._klass, mem, size_in_bytes, _thread); + } else if (_allocated_tlab_size != 0) { + // TLAB was refilled + AllocTracer::send_allocation_in_new_tlab(_allocator._klass, mem, _allocated_tlab_size * HeapWordSize, + size_in_bytes, _thread); + } +} + +void MemAllocator::Allocation::notify_allocation_dtrace_sampler() { + if (DTraceAllocProbes) { + // support for Dtrace object alloc event (no-op most of the time) + Klass* klass = _allocator._klass; + size_t word_size = _allocator._word_size; + if (klass != NULL && klass->name() != NULL) { + SharedRuntime::dtrace_object_alloc(obj(), (int)word_size); + } + } +} + +void MemAllocator::Allocation::notify_allocation() { + notify_allocation_low_memory_detector(); + notify_allocation_jfr_sampler(); + notify_allocation_dtrace_sampler(); + notify_allocation_jvmti_sampler(); +} + +HeapWord* MemAllocator::allocate_outside_tlab(Allocation& allocation) const { + allocation._allocated_outside_tlab = true; + HeapWord* mem = _heap->mem_allocate(_word_size, &allocation._overhead_limit_exceeded); + if (mem == NULL) { + return mem; + } + + NOT_PRODUCT(_heap->check_for_non_bad_heap_word_value(mem, _word_size)); + size_t size_in_bytes = _word_size * HeapWordSize; + _thread->incr_allocated_bytes(size_in_bytes); + + return mem; +} + +HeapWord* MemAllocator::allocate_inside_tlab(Allocation& allocation) const { + assert(UseTLAB, "should use UseTLAB"); + + // Try allocating from an existing TLAB. + HeapWord* mem = _thread->tlab().allocate(_word_size); + if (mem != NULL) { + return mem; + } + + // Try refilling the TLAB and allocating the object in it. + return allocate_inside_tlab_slow(allocation); +} + +HeapWord* MemAllocator::allocate_inside_tlab_slow(Allocation& allocation) const { + HeapWord* mem = NULL; + ThreadLocalAllocBuffer& tlab = _thread->tlab(); + + if (ThreadHeapSampler::enabled()) { + // Try to allocate the sampled object from TLAB, it is possible a sample + // point was put and the TLAB still has space. + tlab.set_back_allocation_end(); + mem = tlab.allocate(_word_size); + if (mem != NULL) { + allocation._tlab_end_reset_for_sample = true; + return mem; + } + } + + // Retain tlab and allocate object in shared space if + // the amount free in the tlab is too large to discard. + if (tlab.free() > tlab.refill_waste_limit()) { + tlab.record_slow_allocation(_word_size); + return NULL; + } + + // Discard tlab and allocate a new one. + // To minimize fragmentation, the last TLAB may be smaller than the rest. + size_t new_tlab_size = tlab.compute_size(_word_size); + + tlab.clear_before_allocation(); + + if (new_tlab_size == 0) { + return NULL; + } + + // Allocate a new TLAB requesting new_tlab_size. Any size + // between minimal and new_tlab_size is accepted. + size_t min_tlab_size = ThreadLocalAllocBuffer::compute_min_size(_word_size); + mem = _heap->allocate_new_tlab(min_tlab_size, new_tlab_size, &allocation._allocated_tlab_size); + if (mem == NULL) { + assert(allocation._allocated_tlab_size == 0, + "Allocation failed, but actual size was updated. min: " SIZE_FORMAT + ", desired: " SIZE_FORMAT ", actual: " SIZE_FORMAT, + min_tlab_size, new_tlab_size, allocation._allocated_tlab_size); + return NULL; + } + assert(allocation._allocated_tlab_size != 0, "Allocation succeeded but actual size not updated. mem at: " + PTR_FORMAT " min: " SIZE_FORMAT ", desired: " SIZE_FORMAT, + p2i(mem), min_tlab_size, new_tlab_size); + + if (ZeroTLAB) { + // ..and clear it. + Copy::zero_to_words(mem, allocation._allocated_tlab_size); + } else { + // ...and zap just allocated object. +#ifdef ASSERT + // Skip mangling the space corresponding to the object header to + // ensure that the returned space is not considered parsable by + // any concurrent GC thread. + size_t hdr_size = oopDesc::header_size(); + Copy::fill_to_words(mem + hdr_size, allocation._allocated_tlab_size - hdr_size, badHeapWordVal); +#endif // ASSERT + } + + tlab.fill(mem, mem + _word_size, allocation._allocated_tlab_size); + return mem; +} + +HeapWord* MemAllocator::mem_allocate(Allocation& allocation) const { + if (UseTLAB) { + HeapWord* result = allocate_inside_tlab(allocation); + if (result != NULL) { + return result; + } + } + + return allocate_outside_tlab(allocation); +} + +oop MemAllocator::allocate() const { + oop obj = NULL; + { + Allocation allocation(*this, &obj); + HeapWord* mem = mem_allocate(allocation); + if (mem != NULL) { + obj = initialize(mem); + } + } + return obj; +} + +void MemAllocator::mem_clear(HeapWord* mem) const { + assert(mem != NULL, "cannot initialize NULL object"); + const size_t hs = oopDesc::header_size(); + assert(_word_size >= hs, "unexpected object size"); + oopDesc::set_klass_gap(mem, 0); + Copy::fill_to_aligned_words(mem + hs, _word_size - hs); +} + +oop MemAllocator::finish(HeapWord* mem) const { + assert(mem != NULL, "NULL object pointer"); + if (UseBiasedLocking) { + oopDesc::set_mark_raw(mem, _klass->prototype_header()); + } else { + // May be bootstrapping + oopDesc::set_mark_raw(mem, markOopDesc::prototype()); + } + // Need a release store to ensure array/class length, mark word, and + // object zeroing are visible before setting the klass non-NULL, for + // concurrent collectors. + oopDesc::release_set_klass(mem, _klass); + return oop(mem); +} + +oop ObjAllocator::initialize(HeapWord* mem) const { + mem_clear(mem); + return finish(mem); +} + +MemRegion ObjArrayAllocator::obj_memory_range(oop obj) const { + if (_do_zero) { + return MemAllocator::obj_memory_range(obj); + } + ArrayKlass* array_klass = ArrayKlass::cast(_klass); + const size_t hs = arrayOopDesc::header_size(array_klass->element_type()); + return MemRegion(((HeapWord*)obj) + hs, _word_size - hs); +} + +oop ObjArrayAllocator::initialize(HeapWord* mem) const { + // Set array length before setting the _klass field because a + // non-NULL klass field indicates that the object is parsable by + // concurrent GC. + assert(_length >= 0, "length should be non-negative"); + if (_do_zero) { + mem_clear(mem); + } + arrayOopDesc::set_length(mem, _length); + return finish(mem); +} + +oop ClassAllocator::initialize(HeapWord* mem) const { + // Set oop_size field before setting the _klass field because a + // non-NULL _klass field indicates that the object is parsable by + // concurrent GC. + assert(_word_size > 0, "oop_size must be positive."); + mem_clear(mem); + java_lang_Class::set_oop_size(mem, (int)_word_size); + return finish(mem); +} diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/memAllocator.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/memAllocator.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/memAllocator.hpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/memAllocator.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_GC_SHARED_MEM_ALLOCATOR_HPP +#define SHARE_GC_SHARED_MEM_ALLOCATOR_HPP + +#include "gc/shared/collectedHeap.hpp" +#include "memory/memRegion.hpp" +#include "oops/oopsHierarchy.hpp" +#include "utilities/exceptions.hpp" +#include "utilities/macros.hpp" + +// These fascilities are used for allocating, and initializing newly allocated objects. + +class MemAllocator: StackObj { + class Allocation; + +protected: + CollectedHeap* const _heap; + Thread* const _thread; + Klass* const _klass; + const size_t _word_size; + +private: + // Allocate from the current thread's TLAB, with broken-out slow path. + HeapWord* allocate_inside_tlab(Allocation& allocation) const; + HeapWord* allocate_inside_tlab_slow(Allocation& allocation) const; + HeapWord* allocate_outside_tlab(Allocation& allocation) const; + +protected: + MemAllocator(Klass* klass, size_t word_size, Thread* thread) + : _heap(Universe::heap()), + _thread(thread), + _klass(klass), + _word_size(word_size) + { } + + // This function clears the memory of the object + void mem_clear(HeapWord* mem) const; + // This finish constructing an oop by installing the mark word and the Klass* pointer + // last. At the point when the Klass pointer is initialized, this is a constructed object + // that must be parseable as an oop by concurrent collectors. + oop finish(HeapWord* mem) const; + + // Raw memory allocation. This may or may not use TLAB allocations to satisfy the + // allocation. A GC implementation may override this function to satisfy the allocation + // in any way. But the default is to try a TLAB allocation, and otherwise perform + // mem_allocate. + virtual HeapWord* mem_allocate(Allocation& allocation) const; + + virtual MemRegion obj_memory_range(oop obj) const { + return MemRegion((HeapWord*)obj, _word_size); + } + +public: + oop allocate() const; + virtual oop initialize(HeapWord* mem) const = 0; +}; + +class ObjAllocator: public MemAllocator { +public: + ObjAllocator(Klass* klass, size_t word_size, Thread* thread = Thread::current()) + : MemAllocator(klass, word_size, thread) {} + virtual oop initialize(HeapWord* mem) const; +}; + +class ObjArrayAllocator: public MemAllocator { + const int _length; + const bool _do_zero; +protected: + virtual MemRegion obj_memory_range(oop obj) const; + +public: + ObjArrayAllocator(Klass* klass, size_t word_size, int length, bool do_zero, + Thread* thread = Thread::current()) + : MemAllocator(klass, word_size, thread), + _length(length), + _do_zero(do_zero) {} + virtual oop initialize(HeapWord* mem) const; +}; + +class ClassAllocator: public MemAllocator { +public: + ClassAllocator(Klass* klass, size_t word_size, Thread* thread = Thread::current()) + : MemAllocator(klass, word_size, thread) {} + virtual oop initialize(HeapWord* mem) const; +}; + +#endif // SHARE_GC_SHARED_MEM_ALLOCATOR_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/modRefBarrierSet.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/modRefBarrierSet.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/modRefBarrierSet.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/modRefBarrierSet.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -102,7 +102,7 @@ if (!HasDecorator::value) { // Optimized covariant case bs->write_ref_array_pre(dst_raw, length, - HasDecorator::value); + HasDecorator::value); Raw::oop_arraycopy(NULL, 0, src_raw, NULL, 0, dst_raw, length); bs->write_ref_array((HeapWord*)dst_raw, length); } else { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/referenceProcessor.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/referenceProcessor.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/referenceProcessor.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/referenceProcessor.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1033,7 +1033,7 @@ // The last ref must have its discovered field pointing to itself. oop next_discovered = (current_head != NULL) ? current_head : obj; - oop retest = RawAccess<>::oop_atomic_cmpxchg(next_discovered, discovered_addr, oop(NULL)); + oop retest = HeapAccess::oop_atomic_cmpxchg(next_discovered, discovered_addr, oop(NULL)); if (retest == NULL) { // This thread just won the right to enqueue the object. diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/referenceProcessorPhaseTimes.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -80,8 +80,7 @@ STATIC_ASSERT((REF_PHANTOM + 1) == ARRAY_SIZE(ReferenceTypeNames)); static const char* phase_enum_2_phase_string(ReferenceProcessor::RefProcPhases phase) { - assert(phase >= ReferenceProcessor::RefPhase1 && phase <= ReferenceProcessor::RefPhaseMax, - "Invalid reference processing phase (%d)", phase); + ASSERT_PHASE(phase); return PhaseNames[phase]; } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/space.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/space.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/space.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/space.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -32,6 +32,7 @@ #include "gc/shared/space.hpp" #include "gc/shared/space.inline.hpp" #include "gc/shared/spaceDecorator.hpp" +#include "memory/iterator.inline.hpp" #include "memory/universe.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" @@ -132,8 +133,7 @@ "Only ones we deal with for now."); assert(_precision != CardTable::ObjHeadPreciseArray || - _cl->idempotent() || _last_bottom == NULL || - top <= _last_bottom, + _last_bottom == NULL || top <= _last_bottom, "Not decreasing"); NOT_PRODUCT(_last_bottom = mr.start()); @@ -171,17 +171,10 @@ walk_mem_region(extended_mr, bottom_obj, top); } - // An idempotent closure might be applied in any order, so we don't - // record a _min_done for it. - if (!_cl->idempotent()) { - _min_done = bottom; - } else { - assert(_min_done == _last_explicit_min_done, - "Don't update _min_done for idempotent cl"); - } + _min_done = bottom; } -DirtyCardToOopClosure* Space::new_dcto_cl(ExtendedOopClosure* cl, +DirtyCardToOopClosure* Space::new_dcto_cl(OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary, bool parallel) { @@ -257,11 +250,11 @@ // (There are only two of these, rather than N, because the split is due // only to the introduction of the FilteringClosure, a local part of the // impl of this abstraction.) -ContiguousSpaceDCTOC__walk_mem_region_with_cl_DEFN(ExtendedOopClosure) +ContiguousSpaceDCTOC__walk_mem_region_with_cl_DEFN(OopIterateClosure) ContiguousSpaceDCTOC__walk_mem_region_with_cl_DEFN(FilteringClosure) DirtyCardToOopClosure* -ContiguousSpace::new_dcto_cl(ExtendedOopClosure* cl, +ContiguousSpace::new_dcto_cl(OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary, bool parallel) { @@ -480,7 +473,7 @@ } } -void Space::oop_iterate(ExtendedOopClosure* blk) { +void Space::oop_iterate(OopIterateClosure* blk) { ObjectToOopClosure blk2(blk); object_iterate(&blk2); } @@ -490,7 +483,7 @@ return true; } -void ContiguousSpace::oop_iterate(ExtendedOopClosure* blk) { +void ContiguousSpace::oop_iterate(OopIterateClosure* blk) { if (is_empty()) return; HeapWord* obj_addr = bottom(); HeapWord* t = top(); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/space.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/space.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/space.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/space.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -169,7 +169,7 @@ // Iterate over all the ref-containing fields of all objects in the // space, calling "cl.do_oop" on each. Fields in objects allocated by // applications of the closure are not included in the iteration. - virtual void oop_iterate(ExtendedOopClosure* cl); + virtual void oop_iterate(OopIterateClosure* cl); // Iterate over all objects in the space, calling "cl.do_object" on // each. Objects allocated by applications of the closure are not @@ -183,7 +183,7 @@ // overridden to return the appropriate type of closure // depending on the type of space in which the closure will // operate. ResourceArea allocated. - virtual DirtyCardToOopClosure* new_dcto_cl(ExtendedOopClosure* cl, + virtual DirtyCardToOopClosure* new_dcto_cl(OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary, bool parallel); @@ -256,7 +256,7 @@ class DirtyCardToOopClosure: public MemRegionClosureRO { protected: - ExtendedOopClosure* _cl; + OopIterateClosure* _cl; Space* _sp; CardTable::PrecisionStyle _precision; HeapWord* _boundary; // If non-NULL, process only non-NULL oops @@ -286,7 +286,7 @@ virtual void walk_mem_region(MemRegion mr, HeapWord* bottom, HeapWord* top); public: - DirtyCardToOopClosure(Space* sp, ExtendedOopClosure* cl, + DirtyCardToOopClosure(Space* sp, OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary) : _sp(sp), _cl(cl), _precision(precision), _boundary(boundary), @@ -582,7 +582,7 @@ HeapWord* allocate_aligned(size_t word_size); // Iteration - void oop_iterate(ExtendedOopClosure* cl); + void oop_iterate(OopIterateClosure* cl); void object_iterate(ObjectClosure* blk); // For contiguous spaces this method will iterate safely over objects // in the space (i.e., between bottom and top) when at a safepoint. @@ -621,7 +621,7 @@ } // Override. - DirtyCardToOopClosure* new_dcto_cl(ExtendedOopClosure* cl, + DirtyCardToOopClosure* new_dcto_cl(OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary, bool parallel); @@ -689,13 +689,13 @@ // apparent. virtual void walk_mem_region_with_cl(MemRegion mr, HeapWord* bottom, HeapWord* top, - ExtendedOopClosure* cl) = 0; + OopIterateClosure* cl) = 0; virtual void walk_mem_region_with_cl(MemRegion mr, HeapWord* bottom, HeapWord* top, FilteringClosure* cl) = 0; public: - FilteringDCTOC(Space* sp, ExtendedOopClosure* cl, + FilteringDCTOC(Space* sp, OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary) : DirtyCardToOopClosure(sp, cl, precision, boundary) {} @@ -718,13 +718,13 @@ virtual void walk_mem_region_with_cl(MemRegion mr, HeapWord* bottom, HeapWord* top, - ExtendedOopClosure* cl); + OopIterateClosure* cl); virtual void walk_mem_region_with_cl(MemRegion mr, HeapWord* bottom, HeapWord* top, FilteringClosure* cl); public: - ContiguousSpaceDCTOC(ContiguousSpace* sp, ExtendedOopClosure* cl, + ContiguousSpaceDCTOC(ContiguousSpace* sp, OopIterateClosure* cl, CardTable::PrecisionStyle precision, HeapWord* boundary) : FilteringDCTOC(sp, cl, precision, boundary) diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/space.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/space.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/space.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/space.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ #ifndef SHARE_VM_GC_SHARED_SPACE_INLINE_HPP #define SHARE_VM_GC_SHARED_SPACE_INLINE_HPP +#include "gc/shared/blockOffsetTable.inline.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/space.hpp" diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/specialized_oop_closures.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/specialized_oop_closures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/specialized_oop_closures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/specialized_oop_closures.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - * - */ - -#ifndef SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP -#define SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP - -#include "utilities/macros.hpp" -#if INCLUDE_CMSGC -#include "gc/cms/cms_specialized_oop_closures.hpp" -#endif -#if INCLUDE_G1GC -#include "gc/g1/g1_specialized_oop_closures.hpp" -#endif -#if INCLUDE_SERIALGC -#include "gc/serial/serial_specialized_oop_closures.hpp" -#endif -#if INCLUDE_ZGC -#include "gc/z/z_specialized_oop_closures.hpp" -#endif - -// The following OopClosure types get specialized versions of -// "oop_oop_iterate" that invoke the closures' do_oop methods -// non-virtually, using a mechanism defined in this file. Extend these -// macros in the obvious way to add specializations for new closures. - -// Forward declarations. -class ExtendedOopClosure; -class NoHeaderExtendedOopClosure; -class OopsInGenClosure; - -// This macro applies an argument macro to all OopClosures for which we -// want specialized bodies of "oop_oop_iterate". The arguments to "f" are: -// "f(closureType, non_virtual)" -// where "closureType" is the name of the particular subclass of ExtendedOopClosure, -// and "non_virtual" will be the string "_nv" if the closure type should -// have its "do_oop" method invoked non-virtually, or else the -// string "_v". ("ExtendedOopClosure" itself will be the only class in the latter -// category.) - -// This is split into several because of a Visual C++ 6.0 compiler bug -// where very long macros cause the compiler to crash - -#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(f) \ - f(NoHeaderExtendedOopClosure,_nv) \ - SERIALGC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_S(f)) \ - CMSGC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_P(f)) - -#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f) \ - SERIALGC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_MS(f)) \ - CMSGC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_CMS(f)) \ - G1GC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1(f)) \ - G1GC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_G1FULL(f)) \ - ZGC_ONLY(SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_Z(f)) - -// We separate these out, because sometime the general one has -// a different definition from the specialized ones, and sometimes it -// doesn't. - -#define ALL_OOP_OOP_ITERATE_CLOSURES_1(f) \ - f(ExtendedOopClosure,_v) \ - SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_1(f) - -#define ALL_OOP_OOP_ITERATE_CLOSURES_2(f) \ - SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_2(f) - -#endif // SHARE_VM_GC_SHARED_SPECIALIZED_OOP_CLOSURES_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/stringdedup/stringDedupTable.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -281,13 +281,11 @@ StringDedupEntry** list, uintx &count) { for (StringDedupEntry* entry = *list; entry != NULL; entry = entry->next()) { if (entry->hash() == hash && entry->latin1() == latin1) { - typeArrayOop existing_value = entry->obj(); - if (equals(value, existing_value)) { - // Apply proper barrier to make sure it is kept alive. Concurrent mark might - // otherwise declare it dead if there are no other strong references to this object. - oop* obj_addr = (oop*)entry->obj_addr(); - oop obj = NativeAccess::oop_load(obj_addr); - return typeArrayOop(obj); + oop* obj_addr = (oop*)entry->obj_addr(); + oop obj = NativeAccess::oop_load(obj_addr); + if (equals(value, static_cast(obj))) { + obj = NativeAccess::oop_load(obj_addr); + return static_cast(obj); } } count++; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp openjdk-11-11~24/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -185,10 +185,6 @@ initialize(start, top, start + new_size - alignment_reserve()); - if (ThreadHeapSampler::enabled()) { - set_sample_end(); - } - // Reset amount of internal fragmentation set_refill_waste_limit(initial_refill_waste_limit()); } @@ -325,14 +321,14 @@ void ThreadLocalAllocBuffer::set_sample_end() { size_t heap_words_remaining = pointer_delta(_end, _top); size_t bytes_until_sample = myThread()->heap_sampler().bytes_until_sample(); - size_t words_until_sample = bytes_until_sample / HeapWordSize;; + size_t words_until_sample = bytes_until_sample / HeapWordSize; if (heap_words_remaining > words_until_sample) { HeapWord* new_end = _top + words_until_sample; set_end(new_end); _bytes_since_last_sample_point = bytes_until_sample; } else { - _bytes_since_last_sample_point = heap_words_remaining * HeapWordSize;; + _bytes_since_last_sample_point = heap_words_remaining * HeapWordSize; } } @@ -346,18 +342,6 @@ _end = _allocation_end; } -HeapWord* ThreadLocalAllocBuffer::allocate_sampled_object(size_t size) { - set_back_allocation_end(); - HeapWord* result = allocate(size); - - if (result) { - myThread()->heap_sampler().check_for_sampling(result, size * HeapWordSize, _bytes_since_last_sample_point); - set_sample_end(); - } - - return result; -} - HeapWord* ThreadLocalAllocBuffer::hard_end() { return _allocation_end + alignment_reserve(); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/threadLocalAllocBuffer.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -89,8 +89,6 @@ size_t remaining(); - bool is_last_allocation(HeapWord* obj, size_t size) { return pointer_delta(top(), obj) == size; } - // Make parsable and release it. void reset(); @@ -141,10 +139,6 @@ // Allocate size HeapWords. The memory is NOT initialized to zero. inline HeapWord* allocate(size_t size); - HeapWord* allocate_sampled_object(size_t size); - - // Undo last allocation. - inline bool undo_allocate(HeapWord* obj, size_t size); // Reserve space at the end of TLAB static size_t end_reserve() { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/shared/threadLocalAllocBuffer.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,19 +53,6 @@ return NULL; } -inline bool ThreadLocalAllocBuffer::undo_allocate(HeapWord* obj, size_t size) { - invariants(); - - if (!is_last_allocation(obj, size)) { - return false; - } - - set_top(obj); - - invariants(); - return true; -} - inline size_t ThreadLocalAllocBuffer::compute_size(size_t obj_size) { // Compute the size for the new TLAB. // The "last" tlab may be smaller to reduce fragmentation. diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp openjdk-11-11~24/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/c2/zBarrierSetC2.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -292,7 +292,7 @@ } void LoadBarrierNode::push_dominated_barriers(PhaseIterGVN* igvn) const { - // change to that barrier may affect a dominated barrier so re-push those + // Change to that barrier may affect a dominated barrier so re-push those Node* val = in(LoadBarrierNode::Oop); for (DUIterator_Fast imax, i = val->fast_outs(imax); i < imax; i++) { @@ -526,7 +526,7 @@ phi_mem2->init_req(1, scmemproj2); kit->set_memory(phi_mem2, alias_idx); - // Merge outer flow - then check if first cas succeded + // Merge outer flow - then check if first CAS succeeded region->set_req(1, then); region->set_req(2, region2); phi->set_req(1, kit->intcon(1)); @@ -573,7 +573,7 @@ Node* region2 = new RegionNode(3); Node* phi2 = new PhiNode(region2, adr_type); - // Check if cmpx succeded + // Check if cmpx succeeded Node* cmp = gvn.transform(new CmpPNode(cmpx, in_expected)); Node* bol = gvn.transform(new BoolNode(cmp, BoolTest::eq))->as_Bool(); IfNode* iff = gvn.transform(new IfNode(in_ctrl, bol, likely, COUNT_UNKNOWN))->as_If(); @@ -610,7 +610,7 @@ phi2->set_req(1, cmpx2); phi2->set_req(2, barrierdata); - // Merge outer flow - then check if first cas succeded + // Merge outer flow - then check if first cas succeeded region->set_req(1, then); region->set_req(2, region2); phi->set_req(1, cmpx); @@ -653,7 +653,6 @@ return p; } - bool conc_root = (access.decorators() & IN_CONCURRENT_ROOT) != 0; bool weak = (access.decorators() & ON_WEAK_OOP_REF) != 0; GraphKit* kit = access.kit(); @@ -803,7 +802,7 @@ } } -// Basic loadbarrier using conventional arg passing +// Basic loadbarrier using conventional argument passing void ZBarrierSetC2::expand_loadbarrier_basic(PhaseMacroExpand* phase, LoadBarrierNode *barrier) const { PhaseIterGVN &igvn = phase->igvn(); @@ -863,7 +862,7 @@ if (barrier->is_writeback()) { call->init_req(TypeFunc::Parms+1, in_adr); } else { - // when slow path is called with a null adr, the healed oop will not be written back + // When slow path is called with a null address, the healed oop will not be written back call->init_req(TypeFunc::Parms+1, igvn.zerocon(T_OBJECT)); } call = igvn.transform(call); @@ -878,7 +877,7 @@ result_region = igvn.transform(result_region); result_val = igvn.transform(result_val); - if (out_ctrl != NULL) { // added if cond + if (out_ctrl != NULL) { // Added if cond igvn.replace_node(out_ctrl, result_region); } igvn.replace_node(out_res, result_val); @@ -935,7 +934,7 @@ Node *new_loadp; new_loadp = slow_path_surrogate; - // create the final region/phi pair to converge cntl/data paths to downstream code + // Create the final region/phi pair to converge cntl/data paths to downstream code Node* result_region = igvn.transform(new RegionNode(3)); result_region->set_req(1, then); result_region->set_req(2, elsen); @@ -944,7 +943,7 @@ result_phi->set_req(1, new_loadp); result_phi->set_req(2, barrier->in(LoadBarrierNode::Oop)); - // finally, connect the original outputs to the barrier region and phi to complete the expansion/substitution + // Finally, connect the original outputs to the barrier region and phi to complete the expansion/substitution // igvn.replace_node(out_ctrl, result_region); if (out_ctrl != NULL) { // added if cond igvn.replace_node(out_ctrl, result_region); @@ -981,7 +980,7 @@ int load_barrier_count = s->load_barrier_count(); LoadBarrierNode * n = s->load_barrier_node(load_barrier_count-1-skipped); if (igvn.type(n) == Type::TOP || (n->in(0) != NULL && n->in(0)->is_top())) { - // node is unreachable, so don't try to expand it + // Node is unreachable, so don't try to expand it s->remove_load_barrier_node(n); continue; } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp openjdk-11-11~24/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/c2/zBarrierSetC2.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -35,8 +35,8 @@ bool _writeback; // Controls if the barrier writes the healed oop back to memory // A swap on a memory location must never write back the healed oop bool _oop_reload_allowed; // Controls if the barrier are allowed to reload the oop from memory - // before healing, otherwise both the oop and the address must be passed to the - // barrier from the oop + // before healing, otherwise both the oop and the address must be + // passed to the barrier from the oop static bool is_dominator(PhaseIdealLoop* phase, bool linear_only, Node *d, Node *n); void push_dominated_barriers(PhaseIterGVN* igvn) const; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/vmStructs_z.cpp openjdk-11-11~24/src/hotspot/share/gc/z/vmStructs_z.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/vmStructs_z.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/vmStructs_z.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -19,7 +19,6 @@ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. - * */ #include "precompiled.hpp" diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/vmStructs_z.hpp openjdk-11-11~24/src/hotspot/share/gc/z/vmStructs_z.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/vmStructs_z.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/vmStructs_z.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -19,7 +19,6 @@ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. - * */ #ifndef SHARE_VM_GC_Z_VMSTRUCTS_Z_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zAllocationFlags.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zAllocationFlags.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zAllocationFlags.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zAllocationFlags.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,31 +31,28 @@ // Allocation flags layout // ----------------------- // -// 7 4 3 2 1 0 -// +---+-+-+-+-+-+ -// |000|1|1|1|1|1| -// +---+-+-+-+-+-+ -// | | | | | | -// | | | | | * 0-0 Java Thread Flag (1-bit) -// | | | | | -// | | | | * 1-1 Worker Thread Flag (1-bit) -// | | | | -// | | | * 2-2 Non-Blocking Flag (1-bit) -// | | | -// | | * 3-3 Relocation Flag (1-bit) -// | | -// | * 4-4 No Reserve Flag (1-bit) +// 7 3 2 1 0 +// +----+-+-+-+-+ +// |0000|1|1|1|1| +// +----+-+-+-+-+ +// | | | | | +// | | | | * 0-0 Worker Thread Flag (1-bit) +// | | | | +// | | | * 1-1 Non-Blocking Flag (1-bit) +// | | | +// | | * 2-2 Relocation Flag (1-bit) +// | | +// | * 3-3 No Reserve Flag (1-bit) // | -// * 7-5 Unused (3-bits) +// * 7-4 Unused (4-bits) // class ZAllocationFlags { private: - typedef ZBitField field_java_thread; - typedef ZBitField field_worker_thread; - typedef ZBitField field_non_blocking; - typedef ZBitField field_relocation; - typedef ZBitField field_no_reserve; + typedef ZBitField field_worker_thread; + typedef ZBitField field_non_blocking; + typedef ZBitField field_relocation; + typedef ZBitField field_no_reserve; uint8_t _flags; @@ -63,10 +60,6 @@ ZAllocationFlags() : _flags(0) {} - void set_java_thread() { - _flags |= field_java_thread::encode(true); - } - void set_worker_thread() { _flags |= field_worker_thread::encode(true); } @@ -83,10 +76,6 @@ _flags |= field_no_reserve::encode(true); } - bool java_thread() const { - return field_java_thread::decode(_flags); - } - bool worker_thread() const { return field_worker_thread::decode(_flags); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zBarrier.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zBarrier.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zBarrier.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zBarrier.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,7 @@ #include "gc/z/zHeap.inline.hpp" #include "gc/z/zOop.inline.hpp" #include "gc/z/zOopClosures.inline.hpp" +#include "memory/iterator.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/safepoint.hpp" #include "utilities/debug.hpp" diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zBarrierSet.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zBarrierSet.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zBarrierSet.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zBarrierSet.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -48,15 +48,12 @@ //assert((decorators & ON_UNKNOWN_OOP_REF) == 0, "Unexpected decorator"); if (type == T_OBJECT || type == T_ARRAY) { - if (((decorators & IN_HEAP) != 0) || - ((decorators & IN_CONCURRENT_ROOT) != 0) || - ((decorators & ON_PHANTOM_OOP_REF) != 0)) { - // Barrier needed - return true; - } + assert((decorators & (IN_HEAP | IN_NATIVE)) != 0, "Where is reference?"); + // Barrier needed even when IN_NATIVE, to allow concurrent scanning. + return true; } - // Barrier not neeed + // Barrier not needed return false; } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zBarrierSet.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zBarrierSet.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zBarrierSet.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zBarrierSet.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -141,7 +141,7 @@ verify_decorators_present(); verify_decorators_absent(); - // Through Unsafe.CompareAndExchangeObject()/CompareAndSetObject() we can recieve + // Through Unsafe.CompareAndExchangeObject()/CompareAndSetObject() we can receive // calls with ON_UNKNOWN_OOP_REF set. However, we treat these as ON_STRONG_OOP_REF, // with the motivation that if you're doing Unsafe operations on a Reference.referent // field, then you're on your own anyway. diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zBitMap.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zBitMap.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zBitMap.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zBitMap.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -51,16 +51,20 @@ do { const bm_word_t new_val = old_val | pair_mask; if (new_val == old_val) { + // Someone else beat us to it inc_live = false; - return false; // Someone else beat us to it. + return false; } const bm_word_t cur_val = Atomic::cmpxchg(new_val, addr, old_val); if (cur_val == old_val) { + // Success const bm_word_t marked_mask = bit_mask(bit); inc_live = !(old_val & marked_mask); - return true; // Success. + return true; } - old_val = cur_val; // The value changed, try again. + + // The value changed, retry + old_val = cur_val; } while (true); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zCollectedHeap.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zCollectedHeap.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zCollectedHeap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zCollectedHeap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -173,7 +173,7 @@ void ZCollectedHeap::collect_as_vm_thread(GCCause::Cause cause) { // These collection requests are ignored since ZGC can't run a synchronous // GC cycle from within the VM thread. This is considered benign, since the - // only GC causes comming in here should be heap dumper and heap inspector. + // only GC causes coming in here should be heap dumper and heap inspector. // However, neither the heap dumper nor the heap inspector really need a GC // to happen, but the result of their heap iterations might in that case be // less accurate since they might include objects that would otherwise have @@ -233,11 +233,11 @@ } void ZCollectedHeap::object_iterate(ObjectClosure* cl) { - _heap.object_iterate(cl); + _heap.object_iterate(cl, true /* visit_referents */); } void ZCollectedHeap::safe_object_iterate(ObjectClosure* cl) { - _heap.object_iterate(cl); + _heap.object_iterate(cl, true /* visit_referents */); } HeapWord* ZCollectedHeap::block_start(const void* addr) const { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zDirector.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zDirector.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zDirector.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zDirector.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -81,7 +81,7 @@ // Perform GC if heap usage passes 10/20/30% and no other GC has been // performed yet. This allows us to get some early samples of the GC // duration, which is needed by the other rules. - const size_t max_capacity = ZHeap::heap()->max_capacity(); + const size_t max_capacity = ZHeap::heap()->current_max_capacity(); const size_t used = ZHeap::heap()->used(); const double used_threshold_percent = (ZStatCycle::ncycles() + 1) * 0.1; const size_t used_threshold = max_capacity * used_threshold_percent; @@ -101,13 +101,13 @@ // Perform GC if the estimated max allocation rate indicates that we // will run out of memory. The estimated max allocation rate is based // on the moving average of the sampled allocation rate plus a safety - // margin based on variations in the allocation rate and unforseen + // margin based on variations in the allocation rate and unforeseen // allocation spikes. // Calculate amount of free memory available to Java threads. Note that // the heap reserve is not available to Java threads and is therefore not // considered part of the free memory. - const size_t max_capacity = ZHeap::heap()->max_capacity(); + const size_t max_capacity = ZHeap::heap()->current_max_capacity(); const size_t max_reserve = ZHeap::heap()->max_reserve(); const size_t used = ZHeap::heap()->used(); const size_t free_with_reserve = max_capacity - used; @@ -115,9 +115,9 @@ // Calculate time until OOM given the max allocation rate and the amount // of free memory. The allocation rate is a moving average and we multiply - // that with an alllcation spike tolerance factor to guard against unforseen + // that with an allocation spike tolerance factor to guard against unforeseen // phase changes in the allocate rate. We then add ~3.3 sigma to account for - // the allocation rate variance, which means the probablility is 1 in 1000 + // the allocation rate variance, which means the probability is 1 in 1000 // that a sample is outside of the confidence interval. const double max_alloc_rate = (ZStatAllocRate::avg() * ZAllocationSpikeTolerance) + (ZStatAllocRate::avg_sd() * one_in_1000); const double time_until_oom = free / (max_alloc_rate + 1.0); // Plus 1.0B/s to avoid division by zero @@ -155,7 +155,7 @@ // passed since the previous GC. This helps avoid superfluous GCs when running // applications with very low allocation rate. const size_t used_after_last_gc = ZStatHeap::used_at_relocate_end(); - const size_t used_increase_threshold = ZHeap::heap()->max_capacity() * 0.10; // 10% + const size_t used_increase_threshold = ZHeap::heap()->current_max_capacity() * 0.10; // 10% const size_t used_threshold = used_after_last_gc + used_increase_threshold; const size_t used = ZHeap::heap()->used(); const double time_since_last_gc = ZStatCycle::time_since_last(); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zDriver.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zDriver.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zDriver.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zDriver.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -181,11 +181,11 @@ ZStatTimer timer(ZPhasePauseMarkStart); ZServiceabilityMarkStartTracer tracer; - // Setup soft reference policy + // Set up soft reference policy const bool clear = should_clear_soft_references(); ZHeap::heap()->set_soft_reference_policy(clear); - // Setup boost mode + // Set up boost mode const bool boost = should_boost_worker_threads(); ZHeap::heap()->set_boost_worker_threads(boost); @@ -373,7 +373,7 @@ ZHeap::heap()->select_relocation_set(); } - // Phase 8: Prepare Relocation Set + // Phase 8: Concurrent Prepare Relocation Set { ZStatTimer timer(ZPhaseConcurrentPrepareRelocationSet); ZHeap::heap()->prepare_relocation_set(); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zForwardingTable.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zForwardingTable.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zForwardingTable.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zForwardingTable.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,7 @@ // Allocate table for linear probing. The size of the table must be // a power of two to allow for quick and inexpensive indexing/masking. // The table is sized to have a load factor of 50%, i.e. sized to have - // double the number of entries actuallly inserted. + // double the number of entries actually inserted. _size = ZUtils::round_up_power_of_2(live_objects * 2); _table = MallocArrayAllocator::allocate(_size, mtGC); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zForwardingTable.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zForwardingTable.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zForwardingTable.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zForwardingTable.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -65,7 +65,7 @@ } inline ZForwardingTableEntry ZForwardingTable::find(uintptr_t from_index, ZForwardingTableCursor* cursor) const { - // Reading entries in the table races with the atomic cas done for + // Reading entries in the table races with the atomic CAS done for // insertion into the table. This is safe because each entry is at // most updated once (from -1 to something else). ZForwardingTableEntry entry = first(from_index, cursor); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zHash.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zHash.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zHash.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zHash.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,6 +21,38 @@ * questions. */ +/* + * This file is available under and governed by the GNU General Public + * License version 2 only, as published by the Free Software Foundation. + * However, the following notice accompanied the original version of this + * file: + * + * (C) 2009 by Remo Dentato (rdentato@gmail.com) + * + * + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation + * and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * http://opensource.org/licenses/bsd-license.php + */ + #ifndef SHARE_GC_Z_ZHASH_INLINE_HPP #define SHARE_GC_Z_ZHASH_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zHeap.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zHeap.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zHeap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zHeap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -50,12 +50,12 @@ #include "utilities/align.hpp" #include "utilities/debug.hpp" -static const ZStatSampler ZSamplerHeapUsedBeforeMark("Memory", "Heap Used Before Mark", ZStatUnitBytes); -static const ZStatSampler ZSamplerHeapUsedAfterMark("Memory", "Heap Used After Mark", ZStatUnitBytes); -static const ZStatSampler ZSamplerHeapUsedBeforeRelocation("Memory", "Heap Used Before Relocation", ZStatUnitBytes); -static const ZStatSampler ZSamplerHeapUsedAfterRelocation("Memory", "Heap Used After Relocation", ZStatUnitBytes); -static const ZStatCounter ZCounterUndoPageAllocation("Memory", "Undo Page Allocation", ZStatUnitOpsPerSecond); -static const ZStatCounter ZCounterOutOfMemory("Memory", "Out Of Memory", ZStatUnitOpsPerSecond); +static const ZStatSampler ZSamplerHeapUsedBeforeMark("Memory", "Heap Used Before Mark", ZStatUnitBytes); +static const ZStatSampler ZSamplerHeapUsedAfterMark("Memory", "Heap Used After Mark", ZStatUnitBytes); +static const ZStatSampler ZSamplerHeapUsedBeforeRelocation("Memory", "Heap Used Before Relocation", ZStatUnitBytes); +static const ZStatSampler ZSamplerHeapUsedAfterRelocation("Memory", "Heap Used After Relocation", ZStatUnitBytes); +static const ZStatCounter ZCounterUndoPageAllocation("Memory", "Undo Page Allocation", ZStatUnitOpsPerSecond); +static const ZStatCounter ZCounterOutOfMemory("Memory", "Out Of Memory", ZStatUnitOpsPerSecond); ZHeap* ZHeap::_heap = NULL; @@ -107,6 +107,10 @@ return _page_allocator.max_capacity(); } +size_t ZHeap::current_max_capacity() const { + return _page_allocator.current_max_capacity(); +} + size_t ZHeap::capacity() const { return _page_allocator.capacity(); } @@ -155,7 +159,7 @@ // fit the smallest possible TLAB. This means that the next // TLAB allocation will force the allocator to get a new // backing page anyway, which in turn means that we can then - // fit the larges possible TLAB. + // fit the largest possible TLAB. size = max_tlab_size(); } @@ -503,10 +507,10 @@ used(), used_high(), used_low()); } -void ZHeap::object_iterate(ObjectClosure* cl) { +void ZHeap::object_iterate(ObjectClosure* cl, bool visit_referents) { assert(SafepointSynchronize::is_at_safepoint(), "Should be at safepoint"); - ZHeapIterator iter; + ZHeapIterator iter(visit_referents); iter.objects_do(cl); } @@ -577,6 +581,6 @@ { ZVerifyObjectClosure cl; - object_iterate(&cl); + object_iterate(&cl, false /* visit_referents */); } } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zHeap.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zHeap.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zHeap.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zHeap.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -79,6 +79,7 @@ // Heap metrics size_t min_capacity() const; size_t max_capacity() const; + size_t current_max_capacity() const; size_t capacity() const; size_t max_reserve() const; size_t used_high() const; @@ -152,7 +153,7 @@ void relocate(); // Iteration - void object_iterate(ObjectClosure* cl); + void object_iterate(ObjectClosure* cl, bool visit_referents); // Serviceability void serviceability_initialize(); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zHeapIterator.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zHeapIterator.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zHeapIterator.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zHeapIterator.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -28,6 +28,7 @@ #include "gc/z/zHeapIterator.hpp" #include "gc/z/zOop.inline.hpp" #include "gc/z/zRootsIterator.hpp" +#include "memory/iterator.inline.hpp" #include "oops/oop.inline.hpp" #include "utilities/bitMap.inline.hpp" #include "utilities/stack.inline.hpp" @@ -73,31 +74,37 @@ } }; -class ZHeapIteratorPushOopClosure : public ExtendedOopClosure { +class ZHeapIteratorPushOopClosure : public BasicOopIterateClosure { private: ZHeapIterator* const _iter; const oop _base; + const bool _visit_referents; public: ZHeapIteratorPushOopClosure(ZHeapIterator* iter, oop base) : _iter(iter), - _base(base) {} + _base(base), + _visit_referents(iter->visit_referents()) {} - void do_oop_nv(oop* p) { - const oop obj = HeapAccess::oop_load_at(_base, _base->field_offset(p)); - _iter->push(obj); + oop load_oop(oop* p) { + if (_visit_referents) { + return HeapAccess::oop_load_at(_base, _base->field_offset(p)); + } else { + return HeapAccess<>::oop_load(p); + } } - void do_oop_nv(narrowOop* p) { - ShouldNotReachHere(); + virtual ReferenceIterationMode reference_iteration_mode() { + return _visit_referents ? DO_FIELDS : DO_FIELDS_EXCEPT_REFERENT; } virtual void do_oop(oop* p) { - do_oop_nv(p); + const oop obj = load_oop(p); + _iter->push(obj); } virtual void do_oop(narrowOop* p) { - do_oop_nv(p); + ShouldNotReachHere(); } #ifdef ASSERT @@ -107,9 +114,10 @@ #endif }; -ZHeapIterator::ZHeapIterator() : +ZHeapIterator::ZHeapIterator(bool visit_referents) : _visit_stack(), - _visit_map() {} + _visit_map(), + _visit_referents(visit_referents) {} ZHeapIterator::~ZHeapIterator() { ZVisitMapIterator iter(&_visit_map); @@ -170,12 +178,16 @@ } } +bool ZHeapIterator::visit_referents() const { + return _visit_referents; +} + void ZHeapIterator::objects_do(ObjectClosure* cl) { ZHeapIteratorRootOopClosure root_cl(this, cl); ZRootsIterator roots; // Follow roots. Note that we also visit the JVMTI weak tag map - // as if they where strong roots to make sure we visit all tagged + // as if they were strong roots to make sure we visit all tagged // objects, even those that might now have become unreachable. // If we didn't do this the user would have expected to see // ObjectFree events for unreachable objects in the tag map. diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zHeapIterator.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zHeapIterator.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zHeapIterator.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zHeapIterator.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -42,6 +42,7 @@ ZVisitStack _visit_stack; ZVisitMap _visit_map; + const bool _visit_referents; size_t object_index_max() const; size_t object_index(oop obj) const; @@ -50,8 +51,10 @@ void push(oop obj); void drain(ObjectClosure* cl); + bool visit_referents() const; + public: - ZHeapIterator(); + ZHeapIterator(bool visit_referents); ~ZHeapIterator(); void objects_do(ObjectClosure* cl); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zList.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zList.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zList.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zList.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -29,7 +29,7 @@ template class ZList; -// Element in a double linked list +// Element in a doubly linked list template class ZListNode { friend class ZList; @@ -61,7 +61,7 @@ } }; -// Double-linked list +// Doubly linked list template class ZList { private: diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zLiveMap.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zLiveMap.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zLiveMap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zLiveMap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -73,7 +73,7 @@ // Mark reset contention if (!contention) { - // Count contention once, not every loop + // Count contention once ZStatInc(ZCounterMarkSeqNumResetContention); contention = true; @@ -95,7 +95,7 @@ // Mark reset contention if (!contention) { - // Count contention once, not every loop + // Count contention once ZStatInc(ZCounterMarkSegmentResetContention); contention = true; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zLiveMap.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zLiveMap.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zLiveMap.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zLiveMap.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -97,8 +97,8 @@ inline bool ZLiveMap::get(size_t index) const { BitMap::idx_t segment = index_to_segment(index); - return is_marked() && // Page is marked - is_segment_live(segment) && // Segment is marked + return is_marked() && // Page is marked + is_segment_live(segment) && // Segment is marked _bitmap.at(index); // Object is marked } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zMark.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zMark.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zMark.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zMark.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -37,6 +37,7 @@ #include "gc/z/zUtils.inline.hpp" #include "gc/z/zWorkers.inline.hpp" #include "logging/log.hpp" +#include "memory/iterator.inline.hpp" #include "oops/objArrayOop.inline.hpp" #include "oops/oop.inline.hpp" #include "runtime/atomic.hpp" @@ -397,7 +398,7 @@ } bool ZMark::try_flush(volatile size_t* nflush) { - // Only flush if handhakes are enabled + // Only flush if handshakes are enabled if (!ThreadLocalHandshakes) { return false; } @@ -680,5 +681,5 @@ Threads::threads_do(&cl); // Verify stripe stacks - guarantee(_stripes.is_empty(), "Should be emtpy"); + guarantee(_stripes.is_empty(), "Should be empty"); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zMarkStackEntry.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zMarkStackEntry.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zMarkStackEntry.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zMarkStackEntry.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -77,7 +77,7 @@ public: ZMarkStackEntry() { - // This constructor is intentionally left emtpy and does not initialize + // This constructor is intentionally left empty and does not initialize // _entry to allow it to be optimized out when instantiating ZMarkStack, // which has a long array of ZMarkStackEntry elements, but doesn't care // what _entry is initialized to. diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zObjectAllocator.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zObjectAllocator.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zObjectAllocator.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zObjectAllocator.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -133,14 +133,6 @@ uintptr_t ZObjectAllocator::alloc_small_object_from_nonworker(size_t size, ZAllocationFlags flags) { assert(ZThread::is_java() || ZThread::is_vm(), "Should be a Java or VM thread"); - if (flags.relocation() && flags.java_thread() && UseTLAB) { - // For relocations from Java threads, try TLAB allocation first - const uintptr_t addr = (uintptr_t)Thread::current()->tlab().allocate(ZUtils::bytes_to_words(size)); - if (addr != 0) { - return addr; - } - } - // Non-worker small page allocation can never use the reserve flags.set_no_reserve(); @@ -194,7 +186,6 @@ assert(ZThread::is_java(), "Must be a Java thread"); ZAllocationFlags flags; - flags.set_java_thread(); flags.set_no_reserve(); if (!ZStallOnOutOfMemory) { @@ -213,8 +204,6 @@ if (ZThread::is_worker()) { flags.set_worker_thread(); - } else if (ZThread::is_java()) { - flags.set_java_thread(); } return alloc_object(size, flags); @@ -238,13 +227,6 @@ bool ZObjectAllocator::undo_alloc_small_object_from_nonworker(ZPage* page, uintptr_t addr, size_t size) { assert(page->type() == ZPageTypeSmall, "Invalid page type"); - if (ZThread::is_java()) { - // Try undo allocation in TLAB - if (Thread::current()->tlab().undo_allocate((HeapWord*)addr, ZUtils::bytes_to_words(size))) { - return true; - } - } - // Try atomic undo on shared page return page->undo_alloc_object_atomic(addr, size); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zObjectAllocator.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zObjectAllocator.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zObjectAllocator.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zObjectAllocator.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -40,7 +40,7 @@ ZPage* alloc_page(uint8_t type, size_t size, ZAllocationFlags flags); // Allocate an object in a shared page. Allocate and - // atomically install a new page if neccesary. + // atomically install a new page if necessary. uintptr_t alloc_object_in_shared_page(ZPage** shared_page, uint8_t page_type, size_t page_size, diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zOopClosures.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zOopClosures.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zOopClosures.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zOopClosures.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -40,13 +40,17 @@ p2i(obj), p2i(p)); } -ZVerifyHeapOopClosure::ZVerifyHeapOopClosure(oop base) - : _base(base) {} +OopIterateClosure::ReferenceIterationMode ZVerifyHeapOopClosure::reference_iteration_mode() { + // Don't visit the j.l.Reference.referents for this verification closure, + // since they are cleaned concurrently after ZHeap::mark_end(), and can + // therefore not be verified at this point. + return DO_FIELDS_EXCEPT_REFERENT; +} void ZVerifyHeapOopClosure::do_oop(oop* p) { guarantee(ZHeap::heap()->is_in((uintptr_t)p), "oop* " PTR_FORMAT " not in heap", p2i(p)); - const oop obj = HeapAccess::oop_load_at(_base, _base->field_offset(p)); + const oop obj = RawAccess<>::oop_load(p); z_verify_loaded_object(p, obj); } @@ -54,10 +58,16 @@ ShouldNotReachHere(); } +ZVerifyRootOopClosure::ZVerifyRootOopClosure() { + // This closure should only be used from ZHeap::mark_end(), + // when all roots should have been fixed by the fixup_partial_loads(). + guarantee(ZGlobalPhase == ZPhaseMarkCompleted, "Invalid phase"); +} + void ZVerifyRootOopClosure::do_oop(oop* p) { guarantee(!ZHeap::heap()->is_in((uintptr_t)p), "oop* " PTR_FORMAT " in heap", p2i(p)); - const oop obj = NativeAccess<>::oop_load(p); + const oop obj = RawAccess<>::oop_load(p); z_verify_loaded_object(p, obj); } @@ -66,9 +76,6 @@ } void ZVerifyObjectClosure::do_object(oop o) { - ZVerifyHeapOopClosure cl(o); + ZVerifyHeapOopClosure cl; o->oop_iterate(&cl); } - -// Generate Z specialized oop_oop_iterate functions. -SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_Z(ALL_KLASS_OOP_OOP_ITERATE_DEFN) diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zOopClosures.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zOopClosures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zOopClosures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zOopClosures.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,11 +26,8 @@ #include "memory/iterator.hpp" -class ZLoadBarrierOopClosure : public ExtendedOopClosure { +class ZLoadBarrierOopClosure : public BasicOopIterateClosure { public: - void do_oop_nv(oop* p); - void do_oop_nv(narrowOop* p); - virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); @@ -54,13 +51,10 @@ }; template -class ZMarkBarrierOopClosure : public ExtendedOopClosure { +class ZMarkBarrierOopClosure : public BasicOopIterateClosure { public: ZMarkBarrierOopClosure(); - void do_oop_nv(oop* p); - void do_oop_nv(narrowOop* p); - virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); @@ -88,12 +82,9 @@ virtual void do_oop(narrowOop* p); }; -class ZVerifyHeapOopClosure : public ExtendedOopClosure { -private: - const oop _base; - +class ZVerifyHeapOopClosure : public BasicOopIterateClosure { public: - ZVerifyHeapOopClosure(oop base); + virtual ReferenceIterationMode reference_iteration_mode(); virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); @@ -108,6 +99,8 @@ class ZVerifyRootOopClosure : public OopClosure { public: + ZVerifyRootOopClosure(); + virtual void do_oop(oop* p); virtual void do_oop(narrowOop* p); }; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zOopClosures.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zOopClosures.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zOopClosures.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zOopClosures.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -32,20 +32,12 @@ #include "runtime/atomic.hpp" #include "utilities/debug.hpp" -inline void ZLoadBarrierOopClosure::do_oop_nv(oop* p) { - ZBarrier::load_barrier_on_oop_field(p); -} - -inline void ZLoadBarrierOopClosure::do_oop_nv(narrowOop* p) { - ShouldNotReachHere(); -} - inline void ZLoadBarrierOopClosure::do_oop(oop* p) { - do_oop_nv(p); + ZBarrier::load_barrier_on_oop_field(p); } inline void ZLoadBarrierOopClosure::do_oop(narrowOop* p) { - do_oop_nv(p); + ShouldNotReachHere(); } inline void ZMarkRootOopClosure::do_oop(oop* p) { @@ -66,26 +58,16 @@ template inline ZMarkBarrierOopClosure::ZMarkBarrierOopClosure() : - ExtendedOopClosure(finalizable ? NULL : ZHeap::heap()->reference_discoverer()) {} - -template -inline void ZMarkBarrierOopClosure::do_oop_nv(oop* p) { - ZBarrier::mark_barrier_on_oop_field(p, finalizable); -} - -template -inline void ZMarkBarrierOopClosure::do_oop_nv(narrowOop* p) { - ShouldNotReachHere(); -} + BasicOopIterateClosure(finalizable ? NULL : ZHeap::heap()->reference_discoverer()) {} template inline void ZMarkBarrierOopClosure::do_oop(oop* p) { - do_oop_nv(p); + ZBarrier::mark_barrier_on_oop_field(p, finalizable); } template inline void ZMarkBarrierOopClosure::do_oop(narrowOop* p) { - do_oop_nv(p); + ShouldNotReachHere(); } inline bool ZPhantomIsAliveObjectClosure::do_object_b(oop o) { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zPageAllocator.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zPageAllocator.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zPageAllocator.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zPageAllocator.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -84,11 +84,12 @@ ZPage* const ZPageAllocator::gc_marker = (ZPage*)-1; ZPageAllocator::ZPageAllocator(size_t min_capacity, size_t max_capacity, size_t max_reserve) : + _lock(), _virtual(), _physical(max_capacity, ZPageSizeMin), _cache(), - _pre_mapped(_virtual, _physical, min_capacity), _max_reserve(max_reserve), + _pre_mapped(_virtual, _physical, try_ensure_unused_for_pre_mapped(min_capacity)), _used_high(0), _used_low(0), _used(0), @@ -107,6 +108,10 @@ return _physical.max_capacity(); } +size_t ZPageAllocator::current_max_capacity() const { + return _physical.current_max_capacity(); +} + size_t ZPageAllocator::capacity() const { return _physical.capacity(); } @@ -145,7 +150,7 @@ void ZPageAllocator::increase_used(size_t size, bool relocation) { if (relocation) { // Allocating a page for the purpose of relocation has a - // negative contribution to the number of relcaimed bytes. + // negative contribution to the number of reclaimed bytes. _reclaimed -= size; } _allocated += size; @@ -169,18 +174,43 @@ } } -size_t ZPageAllocator::available(ZAllocationFlags flags) const { - size_t available = max_capacity() - used(); - assert(_physical.available() + _pre_mapped.available() + _cache.available() == available, "Should be equal"); +size_t ZPageAllocator::max_available(bool no_reserve) const { + size_t available = current_max_capacity() - used(); - if (flags.no_reserve()) { - // The memory reserve should not be considered free + if (no_reserve) { + // The reserve should not be considered available available -= MIN2(available, max_reserve()); } return available; } +size_t ZPageAllocator::try_ensure_unused(size_t size, bool no_reserve) { + // Ensure that we always have space available for the reserve. This + // is needed to avoid losing the reserve because of failure to map + // more memory before reaching max capacity. + _physical.try_ensure_unused_capacity(size + max_reserve()); + + size_t unused = _physical.unused_capacity(); + + if (no_reserve) { + // The reserve should not be considered unused + unused -= MIN2(unused, max_reserve()); + } + + return MIN2(size, unused); +} + +size_t ZPageAllocator::try_ensure_unused_for_pre_mapped(size_t size) { + // This function is called during construction, where the + // physical memory manager might have failed to initialied. + if (!_physical.is_initialized()) { + return 0; + } + + return try_ensure_unused(size, true /* no_reserve */); +} + ZPage* ZPageAllocator::create_page(uint8_t type, size_t size) { // Allocate physical memory const ZPhysicalMemory pmem = _physical.alloc(size); @@ -259,8 +289,8 @@ } ZPage* ZPageAllocator::alloc_page_common_inner(uint8_t type, size_t size, ZAllocationFlags flags) { - const size_t available_total = available(flags); - if (available_total < size) { + const size_t max = max_available(flags.no_reserve()); + if (max < size) { // Not enough free memory return NULL; } @@ -281,11 +311,11 @@ // subsequent allocations can use the physical memory. flush_pre_mapped(); - // Check if physical memory is available - const size_t available_physical = _physical.available(); - if (available_physical < size) { + // Try ensure that physical memory is available + const size_t unused = try_ensure_unused(size, flags.no_reserve()); + if (unused < size) { // Flush cache to free up more physical memory - flush_cache(size - available_physical); + flush_cache(size - unused); } // Create new page and allocate physical memory @@ -303,7 +333,7 @@ increase_used(size, flags.relocation()); // Send trace event - ZTracer::tracer()->report_page_alloc(size, used(), available(flags), _cache.available(), flags); + ZTracer::tracer()->report_page_alloc(size, used(), max_available(flags.no_reserve()), _cache.available(), flags); return page; } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zPageAllocator.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zPageAllocator.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zPageAllocator.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zPageAllocator.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,8 +43,8 @@ ZVirtualMemoryManager _virtual; ZPhysicalMemoryManager _physical; ZPageCache _cache; - ZPreMappedMemory _pre_mapped; const size_t _max_reserve; + ZPreMappedMemory _pre_mapped; size_t _used_high; size_t _used_low; size_t _used; @@ -58,7 +58,9 @@ void increase_used(size_t size, bool relocation); void decrease_used(size_t size, bool reclaimed); - size_t available(ZAllocationFlags flags) const; + size_t max_available(bool no_reserve) const; + size_t try_ensure_unused(size_t size, bool no_reserve); + size_t try_ensure_unused_for_pre_mapped(size_t size); ZPage* create_page(uint8_t type, size_t size); void map_page(ZPage* page); @@ -83,6 +85,7 @@ bool is_initialized() const; size_t max_capacity() const; + size_t current_max_capacity() const; size_t capacity() const; size_t max_reserve() const; size_t used_high() const; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zPhysicalMemory.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zPhysicalMemory.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zPhysicalMemory.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zPhysicalMemory.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,7 @@ #include "memory/allocation.inline.hpp" #include "services/memTracker.hpp" #include "utilities/debug.hpp" +#include "utilities/globalDefinitions.hpp" ZPhysicalMemory::ZPhysicalMemory() : _nsegments(0), @@ -93,6 +94,7 @@ ZPhysicalMemoryManager::ZPhysicalMemoryManager(size_t max_capacity, size_t granule_size) : _backing(max_capacity, granule_size), _max_capacity(max_capacity), + _current_max_capacity(max_capacity), _capacity(0), _used(0) {} @@ -100,31 +102,34 @@ return _backing.is_initialized(); } -bool ZPhysicalMemoryManager::ensure_available(size_t size) { - const size_t unused_capacity = _capacity - _used; - if (unused_capacity >= size) { - // Enough unused capacity available - return true; - } - - const size_t expand_with = size - unused_capacity; - const size_t new_capacity = _capacity + expand_with; - if (new_capacity > _max_capacity) { - // Can not expand beyond max capacity - return false; - } +void ZPhysicalMemoryManager::try_ensure_unused_capacity(size_t size) { + const size_t unused = unused_capacity(); + if (unused >= size) { + // Don't try to expand, enough unused capacity available + return; + } + + const size_t current_max = current_max_capacity(); + if (_capacity == current_max) { + // Don't try to expand, current max capacity reached + return; + } + + // Try to expand + const size_t old_capacity = capacity(); + const size_t new_capacity = MIN2(old_capacity + size - unused, current_max); + _capacity = _backing.try_expand(old_capacity, new_capacity); + + if (_capacity != new_capacity) { + // Failed, or partly failed, to expand + log_error(gc, init)("Not enough space available on the backing filesystem to hold the current max"); + log_error(gc, init)("Java heap size (" SIZE_FORMAT "M). Forcefully lowering max Java heap size to " + SIZE_FORMAT "M (%.0lf%%).", current_max / M, _capacity / M, + percent_of(_capacity, current_max)); - // Expand - if (!_backing.expand(_capacity, new_capacity)) { - log_error(gc)("Failed to expand Java heap with " SIZE_FORMAT "%s", - byte_size_in_proper_unit(expand_with), - proper_unit_for_byte_size(expand_with)); - return false; + // Adjust current max capacity to avoid further expand attempts + _current_max_capacity = _capacity; } - - _capacity = new_capacity; - - return true; } void ZPhysicalMemoryManager::nmt_commit(ZPhysicalMemory pmem, uintptr_t offset) { @@ -144,7 +149,7 @@ } ZPhysicalMemory ZPhysicalMemoryManager::alloc(size_t size) { - if (!ensure_available(size)) { + if (unused_capacity() < size) { // Not enough memory available return ZPhysicalMemory(); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zPhysicalMemory.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zPhysicalMemory.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zPhysicalMemory.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zPhysicalMemory.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -70,11 +70,10 @@ private: ZPhysicalMemoryBacking _backing; const size_t _max_capacity; + size_t _current_max_capacity; size_t _capacity; size_t _used; - bool ensure_available(size_t size); - void nmt_commit(ZPhysicalMemory pmem, uintptr_t offset); void nmt_uncommit(ZPhysicalMemory pmem, uintptr_t offset); @@ -84,9 +83,11 @@ bool is_initialized() const; size_t max_capacity() const; + size_t current_max_capacity() const; size_t capacity() const; - size_t used() const; - size_t available() const; + size_t unused_capacity() const; + + void try_ensure_unused_capacity(size_t size); ZPhysicalMemory alloc(size_t size); void free(ZPhysicalMemory pmem); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zPhysicalMemory.inline.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zPhysicalMemory.inline.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zPhysicalMemory.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zPhysicalMemory.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,16 +71,16 @@ return _max_capacity; } -inline size_t ZPhysicalMemoryManager::capacity() const { - return _capacity; +inline size_t ZPhysicalMemoryManager::current_max_capacity() const { + return _current_max_capacity; } -inline size_t ZPhysicalMemoryManager::used() const { - return _used; +inline size_t ZPhysicalMemoryManager::capacity() const { + return _capacity; } -inline size_t ZPhysicalMemoryManager::available() const { - return _max_capacity - _used; +inline size_t ZPhysicalMemoryManager::unused_capacity() const { + return _capacity - _used; } #endif // SHARE_GC_Z_ZPHYSICALMEMORY_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zPreMappedMemory.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zPreMappedMemory.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zPreMappedMemory.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zPreMappedMemory.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,22 +42,26 @@ log_info(gc, init)("Pre-touching: %s", AlwaysPreTouch ? "Enabled" : "Disabled"); log_info(gc, init)("Pre-mapping: " SIZE_FORMAT "M", size / M); - _pmem = pmm.alloc(size); - if (_pmem.is_null()) { - // Out of memory - return; - } + if (size > 0) { + _pmem = pmm.alloc(size); + if (_pmem.is_null()) { + // Out of memory + log_error(gc, init)("Failed to pre-map Java heap (Cannot allocate physical memory)"); + return; + } + + _vmem = vmm.alloc(size, true /* alloc_from_front */); + if (_vmem.is_null()) { + // Out of address space + log_error(gc, init)("Failed to pre-map Java heap (Cannot allocate virtual memory)"); + pmm.free(_pmem); + return; + } - _vmem = vmm.alloc(size, true /* alloc_from_front */); - if (_vmem.is_null()) { - // Out of address space - pmm.free(_pmem); - return; + // Map physical memory + pmm.map(_pmem, _vmem.start()); } - // Map physical memory - pmm.map(_pmem, _vmem.start()); - _initialized = true; } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zRootsIterator.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zRootsIterator.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zRootsIterator.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zRootsIterator.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -244,7 +244,7 @@ virtual void do_thread(Thread* thread) { if (thread->is_Java_thread()) { - // Update thread local adddress bad mask + // Update thread local address bad mask ZThreadLocalData::set_address_bad_mask(thread, ZAddressBadMask); } diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zServiceability.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zServiceability.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zServiceability.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zServiceability.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -149,7 +149,7 @@ ZServiceabilityCountersTracer::ZServiceabilityCountersTracer() { // Nothing to trace with TraceCollectorStats, since ZGC has - // neither a young collector or a full collector. + // neither a young collector nor a full collector. } ZServiceabilityCountersTracer::~ZServiceabilityCountersTracer() { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/z_specialized_oop_closures.hpp openjdk-11-11~24/src/hotspot/share/gc/z/z_specialized_oop_closures.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/z_specialized_oop_closures.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/z_specialized_oop_closures.hpp 1970-01-01 00:00:00.000000000 +0000 @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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_GC_Z_Z_SPECIALIZED_OOP_CLOSURES_HPP -#define SHARE_GC_Z_Z_SPECIALIZED_OOP_CLOSURES_HPP - -class ZLoadBarrierOopClosure; -template class ZMarkBarrierOopClosure; - -#define SPECIALIZED_OOP_OOP_ITERATE_CLOSURES_Z(f) \ - f(ZLoadBarrierOopClosure,_nv) \ - f(ZMarkBarrierOopClosure,_nv) \ - f(ZMarkBarrierOopClosure,_nv) - -#endif // SHARE_GC_Z_Z_SPECIALIZED_OOP_CLOSURES_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zStat.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zStat.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zStat.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zStat.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -482,7 +482,7 @@ } // -// Stat MMU (Mimimum Mutator Utilization) +// Stat MMU (Minimum Mutator Utilization) // ZStatMMUPause::ZStatMMUPause() : _start(0.0), @@ -560,9 +560,8 @@ } void ZStatMMU::print() { - log_info(gc, mmu)( - "MMU: 2ms/%.1f%%, 5ms/%.1f%%, 10ms/%.1f%%, 20ms/%.1f%%, 50ms/%.1f%%, 100ms/%.1f%%", - _mmu_2ms, _mmu_5ms, _mmu_10ms, _mmu_20ms, _mmu_50ms, _mmu_100ms); + log_info(gc, mmu)("MMU: 2ms/%.1f%%, 5ms/%.1f%%, 10ms/%.1f%%, 20ms/%.1f%%, 50ms/%.1f%%, 100ms/%.1f%%", + _mmu_2ms, _mmu_5ms, _mmu_10ms, _mmu_20ms, _mmu_50ms, _mmu_100ms); } // @@ -623,7 +622,7 @@ } #define ZUSED_FMT SIZE_FORMAT "M(%.0lf%%)" -#define ZUSED_ARGS(size, max_capacity) ((size) / M), (percent_of(size, max_capacity)) +#define ZUSED_ARGS(size, max_capacity) ((size) / M), (percent_of(size, max_capacity)) void ZStatPhaseCycle::register_end(const Ticks& start, const Ticks& end) const { timer()->register_gc_end(end); @@ -641,6 +640,7 @@ ZStatMark::print(); ZStatRelocation::print(); ZStatNMethods::print(); + ZStatMetaspace::print(); ZStatReferences::print(); ZStatHeap::print(); @@ -1129,6 +1129,19 @@ } // +// Stat metaspace +// +void ZStatMetaspace::print() { + log_info(gc, metaspace)("Metaspace: " + SIZE_FORMAT "M used, " SIZE_FORMAT "M capacity, " + SIZE_FORMAT "M committed, " SIZE_FORMAT "M reserved", + MetaspaceUtils::used_bytes() / M, + MetaspaceUtils::capacity_bytes() / M, + MetaspaceUtils::committed_bytes() / M, + MetaspaceUtils::reserved_bytes() / M); +} + +// // Stat references // ZStatReferences::ZCount ZStatReferences::_soft; @@ -1187,7 +1200,7 @@ #define ZSIZE_NA "%9s", "-" #define ZSIZE_ARGS(size) SIZE_FORMAT_W(8) "M (%.0lf%%)", \ - ((size) / M), (percent_of(size, _at_initialize.max_capacity)) + ((size) / M), (percent_of(size, _at_initialize.max_capacity)) size_t ZStatHeap::available(size_t used) { return _at_initialize.max_capacity - used; diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zStat.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zStat.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zStat.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zStat.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -156,7 +156,7 @@ }; // -// Stat MMU (Mimimum Mutator Utilization) +// Stat MMU (Minimum Mutator Utilization) // class ZStatMMUPause { private: @@ -405,6 +405,14 @@ public: static void print(); }; + +// +// Stat metaspace +// +class ZStatMetaspace : public AllStatic { +public: + static void print(); +}; // // Stat references diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zTracer.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zTracer.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zTracer.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zTracer.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -28,6 +28,44 @@ #include "gc/shared/gcLocker.hpp" #include "jfr/jfrEvents.hpp" #include "runtime/safepointVerifiers.hpp" +#if INCLUDE_JFR +#include "jfr/metadata/jfrSerializer.hpp" +#endif + +#if INCLUDE_JFR +class ZStatisticsCounterTypeConstant : public JfrSerializer { +public: + virtual void serialize(JfrCheckpointWriter& writer) { + writer.write_count(ZStatCounter::count()); + for (ZStatCounter* counter = ZStatCounter::first(); counter != NULL; counter = counter->next()) { + writer.write_key(counter->id()); + writer.write(counter->name()); + } + } +}; + +class ZStatisticsSamplerTypeConstant : public JfrSerializer { +public: + virtual void serialize(JfrCheckpointWriter& writer) { + writer.write_count(ZStatSampler::count()); + for (ZStatSampler* sampler = ZStatSampler::first(); sampler != NULL; sampler = sampler->next()) { + writer.write_key(sampler->id()); + writer.write(sampler->name()); + } + } +}; + +static void register_jfr_type_serializers() { + JfrSerializer::register_serializer(TYPE_ZSTATISTICSCOUNTERTYPE, + false /* require_safepoint */, + true /* permit_cache */, + new ZStatisticsCounterTypeConstant()); + JfrSerializer::register_serializer(TYPE_ZSTATISTICSSAMPLERTYPE, + false /* require_safepoint */, + true /* permit_cache */, + new ZStatisticsSamplerTypeConstant()); +} +#endif ZTracer* ZTracer::_tracer = NULL; @@ -35,7 +73,9 @@ GCTracer(Z) {} void ZTracer::initialize() { + assert(_tracer == NULL, "Already initialized"); _tracer = new (ResourceObj::C_HEAP, mtGC) ZTracer(); + JFR_ONLY(register_jfr_type_serializers()); } void ZTracer::send_stat_counter(uint32_t counter_id, uint64_t increment, uint64_t value) { diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zUtils.hpp openjdk-11-11~24/src/hotspot/share/gc/z/zUtils.hpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zUtils.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zUtils.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -35,7 +35,7 @@ static size_t round_up_power_of_2(size_t value); static size_t round_down_power_of_2(size_t value); - // Size convertion + // Size conversion static size_t bytes_to_words(size_t size_in_words); static size_t words_to_bytes(size_t size_in_words); diff -Nru openjdk-11-11~19/src/hotspot/share/gc/z/zWorkers.cpp openjdk-11-11~24/src/hotspot/share/gc/z/zWorkers.cpp --- openjdk-11-11~19/src/hotspot/share/gc/z/zWorkers.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/gc/z/zWorkers.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -44,7 +44,7 @@ uint ZWorkers::calculate_nconcurrent() { // Use 12.5% of the CPUs, rounded up. The number of concurrent threads we // would like to use heavily depends on the type of workload we are running. - // Using too many threads will have a nagative impact on the application + // Using too many threads will have a negative impact on the application // throughput, while using too few threads will prolong the GC-cycle and // we then risk being out-run by the application. Using 12.5% of the active // processors appears to be a fairly good balance. diff -Nru openjdk-11-11~19/src/hotspot/share/include/jvm.h openjdk-11-11~24/src/hotspot/share/include/jvm.h --- openjdk-11-11~19/src/hotspot/share/include/jvm.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/include/jvm.h 2018-07-25 15:36:46.000000000 +0000 @@ -522,6 +522,17 @@ JNIEXPORT jint JNICALL JVM_GetClassAccessFlags(JNIEnv *env, jclass cls); +/* Nestmates - since JDK 11 */ + +JNIEXPORT jboolean JNICALL +JVM_AreNestMates(JNIEnv *env, jclass current, jclass member); + +JNIEXPORT jclass JNICALL +JVM_GetNestHost(JNIEnv *env, jclass current); + +JNIEXPORT jobjectArray JNICALL +JVM_GetNestMembers(JNIEnv *env, jclass current); + /* The following two reflection routines are still needed due to startup time issues */ /* * java.lang.reflect.Method diff -Nru openjdk-11-11~19/src/hotspot/share/interpreter/bytecodeInterpreter.cpp openjdk-11-11~24/src/hotspot/share/interpreter/bytecodeInterpreter.cpp --- openjdk-11-11~19/src/hotspot/share/interpreter/bytecodeInterpreter.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/interpreter/bytecodeInterpreter.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2524,11 +2524,9 @@ istate->set_msg(call_method); // Special case of invokeinterface called for virtual method of - // java.lang.Object. See cpCacheOop.cpp for details. - // This code isn't produced by javac, but could be produced by - // another compliant java compiler. + // java.lang.Object. See cpCache.cpp for details. + Method* callee = NULL; if (cache->is_forced_virtual()) { - Method* callee; CHECK_NULL(STACK_OBJECT(-(cache->parameter_size()))); if (cache->is_vfinal()) { callee = cache->f2_as_vfinal_method(); @@ -2545,6 +2543,29 @@ // Profile 'special case of invokeinterface' virtual call. BI_PROFILE_UPDATE_VIRTUALCALL(rcvrKlass); } + } else if (cache->is_vfinal()) { + // private interface method invocations + // + // Ensure receiver class actually implements + // the resolved interface class. The link resolver + // does this, but only for the first time this + // interface is being called. + int parms = cache->parameter_size(); + oop rcvr = STACK_OBJECT(-parms); + CHECK_NULL(rcvr); + Klass* recv_klass = rcvr->klass(); + Klass* resolved_klass = cache->f1_as_klass(); + if (!recv_klass->is_subtype_of(resolved_klass)) { + ResourceMark rm(THREAD); + char buf[200]; + jio_snprintf(buf, sizeof(buf), "Class %s does not implement the requested interface %s", + recv_klass->external_name(), + resolved_klass->external_name()); + VM_JAVA_ERROR(vmSymbols::java_lang_IncompatibleClassChangeError(), buf, note_no_trap); + } + callee = cache->f2_as_vfinal_method(); + } + if (callee != NULL) { istate->set_callee(callee); istate->set_callee_entry_point(callee->from_interpreted_entry()); #ifdef VM_JVMTI @@ -2557,7 +2578,6 @@ } // this could definitely be cleaned up QQQ - Method* callee; Method *interface_method = cache->f2_as_interface_method(); InstanceKlass* iclass = interface_method->method_holder(); diff -Nru openjdk-11-11~19/src/hotspot/share/interpreter/linkResolver.cpp openjdk-11-11~24/src/hotspot/share/interpreter/linkResolver.cpp --- openjdk-11-11~19/src/hotspot/share/interpreter/linkResolver.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/interpreter/linkResolver.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -218,7 +218,7 @@ fatal("Unexpected call kind %d", call_kind()); } } -#endif //ASSERT +#endif // ASSERT #ifndef PRODUCT void CallInfo::print() { @@ -294,7 +294,7 @@ base_klass = ObjArrayKlass::cast(sel_klass)->bottom_klass(); } // The element type could be a typeArray - we only need the access - // check if it is an reference to another class. + // check if it is a reference to another class. if (!base_klass->is_instance_klass()) { return; // no relevant check to do } @@ -306,13 +306,17 @@ char* msg = Reflection::verify_class_access_msg(ref_klass, InstanceKlass::cast(base_klass), vca_result); + bool same_module = (base_klass->module() == ref_klass->module()); if (msg == NULL) { Exceptions::fthrow( THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalAccessError(), - "failed to access class %s from class %s", + "failed to access class %s from class %s (%s%s%s)", base_klass->external_name(), - ref_klass->external_name()); + ref_klass->external_name(), + (same_module) ? base_klass->joint_in_module_of_loader(ref_klass) : base_klass->class_in_module_of_loader(), + (same_module) ? "" : "; ", + (same_module) ? "" : ref_klass->class_in_module_of_loader()); } else { // Use module specific message returned by verify_class_access_msg(). Exceptions::fthrow( @@ -387,12 +391,13 @@ // Looks up method in classes, then looks up local default methods methodHandle LinkResolver::lookup_instance_method_in_klasses(Klass* klass, Symbol* name, - Symbol* signature, TRAPS) { - Method* result = klass->uncached_lookup_method(name, signature, Klass::find_overpass); + Symbol* signature, + Klass::PrivateLookupMode private_mode, TRAPS) { + Method* result = klass->uncached_lookup_method(name, signature, Klass::find_overpass, private_mode); while (result != NULL && result->is_static() && result->method_holder()->super() != NULL) { Klass* super_klass = result->method_holder()->super(); - result = super_klass->uncached_lookup_method(name, signature, Klass::find_overpass); + result = super_klass->uncached_lookup_method(name, signature, Klass::find_overpass, private_mode); } if (klass->is_array_klass()) { @@ -582,20 +587,30 @@ } // assert(extra_arg_result_or_null != NULL, "must be able to return extra argument"); - if (!Reflection::verify_field_access(ref_klass, - resolved_klass, - sel_klass, - flags, - true)) { + bool can_access = Reflection::verify_member_access(ref_klass, + resolved_klass, + sel_klass, + flags, + true, false, CHECK); + // Any existing exceptions that may have been thrown, for example LinkageErrors + // from nest-host resolution, have been allowed to propagate. + if (!can_access) { ResourceMark rm(THREAD); + bool same_module = (sel_klass->module() == ref_klass->module()); Exceptions::fthrow( THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalAccessError(), - "tried to access method %s.%s%s from class %s", + "class %s tried to access %s%s%smethod %s.%s%s (%s%s%s)", + ref_klass->external_name(), + sel_method->is_abstract() ? "abstract " : "", + sel_method->is_protected() ? "protected " : "", + sel_method->is_private() ? "private " : "", sel_klass->external_name(), sel_method->name()->as_C_string(), sel_method->signature()->as_C_string(), - ref_klass->external_name() + (same_module) ? ref_klass->joint_in_module_of_loader(sel_klass) : ref_klass->class_in_module_of_loader(), + (same_module) ? "" : "; ", + (same_module) ? "" : sel_klass->class_in_module_of_loader() ); return; } @@ -757,7 +772,7 @@ nested_exception, NULL); } - // 5. access checks, access checking may be turned off when calling from within the VM. + // 6. access checks, access checking may be turned off when calling from within the VM. Klass* current_klass = link_info.current_klass(); if (link_info.check_access()) { assert(current_klass != NULL , "current_klass should not be null"); @@ -773,6 +788,24 @@ check_method_loader_constraints(link_info, resolved_method, "method", CHECK_NULL); } + // For private method invocation we should only find the method in the resolved class. + // If that is not the case then we have a found a supertype method that we have nestmate + // access to. + if (resolved_method->is_private() && resolved_method->method_holder() != resolved_klass) { + ResourceMark rm(THREAD); + DEBUG_ONLY(bool is_nestmate = InstanceKlass::cast(link_info.current_klass())->has_nestmate_access_to(InstanceKlass::cast(resolved_klass), THREAD);) + assert(is_nestmate, "was only expecting nestmates to get here!"); + Exceptions::fthrow( + THREAD_AND_LOCATION, + vmSymbols::java_lang_NoSuchMethodError(), + "%s: method %s%s not found", + resolved_klass->external_name(), + resolved_method->name()->as_C_string(), + resolved_method->signature()->as_C_string() + ); + return NULL; + } + return resolved_method; } @@ -874,19 +907,6 @@ THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - if (code == Bytecodes::_invokeinterface && resolved_method->is_private()) { - ResourceMark rm(THREAD); - char buf[200]; - - Klass* current_klass = link_info.current_klass(); - jio_snprintf(buf, sizeof(buf), "private interface method requires invokespecial, not invokeinterface: method %s, caller-class:%s", - Method::name_and_sig_as_C_string(resolved_klass, - resolved_method->name(), - resolved_method->signature()), - (current_klass == NULL ? "" : current_klass->internal_name())); - THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); - } - if (log_develop_is_enabled(Trace, itables)) { char buf[200]; jio_snprintf(buf, sizeof(buf), "%s resolved interface method: caller-class:", @@ -906,19 +926,28 @@ Klass* sel_klass, const fieldDescriptor& fd, TRAPS) { - if (!Reflection::verify_field_access(ref_klass, - resolved_klass, - sel_klass, - fd.access_flags(), - true)) { + bool can_access = Reflection::verify_member_access(ref_klass, + resolved_klass, + sel_klass, + fd.access_flags(), + true, false, CHECK); + // Any existing exceptions that may have been thrown, for example LinkageErrors + // from nest-host resolution, have been allowed to propagate. + if (!can_access) { + bool same_module = (sel_klass->module() == ref_klass->module()); ResourceMark rm(THREAD); Exceptions::fthrow( THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalAccessError(), - "tried to access field %s.%s from class %s", + "class %s tried to access %s%sfield %s.%s (%s%s%s)", + ref_klass->external_name(), + fd.is_protected() ? "protected " : "", + fd.is_private() ? "private " : "", sel_klass->external_name(), fd.name()->as_C_string(), - ref_klass->external_name() + (same_module) ? ref_klass->joint_in_module_of_loader(sel_klass) : ref_klass->class_in_module_of_loader(), + (same_module) ? "" : "; ", + (same_module) ? "" : sel_klass->class_in_module_of_loader() ); return; } @@ -1128,7 +1157,8 @@ return NULL; } - // check if invokespecial's interface method reference is in an indirect superinterface + // ensure that invokespecial's interface method reference is in + // a direct superinterface, not an indirect superinterface Klass* current_klass = link_info.current_klass(); if (current_klass != NULL && resolved_klass->is_interface()) { InstanceKlass* ck = InstanceKlass::cast(current_klass); @@ -1146,8 +1176,8 @@ jio_snprintf(buf, sizeof(buf), "Interface method reference: %s, is in an indirect superinterface of %s", Method::name_and_sig_as_C_string(resolved_klass, - resolved_method->name(), - resolved_method->signature()), + resolved_method->name(), + resolved_method->signature()), current_klass->external_name()); THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } @@ -1192,7 +1222,7 @@ resolved_method->name() != vmSymbols::object_initializer_name()) { // check if this is an old-style super call and do a new lookup if so - // a) check if ACC_SUPER flag is set for the current class + // a) check if ACC_SUPER flag is set for the current class Klass* current_klass = link_info.current_klass(); if ((current_klass->is_super() || !AllowNonVirtualCalls) && // b) check if the class of the resolved_klass is a superclass @@ -1200,12 +1230,14 @@ // This check is not performed for super.invoke for interface methods // in super interfaces. current_klass->is_subclass_of(resolved_klass) && - current_klass != resolved_klass) { + current_klass != resolved_klass + ) { // Lookup super method Klass* super_klass = current_klass->super(); sel_method = lookup_instance_method_in_klasses(super_klass, - resolved_method->name(), - resolved_method->signature(), CHECK); + resolved_method->name(), + resolved_method->signature(), + Klass::find_private, CHECK); // check if found if (sel_method.is_null()) { ResourceMark rm(THREAD); @@ -1356,11 +1388,12 @@ // a default or miranda method; therefore, it must have a valid vtable index. assert(!resolved_method->has_itable_index(), ""); vtable_index = resolved_method->vtable_index(); - // We could get a negative vtable_index for final methods, - // because as an optimization they are never put in the vtable, - // unless they override an existing method. - // If we do get a negative, it means the resolved method is the the selected - // method, and it can never be changed by an override. + // We could get a negative vtable_index of nonvirtual_vtable_index for private + // methods, or for final methods. Private methods never appear in the vtable + // and never override other methods. As an optimization, final methods are + // never put in the vtable, unless they override an existing method. + // So if we do get nonvirtual_vtable_index, it means the selected method is the + // resolved method, and it can never be changed by an override. if (vtable_index == Method::nonvirtual_vtable_index) { assert(resolved_method->can_be_statically_bound(), "cannot override this method"); selected_method = resolved_method; @@ -1415,6 +1448,7 @@ Handle recv, Klass* recv_klass, bool check_null_and_abstract, TRAPS) { + // check if receiver exists if (check_null_and_abstract && recv.is_null()) { THROW(vmSymbols::java_lang_NullPointerException()); @@ -1430,35 +1464,43 @@ THROW_MSG(vmSymbols::java_lang_IncompatibleClassChangeError(), buf); } - // do lookup based on receiver klass - // This search must match the linktime preparation search for itable initialization - // to correctly enforce loader constraints for interface method inheritance - methodHandle selected_method = lookup_instance_method_in_klasses(recv_klass, - resolved_method->name(), - resolved_method->signature(), CHECK); - if (selected_method.is_null() && !check_null_and_abstract) { - // In theory this is a harmless placeholder value, but - // in practice leaving in null affects the nsk default method tests. - // This needs further study. - selected_method = resolved_method; - } - // check if method exists - if (selected_method.is_null()) { - // Pass arguments for generating a verbose error message. - throw_abstract_method_error(resolved_method, recv_klass, CHECK); - } - // check access - // Throw Illegal Access Error if selected_method is not public. - if (!selected_method->is_public()) { - ResourceMark rm(THREAD); - THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), - Method::name_and_sig_as_C_string(recv_klass, - selected_method->name(), - selected_method->signature())); - } - // check if abstract - if (check_null_and_abstract && selected_method->is_abstract()) { - throw_abstract_method_error(resolved_method, selected_method, recv_klass, CHECK); + methodHandle selected_method = resolved_method; + + // resolve the method in the receiver class, unless it is private + if (!resolved_method()->is_private()) { + // do lookup based on receiver klass + // This search must match the linktime preparation search for itable initialization + // to correctly enforce loader constraints for interface method inheritance. + // Private methods are skipped as the resolved method was not private. + selected_method = lookup_instance_method_in_klasses(recv_klass, + resolved_method->name(), + resolved_method->signature(), + Klass::skip_private, CHECK); + + if (selected_method.is_null() && !check_null_and_abstract) { + // In theory this is a harmless placeholder value, but + // in practice leaving in null affects the nsk default method tests. + // This needs further study. + selected_method = resolved_method; + } + // check if method exists + if (selected_method.is_null()) { + // Pass arguments for generating a verbose error message. + throw_abstract_method_error(resolved_method, recv_klass, CHECK); + } + // check access + // Throw Illegal Access Error if selected_method is not public. + if (!selected_method->is_public()) { + ResourceMark rm(THREAD); + THROW_MSG(vmSymbols::java_lang_IllegalAccessError(), + Method::name_and_sig_as_C_string(recv_klass, + selected_method->name(), + selected_method->signature())); + } + // check if abstract + if (check_null_and_abstract && selected_method->is_abstract()) { + throw_abstract_method_error(resolved_method, selected_method, recv_klass, CHECK); + } } if (log_develop_is_enabled(Trace, itables)) { @@ -1466,13 +1508,25 @@ recv_klass, resolved_klass, selected_method, true); } // setup result - if (!resolved_method->has_itable_index()) { + if (resolved_method->has_vtable_index()) { int vtable_index = resolved_method->vtable_index(); + log_develop_trace(itables)(" -- vtable index: %d", vtable_index); assert(vtable_index == selected_method->vtable_index(), "sanity check"); result.set_virtual(resolved_klass, recv_klass, resolved_method, selected_method, vtable_index, CHECK); - } else { + } else if (resolved_method->has_itable_index()) { int itable_index = resolved_method()->itable_index(); + log_develop_trace(itables)(" -- itable index: %d", itable_index); result.set_interface(resolved_klass, recv_klass, resolved_method, selected_method, itable_index, CHECK); + } else { + int index = resolved_method->vtable_index(); + log_develop_trace(itables)(" -- non itable/vtable index: %d", index); + assert(index == Method::nonvirtual_vtable_index, "Oops hit another case!"); + assert(resolved_method()->is_private() || + (resolved_method()->is_final() && resolved_method->method_holder() == SystemDictionary::Object_klass()), + "Should only have non-virtual invokeinterface for private or final-Object methods!"); + assert(resolved_method()->can_be_statically_bound(), "Should only have non-virtual invokeinterface for statically bound methods!"); + // This sets up the nonvirtual form of "virtual" call (as needed for final and private methods) + result.set_virtual(resolved_klass, resolved_klass, resolved_method, resolved_method, index, CHECK); } } diff -Nru openjdk-11-11~19/src/hotspot/share/interpreter/linkResolver.hpp openjdk-11-11~24/src/hotspot/share/interpreter/linkResolver.hpp --- openjdk-11-11~19/src/hotspot/share/interpreter/linkResolver.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/interpreter/linkResolver.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -211,8 +211,8 @@ Handle *method_type_result, TRAPS); JVMCI_ONLY(public:) // Needed for CompilerToVM.resolveMethod() // Not Linktime so doesn't take LinkInfo - static methodHandle lookup_instance_method_in_klasses ( - Klass* klass, Symbol* name, Symbol* signature, TRAPS); + static methodHandle lookup_instance_method_in_klasses (Klass* klass, Symbol* name, Symbol* signature, + Klass::PrivateLookupMode private_mode, TRAPS); JVMCI_ONLY(private:) // Similar loader constraint checking functions that throw diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp openjdk-11-11~24/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/dcmd/jfrDcmds.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -179,11 +179,19 @@ JfrDumpFlightRecordingDCmd::JfrDumpFlightRecordingDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), - _name("name", "Recording name, e.g. \\\"My Recording\\\"", "STRING", true, NULL), - _filename("filename", "Copy recording data to file, i.e \\\"" JFR_FILENAME_EXAMPLE "\\\"", "STRING", true), + _name("name", "Recording name, e.g. \\\"My Recording\\\"", "STRING", false, NULL), + _filename("filename", "Copy recording data to file, e.g. \\\"" JFR_FILENAME_EXAMPLE "\\\"", "STRING", false), + _maxage("maxage", "Maximum duration to dump, in (s)econds, (m)inutes, (h)ours, or (d)ays, e.g. 60m, or 0 for no limit", "NANOTIME", false, "0"), + _maxsize("maxsize", "Maximum amount of bytes to dump, in (M)B or (G)B, e.g. 500M, or 0 for no limit", "MEMORY SIZE", false, "0"), + _begin("begin", "Point in time to dump data from, e.g. 09:00, 21:35:00, 2018-06-03T18:12:56.827Z, 2018-06-03T20:13:46.832, -10m, -3h, or -1d", "STRING", false), + _end("end", "Point in time to dump data to, e.g. 09:00, 21:35:00, 2018-06-03T18:12:56.827Z, 2018-06-03T20:13:46.832, -10m, -3h, or -1d", "STRING", false), _path_to_gc_roots("path-to-gc-roots", "Collect path to GC roots", "BOOLEAN", false, "false") { _dcmdparser.add_dcmd_option(&_name); _dcmdparser.add_dcmd_option(&_filename); + _dcmdparser.add_dcmd_option(&_maxage); + _dcmdparser.add_dcmd_option(&_maxsize); + _dcmdparser.add_dcmd_option(&_begin); + _dcmdparser.add_dcmd_option(&_end); _dcmdparser.add_dcmd_option(&_path_to_gc_roots); }; @@ -225,6 +233,26 @@ filepath = JfrJavaSupport::new_string(_filename.value(), CHECK); } + jobject maxage = NULL; + if (_maxage.is_set()) { + maxage = JfrJavaSupport::new_java_lang_Long(_maxage.value()._nanotime, CHECK); + } + + jobject maxsize = NULL; + if (_maxsize.is_set()) { + maxsize = JfrJavaSupport::new_java_lang_Long(_maxsize.value()._size, CHECK); + } + + jstring begin = NULL; + if (_begin.is_set() && _begin.value() != NULL) { + begin = JfrJavaSupport::new_string(_begin.value(), CHECK); + } + + jstring end = NULL; + if (_end.is_set() && _end.value() != NULL) { + end = JfrJavaSupport::new_string(_end.value(), CHECK); + } + jobject path_to_gc_roots = NULL; if (_path_to_gc_roots.is_set()) { path_to_gc_roots = JfrJavaSupport::new_java_lang_Boolean(_path_to_gc_roots.value(), CHECK); @@ -232,7 +260,7 @@ static const char klass[] = "jdk/jfr/internal/dcmd/DCmdDump"; static const char method[] = "execute"; - static const char signature[] = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Ljava/lang/String;"; + static const char signature[] = "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Long;Ljava/lang/Long;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Boolean;)Ljava/lang/String;"; JfrJavaArguments execute_args(&result, klass, method, signature, CHECK); execute_args.set_receiver(h_dcmd_instance); @@ -240,6 +268,10 @@ // arguments execute_args.push_jobject(name); execute_args.push_jobject(filepath); + execute_args.push_jobject(maxage); + execute_args.push_jobject(maxsize); + execute_args.push_jobject(begin); + execute_args.push_jobject(end); execute_args.push_jobject(path_to_gc_roots); JfrJavaSupport::call_virtual(&execute_args, THREAD); @@ -247,7 +279,7 @@ } JfrCheckFlightRecordingDCmd::JfrCheckFlightRecordingDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), - _name("name","Recording text, e.g. \\\"My Recording\\\" or omit to see all recordings","STRING",false, NULL), + _name("name","Recording name, e.g. \\\"My Recording\\\" or omit to see all recordings","STRING",false, NULL), _verbose("verbose","Print event settings for the recording(s)","BOOLEAN", false, "false") { _dcmdparser.add_dcmd_option(&_name); diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp openjdk-11-11~24/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/dcmd/jfrDcmds.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,10 @@ protected: DCmdArgument _name; DCmdArgument _filename; + DCmdArgument _maxage; + DCmdArgument _maxsize; + DCmdArgument _begin; + DCmdArgument _end; DCmdArgument _path_to_gc_roots; public: diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/jfr.cpp openjdk-11-11~24/src/hotspot/share/jfr/jfr.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/jfr.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/jfr.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,10 +26,10 @@ #include "jfr/jfr.hpp" #include "jfr/leakprofiler/leakProfiler.hpp" #include "jfr/periodic/sampling/jfrThreadSampler.hpp" -#include "jfr/recorder/service/jfrOptionSet.hpp" #include "jfr/recorder/jfrRecorder.hpp" #include "jfr/recorder/checkpoint/jfrCheckpointManager.hpp" #include "jfr/recorder/repository/jfrEmergencyDump.hpp" +#include "jfr/recorder/service/jfrOptionSet.hpp" #include "jfr/support/jfrThreadLocal.hpp" #include "runtime/java.hpp" @@ -64,9 +64,7 @@ } void Jfr::on_thread_exit(JavaThread* thread) { - if (JfrRecorder::is_recording()) { - JfrThreadLocal::on_exit(thread); - } + JfrThreadLocal::on_exit(thread); } void Jfr::on_thread_destruct(Thread* thread) { @@ -85,12 +83,12 @@ LeakProfiler::oops_do(is_alive, f); } -bool Jfr::on_start_flight_recording_option(const JavaVMOption** option, char* tail) { - return JfrOptionSet::parse_start_flight_recording_option(option, tail); +bool Jfr::on_flight_recorder_option(const JavaVMOption** option, char* delimiter) { + return JfrOptionSet::parse_flight_recorder_option(option, delimiter); } -bool Jfr::on_flight_recorder_option(const JavaVMOption** option, char* tail) { - return JfrOptionSet::parse_flight_recorder_option(option, tail); +bool Jfr::on_start_flight_recording_option(const JavaVMOption** option, char* delimiter) { + return JfrOptionSet::parse_start_flight_recording_option(option, delimiter); } Thread* Jfr::sampler_thread() { diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/jfr.hpp openjdk-11-11~24/src/hotspot/share/jfr/jfr.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/jfr.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/jfr.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -49,8 +49,8 @@ static void on_thread_exit(JavaThread* thread); static void on_thread_destruct(Thread* thread); static void on_vm_shutdown(bool exception_handler = false); - static bool on_start_flight_recording_option(const JavaVMOption** option, char* tail); - static bool on_flight_recorder_option(const JavaVMOption** option, char* tail); + 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 weak_oops_do(BoolObjectClosure* is_alive, OopClosure* f); static Thread* sampler_thread(); }; diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ #include "jfr/leakprofiler/utilities/granularTimer.hpp" #include "jfr/leakprofiler/utilities/unifiedOop.hpp" #include "logging/log.hpp" +#include "memory/iterator.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/access.inline.hpp" #include "oops/oop.inline.hpp" diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.hpp openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/bfsClosure.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,7 @@ class EdgeQueue; // Class responsible for iterating the heap breadth-first -class BFSClosure : public ExtendedOopClosure { +class BFSClosure : public BasicOopIterateClosure { private: EdgeQueue* _edge_queue; EdgeStore* _edge_store; diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ #include "jfr/leakprofiler/utilities/unifiedOop.hpp" #include "jfr/leakprofiler/utilities/rootType.hpp" #include "jfr/leakprofiler/chains/rootSetClosure.hpp" +#include "memory/iterator.inline.hpp" #include "memory/resourceArea.hpp" #include "oops/access.inline.hpp" #include "oops/oop.inline.hpp" diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/dfsClosure.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,7 @@ class EdgeQueue; // Class responsible for iterating the heap depth-first -class DFSClosure: public ExtendedOopClosure { +class DFSClosure: public BasicOopIterateClosure { private: static EdgeStore* _edge_store; static BitSet* _mark_bits; diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.hpp openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/chains/rootSetClosure.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -30,7 +30,7 @@ class EdgeQueue; -class RootSetClosure: public ExtendedOopClosure { +class RootSetClosure: public BasicOopIterateClosure { private: RootSetClosure(EdgeQueue* edge_queue); EdgeQueue* _edge_queue; diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/emitEventOperation.cpp openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/emitEventOperation.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/emitEventOperation.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/emitEventOperation.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -216,6 +216,7 @@ e.set_starttime(GranularTimer::start_time()); e.set_endtime(GranularTimer::end_time()); e.set_allocationTime(sample->allocation_time()); + e.set_lastKnownHeapUsage(sample->heap_used_at_last_gc()); e.set_object(object_id); e.set_arrayElements(array_size(*object_addr)); e.set_root(gc_root_id); diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/sampling/objectSample.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -53,6 +53,7 @@ int _index; size_t _span; size_t _allocated; + size_t _heap_used_at_last_gc; unsigned int _stack_trace_hash; bool _dead; @@ -88,6 +89,7 @@ _index(0), _span(0), _allocated(0), + _heap_used_at_last_gc(0), _stack_trace_hash(0), _dead(false) {} @@ -164,6 +166,14 @@ _allocation_time = Ticks(time.value()); } + void set_heap_used_at_last_gc(size_t heap_used) { + _heap_used_at_last_gc = heap_used; + } + + size_t heap_used_at_last_gc() const { + return _heap_used_at_last_gc; + } + bool has_stack_trace() const { return stack_trace_id() != 0; } diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/sampling/objectSampler.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ #include "jfr/recorder/stacktrace/jfrStackTraceRepository.hpp" #include "jfr/support/jfrThreadLocal.hpp" #include "jfr/utilities/jfrTryLock.hpp" +#include "logging/log.hpp" +#include "memory/universe.hpp" #include "oops/oop.inline.hpp" #include "runtime/thread.hpp" -#include "logging/log.hpp" ObjectSampler::ObjectSampler(size_t size) : _priority_queue(new SamplePriorityQueue(size)), @@ -73,8 +74,6 @@ thread->jfr_thread_local()->set_cached_stack_trace_id(stack_trace_id, stack_trace_hash); } - const JfrTicks allocation_time = JfrTicks::now(); - JfrTryLock tryLock(&_tryLock); if (!tryLock.has_lock()) { log_trace(jfr, oldobject, sampling)("Skipping old object sample due to lock contention"); @@ -114,7 +113,8 @@ sample->set_span(allocated); sample->set_object((oop)obj); sample->set_allocated(allocated); - sample->set_allocation_time(allocation_time); + sample->set_allocation_time(JfrTicks::now()); + sample->set_heap_used_at_last_gc(Universe::get_heap_used_at_last_gc()); _priority_queue->push(sample); } diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/leakprofiler/utilities/saveRestore.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -74,7 +74,6 @@ CLDClaimContext::~CLDClaimContext() { if (_cld != NULL) { - assert(!_cld->claimed(), "invariant"); _cld->claim(); assert(_cld->claimed(), "invariant"); } diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/metadata/metadata.xml openjdk-11-11~24/src/hotspot/share/jfr/metadata/metadata.xml --- openjdk-11-11~19/src/hotspot/share/jfr/metadata/metadata.xml 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/metadata/metadata.xml 2018-07-25 15:36:46.000000000 +0000 @@ -577,6 +577,7 @@ + @@ -656,6 +657,12 @@ + + + + + + @@ -918,6 +925,10 @@ + + + + @@ -1122,4 +1133,4 @@ - \ No newline at end of file + diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" +#include "logging/log.hpp" +#include "jfr/jfrEvents.hpp" +#include "jfr/metadata/jfrSerializer.hpp" +#include "jfr/periodic/jfrNetworkUtilization.hpp" +#include "jfr/periodic/jfrOSInterface.hpp" +#include "jfr/utilities/jfrTime.hpp" +#include "jfr/utilities/jfrTypes.hpp" +#include "runtime/os_perf.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/growableArray.hpp" + +struct InterfaceEntry { + char* name; + traceid id; + uint64_t bytes_in; + uint64_t bytes_out; + bool in_use; +}; + +static GrowableArray* _interfaces = NULL; + +void JfrNetworkUtilization::destroy() { + if (_interfaces != NULL) { + for (int i = 0; i < _interfaces->length(); ++i) { + FREE_C_HEAP_ARRAY(char, _interfaces->at(i).name); + } + delete _interfaces; + _interfaces = NULL; + } +} + +static InterfaceEntry& new_entry(const NetworkInterface* iface, GrowableArray* interfaces) { + assert(iface != NULL, "invariant"); + assert(interfaces != NULL, "invariant"); + + // single threaded premise + static traceid interface_id = 0; + + const char* name = iface->get_name(); + assert(name != NULL, "invariant"); + + InterfaceEntry entry; + const size_t length = strlen(name); + entry.name = NEW_C_HEAP_ARRAY(char, length + 1, mtInternal); + strncpy(entry.name, name, length + 1); + entry.id = ++interface_id; + entry.bytes_in = iface->get_bytes_in(); + entry.bytes_out = iface->get_bytes_out(); + entry.in_use = false; + return _interfaces->at(_interfaces->append(entry)); +} + +static GrowableArray* get_interfaces() { + if (_interfaces == NULL) { + _interfaces = new(ResourceObj::C_HEAP, mtTracing) GrowableArray(10, true, mtTracing); + } + return _interfaces; +} + +static InterfaceEntry& get_entry(const NetworkInterface* iface) { + // Remember the index we started at last time, since we're most likely looking at them + // in the same order every time. + static int saved_index = -1; + + GrowableArray* interfaces = get_interfaces(); + assert(interfaces != NULL, "invariant"); + for (int i = 0; i < _interfaces->length(); ++i) { + saved_index = (saved_index + 1) % _interfaces->length(); + if (strcmp(_interfaces->at(saved_index).name, iface->get_name()) == 0) { + return _interfaces->at(saved_index); + } + } + return new_entry(iface, interfaces); +} + +// If current counters are less than previous we assume the interface has been reset +// If no bytes have been either sent or received, we'll also skip the event +static uint64_t rate_per_second(uint64_t current, uint64_t old, const JfrTickspan& interval) { + assert(interval.value() > 0, "invariant"); + if (current <= old) { + return 0; + } + return ((current - old) * NANOSECS_PER_SEC) / interval.nanoseconds(); +} + +static bool get_interfaces(NetworkInterface** network_interfaces) { + const int ret_val = JfrOSInterface::network_utilization(network_interfaces); + if (ret_val == OS_ERR) { + log_debug(jfr, system)("Unable to generate network utilization events"); + return false; + } + return ret_val != FUNCTIONALITY_NOT_IMPLEMENTED; +} + +class JfrNetworkInterfaceName : public JfrSerializer { + public: + void serialize(JfrCheckpointWriter& writer) { + assert(_interfaces != NULL, "invariant"); + const JfrCheckpointContext ctx = writer.context(); + const intptr_t count_offset = writer.reserve(sizeof(u4)); // Don't know how many yet + int active_interfaces = 0; + for (int i = 0; i < _interfaces->length(); ++i) { + InterfaceEntry& entry = _interfaces->at(i); + if (entry.in_use) { + entry.in_use = false; + writer.write_key(entry.id); + writer.write(entry.name); + ++active_interfaces; + } + } + if (active_interfaces == 0) { + // nothing to write, restore context + writer.set_context(ctx); + return; + } + writer.write_count(active_interfaces, count_offset); + } +}; + +static bool register_network_interface_name_serializer() { + assert(_interfaces != NULL, "invariant"); + return JfrSerializer::register_serializer(TYPE_NETWORKINTERFACENAME, + false, // require safepoint + false, // disallow caching; we want a callback every rotation + new JfrNetworkInterfaceName()); +} + +void JfrNetworkUtilization::send_events() { + ResourceMark rm; + NetworkInterface* network_interfaces; + if (!get_interfaces(&network_interfaces)) { + return; + } + log_trace(jfr, event)("Reporting network utilization"); + static JfrTicks last_sample_instant; + const JfrTicks cur_time = JfrTicks::now(); + const JfrTickspan interval = last_sample_instant == 0 ? cur_time - cur_time : cur_time - last_sample_instant; + last_sample_instant = cur_time; + for (NetworkInterface *cur = network_interfaces; cur != NULL; cur = cur->next()) { + InterfaceEntry& entry = get_entry(cur); + if (interval.value() > 0) { + const uint64_t current_bytes_in = cur->get_bytes_in(); + const uint64_t current_bytes_out = cur->get_bytes_out(); + const uint64_t read_rate = rate_per_second(current_bytes_in, entry.bytes_in, interval); + const uint64_t write_rate = rate_per_second(current_bytes_out, entry.bytes_out, interval); + if (read_rate > 0 || write_rate > 0) { + entry.in_use = true; + EventNetworkUtilization event(UNTIMED); + event.set_starttime(cur_time); + event.set_endtime(cur_time); + event.set_networkInterface(entry.id); + event.set_readRate(read_rate); + event.set_writeRate(write_rate); + event.commit(); + } + // update existing entry with new values + entry.bytes_in = current_bytes_in; + entry.bytes_out = current_bytes_out; + } + } + + static bool is_serializer_registered = false; + if (!is_serializer_registered) { + is_serializer_registered = register_network_interface_name_serializer(); + } +} diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrNetworkUtilization.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_JFR_PERIODIC_JFRNETWORKUTILIZATION_HPP +#define SHARE_VM_JFR_PERIODIC_JFRNETWORKUTILIZATION_HPP + +#include "memory/allocation.hpp" + +class NetworkInterface; + +class JfrNetworkUtilization : public AllStatic { +public: + static void destroy(); + static void send_events(); +}; + +#endif // SHARE_VM_JFR_PERIODIC_JFRNETWORKUTILIZATION_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrOSInterface.cpp openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrOSInterface.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrOSInterface.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrOSInterface.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,7 @@ #include "precompiled.hpp" #include "jfr/jfrEvents.hpp" +#include "jfr/periodic/jfrNetworkUtilization.hpp" #include "jfr/periodic/jfrOSInterface.hpp" #include "memory/allocation.inline.hpp" #include "memory/resourceArea.hpp" @@ -54,6 +55,7 @@ } void JfrOSInterface::destroy() { + JfrNetworkUtilization::destroy(); if (_instance != NULL) { delete _instance; _instance = NULL; @@ -66,6 +68,7 @@ CPUInformationInterface* _cpu_info_interface; CPUPerformanceInterface* _cpu_perf_interface; SystemProcessInterface* _system_process_interface; + NetworkPerformanceInterface* _network_performance_interface; // stub helper void functionality_not_implemented(char** str) const; @@ -89,6 +92,8 @@ // system processes information int system_processes(SystemProcess** system_processes, int* no_of_sys_processes); + + int network_utilization(NetworkInterface** network_interfaces) const; }; JfrOSInterface::JfrOSInterfaceImpl::JfrOSInterfaceImpl() : _cpu_info_interface(NULL), @@ -97,18 +102,19 @@ bool JfrOSInterface::JfrOSInterfaceImpl::initialize() { _cpu_info_interface = new CPUInformationInterface(); - bool success = _cpu_info_interface != NULL && _cpu_info_interface->initialize(); - if (!success) { + if (!(_cpu_info_interface != NULL && _cpu_info_interface->initialize())) { return false; } _cpu_perf_interface = new CPUPerformanceInterface(); - success = _cpu_perf_interface != NULL && _cpu_perf_interface->initialize(); - if (!success) { + if (!(_cpu_perf_interface != NULL && _cpu_perf_interface->initialize())) { return false; } _system_process_interface = new SystemProcessInterface(); - success = _system_process_interface != NULL && _system_process_interface->initialize(); - return success; + if (!(_system_process_interface != NULL && _system_process_interface->initialize())) { + return false; + } + _network_performance_interface = new NetworkPerformanceInterface(); + return _network_performance_interface != NULL && _network_performance_interface->initialize(); } JfrOSInterface::JfrOSInterfaceImpl::~JfrOSInterfaceImpl(void) { @@ -124,6 +130,10 @@ delete _system_process_interface; _system_process_interface = NULL; } + if (_network_performance_interface != NULL) { + delete _network_performance_interface; + _network_performance_interface = NULL; + } } int JfrOSInterface::JfrOSInterfaceImpl::cpu_load(int which_logical_cpu, double* cpu_load) { @@ -154,6 +164,10 @@ return _system_process_interface->system_processes(system_processes, no_of_sys_processes); } +int JfrOSInterface::JfrOSInterfaceImpl::network_utilization(NetworkInterface** network_interfaces) const { + return _network_performance_interface->network_utilization(network_interfaces); +} + // assigned char* is RESOURCE_HEAP_ALLOCATED // caller need to ensure proper ResourceMark placement. int JfrOSInterface::JfrOSInterfaceImpl::os_version(char** os_version) const { @@ -246,3 +260,7 @@ int JfrOSInterface::system_processes(SystemProcess** sys_processes, int* no_of_sys_processes) { return instance()._impl->system_processes(sys_processes, no_of_sys_processes); } + +int JfrOSInterface::network_utilization(NetworkInterface** network_interfaces) { + return instance()._impl->network_utilization(network_interfaces); +} diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrOSInterface.hpp openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrOSInterface.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrOSInterface.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrOSInterface.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,10 +26,10 @@ #define SHARE_VM_JFR_PERIODIC_JFROSINTERFACE_HPP #include "jfr/utilities/jfrAllocation.hpp" -#include "utilities/globalDefinitions.hpp" class CPUInformation; class EnvironmentVariable; +class NetworkInterface; class SystemProcess; class JfrOSInterface: public JfrCHeapObj { @@ -54,6 +54,7 @@ static int os_version(char** os_version); static int generate_initial_environment_variable_events(); static int system_processes(SystemProcess** system_processes, int* no_of_sys_processes); + static int network_utilization(NetworkInterface** network_interfaces); }; #endif // SHARE_VM_JFR_PERIODIC_JFROSINTERFACE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/periodic/jfrPeriodic.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -38,6 +38,7 @@ #include "jfr/periodic/jfrOSInterface.hpp" #include "jfr/periodic/jfrThreadCPULoadEvent.hpp" #include "jfr/periodic/jfrThreadDumpEvent.hpp" +#include "jfr/periodic/jfrNetworkUtilization.hpp" #include "jfr/recorder/jfrRecorder.hpp" #include "jfr/support/jfrThreadId.hpp" #include "jfr/utilities/jfrTime.hpp" @@ -176,6 +177,10 @@ JfrThreadCPULoadEvent::send_events(); } +TRACE_REQUEST_FUNC(NetworkUtilization) { + JfrNetworkUtilization::send_events(); +} + TRACE_REQUEST_FUNC(CPUTimeStampCounter) { EventCPUTimeStampCounter event; event.set_fastTimeEnabled(JfrTime::is_ft_enabled()); diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -66,7 +66,6 @@ _free_list_mspace(NULL), _epoch_transition_mspace(NULL), _lock(NULL), - _type_manager(NULL), _service_thread(NULL), _chunkwriter(cw), _checkpoint_epoch_state(JfrTraceIdEpoch::epoch()) {} @@ -81,9 +80,7 @@ if (_lock != NULL) { delete _lock; } - if (_type_manager) { - delete _type_manager; - } + JfrTypeManager::clear(); } static const size_t unlimited_mspace_size = 0; @@ -109,14 +106,12 @@ if (_epoch_transition_mspace == NULL) { return false; } - assert(_type_manager == NULL, "invariant"); - _type_manager = new JfrTypeManager(); - if (_type_manager == NULL || !_type_manager->initialize()) { - return false; - } assert(_lock == NULL, "invariant"); _lock = new Mutex(Monitor::leaf - 1, "Checkpoint mutex", Mutex::_allow_vm_block_flag, Monitor::_safepoint_check_never); - return _lock != NULL; + if (_lock == NULL) { + return false; + } + return JfrTypeManager::initialize(); } bool JfrCheckpointManager::use_epoch_transition_mspace(const Thread* thread) const { @@ -354,37 +349,32 @@ return discarder.processed(); } -bool JfrCheckpointManager::register_serializer(JfrTypeId id, bool require_safepoint, bool permit_cache, JfrSerializer* cs) { - assert(cs != NULL, "invariant"); - return instance()._type_manager->register_serializer(id, require_safepoint, permit_cache, cs); -} - size_t JfrCheckpointManager::write_types() { JfrCheckpointWriter writer(false, true, Thread::current()); - _type_manager->write_types(writer); + JfrTypeManager::write_types(writer); return writer.used_size(); } size_t JfrCheckpointManager::write_safepoint_types() { // this is also a "flushpoint" JfrCheckpointWriter writer(true, true, Thread::current()); - _type_manager->write_safepoint_types(writer); + JfrTypeManager::write_safepoint_types(writer); return writer.used_size(); } void JfrCheckpointManager::write_type_set() { - _type_manager->write_type_set(); + JfrTypeManager::write_type_set(); } void JfrCheckpointManager::write_type_set_for_unloaded_classes() { assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint!"); - instance()._type_manager->write_type_set_for_unloaded_classes(); + JfrTypeManager::write_type_set_for_unloaded_classes(); } void JfrCheckpointManager::create_thread_checkpoint(JavaThread* jt) { - instance()._type_manager->create_thread_checkpoint(jt); + JfrTypeManager::create_thread_checkpoint(jt); } void JfrCheckpointManager::write_thread_checkpoint(JavaThread* jt) { - instance()._type_manager->write_thread_checkpoint(jt); + JfrTypeManager::write_thread_checkpoint(jt); } diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/jfrCheckpointManager.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -28,7 +28,6 @@ #include "jfr/recorder/storage/jfrBuffer.hpp" #include "jfr/recorder/storage/jfrMemorySpace.hpp" #include "jfr/recorder/storage/jfrMemorySpaceRetrieval.hpp" -#include "jfr/utilities/jfrTypes.hpp" class JfrCheckpointManager; class JfrChunkWriter; @@ -59,7 +58,6 @@ JfrCheckpointMspace* _free_list_mspace; JfrCheckpointMspace* _epoch_transition_mspace; Mutex* _lock; - JfrTypeManager* _type_manager; const Thread* _service_thread; JfrChunkWriter& _chunkwriter; bool _checkpoint_epoch_state; @@ -91,8 +89,6 @@ bool initialize(); static void destroy(); - static bool register_serializer(JfrTypeId id, bool require_safepoint, bool permit_cache, JfrSerializer* serializer); - public: void register_service_thread(const Thread* t); static void write_type_set_for_unloaded_classes(); diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -59,32 +59,33 @@ #include "gc/g1/g1HeapRegionTraceType.hpp" #include "gc/g1/g1YCTypes.hpp" #endif -#if INCLUDE_ZGC -#include "gc/z/zStat.hpp" -#endif - -// implementation for the static registration function exposed in the api -bool JfrSerializer::register_serializer(JfrTypeId id, bool require_safepoint, bool permit_cache, JfrSerializer* cs) { - assert(cs != NULL, "invariant"); - return JfrCheckpointManager::register_serializer(id, require_safepoint, permit_cache, cs); -} - -class JfrCheckpointThreadCountClosure : public ThreadClosure { -private: - u4 _total_threads; -public: - JfrCheckpointThreadCountClosure() : _total_threads(0) {} - u4 total_threads() { return _total_threads; } - void do_thread(Thread *t) { _total_threads++; } -}; // Requires a ResourceMark for get_thread_name/as_utf8 class JfrCheckpointThreadClosure : public ThreadClosure { private: JfrCheckpointWriter& _writer; - Thread* _curthread; + JfrCheckpointContext _ctx; + const intptr_t _count_position; + Thread* const _curthread; + u4 _count; + public: - JfrCheckpointThreadClosure(JfrCheckpointWriter& writer) : _writer(writer), _curthread(Thread::current()) {} + JfrCheckpointThreadClosure(JfrCheckpointWriter& writer) : _writer(writer), + _ctx(writer.context()), + _count_position(writer.reserve(sizeof(u4))), + _curthread(Thread::current()), + _count(0) { + } + + ~JfrCheckpointThreadClosure() { + if (_count == 0) { + // restore + _writer.set_context(_ctx); + return; + } + _writer.write_count(_count, _count_position); + } + void do_thread(Thread* t); }; @@ -92,10 +93,16 @@ void JfrCheckpointThreadClosure::do_thread(Thread* t) { assert(t != NULL, "invariant"); assert_locked_or_safepoint(Threads_lock); - _writer.write_key(t->jfr_thread_local()->thread_id()); + const JfrThreadLocal* const tl = t->jfr_thread_local(); + assert(tl != NULL, "invariant"); + if (tl->is_dead()) { + return; + } + ++_count; + _writer.write_key(tl->thread_id()); _writer.write(t->name()); const OSThread* const os_thread = t->osthread(); - _writer.write(os_thread != NULL ? os_thread->thread_id() : (u8)0); + _writer.write(os_thread != NULL ? os_thread->thread_id() : 0); if (t->is_Java_thread()) { JavaThread* const jt = (JavaThread*)t; _writer.write(jt->name()); @@ -106,17 +113,12 @@ return; } _writer.write((const char*)NULL); // java name - _writer.write((traceid)0); // java thread id - _writer.write((traceid)0); // java thread group + _writer.write((traceid)0); // java thread id + _writer.write((traceid)0); // java thread group } void JfrThreadConstantSet::serialize(JfrCheckpointWriter& writer) { assert(SafepointSynchronize::is_at_safepoint(), "invariant"); - JfrCheckpointThreadCountClosure tcc; - Threads::threads_do(&tcc); - const u4 total_threads = tcc.total_threads(); - // THREADS - writer.write_count(total_threads); JfrCheckpointThreadClosure tc(writer); Threads::threads_do(&tc); } @@ -343,33 +345,9 @@ writer.write_count(1); writer.write_key(_thread->jfr_thread_local()->thread_id()); writer.write(thread_name); - writer.write((u8)_thread->osthread()->thread_id()); + writer.write((traceid)_thread->osthread()->thread_id()); writer.write(thread_name); writer.write(java_lang_thread_id); writer.write(thread_group_id); JfrThreadGroup::serialize(&writer, thread_group_id); } - -void ZStatisticsCounterTypeConstant::serialize(JfrCheckpointWriter& writer) { -#if INCLUDE_ZGC - writer.write_count(ZStatCounter::count()); - for (ZStatCounter* counter = ZStatCounter::first(); counter != NULL; counter = counter->next()) { - writer.write_key(counter->id()); - writer.write(counter->name()); - } -#else - writer.write_count(0); -#endif -} - -void ZStatisticsSamplerTypeConstant::serialize(JfrCheckpointWriter& writer) { -#if INCLUDE_ZGC - writer.write_count(ZStatSampler::count()); - for (ZStatSampler* sampler = ZStatSampler::first(); sampler != NULL; sampler = sampler->next()) { - writer.write_key(sampler->id()); - writer.write(sampler->name()); - } -#else - writer.write_count(0); -#endif -} diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.hpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/types/jfrType.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -135,14 +135,4 @@ void serialize(JfrCheckpointWriter& writer); }; -class ZStatisticsCounterTypeConstant : public JfrSerializer { - public: - void serialize(JfrCheckpointWriter& writer); -}; - -class ZStatisticsSamplerTypeConstant : public JfrSerializer { - public: - void serialize(JfrCheckpointWriter& writer); -}; - #endif // SHARE_VM_JFR_CHECKPOINT_CONSTANT_JFRCONSTANT_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -23,123 +23,146 @@ */ #include "precompiled.hpp" +#include "jfr/metadata/jfrSerializer.hpp" #include "jfr/recorder/checkpoint/jfrCheckpointWriter.hpp" #include "jfr/recorder/checkpoint/types/jfrType.hpp" #include "jfr/recorder/checkpoint/types/jfrTypeManager.hpp" +#include "jfr/utilities/jfrDoublyLinkedList.hpp" #include "jfr/utilities/jfrIterator.hpp" #include "runtime/safepoint.hpp" #include "runtime/thread.inline.hpp" #include "utilities/exceptions.hpp" +#include "runtime/semaphore.hpp" -JfrSerializerRegistration::JfrSerializerRegistration(JfrTypeId id, bool permit_cache, JfrSerializer* cs) : - _next(NULL), - _prev(NULL), - _serializer(cs), - _cache(), - _id(id), - _permit_cache(permit_cache) {} +class JfrSerializerRegistration : public JfrCHeapObj { + private: + JfrSerializerRegistration* _next; + JfrSerializerRegistration* _prev; + JfrSerializer* _serializer; + mutable JfrCheckpointBlobHandle _cache; + JfrTypeId _id; + bool _permit_cache; -JfrSerializerRegistration::~JfrSerializerRegistration() { - delete _serializer; -} + public: + JfrSerializerRegistration(JfrTypeId id, bool permit_cache, JfrSerializer* serializer) : + _next(NULL), _prev(NULL), _serializer(serializer), _cache(), _id(id), _permit_cache(permit_cache) {} -JfrSerializerRegistration* JfrSerializerRegistration::next() const { - return _next; -} + ~JfrSerializerRegistration() { + delete _serializer; + } -void JfrSerializerRegistration::set_next(JfrSerializerRegistration* next) { - _next = next; -} + JfrSerializerRegistration* next() const { + return _next; + } -JfrSerializerRegistration* JfrSerializerRegistration::prev() const { - return _prev; -} + void set_next(JfrSerializerRegistration* next) { + _next = next; + } -void JfrSerializerRegistration::set_prev(JfrSerializerRegistration* prev) { - _prev = prev; -} + JfrSerializerRegistration* prev() const { + return _prev; + } -JfrTypeId JfrSerializerRegistration::id() const { - return _id; -} + void set_prev(JfrSerializerRegistration* prev) { + _prev = prev; + } + + JfrTypeId id() const { + return _id; + } + + void invoke(JfrCheckpointWriter& writer) const; +}; -void JfrSerializerRegistration::invoke_serializer(JfrCheckpointWriter& writer) const { +void JfrSerializerRegistration::invoke(JfrCheckpointWriter& writer) const { if (_cache.valid()) { writer.increment(); _cache->write(writer); return; } const JfrCheckpointContext ctx = writer.context(); + // serialize the type id before invoking callback writer.write_type(_id); + const intptr_t start = writer.current_offset(); + // invoke the serializer routine _serializer->serialize(writer); + if (start == writer.current_offset() ) { + // the serializer implementation did nothing, rewind to restore + writer.set_context(ctx); + return; + } if (_permit_cache) { _cache = writer.copy(&ctx); } } -JfrTypeManager::~JfrTypeManager() { - Iterator iter(_types); +class SerializerRegistrationGuard : public StackObj { + private: + static Semaphore _mutex_semaphore; + public: + SerializerRegistrationGuard() { + _mutex_semaphore.wait(); + } + ~SerializerRegistrationGuard() { + _mutex_semaphore.signal(); + } +}; + +Semaphore SerializerRegistrationGuard::_mutex_semaphore(1); + +typedef JfrDoublyLinkedList List; +typedef StopOnNullIterator Iterator; +static List types; +static List safepoint_types; + +void JfrTypeManager::clear() { + SerializerRegistrationGuard guard; + Iterator iter(types); JfrSerializerRegistration* registration; while (iter.has_next()) { - registration = _types.remove(iter.next()); + registration = types.remove(iter.next()); assert(registration != NULL, "invariant"); delete registration; } - Iterator sp_type_iter(_safepoint_types); + Iterator sp_type_iter(safepoint_types); while (sp_type_iter.has_next()) { - registration = _safepoint_types.remove(sp_type_iter.next()); + registration = safepoint_types.remove(sp_type_iter.next()); assert(registration != NULL, "invariant"); delete registration; } } -size_t JfrTypeManager::number_of_registered_types() const { - size_t count = 0; - const Iterator iter(_types); - while (iter.has_next()) { - ++count; - iter.next(); - } - const Iterator sp_type_iter(_safepoint_types); - while (sp_type_iter.has_next()) { - ++count; - sp_type_iter.next(); - } - return count; -} - -void JfrTypeManager::write_types(JfrCheckpointWriter& writer) const { - const Iterator iter(_types); +void JfrTypeManager::write_types(JfrCheckpointWriter& writer) { + const Iterator iter(types); while (iter.has_next()) { - iter.next()->invoke_serializer(writer); + iter.next()->invoke(writer); } } -void JfrTypeManager::write_safepoint_types(JfrCheckpointWriter& writer) const { +void JfrTypeManager::write_safepoint_types(JfrCheckpointWriter& writer) { assert(SafepointSynchronize::is_at_safepoint(), "invariant"); - const Iterator iter(_safepoint_types); + const Iterator iter(safepoint_types); while (iter.has_next()) { - iter.next()->invoke_serializer(writer); + iter.next()->invoke(writer); } } -void JfrTypeManager::write_type_set() const { - assert(!SafepointSynchronize::is_at_safepoint(), "invariant"); +void JfrTypeManager::write_type_set() { // can safepoint here because of Module_lock - MutexLockerEx lock(Module_lock); + MutexLockerEx lock(SafepointSynchronize::is_at_safepoint() ? NULL : Module_lock); JfrCheckpointWriter writer(true, true, Thread::current()); TypeSet set; set.serialize(writer); } -void JfrTypeManager::write_type_set_for_unloaded_classes() const { +void JfrTypeManager::write_type_set_for_unloaded_classes() { assert(SafepointSynchronize::is_at_safepoint(), "invariant"); JfrCheckpointWriter writer(false, true, Thread::current()); ClassUnloadTypeSet class_unload_set; class_unload_set.serialize(writer); } -void JfrTypeManager::create_thread_checkpoint(JavaThread* jt) const { +void JfrTypeManager::create_thread_checkpoint(JavaThread* jt) { assert(jt != NULL, "invariant"); JfrThreadConstant type_thread(jt); JfrCheckpointWriter writer(false, true, jt); @@ -150,7 +173,7 @@ assert(jt->jfr_thread_local()->has_thread_checkpoint(), "invariant"); } -void JfrTypeManager::write_thread_checkpoint(JavaThread* jt) const { +void JfrTypeManager::write_thread_checkpoint(JavaThread* jt) { assert(jt != NULL, "JavaThread is NULL!"); ResourceMark rm(jt); if (jt->jfr_thread_local()->has_thread_checkpoint()) { @@ -165,71 +188,62 @@ } #ifdef ASSERT -static void assert_not_registered_twice(JfrTypeId id, JfrTypeManager::List& list) { - const JfrTypeManager::Iterator iter(list); +static void assert_not_registered_twice(JfrTypeId id, List& list) { + const Iterator iter(list); while (iter.has_next()) { assert(iter.next()->id() != id, "invariant"); } } #endif -bool JfrTypeManager::register_serializer(JfrTypeId id, bool require_safepoint, bool permit_cache, JfrSerializer* cs) { - assert(cs != NULL, "invariant"); - JfrSerializerRegistration* const registration = new JfrSerializerRegistration(id, permit_cache, cs); +static bool register_type(JfrTypeId id, bool require_safepoint, bool permit_cache, JfrSerializer* serializer) { + assert(serializer != NULL, "invariant"); + JfrSerializerRegistration* const registration = new JfrSerializerRegistration(id, permit_cache, serializer); if (registration == NULL) { - delete cs; + delete serializer; return false; } if (require_safepoint) { - assert(!_safepoint_types.in_list(registration), "invariant"); - DEBUG_ONLY(assert_not_registered_twice(id, _safepoint_types);) - _safepoint_types.prepend(registration); - } - else { - assert(!_types.in_list(registration), "invariant"); - DEBUG_ONLY(assert_not_registered_twice(id, _types);) - _types.prepend(registration); + assert(!safepoint_types.in_list(registration), "invariant"); + DEBUG_ONLY(assert_not_registered_twice(id, safepoint_types);) + safepoint_types.prepend(registration); + } else { + assert(!types.in_list(registration), "invariant"); + DEBUG_ONLY(assert_not_registered_twice(id, types);) + types.prepend(registration); } return true; } bool JfrTypeManager::initialize() { + SerializerRegistrationGuard guard; + // register non-safepointing type serialization - for (size_t i = 0; i < 18; ++i) { - switch (i) { - case 0: register_serializer(TYPE_FLAGVALUEORIGIN, false, true, new FlagValueOriginConstant()); break; - case 1: register_serializer(TYPE_INFLATECAUSE, false, true, new MonitorInflateCauseConstant()); break; - case 2: register_serializer(TYPE_GCCAUSE, false, true, new GCCauseConstant()); break; - case 3: register_serializer(TYPE_GCNAME, false, true, new GCNameConstant()); break; - case 4: register_serializer(TYPE_GCWHEN, false, true, new GCWhenConstant()); break; - case 5: register_serializer(TYPE_G1HEAPREGIONTYPE, false, true, new G1HeapRegionTypeConstant()); break; - case 6: register_serializer(TYPE_GCTHRESHOLDUPDATER, false, true, new GCThresholdUpdaterConstant()); break; - case 7: register_serializer(TYPE_METADATATYPE, false, true, new MetadataTypeConstant()); break; - case 8: register_serializer(TYPE_METASPACEOBJECTTYPE, false, true, new MetaspaceObjectTypeConstant()); break; - case 9: register_serializer(TYPE_G1YCTYPE, false, true, new G1YCTypeConstant()); break; - case 10: register_serializer(TYPE_REFERENCETYPE, false, true, new ReferenceTypeConstant()); break; - case 11: register_serializer(TYPE_NARROWOOPMODE, false, true, new NarrowOopModeConstant()); break; - case 12: register_serializer(TYPE_COMPILERPHASETYPE, false, true, new CompilerPhaseTypeConstant()); break; - case 13: register_serializer(TYPE_CODEBLOBTYPE, false, true, new CodeBlobTypeConstant()); break; - case 14: register_serializer(TYPE_VMOPERATIONTYPE, false, true, new VMOperationTypeConstant()); break; - case 15: register_serializer(TYPE_THREADSTATE, false, true, new ThreadStateConstant()); break; - case 16: register_serializer(TYPE_ZSTATISTICSCOUNTERTYPE, false, true, new ZStatisticsCounterTypeConstant()); break; - case 17: register_serializer(TYPE_ZSTATISTICSSAMPLERTYPE, false, true, new ZStatisticsSamplerTypeConstant()); break; - default: - guarantee(false, "invariant"); - } - } + register_type(TYPE_FLAGVALUEORIGIN, false, true, new FlagValueOriginConstant()); + register_type(TYPE_INFLATECAUSE, false, true, new MonitorInflateCauseConstant()); + register_type(TYPE_GCCAUSE, false, true, new GCCauseConstant()); + register_type(TYPE_GCNAME, false, true, new GCNameConstant()); + register_type(TYPE_GCWHEN, false, true, new GCWhenConstant()); + register_type(TYPE_G1HEAPREGIONTYPE, false, true, new G1HeapRegionTypeConstant()); + register_type(TYPE_GCTHRESHOLDUPDATER, false, true, new GCThresholdUpdaterConstant()); + register_type(TYPE_METADATATYPE, false, true, new MetadataTypeConstant()); + register_type(TYPE_METASPACEOBJECTTYPE, false, true, new MetaspaceObjectTypeConstant()); + register_type(TYPE_G1YCTYPE, false, true, new G1YCTypeConstant()); + register_type(TYPE_REFERENCETYPE, false, true, new ReferenceTypeConstant()); + register_type(TYPE_NARROWOOPMODE, false, true, new NarrowOopModeConstant()); + register_type(TYPE_COMPILERPHASETYPE, false, true, new CompilerPhaseTypeConstant()); + register_type(TYPE_CODEBLOBTYPE, false, true, new CodeBlobTypeConstant()); + register_type(TYPE_VMOPERATIONTYPE, false, true, new VMOperationTypeConstant()); + register_type(TYPE_THREADSTATE, false, true, new ThreadStateConstant()); // register safepointing type serialization - for (size_t i = 0; i < 2; ++i) { - switch (i) { - case 0: register_serializer(TYPE_THREADGROUP, true, false, new JfrThreadGroupConstant()); break; - case 1: register_serializer(TYPE_THREAD, true, false, new JfrThreadConstantSet()); break; - default: - guarantee(false, "invariant"); - } - } + register_type(TYPE_THREADGROUP, true, false, new JfrThreadGroupConstant()); + register_type(TYPE_THREAD, true, false, new JfrThreadConstantSet()); return true; } - +// implementation for the static registration function exposed in the JfrSerializer api +bool JfrSerializer::register_serializer(JfrTypeId id, bool require_safepoint, bool permit_cache, JfrSerializer* serializer) { + SerializerRegistrationGuard guard; + return register_type(id, require_safepoint, permit_cache, serializer); +} diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.hpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/checkpoint/types/jfrTypeManager.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -24,49 +24,21 @@ #ifndef SHARE_VM_JFR_CHECKPOINT_TYPES_JFRTYPEMANAGER_HPP #define SHARE_VM_JFR_CHECKPOINT_TYPES_JFRTYPEMANAGER_HPP -#include "jfr/metadata/jfrSerializer.hpp" #include "jfr/utilities/jfrAllocation.hpp" -#include "jfr/utilities/jfrDoublyLinkedList.hpp" -#include "jfr/utilities/jfrIterator.hpp" -class JfrSerializerRegistration : public JfrCHeapObj { - private: - JfrSerializerRegistration* _next; - JfrSerializerRegistration* _prev; - JfrSerializer* _serializer; - mutable JfrCheckpointBlobHandle _cache; - JfrTypeId _id; - bool _permit_cache; +class JavaThread; +class JfrCheckpointWriter; +class JfrTypeManager : public AllStatic { public: - JfrSerializerRegistration(JfrTypeId id, bool permit_cache, JfrSerializer* serializer); - ~JfrSerializerRegistration(); - JfrSerializerRegistration* next() const; - void set_next(JfrSerializerRegistration* next); - JfrSerializerRegistration* prev() const; - void set_prev(JfrSerializerRegistration* prev); - void invoke_serializer(JfrCheckpointWriter& writer) const; - JfrTypeId id() const; + static bool initialize(); + static void clear(); + static void write_types(JfrCheckpointWriter& writer); + static void write_safepoint_types(JfrCheckpointWriter& writer); + static void write_type_set(); + static void write_type_set_for_unloaded_classes(); + static void create_thread_checkpoint(JavaThread* jt); + static void write_thread_checkpoint(JavaThread* jt); }; -class JfrTypeManager : public JfrCHeapObj { - friend class JfrCheckpointManager; - public: - typedef JfrDoublyLinkedList List; - typedef StopOnNullIterator Iterator; - private: - List _types; - List _safepoint_types; - - ~JfrTypeManager(); - bool initialize(); - size_t number_of_registered_types() const; - void write_types(JfrCheckpointWriter& writer) const; - void write_safepoint_types(JfrCheckpointWriter& writer) const; - void write_type_set() const; - void write_type_set_for_unloaded_classes() const; - void create_thread_checkpoint(JavaThread* jt) const; - void write_thread_checkpoint(JavaThread* jt) const; - bool register_serializer(JfrTypeId id, bool require_safepoint, bool permit_cache, JfrSerializer* serializer); -}; #endif // SHARE_VM_JFR_CHECKPOINT_TYPES_JFRTYPEMANAGER_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/jfrRecorder.cpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/jfrRecorder.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/jfrRecorder.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/jfrRecorder.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -46,6 +46,7 @@ #include "runtime/handles.inline.hpp" #include "runtime/flags/jvmFlag.hpp" #include "runtime/globals.hpp" +#include "utilities/growableArray.hpp" static bool is_disabled_on_command_line() { static const size_t length = strlen("FlightRecorder"); @@ -85,31 +86,30 @@ return JfrTime::initialize(); } -static JfrStartFlightRecordingDCmd* _startup_recording = NULL; +static GrowableArray* dcmd_recordings_array = NULL; -static void release_startup_recording() { - if (_startup_recording != NULL) { - delete _startup_recording; - _startup_recording = NULL; +static void release_recordings() { + if (dcmd_recordings_array != NULL) { + const int length = dcmd_recordings_array->length(); + for (int i = 0; i < length; ++i) { + delete dcmd_recordings_array->at(i); + } + delete dcmd_recordings_array; + dcmd_recordings_array = NULL; } } static void teardown_startup_support() { - release_startup_recording(); - JfrOptionSet::release_startup_recordings(); + release_recordings(); + JfrOptionSet::release_startup_recording_options(); } - // Parsing options here to detect errors as soon as possible -static bool parse_recording_options(const char* options, TRAPS) { +static bool parse_recording_options(const char* options, JfrStartFlightRecordingDCmd* dcmd_recording, TRAPS) { assert(options != NULL, "invariant"); - if (_startup_recording != NULL) { - delete _startup_recording; - } + assert(dcmd_recording != NULL, "invariant"); CmdLine cmdline(options, strlen(options), true); - _startup_recording = new (ResourceObj::C_HEAP, mtTracing) JfrStartFlightRecordingDCmd(tty, true); - assert(_startup_recording != NULL, "invariant"); - _startup_recording->parse(&cmdline, ',', THREAD); + dcmd_recording->parse(&cmdline, ',', THREAD); if (HAS_PENDING_EXCEPTION) { java_lang_Throwable::print(PENDING_EXCEPTION, tty); CLEAR_PENDING_EXCEPTION; @@ -119,24 +119,30 @@ } static bool validate_recording_options(TRAPS) { - const GrowableArray* startup_options = JfrOptionSet::startup_recordings(); - if (startup_options == NULL) { + const GrowableArray* options = JfrOptionSet::startup_recording_options(); + if (options == NULL) { return true; } - const int length = startup_options->length(); + const int length = options->length(); assert(length >= 1, "invariant"); + assert(dcmd_recordings_array == NULL, "invariant"); + dcmd_recordings_array = new (ResourceObj::C_HEAP, mtTracing)GrowableArray(length, true, mtTracing); + assert(dcmd_recordings_array != NULL, "invariant"); for (int i = 0; i < length; ++i) { - if (!parse_recording_options(startup_options->at(i), THREAD)) { + JfrStartFlightRecordingDCmd* const dcmd_recording = new(ResourceObj::C_HEAP, mtTracing) JfrStartFlightRecordingDCmd(tty, true); + assert(dcmd_recording != NULL, "invariant"); + dcmd_recordings_array->append(dcmd_recording); + if (!parse_recording_options(options->at(i), dcmd_recording, THREAD)) { return false; } } return true; } -static bool launch_recording(TRAPS) { - assert(_startup_recording != NULL, "invariant"); +static bool launch_recording(JfrStartFlightRecordingDCmd* dcmd_recording, TRAPS) { + assert(dcmd_recording != NULL, "invariant"); log_trace(jfr, system)("Starting a recording"); - _startup_recording->execute(DCmd_Source_Internal, Thread::current()); + dcmd_recording->execute(DCmd_Source_Internal, THREAD); if (HAS_PENDING_EXCEPTION) { log_debug(jfr, system)("Exception while starting a recording"); CLEAR_PENDING_EXCEPTION; @@ -146,31 +152,20 @@ return true; } -static bool launch_recordings(const GrowableArray* startup_options, TRAPS) { - assert(startup_options != NULL, "invariant"); - const int length = startup_options->length(); - assert(length >= 1, "invariant"); - if (length == 1) { - // already parsed and ready, launch it - return launch_recording(THREAD); - } - for (int i = 0; i < length; ++i) { - parse_recording_options(startup_options->at(i), THREAD); - if (!launch_recording(THREAD)) { - return false; +static bool launch_recordings(TRAPS) { + bool result = true; + if (dcmd_recordings_array != NULL) { + const int length = dcmd_recordings_array->length(); + assert(length >= 1, "invariant"); + for (int i = 0; i < length; ++i) { + if (!launch_recording(dcmd_recordings_array->at(i), THREAD)) { + result = false; + break; + } } } - return true; -} - -static bool startup_recordings(TRAPS) { - const GrowableArray* startup_options = JfrOptionSet::startup_recordings(); - if (startup_options == NULL) { - return true; - } - const bool ret = launch_recordings(startup_options, THREAD); teardown_startup_support(); - return ret; + return result; } static void log_jdk_jfr_module_resolution_error(TRAPS) { @@ -180,8 +175,20 @@ JfrJavaSupport::is_jdk_jfr_module_available(&stream, THREAD); } +static bool is_cds_dump_requested() { + // we will not be able to launch recordings if a cds dump is being requested + if (DumpSharedSpaces && (JfrOptionSet::startup_recording_options() != NULL)) { + warning("JFR will be disabled during CDS dumping"); + teardown_startup_support(); + return true; + } + return false; +} + bool JfrRecorder::on_vm_start() { - const bool in_graph = JfrJavaSupport::is_jdk_jfr_module_available(); + if (is_cds_dump_requested()) { + return true; + } Thread* const thread = Thread::current(); if (!JfrOptionSet::initialize(thread)) { return false; @@ -189,10 +196,13 @@ if (!register_jfr_dcmds()) { return false; } - if (!validate_recording_options(thread)) { - return false; - } + + const bool in_graph = JfrJavaSupport::is_jdk_jfr_module_available(); + if (in_graph) { + if (!validate_recording_options(thread)) { + return false; + } if (!JfrJavaEventWriter::initialize()) { return false; } @@ -200,14 +210,17 @@ return false; } } + if (!is_enabled()) { return true; } + if (!in_graph) { log_jdk_jfr_module_resolution_error(thread); return false; } - return startup_recordings(thread); + + return launch_recordings(thread); } static bool _created = false; diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/service/jfrOptionSet.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -665,59 +665,66 @@ return true; } -static GrowableArray* startup_recording_array = NULL; +bool JfrOptionSet::parse_flight_recorder_option(const JavaVMOption** option, char* delimiter) { + assert(option != NULL, "invariant"); + assert(delimiter != NULL, "invariant"); + assert((*option)->optionString != NULL, "invariant"); + assert(strncmp((*option)->optionString, "-XX:FlightRecorderOptions", 25) == 0, "invariant"); + if (*delimiter == '\0') { + // -XX:FlightRecorderOptions without any delimiter and values + } else { + // -XX:FlightRecorderOptions[=|:] + // set delimiter to '=' + *delimiter = '='; + } + return false; +} + +static GrowableArray* startup_recording_options_array = NULL; -bool JfrOptionSet::parse_start_flight_recording_option(const JavaVMOption** option, char* tail) { +bool JfrOptionSet::parse_start_flight_recording_option(const JavaVMOption** option, char* delimiter) { assert(option != NULL, "invariant"); - assert(tail != NULL, "invariant"); + assert(delimiter != NULL, "invariant"); assert((*option)->optionString != NULL, "invariant"); assert(strncmp((*option)->optionString, "-XX:StartFlightRecording", 24) == 0, "invariant"); - const char* param_string = NULL; - if (*tail == '\0') { - // Add dummy dumponexit=false so -XX:StartFlightRecording can be used without a parameter. + const char* value = NULL; + if (*delimiter == '\0') { + // -XX:StartFlightRecording without any delimiter and values + // Add dummy value "dumponexit=false" so -XX:StartFlightRecording can be used without explicit values. // The existing option->optionString points to stack memory so no need to deallocate. const_cast(*option)->optionString = (char*)"-XX:StartFlightRecording=dumponexit=false"; - param_string = (*option)->optionString + 25; + value = (*option)->optionString + 25; } else { - *tail = '='; // ":" -> "=" - param_string = tail + 1; + // -XX:StartFlightRecording[=|:] + // set delimiter to '=' + *delimiter = '='; + value = delimiter + 1; } - assert(param_string != NULL, "invariant"); - const size_t param_length = strlen(param_string); + assert(value != NULL, "invariant"); + const size_t value_length = strlen(value); - if (startup_recording_array == NULL) { - startup_recording_array = new (ResourceObj::C_HEAP, mtTracing) GrowableArray(8, true, mtTracing); + if (startup_recording_options_array == NULL) { + startup_recording_options_array = new (ResourceObj::C_HEAP, mtTracing) GrowableArray(8, true, mtTracing); } - assert(startup_recording_array != NULL, "invariant"); - char* startup_options = NEW_C_HEAP_ARRAY(char, param_length + 1, mtTracing); - strncpy(startup_options, param_string, strlen(param_string) + 1); - assert(strncmp(param_string, startup_options, param_length) == 0, "invariant"); - startup_recording_array->append(startup_options); + assert(startup_recording_options_array != NULL, "invariant"); + char* const startup_value = NEW_C_HEAP_ARRAY(char, value_length + 1, mtTracing); + strncpy(startup_value, value, value_length + 1); + assert(strncmp(startup_value, value, value_length) == 0, "invariant"); + startup_recording_options_array->append(startup_value); return false; } -const GrowableArray* JfrOptionSet::startup_recordings() { - return startup_recording_array; +const GrowableArray* JfrOptionSet::startup_recording_options() { + return startup_recording_options_array; } -void JfrOptionSet::release_startup_recordings() { - if (startup_recording_array != NULL) { - for (int i = 0; i < startup_recording_array->length(); ++i) { - FREE_C_HEAP_ARRAY(char, startup_recording_array->at(i)); +void JfrOptionSet::release_startup_recording_options() { + if (startup_recording_options_array != NULL) { + const int length = startup_recording_options_array->length(); + for (int i = 0; i < length; ++i) { + FREE_C_HEAP_ARRAY(char, startup_recording_options_array->at(i)); } + delete startup_recording_options_array; + startup_recording_options_array = NULL; } - delete startup_recording_array; - DEBUG_ONLY(startup_recording_array = NULL;) } - -bool JfrOptionSet::parse_flight_recorder_option(const JavaVMOption** option, char* tail) { - assert(option != NULL, "invariant"); - assert(tail != NULL, "invariant"); - assert((*option)->optionString != NULL, "invariant"); - assert(strncmp((*option)->optionString, "-XX:FlightRecorderOptions", 25) == 0, "invariant"); - if (tail != NULL) { - *tail = '='; // ":" -> "=" - } - return false; -} - diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/service/jfrOptionSet.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -78,11 +78,10 @@ static bool sample_protection(); DEBUG_ONLY(static void set_sample_protection(jboolean protection);) - static bool parse_start_flight_recording_option(const JavaVMOption** option, char* tail); - static bool parse_flight_recorder_option(const JavaVMOption** option, char* tail); - - static const GrowableArray* startup_recordings(); - static void release_startup_recordings(); + static bool parse_flight_recorder_option(const JavaVMOption** option, char* delimiter); + static bool parse_start_flight_recording_option(const JavaVMOption** option, char* delimiter); + static const GrowableArray* startup_recording_options(); + static void release_startup_recording_options(); }; #endif // SHARE_VM_JFR_RECORDER_SERVICE_JFROPTIONSET_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/storage/jfrBuffer.hpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/storage/jfrBuffer.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/storage/jfrBuffer.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/storage/jfrBuffer.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_JFR_RECORDER_STORAGE_JFRBUFFER_HPP #define SHARE_VM_JFR_RECORDER_STORAGE_JFRBUFFER_HPP -#include "jni.h" #include "memory/allocation.hpp" // @@ -34,7 +33,7 @@ // u1* _pos <-- next store position // u1* _top <-- next unflushed position // -// const void* _identity <<-- acquired by +// const void* _identity <-- acquired by // // Must be the owner before attempting stores. // Use acquire() and/or try_acquire() for exclusive access diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -24,13 +24,11 @@ #include "precompiled.hpp" #include "jfr/recorder/stringpool/jfrStringPoolBuffer.hpp" -#include "runtime/atomic.hpp" -#include "runtime/orderAccess.hpp" -#include "runtime/thread.inline.hpp" JfrStringPoolBuffer::JfrStringPoolBuffer() : JfrBuffer(), _string_count_pos(0), _string_count_top(0) {} void JfrStringPoolBuffer::reinitialize() { + assert(acquired_by_self() || retired(), "invariant"); concurrent_top(); set_pos((start())); set_string_pos(0); @@ -39,35 +37,31 @@ } uint64_t JfrStringPoolBuffer::string_pos() const { - return OrderAccess::load_acquire(&_string_count_pos); + assert(acquired_by_self() || retired(), "invariant"); + return _string_count_pos; } uint64_t JfrStringPoolBuffer::string_top() const { - return OrderAccess::load_acquire(&_string_count_top); + assert(acquired_by_self() || retired(), "invariant"); + return _string_count_top; } uint64_t JfrStringPoolBuffer::string_count() const { + assert(acquired_by_self() || retired(), "invariant"); return string_pos() - string_top(); } void JfrStringPoolBuffer::set_string_pos(uint64_t value) { - Atomic::store(value, &_string_count_pos); + assert(acquired_by_self() || retired(), "invariant"); + _string_count_pos = value; } void JfrStringPoolBuffer::increment(uint64_t value) { -#if !(defined(ARM) || defined(IA32)) - Atomic::add(value, &_string_count_pos); -#else - // TODO: This should be fixed in Atomic::add handling for 32-bit platforms, - // see JDK-8203283. We workaround the absence of support right here. - uint64_t cur, val; - do { - cur = Atomic::load(&_string_count_top); - val = cur + value; - } while (Atomic::cmpxchg(val, &_string_count_pos, cur) != cur); -#endif + assert(acquired_by_self() || retired(), "invariant"); + ++_string_count_pos; } void JfrStringPoolBuffer::set_string_top(uint64_t value) { - Atomic::store(value, &_string_count_top); + assert(acquired_by_self() || retired(), "invariant"); + _string_count_top = value; } diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.hpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/stringpool/jfrStringPoolBuffer.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,6 @@ #define SHARE_VM_JFR_RECORDER_STRINGPOOL_JFRSTRINGPOOLBUFFER_HPP #include "jfr/recorder/storage/jfrBuffer.hpp" -#include "utilities/globalDefinitions.hpp" class JfrStringPoolBuffer : public JfrBuffer { private: diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp openjdk-11-11~24/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/recorder/stringpool/jfrStringPool.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -151,7 +151,7 @@ StringPoolWriteOp(JfrChunkWriter& writer, Thread* thread) : _writer(writer), _thread(thread), _strings_processed(0) {} bool write(Type* buffer, const u1* data, size_t size) { buffer->acquire(_thread); // blocking - const u4 nof_strings_used = (const u4)buffer->string_count(); + const uint64_t nof_strings_used = buffer->string_count(); assert(nof_strings_used > 0, "invariant"); buffer->set_string_top(buffer->string_top() + nof_strings_used); // "size processed" for string pool buffers is the number of processed string elements @@ -208,10 +208,10 @@ return true; } buffer->set_top(current_top + unflushed_size); - const u4 nof_strings_used = buffer->string_count(); + const uint64_t nof_strings_used = buffer->string_count(); buffer->set_string_top(buffer->string_top() + nof_strings_used); // "size processed" for string pool buffers is the number of string elements - _processed += nof_strings_used; + _processed += (size_t)nof_strings_used; buffer->release(); return true; } diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/support/jfrThreadLocal.cpp openjdk-11-11~24/src/hotspot/share/jfr/support/jfrThreadLocal.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/support/jfrThreadLocal.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/support/jfrThreadLocal.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -23,8 +23,9 @@ */ #include "precompiled.hpp" -#include "jfr/periodic/jfrThreadCPULoadEvent.hpp" #include "jfr/jni/jfrJavaSupport.hpp" +#include "jfr/periodic/jfrThreadCPULoadEvent.hpp" +#include "jfr/recorder/jfrRecorder.hpp" #include "jfr/recorder/checkpoint/jfrCheckpointManager.hpp" #include "jfr/recorder/checkpoint/types/traceid/jfrTraceId.inline.hpp" #include "jfr/recorder/service/jfrOptionSet.hpp" @@ -51,7 +52,8 @@ _wallclock_time(os::javaTimeNanos()), _stack_trace_hash(0), _stackdepth(0), - _entering_suspend_flag(0) {} + _entering_suspend_flag(0), + _dead(false) {} u8 JfrThreadLocal::add_data_lost(u8 value) { _data_lost += value; @@ -71,9 +73,17 @@ return _thread_cp; } +void JfrThreadLocal::set_dead() { + assert(!is_dead(), "invariant"); + _dead = true; +} + void JfrThreadLocal::on_exit(JavaThread* thread) { - JfrCheckpointManager::write_thread_checkpoint(thread); - JfrThreadCPULoadEvent::send_event_for_thread(thread); + if (JfrRecorder::is_recording()) { + JfrCheckpointManager::write_thread_checkpoint(thread); + JfrThreadCPULoadEvent::send_event_for_thread(thread); + } + thread->jfr_thread_local()->set_dead(); } void JfrThreadLocal::on_destruct(Thread* thread) { diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/support/jfrThreadLocal.hpp openjdk-11-11~24/src/hotspot/share/jfr/support/jfrThreadLocal.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/support/jfrThreadLocal.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/support/jfrThreadLocal.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -50,11 +50,14 @@ unsigned int _stack_trace_hash; mutable u4 _stackdepth; volatile jint _entering_suspend_flag; + bool _dead; JfrBuffer* install_native_buffer() const; JfrBuffer* install_java_buffer() const; JfrStackFrame* install_stackframes() const; + void set_dead(); + public: JfrThreadLocal(); @@ -202,6 +205,10 @@ _trace_id = id; } + bool is_dead() const { + return _dead; + } + bool has_thread_checkpoint() const; void set_thread_checkpoint(const JfrCheckpointBlobHandle& handle); const JfrCheckpointBlobHandle& thread_checkpoint() const; diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/utilities/jfrAllocation.cpp openjdk-11-11~24/src/hotspot/share/jfr/utilities/jfrAllocation.cpp --- openjdk-11-11~19/src/hotspot/share/jfr/utilities/jfrAllocation.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/utilities/jfrAllocation.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -53,8 +53,8 @@ static void add(size_t alloc_size) { if (!JfrRecorder::is_created()) { - const jlong total_allocated = atomic_add_jlong(alloc_size, &_allocated_bytes); - const jlong current_live_set = atomic_add_jlong(alloc_size, &_live_set_bytes); + const jlong total_allocated = atomic_add_jlong((jlong)alloc_size, &_allocated_bytes); + const jlong current_live_set = atomic_add_jlong((jlong)alloc_size, &_live_set_bytes); log_trace(jfr, system)("Allocation: [" SIZE_FORMAT "] bytes", alloc_size); log_trace(jfr, system)("Total alloc [" JLONG_FORMAT "] bytes", total_allocated); log_trace(jfr, system)("Liveset: [" JLONG_FORMAT "] bytes", current_live_set); @@ -63,11 +63,11 @@ static void subtract(size_t dealloc_size) { if (!JfrRecorder::is_created()) { - const size_t total_deallocated = atomic_add_jlong(dealloc_size, &_deallocated_bytes); - const size_t current_live_set = atomic_add_jlong(dealloc_size * -1, &_live_set_bytes); + const jlong total_deallocated = atomic_add_jlong((jlong)dealloc_size, &_deallocated_bytes); + const jlong current_live_set = atomic_add_jlong(((jlong)dealloc_size * -1), &_live_set_bytes); log_trace(jfr, system)("Deallocation: [" SIZE_FORMAT "] bytes", dealloc_size); - log_trace(jfr, system)("Total dealloc [" SIZE_FORMAT "] bytes", total_deallocated); - log_trace(jfr, system)("Liveset: [" SIZE_FORMAT "] bytes", current_live_set); + log_trace(jfr, system)("Total dealloc [" JLONG_FORMAT "] bytes", total_deallocated); + log_trace(jfr, system)("Liveset: [" JLONG_FORMAT "] bytes", current_live_set); } } diff -Nru openjdk-11-11~19/src/hotspot/share/jfr/utilities/jfrLogTagSets.hpp openjdk-11-11~24/src/hotspot/share/jfr/utilities/jfrLogTagSets.hpp --- openjdk-11-11~19/src/hotspot/share/jfr/utilities/jfrLogTagSets.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jfr/utilities/jfrLogTagSets.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -55,7 +55,8 @@ JFR_LOG_TAG(jfr, system, metadata) \ JFR_LOG_TAG(jfr, metadata) \ JFR_LOG_TAG(jfr, event) \ - JFR_LOG_TAG(jfr, setting) + JFR_LOG_TAG(jfr, setting) \ + JFR_LOG_TAG(jfr, dcmd) /* NEW TAGS, DONT FORGET TO UPDATE JAVA SIDE */ #endif // SHARE_VM_JFR_UTILITIES_JFRLOGTAGSETS_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCodeInstaller.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -234,8 +234,10 @@ vmassert(index + 1 == newCount, "must be last"); - Klass* klass = NULL; + JVMCIKlassHandle klass(THREAD); oop result = NULL; + guarantee(h != NULL, + "If DebugInformationRecorder::describe_scope passes NULL oldCount == newCount must hold."); if (h->is_klass()) { klass = (Klass*) h; result = CompilerToVM::get_jvmci_type(klass, CATCH); @@ -966,8 +968,8 @@ } void CodeInstaller::assumption_CallSiteTargetValue(Thread* thread, Handle assumption) { - Handle callSite(thread, Assumptions_CallSiteTargetValue::callSite(assumption())); - Handle methodHandle(thread, Assumptions_CallSiteTargetValue::methodHandle(assumption())); + Handle callSite(thread, HotSpotObjectConstantImpl::object(Assumptions_CallSiteTargetValue::callSite(assumption()))); + Handle methodHandle(thread, HotSpotObjectConstantImpl::object(Assumptions_CallSiteTargetValue::methodHandle(assumption()))); _dependencies->assert_call_site_target_value(callSite(), methodHandle()); } @@ -1048,6 +1050,26 @@ record_scope(pc_offset, position, scope_mode, objectMapping, return_oop, CHECK); } +int CodeInstaller::map_jvmci_bci(int bci) { + if (bci < 0) { + if (bci == BytecodeFrame::BEFORE_BCI()) { + return BeforeBci; + } else if (bci == BytecodeFrame::AFTER_BCI()) { + return AfterBci; + } else if (bci == BytecodeFrame::UNWIND_BCI()) { + return UnwindBci; + } else if (bci == BytecodeFrame::AFTER_EXCEPTION_BCI()) { + return AfterExceptionBci; + } else if (bci == BytecodeFrame::UNKNOWN_BCI()) { + return UnknownBci; + } else if (bci == BytecodeFrame::INVALID_FRAMESTATE_BCI()) { + return InvalidFrameStateBci; + } + ShouldNotReachHere(); + } + return bci; +} + void CodeInstaller::record_scope(jint pc_offset, Handle position, ScopeMode scope_mode, GrowableArray* objects, bool return_oop, TRAPS) { Handle frame; if (scope_mode == CodeInstaller::FullFrame) { @@ -1063,16 +1085,13 @@ Handle hotspot_method (THREAD, BytecodePosition::method(position)); Method* method = getMethodFromHotSpotMethod(hotspot_method()); - jint bci = BytecodePosition::bci(position); - if (bci == BytecodeFrame::BEFORE_BCI()) { - bci = SynchronizationEntryBCI; - } + jint bci = map_jvmci_bci(BytecodePosition::bci(position)); TRACE_jvmci_2("Recording scope pc_offset=%d bci=%d method=%s", pc_offset, bci, method->name_and_sig_as_C_string()); bool reexecute = false; if (frame.not_null()) { - if (bci == SynchronizationEntryBCI){ + if (bci < 0) { reexecute = false; } else { Bytecodes::Code code = Bytecodes::java_code_at(method, method->bcp_from(bci)); diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCodeInstaller.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -255,6 +255,7 @@ FullFrame }; + int map_jvmci_bci(int bci); void record_scope(jint pc_offset, Handle debug_info, ScopeMode scope_mode, bool return_oop, TRAPS); void record_scope(jint pc_offset, Handle debug_info, ScopeMode scope_mode, TRAPS) { record_scope(pc_offset, debug_info, scope_mode, false /* return_oop */, THREAD); diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompiler.cpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompiler.cpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompiler.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompiler.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -215,8 +215,10 @@ Handle ex(THREAD, exception); java_lang_Throwable::java_printStackTrace(ex, THREAD); } else { - // Allow error reporting thread to print the stack trace. - os::sleep(THREAD, 200, false); + // Allow error reporting thread to print the stack trace. Windows + // doesn't allow uninterruptible wait for JavaThreads + const bool interruptible = true; + os::sleep(THREAD, 200, interruptible); } before_exit(THREAD); @@ -228,13 +230,6 @@ ShouldNotReachHere(); } -bool JVMCICompiler::is_trivial(Method* method) { - if (_bootstrapping) { - return false; - } - return JVMCIRuntime::treat_as_trivial(method); -} - // Print compilation timers and statistics void JVMCICompiler::print_timers() { print_compilation_timers(); diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompiler.hpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompiler.hpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompiler.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompiler.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -92,8 +92,6 @@ void compile_method(const methodHandle& target, int entry_bci, JVMCIEnv* env); - virtual bool is_trivial(Method* method); - // Print compilation timers and statistics virtual void print_timers(); diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompilerToVM.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -44,6 +44,21 @@ #include "runtime/timerTrace.hpp" #include "runtime/vframe_hp.hpp" +JVMCIKlassHandle::JVMCIKlassHandle(Thread* thread, Klass* klass) { + _thread = thread; + _klass = klass; + if (klass != NULL) { + _holder = Handle(_thread, klass->holder_phantom()); + } +} + +JVMCIKlassHandle& JVMCIKlassHandle::operator=(Klass* klass) { + _klass = klass; + if (klass != NULL) { + _holder = Handle(_thread, klass->holder_phantom()); + } + return *this; +} void JNIHandleMark::push_jni_handle_block() { JavaThread* thread = JavaThread::current(); @@ -91,8 +106,8 @@ return NULL; } -oop CompilerToVM::get_jvmci_type(Klass* klass, TRAPS) { - if (klass != NULL) { +oop CompilerToVM::get_jvmci_type(JVMCIKlassHandle& klass, TRAPS) { + if (!klass.is_null()) { JavaValue result(T_OBJECT); JavaCallArguments args; args.push_oop(Handle(THREAD, klass->java_mirror())); @@ -311,7 +326,7 @@ } C2V_VMENTRY(jobject, getResolvedJavaType, (JNIEnv *, jobject, jobject base, jlong offset, jboolean compressed)) - Klass* klass = NULL; + JVMCIKlassHandle klass(THREAD); oop base_object = JNIHandles::resolve(base); jlong base_address = 0; if (base_object != NULL && offset == oopDesc::klass_offset_in_bytes()) { @@ -334,7 +349,9 @@ klass = *((Klass**) (intptr_t) (base_address + offset)); } else { THROW_MSG_0(vmSymbols::java_lang_IllegalArgumentException(), - err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s", base_object->klass()->external_name(), offset, compressed ? "true" : "false")); + err_msg("Unexpected arguments: %s " JLONG_FORMAT " %s", + base_object != NULL ? base_object->klass()->external_name() : "null", + offset, compressed ? "true" : "false")); } assert (klass == NULL || klass->is_klass(), "invalid read"); oop result = CompilerToVM::get_jvmci_type(klass, CHECK_NULL); @@ -365,7 +382,8 @@ err_msg("Expected interface type, got %s", klass->external_name())); } InstanceKlass* iklass = InstanceKlass::cast(klass); - oop implementor = CompilerToVM::get_jvmci_type(iklass->implementor(), CHECK_NULL); + JVMCIKlassHandle handle(THREAD, iklass->implementor()); + oop implementor = CompilerToVM::get_jvmci_type(handle, CHECK_NULL); return JNIHandles::make_local(THREAD, implementor); C2V_END @@ -400,7 +418,7 @@ THROW_MSG_0(vmSymbols::java_lang_InternalError(), err_msg("Primitive type %s should be handled in Java code", class_name->as_C_string())); } - Klass* resolved_klass = NULL; + JVMCIKlassHandle resolved_klass(THREAD); if (JNIHandles::resolve(accessing_class) == NULL) { THROW_0(vmSymbols::java_lang_NullPointerException()); } @@ -433,12 +451,11 @@ class_loader, protection_domain, CHECK_0); - if (resolved_klass != NULL) { + if (!resolved_klass.is_null()) { resolved_klass = resolved_klass->array_klass(fd.dimension(), CHECK_0); } } else { - resolved_klass = Universe::typeArrayKlassObj(t); - resolved_klass = TypeArrayKlass::cast(resolved_klass)->array_klass(fd.dimension(), CHECK_0); + resolved_klass = TypeArrayKlass::cast(Universe::typeArrayKlassObj(t))->array_klass(fd.dimension(), CHECK_0); } } } @@ -482,25 +499,26 @@ C2V_VMENTRY(jobject, resolveTypeInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index)) constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); - Klass* resolved_klass = cp->klass_at(index, CHECK_NULL); + Klass* klass = cp->klass_at(index, CHECK_NULL); + JVMCIKlassHandle resolved_klass(THREAD, klass); if (resolved_klass->is_instance_klass()) { - InstanceKlass::cast(resolved_klass)->link_class_or_fail(THREAD); + InstanceKlass::cast(resolved_klass())->link_class_or_fail(THREAD); } - oop klass = CompilerToVM::get_jvmci_type(resolved_klass, CHECK_NULL); - return JNIHandles::make_local(THREAD, klass); + oop jvmci_type = CompilerToVM::get_jvmci_type(resolved_klass, CHECK_NULL); + return JNIHandles::make_local(THREAD, jvmci_type); C2V_END C2V_VMENTRY(jobject, lookupKlassInPool, (JNIEnv*, jobject, jobject jvmci_constant_pool, jint index, jbyte opcode)) constantPoolHandle cp = CompilerToVM::asConstantPool(jvmci_constant_pool); Klass* loading_klass = cp->pool_holder(); bool is_accessible = false; - Klass* klass = JVMCIEnv::get_klass_by_index(cp, index, is_accessible, loading_klass); + JVMCIKlassHandle klass(THREAD, JVMCIEnv::get_klass_by_index(cp, index, is_accessible, loading_klass)); Symbol* symbol = NULL; if (klass == NULL) { symbol = cp->klass_name_at(index); } oop result_oop; - if (klass != NULL) { + if (!klass.is_null()) { result_oop = CompilerToVM::get_jvmci_type(klass, CHECK_NULL); } else { Handle result = java_lang_String::create_from_symbol(symbol, CHECK_NULL); @@ -543,7 +561,8 @@ info->int_at_put(0, fd.access_flags().as_int()); info->int_at_put(1, fd.offset()); info->int_at_put(2, fd.index()); - oop field_holder = CompilerToVM::get_jvmci_type(fd.field_holder(), CHECK_NULL); + JVMCIKlassHandle handle(THREAD, fd.field_holder()); + oop field_holder = CompilerToVM::get_jvmci_type(handle, CHECK_NULL); return JNIHandles::make_local(THREAD, field_holder); C2V_END @@ -1413,7 +1432,8 @@ C2V_VMENTRY(jobject, getHostClass, (JNIEnv*, jobject, jobject jvmci_type)) InstanceKlass* k = InstanceKlass::cast(CompilerToVM::asKlass(jvmci_type)); InstanceKlass* host = k->host_klass(); - oop result = CompilerToVM::get_jvmci_type(host, CHECK_NULL); + JVMCIKlassHandle handle(THREAD, host); + oop result = CompilerToVM::get_jvmci_type(handle, CHECK_NULL); return JNIHandles::make_local(THREAD, result); C2V_END diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompilerToVM.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -28,6 +28,37 @@ #include "runtime/javaCalls.hpp" #include "jvmci/jvmciJavaClasses.hpp" +// Helper class to ensure that references to Klass* are kept alive for G1 +class JVMCIKlassHandle : public StackObj { + private: + Klass* _klass; + Handle _holder; + Thread* _thread; + + Klass* klass() const { return _klass; } + Klass* non_null_klass() const { assert(_klass != NULL, "resolving NULL _klass"); return _klass; } + + public: + /* Constructors */ + JVMCIKlassHandle (Thread* thread) : _klass(NULL), _thread(thread) {} + JVMCIKlassHandle (Thread* thread, Klass* klass); + + JVMCIKlassHandle (const JVMCIKlassHandle &h): _klass(h._klass), _holder(h._holder), _thread(h._thread) {} + JVMCIKlassHandle& operator=(const JVMCIKlassHandle &s); + JVMCIKlassHandle& operator=(Klass* klass); + + /* Operators for ease of use */ + Klass* operator () () const { return klass(); } + Klass* operator -> () const { return non_null_klass(); } + + bool operator == (Klass* o) const { return klass() == o; } + bool operator == (const JVMCIKlassHandle& h) const { return klass() == h.klass(); } + + /* Null checks */ + bool is_null() const { return _klass == NULL; } + bool not_null() const { return _klass != NULL; } +}; + class CompilerToVM { public: class Data { @@ -161,7 +192,7 @@ static oop get_jvmci_method(const methodHandle& method, TRAPS); - static oop get_jvmci_type(Klass* klass, TRAPS); + static oop get_jvmci_type(JVMCIKlassHandle& klass, TRAPS); }; class JavaArgumentUnboxer : public SignatureIterator { diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciCompilerToVMInit.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -234,10 +234,15 @@ do_bool_flag(UseCRC32Intrinsics) \ do_bool_flag(UseCompressedClassPointers) \ do_bool_flag(UseCompressedOops) \ - do_bool_flag(UseConcMarkSweepGC) \ X86_ONLY(do_bool_flag(UseCountLeadingZerosInstruction)) \ X86_ONLY(do_bool_flag(UseCountTrailingZerosInstruction)) \ + do_bool_flag(UseConcMarkSweepGC) \ do_bool_flag(UseG1GC) \ + do_bool_flag(UseParallelGC) \ + do_bool_flag(UseParallelOldGC) \ + do_bool_flag(UseSerialGC) \ + do_bool_flag(UseZGC) \ + do_bool_flag(UseEpsilonGC) \ COMPILER2_PRESENT(do_bool_flag(UseMontgomeryMultiplyIntrinsic)) \ COMPILER2_PRESENT(do_bool_flag(UseMontgomerySquareIntrinsic)) \ COMPILER2_PRESENT(do_bool_flag(UseMulAddIntrinsic)) \ diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciJavaClasses.hpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciJavaClasses.hpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciJavaClasses.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciJavaClasses.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -147,8 +147,8 @@ oop_field(Assumptions_ConcreteMethod, impl, "Ljdk/vm/ci/meta/ResolvedJavaMethod;") \ end_class \ start_class(Assumptions_CallSiteTargetValue) \ - oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljava/lang/invoke/CallSite;") \ - oop_field(Assumptions_CallSiteTargetValue, methodHandle, "Ljava/lang/invoke/MethodHandle;") \ + oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljdk/vm/ci/meta/JavaConstant;") \ + oop_field(Assumptions_CallSiteTargetValue, methodHandle, "Ljdk/vm/ci/meta/JavaConstant;") \ end_class \ start_class(site_Site) \ int_field(site_Site, pcOffset) \ @@ -210,7 +210,12 @@ int_field(BytecodeFrame, numLocks) \ boolean_field(BytecodeFrame, rethrowException) \ boolean_field(BytecodeFrame, duringCall) \ + static_int_field(BytecodeFrame, UNKNOWN_BCI) \ + static_int_field(BytecodeFrame, UNWIND_BCI) \ static_int_field(BytecodeFrame, BEFORE_BCI) \ + static_int_field(BytecodeFrame, AFTER_BCI) \ + static_int_field(BytecodeFrame, AFTER_EXCEPTION_BCI) \ + static_int_field(BytecodeFrame, INVALID_FRAMESTATE_BCI) \ end_class \ start_class(BytecodePosition) \ oop_field(BytecodePosition, caller, "Ljdk/vm/ci/code/BytecodePosition;") \ @@ -283,7 +288,7 @@ boolean_field(StackLockValue, eliminated) \ end_class \ start_class(HotSpotSpeculationLog) \ - oop_field(HotSpotSpeculationLog, lastFailed, "Ljava/lang/Object;") \ + long_field(HotSpotSpeculationLog, lastFailed) \ end_class \ start_class(HotSpotStackFrameReference) \ oop_field(HotSpotStackFrameReference, compilerToVM, "Ljdk/vm/ci/hotspot/CompilerToVM;") \ @@ -307,7 +312,6 @@ long_field(HotSpotConstantPool, metaspaceConstantPool) \ end_class \ start_class(HotSpotJVMCIRuntime) \ - objArrayOop_field(HotSpotJVMCIRuntime, trivialPrefixes, "[Ljava/lang/String;") \ int_field(HotSpotJVMCIRuntime, compilationLevelAdjustment) \ end_class \ /* end*/ diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciRuntime.cpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciRuntime.cpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciRuntime.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciRuntime.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -61,8 +61,6 @@ jobject JVMCIRuntime::_HotSpotJVMCIRuntime_instance = NULL; bool JVMCIRuntime::_HotSpotJVMCIRuntime_initialized = false; bool JVMCIRuntime::_well_known_classes_initialized = false; -int JVMCIRuntime::_trivial_prefixes_count = 0; -char** JVMCIRuntime::_trivial_prefixes = NULL; JVMCIRuntime::CompLevelAdjustment JVMCIRuntime::_comp_level_adjustment = JVMCIRuntime::none; bool JVMCIRuntime::_shutdown_called = false; @@ -536,11 +534,9 @@ PRAGMA_DIAG_PUSH PRAGMA_FORMAT_NONLITERAL_IGNORED -JRT_LEAF(void, JVMCIRuntime::log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3)) +JRT_LEAF(void, JVMCIRuntime::log_printf(JavaThread* thread, const char* format, jlong v1, jlong v2, jlong v3)) ResourceMark rm; - assert(format != NULL && java_lang_String::is_instance(format), "must be"); - char *buf = java_lang_String::as_utf8_string(format); - tty->print((const char*)buf, v1, v2, v3); + tty->print(format, v1, v2, v3); JRT_END PRAGMA_DIAG_POP @@ -685,20 +681,6 @@ Handle result = callStatic("jdk/vm/ci/hotspot/HotSpotJVMCIRuntime", "runtime", "()Ljdk/vm/ci/hotspot/HotSpotJVMCIRuntime;", NULL, CHECK); - objArrayOop trivial_prefixes = HotSpotJVMCIRuntime::trivialPrefixes(result); - if (trivial_prefixes != NULL) { - char** prefixes = NEW_C_HEAP_ARRAY(char*, trivial_prefixes->length(), mtCompiler); - for (int i = 0; i < trivial_prefixes->length(); i++) { - oop str = trivial_prefixes->obj_at(i); - if (str == NULL) { - THROW(vmSymbols::java_lang_NullPointerException()); - } else { - prefixes[i] = strdup(java_lang_String::as_utf8_string(str)); - } - } - _trivial_prefixes = prefixes; - _trivial_prefixes_count = trivial_prefixes->length(); - } int adjustment = HotSpotJVMCIRuntime::compilationLevelAdjustment(result); assert(adjustment >= JVMCIRuntime::none && adjustment <= JVMCIRuntime::by_full_signature, @@ -918,14 +900,3 @@ args.push_oop(receiver); JavaCalls::call_special(&result, receiver->klass(), vmSymbols::bootstrapFinished_method_name(), vmSymbols::void_method_signature(), &args, CHECK); } - -bool JVMCIRuntime::treat_as_trivial(Method* method) { - if (_HotSpotJVMCIRuntime_initialized) { - for (int i = 0; i < _trivial_prefixes_count; i++) { - if (method->method_holder()->name()->starts_with(_trivial_prefixes[i])) { - return true; - } - } - } - return false; -} diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/jvmciRuntime.hpp openjdk-11-11~24/src/hotspot/share/jvmci/jvmciRuntime.hpp --- openjdk-11-11~19/src/hotspot/share/jvmci/jvmciRuntime.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/jvmciRuntime.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -56,9 +56,6 @@ static bool _HotSpotJVMCIRuntime_initialized; static bool _well_known_classes_initialized; - static int _trivial_prefixes_count; - static char** _trivial_prefixes; - static CompLevelAdjustment _comp_level_adjustment; static bool _shutdown_called; @@ -110,8 +107,6 @@ return _shutdown_called; } - static bool treat_as_trivial(Method* method); - /** * Lets JVMCI modify the compilation level currently selected for a method by * the VM compilation policy. @@ -143,7 +138,7 @@ static jboolean object_notifyAll(JavaThread* thread, oopDesc* obj); static void vm_error(JavaThread* thread, jlong where, jlong format, jlong value); static oopDesc* load_and_clear_exception(JavaThread* thread); - static void log_printf(JavaThread* thread, oopDesc* format, jlong v1, jlong v2, jlong v3); + static void log_printf(JavaThread* thread, const char* format, jlong v1, jlong v2, jlong v3); static void log_primitive(JavaThread* thread, jchar typeChar, jlong value, jboolean newline); // Print the passed in object, optionally followed by a newline. If // as_string is true and the object is a java.lang.String then it diff -Nru openjdk-11-11~19/src/hotspot/share/jvmci/vmStructs_jvmci.cpp openjdk-11-11~24/src/hotspot/share/jvmci/vmStructs_jvmci.cpp --- openjdk-11-11~19/src/hotspot/share/jvmci/vmStructs_jvmci.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/jvmci/vmStructs_jvmci.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -176,7 +176,7 @@ volatile_nonstatic_field(JavaThread, _is_method_handle_return, int) \ nonstatic_field(JavaThread, _osthread, OSThread*) \ nonstatic_field(JavaThread, _pending_deoptimization, int) \ - nonstatic_field(JavaThread, _pending_failed_speculation, oop) \ + nonstatic_field(JavaThread, _pending_failed_speculation, long) \ nonstatic_field(JavaThread, _pending_transfer_to_interpreter, bool) \ nonstatic_field(JavaThread, _jvmci_counters, jlong*) \ nonstatic_field(JavaThread, _reserved_stack_activation, address) \ @@ -299,6 +299,7 @@ static_field(StubRoutines, _cipherBlockChaining_encryptAESCrypt, address) \ static_field(StubRoutines, _cipherBlockChaining_decryptAESCrypt, address) \ static_field(StubRoutines, _counterMode_AESCrypt, address) \ + static_field(StubRoutines, _base64_encodeBlock, address) \ static_field(StubRoutines, _ghash_processBlocks, address) \ static_field(StubRoutines, _sha1_implCompress, address) \ static_field(StubRoutines, _sha1_implCompressMB, address) \ diff -Nru openjdk-11-11~19/src/hotspot/share/logging/logOutput.cpp openjdk-11-11~24/src/hotspot/share/logging/logOutput.cpp --- openjdk-11-11~19/src/hotspot/share/logging/logOutput.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/logging/logOutput.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -262,7 +262,9 @@ while (n_deviates > 0) { size_t prev_deviates = n_deviates; int max_score = 0; - const LogSelection* best_selection = NULL; + + guarantee(n_selections > 0, "Cannot find maximal selection."); + const LogSelection* best_selection = &selections[0]; for (size_t i = 0; i < n_selections; i++) { // Give the selection a score based on how many deviating tag sets it selects (with correct level) @@ -287,13 +289,12 @@ // Pick the selection with the best score, or in the case of a tie, the one with fewest tags if (score > max_score || - (score == max_score && best_selection != NULL && selections[i].ntags() < best_selection->ntags())) { + (score == max_score && selections[i].ntags() < best_selection->ntags())) { max_score = score; best_selection = &selections[i]; } } - assert(best_selection != NULL, "must always find a maximal selection"); add_to_config_string(*best_selection); // Remove all deviates that this selection covered diff -Nru openjdk-11-11~19/src/hotspot/share/logging/logTag.hpp openjdk-11-11~24/src/hotspot/share/logging/logTag.hpp --- openjdk-11-11~19/src/hotspot/share/logging/logTag.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/logging/logTag.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -44,6 +44,7 @@ LOG_TAG(blocks) \ LOG_TAG(bot) \ LOG_TAG(breakpoint) \ + LOG_TAG(bytecode) \ LOG_TAG(cds) \ LOG_TAG(census) \ LOG_TAG(class) \ @@ -60,11 +61,13 @@ LOG_TAG(cset) \ LOG_TAG(data) \ LOG_TAG(datacreation) \ + LOG_TAG(dcmd) \ LOG_TAG(decoder) \ LOG_TAG(defaultmethods) \ LOG_TAG(director) \ LOG_TAG(dump) \ LOG_TAG(ergo) \ + LOG_TAG(event) \ LOG_TAG(exceptions) \ LOG_TAG(exit) \ LOG_TAG(fingerprint) \ @@ -81,6 +84,7 @@ LOG_TAG(inlining) \ LOG_TAG(interpreter) \ LOG_TAG(itables) \ + LOG_TAG(jfr) \ LOG_TAG(jit) \ LOG_TAG(jni) \ LOG_TAG(jvmti) \ @@ -100,10 +104,12 @@ LOG_TAG(module) \ LOG_TAG(monitorinflation) \ LOG_TAG(monitormismatch) \ + LOG_TAG(nestmates) \ LOG_TAG(nmethod) \ LOG_TAG(normalize) \ LOG_TAG(objecttagging) \ LOG_TAG(obsolete) \ + LOG_TAG(oldobject) \ LOG_TAG(oom) \ LOG_TAG(oopmap) \ LOG_TAG(oops) \ @@ -125,10 +131,13 @@ LOG_TAG(region) \ LOG_TAG(reloc) \ LOG_TAG(remset) \ + LOG_TAG(parser) \ LOG_TAG(purge) \ LOG_TAG(resolve) \ LOG_TAG(safepoint) \ + LOG_TAG(sampling) \ LOG_TAG(scavenge) \ + LOG_TAG(setting) \ LOG_TAG(smr) \ LOG_TAG(stacktrace) \ LOG_TAG(stackwalk) \ @@ -142,6 +151,7 @@ LOG_TAG(subclass) \ LOG_TAG(survivor) \ LOG_TAG(sweep) \ + LOG_TAG(system) \ LOG_TAG(table) \ LOG_TAG(task) \ DEBUG_ONLY(LOG_TAG(test)) \ @@ -159,15 +169,7 @@ LOG_TAG(vmoperation) \ LOG_TAG(vmthread) \ LOG_TAG(vtables) \ - LOG_TAG(workgang) \ - LOG_TAG(jfr) \ - LOG_TAG(system) \ - LOG_TAG(parser) \ - LOG_TAG(bytecode) \ - LOG_TAG(setting) \ - LOG_TAG(oldobject) \ - LOG_TAG(sampling) \ - LOG_TAG(event) + LOG_TAG(workgang) LOG_TAG_LIST_EXT #define PREFIX_LOG_TAG(T) (LogTag::_##T) diff -Nru openjdk-11-11~19/src/hotspot/share/memory/filemap.cpp openjdk-11-11~24/src/hotspot/share/memory/filemap.cpp --- openjdk-11-11~19/src/hotspot/share/memory/filemap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/filemap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -631,7 +631,9 @@ si->_read_only = read_only; si->_allow_exec = allow_exec; si->_crc = ClassLoader::crc32(0, base, (jint)size); - write_bytes_aligned(base, (int)size); + if (base != NULL) { + write_bytes_aligned(base, (int)size); + } } // Write out the given archive heap memory regions. GC code combines multiple diff -Nru openjdk-11-11~19/src/hotspot/share/memory/heapInspection.hpp openjdk-11-11~24/src/hotspot/share/memory/heapInspection.hpp --- openjdk-11-11~19/src/hotspot/share/memory/heapInspection.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/heapInspection.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,6 +86,8 @@ "Number of bytes used by the InstanceKlass::fields() array") \ f(inner_classes_bytes, IK_inner_classes, \ "Number of bytes used by the InstanceKlass::inner_classes() array") \ + f(nest_members_bytes, IK_nest_members, \ + "Number of bytes used by the InstanceKlass::nest_members() array") \ f(signers_bytes, IK_signers, \ "Number of bytes used by the InstanceKlass::singers() array") \ f(class_annotations_bytes, class_annotations, \ diff -Nru openjdk-11-11~19/src/hotspot/share/memory/iterator.cpp openjdk-11-11~24/src/hotspot/share/memory/iterator.cpp --- openjdk-11-11~19/src/hotspot/share/memory/iterator.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/iterator.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -63,12 +63,3 @@ do_nmethod(nm); } } - -// Generate the *Klass::oop_oop_iterate functions for the base class -// of the oop closures. These versions use the virtual do_oop calls, -// instead of the devirtualized do_oop_nv version. -ALL_KLASS_OOP_OOP_ITERATE_DEFN(ExtendedOopClosure, _v) - -// Generate the *Klass::oop_oop_iterate functions -// for the NoHeaderExtendedOopClosure helper class. -ALL_KLASS_OOP_OOP_ITERATE_DEFN(NoHeaderExtendedOopClosure, _nv) diff -Nru openjdk-11-11~19/src/hotspot/share/memory/iterator.hpp openjdk-11-11~24/src/hotspot/share/memory/iterator.hpp --- openjdk-11-11~19/src/hotspot/share/memory/iterator.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/iterator.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -55,17 +55,17 @@ }; extern DoNothingClosure do_nothing_cl; -// ExtendedOopClosure adds extra code to be run during oop iterations. +// OopIterateClosure adds extra code to be run during oop iterations. // This is needed by the GC and is extracted to a separate type to not // pollute the OopClosure interface. -class ExtendedOopClosure : public OopClosure { +class OopIterateClosure : public OopClosure { private: ReferenceDiscoverer* _ref_discoverer; protected: - ExtendedOopClosure(ReferenceDiscoverer* rd) : _ref_discoverer(rd) { } - ExtendedOopClosure() : _ref_discoverer(NULL) { } - ~ExtendedOopClosure() { } + OopIterateClosure(ReferenceDiscoverer* rd) : _ref_discoverer(rd) { } + OopIterateClosure() : _ref_discoverer(NULL) { } + ~OopIterateClosure() { } void set_ref_discoverer_internal(ReferenceDiscoverer* rd) { _ref_discoverer = rd; } @@ -77,7 +77,8 @@ enum ReferenceIterationMode { DO_DISCOVERY, // Apply closure and discover references DO_DISCOVERED_AND_DISCOVERY, // Apply closure to discovered field and do discovery - DO_FIELDS // Apply closure to all fields + DO_FIELDS, // Apply closure to all fields + DO_FIELDS_EXCEPT_REFERENT // Apply closure to all fields except the referent field }; // The default iteration mode is to do discovery. @@ -89,27 +90,10 @@ // 1) do_klass on the header klass pointer. // 2) do_klass on the klass pointer in the mirrors. // 3) do_cld on the class loader data in class loaders. - // - // The virtual (without suffix) and the non-virtual (with _nv suffix) need - // to be updated together, or else the devirtualization will break. - // - // Providing default implementations of the _nv functions unfortunately - // removes the compile-time safeness, but reduces the clutter for the - // ExtendedOopClosures that don't need to walk the metadata. - // Currently, only CMS and G1 need these. - - bool do_metadata_nv() { return false; } - virtual bool do_metadata() { return do_metadata_nv(); } - - void do_klass_nv(Klass* k) { ShouldNotReachHere(); } - virtual void do_klass(Klass* k) { do_klass_nv(k); } - - void do_cld_nv(ClassLoaderData* cld) { ShouldNotReachHere(); } - virtual void do_cld(ClassLoaderData* cld) { do_cld_nv(cld); } - - // True iff this closure may be safely applied more than once to an oop - // location without an intervening "major reset" (like the end of a GC). - virtual bool idempotent() { return false; } + + virtual bool do_metadata() = 0; + virtual void do_klass(Klass* k) = 0; + virtual void do_cld(ClassLoaderData* cld) = 0; #ifdef ASSERT // Default verification of each visited oop field. @@ -120,19 +104,14 @@ #endif }; -// Wrapper closure only used to implement oop_iterate_no_header(). -class NoHeaderExtendedOopClosure : public ExtendedOopClosure { - OopClosure* _wrapped_closure; - public: - NoHeaderExtendedOopClosure(OopClosure* cl) : _wrapped_closure(cl) {} - // Warning: this calls the virtual version do_oop in the the wrapped closure. - void do_oop_nv(oop* p) { _wrapped_closure->do_oop(p); } - void do_oop_nv(narrowOop* p) { _wrapped_closure->do_oop(p); } - - void do_oop(oop* p) { assert(false, "Only the _nv versions should be used"); - _wrapped_closure->do_oop(p); } - void do_oop(narrowOop* p) { assert(false, "Only the _nv versions should be used"); - _wrapped_closure->do_oop(p);} +// An OopIterateClosure that can be used when there's no need to visit the Metadata. +class BasicOopIterateClosure : public OopIterateClosure { +public: + BasicOopIterateClosure(ReferenceDiscoverer* rd = NULL) : OopIterateClosure(rd) {} + + virtual bool do_metadata() { return false; } + virtual void do_klass(Klass* k) { ShouldNotReachHere(); } + virtual void do_cld(ClassLoaderData* cld) { ShouldNotReachHere(); } }; class KlassClosure : public Closure { @@ -161,20 +140,13 @@ // The base class for all concurrent marking closures, // that participates in class unloading. // It's used to proxy through the metadata to the oops defined in them. -class MetadataAwareOopClosure: public ExtendedOopClosure { - +class MetadataVisitingOopIterateClosure: public OopIterateClosure { public: - MetadataAwareOopClosure() : ExtendedOopClosure() { } - MetadataAwareOopClosure(ReferenceDiscoverer* rd) : ExtendedOopClosure(rd) { } - - bool do_metadata_nv() { return true; } - virtual bool do_metadata() { return do_metadata_nv(); } - - void do_klass_nv(Klass* k); - virtual void do_klass(Klass* k) { do_klass_nv(k); } + MetadataVisitingOopIterateClosure(ReferenceDiscoverer* rd = NULL) : OopIterateClosure(rd) { } - void do_cld_nv(ClassLoaderData* cld); - virtual void do_cld(ClassLoaderData* cld) { do_cld_nv(cld); } + virtual bool do_metadata() { return true; } + virtual void do_klass(Klass* k); + virtual void do_cld(ClassLoaderData* cld); }; // ObjectClosure is used for iterating through an object space @@ -204,10 +176,10 @@ // Applies an oop closure to all ref fields in objects iterated over in an // object iteration. class ObjectToOopClosure: public ObjectClosure { - ExtendedOopClosure* _cl; + OopIterateClosure* _cl; public: void do_object(oop obj); - ObjectToOopClosure(ExtendedOopClosure* cl) : _cl(cl) {} + ObjectToOopClosure(OopIterateClosure* cl) : _cl(cl) {} }; // A version of ObjectClosure that is expected to be robust @@ -371,30 +343,22 @@ } }; -// The two class template specializations are used to dispatch calls -// to the ExtendedOopClosure functions. If use_non_virtual_call is true, -// the non-virtual versions are called (E.g. do_oop_nv), otherwise the -// virtual versions are called (E.g. do_oop). - -template -class Devirtualizer {}; - -// Dispatches to the non-virtual functions. -template <> class Devirtualizer { - public: - template static void do_oop(OopClosureType* closure, T* p); - template static void do_klass(OopClosureType* closure, Klass* k); - template static void do_cld(OopClosureType* closure, ClassLoaderData* cld); - template static bool do_metadata(OopClosureType* closure); -}; - -// Dispatches to the virtual functions. -template <> class Devirtualizer { - public: - template static void do_oop(OopClosureType* closure, T* p); - template static void do_klass(OopClosureType* closure, Klass* k); - template static void do_cld(OopClosureType* closure, ClassLoaderData* cld); - template static bool do_metadata(OopClosureType* closure); +// Dispatches to the non-virtual functions if OopClosureType has +// a concrete implementation, otherwise a virtual call is taken. +class Devirtualizer { + public: + template static void do_oop_no_verify(OopClosureType* closure, T* p); + template static void do_oop(OopClosureType* closure, T* p); + template static void do_klass(OopClosureType* closure, Klass* k); + template static void do_cld(OopClosureType* closure, ClassLoaderData* cld); + template static bool do_metadata(OopClosureType* closure); +}; + +class OopIteratorClosureDispatch { + public: + template static void oop_oop_iterate(OopClosureType* cl, oop obj, Klass* klass); + template static void oop_oop_iterate(OopClosureType* cl, oop obj, Klass* klass, MemRegion mr); + template static void oop_oop_iterate_backwards(OopClosureType* cl, oop obj, Klass* klass); }; #endif // SHARE_VM_MEMORY_ITERATOR_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/memory/iterator.inline.hpp openjdk-11-11~24/src/hotspot/share/memory/iterator.inline.hpp --- openjdk-11-11~19/src/hotspot/share/memory/iterator.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/iterator.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -38,21 +38,21 @@ #include "oops/typeArrayKlass.inline.hpp" #include "utilities/debug.hpp" -inline void MetadataAwareOopClosure::do_cld_nv(ClassLoaderData* cld) { +inline void MetadataVisitingOopIterateClosure::do_cld(ClassLoaderData* cld) { bool claim = true; // Must claim the class loader data before processing. cld->oops_do(this, claim); } -inline void MetadataAwareOopClosure::do_klass_nv(Klass* k) { +inline void MetadataVisitingOopIterateClosure::do_klass(Klass* k) { ClassLoaderData* cld = k->class_loader_data(); - do_cld_nv(cld); + MetadataVisitingOopIterateClosure::do_cld(cld); } #ifdef ASSERT // This verification is applied to all visited oops. // The closures can turn is off by overriding should_verify_oops(). template -void ExtendedOopClosure::verify(T* p) { +void OopIterateClosure::verify(T* p) { if (should_verify_oops()) { T heap_oop = RawAccess<>::oop_load(p); if (!CompressedOops::is_null(heap_oop)) { @@ -65,54 +65,360 @@ #endif // Implementation of the non-virtual do_oop dispatch. +// +// The same implementation is used for do_metadata, do_klass, and do_cld. +// +// Preconditions: +// - Base has a pure virtual do_oop +// - Only one of the classes in the inheritance chain from OopClosureType to +// Base implements do_oop. +// +// Given the preconditions: +// - If &OopClosureType::do_oop is resolved to &Base::do_oop, then there is no +// implementation of do_oop between Base and OopClosureType. However, there +// must be one implementation in one of the subclasses of OopClosureType. +// In this case we take the virtual call. +// +// - Conversely, if &OopClosureType::do_oop is not resolved to &Base::do_oop, +// then we've found the one and only concrete implementation. In this case we +// take a non-virtual call. +// +// Because of this it's clear when we should call the virtual call and +// when the non-virtual call should be made. +// +// The way we find if &OopClosureType::do_oop is resolved to &Base::do_oop is to +// check if the resulting type of the class of a member-function pointer to +// &OopClosureType::do_oop is equal to the type of the class of a +// &Base::do_oop member-function pointer. Template parameter deduction is used +// to find these types, and then the IsSame trait is used to check if they are +// equal. Finally, SFINAE is used to select the appropriate implementation. +// +// Template parameters: +// T - narrowOop or oop +// Receiver - the resolved type of the class of the +// &OopClosureType::do_oop member-function pointer. That is, +// the klass with the do_oop member function. +// Base - klass with the pure virtual do_oop member function. +// OopClosureType - The dynamic closure type +// +// Parameters: +// closure - The closure to call +// p - The oop (or narrowOop) field to pass to the closure -template -inline void Devirtualizer::do_oop(OopClosureType* closure, T* p) { - debug_only(closure->verify(p)); - closure->do_oop_nv(p); +template +static typename EnableIf::value, void>::type +call_do_oop(void (Receiver::*)(T*), void (Base::*)(T*), OopClosureType* closure, T* p) { + closure->do_oop(p); } -template -inline void Devirtualizer::do_klass(OopClosureType* closure, Klass* k) { - closure->do_klass_nv(k); + +template +static typename EnableIf::value, void>::type +call_do_oop(void (Receiver::*)(T*), void (Base::*)(T*), OopClosureType* closure, T* p) { + // Sanity check + STATIC_ASSERT((!IsSame::value)); + closure->OopClosureType::do_oop(p); } -template -void Devirtualizer::do_cld(OopClosureType* closure, ClassLoaderData* cld) { - closure->do_cld_nv(cld); + +template +inline void Devirtualizer::do_oop_no_verify(OopClosureType* closure, T* p) { + call_do_oop(&OopClosureType::do_oop, &OopClosure::do_oop, closure, p); } -template -inline bool Devirtualizer::do_metadata(OopClosureType* closure) { - // Make sure the non-virtual and the virtual versions match. - assert(closure->do_metadata_nv() == closure->do_metadata(), "Inconsistency in do_metadata"); - return closure->do_metadata_nv(); + +template +inline void Devirtualizer::do_oop(OopClosureType* closure, T* p) { + debug_only(closure->verify(p)); + + do_oop_no_verify(closure, p); } -// Implementation of the virtual do_oop dispatch. +// Implementation of the non-virtual do_metadata dispatch. -template -void Devirtualizer::do_oop(OopClosureType* closure, T* p) { - debug_only(closure->verify(p)); - closure->do_oop(p); +template +static typename EnableIf::value, bool>::type +call_do_metadata(bool (Receiver::*)(), bool (Base::*)(), OopClosureType* closure) { + return closure->do_metadata(); +} + +template +static typename EnableIf::value, bool>::type +call_do_metadata(bool (Receiver::*)(), bool (Base::*)(), OopClosureType* closure) { + return closure->OopClosureType::do_metadata(); +} + +template +inline bool Devirtualizer::do_metadata(OopClosureType* closure) { + return call_do_metadata(&OopClosureType::do_metadata, &OopIterateClosure::do_metadata, closure); } -template -void Devirtualizer::do_klass(OopClosureType* closure, Klass* k) { + +// Implementation of the non-virtual do_klass dispatch. + +template +static typename EnableIf::value, void>::type +call_do_klass(void (Receiver::*)(Klass*), void (Base::*)(Klass*), OopClosureType* closure, Klass* k) { closure->do_klass(k); } -template -void Devirtualizer::do_cld(OopClosureType* closure, ClassLoaderData* cld) { + +template +static typename EnableIf::value, void>::type +call_do_klass(void (Receiver::*)(Klass*), void (Base::*)(Klass*), OopClosureType* closure, Klass* k) { + closure->OopClosureType::do_klass(k); +} + +template +inline void Devirtualizer::do_klass(OopClosureType* closure, Klass* k) { + call_do_klass(&OopClosureType::do_klass, &OopIterateClosure::do_klass, closure, k); +} + +// Implementation of the non-virtual do_cld dispatch. + +template +static typename EnableIf::value, void>::type +call_do_cld(void (Receiver::*)(ClassLoaderData*), void (Base::*)(ClassLoaderData*), OopClosureType* closure, ClassLoaderData* cld) { closure->do_cld(cld); } -template -bool Devirtualizer::do_metadata(OopClosureType* closure) { - return closure->do_metadata(); + +template +static typename EnableIf::value, void>::type +call_do_cld(void (Receiver::*)(ClassLoaderData*), void (Base::*)(ClassLoaderData*), OopClosureType* closure, ClassLoaderData* cld) { + closure->OopClosureType::do_cld(cld); +} + +template +void Devirtualizer::do_cld(OopClosureType* closure, ClassLoaderData* cld) { + call_do_cld(&OopClosureType::do_cld, &OopIterateClosure::do_cld, closure, cld); } -// The list of all "specializable" oop_oop_iterate function definitions. -#define ALL_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - ALL_INSTANCE_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ - ALL_INSTANCE_REF_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ - ALL_INSTANCE_MIRROR_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ - ALL_INSTANCE_CLASS_LOADER_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - ALL_OBJ_ARRAY_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) \ - ALL_TYPE_ARRAY_KLASS_OOP_OOP_ITERATE_DEFN( OopClosureType, nv_suffix) +// Dispatch table implementation for *Klass::oop_oop_iterate +// +// It allows for a single call to do a multi-dispatch to an optimized version +// of oop_oop_iterate that statically know all these types: +// - OopClosureType : static type give at call site +// - Klass* : dynamic to static type through Klass::id() -> table index +// - UseCompressedOops : dynamic to static value determined once +// +// when users call obj->oop_iterate(&cl). +// +// oopDesc::oop_iterate() calls OopOopIterateDispatch::function(klass)(cl, obj, klass), +// which dispatches to an optimized version of +// [Instance, ObjArry, etc]Klass::oop_oop_iterate(oop, OopClosureType) +// +// OopClosureType : +// If OopClosureType has an implementation of do_oop (and do_metadata et.al.), +// then the static type of OopClosureType will be used to allow inlining of +// do_oop (even though do_oop is virtual). Otherwise, a virtual call will be +// used when calling do_oop. +// +// Klass* : +// A table mapping from *Klass::ID to function is setup. This happens once +// when the program starts, when the static _table instance is initialized for +// the OopOopIterateDispatch specialized with the OopClosureType. +// +// UseCompressedOops : +// Initially the table is populated with an init function, and not the actual +// oop_oop_iterate function. This is done, so that the first time we dispatch +// through the init function we check what the value of UseCompressedOops +// became, and use that to determine if we should install an optimized +// narrowOop version or optimized oop version of oop_oop_iterate. The appropriate +// oop_oop_iterate function replaces the init function in the table, and +// succeeding calls will jump directly to oop_oop_iterate. + + +template +class OopOopIterateDispatch : public AllStatic { +private: + class Table { + private: + template + static void oop_oop_iterate(OopClosureType* cl, oop obj, Klass* k) { + ((KlassType*)k)->KlassType::template oop_oop_iterate(obj, cl); + } + + template + static void init(OopClosureType* cl, oop obj, Klass* k) { + OopOopIterateDispatch::_table.set_resolve_function_and_execute(cl, obj, k); + } + + template + void set_init_function() { + _function[KlassType::ID] = &init; + } + + template + void set_resolve_function() { + // Size requirement to prevent word tearing + // when functions pointers are updated. + STATIC_ASSERT(sizeof(_function[0]) == sizeof(void*)); + if (UseCompressedOops) { + _function[KlassType::ID] = &oop_oop_iterate; + } else { + _function[KlassType::ID] = &oop_oop_iterate; + } + } + + template + void set_resolve_function_and_execute(OopClosureType* cl, oop obj, Klass* k) { + set_resolve_function(); + _function[KlassType::ID](cl, obj, k); + } + + public: + void (*_function[KLASS_ID_COUNT])(OopClosureType*, oop, Klass*); + + Table(){ + set_init_function(); + set_init_function(); + set_init_function(); + set_init_function(); + set_init_function(); + set_init_function(); + } + }; + + static Table _table; +public: + + static void (*function(Klass* klass))(OopClosureType*, oop, Klass*) { + return _table._function[klass->id()]; + } +}; + +template +typename OopOopIterateDispatch::Table OopOopIterateDispatch::_table; + + +template +class OopOopIterateBoundedDispatch { +private: + class Table { + private: + template + static void oop_oop_iterate_bounded(OopClosureType* cl, oop obj, Klass* k, MemRegion mr) { + ((KlassType*)k)->KlassType::template oop_oop_iterate_bounded(obj, cl, mr); + } + + template + static void init(OopClosureType* cl, oop obj, Klass* k, MemRegion mr) { + OopOopIterateBoundedDispatch::_table.set_resolve_function_and_execute(cl, obj, k, mr); + } + + template + void set_init_function() { + _function[KlassType::ID] = &init; + } + + template + void set_resolve_function() { + if (UseCompressedOops) { + _function[KlassType::ID] = &oop_oop_iterate_bounded; + } else { + _function[KlassType::ID] = &oop_oop_iterate_bounded; + } + } + + template + void set_resolve_function_and_execute(OopClosureType* cl, oop obj, Klass* k, MemRegion mr) { + set_resolve_function(); + _function[KlassType::ID](cl, obj, k, mr); + } + + public: + void (*_function[KLASS_ID_COUNT])(OopClosureType*, oop, Klass*, MemRegion); + + Table(){ + set_init_function(); + set_init_function(); + set_init_function(); + set_init_function(); + set_init_function(); + set_init_function(); + } + }; + + static Table _table; +public: + + static void (*function(Klass* klass))(OopClosureType*, oop, Klass*, MemRegion) { + return _table._function[klass->id()]; + } +}; + +template +typename OopOopIterateBoundedDispatch::Table OopOopIterateBoundedDispatch::_table; + + +template +class OopOopIterateBackwardsDispatch { +private: + class Table { + private: + template + static void oop_oop_iterate_backwards(OopClosureType* cl, oop obj, Klass* k) { + ((KlassType*)k)->KlassType::template oop_oop_iterate_reverse(obj, cl); + } + + template + static void init(OopClosureType* cl, oop obj, Klass* k) { + OopOopIterateBackwardsDispatch::_table.set_resolve_function_and_execute(cl, obj, k); + } + + template + void set_init_function() { + _function[KlassType::ID] = &init; + } + + template + void set_resolve_function() { + if (UseCompressedOops) { + _function[KlassType::ID] = &oop_oop_iterate_backwards; + } else { + _function[KlassType::ID] = &oop_oop_iterate_backwards; + } + } + + template + void set_resolve_function_and_execute(OopClosureType* cl, oop obj, Klass* k) { + set_resolve_function(); + _function[KlassType::ID](cl, obj, k); + } + + public: + void (*_function[KLASS_ID_COUNT])(OopClosureType*, oop, Klass*); + + Table(){ + set_init_function(); + set_init_function(); + set_init_function(); + set_init_function(); + set_init_function(); + set_init_function(); + } + }; + + static Table _table; +public: + + static void (*function(Klass* klass))(OopClosureType*, oop, Klass*) { + return _table._function[klass->id()]; + } +}; + +template +typename OopOopIterateBackwardsDispatch::Table OopOopIterateBackwardsDispatch::_table; + + +template +void OopIteratorClosureDispatch::oop_oop_iterate(OopClosureType* cl, oop obj, Klass* klass) { + OopOopIterateDispatch::function(klass)(cl, obj, klass); +} + +template +void OopIteratorClosureDispatch::oop_oop_iterate(OopClosureType* cl, oop obj, Klass* klass, MemRegion mr) { + OopOopIterateBoundedDispatch::function(klass)(cl, obj, klass, mr); +} + +template +void OopIteratorClosureDispatch::oop_oop_iterate_backwards(OopClosureType* cl, oop obj, Klass* klass) { + OopOopIterateBackwardsDispatch::function(klass)(cl, obj, klass); +} #endif // SHARE_VM_MEMORY_ITERATOR_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/memory/metaspace/chunkManager.cpp openjdk-11-11~24/src/hotspot/share/memory/metaspace/chunkManager.cpp --- openjdk-11-11~19/src/hotspot/share/memory/metaspace/chunkManager.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/metaspace/chunkManager.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -508,7 +508,7 @@ return NULL; } - log_debug(gc, metaspace, alloc)("Free list allocate humongous chunk size " SIZE_FORMAT " for requested size " SIZE_FORMAT " waste " SIZE_FORMAT, + log_trace(gc, metaspace, alloc)("Free list allocate humongous chunk size " SIZE_FORMAT " for requested size " SIZE_FORMAT " waste " SIZE_FORMAT, chunk->word_size(), word_size, chunk->word_size() - word_size); } @@ -550,7 +550,7 @@ assert((word_size <= chunk->word_size()) || (list_index(chunk->word_size()) == HumongousIndex), "Non-humongous variable sized chunk"); - LogTarget(Debug, gc, metaspace, freelist) lt; + LogTarget(Trace, gc, metaspace, freelist) lt; if (lt.is_enabled()) { size_t list_count; if (list_index(word_size) < HumongousIndex) { diff -Nru openjdk-11-11~19/src/hotspot/share/memory/metaspace/spaceManager.cpp openjdk-11-11~24/src/hotspot/share/memory/metaspace/spaceManager.cpp --- openjdk-11-11~19/src/hotspot/share/memory/metaspace/spaceManager.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/metaspace/spaceManager.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -152,11 +152,11 @@ " chunk_word_size " SIZE_FORMAT, word_size, chunk_word_size); Log(gc, metaspace, alloc) log; - if (log.is_debug() && SpaceManager::is_humongous(word_size)) { - log.debug("Metadata humongous allocation:"); - log.debug(" word_size " PTR_FORMAT, word_size); - log.debug(" chunk_word_size " PTR_FORMAT, chunk_word_size); - log.debug(" chunk overhead " PTR_FORMAT, Metachunk::overhead()); + if (log.is_trace() && SpaceManager::is_humongous(word_size)) { + log.trace("Metadata humongous allocation:"); + log.trace(" word_size " PTR_FORMAT, word_size); + log.trace(" chunk_word_size " PTR_FORMAT, chunk_word_size); + log.trace(" chunk overhead " PTR_FORMAT, Metachunk::overhead()); } return chunk_word_size; } @@ -390,9 +390,9 @@ } Log(gc, metaspace, alloc) log; - if (log.is_debug() && next != NULL && + if (log.is_trace() && next != NULL && SpaceManager::is_humongous(next->word_size())) { - log.debug(" new humongous chunk word size " PTR_FORMAT, next->word_size()); + log.trace(" new humongous chunk word size " PTR_FORMAT, next->word_size()); } return next; diff -Nru openjdk-11-11~19/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp openjdk-11-11~24/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp --- openjdk-11-11~19/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/metaspace/virtualSpaceNode.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -428,7 +428,7 @@ "The committed memory doesn't match the expanded memory."); if (!is_available(chunk_word_size)) { - LogTarget(Debug, gc, metaspace, freelist) lt; + LogTarget(Trace, gc, metaspace, freelist) lt; if (lt.is_enabled()) { LogStream ls(lt); ls.print("VirtualSpaceNode::take_from_committed() not available " SIZE_FORMAT " words ", chunk_word_size); diff -Nru openjdk-11-11~19/src/hotspot/share/memory/metaspace.cpp openjdk-11-11~24/src/hotspot/share/memory/metaspace.cpp --- openjdk-11-11~19/src/hotspot/share/memory/metaspace.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/metaspace.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1260,7 +1260,9 @@ tty->print_cr("Please increase MaxMetaspaceSize (currently " SIZE_FORMAT " bytes).", MaxMetaspaceSize); vm_exit(1); } - report_metadata_oome(loader_data, word_size, type, mdtype, CHECK_NULL); + report_metadata_oome(loader_data, word_size, type, mdtype, THREAD); + assert(HAS_PENDING_EXCEPTION, "sanity"); + return NULL; } // Zero initialize. diff -Nru openjdk-11-11~19/src/hotspot/share/memory/metaspaceShared.cpp openjdk-11-11~24/src/hotspot/share/memory/metaspaceShared.cpp --- openjdk-11-11~19/src/hotspot/share/memory/metaspaceShared.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/metaspaceShared.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -455,6 +455,7 @@ java_lang_StackTraceElement::serialize(soc); java_lang_StackFrameInfo::serialize(soc); java_lang_LiveStackFrameInfo::serialize(soc); + java_util_concurrent_locks_AbstractOwnableSynchronizer::serialize(soc); } address MetaspaceShared::cds_i2i_entry_code_buffers(size_t total_size) { diff -Nru openjdk-11-11~19/src/hotspot/share/memory/virtualspace.cpp openjdk-11-11~24/src/hotspot/share/memory/virtualspace.cpp --- openjdk-11-11~19/src/hotspot/share/memory/virtualspace.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/memory/virtualspace.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -70,6 +70,18 @@ initialize(size, alignment, large, NULL, executable); } +ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment, + bool special, bool executable) : _fd_for_heap(-1) { + assert((size % os::vm_allocation_granularity()) == 0, + "size not allocation aligned"); + _base = base; + _size = size; + _alignment = alignment; + _noaccess_prefix = 0; + _special = special; + _executable = executable; +} + // Helper method static void unmap_or_release_memory(char* base, size_t size, bool is_file_mapped) { if (is_file_mapped) { @@ -218,20 +230,6 @@ } } - -ReservedSpace::ReservedSpace(char* base, size_t size, size_t alignment, - bool special, bool executable) { - assert((size % os::vm_allocation_granularity()) == 0, - "size not allocation aligned"); - _base = base; - _size = size; - _alignment = alignment; - _noaccess_prefix = 0; - _special = special; - _executable = executable; -} - - ReservedSpace ReservedSpace::first_part(size_t partition_size, size_t alignment, bool split, bool realloc) { assert(partition_size <= size(), "partition failed"); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/accessBackend.hpp openjdk-11-11~24/src/hotspot/share/oops/accessBackend.hpp --- openjdk-11-11~19/src/hotspot/share/oops/accessBackend.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/accessBackend.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -181,7 +181,7 @@ // This mask specifies what decorators are relevant for raw accesses. When passing // accesses to the raw layer, irrelevant decorators are removed. const DecoratorSet RAW_DECORATOR_MASK = INTERNAL_DECORATOR_MASK | MO_DECORATOR_MASK | - ARRAYCOPY_DECORATOR_MASK | OOP_DECORATOR_MASK; + ARRAYCOPY_DECORATOR_MASK | IS_NOT_NULL; // The RawAccessBarrier performs raw accesses with additional knowledge of // memory ordering, so that OrderAccess/Atomic is called when necessary. @@ -1290,7 +1290,7 @@ (IsSame::value || IsIntegral::value) || IsFloatingPoint::value)); // arraycopy allows type erased void elements typedef typename Decay::type DecayedT; - const DecoratorSet expanded_decorators = DecoratorFixup::value; + const DecoratorSet expanded_decorators = DecoratorFixup::value; return arraycopy_reduce_types(src_obj, src_offset_in_bytes, const_cast(src_raw), dst_obj, dst_offset_in_bytes, const_cast(dst_raw), length); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/accessBackend.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/accessBackend.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/accessBackend.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/accessBackend.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -35,7 +35,7 @@ inline typename EnableIf< AccessInternal::MustConvertCompressedOop::value, T>::type RawAccessBarrier::decode_internal(typename HeapOopType::type value) { - if (HasDecorator::value) { + if (HasDecorator::value) { return CompressedOops::decode_not_null(value); } else { return CompressedOops::decode(value); @@ -48,7 +48,7 @@ AccessInternal::MustConvertCompressedOop::value, typename HeapOopType::type>::type RawAccessBarrier::encode_internal(T value) { - if (HasDecorator::value) { + if (HasDecorator::value) { return CompressedOops::encode_not_null(value); } else { return CompressedOops::encode(value); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/accessDecorators.hpp openjdk-11-11~24/src/hotspot/share/oops/accessDecorators.hpp --- openjdk-11-11~19/src/hotspot/share/oops/accessDecorators.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/accessDecorators.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -143,8 +143,6 @@ // - Accesses on narrowOop* translate to encoded/decoded memory accesses without runtime checks // - Accesses on HeapWord* translate to a runtime check choosing one of the above // - Accesses on other types translate to raw memory accesses without runtime checks -// * AS_DEST_NOT_INITIALIZED: This property can be important to e.g. SATB barriers by -// marking that the previous value is uninitialized nonsense rather than a real value. // * AS_NO_KEEPALIVE: The barrier is used only on oop references and will not keep any involved objects // alive, regardless of the type of reference being accessed. It will however perform the memory access // in a consistent way w.r.t. e.g. concurrent compaction, so that the right field is being accessed, @@ -155,11 +153,9 @@ // Note that primitive accesses will only be resolved on the barrier set if the appropriate build-time // decorator for enabling primitive barriers is enabled for the build. const DecoratorSet AS_RAW = UCONST64(1) << 12; -const DecoratorSet AS_DEST_NOT_INITIALIZED = UCONST64(1) << 13; -const DecoratorSet AS_NO_KEEPALIVE = UCONST64(1) << 14; -const DecoratorSet AS_NORMAL = UCONST64(1) << 15; -const DecoratorSet AS_DECORATOR_MASK = AS_RAW | AS_DEST_NOT_INITIALIZED | - AS_NO_KEEPALIVE | AS_NORMAL; +const DecoratorSet AS_NO_KEEPALIVE = UCONST64(1) << 13; +const DecoratorSet AS_NORMAL = UCONST64(1) << 14; +const DecoratorSet AS_DECORATOR_MASK = AS_RAW | AS_NO_KEEPALIVE | AS_NORMAL; // === Reference Strength Decorators === // These decorators only apply to accesses on oop-like types (oop/narrowOop). @@ -170,10 +166,10 @@ // * ON_UNKNOWN_OOP_REF: The memory access is performed on a reference of unknown strength. // This could for example come from the unsafe API. // * Default (no explicit reference strength specified): ON_STRONG_OOP_REF -const DecoratorSet ON_STRONG_OOP_REF = UCONST64(1) << 16; -const DecoratorSet ON_WEAK_OOP_REF = UCONST64(1) << 17; -const DecoratorSet ON_PHANTOM_OOP_REF = UCONST64(1) << 18; -const DecoratorSet ON_UNKNOWN_OOP_REF = UCONST64(1) << 19; +const DecoratorSet ON_STRONG_OOP_REF = UCONST64(1) << 15; +const DecoratorSet ON_WEAK_OOP_REF = UCONST64(1) << 16; +const DecoratorSet ON_PHANTOM_OOP_REF = UCONST64(1) << 17; +const DecoratorSet ON_UNKNOWN_OOP_REF = UCONST64(1) << 18; const DecoratorSet ON_DECORATOR_MASK = ON_STRONG_OOP_REF | ON_WEAK_OOP_REF | ON_PHANTOM_OOP_REF | ON_UNKNOWN_OOP_REF; @@ -182,23 +178,20 @@ // The location is important to the GC as it may imply different actions. The following decorators are used: // * IN_HEAP: The access is performed in the heap. Many barriers such as card marking will // be omitted if this decorator is not set. -// * IN_HEAP_ARRAY: The access is performed on a heap allocated array. This is sometimes a special case -// for some GCs, and implies that it is an IN_HEAP. // * IN_NATIVE: The access is performed in an off-heap data structure pointing into the Java heap. -// * IN_CONCURRENT_ROOT: The access is performed in an off-heap data structure pointing into the Java heap, -// but is notably not scanned during safepoints. This is sometimes a special case for some GCs and -// implies that it is also an IN_NATIVE. -const DecoratorSet IN_HEAP = UCONST64(1) << 20; -const DecoratorSet IN_HEAP_ARRAY = UCONST64(1) << 21; -const DecoratorSet IN_NATIVE = UCONST64(1) << 22; -const DecoratorSet IN_CONCURRENT_ROOT = UCONST64(1) << 23; -const DecoratorSet IN_DECORATOR_MASK = IN_HEAP | IN_HEAP_ARRAY | - IN_NATIVE | IN_CONCURRENT_ROOT; - -// == Value Decorators == -// * OOP_NOT_NULL: This property can make certain barriers faster such as compressing oops. -const DecoratorSet OOP_NOT_NULL = UCONST64(1) << 25; -const DecoratorSet OOP_DECORATOR_MASK = OOP_NOT_NULL; +const DecoratorSet IN_HEAP = UCONST64(1) << 19; +const DecoratorSet IN_NATIVE = UCONST64(1) << 20; +const DecoratorSet IN_DECORATOR_MASK = IN_HEAP | IN_NATIVE; + +// == Boolean Flag Decorators == +// * IS_ARRAY: The access is performed on a heap allocated array. This is sometimes a special case +// for some GCs. +// * IS_DEST_UNINITIALIZED: This property can be important to e.g. SATB barriers by +// marking that the previous value is uninitialized nonsense rather than a real value. +// * IS_NOT_NULL: This property can make certain barriers faster such as compressing oops. +const DecoratorSet IS_ARRAY = UCONST64(1) << 21; +const DecoratorSet IS_DEST_UNINITIALIZED = UCONST64(1) << 22; +const DecoratorSet IS_NOT_NULL = UCONST64(1) << 23; // == Arraycopy Decorators == // * ARRAYCOPY_CHECKCAST: This property means that the class of the objects in source @@ -210,17 +203,17 @@ // * ARRAYCOPY_ARRAYOF: The copy is in the arrayof form. // * ARRAYCOPY_ATOMIC: The accesses have to be atomic over the size of its elements. // * ARRAYCOPY_ALIGNED: The accesses have to be aligned on a HeapWord. -const DecoratorSet ARRAYCOPY_CHECKCAST = UCONST64(1) << 26; -const DecoratorSet ARRAYCOPY_DISJOINT = UCONST64(1) << 27; -const DecoratorSet ARRAYCOPY_ARRAYOF = UCONST64(1) << 28; -const DecoratorSet ARRAYCOPY_ATOMIC = UCONST64(1) << 29; -const DecoratorSet ARRAYCOPY_ALIGNED = UCONST64(1) << 30; +const DecoratorSet ARRAYCOPY_CHECKCAST = UCONST64(1) << 24; +const DecoratorSet ARRAYCOPY_DISJOINT = UCONST64(1) << 25; +const DecoratorSet ARRAYCOPY_ARRAYOF = UCONST64(1) << 26; +const DecoratorSet ARRAYCOPY_ATOMIC = UCONST64(1) << 27; +const DecoratorSet ARRAYCOPY_ALIGNED = UCONST64(1) << 28; const DecoratorSet ARRAYCOPY_DECORATOR_MASK = ARRAYCOPY_CHECKCAST | ARRAYCOPY_DISJOINT | ARRAYCOPY_DISJOINT | ARRAYCOPY_ARRAYOF | ARRAYCOPY_ATOMIC | ARRAYCOPY_ALIGNED; // Keep track of the last decorator. -const DecoratorSet DECORATOR_LAST = UCONST64(1) << 30; +const DecoratorSet DECORATOR_LAST = UCONST64(1) << 28; namespace AccessInternal { // This class adds implied decorators that follow according to decorator rules. @@ -238,12 +231,7 @@ // If no barrier strength has been picked, normal will be used static const DecoratorSet barrier_strength_default = memory_ordering_default | ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : INTERNAL_EMPTY); - // Heap array accesses imply it is a heap access - static const DecoratorSet heap_array_is_in_heap = barrier_strength_default | - ((IN_HEAP_ARRAY & barrier_strength_default) != 0 ? IN_HEAP : INTERNAL_EMPTY); - static const DecoratorSet conc_root_is_root = heap_array_is_in_heap | - ((IN_CONCURRENT_ROOT & heap_array_is_in_heap) != 0 ? IN_NATIVE : INTERNAL_EMPTY); - static const DecoratorSet value = conc_root_is_root | BT_BUILDTIME_DECORATORS; + static const DecoratorSet value = barrier_strength_default | BT_BUILDTIME_DECORATORS; }; // This function implements the above DecoratorFixup rules, but without meta @@ -259,12 +247,7 @@ // If no barrier strength has been picked, normal will be used DecoratorSet barrier_strength_default = memory_ordering_default | ((AS_DECORATOR_MASK & memory_ordering_default) == 0 ? AS_NORMAL : INTERNAL_EMPTY); - // Heap array accesses imply it is a heap access - DecoratorSet heap_array_is_in_heap = barrier_strength_default | - ((IN_HEAP_ARRAY & barrier_strength_default) != 0 ? IN_HEAP : INTERNAL_EMPTY); - DecoratorSet conc_root_is_root = heap_array_is_in_heap | - ((IN_CONCURRENT_ROOT & heap_array_is_in_heap) != 0 ? IN_NATIVE : INTERNAL_EMPTY); - DecoratorSet value = conc_root_is_root | BT_BUILDTIME_DECORATORS; + DecoratorSet value = barrier_strength_default | BT_BUILDTIME_DECORATORS; return value; } } diff -Nru openjdk-11-11~19/src/hotspot/share/oops/access.hpp openjdk-11-11~24/src/hotspot/share/oops/access.hpp --- openjdk-11-11~19/src/hotspot/share/oops/access.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/access.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -104,8 +104,8 @@ template static void verify_primitive_decorators() { - const DecoratorSet primitive_decorators = (AS_DECORATOR_MASK ^ AS_NO_KEEPALIVE ^ AS_DEST_NOT_INITIALIZED) | - IN_HEAP | IN_HEAP_ARRAY; + const DecoratorSet primitive_decorators = (AS_DECORATOR_MASK ^ AS_NO_KEEPALIVE) | + IN_HEAP | IS_ARRAY; verify_decorators(); } @@ -113,15 +113,14 @@ static void verify_oop_decorators() { const DecoratorSet oop_decorators = AS_DECORATOR_MASK | IN_DECORATOR_MASK | (ON_DECORATOR_MASK ^ ON_UNKNOWN_OOP_REF) | // no unknown oop refs outside of the heap - OOP_DECORATOR_MASK; + IS_ARRAY | IS_NOT_NULL | IS_DEST_UNINITIALIZED; verify_decorators(); } template static void verify_heap_oop_decorators() { const DecoratorSet heap_oop_decorators = AS_DECORATOR_MASK | ON_DECORATOR_MASK | - OOP_DECORATOR_MASK | (IN_DECORATOR_MASK ^ - (IN_NATIVE | IN_CONCURRENT_ROOT)); // no root accesses in the heap + IN_HEAP | IS_ARRAY | IS_NOT_NULL; verify_decorators(); } @@ -135,8 +134,8 @@ static inline bool oop_arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, const T* src_raw, arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw, size_t length) { - verify_decorators(); + verify_decorators(); return AccessInternal::arraycopy(src_obj, src_offset_in_bytes, src_raw, dst_obj, dst_offset_in_bytes, dst_raw, length); @@ -146,8 +145,8 @@ static inline void arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, const T* src_raw, arrayOop dst_obj, size_t dst_offset_in_bytes, T* dst_raw, size_t length) { - verify_decorators(); + verify_decorators(); AccessInternal::arraycopy(src_obj, src_offset_in_bytes, src_raw, dst_obj, dst_offset_in_bytes, dst_raw, length); @@ -300,8 +299,8 @@ // Helper for array access. template -class ArrayAccess: public HeapAccess { - typedef HeapAccess AccessT; +class ArrayAccess: public HeapAccess { + typedef HeapAccess AccessT; public: template static inline void arraycopy(arrayOop src_obj, size_t src_offset_in_bytes, @@ -354,7 +353,6 @@ const DecoratorSet barrier_strength_decorators = decorators & AS_DECORATOR_MASK; STATIC_ASSERT(barrier_strength_decorators == 0 || ( // make sure barrier strength decorators are disjoint if set (barrier_strength_decorators ^ AS_NO_KEEPALIVE) == 0 || - (barrier_strength_decorators ^ AS_DEST_NOT_INITIALIZED) == 0 || (barrier_strength_decorators ^ AS_RAW) == 0 || (barrier_strength_decorators ^ AS_NORMAL) == 0 )); @@ -377,9 +375,7 @@ const DecoratorSet location_decorators = decorators & IN_DECORATOR_MASK; STATIC_ASSERT(location_decorators == 0 || ( // make sure location decorators are disjoint if set (location_decorators ^ IN_NATIVE) == 0 || - (location_decorators ^ IN_HEAP) == 0 || - (location_decorators ^ (IN_HEAP | IN_HEAP_ARRAY)) == 0 || - (location_decorators ^ (IN_NATIVE | IN_CONCURRENT_ROOT)) == 0 + (location_decorators ^ IN_HEAP) == 0 )); } diff -Nru openjdk-11-11~19/src/hotspot/share/oops/arrayKlass.cpp openjdk-11-11~24/src/hotspot/share/oops/arrayKlass.cpp --- openjdk-11-11~19/src/hotspot/share/oops/arrayKlass.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/arrayKlass.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -71,16 +71,18 @@ Method* ArrayKlass::uncached_lookup_method(const Symbol* name, const Symbol* signature, - OverpassLookupMode overpass_mode) const { + OverpassLookupMode overpass_mode, + PrivateLookupMode private_mode) const { // There are no methods in an array klass but the super class (Object) has some assert(super(), "super klass must be present"); // Always ignore overpass methods in superclasses, although technically the // super klass of an array, (j.l.Object) should not have // any overpass methods present. - return super()->uncached_lookup_method(name, signature, Klass::skip_overpass); + return super()->uncached_lookup_method(name, signature, Klass::skip_overpass, private_mode); } -ArrayKlass::ArrayKlass(Symbol* name) : +ArrayKlass::ArrayKlass(Symbol* name, KlassID id) : + Klass(id), _dimension(1), _higher_dimension(NULL), _lower_dimension(NULL) { @@ -140,8 +142,8 @@ int size = objArrayOopDesc::object_size(length); Klass* k = array_klass(n+dimension(), CHECK_0); ArrayKlass* ak = ArrayKlass::cast(k); - objArrayOop o = - (objArrayOop)CollectedHeap::array_allocate(ak, size, length, CHECK_0); + objArrayOop o = (objArrayOop)Universe::heap()->array_allocate(ak, size, length, + /* do_zero */ true, CHECK_0); // initialization to NULL not necessary, area already cleared return o; } diff -Nru openjdk-11-11~19/src/hotspot/share/oops/arrayKlass.hpp openjdk-11-11~24/src/hotspot/share/oops/arrayKlass.hpp --- openjdk-11-11~19/src/hotspot/share/oops/arrayKlass.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/arrayKlass.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,7 +46,7 @@ // Constructors // The constructor with the Symbol argument does the real array // initialization, the other is a dummy - ArrayKlass(Symbol* name); + ArrayKlass(Symbol* name, KlassID id); ArrayKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); } public: @@ -87,7 +87,8 @@ // Lookup operations Method* uncached_lookup_method(const Symbol* name, const Symbol* signature, - OverpassLookupMode overpass_mode) const; + OverpassLookupMode overpass_mode, + PrivateLookupMode private_mode = find_private) const; static ArrayKlass* cast(Klass* k) { return const_cast(cast(const_cast(k))); @@ -146,36 +147,4 @@ void oop_verify_on(oop obj, outputStream* st); }; -// Array oop iteration macros for declarations. -// Used to generate the declarations in the *ArrayKlass header files. - -#define OOP_OOP_ITERATE_DECL_RANGE(OopClosureType, nv_suffix) \ - void oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end); - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -// Named NO_BACKWARDS because the definition used by *ArrayKlass isn't reversed, see below. -#define OOP_OOP_ITERATE_DECL_NO_BACKWARDS(OopClosureType, nv_suffix) \ - void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure); -#endif - - -// Array oop iteration macros for definitions. -// Used to generate the definitions in the *ArrayKlass.inline.hpp files. - -#define OOP_OOP_ITERATE_DEFN_RANGE(KlassType, OopClosureType, nv_suffix) \ - \ -void KlassType::oop_oop_iterate_range##nv_suffix(oop obj, OopClosureType* closure, int start, int end) { \ - oop_oop_iterate_range(obj, closure, start, end); \ -} - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -#define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix) \ -void KlassType::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ - /* No reverse implementation ATM. */ \ - oop_oop_iterate(obj, closure); \ -} -#else -#define OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(KlassType, OopClosureType, nv_suffix) -#endif - #endif // SHARE_VM_OOPS_ARRAYKLASS_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/arrayOop.hpp openjdk-11-11~24/src/hotspot/share/oops/arrayOop.hpp --- openjdk-11-11~19/src/hotspot/share/oops/arrayOop.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/arrayOop.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -109,7 +109,10 @@ return *(int*)(((intptr_t)this) + length_offset_in_bytes()); } void set_length(int length) { - *(int*)(((intptr_t)this) + length_offset_in_bytes()) = length; + set_length((HeapWord*)this, length); + } + static void set_length(HeapWord* mem, int length) { + *(int*)(((char*)mem) + length_offset_in_bytes()) = length; } // Should only be called with constants as argument diff -Nru openjdk-11-11~19/src/hotspot/share/oops/constantPool.cpp openjdk-11-11~24/src/hotspot/share/oops/constantPool.cpp --- openjdk-11-11~19/src/hotspot/share/oops/constantPool.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/constantPool.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -807,6 +807,17 @@ } } +constantTag ConstantPool::constant_tag_at(int which) { + constantTag tag = tag_at(which); + if (tag.is_dynamic_constant() || + tag.is_dynamic_constant_in_error()) { + // have to look at the signature for this one + Symbol* constant_type = uncached_signature_ref_at(which); + return constantTag::ofBasicType(FieldType::basic_type(constant_type)); + } + return tag; +} + BasicType ConstantPool::basic_type_for_constant_at(int which) { constantTag tag = tag_at(which); if (tag.is_dynamic_constant() || diff -Nru openjdk-11-11~19/src/hotspot/share/oops/constantPool.hpp openjdk-11-11~24/src/hotspot/share/oops/constantPool.hpp --- openjdk-11-11~19/src/hotspot/share/oops/constantPool.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/constantPool.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -719,6 +719,9 @@ enum { _no_index_sentinel = -1, _possible_index_sentinel = -2 }; public: + // Get the tag for a constant, which may involve a constant dynamic + constantTag constant_tag_at(int which); + // Get the basic type for a constant, which may involve a constant dynamic BasicType basic_type_for_constant_at(int which); // Resolve late bound constants. diff -Nru openjdk-11-11~19/src/hotspot/share/oops/cpCache.cpp openjdk-11-11~24/src/hotspot/share/oops/cpCache.cpp --- openjdk-11-11~19/src/hotspot/share/oops/cpCache.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/cpCache.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -174,17 +174,37 @@ int byte_no = -1; bool change_to_virtual = false; - + InstanceKlass* holder = NULL; // have to declare this outside the switch switch (invoke_code) { case Bytecodes::_invokeinterface: - // We get here from InterpreterRuntime::resolve_invoke when an invokeinterface - // instruction somehow links to a non-interface method (in Object). - // In that case, the method has no itable index and must be invoked as a virtual. - // Set a flag to keep track of this corner case. - assert(method->is_public(), "Calling non-public method in Object with invokeinterface"); - change_to_virtual = true; + holder = method->method_holder(); + // check for private interface method invocations + if (vtable_index == Method::nonvirtual_vtable_index && holder->is_interface() ) { + assert(method->is_private(), "unexpected non-private method"); + assert(method->can_be_statically_bound(), "unexpected non-statically-bound method"); + // set_f2_as_vfinal_method checks if is_vfinal flag is true. + set_method_flags(as_TosState(method->result_type()), + ( 1 << is_vfinal_shift) | + ((method->is_final_method() ? 1 : 0) << is_final_shift), + method()->size_of_parameters()); + set_f2_as_vfinal_method(method()); + byte_no = 2; + set_f1(holder); // interface klass* + break; + } + else { + // We get here from InterpreterRuntime::resolve_invoke when an invokeinterface + // instruction links to a non-interface method (in Object). This can happen when + // an interface redeclares an Object method (like CharSequence declaring toString()) + // or when invokeinterface is used explicitly. + // In that case, the method has no itable index and must be invoked as a virtual. + // Set a flag to keep track of this corner case. + assert(holder->is_interface() || holder == SystemDictionary::Object_klass(), "unexpected holder class"); + assert(method->is_public(), "Calling non-public method in Object with invokeinterface"); + change_to_virtual = true; - // ...and fall through as if we were handling invokevirtual: + // ...and fall through as if we were handling invokevirtual: + } case Bytecodes::_invokevirtual: { if (!is_vtable_call) { @@ -237,7 +257,7 @@ // is executed. if (invoke_code != Bytecodes::_invokespecial || !sender_is_interface || method->name() == vmSymbols::object_initializer_name()) { - set_bytecode_1(invoke_code); + set_bytecode_1(invoke_code); } } else if (byte_no == 2) { if (change_to_virtual) { @@ -257,7 +277,18 @@ // We set bytecode_2() to _invokevirtual. // See also interpreterRuntime.cpp. (8/25/2000) } else { - assert(invoke_code == Bytecodes::_invokevirtual, ""); + assert(invoke_code == Bytecodes::_invokevirtual || + (invoke_code == Bytecodes::_invokeinterface && + ((method->is_private() || + (method->is_final() && method->method_holder() == SystemDictionary::Object_klass())))), + "unexpected invocation mode"); + if (invoke_code == Bytecodes::_invokeinterface && + (method->is_private() || method->is_final())) { + // We set bytecode_1() to _invokeinterface, because that is the + // bytecode # used by the interpreter to see if it is resolved. + // We set bytecode_2() to _invokevirtual. + set_bytecode_1(invoke_code); + } } // set up for invokevirtual, even if linking for invokeinterface also: set_bytecode_2(Bytecodes::_invokevirtual); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceClassLoaderKlass.hpp openjdk-11-11~24/src/hotspot/share/oops/instanceClassLoaderKlass.hpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceClassLoaderKlass.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceClassLoaderKlass.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP #define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP -#include "gc/shared/specialized_oop_closures.hpp" #include "oops/instanceKlass.hpp" #include "utilities/macros.hpp" @@ -40,8 +39,11 @@ class InstanceClassLoaderKlass: public InstanceKlass { friend class VMStructs; friend class InstanceKlass; - private: - InstanceClassLoaderKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_class_loader) {} +public: + static const KlassID ID = InstanceClassLoaderKlassID; + +private: + InstanceClassLoaderKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_class_loader, ID) {} public: InstanceClassLoaderKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } @@ -57,39 +59,24 @@ #endif // Oop fields (and metadata) iterators - // [nv = true] Use non-virtual calls to do_oop_nv. - // [nv = false] Use virtual calls to do_oop. // // The InstanceClassLoaderKlass iterators also visit the CLD pointer (or mirror of anonymous klasses.) - private: + public: // Forward iteration // Iterate over the oop fields and metadata. - template + template inline void oop_oop_iterate(oop obj, OopClosureType* closure); -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS // Reverse iteration // Iterate over the oop fields and metadata. - template + template inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure); -#endif // Bounded range iteration // Iterate over the oop fields and metadata. - template + template inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); - - public: - - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) -#endif - }; #endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceClassLoaderKlass.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,7 @@ #define SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_INLINE_HPP #include "classfile/javaClasses.hpp" -#include "memory/iterator.inline.hpp" +#include "memory/iterator.hpp" #include "oops/instanceClassLoaderKlass.hpp" #include "oops/instanceKlass.inline.hpp" #include "oops/oop.inline.hpp" @@ -34,48 +34,40 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" -template +template inline void InstanceClassLoaderKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { - InstanceKlass::oop_oop_iterate(obj, closure); + InstanceKlass::oop_oop_iterate(obj, closure); - if (Devirtualizer::do_metadata(closure)) { + if (Devirtualizer::do_metadata(closure)) { ClassLoaderData* cld = java_lang_ClassLoader::loader_data(obj); // cld can be null if we have a non-registered class loader. if (cld != NULL) { - Devirtualizer::do_cld(closure, cld); + Devirtualizer::do_cld(closure, cld); } } } -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -template +template inline void InstanceClassLoaderKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { - InstanceKlass::oop_oop_iterate_reverse(obj, closure); + InstanceKlass::oop_oop_iterate_reverse(obj, closure); - assert(!Devirtualizer::do_metadata(closure), + assert(!Devirtualizer::do_metadata(closure), "Code to handle metadata is not implemented"); } -#endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS - -template +template inline void InstanceClassLoaderKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { - InstanceKlass::oop_oop_iterate_bounded(obj, closure, mr); + InstanceKlass::oop_oop_iterate_bounded(obj, closure, mr); - if (Devirtualizer::do_metadata(closure)) { + if (Devirtualizer::do_metadata(closure)) { if (mr.contains(obj)) { ClassLoaderData* cld = java_lang_ClassLoader::loader_data(obj); // cld can be null if we have a non-registered class loader. if (cld != NULL) { - Devirtualizer::do_cld(closure, cld); + Devirtualizer::do_cld(closure, cld); } } } } -#define ALL_INSTANCE_CLASS_LOADER_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN( InstanceClassLoaderKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BOUNDED( InstanceClassLoaderKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BACKWARDS(InstanceClassLoaderKlass, OopClosureType, nv_suffix) - #endif // SHARE_VM_OOPS_INSTANCECLASSLOADERKLASS_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceKlass.cpp openjdk-11-11~24/src/hotspot/share/oops/instanceKlass.cpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceKlass.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceKlass.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -38,7 +38,6 @@ #include "code/dependencyContext.hpp" #include "compiler/compileBroker.hpp" #include "gc/shared/collectedHeap.inline.hpp" -#include "gc/shared/specialized_oop_closures.hpp" #include "interpreter/oopMapCache.hpp" #include "interpreter/rewriter.hpp" #include "jvmtifiles/jvmti.h" @@ -145,6 +144,198 @@ return false; } +// called to verify that k is a member of this nest +bool InstanceKlass::has_nest_member(InstanceKlass* k, TRAPS) const { + if (_nest_members == NULL || _nest_members == Universe::the_empty_short_array()) { + if (log_is_enabled(Trace, class, nestmates)) { + ResourceMark rm(THREAD); + log_trace(class, nestmates)("Checked nest membership of %s in non-nest-host class %s", + k->external_name(), this->external_name()); + } + return false; + } + + if (log_is_enabled(Trace, class, nestmates)) { + ResourceMark rm(THREAD); + log_trace(class, nestmates)("Checking nest membership of %s in %s", + k->external_name(), this->external_name()); + } + + // Check names first and if they match then check actual klass. This avoids + // resolving anything unnecessarily. + for (int i = 0; i < _nest_members->length(); i++) { + int cp_index = _nest_members->at(i); + Symbol* name = _constants->klass_name_at(cp_index); + if (name == k->name()) { + log_trace(class, nestmates)("- Found it at nest_members[%d] => cp[%d]", i, cp_index); + + // names match so check actual klass - this may trigger class loading if + // it doesn't match (but that should be impossible) + Klass* k2 = _constants->klass_at(cp_index, CHECK_false); + if (k2 == k) { + log_trace(class, nestmates)("- class is listed as a nest member"); + return true; + } else { + // same name but different klass! + log_trace(class, nestmates)(" - klass comparison failed!"); + // can't have different classes for the same name, so we're done + return false; + } + } + } + log_trace(class, nestmates)("- class is NOT a nest member!"); + return false; +} + +// Return nest-host class, resolving, validating and saving it if needed. +// In cases where this is called from a thread that can not do classloading +// (such as a native JIT thread) then we simply return NULL, which in turn +// causes the access check to return false. Such code will retry the access +// from a more suitable environment later. +InstanceKlass* InstanceKlass::nest_host(Symbol* validationException, TRAPS) { + InstanceKlass* nest_host_k = _nest_host; + if (nest_host_k == NULL) { + // need to resolve and save our nest-host class. This could be attempted + // concurrently but as the result is idempotent and we don't use the class + // then we do not need any synchronization beyond what is implicitly used + // during class loading. + if (_nest_host_index != 0) { // we have a real nest_host + // Before trying to resolve check if we're in a suitable context + if (!THREAD->can_call_java() && !_constants->tag_at(_nest_host_index).is_klass()) { + if (log_is_enabled(Trace, class, nestmates)) { + ResourceMark rm(THREAD); + log_trace(class, nestmates)("Rejected resolution of nest-host of %s in unsuitable thread", + this->external_name()); + } + return NULL; + } + + if (log_is_enabled(Trace, class, nestmates)) { + ResourceMark rm(THREAD); + log_trace(class, nestmates)("Resolving nest-host of %s using cp entry for %s", + this->external_name(), + _constants->klass_name_at(_nest_host_index)->as_C_string()); + } + + Klass* k = _constants->klass_at(_nest_host_index, THREAD); + if (HAS_PENDING_EXCEPTION) { + Handle exc_h = Handle(THREAD, PENDING_EXCEPTION); + if (exc_h->is_a(SystemDictionary::NoClassDefFoundError_klass())) { + // throw a new CDNFE with the original as its cause, and a clear msg + ResourceMark rm(THREAD); + char buf[200]; + CLEAR_PENDING_EXCEPTION; + jio_snprintf(buf, sizeof(buf), + "Unable to load nest-host class (%s) of %s", + _constants->klass_name_at(_nest_host_index)->as_C_string(), + this->external_name()); + log_trace(class, nestmates)("%s - NoClassDefFoundError", buf); + THROW_MSG_CAUSE_NULL(vmSymbols::java_lang_NoClassDefFoundError(), buf, exc_h); + } + // All other exceptions pass through (OOME, StackOverflowError, LinkageErrors etc). + return NULL; + } + + // A valid nest-host is an instance class in the current package that lists this + // class as a nest member. If any of these conditions are not met we post the + // requested exception type (if any) and return NULL + + const char* error = NULL; + + // JVMS 5.4.4 indicates package check comes first + if (is_same_class_package(k)) { + + // Now check actual membership. We can't be a member if our "host" is + // not an instance class. + if (k->is_instance_klass()) { + nest_host_k = InstanceKlass::cast(k); + + bool is_member = nest_host_k->has_nest_member(this, CHECK_NULL); + if (is_member) { + // save resolved nest-host value + _nest_host = nest_host_k; + + if (log_is_enabled(Trace, class, nestmates)) { + ResourceMark rm(THREAD); + log_trace(class, nestmates)("Resolved nest-host of %s to %s", + this->external_name(), k->external_name()); + } + return nest_host_k; + } + } + error = "current type is not listed as a nest member"; + } else { + error = "types are in different packages"; + } + + if (log_is_enabled(Trace, class, nestmates)) { + ResourceMark rm(THREAD); + log_trace(class, nestmates)("Type %s is not a nest member of resolved type %s: %s", + this->external_name(), + k->external_name(), + error); + } + + if (validationException != NULL) { + ResourceMark rm(THREAD); + Exceptions::fthrow(THREAD_AND_LOCATION, + validationException, + "Type %s is not a nest member of %s: %s", + this->external_name(), + k->external_name(), + error + ); + } + return NULL; + } else { + if (log_is_enabled(Trace, class, nestmates)) { + ResourceMark rm(THREAD); + log_trace(class, nestmates)("Type %s is not part of a nest: setting nest-host to self", + this->external_name()); + } + // save resolved nest-host value + return (_nest_host = this); + } + } + return nest_host_k; +} + +// check if 'this' and k are nestmates (same nest_host), or k is our nest_host, +// or we are k's nest_host - all of which is covered by comparing the two +// resolved_nest_hosts +bool InstanceKlass::has_nestmate_access_to(InstanceKlass* k, TRAPS) { + + assert(this != k, "this should be handled by higher-level code"); + + // Per JVMS 5.4.4 we first resolve and validate the current class, then + // the target class k. Resolution exceptions will be passed on by upper + // layers. IncompatibleClassChangeErrors from membership validation failures + // will also be passed through. + + Symbol* icce = vmSymbols::java_lang_IncompatibleClassChangeError(); + InstanceKlass* cur_host = nest_host(icce, CHECK_false); + if (cur_host == NULL) { + return false; + } + + Klass* k_nest_host = k->nest_host(icce, CHECK_false); + if (k_nest_host == NULL) { + return false; + } + + bool access = (cur_host == k_nest_host); + + if (log_is_enabled(Trace, class, nestmates)) { + ResourceMark rm(THREAD); + log_trace(class, nestmates)("Class %s does %shave nestmate access to %s", + this->external_name(), + access ? "" : "NOT ", + k->external_name()); + } + + return access; +} + InstanceKlass* InstanceKlass::allocate_instance_klass(const ClassFileParser& parser, TRAPS) { const int size = InstanceKlass::size(parser.vtable_size(), parser.itable_size(), @@ -169,13 +360,11 @@ else if (is_class_loader(class_name, parser)) { // class loader ik = new (loader_data, size, THREAD) InstanceClassLoaderKlass(parser); - } - else { + } else { // normal ik = new (loader_data, size, THREAD) InstanceKlass(parser, InstanceKlass::_misc_kind_other); } - } - else { + } else { // reference ik = new (loader_data, size, THREAD) InstanceRefKlass(parser); } @@ -211,11 +400,15 @@ return vtable_indices; } -InstanceKlass::InstanceKlass(const ClassFileParser& parser, unsigned kind) : +InstanceKlass::InstanceKlass(const ClassFileParser& parser, unsigned kind, KlassID id) : + Klass(id), _static_field_size(parser.static_field_size()), _nonstatic_oop_map_size(nonstatic_oop_map_size(parser.total_oop_map_count())), _itable_len(parser.itable_size()), - _reference_type(parser.reference_type()) { + _reference_type(parser.reference_type()), + _nest_members(NULL), + _nest_host_index(0), + _nest_host(NULL) { set_vtable_length(parser.vtable_size()); set_kind(kind); set_access_flags(parser.access_flags()); @@ -359,6 +552,13 @@ } set_inner_classes(NULL); + if (nest_members() != NULL && + nest_members() != Universe::the_empty_short_array() && + !nest_members()->is_shared()) { + MetadataFactory::free_array(loader_data, nest_members()); + } + set_nest_members(NULL); + // We should deallocate the Annotations instance if it's not in shared spaces. if (annotations() != NULL && !annotations()->is_shared()) { MetadataFactory::free_metadata(loader_data, annotations()); @@ -643,7 +843,6 @@ return true; } - // Rewrite the byte codes of all of the methods of a class. // The rewriter must be called exactly once. Rewriting must happen after // verification but before the first method of the class is executed. @@ -985,8 +1184,8 @@ } int size = objArrayOopDesc::object_size(length); Klass* ak = array_klass(n, CHECK_NULL); - objArrayOop o = - (objArrayOop)CollectedHeap::array_allocate(ak, size, length, CHECK_NULL); + objArrayOop o = (objArrayOop)Universe::heap()->array_allocate(ak, size, length, + /* do_zero */ true, CHECK_NULL); return o; } @@ -1011,7 +1210,7 @@ instanceOop i; - i = (instanceOop)CollectedHeap::obj_allocate(this, size, CHECK_NULL); + i = (instanceOop)Universe::heap()->obj_allocate(this, size, CHECK_NULL); if (has_finalizer_flag && !RegisterFinalizersAtInit) { i = register_finalizer(i, CHECK_NULL); } @@ -1359,13 +1558,14 @@ // and skips over static methods Method* InstanceKlass::find_instance_method(const Array* methods, const Symbol* name, - const Symbol* signature) { + const Symbol* signature, + PrivateLookupMode private_mode) { Method* const meth = InstanceKlass::find_method_impl(methods, name, signature, find_overpass, skip_static, - find_private); + private_mode); assert(((meth == NULL) || !meth->is_static()), "find_instance_method should have skipped statics"); return meth; @@ -1373,8 +1573,10 @@ // find_instance_method looks up the name/signature in the local methods array // and skips over static methods -Method* InstanceKlass::find_instance_method(const Symbol* name, const Symbol* signature) const { - return InstanceKlass::find_instance_method(methods(), name, signature); +Method* InstanceKlass::find_instance_method(const Symbol* name, + const Symbol* signature, + PrivateLookupMode private_mode) const { + return InstanceKlass::find_instance_method(methods(), name, signature, private_mode); } // Find looks up the name/signature in the local methods array @@ -1475,7 +1677,7 @@ // Do linear search to find matching signature. First, quick check // for common case, ignoring overpasses if requested. if (method_matches(m, signature, skipping_overpass, skipping_static, skipping_private)) { - return hit; + return hit; } // search downwards through overloaded methods @@ -1531,10 +1733,12 @@ } // uncached_lookup_method searches both the local class methods array and all -// superclasses methods arrays, skipping any overpass methods in superclasses. +// superclasses methods arrays, skipping any overpass methods in superclasses, +// and possibly skipping private methods. Method* InstanceKlass::uncached_lookup_method(const Symbol* name, const Symbol* signature, - OverpassLookupMode overpass_mode) const { + OverpassLookupMode overpass_mode, + PrivateLookupMode private_mode) const { OverpassLookupMode overpass_local_mode = overpass_mode; const Klass* klass = this; while (klass != NULL) { @@ -1542,7 +1746,7 @@ signature, overpass_local_mode, find_static, - find_private); + private_mode); if (method != NULL) { return method; } @@ -2044,6 +2248,8 @@ } } } + + it->push(&_nest_members); } void InstanceKlass::remove_unshareable_info() { @@ -2087,10 +2293,12 @@ guarantee(_previous_versions == NULL, "must be"); #endif - _init_thread = NULL; - _methods_jmethod_ids = NULL; - _jni_ids = NULL; - _oop_map_cache = NULL; + _init_thread = NULL; + _methods_jmethod_ids = NULL; + _jni_ids = NULL; + _oop_map_cache = NULL; + // clear _nest_host to ensure re-load at runtime + _nest_host = NULL; } void InstanceKlass::remove_java_mirror() { @@ -2642,9 +2850,14 @@ if (cnt >= nof_interfaces) { ResourceMark rm(THREAD); stringStream ss; + bool same_module = (module() == holder->module()); ss.print("Receiver class %s does not implement " - "the interface %s defining the method to be called", - class_loader_and_module_name(), holder->class_loader_and_module_name()); + "the interface %s defining the method to be called " + "(%s%s%s)", + external_name(), holder->external_name(), + (same_module) ? joint_in_module_of_loader(holder) : class_in_module_of_loader(), + (same_module) ? "" : "; ", + (same_module) ? "" : holder->class_in_module_of_loader()); THROW_MSG_NULL(vmSymbols::java_lang_IncompatibleClassChangeError(), ss.as_string()); } @@ -2946,6 +3159,7 @@ st->cr(); } st->print(BULLET"inner classes: "); inner_classes()->print_value_on(st); st->cr(); + st->print(BULLET"nest members: "); nest_members()->print_value_on(st); st->cr(); st->print(BULLET"java mirror: "); java_mirror()->print_value_on(st); st->cr(); st->print(BULLET"vtable length %d (start addr: " INTPTR_FORMAT ")", vtable_length(), p2i(start_of_vtable())); st->cr(); if (vtable_length() > 0 && (Verbose || WizardMode)) print_vtable(start_of_vtable(), vtable_length(), st); @@ -3188,6 +3402,7 @@ n += (sz->_transitive_interfaces_bytes = sz->count_array(transitive_interfaces())); n += (sz->_fields_bytes = sz->count_array(fields())); n += (sz->_inner_classes_bytes = sz->count_array(inner_classes())); + n += (sz->_nest_members_bytes = sz->count_array(nest_members())); sz->_ro_bytes += n; const ConstantPool* cp = constants(); @@ -3215,7 +3430,7 @@ // Verification -class VerifyFieldClosure: public OopClosure { +class VerifyFieldClosure: public BasicOopIterateClosure { protected: template void do_oop_work(T* p) { oop obj = RawAccess<>::oop_load(p); @@ -3363,7 +3578,7 @@ void InstanceKlass::oop_verify_on(oop obj, outputStream* st) { Klass::oop_verify_on(obj, st); VerifyFieldClosure blk; - obj->oop_iterate_no_header(&blk); + obj->oop_iterate(&blk); } @@ -3415,10 +3630,6 @@ } } -oop InstanceKlass::holder_phantom() const { - return class_loader_data()->holder_phantom(); -} - #ifdef ASSERT void InstanceKlass::set_init_state(ClassState state) { bool good_state = is_shared() ? (_init_state <= state) diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceKlass.hpp openjdk-11-11~24/src/hotspot/share/oops/instanceKlass.hpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceKlass.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceKlass.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -29,7 +29,6 @@ #include "classfile/classLoaderData.hpp" #include "classfile/moduleEntry.hpp" #include "classfile/packageEntry.hpp" -#include "gc/shared/specialized_oop_closures.hpp" #include "memory/referenceType.hpp" #include "oops/annotations.hpp" #include "oops/constMethod.hpp" @@ -120,8 +119,11 @@ friend class ClassFileParser; friend class CompileReplay; + public: + static const KlassID ID = InstanceKlassID; + protected: - InstanceKlass(const ClassFileParser& parser, unsigned kind); + InstanceKlass(const ClassFileParser& parser, unsigned kind, KlassID id = ID); public: InstanceKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } @@ -165,6 +167,19 @@ // number_of_inner_classes * 4 + enclosing_method_attribute_size. Array* _inner_classes; + // The NestMembers attribute. An array of shorts, where each is a + // class info index for the class that is a nest member. This data + // has not been validated. + Array* _nest_members; + + // The NestHost attribute. The class info index for the class + // that is the nest-host of this class. This data has not been validated. + jushort _nest_host_index; + + // Resolved nest-host klass: either true nest-host or self if we are not nested. + // By always being set it makes nest-member access checks simpler. + InstanceKlass* _nest_host; + // the source debug extension for this klass, NULL if not specified. // Specified as UTF-8 string without terminating zero byte in the classfile, // it is stored in the instanceklass as a NULL-terminated UTF-8 string @@ -435,6 +450,24 @@ Array* inner_classes() const { return _inner_classes; } void set_inner_classes(Array* f) { _inner_classes = f; } + // nest members + Array* nest_members() const { return _nest_members; } + void set_nest_members(Array* m) { _nest_members = m; } + + // nest-host index + jushort nest_host_index() const { return _nest_host_index; } + void set_nest_host_index(u2 i) { _nest_host_index = i; } + +private: + // Called to verify that k is a member of this nest - does not look at k's nest-host + bool has_nest_member(InstanceKlass* k, TRAPS) const; +public: + // Returns nest-host class, resolving and validating it if needed + // Returns NULL if an exception occurs during loading, or validation fails + InstanceKlass* nest_host(Symbol* validationException, TRAPS); + // Check if this klass is a nestmate of k - resolves this nest-host and k's + bool has_nestmate_access_to(InstanceKlass* k, TRAPS); + enum InnerClassAttributeOffset { // From http://mirror.eng/products/jdk/1.1/docs/guide/innerclasses/spec/innerclasses.doc10.html#18814 inner_class_inner_class_info_offset = 0, @@ -554,10 +587,12 @@ const Symbol* signature); // find a local method, but skip static methods - Method* find_instance_method(const Symbol* name, const Symbol* signature) const; + Method* find_instance_method(const Symbol* name, const Symbol* signature, + PrivateLookupMode private_mode = find_private) const; static Method* find_instance_method(const Array* methods, const Symbol* name, - const Symbol* signature); + const Symbol* signature, + PrivateLookupMode private_mode = find_private); // find a local method (returns NULL if not found) Method* find_local_method(const Symbol* name, @@ -585,7 +620,8 @@ // lookup operation (returns NULL if not found) Method* uncached_lookup_method(const Symbol* name, const Symbol* signature, - OverpassLookupMode overpass_mode) const; + OverpassLookupMode overpass_mode, + PrivateLookupMode private_mode = find_private) const; // lookup a method in all the interfaces that this class implements // (returns NULL if not found) @@ -653,11 +689,6 @@ return is_anonymous() ? java_mirror() : class_loader(); } - // Load the klass's holder as a phantom. This is useful when a weak Klass - // pointer has been "peeked" and then must be kept alive before it may - // be used safely. - oop holder_phantom() const; - bool is_contended() const { return (_misc_flags & _misc_is_contended) != 0; } @@ -1196,89 +1227,56 @@ #endif // Oop fields (and metadata) iterators - // [nv = true] Use non-virtual calls to do_oop_nv. - // [nv = false] Use virtual calls to do_oop. // // The InstanceKlass iterators also visits the Object's klass. // Forward iteration public: // Iterate over all oop fields in the oop maps. - template + template inline void oop_oop_iterate_oop_maps(oop obj, OopClosureType* closure); - protected: // Iterate over all oop fields and metadata. - template + template inline int oop_oop_iterate(oop obj, OopClosureType* closure); - private: - // Iterate over all oop fields in the oop maps. - // Specialized for [T = oop] or [T = narrowOop]. - template - inline void oop_oop_iterate_oop_maps_specialized(oop obj, OopClosureType* closure); - // Iterate over all oop fields in one oop map. - template + template inline void oop_oop_iterate_oop_map(OopMapBlock* map, oop obj, OopClosureType* closure); // Reverse iteration -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS - public: - // Iterate over all oop fields in the oop maps. - template - inline void oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure); - - protected: // Iterate over all oop fields and metadata. - template + template inline int oop_oop_iterate_reverse(oop obj, OopClosureType* closure); private: // Iterate over all oop fields in the oop maps. - // Specialized for [T = oop] or [T = narrowOop]. - template - inline void oop_oop_iterate_oop_maps_specialized_reverse(oop obj, OopClosureType* closure); + template + inline void oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure); // Iterate over all oop fields in one oop map. - template + template inline void oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure); -#endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS // Bounded range iteration public: // Iterate over all oop fields in the oop maps. - template + template inline void oop_oop_iterate_oop_maps_bounded(oop obj, OopClosureType* closure, MemRegion mr); - protected: // Iterate over all oop fields and metadata. - template + template inline int oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); private: - // Iterate over all oop fields in the oop maps. - // Specialized for [T = oop] or [T = narrowOop]. - template - inline void oop_oop_iterate_oop_maps_specialized_bounded(oop obj, OopClosureType* closure, MemRegion mr); - // Iterate over all oop fields in one oop map. - template + template inline void oop_oop_iterate_oop_map_bounded(OopMapBlock* map, oop obj, OopClosureType* closure, MemRegion mr); public: - - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) -#endif - u2 idnum_allocated_count() const { return _idnum_allocated_count; } public: diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceKlass.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/instanceKlass.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceKlass.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceKlass.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -54,30 +54,28 @@ // By force inlining the following functions, we get similar GC performance // as the previous macro based implementation. -template +template ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map(OopMapBlock* map, oop obj, OopClosureType* closure) { T* p = (T*)obj->obj_field_addr_raw(map->offset()); T* const end = p + map->count(); for (; p < end; ++p) { - Devirtualizer::do_oop(closure, p); + Devirtualizer::do_oop(closure, p); } } -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -template +template ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map_reverse(OopMapBlock* map, oop obj, OopClosureType* closure) { T* const start = (T*)obj->obj_field_addr_raw(map->offset()); T* p = start + map->count(); while (start < p) { --p; - Devirtualizer::do_oop(closure, p); + Devirtualizer::do_oop(closure, p); } } -#endif -template +template ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_map_bounded(OopMapBlock* map, oop obj, OopClosureType* closure, MemRegion mr) { T* p = (T*)obj->obj_field_addr_raw(map->offset()); T* end = p + map->count(); @@ -96,111 +94,73 @@ } for (;p < end; ++p) { - Devirtualizer::do_oop(closure, p); + Devirtualizer::do_oop(closure, p); } } -template -ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized(oop obj, OopClosureType* closure) { +template +ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps(oop obj, OopClosureType* closure) { OopMapBlock* map = start_of_nonstatic_oop_maps(); OopMapBlock* const end_map = map + nonstatic_oop_map_count(); for (; map < end_map; ++map) { - oop_oop_iterate_oop_map(map, obj, closure); + oop_oop_iterate_oop_map(map, obj, closure); } } -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -template -ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized_reverse(oop obj, OopClosureType* closure) { +template +ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure) { OopMapBlock* const start_map = start_of_nonstatic_oop_maps(); OopMapBlock* map = start_map + nonstatic_oop_map_count(); while (start_map < map) { --map; - oop_oop_iterate_oop_map_reverse(map, obj, closure); + oop_oop_iterate_oop_map_reverse(map, obj, closure); } } -#endif -template -ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_specialized_bounded(oop obj, OopClosureType* closure, MemRegion mr) { +template +ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_bounded(oop obj, OopClosureType* closure, MemRegion mr) { OopMapBlock* map = start_of_nonstatic_oop_maps(); OopMapBlock* const end_map = map + nonstatic_oop_map_count(); for (;map < end_map; ++map) { - oop_oop_iterate_oop_map_bounded(map, obj, closure, mr); - } -} - -template -ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps(oop obj, OopClosureType* closure) { - if (UseCompressedOops) { - oop_oop_iterate_oop_maps_specialized(obj, closure); - } else { - oop_oop_iterate_oop_maps_specialized(obj, closure); - } -} - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -template -ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_reverse(oop obj, OopClosureType* closure) { - if (UseCompressedOops) { - oop_oop_iterate_oop_maps_specialized_reverse(obj, closure); - } else { - oop_oop_iterate_oop_maps_specialized_reverse(obj, closure); - } -} -#endif - -template -ALWAYSINLINE void InstanceKlass::oop_oop_iterate_oop_maps_bounded(oop obj, OopClosureType* closure, MemRegion mr) { - if (UseCompressedOops) { - oop_oop_iterate_oop_maps_specialized_bounded(obj, closure, mr); - } else { - oop_oop_iterate_oop_maps_specialized_bounded(obj, closure, mr); + oop_oop_iterate_oop_map_bounded(map, obj, closure, mr); } } -template +template ALWAYSINLINE int InstanceKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { - if (Devirtualizer::do_metadata(closure)) { - Devirtualizer::do_klass(closure, this); + if (Devirtualizer::do_metadata(closure)) { + Devirtualizer::do_klass(closure, this); } - oop_oop_iterate_oop_maps(obj, closure); + oop_oop_iterate_oop_maps(obj, closure); return size_helper(); } -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -template +template ALWAYSINLINE int InstanceKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { - assert(!Devirtualizer::do_metadata(closure), + assert(!Devirtualizer::do_metadata(closure), "Code to handle metadata is not implemented"); - oop_oop_iterate_oop_maps_reverse(obj, closure); + oop_oop_iterate_oop_maps_reverse(obj, closure); return size_helper(); } -#endif -template +template ALWAYSINLINE int InstanceKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { - if (Devirtualizer::do_metadata(closure)) { + if (Devirtualizer::do_metadata(closure)) { if (mr.contains(obj)) { - Devirtualizer::do_klass(closure, this); + Devirtualizer::do_klass(closure, this); } } - oop_oop_iterate_oop_maps_bounded(obj, closure, mr); + oop_oop_iterate_oop_maps_bounded(obj, closure, mr); return size_helper(); } -#define ALL_INSTANCE_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN( InstanceKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BOUNDED( InstanceKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BACKWARDS(InstanceKlass, OopClosureType, nv_suffix) - #endif // SHARE_VM_OOPS_INSTANCEKLASS_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceMirrorKlass.cpp openjdk-11-11~24/src/hotspot/share/oops/instanceMirrorKlass.cpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceMirrorKlass.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceMirrorKlass.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,6 @@ #include "classfile/javaClasses.hpp" #include "classfile/systemDictionary.hpp" #include "gc/shared/collectedHeap.inline.hpp" -#include "gc/shared/specialized_oop_closures.hpp" #include "memory/iterator.inline.hpp" #include "memory/oopFactory.hpp" #include "oops/instanceKlass.hpp" @@ -53,7 +52,7 @@ // Since mirrors can be variable sized because of the static fields, store // the size in the mirror itself. - return (instanceOop)CollectedHeap::class_allocate(this, size, CHECK_NULL); + return (instanceOop)Universe::heap()->class_allocate(this, size, CHECK_NULL); } int InstanceMirrorKlass::oop_size(oop obj) const { diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceMirrorKlass.hpp openjdk-11-11~24/src/hotspot/share/oops/instanceMirrorKlass.hpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceMirrorKlass.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceMirrorKlass.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,6 @@ #define SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP #include "classfile/systemDictionary.hpp" -#include "gc/shared/specialized_oop_closures.hpp" #include "oops/instanceKlass.hpp" #include "runtime/handles.hpp" #include "utilities/macros.hpp" @@ -45,10 +44,13 @@ friend class VMStructs; friend class InstanceKlass; + public: + static const KlassID ID = InstanceMirrorKlassID; + private: static int _offset_of_static_fields; - InstanceMirrorKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_mirror) {} + InstanceMirrorKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_mirror, ID) {} public: InstanceMirrorKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } @@ -98,60 +100,33 @@ #endif // Oop fields (and metadata) iterators - // [nv = true] Use non-virtual calls to do_oop_nv. - // [nv = false] Use virtual calls to do_oop. // // The InstanceMirrorKlass iterators also visit the hidden Klass pointer. - public: // Iterate over the static fields. - template + template inline void oop_oop_iterate_statics(oop obj, OopClosureType* closure); - private: - // Iterate over the static fields. - // Specialized for [T = oop] or [T = narrowOop]. - template - inline void oop_oop_iterate_statics_specialized(oop obj, OopClosureType* closure); - // Forward iteration // Iterate over the oop fields and metadata. - template + template inline void oop_oop_iterate(oop obj, OopClosureType* closure); - // Reverse iteration -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS // Iterate over the oop fields and metadata. - template + template inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure); -#endif - // Bounded range iteration // Iterate over the oop fields and metadata. - template + template inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); - // Iterate over the static fields. - template - inline void oop_oop_iterate_statics_bounded(oop obj, OopClosureType* closure, MemRegion mr); + private: // Iterate over the static fields. - // Specialized for [T = oop] or [T = narrowOop]. - template - inline void oop_oop_iterate_statics_specialized_bounded(oop obj, OopClosureType* closure, MemRegion mr); - - - public: - - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) -#endif + template + inline void oop_oop_iterate_statics_bounded(oop obj, OopClosureType* closure, MemRegion mr); }; #endif // SHARE_VM_OOPS_INSTANCEMIRRORKLASS_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceMirrorKlass.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -33,30 +33,21 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" -template -void InstanceMirrorKlass::oop_oop_iterate_statics_specialized(oop obj, OopClosureType* closure) { +template +void InstanceMirrorKlass::oop_oop_iterate_statics(oop obj, OopClosureType* closure) { T* p = (T*)start_of_static_fields(obj); T* const end = p + java_lang_Class::static_oop_field_count(obj); for (; p < end; ++p) { - Devirtualizer::do_oop(closure, p); - } -} - -template -void InstanceMirrorKlass::oop_oop_iterate_statics(oop obj, OopClosureType* closure) { - if (UseCompressedOops) { - oop_oop_iterate_statics_specialized(obj, closure); - } else { - oop_oop_iterate_statics_specialized(obj, closure); + Devirtualizer::do_oop(closure, p); } } -template +template void InstanceMirrorKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { - InstanceKlass::oop_oop_iterate(obj, closure); + InstanceKlass::oop_oop_iterate(obj, closure); - if (Devirtualizer::do_metadata(closure)) { + if (Devirtualizer::do_metadata(closure)) { Klass* klass = java_lang_Class::as_Klass(obj); // We'll get NULL for primitive mirrors. if (klass != NULL) { @@ -66,9 +57,9 @@ // loader data is claimed, this is done by calling do_cld explicitly. // For non-anonymous classes the call to do_cld is made when the class // loader itself is handled. - Devirtualizer::do_cld(closure, klass->class_loader_data()); + Devirtualizer::do_cld(closure, klass->class_loader_data()); } else { - Devirtualizer::do_klass(closure, klass); + Devirtualizer::do_klass(closure, klass); } } else { // We would like to assert here (as below) that if klass has been NULL, then @@ -83,22 +74,20 @@ } } - oop_oop_iterate_statics(obj, closure); + oop_oop_iterate_statics(obj, closure); } -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -template +template void InstanceMirrorKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { - InstanceKlass::oop_oop_iterate_reverse(obj, closure); + InstanceKlass::oop_oop_iterate_reverse(obj, closure); - InstanceMirrorKlass::oop_oop_iterate_statics(obj, closure); + InstanceMirrorKlass::oop_oop_iterate_statics(obj, closure); } -#endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS -template -void InstanceMirrorKlass::oop_oop_iterate_statics_specialized_bounded(oop obj, - OopClosureType* closure, - MemRegion mr) { +template +void InstanceMirrorKlass::oop_oop_iterate_statics_bounded(oop obj, + OopClosureType* closure, + MemRegion mr) { T* p = (T*)start_of_static_fields(obj); T* end = p + java_lang_Class::static_oop_field_count(obj); @@ -116,39 +105,25 @@ } for (;p < end; ++p) { - Devirtualizer::do_oop(closure, p); + Devirtualizer::do_oop(closure, p); } } -template -void InstanceMirrorKlass::oop_oop_iterate_statics_bounded(oop obj, OopClosureType* closure, MemRegion mr) { - if (UseCompressedOops) { - oop_oop_iterate_statics_specialized_bounded(obj, closure, mr); - } else { - oop_oop_iterate_statics_specialized_bounded(obj, closure, mr); - } -} - -template +template void InstanceMirrorKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { - InstanceKlass::oop_oop_iterate_bounded(obj, closure, mr); + InstanceKlass::oop_oop_iterate_bounded(obj, closure, mr); - if (Devirtualizer::do_metadata(closure)) { + if (Devirtualizer::do_metadata(closure)) { if (mr.contains(obj)) { Klass* klass = java_lang_Class::as_Klass(obj); // We'll get NULL for primitive mirrors. if (klass != NULL) { - Devirtualizer::do_klass(closure, klass); + Devirtualizer::do_klass(closure, klass); } } } - oop_oop_iterate_statics_bounded(obj, closure, mr); + oop_oop_iterate_statics_bounded(obj, closure, mr); } -#define ALL_INSTANCE_MIRROR_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN( InstanceMirrorKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BOUNDED( InstanceMirrorKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BACKWARDS(InstanceMirrorKlass, OopClosureType, nv_suffix) - #endif // SHARE_VM_OOPS_INSTANCEMIRRORKLASS_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceRefKlass.hpp openjdk-11-11~24/src/hotspot/share/oops/instanceRefKlass.hpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceRefKlass.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceRefKlass.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_OOPS_INSTANCEREFKLASS_HPP #define SHARE_VM_OOPS_INSTANCEREFKLASS_HPP -#include "gc/shared/specialized_oop_closures.hpp" #include "oops/instanceKlass.hpp" #include "utilities/macros.hpp" @@ -50,8 +49,11 @@ class InstanceRefKlass: public InstanceKlass { friend class InstanceKlass; + public: + static const KlassID ID = InstanceRefKlassID; + private: - InstanceRefKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_reference) {} + InstanceRefKlass(const ClassFileParser& parser) : InstanceKlass(parser, InstanceKlass::_misc_kind_reference, ID) {} public: InstanceRefKlass() { assert(DumpSharedSpaces || UseSharedSpaces, "only for CDS"); } @@ -67,52 +69,48 @@ #endif // Oop fields (and metadata) iterators - // [nv = true] Use non-virtual calls to do_oop_nv. - // [nv = false] Use virtual calls to do_oop. // // The InstanceRefKlass iterators also support reference processing. // Forward iteration -private: // Iterate over all oop fields and metadata. - template + template inline void oop_oop_iterate(oop obj, OopClosureType* closure); // Reverse iteration -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS // Iterate over all oop fields and metadata. - template + template inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure); -#endif // Bounded range iteration // Iterate over all oop fields and metadata. - template + template inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); + private: + // Reference processing part of the iterators. - // Specialized for [T = oop] or [T = narrowOop]. - template - inline void oop_oop_iterate_ref_processing_specialized(oop obj, OopClosureType* closure, Contains& contains); + template + inline void oop_oop_iterate_ref_processing(oop obj, OopClosureType* closure, Contains& contains); // Only perform reference processing if the referent object is within mr. - template + template inline void oop_oop_iterate_ref_processing_bounded(oop obj, OopClosureType* closure, MemRegion mr); // Reference processing - template + template inline void oop_oop_iterate_ref_processing(oop obj, OopClosureType* closure); // Building blocks for specialized handling. - template + template static void do_referent(oop obj, OopClosureType* closure, Contains& contains); - template + template static void do_next(oop obj, OopClosureType* closure, Contains& contains); - template + template static void do_discovered(oop obj, OopClosureType* closure, Contains& contains); template @@ -120,32 +118,27 @@ // Do discovery while handling InstanceRefKlasses. Reference discovery // is only done if the closure provides a ReferenceProcessor. - template + template static void oop_oop_iterate_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains); // Used for a special case in G1 where the closure needs to be applied // to the discovered field. Reference discovery is also done if the // closure provides a ReferenceProcessor. - template + template static void oop_oop_iterate_discovered_and_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains); // Apply the closure to all fields. No reference discovery is done. - template + template static void oop_oop_iterate_fields(oop obj, OopClosureType* closure, Contains& contains); + // Apply the closure to all fields, except the referent field. No reference discovery is done. + template + static void oop_oop_iterate_fields_except_referent(oop obj, OopClosureType* closure, Contains& contains); + template static void trace_reference_gc(const char *s, oop obj) NOT_DEBUG_RETURN; public: - - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_BACKWARDS) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_BACKWARDS) -#endif - // Update non-static oop maps so 'referent', 'nextPending' and // 'discovered' will look like non-oops static void update_nonstatic_oop_maps(Klass* k); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/instanceRefKlass.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/instanceRefKlass.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/instanceRefKlass.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/instanceRefKlass.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -37,19 +37,19 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/macros.hpp" -template +template void InstanceRefKlass::do_referent(oop obj, OopClosureType* closure, Contains& contains) { T* referent_addr = (T*)java_lang_ref_Reference::referent_addr_raw(obj); if (contains(referent_addr)) { - Devirtualizer::do_oop(closure, referent_addr); + Devirtualizer::do_oop(closure, referent_addr); } } -template +template void InstanceRefKlass::do_discovered(oop obj, OopClosureType* closure, Contains& contains) { T* discovered_addr = (T*)java_lang_ref_Reference::discovered_addr_raw(obj); if (contains(discovered_addr)) { - Devirtualizer::do_oop(closure, discovered_addr); + Devirtualizer::do_oop(closure, discovered_addr); } } @@ -76,7 +76,7 @@ return false; } -template +template void InstanceRefKlass::oop_oop_iterate_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains) { // Try to discover reference and return if it succeeds. if (try_discover(obj, type, closure)) { @@ -84,38 +84,47 @@ } // Treat referent and discovered as normal oops. - do_referent(obj, closure, contains); - do_discovered(obj, closure, contains); + do_referent(obj, closure, contains); + do_discovered(obj, closure, contains); } -template -void InstanceRefKlass::oop_oop_iterate_fields(oop obj, OopClosureType* closure, Contains& contains) { - do_referent(obj, closure, contains); - do_discovered(obj, closure, contains); -} - -template +template void InstanceRefKlass::oop_oop_iterate_discovered_and_discovery(oop obj, ReferenceType type, OopClosureType* closure, Contains& contains) { // Explicitly apply closure to the discovered field. - do_discovered(obj, closure, contains); + do_discovered(obj, closure, contains); // Then do normal reference processing with discovery. - oop_oop_iterate_discovery(obj, type, closure, contains); + oop_oop_iterate_discovery(obj, type, closure, contains); +} + +template +void InstanceRefKlass::oop_oop_iterate_fields(oop obj, OopClosureType* closure, Contains& contains) { + do_referent(obj, closure, contains); + do_discovered(obj, closure, contains); +} + +template +void InstanceRefKlass::oop_oop_iterate_fields_except_referent(oop obj, OopClosureType* closure, Contains& contains) { + do_discovered(obj, closure, contains); } -template -void InstanceRefKlass::oop_oop_iterate_ref_processing_specialized(oop obj, OopClosureType* closure, Contains& contains) { +template +void InstanceRefKlass::oop_oop_iterate_ref_processing(oop obj, OopClosureType* closure, Contains& contains) { switch (closure->reference_iteration_mode()) { - case ExtendedOopClosure::DO_DISCOVERY: + case OopIterateClosure::DO_DISCOVERY: trace_reference_gc("do_discovery", obj); - oop_oop_iterate_discovery(obj, reference_type(), closure, contains); + oop_oop_iterate_discovery(obj, reference_type(), closure, contains); break; - case ExtendedOopClosure::DO_DISCOVERED_AND_DISCOVERY: + case OopIterateClosure::DO_DISCOVERED_AND_DISCOVERY: trace_reference_gc("do_discovered_and_discovery", obj); - oop_oop_iterate_discovered_and_discovery(obj, reference_type(), closure, contains); + oop_oop_iterate_discovered_and_discovery(obj, reference_type(), closure, contains); break; - case ExtendedOopClosure::DO_FIELDS: + case OopIterateClosure::DO_FIELDS: trace_reference_gc("do_fields", obj); - oop_oop_iterate_fields(obj, closure, contains); + oop_oop_iterate_fields(obj, closure, contains); + break; + case OopIterateClosure::DO_FIELDS_EXCEPT_REFERENT: + trace_reference_gc("do_fields_except_referent", obj); + oop_oop_iterate_fields_except_referent(obj, closure, contains); break; default: ShouldNotReachHere(); @@ -127,14 +136,10 @@ template bool operator()(T* p) const { return true; } }; -template +template void InstanceRefKlass::oop_oop_iterate_ref_processing(oop obj, OopClosureType* closure) { AlwaysContains always_contains; - if (UseCompressedOops) { - oop_oop_iterate_ref_processing_specialized(obj, closure, always_contains); - } else { - oop_oop_iterate_ref_processing_specialized(obj, closure, always_contains); - } + oop_oop_iterate_ref_processing(obj, closure, always_contains); } class MrContains { @@ -144,38 +149,31 @@ template bool operator()(T* p) const { return _mr.contains(p); } }; -template +template void InstanceRefKlass::oop_oop_iterate_ref_processing_bounded(oop obj, OopClosureType* closure, MemRegion mr) { const MrContains contains(mr); - if (UseCompressedOops) { - oop_oop_iterate_ref_processing_specialized(obj, closure, contains); - } else { - oop_oop_iterate_ref_processing_specialized(obj, closure, contains); - } + oop_oop_iterate_ref_processing(obj, closure, contains); } -template +template void InstanceRefKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { - InstanceKlass::oop_oop_iterate(obj, closure); + InstanceKlass::oop_oop_iterate(obj, closure); - oop_oop_iterate_ref_processing(obj, closure); + oop_oop_iterate_ref_processing(obj, closure); } -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -template +template void InstanceRefKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { - InstanceKlass::oop_oop_iterate_reverse(obj, closure); + InstanceKlass::oop_oop_iterate_reverse(obj, closure); - oop_oop_iterate_ref_processing(obj, closure); + oop_oop_iterate_ref_processing(obj, closure); } -#endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS - -template +template void InstanceRefKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { - InstanceKlass::oop_oop_iterate_bounded(obj, closure, mr); + InstanceKlass::oop_oop_iterate_bounded(obj, closure, mr); - oop_oop_iterate_ref_processing_bounded(obj, closure, mr); + oop_oop_iterate_ref_processing_bounded(obj, closure, mr); } #ifdef ASSERT @@ -192,11 +190,4 @@ } #endif -// Macro to define InstanceRefKlass::oop_oop_iterate for virtual/nonvirtual for -// all closures. Macros calling macros above for each oop size. -#define ALL_INSTANCE_REF_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN( InstanceRefKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BOUNDED( InstanceRefKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BACKWARDS(InstanceRefKlass, OopClosureType, nv_suffix) - #endif // SHARE_VM_OOPS_INSTANCEREFKLASS_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/klass.cpp openjdk-11-11~24/src/hotspot/share/oops/klass.cpp --- openjdk-11-11~19/src/hotspot/share/oops/klass.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/klass.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -168,7 +168,9 @@ return NULL; } -Method* Klass::uncached_lookup_method(const Symbol* name, const Symbol* signature, OverpassLookupMode overpass_mode) const { +Method* Klass::uncached_lookup_method(const Symbol* name, const Symbol* signature, + OverpassLookupMode overpass_mode, + PrivateLookupMode private_mode) const { #ifdef ASSERT tty->print_cr("Error: uncached_lookup_method called on a klass oop." " Likely error: reflection method does not correctly" @@ -188,9 +190,10 @@ // which doesn't zero out the memory before calling the constructor. // Need to set the _java_mirror field explicitly to not hit an assert that the field // should be NULL before setting it. -Klass::Klass() : _prototype_header(markOopDesc::prototype()), - _shared_class_path_index(-1), - _java_mirror(NULL) { +Klass::Klass(KlassID id) : _id(id), + _prototype_header(markOopDesc::prototype()), + _shared_class_path_index(-1), + _java_mirror(NULL) { CDS_ONLY(_shared_class_flags = 0;) CDS_JAVA_HEAP_ONLY(_archived_mirror = 0;) _primary_supers[0] = this; @@ -386,6 +389,10 @@ debug_only(verify();) } +oop Klass::holder_phantom() const { + return class_loader_data()->holder_phantom(); +} + void Klass::clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses) { if (!ClassUnloading || !unloading_occurred) { return; @@ -767,80 +774,124 @@ #endif // PRODUCT -// The caller of class_loader_and_module_name() (or one of its callers) -// must use a ResourceMark in order to correctly free the result. -const char* Klass::class_loader_and_module_name() const { - const char* delim = "/"; - size_t delim_len = strlen(delim); - - const char* fqn = external_name(); - // Length of message to return; always include FQN - size_t msglen = strlen(fqn) + 1; - - bool has_cl_name = false; - bool has_mod_name = false; - bool has_version = false; - - // Use class loader name, if exists and not builtin - const char* class_loader_name = ""; - ClassLoaderData* cld = class_loader_data(); - assert(cld != NULL, "class_loader_data should not be NULL"); - if (!cld->is_builtin_class_loader_data()) { - // If not builtin, look for name - oop loader = class_loader(); - if (loader != NULL) { - oop class_loader_name_oop = java_lang_ClassLoader::name(loader); - if (class_loader_name_oop != NULL) { - class_loader_name = java_lang_String::as_utf8_string(class_loader_name_oop); - if (class_loader_name != NULL && class_loader_name[0] != '\0') { - has_cl_name = true; - msglen += strlen(class_loader_name) + delim_len; - } - } - } - } +// Caller needs ResourceMark +// joint_in_module_of_loader provides an optimization if 2 classes are in +// the same module to succinctly print out relevant information about their +// module name and class loader's name_and_id for error messages. +// Format: +// and +// are in module [@] +// of loader [, parent loader ] +const char* Klass::joint_in_module_of_loader(const Klass* class2, bool include_parent_loader) const { + assert(module() == class2->module(), "classes do not have the same module"); + const char* class1_name = external_name(); + size_t len = strlen(class1_name) + 1; + + const char* class2_description = class2->class_in_module_of_loader(true, include_parent_loader); + len += strlen(class2_description); + + len += strlen(" and "); + + char* joint_description = NEW_RESOURCE_ARRAY_RETURN_NULL(char, len); + + // Just return the FQN if error when allocating string + if (joint_description == NULL) { + return class1_name; + } + + jio_snprintf(joint_description, len, "%s and %s", + class1_name, + class2_description); + + return joint_description; +} + +// Caller needs ResourceMark +// class_in_module_of_loader provides a standard way to include +// relevant information about a class, such as its module name as +// well as its class loader's name_and_id, in error messages and logging. +// Format: +// is in module [@] +// of loader [, parent loader ] +const char* Klass::class_in_module_of_loader(bool use_are, bool include_parent_loader) const { + // 1. fully qualified external name of class + const char* klass_name = external_name(); + size_t len = strlen(klass_name) + 1; + // 2. module name + @version const char* module_name = ""; const char* version = ""; + bool has_version = false; + bool module_is_named = false; + const char* module_name_phrase = ""; const Klass* bottom_klass = is_objArray_klass() ? - ObjArrayKlass::cast(this)->bottom_klass() : this; + ObjArrayKlass::cast(this)->bottom_klass() : this; if (bottom_klass->is_instance_klass()) { ModuleEntry* module = InstanceKlass::cast(bottom_klass)->module(); - // Use module name, if exists if (module->is_named()) { - has_mod_name = true; + module_is_named = true; + module_name_phrase = "module "; module_name = module->name()->as_C_string(); - msglen += strlen(module_name); + len += strlen(module_name); // Use version if exists and is not a jdk module if (module->should_show_version()) { has_version = true; version = module->version()->as_C_string(); - msglen += strlen(version) + 1; // +1 for "@" + // Include stlen(version) + 1 for the "@" + len += strlen(version) + 1; } + } else { + module_name = UNNAMED_MODULE; + len += UNNAMED_MODULE_LEN; } } else { - // klass is an array of primitives, so its module is java.base + // klass is an array of primitives, module is java.base + module_is_named = true; + module_name_phrase = "module "; module_name = JAVA_BASE_NAME; + len += JAVA_BASE_NAME_LEN; } - if (has_cl_name || has_mod_name) { - msglen += delim_len; - } - - char* message = NEW_RESOURCE_ARRAY_RETURN_NULL(char, msglen); - - // Just return the FQN if error in allocating string - if (message == NULL) { - return fqn; - } - - jio_snprintf(message, msglen, "%s%s%s%s%s%s%s", - class_loader_name, - (has_cl_name) ? delim : "", - (has_mod_name) ? module_name : "", + // 3. class loader's name_and_id + ClassLoaderData* cld = class_loader_data(); + assert(cld != NULL, "class_loader_data should not be null"); + const char* loader_name_and_id = cld->loader_name_and_id(); + len += strlen(loader_name_and_id); + + // 4. include parent loader information + const char* parent_loader_phrase = ""; + const char* parent_loader_name_and_id = ""; + if (include_parent_loader && + !cld->is_builtin_class_loader_data()) { + oop parent_loader = java_lang_ClassLoader::parent(class_loader()); + ClassLoaderData *parent_cld = ClassLoaderData::class_loader_data(parent_loader); + assert(parent_cld != NULL, "parent's class loader data should not be null"); + parent_loader_name_and_id = parent_cld->loader_name_and_id(); + parent_loader_phrase = ", parent loader "; + len += strlen(parent_loader_phrase) + strlen(parent_loader_name_and_id); + } + + // Start to construct final full class description string + len += ((use_are) ? strlen(" are in ") : strlen(" is in ")); + len += strlen(module_name_phrase) + strlen(" of loader "); + + char* class_description = NEW_RESOURCE_ARRAY_RETURN_NULL(char, len); + + // Just return the FQN if error when allocating string + if (class_description == NULL) { + return klass_name; + } + + jio_snprintf(class_description, len, "%s %s in %s%s%s%s of loader %s%s%s", + klass_name, + (use_are) ? "are" : "is", + module_name_phrase, + module_name, (has_version) ? "@" : "", (has_version) ? version : "", - (has_cl_name || has_mod_name) ? delim : "", - fqn); - return message; + loader_name_and_id, + parent_loader_phrase, + parent_loader_name_and_id); + + return class_description; } diff -Nru openjdk-11-11~19/src/hotspot/share/oops/klass.hpp openjdk-11-11~24/src/hotspot/share/oops/klass.hpp --- openjdk-11-11~19/src/hotspot/share/oops/klass.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/klass.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,6 @@ #define SHARE_VM_OOPS_KLASS_HPP #include "classfile/classLoaderData.hpp" -#include "gc/shared/specialized_oop_closures.hpp" #include "memory/iterator.hpp" #include "memory/memRegion.hpp" #include "oops/metadata.hpp" @@ -38,6 +37,18 @@ #include "jfr/support/jfrTraceIdExtension.hpp" #endif +// Klass IDs for all subclasses of Klass +enum KlassID { + InstanceKlassID, + InstanceRefKlassID, + InstanceMirrorKlassID, + InstanceClassLoaderKlassID, + TypeArrayKlassID, + ObjArrayKlassID +}; + +const uint KLASS_ID_COUNT = 6; + // // A Klass provides: // 1: language level class object (method dictionary etc.) @@ -103,6 +114,9 @@ // because it is frequently queried. jint _layout_helper; + // Klass identifier used to implement devirtualized oop closure dispatching. + const KlassID _id; + // The fields _super_check_offset, _secondary_super_cache, _secondary_supers // and _primary_supers all help make fast subtype checks. See big discussion // in doc/server_compiler/checktype.txt @@ -173,11 +187,14 @@ protected: // Constructor - Klass(); + Klass(KlassID id); + Klass() : _id(KlassID(-1)) { assert(DumpSharedSpaces || UseSharedSpaces, "only for cds"); } void* operator new(size_t size, ClassLoaderData* loader_data, size_t word_size, TRAPS) throw(); public: + int id() { return _id; } + enum DefaultsLookupMode { find_defaults, skip_defaults }; enum OverpassLookupMode { find_overpass, skip_overpass }; enum StaticLookupMode { find_static, skip_static }; @@ -467,7 +484,9 @@ // lookup operation for MethodLookupCache friend class MethodLookupCache; virtual Klass* find_field(Symbol* name, Symbol* signature, fieldDescriptor* fd) const; - virtual Method* uncached_lookup_method(const Symbol* name, const Symbol* signature, OverpassLookupMode overpass_mode) const; + virtual Method* uncached_lookup_method(const Symbol* name, const Symbol* signature, + OverpassLookupMode overpass_mode, + PrivateLookupMode = find_private) const; public: Method* lookup_method(const Symbol* name, const Symbol* signature) const { return uncached_lookup_method(name, signature, find_overpass); @@ -541,7 +560,8 @@ // and the package separators as '/'. virtual const char* signature_name() const; - const char* class_loader_and_module_name() const; + const char* joint_in_module_of_loader(const Klass* class2, bool include_parent_loader = false) const; + const char* class_in_module_of_loader(bool use_are = false, bool include_parent_loader = false) const; // Returns "interface", "abstract class" or "class". const char* external_kind() const; @@ -638,6 +658,11 @@ // Klass is considered alive. Has already been marked as unloading. bool is_loader_alive() const { return !class_loader_data()->is_unloading(); } + // Load the klass's holder as a phantom. This is useful when a weak Klass + // pointer has been "peeked" and then must be kept alive before it may + // be used safely. + oop holder_phantom() const; + static void clean_weak_klass_links(bool unloading_occurred, bool clean_alive_klasses = true); static void clean_subklass_tree() { clean_weak_klass_links(/*unloading_occurred*/ true , /* clean_alive_klasses */ false); @@ -653,24 +678,6 @@ virtual void oop_pc_update_pointers(oop obj, ParCompactionManager* cm) = 0; #endif - // Iterators specialized to particular subtypes - // of ExtendedOopClosure, to avoid closure virtual calls. -#define Klass_OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ - virtual void oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) = 0; \ - /* Iterates "closure" over all the oops in "obj" (of type "this") within "mr". */ \ - virtual void oop_oop_iterate_bounded##nv_suffix(oop obj, OopClosureType* closure, MemRegion mr) = 0; - - ALL_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_DECL) - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -#define Klass_OOP_OOP_ITERATE_DECL_BACKWARDS(OopClosureType, nv_suffix) \ - virtual void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) = 0; - - ALL_OOP_OOP_ITERATE_CLOSURES_1(Klass_OOP_OOP_ITERATE_DECL_BACKWARDS) - ALL_OOP_OOP_ITERATE_CLOSURES_2(Klass_OOP_OOP_ITERATE_DECL_BACKWARDS) -#endif - virtual void array_klasses_do(void f(Klass* k)) {} // Return self, except for abstract classes with exactly 1 @@ -718,44 +725,4 @@ static Klass* decode_klass(narrowKlass v); }; -// Helper to convert the oop iterate macro suffixes into bool values that can be used by template functions. -#define nvs_nv_to_bool true -#define nvs_v_to_bool false -#define nvs_to_bool(nv_suffix) nvs##nv_suffix##_to_bool - -// Oop iteration macros for declarations. -// Used to generate declarations in the *Klass header files. - -#define OOP_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ - void oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure); \ - void oop_oop_iterate_bounded##nv_suffix(oop obj, OopClosureType* closure, MemRegion mr); - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -#define OOP_OOP_ITERATE_DECL_BACKWARDS(OopClosureType, nv_suffix) \ - void oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure); -#endif - - -// Oop iteration macros for definitions. -// Used to generate definitions in the *Klass.inline.hpp files. - -#define OOP_OOP_ITERATE_DEFN(KlassType, OopClosureType, nv_suffix) \ -void KlassType::oop_oop_iterate##nv_suffix(oop obj, OopClosureType* closure) { \ - oop_oop_iterate(obj, closure); \ -} - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -#define OOP_OOP_ITERATE_DEFN_BACKWARDS(KlassType, OopClosureType, nv_suffix) \ -void KlassType::oop_oop_iterate_backwards##nv_suffix(oop obj, OopClosureType* closure) { \ - oop_oop_iterate_reverse(obj, closure); \ -} -#else -#define OOP_OOP_ITERATE_DEFN_BACKWARDS(KlassType, OopClosureType, nv_suffix) -#endif - -#define OOP_OOP_ITERATE_DEFN_BOUNDED(KlassType, OopClosureType, nv_suffix) \ -void KlassType::oop_oop_iterate_bounded##nv_suffix(oop obj, OopClosureType* closure, MemRegion mr) { \ - oop_oop_iterate_bounded(obj, closure, mr); \ -} - #endif // SHARE_VM_OOPS_KLASS_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/klassVtable.cpp openjdk-11-11~24/src/hotspot/share/oops/klassVtable.cpp --- openjdk-11-11~19/src/hotspot/share/oops/klassVtable.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/klassVtable.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1122,7 +1122,7 @@ inline bool interface_method_needs_itable_index(Method* m) { if (m->is_static()) return false; // e.g., Stream.empty if (m->is_initializer()) return false; // or - if (m->is_private()) return false; // requires invokeSpecial + if (m->is_private()) return false; // uses direct call // If an interface redeclares a method from java.lang.Object, // it should already have a vtable index, don't touch it. // e.g., CharSequence.toString (from initialize_vtable) @@ -1211,8 +1211,13 @@ methodHandle target; if (m->has_itable_index()) { // This search must match the runtime resolution, i.e. selection search for invokeinterface - // to correctly enforce loader constraints for interface method inheritance - target = LinkResolver::lookup_instance_method_in_klasses(_klass, m->name(), m->signature(), CHECK); + // to correctly enforce loader constraints for interface method inheritance. + // Private methods are skipped as a private class method can never be the implementation + // of an interface method. + // Invokespecial does not perform selection based on the receiver, so it does not use + // the cached itable. + target = LinkResolver::lookup_instance_method_in_klasses(_klass, m->name(), m->signature(), + Klass::skip_private, CHECK); } if (target == NULL || !target->is_public() || target->is_abstract() || target->is_overpass()) { assert(target == NULL || !target->is_overpass() || target->is_public(), diff -Nru openjdk-11-11~19/src/hotspot/share/oops/method.cpp openjdk-11-11~24/src/hotspot/share/oops/method.cpp --- openjdk-11-11~19/src/hotspot/share/oops/method.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/method.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -690,12 +690,10 @@ int Method::line_number_from_bci(int bci) const { - if (bci == SynchronizationEntryBCI) bci = 0; - assert(bci == 0 || 0 <= bci && bci < code_size(), "illegal bci"); int best_bci = 0; int best_line = -1; - - if (has_linenumber_table()) { + if (bci == SynchronizationEntryBCI) bci = 0; + if (0 <= bci && bci < code_size() && has_linenumber_table()) { // The line numbers are a short array of 2-tuples [start_pc, line_number]. // Not necessarily sorted and not necessarily one-to-one. CompressedLineNumberReadStream stream(compressed_linenumber_table()); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/objArrayKlass.cpp openjdk-11-11~24/src/hotspot/share/oops/objArrayKlass.cpp --- openjdk-11-11~19/src/hotspot/share/oops/objArrayKlass.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/objArrayKlass.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -29,7 +29,6 @@ #include "classfile/systemDictionary.hpp" #include "classfile/vmSymbols.hpp" #include "gc/shared/collectedHeap.inline.hpp" -#include "gc/shared/specialized_oop_closures.hpp" #include "memory/iterator.inline.hpp" #include "memory/metadataFactory.hpp" #include "memory/metaspaceClosure.hpp" @@ -142,7 +141,7 @@ return oak; } -ObjArrayKlass::ObjArrayKlass(int n, Klass* element_klass, Symbol* name) : ArrayKlass(name) { +ObjArrayKlass::ObjArrayKlass(int n, Klass* element_klass, Symbol* name) : ArrayKlass(name, ID) { this->set_dimension(n); this->set_element_klass(element_klass); // decrement refcount because object arrays are not explicitly freed. The @@ -174,7 +173,8 @@ if (length >= 0) { if (length <= arrayOopDesc::max_array_length(T_OBJECT)) { int size = objArrayOopDesc::object_size(length); - return (objArrayOop)CollectedHeap::array_allocate(this, size, length, THREAD); + return (objArrayOop)Universe::heap()->array_allocate(this, size, length, + /* do_zero */ true, THREAD); } else { report_java_out_of_memory("Requested array size exceeds VM limit"); JvmtiExport::post_array_size_exhausted(); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/objArrayKlass.hpp openjdk-11-11~24/src/hotspot/share/oops/objArrayKlass.hpp --- openjdk-11-11~19/src/hotspot/share/oops/objArrayKlass.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/objArrayKlass.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -34,6 +34,10 @@ class ObjArrayKlass : public ArrayKlass { friend class VMStructs; friend class JVMCIVMStructs; + + public: + static const KlassID ID = ObjArrayKlassID; + private: // If you add a new field that points to any metaspace object, you // must add this field to ObjArrayKlass::metaspace_pointers_do(). @@ -127,63 +131,39 @@ #endif // Oop fields (and metadata) iterators - // [nv = true] Use non-virtual calls to do_oop_nv. - // [nv = false] Use virtual calls to do_oop. // // The ObjArrayKlass iterators also visits the Object's klass. - private: - // Iterate over oop elements and metadata. - template + template inline void oop_oop_iterate(oop obj, OopClosureType* closure); + // Iterate over oop elements and metadata. + template + inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure); + // Iterate over oop elements within mr, and metadata. - template + template inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); - // Iterate over oop elements with indices within [start, end), and metadata. - template - inline void oop_oop_iterate_range(oop obj, OopClosureType* closure, int start, int end); - // Iterate over oop elements within [start, end), and metadata. - // Specialized for [T = oop] or [T = narrowOop]. - template - inline void oop_oop_iterate_range_specialized(objArrayOop a, OopClosureType* closure, int start, int end); + template + inline void oop_oop_iterate_range(objArrayOop a, OopClosureType* closure, int start, int end); public: // Iterate over all oop elements. - template + template inline void oop_oop_iterate_elements(objArrayOop a, OopClosureType* closure); private: - // Iterate over all oop elements. - // Specialized for [T = oop] or [T = narrowOop]. - template - inline void oop_oop_iterate_elements_specialized(objArrayOop a, OopClosureType* closure); - // Iterate over all oop elements with indices within mr. - template - inline void oop_oop_iterate_elements_bounded(objArrayOop a, OopClosureType* closure, MemRegion mr); - - // Iterate over oop elements within [low, high).. - // Specialized for [T = oop] or [T = narrowOop]. - template - inline void oop_oop_iterate_elements_specialized_bounded(objArrayOop a, OopClosureType* closure, void* low, void* high); + template + inline void oop_oop_iterate_elements_bounded(objArrayOop a, OopClosureType* closure, void* low, void* high); + template + inline void oop_oop_iterate_elements_bounded(objArrayOop a, OopClosureType* closure, MemRegion mr); public: - - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_RANGE) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_RANGE) - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_NO_BACKWARDS) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_NO_BACKWARDS) -#endif - // JVM support jint compute_modifier_flags(TRAPS) const; diff -Nru openjdk-11-11~19/src/hotspot/share/oops/objArrayKlass.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/objArrayKlass.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/objArrayKlass.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/objArrayKlass.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,7 @@ #define SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP #include "memory/memRegion.hpp" -#include "memory/iterator.inline.hpp" +#include "memory/iterator.hpp" #include "oops/arrayOop.inline.hpp" #include "oops/arrayKlass.hpp" #include "oops/klass.hpp" @@ -35,18 +35,18 @@ #include "oops/oop.inline.hpp" #include "utilities/macros.hpp" -template -void ObjArrayKlass::oop_oop_iterate_elements_specialized(objArrayOop a, OopClosureType* closure) { +template +void ObjArrayKlass::oop_oop_iterate_elements(objArrayOop a, OopClosureType* closure) { T* p = (T*)a->base_raw(); T* const end = p + a->length(); for (;p < end; p++) { - Devirtualizer::do_oop(closure, p); + Devirtualizer::do_oop(closure, p); } } -template -void ObjArrayKlass::oop_oop_iterate_elements_specialized_bounded( +template +void ObjArrayKlass::oop_oop_iterate_elements_bounded( objArrayOop a, OopClosureType* closure, void* low, void* high) { T* const l = (T*)low; @@ -63,78 +63,58 @@ } for (;p < end; ++p) { - Devirtualizer::do_oop(closure, p); - } -} - -template -void ObjArrayKlass::oop_oop_iterate_elements(objArrayOop a, OopClosureType* closure) { - if (UseCompressedOops) { - oop_oop_iterate_elements_specialized(a, closure); - } else { - oop_oop_iterate_elements_specialized(a, closure); - } -} - -template -void ObjArrayKlass::oop_oop_iterate_elements_bounded(objArrayOop a, OopClosureType* closure, MemRegion mr) { - if (UseCompressedOops) { - oop_oop_iterate_elements_specialized_bounded(a, closure, mr.start(), mr.end()); - } else { - oop_oop_iterate_elements_specialized_bounded(a, closure, mr.start(), mr.end()); + Devirtualizer::do_oop(closure, p); } } -template +template void ObjArrayKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { assert (obj->is_array(), "obj must be array"); objArrayOop a = objArrayOop(obj); - if (Devirtualizer::do_metadata(closure)) { - Devirtualizer::do_klass(closure, obj->klass()); + if (Devirtualizer::do_metadata(closure)) { + Devirtualizer::do_klass(closure, obj->klass()); } - oop_oop_iterate_elements(a, closure); + oop_oop_iterate_elements(a, closure); +} + +template +void ObjArrayKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { + // No reverse implementation ATM. + oop_oop_iterate(obj, closure); } -template +template void ObjArrayKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { assert(obj->is_array(), "obj must be array"); objArrayOop a = objArrayOop(obj); - if (Devirtualizer::do_metadata(closure)) { - Devirtualizer::do_klass(closure, a->klass()); + if (Devirtualizer::do_metadata(closure)) { + Devirtualizer::do_klass(closure, a->klass()); } - oop_oop_iterate_elements_bounded(a, closure, mr); + oop_oop_iterate_elements_bounded(a, closure, mr.start(), mr.end()); } -template -void ObjArrayKlass::oop_oop_iterate_range_specialized(objArrayOop a, OopClosureType* closure, int start, int end) { +// Like oop_oop_iterate but only iterates over a specified range and only used +// for objArrayOops. +template +void ObjArrayKlass::oop_oop_iterate_range(objArrayOop a, OopClosureType* closure, int start, int end) { T* low = start == 0 ? cast_from_oop(a) : a->obj_at_addr_raw(start); T* high = (T*)a->base_raw() + end; - oop_oop_iterate_elements_specialized_bounded(a, closure, low, high); + oop_oop_iterate_elements_bounded(a, closure, low, high); } -// Like oop_oop_iterate but only iterates over a specified range and only used -// for objArrayOops. -template -void ObjArrayKlass::oop_oop_iterate_range(oop obj, OopClosureType* closure, int start, int end) { - assert(obj->is_array(), "obj must be array"); - objArrayOop a = objArrayOop(obj); - +// Placed here to resolve include cycle between objArrayKlass.inline.hpp and objArrayOop.inline.hpp +template +void objArrayOopDesc::oop_iterate_range(OopClosureType* blk, int start, int end) { if (UseCompressedOops) { - oop_oop_iterate_range_specialized(a, closure, start, end); + ((ObjArrayKlass*)klass())->oop_oop_iterate_range(this, blk, start, end); } else { - oop_oop_iterate_range_specialized(a, closure, start, end); + ((ObjArrayKlass*)klass())->oop_oop_iterate_range(this, blk, start, end); } } -#define ALL_OBJ_ARRAY_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN( ObjArrayKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BOUNDED( ObjArrayKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_RANGE( ObjArrayKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(ObjArrayKlass, OopClosureType, nv_suffix) - #endif // SHARE_VM_OOPS_OBJARRAYKLASS_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/objArrayOop.cpp openjdk-11-11~24/src/hotspot/share/oops/objArrayOop.cpp --- openjdk-11-11~19/src/hotspot/share/oops/objArrayOop.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/objArrayOop.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,6 @@ */ #include "precompiled.hpp" -#include "gc/shared/specialized_oop_closures.hpp" #include "oops/access.inline.hpp" #include "oops/objArrayKlass.hpp" #include "oops/objArrayOop.inline.hpp" @@ -37,18 +36,9 @@ } else { offs = objArrayOopDesc::obj_at_offset(index); } - return HeapAccess::oop_atomic_cmpxchg_at(exchange_value, as_oop(), offs, compare_value); + return HeapAccess::oop_atomic_cmpxchg_at(exchange_value, as_oop(), offs, compare_value); } Klass* objArrayOopDesc::element_klass() { return ObjArrayKlass::cast(klass())->element_klass(); } - -#define ObjArrayOop_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - \ -void objArrayOopDesc::oop_iterate_range(OopClosureType* blk, int start, int end) { \ - ((ObjArrayKlass*)klass())->oop_oop_iterate_range##nv_suffix(this, blk, start, end); \ -} - -ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayOop_OOP_ITERATE_DEFN) -ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayOop_OOP_ITERATE_DEFN) diff -Nru openjdk-11-11~19/src/hotspot/share/oops/objArrayOop.hpp openjdk-11-11~24/src/hotspot/share/oops/objArrayOop.hpp --- openjdk-11-11~19/src/hotspot/share/oops/objArrayOop.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/objArrayOop.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_OOPS_OBJARRAYOOP_HPP #define SHARE_VM_OOPS_OBJARRAYOOP_HPP -#include "gc/shared/specialized_oop_closures.hpp" #include "oops/arrayOop.hpp" #include "utilities/align.hpp" @@ -107,12 +106,10 @@ Klass* element_klass(); +public: // special iterators for index ranges, returns size of object -#define ObjArrayOop_OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ + template void oop_iterate_range(OopClosureType* blk, int start, int end); - - ALL_OOP_OOP_ITERATE_CLOSURES_1(ObjArrayOop_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(ObjArrayOop_OOP_ITERATE_DECL) }; #endif // SHARE_VM_OOPS_OBJARRAYOOP_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/objArrayOop.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/objArrayOop.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/objArrayOop.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/objArrayOop.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,12 +46,12 @@ inline oop objArrayOopDesc::obj_at(int index) const { ptrdiff_t offset = UseCompressedOops ? obj_at_offset(index) : obj_at_offset(index); - return HeapAccess::oop_load_at(as_oop(), offset); + return HeapAccess::oop_load_at(as_oop(), offset); } inline void objArrayOopDesc::obj_at_put(int index, oop value) { ptrdiff_t offset = UseCompressedOops ? obj_at_offset(index) : obj_at_offset(index); - HeapAccess::oop_store_at(as_oop(), offset, value); + HeapAccess::oop_store_at(as_oop(), offset, value); } #endif // SHARE_VM_OOPS_OBJARRAYOOP_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/oopHandle.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/oopHandle.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/oopHandle.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/oopHandle.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -29,7 +29,7 @@ #include "oops/oopHandle.hpp" inline oop OopHandle::resolve() const { - return (_obj == NULL) ? (oop)NULL : NativeAccess::oop_load(_obj); + return (_obj == NULL) ? (oop)NULL : NativeAccess<>::oop_load(_obj); } #endif // SHARE_VM_OOPS_OOPHANDLE_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/oop.hpp openjdk-11-11~24/src/hotspot/share/oops/oop.hpp --- openjdk-11-11~19/src/hotspot/share/oops/oop.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/oop.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,6 @@ #ifndef SHARE_VM_OOPS_OOP_HPP #define SHARE_VM_OOPS_OOP_HPP -#include "gc/shared/specialized_oop_closures.hpp" #include "memory/iterator.hpp" #include "memory/memRegion.hpp" #include "oops/access.hpp" @@ -70,6 +69,7 @@ inline void set_mark(volatile markOop m); inline void set_mark_raw(volatile markOop m); + static inline void set_mark_raw(HeapWord* mem, markOop m); inline void release_set_mark(markOop m); inline markOop cas_set_mark(markOop new_mark, markOop old_mark); @@ -83,15 +83,18 @@ inline Klass* klass() const; inline Klass* klass_or_null() const volatile; inline Klass* klass_or_null_acquire() const volatile; + static inline Klass** klass_addr(HeapWord* mem); + static inline narrowKlass* compressed_klass_addr(HeapWord* mem); inline Klass** klass_addr(); inline narrowKlass* compressed_klass_addr(); inline void set_klass(Klass* k); - inline void release_set_klass(Klass* k); + static inline void release_set_klass(HeapWord* mem, Klass* klass); // For klass field compression inline int klass_gap() const; inline void set_klass_gap(int z); + static inline void set_klass_gap(HeapWord* mem, int z); // For when the klass pointer is being used as a linked list "next" field. inline void set_klass_to_list_ptr(oop k); inline oop list_ptr_from_klass(); @@ -266,7 +269,7 @@ // Exactly one thread succeeds in inserting the forwarding pointer, and // this call returns "NULL" for that thread; any other thread has the // value of the forwarding pointer returned and does not modify "this". - inline oop forward_to_atomic(oop p); + inline oop forward_to_atomic(oop p, atomic_memory_order order = memory_order_conservative); inline oop forwardee() const; inline oop forwardee_acquire() const; @@ -288,35 +291,20 @@ inline void ps_push_contents(PSPromotionManager* pm); #endif + template + inline void oop_iterate(OopClosureType* cl); - // iterators, returns size of object -#define OOP_ITERATE_DECL(OopClosureType, nv_suffix) \ - inline void oop_iterate(OopClosureType* blk); \ - inline void oop_iterate(OopClosureType* blk, MemRegion mr); // Only in mr. + template + inline void oop_iterate(OopClosureType* cl, MemRegion mr); - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_DECL) + template + inline int oop_iterate_size(OopClosureType* cl); -#define OOP_ITERATE_SIZE_DECL(OopClosureType, nv_suffix) \ - inline int oop_iterate_size(OopClosureType* blk); \ - inline int oop_iterate_size(OopClosureType* blk, MemRegion mr); // Only in mr. + template + inline int oop_iterate_size(OopClosureType* cl, MemRegion mr); - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_SIZE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_SIZE_DECL) - - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS - -#define OOP_ITERATE_BACKWARDS_DECL(OopClosureType, nv_suffix) \ - inline void oop_iterate_backwards(OopClosureType* blk); - - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_ITERATE_BACKWARDS_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_ITERATE_BACKWARDS_DECL) - -#endif // INCLUDE_OOP_OOP_ITERATE_BACKWARDS - - inline int oop_iterate_no_header(OopClosure* bk); - inline int oop_iterate_no_header(OopClosure* bk, MemRegion mr); + template + inline void oop_iterate_backwards(OopClosureType* cl); inline static bool is_instanceof_or_null(oop obj, Klass* klass); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/oop.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/oop.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/oop.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/oop.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -63,6 +63,10 @@ _mark = m; } +void oopDesc::set_mark_raw(HeapWord* mem, markOop m) { + *(markOop*)(((char*)mem) + mark_offset_in_bytes()) = m; +} + void oopDesc::release_set_mark(markOop m) { HeapAccess::store_at(as_oop(), mark_offset_in_bytes(), m); } @@ -110,16 +114,26 @@ } } -Klass** oopDesc::klass_addr() { +Klass** oopDesc::klass_addr(HeapWord* mem) { // Only used internally and with CMS and will not work with // UseCompressedOops assert(!UseCompressedClassPointers, "only supported with uncompressed klass pointers"); - return (Klass**) &_metadata._klass; + ByteSize offset = byte_offset_of(oopDesc, _metadata._klass); + return (Klass**) (((char*)mem) + in_bytes(offset)); } -narrowKlass* oopDesc::compressed_klass_addr() { +narrowKlass* oopDesc::compressed_klass_addr(HeapWord* mem) { assert(UseCompressedClassPointers, "only called by compressed klass pointers"); - return &_metadata._compressed_klass; + ByteSize offset = byte_offset_of(oopDesc, _metadata._compressed_klass); + return (narrowKlass*) (((char*)mem) + in_bytes(offset)); +} + +Klass** oopDesc::klass_addr() { + return klass_addr((HeapWord*)this); +} + +narrowKlass* oopDesc::compressed_klass_addr() { + return compressed_klass_addr((HeapWord*)this); } #define CHECK_SET_KLASS(k) \ @@ -137,13 +151,13 @@ } } -void oopDesc::release_set_klass(Klass* k) { - CHECK_SET_KLASS(k); +void oopDesc::release_set_klass(HeapWord* mem, Klass* klass) { + CHECK_SET_KLASS(klass); if (UseCompressedClassPointers) { - OrderAccess::release_store(compressed_klass_addr(), - Klass::encode_klass_not_null(k)); + OrderAccess::release_store(compressed_klass_addr(mem), + Klass::encode_klass_not_null(klass)); } else { - OrderAccess::release_store(klass_addr(), k); + OrderAccess::release_store(klass_addr(mem), klass); } } @@ -153,12 +167,16 @@ return *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()); } -void oopDesc::set_klass_gap(int v) { +void oopDesc::set_klass_gap(HeapWord* mem, int v) { if (UseCompressedClassPointers) { - *(int*)(((intptr_t)this) + klass_gap_offset_in_bytes()) = v; + *(int*)(((char*)mem) + klass_gap_offset_in_bytes()) = v; } } +void oopDesc::set_klass_gap(int v) { + set_klass_gap((HeapWord*)this, v); +} + void oopDesc::set_klass_to_list_ptr(oop k) { // This is only to be used during GC, for from-space objects, so no // barrier is needed. @@ -352,7 +370,7 @@ return cas_set_mark_raw(m, compare, order) == compare; } -oop oopDesc::forward_to_atomic(oop p) { +oop oopDesc::forward_to_atomic(oop p, atomic_memory_order order) { markOop oldMark = mark_raw(); markOop forwardPtrMark = markOopDesc::encode_pointer_as_mark(p); markOop curMark; @@ -361,7 +379,7 @@ assert(sizeof(markOop) == sizeof(intptr_t), "CAS below requires this."); while (!oldMark->is_marked()) { - curMark = cas_set_mark_raw(forwardPtrMark, oldMark); + curMark = cas_set_mark_raw(forwardPtrMark, oldMark, order); assert(is_forwarded(), "object should have been forwarded"); if (curMark == oldMark) { return NULL; @@ -432,61 +450,36 @@ } #endif // INCLUDE_PARALLELGC -#define OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - \ -void oopDesc::oop_iterate(OopClosureType* blk) { \ - klass()->oop_oop_iterate##nv_suffix(this, blk); \ -} \ - \ -void oopDesc::oop_iterate(OopClosureType* blk, MemRegion mr) { \ - klass()->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ -} - -#define OOP_ITERATE_SIZE_DEFN(OopClosureType, nv_suffix) \ - \ -int oopDesc::oop_iterate_size(OopClosureType* blk) { \ - Klass* k = klass(); \ - int size = size_given_klass(k); \ - k->oop_oop_iterate##nv_suffix(this, blk); \ - return size; \ -} \ - \ -int oopDesc::oop_iterate_size(OopClosureType* blk, MemRegion mr) { \ - Klass* k = klass(); \ - int size = size_given_klass(k); \ - k->oop_oop_iterate_bounded##nv_suffix(this, blk, mr); \ - return size; \ -} - -int oopDesc::oop_iterate_no_header(OopClosure* blk) { - // The NoHeaderExtendedOopClosure wraps the OopClosure and proxies all - // the do_oop calls, but turns off all other features in ExtendedOopClosure. - NoHeaderExtendedOopClosure cl(blk); - return oop_iterate_size(&cl); -} - -int oopDesc::oop_iterate_no_header(OopClosure* blk, MemRegion mr) { - NoHeaderExtendedOopClosure cl(blk); - return oop_iterate_size(&cl, mr); -} - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS -#define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) \ - \ -inline void oopDesc::oop_iterate_backwards(OopClosureType* blk) { \ - klass()->oop_oop_iterate_backwards##nv_suffix(this, blk); \ -} -#else -#define OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) -#endif - -#define ALL_OOPDESC_OOP_ITERATE(OopClosureType, nv_suffix) \ - OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - OOP_ITERATE_SIZE_DEFN(OopClosureType, nv_suffix) \ - OOP_ITERATE_BACKWARDS_DEFN(OopClosureType, nv_suffix) +template +void oopDesc::oop_iterate(OopClosureType* cl) { + OopIteratorClosureDispatch::oop_oop_iterate(cl, this, klass()); +} + +template +void oopDesc::oop_iterate(OopClosureType* cl, MemRegion mr) { + OopIteratorClosureDispatch::oop_oop_iterate(cl, this, klass(), mr); +} + +template +int oopDesc::oop_iterate_size(OopClosureType* cl) { + Klass* k = klass(); + int size = size_given_klass(k); + OopIteratorClosureDispatch::oop_oop_iterate(cl, this, k); + return size; +} + +template +int oopDesc::oop_iterate_size(OopClosureType* cl, MemRegion mr) { + Klass* k = klass(); + int size = size_given_klass(k); + OopIteratorClosureDispatch::oop_oop_iterate(cl, this, k, mr); + return size; +} -ALL_OOP_OOP_ITERATE_CLOSURES_1(ALL_OOPDESC_OOP_ITERATE) -ALL_OOP_OOP_ITERATE_CLOSURES_2(ALL_OOPDESC_OOP_ITERATE) +template +void oopDesc::oop_iterate_backwards(OopClosureType* cl) { + OopIteratorClosureDispatch::oop_oop_iterate_backwards(cl, this, klass()); +} bool oopDesc::is_instanceof_or_null(oop obj, Klass* klass) { return obj == NULL || obj->klass()->is_subtype_of(klass); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/typeArrayKlass.cpp openjdk-11-11~24/src/hotspot/share/oops/typeArrayKlass.cpp --- openjdk-11-11~19/src/hotspot/share/oops/typeArrayKlass.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/typeArrayKlass.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -86,7 +86,7 @@ return new (loader_data, size, THREAD) TypeArrayKlass(type, name); } -TypeArrayKlass::TypeArrayKlass(BasicType type, Symbol* name) : ArrayKlass(name) { +TypeArrayKlass::TypeArrayKlass(BasicType type, Symbol* name) : ArrayKlass(name, ID) { set_layout_helper(array_layout_helper(type)); assert(is_array_klass(), "sanity"); assert(is_typeArray_klass(), "sanity"); @@ -102,14 +102,8 @@ if (length >= 0) { if (length <= max_length()) { size_t size = typeArrayOopDesc::object_size(layout_helper(), length); - typeArrayOop t; - CollectedHeap* ch = Universe::heap(); - if (do_zero) { - t = (typeArrayOop)CollectedHeap::array_allocate(this, (int)size, length, CHECK_NULL); - } else { - t = (typeArrayOop)CollectedHeap::array_allocate_nozero(this, (int)size, length, CHECK_NULL); - } - return t; + return (typeArrayOop)Universe::heap()->array_allocate(this, (int)size, length, + do_zero, CHECK_NULL); } else { report_java_out_of_memory("Requested array size exceeds VM limit"); JvmtiExport::post_array_size_exhausted(); diff -Nru openjdk-11-11~19/src/hotspot/share/oops/typeArrayKlass.hpp openjdk-11-11~24/src/hotspot/share/oops/typeArrayKlass.hpp --- openjdk-11-11~19/src/hotspot/share/oops/typeArrayKlass.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/typeArrayKlass.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -33,6 +33,10 @@ class TypeArrayKlass : public ArrayKlass { friend class VMStructs; + + public: + static const KlassID ID = TypeArrayKlassID; + private: jint _max_length; // maximum number of elements allowed in an array @@ -87,28 +91,20 @@ private: // The implementation used by all oop_oop_iterate functions in TypeArrayKlasses. - inline void oop_oop_iterate_impl(oop obj, ExtendedOopClosure* closure); + inline void oop_oop_iterate_impl(oop obj, OopIterateClosure* closure); + public: // Wraps oop_oop_iterate_impl to conform to macros. - template + template inline void oop_oop_iterate(oop obj, OopClosureType* closure); // Wraps oop_oop_iterate_impl to conform to macros. - template + template inline void oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr); - public: - - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL) - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_RANGE) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_RANGE) - -#if INCLUDE_OOP_OOP_ITERATE_BACKWARDS - ALL_OOP_OOP_ITERATE_CLOSURES_1(OOP_OOP_ITERATE_DECL_NO_BACKWARDS) - ALL_OOP_OOP_ITERATE_CLOSURES_2(OOP_OOP_ITERATE_DECL_NO_BACKWARDS) -#endif - + // Wraps oop_oop_iterate_impl to conform to macros. + template + inline void oop_oop_iterate_reverse(oop obj, OopClosureType* closure); protected: // Find n'th dimensional array diff -Nru openjdk-11-11~19/src/hotspot/share/oops/typeArrayKlass.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/typeArrayKlass.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/typeArrayKlass.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/typeArrayKlass.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,27 +31,27 @@ #include "oops/typeArrayKlass.hpp" #include "oops/typeArrayOop.hpp" -class ExtendedOopClosure; +class OopIterateClosure; -inline void TypeArrayKlass::oop_oop_iterate_impl(oop obj, ExtendedOopClosure* closure) { +inline void TypeArrayKlass::oop_oop_iterate_impl(oop obj, OopIterateClosure* closure) { assert(obj->is_typeArray(),"must be a type array"); - // Performance tweak: We skip iterating over the klass pointer since we - // know that Universe::TypeArrayKlass never moves. + // Performance tweak: We skip processing the klass pointer since all + // TypeArrayKlasses are guaranteed processed via the null class loader. } -template +template void TypeArrayKlass::oop_oop_iterate(oop obj, OopClosureType* closure) { oop_oop_iterate_impl(obj, closure); } -template +template void TypeArrayKlass::oop_oop_iterate_bounded(oop obj, OopClosureType* closure, MemRegion mr) { oop_oop_iterate_impl(obj, closure); } -#define ALL_TYPE_ARRAY_KLASS_OOP_OOP_ITERATE_DEFN(OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN( TypeArrayKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_BOUNDED( TypeArrayKlass, OopClosureType, nv_suffix) \ - OOP_OOP_ITERATE_DEFN_NO_BACKWARDS(TypeArrayKlass, OopClosureType, nv_suffix) +template +void TypeArrayKlass::oop_oop_iterate_reverse(oop obj, OopClosureType* closure) { + oop_oop_iterate_impl(obj, closure); +} #endif // SHARE_VM_OOPS_TYPEARRAYKLASS_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/oops/typeArrayOop.inline.hpp openjdk-11-11~24/src/hotspot/share/oops/typeArrayOop.inline.hpp --- openjdk-11-11~19/src/hotspot/share/oops/typeArrayOop.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/oops/typeArrayOop.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -91,92 +91,92 @@ inline jbyte typeArrayOopDesc::byte_at(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::byte_at_put(int which, jbyte contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, contents); + HeapAccess::store_at(as_oop(), offset, contents); } inline jboolean typeArrayOopDesc::bool_at(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::bool_at_put(int which, jboolean contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, jboolean(contents & 1)); + HeapAccess::store_at(as_oop(), offset, jboolean(contents & 1)); } inline jchar typeArrayOopDesc::char_at(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::char_at_put(int which, jchar contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, contents); + HeapAccess::store_at(as_oop(), offset, contents); } inline jint typeArrayOopDesc::int_at(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::int_at_put(int which, jint contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, contents); + HeapAccess::store_at(as_oop(), offset, contents); } inline jshort typeArrayOopDesc::short_at(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::short_at_put(int which, jshort contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, contents); + HeapAccess::store_at(as_oop(), offset, contents); } inline jushort typeArrayOopDesc::ushort_at(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::ushort_at_put(int which, jushort contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, contents); + HeapAccess::store_at(as_oop(), offset, contents); } inline jlong typeArrayOopDesc::long_at(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::long_at_put(int which, jlong contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, contents); + HeapAccess::store_at(as_oop(), offset, contents); } inline jfloat typeArrayOopDesc::float_at(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::float_at_put(int which, jfloat contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, contents); + HeapAccess::store_at(as_oop(), offset, contents); } inline jdouble typeArrayOopDesc::double_at(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::double_at_put(int which, jdouble contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, contents); + HeapAccess::store_at(as_oop(), offset, contents); } inline jbyte typeArrayOopDesc::byte_at_acquire(int which) const { ptrdiff_t offset = element_offset(which); - return HeapAccess::load_at(as_oop(), offset); + return HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::release_byte_at_put(int which, jbyte contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, contents); + HeapAccess::store_at(as_oop(), offset, contents); } // Java thinks Symbol arrays are just arrays of either long or int, since @@ -185,20 +185,20 @@ #ifdef _LP64 inline Symbol* typeArrayOopDesc::symbol_at(int which) const { ptrdiff_t offset = element_offset(which); - return (Symbol*)(jlong) HeapAccess::load_at(as_oop(), offset); + return (Symbol*)(jlong) HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::symbol_at_put(int which, Symbol* contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, (jlong)contents); + HeapAccess::store_at(as_oop(), offset, (jlong)contents); } #else inline Symbol* typeArrayOopDesc::symbol_at(int which) const { ptrdiff_t offset = element_offset(which); - return (Symbol*)(jint) HeapAccess::load_at(as_oop(), offset); + return (Symbol*)(jint) HeapAccess::load_at(as_oop(), offset); } inline void typeArrayOopDesc::symbol_at_put(int which, Symbol* contents) { ptrdiff_t offset = element_offset(which); - HeapAccess::store_at(as_oop(), offset, (jint)contents); + HeapAccess::store_at(as_oop(), offset, (jint)contents); } #endif // _LP64 diff -Nru openjdk-11-11~19/src/hotspot/share/opto/arraycopynode.cpp openjdk-11-11~24/src/hotspot/share/opto/arraycopynode.cpp --- openjdk-11-11~19/src/hotspot/share/opto/arraycopynode.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/arraycopynode.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -366,6 +366,9 @@ if (!forward_ctl->is_top()) { // copy forward mem = start_mem_dest; + uint alias_idx_src = phase->C->get_alias_index(atp_src); + uint alias_idx_dest = phase->C->get_alias_index(atp_dest); + bool same_alias = (alias_idx_src == alias_idx_dest); if (count > 0) { Node* v = LoadNode::make(*phase, forward_ctl, start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered); @@ -376,7 +379,7 @@ Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off)); Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off)); - v = LoadNode::make(*phase, forward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered); + v = LoadNode::make(*phase, forward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered); v = phase->transform(v); mem = StoreNode::make(*phase, forward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered); mem = phase->transform(mem); @@ -408,18 +411,21 @@ if (!backward_ctl->is_top()) { // copy backward mem = start_mem_dest; + uint alias_idx_src = phase->C->get_alias_index(atp_src); + uint alias_idx_dest = phase->C->get_alias_index(atp_dest); + bool same_alias = (alias_idx_src == alias_idx_dest); if (count > 0) { for (int i = count-1; i >= 1; i--) { Node* off = phase->MakeConX(type2aelembytes(copy_type) * i); Node* next_src = phase->transform(new AddPNode(base_src,adr_src,off)); Node* next_dest = phase->transform(new AddPNode(base_dest,adr_dest,off)); - Node* v = LoadNode::make(*phase, backward_ctl, mem, next_src, atp_src, value_type, copy_type, MemNode::unordered); + Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, next_src, atp_src, value_type, copy_type, MemNode::unordered); v = phase->transform(v); mem = StoreNode::make(*phase, backward_ctl,mem,next_dest,atp_dest,v, copy_type, MemNode::unordered); mem = phase->transform(mem); } - Node* v = LoadNode::make(*phase, backward_ctl, mem, adr_src, atp_src, value_type, copy_type, MemNode::unordered); + Node* v = LoadNode::make(*phase, backward_ctl, same_alias ? mem : start_mem_src, adr_src, atp_src, value_type, copy_type, MemNode::unordered); v = phase->transform(v); mem = StoreNode::make(*phase, backward_ctl, mem, adr_dest, atp_dest, v, copy_type, MemNode::unordered); mem = phase->transform(mem); @@ -659,7 +665,8 @@ c = bs->step_over_gc_barrier(c); CallNode* call = NULL; - if (c != NULL && c->is_Region()) { + guarantee(c != NULL, "step_over_gc_barrier failed, there must be something to step to."); + if (c->is_Region()) { for (uint i = 1; i < c->req(); i++) { if (c->in(i) != NULL) { Node* n = c->in(i)->in(0); diff -Nru openjdk-11-11~19/src/hotspot/share/opto/bytecodeInfo.cpp openjdk-11-11~24/src/hotspot/share/opto/bytecodeInfo.cpp --- openjdk-11-11~19/src/hotspot/share/opto/bytecodeInfo.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/bytecodeInfo.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -520,10 +520,10 @@ caller_bci, inline_msg); if (C->print_inlining()) { C->print_inlining(callee_method, inline_level(), caller_bci, inline_msg); - if (callee_method == NULL) tty->print(" callee not monotonic or profiled"); - if (Verbose && callee_method) { + guarantee(callee_method != NULL, "would crash in post_inlining_event"); + if (Verbose) { const InlineTree *top = this; - while( top->caller_tree() != NULL ) { top = top->caller_tree(); } + while (top->caller_tree() != NULL) { top = top->caller_tree(); } //tty->print(" bcs: %d+%d invoked: %d", top->count_inline_bcs(), callee_method->code_size(), callee_method->interpreter_invocation_count()); } } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/c2compiler.cpp openjdk-11-11~24/src/hotspot/share/opto/c2compiler.cpp --- openjdk-11-11~19/src/hotspot/share/opto/c2compiler.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/c2compiler.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -586,6 +586,7 @@ case vmIntrinsics::_montgomerySquare: case vmIntrinsics::_vectorizedMismatch: case vmIntrinsics::_ghash_processBlocks: + case vmIntrinsics::_base64_encodeBlock: case vmIntrinsics::_updateCRC32: case vmIntrinsics::_updateBytesCRC32: case vmIntrinsics::_updateByteBufferCRC32: diff -Nru openjdk-11-11~19/src/hotspot/share/opto/callnode.cpp openjdk-11-11~24/src/hotspot/share/opto/callnode.cpp --- openjdk-11-11~19/src/hotspot/share/opto/callnode.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/callnode.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -759,6 +759,7 @@ } } } + guarantee(dest != NULL, "Call had only one ptr in, broken IR!"); if (!dest->is_top() && may_modify_arraycopy_helper(phase->type(dest)->is_oopptr(), t_oop, phase)) { return true; } @@ -1149,6 +1150,11 @@ assert( n0->is_Call(), "expect a call here" ); } if( n0->is_Call() && n0->as_Call()->guaranteed_safepoint() ) { + // Don't remove a safepoint belonging to an OuterStripMinedLoopEndNode. + // If the loop dies, they will be removed together. + if (has_out_with(Op_OuterStripMinedLoopEnd)) { + return this; + } // Useless Safepoint, so remove it return in(TypeFunc::Control); } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/compile.cpp openjdk-11-11~24/src/hotspot/share/opto/compile.cpp --- openjdk-11-11~19/src/hotspot/share/opto/compile.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/compile.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -4049,9 +4049,9 @@ int Compile::ConstantTable::find_offset(Constant& con) const { int idx = _constants.find(con); - assert(idx != -1, "constant must be in constant table"); + guarantee(idx != -1, "constant must be in constant table"); int offset = _constants.at(idx).offset(); - assert(offset != -1, "constant table not emitted yet?"); + guarantee(offset != -1, "constant table not emitted yet?"); return offset; } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/doCall.cpp openjdk-11-11~24/src/hotspot/share/opto/doCall.cpp --- openjdk-11-11~19/src/hotspot/share/opto/doCall.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/doCall.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -505,28 +505,36 @@ speculative_receiver_type = receiver_type != NULL ? receiver_type->speculative_type() : NULL; } - // invoke-super-special + // Additional receiver subtype checks for interface calls via invokespecial or invokeinterface. + ciKlass* receiver_constraint = NULL; if (iter().cur_bc_raw() == Bytecodes::_invokespecial && !orig_callee->is_object_initializer()) { ciInstanceKlass* calling_klass = method()->holder(); ciInstanceKlass* sender_klass = calling_klass->is_anonymous() ? calling_klass->host_klass() : calling_klass; if (sender_klass->is_interface()) { - Node* receiver_node = stack(sp() - nargs); - Node* cls_node = makecon(TypeKlassPtr::make(sender_klass)); - Node* bad_type_ctrl = NULL; - Node* casted_receiver = gen_checkcast(receiver_node, cls_node, &bad_type_ctrl); - if (bad_type_ctrl != NULL) { - PreserveJVMState pjvms(this); - set_control(bad_type_ctrl); - uncommon_trap(Deoptimization::Reason_class_check, - Deoptimization::Action_none); - } - if (stopped()) { - return; // MUST uncommon-trap? - } - set_stack(sp() - nargs, casted_receiver); + receiver_constraint = sender_klass; + } + } else if (iter().cur_bc_raw() == Bytecodes::_invokeinterface && orig_callee->is_private()) { + assert(holder->is_interface(), "How did we get a non-interface method here!"); + receiver_constraint = holder; + } + + if (receiver_constraint != NULL) { + Node* receiver_node = stack(sp() - nargs); + Node* cls_node = makecon(TypeKlassPtr::make(receiver_constraint)); + Node* bad_type_ctrl = NULL; + Node* casted_receiver = gen_checkcast(receiver_node, cls_node, &bad_type_ctrl); + if (bad_type_ctrl != NULL) { + PreserveJVMState pjvms(this); + set_control(bad_type_ctrl); + uncommon_trap(Deoptimization::Reason_class_check, + Deoptimization::Action_none); + } + if (stopped()) { + return; // MUST uncommon-trap? } + set_stack(sp() - nargs, casted_receiver); } // Note: It's OK to try to inline a virtual call. diff -Nru openjdk-11-11~19/src/hotspot/share/opto/escape.cpp openjdk-11-11~24/src/hotspot/share/opto/escape.cpp --- openjdk-11-11~19/src/hotspot/share/opto/escape.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/escape.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1019,6 +1019,7 @@ strcmp(call->as_CallLeaf()->_name, "cipherBlockChaining_decryptAESCrypt") == 0 || strcmp(call->as_CallLeaf()->_name, "counterMode_AESCrypt") == 0 || strcmp(call->as_CallLeaf()->_name, "ghash_processBlocks") == 0 || + strcmp(call->as_CallLeaf()->_name, "encodeBlock") == 0 || strcmp(call->as_CallLeaf()->_name, "sha1_implCompress") == 0 || strcmp(call->as_CallLeaf()->_name, "sha1_implCompressMB") == 0 || strcmp(call->as_CallLeaf()->_name, "sha256_implCompress") == 0 || diff -Nru openjdk-11-11~19/src/hotspot/share/opto/gcm.cpp openjdk-11-11~24/src/hotspot/share/opto/gcm.cpp --- openjdk-11-11~19/src/hotspot/share/opto/gcm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/gcm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -684,37 +684,39 @@ assert(store_block != NULL, "unused killing projections skipped above"); if (store->is_Phi()) { - if (store->in(0)->is_Loop()) { - // 'load' uses memory which is one (or more) of the Phi's inputs. - // It must be scheduled not before the Phi, but rather before - // each of the relevant Phi inputs. - // - // Instead of finding the LCA of all inputs to a Phi that match 'mem', - // we mark each corresponding predecessor block and do a combined - // hoisting operation later (raise_LCA_above_marks). - // - // Do not assert(store_block != early, "Phi merging memory after access") - // PhiNode may be at start of block 'early' with backedge to 'early' - DEBUG_ONLY(bool found_match = false); - for (uint j = PhiNode::Input, jmax = store->req(); j < jmax; j++) { - if (store->in(j) == mem) { // Found matching input? - DEBUG_ONLY(found_match = true); - Block* pred_block = get_block_for_node(store_block->pred(j)); - if (pred_block != early) { - // If any predecessor of the Phi matches the load's "early block", - // we do not need a precedence edge between the Phi and 'load' - // since the load will be forced into a block preceding the Phi. - pred_block->set_raise_LCA_mark(load_index); - assert(!LCA_orig->dominates(pred_block) || - early->dominates(pred_block), "early is high enough"); - must_raise_LCA = true; - } else { - // anti-dependent upon PHI pinned below 'early', no edge needed - LCA = early; // but can not schedule below 'early' - } + // Loop-phis need to raise load before input. (Other phis are treated + // as store below.) + // + // 'load' uses memory which is one (or more) of the Phi's inputs. + // It must be scheduled not before the Phi, but rather before + // each of the relevant Phi inputs. + // + // Instead of finding the LCA of all inputs to a Phi that match 'mem', + // we mark each corresponding predecessor block and do a combined + // hoisting operation later (raise_LCA_above_marks). + // + // Do not assert(store_block != early, "Phi merging memory after access") + // PhiNode may be at start of block 'early' with backedge to 'early' + DEBUG_ONLY(bool found_match = false); + for (uint j = PhiNode::Input, jmax = store->req(); j < jmax; j++) { + if (store->in(j) == mem) { // Found matching input? + DEBUG_ONLY(found_match = true); + Block* pred_block = get_block_for_node(store_block->pred(j)); + if (pred_block != early) { + // If any predecessor of the Phi matches the load's "early block", + // we do not need a precedence edge between the Phi and 'load' + // since the load will be forced into a block preceding the Phi. + pred_block->set_raise_LCA_mark(load_index); + assert(!LCA_orig->dominates(pred_block) || + early->dominates(pred_block), "early is high enough"); + must_raise_LCA = true; + } else { + // anti-dependent upon PHI pinned below 'early', no edge needed + LCA = early; // but can not schedule below 'early' } } - assert(found_match, "no worklist bug"); + } + assert(found_match, "no worklist bug"); #ifdef TRACK_PHI_INPUTS #ifdef ASSERT // This assert asks about correct handling of PhiNodes, which may not @@ -728,7 +730,6 @@ "Expect at least one phi input will not be from original memory state"); #endif //ASSERT #endif //TRACK_PHI_INPUTS - } } else if (store_block != early) { // 'store' is between the current LCA and earliest possible block. // Label its block, and decide later on how to raise the LCA @@ -1262,6 +1263,7 @@ Node* use = self->fast_out(i); LCA = raise_LCA_above_use(LCA, use, self, this); } + guarantee(LCA != NULL, "There must be a LCA"); } // (Hide defs of imax, i from rest of block.) // Place temps in the block of their use. This isn't a diff -Nru openjdk-11-11~19/src/hotspot/share/opto/ifnode.cpp openjdk-11-11~24/src/hotspot/share/opto/ifnode.cpp --- openjdk-11-11~19/src/hotspot/share/opto/ifnode.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/ifnode.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -387,6 +387,7 @@ } else { assert( 0, "do not know how to handle this guy" ); } + guarantee(proj != NULL, "sanity"); Node *proj_path_data, *proj_path_ctrl; if( proj->Opcode() == Op_IfTrue ) { @@ -1490,7 +1491,8 @@ // be skipped. For example, range check predicate has two checks // for lower and upper bounds. ProjNode* unc_proj = proj_out(1 - prev_dom->as_Proj()->_con)->as_Proj(); - if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL) { + if (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL || + unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_profile_predicate) != NULL) { prev_dom = idom; } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/indexSet.cpp openjdk-11-11~24/src/hotspot/share/opto/indexSet.cpp --- openjdk-11-11~19/src/hotspot/share/opto/indexSet.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/indexSet.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -319,7 +319,7 @@ if (_max_blocks <= preallocated_block_list_size) { _blocks = _preallocated_block_list; } else { - _blocks = (IndexSet::BitBlock**) arena()->Amalloc_4(sizeof(IndexSet::BitBlock**) * _max_blocks); + _blocks = (IndexSet::BitBlock**) arena()->Amalloc_4(sizeof(IndexSet::BitBlock*) * _max_blocks); } for (uint i = 0; i < _max_blocks; i++) { set_block(i, &_empty_block); @@ -343,7 +343,7 @@ if (_max_blocks <= preallocated_block_list_size) { _blocks = _preallocated_block_list; } else { - _blocks = (IndexSet::BitBlock**) arena->Amalloc_4(sizeof(IndexSet::BitBlock**) * _max_blocks); + _blocks = (IndexSet::BitBlock**) arena->Amalloc_4(sizeof(IndexSet::BitBlock*) * _max_blocks); } for (uint i = 0; i < _max_blocks; i++) { set_block(i, &_empty_block); diff -Nru openjdk-11-11~19/src/hotspot/share/opto/lcm.cpp openjdk-11-11~24/src/hotspot/share/opto/lcm.cpp --- openjdk-11-11~19/src/hotspot/share/opto/lcm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/lcm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -646,7 +646,7 @@ } } // End of for all ready nodes in worklist - assert(idx >= 0, "index should be set"); + guarantee(idx >= 0, "index should be set"); Node *n = worklist[(uint)idx]; // Get the winner worklist.map((uint)idx, worklist.pop()); // Compress worklist diff -Nru openjdk-11-11~19/src/hotspot/share/opto/library_call.cpp openjdk-11-11~24/src/hotspot/share/opto/library_call.cpp --- openjdk-11-11~19/src/hotspot/share/opto/library_call.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/library_call.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -298,6 +298,7 @@ Node* get_key_start_from_aescrypt_object(Node* aescrypt_object); Node* get_original_key_start_from_aescrypt_object(Node* aescrypt_object); bool inline_ghash_processBlocks(); + bool inline_base64_encodeBlock(); bool inline_sha_implCompress(vmIntrinsics::ID id); bool inline_digestBase_implCompressMB(int predicate); bool inline_sha_implCompressMB(Node* digestBaseObj, ciInstanceKlass* instklass_SHA, @@ -833,6 +834,8 @@ case vmIntrinsics::_ghash_processBlocks: return inline_ghash_processBlocks(); + case vmIntrinsics::_base64_encodeBlock: + return inline_base64_encodeBlock(); case vmIntrinsics::_encodeISOArray: case vmIntrinsics::_encodeByteISOArray: @@ -6084,6 +6087,35 @@ return true; } +bool LibraryCallKit::inline_base64_encodeBlock() { + address stubAddr; + const char *stubName; + assert(UseBASE64Intrinsics, "need Base64 intrinsics support"); + assert(callee()->signature()->size() == 6, "base64_encodeBlock has 6 parameters"); + stubAddr = StubRoutines::base64_encodeBlock(); + stubName = "encodeBlock"; + + if (!stubAddr) return false; + Node* base64obj = argument(0); + Node* src = argument(1); + Node* offset = argument(2); + Node* len = argument(3); + Node* dest = argument(4); + Node* dp = argument(5); + Node* isURL = argument(6); + + Node* src_start = array_element_address(src, intcon(0), T_BYTE); + assert(src_start, "source array is NULL"); + Node* dest_start = array_element_address(dest, intcon(0), T_BYTE); + assert(dest_start, "destination array is NULL"); + + Node* base64 = make_runtime_call(RC_LEAF, + OptoRuntime::base64_encodeBlock_Type(), + stubAddr, stubName, TypePtr::BOTTOM, + src_start, offset, len, dest_start, dp, isURL); + return true; +} + //------------------------------inline_sha_implCompress----------------------- // // Calculate SHA (i.e., SHA-1) for single-block byte[] array. diff -Nru openjdk-11-11~19/src/hotspot/share/opto/loopnode.cpp openjdk-11-11~24/src/hotspot/share/opto/loopnode.cpp --- openjdk-11-11~19/src/hotspot/share/opto/loopnode.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/loopnode.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -616,6 +616,11 @@ } IfNode* check_iff = limit_check_proj->in(0)->as_If(); + + if (!is_dominator(get_ctrl(limit), check_iff->in(0))) { + return false; + } + Node* cmp_limit; Node* bol; @@ -4224,34 +4229,34 @@ // which can inhibit range check elimination. if (least != early) { Node* ctrl_out = least->unique_ctrl_out(); - if (ctrl_out && ctrl_out->is_CountedLoop() && + if (ctrl_out && ctrl_out->is_Loop() && least == ctrl_out->in(LoopNode::EntryControl)) { + // Move the node above predicates as far up as possible so a + // following pass of loop predication doesn't hoist a predicate + // that depends on it above that node. Node* new_ctrl = least; - // Move the node above predicates so a following pass of loop - // predication doesn't hoist a predicate that depends on it - // above that node. - if (find_predicate_insertion_point(new_ctrl, Deoptimization::Reason_loop_limit_check) != NULL) { - new_ctrl = new_ctrl->in(0)->in(0); - assert(is_dominator(early, new_ctrl), "least != early so we can move up the dominator tree"); - } - if (find_predicate_insertion_point(new_ctrl, Deoptimization::Reason_profile_predicate) != NULL) { - Node* c = new_ctrl->in(0)->in(0); - assert(is_dominator(early, c), "least != early so we can move up the dominator tree"); - new_ctrl = c; - } - if (find_predicate_insertion_point(new_ctrl, Deoptimization::Reason_predicate) != NULL) { + for (;;) { + if (!new_ctrl->is_Proj()) { + break; + } + CallStaticJavaNode* call = new_ctrl->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none); + if (call == NULL) { + break; + } + int req = call->uncommon_trap_request(); + Deoptimization::DeoptReason trap_reason = Deoptimization::trap_request_reason(req); + if (trap_reason != Deoptimization::Reason_loop_limit_check && + trap_reason != Deoptimization::Reason_predicate && + trap_reason != Deoptimization::Reason_profile_predicate) { + break; + } Node* c = new_ctrl->in(0)->in(0); - assert(is_dominator(early, c), "least != early so we can move up the dominator tree"); - new_ctrl = c; - } - if (new_ctrl != ctrl_out) { - least = new_ctrl; - } else if (ctrl_out->is_CountedLoop() || ctrl_out->is_OuterStripMinedLoop()) { - Node* least_dom = idom(least); - if (get_loop(least_dom)->is_member(get_loop(least))) { - least = least_dom; + if (is_dominator(c, early) && c != early) { + break; } + new_ctrl = c; } + least = new_ctrl; } } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/loopnode.hpp openjdk-11-11~24/src/hotspot/share/opto/loopnode.hpp --- openjdk-11-11~19/src/hotspot/share/opto/loopnode.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/loopnode.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -75,7 +75,8 @@ HasRangeChecks=8192, IsMultiversioned=16384, StripMined=32768, - ProfileTripFailed=65536}; + SubwordLoop=65536, + ProfileTripFailed=131072}; char _unswitch_count; enum { _unswitch_max=3 }; char _postloop_flags; @@ -99,6 +100,7 @@ bool partial_peel_has_failed() const { return _loop_flags & PartialPeelFailed; } bool is_strip_mined() const { return _loop_flags & StripMined; } bool is_profile_trip_failed() const { return _loop_flags & ProfileTripFailed; } + bool is_subword_loop() const { return _loop_flags & SubwordLoop; } void mark_partial_peel_failed() { _loop_flags |= PartialPeelFailed; } void mark_has_reductions() { _loop_flags |= HasReductions; } @@ -112,6 +114,7 @@ void mark_strip_mined() { _loop_flags |= StripMined; } void clear_strip_mined() { _loop_flags &= ~StripMined; } void mark_profile_trip_failed() { _loop_flags |= ProfileTripFailed; } + void mark_subword_loop() { _loop_flags |= SubwordLoop; } int unswitch_max() { return _unswitch_max; } int unswitch_count() { return _unswitch_count; } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/loopopts.cpp openjdk-11-11~24/src/hotspot/share/opto/loopopts.cpp --- openjdk-11-11~19/src/hotspot/share/opto/loopopts.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/loopopts.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -257,6 +257,7 @@ ProjNode* unc_proj = iff->as_If()->proj_out(1 - dp_proj->_con)->as_Proj(); if (exclude_loop_predicate && (unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_predicate) != NULL || + unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_profile_predicate) != NULL || unc_proj->is_uncommon_trap_proj(Deoptimization::Reason_range_check) != NULL)) { // If this is a range check (IfNode::is_range_check), do not // reorder because Compile::allow_range_check_smearing might have diff -Nru openjdk-11-11~19/src/hotspot/share/opto/loopPredicate.cpp openjdk-11-11~24/src/hotspot/share/opto/loopPredicate.cpp --- openjdk-11-11~19/src/hotspot/share/opto/loopPredicate.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/loopPredicate.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -684,6 +684,7 @@ Node* max_idx_expr = NULL; const TypeInt* idx_type = TypeInt::INT; if ((stride > 0) == (scale > 0) == upper) { + guarantee(limit != NULL, "sanity"); if (TraceLoopPredicate) { if (limit->is_Con()) { predString->print("(%d ", con_limit); @@ -1056,7 +1057,9 @@ stack.push(in, 1); break; } else if (in->is_IfProj() && - in->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none)) { + in->as_Proj()->is_uncommon_trap_if_pattern(Deoptimization::Reason_none) && + (in->in(0)->Opcode() == Op_If || + in->in(0)->Opcode() == Op_RangeCheck)) { if (pf.to(in) * loop_trip_cnt >= 1) { stack.push(in, 1); } @@ -1281,7 +1284,7 @@ Node* n = skip_loop_predicates(entry); // Check if predicates were already added to the profile predicate // block - if (n != entry->in(0)->in(0)) { + if (n != entry->in(0)->in(0) || n->outcnt() != 1) { has_profile_predicates = true; } entry = n; diff -Nru openjdk-11-11~19/src/hotspot/share/opto/loopTransform.cpp openjdk-11-11~24/src/hotspot/share/opto/loopTransform.cpp --- openjdk-11-11~19/src/hotspot/share/opto/loopTransform.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/loopTransform.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -768,11 +768,12 @@ Node *init_n = cl->init_trip(); Node *limit_n = cl->limit(); int stride_con = cl->stride_con(); + if (limit_n == NULL) return false; // We will dereference it below. + // Non-constant bounds. // Protect against over-unrolling when init or/and limit are not constant // (so that trip_count's init value is maxint) but iv range is known. - if (init_n == NULL || !init_n->is_Con() || - limit_n == NULL || !limit_n->is_Con()) { + if (init_n == NULL || !init_n->is_Con() || !limit_n->is_Con()) { Node* phi = cl->phi(); if (phi != NULL) { assert(phi->is_Phi() && phi->in(0) == _head, "Counted loop should have iv phi."); @@ -861,7 +862,9 @@ // Check for being too big if (body_size > (uint)_local_loop_unroll_limit) { - if ((UseSubwordForMaxVector || xors_in_loop >= 4) && body_size < (uint)LoopUnrollLimit * 4) return true; + if ((cl->is_subword_loop() || xors_in_loop >= 4) && body_size < (uint)LoopUnrollLimit * 4) { + return true; + } // Normal case: loop too big return false; } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/macro.cpp openjdk-11-11~24/src/hotspot/share/opto/macro.cpp --- openjdk-11-11~19/src/hotspot/share/opto/macro.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/macro.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -2154,6 +2154,7 @@ Node* mem = alock->in(TypeFunc::Memory); Node* ctrl = alock->in(TypeFunc::Control); + guarantee(ctrl != NULL, "missing control projection, cannot replace_node() with NULL"); extract_call_projections(alock); // There are 2 projections from the lock. The lock node will @@ -2188,8 +2189,7 @@ } // Seach for MemBarReleaseLock node and delete it also. - if (alock->is_Unlock() && ctrl != NULL && ctrl->is_Proj() && - ctrl->in(0)->is_MemBar()) { + if (alock->is_Unlock() && ctrl->is_Proj() && ctrl->in(0)->is_MemBar()) { MemBarNode* membar = ctrl->in(0)->as_MemBar(); assert(membar->Opcode() == Op_MemBarReleaseLock && mem->is_Proj() && membar == mem->in(0), ""); diff -Nru openjdk-11-11~19/src/hotspot/share/opto/memnode.cpp openjdk-11-11~24/src/hotspot/share/opto/memnode.cpp --- openjdk-11-11~19/src/hotspot/share/opto/memnode.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/memnode.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -370,10 +370,10 @@ if (mem != old_mem) { set_req(MemNode::Memory, mem); - if (can_reshape && old_mem->outcnt() == 0) { - igvn->_worklist.push(old_mem); + if (can_reshape && old_mem->outcnt() == 0 && igvn != NULL) { + igvn->_worklist.push(old_mem); } - if (phase->type( mem ) == Type::TOP) return NodeSentinel; + if (phase->type(mem) == Type::TOP) return NodeSentinel; return this; } @@ -518,8 +518,7 @@ if (ac->is_clonebasic()) { intptr_t offset; AllocateNode* alloc = AllocateNode::Ideal_allocation(ac->in(ArrayCopyNode::Dest), phase, offset); - assert(alloc != NULL && (!ReduceBulkZeroing || alloc->initialization()->is_complete_with_arraycopy()), "broken allocation"); - if (alloc == ld_alloc) { + if (alloc != NULL && alloc == ld_alloc) { return ac; } } @@ -826,7 +825,7 @@ } break; default: - // ShouldNotReachHere(); ??? + ShouldNotReachHere(); break; } assert(load != NULL, "LoadNode should have been created"); diff -Nru openjdk-11-11~19/src/hotspot/share/opto/node.hpp openjdk-11-11~24/src/hotspot/share/opto/node.hpp --- openjdk-11-11~19/src/hotspot/share/opto/node.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/node.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1689,9 +1689,10 @@ int block_idx = (idx >> _log2_node_notes_block_size); int grow_by = (block_idx - (arr == NULL? 0: arr->length())); if (grow_by >= 0) { - if (!can_grow) return NULL; + if (!can_grow) return NULL; grow_node_notes(arr, grow_by + 1); } + if (arr == NULL) return NULL; // (Every element of arr is a sub-array of length _node_notes_block_size.) return arr->at(block_idx) + (idx & (_node_notes_block_size-1)); } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/output.cpp openjdk-11-11~24/src/hotspot/share/opto/output.cpp --- openjdk-11-11~19/src/hotspot/share/opto/output.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/output.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1424,7 +1424,7 @@ // See if this instruction has a delay slot if (valid_bundle_info(n) && node_bundling(n)->use_unconditional_delay()) { - assert(delay_slot != NULL, "expecting delay slot node"); + guarantee(delay_slot != NULL, "expecting delay slot node"); // Back up 1 instruction cb->set_insts_end(cb->insts_end() - Pipeline::instr_unit_size()); diff -Nru openjdk-11-11~19/src/hotspot/share/opto/parse1.cpp openjdk-11-11~24/src/hotspot/share/opto/parse1.cpp --- openjdk-11-11~19/src/hotspot/share/opto/parse1.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/parse1.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1823,7 +1823,7 @@ // Instead, wire the new split into a MergeMem on the backedge. // The optimizer will sort it out, slicing the phi. if (remerge == NULL) { - assert(base != NULL, ""); + guarantee(base != NULL, ""); assert(base->in(0) != NULL, "should not be xformed away"); remerge = MergeMemNode::make(base->in(pnum)); gvn().set_type(remerge, Type::MEMORY); diff -Nru openjdk-11-11~19/src/hotspot/share/opto/parse2.cpp openjdk-11-11~24/src/hotspot/share/opto/parse2.cpp --- openjdk-11-11~19/src/hotspot/share/opto/parse2.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/parse2.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -69,7 +69,7 @@ const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(bt); Node* ld = access_load_at(array, adr, adr_type, elemtype, bt, - IN_HEAP | IN_HEAP_ARRAY | C2_CONTROL_DEPENDENT_LOAD); + IN_HEAP | IS_ARRAY | C2_CONTROL_DEPENDENT_LOAD); if (big_val) { push_pair(ld); } else { @@ -104,7 +104,7 @@ const TypeAryPtr* adr_type = TypeAryPtr::get_array_body_type(bt); - access_store_at(control(), array, adr, adr_type, val, elemtype, bt, MO_UNORDERED | IN_HEAP | IN_HEAP_ARRAY); + access_store_at(control(), array, adr, adr_type, val, elemtype, bt, MO_UNORDERED | IN_HEAP | IS_ARRAY); } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/parse3.cpp openjdk-11-11~24/src/hotspot/share/opto/parse3.cpp --- openjdk-11-11~19/src/hotspot/share/opto/parse3.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/parse3.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -351,7 +351,7 @@ Node* elem = expand_multianewarray(array_klass_1, &lengths[1], ndimensions-1, nargs); intptr_t offset = header + ((intptr_t)i << LogBytesPerHeapOop); Node* eaddr = basic_plus_adr(array, offset); - access_store_at(control(), array, eaddr, adr_type, elem, elemtype, T_OBJECT, IN_HEAP | IN_HEAP_ARRAY); + access_store_at(control(), array, eaddr, adr_type, elem, elemtype, T_OBJECT, IN_HEAP | IS_ARRAY); } } return array; diff -Nru openjdk-11-11~19/src/hotspot/share/opto/reg_split.cpp openjdk-11-11~24/src/hotspot/share/opto/reg_split.cpp --- openjdk-11-11~19/src/hotspot/share/opto/reg_split.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/reg_split.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -683,7 +683,7 @@ if( needs_phi ) { // create a new phi node and insert it into the block // type is taken from left over pointer to a predecessor - assert(n3,"No non-NULL reaching DEF for a Phi"); + guarantee(n3, "No non-NULL reaching DEF for a Phi"); phi = new PhiNode(b->head(), n3->bottom_type()); // initialize the Reaches entry for this LRG Reachblock[slidx] = phi; diff -Nru openjdk-11-11~19/src/hotspot/share/opto/runtime.cpp openjdk-11-11~24/src/hotspot/share/opto/runtime.cpp --- openjdk-11-11~19/src/hotspot/share/opto/runtime.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/runtime.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1123,6 +1123,27 @@ const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); return TypeFunc::make(domain, range); } +// Base64 encode function +const TypeFunc* OptoRuntime::base64_encodeBlock_Type() { + int argcnt = 6; + + const Type** fields = TypeTuple::fields(argcnt); + int argp = TypeFunc::Parms; + fields[argp++] = TypePtr::NOTNULL; // src array + fields[argp++] = TypeInt::INT; // offset + fields[argp++] = TypeInt::INT; // length + fields[argp++] = TypePtr::NOTNULL; // dest array + fields[argp++] = TypeInt::INT; // dp + fields[argp++] = TypeInt::BOOL; // isURL + assert(argp == TypeFunc::Parms + argcnt, "correct decoding"); + const TypeTuple* domain = TypeTuple::make(TypeFunc::Parms+argcnt, fields); + + // result type needed + fields = TypeTuple::fields(1); + fields[TypeFunc::Parms + 0] = NULL; // void + const TypeTuple* range = TypeTuple::make(TypeFunc::Parms, fields); + return TypeFunc::make(domain, range); +} //------------- Interpreter state access for on stack replacement const TypeFunc* OptoRuntime::osr_end_Type() { @@ -1587,7 +1608,12 @@ } int bci = jvms->bci(); if (bci < 0) bci = 0; - st.print("%s.%s@%d", m->holder()->name()->as_utf8(), m->name()->as_utf8(), bci); + if (m != NULL) { + st.print("%s.%s", m->holder()->name()->as_utf8(), m->name()->as_utf8()); + } else { + st.print("no method"); + } + st.print("@%d", bci); // To print linenumbers instead of bci use: m->line_number_from_bci(bci) } NamedCounter* c; diff -Nru openjdk-11-11~19/src/hotspot/share/opto/runtime.hpp openjdk-11-11~24/src/hotspot/share/opto/runtime.hpp --- openjdk-11-11~19/src/hotspot/share/opto/runtime.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/runtime.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -291,6 +291,7 @@ static const TypeFunc* vectorizedMismatch_Type(); static const TypeFunc* ghash_processBlocks_Type(); + static const TypeFunc* base64_encodeBlock_Type(); static const TypeFunc* updateBytesCRC32_Type(); static const TypeFunc* updateBytesCRC32C_Type(); diff -Nru openjdk-11-11~19/src/hotspot/share/opto/superword.cpp openjdk-11-11~24/src/hotspot/share/opto/superword.cpp --- openjdk-11-11~19/src/hotspot/share/opto/superword.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/superword.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -376,6 +376,7 @@ if (same_type) { max_vector = cur_max_vector; flag_small_bt = true; + cl->mark_subword_loop(); } } } diff -Nru openjdk-11-11~19/src/hotspot/share/opto/type.cpp openjdk-11-11~24/src/hotspot/share/opto/type.cpp --- openjdk-11-11~19/src/hotspot/share/opto/type.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/opto/type.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -252,17 +252,16 @@ ciObject* oop_constant = constant.as_object(); if (oop_constant->is_null_object()) { con_type = Type::get_zero_type(T_OBJECT); - } else if (require_constant || oop_constant->should_be_constant()) { + } else { + guarantee(require_constant || oop_constant->should_be_constant(), "con_type must get computed"); con_type = TypeOopPtr::make_from_constant(oop_constant, require_constant); - if (con_type != NULL) { - if (Compile::current()->eliminate_boxing() && is_autobox_cache) { - con_type = con_type->is_aryptr()->cast_to_autobox_cache(true); - } - if (stable_dimension > 0) { - assert(FoldStableValues, "sanity"); - assert(!con_type->is_zero_type(), "default value for stable field"); - con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension); - } + if (Compile::current()->eliminate_boxing() && is_autobox_cache) { + con_type = con_type->is_aryptr()->cast_to_autobox_cache(true); + } + if (stable_dimension > 0) { + assert(FoldStableValues, "sanity"); + assert(!con_type->is_zero_type(), "default value for stable field"); + con_type = con_type->is_aryptr()->cast_to_stable(true, stable_dimension); } } if (is_narrow_oop) { diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvm.cpp openjdk-11-11~24/src/hotspot/share/prims/jvm.cpp --- openjdk-11-11~19/src/hotspot/share/prims/jvm.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvm.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -38,6 +38,7 @@ #include "gc/shared/collectedHeap.inline.hpp" #include "interpreter/bytecode.hpp" #include "jfr/jfrEvents.hpp" +#include "logging/log.hpp" #include "memory/oopFactory.hpp" #include "memory/referenceType.hpp" #include "memory/resourceArea.hpp" @@ -661,9 +662,10 @@ oop new_obj_oop = NULL; if (obj->is_array()) { const int length = ((arrayOop)obj())->length(); - new_obj_oop = CollectedHeap::array_allocate(klass, size, length, CHECK_NULL); + new_obj_oop = Universe::heap()->array_allocate(klass, size, length, + /* do_zero */ true, CHECK_NULL); } else { - new_obj_oop = CollectedHeap::obj_allocate(klass, size, CHECK_NULL); + new_obj_oop = Universe::heap()->obj_allocate(klass, size, CHECK_NULL); } HeapAccess<>::clone(obj(), new_obj_oop, size); @@ -1892,6 +1894,98 @@ } JVM_END +JVM_ENTRY(jboolean, JVM_AreNestMates(JNIEnv *env, jclass current, jclass member)) +{ + JVMWrapper("JVM_AreNestMates"); + Klass* c = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(current)); + assert(c->is_instance_klass(), "must be"); + InstanceKlass* ck = InstanceKlass::cast(c); + Klass* m = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(member)); + assert(m->is_instance_klass(), "must be"); + InstanceKlass* mk = InstanceKlass::cast(m); + return ck->has_nestmate_access_to(mk, THREAD); +} +JVM_END + +JVM_ENTRY(jclass, JVM_GetNestHost(JNIEnv* env, jclass current)) +{ + // current is not a primitive or array class + JVMWrapper("JVM_GetNestHost"); + Klass* c = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(current)); + assert(c->is_instance_klass(), "must be"); + InstanceKlass* ck = InstanceKlass::cast(c); + // Don't post exceptions if validation fails + InstanceKlass* host = ck->nest_host(NULL, THREAD); + return (jclass) (host == NULL ? NULL : + JNIHandles::make_local(THREAD, host->java_mirror())); +} +JVM_END + +JVM_ENTRY(jobjectArray, JVM_GetNestMembers(JNIEnv* env, jclass current)) +{ + // current is not a primitive or array class + JVMWrapper("JVM_GetNestMembers"); + Klass* c = java_lang_Class::as_Klass(JNIHandles::resolve_non_null(current)); + assert(c->is_instance_klass(), "must be"); + InstanceKlass* ck = InstanceKlass::cast(c); + // Get the nest host for this nest - throw ICCE if validation fails + Symbol* icce = vmSymbols::java_lang_IncompatibleClassChangeError(); + InstanceKlass* host = ck->nest_host(icce, CHECK_NULL); + + { + JvmtiVMObjectAllocEventCollector oam; + Array* members = host->nest_members(); + int length = members == NULL ? 0 : members->length(); + // nest host is first in the array so make it one bigger + objArrayOop r = oopFactory::new_objArray(SystemDictionary::Class_klass(), + length + 1, CHECK_NULL); + objArrayHandle result (THREAD, r); + result->obj_at_put(0, host->java_mirror()); + if (length != 0) { + int i; + for (i = 0; i < length; i++) { + int cp_index = members->at(i); + Klass* k = host->constants()->klass_at(cp_index, CHECK_NULL); + if (k->is_instance_klass()) { + InstanceKlass* nest_host_k = + InstanceKlass::cast(k)->nest_host(icce, CHECK_NULL); + if (nest_host_k == host) { + result->obj_at_put(i+1, k->java_mirror()); + } + else { + // k's nest host is legal but it isn't our host so + // throw ICCE + ResourceMark rm(THREAD); + Exceptions::fthrow(THREAD_AND_LOCATION, + icce, + "Nest member %s in %s declares a different nest host of %s", + k->external_name(), + host->external_name(), + nest_host_k->external_name() + ); + return NULL; + } + } + else { + // we have a bad nest member entry - throw ICCE + ResourceMark rm(THREAD); + Exceptions::fthrow(THREAD_AND_LOCATION, + icce, + "Class %s can not be a nest member of %s", + k->external_name(), + host->external_name() + ); + return NULL; + } + } + } + else { + assert(host == ck, "must be singleton nest"); + } + return (jobjectArray)JNIHandles::make_local(THREAD, result()); + } +} +JVM_END // Constant pool access ////////////////////////////////////////////////////////// diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp openjdk-11-11~24/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp --- openjdk-11-11~19/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmtiClassFileReconstituter.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -388,6 +388,40 @@ } } +// NestHost_attribute { +// u2 attribute_name_index; +// u4 attribute_length; +// u2 host_class_index; +// } +void JvmtiClassFileReconstituter::write_nest_host_attribute() { + int length = sizeof(u2); + int host_class_index = ik()->nest_host_index(); + + write_attribute_name_index("NestHost"); + write_u4(length); + write_u2(host_class_index); +} + +// NestMembers_attribute { +// u2 attribute_name_index; +// u4 attribute_length; +// u2 number_of_classes; +// u2 classes[number_of_classes]; +// } +void JvmtiClassFileReconstituter::write_nest_members_attribute() { + Array* nest_members = ik()->nest_members(); + int number_of_classes = nest_members->length(); + int length = sizeof(u2) * (1 + number_of_classes); + + write_attribute_name_index("NestMembers"); + write_u4(length); + write_u2(number_of_classes); + for (int i = 0; i < number_of_classes; i++) { + u2 class_cp_index = nest_members->at(i); + write_u2(class_cp_index); + } +} + // Write InnerClasses attribute // JVMSpec| InnerClasses_attribute { @@ -658,6 +692,12 @@ if (cpool()->operands() != NULL) { ++attr_count; } + if (ik()->nest_host_index() != 0) { + ++attr_count; + } + if (ik()->nest_members() != Universe::the_empty_short_array()) { + ++attr_count; + } write_u2(attr_count); @@ -682,6 +722,12 @@ if (cpool()->operands() != NULL) { write_bootstrapmethod_attribute(); } + if (ik()->nest_host_index() != 0) { + write_nest_host_attribute(); + } + if (ik()->nest_members() != Universe::the_empty_short_array()) { + write_nest_members_attribute(); + } } // Write the method information portion of ClassFile structure diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmtiClassFileReconstituter.hpp openjdk-11-11~24/src/hotspot/share/prims/jvmtiClassFileReconstituter.hpp --- openjdk-11-11~19/src/hotspot/share/prims/jvmtiClassFileReconstituter.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmtiClassFileReconstituter.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -116,6 +116,8 @@ void write_attribute_name_index(const char* name); void write_annotations_attribute(const char* attr_name, AnnotationArray* annos); void write_bootstrapmethod_attribute(); + void write_nest_host_attribute(); + void write_nest_members_attribute(); address writeable_address(size_t size); void write_u1(u1 x); diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp openjdk-11-11~24/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp --- openjdk-11-11~19/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmtiCodeBlobEvents.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -269,7 +269,7 @@ ScopeDesc *sd = &sc0; while( !sd->is_top() ) { sd = sd->sender(); } int bci = sd->bci(); - if (bci != InvocationEntryBci) { + if (bci >= 0) { assert(map_length < pcds_in_method, "checking"); map[map_length].start_address = (const void*)pcd->real_pc(nm); map[map_length].location = bci; diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmtiEnvBase.cpp openjdk-11-11~24/src/hotspot/share/prims/jvmtiEnvBase.cpp --- openjdk-11-11~19/src/hotspot/share/prims/jvmtiEnvBase.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmtiEnvBase.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1219,7 +1219,7 @@ } infop->state = state; - if (thr != NULL || (state & JVMTI_THREAD_STATE_ALIVE) != 0) { + if (thr != NULL && (state & JVMTI_THREAD_STATE_ALIVE) != 0) { infop->frame_buffer = NEW_RESOURCE_ARRAY(jvmtiFrameInfo, max_frame_count()); env()->get_stack_trace(thr, 0, max_frame_count(), infop->frame_buffer, &(infop->frame_count)); diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmtiEnv.cpp openjdk-11-11~24/src/hotspot/share/prims/jvmtiEnv.cpp --- openjdk-11-11~19/src/hotspot/share/prims/jvmtiEnv.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmtiEnv.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -3644,13 +3644,13 @@ } /* end GetAvailableProcessors */ jvmtiError -JvmtiEnv::SetHeapSamplingRate(jint sampling_rate) { - if (sampling_rate < 0) { +JvmtiEnv::SetHeapSamplingInterval(jint sampling_interval) { + if (sampling_interval < 0) { return JVMTI_ERROR_ILLEGAL_ARGUMENT; } - ThreadHeapSampler::set_sampling_rate(sampling_rate); + ThreadHeapSampler::set_sampling_interval(sampling_interval); return JVMTI_ERROR_NONE; -} /* end SetHeapSamplingRate */ +} /* end SetHeapSamplingInterval */ // // System Properties functions diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmtiExport.cpp openjdk-11-11~24/src/hotspot/share/prims/jvmtiExport.cpp --- openjdk-11-11~19/src/hotspot/share/prims/jvmtiExport.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmtiExport.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -370,6 +370,14 @@ return JNI_EVERSION; // unsupported minor version number } break; + case 11: + switch (minor) { + case 0: // version 11.0. is recognized + break; + default: + return JNI_EVERSION; // unsupported minor version number + } + break; default: return JNI_EVERSION; // unsupported major version number } diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmtiH.xsl openjdk-11-11~24/src/hotspot/share/prims/jvmtiH.xsl --- openjdk-11-11~19/src/hotspot/share/prims/jvmtiH.xsl 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmtiH.xsl 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,6 @@ - + /* Errors */ @@ -91,7 +91,7 @@ - + @@ -114,6 +114,7 @@ JVMTI_VERSION_1_1 = 0x30010100, JVMTI_VERSION_1_2 = 0x30010200, JVMTI_VERSION_9 = 0x30090000, + JVMTI_VERSION_11 = 0x300B0000, JVMTI_VERSION = 0x30000000 + ( @@ -298,7 +299,7 @@ RESERVED */ - void *reserved + void *reserved diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmtiRedefineClasses.cpp openjdk-11-11~24/src/hotspot/share/prims/jvmtiRedefineClasses.cpp --- openjdk-11-11~19/src/hotspot/share/prims/jvmtiRedefineClasses.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmtiRedefineClasses.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -683,6 +683,95 @@ _operands_index_map_count = 0; } // end finalize_operands_merge() +// Symbol* comparator for qsort +// The caller must have an active ResourceMark. +static int symcmp(const void* a, const void* b) { + char* astr = (*(Symbol**)a)->as_C_string(); + char* bstr = (*(Symbol**)b)->as_C_string(); + return strcmp(astr, bstr); +} + +static jvmtiError check_nest_attributes(InstanceKlass* the_class, + InstanceKlass* scratch_class) { + // Check whether the class NestHost attribute has been changed. + Thread* thread = Thread::current(); + ResourceMark rm(thread); + JvmtiThreadState *state = JvmtiThreadState::state_for((JavaThread*)thread); + u2 the_nest_host_idx = the_class->nest_host_index(); + u2 scr_nest_host_idx = scratch_class->nest_host_index(); + + if (the_nest_host_idx != 0 && scr_nest_host_idx != 0) { + Symbol* the_sym = the_class->constants()->klass_name_at(the_nest_host_idx); + Symbol* scr_sym = scratch_class->constants()->klass_name_at(scr_nest_host_idx); + if (the_sym != scr_sym) { + log_trace(redefine, class, nestmates) + ("redefined class %s attribute change error: NestHost class: %s replaced with: %s", + the_class->external_name(), the_sym->as_C_string(), scr_sym->as_C_string()); + return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED; + } + } else if ((the_nest_host_idx == 0) ^ (scr_nest_host_idx == 0)) { + const char* action_str = (the_nest_host_idx != 0) ? "removed" : "added"; + log_trace(redefine, class, nestmates) + ("redefined class %s attribute change error: NestHost attribute %s", + the_class->external_name(), action_str); + return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED; + } + + // Check whether the class NestMembers attribute has been changed. + Array* the_nest_members = the_class->nest_members(); + Array* scr_nest_members = scratch_class->nest_members(); + bool the_members_exists = the_nest_members != Universe::the_empty_short_array(); + bool scr_members_exists = scr_nest_members != Universe::the_empty_short_array(); + + int members_len = the_nest_members->length(); + if (the_members_exists && scr_members_exists) { + if (members_len != scr_nest_members->length()) { + log_trace(redefine, class, nestmates) + ("redefined class %s attribute change error: NestMember len=%d changed to len=%d", + the_class->external_name(), members_len, scr_nest_members->length()); + return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED; + } + + // The order of entries in the NestMembers array is not specified so we + // have to explicitly check for the same contents. We do this by copying + // the referenced symbols into their own arrays, sorting them and then + // comparing each element pair. + + Symbol** the_syms = NEW_RESOURCE_ARRAY_RETURN_NULL(Symbol*, members_len); + Symbol** scr_syms = NEW_RESOURCE_ARRAY_RETURN_NULL(Symbol*, members_len); + + if (the_syms == NULL || scr_syms == NULL) { + return JVMTI_ERROR_OUT_OF_MEMORY; + } + + for (int i = 0; i < members_len; i++) { + int the_cp_index = the_nest_members->at(i); + int scr_cp_index = scr_nest_members->at(i); + the_syms[i] = the_class->constants()->klass_name_at(the_cp_index); + scr_syms[i] = scratch_class->constants()->klass_name_at(scr_cp_index); + } + + qsort(the_syms, members_len, sizeof(Symbol*), symcmp); + qsort(scr_syms, members_len, sizeof(Symbol*), symcmp); + + for (int i = 0; i < members_len; i++) { + if (the_syms[i] != scr_syms[i]) { + log_trace(redefine, class, nestmates) + ("redefined class %s attribute change error: NestMembers[%d]: %s changed to %s", + the_class->external_name(), i, the_syms[i]->as_C_string(), scr_syms[i]->as_C_string()); + return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED; + } + } + } else if (the_members_exists ^ scr_members_exists) { + const char* action_str = (the_members_exists) ? "removed" : "added"; + log_trace(redefine, class, nestmates) + ("redefined class %s attribute change error: NestMembers attribute %s", + the_class->external_name(), action_str); + return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED; + } + + return JVMTI_ERROR_NONE; +} jvmtiError VM_RedefineClasses::compare_and_normalize_class_versions( InstanceKlass* the_class, @@ -725,6 +814,12 @@ return JVMTI_ERROR_INVALID_CLASS; } + // Check whether the nest-related attributes have been changed. + jvmtiError err = check_nest_attributes(the_class, scratch_class); + if (err != JVMTI_ERROR_NONE) { + return err; + } + // Check whether class modifiers are the same. jushort old_flags = (jushort) the_class->access_flags().get_flags(); jushort new_flags = (jushort) scratch_class->access_flags().get_flags(); @@ -1598,6 +1693,12 @@ bool VM_RedefineClasses::rewrite_cp_refs(InstanceKlass* scratch_class, TRAPS) { + // rewrite constant pool references in the nest attributes: + if (!rewrite_cp_refs_in_nest_attributes(scratch_class)) { + // propagate failure back to caller + return false; + } + // rewrite constant pool references in the methods: if (!rewrite_cp_refs_in_methods(scratch_class, THREAD)) { // propagate failure back to caller @@ -1680,6 +1781,22 @@ return true; } // end rewrite_cp_refs() +// Rewrite constant pool references in the NestHost and NestMembers attributes. +bool VM_RedefineClasses::rewrite_cp_refs_in_nest_attributes( + InstanceKlass* scratch_class) { + + u2 cp_index = scratch_class->nest_host_index(); + if (cp_index != 0) { + scratch_class->set_nest_host_index(find_new_index(cp_index)); + } + Array* nest_members = scratch_class->nest_members(); + for (int i = 0; i < nest_members->length(); i++) { + u2 cp_index = nest_members->at(i); + nest_members->at_put(i, find_new_index(cp_index)); + } + return true; +} + // Rewrite constant pool references in the methods. bool VM_RedefineClasses::rewrite_cp_refs_in_methods( InstanceKlass* scratch_class, TRAPS) { diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmtiRedefineClasses.hpp openjdk-11-11~24/src/hotspot/share/prims/jvmtiRedefineClasses.hpp --- openjdk-11-11~19/src/hotspot/share/prims/jvmtiRedefineClasses.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmtiRedefineClasses.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -469,6 +469,7 @@ AnnotationArray* type_annotations_typeArray, int &byte_i_ref, TRAPS); bool rewrite_cp_refs_in_fields_annotations( InstanceKlass* scratch_class, TRAPS); + bool rewrite_cp_refs_in_nest_attributes(InstanceKlass* scratch_class); void rewrite_cp_refs_in_method(methodHandle method, methodHandle * new_method_p, TRAPS); bool rewrite_cp_refs_in_methods(InstanceKlass* scratch_class, TRAPS); diff -Nru openjdk-11-11~19/src/hotspot/share/prims/jvmti.xml openjdk-11-11~24/src/hotspot/share/prims/jvmti.xml --- openjdk-11-11~19/src/hotspot/share/prims/jvmti.xml 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/jvmti.xml 2018-07-25 15:36:46.000000000 +0000 @@ -358,7 +358,7 @@ ]> @@ -778,7 +778,7 @@ <intro id="bci" label="Bytecode Instrumentation"> This interface does not include some events that one might expect in an interface with - profiling support. Some examples include object allocation events and full speed + profiling support. Some examples include full speed method enter and exit events. The interface instead provides support for <i>bytecode instrumentation</i>, the ability to alter the Java virtual machine bytecode instructions which comprise the target program. Typically, these alterations @@ -3454,7 +3454,7 @@ <jint/> <description> For <datalink id="JVMTI_HEAP_REFERENCE_FIELD"/>, the - referrer object is not a class or an inteface. + referrer object is not a class or an interface. In this case, <code>index</code> is the index of the field in the class of the referrer object. This class is referred to below as <i>C</i>. @@ -7631,9 +7631,12 @@ <eventlink id="ClassFileLoadHook"/> event will be sent. <p/> - The retransformation may change method bodies, the constant pool and attributes. + The retransformation may change method bodies, the constant pool and attributes + (unless explicitly prohibited). The retransformation must not add, remove or rename fields or methods, change the signatures of methods, change modifiers, or change inheritance. + The retransformation must not change the <code>NestHost</code> or + <code>NestMembers</code> attributes. These restrictions may be lifted in future versions. See the error return description below for information on error codes returned if an unsupported retransformation is attempted. @@ -7704,6 +7707,9 @@ A retransformed class file does not declare a method declared in the old class version. </error> + <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED"> + A retransformed class file has unsupported differences in class attributes. + </error> <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED"> A retransformed class file has different class modifiers. </error> @@ -7778,9 +7784,12 @@ <eventlink id="ClassFileLoadHook">Class File Load Hook</eventlink> will be sent (if enabled), but no other <jvmti/> events will be sent. <p/> - The redefinition may change method bodies, the constant pool and attributes. + The redefinition may change method bodies, the constant pool and attributes + (unless explicitly prohibited). The redefinition must not add, remove or rename fields or methods, change the signatures of methods, change modifiers, or change inheritance. + The retransformation must not change the <code>NestHost</code> or + <code>NestMembers</code> attributes. These restrictions may be lifted in future versions. See the error return description below for information on error codes returned if an unsupported redefinition is attempted. @@ -7855,6 +7864,9 @@ A new class version does not declare a method declared in the old class version. </error> + <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED"> + A new class version has unsupported differences in class attributes. + </error> <error id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED"> A new class version has different modifiers. </error> @@ -8513,10 +8525,10 @@ For the method indicated by <code>method</code>, return the beginning and ending addresses through <code>start_location_ptr</code> and <code>end_location_ptr</code>. In a - conventional byte code indexing scheme, + conventional bytecode indexing scheme, <code>start_location_ptr</code> will always point to zero and <code>end_location_ptr</code> - will always point to the byte code count minus one. + will always point to the bytecode count minus one. </description> <origin>jvmdi</origin> <capabilities> @@ -8649,8 +8661,8 @@ <synopsis>Get Bytecodes</synopsis> <description> For the method indicated by <code>method</code>, - return the byte codes that implement the method. The number of - bytecodes is returned via <code>bytecode_count_ptr</code>. The byte codes + return the bytecodes that implement the method. The number of + bytecodes is returned via <code>bytecode_count_ptr</code>. The bytecodes themselves are returned via <code>bytecodes_ptr</code>. </description> <origin>jvmdi</origin> @@ -8673,13 +8685,13 @@ <param id="bytecode_count_ptr"> <outptr><jint/></outptr> <description> - On return, points to the length of the byte code array + On return, points to the length of the bytecode array </description> </param> <param id="bytecodes_ptr"> <allocbuf outcount="bytecode_count_ptr"><uchar/></allocbuf> <description> - On return, points to the pointer to the byte code array + On return, points to the pointer to the bytecode array </description> </param> </parameters> @@ -8923,7 +8935,7 @@ layer of agents) this function allows each transformation to have its own prefix. The prefixes are applied in the order supplied and are - processed in the same manor as described for the + processed in the same manner as described for the application of prefixes from multiple <jvmti/> environments in <functionlink id="SetNativeMethodPrefix"/>. <p/> @@ -10357,7 +10369,7 @@ <description> Can generate sampled allocation events. If this capability is enabled then the heap sampling method - <functionlink id="SetHeapSamplingRate"></functionlink> can be + <functionlink id="SetHeapSamplingInterval"></functionlink> can be called and <eventlink id="SampledObjectAlloc"></eventlink> events can be generated. </description> </capabilityfield> @@ -11540,41 +11552,47 @@ </category> <category id="heap_monitoring" label="Heap Monitoring"> - <function id="SetHeapSamplingRate" phase="onload" num="156" since="11"> - <synopsis>Set Heap Sampling Rate</synopsis> + <function id="SetHeapSamplingInterval" phase="onload" num="156" since="11"> + <synopsis>Set Heap Sampling Interval</synopsis> <description> Generate a <eventlink id="SampledObjectAlloc"/> event when objects are allocated. Each thread keeps a counter of bytes allocated. The event will only be generated - when that counter exceeds an average of <paramlink id="sampling_rate"></paramlink> + when that counter exceeds an average of <paramlink id="sampling_interval"></paramlink> since the last sample. <p/> - Setting <paramlink id="sampling_rate"></paramlink> to 0 will cause an event to be - generated by each allocation supported by the system. + Setting <paramlink id="sampling_interval"></paramlink> to 0 will cause an event to be + generated by each allocation supported by the system once the new interval is taken into account. + <p/> + Note that updating the new sampling interval might take various number of allocations + to provoke internal data structure updates. Therefore it is important to + consider the sampling interval as an average. This includes the interval 0, where events + might not be generated straight away for each allocation. </description> <origin>new</origin> <capabilities> <required id="can_generate_sampled_object_alloc_events"></required> </capabilities> <parameters> - <param id="sampling_rate"> + <param id="sampling_interval"> <jint/> <description> - The sampling rate in bytes. The sampler uses a statistical approach to - generate an event, on average, once for every <paramlink id="sampling_rate"/> bytes of + The sampling interval in bytes. The sampler uses a statistical approach to + generate an event, on average, once for every <paramlink id="sampling_interval"/> bytes of memory allocated by a given thread. <p/> - Passing 0 as a sampling rate generates a sample for every allocation. + Once the new sampling interval is taken into account, 0 as a sampling interval will generate + a sample for every allocation. <p/> - Note: The overhead of this feature is directly correlated with the sampling rate. - A high sampling rate, such as 1024 bytes, will incur a high overhead. - A lower rate, such as 1024KB, will have a much lower overhead. Sampling should only + Note: The overhead of this feature is directly correlated with the sampling interval. + A high sampling interval, such as 1024 bytes, will incur a high overhead. + A lower interval, such as 1024KB, will have a much lower overhead. Sampling should only be used with an understanding that it may impact performance. </description> </param> </parameters> <errors> <error id="JVMTI_ERROR_ILLEGAL_ARGUMENT"> - <paramlink id="sampling_rate"></paramlink> is less than zero. + <paramlink id="sampling_interval"></paramlink> is less than zero. </error> </errors> </function> @@ -11788,6 +11806,9 @@ A method in the new class version has different modifiers than its counterpart in the old class version. </errorid> + <errorid id="JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED" num="72"> + A new class version has unsupported differences in class attributes. + </errorid> </errorcategory> </errorsection> @@ -12996,7 +13017,7 @@ Agents that create more than one JVM TI environment, where the capability is added to some but not all environments, may observe the start phase beginning earlier in the JVM TI environments that possess - the capabilty. + the capability. <p/> In the case of VM start-up failure, this event will not be sent. </description> @@ -13492,9 +13513,8 @@ <event label="VM Object Allocation" id="VMObjectAlloc" const="JVMTI_EVENT_VM_OBJECT_ALLOC" num="84"> <description> - Sent when a method causes the virtual machine to allocate an - Object visible to Java programming language code and the - allocation is not detectable by other intrumentation mechanisms. + Sent when a method causes the virtual machine to directly allocate an + Object visible to Java programming language code. Generally object allocation should be detected by instrumenting the bytecodes of allocating methods. Object allocation generated in native code by JNI function @@ -13505,6 +13525,12 @@ VM. These methods should send this event. Virtual machines which are incapable of bytecode instrumentation for some or all of their methods can send this event. + + Note that the <internallink + id="SampledObjectAlloc">SampledObjectAlloc</internallink> + event is triggered on all Java object allocations, including those + caused by bytecode method execution, JNI method execution, and + directly by VM methods. <p/> Typical examples where this event might be sent: <ul> @@ -13566,20 +13592,23 @@ id="SampledObjectAlloc" const="JVMTI_EVENT_SAMPLED_OBJECT_ALLOC" num="86" since="11"> <description> Sent when an allocated object is sampled. - By default, the sampling rate is a geometric variable with a 512KB mean. + By default, the sampling interval is set to 512KB. The sampling is semi-random to avoid + pattern-based bias and provides an approximate overall average interval over long periods of + sampling. + <p/> Each thread tracks how many bytes it has allocated since it sent the last event. - When the number of bytes exceeds the sampling rate, it will send another event. + When the number of bytes exceeds the sampling interval, it will send another event. This implies that, on average, one object will be sampled every time a thread has allocated 512KB bytes since the last sample. <p/> - Note that this is a geometric variable: it will not sample every 512KB precisely. + Note that the sampler is pseudo-random: it will not sample every 512KB precisely. The goal of this is to ensure high quality sampling even if allocation is happening in a fixed pattern (i.e., the same set of objects are being allocated every 512KB). <p/> - If another sampling rate is required, the user can call - <functionlink id="SetHeapSamplingRate"></functionlink> with a strictly positive integer value, representing - the new sampling rate. + If another sampling interval is required, the user can call + <functionlink id="SetHeapSamplingInterval"></functionlink> with a strictly positive integer value, + representing the new sampling interval. <p/> This event is sent once the sampled allocation has been performed. It provides the object, stack trace of the allocation, the thread allocating, the size of allocation, and the object's class. @@ -14927,6 +14956,13 @@ - The function may return NULL in the start phase if the can_generate_early_vmstart capability is enabled. </change> + <change date="7 February 2018" version="11.0.0"> + Minor update for new class file NestHost and NestMembers attributes: + - Specify that RedefineClasses and RetransformClasses are not allowed + to change the class file NestHost and NestMembers attributes. + - Add new error JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED + that can be returned by RedefineClasses and RetransformClasses. + </change> </changehistory> </specification> diff -Nru openjdk-11-11~19/src/hotspot/share/prims/methodHandles.cpp openjdk-11-11~24/src/hotspot/share/prims/methodHandles.cpp --- openjdk-11-11~19/src/hotspot/share/prims/methodHandles.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/methodHandles.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -238,7 +238,12 @@ vmindex); m->access_flags().print_on(tty); if (!m->is_abstract()) { - tty->print("default"); + if (!m->is_private()) { + tty->print("default"); + } + else { + tty->print("private-intf"); + } } tty->cr(); } @@ -292,6 +297,9 @@ } else if (m->is_initializer()) { flags |= IS_CONSTRUCTOR | (JVM_REF_invokeSpecial << REFERENCE_KIND_SHIFT); } else { + // "special" reflects that this is a direct call, not that it + // necessarily originates from an invokespecial. We can also do + // direct calls for private and/or final non-static methods. flags |= IS_METHOD | (JVM_REF_invokeSpecial << REFERENCE_KIND_SHIFT); } break; @@ -483,6 +491,24 @@ return vmIntrinsics::_none; } +// Returns true if method is signature polymorphic and public +bool MethodHandles::is_signature_polymorphic_public_name(Klass* klass, Symbol* name) { + if (is_signature_polymorphic_name(klass, name)) { + InstanceKlass* iklass = InstanceKlass::cast(klass); + int me; + int ms = iklass->find_method_by_name(name, &me); + assert(ms != -1, ""); + for (; ms < me; ms++) { + Method* m = iklass->methods()->at(ms); + int required = JVM_ACC_NATIVE | JVM_ACC_VARARGS | JVM_ACC_PUBLIC; + int flags = m->access_flags().as_int(); + if ((flags & required) == required && ArgumentCount(m->signature()).size() == 1) { + return true; + } + } + } + return false; +} // convert the external string or reflective type to an internal signature Symbol* MethodHandles::lookup_signature(oop type_str, bool intern_if_not_found, TRAPS) { @@ -733,7 +759,7 @@ vmIntrinsics::ID mh_invoke_id = vmIntrinsics::_none; if ((flags & ALL_KINDS) == IS_METHOD && - (defc == SystemDictionary::MethodHandle_klass()) && + (defc == SystemDictionary::MethodHandle_klass() || defc == SystemDictionary::VarHandle_klass()) && (ref_kind == JVM_REF_invokeVirtual || ref_kind == JVM_REF_invokeSpecial || // static invocation mode is required for _linkToVirtual, etc.: diff -Nru openjdk-11-11~19/src/hotspot/share/prims/methodHandles.hpp openjdk-11-11~24/src/hotspot/share/prims/methodHandles.hpp --- openjdk-11-11~19/src/hotspot/share/prims/methodHandles.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/methodHandles.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -143,6 +143,7 @@ static bool is_signature_polymorphic_name(Klass* klass, Symbol* name) { return signature_polymorphic_name_id(klass, name) != vmIntrinsics::_none; } + static bool is_signature_polymorphic_public_name(Klass* klass, Symbol* name); static Bytecodes::Code signature_polymorphic_intrinsic_bytecode(vmIntrinsics::ID id); diff -Nru openjdk-11-11~19/src/hotspot/share/prims/whitebox.cpp openjdk-11-11~24/src/hotspot/share/prims/whitebox.cpp --- openjdk-11-11~19/src/hotspot/share/prims/whitebox.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/prims/whitebox.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -855,7 +855,16 @@ bool WhiteBox::compile_method(Method* method, int comp_level, int bci, Thread* THREAD) { // Screen for unavailable/bad comp level or null method AbstractCompiler* comp = CompileBroker::compiler(comp_level); - if (method == NULL || comp_level > MIN2((CompLevel) TieredStopAtLevel, CompLevel_highest_tier) || comp == NULL) { + if (method == NULL) { + tty->print_cr("WB error: request to compile NULL method"); + return false; + } + if (comp_level > MIN2((CompLevel) TieredStopAtLevel, CompLevel_highest_tier)) { + tty->print_cr("WB error: invalid compilation level %d", comp_level); + return false; + } + if (comp == NULL) { + tty->print_cr("WB error: no compiler for requested compilation level %d", comp_level); return false; } @@ -868,7 +877,17 @@ // Compile method and check result nmethod* nm = CompileBroker::compile_method(mh, bci, comp_level, mh, mh->invocation_count(), CompileTask::Reason_Whitebox, THREAD); MutexLockerEx mu(Compile_lock); - return ((!is_blocking && mh->queued_for_compilation()) || nm != NULL); + bool is_queued = mh->queued_for_compilation(); + if ((!is_blocking && is_queued) || nm != NULL) { + return true; + } + tty->print("WB error: failed to %s compile at level %d method ", is_blocking ? "blocking" : "", comp_level); + mh->print_short_name(tty); + tty->cr(); + if (is_blocking && is_queued) { + tty->print_cr("WB error: blocking compilation is still in queue!"); + } + return false; } WB_ENTRY(jboolean, WB_EnqueueMethodForCompilation(JNIEnv* env, jobject o, jobject method, jint comp_level, jint bci)) @@ -1766,6 +1785,14 @@ WB_END +WB_ENTRY(jboolean, WB_IsJFRIncludedInVmBuild(JNIEnv* env)) +#if INCLUDE_JFR + return true; +#else + return false; +#endif // INCLUDE_JFR +WB_END + #if INCLUDE_CDS WB_ENTRY(jint, WB_GetOffsetForName(JNIEnv* env, jobject o, jstring name)) @@ -2144,6 +2171,7 @@ {CC"getResolvedReferences", CC"(Ljava/lang/Class;)Ljava/lang/Object;", (void*)&WB_GetResolvedReferences}, {CC"areOpenArchiveHeapObjectsMapped", CC"()Z", (void*)&WB_AreOpenArchiveHeapObjectsMapped}, {CC"isCDSIncludedInVmBuild", CC"()Z", (void*)&WB_IsCDSIncludedInVmBuild }, + {CC"isJFRIncludedInVmBuild", CC"()Z", (void*)&WB_IsJFRIncludedInVmBuild }, {CC"isJavaHeapArchiveSupported", CC"()Z", (void*)&WB_IsJavaHeapArchiveSupported }, {CC"clearInlineCaches0", CC"(Z)V", (void*)&WB_ClearInlineCaches }, diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/arguments.cpp openjdk-11-11~24/src/hotspot/share/runtime/arguments.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/arguments.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/arguments.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -488,7 +488,7 @@ * * Recommended approach for removing options: * - * To remove options commonly used by customers (e.g. product, commercial -XX options), use + * To remove options commonly used by customers (e.g. product -XX options), use * the 3-step model adding major release numbers to the deprecate, obsolete and expire columns. * * To remove internal options (e.g. diagnostic, experimental, develop options), use @@ -540,6 +540,7 @@ { "PrintSafepointStatisticsCount",JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) }, { "AggressiveOpts", JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) }, { "AllowNonVirtualCalls", JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) }, + { "UnlinkSymbolsALot", JDK_Version::jdk(11), JDK_Version::jdk(12), JDK_Version::jdk(13) }, // --- Deprecated alias flags (see also aliased_jvm_flags) - sorted by obsolete_in then expired_in: { "DefaultMaxRAMFraction", JDK_Version::jdk(8), JDK_Version::undefined(), JDK_Version::undefined() }, @@ -569,6 +570,9 @@ { "InlineNotify", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) }, { "EnableTracing", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) }, { "UseLockedTracing", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) }, + { "NativeMonitorTimeout", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) }, + { "NativeMonitorSpinLimit", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) }, + { "NativeMonitorFlags", JDK_Version::undefined(), JDK_Version::jdk(11), JDK_Version::jdk(12) }, #ifdef TEST_VERIFY_SPECIAL_JVM_FLAGS { "dep > obs", JDK_Version::jdk(9), JDK_Version::jdk(8), JDK_Version::undefined() }, @@ -3896,13 +3900,13 @@ jint result = set_ergonomics_flags(); if (result != JNI_OK) return result; - set_shared_spaces_flags(); - // Set heap size based on available physical memory set_heap_size(); GCConfig::arguments()->initialize(); + set_shared_spaces_flags(); + // Initialize Metaspace flags and alignments Metaspace::ergo_initialize(); diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/deoptimization.cpp openjdk-11-11~24/src/hotspot/share/runtime/deoptimization.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/deoptimization.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/deoptimization.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1547,13 +1547,13 @@ methodHandle trap_method = trap_scope->method(); int trap_bci = trap_scope->bci(); #if INCLUDE_JVMCI - oop speculation = thread->pending_failed_speculation(); + long speculation = thread->pending_failed_speculation(); if (nm->is_compiled_by_jvmci()) { - if (speculation != NULL) { + if (speculation != 0) { oop speculation_log = nm->as_nmethod()->speculation_log(); if (speculation_log != NULL) { if (TraceDeoptimization || TraceUncollectedSpeculations) { - if (HotSpotSpeculationLog::lastFailed(speculation_log) != NULL) { + if (HotSpotSpeculationLog::lastFailed(speculation_log) != 0) { tty->print_cr("A speculation that was not collected by the compiler is being overwritten"); } } @@ -1566,14 +1566,14 @@ tty->print_cr("Speculation present but no speculation log"); } } - thread->set_pending_failed_speculation(NULL); + thread->set_pending_failed_speculation(0); } else { if (TraceDeoptimization) { tty->print_cr("No speculation"); } } } else { - assert(speculation == NULL, "There should not be a speculation for method compiled by non-JVMCI compilers"); + assert(speculation == 0, "There should not be a speculation for method compiled by non-JVMCI compilers"); } if (trap_bci == SynchronizationEntryBCI) { @@ -2044,7 +2044,7 @@ bool ignore_maybe_prior_recompile; assert(!reason_is_speculate(reason), "reason speculate only used by compiler"); // JVMCI uses the total counts to determine if deoptimizations are happening too frequently -> do not adjust total counts - bool update_total_counts = JVMCI_ONLY(false) NOT_JVMCI(true); + bool update_total_counts = true JVMCI_ONLY( && !UseJVMCICompiler); query_update_method_data(trap_mdo, trap_bci, (DeoptReason)reason, update_total_counts, diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlagConstraintList.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -242,7 +242,6 @@ // Generate code to call emit_constraint_xxx function #define EMIT_CONSTRAINT_PRODUCT_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name -#define EMIT_CONSTRAINT_COMMERCIAL_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name #define EMIT_CONSTRAINT_DIAGNOSTIC_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name #define EMIT_CONSTRAINT_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name #define EMIT_CONSTRAINT_MANAGEABLE_FLAG(type, name, value, doc) ); emit_constraint_##type(#name,&name diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlag.cpp openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlag.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlag.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlag.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -326,10 +326,6 @@ return (_flags & KIND_READ_WRITE) != 0; } -bool JVMFlag::is_commercial() const { - return (_flags & KIND_COMMERCIAL) != 0; -} - /** * Returns if this flag is a constant in the binary. Right now this is * true for notproduct and develop flags in product builds. @@ -642,7 +638,6 @@ { KIND_MANAGEABLE, "manageable" }, { KIND_DIAGNOSTIC, "diagnostic" }, { KIND_EXPERIMENTAL, "experimental" }, - { KIND_COMMERCIAL, "commercial" }, { KIND_NOT_PRODUCT, "notproduct" }, { KIND_DEVELOP, "develop" }, { KIND_LP64_PRODUCT, "lp64_product" }, @@ -911,7 +906,7 @@ if (!(current->is_unlocked() || current->is_unlocker())) { if (!allow_locked) { // disable use of locked flags, e.g. diagnostic, experimental, - // commercial... until they are explicitly unlocked + // etc. until they are explicitly unlocked return NULL; } } @@ -944,6 +939,10 @@ } } + if (match == NULL) { + return NULL; + } + if (!(match->is_unlocked() || match->is_unlocker())) { if (!allow_locked) { return NULL; diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlag.hpp openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlag.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlag.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlag.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -60,11 +60,10 @@ KIND_C2 = 1 << 13, KIND_ARCH = 1 << 14, KIND_LP64_PRODUCT = 1 << 15, - KIND_COMMERCIAL = 1 << 16, - KIND_JVMCI = 1 << 17, + KIND_JVMCI = 1 << 16, // set this bit if the flag was set on the command line - ORIG_COMMAND_LINE = 1 << 18, + ORIG_COMMAND_LINE = 1 << 17, KIND_MASK = ~(VALUE_ORIGIN_MASK | ORIG_COMMAND_LINE) }; @@ -101,9 +100,7 @@ DIAGNOSTIC_FLAG_BUT_LOCKED, EXPERIMENTAL_FLAG_BUT_LOCKED, DEVELOPER_FLAG_BUT_PRODUCT_BUILD, - NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD, - COMMERCIAL_FLAG_BUT_DISABLED, - COMMERCIAL_FLAG_BUT_LOCKED + NOTPRODUCT_FLAG_BUT_PRODUCT_BUILD }; const char* _type; @@ -187,7 +184,6 @@ bool is_notproduct() const; bool is_develop() const; bool is_read_write() const; - bool is_commercial() const; bool is_constant_in_binary() const; diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlagRangeList.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -293,7 +293,6 @@ // Generate code to call emit_range_xxx function #define EMIT_RANGE_PRODUCT_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name -#define EMIT_RANGE_COMMERCIAL_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name #define EMIT_RANGE_DIAGNOSTIC_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name #define EMIT_RANGE_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name #define EMIT_RANGE_MANAGEABLE_FLAG(type, name, value, doc) ); emit_range_##type(#name,&name diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlagWriteableList.cpp openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlagWriteableList.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/flags/jvmFlagWriteableList.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/flags/jvmFlagWriteableList.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -94,7 +94,6 @@ // Generate code to call emit_writeable_xxx function #define EMIT_WRITEABLE_PRODUCT_FLAG(type, name, value, doc) ); emit_writeable_##type(#name -#define EMIT_WRITEABLE_COMMERCIAL_FLAG(type, name, value, doc) ); emit_writeable_##type(#name #define EMIT_WRITEABLE_DIAGNOSTIC_FLAG(type, name, value, doc) ); emit_writeable_##type(#name #define EMIT_WRITEABLE_EXPERIMENTAL_FLAG(type, name, value, doc) ); emit_writeable_##type(#name #define EMIT_WRITEABLE_MANAGEABLE_FLAG(type, name, value, doc) ); emit_writeable_##type(#name diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/globals.hpp openjdk-11-11~24/src/hotspot/share/runtime/globals.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/globals.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/globals.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -345,6 +345,9 @@ diagnostic(bool, UseGHASHIntrinsics, false, \ "Use intrinsics for GHASH versions of crypto") \ \ + product(bool, UseBASE64Intrinsics, false, \ + "Use intrinsics for java.util.Base64") \ + \ product(size_t, LargePageSizeInBytes, 0, \ "Large page size (0 to let VM choose the page size)") \ range(0, max_uintx) \ @@ -661,6 +664,9 @@ product(bool, PrintCompilation, false, \ "Print compilations") \ \ + product(bool, PrintExtendedThreadInfo, false, \ + "Print more information in thread dump") \ + \ diagnostic(bool, TraceNMethodInstalls, false, \ "Trace nmethod installation") \ \ @@ -854,12 +860,6 @@ "When true prevents OS-level spurious, or premature, wakeups " \ "from Object.wait (Ignored for Windows)") \ \ - experimental(intx, NativeMonitorTimeout, -1, "(Unstable)") \ - \ - experimental(intx, NativeMonitorFlags, 0, "(Unstable)") \ - \ - experimental(intx, NativeMonitorSpinLimit, 20, "(Unstable)") \ - \ develop(bool, UsePthreads, false, \ "Use pthread-based instead of libthread-based synchronization " \ "(SPARC only)") \ diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/handshake.cpp openjdk-11-11~24/src/hotspot/share/runtime/handshake.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/handshake.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/handshake.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -297,12 +297,12 @@ void HandshakeState::set_operation(JavaThread* target, HandshakeOperation* op) { _operation = op; - SafepointMechanism::arm_local_poll(target); + SafepointMechanism::arm_local_poll_release(target); } void HandshakeState::clear_handshake(JavaThread* target) { _operation = NULL; - SafepointMechanism::disarm_local_poll(target); + SafepointMechanism::disarm_local_poll_release(target); } void HandshakeState::process_self_inner(JavaThread* thread) { diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/interfaceSupport.cpp openjdk-11-11~24/src/hotspot/share/runtime/interfaceSupport.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/interfaceSupport.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/interfaceSupport.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ #include "precompiled.hpp" #include "gc/shared/collectedHeap.hpp" #include "gc/shared/collectedHeap.inline.hpp" +#include "logging/log.hpp" #include "memory/resourceArea.hpp" #include "runtime/atomic.hpp" #include "runtime/frame.inline.hpp" diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/jniHandles.cpp openjdk-11-11~24/src/hotspot/share/runtime/jniHandles.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/jniHandles.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/jniHandles.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -109,7 +109,7 @@ // Return NULL on allocation failure. if (ptr != NULL) { assert(*ptr == NULL, "invariant"); - NativeAccess<IN_CONCURRENT_ROOT>::oop_store(ptr, obj()); + NativeAccess<>::oop_store(ptr, obj()); res = reinterpret_cast<jobject>(ptr); } else { report_handle_allocation_failure(alloc_failmode, "global"); @@ -175,7 +175,7 @@ if (handle != NULL) { assert(!is_jweak(handle), "wrong method for detroying jweak"); oop* oop_ptr = jobject_ptr(handle); - NativeAccess<IN_CONCURRENT_ROOT>::oop_store(oop_ptr, (oop)NULL); + NativeAccess<>::oop_store(oop_ptr, (oop)NULL); global_handles()->release(oop_ptr); } } @@ -517,7 +517,7 @@ // Try last block if (_last->_top < block_size_in_oops) { oop* handle = &(_last->_handles)[_last->_top++]; - NativeAccess<AS_DEST_NOT_INITIALIZED>::oop_store(handle, obj); + NativeAccess<IS_DEST_UNINITIALIZED>::oop_store(handle, obj); return (jobject) handle; } @@ -525,7 +525,7 @@ if (_free_list != NULL) { oop* handle = _free_list; _free_list = (oop*) *_free_list; - NativeAccess<AS_DEST_NOT_INITIALIZED>::oop_store(handle, obj); + NativeAccess<IS_DEST_UNINITIALIZED>::oop_store(handle, obj); return (jobject) handle; } // Check if unused block follow last diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/jniHandles.inline.hpp openjdk-11-11~24/src/hotspot/share/runtime/jniHandles.inline.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/jniHandles.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/jniHandles.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -57,7 +57,7 @@ if (is_jweak(handle)) { // Unlikely result = resolve_jweak(handle); } else { - result = NativeAccess<IN_CONCURRENT_ROOT>::oop_load(jobject_ptr(handle)); + result = NativeAccess<>::oop_load(jobject_ptr(handle)); // Construction of jobjects canonicalize a null value into a null // jobject, so for non-jweak the pointee should never be null. assert(external_guard || result != NULL, "Invalid JNI handle"); diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/mutex.cpp openjdk-11-11~24/src/hotspot/share/runtime/mutex.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/mutex.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/mutex.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -348,9 +348,7 @@ int Probes = 0; int Delay = 0; - int Steps = 0; - int SpinMax = NativeMonitorSpinLimit; - int flgs = NativeMonitorFlags; + int SpinMax = 20; for (;;) { intptr_t v = _LockWord.FullWord; if ((v & _LBIT) == 0) { @@ -360,9 +358,7 @@ continue; } - if ((flgs & 8) == 0) { - SpinPause(); - } + SpinPause(); // Periodically increase Delay -- variable Delay form // conceptually: delay *= 1 + 1/Exponent @@ -374,8 +370,6 @@ // CONSIDER: Delay += 1 + (Delay/4); Delay &= 0x7FF ; } - if (flgs & 2) continue; - // Consider checking _owner's schedctl state, if OFFPROC abort spin. // If the owner is OFFPROC then it's unlike that the lock will be dropped // in a timely fashion, which suggests that spinning would not be fruitful @@ -390,12 +384,11 @@ // spin loop. N1 and brethren write-around the L1$ over the xbar into the L2$. // Furthermore, they don't have a W$ like traditional SPARC processors. // We currently use a Marsaglia Shift-Xor RNG loop. - Steps += Delay; if (Self != NULL) { jint rv = Self->rng[0]; for (int k = Delay; --k >= 0;) { rv = MarsagliaXORV(rv); - if ((flgs & 4) == 0 && SafepointMechanism::poll(Self)) return 0; + if (SafepointMechanism::poll(Self)) return 0; } Self->rng[0] = rv; } else { @@ -406,10 +399,6 @@ static int ParkCommon(ParkEvent * ev, jlong timo) { // Diagnostic support - periodically unwedge blocked threads - intx nmt = NativeMonitorTimeout; - if (nmt > 0 && (nmt < timo || timo <= 0)) { - timo = nmt; - } int err = OS_OK; if (0 == timo) { ev->park(); @@ -466,11 +455,6 @@ ESelf->reset(); OrderAccess::fence(); - // Optional optimization ... try barging on the inner lock - if ((NativeMonitorFlags & 32) && Atomic::replace_if_null(ESelf, &_OnDeck)) { - goto OnDeck_LOOP; - } - if (AcquireOrPush(ESelf)) goto Exeunt; // At any given time there is at most one ondeck thread. @@ -484,7 +468,6 @@ // Self is now in the OnDeck position and will remain so until it // manages to acquire the lock. - OnDeck_LOOP: for (;;) { assert(_OnDeck == ESelf, "invariant"); if (TrySpin(Self)) break; @@ -706,11 +689,6 @@ nfy->Notified = 1; } Thread::muxRelease(_WaitLock); - if (nfy != NULL && (NativeMonitorFlags & 16)) { - // Experimental code ... light up the wakee in the hope that this thread (the owner) - // will drop the lock just about the time the wakee comes ONPROC. - nfy->unpark(); - } assert(ILocked(), "invariant"); return true; } @@ -794,7 +772,7 @@ for (;;) { if (ESelf->Notified) break; int err = ParkCommon(ESelf, timo); - if (err == OS_TIMEOUT || (NativeMonitorFlags & 1)) break; + if (err == OS_TIMEOUT) break; } // Prepare for reentry - if necessary, remove ESelf from WaitSet diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/os.cpp openjdk-11-11~24/src/hotspot/share/runtime/os.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/os.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/os.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -995,6 +995,22 @@ st->print_cr(" elapsed time: %d seconds (%dd %dh %dm %ds)", eltime, eldays, elhours, elmins, elsecs); } + +// Check if pointer can be read from (4-byte read access). +// Helps to prove validity of a not-NULL pointer. +// Returns true in very early stages of VM life when stub is not yet generated. +#define SAFEFETCH_DEFAULT true +bool os::is_readable_pointer(const void* p) { + if (!CanUseSafeFetch32()) { + return SAFEFETCH_DEFAULT; + } + int* const aligned = (int*) align_down((intptr_t)p, 4); + int cafebabe = 0xcafebabe; // tester value 1 + int deadbeef = 0xdeadbeef; // tester value 2 + return (SafeFetch32(aligned, cafebabe) != cafebabe) || (SafeFetch32(aligned, deadbeef) != deadbeef); +} + + // moved from debug.cpp (used to be find()) but still called from there // The verbose parameter is only set by the debug code in one case void os::print_location(outputStream* st, intptr_t x, bool verbose) { @@ -1094,21 +1110,26 @@ return; } } - if (JNIHandles::is_global_handle((jobject) addr)) { - st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr)); - return; - } - if (JNIHandles::is_weak_global_handle((jobject) addr)) { - st->print_cr(INTPTR_FORMAT " is a weak global jni handle", p2i(addr)); - return; - } + + bool accessible = is_readable_pointer(addr); + + if (align_down((intptr_t)addr, sizeof(intptr_t)) != 0 && accessible) { + if (JNIHandles::is_global_handle((jobject) addr)) { + st->print_cr(INTPTR_FORMAT " is a global jni handle", p2i(addr)); + return; + } + if (JNIHandles::is_weak_global_handle((jobject) addr)) { + st->print_cr(INTPTR_FORMAT " is a weak global jni handle", p2i(addr)); + return; + } #ifndef PRODUCT - // we don't keep the block list in product mode - if (JNIHandles::is_local_handle((jobject) addr)) { - st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr)); - return; - } + // we don't keep the block list in product mode + if (JNIHandles::is_local_handle((jobject) addr)) { + st->print_cr(INTPTR_FORMAT " is a local jni handle", p2i(addr)); + return; + } #endif + } for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) { // Check for privilege stack @@ -1155,6 +1176,11 @@ return; } + if (accessible) { + st->print_cr(INTPTR_FORMAT " points into unknown readable memory", p2i(addr)); + return; + } + st->print_cr(INTPTR_FORMAT " is an unknown value", p2i(addr)); } diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/os.hpp openjdk-11-11~24/src/hotspot/share/runtime/os.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/os.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/os.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -412,6 +412,9 @@ static void make_polling_page_unreadable(); static void make_polling_page_readable(); + // Check if pointer points to readable memory (by 4-byte read access) + static bool is_readable_pointer(const void* p); + // Routines used to serialize the thread state without using membars static void serialize_thread_states(); diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/os_perf.hpp openjdk-11-11~24/src/hotspot/share/runtime/os_perf.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/os_perf.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/os_perf.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,8 @@ #ifndef SHARE_VM_RUNTIME_OS_PERF_HPP #define SHARE_VM_RUNTIME_OS_PERF_HPP -#include "utilities/macros.hpp" #include "memory/allocation.hpp" -#include "utilities/globalDefinitions.hpp" +#include "utilities/macros.hpp" #define FUNCTIONALITY_NOT_IMPLEMENTED -8 @@ -194,6 +193,47 @@ } }; +class NetworkInterface : public ResourceObj { + private: + char* _name; + uint64_t _bytes_in; + uint64_t _bytes_out; + NetworkInterface* _next; + + NetworkInterface(); // no impl + NetworkInterface(const NetworkInterface& rhs); // no impl + NetworkInterface& operator=(const NetworkInterface& rhs); // no impl + public: + NetworkInterface(const char* name, uint64_t bytes_in, uint64_t bytes_out, NetworkInterface* next) : + _name(NULL), + _bytes_in(bytes_in), + _bytes_out(bytes_out), + _next(next) { + assert(name != NULL, "invariant"); + const size_t length = strlen(name); + assert(allocated_on_res_area(), "invariant"); + _name = NEW_RESOURCE_ARRAY(char, length + 1); + strncpy(_name, name, length + 1); + assert(strncmp(_name, name, length) == 0, "invariant"); + } + + NetworkInterface* next() const { + return _next; + } + + const char* get_name() const { + return _name; + } + + uint64_t get_bytes_out() const { + return _bytes_out; + } + + uint64_t get_bytes_in() const { + return _bytes_in; + } +}; + class CPUInformationInterface : public CHeapObj<mtInternal> { private: CPUInformation* _cpu_info; @@ -234,4 +274,17 @@ int system_processes(SystemProcess** system_procs, int* const no_of_sys_processes) const; }; +class NetworkPerformanceInterface : public CHeapObj<mtInternal> { + private: + class NetworkPerformance; + NetworkPerformance* _impl; + NetworkPerformanceInterface(const NetworkPerformanceInterface& rhs); // no impl + NetworkPerformanceInterface& operator=(const NetworkPerformanceInterface& rhs); // no impl + public: + NetworkPerformanceInterface(); + bool initialize(); + ~NetworkPerformanceInterface(); + int network_utilization(NetworkInterface** network_interfaces) const; +}; + #endif // SHARE_VM_RUNTIME_OS_PERF_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/reflection.cpp openjdk-11-11~24/src/hotspot/share/runtime/reflection.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/reflection.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/reflection.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -650,26 +650,27 @@ return msg; } -bool Reflection::verify_field_access(const Klass* current_class, - const Klass* resolved_class, - const Klass* field_class, - AccessFlags access, - bool classloader_only, - bool protected_restriction) { - // Verify that current_class can access a field of field_class, where that +bool Reflection::verify_member_access(const Klass* current_class, + const Klass* resolved_class, + const Klass* member_class, + AccessFlags access, + bool classloader_only, + bool protected_restriction, + TRAPS) { + // Verify that current_class can access a member of member_class, where that // field's access bits are "access". We assume that we've already verified - // that current_class can access field_class. + // that current_class can access member_class. // // If the classloader_only flag is set, we automatically allow any accesses // in which current_class doesn't have a classloader. // - // "resolved_class" is the runtime type of "field_class". Sometimes we don't + // "resolved_class" is the runtime type of "member_class". Sometimes we don't // need this distinction (e.g. if all we have is the runtime type, or during // class file parsing when we only care about the static type); in that case - // callers should ensure that resolved_class == field_class. + // callers should ensure that resolved_class == member_class. // if ((current_class == NULL) || - (current_class == field_class) || + (current_class == member_class) || access.is_public()) { return true; } @@ -683,18 +684,18 @@ InstanceKlass::cast(host_class)->is_anonymous()), "host_class should not be anonymous"); } - if (host_class == field_class) { + if (host_class == member_class) { return true; } if (access.is_protected()) { if (!protected_restriction) { - // See if current_class (or outermost host class) is a subclass of field_class + // See if current_class (or outermost host class) is a subclass of member_class // An interface may not access protected members of j.l.Object - if (!host_class->is_interface() && host_class->is_subclass_of(field_class)) { + if (!host_class->is_interface() && host_class->is_subclass_of(member_class)) { if (access.is_static() || // static fields are ok, see 6622385 current_class == resolved_class || - field_class == resolved_class || + member_class == resolved_class || host_class->is_subclass_of(resolved_class) || resolved_class->is_subclass_of(host_class)) { return true; @@ -703,18 +704,35 @@ } } - if (!access.is_private() && is_same_class_package(current_class, field_class)) { + // package access + if (!access.is_private() && is_same_class_package(current_class, member_class)) { return true; } + // private access between different classes needs a nestmate check, but + // not for anonymous classes - so check host_class + if (access.is_private() && host_class == current_class) { + if (current_class->is_instance_klass() && member_class->is_instance_klass() ) { + InstanceKlass* cur_ik = const_cast<InstanceKlass*>(InstanceKlass::cast(current_class)); + InstanceKlass* field_ik = const_cast<InstanceKlass*>(InstanceKlass::cast(member_class)); + // Nestmate access checks may require resolution and validation of the nest-host. + // It is up to the caller to check for pending exceptions and handle appropriately. + bool access = cur_ik->has_nestmate_access_to(field_ik, CHECK_false); + if (access) { + guarantee(resolved_class->is_subclass_of(member_class), "must be!"); + return true; + } + } + } + // Allow all accesses from jdk/internal/reflect/MagicAccessorImpl subclasses to // succeed trivially. if (current_class->is_subclass_of(SystemDictionary::reflect_MagicAccessorImpl_klass())) { return true; } - return can_relax_access_check_for( - current_class, field_class, classloader_only); + // Check for special relaxations + return can_relax_access_check_for(current_class, member_class, classloader_only); } bool Reflection::is_same_class_package(const Klass* class1, const Klass* class2) { diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/reflection.hpp openjdk-11-11~24/src/hotspot/share/runtime/reflection.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/reflection.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/reflection.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -90,12 +90,13 @@ const InstanceKlass* new_class, const VerifyClassAccessResults result); - static bool verify_field_access(const Klass* current_class, - const Klass* resolved_class, - const Klass* field_class, - AccessFlags access, - bool classloader_only, - bool protected_restriction = false); + static bool verify_member_access(const Klass* current_class, + const Klass* resolved_class, + const Klass* member_class, + AccessFlags access, + bool classloader_only, + bool protected_restriction, + TRAPS); static bool is_same_class_package(const Klass* class1, const Klass* class2); // inner class reflection diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/safepoint.cpp openjdk-11-11~24/src/hotspot/share/runtime/safepoint.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/safepoint.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/safepoint.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -243,9 +243,10 @@ if (SafepointMechanism::uses_thread_local_poll()) { // Arming the per thread poll while having _state != _not_synchronized means safepointing log_trace(safepoint)("Setting thread local yield flag for threads"); + OrderAccess::storestore(); // storestore, global state -> local state for (JavaThreadIteratorWithHandle jtiwh; JavaThread *cur = jtiwh.next(); ) { // Make sure the threads start polling, it is time to yield. - SafepointMechanism::arm_local_poll(cur); // release store, global state -> local state + SafepointMechanism::arm_local_poll(cur); } } OrderAccess::fence(); // storestore|storeload, global state -> local state @@ -546,7 +547,7 @@ for (; JavaThread *current = jtiwh.next(); ) { ThreadSafepointState* cur_state = current->safepoint_state(); cur_state->restart(); // TSS _running - SafepointMechanism::disarm_local_poll(current); // release store, local state -> polling page + SafepointMechanism::disarm_local_poll(current); } log_info(safepoint)("Leaving safepoint region"); } else { diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/safepointMechanism.hpp openjdk-11-11~24/src/hotspot/share/runtime/safepointMechanism.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/safepointMechanism.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/safepointMechanism.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -79,9 +79,13 @@ // Blocks a thread until safepoint is completed static inline void block_if_requested(JavaThread* thread); + // Caller is responsible for using a memory barrier if needed. static inline void arm_local_poll(JavaThread* thread); static inline void disarm_local_poll(JavaThread* thread); + static inline void arm_local_poll_release(JavaThread* thread); + static inline void disarm_local_poll_release(JavaThread* thread); + // Setup the selected safepoint mechanism static void initialize(); static void initialize_header(JavaThread* thread); diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/safepointMechanism.inline.hpp openjdk-11-11~24/src/hotspot/share/runtime/safepointMechanism.inline.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/safepointMechanism.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/safepointMechanism.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -87,4 +87,12 @@ thread->set_polling_page(poll_disarmed_value()); } +void SafepointMechanism::arm_local_poll_release(JavaThread* thread) { + thread->set_polling_page_release(poll_armed_value()); +} + +void SafepointMechanism::disarm_local_poll_release(JavaThread* thread) { + thread->set_polling_page_release(poll_disarmed_value()); +} + #endif // SHARE_VM_RUNTIME_SAFEPOINTMECHANISM_INLINE_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/sharedRuntime.cpp openjdk-11-11~24/src/hotspot/share/runtime/sharedRuntime.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/sharedRuntime.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/sharedRuntime.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1959,14 +1959,27 @@ // must use a ResourceMark in order to correctly free the result. char* SharedRuntime::generate_class_cast_message( Klass* caster_klass, Klass* target_klass, Symbol* target_klass_name) { - - const char* caster_name = caster_klass->class_loader_and_module_name(); + const char* caster_name = caster_klass->external_name(); assert(target_klass != NULL || target_klass_name != NULL, "one must be provided"); const char* target_name = target_klass == NULL ? target_klass_name->as_C_string() : - target_klass->class_loader_and_module_name(); + target_klass->external_name(); + + size_t msglen = strlen(caster_name) + strlen("class ") + strlen(" cannot be cast to class ") + strlen(target_name) + 1; + + const char* caster_klass_description = ""; + const char* target_klass_description = ""; + const char* klass_separator = ""; + if (target_klass != NULL && caster_klass->module() == target_klass->module()) { + caster_klass_description = caster_klass->joint_in_module_of_loader(target_klass); + } else { + caster_klass_description = caster_klass->class_in_module_of_loader(); + target_klass_description = (target_klass != NULL) ? target_klass->class_in_module_of_loader() : ""; + klass_separator = (target_klass != NULL) ? "; " : ""; + } - size_t msglen = strlen(caster_name) + strlen(" cannot be cast to ") + strlen(target_name) + 1; + // add 3 for parenthesis and preceeding space + msglen += strlen(caster_klass_description) + strlen(target_klass_description) + strlen(klass_separator) + 3; char* message = NEW_RESOURCE_ARRAY_RETURN_NULL(char, msglen); if (message == NULL) { @@ -1975,9 +1988,13 @@ } else { jio_snprintf(message, msglen, - "%s cannot be cast to %s", + "class %s cannot be cast to class %s (%s%s%s)", caster_name, - target_name); + target_name, + caster_klass_description, + klass_separator, + target_klass_description + ); } return message; } diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/simpleThresholdPolicy.cpp openjdk-11-11~24/src/hotspot/share/runtime/simpleThresholdPolicy.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/simpleThresholdPolicy.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/simpleThresholdPolicy.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -266,8 +266,9 @@ max_method = max_task->method(); } - if (max_task->comp_level() == CompLevel_full_profile && TieredStopAtLevel > CompLevel_full_profile - && is_method_profiled(max_method)) { + if (max_task != NULL && max_task->comp_level() == CompLevel_full_profile && + TieredStopAtLevel > CompLevel_full_profile && + max_method != NULL && is_method_profiled(max_method)) { max_task->set_comp_level(CompLevel_limited_profile); if (PrintTieredEvents) { print_event(UPDATE_IN_QUEUE, max_method, max_method, max_task->osr_bci(), (CompLevel)max_task->comp_level()); diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/stubRoutines.cpp openjdk-11-11~24/src/hotspot/share/runtime/stubRoutines.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/stubRoutines.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/stubRoutines.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -128,6 +128,7 @@ address StubRoutines::_cipherBlockChaining_decryptAESCrypt = NULL; address StubRoutines::_counterMode_AESCrypt = NULL; address StubRoutines::_ghash_processBlocks = NULL; +address StubRoutines::_base64_encodeBlock = NULL; address StubRoutines::_sha1_implCompress = NULL; address StubRoutines::_sha1_implCompressMB = NULL; @@ -418,7 +419,7 @@ SharedRuntime::_oop_array_copy_ctr++; // Slow-path oop array copy #endif // !PRODUCT assert(count != 0, "count should be non-zero"); - ArrayAccess<AS_DEST_NOT_INITIALIZED>::oop_arraycopy_raw((HeapWord*)src, (HeapWord*)dest, count); + ArrayAccess<IS_DEST_UNINITIALIZED>::oop_arraycopy_raw((HeapWord*)src, (HeapWord*)dest, count); JRT_END JRT_LEAF(void, StubRoutines::arrayof_jbyte_copy(HeapWord* src, HeapWord* dest, size_t count)) @@ -462,7 +463,7 @@ SharedRuntime::_oop_array_copy_ctr++; // Slow-path oop array copy #endif // !PRODUCT assert(count != 0, "count should be non-zero"); - ArrayAccess<ARRAYCOPY_ARRAYOF | AS_DEST_NOT_INITIALIZED>::oop_arraycopy_raw(src, dest, count); + ArrayAccess<ARRAYCOPY_ARRAYOF | IS_DEST_UNINITIALIZED>::oop_arraycopy_raw(src, dest, count); JRT_END address StubRoutines::select_fill_function(BasicType t, bool aligned, const char* &name) { diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/stubRoutines.hpp openjdk-11-11~24/src/hotspot/share/runtime/stubRoutines.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/stubRoutines.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/stubRoutines.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -172,6 +172,7 @@ static address _cipherBlockChaining_decryptAESCrypt; static address _counterMode_AESCrypt; static address _ghash_processBlocks; + static address _base64_encodeBlock; static address _sha1_implCompress; static address _sha1_implCompressMB; @@ -347,7 +348,7 @@ static address cipherBlockChaining_decryptAESCrypt() { return _cipherBlockChaining_decryptAESCrypt; } static address counterMode_AESCrypt() { return _counterMode_AESCrypt; } static address ghash_processBlocks() { return _ghash_processBlocks; } - + static address base64_encodeBlock() { return _base64_encodeBlock; } static address sha1_implCompress() { return _sha1_implCompress; } static address sha1_implCompressMB() { return _sha1_implCompressMB; } static address sha256_implCompress() { return _sha256_implCompress; } diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/thread.cpp openjdk-11-11~24/src/hotspot/share/runtime/thread.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/thread.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/thread.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -93,6 +93,7 @@ #include "runtime/thread.inline.hpp" #include "runtime/threadCritical.hpp" #include "runtime/threadSMR.inline.hpp" +#include "runtime/threadStatisticalInfo.hpp" #include "runtime/timer.hpp" #include "runtime/timerTrace.hpp" #include "runtime/vframe.inline.hpp" @@ -869,13 +870,29 @@ } } -void Thread::print_on(outputStream* st) const { +void Thread::print_on(outputStream* st, bool print_extended_info) const { // get_priority assumes osthread initialized if (osthread() != NULL) { int os_prio; if (os::get_native_priority(this, &os_prio) == OS_OK) { st->print("os_prio=%d ", os_prio); } + + st->print("cpu=%.2fms ", + os::thread_cpu_time(const_cast<Thread*>(this), true) / 1000000.0 + ); + st->print("elapsed=%.2fs ", + _statistical_info.getElapsedTime() / 1000.0 + ); + if (is_Java_thread() && (PrintExtendedThreadInfo || print_extended_info)) { + size_t allocated_bytes = (size_t) const_cast<Thread*>(this)->cooked_allocated_bytes(); + st->print("allocated=" SIZE_FORMAT "%s ", + byte_size_in_proper_unit(allocated_bytes), + proper_unit_for_byte_size(allocated_bytes) + ); + st->print("defined_classes=" INT64_FORMAT " ", _statistical_info.getDefineClassCount()); + } + st->print("tid=" INTPTR_FORMAT " ", p2i(this)); osthread()->print_on(st); } @@ -946,7 +963,7 @@ // The flag: potential_vm_operation notifies if this particular safepoint state could potentially // invoke the vm-thread (e.g., an oop allocation). In that case, we also have to make sure that -// no threads which allow_vm_block's are held +// no locks which allow_vm_block's are held void Thread::check_for_valid_safepoint_state(bool potential_vm_operation) { // Check if current thread is allowed to block at a safepoint if (!(_allow_safepoint_count == 0)) { @@ -1484,7 +1501,7 @@ #if INCLUDE_JVMCI _pending_monitorenter = false; _pending_deoptimization = -1; - _pending_failed_speculation = NULL; + _pending_failed_speculation = 0; _pending_transfer_to_interpreter = false; _adjusting_comp_level = false; _jvmci._alternate_call_target = NULL; @@ -2753,8 +2770,6 @@ // Traverse the GCHandles Thread::oops_do(f, cf); - JVMCI_ONLY(f->do_oop((oop*)&_pending_failed_speculation);) - assert((!has_last_Java_frame() && java_call_counter() == 0) || (has_last_Java_frame() && java_call_counter() > 0), "wrong java_sp info!"); @@ -2871,7 +2886,7 @@ #endif // PRODUCT // Called by Threads::print() for VM_PrintThreads operation -void JavaThread::print_on(outputStream *st) const { +void JavaThread::print_on(outputStream *st, bool print_extended_info) const { st->print_raw("\""); st->print_raw(get_thread_name()); st->print_raw("\" "); @@ -2881,7 +2896,7 @@ if (java_lang_Thread::is_daemon(thread_oop)) st->print("daemon "); st->print("prio=%d ", java_lang_Thread::priority(thread_oop)); } - Thread::print_on(st); + Thread::print_on(st, print_extended_info); // print guess for valid stack memory region (assume 4K pages); helps lock debugging st->print_cr("[" INTPTR_FORMAT "]", (intptr_t)last_Java_sp() & ~right_n_bits(12)); if (thread_oop != NULL) { @@ -3283,6 +3298,11 @@ } CompilerThread::~CompilerThread() { + // Free buffer blob, if allocated + if (get_buffer_blob() != NULL) { + MutexLockerEx mu(CodeCache_lock, Mutex::_no_safepoint_check_flag); + CodeCache::free(get_buffer_blob()); + } // Delete objects which were allocated on heap. delete _counters; } @@ -4531,7 +4551,8 @@ // Threads::print_on() is called at safepoint by VM_PrintThreads operation. void Threads::print_on(outputStream* st, bool print_stacks, - bool internal_format, bool print_concurrent_locks) { + bool internal_format, bool print_concurrent_locks, + bool print_extended_info) { char buf[32]; st->print_raw_cr(os::local_time_string(buf, sizeof(buf))); @@ -4554,7 +4575,7 @@ ALL_JAVA_THREADS(p) { ResourceMark rm; - p->print_on(st); + p->print_on(st, print_extended_info); if (print_stacks) { if (internal_format) { p->trace_stack(); diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/threadHeapSampler.cpp openjdk-11-11~24/src/hotspot/share/runtime/threadHeapSampler.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/threadHeapSampler.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/threadHeapSampler.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,7 +31,7 @@ // Cheap random number generator uint64_t ThreadHeapSampler::_rnd; // Default is 512kb. -int ThreadHeapSampler::_sampling_rate = 512 * 1024; +int ThreadHeapSampler::_sampling_interval = 512 * 1024; int ThreadHeapSampler::_enabled; // Statics for the fast log @@ -69,7 +69,7 @@ // Generates a geometric variable with the specified mean (512K by default). // This is done by generating a random number between 0 and 1 and applying // the inverse cumulative distribution function for an exponential. -// Specifically: Let m be the inverse of the sample rate, then +// Specifically: Let m be the inverse of the sample interval, then // the probability distribution function is m*exp(-mx) so the CDF is // p = 1 - exp(-mx), so // q = 1 - p = exp(-mx) @@ -96,14 +96,14 @@ // negative answer. double log_val = (fast_log2(q) - 26); double result = - (0.0 < log_val ? 0.0 : log_val) * (-log(2.0) * (get_sampling_rate())) + 1; + (0.0 < log_val ? 0.0 : log_val) * (-log(2.0) * (get_sampling_interval())) + 1; assert(result > 0 && result < SIZE_MAX, "Result is not in an acceptable range."); - size_t rate = static_cast<size_t>(result); - _bytes_until_sample = rate; + size_t interval = static_cast<size_t>(result); + _bytes_until_sample = interval; } void ThreadHeapSampler::pick_next_sample(size_t overflowed_bytes) { - if (get_sampling_rate() == 1) { + if (get_sampling_interval() == 1) { _bytes_until_sample = 1; return; } @@ -116,8 +116,7 @@ } } -void ThreadHeapSampler::check_for_sampling(HeapWord* ptr, size_t allocation_size, size_t bytes_since_allocation) { - oopDesc* oop = reinterpret_cast<oopDesc*>(ptr); +void ThreadHeapSampler::check_for_sampling(oop obj, size_t allocation_size, size_t bytes_since_allocation) { size_t total_allocated_bytes = bytes_since_allocation + allocation_size; // If not yet time for a sample, skip it. @@ -126,7 +125,7 @@ return; } - JvmtiExport::sampled_object_alloc_event_collector(oop); + JvmtiExport::sampled_object_alloc_event_collector(obj); size_t overflow_bytes = total_allocated_bytes - _bytes_until_sample; pick_next_sample(overflow_bytes); @@ -162,12 +161,12 @@ OrderAccess::release_store(&_enabled, 0); } -int ThreadHeapSampler::get_sampling_rate() { - return OrderAccess::load_acquire(&_sampling_rate); +int ThreadHeapSampler::get_sampling_interval() { + return OrderAccess::load_acquire(&_sampling_interval); } -void ThreadHeapSampler::set_sampling_rate(int sampling_rate) { - OrderAccess::release_store(&_sampling_rate, sampling_rate); +void ThreadHeapSampler::set_sampling_interval(int sampling_interval) { + OrderAccess::release_store(&_sampling_interval, sampling_interval); } // Methods used in assertion mode to check if a collector is present or not at diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/threadHeapSampler.hpp openjdk-11-11~24/src/hotspot/share/runtime/threadHeapSampler.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/threadHeapSampler.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/threadHeapSampler.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -36,7 +36,7 @@ void pick_next_geometric_sample(); void pick_next_sample(size_t overflowed_bytes = 0); static int _enabled; - static int _sampling_rate; + static int _sampling_interval; // Used for assertion mode to determine if there is a path to a TLAB slow path // without a collector present. @@ -57,14 +57,14 @@ size_t bytes_until_sample() { return _bytes_until_sample; } void set_bytes_until_sample(size_t bytes) { _bytes_until_sample = bytes; } - void check_for_sampling(HeapWord* obj, size_t size_in_bytes, size_t bytes_allocated_before = 0); + void check_for_sampling(oop obj, size_t size_in_bytes, size_t bytes_allocated_before); static int enabled(); static void enable(); static void disable(); - static void set_sampling_rate(int sampling_rate); - static int get_sampling_rate(); + static void set_sampling_interval(int sampling_interval); + static int get_sampling_interval(); bool sampling_collector_present() const; bool remove_sampling_collector(); diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/thread.hpp openjdk-11-11~24/src/hotspot/share/runtime/thread.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/thread.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/thread.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -44,6 +44,7 @@ #include "runtime/stubRoutines.hpp" #include "runtime/threadHeapSampler.hpp" #include "runtime/threadLocalStorage.hpp" +#include "runtime/threadStatisticalInfo.hpp" #include "runtime/unhandledOops.hpp" #include "utilities/align.hpp" #include "utilities/exceptions.hpp" @@ -341,6 +342,8 @@ // the Java heap ThreadHeapSampler _heap_sampler; // For use when sampling the memory. + ThreadStatisticalInfo _statistical_info; // Statistics about the thread + JFR_ONLY(DEFINE_THREAD_LOCAL_FIELD_JFR;) // Thread-local data for jfr int _vm_operation_started_count; // VM_Operation support @@ -521,6 +524,8 @@ ThreadHeapSampler& heap_sampler() { return _heap_sampler; } + ThreadStatisticalInfo& statistical_info() { return _statistical_info; } + JFR_ONLY(DEFINE_THREAD_LOCAL_ACCESSOR_JFR;) bool is_trace_suspend() { return (_suspend_flags & _trace_flag) != 0; } @@ -638,7 +643,8 @@ void set_lgrp_id(int value) { _lgrp_id = value; } // Printing - virtual void print_on(outputStream* st) const; + void print_on(outputStream* st, bool print_extended_info) const; + virtual void print_on(outputStream* st) const { print_on(st, false); } void print() const { print_on(tty); } virtual void print_on_error(outputStream* st, char* buf, int buflen) const; void print_value_on(outputStream* st) const; @@ -1011,9 +1017,9 @@ // Guard for re-entrant call to JVMCIRuntime::adjust_comp_level bool _adjusting_comp_level; - // An object that JVMCI compiled code can use to further describe and + // An id of a speculation that JVMCI compiled code can use to further describe and // uniquely identify the speculative optimization guarded by the uncommon trap - oop _pending_failed_speculation; + long _pending_failed_speculation; // These fields are mutually exclusive in terms of live ranges. union { @@ -1201,6 +1207,7 @@ bool do_not_unlock_if_synchronized() { return _do_not_unlock_if_synchronized; } void set_do_not_unlock_if_synchronized(bool val) { _do_not_unlock_if_synchronized = val; } + inline void set_polling_page_release(void* poll_value); inline void set_polling_page(void* poll_value); inline volatile void* get_polling_page(); @@ -1420,13 +1427,13 @@ #if INCLUDE_JVMCI int pending_deoptimization() const { return _pending_deoptimization; } - oop pending_failed_speculation() const { return _pending_failed_speculation; } + long pending_failed_speculation() const { return _pending_failed_speculation; } bool adjusting_comp_level() const { return _adjusting_comp_level; } void set_adjusting_comp_level(bool b) { _adjusting_comp_level = b; } bool has_pending_monitorenter() const { return _pending_monitorenter; } void set_pending_monitorenter(bool b) { _pending_monitorenter = b; } void set_pending_deoptimization(int reason) { _pending_deoptimization = reason; } - void set_pending_failed_speculation(oop failed_speculation) { _pending_failed_speculation = failed_speculation; } + void set_pending_failed_speculation(long failed_speculation) { _pending_failed_speculation = failed_speculation; } void set_pending_transfer_to_interpreter(bool b) { _pending_transfer_to_interpreter = b; } void set_jvmci_alternate_call_target(address a) { assert(_jvmci._alternate_call_target == NULL, "must be"); _jvmci._alternate_call_target = a; } void set_jvmci_implicit_exception_pc(address a) { assert(_jvmci._implicit_exception_pc == NULL, "must be"); _jvmci._implicit_exception_pc = a; } @@ -1759,7 +1766,8 @@ // Misc. operations char* name() const { return (char*)get_thread_name(); } - void print_on(outputStream* st) const; + void print_on(outputStream* st, bool print_extended_info) const; + void print_on(outputStream* st) const { print_on(st, false); } void print_value(); void print_thread_state_on(outputStream*) const PRODUCT_RETURN; void print_thread_state() const PRODUCT_RETURN; @@ -2173,10 +2181,10 @@ // Verification static void verify(); - static void print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks); + static void print_on(outputStream* st, bool print_stacks, bool internal_format, bool print_concurrent_locks, bool print_extended_info); static void print(bool print_stacks, bool internal_format) { // this function is only used by debug.cpp - print_on(tty, print_stacks, internal_format, false /* no concurrent lock printed */); + print_on(tty, print_stacks, internal_format, false /* no concurrent lock printed */, false /* simple format */); } static void print_on_error(outputStream* st, Thread* current, char* buf, int buflen); static void print_on_error(Thread* this_thread, outputStream* st, Thread* current, char* buf, diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/thread.inline.hpp openjdk-11-11~24/src/hotspot/share/runtime/thread.inline.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/thread.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/thread.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -170,10 +170,15 @@ // The release make sure this store is done after storing the handshake // operation or global state -inline void JavaThread::set_polling_page(void* poll_value) { +inline void JavaThread::set_polling_page_release(void* poll_value) { OrderAccess::release_store(polling_page_addr(), poll_value); } +// Caller is responsible for using a memory barrier if needed. +inline void JavaThread::set_polling_page(void* poll_value) { + *polling_page_addr() = poll_value; +} + // The aqcquire make sure reading of polling page is done before // the reading the handshake operation or the global state inline volatile void* JavaThread::get_polling_page() { diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/threadSMR.cpp openjdk-11-11~24/src/hotspot/share/runtime/threadSMR.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/threadSMR.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/threadSMR.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1067,8 +1067,15 @@ // Print Threads class SMR info. void ThreadsSMRSupport::print_info_on(outputStream* st) { - // Only grab the Threads_lock if we don't already own it - // and if we are not reporting an error. + // Only grab the Threads_lock if we don't already own it and if we + // are not reporting an error. + // Note: Not grabbing the Threads_lock during error reporting is + // dangerous because the data structures we want to print can be + // freed concurrently. However, grabbing the Threads_lock during + // error reporting can be equally dangerous since this thread might + // block during error reporting or a nested error could leave the + // Threads_lock held. The classic no win scenario. + // MutexLockerEx ml((Threads_lock->owned_by_self() || VMError::is_error_reported()) ? NULL : Threads_lock); st->print_cr("Threads class SMR info:"); diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/threadStatisticalInfo.hpp openjdk-11-11~24/src/hotspot/share/runtime/threadStatisticalInfo.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/threadStatisticalInfo.hpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/threadStatisticalInfo.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#ifndef SHARE_VM_RUNTIME_THREADSTATISTICS_HPP +#define SHARE_VM_RUNTIME_THREADSTATISTICS_HPP + +#include "jni.h" +#include "runtime/os.hpp" +#include "utilities/globalDefinitions.hpp" + + +class ThreadStatisticalInfo { + // The time stamp the thread was started. + const uint64_t _start_time_stamp; + uint64_t _define_class_count; + +public: + ThreadStatisticalInfo() : _start_time_stamp(os::javaTimeMillis()), _define_class_count(0) {} + uint64_t getStartTime() const { return _start_time_stamp; } + uint64_t getDefineClassCount() const { return _define_class_count; } + void setDefineClassCount(uint64_t defineClassCount) { _define_class_count = defineClassCount; } + void incr_define_class_count() { _define_class_count += 1; } + uint64_t getElapsedTime() const { return os::javaTimeMillis() - getStartTime(); } +}; + +#endif // SHARE_VM_RUNTIME_THREADSTATISTICS_HPP diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/vm_operations.cpp openjdk-11-11~24/src/hotspot/share/runtime/vm_operations.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/vm_operations.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/vm_operations.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -212,7 +212,7 @@ } void VM_PrintThreads::doit() { - Threads::print_on(_out, true, false, _print_concurrent_locks); + Threads::print_on(_out, true, false, _print_concurrent_locks, _print_extended_info); } void VM_PrintThreads::doit_epilogue() { diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/vm_operations.hpp openjdk-11-11~24/src/hotspot/share/runtime/vm_operations.hpp --- openjdk-11-11~19/src/hotspot/share/runtime/vm_operations.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/vm_operations.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -372,10 +372,17 @@ private: outputStream* _out; bool _print_concurrent_locks; + bool _print_extended_info; public: - VM_PrintThreads() { _out = tty; _print_concurrent_locks = PrintConcurrentLocks; } - VM_PrintThreads(outputStream* out, bool print_concurrent_locks) { _out = out; _print_concurrent_locks = print_concurrent_locks; } - VMOp_Type type() const { return VMOp_PrintThreads; } + VM_PrintThreads() + : _out(tty), _print_concurrent_locks(PrintConcurrentLocks), _print_extended_info(false) + {} + VM_PrintThreads(outputStream* out, bool print_concurrent_locks, bool print_extended_info) + : _out(out), _print_concurrent_locks(print_concurrent_locks), _print_extended_info(print_extended_info) + {} + VMOp_Type type() const { + return VMOp_PrintThreads; + } void doit(); bool doit_prologue(); void doit_epilogue(); diff -Nru openjdk-11-11~19/src/hotspot/share/runtime/vmStructs.cpp openjdk-11-11~24/src/hotspot/share/runtime/vmStructs.cpp --- openjdk-11-11~19/src/hotspot/share/runtime/vmStructs.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/runtime/vmStructs.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -611,6 +611,7 @@ static_field(StubRoutines, _cipherBlockChaining_decryptAESCrypt, address) \ static_field(StubRoutines, _counterMode_AESCrypt, address) \ static_field(StubRoutines, _ghash_processBlocks, address) \ + static_field(StubRoutines, _base64_encodeBlock, address) \ static_field(StubRoutines, _updateBytesCRC32, address) \ static_field(StubRoutines, _crc_table_adr, address) \ static_field(StubRoutines, _crc32c_table_addr, address) \ diff -Nru openjdk-11-11~19/src/hotspot/share/services/attachListener.cpp openjdk-11-11~24/src/hotspot/share/services/attachListener.cpp --- openjdk-11-11~19/src/hotspot/share/services/attachListener.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/services/attachListener.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -168,12 +168,20 @@ // static jint thread_dump(AttachOperation* op, outputStream* out) { bool print_concurrent_locks = false; - if (op->arg(0) != NULL && strcmp(op->arg(0), "-l") == 0) { - print_concurrent_locks = true; + bool print_extended_info = false; + if (op->arg(0) != NULL) { + for (int i = 0; op->arg(0)[i] != 0; ++i) { + if (op->arg(0)[i] == 'l') { + print_concurrent_locks = true; + } + if (op->arg(0)[i] == 'e') { + print_extended_info = true; + } + } } // thread stacks - VM_PrintThreads op1(out, print_concurrent_locks); + VM_PrintThreads op1(out, print_concurrent_locks, print_extended_info); VMThread::execute(&op1); // JNI global handles diff -Nru openjdk-11-11~19/src/hotspot/share/services/diagnosticCommand.cpp openjdk-11-11~24/src/hotspot/share/services/diagnosticCommand.cpp --- openjdk-11-11~19/src/hotspot/share/services/diagnosticCommand.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/services/diagnosticCommand.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -612,13 +612,15 @@ ThreadDumpDCmd::ThreadDumpDCmd(outputStream* output, bool heap) : DCmdWithParser(output, heap), - _locks("-l", "print java.util.concurrent locks", "BOOLEAN", false, "false") { + _locks("-l", "print java.util.concurrent locks", "BOOLEAN", false, "false"), + _extended("-e", "print extended thread information", "BOOLEAN", false, "false") { _dcmdparser.add_dcmd_option(&_locks); + _dcmdparser.add_dcmd_option(&_extended); } void ThreadDumpDCmd::execute(DCmdSource source, TRAPS) { // thread stacks - VM_PrintThreads op1(output(), _locks.value()); + VM_PrintThreads op1(output(), _locks.value(), _extended.value()); VMThread::execute(&op1); // JNI global handles diff -Nru openjdk-11-11~19/src/hotspot/share/services/diagnosticCommand.hpp openjdk-11-11~24/src/hotspot/share/services/diagnosticCommand.hpp --- openjdk-11-11~19/src/hotspot/share/services/diagnosticCommand.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/services/diagnosticCommand.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -446,6 +446,7 @@ class ThreadDumpDCmd : public DCmdWithParser { protected: DCmdArgument<bool> _locks; + DCmdArgument<bool> _extended; public: ThreadDumpDCmd(outputStream* output, bool heap); static const char* name() { return "Thread.print"; } diff -Nru openjdk-11-11~19/src/hotspot/share/services/mallocSiteTable.cpp openjdk-11-11~24/src/hotspot/share/services/mallocSiteTable.cpp --- openjdk-11-11~19/src/hotspot/share/services/mallocSiteTable.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/services/mallocSiteTable.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -84,12 +84,18 @@ // Create pseudo call stack for hashtable entry allocation address pc[3]; if (NMT_TrackingStackDepth >= 3) { - pc[2] = (address)MallocSiteTable::allocation_at; + uintx *fp = (uintx*)MallocSiteTable::allocation_at; + // On ppc64, 'fp' is a pointer to a function descriptor which is a struct of + // three native pointers where the first pointer is the real function address. + // See: http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi-1.9.html#FUNC-DES + pc[2] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0]))); } if (NMT_TrackingStackDepth >= 2) { - pc[1] = (address)MallocSiteTable::lookup_or_add; + uintx *fp = (uintx*)MallocSiteTable::lookup_or_add; + pc[1] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0]))); } - pc[0] = (address)MallocSiteTable::new_entry; + uintx *fp = (uintx*)MallocSiteTable::new_entry; + pc[0] = (address)(fp PPC64_ONLY(BIG_ENDIAN_ONLY([0]))); // Instantiate NativeCallStack object, have to use placement new operator. (see comments above) NativeCallStack* stack = ::new ((void*)_hash_entry_allocation_stack) diff -Nru openjdk-11-11~19/src/hotspot/share/services/mallocSiteTable.hpp openjdk-11-11~24/src/hotspot/share/services/mallocSiteTable.hpp --- openjdk-11-11~19/src/hotspot/share/services/mallocSiteTable.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/services/mallocSiteTable.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -42,7 +42,7 @@ public: MallocSite() : - AllocationSite<MemoryCounter>(NativeCallStack::EMPTY_STACK), _flags(mtNone) {} + AllocationSite<MemoryCounter>(NativeCallStack::empty_stack()), _flags(mtNone) {} MallocSite(const NativeCallStack& stack, MEMFLAGS flags) : AllocationSite<MemoryCounter>(stack), _flags(flags) {} diff -Nru openjdk-11-11~19/src/hotspot/share/services/memTracker.hpp openjdk-11-11~24/src/hotspot/share/services/memTracker.hpp --- openjdk-11-11~19/src/hotspot/share/services/memTracker.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/services/memTracker.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -31,8 +31,8 @@ #if !INCLUDE_NMT -#define CURRENT_PC NativeCallStack::EMPTY_STACK -#define CALLER_PC NativeCallStack::EMPTY_STACK +#define CURRENT_PC NativeCallStack::empty_stack() +#define CALLER_PC NativeCallStack::empty_stack() class Tracker : public StackObj { public: @@ -86,9 +86,9 @@ extern volatile bool NMT_stack_walkable; #define CURRENT_PC ((MemTracker::tracking_level() == NMT_detail && NMT_stack_walkable) ? \ - NativeCallStack(0, true) : NativeCallStack::EMPTY_STACK) + NativeCallStack(0, true) : NativeCallStack::empty_stack()) #define CALLER_PC ((MemTracker::tracking_level() == NMT_detail && NMT_stack_walkable) ? \ - NativeCallStack(1, true) : NativeCallStack::EMPTY_STACK) + NativeCallStack(1, true) : NativeCallStack::empty_stack()) class MemBaseline; class Mutex; diff -Nru openjdk-11-11~19/src/hotspot/share/services/virtualMemoryTracker.hpp openjdk-11-11~24/src/hotspot/share/services/virtualMemoryTracker.hpp --- openjdk-11-11~19/src/hotspot/share/services/virtualMemoryTracker.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/services/virtualMemoryTracker.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -302,7 +302,7 @@ ReservedMemoryRegion(address base, size_t size) : - VirtualMemoryRegion(base, size), _stack(NativeCallStack::EMPTY_STACK), _flag(mtNone) { } + VirtualMemoryRegion(base, size), _stack(NativeCallStack::empty_stack()), _flag(mtNone) { } // Copy constructor ReservedMemoryRegion(const ReservedMemoryRegion& rr) : diff -Nru openjdk-11-11~19/src/hotspot/share/services/writeableFlags.cpp openjdk-11-11~24/src/hotspot/share/services/writeableFlags.cpp --- openjdk-11-11~19/src/hotspot/share/services/writeableFlags.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/services/writeableFlags.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -79,7 +79,7 @@ case JVMFlag::NON_WRITABLE: buffer_concat(buffer, "flag is not writeable."); break; case JVMFlag::OUT_OF_BOUNDS: - print_flag_error_message_bounds(name, buffer); break; + if (name != NULL) { print_flag_error_message_bounds(name, buffer); } break; case JVMFlag::VIOLATES_CONSTRAINT: buffer_concat(buffer, "value violates its flag's constraint."); break; case JVMFlag::INVALID_FLAG: diff -Nru openjdk-11-11~19/src/hotspot/share/utilities/concurrentHashTable.inline.hpp openjdk-11-11~24/src/hotspot/share/utilities/concurrentHashTable.inline.hpp --- openjdk-11-11~19/src/hotspot/share/utilities/concurrentHashTable.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/utilities/concurrentHashTable.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -263,8 +263,11 @@ Prefetch::read(*pref->value(), 0); pref = pref->next(); } - if (next->next() != NULL) { - Prefetch::read(*next->next()->value(), 0); + // Read next() Node* once. May be racing with a thread moving the next + // pointers. + Node* next_pref = next->next(); + if (next_pref != NULL) { + Prefetch::read(*next_pref->value(), 0); } if (eval_f(next->value())) { return true; @@ -546,8 +549,9 @@ lookup_f.equals(rem_n->value(), &is_dead); if (is_dead) { ndel[dels++] = rem_n; - bucket->release_assign_node_ptr(rem_n_prev, rem_n->next()); - rem_n = rem_n->next(); + Node* next_node = rem_n->next(); + bucket->release_assign_node_ptr(rem_n_prev, next_node); + rem_n = next_node; if (dels == BULK_DELETE_LIMIT) { break; } @@ -654,32 +658,33 @@ while (aux != NULL) { bool dead_hash = false; size_t aux_hash = CONFIG::get_hash(*aux->value(), &dead_hash); + Node* aux_next = aux->next(); if (dead_hash) { delete_me = aux; // This item is dead, move both list to next new_table->get_bucket(odd_index)->release_assign_node_ptr(odd, - aux->next()); + aux_next); new_table->get_bucket(even_index)->release_assign_node_ptr(even, - aux->next()); + aux_next); } else { size_t aux_index = bucket_idx_hash(new_table, aux_hash); if (aux_index == even_index) { // This is a even, so move odd to aux/even next new_table->get_bucket(odd_index)->release_assign_node_ptr(odd, - aux->next()); + aux_next); // Keep in even list even = aux->next_ptr(); } else if (aux_index == odd_index) { // This is a odd, so move odd to aux/odd next new_table->get_bucket(even_index)->release_assign_node_ptr(even, - aux->next()); + aux_next); // Keep in odd list odd = aux->next_ptr(); } else { fatal("aux_index does not match even or odd indices"); } } - aux = aux->next(); + aux = aux_next; // We can only move 1 pointer otherwise a reader might be moved to the wrong // chain. E.g. looking for even hash value but got moved to the odd bucket @@ -976,8 +981,9 @@ while (rem_n != NULL) { if (eval_f(rem_n->value())) { ndel[dels++] = rem_n; - bucket->release_assign_node_ptr(rem_n_prev, rem_n->next()); - rem_n = rem_n->next(); + Node* next_node = rem_n->next(); + bucket->release_assign_node_ptr(rem_n_prev, next_node); + rem_n = next_node; if (dels == num_del) { break; } diff -Nru openjdk-11-11~19/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp openjdk-11-11~24/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp --- openjdk-11-11~19/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/utilities/concurrentHashTableTasks.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -63,7 +63,8 @@ } // Calculate starting values. - void setup() { + void setup(Thread* thread) { + thread_owns_resize_lock(thread); _size_log2 = _cht->_table->_log2_size; _task_size_log2 = MIN2(_task_size_log2, _size_log2); size_t tmp = _size_log2 > _task_size_log2 ? @@ -76,12 +77,6 @@ return OrderAccess::load_acquire(&_next_to_claim) >= _stop_task; } - // If we have changed size. - bool is_same_table() { - // Not entirely true. - return _size_log2 != _cht->_table->_log2_size; - } - void thread_owns_resize_lock(Thread* thread) { assert(BucketsOperation::_cht->_resize_lock_owner == thread, "Should be locked by me"); @@ -100,6 +95,24 @@ assert(BucketsOperation::_cht->_resize_lock_owner != thread, "Should not be locked by me"); } + +public: + // Pauses for safepoint + void pause(Thread* thread) { + // This leaves internal state locked. + this->thread_owns_resize_lock(thread); + BucketsOperation::_cht->_resize_lock->unlock(); + this->thread_owns_only_state_lock(thread); + } + + // Continues after safepoint. + void cont(Thread* thread) { + this->thread_owns_only_state_lock(thread); + // If someone slips in here directly after safepoint. + while (!BucketsOperation::_cht->_resize_lock->try_lock()) + { /* for ever */ }; + this->thread_owns_resize_lock(thread); + } }; // For doing pausable/parallel bulk delete. @@ -117,8 +130,7 @@ if (!lock) { return false; } - this->setup(); - this->thread_owns_resize_lock(thread); + this->setup(thread); return true; } @@ -135,30 +147,8 @@ BucketsOperation::_cht->do_bulk_delete_locked_for(thread, start, stop, eval_f, del_f, BucketsOperation::_is_mt); - return true; - } - - // Pauses this operations for a safepoint. - void pause(Thread* thread) { - this->thread_owns_resize_lock(thread); - // This leaves internal state locked. - BucketsOperation::_cht->unlock_resize_lock(thread); - this->thread_do_not_own_resize_lock(thread); - } - - // Continues this operations after a safepoint. - bool cont(Thread* thread) { - this->thread_do_not_own_resize_lock(thread); - if (!BucketsOperation::_cht->try_resize_lock(thread)) { - this->thread_do_not_own_resize_lock(thread); - return false; - } - if (BucketsOperation::is_same_table()) { - BucketsOperation::_cht->unlock_resize_lock(thread); - this->thread_do_not_own_resize_lock(thread); - return false; - } - this->thread_owns_resize_lock(thread); + assert(BucketsOperation::_cht->_resize_lock_owner != NULL, + "Should be locked"); return true; } @@ -183,8 +173,7 @@ thread, BucketsOperation::_cht->_log2_size_limit)) { return false; } - this->thread_owns_resize_lock(thread); - BucketsOperation::setup(); + this->setup(thread); return true; } @@ -202,23 +191,6 @@ return true; } - // Pauses growing for safepoint - void pause(Thread* thread) { - // This leaves internal state locked. - this->thread_owns_resize_lock(thread); - BucketsOperation::_cht->_resize_lock->unlock(); - this->thread_owns_only_state_lock(thread); - } - - // Continues growing after safepoint. - void cont(Thread* thread) { - this->thread_owns_only_state_lock(thread); - // If someone slips in here directly after safepoint. - while (!BucketsOperation::_cht->_resize_lock->try_lock()) - { /* for ever */ }; - this->thread_owns_resize_lock(thread); - } - // Must be called after do_task returns false. void done(Thread* thread) { this->thread_owns_resize_lock(thread); diff -Nru openjdk-11-11~19/src/hotspot/share/utilities/debug.cpp openjdk-11-11~24/src/hotspot/share/utilities/debug.cpp --- openjdk-11-11~19/src/hotspot/share/utilities/debug.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/utilities/debug.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -714,16 +714,13 @@ } } -static bool store_context(const void* context) { - if (memcpy(&g_stored_assertion_context, context, sizeof(ucontext_t)) == false) { - return false; - } +static void store_context(const void* context) { + memcpy(&g_stored_assertion_context, context, sizeof(ucontext_t)); #if defined(__linux) && defined(PPC64) // on Linux ppc64, ucontext_t contains pointers into itself which have to be patched up // after copying the context (see comment in sys/ucontext.h): *((void**) &g_stored_assertion_context.uc_mcontext.regs) = &(g_stored_assertion_context.uc_mcontext.gp_regs); #endif - return true; } bool handle_assert_poison_fault(const void* ucVoid, const void* faulting_address) { @@ -734,9 +731,8 @@ if (ucVoid) { const intx my_tid = os::current_thread_id(); if (Atomic::cmpxchg(my_tid, &g_asserting_thread, (intx)0) == 0) { - if (store_context(ucVoid)) { - g_assertion_context = &g_stored_assertion_context; - } + store_context(ucVoid); + g_assertion_context = &g_stored_assertion_context; } } return true; diff -Nru openjdk-11-11~19/src/hotspot/share/utilities/macros.hpp openjdk-11-11~24/src/hotspot/share/utilities/macros.hpp --- openjdk-11-11~19/src/hotspot/share/utilities/macros.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/utilities/macros.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -239,14 +239,6 @@ #define NOT_ZGC_RETURN_(code) { return code; } #endif // INCLUDE_ZGC -#if INCLUDE_CMSGC || INCLUDE_EPSILONGC || INCLUDE_G1GC || INCLUDE_PARALLELGC || INCLUDE_ZGC -#define INCLUDE_NOT_ONLY_SERIALGC 1 -#else -#define INCLUDE_NOT_ONLY_SERIALGC 0 -#endif - -#define INCLUDE_OOP_OOP_ITERATE_BACKWARDS INCLUDE_NOT_ONLY_SERIALGC - #ifndef INCLUDE_NMT #define INCLUDE_NMT 1 #endif // INCLUDE_NMT @@ -577,6 +569,14 @@ #define NOT_AARCH64(code) code #endif +#ifdef VM_LITTLE_ENDIAN +#define LITTLE_ENDIAN_ONLY(code) code +#define BIG_ENDIAN_ONLY(code) +#else +#define LITTLE_ENDIAN_ONLY(code) +#define BIG_ENDIAN_ONLY(code) code +#endif + #define define_pd_global(type, name, value) const type pd_##name = value; // Helper macros for constructing file names for includes. diff -Nru openjdk-11-11~19/src/hotspot/share/utilities/nativeCallStack.cpp openjdk-11-11~24/src/hotspot/share/utilities/nativeCallStack.cpp --- openjdk-11-11~19/src/hotspot/share/utilities/nativeCallStack.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/utilities/nativeCallStack.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -28,7 +28,7 @@ #include "utilities/globalDefinitions.hpp" #include "utilities/nativeCallStack.hpp" -const NativeCallStack NativeCallStack::EMPTY_STACK(0, false); +NativeCallStack NativeCallStack::EMPTY_STACK(0, false); NativeCallStack::NativeCallStack(int toSkip, bool fillStack) : _hash_value(0) { @@ -126,4 +126,3 @@ } } } - diff -Nru openjdk-11-11~19/src/hotspot/share/utilities/nativeCallStack.hpp openjdk-11-11~24/src/hotspot/share/utilities/nativeCallStack.hpp --- openjdk-11-11~19/src/hotspot/share/utilities/nativeCallStack.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/utilities/nativeCallStack.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,18 +51,23 @@ * 2. The class is strict stack object, no heap or virtual memory can be allocated * from it. */ +class MemTracker; + class NativeCallStack : public StackObj { - public: - static const NativeCallStack EMPTY_STACK; + friend class MemTracker; - private: +private: address _stack[NMT_TrackingStackDepth]; unsigned int _hash_value; - public: + static NativeCallStack EMPTY_STACK; +public: NativeCallStack(int toSkip = 0, bool fillStack = false); NativeCallStack(address* pc, int frameCount); + static inline const NativeCallStack& empty_stack() { + return EMPTY_STACK; + } // if it is an empty stack inline bool is_empty() const { diff -Nru openjdk-11-11~19/src/hotspot/share/utilities/ostream.cpp openjdk-11-11~24/src/hotspot/share/utilities/ostream.cpp --- openjdk-11-11~19/src/hotspot/share/utilities/ostream.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/utilities/ostream.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -531,7 +531,8 @@ long fileStream::fileSize() { long size = -1; if (_file != NULL) { - long pos = ::ftell(_file); + long pos = ::ftell(_file); + if (pos < 0) return pos; if (::fseek(_file, 0, SEEK_END) == 0) { size = ::ftell(_file); } diff -Nru openjdk-11-11~19/src/hotspot/share/utilities/vmError.cpp openjdk-11-11~24/src/hotspot/share/utilities/vmError.cpp --- openjdk-11-11~19/src/hotspot/share/utilities/vmError.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/hotspot/share/utilities/vmError.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1385,9 +1385,24 @@ os::infinite_sleep(); } else { // Crash or assert during error reporting. Lets continue reporting with the next step. - jio_snprintf(buffer, sizeof(buffer), - "[error occurred during error reporting (%s), id 0x%x]", - _current_step_info, _id); + stringStream ss(buffer, sizeof(buffer)); + // Note: this string does get parsed by a number of jtreg tests, + // see hotspot/jtreg/runtime/ErrorHandling. + ss.print("[error occurred during error reporting (%s), id 0x%x", + _current_step_info, id); + char signal_name[64]; + if (os::exception_name(id, signal_name, sizeof(signal_name))) { + ss.print(", %s (0x%x) at pc=" PTR_FORMAT, signal_name, id, p2i(pc)); + } else { + if (should_report_bug(id)) { + ss.print(", Internal Error (%s:%d)", + filename == NULL ? "??" : filename, lineno); + } else { + ss.print(", Out of Memory Error (%s:%d)", + filename == NULL ? "??" : filename, lineno); + } + } + ss.print("]"); st->print_raw_cr(buffer); st->cr(); } @@ -1698,6 +1713,13 @@ // Case 15 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java. // Case 16 is tested by test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java. // Case 17 is tested by test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java. + + // We grab Threads_lock to keep ThreadsSMRSupport::print_info_on() + // from racing with Threads::add() or Threads::remove() as we + // generate the hs_err_pid file. This makes our ErrorHandling tests + // more stable. + MutexLockerEx ml(Threads_lock->owned_by_self() ? NULL : Threads_lock, Mutex::_no_safepoint_check_flag); + switch (how) { case 1: vmassert(str == NULL, "expected null"); break; case 2: vmassert(num == 1023 && *str == 'X', diff -Nru openjdk-11-11~19/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/SubSystem.java openjdk-11-11~24/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/SubSystem.java --- openjdk-11-11~19/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/SubSystem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/linux/classes/jdk/internal/platform/cgroupv1/SubSystem.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,6 +27,7 @@ import java.io.BufferedReader; import java.io.IOException; +import java.math.BigInteger; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; @@ -100,11 +101,20 @@ public static long getLongValue(SubSystem subsystem, String parm) { String strval = getStringValue(subsystem, parm); + long retval = 0; if (strval == null) return 0L; - long retval = Long.parseLong(strval); - + try { + retval = Long.parseLong(strval); + } catch (NumberFormatException e) { + // For some properties (e.g. memory.limit_in_bytes) we may overflow the range of signed long. + // In this case, return Long.max + BigInteger b = new BigInteger(strval); + if (b.compareTo(BigInteger.valueOf(Long.MAX_VALUE)) > 0) { + return Long.MAX_VALUE; + } + } return retval; } diff -Nru openjdk-11-11~19/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java openjdk-11-11~24/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java --- openjdk-11-11~19/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/linux/classes/sun/nio/fs/LinuxFileStore.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,14 @@ package sun.nio.fs; -import java.nio.file.attribute.*; -import java.util.*; import java.io.IOException; +import java.nio.file.attribute.DosFileAttributeView; +import java.nio.file.attribute.FileAttributeView; +import java.nio.file.attribute.PosixFileAttributeView; +import java.nio.file.attribute.UserDefinedFileAttributeView; +import java.util.Arrays; +import java.util.List; +import java.util.regex.Pattern; /** * Linux implementation of FileStore @@ -121,6 +126,18 @@ return false; } + // get kernel version as a three element array {major, minor, micro} + private static int[] getKernelVersion() { + Pattern pattern = Pattern.compile("\\D+"); + String[] matches = pattern.split(System.getProperty("os.version")); + int[] majorMinorMicro = new int[3]; + int length = Math.min(matches.length, majorMinorMicro.length); + for (int i = 0; i < length; i++) { + majorMinorMicro[i] = Integer.valueOf(matches[i]); + } + return majorMinorMicro; + } + @Override public boolean supportsFileAttributeView(Class<? extends FileAttributeView> type) { // support DosFileAttributeView and UserDefinedAttributeView if extended @@ -140,11 +157,31 @@ if ((entry().hasOption("user_xattr"))) return true; - // for ext3 and ext4 user_xattr option is enabled by default so - // check for explicit disabling of this option - if (entry().fstype().equals("ext3") || - entry().fstype().equals("ext4")) { - return !entry().hasOption("nouser_xattr"); + // check for explicit disabling of extended attributes + if (entry().hasOption("nouser_xattr")) { + return false; + } + + // user_{no}xattr options not present but we special-case ext3 as + // we know that extended attributes are not enabled by default. + if (entry().fstype().equals("ext3")) { + return false; + } + + // user_xattr option not present but we special-case ext4 as we + // know that extended attributes are enabled by default for + // kernel version >= 2.6.39 + if (entry().fstype().equals("ext4")) { + if (!xattrChecked) { + // check kernel version + int[] kernelVersion = getKernelVersion(); + xattrEnabled = kernelVersion[0] > 2 || + (kernelVersion[0] == 2 && kernelVersion[1] > 6) || + (kernelVersion[0] == 2 && kernelVersion[1] == 6 && + kernelVersion[2] >= 39); + xattrChecked = true; + } + return xattrEnabled; } // not ext3/4 so probe mount point diff -Nru openjdk-11-11~19/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java openjdk-11-11~24/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java --- openjdk-11-11~19/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/linux/classes/sun/nio/fs/LinuxFileSystemProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,8 +29,8 @@ import java.nio.file.attribute.*; import java.nio.file.spi.FileTypeDetector; import java.io.IOException; -import java.security.AccessController; -import sun.security.action.GetPropertyAction; + +import jdk.internal.util.StaticProperty; /** * Linux implementation of FileSystemProvider @@ -102,7 +102,7 @@ @Override FileTypeDetector getFileTypeDetector() { - String userHome = GetPropertyAction.privilegedGetProperty("user.home"); + String userHome = StaticProperty.userHome(); Path userMimeTypes = Path.of(userHome, ".mime.types"); Path etcMimeTypes = Path.of("/etc/mime.types"); diff -Nru openjdk-11-11~19/src/java.base/linux/native/libnet/linux_close.c openjdk-11-11~24/src/java.base/linux/native/libnet/linux_close.c --- openjdk-11-11~19/src/java.base/linux/native/libnet/linux_close.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/linux/native/libnet/linux_close.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -290,13 +290,13 @@ * And close/dup the file descriptor * (restart if interrupted by signal) */ - do { - if (fd1 < 0) { - rv = close(fd2); - } else { + if (fd1 < 0) { + rv = close(fd2); + } else { + do { rv = dup2(fd1, fd2); - } - } while (rv == -1 && errno == EINTR); + } while (rv == -1 && errno == EINTR); + } /* * Send a wakeup signal to all threads blocked on this diff -Nru openjdk-11-11~19/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java openjdk-11-11~24/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java --- openjdk-11-11~19/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/macosx/classes/sun/nio/fs/MacOSXFileSystemProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,6 +27,7 @@ import java.nio.file.Path; import java.nio.file.spi.FileTypeDetector; +import jdk.internal.util.StaticProperty; import sun.security.action.GetPropertyAction; /** @@ -45,8 +46,7 @@ @Override FileTypeDetector getFileTypeDetector() { - Path userMimeTypes = Path.of(GetPropertyAction - .privilegedGetProperty("user.home"), ".mime.types"); + Path userMimeTypes = Path.of(StaticProperty.userHome(), ".mime.types"); return chain(new MimeTypesFileTypeDetector(userMimeTypes), new UTIFileTypeDetector()); diff -Nru openjdk-11-11~19/src/java.base/macosx/native/libjava/java_props_macosx.c openjdk-11-11~24/src/java.base/macosx/native/libjava/java_props_macosx.c --- openjdk-11-11~19/src/java.base/macosx/native/libjava/java_props_macosx.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/macosx/native/libjava/java_props_macosx.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,11 +45,22 @@ } #define LOCALEIDLENGTH 128 +#ifndef kCFCoreFoundationVersionNumber10_11_Max +#define kCFCoreFoundationVersionNumber10_11_Max 1299 +#endif char *getMacOSXLocale(int cat) { const char* retVal = NULL; char languageString[LOCALEIDLENGTH]; char localeString[LOCALEIDLENGTH]; + // Since macOS 10.12, there is no separate language selection for + // "format" locale, e.g., date format. Use the preferred language + // for all LC_* categories. + if (kCFCoreFoundationVersionNumber > + kCFCoreFoundationVersionNumber10_11_Max) { + cat = LC_MESSAGES; + } + switch (cat) { case LC_MESSAGES: { diff -Nru openjdk-11-11~19/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java openjdk-11-11~24/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java --- openjdk-11-11~19/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/com/sun/crypto/provider/GCTR.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,8 @@ package com.sun.crypto.provider; +import java.nio.ByteBuffer; +import java.nio.ByteOrder; import javax.crypto.IllegalBlockSizeException; import static com.sun.crypto.provider.AESConstants.AES_BLOCK_SIZE; @@ -68,6 +70,15 @@ return "GCTR"; } + // return the number of blocks until the lower 32 bits roll over + private long blocksUntilRollover() { + ByteBuffer buf = ByteBuffer.wrap(counter, counter.length - 4, 4); + buf.order(ByteOrder.BIG_ENDIAN); + long ctr32 = 0xFFFFFFFFL & buf.getInt(); + long blocksLeft = (1L << 32) - ctr32; + return blocksLeft; + } + // input must be multiples of 128-bit blocks when calling update int update(byte[] in, int inOfs, int inLen, byte[] out, int outOfs) { if (inLen - inOfs > in.length) { @@ -80,7 +91,25 @@ throw new RuntimeException("output buffer too small"); } - return encrypt(in, inOfs, inLen, out, outOfs); + long blocksLeft = blocksUntilRollover(); + int numOfCompleteBlocks = inLen / AES_BLOCK_SIZE; + if (numOfCompleteBlocks >= blocksLeft) { + // Counter Mode encryption cannot be used because counter will + // roll over incorrectly. Use GCM-specific code instead. + byte[] encryptedCntr = new byte[AES_BLOCK_SIZE]; + for (int i = 0; i < numOfCompleteBlocks; i++) { + embeddedCipher.encryptBlock(counter, 0, encryptedCntr, 0); + for (int n = 0; n < AES_BLOCK_SIZE; n++) { + int index = (i * AES_BLOCK_SIZE + n); + out[outOfs + index] = + (byte) ((in[inOfs + index] ^ encryptedCntr[n])); + } + GaloisCounterMode.increment32(counter); + } + return inLen; + } else { + return encrypt(in, inOfs, inLen, out, outOfs); + } } // input can be arbitrary size when calling doFinal diff -Nru openjdk-11-11~19/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java openjdk-11-11~24/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java --- openjdk-11-11~19/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/com/sun/crypto/provider/PBES2Parameters.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,7 +33,6 @@ import java.security.spec.InvalidParameterSpecException; import javax.crypto.spec.IvParameterSpec; import javax.crypto.spec.PBEParameterSpec; -import sun.security.util.HexDumpEncoder; import sun.security.util.*; /** @@ -260,21 +259,7 @@ String kdfAlgo = null; String cipherAlgo = null; - DerValue pBES2Algorithms = new DerValue(encoded); - if (pBES2Algorithms.tag != DerValue.tag_Sequence) { - throw new IOException("PBE parameter parsing error: " - + "not an ASN.1 SEQUENCE tag"); - } - if (!pkcs5PBES2_OID.equals(pBES2Algorithms.data.getOID())) { - throw new IOException("PBE parameter parsing error: " - + "expecting the object identifier for PBES2"); - } - if (pBES2Algorithms.tag != DerValue.tag_Sequence) { - throw new IOException("PBE parameter parsing error: " - + "not an ASN.1 SEQUENCE tag"); - } - - DerValue pBES2_params = pBES2Algorithms.data.getDerValue(); + DerValue pBES2_params = new DerValue(encoded); if (pBES2_params.tag != DerValue.tag_Sequence) { throw new IOException("PBE parameter parsing error: " + "not an ASN.1 SEQUENCE tag"); @@ -293,7 +278,6 @@ @SuppressWarnings("deprecation") private String parseKDF(DerValue keyDerivationFunc) throws IOException { - String kdfAlgo = null; if (!pkcs5PBKDF2_OID.equals(keyDerivationFunc.data.getOID())) { throw new IOException("PBE parameter parsing error: " @@ -318,34 +302,41 @@ + "not an ASN.1 OCTET STRING tag"); } iCount = pBKDF2_params.data.getInteger(); - DerValue keyLength = pBKDF2_params.data.getDerValue(); - if (keyLength.tag == DerValue.tag_Integer) { - keysize = keyLength.getInteger() * 8; // keysize (in bits) - } - if (pBKDF2_params.tag == DerValue.tag_Sequence) { - DerValue prf = pBKDF2_params.data.getDerValue(); - kdfAlgo_OID = prf.data.getOID(); - if (hmacWithSHA1_OID.equals(kdfAlgo_OID)) { - kdfAlgo = "HmacSHA1"; - } else if (hmacWithSHA224_OID.equals(kdfAlgo_OID)) { - kdfAlgo = "HmacSHA224"; - } else if (hmacWithSHA256_OID.equals(kdfAlgo_OID)) { - kdfAlgo = "HmacSHA256"; - } else if (hmacWithSHA384_OID.equals(kdfAlgo_OID)) { - kdfAlgo = "HmacSHA384"; - } else if (hmacWithSHA512_OID.equals(kdfAlgo_OID)) { - kdfAlgo = "HmacSHA512"; - } else { - throw new IOException("PBE parameter parsing error: " - + "expecting the object identifier for a HmacSHA key " - + "derivation function"); + // keyLength INTEGER (1..MAX) OPTIONAL, + if (pBKDF2_params.data.available() > 0) { + DerValue keyLength = pBKDF2_params.data.getDerValue(); + if (keyLength.tag == DerValue.tag_Integer) { + keysize = keyLength.getInteger() * 8; // keysize (in bits) } - if (prf.data.available() != 0) { - // parameter is 'NULL' for all HmacSHA KDFs - DerValue parameter = prf.data.getDerValue(); - if (parameter.tag != DerValue.tag_Null) { + } + // prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1 + String kdfAlgo = "HmacSHA1"; + if (pBKDF2_params.data.available() > 0) { + if (pBKDF2_params.tag == DerValue.tag_Sequence) { + DerValue prf = pBKDF2_params.data.getDerValue(); + kdfAlgo_OID = prf.data.getOID(); + if (hmacWithSHA1_OID.equals(kdfAlgo_OID)) { + kdfAlgo = "HmacSHA1"; + } else if (hmacWithSHA224_OID.equals(kdfAlgo_OID)) { + kdfAlgo = "HmacSHA224"; + } else if (hmacWithSHA256_OID.equals(kdfAlgo_OID)) { + kdfAlgo = "HmacSHA256"; + } else if (hmacWithSHA384_OID.equals(kdfAlgo_OID)) { + kdfAlgo = "HmacSHA384"; + } else if (hmacWithSHA512_OID.equals(kdfAlgo_OID)) { + kdfAlgo = "HmacSHA512"; + } else { throw new IOException("PBE parameter parsing error: " - + "not an ASN.1 NULL tag"); + + "expecting the object identifier for a HmacSHA key " + + "derivation function"); + } + if (prf.data.available() != 0) { + // parameter is 'NULL' for all HmacSHA KDFs + DerValue parameter = prf.data.getDerValue(); + if (parameter.tag != DerValue.tag_Null) { + throw new IOException("PBE parameter parsing error: " + + "not an ASN.1 NULL tag"); + } } } } @@ -399,8 +390,6 @@ protected byte[] engineGetEncoded() throws IOException { DerOutputStream out = new DerOutputStream(); - DerOutputStream pBES2Algorithms = new DerOutputStream(); - pBES2Algorithms.putOID(pkcs5PBES2_OID); DerOutputStream pBES2_params = new DerOutputStream(); @@ -410,7 +399,10 @@ DerOutputStream pBKDF2_params = new DerOutputStream(); pBKDF2_params.putOctetString(salt); // choice: 'specified OCTET STRING' pBKDF2_params.putInteger(iCount); - pBKDF2_params.putInteger(keysize / 8); // derived key length (in octets) + + if (keysize > 0) { + pBKDF2_params.putInteger(keysize / 8); // derived key length (in octets) + } DerOutputStream prf = new DerOutputStream(); // algorithm is id-hmacWithSHA1/SHA224/SHA256/SHA384/SHA512 @@ -434,8 +426,7 @@ } pBES2_params.write(DerValue.tag_Sequence, encryptionScheme); - pBES2Algorithms.write(DerValue.tag_Sequence, pBES2_params); - out.write(DerValue.tag_Sequence, pBES2Algorithms); + out.write(DerValue.tag_Sequence, pBES2_params); return out.toByteArray(); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java openjdk-11-11~24/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java --- openjdk-11-11~19/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/com/sun/crypto/provider/RSACipher.java 2018-07-25 15:36:46.000000000 +0000 @@ -332,7 +332,7 @@ if ((inLen == 0) || (in == null)) { return; } - if (bufOfs + inLen > buffer.length) { + if (inLen > (buffer.length - bufOfs)) { bufOfs = buffer.length + 1; return; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java openjdk-11-11~24/src/java.base/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java --- openjdk-11-11~19/src/java.base/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/com/sun/crypto/provider/TlsMasterSecretGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -95,7 +95,7 @@ premasterMajor = premaster[0] & 0xff; premasterMinor = premaster[1] & 0xff; } else { - // DH, KRB5, others + // DH, others premasterMajor = -1; premasterMinor = -1; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/com/sun/java/util/jar/pack/intrinsic.properties openjdk-11-11~24/src/java.base/share/classes/com/sun/java/util/jar/pack/intrinsic.properties --- openjdk-11-11~19/src/java.base/share/classes/com/sun/java/util/jar/pack/intrinsic.properties 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/com/sun/java/util/jar/pack/intrinsic.properties 2018-07-25 15:36:46.000000000 +0000 @@ -13,6 +13,8 @@ pack.code.attribute.CharacterRangeTable = NH[PHPOHIIH] pack.class.attribute.SourceID = RUH pack.class.attribute.CompilationID = RUH +pack.class.attribute.NestHost = RCH +pack.class.attribute.NestMembers = NH[RCH] # Note: Zero-length ("marker") attributes do not need to be specified here. # They are automatically defined to have an empty layout. diff -Nru openjdk-11-11~19/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java openjdk-11-11~24/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java --- openjdk-11-11~19/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/com/sun/net/ssl/internal/www/protocol/https/DelegateHttpsURLConnection.java 2018-07-25 15:36:46.000000000 +0000 @@ -113,27 +113,19 @@ * In com.sun.net.ssl.HostnameVerifier the method is defined * as verify(String urlHostname, String certHostname). * This means we need to extract the hostname from the X.509 certificate - * or from the Kerberos principal name, in this wrapper. + * in this wrapper. */ public boolean verify(String hostname, javax.net.ssl.SSLSession session) { try { - String serverName; - // Use ciphersuite to determine whether Kerberos is active. - if (session.getCipherSuite().startsWith("TLS_KRB5")) { - serverName = - HostnameChecker.getServerName(getPeerPrincipal(session)); - - } else { // X.509 - Certificate[] serverChain = session.getPeerCertificates(); - if ((serverChain == null) || (serverChain.length == 0)) { - return false; - } - if (serverChain[0] instanceof X509Certificate == false) { - return false; - } - X509Certificate serverCert = (X509Certificate)serverChain[0]; - serverName = getServername(serverCert); + Certificate[] serverChain = session.getPeerCertificates(); + if ((serverChain == null) || (serverChain.length == 0)) { + return false; } + if (serverChain[0] instanceof X509Certificate == false) { + return false; + } + X509Certificate serverCert = (X509Certificate)serverChain[0]; + String serverName = getServername(serverCert); if (serverName == null) { return false; } @@ -144,23 +136,6 @@ } /* - * Get the peer principal from the session - */ - private Principal getPeerPrincipal(javax.net.ssl.SSLSession session) - throws javax.net.ssl.SSLPeerUnverifiedException - { - Principal principal; - try { - principal = session.getPeerPrincipal(); - } catch (AbstractMethodError e) { - // if the provider does not support it, return null, since - // we need it only for Kerberos. - principal = null; - } - return principal; - } - - /* * Extract the name of the SSL server from the certificate. * * Note this code is essentially a subset of the hostname extraction diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/io/Reader.java openjdk-11-11~24/src/java.base/share/classes/java/io/Reader.java --- openjdk-11-11~19/src/java.base/share/classes/java/io/Reader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/io/Reader.java 2018-07-25 15:36:46.000000000 +0000 @@ -63,13 +63,12 @@ * * <p> While the stream is open, the {@code read()}, {@code read(char[])}, * {@code read(char[], int, int)}, {@code read(Charbuffer)}, {@code - * ready())}, {@code skip(long)}, and {@code transferTo()} methods all - * behave as if end of stream has been reached. After the stream has been + * ready()}, {@code skip(long)}, and {@code transferTo()} methods all + * behave as if end of stream has been reached. After the stream has been * closed, these methods all throw {@code IOException}. * * <p> The {@code markSupported()} method returns {@code false}. The - * {@code mark()} method does nothing, and the {@code reset()} method - * throws {@code IOException}. + * {@code mark()} and {@code reset()} methods throw an {@code IOException}. * * <p> The {@link #lock object} used to synchronize operations on the * returned {@code Reader} is not specified. @@ -115,6 +114,12 @@ } @Override + public boolean ready() throws IOException { + ensureOpen(); + return false; + } + + @Override public long skip(long n) throws IOException { ensureOpen(); return 0L; diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/Class.java openjdk-11-11~24/src/java.base/share/classes/java/lang/Class.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/Class.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/Class.java 2018-07-25 15:36:46.000000000 +0000 @@ -82,9 +82,9 @@ import sun.reflect.misc.ReflectUtil; /** - * Instances of the class {@code Class} represent classes and - * interfaces in a running Java application. An enum is a kind of - * class and an annotation is a kind of interface. Every array also + * Instances of the class {@code Class} represent classes and interfaces + * in a running Java application. An enum type is a kind of class and an + * annotation type is a kind of interface. Every array also * belongs to a class that is reflected as a {@code Class} object * that is shared by all arrays with the same element type and number * of dimensions. The primitive Java types ({@code boolean}, @@ -93,10 +93,34 @@ * {@code double}), and the keyword {@code void} are also * represented as {@code Class} objects. * - * <p> {@code Class} has no public constructor. Instead {@code Class} - * objects are constructed automatically by the Java Virtual Machine as classes - * are loaded and by calls to the {@code defineClass} method in the class - * loader. + * <p> {@code Class} has no public constructor. Instead a {@code Class} + * object is constructed automatically by the Java Virtual Machine + * when a class loader invokes one of the + * {@link ClassLoader#defineClass(String,byte[], int,int) defineClass} methods + * and passes the bytes of a {@code class} file. + * + * <p> The methods of class {@code Class} expose many characteristics of a + * class or interface. Most characteristics are derived from the {@code class} + * file that the class loader passed to the Java Virtual Machine. A few + * characteristics are determined by the class loading environment at run time, + * such as the module returned by {@link #getModule() getModule()}. + * + * <p> Some methods of class {@code Class} expose whether the declaration of + * a class or interface in Java source code was <em>enclosed</em> within + * another declaration. Other methods describe how a class or interface + * is situated in a <em>nest</em>. A <a id="nest">nest</a> is a set of + * classes and interfaces, in the same run-time package, that + * allow mutual access to their {@code private} members. + * The classes and interfaces are known as <em>nestmates</em>. + * One nestmate acts as the + * <em>nest host</em>, and enumerates the other nestmates which + * belong to the nest; each of them in turn records it as the nest host. + * The classes and interfaces which belong to a nest, including its host, are + * determined when + * {@code class} files are generated, for example, a Java compiler + * will typically record a top-level class as the host of a nest where the + * other members are the classes and interfaces whose declarations are + * enclosed within the top-level class declaration. * * <p> The following example uses a {@code Class} object to print the * class name of an object: @@ -3848,4 +3872,161 @@ public AnnotatedType[] getAnnotatedInterfaces() { return TypeAnnotationParser.buildAnnotatedInterfaces(getRawTypeAnnotations(), getConstantPool(), this); } + + private native Class<?> getNestHost0(); + + /** + * Returns the nest host of the <a href=#nest>nest</a> to which the class + * or interface represented by this {@code Class} object belongs. + * Every class and interface is a member of exactly one nest. + * A class or interface that is not recorded as belonging to a nest + * belongs to the nest consisting only of itself, and is the nest + * host. + * + * <p>Each of the {@code Class} objects representing array types, + * primitive types, and {@code void} returns {@code this} to indicate + * that the represented entity belongs to the nest consisting only of + * itself, and is the nest host. + * + * <p>If there is a {@linkplain LinkageError linkage error} accessing + * the nest host, or if this class or interface is not enumerated as + * a member of the nest by the nest host, then it is considered to belong + * to its own nest and {@code this} is returned as the host. + * + * @apiNote A {@code class} file of version 55.0 or greater may record the + * host of the nest to which it belongs by using the {@code NestHost} + * attribute (JVMS 4.7.28). Alternatively, a {@code class} file of + * version 55.0 or greater may act as a nest host by enumerating the nest's + * other members with the + * {@code NestMembers} attribute (JVMS 4.7.29). + * A {@code class} file of version 54.0 or lower does not use these + * attributes. + * + * @return the nest host of this class or interface + * + * @throws SecurityException + * If the returned class is not the current class, and + * if a security manager, <i>s</i>, is present and the caller's + * class loader is not the same as or an ancestor of the class + * loader for the returned class and invocation of {@link + * SecurityManager#checkPackageAccess s.checkPackageAccess()} + * denies access to the package of the returned class + * @since 11 + * @jvms 4.7.28 and 4.7.29 NestHost and NestMembers attributes + * @jvms 5.4.4 Access Control + */ + @CallerSensitive + public Class<?> getNestHost() { + if (isPrimitive() || isArray()) { + return this; + } + Class<?> host; + try { + host = getNestHost0(); + } catch (LinkageError e) { + // if we couldn't load our nest-host then we + // act as-if we have no nest-host attribute + return this; + } + // if null then nest membership validation failed, so we + // act as-if we have no nest-host attribute + if (host == null || host == this) { + return this; + } + // returning a different class requires a security check + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + checkPackageAccess(sm, + ClassLoader.getClassLoader(Reflection.getCallerClass()), true); + } + return host; + } + + /** + * Determines if the given {@code Class} is a nestmate of the + * class or interface represented by this {@code Class} object. + * Two classes or interfaces are nestmates + * if they have the same {@linkplain #getNestHost() nest host}. + * + * @param c the class to check + * @return {@code true} if this class and {@code c} are members of + * the same nest; and {@code false} otherwise. + * + * @since 11 + */ + public boolean isNestmateOf(Class<?> c) { + if (this == c) { + return true; + } + if (isPrimitive() || isArray() || + c.isPrimitive() || c.isArray()) { + return false; + } + try { + return getNestHost0() == c.getNestHost0(); + } catch (LinkageError e) { + return false; + } + } + + private native Class<?>[] getNestMembers0(); + + /** + * Returns an array containing {@code Class} objects representing all the + * classes and interfaces that are members of the nest to which the class + * or interface represented by this {@code Class} object belongs. + * The {@linkplain #getNestHost() nest host} of that nest is the zeroth + * element of the array. Subsequent elements represent any classes or + * interfaces that are recorded by the nest host as being members of + * the nest; the order of such elements is unspecified. Duplicates are + * permitted. + * If the nest host of that nest does not enumerate any members, then the + * array has a single element containing {@code this}. + * + * <p>Each of the {@code Class} objects representing array types, + * primitive types, and {@code void} returns an array containing only + * {@code this}. + * + * <p>This method validates that, for each class or interface which is + * recorded as a member of the nest by the nest host, that class or + * interface records itself as a member of that same nest. Any exceptions + * that occur during this validation are rethrown by this method. + * + * @return an array of all classes and interfaces in the same nest as + * this class + * + * @throws LinkageError + * If there is any problem loading or validating a nest member or + * its nest host + * @throws SecurityException + * If any returned class is not the current class, and + * if a security manager, <i>s</i>, is present and the caller's + * class loader is not the same as or an ancestor of the class + * loader for that returned class and invocation of {@link + * SecurityManager#checkPackageAccess s.checkPackageAccess()} + * denies access to the package of that returned class + * + * @since 11 + * @see #getNestHost() + */ + @CallerSensitive + public Class<?>[] getNestMembers() { + if (isPrimitive() || isArray()) { + return new Class<?>[] { this }; + } + Class<?>[] members = getNestMembers0(); + // Can't actually enable this due to bootstrapping issues + // assert(members.length != 1 || members[0] == this); // expected invariant from VM + + if (members.length > 1) { + // If we return anything other than the current class we need + // a security check + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + checkPackageAccess(sm, + ClassLoader.getClassLoader(Reflection.getCallerClass()), true); + } + } + return members; + } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/DirectMethodHandle.java 2018-07-25 15:36:46.000000000 +0000 @@ -58,7 +58,8 @@ if (!member.isResolved()) throw new InternalError(); if (member.getDeclaringClass().isInterface() && - member.isMethod() && !member.isAbstract()) { + member.getReferenceKind() == REF_invokeInterface && + member.isMethod() && !member.isAbstract()) { // Check for corner case: invokeinterface of Object method MemberName m = new MemberName(Object.class, member.getName(), member.getMethodType(), member.getReferenceKind()); m = MemberName.getFactory().resolveOrNull(m.getReferenceKind(), m, null); @@ -80,22 +81,28 @@ mtype = mtype.insertParameterTypes(0, refc); } if (!member.isField()) { + // refKind reflects the original type of lookup via findSpecial or + // findVirtual etc. switch (refKind) { case REF_invokeSpecial: { member = member.asSpecial(); - LambdaForm lform = preparedLambdaForm(member, callerClass); - Class<?> checkClass = refc; // Class to use for receiver type check - if (callerClass != null) { - checkClass = callerClass; // potentially strengthen to caller class + // if caller is an interface we need to adapt to get the + // receiver check inserted + if (callerClass == null) { + throw new InternalError("callerClass must not be null for REF_invokeSpecial"); } - return new Special(mtype, lform, member, checkClass); + LambdaForm lform = preparedLambdaForm(member, callerClass.isInterface()); + return new Special(mtype, lform, member, callerClass); } case REF_invokeInterface: { - LambdaForm lform = preparedLambdaForm(member, callerClass); + // for interfaces we always need the receiver typecheck, + // so we always pass 'true' to ensure we adapt if needed + // to include the REF_invokeSpecial case + LambdaForm lform = preparedLambdaForm(member, true); return new Interface(mtype, lform, member, refc); } default: { - LambdaForm lform = preparedLambdaForm(member, callerClass); + LambdaForm lform = preparedLambdaForm(member); return new DirectMethodHandle(mtype, lform, member); } } @@ -165,11 +172,16 @@ * Cache and share this structure among all methods with * the same basicType and refKind. */ - private static LambdaForm preparedLambdaForm(MemberName m, Class<?> callerClass) { + private static LambdaForm preparedLambdaForm(MemberName m, boolean adaptToSpecialIfc) { assert(m.isInvocable()) : m; // call preparedFieldLambdaForm instead MethodType mtype = m.getInvocationType().basicType(); assert(!m.isMethodHandleInvoke()) : m; int which; + // MemberName.getReferenceKind represents the JVM optimized form of the call + // as distinct from the "kind" passed to DMH.make which represents the original + // bytecode-equivalent request. Specifically private/final methods that use a direct + // call have getReferenceKind adapted to REF_invokeSpecial, even though the actual + // invocation mode may be invokevirtual or invokeinterface. switch (m.getReferenceKind()) { case REF_invokeVirtual: which = LF_INVVIRTUAL; break; case REF_invokeStatic: which = LF_INVSTATIC; break; @@ -183,7 +195,7 @@ preparedLambdaForm(mtype, which); which = LF_INVSTATIC_INIT; } - if (which == LF_INVSPECIAL && callerClass != null && callerClass.isInterface()) { + if (which == LF_INVSPECIAL && adaptToSpecialIfc) { which = LF_INVSPECIAL_IFC; } LambdaForm lform = preparedLambdaForm(mtype, which); @@ -195,7 +207,7 @@ } private static LambdaForm preparedLambdaForm(MemberName m) { - return preparedLambdaForm(m, null); + return preparedLambdaForm(m, false); } private static LambdaForm preparedLambdaForm(MethodType mtype, int which) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/LambdaMetafactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -61,7 +61,13 @@ * parameters</em>, which must be provided as arguments to the * {@code CallSite} target, and which may be early-bound to the behavior * {@code MethodHandle}. The number of captured parameters and their types - * are determined during linkage.</li> + * are determined during linkage. + * The identity of a function object produced by invoking the + * {@code CallSite}'s target is unpredictable, and therefore + * identity-sensitive operations (such as reference equality, object + * locking, and {@code System.identityHashCode()} may produce different + * results in different implementations, or even upon different invocations + * in the same implementation.</li> * * <li><em>Invocation</em> occurs when an implemented interface method * is invoked on a function object. This may occur many times for a single diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/MethodHandle.java openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/MethodHandle.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/MethodHandle.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/MethodHandle.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -250,6 +250,9 @@ * can also be created. These do not perform virtual lookup based on * receiver type. Such a method handle simulates the effect of * an {@code invokespecial} instruction to the same method. + * A non-virtual method handle can also be created to simulate the effect + * of an {@code invokevirtual} or {@code invokeinterface} instruction on + * a private method (as applicable). * * <h1>Usage examples</h1> * Here are some examples of usage: diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/MethodHandles.java openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/MethodHandles.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/MethodHandles.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/MethodHandles.java 2018-07-25 15:36:46.000000000 +0000 @@ -469,15 +469,20 @@ * methods as if they were normal methods, but the JVM bytecode verifier rejects them. * A lookup of such an internal method will produce a {@code NoSuchMethodException}. * <p> - * In some cases, access between nested classes is obtained by the Java compiler by creating - * an wrapper method to access a private method of another class - * in the same top-level declaration. + * If the relationship between nested types is expressed directly through the + * {@code NestHost} and {@code NestMembers} attributes + * (see the Java Virtual Machine Specification, sections 4.7.28 and 4.7.29), + * then the associated {@code Lookup} object provides direct access to + * the lookup class and all of its nestmates + * (see {@link java.lang.Class#getNestHost Class.getNestHost}). + * Otherwise, access between nested classes is obtained by the Java compiler creating + * a wrapper method to access a private method of another class in the same nest. * For example, a nested class {@code C.D} * can access private members within other related classes such as * {@code C}, {@code C.D.E}, or {@code C.B}, * but the Java compiler may need to generate wrapper methods in * those related classes. In such cases, a {@code Lookup} object on - * {@code C.E} would be unable to those private members. + * {@code C.E} would be unable to access those private members. * A workaround for this limitation is the {@link Lookup#in Lookup.in} method, * which can transform a lookup on {@code C.E} into one on any of those other * classes, without special elevation of privilege. @@ -499,11 +504,12 @@ * <em>Discussion of private access:</em> * We say that a lookup has <em>private access</em> * if its {@linkplain #lookupModes lookup modes} - * include the possibility of accessing {@code private} members. + * include the possibility of accessing {@code private} members + * (which includes the private members of nestmates). * As documented in the relevant methods elsewhere, * only lookups with private access possess the following capabilities: * <ul style="font-size:smaller;"> - * <li>access private fields, methods, and constructors of the lookup class + * <li>access private fields, methods, and constructors of the lookup class and its nestmates * <li>create method handles which invoke <a href="MethodHandles.Lookup.html#callsens">caller sensitive</a> methods, * such as {@code Class.forName} * <li>create method handles which {@link Lookup#findSpecial emulate invokespecial} instructions @@ -728,9 +734,7 @@ * <p> * A freshly-created lookup object * on the {@linkplain java.lang.invoke.MethodHandles#lookup() caller's class} has - * all possible bits set, except {@code UNCONDITIONAL}. The lookup can be used to - * access all members of the caller's class, all public types in the caller's module, - * and all public types in packages exported by other modules to the caller's module. + * all possible bits set, except {@code UNCONDITIONAL}. * A lookup object on a new lookup class * {@linkplain java.lang.invoke.MethodHandles.Lookup#in created from a previous lookup object} * may have some mode bits set to zero. @@ -1106,8 +1110,9 @@ * The method and all its argument types must be accessible to the lookup object. * <p> * When called, the handle will treat the first argument as a receiver - * and dispatch on the receiver's type to determine which method + * and, for non-private methods, dispatch on the receiver's type to determine which method * implementation to enter. + * For private methods the named method in {@code refc} will be invoked on the receiver. * (The dispatching action is identical with that performed by an * {@code invokevirtual} or {@code invokeinterface} instruction.) * <p> @@ -1171,7 +1176,6 @@ * @throws NoSuchMethodException if the method does not exist * @throws IllegalAccessException if access checking fails, * or if the method is {@code static}, - * or if the method is {@code private} method of interface, * or if the method's variable arity modifier bit * is set and {@code asVarargsCollector} fails * @exception SecurityException if a security manager is present and it @@ -2225,17 +2229,13 @@ return "member is private to package"; } - private static final boolean ALLOW_NESTMATE_ACCESS = false; - private void checkSpecialCaller(Class<?> specialCaller, Class<?> refc) throws IllegalAccessException { int allowedModes = this.allowedModes; if (allowedModes == TRUSTED) return; if (!hasPrivateAccess() || (specialCaller != lookupClass() // ensure non-abstract methods in superinterfaces can be special-invoked - && !(refc != null && refc.isInterface() && refc.isAssignableFrom(specialCaller)) - && !(ALLOW_NESTMATE_ACCESS && - VerifyAccess.isSamePackageMember(specialCaller, lookupClass())))) + && !(refc != null && refc.isInterface() && refc.isAssignableFrom(specialCaller)))) throw new MemberName(specialCaller). makeAccessException("no private access for invokespecial", this); } @@ -2246,9 +2246,7 @@ if (!method.isProtected() || method.isStatic() || allowedModes == TRUSTED || method.getDeclaringClass() == lookupClass() - || VerifyAccess.isSamePackage(method.getDeclaringClass(), lookupClass()) - || (ALLOW_NESTMATE_ACCESS && - VerifyAccess.isSamePackageMember(method.getDeclaringClass(), lookupClass()))) + || VerifyAccess.isSamePackage(method.getDeclaringClass(), lookupClass())) return false; return true; } @@ -2288,6 +2286,7 @@ private MethodHandle getDirectMethodCommon(byte refKind, Class<?> refc, MemberName method, boolean checkSecurity, boolean doRestrict, Class<?> boundCallerClass) throws IllegalAccessException { + checkMethod(refKind, refc, method); // Optionally check with the security manager; this isn't needed for unreflect* calls. if (checkSecurity) @@ -2300,6 +2299,7 @@ refc != lookupClass().getSuperclass() && refc.isAssignableFrom(lookupClass())) { assert(!method.getName().equals("<init>")); // not this code path + // Per JVMS 6.5, desc. of invokespecial instruction: // If the method is in a superclass of the LC, // and if our original search was above LC.super, @@ -2452,12 +2452,18 @@ checkSymbolicClass(defc); return mh; } - // Treat MethodHandle.invoke and invokeExact specially. if (defc == MethodHandle.class && refKind == REF_invokeVirtual) { + // Treat MethodHandle.invoke and invokeExact specially. mh = findVirtualForMH(member.getName(), member.getMethodType()); if (mh != null) { return mh; } + } else if (defc == VarHandle.class && refKind == REF_invokeVirtual) { + // Treat signature-polymorphic methods on VarHandle specially. + mh = findVirtualForVH(member.getName(), member.getMethodType()); + if (mh != null) { + return mh; + } } MemberName resolved = resolveOrFail(refKind, member); mh = getDirectMethodForConstant(refKind, defc, resolved); diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/invoke/SerializedLambda.java 2018-07-25 15:36:46.000000000 +0000 @@ -53,6 +53,12 @@ * that the properties of the {@code SerializedLambda} are consistent with a * lambda actually captured by that class. * + * <p>The identity of a function object produced by deserializing the serialized + * form is unpredictable, and therefore identity-sensitive operations (such as + * reference equality, object locking, and {@code System.identityHashCode()} may + * produce different results in different implementations, or even upon + * different deserializations in the same implementation. + * * @see LambdaMetafactory * @since 1.8 */ diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/module/package-info.java openjdk-11-11~24/src/java.base/share/classes/java/lang/module/package-info.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/module/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/module/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -154,8 +154,9 @@ * application module specified to the 'java' launcher. When compiling code in * the unnamed module, or at run-time when the main application class is loaded * from the class path, then the default set of root modules is implementation - * specific (In the JDK implementation it is the module "java.se", if observable, - * and every observable module that exports an API). </p> + * specific. In the JDK the default set of root modules contains every module + * that is observable on the upgrade module path or among the system modules, + * and that exports at least one package without qualification. </p> * * <h2> Observable modules </h2> * diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java openjdk-11-11~24/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/reflect/AccessibleObject.java 2018-07-25 15:36:46.000000000 +0000 @@ -47,7 +47,7 @@ * in a manner that would normally be prohibited. * * <p> Java language access control prevents use of private members outside - * their class; package access members outside their package; protected members + * their top-level class; package access members outside their package; protected members * outside their package or subclasses; and public members outside their * module unless they are declared in an {@link Module#isExported(String,Module) * exported} package and the user {@link Module#canRead reads} their module. By diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/reflect/Method.java openjdk-11-11~24/src/java.base/share/classes/java/lang/reflect/Method.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/reflect/Method.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/reflect/Method.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -505,8 +505,8 @@ * * <p>If the underlying method is an instance method, it is invoked * using dynamic method lookup as documented in The Java Language - * Specification, Second Edition, section 15.12.4.4; in particular, - * overriding based on the runtime type of the target object will occur. + * Specification, section 15.12.4.4; in particular, + * overriding based on the runtime type of the target object may occur. * * <p>If the underlying method is static, the class that declared * the method is initialized if it has not already been initialized. diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/StringCoding.java openjdk-11-11~24/src/java.base/share/classes/java/lang/StringCoding.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/StringCoding.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/StringCoding.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,6 +36,8 @@ import java.nio.charset.CoderResult; import java.nio.charset.CodingErrorAction; import java.nio.charset.IllegalCharsetNameException; +import java.nio.charset.MalformedInputException; +import java.nio.charset.UnmappableCharacterException; import java.nio.charset.UnsupportedCharsetException; import java.util.Arrays; import jdk.internal.HotSpotIntrinsicCandidate; @@ -607,7 +609,7 @@ dp = dp + ret; if (ret != len) { if (!doReplace) { - throwMalformed(sp, 1); + throwUnmappable(sp, 1); } char c = StringUTF16.getChar(val, sp++); if (Character.isHighSurrogate(c) && sp < sl && @@ -679,8 +681,8 @@ } private static void throwMalformed(int off, int nb) { - throw new IllegalArgumentException("malformed input off : " + off + - ", length : " + nb); + String msg = "malformed input off : " + off + ", length : " + nb; + throw new IllegalArgumentException(msg, new MalformedInputException(nb)); } private static void throwMalformed(byte[] val) { @@ -689,6 +691,17 @@ throwMalformed(dp, 1); } + private static void throwUnmappable(int off, int nb) { + String msg = "malformed input off : " + off + ", length : " + nb; + throw new IllegalArgumentException(msg, new UnmappableCharacterException(nb)); + } + + private static void throwUnmappable(byte[] val) { + int dp = 0; + while (dp < val.length && val[dp] >=0) { dp++; } + throwUnmappable(dp, 1); + } + private static char repl = '\ufffd'; private static Result decodeUTF8(byte[] src, int sp, int len, boolean doReplace) { @@ -919,7 +932,7 @@ if (doReplace) { dst[dp++] = '?'; } else { - throwMalformed(sp - 1, 1); // or 2, does not matter here + throwUnmappable(sp - 1, 1); // or 2, does not matter here } } else { dst[dp++] = (byte)(0xf0 | ((uc >> 18))); @@ -972,7 +985,20 @@ return new String(StringLatin1.inflate(src, 0, src.length), UTF16); } - static String newStringNoRepl(byte[] src, Charset cs) { + static String newStringNoRepl(byte[] src, Charset cs) throws CharacterCodingException { + try { + return newStringNoRepl1(src, cs); + } catch (IllegalArgumentException e) { + //newStringNoRepl1 throws IAE with MalformedInputException or CCE as the cause + Throwable cause = e.getCause(); + if (cause instanceof MalformedInputException) { + throw (MalformedInputException)cause; + } + throw (CharacterCodingException)cause; + } + } + + static String newStringNoRepl1(byte[] src, Charset cs) { if (cs == UTF_8) { if (COMPACT_STRINGS && isASCII(src)) return new String(src, LATIN1); @@ -1023,9 +1049,22 @@ } /* - * Throws iae, instead of replacing, if unmappable. + * Throws CCE, instead of replacing, if unmappable. */ - static byte[] getBytesNoRepl(String s, Charset cs) { + static byte[] getBytesNoRepl(String s, Charset cs) throws CharacterCodingException { + try { + return getBytesNoRepl1(s, cs); + } catch (IllegalArgumentException e) { + //getBytesNoRepl1 throws IAE with UnmappableCharacterException or CCE as the cause + Throwable cause = e.getCause(); + if (cause instanceof UnmappableCharacterException) { + throw (UnmappableCharacterException)cause; + } + throw (CharacterCodingException)cause; + } + } + + static byte[] getBytesNoRepl1(String s, Charset cs) { byte[] val = s.value(); byte coder = s.coder(); if (cs == UTF_8) { @@ -1045,7 +1084,7 @@ if (isASCII(val)) { return val; } else { - throwMalformed(val); + throwUnmappable(val); } } } @@ -1083,7 +1122,7 @@ if (!cr.isUnderflow()) cr.throwException(); } catch (CharacterCodingException x) { - throw new Error(x); + throw new IllegalArgumentException(x); } return safeTrim(ba, bb.position(), isTrusted); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/System.java openjdk-11-11~24/src/java.base/share/classes/java/lang/System.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/System.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/System.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,6 +41,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.net.URI; +import java.nio.charset.CharacterCodingException; import java.security.AccessControlContext; import java.security.ProtectionDomain; import java.security.AccessController; @@ -59,6 +60,7 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Stream; +import jdk.internal.util.StaticProperty; import jdk.internal.module.ModuleBootstrap; import jdk.internal.module.ServicesCatalog; import jdk.internal.reflect.CallerSensitive; @@ -669,7 +671,16 @@ * {@code getProperties} operation, it may choose to permit the * {@link #getProperty(String)} operation. * - * @implNote In addition to the standard system properties, the system + * @apiNote + * <strong>Changing a standard system property may have unpredictable results + * unless otherwise specified.</strong> + * Property values may be cached during initialization or on first use. + * Setting a standard property after initialization using {@link #getProperties()}, + * {@link #setProperties(Properties)}, {@link #setProperty(String, String)}, or + * {@link #clearProperty(String)} may not have the desired effect. + * + * @implNote + * In addition to the standard system properties, the system * properties may include the following keys: * <table class="striped"> * <caption style="display:none">Shows property keys and associated values</caption> @@ -736,6 +747,11 @@ * {@code null}, then the current set of system properties is * forgotten. * + * @apiNote + * <strong>Changing a standard system property may have unpredictable results + * unless otherwise specified</strong>. + * See {@linkplain #getProperties getProperties} for details. + * * @param props the new system properties. * @throws SecurityException if a security manager exists and its * {@code checkPropertiesAccess} method doesn't allow access @@ -768,6 +784,11 @@ * properties is first created and initialized in the same manner as * for the {@code getProperties} method. * + * @apiNote + * <strong>Changing a standard system property may have unpredictable results + * unless otherwise specified</strong>. + * See {@linkplain #getProperties getProperties} for details. + * * @param key the name of the system property. * @return the string value of the system property, * or {@code null} if there is no property with that key. @@ -837,6 +858,11 @@ * If no exception is thrown, the specified property is set to the given * value. * + * @apiNote + * <strong>Changing a standard system property may have unpredictable results + * unless otherwise specified</strong>. + * See {@linkplain #getProperties getProperties} for details. + * * @param key the name of the system property. * @param value the value of the system property. * @return the previous value of the system property, @@ -875,6 +901,11 @@ * permission. This may result in a SecurityException being thrown. * If no exception is thrown, the specified property is removed. * + * @apiNote + * <strong>Changing a standard system property may have unpredictable results + * unless otherwise specified</strong>. + * See {@linkplain #getProperties getProperties} method for details. + * * @param key the name of the system property to be removed. * @return the previous string value of the system property, * or {@code null} if there was no property with that key. @@ -1927,6 +1958,7 @@ VM.saveAndRemoveProperties(props); lineSeparator = props.getProperty("line.separator"); + StaticProperty.javaHome(); // Load StaticProperty to cache the property values VersionProps.init(); FileInputStream fdIn = new FileInputStream(FileDescriptor.in); @@ -2153,11 +2185,11 @@ return ModuleLayer.layers(loader); } - public String newStringNoRepl(byte[] bytes, Charset cs) { + public String newStringNoRepl(byte[] bytes, Charset cs) throws CharacterCodingException { return StringCoding.newStringNoRepl(bytes, cs); } - public byte[] getBytesNoRepl(String s, Charset cs) { + public byte[] getBytesNoRepl(String s, Charset cs) throws CharacterCodingException { return StringCoding.getBytesNoRepl(s, cs); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/Thread.java openjdk-11-11~24/src/java.base/share/classes/java/lang/Thread.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/Thread.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/Thread.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,6 +36,8 @@ import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; import java.util.concurrent.locks.LockSupport; + +import jdk.internal.misc.TerminatingThreadLocal; import sun.nio.ch.Interruptible; import jdk.internal.reflect.CallerSensitive; import jdk.internal.reflect.Reflection; @@ -838,6 +840,9 @@ * a chance to clean up before it actually exits. */ private void exit() { + if (threadLocals != null && TerminatingThreadLocal.REGISTRY.isPresent()) { + TerminatingThreadLocal.threadTerminated(); + } if (group != null) { group.threadTerminated(this); group = null; diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/lang/ThreadLocal.java openjdk-11-11~24/src/java.base/share/classes/java/lang/ThreadLocal.java --- openjdk-11-11~19/src/java.base/share/classes/java/lang/ThreadLocal.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/lang/ThreadLocal.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,8 @@ */ package java.lang; +import jdk.internal.misc.TerminatingThreadLocal; + import java.lang.ref.*; import java.util.Objects; import java.util.concurrent.atomic.AtomicInteger; @@ -171,6 +173,19 @@ } /** + * Returns {@code true} if there is a value in the current thread's copy of + * this thread-local variable, even if that values is {@code null}. + * + * @return {@code true} if current thread has associated value in this + * thread-local variable; {@code false} if not + */ + boolean isPresent() { + Thread t = Thread.currentThread(); + ThreadLocalMap map = getMap(t); + return map != null && map.getEntry(this) != null; + } + + /** * Variant of set() to establish initialValue. Used instead * of set() in case user has overridden the set() method. * @@ -180,10 +195,14 @@ T value = initialValue(); Thread t = Thread.currentThread(); ThreadLocalMap map = getMap(t); - if (map != null) + if (map != null) { map.set(this, value); - else + } else { createMap(t, value); + } + if (this instanceof TerminatingThreadLocal) { + TerminatingThreadLocal.register((TerminatingThreadLocal<?>) this); + } return value; } @@ -199,10 +218,11 @@ public void set(T value) { Thread t = Thread.currentThread(); ThreadLocalMap map = getMap(t); - if (map != null) + if (map != null) { map.set(this, value); - else + } else { createMap(t, value); + } } /** @@ -218,8 +238,9 @@ */ public void remove() { ThreadLocalMap m = getMap(Thread.currentThread()); - if (m != null) + if (m != null) { m.remove(this); + } } /** diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java openjdk-11-11~24/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java --- openjdk-11-11~19/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/net/AbstractPlainSocketImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,6 +37,7 @@ import sun.net.ConnectionResetException; import sun.net.NetHooks; import sun.net.ResourceManager; +import sun.net.util.SocketExceptions; /** * Default Socket Implementation. This implementation does @@ -415,7 +416,7 @@ } } catch (IOException e) { close(); - throw e; + throw SocketExceptions.of(e, new InetSocketAddress(address, port)); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/net/InetAddress.java openjdk-11-11~24/src/java.base/share/classes/java/net/InetAddress.java --- openjdk-11-11~19/src/java.base/share/classes/java/net/InetAddress.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/net/InetAddress.java 2018-07-25 15:36:46.000000000 +0000 @@ -1709,7 +1709,7 @@ return (InetAddressImpl) impl; } - private void readObjectNoData (ObjectInputStream s) throws + private void readObjectNoData () throws IOException, ClassNotFoundException { if (getClass().getClassLoader() != null) { throw new SecurityException ("invalid address type"); diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/net/SocketPermission.java openjdk-11-11~24/src/java.base/share/classes/java/net/SocketPermission.java --- openjdk-11-11~19/src/java.base/share/classes/java/net/SocketPermission.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/net/SocketPermission.java 2018-07-25 15:36:46.000000000 +0000 @@ -675,9 +675,21 @@ private transient String cdomain, hdomain; + /** + * previously we allowed domain names to be specified in IDN ACE form + * Need to check for that and convert to Unicode + */ + private static String checkForIDN(String name) { + if (name.startsWith("xn--") || name.contains(".xn--")) { + return IDN.toUnicode(name); + } else { + return name; + } + } + private boolean match(String cname, String hname) { - String a = cname.toLowerCase(); - String b = hname.toLowerCase(); + String a = checkForIDN(cname.toLowerCase()); + String b = checkForIDN(hname.toLowerCase()); if (a.startsWith(b) && ((a.length() == b.length()) || (a.charAt(b.length()) == '.'))) { return true; diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/net/SocksSocketImpl.java openjdk-11-11~24/src/java.base/share/classes/java/net/SocksSocketImpl.java --- openjdk-11-11~19/src/java.base/share/classes/java/net/SocksSocketImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/net/SocksSocketImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import java.security.AccessController; import java.security.PrivilegedAction; import java.security.PrivilegedExceptionAction; + +import jdk.internal.util.StaticProperty; import sun.net.SocksProxy; import sun.net.spi.DefaultProxySelector; import sun.net.www.ParseUtil; -import sun.security.action.GetPropertyAction; /* import org.ietf.jgss.*; */ /** @@ -178,7 +179,7 @@ userName = pw.getUserName(); password = new String(pw.getPassword()); } else { - userName = GetPropertyAction.privilegedGetProperty("user.name"); + userName = StaticProperty.userName(); } if (userName == null) return false; @@ -1088,7 +1089,7 @@ userName = System.getProperty("user.name"); } catch (SecurityException se) { /* swallow Exception */ } } else { - userName = GetPropertyAction.privilegedGetProperty("user.name"); + userName = StaticProperty.userName(); } return userName; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/nio/Bits.java openjdk-11-11~24/src/java.base/share/classes/java/nio/Bits.java --- openjdk-11-11~19/src/java.base/share/classes/java/nio/Bits.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/nio/Bits.java 2018-07-25 15:36:46.000000000 +0000 @@ -207,43 +207,24 @@ assert cnt >= 0 && reservedMem >= 0 && totalCap >= 0; } - // -- Monitoring of direct buffer usage -- - - static { - // setup access to this package in SharedSecrets - SharedSecrets.setJavaNioAccess( - new JavaNioAccess() { - @Override - public JavaNioAccess.BufferPool getDirectBufferPool() { - return new JavaNioAccess.BufferPool() { - @Override - public String getName() { - return "direct"; - } - @Override - public long getCount() { - return Bits.COUNT.get(); - } - @Override - public long getTotalCapacity() { - return Bits.TOTAL_CAPACITY.get(); - } - @Override - public long getMemoryUsed() { - return Bits.RESERVED_MEMORY.get(); - } - }; - } - @Override - public ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) { - return new DirectByteBuffer(addr, cap, ob); - } - @Override - public void truncate(Buffer buf) { - buf.truncate(); - } - }); - } + static final JavaNioAccess.BufferPool BUFFER_POOL = new JavaNioAccess.BufferPool() { + @Override + public String getName() { + return "direct"; + } + @Override + public long getCount() { + return Bits.COUNT.get(); + } + @Override + public long getTotalCapacity() { + return Bits.TOTAL_CAPACITY.get(); + } + @Override + public long getMemoryUsed() { + return Bits.RESERVED_MEMORY.get(); + } + }; // These numbers represent the point at which we have empirically // determined that the average cost of a JNI call exceeds the expense diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/nio/Buffer.java openjdk-11-11~24/src/java.base/share/classes/java/nio/Buffer.java --- openjdk-11-11~19/src/java.base/share/classes/java/nio/Buffer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/nio/Buffer.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,8 @@ package java.nio; import jdk.internal.HotSpotIntrinsicCandidate; +import jdk.internal.misc.JavaNioAccess; +import jdk.internal.misc.SharedSecrets; import jdk.internal.misc.Unsafe; import java.util.Spliterator; @@ -707,4 +709,23 @@ throw new IndexOutOfBoundsException(); } + static { + // setup access to this package in SharedSecrets + SharedSecrets.setJavaNioAccess( + new JavaNioAccess() { + @Override + public JavaNioAccess.BufferPool getDirectBufferPool() { + return Bits.BUFFER_POOL; + } + @Override + public ByteBuffer newDirectByteBuffer(long addr, int cap, Object ob) { + return new DirectByteBuffer(addr, cap, ob); + } + @Override + public void truncate(Buffer buf) { + buf.truncate(); + } + }); + } + } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/nio/BufferMismatch.java openjdk-11-11~24/src/java.base/share/classes/java/nio/BufferMismatch.java --- openjdk-11-11~19/src/java.base/share/classes/java/nio/BufferMismatch.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/nio/BufferMismatch.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,6 +34,8 @@ static int mismatch(ByteBuffer a, int aOff, ByteBuffer b, int bOff, int length) { int i = 0; if (length > 7) { + if (a.get(aOff) != b.get(bOff)) + return 0; i = ArraysSupport.vectorizedMismatch( a.base(), a.address + aOff, b.base(), b.address + bOff, @@ -56,6 +58,8 @@ // (order is null) then the slow path is taken if (length > 3 && a.charRegionOrder() == b.charRegionOrder() && a.charRegionOrder() != null && b.charRegionOrder() != null) { + if (a.get(aOff) != b.get(bOff)) + return 0; i = ArraysSupport.vectorizedMismatch( a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_CHAR_INDEX_SCALE), b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_CHAR_INDEX_SCALE), @@ -74,6 +78,8 @@ static int mismatch(ShortBuffer a, int aOff, ShortBuffer b, int bOff, int length) { int i = 0; if (length > 3 && a.order() == b.order()) { + if (a.get(aOff) != b.get(bOff)) + return 0; i = ArraysSupport.vectorizedMismatch( a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_SHORT_INDEX_SCALE), b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_SHORT_INDEX_SCALE), @@ -92,6 +98,8 @@ static int mismatch(IntBuffer a, int aOff, IntBuffer b, int bOff, int length) { int i = 0; if (length > 1 && a.order() == b.order()) { + if (a.get(aOff) != b.get(bOff)) + return 0; i = ArraysSupport.vectorizedMismatch( a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_INT_INDEX_SCALE), b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_INT_INDEX_SCALE), @@ -110,11 +118,13 @@ static int mismatch(FloatBuffer a, int aOff, FloatBuffer b, int bOff, int length) { int i = 0; if (length > 1 && a.order() == b.order()) { - i = ArraysSupport.vectorizedMismatch( - a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE), - b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE), - length, - ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE); + if (Float.floatToRawIntBits(a.get(aOff)) == Float.floatToRawIntBits(b.get(bOff))) { + i = ArraysSupport.vectorizedMismatch( + a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE), + b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE), + length, + ArraysSupport.LOG2_ARRAY_FLOAT_INDEX_SCALE); + } // Mismatched if (i >= 0) { // Check if mismatch is not associated with two NaN values; and @@ -146,6 +156,8 @@ static int mismatch(LongBuffer a, int aOff, LongBuffer b, int bOff, int length) { int i = 0; if (length > 0 && a.order() == b.order()) { + if (a.get(aOff) != b.get(bOff)) + return 0; i = ArraysSupport.vectorizedMismatch( a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_LONG_INDEX_SCALE), b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_LONG_INDEX_SCALE), @@ -163,11 +175,13 @@ static int mismatch(DoubleBuffer a, int aOff, DoubleBuffer b, int bOff, int length) { int i = 0; if (length > 0 && a.order() == b.order()) { - i = ArraysSupport.vectorizedMismatch( - a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE), - b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE), - length, - ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE); + if (Double.doubleToRawLongBits(a.get(aOff)) == Double.doubleToRawLongBits(b.get(bOff))) { + i = ArraysSupport.vectorizedMismatch( + a.base(), a.address + (aOff << ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE), + b.base(), b.address + (bOff << ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE), + length, + ArraysSupport.LOG2_ARRAY_DOUBLE_INDEX_SCALE); + } // Mismatched if (i >= 0) { // Check if mismatch is not associated with two NaN values; and diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java openjdk-11-11~24/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java --- openjdk-11-11~19/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/nio/channels/AsynchronousFileChannel.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -301,8 +301,13 @@ public static AsynchronousFileChannel open(Path file, OpenOption... options) throws IOException { - Set<OpenOption> set = new HashSet<>(options.length); - Collections.addAll(set, options); + Set<OpenOption> set; + if (options.length == 0) { + set = Collections.emptySet(); + } else { + set = new HashSet<>(); + Collections.addAll(set, options); + } return open(file, set, null, NO_ATTRIBUTES); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/nio/channels/FileChannel.java openjdk-11-11~24/src/java.base/share/classes/java/nio/channels/FileChannel.java --- openjdk-11-11~19/src/java.base/share/classes/java/nio/channels/FileChannel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/nio/channels/FileChannel.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -335,8 +335,13 @@ public static FileChannel open(Path path, OpenOption... options) throws IOException { - Set<OpenOption> set = new HashSet<>(options.length); - Collections.addAll(set, options); + Set<OpenOption> set; + if (options.length == 0) { + set = Collections.emptySet(); + } else { + set = new HashSet<>(); + Collections.addAll(set, options); + } return open(path, set, NO_ATTRIBUTES); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/nio/file/Files.java openjdk-11-11~24/src/java.base/share/classes/java/nio/file/Files.java --- openjdk-11-11~19/src/java.base/share/classes/java/nio/file/Files.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/nio/file/Files.java 2018-07-25 15:36:46.000000000 +0000 @@ -77,6 +77,7 @@ import java.util.stream.Stream; import java.util.stream.StreamSupport; +import sun.nio.ch.FileChannelImpl; import sun.nio.fs.AbstractFileSystemProvider; /** @@ -410,8 +411,13 @@ public static SeekableByteChannel newByteChannel(Path path, OpenOption... options) throws IOException { - Set<OpenOption> set = new HashSet<>(options.length); - Collections.addAll(set, options); + Set<OpenOption> set; + if (options.length == 0) { + set = Collections.emptySet(); + } else { + set = new HashSet<>(); + Collections.addAll(set, options); + } return newByteChannel(path, set); } @@ -599,6 +605,9 @@ // -- Creation and deletion -- + private static final Set<OpenOption> DEFAULT_CREATE_OPTIONS = + Set.of(StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE); + /** * Creates a new and empty file, failing if the file already exists. The * check for the existence of the file and the creation of the new file if @@ -635,9 +644,7 @@ public static Path createFile(Path path, FileAttribute<?>... attrs) throws IOException { - EnumSet<StandardOpenOption> options = - EnumSet.<StandardOpenOption>of(StandardOpenOption.CREATE_NEW, StandardOpenOption.WRITE); - newByteChannel(path, options, attrs).close(); + newByteChannel(path, DEFAULT_CREATE_OPTIONS, attrs).close(); return path; } @@ -3197,10 +3204,11 @@ public static byte[] readAllBytes(Path path) throws IOException { try (SeekableByteChannel sbc = Files.newByteChannel(path); InputStream in = Channels.newInputStream(sbc)) { + if (sbc instanceof FileChannelImpl) + ((FileChannelImpl) sbc).setUninterruptible(); long size = sbc.size(); - if (size > (long)MAX_BUFFER_SIZE) + if (size > (long) MAX_BUFFER_SIZE) throw new OutOfMemoryError("Required array size too large"); - return read(in, (int)size); } } @@ -3273,11 +3281,7 @@ Objects.requireNonNull(cs); byte[] ba = readAllBytes(path); - try { - return JLA.newStringNoRepl(ba, cs); - } catch (IllegalArgumentException e) { - throw new IOException(e); - } + return JLA.newStringNoRepl(ba, cs); } /** @@ -3628,12 +3632,8 @@ Objects.requireNonNull(csq); Objects.requireNonNull(cs); - try { - byte[] bytes = JLA.getBytesNoRepl(String.valueOf(csq), cs); - write(path, bytes, options); - } catch (IllegalArgumentException e) { - throw new IOException(e); - } + byte[] bytes = JLA.getBytesNoRepl(String.valueOf(csq), cs); + write(path, bytes, options); return path; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java openjdk-11-11~24/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java --- openjdk-11-11~19/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/nio/file/spi/FileSystemProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,18 +25,54 @@ package java.nio.file.spi; -import java.nio.file.*; -import java.nio.file.attribute.*; -import java.nio.channels.*; +import java.nio.channels.AsynchronousFileChannel; +import java.nio.channels.Channels; +import java.nio.channels.FileChannel; +import java.nio.channels.ReadableByteChannel; +import java.nio.channels.SeekableByteChannel; +import java.nio.channels.WritableByteChannel; +import java.nio.file.AccessDeniedException; +import java.nio.file.AccessMode; +import java.nio.file.AtomicMoveNotSupportedException; +import java.nio.file.CopyOption; +import java.nio.file.DirectoryNotEmptyException; +import java.nio.file.DirectoryStream; +import java.nio.file.FileAlreadyExistsException; +import java.nio.file.FileStore; +import java.nio.file.FileSystem; +import java.nio.file.FileSystemAlreadyExistsException; +import java.nio.file.FileSystemNotFoundException; +import java.nio.file.FileSystems; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.LinkPermission; +import java.nio.file.NoSuchFileException; +import java.nio.file.NotDirectoryException; +import java.nio.file.NotLinkException; +import java.nio.file.OpenOption; +import java.nio.file.Path; +import java.nio.file.StandardOpenOption; import java.net.URI; import java.io.InputStream; import java.io.OutputStream; import java.io.IOException; -import java.util.*; +import java.nio.file.attribute.BasicFileAttributes; +import java.nio.file.attribute.FileAttribute; +import java.nio.file.attribute.FileAttributeView; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.ServiceConfigurationError; +import java.util.ServiceLoader; +import java.util.Set; import java.util.concurrent.ExecutorService; import java.security.AccessController; import java.security.PrivilegedAction; +import sun.nio.ch.FileChannelImpl; + /** * Service-provider class for file systems. The methods defined by the {@link * java.nio.file.Files} class will typically delegate to an instance of this @@ -381,9 +417,17 @@ throw new UnsupportedOperationException("'" + opt + "' not allowed"); } } - return Channels.newInputStream(Files.newByteChannel(path, options)); + ReadableByteChannel rbc = Files.newByteChannel(path, options); + if (rbc instanceof FileChannelImpl) { + ((FileChannelImpl) rbc).setUninterruptible(); + } + return Channels.newInputStream(rbc); } + private static final Set<OpenOption> DEFAULT_OPEN_OPTIONS = + Set.of(StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING, + StandardOpenOption.WRITE); + /** * Opens or creates a file, returning an output stream that may be used to * write bytes to the file. This method works in exactly the manner @@ -419,19 +463,23 @@ throws IOException { int len = options.length; - Set<OpenOption> opts = new HashSet<>(len + 3); + Set<OpenOption> opts ; if (len == 0) { - opts.add(StandardOpenOption.CREATE); - opts.add(StandardOpenOption.TRUNCATE_EXISTING); + opts = DEFAULT_OPEN_OPTIONS; } else { + opts = new HashSet<>(); for (OpenOption opt: options) { if (opt == StandardOpenOption.READ) throw new IllegalArgumentException("READ not allowed"); opts.add(opt); } + opts.add(StandardOpenOption.WRITE); + } + WritableByteChannel wbc = newByteChannel(path, opts); + if (wbc instanceof FileChannelImpl) { + ((FileChannelImpl) wbc).setUninterruptible(); } - opts.add(StandardOpenOption.WRITE); - return Channels.newOutputStream(newByteChannel(path, opts)); + return Channels.newOutputStream(wbc); } /** diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/security/KeyStore.java openjdk-11-11~24/src/java.base/share/classes/java/security/KeyStore.java --- openjdk-11-11~19/src/java.base/share/classes/java/security/KeyStore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/security/KeyStore.java 2018-07-25 15:36:46.000000000 +0000 @@ -1807,6 +1807,7 @@ keystore.load(dataStream, password); } else { keystore.keyStoreSpi.engineLoad(dataStream, param); + keystore.initialized = true; } return keystore; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/security/Security.java openjdk-11-11~24/src/java.base/share/classes/java/security/Security.java --- openjdk-11-11~19/src/java.base/share/classes/java/security/Security.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/security/Security.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ import java.net.URL; import jdk.internal.misc.SharedSecrets; +import jdk.internal.util.StaticProperty; import sun.security.util.Debug; import sun.security.util.PropertyExpander; @@ -214,7 +215,7 @@ // maybe check for a system property which will specify where to // look. Someday. String sep = File.separator; - return new File(System.getProperty("java.home") + sep + "conf" + sep + + return new File(StaticProperty.javaHome() + sep + "conf" + sep + "security" + sep + filename); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/security/Signature.java openjdk-11-11~24/src/java.base/share/classes/java/security/Signature.java --- openjdk-11-11~19/src/java.base/share/classes/java/security/Signature.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/security/Signature.java 2018-07-25 15:36:46.000000000 +0000 @@ -700,7 +700,7 @@ * encoded or of the wrong type, if this signature algorithm is unable to * process the input data provided, etc. * @exception IllegalArgumentException if the {@code signature} - * byte array is null, or the {@code offset} or {@code length} + * byte array is {@code null}, or the {@code offset} or {@code length} * is less than 0, or the sum of the {@code offset} and * {@code length} is greater than the length of the * {@code signature} byte array. @@ -897,14 +897,15 @@ /** * Returns the parameters used with this signature object. * - * <p>The returned parameters may be the same that were used to initialize - * this signature, or may contain a combination of default and randomly - * generated parameter values used by the underlying signature - * implementation if this signature requires algorithm parameters but - * was not initialized with any. + * <p> If this signature has been previously initialized with parameters + * (by calling the {@code setParameter} method), this method returns + * the same parameters. If this signature has not been initialized with + * parameters, this method may return a combination of default and + * randomly generated parameter values if the underlying + * signature implementation supports it and can successfully generate + * them. Otherwise, {@code null} is returned. * - * @return the parameters used with this signature, or null if this - * signature does not use any parameters. + * @return the parameters used with this signature, or {@code null} * * @see #setParameter(AlgorithmParameterSpec) * @since 1.4 @@ -925,7 +926,7 @@ * * @param param the string name of the parameter. * - * @return the object that represents the parameter value, or null if + * @return the object that represents the parameter value, or {@code null} if * there is none. * * @exception InvalidParameterException if {@code param} is an invalid diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/security/SignatureSpi.java openjdk-11-11~24/src/java.base/share/classes/java/security/SignatureSpi.java --- openjdk-11-11~19/src/java.base/share/classes/java/security/SignatureSpi.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/security/SignatureSpi.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -326,18 +326,18 @@ } /** - * <p>This method is overridden by providers to return the - * parameters used with this signature engine, or null - * if this signature engine does not use any parameters. - * - * <p>The returned parameters may be the same that were used to initialize - * this signature engine, or may contain a combination of default and - * randomly generated parameter values used by the underlying signature - * implementation if this signature engine requires algorithm parameters - * but was not initialized with any. + * <p>This method is overridden by providers to return the parameters + * used with this signature engine. * - * @return the parameters used with this signature engine, or null if this - * signature engine does not use any parameters + * <p> If this signature engine has been previously initialized with + * parameters (by calling the {@code engineSetParameter} method), this + * method returns the same parameters. If this signature engine has not been + * initialized with parameters, this method may return a combination of + * default and randomly generated parameter values if the underlying + * signature implementation supports it and can successfully generate + * them. Otherwise, {@code null} is returned. + * + * @return the parameters used with this signature engine, or {@code null} * * @exception UnsupportedOperationException if this method is * not overridden by a provider @@ -360,7 +360,7 @@ * * @param param the string name of the parameter. * - * @return the object that represents the parameter value, or null if + * @return the object that represents the parameter value, or {@code null} if * there is none. * * @exception InvalidParameterException if {@code param} is an diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java openjdk-11-11~24/src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java --- openjdk-11-11~19/src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/time/zone/TzdbZoneRulesProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -61,19 +61,19 @@ */ package java.time.zone; +import jdk.internal.util.StaticProperty; + import java.io.ByteArrayInputStream; import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; -import java.io.IOException; import java.io.StreamCorruptedException; import java.util.Arrays; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.NavigableMap; -import java.util.Objects; import java.util.Set; import java.util.TreeMap; import java.util.concurrent.ConcurrentHashMap; @@ -106,7 +106,7 @@ */ public TzdbZoneRulesProvider() { try { - String libDir = System.getProperty("java.home") + File.separator + "lib"; + String libDir = StaticProperty.javaHome() + File.separator + "lib"; try (DataInputStream dis = new DataInputStream( new BufferedInputStream(new FileInputStream( new File(libDir, "tzdb.dat"))))) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/Base64.java openjdk-11-11~24/src/java.base/share/classes/java/util/Base64.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/Base64.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/Base64.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ import java.io.OutputStream; import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; +import jdk.internal.HotSpotIntrinsicCandidate; /** * This class consists exclusively of static methods for obtaining @@ -390,6 +391,20 @@ return new Encoder(isURL, newline, linemax, false); } + @HotSpotIntrinsicCandidate + private void encodeBlock(byte[] src, int sp, int sl, byte[] dst, int dp, boolean isURL) { + char[] base64 = isURL ? toBase64URL : toBase64; + for (int sp0 = sp, dp0 = dp ; sp0 < sl; ) { + int bits = (src[sp0++] & 0xff) << 16 | + (src[sp0++] & 0xff) << 8 | + (src[sp0++] & 0xff); + dst[dp0++] = (byte)base64[(bits >>> 18) & 0x3f]; + dst[dp0++] = (byte)base64[(bits >>> 12) & 0x3f]; + dst[dp0++] = (byte)base64[(bits >>> 6) & 0x3f]; + dst[dp0++] = (byte)base64[bits & 0x3f]; + } + } + private int encode0(byte[] src, int off, int end, byte[] dst) { char[] base64 = isURL ? toBase64URL : toBase64; int sp = off; @@ -400,15 +415,7 @@ int dp = 0; while (sp < sl) { int sl0 = Math.min(sp + slen, sl); - for (int sp0 = sp, dp0 = dp ; sp0 < sl0; ) { - int bits = (src[sp0++] & 0xff) << 16 | - (src[sp0++] & 0xff) << 8 | - (src[sp0++] & 0xff); - dst[dp0++] = (byte)base64[(bits >>> 18) & 0x3f]; - dst[dp0++] = (byte)base64[(bits >>> 12) & 0x3f]; - dst[dp0++] = (byte)base64[(bits >>> 6) & 0x3f]; - dst[dp0++] = (byte)base64[bits & 0x3f]; - } + encodeBlock(src, sp, sl0, dst, dp, isURL); int dlen = (sl0 - sp) / 3 * 4; dp += dlen; sp = sl0; diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/Collection.java openjdk-11-11~24/src/java.base/share/classes/java/util/Collection.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/Collection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/Collection.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ package java.util; +import java.util.function.IntFunction; import java.util.function.Predicate; import java.util.stream.Stream; import java.util.stream.StreamSupport; @@ -276,8 +277,12 @@ * allocate a new array even if this collection is backed by an array). * The caller is thus free to modify the returned array. * - * <p>This method acts as bridge between array-based and collection-based - * APIs. + * @apiNote + * This method acts as a bridge between array-based and collection-based APIs. + * It returns an array whose runtime type is {@code Object[]}. + * Use {@link #toArray(Object[]) toArray(T[])} to reuse an existing + * array, or use {@link #toArray(IntFunction)} to control the runtime type + * of the array. * * @return an array, whose {@linkplain Class#getComponentType runtime component * type} is {@code Object}, containing all of the elements in this collection @@ -302,19 +307,27 @@ * are returned by its iterator, this method must return the elements in * the same order. * - * <p>Like the {@link #toArray()} method, this method acts as bridge between - * array-based and collection-based APIs. Further, this method allows - * precise control over the runtime type of the output array, and may, - * under certain circumstances, be used to save allocation costs. + * @apiNote + * This method acts as a bridge between array-based and collection-based APIs. + * It allows an existing array to be reused under certain circumstances. + * Use {@link #toArray()} to create an array whose runtime type is {@code Object[]}, + * or use {@link #toArray(IntFunction)} to control the runtime type of + * the array. * * <p>Suppose {@code x} is a collection known to contain only strings. - * The following code can be used to dump the collection into a newly - * allocated array of {@code String}: + * The following code can be used to dump the collection into a previously + * allocated {@code String} array: * * <pre> - * String[] y = x.toArray(new String[0]);</pre> + * String[] y = new String[SIZE]; + * ... + * y = x.toArray(y);</pre> + * + * <p>The return value is reassigned to the variable {@code y}, because a + * new array will be allocated and returned if the collection {@code x} has + * too many elements to fit into the existing array {@code y}. * - * Note that {@code toArray(new Object[0])} is identical in function to + * <p>Note that {@code toArray(new Object[0])} is identical in function to * {@code toArray()}. * * @param <T> the component type of the array to contain the collection @@ -329,6 +342,45 @@ */ <T> T[] toArray(T[] a); + /** + * Returns an array containing all of the elements in this collection, + * using the provided {@code generator} function to allocate the returned array. + * + * <p>If this collection makes any guarantees as to what order its elements + * are returned by its iterator, this method must return the elements in + * the same order. + * + * @apiNote + * This method acts as a bridge between array-based and collection-based APIs. + * It allows creation of an array of a particular runtime type. Use + * {@link #toArray()} to create an array whose runtime type is {@code Object[]}, + * or use {@link #toArray(Object[]) toArray(T[])} to reuse an existing array. + * + * <p>Suppose {@code x} is a collection known to contain only strings. + * The following code can be used to dump the collection into a newly + * allocated array of {@code String}: + * + * <pre> + * String[] y = x.toArray(String[]::new);</pre> + * + * @implSpec + * The default implementation calls the generator function with zero + * and then passes the resulting array to {@link #toArray(Object[]) toArray(T[])}. + * + * @param <T> the component type of the array to contain the collection + * @param generator a function which produces a new array of the desired + * type and the provided length + * @return an array containing all of the elements in this collection + * @throws ArrayStoreException if the runtime type of any element in this + * collection is not assignable to the {@linkplain Class#getComponentType + * runtime component type} of the generated array + * @throws NullPointerException if the generator function is null + * @since 11 + */ + default <T> T[] toArray(IntFunction<T[]> generator) { + return toArray(generator.apply(0)); + } + // Modification Operations /** diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/Collections.java openjdk-11-11~24/src/java.base/share/classes/java/util/Collections.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/Collections.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/Collections.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,6 +33,7 @@ import java.util.function.BiFunction; import java.util.function.Consumer; import java.util.function.Function; +import java.util.function.IntFunction; import java.util.function.Predicate; import java.util.function.UnaryOperator; import java.util.stream.IntStream; @@ -1028,12 +1029,13 @@ this.c = c; } - public int size() {return c.size();} - public boolean isEmpty() {return c.isEmpty();} - public boolean contains(Object o) {return c.contains(o);} - public Object[] toArray() {return c.toArray();} - public <T> T[] toArray(T[] a) {return c.toArray(a);} - public String toString() {return c.toString();} + public int size() {return c.size();} + public boolean isEmpty() {return c.isEmpty();} + public boolean contains(Object o) {return c.contains(o);} + public Object[] toArray() {return c.toArray();} + public <T> T[] toArray(T[] a) {return c.toArray(a);} + public <T> T[] toArray(IntFunction<T[]> f) {return c.toArray(f);} + public String toString() {return c.toString();} public Iterator<E> iterator() { return new Iterator<E>() { @@ -1567,7 +1569,8 @@ super((Set)s); } - static <K, V> Consumer<Map.Entry<K, V>> entryConsumer(Consumer<? super Entry<K, V>> action) { + static <K, V> Consumer<Map.Entry<? extends K, ? extends V>> entryConsumer( + Consumer<? super Entry<K, V>> action) { return e -> action.accept(new UnmodifiableEntry<>(e)); } @@ -1659,6 +1662,9 @@ public void remove() { throw new UnsupportedOperationException(); } + public void forEachRemaining(Consumer<? super Map.Entry<K, V>> action) { + i.forEachRemaining(entryConsumer(action)); + } }; } @@ -2020,6 +2026,9 @@ public <T> T[] toArray(T[] a) { synchronized (mutex) {return c.toArray(a);} } + public <T> T[] toArray(IntFunction<T[]> f) { + synchronized (mutex) {return c.toArray(f);} + } public Iterator<E> iterator() { return c.iterator(); // Must be manually synched by user! @@ -3049,14 +3058,15 @@ this.type = Objects.requireNonNull(type, "type"); } - public int size() { return c.size(); } - public boolean isEmpty() { return c.isEmpty(); } - public boolean contains(Object o) { return c.contains(o); } - public Object[] toArray() { return c.toArray(); } - public <T> T[] toArray(T[] a) { return c.toArray(a); } - public String toString() { return c.toString(); } - public boolean remove(Object o) { return c.remove(o); } - public void clear() { c.clear(); } + public int size() { return c.size(); } + public boolean isEmpty() { return c.isEmpty(); } + public boolean contains(Object o) { return c.contains(o); } + public Object[] toArray() { return c.toArray(); } + public <T> T[] toArray(T[] a) { return c.toArray(a); } + public <T> T[] toArray(IntFunction<T[]> f) { return c.toArray(f); } + public String toString() { return c.toString(); } + public boolean remove(Object o) { return c.remove(o); } + public void clear() { c.clear(); } public boolean containsAll(Collection<?> coll) { return c.containsAll(coll); @@ -3075,7 +3085,11 @@ return new Iterator<E>() { public boolean hasNext() { return it.hasNext(); } public E next() { return it.next(); } - public void remove() { it.remove(); }}; + public void remove() { it.remove(); } + public void forEachRemaining(Consumer<? super E> action) { + it.forEachRemaining(action); + } + }; } public boolean add(E e) { return c.add(typeCheck(e)); } @@ -3751,7 +3765,6 @@ public Iterator<Map.Entry<K,V>> iterator() { final Iterator<Map.Entry<K, V>> i = s.iterator(); - final Class<V> valueType = this.valueType; return new Iterator<Map.Entry<K,V>>() { public boolean hasNext() { return i.hasNext(); } @@ -3760,6 +3773,11 @@ public Map.Entry<K,V> next() { return checkedEntry(i.next(), valueType); } + + public void forEachRemaining(Consumer<? super Entry<K, V>> action) { + i.forEachRemaining( + e -> action.accept(checkedEntry(e, valueType))); + } }; } @@ -5559,25 +5577,26 @@ implements Queue<E>, Serializable { private static final long serialVersionUID = 1802017725587941708L; private final Deque<E> q; - AsLIFOQueue(Deque<E> q) { this.q = q; } - public boolean add(E e) { q.addFirst(e); return true; } - public boolean offer(E e) { return q.offerFirst(e); } - public E poll() { return q.pollFirst(); } - public E remove() { return q.removeFirst(); } - public E peek() { return q.peekFirst(); } - public E element() { return q.getFirst(); } - public void clear() { q.clear(); } - public int size() { return q.size(); } - public boolean isEmpty() { return q.isEmpty(); } - public boolean contains(Object o) { return q.contains(o); } - public boolean remove(Object o) { return q.remove(o); } - public Iterator<E> iterator() { return q.iterator(); } - public Object[] toArray() { return q.toArray(); } - public <T> T[] toArray(T[] a) { return q.toArray(a); } - public String toString() { return q.toString(); } - public boolean containsAll(Collection<?> c) {return q.containsAll(c);} - public boolean removeAll(Collection<?> c) {return q.removeAll(c);} - public boolean retainAll(Collection<?> c) {return q.retainAll(c);} + AsLIFOQueue(Deque<E> q) { this.q = q; } + public boolean add(E e) { q.addFirst(e); return true; } + public boolean offer(E e) { return q.offerFirst(e); } + public E poll() { return q.pollFirst(); } + public E remove() { return q.removeFirst(); } + public E peek() { return q.peekFirst(); } + public E element() { return q.getFirst(); } + public void clear() { q.clear(); } + public int size() { return q.size(); } + public boolean isEmpty() { return q.isEmpty(); } + public boolean contains(Object o) { return q.contains(o); } + public boolean remove(Object o) { return q.remove(o); } + public Iterator<E> iterator() { return q.iterator(); } + public Object[] toArray() { return q.toArray(); } + public <T> T[] toArray(T[] a) { return q.toArray(a); } + public <T> T[] toArray(IntFunction<T[]> f) { return q.toArray(f); } + public String toString() { return q.toString(); } + public boolean containsAll(Collection<?> c) { return q.containsAll(c); } + public boolean removeAll(Collection<?> c) { return q.removeAll(c); } + public boolean retainAll(Collection<?> c) { return q.retainAll(c); } // We use inherited addAll; forwarding addAll would be wrong // Override default methods in Collection diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/ComparableTimSort.java openjdk-11-11~24/src/java.base/share/classes/java/util/ComparableTimSort.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/ComparableTimSort.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/ComparableTimSort.java 2018-07-25 15:36:46.000000000 +0000 @@ -305,7 +305,7 @@ * @param a the array in which a run is to be counted and possibly reversed * @param lo index of the first element in the run * @param hi index after the last element that may be contained in the run. - It is required that {@code lo < hi}. + * It is required that {@code lo < hi}. * @return the length of the run beginning at the specified position in * the specified array */ @@ -394,19 +394,23 @@ * This method is called each time a new run is pushed onto the stack, * so the invariants are guaranteed to hold for i < stackSize upon * entry to the method. + * + * Thanks to Stijn de Gouw, Jurriaan Rot, Frank S. de Boer, + * Richard Bubel and Reiner Hahnle, this is fixed with respect to + * the analysis in "On the Worst-Case Complexity of TimSort" by + * Nicolas Auger, Vincent Jug, Cyril Nicaud, and Carine Pivoteau. */ private void mergeCollapse() { while (stackSize > 1) { int n = stackSize - 2; - if (n > 0 && runLen[n-1] <= runLen[n] + runLen[n+1]) { + if (n > 0 && runLen[n-1] <= runLen[n] + runLen[n+1] || + n > 1 && runLen[n-2] <= runLen[n] + runLen[n-1]) { if (runLen[n - 1] < runLen[n + 1]) n--; - mergeAt(n); - } else if (runLen[n] <= runLen[n + 1]) { - mergeAt(n); - } else { + } else if (n < 0 || runLen[n] > runLen[n + 1]) { break; // Invariant is established } + mergeAt(n); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/ArrayBlockingQueue.java 2018-07-25 15:36:46.000000000 +0000 @@ -1129,7 +1129,7 @@ final int len = items.length; // how far takeIndex has advanced since the previous // operation of this iterator - long dequeues = (cycles - prevCycles) * len + long dequeues = (long) (cycles - prevCycles) * len + (takeIndex - prevTakeIndex); // Check indices for invalidation diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/ConcurrentHashMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -702,12 +702,7 @@ * See Hackers Delight, sec 3.2 */ private static final int tableSizeFor(int c) { - int n = c - 1; - n |= n >>> 1; - n |= n >>> 2; - n |= n >>> 4; - n |= n >>> 8; - n |= n >>> 16; + int n = -1 >>> Integer.numberOfLeadingZeros(c - 1); return (n < 0) ? 1 : (n >= MAXIMUM_CAPACITY) ? MAXIMUM_CAPACITY : n + 1; } @@ -844,12 +839,7 @@ * elements is negative */ public ConcurrentHashMap(int initialCapacity) { - if (initialCapacity < 0) - throw new IllegalArgumentException(); - int cap = ((initialCapacity >= (MAXIMUM_CAPACITY >>> 1)) ? - MAXIMUM_CAPACITY : - tableSizeFor(initialCapacity + (initialCapacity >>> 1) + 1)); - this.sizeCtl = cap; + this(initialCapacity, LOAD_FACTOR, 1); } /** @@ -883,8 +873,8 @@ /** * Creates a new, empty map with an initial table size based on - * the given number of elements ({@code initialCapacity}), table - * density ({@code loadFactor}), and number of concurrently + * the given number of elements ({@code initialCapacity}), initial + * table density ({@code loadFactor}), and number of concurrently * updating threads ({@code concurrencyLevel}). * * @param initialCapacity the initial capacity. The implementation @@ -1473,13 +1463,9 @@ if (size == 0L) sizeCtl = 0; else { - int n; - if (size >= (long)(MAXIMUM_CAPACITY >>> 1)) - n = MAXIMUM_CAPACITY; - else { - int sz = (int)size; - n = tableSizeFor(sz + (sz >>> 1) + 1); - } + long ts = (long)(1.0 + size / LOAD_FACTOR); + int n = (ts >= (long)MAXIMUM_CAPACITY) ? + MAXIMUM_CAPACITY : tableSizeFor((int)ts); @SuppressWarnings("unchecked") Node<K,V>[] tab = (Node<K,V>[])new Node<?,?>[n]; int mask = n - 1; diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/ConcurrentSkipListMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -1764,9 +1764,7 @@ } return true; } - } catch (ClassCastException unused) { - return false; - } catch (NullPointerException unused) { + } catch (ClassCastException | NullPointerException unused) { return false; } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/CopyOnWriteArrayList.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,6 +34,7 @@ package java.util.concurrent; +import java.lang.invoke.VarHandle; import java.lang.reflect.Field; import java.util.Arrays; import java.util.Collection; @@ -299,6 +300,9 @@ CopyOnWriteArrayList<E> clone = (CopyOnWriteArrayList<E>) super.clone(); clone.resetLock(); + // Unlike in readObject, here we cannot visibility-piggyback on the + // volatile write in setArray(). + VarHandle.releaseFence(); return clone; } catch (CloneNotSupportedException e) { // this shouldn't happen, since we are Cloneable diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java 2018-07-25 15:36:46.000000000 +0000 @@ -826,7 +826,7 @@ */ public static <T extends ForkJoinTask<?>> Collection<T> invokeAll(Collection<T> tasks) { if (!(tasks instanceof RandomAccess) || !(tasks instanceof List<?>)) { - invokeAll(tasks.toArray(new ForkJoinTask<?>[tasks.size()])); + invokeAll(tasks.toArray(new ForkJoinTask<?>[0])); return tasks; } @SuppressWarnings("unchecked") diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/locks/Condition.java openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/locks/Condition.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/locks/Condition.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/locks/Condition.java 2018-07-25 15:36:46.000000000 +0000 @@ -312,13 +312,13 @@ * <pre> {@code * boolean aMethod(long timeout, TimeUnit unit) * throws InterruptedException { - * long nanos = unit.toNanos(timeout); + * long nanosRemaining = unit.toNanos(timeout); * lock.lock(); * try { * while (!conditionBeingWaitedFor()) { - * if (nanos <= 0L) + * if (nanosRemaining <= 0L) * return false; - * nanos = theCondition.awaitNanos(nanos); + * nanosRemaining = theCondition.awaitNanos(nanosRemaining); * } * // ... * return true; diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/TimeUnit.java openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/TimeUnit.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/concurrent/TimeUnit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/concurrent/TimeUnit.java 2018-07-25 15:36:46.000000000 +0000 @@ -202,6 +202,10 @@ * {@code unit.convert(Duration.of(n, unit.toChronoUnit()))} * is equivalent to {@code n} (in the absence of overflow). * + * @apiNote + * This method differs from {@link Duration#toNanos()} in that it + * does not throw {@link ArithmeticException} on numeric overflow. + * * @param duration the time duration * @return the converted duration in this unit, * or {@code Long.MIN_VALUE} if conversion would negatively overflow, @@ -216,7 +220,7 @@ if (secs < 0 && nano > 0) { // use representation compatible with integer division secs++; - nano -= SECOND_SCALE; + nano -= (int) SECOND_SCALE; } final long s, nanoVal; // Optimize for the common case - NANOSECONDS without overflow diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/Currency.java openjdk-11-11~24/src/java.base/share/classes/java/util/Currency.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/Currency.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/Currency.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,6 +42,8 @@ import java.util.regex.Matcher; import java.util.spi.CurrencyNameProvider; import java.util.stream.Collectors; + +import jdk.internal.util.StaticProperty; import sun.util.locale.provider.CalendarDataUtility; import sun.util.locale.provider.LocaleServiceProviderPool; import sun.util.logging.PlatformLogger; @@ -236,7 +238,7 @@ // look for the properties file for overrides String propsFile = System.getProperty("java.util.currency.data"); if (propsFile == null) { - propsFile = System.getProperty("java.home") + File.separator + "lib" + + propsFile = StaticProperty.javaHome() + File.separator + "lib" + File.separator + "currency.properties"; } try { @@ -578,7 +580,7 @@ /** * Returns the 3 digit ISO 4217 numeric code of this currency as a {@code String}. - * Unlike {@link getNumericCode()}, which returns the numeric code as {@code int}, + * Unlike {@link #getNumericCode()}, which returns the numeric code as {@code int}, * this method always returns the numeric code as a 3 digit string. * e.g. a numeric value of 32 would be returned as "032", * and a numeric value of 6 would be returned as "006". diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/ImmutableCollections.java openjdk-11-11~24/src/java.base/share/classes/java/util/ImmutableCollections.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/ImmutableCollections.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/ImmutableCollections.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -83,6 +83,16 @@ // ---------- List Implementations ---------- + // make a copy, short-circuiting based on implementation class + @SuppressWarnings("unchecked") + static <E> List<E> listCopy(Collection<? extends E> coll) { + if (coll instanceof AbstractImmutableList && coll.getClass() != SubList.class) { + return (List<E>)coll; + } else { + return (List<E>)List.of(coll.toArray()); + } + } + @SuppressWarnings("unchecked") static <E> List<E> emptyList() { return (List<E>) ListN.EMPTY_LIST; @@ -203,16 +213,23 @@ @Stable private final int size; + @Stable + private final boolean isListIterator; + private int cursor; ListItr(List<E> list, int size) { - this(list, size, 0); + this.list = list; + this.size = size; + this.cursor = 0; + isListIterator = false; } ListItr(List<E> list, int size, int index) { this.list = list; this.size = size; this.cursor = index; + isListIterator = true; } public boolean hasNext() { @@ -235,10 +252,16 @@ } public boolean hasPrevious() { + if (!isListIterator) { + throw uoe(); + } return cursor != 0; } public E previous() { + if (!isListIterator) { + throw uoe(); + } try { int i = cursor - 1; E previous = list.get(i); @@ -250,10 +273,16 @@ } public int nextIndex() { + if (!isListIterator) { + throw uoe(); + } return cursor; } public int previousIndex() { + if (!isListIterator) { + throw uoe(); + } return cursor - 1; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/List.java openjdk-11-11~24/src/java.base/share/classes/java/util/List.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/List.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/List.java 2018-07-25 15:36:46.000000000 +0000 @@ -1057,12 +1057,7 @@ * @throws NullPointerException if coll is null, or if it contains any nulls * @since 10 */ - @SuppressWarnings("unchecked") static <E> List<E> copyOf(Collection<? extends E> coll) { - if (coll instanceof ImmutableCollections.AbstractImmutableList) { - return (List<E>)coll; - } else { - return (List<E>)List.of(coll.toArray()); - } + return ImmutableCollections.listCopy(coll); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java openjdk-11-11~24/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/regex/PatternSyntaxException.java 2018-07-25 15:36:46.000000000 +0000 @@ -106,7 +106,7 @@ } sb.append(System.lineSeparator()); sb.append(pattern); - if (index >= 0) { + if (index >= 0 && pattern != null && index < pattern.length()) { sb.append(System.lineSeparator()); for (int i = 0; i < index; i++) sb.append(' '); sb.append('^'); diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/TimeZone.java openjdk-11-11~24/src/java.base/share/classes/java/util/TimeZone.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/TimeZone.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/TimeZone.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,10 +39,9 @@ package java.util; import java.io.Serializable; -import java.security.AccessController; -import java.security.PrivilegedAction; import java.time.ZoneId; -import java.util.Properties; + +import jdk.internal.util.StaticProperty; import sun.security.action.GetPropertyAction; import sun.util.calendar.ZoneInfo; import sun.util.calendar.ZoneInfoFile; @@ -667,7 +666,7 @@ // if the time zone ID is not set (yet), perform the // platform to Java time zone ID mapping. if (zoneID == null || zoneID.isEmpty()) { - String javaHome = props.getProperty("java.home"); + String javaHome = StaticProperty.javaHome(); try { zoneID = getSystemTimeZoneID(javaHome); if (zoneID == null) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/java/util/TimSort.java openjdk-11-11~24/src/java.base/share/classes/java/util/TimSort.java --- openjdk-11-11~19/src/java.base/share/classes/java/util/TimSort.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/java/util/TimSort.java 2018-07-25 15:36:46.000000000 +0000 @@ -339,7 +339,7 @@ * @param a the array in which a run is to be counted and possibly reversed * @param lo index of the first element in the run * @param hi index after the last element that may be contained in the run. - It is required that {@code lo < hi}. + * It is required that {@code lo < hi}. * @param c the comparator to used for the sort * @return the length of the run beginning at the specified position in * the specified array @@ -429,19 +429,23 @@ * This method is called each time a new run is pushed onto the stack, * so the invariants are guaranteed to hold for i < stackSize upon * entry to the method. + * + * Thanks to Stijn de Gouw, Jurriaan Rot, Frank S. de Boer, + * Richard Bubel and Reiner Hahnle, this is fixed with respect to + * the analysis in "On the Worst-Case Complexity of TimSort" by + * Nicolas Auger, Vincent Jug, Cyril Nicaud, and Carine Pivoteau. */ private void mergeCollapse() { while (stackSize > 1) { int n = stackSize - 2; - if (n > 0 && runLen[n-1] <= runLen[n] + runLen[n+1]) { + if (n > 0 && runLen[n-1] <= runLen[n] + runLen[n+1] || + n > 1 && runLen[n-2] <= runLen[n] + runLen[n-1]) { if (runLen[n - 1] < runLen[n + 1]) n--; - mergeAt(n); - } else if (runLen[n] <= runLen[n + 1]) { - mergeAt(n); - } else { + } else if (n < 0 || runLen[n] > runLen[n + 1]) { break; // Invariant is established } + mergeAt(n); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/javax/crypto/Cipher.java openjdk-11-11~24/src/java.base/share/classes/javax/crypto/Cipher.java --- openjdk-11-11~19/src/java.base/share/classes/javax/crypto/Cipher.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/javax/crypto/Cipher.java 2018-07-25 15:36:46.000000000 +0000 @@ -2739,7 +2739,7 @@ // Input sanity check if ((src == null) || (offset < 0) || (len < 0) - || ((len + offset) > src.length)) { + || len > (src.length - offset)) { throw new IllegalArgumentException("Bad arguments"); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/javax/crypto/JceSecurity.java.template openjdk-11-11~24/src/java.base/share/classes/javax/crypto/JceSecurity.java.template --- openjdk-11-11~19/src/java.base/share/classes/javax/crypto/JceSecurity.java.template 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/javax/crypto/JceSecurity.java.template 2018-07-25 15:36:46.000000000 +0000 @@ -57,6 +57,8 @@ import java.security.Provider.Service; +import jdk.internal.util.StaticProperty; + import sun.security.jca.*; import sun.security.jca.GetInstance.Instance; import sun.security.util.Debug; @@ -71,8 +73,8 @@ */ final class JceSecurity { - - + + private static final Debug debug = Debug.getInstance("jca"); static final SecureRandom RANDOM = new SecureRandom(); @@ -307,7 +309,7 @@ // Prepend java.home to get the full path. normalize() in // case an extra "." or ".." snuck in somehow. - String javaHomeProperty = System.getProperty("java.home"); + String javaHomeProperty = StaticProperty.javaHome(); Path javaHomePolicyPath = Paths.get(javaHomeProperty, "conf", "security", "policy").normalize(); Path cryptoPolicyPath = Paths.get(javaHomeProperty, "conf", "security", diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/loader/BootLoader.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/loader/BootLoader.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/loader/BootLoader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/loader/BootLoader.java 2018-07-25 15:36:46.000000000 +0000 @@ -44,7 +44,9 @@ import jdk.internal.misc.JavaLangAccess; import jdk.internal.misc.SharedSecrets; +import jdk.internal.module.Modules; import jdk.internal.module.ServicesCatalog; +import jdk.internal.util.StaticProperty; /** * Find resources and packages in modules defined to the boot class loader or @@ -56,7 +58,7 @@ // The unnamed module for the boot loader private static final Module UNNAMED_MODULE; - private static final String JAVA_HOME = System.getProperty("java.home"); + private static final String JAVA_HOME = StaticProperty.javaHome(); static { UNNAMED_MODULE = SharedSecrets.getJavaLangAccess().defineUnnamedModule(null); @@ -249,15 +251,16 @@ } } + // return the Module object for the module name. The Module may + // in the boot layer or a child layer for the case that the module + // is loaded into a running VM if (mn != null) { - // named module from runtime image or exploded module - Optional<Module> om = ModuleLayer.boot().findModule(mn); - if (!om.isPresent()) - throw new InternalError(mn + " not in boot layer"); - return om.get(); + String name = mn; + return Modules.findLoadedModule(mn) + .orElseThrow(() -> new InternalError(name + " not loaded")); + } else { + return null; } - - return null; } /** diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/misc/JavaLangAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,6 +30,7 @@ import java.lang.reflect.Executable; import java.lang.reflect.Method; import java.net.URI; +import java.nio.charset.CharacterCodingException; import java.nio.charset.Charset; import java.security.AccessControlContext; import java.security.ProtectionDomain; @@ -266,9 +267,9 @@ * @param bytes the byte array source * @param cs the Charset * @return the newly created string - * @throws IllegalArgumentException for malformed or unmappable bytes + * @throws CharacterCodingException for malformed or unmappable bytes */ - String newStringNoRepl(byte[] bytes, Charset cs); + String newStringNoRepl(byte[] bytes, Charset cs) throws CharacterCodingException; /** * Encode the given string into a sequence of bytes using the specified Charset. @@ -276,15 +277,15 @@ * This method avoids copying the String's internal representation if the input * is ASCII. * - * This method throws IllegalArgumentException instead of replacing when + * This method throws CharacterCodingException instead of replacing when * malformed input or unmappable characters are encountered. * * @param s the string to encode * @param cs the charset * @return the encoded bytes - * @throws IllegalArgumentException for malformed input or unmappable characters + * @throws CharacterCodingException for malformed input or unmappable characters */ - byte[] getBytesNoRepl(String s, Charset cs); + byte[] getBytesNoRepl(String s, Charset cs) throws CharacterCodingException; /** * Returns a new string by decoding from the given utf8 bytes array. diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/misc/SharedSecrets.java 2018-07-25 15:36:46.000000000 +0000 @@ -194,10 +194,9 @@ public static JavaNioAccess getJavaNioAccess() { if (javaNioAccess == null) { - // Ensure java.nio.ByteOrder is initialized; we know that - // this class initializes java.nio.Bits that provides the + // Ensure java.nio.Buffer is initialized, which provides the // shared secret. - unsafe.ensureClassInitialized(java.nio.ByteOrder.class); + unsafe.ensureClassInitialized(java.nio.Buffer.class); } return javaNioAccess; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/misc/TerminatingThreadLocal.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/misc/TerminatingThreadLocal.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/misc/TerminatingThreadLocal.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/misc/TerminatingThreadLocal.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.internal.misc; + +import java.util.Collection; +import java.util.Collections; +import java.util.IdentityHashMap; + +/** + * A thread-local variable that is notified when a thread terminates and + * it has been initialized in the terminating thread (even if it was + * initialized with a null value). + */ +public class TerminatingThreadLocal<T> extends ThreadLocal<T> { + + @Override + public void set(T value) { + super.set(value); + register(this); + } + + @Override + public void remove() { + super.remove(); + unregister(this); + } + + /** + * Invoked by a thread when terminating and this thread-local has an associated + * value for the terminating thread (even if that value is null), so that any + * native resources maintained by the value can be released. + * + * @param value current thread's value of this thread-local variable + * (may be null but only if null value was explicitly initialized) + */ + protected void threadTerminated(T value) { + } + + // following methods and field are implementation details and should only be + // called from the corresponding code int Thread/ThreadLocal class. + + /** + * Invokes the TerminatingThreadLocal's {@link #threadTerminated()} method + * on all instances registered in current thread. + */ + public static void threadTerminated() { + for (TerminatingThreadLocal<?> ttl : REGISTRY.get()) { + ttl._threadTerminated(); + } + } + + private void _threadTerminated() { threadTerminated(get()); } + + /** + * Register given TerminatingThreadLocal + * + * @param tl the ThreadLocal to register + */ + public static void register(TerminatingThreadLocal<?> tl) { + REGISTRY.get().add(tl); + } + + /** + * Unregister given TerminatingThreadLocal + * + * @param tl the ThreadLocal to unregister + */ + private static void unregister(TerminatingThreadLocal<?> tl) { + REGISTRY.get().remove(tl); + } + + /** + * a per-thread registry of TerminatingThreadLocal(s) that have been registered + * but later not unregistered in a particular thread. + */ + public static final ThreadLocal<Collection<TerminatingThreadLocal<?>>> REGISTRY = + new ThreadLocal<>() { + @Override + protected Collection<TerminatingThreadLocal<?>> initialValue() { + return Collections.newSetFromMap(new IdentityHashMap<>(4)); + } + }; +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/DefaultRoots.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/DefaultRoots.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/DefaultRoots.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/DefaultRoots.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,13 +22,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package jdk.internal.module; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleFinder; import java.lang.module.ModuleReference; -import java.util.HashSet; import java.util.Set; +import java.util.stream.Collectors; /** * Defines methods to compute the default set of root modules for the unnamed @@ -36,58 +37,45 @@ */ public final class DefaultRoots { - private static final String JAVA_SE = "java.se"; - private DefaultRoots() { } /** - * Returns the default set of root modules for the unnamed module computed from - * the system modules observable with the given module finder. + * Returns the default set of root modules for the unnamed module from the + * modules observable with the intersection of two module finders. + * + * The first module finder should be the module finder that finds modules on + * the upgrade module path or among the system modules. The second module + * finder should be the module finder that finds all modules on the module + * path, or a subset of when using --limit-modules. */ - static Set<String> compute(ModuleFinder systemModuleFinder, ModuleFinder finder) { - Set<String> roots = new HashSet<>(); - - boolean hasJava = false; - if (systemModuleFinder.find(JAVA_SE).isPresent()) { - if (finder == systemModuleFinder || finder.find(JAVA_SE).isPresent()) { - // java.se is a system module - hasJava = true; - roots.add(JAVA_SE); - } - } - - for (ModuleReference mref : systemModuleFinder.findAll()) { - String mn = mref.descriptor().name(); - if (hasJava && mn.startsWith("java.")) { - // not a root - continue; - } - - if (ModuleResolution.doNotResolveByDefault(mref)) { - // not a root - continue; - } - - if ((finder == systemModuleFinder || finder.find(mn).isPresent())) { - // add as root if exports at least one package to all modules - ModuleDescriptor descriptor = mref.descriptor(); - for (ModuleDescriptor.Exports e : descriptor.exports()) { - if (!e.isQualified()) { - roots.add(mn); - break; - } - } - } - } - - return roots; + static Set<String> compute(ModuleFinder finder1, ModuleFinder finder2) { + return finder1.findAll().stream() + .filter(mref -> !ModuleResolution.doNotResolveByDefault(mref)) + .map(ModuleReference::descriptor) + .filter(descriptor -> finder2.find(descriptor.name()).isPresent() + && exportsAPI(descriptor)) + .map(ModuleDescriptor::name) + .collect(Collectors.toSet()); } /** * Returns the default set of root modules for the unnamed module from the * modules observable with the given module finder. + * + * This method is used by the jlink system modules plugin. */ public static Set<String> compute(ModuleFinder finder) { return compute(finder, finder); } + + /** + * Returns true if the given module exports a package to all modules + */ + private static boolean exportsAPI(ModuleDescriptor descriptor) { + return descriptor.exports() + .stream() + .filter(e -> !e.isQualified()) + .findAny() + .isPresent(); + } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java 2018-07-25 15:36:46.000000000 +0000 @@ -136,7 +136,7 @@ /** * Initialize the module system, returning the boot layer. * - * @see java.lang.System#initPhase2() + * @see java.lang.System#initPhase2(boolean, boolean) */ public static ModuleLayer boot() throws Exception { @@ -213,11 +213,13 @@ Counters.add("jdk.module.boot.2.defineBaseTime", t2); - // Step 2a: If --validate-modules is specified then the VM needs to - // start with only system modules, all other options are ignored. + // Step 2a: Scan all modules when --validate-modules specified if (getAndRemoveProperty("jdk.module.validation") != null) { - return createBootLayerForValidation(); + int errors = ModulePathValidator.scanAllModules(System.out); + if (errors > 0) { + fail("Validation of module path failed"); + } } @@ -278,11 +280,10 @@ // If there is no initial module specified then assume that the initial // module is the unnamed module of the application class loader. This - // is implemented by resolving "java.se" and all (non-java.*) modules - // that export an API. If "java.se" is not observable then all java.* - // modules are resolved. Modules that have the DO_NOT_RESOLVE_BY_DEFAULT - // bit set in their ModuleResolution attribute flags are excluded from - // the default set of roots. + // is implemented by resolving all observable modules that export an + // API. Modules that have the DO_NOT_RESOLVE_BY_DEFAULT bit set in + // their ModuleResolution attribute flags are excluded from the + // default set of roots. if (mainModule == null || addAllDefaultModules) { roots.addAll(DefaultRoots.compute(systemModuleFinder, finder)); } @@ -420,26 +421,6 @@ } /** - * Create a boot module layer for validation that resolves all - * system modules. - */ - private static ModuleLayer createBootLayerForValidation() { - Set<String> allSystem = ModuleFinder.ofSystem().findAll() - .stream() - .map(ModuleReference::descriptor) - .map(ModuleDescriptor::name) - .collect(Collectors.toSet()); - - Configuration cf = SharedSecrets.getJavaLangModuleAccess() - .resolveAndBind(ModuleFinder.ofSystem(), - allSystem, - null); - - Function<String, ClassLoader> clf = ModuleLoaderMap.mappingFunction(cf); - return ModuleLayer.empty().defineModules(cf, clf); - } - - /** * Load/register the modules to the built-in class loaders. */ private static void loadModules(Configuration cf, diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/ModulePathValidator.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/ModulePathValidator.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/ModulePathValidator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/ModulePathValidator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,254 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.internal.module; + +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; +import java.lang.module.FindException; +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; +import java.net.URI; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.NoSuchFileException; +import java.nio.file.Path; +import java.nio.file.attribute.BasicFileAttributes; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Stream; + +/** + * A validator to check for errors and conflicts between modules. + */ + +class ModulePathValidator { + private static final String MODULE_INFO = "module-info.class"; + private static final String INDENT = " "; + + private final Map<String, ModuleReference> nameToModule; + private final Map<String, ModuleReference> packageToModule; + private final PrintStream out; + + private int errorCount; + + private ModulePathValidator(PrintStream out) { + this.nameToModule = new HashMap<>(); + this.packageToModule = new HashMap<>(); + this.out = out; + } + + /** + * Scans and the validates all modules on the module path. The module path + * comprises the upgrade module path, system modules, and the application + * module path. + * + * @param out the print stream for output messages + * @return the number of errors found + */ + static int scanAllModules(PrintStream out) { + ModulePathValidator validator = new ModulePathValidator(out); + + // upgrade module path + String value = System.getProperty("jdk.module.upgrade.path"); + if (value != null) { + Stream.of(value.split(File.pathSeparator)) + .map(Path::of) + .forEach(validator::scan); + } + + // system modules + ModuleFinder.ofSystem().findAll().stream() + .sorted(Comparator.comparing(ModuleReference::descriptor)) + .forEach(validator::process); + + // application module path + value = System.getProperty("jdk.module.path"); + if (value != null) { + Stream.of(value.split(File.pathSeparator)) + .map(Path::of) + .forEach(validator::scan); + } + + return validator.errorCount; + } + + /** + * Prints the module location and name. + */ + private void printModule(ModuleReference mref) { + mref.location() + .filter(uri -> !isJrt(uri)) + .ifPresent(uri -> out.print(uri + " ")); + ModuleDescriptor descriptor = mref.descriptor(); + out.print(descriptor.name()); + if (descriptor.isAutomatic()) + out.print(" automatic"); + out.println(); + } + + /** + * Prints the module location and name, checks if the module is + * shadowed by a previously seen module, and finally checks for + * package conflicts with previously seen modules. + */ + private void process(ModuleReference mref) { + String name = mref.descriptor().name(); + ModuleReference previous = nameToModule.putIfAbsent(name, mref); + if (previous != null) { + printModule(mref); + out.print(INDENT + "shadowed by "); + printModule(previous); + } else { + boolean first = true; + + // check for package conflicts when not shadowed + for (String pkg : mref.descriptor().packages()) { + previous = packageToModule.putIfAbsent(pkg, mref); + if (previous != null) { + if (first) { + printModule(mref); + first = false; + errorCount++; + } + String mn = previous.descriptor().name(); + out.println(INDENT + "contains " + pkg + + " conflicts with module " + mn); + } + } + } + } + + /** + * Scan an element on a module path. The element is a directory + * of modules, an exploded module, or a JAR file. + */ + private void scan(Path entry) { + BasicFileAttributes attrs; + try { + attrs = Files.readAttributes(entry, BasicFileAttributes.class); + } catch (NoSuchFileException ignore) { + return; + } catch (IOException ioe) { + out.println(entry + " " + ioe); + errorCount++; + return; + } + + String fn = entry.getFileName().toString(); + if (attrs.isRegularFile() && fn.endsWith(".jar")) { + // JAR file, explicit or automatic module + scanModule(entry).ifPresent(this::process); + } else if (attrs.isDirectory()) { + Path mi = entry.resolve(MODULE_INFO); + if (Files.exists(mi)) { + // exploded module + scanModule(entry).ifPresent(this::process); + } else { + // directory of modules + scanDirectory(entry); + } + } + } + + /** + * Scan the JAR files and exploded modules in a directory. + */ + private void scanDirectory(Path dir) { + try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) { + Map<String, Path> moduleToEntry = new HashMap<>(); + + for (Path entry : stream) { + BasicFileAttributes attrs; + try { + attrs = Files.readAttributes(entry, BasicFileAttributes.class); + } catch (IOException ioe) { + out.println(entry + " " + ioe); + errorCount++; + continue; + } + + ModuleReference mref = null; + + String fn = entry.getFileName().toString(); + if (attrs.isRegularFile() && fn.endsWith(".jar")) { + mref = scanModule(entry).orElse(null); + } else if (attrs.isDirectory()) { + Path mi = entry.resolve(MODULE_INFO); + if (Files.exists(mi)) { + mref = scanModule(entry).orElse(null); + } + } + + if (mref != null) { + String name = mref.descriptor().name(); + Path previous = moduleToEntry.putIfAbsent(name, entry); + if (previous != null) { + // same name as other module in the directory + printModule(mref); + out.println(INDENT + "contains same module as " + + previous.getFileName()); + errorCount++; + } else { + process(mref); + } + } + } + } catch (IOException ioe) { + out.println(dir + " " + ioe); + errorCount++; + } + } + + /** + * Scan a JAR file or exploded module. + */ + private Optional<ModuleReference> scanModule(Path entry) { + ModuleFinder finder = ModuleFinder.of(entry); + try { + return finder.findAll().stream().findFirst(); + } catch (FindException e) { + out.println(entry); + out.println(INDENT + e.getMessage()); + Throwable cause = e.getCause(); + if (cause != null) { + out.println(INDENT + cause); + } + errorCount++; + return Optional.empty(); + } + } + + /** + * Returns true if the given URI is a jrt URI + */ + private static boolean isJrt(URI uri) { + return (uri != null && uri.getScheme().equalsIgnoreCase("jrt")); + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/Modules.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/Modules.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/Modules.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/Modules.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,6 +35,7 @@ import java.security.PrivilegedAction; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; @@ -249,7 +250,19 @@ } - // the top-most system layer - private static ModuleLayer topLayer; + /** + * Finds the module with the given name in the boot layer or any child + * layers created to load the "java.instrument" or "jdk.management.agent" + * modules into a running VM. + */ + public static Optional<Module> findLoadedModule(String name) { + ModuleLayer top = topLayer; + if (top == null) + top = ModuleLayer.boot(); + return top.findModule(name); + } + + // the top-most layer + private static volatile ModuleLayer topLayer; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/module/SystemModuleFinders.java 2018-07-25 15:36:46.000000000 +0000 @@ -61,6 +61,7 @@ import jdk.internal.jimage.ImageReaderFactory; import jdk.internal.misc.JavaNetUriAccess; import jdk.internal.misc.SharedSecrets; +import jdk.internal.util.StaticProperty; import jdk.internal.module.ModuleHashes.HashSupplier; /** @@ -183,7 +184,7 @@ } // probe to see if this is an images build - String home = System.getProperty("java.home"); + String home = StaticProperty.javaHome(); Path modules = Path.of(home, "lib", "modules"); if (Files.isRegularFile(modules)) { if (USE_FAST_PATH) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Attribute.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Attribute.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Attribute.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/org/objectweb/asm/Attribute.java 2018-07-25 15:36:46.000000000 +0000 @@ -58,6 +58,8 @@ */ package jdk.internal.org.objectweb.asm; +import java.util.Arrays; + /** * A non standard class, field, method or code attribute. * @@ -281,4 +283,72 @@ attr = attr.next; } } + + //The stuff below is temporary - once proper support for nestmate attribute has been added, it can be safely removed. + //see also changes in ClassReader.accept. + + public static class NestMembers extends Attribute { + public NestMembers() { + super("NestMembers"); + } + + byte[] bytes; + String[] classes; + + @Override + protected Attribute read(ClassReader cr, int off, int len, char[] buf, int codeOff, Label[] labels) { + int offset = off; + NestMembers a = new NestMembers(); + int size = cr.readShort(off); + a.classes = new String[size]; + off += 2; + for (int i = 0; i < size ; i++) { + a.classes[i] = cr.readClass(off, buf); + off += 2; + } + a.bytes = Arrays.copyOfRange(cr.b, offset, offset + len); + return a; + } + + @Override + protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) { + ByteVector v = new ByteVector(bytes.length); + v.putShort(classes.length); + for (String s : classes) { + v.putShort(cw.newClass(s)); + } + return v; + } + } + + public static class NestHost extends Attribute { + + byte[] bytes; + String clazz; + + public NestHost() { + super("NestHost"); + } + + @Override + protected Attribute read(ClassReader cr, int off, int len, char[] buf, int codeOff, Label[] labels) { + int offset = off; + NestHost a = new NestHost(); + a.clazz = cr.readClass(off, buf); + a.bytes = Arrays.copyOfRange(cr.b, offset, offset + len); + return a; + } + + @Override + protected ByteVector write(ClassWriter cw, byte[] code, int len, int maxStack, int maxLocals) { + ByteVector v = new ByteVector(bytes.length); + v.putShort(cw.newClass(clazz)); + return v; + } + } + + static final Attribute[] DEFAULT_ATTRIBUTE_PROTOS = new Attribute[] { + new NestMembers(), + new NestHost() + }; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/org/objectweb/asm/ClassReader.java 2018-07-25 15:36:46.000000000 +0000 @@ -530,7 +530,7 @@ * , {@link #SKIP_FRAMES}, {@link #SKIP_CODE}. */ public void accept(final ClassVisitor classVisitor, final int flags) { - accept(classVisitor, new Attribute[0], flags); + accept(classVisitor, Attribute.DEFAULT_ATTRIBUTE_PROTOS, flags); } /** diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/reflect/MethodAccessorGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -629,14 +629,10 @@ typeSizeInStackSlots(returnType)); } else { if (isInterface()) { - if (isPrivate()) { - cb.opc_invokespecial(targetMethodRef, count, 0); - } else { - cb.opc_invokeinterface(targetMethodRef, - count, - count, - typeSizeInStackSlots(returnType)); - } + cb.opc_invokeinterface(targetMethodRef, + count, + count, + typeSizeInStackSlots(returnType)); } else { cb.opc_invokevirtual(targetMethodRef, count, diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/reflect/ReflectionFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,6 +87,9 @@ private static boolean noInflation = false; private static int inflationThreshold = 15; + // true if deserialization constructor checking is disabled + private static boolean disableSerialConstructorChecks = false; + private ReflectionFactory() { } @@ -424,10 +427,67 @@ return generateConstructor(cl, constructorToCall); } + /** + * Given a class, determines whether its superclass has + * any constructors that are accessible from the class. + * This is a special purpose method intended to do access + * checking for a serializable class and its superclasses + * up to, but not including, the first non-serializable + * superclass. This also implies that the superclass is + * always non-null, because a serializable class must be a + * class (not an interface) and Object is not serializable. + * + * @param cl the class from which access is checked + * @return whether the superclass has a constructor accessible from cl + */ + private boolean superHasAccessibleConstructor(Class<?> cl) { + Class<?> superCl = cl.getSuperclass(); + assert Serializable.class.isAssignableFrom(cl); + assert superCl != null; + if (packageEquals(cl, superCl)) { + // accessible if any non-private constructor is found + for (Constructor<?> ctor : superCl.getDeclaredConstructors()) { + if ((ctor.getModifiers() & Modifier.PRIVATE) == 0) { + return true; + } + } + if (Reflection.areNestMates(cl, superCl)) { + return true; + } + return false; + } else { + // sanity check to ensure the parent is protected or public + if ((superCl.getModifiers() & (Modifier.PROTECTED | Modifier.PUBLIC)) == 0) { + return false; + } + // accessible if any constructor is protected or public + for (Constructor<?> ctor : superCl.getDeclaredConstructors()) { + if ((ctor.getModifiers() & (Modifier.PROTECTED | Modifier.PUBLIC)) != 0) { + return true; + } + } + return false; + } + } + + /** + * Returns a constructor that allocates an instance of cl and that then initializes + * the instance by calling the no-arg constructor of its first non-serializable + * superclass. This is specified in the Serialization Specification, section 3.1, + * in step 11 of the deserialization process. If cl is not serializable, returns + * cl's no-arg constructor. If no accessible constructor is found, or if the + * class hierarchy is somehow malformed (e.g., a serializable class has no + * superclass), null is returned. + * + * @param cl the class for which a constructor is to be found + * @return the generated constructor, or null if none is available + */ public final Constructor<?> newConstructorForSerialization(Class<?> cl) { Class<?> initCl = cl; while (Serializable.class.isAssignableFrom(initCl)) { - if ((initCl = initCl.getSuperclass()) == null) { + Class<?> prev = initCl; + if ((initCl = initCl.getSuperclass()) == null || + (!disableSerialConstructorChecks && !superHasAccessibleConstructor(prev))) { return null; } } @@ -653,6 +713,9 @@ } } + disableSerialConstructorChecks = + "true".equals(props.getProperty("jdk.disableSerialConstructorChecks")); + initted = true; } @@ -675,8 +738,14 @@ * @returns true if the two classes are in the same classloader and package */ private static boolean packageEquals(Class<?> cl1, Class<?> cl2) { + assert !cl1.isArray() && !cl2.isArray(); + + if (cl1 == cl2) { + return true; + } + return cl1.getClassLoader() == cl2.getClassLoader() && - Objects.equals(cl1.getPackage(), cl2.getPackage()); + Objects.equals(cl1.getPackageName(), cl2.getPackageName()); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/reflect/Reflection.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/reflect/Reflection.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/reflect/Reflection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/reflect/Reflection.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -143,6 +143,15 @@ return true; } + // Check for nestmate access if member is private + if (Modifier.isPrivate(modifiers)) { + // Note: targetClass may be outside the nest, but that is okay + // as long as memberClass is in the nest. + if (areNestMates(currentClass, memberClass)) { + return true; + } + } + boolean successSoFar = false; if (Modifier.isProtected(modifiers)) { @@ -351,4 +360,12 @@ return new IllegalAccessException(msg); } + + /** + * Returns true if {@code currentClass} and {@code memberClass} + * are nestmates - that is, if they have the same nesthost as + * determined by the VM. + */ + public static native boolean areNestMates(Class<?> currentClass, + Class<?> memberClass); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/util/ArraysSupport.java 2018-07-25 15:36:46.000000000 +0000 @@ -166,6 +166,8 @@ int length) { int i = 0; if (length > 7) { + if (a[0] != b[0]) + return 0; i = vectorizedMismatch( a, Unsafe.ARRAY_BOOLEAN_BASE_OFFSET, b, Unsafe.ARRAY_BOOLEAN_BASE_OFFSET, @@ -186,6 +188,8 @@ int length) { int i = 0; if (length > 7) { + if (a[aFromIndex] != b[bFromIndex]) + return 0; int aOffset = Unsafe.ARRAY_BOOLEAN_BASE_OFFSET + aFromIndex; int bOffset = Unsafe.ARRAY_BOOLEAN_BASE_OFFSET + bFromIndex; i = vectorizedMismatch( @@ -228,6 +232,8 @@ int i = 0; if (length > 7) { + if (a[0] != b[0]) + return 0; i = vectorizedMismatch( a, Unsafe.ARRAY_BYTE_BASE_OFFSET, b, Unsafe.ARRAY_BYTE_BASE_OFFSET, @@ -275,6 +281,8 @@ int i = 0; if (length > 7) { + if (a[aFromIndex] != b[bFromIndex]) + return 0; int aOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET + aFromIndex; int bOffset = Unsafe.ARRAY_BYTE_BASE_OFFSET + bFromIndex; i = vectorizedMismatch( @@ -300,6 +308,8 @@ int length) { int i = 0; if (length > 3) { + if (a[0] != b[0]) + return 0; i = vectorizedMismatch( a, Unsafe.ARRAY_CHAR_BASE_OFFSET, b, Unsafe.ARRAY_CHAR_BASE_OFFSET, @@ -320,6 +330,8 @@ int length) { int i = 0; if (length > 3) { + if (a[aFromIndex] != b[bFromIndex]) + return 0; int aOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE); int bOffset = Unsafe.ARRAY_CHAR_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_CHAR_INDEX_SCALE); i = vectorizedMismatch( @@ -345,6 +357,8 @@ int length) { int i = 0; if (length > 3) { + if (a[0] != b[0]) + return 0; i = vectorizedMismatch( a, Unsafe.ARRAY_SHORT_BASE_OFFSET, b, Unsafe.ARRAY_SHORT_BASE_OFFSET, @@ -365,6 +379,8 @@ int length) { int i = 0; if (length > 3) { + if (a[aFromIndex] != b[bFromIndex]) + return 0; int aOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE); int bOffset = Unsafe.ARRAY_SHORT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_SHORT_INDEX_SCALE); i = vectorizedMismatch( @@ -390,6 +406,8 @@ int length) { int i = 0; if (length > 1) { + if (a[0] != b[0]) + return 0; i = vectorizedMismatch( a, Unsafe.ARRAY_INT_BASE_OFFSET, b, Unsafe.ARRAY_INT_BASE_OFFSET, @@ -410,6 +428,8 @@ int length) { int i = 0; if (length > 1) { + if (a[aFromIndex] != b[bFromIndex]) + return 0; int aOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_INT_INDEX_SCALE); int bOffset = Unsafe.ARRAY_INT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_INT_INDEX_SCALE); i = vectorizedMismatch( @@ -441,12 +461,14 @@ int length) { int i = 0; if (length > 1) { - int aOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE); - int bOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE); - i = vectorizedMismatch( - a, aOffset, - b, bOffset, - length, LOG2_ARRAY_FLOAT_INDEX_SCALE); + if (Float.floatToRawIntBits(a[aFromIndex]) == Float.floatToRawIntBits(b[bFromIndex])) { + int aOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE); + int bOffset = Unsafe.ARRAY_FLOAT_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_FLOAT_INDEX_SCALE); + i = vectorizedMismatch( + a, aOffset, + b, bOffset, + length, LOG2_ARRAY_FLOAT_INDEX_SCALE); + } // Mismatched if (i >= 0) { // Check if mismatch is not associated with two NaN values @@ -481,6 +503,8 @@ if (length == 0) { return -1; } + if (a[0] != b[0]) + return 0; int i = vectorizedMismatch( a, Unsafe.ARRAY_LONG_BASE_OFFSET, b, Unsafe.ARRAY_LONG_BASE_OFFSET, @@ -494,6 +518,8 @@ if (length == 0) { return -1; } + if (a[aFromIndex] != b[bFromIndex]) + return 0; int aOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE); int bOffset = Unsafe.ARRAY_LONG_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_LONG_INDEX_SCALE); int i = vectorizedMismatch( @@ -518,12 +544,15 @@ if (length == 0) { return -1; } - int aOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE); - int bOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE); - int i = vectorizedMismatch( - a, aOffset, - b, bOffset, - length, LOG2_ARRAY_DOUBLE_INDEX_SCALE); + int i = 0; + if (Double.doubleToRawLongBits(a[aFromIndex]) == Double.doubleToRawLongBits(b[bFromIndex])) { + int aOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (aFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE); + int bOffset = Unsafe.ARRAY_DOUBLE_BASE_OFFSET + (bFromIndex << LOG2_ARRAY_DOUBLE_INDEX_SCALE); + i = vectorizedMismatch( + a, aOffset, + b, bOffset, + length, LOG2_ARRAY_DOUBLE_INDEX_SCALE); + } if (i >= 0) { // Check if mismatch is not associated with two NaN values if (!Double.isNaN(a[aFromIndex + i]) || !Double.isNaN(b[bFromIndex + i])) diff -Nru openjdk-11-11~19/src/java.base/share/classes/jdk/internal/util/StaticProperty.java openjdk-11-11~24/src/java.base/share/classes/jdk/internal/util/StaticProperty.java --- openjdk-11-11~19/src/java.base/share/classes/jdk/internal/util/StaticProperty.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/jdk/internal/util/StaticProperty.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.internal.util; + +/** + * System Property access for internal use only. + * Read-only access to System property values initialized during Phase 1 + * are cached. Setting, clearing, or modifying the value using + * {@link System#setProperty) or {@link System#getProperties()} is ignored. + * <strong>{@link SecurityManager#checkPropertyAccess} is NOT checked + * in these access methods. The caller of these methods should take care to ensure + * that the returned property is not made accessible to untrusted code.</strong> + */ +public final class StaticProperty { + + // The class static initialization is triggered to initialize these final + // fields during init Phase 1 and before a security manager is set. + private static final String JAVA_HOME = initProperty("java.home"); + private static final String USER_HOME = initProperty("user.home"); + private static final String USER_DIR = initProperty("user.dir"); + private static final String USER_NAME = initProperty("user.name"); + + private StaticProperty() {} + + private static String initProperty(String key) { + String v = System.getProperty(key); + if (v == null) { + throw new InternalError("null property: " + key); + } + return v; + } + + /** + * Return the {@code java.home} system property. + * + * <strong>{@link SecurityManager#checkPropertyAccess} is NOT checked + * in this method. The caller of this method should take care to ensure + * that the returned property is not made accessible to untrusted code.</strong> + * + * @return the {@code java.home} system property + */ + public static String javaHome() { + return JAVA_HOME; + } + + /** + * Return the {@code user.home} system property. + * + * <strong>{@link SecurityManager#checkPropertyAccess} is NOT checked + * in this method. The caller of this method should take care to ensure + * that the returned property is not made accessible to untrusted code.</strong> + * + * @return the {@code user.home} system property + */ + public static String userHome() { + return USER_HOME; + } + + /** + * Return the {@code user.dir} system property. + * + * <strong>{@link SecurityManager#checkPropertyAccess} is NOT checked + * in this method. The caller of this method should take care to ensure + * that the returned property is not made accessible to untrusted code.</strong> + * + * @return the {@code user.dir} system property + */ + public static String userDir() { + return USER_DIR; + } + + /** + * Return the {@code user.name} system property. + * + * <strong>{@link SecurityManager#checkPropertyAccess} is NOT checked + * in this method. The caller of this method should take care to ensure + * that the returned property is not made accessible to untrusted code.</strong> + * + * @return the {@code user.name} system property + */ + public static String userName() { + return USER_NAME; + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/module-info.java openjdk-11-11~24/src/java.base/share/classes/module-info.java --- openjdk-11-11~19/src/java.base/share/classes/module-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/module-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -242,6 +242,7 @@ exports sun.nio.ch to java.management, jdk.crypto.cryptoki, + jdk.net, jdk.sctp, jdk.unsupported; exports sun.nio.cs to @@ -359,7 +360,6 @@ // JDK-internal service types uses jdk.internal.logger.DefaultLoggerFinder; - uses sun.security.ssl.ClientKeyExchangeService; uses sun.text.spi.JavaTimeDateTimePatternProvider; uses sun.util.spi.CalendarProvider; uses sun.util.locale.provider.LocaleDataMetaInfo; diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java openjdk-11-11~24/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java --- openjdk-11-11~19/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/invoke/util/VerifyAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,6 @@ private static final int PACKAGE_ALLOWED = java.lang.invoke.MethodHandles.Lookup.PACKAGE; private static final int PROTECTED_OR_PACKAGE_ALLOWED = (PACKAGE_ALLOWED|PROTECTED); private static final int ALL_ACCESS_MODES = (PUBLIC|PRIVATE|PROTECTED|PACKAGE_ONLY); - private static final boolean ALLOW_NESTMATE_ACCESS = false; /** * Evaluate the JVM linkage rules for access to the given method @@ -62,23 +61,29 @@ * the defining class should be passed for both arguments ({@code defc == refc}). * <h3>JVM Specification, 5.4.4 "Access Control"</h3> * A field or method R is accessible to a class or interface D if - * and only if any of the following conditions is true:<ul> - * <li>R is public. + * and only if any of the following is true: + * <ul> + * <li>R is public.</li> * <li>R is protected and is declared in a class C, and D is either - * a subclass of C or C itself. Furthermore, if R is not - * static, then the symbolic reference to R must contain a - * symbolic reference to a class T, such that T is either a - * subclass of D, a superclass of D or D itself. - * <li>R is either protected or has default access (that is, - * neither public nor protected nor private), and is declared - * by a class in the same runtime package as D. - * <li>R is private and is declared in D. + * a subclass of C or C itself. Furthermore, if R is not static, + * then the symbolic reference to R must contain a symbolic + * reference to a class T, such that T is either a subclass of D, + * a superclass of D, or D itself. + * <p>During verification, it was also required that, even if T is + * a superclass of D, the target reference of a protected instance + * field access or method invocation must be an instance of D or a + * subclass of D (4.10.1.8).</p></li> + * <li>R is either protected or has default access (that is, neither + * public nor protected nor private), and is declared by a class + * in the same run-time package as D.</li> + * <li>R is private and is declared in D by a class or interface + * belonging to the same nest as D.</li> * </ul> - * This discussion of access control omits a related restriction - * on the target of a protected field access or method invocation - * (the target must be of class D or a subtype of D). That - * requirement is checked as part of the verification process - * (5.4.1); it is not part of link-time access control. + * If a referenced field or method is not accessible, access checking + * throws an IllegalAccessError. If an exception is thrown while + * attempting to determine the nest host of a class or interface, + * access checking fails for the same reason. + * * @param refc the class used in the symbolic reference to the proposed member * @param defc the class in which the proposed member is actually defined * @param mods modifier flags for the proposed member @@ -98,9 +103,10 @@ return false; } // Usually refc and defc are the same, but verify defc also in case they differ. - if (defc == lookupClass && + if (defc == lookupClass && (allowedModes & PRIVATE) != 0) - return true; // easy check; all self-access is OK + return true; // easy check; all self-access is OK with a private lookup + switch (mods & ALL_ACCESS_MODES) { case PUBLIC: return true; // already checked above @@ -126,10 +132,13 @@ return ((allowedModes & PACKAGE_ALLOWED) != 0 && isSamePackage(defc, lookupClass)); case PRIVATE: - // Loosened rules for privates follows access rules for inner classes. - return (ALLOW_NESTMATE_ACCESS && - (allowedModes & PRIVATE) != 0 && - isSamePackageMember(defc, lookupClass)); + // Rules for privates follows access rules for nestmates. + boolean canAccess = ((allowedModes & PRIVATE) != 0 && + Reflection.areNestMates(defc, lookupClass)); + // for private methods the selected method equals the + // resolved method - so refc == defc + assert (canAccess && refc == defc) || !canAccess; + return canAccess; default: throw new IllegalArgumentException("bad modifiers: "+Modifier.toString(mods)); } @@ -324,7 +333,6 @@ * @return whether they are in the same package */ public static boolean isSamePackage(Class<?> class1, Class<?> class2) { - assert(!class1.isArray() && !class2.isArray()); if (class1 == class2) return true; if (class1.getClassLoader() != class2.getClassLoader()) diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/launcher/LauncherHelper.java openjdk-11-11~24/src/java.base/share/classes/sun/launcher/LauncherHelper.java --- openjdk-11-11~19/src/java.base/share/classes/sun/launcher/LauncherHelper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/launcher/LauncherHelper.java 2018-07-25 15:36:46.000000000 +0000 @@ -44,7 +44,6 @@ import java.io.PrintStream; import java.io.UnsupportedEncodingException; import java.lang.module.Configuration; -import java.lang.module.FindException; import java.lang.module.ModuleDescriptor; import java.lang.module.ModuleDescriptor.Requires; import java.lang.module.ModuleDescriptor.Exports; @@ -62,21 +61,16 @@ import java.nio.charset.Charset; import java.nio.file.DirectoryStream; import java.nio.file.Files; -import java.nio.file.NoSuchFileException; import java.nio.file.Path; -import java.nio.file.Paths; -import java.nio.file.attribute.BasicFileAttributes; import java.text.Normalizer; import java.text.MessageFormat; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; -import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Locale.Category; -import java.util.Map; import java.util.Optional; import java.util.Properties; import java.util.ResourceBundle; @@ -1212,197 +1206,4 @@ return (uri != null && uri.getScheme().equalsIgnoreCase("jrt")); } - /** - * Called by the launcher to validate the modules on the upgrade and - * application module paths. - * - * @return {@code true} if no errors are found - */ - private static boolean validateModules() { - initOutput(System.out); - - ModuleValidator validator = new ModuleValidator(); - - // upgrade module path - String value = System.getProperty("jdk.module.upgrade.path"); - if (value != null) { - Stream.of(value.split(File.pathSeparator)) - .map(Paths::get) - .forEach(validator::scan); - } - - // system modules - ModuleFinder.ofSystem().findAll().stream() - .sorted(Comparator.comparing(ModuleReference::descriptor)) - .forEach(validator::process); - - // application module path - value = System.getProperty("jdk.module.path"); - if (value != null) { - Stream.of(value.split(File.pathSeparator)) - .map(Paths::get) - .forEach(validator::scan); - } - - return !validator.foundErrors(); - } - - /** - * A simple validator to check for errors and conflicts between modules. - */ - static class ModuleValidator { - private static final String MODULE_INFO = "module-info.class"; - - private Map<String, ModuleReference> nameToModule = new HashMap<>(); - private Map<String, ModuleReference> packageToModule = new HashMap<>(); - private boolean errorFound; - - /** - * Returns true if at least one error was found - */ - boolean foundErrors() { - return errorFound; - } - - /** - * Prints the module location and name. - */ - private void printModule(ModuleReference mref) { - mref.location() - .filter(uri -> !isJrt(uri)) - .ifPresent(uri -> ostream.print(uri + " ")); - ModuleDescriptor descriptor = mref.descriptor(); - ostream.print(descriptor.name()); - if (descriptor.isAutomatic()) - ostream.print(" automatic"); - ostream.println(); - } - - /** - * Prints the module location and name, checks if the module is - * shadowed by a previously seen module, and finally checks for - * package conflicts with previously seen modules. - */ - void process(ModuleReference mref) { - printModule(mref); - - String name = mref.descriptor().name(); - ModuleReference previous = nameToModule.putIfAbsent(name, mref); - if (previous != null) { - ostream.print(INDENT + "shadowed by "); - printModule(previous); - } else { - // check for package conflicts when not shadowed - for (String pkg : mref.descriptor().packages()) { - previous = packageToModule.putIfAbsent(pkg, mref); - if (previous != null) { - String mn = previous.descriptor().name(); - ostream.println(INDENT + "contains " + pkg - + " conflicts with module " + mn); - errorFound = true; - } - } - } - } - - /** - * Scan an element on a module path. The element is a directory - * of modules, an exploded module, or a JAR file. - */ - void scan(Path entry) { - BasicFileAttributes attrs; - try { - attrs = Files.readAttributes(entry, BasicFileAttributes.class); - } catch (NoSuchFileException ignore) { - return; - } catch (IOException ioe) { - ostream.println(entry + " " + ioe); - errorFound = true; - return; - } - - String fn = entry.getFileName().toString(); - if (attrs.isRegularFile() && fn.endsWith(".jar")) { - // JAR file, explicit or automatic module - scanModule(entry).ifPresent(this::process); - } else if (attrs.isDirectory()) { - Path mi = entry.resolve(MODULE_INFO); - if (Files.exists(mi)) { - // exploded module - scanModule(entry).ifPresent(this::process); - } else { - // directory of modules - scanDirectory(entry); - } - } - } - - /** - * Scan the JAR files and exploded modules in a directory. - */ - private void scanDirectory(Path dir) { - try (DirectoryStream<Path> stream = Files.newDirectoryStream(dir)) { - Map<String, Path> moduleToEntry = new HashMap<>(); - - for (Path entry : stream) { - BasicFileAttributes attrs; - try { - attrs = Files.readAttributes(entry, BasicFileAttributes.class); - } catch (IOException ioe) { - ostream.println(entry + " " + ioe); - errorFound = true; - continue; - } - - ModuleReference mref = null; - - String fn = entry.getFileName().toString(); - if (attrs.isRegularFile() && fn.endsWith(".jar")) { - mref = scanModule(entry).orElse(null); - } else if (attrs.isDirectory()) { - Path mi = entry.resolve(MODULE_INFO); - if (Files.exists(mi)) { - mref = scanModule(entry).orElse(null); - } - } - - if (mref != null) { - String name = mref.descriptor().name(); - Path previous = moduleToEntry.putIfAbsent(name, entry); - if (previous != null) { - // same name as other module in the directory - printModule(mref); - ostream.println(INDENT + "contains same module as " - + previous.getFileName()); - errorFound = true; - } else { - process(mref); - } - } - } - } catch (IOException ioe) { - ostream.println(dir + " " + ioe); - errorFound = true; - } - } - - /** - * Scan a JAR file or exploded module. - */ - private Optional<ModuleReference> scanModule(Path entry) { - ModuleFinder finder = ModuleFinder.of(entry); - try { - return finder.findAll().stream().findFirst(); - } catch (FindException e) { - ostream.println(entry); - ostream.println(INDENT + e.getMessage()); - Throwable cause = e.getCause(); - if (cause != null) { - ostream.println(INDENT + cause); - } - errorFound = true; - return Optional.empty(); - } - } - } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/net/NetProperties.java openjdk-11-11~24/src/java.base/share/classes/sun/net/NetProperties.java --- openjdk-11-11~19/src/java.base/share/classes/sun/net/NetProperties.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/net/NetProperties.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,8 @@ */ package sun.net; +import jdk.internal.util.StaticProperty; + import java.io.*; import java.security.AccessController; import java.security.PrivilegedAction; @@ -57,7 +59,7 @@ * the file is in jre/lib/net.properties */ private static void loadDefaultProperties() { - String fname = System.getProperty("java.home"); + String fname = StaticProperty.javaHome(); if (fname == null) { throw new Error("Can't find java.home ??"); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/net/RegisteredDomain.java openjdk-11-11~24/src/java.base/share/classes/sun/net/RegisteredDomain.java --- openjdk-11-11~19/src/java.base/share/classes/sun/net/RegisteredDomain.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/net/RegisteredDomain.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,913 +0,0 @@ -/* - * Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package sun.net; - -import java.util.Arrays; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -/* - * WARNING: This class may contain out-of-date information. It should be - * updated or replaced with an appropriate implementation. See - * sun.security.util.RegisteredDomain for more information. - * - * The naming tables listed below were gathered from publicly available data such as - * the subdomain registration websites listed for each top-level domain by the Internet - * Assigned Numbers Authority and the website of the Internet Corporation for Assigned Names - * and Numbers as well as Wikipedia. - */ - -public class RegisteredDomain { - -// XX.AA -private static Set<String> top1Set = new HashSet<String>(Arrays.asList("asia", "biz", "cat", "coop", - "edu", "info", "gov", "jobs", "travel", "am", "aq", "ax", "cc", "cf", "cg", "ch", "cv", "cz", - "de", "dj", "dk", "fm", "fo", "ga", "gd", "gf", "gl", "gm", "gq", "gs", "gw", "hm", - "li", "lu", "md", "mh", "mil", "mobi", "mq", "ms", "ms", "ne", "nl", "nu", "si", - "sm", "sr", "su", "tc", "td", "tf", "tg", "tk", "tm", "tv", "va", "vg", - /* ae */ "xn--mgbaam7a8h", /* cn s */ "xn--fiqs8s", /* cn t */ "xn--fiqz9s", - /* eg */ "xn--wgbh1c", /* hk */ "xn--j6w193g", /* jo */ "xn--mgbayh7gpa", - /* lk */ "xn--fzc2c9e2c", /* ps */ "xn--ygbi2ammx", /* ru */ "xn--p1ai", - /* qa */ "xn--wgbl6a", /* sa */ "xn--mgberp4a5d4ar", /* sg */ "xn--yfro4i67o", - /* th */ "xn--o3cw4h", /* tn */ "xn--pgbs0dh", /* tw s */ "xn--kpry57d", - /* tw */ "xn--kprw13d", /* sg tamil */ "xn--clchc0ea0b2g2a9gcd")); - -// common pattern: XX.AA or XX.GOV.AA -private static Set<String> top2Set = new HashSet<String>(Arrays.asList("as", "bf", "cd", "cx", - "ie", "lt", "mr", "tl")); - -// common pattern: XX.AA or XX.COM.AA or XX.EDU.AA or XX.NET.AA or XX.ORG.AA or XX.GOV.AA -private static Set<String> top4Set = new HashSet<String>(Arrays.asList("af", "bm", "bs", "bt", - "bz", "dm", "ky", "lb", "lr", "mo", "sc", "sl", "ws")); - -// AA or less than 3 other XX.BB.AA possible matches -private static Set<String> top3Set = new HashSet<String>(Arrays.asList("ad", "aw", "be", "bw", - "cl", "fi", "int", "io", "mc")); - -// AA.UK exceptions -private static Set<String> ukSet = new HashSet<String>(Arrays.asList( "bl", "british-library", - "jet", "nhs", "nls", "parliament", "mod", "police")); - -// AA.AR exceptions -private static Set<String> arSet = new HashSet<String>(Arrays.asList( "argentina", "educ", - "gobiernoelectronico", "nic", "promocion", "retina", "uba")); - -// AA.OM exceptions -private static Set<String> omSet = new HashSet<String>(Arrays.asList("mediaphone", "nawrastelecom", - "nawras", "omanmobile", "omanpost", "omantel", "rakpetroleum", "siemens", "songfest", - "statecouncil", "shura", "peie", "omran", "omnic", "omanet", "oman", "muriya", "kom")); - -// any XX.BB.AA -private static Set<String> top5Set = new HashSet<String>(Arrays.asList("au", "arpa", "bd", "bn", "ck", - "cy", "er", "et", "fj", "fk", "gt", "gu", "il", "jm", "ke", "kh", "kw", - "mm", "mt", "mz", "ni", "np", "nz", "pg", "sb", "sv", "tz", "uy", "ve", "ye", - "za", "zm", "zw")); - -// XX.CC.BB.JP -private static Set<String> jpSet = new HashSet<String>(Arrays.asList("aichi", "akita", "aomori", - "chiba", "ehime", "fukui", "fukuoka", "fukushima", "gifu", "gunma", "hiroshima", "hokkaido", - "hyogo", "ibaraki", "ishikawa", "iwate", "kagawa", "kagoshima", "kanagawa", "kawasaki", - "kitakyushu", "kobe", "kochi", "kumamoto", "kyoto", "mie", "miyagi", "miyazaki", "nagano", - "nagasaki", "nagoya", "nara", "niigata", "oita", "okayama", "okinawa", "osaka", "saga", - "saitama", "sapporo", "sendai", "shiga", "shimane", "shizuoka", "tochigi", "tokushima", - "tokyo", "tottori", "toyama", "wakayama", "yamagata", "yamaguchi", "yamanashi", "yokohama")); - -// CC.BB.JP exceptions -private static Set<String> jp2Set = new HashSet<String>(Arrays.asList("metro.tokyo.jp", - "pref.aichi.jp", "pref.akita.jp", "pref.aomori.jp", "pref.chiba.jp", "pref.ehime.jp", - "pref.fukui.jp", "pref.fukuoka.jp", "pref.fukushima.jp", "pref.gifu.jp", "pref.gunma.jp", - "pref.hiroshima.jp", "pref.hokkaido.jp", "pref.hyogo.jp", "pref.ibaraki.jp", "pref.ishikawa.jp", - "pref.iwate.jp", "pref.kagawa.jp", "pref.kagoshima.jp", "pref.kanagawa.jp", "pref.kochi.jp", - "pref.kumamoto.jp", "pref.kyoto.jp", "pref.mie.jp", "pref.miyagi.jp", "pref.miyazaki.jp", - "pref.nagano.jp", "pref.nagasaki.jp", "pref.nara.jp", "pref.niigata.jp", "pref.oita.jp", - "pref.okayama.jp", "pref.okinawa.jp", "pref.osaka.jp", "pref.saga.jp", "pref.saitama.jp", - "pref.shiga.jp", "pref.shimane.jp", "pref.shizuoka.jp", "pref.tochigi.jp", "pref.tokushima.jp", - "pref.tottori.jp", "pref.toyama.jp", "pref.wakayama.jp", "pref.yamagata.jp", "pref.yamaguchi.jp", - "pref.yamanashi.jp", "city.chiba.jp", "city.fukuoka.jp", "city.hamamatsu.jp", "city.hiroshima.jp", "city.kawasaki.jp", - "city.kitakyushu.jp", "city.kobe.jp", "city.kyoto.jp", "city.nagoya.jp", "city.niigata.jp", - "city.okayama.jp", "city.osaka.jp", "city.sagamihara.jp", "city.saitama.jp", "city.sapporo.jp", "city.sendai.jp", - "city.shizuoka.jp", "city.yokohama.jp")); - -private static Set<String> usStateSet = new HashSet<String>(Arrays.asList("ak", - "al", "ar", "as", "az", "ca", "co", "ct", "dc", "de", "fl", "ga", "gu", "hi", "ia", - "id", "il", "in", "ks", "ky", "la", "ma", "md", "me", "mi", "mn", "mo", "ms", "mt", - "nc", "nd", "ne", "nh", "nj", "nm", "nv", "ny", "oh", "ok", "or", "pa", "pr", "ri", - "sc", "sd", "tn", "tx", "ut", "vi", "vt", "va", "wa", "wi", "wv", "wy")); - -private static Set<String> usSubStateSet = new HashSet<String>(Arrays.asList("state", - "lib", "k12", "cc", "tec", "gen", "cog", "mus", "dst")); - -private static Map<String,Set<String>> topMap = new HashMap<>(); -private static Map<String,Set<String>> top3Map = new HashMap<>(); - -static { - /* - * XX.AA or XX.BB.AA - */ - topMap.put("ac", new HashSet<String>(Arrays.asList("com", "co", "edu", "gov", "net", "mil", "org"))); - topMap.put("ae", new HashSet<String>(Arrays.asList("co", "net", "org", "sch", "ac", "gov", "mil"))); - topMap.put("aero", new HashSet<String>(Arrays.asList("accident-investigation", - "accident-prevention", "aerobatic", "aeroclub", "aerodrome", "agents", "aircraft", - "airline", "airport", "air-surveillance", "airtraffic", "air-traffic-control", - "ambulance", "amusement", "association", "author", "ballooning", "broker", "caa", - "cargo", "catering", "certification", "championship", "charter", "civilaviation", - "club", "conference", "consultant", "consulting", "control", "council", "crew", - "design", "dgca", "educator", "emergency", "engine", "engineer", "entertainment", - "equipment", "exchange", "express", "federation", "flight", "freight", "fuel", - "gliding", "government", "groundhandling", "group", "hanggliding", "homebuilt", - "insurance", "journal", "journalist", "leasing", "logistics", "magazine", - "maintenance", "marketplace", "media", "microlight", "modelling", "navigation", - "parachuting", "paragliding", "passenger-association", "pilot", "press", "production", - "recreation", "repbody", "res", "research", "rotorcraft", "safety", "scientist", - "services", "show", "skydiving", "software", "student", "taxi", "trader", "trading", - "trainer", "union", "workinggroup", "works" ))); - topMap.put( "ag", new HashSet<String>(Arrays.asList("com", "org", "net", "co", "nom"))); - topMap.put( "ai", new HashSet<String>(Arrays.asList("off", "com", "net", "org"))); - topMap.put( "al", new HashSet<String>(Arrays.asList("com", "edu", "gov", "mil", "net", "org"))); - topMap.put( "an", new HashSet<String>(Arrays.asList("com"))); - topMap.put( "ao", new HashSet<String>(Arrays.asList("ed", "gv", "og", "co", "pb", "it"))); - topMap.put( "at", new HashSet<String>(Arrays.asList("ac", "co", "gv", "or", "biz", "info", "priv"))); - topMap.put( "az", new HashSet<String>(Arrays.asList("com", "net", "int", "gov", "org", "edu", "info", - "pp", "mil", "name", "biz"))); - topMap.put( "ba", new HashSet<String>(Arrays.asList("org", "net", "edu", "gov", "mil", "unbi", - "unmo", "unsa", "untz", "unze", "co", "com", "rs"))); - topMap.put( "bb", new HashSet<String>(Arrays.asList("biz", "com", "edu", "gov", "info", "net", "org", - "store"))); - topMap.put( "bg", new HashSet<String>(Arrays.asList("a", "b", "c", "d", "e", "f", "g", "h", "i", "j", - "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", - "2", "3", "4", "5", "6", "7", "8", "9"))); - topMap.put( "bh", new HashSet<String>(Arrays.asList("com", "info", "cc", "edu", "biz", "net", - "org", "gov"))); - topMap.put( "bi", new HashSet<String>(Arrays.asList("co", "com", "edu", "gov", "info", "or", "org"))); - topMap.put( "bj", new HashSet<String>(Arrays.asList("asso", "barreau", "com", "edu", "gouv", "gov", "mil"))); - topMap.put( "bo", new HashSet<String>(Arrays.asList("com", "edu", "gov", "gob", "int", "org", "net", - "mil", "tv"))); - topMap.put( "br", new HashSet<String>(Arrays.asList("adm", "adv", "agr", "am", "arq", "art", "ato", - "b", "bio", "blog", "bmd", "cim", "cng", "cnt", "com", "coop", "ecn", "edu", "emp", "eng", - "esp", "etc", "eti", "far", "flog", "fm", "fnd", "fot", "fst", "g12", "ggf", "gov", - "imb", "ind", "inf", "jor", "jus", "lel", "mat", "med", "mil", "mus", "net", "nom", - "not", "ntr", "odo", "org", "ppg", "pro", "psc", "psi", "qsl", "radio", "rec", "slg", - "srv", "taxi", "teo", "tmp", "trd", "tur", "tv", "vet", "vlog", "wiki", "zlg"))); - topMap.put( "bw", new HashSet<String>(Arrays.asList("co", "gov", "org"))); - topMap.put( "by", new HashSet<String>(Arrays.asList("gov", "mil", "com", "of"))); - topMap.put( "ca", new HashSet<String>(Arrays.asList("ab", "bc", "mb", "nb", "nf", - "nl", "ns", "nt", "nu", "on", "pe", "qc", "sk", "yk", "gc"))); - topMap.put( "ci", new HashSet<String>(Arrays.asList("org", "or", "com", "co", "edu", - "ed", "ac", "net", "go", "asso", "xn--aroport-bya", "int", - "presse", "md", "gouv"))); - topMap.put( "com", new HashSet<String>(Arrays.asList("ad", "ar", "br", "cn", "de", "eu", "gb", - "gr", "hu", "jpn", "kr", "no", "qc", "ru", "sa", "se", "uk", "us", "uy", "za"))); - topMap.put( "cm", new HashSet<String>(Arrays.asList("co", "com", "gov", "net"))); - topMap.put( "cn", new HashSet<String>(Arrays.asList("ac", "com", "edu", "gov", "net", - "org", "mil", "xn--55qx5d", "xn--io0a7i", - "ah", "bj", "cq", "fj", "gd", "gs", "gz", "gx", - "ha", "hb", "he", "hi", "hl", "hn", "jl", "js", "jx", "ln", "nm", "nx", "qh", - "sc", "sd", "sh", "sn", "sx", "tj", "xj", "xz", "yn", "zj", "hk", "mo", "tw"))); - topMap.put( "co", new HashSet<String>(Arrays.asList("arts", "com", "edu", "firm", "gov", "info", - "int", "mil", "net", "nom", "org", "rec", "web"))); - topMap.put( "cr", new HashSet<String>(Arrays.asList("ac", "co", "ed", "fi", "go", "or", "sa"))); - topMap.put( "cu", new HashSet<String>(Arrays.asList("com", "edu", "org", "net", "gov", "inf"))); - topMap.put( "do", new HashSet<String>(Arrays.asList("com", "edu", "org", "net", "gov", "gob", - "web", "art", "sld", "mil"))); - topMap.put( "dz", new HashSet<String>(Arrays.asList("com", "org", "net", "gov", "edu", "asso", - "pol", "art"))); - topMap.put( "ec", new HashSet<String>(Arrays.asList("com", "info", "net", "fin", "k12", "med", - "pro", "org", "edu", "gov", "gob", "mil"))); - topMap.put( "ee", new HashSet<String>(Arrays.asList("edu", "gov", "riik", "lib", "med", "com", - "pri", "aip", "org", "fie"))); - topMap.put( "eg", new HashSet<String>(Arrays.asList("com", "edu", "eun", "gov", "mil", "name", - "net", "org", "sci"))); - topMap.put( "es", new HashSet<String>(Arrays.asList("com", "nom", "org", "gob", "edu"))); - topMap.put( "eu", new HashSet<String>(Arrays.asList("europa"))); - topMap.put( "fr", new HashSet<String>(Arrays.asList("com", "asso", "nom", "prd", "presse", - "tm", "aeroport", "assedic", "avocat", "avoues", "cci", "chambagri", - "chirurgiens-dentistes", "experts-comptables", "geometre-expert", "gouv", "greta", - "huissier-justice", "medecin", "notaires", "pharmacien", "port", "veterinaire"))); - topMap.put( "ge", new HashSet<String>(Arrays.asList("com", "edu", "gov", "org", "mil", "net", "pvt"))); - topMap.put( "gg", new HashSet<String>(Arrays.asList("co", "org", "net", "sch", "gov"))); - topMap.put( "gh", new HashSet<String>(Arrays.asList("com", "edu", "gov", "org", "mil"))); - topMap.put( "gi", new HashSet<String>(Arrays.asList("com", "ltd", "gov", "mod", "edu", "org"))); - topMap.put( "gn", new HashSet<String>(Arrays.asList("ac", "com", "edu", "gov", "org", "net"))); - topMap.put( "gp", new HashSet<String>(Arrays.asList("com", "net", "mobi", "edu", "org", "asso"))); - topMap.put( "gr", new HashSet<String>(Arrays.asList("com", "co", "net", "edu", "org", "gov", - "mil", "mod", "sch"))); - topMap.put( "gy", new HashSet<String>(Arrays.asList("co", "com", "net", "org", "edu", "gov"))); - topMap.put( "hk", new HashSet<String>(Arrays.asList("com", "edu", "gov", "idv", "net", "org", - /* com */ "xn--55qx5d", /* edu */ "xn--wcvs22d", /* gov */"xn--mxtq1m", - /* idv */ "xn--gmqw5a", /* net */ "xn--od0alg", /*org*/ "xn--uc0atv"))); - topMap.put( /* hk */ "xn--j6w193g", new HashSet<String>(Arrays.asList( - /* com */ "xn--55qx5d", /* edu */ "xn--wcvs22d", /* gov */"xn--mxtq1m", - /* idv */ "xn--gmqw5a", /* net */ "xn--od0alg", /*org*/ "xn--uc0atv"))); - topMap.put( "hn", new HashSet<String>(Arrays.asList("com", "edu", "org", "net", "mil", "gob"))); - topMap.put( "hr", new HashSet<String>(Arrays.asList("iz.hr", "from.hr", "name.hr", "com.hr"))); - topMap.put( "ht", new HashSet<String>(Arrays.asList("com", "shop", "firm", "info", "adult", - "net", "pro", "org", "med", "art", "coop", "pol", "asso", "edu", "rel", "gouv", "perso"))); - topMap.put( "hu", new HashSet<String>(Arrays.asList("co", "info", "org", "priv", "sport", "tm", - "2000", "agrar", "bolt", "casino", "city", "erotica", "erotika", "film", "forum", - "games", "hotel", "ingatlan", "jogasz", "konyvelo", "lakas", "media", "news", "reklam", - "sex", "shop", "suli", "szex", "tozsde", "utazas", "video"))); - topMap.put( "id", new HashSet<String>(Arrays.asList("ac", "co", "go", "mil", "net", "or", "sch", - "web"))); - topMap.put( "im", new HashSet<String>(Arrays.asList("co.im", "com", "net.im", "gov.im", "org.im", - "ac.im"))); - topMap.put( "in", new HashSet<String>(Arrays.asList("co", "firm", "ernet", "net", "org", "gen", "ind", - "nic", "ac", "edu", "res", "gov", "mil"))); - topMap.put( "iq", new HashSet<String>(Arrays.asList("gov", "edu", "mil", "com", "org", "net" ))); - topMap.put( "ir", new HashSet<String>(Arrays.asList("ac", "co", "gov", "id", "net", "org", "sch" - ))); - topMap.put( "is", new HashSet<String>(Arrays.asList("net", "com", "edu", "gov", "org", "int"))); - topMap.put( "it", new HashSet<String>(Arrays.asList("gov", "edu", "agrigento", "ag", "alessandria", - "al", "ancona", "an", "aosta", "aoste", "ao", "arezzo", "ar", "ascoli-piceno", - "ascolipiceno", "ap", "asti", "at", "avellino", "av", "bari", "ba", - "andria-barletta-trani", "andriabarlettatrani", "trani-barletta-andria", - "tranibarlettaandria", "barletta-trani-andria", "barlettatraniandria", - "andria-trani-barletta", "andriatranibarletta", "trani-andria-barletta", - "traniandriabarletta", "bt", "belluno", "bl", "benevento", "bn", "bergamo", "bg", - "biella", "bi", "bologna", "bo", "bolzano", "bozen", "balsan", "alto-adige", - "altoadige", "suedtirol", "bz", "brescia", "bs", "brindisi", "br", "cagliari", - "ca", "caltanissetta", "cl", "campobasso", "cb", "carboniaiglesias", "carbonia-iglesias", - "iglesias-carbonia", "iglesiascarbonia", "ci", "caserta", "ce", "catania", "ct", - "catanzaro", "cz", "chieti", "ch", "como", "co", "cosenza", "cs", "cremona", "cr", - "crotone", "kr", "cuneo", "cn", "dell-ogliastra", "dellogliastra", "ogliastra", "og", - "enna", "en", "ferrara", "fe", "fermo", "fm", "firenze", "florence", "fi", "foggia", - "fg", "forli-cesena", "forlicesena", "cesena-forli", "cesenaforli", "fc", "frosinone", - "fr", "genova", "genoa", "ge", "gorizia", "go", "grosseto", "gr", "imperia", "im", - "isernia", "is", "laquila", "aquila", "aq", "la-spezia", "laspezia", "sp", "latina", - "lt", "lecce", "le", "lecco", "lc", "livorno", "li", "lodi", "lo", "lucca", "lu", - "macerata", "mc", "mantova", "mn", "massa-carrara", "massacarrara", "carrara-massa", - "carraramassa", "ms", "matera", "mt", "medio-campidano", "mediocampidano", - "campidano-medio", "campidanomedio", "vs", "messina", "me", "milano", "milan", - "mi", "modena", "mo", "monza", "monza-brianza", "monzabrianza", "monzaebrianza", - "monzaedellabrianza", "monza-e-della-brianza", "mb", "napoli", "naples", "na", - "novara", "no", "nuoro", "nu", "oristano", "or", "padova", "padua", "pd", "palermo", - "pa", "parma", "pr", "pavia", "pv", "perugia", "pg", "pescara", "pe", "pesaro-urbino", - "pesarourbino", "urbino-pesaro", "urbinopesaro", "pu", "piacenza", "pc", "pisa", - "pi", "pistoia", "pt", "pordenone", "pn", "potenza", "pz", "prato", "po", "ragusa", - "rg", "ravenna", "ra", "reggio-calabria", "reggiocalabria", "rc", "reggio-emilia", - "reggioemilia", "re", "rieti", "ri", "rimini", "rn", "roma", "rome", "rm", "rovigo", - "ro", "salerno", "sa", "sassari", "ss", "savona", "sv", "siena", "si", "siracusa", - "sr", "sondrio", "so", "taranto", "ta", "tempio-olbia", "tempioolbia", "olbia-tempio", - "olbiatempio", "ot", "teramo", "te", "terni", "tr", "torino", "turin", "to", - "trapani", "tp", "trento", "trentino", "tn", "treviso", "tv", "trieste", "ts", - "udine", "ud", "varese", "va", "venezia", "venice", "ve", "verbania", "vb", - "vercelli", "vc", "verona", "vr", "vibo-valentia", "vibovalentia", "vv", "vicenza", - "vi", "viterbo", "vt"))); - topMap.put( "je", new HashSet<String>(Arrays.asList("co", "org", "net", "sch", "gov"))); - topMap.put( "jo", new HashSet<String>(Arrays.asList("com", "org", "net", "edu", "sch", - "gov", "mil", "name"))); - topMap.put( "jp", new HashSet<String>(Arrays.asList("ac", "ad", "co", "ed", "go", "gr", "lg", - "ne", "or"))); - topMap.put( "kg", new HashSet<String>(Arrays.asList("org", "net", "com", "edu", "gov", "mil"))); - topMap.put( "ki", new HashSet<String>(Arrays.asList("edu", "biz", "net", "org", "gov", - "info", "com"))); - topMap.put( "km", new HashSet<String>(Arrays.asList("org", "nom", "gov", "prd", "tm", "edu", - "mil", "ass", "com", "coop", "asso", "presse", "medecin", "notaires", "pharmaciens", - "veterinaire", "gouv"))); - topMap.put( "kn", new HashSet<String>(Arrays.asList("net", "org", "edu", "gov"))); - topMap.put( "kp", new HashSet<String>(Arrays.asList("com", "edu", "gov", "org", "rep", "tra"))); - topMap.put( "kr", new HashSet<String>(Arrays.asList("ac", "co", "es", "go", "hs", "kg", "mil", - "ms", "ne", "or", "pe", "re", "sc", "busan", "chungbuk", "chungnam", "daegu", - "daejeon", "gangwon", "gwangju", "gyeongbuk", "gyeonggi", "gyeongnam", "incheon", - "jeju", "jeonbuk", "jeonnam", "seoul", "ulsan"))); - topMap.put( "kz", new HashSet<String>(Arrays.asList("org", "edu", "net", "gov", "mil", "com"))); - topMap.put( "la", new HashSet<String>(Arrays.asList("int", "net", "info", "edu", "gov", "per", - "com", "org", "c"))); - topMap.put( "lc", new HashSet<String>(Arrays.asList("com", "net", "co", "org", "edu", "gov", - "l.lc", "p.lc"))); - topMap.put( "lk", new HashSet<String>(Arrays.asList("gov", "sch", "net", "int", "com", "org", - "edu", "ngo", "soc", "web", "ltd", "assn", "grp", "hotel"))); - topMap.put( "ls", new HashSet<String>(Arrays.asList("co", "gov", "ac", "org"))); - topMap.put( "lv", new HashSet<String>(Arrays.asList("com", "edu", "gov", "org", "mil", - "id", "net", "asn", "conf"))); - topMap.put( "ly", new HashSet<String>(Arrays.asList("com", "net", "gov", "plc", "edu", "sch", - "med", "org", "id"))); - topMap.put( "ma", new HashSet<String>(Arrays.asList("co", "net", "gov", "org", "ac", "press"))); - topMap.put( "me", new HashSet<String>(Arrays.asList("co", "net", "org", "edu", "ac", "gov", - "its", "priv"))); - topMap.put( "mg", new HashSet<String>(Arrays.asList("org", "nom", "gov", "prd", "tm", - "edu", "mil", "com"))); - topMap.put( "mk", new HashSet<String>(Arrays.asList("com", "org", "net", "edu", "gov", "inf", - "name", "pro"))); - topMap.put( "ml", new HashSet<String>(Arrays.asList("com", "edu", "gouv", "gov", "net", - "org", "presse"))); - topMap.put( "mn", new HashSet<String>(Arrays.asList("gov", "edu", "org"))); - topMap.put( "mp", new HashSet<String>(Arrays.asList("gov", "co", "org"))); - topMap.put( "mu", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "ac", - "co", "or"))); - topMap.put( "museum", new HashSet<String>(Arrays.asList("academy", "agriculture", "air", - "airguard", "alabama", "alaska", "amber", "ambulance", "american", "americana", - "americanantiques", "americanart", "amsterdam", "and", "annefrank", "anthro", - "anthropology", "antiques", "aquarium", "arboretum", "archaeological", "archaeology", - "architecture", "art", "artanddesign", "artcenter", "artdeco", "arteducation", - "artgallery", "arts", "artsandcrafts", "asmatart", "assassination", "assisi", - "association", "astronomy", "atlanta", "austin", "australia", "automotive", "aviation", - "axis", "badajoz", "baghdad", "bahn", "bale", "baltimore", "barcelona", "baseball", - "basel", "baths", "bauern", "beauxarts", "beeldengeluid", "bellevue", "bergbau", - "berkeley", "berlin", "bern", "bible", "bilbao", "bill", "birdart", "birthplace", - "bonn", "boston", "botanical", "botanicalgarden", "botanicgarden", "botany", - "brandywinevalley", "brasil", "bristol", "british", "britishcolumbia", "broadcast", - "brunel", "brussel", "brussels", "bruxelles", "building", "burghof", "bus", "bushey", - "cadaques", "california", "cambridge", "can", "canada", "capebreton", "carrier", - "cartoonart", "casadelamoneda", "castle", "castres", "celtic", "center", "chattanooga", - "cheltenham", "chesapeakebay", "chicago", "children", "childrens", "childrensgarden", - "chiropractic", "chocolate", "christiansburg", "cincinnati", "cinema", "circus", - "civilisation", "civilization", "civilwar", "clinton", "clock", "coal", "coastaldefence", - "cody", "coldwar", "collection", "colonialwilliamsburg", "coloradoplateau", "columbia", - "columbus", "communication", "communications", "community", "computer", - "computerhistory", "xn--comunicaes-v6a2o", "contemporary", "contemporaryart", - "convent", "copenhagen", "corporation", "xn--correios-e-telecomunicaes-ghc29a", - "corvette", "costume", "countryestate", "county", "crafts", "cranbrook", "creation", - "cultural", "culturalcenter", "culture", "cyber", "cymru", "dali", "dallas", "database", - "ddr", "decorativearts", "delaware", "delmenhorst", "denmark", "depot", "design", - "detroit", "dinosaur", "discovery", "dolls", "donostia", "durham", "eastafrica", - "eastcoast", "education", "educational", "egyptian", "eisenbahn", "elburg", - "elvendrell", "embroidery", "encyclopedic", "england", "entomology", "environment", - "environmentalconservation", "epilepsy", "essex", "estate", "ethnology", "exeter", - "exhibition", "family", "farm", "farmequipment", "farmers", "farmstead", "field", - "figueres", "filatelia", "film", "fineart", "finearts", "finland", "flanders", "florida", - "force", "fortmissoula", "fortworth", "foundation", "francaise", "frankfurt", - "franziskaner", "freemasonry", "freiburg", "fribourg", "frog", "fundacio", "furniture", - "gallery", "garden", "gateway", "geelvinck", "gemological", "geology", "georgia", - "giessen", "glas", "glass", "gorge", "grandrapids", "graz", "guernsey", "halloffame", - "hamburg", "handson", "harvestcelebration", "hawaii", "health", "heimatunduhren", - "hellas", "helsinki", "hembygdsforbund", "heritage", "histoire", "historical", - "historicalsociety", "historichouses", "historisch", "historisches", "history", - "historyofscience", "horology", "house", "humanities", "illustration", "imageandsound", - "indian", "indiana", "indianapolis", "indianmarket", "intelligence", "interactive", - "iraq", "iron", "isleofman", "jamison", "jefferson", "jerusalem", "jewelry", - "jewish", "jewishart", "jfk", "journalism", "judaica", "judygarland", "juedisches", - "juif", "karate", "karikatur", "kids", "koebenhavn", "koeln", "kunst", "kunstsammlung", - "kunstunddesign", "labor", "labour", "lajolla", "lancashire", "landes", "lans", - "xn--lns-qla", "larsson", "lewismiller", "lincoln", "linz", "living", "livinghistory", - "localhistory", "london", "losangeles", "louvre", "loyalist", "lucerne", "luxembourg", - "luzern", "mad", "madrid", "mallorca", "manchester", "mansion", "mansions", "manx", - "marburg", "maritime", "maritimo", "maryland", "marylhurst", "media", "medical", - "medizinhistorisches", "meeres", "memorial", "mesaverde", "michigan", "midatlantic", - "military", "mill", "miners", "mining", "minnesota", "missile", "missoula", "modern", - "moma", "money", "monmouth", "monticello", "montreal", "moscow", "motorcycle", "muenchen", - "muenster", "mulhouse", "muncie", "museet", "museumcenter", "museumvereniging", "music", - "national", "nationalfirearms", "nationalheritage", "nativeamerican", "naturalhistory", - "naturalhistorymuseum", "naturalsciences", "nature", "naturhistorisches", - "natuurwetenschappen", "naumburg", "naval", "nebraska", "neues", "newhampshire", - "newjersey", "newmexico", "newport", "newspaper", "newyork", "niepce", "norfolk", - "north", "nrw", "nuernberg", "nuremberg", "nyc", "nyny", "oceanographic", - "oceanographique", "omaha", "online", "ontario", "openair", "oregon", "oregontrail", - "otago", "oxford", "pacific", "paderborn", "palace", "paleo", "palmsprings", "panama", - "paris", "pasadena", "pharmacy", "philadelphia", "philadelphiaarea", "philately", - "phoenix", "photography", "pilots", "pittsburgh", "planetarium", "plantation", - "plants", "plaza", "portal", "portland", "portlligat", "posts-and-telecommunications", - "preservation", "presidio", "press", "project", "public", "pubol", "quebec", - "railroad", "railway", "research", "resistance", "riodejaneiro", "rochester", "rockart", - "roma", "russia", "saintlouis", "salem", "salvadordali", "salzburg", "sandiego", - "sanfrancisco", "santabarbara", "santacruz", "santafe", "saskatchewan", "satx", - "savannahga", "schlesisches", "schoenbrunn", "schokoladen", "school", "schweiz", - "science", "scienceandhistory", "scienceandindustry", "sciencecenter", "sciencecenters", - "science-fiction", "sciencehistory", "sciences", "sciencesnaturelles", "scotland", - "seaport", "settlement", "settlers", "shell", "sherbrooke", "sibenik", "silk", "ski", - "skole", "society", "sologne", "soundandvision", "southcarolina", "southwest", "space", - "spy", "square", "stadt", "stalbans", "starnberg", "state", "stateofdelaware", - "station", "steam", "steiermark", "stjohn", "stockholm", "stpetersburg", "stuttgart", - "suisse", "surgeonshall", "surrey", "svizzera", "sweden", "sydney", "tank", "tcm", - "technology", "telekommunikation", "television", "texas", "textile", "theater", - "time", "timekeeping", "topology", "torino", "touch", "town", "transport", "tree", - "trolley", "trust", "trustee", "uhren", "ulm", "undersea", "university", "usa", - "usantiques", "usarts", "uscountryestate", "usculture", "usdecorativearts", "usgarden", - "ushistory", "ushuaia", "uslivinghistory", "utah", "uvic", "valley", "vantaa", - "versailles", "viking", "village", "virginia", "virtual", "virtuel", "vlaanderen", - "volkenkunde", "wales", "wallonie", "war", "washingtondc", "watchandclock", - "watch-and-clock", "western", "westfalen", "whaling", "wildlife", "williamsburg", - "windmill", "workshop", "york", "yorkshire", "yosemite", "youth", "zoological", - "zoology", "xn--9dbhblg6di", "xn--h1aegh"))); - topMap.put( "mv", new HashSet<String>(Arrays.asList("aero", "biz", "com", "coop", "edu", "gov", - "info", "int", "mil", "museum", "name", "net", "org", "pro"))); - topMap.put( "mw", new HashSet<String>(Arrays.asList("ac", "biz", "co", "com", "coop", "edu", - "gov", "int", "museum", "net", "org"))); - topMap.put( "mx", new HashSet<String>(Arrays.asList("com", "org", "gob", "edu", "net"))); - topMap.put( "my", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu", - "mil", "name", "sch"))); - topMap.put( "na", new HashSet<String>(Arrays.asList("co", "com", "org", "edu", "edunet", "net", - "alt", "biz", "info"))); - topMap.put( "nc", new HashSet<String>(Arrays.asList("asso", "nom"))); - topMap.put( "net", new HashSet<String>(Arrays.asList("gb", "se", "uk", "za"))); - topMap.put( "ng", new HashSet<String>(Arrays.asList("name", "sch", "mil", "mobi", "com", - "edu", "gov", "net", "org"))); - topMap.put( "nf", new HashSet<String>(Arrays.asList("com", "net", "per", "rec", "web", - "arts", "firm", "info", "other", "store"))); - topMap.put( "no", new HashSet<String>(Arrays.asList("fhs", "vgs", "fylkesbibl", "folkebibl", - "museum", "idrett", "priv", "mil", "stat", "dep", "kommune", "herad", "aa", - "ah", "bu", "fm", "hl", "hm", "jan-mayen", "mr", "nl", "nt", "of", "ol", "oslo", - "rl", "sf", "st", "svalbard", "tm", "tr", "va", "vf", "akrehamn", - "xn--krehamn-dxa", "algard", "xn--lgrd-poac", "arna", "brumunddal", - "bryne", "bronnoysund", "xn--brnnysund-m8ac", "drobak", - "xn--drbak-wua", "egersund", "fetsund", "floro", "xn--flor-jra", - "fredrikstad", "hokksund", "honefoss", "xn--hnefoss-q1a", - "jessheim", "jorpeland", "xn--jrpeland-54a", "kirkenes", "kopervik", - "krokstadelva", "langevag", "xn--langevg-jxa", "leirvik", "mjondalen", - "xn--mjndalen-64a", "mo-i-rana", "mosjoen", "xn--mosjen-eya", - "nesoddtangen", "orkanger", "osoyro", "xn--osyro-wua", - "raholt", "xn--rholt-mra", "sandnessjoen", "xn--sandnessjen-ogb", - "skedsmokorset", "slattum", "spjelkavik", "stathelle", "stavern", "stjordalshalsen", - "xn--stjrdalshalsen-sqb", "tananger", "tranby", "vossevangen", "tranby", - "vossevangen", "afjord", "xn--fjord-lra", "agdenes", "al", - "xn--l-1fa", "alesund", "xn--lesund-hua", - "alstahaug", "alta", "xn--lt-liac", "alaheadju", - "xn--laheadju-7ya", "alvdal", "amli", "xn--mli-tla", - "amot", "xn--mot-tla", "andebu", "andoy", "xn--andy-ira", - "andasuolo", "ardal", "xn--rdal-poa", "aremark", "arendal", - "xn--s-1fa", "aseral", "xn--seral-lra", - "asker", "askim", "askvoll", "askoy", "xn--asky-ira", - "asnes", "xn--snes-poa", "audnedaln", "aukra", "aure", "aurland", - "aurskog-holand", "xn--aurskog-hland-jnb", - "austevoll", "austrheim", "averoy", "xn--avery-yua", - "balestrand", "ballangen", "balat", "xn--blt-elab", - "balsfjord", "bahccavuotna", "xn--bhccavuotna-k7a", - "bamble", "bardu", "beardu", "beiarn", "bajddar", "xn--bjddar-pta", - "baidar", "xn--bidr-5nac", "berg", "bergen", "berlevag", "xn--berlevg-jxa", - "bearalvahki", "xn--bearalvhki-y4a", "bindal", "birkenes", "bjarkoy", - "xn--bjarky-fya", "bjerkreim", "bjugn", "bodo", "xn--bod-2na", - "badaddja", "xn--bdddj-mrabd", "budejju", "bokn", - "bremanger", "bronnoy", "xn--brnny-wuac", "bygland", - "bykle", "barum", "xn--brum-voa", "bievat", "xn--bievt-0qa", - "bomlo", "xn--bmlo-gra", "batsfjord", "xn--btsfjord-9za", "bahcavuotna", - "xn--bhcavuotna-s4a", "dovre", "drammen", "drangedal", "dyroy", - "xn--dyry-ira", "donna", "xn--dnna-gra", - "eid", "eidfjord", "eidsberg", "eidskog", "eidsvoll", "eigersund", "elverum", - "enebakk", "engerdal", "etne", "etnedal", "evenes", "evenassi", - "xn--eveni-0qa01ga", "evje-og-hornnes", "farsund", "fauske", - "fuossko", "fuoisku", "fedje", "fet", "finnoy", "xn--finny-yua", - "fitjar", "fjaler", "fjell", "flakstad", "flatanger", "flekkefjord", "flesberg", - "flora", "fla", "xn--fl-zia", "folldal", "forsand", "fosnes", "frei", - "frogn", "froland", "frosta", "frana", "xn--frna-woa", - "froya", "xn--frya-hra", "fusa", "fyresdal", "forde", - "xn--frde-gra", "gamvik", "gangaviika", "xn--ggaviika-8ya47h", - "gaular", "gausdal", "gildeskal", "xn--gildeskl-g0a", - "giske", "gjemnes", "gjerdrum", "gjerstad", "gjesdal", "gjovik", - "xn--gjvik-wua", "gloppen", "gol", "gran", "grane", "granvin", - "gratangen", "grimstad", "grong", "kraanghke", "xn--kranghke-b0a", - "grue", "gulen", "hadsel", "halden", "halsa", "hamar", "hamaroy", "habmer", - "xn--hbmer-xqa", "hapmir", "xn--hpmir-xqa", - "hammerfest", "hammarfeasta", "xn--hmmrfeasta-s4ac", - "haram", "hareid", "harstad", "hasvik", "aknoluokta", "xn--koluokta-7ya57h", - "hattfjelldal", "aarborte", "haugesund", "hemne", "hemnes", "hemsedal", - "hitra", "hjartdal", "hjelmeland", - "hobol", "xn--hobl-ira", "hof", "hol", "hole", "holmestrand", "holtalen", - "xn--holtlen-hxa", "hornindal", "horten", "hurdal", "hurum", "hvaler", - "hyllestad", "hagebostad", "xn--hgebostad-g3a", "hoyanger", - "xn--hyanger-q1a", "hoylandet", "xn--hylandet-54a", - "ha", "xn--h-2fa", "ibestad", "inderoy", "xn--indery-fya", - "iveland", "jevnaker", "jondal", "jolster", "xn--jlster-bya", - "karasjok", "karasjohka", "xn--krjohka-hwab49j", - "karlsoy", "galsa", "xn--gls-elac", "karmoy", - "xn--karmy-yua", "kautokeino", "guovdageaidnu", "klepp", "klabu", - "xn--klbu-woa", "kongsberg", "kongsvinger", "kragero", "xn--krager-gya", - "kristiansand", "kristiansund", "krodsherad", "xn--krdsherad-m8a", - "kvalsund", "rahkkeravju", "xn--rhkkervju-01af", - "kvam", "kvinesdal", "kvinnherad", "kviteseid", "kvitsoy", "xn--kvitsy-fya", - "kvafjord", "xn--kvfjord-nxa", "giehtavuoatna", "kvanangen", - "xn--kvnangen-k0a", "navuotna", "xn--nvuotna-hwa", - "kafjord", "xn--kfjord-iua", "gaivuotna", "xn--givuotna-8ya", - "larvik", "lavangen", "lavagis", "loabat", "xn--loabt-0qa", - "lebesby", "davvesiida", "leikanger", "leirfjord", "leka", "leksvik", "lenvik", - "leangaviika", "xn--leagaviika-52b", "lesja", "levanger", "lier", "lierne", - "lillehammer", "lillesand", "lindesnes", "lindas", "xn--linds-pra", - "lom", "loppa", "lahppi", "xn--lhppi-xqa", "lund", "lunner", "luroy", - "xn--lury-ira", "luster", "lyngdal", "lyngen", "ivgu", "lardal", "lerdal", - "xn--lrdal-sra", "lodingen", "xn--ldingen-q1a", "lorenskog", - "xn--lrenskog-54a", "loten", "xn--lten-gra", "malvik", - "masoy", "xn--msy-ula0h", "muosat", "xn--muost-0qa", - "mandal", "marker", "marnardal", "masfjorden", "meland", "meldal", "melhus", - "meloy", "xn--mely-ira", "meraker", "xn--merker-kua", "moareke", - "xn--moreke-jua", "midsund", "midtre-gauldal", "modalen", "modum", - "molde", "moskenes", "moss", "mosvik", "malselv", "xn--mlselv-iua", - "malatvuopmi", "xn--mlatvuopmi-s4a", "namdalseid", "aejrie", "namsos", - "namsskogan", "naamesjevuemie", "xn--nmesjevuemie-tcba", - "laakesvuemie", "nannestad", "narvik", "narviika", "naustdal", "nedre-eiker", - "nesna", "nesodden", "nesseby", "unjarga", "xn--unjrga-rta", "nesset", - "nissedal", "nittedal", "nord-aurdal", "nord-fron", "nord-odal", "norddal", - "nordkapp", "davvenjarga", "xn--davvenjrga-y4a", "nordre-land", - "nordreisa", "raisa", "xn--risa-5na", "nore-og-uvdal", "notodden", "naroy", - "xn--nry-yla5g", "notteroy", "xn--nttery-byae", - "odda", "oksnes", "xn--ksnes-uua", "oppdal", "oppegard", - "xn--oppegrd-ixa", "orkdal", "orland", "xn--rland-uua", - "orskog", "xn--rskog-uua", "orsta", "xn--rsta-fra", - "os.hedmark", "os.hordaland", "osen", "osteroy", "xn--ostery-fya", - "ostre-toten", "xn--stre-toten-zcb", "overhalla", "ovre-eiker", - "xn--vre-eiker-k8a", "oyer", "xn--yer-zna", - "oygarden", "xn--ygarden-p1a", "oystre-slidre", "xn--ystre-slidre-ujb", - "porsanger", "porsangu", "xn--porsgu-sta26f", "porsgrunn", - "radoy", "xn--rady-ira", "rakkestad", "rana", "ruovat", "randaberg", - "rauma", "rendalen", "rennebu", "rennesoy", "xn--rennesy-v1a", - "rindal", "ringebu", "ringerike", "ringsaker", "rissa", "risor", - "xn--risr-ira", "roan", "rollag", "rygge", "ralingen", "xn--rlingen-mxa", - "rodoy", "xn--rdy-0nab", "romskog", "xn--rmskog-bya", - "roros", "xn--rros-gra", "rost", "xn--rst-0na", - "royken", "xn--ryken-vua", "royrvik", "xn--ryrvik-bya", - "rade", "xn--rde-ula", "salangen", "siellak", "saltdal", "salat", - "xn--slt-elab", "xn--slat-5na", "samnanger", - "sandefjord", "sandnes", "sandoy", "xn--sandy-yua", "sarpsborg", - "sauda", "sauherad", "sel", "selbu", "selje", "seljord", "sigdal", "siljan", - "sirdal", "skaun", "skedsmo", "ski", "skien", "skiptvet", "skjervoy", - "xn--skjervy-v1a", "skierva", "xn--skierv-uta", - "skjak", "xn--skjk-soa", "skodje", "skanland", "xn--sknland-fxa", - "skanit", "xn--sknit-yqa", "smola", "xn--smla-hra", - "snillfjord", "snasa", "xn--snsa-roa", "snoasa", "snaase", - "xn--snase-nra", "sogndal", "sokndal", "sola", "solund", "songdalen", - "sortland", "spydeberg", "stange", "stavanger", "steigen", "steinkjer", - "stjordal", "xn--stjrdal-s1a", "stokke", "stor-elvdal", "stord", "stordal", - "storfjord", "omasvuotna", "strand", "stranda", "stryn", "sula", "suldal", - "sund", "sunndal", "surnadal", "sveio", "svelvik", "sykkylven", "sogne", - "xn--sgne-gra", "somna", "xn--smna-gra", "sondre-land", - "xn--sndre-land-0cb", "sor-aurdal", "xn--sr-aurdal-l8a", - "sor-fron", "xn--sr-fron-q1a", "sor-odal", "xn--sr-odal-q1a", - "sor-varanger", "xn--sr-varanger-ggb", "matta-varjjat", - "xn--mtta-vrjjat-k7af", "sorfold", "xn--srfold-bya", - "sorreisa", "xn--srreisa-q1a", "sorum", "xn--srum-gra", - "tana", "deatnu", "time", "tingvoll", "tinn", "tjeldsund", "dielddanuorri", - "tjome", "xn--tjme-hra", "tokke", "tolga", "torsken", "tranoy", - "xn--trany-yua", "tromso", "xn--troms-zua", "tromsa", "romsa", - "trondheim", "troandin", "trysil", "trana", "xn--trna-woa", - "trogstad", "xn--trgstad-r1a", "tvedestrand", "tydal", "tynset", - "tysfjord", "divtasvuodna", "divttasvuotna", "tysnes", "tysvar", - "xn--tysvr-vra", "tonsberg", "xn--tnsberg-q1a", - "ullensaker", "ullensvang", "ulvik", "utsira", "vadso", "xn--vads-jra", - "cahcesuolo", "xn--hcesuolo-7ya35b", "vaksdal", "valle", "vang", - "vanylven", "vardo", "xn--vard-jra", "varggat", "xn--vrggt-xqad", - "vefsn", "vaapste", "vega", "vegarshei", "xn--vegrshei-c0a", "vennesla", - "verdal", "verran", "vestby", "vestnes", "vestre-slidre", "vestre-toten", - "vestvagoy", "xn--vestvgy-ixa6o", "vevelstad", "vik", "vikna", - "vindafjord", "volda", "voss", "varoy", "xn--vry-yla5g", - "vagan", "xn--vgan-qoa", "voagat", "vagsoy", "xn--vgsy-qoa0j", - "vaga", "xn--vg-yiab"))); - - topMap.put( "nr", new HashSet<String>(Arrays.asList("biz", "info", "gov", "edu", "org", - "net", "com", "co"))); - topMap.put( "pa", new HashSet<String>(Arrays.asList("ac", "gob", "com", "org", - "sld", "edu", "net", "ing", "abo", "med", "nom"))); - topMap.put( "pe", new HashSet<String>(Arrays.asList("edu", "gob", "nom", "mil", "org", "com", - "net", "sld"))); - topMap.put( "pf", new HashSet<String>(Arrays.asList( "com"))); - topMap.put( "ph", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu", "ngo", "mil"))); - topMap.put( "pk", new HashSet<String>(Arrays.asList("com", "net", "edu", "org", "fam", "biz", - "web", "gov", "gob", "gok", "gon", "gop", "gos", "gog", "gkp", "info"))); - topMap.put( "pl", new HashSet<String>(Arrays.asList("aid", "agro", "atm", "auto", "biz", "com", - "edu", "gmina", "gsm", "info", "mail", "miasta", "media", "mil", "net", "nieruchomosci", - "nom", "org", "pc", "powiat", "priv", "realestate", "rel", "sex", "shop", "sklep", - "sos", "szkola", "targi", "tm", "tourism", "travel", "turystyka", "art", - "gov", "ngo", "augustow", "babia-gora", "bedzin", "beskidy", - "bialowieza", "bialystok", "bielawa", "bieszczady", "boleslawiec", "bydgoszcz", - "bytom", "cieszyn", "czeladz", "czest", "dlugoleka", "elblag", "elk", "glogow", - "gniezno", "gorlice", "grajewo", "ilawa", "jaworzno", "jelenia-gora", "jgora", - "kalisz", "kazimierz-dolny", "karpacz", "kartuzy", "kaszuby", "katowice", "kepno", - "ketrzyn", "klodzko", "kobierzyce", "kolobrzeg", "konin", "konskowola", "kutno", - "lapy", "lebork", "legnica", "lezajsk", "limanowa", "lomza", "lowicz", "lubin", - "lukow", "malbork", "malopolska", "mazowsze", "mazury", "mielec", "mielno", "mragowo", - "naklo", "nowaruda", "nysa", "olawa", "olecko", "olkusz", "olsztyn", "opoczno", - "opole", "ostroda", "ostroleka", "ostrowiec", "ostrowwlkp", "pila", "pisz", "podhale", - "podlasie", "polkowice", "pomorze", "pomorskie", "prochowice", "pruszkow", "przeworsk", - "pulawy", "radom", "rawa-maz", "rybnik", "rzeszow", "sanok", "sejny", "siedlce", - "slask", "slupsk", "sosnowiec", "stalowa-wola", "skoczow", "starachowice", "stargard", - "suwalki", "swidnica", "swiebodzin", "swinoujscie", "szczecin", "szczytno", "tarnobrzeg", - "tgory", "turek", "tychy", "ustka", "walbrzych", "warmia", "warszawa", "waw", - "wegrow", "wielun", "wlocl", "wloclawek", "wodzislaw", "wolomin", "wroclaw", - "zachpomor", "zagan", "zarow", "zgora", "zgorzelec", "gda", "gdansk", - "krakow", "poznan", "wroc", "co", - "lodz", "lublin", "torun"))); - topMap.put( "pn", new HashSet<String>(Arrays.asList("gov", "co", "org", "edu", "net"))); - topMap.put( "pr", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu", "isla", - "pro", "biz", "info", "name", "est", "prof", "ac", "gobierno"))); - topMap.put( "pro", new HashSet<String>(Arrays.asList("aca", "bar", "cpa", "jur", "law", - "med", "eng"))); - topMap.put( "ps", new HashSet<String>(Arrays.asList("edu", "gov", "sec", "plo", "com", "org", "net"))); - topMap.put( "pt", new HashSet<String>(Arrays.asList("net", "gov", "org", "edu", "int", "publ", - "com", "nome"))); - topMap.put( "pw", new HashSet<String>(Arrays.asList("co", "ne", "or", "ed", "go", "belau"))); - topMap.put( "qa", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu", "mil"))); - topMap.put( "re", new HashSet<String>(Arrays.asList("com", "asso", "nom"))); - topMap.put( "ro", new HashSet<String>(Arrays.asList("com", "org", "tm", "nt", "nom", "info", - "rec", "arts", "firm", "store", "www"))); - topMap.put( "rs", new HashSet<String>(Arrays.asList("co", "org", "edu", "ac", "gov", "in"))); - topMap.put( "ru", new HashSet<String>(Arrays.asList("ac", "com", "edu", "int", "net", "org", - "pp", "adygeya", "altai", "amur", "arkhangelsk", "astrakhan", "bashkiria", - "belgorod", "bir", "bryansk", "buryatia", "cap", "cbg", "chel", "chelyabinsk", "chita", - "chukotka", "dagestan", "e-burg", "grozny", "irkutsk", - "ivanovo", "izhevsk", "jar", "joshkar-ola", "kalmykia", "kaluga", "kamchatka", - "karelia", "kazan", "kchr", "kemerovo", "khabarovsk", "khakassia", "khv", "kirov", - "koenig", "komi", "kostroma", "krasnoyarsk", "kuban", "kurgan", "kursk", "lipetsk", - "magadan", "mari", "mari-el", "marine", "mordovia", "mosreg", "msk", "murmansk", - "nalchik", "nnov", "nov", "novosibirsk", "nsk", "omsk", "orenburg", "oryol", - "palana", "penza", "perm", "pskov", "ptz", "rnd", "ryazan", "sakhalin", "samara", - "saratov", "simbirsk", "smolensk", "spb", "stavropol", "stv", "surgut", "tambov", - "tatarstan", "tom", "tomsk", "tsaritsyn", "tsk", "tula", "tuva", "tver", "tyumen", - "udm", "udmurtia", "ulan-ude", "vladikavkaz", "vladimir", "vladivostok", "volgograd", - "vologda", "voronezh", "vrn", "vyatka", "yakutia", "yamal", "yaroslavl", - "yekaterinburg", "yuzhno-sakhalinsk", "amursk", "baikal", "cmw", "fareast", - "jamal", "kms", "k-uralsk", "kustanai", "kuzbass", "magnitka", "mytis", - "nakhodka", "nkz", "norilsk", "oskol", "pyatigorsk", "rubtsovsk", "snz", "syzran", - "vdonsk", "zgrad", "gov", "mil", "test"))); - topMap.put( "rw", new HashSet<String>(Arrays.asList("gov", "net", "edu", "ac", "com", "co", - "int", "mil", "gouv"))); - topMap.put( "sa", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "med", "pub", - "edu", "sch"))); - topMap.put( "sd", new HashSet<String>(Arrays.asList("com", "net", "org", "edu", "med", "gov", - "info", "tv"))); - topMap.put( "se", new HashSet<String>(Arrays.asList("a", "ac", "b", "bd", "brand", "c", "d", - "e", "f", "fh", "fhsk", "fhv", "g", "h", "i", "k", "komforb", "kommunalforbund", - "komvux", "l", "lanarb", "lanbib", "m", "n", "naturbruksgymn", "o", "org", "p", "parti", - "pp", "press", "r", "s", "sshn", "t", "tm", "u", "w", "x", "y", "z"))); - topMap.put( "sg", new HashSet<String>(Arrays.asList("com", "net", "org", "gov", "edu", "per"))); - topMap.put( "sh", new HashSet<String>(Arrays.asList("co", "com", "net", "org", "gov", "edu", "nom"))); - topMap.put( "sk", new HashSet<String>(Arrays.asList("gov", "edu"))); - topMap.put( "sn", new HashSet<String>(Arrays.asList("art", "com", "edu", "gouv", "org", "perso", - "univ"))); - topMap.put( "so", new HashSet<String>(Arrays.asList("com", "net", "org"))); - topMap.put( "sr", new HashSet<String>(Arrays.asList("co", "com", "consulado", "edu", "embaixada", - "gov", "mil", "net", "org", "principe", "saotome", "store"))); - topMap.put( "sy", new HashSet<String>(Arrays.asList("edu", "gov", "net", "mil", "com", "org", "news"))); - topMap.put( "sz", new HashSet<String>(Arrays.asList("co", "ac", "org"))); - topMap.put( "th", new HashSet<String>(Arrays.asList("ac", "co", "go", "in", "mi", "net", "or"))); - topMap.put( "tj", new HashSet<String>(Arrays.asList("ac", "biz", "co", "com", "edu", "go", "gov", - "int", "mil", "name", "net", "nic", "org", "test", "web"))); - topMap.put( "tn", new HashSet<String>(Arrays.asList("com", "ens", "fin", "gov", "ind", "intl", - "nat", "net", "org", "info", "perso", "tourism", "edunet", "rnrt", "rns", "rnu", - "mincom", "agrinet", "defense", "turen"))); - topMap.put( "to", new HashSet<String>(Arrays.asList("gov"))); - topMap.put( "tt", new HashSet<String>(Arrays.asList("co", "com", "org", "net", "biz", "info", - "pro", "int", "coop", "jobs", "mobi", "travel", "museum", "aero", "name", "gov", - "edu", "cat", "tel", "mil"))); - topMap.put( "tw", new HashSet<String>(Arrays.asList("edu", "gov", "mil", "com", "net", "org", - "idv", "game", "ebiz", "club", "xn--zf0ao64a", "xn--uc0atv", "xn--czrw28b"))); - topMap.put( "ua", new HashSet<String>(Arrays.asList("com", "edu", "gov", "in", "net", "org", - "cherkassy", "chernigov", "chernovtsy", "ck", "cn", "crimea", "cv", "dn", - "dnepropetrovsk", "donetsk", "dp", "if", "ivano-frankivsk", "kh", "kharkov", - "kherson", "kiev", "kirovograd", "km", "kr", "ks", "lg", - "lugansk", "lutsk", "lviv", "mk", "nikolaev", "od", "odessa", "pl", "poltava", - "rovno", "rv", "sebastopol", "sumy", "te", "ternopil", "uzhgorod", "vinnica", "vn", - "zaporizhzhe", "zp", "zhitomir", "zt", "cr", "lt", "lv", "sb", "sm", "tr", - "co", "biz", "in", "ne", "pp", "uz", "dominic"))); - topMap.put( "ug", new HashSet<String>(Arrays.asList("co", "ac", "sc", "go", "ne", "or", "org", "com"))); - topMap.put( "us", new HashSet<String>(Arrays.asList("dni", "fed", "isa", "kids", "nsn", "kyschools"))); - topMap.put( "uz", new HashSet<String>(Arrays.asList("co", "com", "org", "gov", "ac", "edu", "int", "pp", "net"))); - topMap.put( "vc", new HashSet<String>(Arrays.asList("com", "net", "org", "gov"))); - topMap.put( "vi", new HashSet<String>(Arrays.asList("co", "com", "k12", "net", "org"))); - topMap.put( "vn", new HashSet<String>(Arrays.asList( "com", "net", "org", "edu", "gov", "int", - "ac", "biz", "info", "name", "pro", "health"))); - topMap.put( "vu", new HashSet<String>(Arrays.asList("co", "com", "net", "org", "edu", "gov", "de"))); - topMap.put("org", new HashSet<String>(Arrays.asList("ae", "za"))); - topMap.put("pro", new HashSet<String>(Arrays.asList("aca", "bar", "cpa", "jur", "law", "med", "eng"))); - - top3Map.put("au", new HashSet<String>(Arrays.asList("act.edu.au", "eq.edu.au", - "nsw.edu.au", "nt.edu.au", "qld.edu.au", "sa.edu.au", "tas.edu.au", "vic.edu.au", - "wa.edu.au", "act.gov.au", "nsw.gov.au", "nt.gov.au", "qld.gov.au", "sa.gov.au", - "tas.gov.au", "vic.gov.au", "wa.gov.au"))); - top3Map.put("im", new HashSet<String>(Arrays.asList("ltd.co.im", "plc.co.im"))); - top3Map.put("no", new HashSet<String>(Arrays.asList("gs.aa.no", "gs.ah.no", "gs.bu.no", - "gs.fm.no", "gs.hl.no", "gs.hm.no", "gs.jan-mayen.no", "gs.mr.no", "gs.nl.no", - "gs.nt.no", "gs.of.no", "gs.ol.no", "gs.oslo.no", "gs.rl.no", "gs.sf.no", - "gs.st.no", "gs.svalbard.no", "gs.tm.no", "gs.tr.no", "gs.va.no", "gs.vf.no", - "bo.telemark.no", "xn--b-5ga.telemark.no", "bo.nordland.no", - "xn--b-5ga.nordland.no", "heroy.more-og-romsdal.no", - "xn--hery-ira.xn--mre-og-romsdal-qqb.no", "heroy.nordland.no", - "xn--hery-ira.nordland.no", "nes.akershus.no", "nes.buskerud.no", - "os.hedmark.no", "os.hordaland.no", - "sande.more-og-romsdal.no", "sande.xn--mre-og-romsdal-qqb.no", - "sande.vestfold.no", "valer.ostfold.no", "xn--vler-qoa.xn--stfold-9xa.no", - "valer.hedmark.no", "xn--vler-qoa.hedmark.no"))); - top3Map.put("tr", new HashSet<String>(Arrays.asList("gov.nc.tr"))); -} - - /** - * Returns a {@code sun.security.util.RegisteredDomain} representing the - * registered part of the specified domain. - * - * @param domain the domain name - * @return a {@code sun.security.util.RegisteredDomain} or null - * if the domain is unknown or not registerable - * @throws NullPointerException if domain is null - */ - public static sun.security.util.RegisteredDomain registeredDomain(String domain) { - String name = getRegisteredDomain(domain); - if (name.equals(domain)) { - return null; - } - return new sun.security.util.RegisteredDomain() { - private String rname = name; - @Override - public String name() { - return rname; - } - @Override - public sun.security.util.RegisteredDomain.Type type() { - return sun.security.util.RegisteredDomain.Type.ICANN; - } - @Override - public String publicSuffix() { - return rname.substring(rname.indexOf(".") + 1); - } - }; - } - - /* - * Return the registered part of a qualified domain - * name or the original if no match is found. - */ - public static String getRegisteredDomain(String cname) { - int dot; - - /* - * If one dot or less than just return. - */ - dot = cname.lastIndexOf('.'); - if (dot == -1) - return cname; - if (dot == 0) - return ""; - if (dot == cname.length() - 1) { - cname = cname.substring(0, cname.length() -1); - dot = cname.lastIndexOf('.'); - if (dot == -1) - return cname; - if (dot == 0) - return ""; - } - if (dot == cname.length() - 1) - return ""; - - /* - * Break it up into seperate labels. - */ - int second = cname.lastIndexOf('.', dot - 1); - if (second == -1) - return cname; - if (second == 0) - return ""; - int third = cname.lastIndexOf('.', second - 1); - int fourth = -1; - if (third > 0) { - fourth = cname.lastIndexOf('.', third - 1); - } - int fifth = -1; - if (fourth > 0) { - fifth = cname.lastIndexOf('.', fourth - 1); - } - String s = cname.substring(dot + 1); - String s2 = cname.substring(second + 1, dot); - - /* - * Look for longest matches first. - * XX.PVT.K12.MA.US etc. - */ - if (fourth != -1 && s.equals("us") && usStateSet.contains(s2)) { - String s3 = cname.substring(third + 1, second); - String s4 = cname.substring(fourth + 1, third); - if (s3.equals("k12")) { - if (s2.equals("ma") && (s4.equals("chtr") || s4.equals("paroch"))) { - return cname.substring(fifth + 1); - } else if (s4.equals("pvt")) { - return cname.substring(fifth + 1); - } - } - } - - /* - * XX.K12.MA.US. - */ - String str = cname.substring(third + 1); - if (third != -1) { - Set<String> set = top3Map.get(s); - if (set != null) { - if (set.contains(str)) { - return cname.substring(fourth + 1); - } - } else if (s.equals("us") && usStateSet.contains(s2)) { - // check for known third level labels - String s3 = cname.substring(third + 1, second); - if (usSubStateSet.contains(s3)) { - return fourth != -1? cname.substring(fourth + 1): cname; - } else { - return cname.substring(third + 1); - } - } else if (s.equals("uk")) { - if (s2.equals("sch")) { - return cname.substring(fourth + 1); - } - } else if (s.equals("jp")) { - if (jpSet.contains(s2)) { - if (jp2Set.contains(str)) { - return cname.substring(third + 1); - } - return cname.substring(fourth + 1); - } - } - } - - /* - * PREF.AKITA.JP etc. - */ - if (jp2Set.contains(str)) { - return cname.substring(third + 1); - } - - /* - * XX.MA.US. - */ - Set<String> topSet = topMap.get(s); - if (topSet != null) { - if (topSet.contains(s2)) { - return cname.substring(third + 1); - } - if (!((s.equals("us") && usStateSet.contains(s2)) || (s.equals("jp") && jpSet.contains(s2)))) { - return cname.substring(second + 1); - } - } else if (top2Set.contains(s)) { - if (s2.equals("gov")) { - return cname.substring(third + 1); - } - return cname.substring(second + 1); - } else if (top3Set.contains(s)) { - if (s.equals("ad") && s2.equals("nom") || - s.equals("aw") && s2.equals("com") || - s.equals("be") && s2.equals("ac") || - s.equals("cl") && s2.equals("gov") || - s.equals("cl") && s2.equals("gob") || - s.equals("fi") && s2.equals("aland") || - s.equals("int") && s2.equals("eu") || - s.equals("io") && s2.equals("com") || - s.equals("mc") && s2.equals("tm") || - s.equals("mc") && s2.equals("asso") || - s.equals("vc") && s2.equals("com")) { - return cname.substring(third + 1); - } - return cname.substring(second + 1); - } else if (top4Set.contains(s)) { - if (s2.equals("com") || s2.equals("edu") || s2.equals("gov") || - s2.equals("net") || s2.equals("org")) { - return cname.substring(third + 1); - } - return cname.substring(second + 1); - } else if (top5Set.contains(s)) { - return cname.substring(third + 1); - } - - /* - * BB.AA exception cases. - */ - if (s.equals("tr")) { - if (!s2.equals("nic") && !s2.equals("tsk")) { - return cname.substring(third + 1); - } - return cname.substring(second + 1); - } else if (s.equals("uk")) { - if (!ukSet.contains(s2)) { - return cname.substring(third + 1); - } - return cname.substring(second + 1); - } else if (s.equals("ar")) { - if (!arSet.contains(s2)) { - return cname.substring(third + 1); - } - return cname.substring(second + 1); - } else if (s.equals("om")) { - if (!omSet.contains(s2)) { - return cname.substring(third + 1); - } - return cname.substring(second + 1); - } - - /* - * XX.AA - */ - if (top1Set.contains(s)) { - return cname.substring(second + 1); - } - - /* - * Nothing matched so we can't shorten the string. - */ - return cname; - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/net/util/SocketExceptions.java openjdk-11-11~24/src/java.base/share/classes/sun/net/util/SocketExceptions.java --- openjdk-11-11~19/src/java.base/share/classes/sun/net/util/SocketExceptions.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/net/util/SocketExceptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,117 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.net.util; + +import java.io.IOException; +import java.lang.reflect.Constructor; +import java.net.InetSocketAddress; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.security.Security; + +public final class SocketExceptions { + private SocketExceptions() {} + + /** + * Security or system property which specifies categories of + * (potentially sensitive) information that may be included + * in exception text. This class only defines one category: + * "hostInfo" which represents the hostname and port number + * of the remote peer relating to a socket exception. + * The property value is a comma separated list of + * case insignificant category names. + */ + private static final String enhancedTextPropname = "jdk.includeInExceptions"; + + private static final boolean enhancedExceptionText = initTextProp(); + + private static boolean initTextProp() { + return AccessController.doPrivileged(new PrivilegedAction<Boolean>() { + public Boolean run() { + String val = System.getProperty(enhancedTextPropname); + if (val == null) { + val = Security.getProperty(enhancedTextPropname); + if (val == null) + return false; + } + String[] tokens = val.split(","); + for (String token : tokens) { + if (token.equalsIgnoreCase("hostinfo")) + return true; + } + return false; + } + }); + } + + + /** + * Utility which takes an exception and returns either the same exception + * or a new exception of the same type with the same stack trace + * and detail message enhanced with addressing information from the + * given InetSocketAddress. + * + * If the system/security property "jdk.net.enhanceExceptionText" is not + * set or is false, then the original exception is returned. + * + * Only specific IOException subtypes are supported. + */ + public static IOException of(IOException e, InetSocketAddress address) { + if (!enhancedExceptionText || address == null) + return e; + int port = address.getPort(); + String host = address.getHostString(); + StringBuilder sb = new StringBuilder(); + sb.append(e.getMessage()); + sb.append(": "); + sb.append(host); + sb.append(':'); + sb.append(Integer.toString(port)); + String enhancedMsg = sb.toString(); + return create(e, enhancedMsg); + } + + // return a new instance of the same type with the given detail + // msg, or if the type doesn't support detail msgs, return given + // instance. + + private static IOException create(IOException e, String msg) { + return AccessController.doPrivileged(new PrivilegedAction<IOException>() { + public IOException run() { + try { + Class<?> clazz = e.getClass(); + Constructor<?> ctor = clazz.getConstructor(String.class); + IOException e1 = (IOException)(ctor.newInstance(msg)); + e1.setStackTrace(e.getStackTrace()); + return e1; + } catch (Exception e0) { + // Some eg AsynchronousCloseException have no detail msg + return e; + } + } + }); + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/net/www/MimeTable.java openjdk-11-11~24/src/java.base/share/classes/sun/net/www/MimeTable.java --- openjdk-11-11~19/src/java.base/share/classes/sun/net/www/MimeTable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/net/www/MimeTable.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,8 @@ */ package sun.net.www; +import jdk.internal.util.StaticProperty; + import java.io.*; import java.net.FileNameMap; import java.util.Hashtable; @@ -53,7 +55,7 @@ mailcapLocations = new String[] { System.getProperty("user.mailcap"), - System.getProperty("user.home") + "/.mailcap", + StaticProperty.userHome() + "/.mailcap", "/etc/mailcap", "/usr/etc/mailcap", "/usr/local/etc/mailcap", @@ -384,7 +386,12 @@ Properties properties = getAsProperties(); properties.put("temp.file.template", tempFileTemplate); String tag; - String user = System.getProperty("user.name"); + // Perform the property security check for user.name + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPropertyAccess("user.name"); + } + String user = StaticProperty.userName(); if (user != null) { tag = "; customized for " + user; properties.store(os, filePreamble + tag); diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java openjdk-11-11~24/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java --- openjdk-11-11~19/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java 2018-07-25 15:36:46.000000000 +0000 @@ -608,26 +608,17 @@ HostnameChecker checker = HostnameChecker.getInstance( HostnameChecker.TYPE_TLS); - // Use ciphersuite to determine whether Kerberos is present. - if (cipher.startsWith("TLS_KRB5")) { - if (!HostnameChecker.match(host, getPeerPrincipal())) { - throw new SSLPeerUnverifiedException("Hostname checker" + - " failed for Kerberos"); - } - } else { // X.509 + // get the subject's certificate + peerCerts = session.getPeerCertificates(); - // get the subject's certificate - peerCerts = session.getPeerCertificates(); - - X509Certificate peerCert; - if (peerCerts[0] instanceof - java.security.cert.X509Certificate) { - peerCert = (java.security.cert.X509Certificate)peerCerts[0]; - } else { - throw new SSLPeerUnverifiedException(""); - } - checker.match(host, peerCert); + X509Certificate peerCert; + if (peerCerts[0] instanceof + java.security.cert.X509Certificate) { + peerCert = (java.security.cert.X509Certificate)peerCerts[0]; + } else { + throw new SSLPeerUnverifiedException(""); } + checker.match(host, peerCert); // if it doesn't throw an exception, we passed. Return. return; diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/net/www/protocol/mailto/MailToURLConnection.java openjdk-11-11~24/src/java.base/share/classes/sun/net/www/protocol/mailto/MailToURLConnection.java --- openjdk-11-11~19/src/java.base/share/classes/sun/net/www/protocol/mailto/MailToURLConnection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/net/www/protocol/mailto/MailToURLConnection.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,6 +30,8 @@ import java.net.SocketPermission; import java.io.*; import java.security.Permission; + +import jdk.internal.util.StaticProperty; import sun.net.www.*; import sun.net.smtp.SmtpClient; import sun.net.www.ParseUtil; @@ -65,7 +67,12 @@ String getFromAddress() { String str = System.getProperty("user.fromaddr"); if (str == null) { - str = System.getProperty("user.name"); + // Perform the property security check for user.name + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkPropertyAccess("user.name"); + } + str = StaticProperty.userName(); if (str != null) { String host = System.getProperty("mail.host"); if (host == null) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/nio/ch/FileChannelImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ import java.lang.ref.Cleaner.Cleanable; import java.nio.ByteBuffer; import java.nio.MappedByteBuffer; +import java.nio.channels.AsynchronousCloseException; import java.nio.channels.ClosedByInterruptException; import java.nio.channels.ClosedChannelException; import java.nio.channels.FileChannel; @@ -38,24 +39,15 @@ import java.nio.channels.FileLockInterruptionException; import java.nio.channels.NonReadableChannelException; import java.nio.channels.NonWritableChannelException; -import java.nio.channels.OverlappingFileLockException; import java.nio.channels.ReadableByteChannel; import java.nio.channels.SelectableChannel; import java.nio.channels.WritableByteChannel; -import java.nio.file.Files; -import java.nio.file.FileStore; -import java.nio.file.FileSystemException; -import java.nio.file.Path; -import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; import jdk.internal.misc.JavaIOFileDescriptorAccess; import jdk.internal.misc.JavaNioAccess; import jdk.internal.misc.SharedSecrets; import jdk.internal.ref.Cleaner; import jdk.internal.ref.CleanerFactory; -import sun.security.action.GetPropertyAction; public class FileChannelImpl extends FileChannel @@ -90,7 +82,7 @@ // Lock for operations involving position and size private final Object positionLock = new Object(); - // Positional-read is not interruptible + // blocking operations are not interruptible private volatile boolean uninterruptible; // DirectIO flag @@ -162,6 +154,14 @@ uninterruptible = true; } + private void beginBlocking() { + if (!uninterruptible) begin(); + } + + private void endBlocking(boolean completed) throws AsynchronousCloseException { + if (!uninterruptible) end(completed); + } + // -- Standard channel operations -- protected void implCloseChannel() throws IOException { @@ -215,7 +215,7 @@ int n = 0; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return 0; @@ -225,7 +225,7 @@ return IOStatus.normalize(n); } finally { threads.remove(ti); - end(n > 0); + endBlocking(n > 0); assert IOStatus.check(n); } } @@ -245,7 +245,7 @@ long n = 0; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return 0; @@ -256,7 +256,7 @@ return IOStatus.normalize(n); } finally { threads.remove(ti); - end(n > 0); + endBlocking(n > 0); assert IOStatus.check(n); } } @@ -272,7 +272,7 @@ int n = 0; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return 0; @@ -282,7 +282,7 @@ return IOStatus.normalize(n); } finally { threads.remove(ti); - end(n > 0); + endBlocking(n > 0); assert IOStatus.check(n); } } @@ -302,7 +302,7 @@ long n = 0; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return 0; @@ -313,7 +313,7 @@ return IOStatus.normalize(n); } finally { threads.remove(ti); - end(n > 0); + endBlocking(n > 0); assert IOStatus.check(n); } } @@ -327,7 +327,7 @@ long p = -1; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return 0; @@ -339,7 +339,7 @@ return IOStatus.normalize(p); } finally { threads.remove(ti); - end(p > -1); + endBlocking(p > -1); assert IOStatus.check(p); } } @@ -353,7 +353,7 @@ long p = -1; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return null; @@ -363,7 +363,7 @@ return this; } finally { threads.remove(ti); - end(p > -1); + endBlocking(p > -1); assert IOStatus.check(p); } } @@ -375,7 +375,7 @@ long s = -1; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return -1; @@ -385,7 +385,7 @@ return IOStatus.normalize(s); } finally { threads.remove(ti); - end(s > -1); + endBlocking(s > -1); assert IOStatus.check(s); } } @@ -403,7 +403,7 @@ int ti = -1; long rp = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return null; @@ -442,7 +442,7 @@ return this; } finally { threads.remove(ti); - end(rv > -1); + endBlocking(rv > -1); assert IOStatus.check(rv); } } @@ -453,7 +453,7 @@ int rv = -1; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return; @@ -462,7 +462,7 @@ } while ((rv == IOStatus.INTERRUPTED) && isOpen()); } finally { threads.remove(ti); - end(rv > -1); + endBlocking(rv > -1); assert IOStatus.check(rv); } } @@ -493,7 +493,7 @@ long n = -1; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return -1; @@ -808,9 +808,8 @@ int n = 0; int ti = -1; - boolean interruptible = !uninterruptible; try { - if (interruptible) begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return -1; @@ -820,7 +819,7 @@ return IOStatus.normalize(n); } finally { threads.remove(ti); - if (interruptible) end(n > 0); + endBlocking(n > 0); assert IOStatus.check(n); } } @@ -849,7 +848,7 @@ int n = 0; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return -1; @@ -859,7 +858,7 @@ return IOStatus.normalize(n); } finally { threads.remove(ti); - end(n > 0); + endBlocking(n > 0); assert IOStatus.check(n); } } @@ -963,7 +962,7 @@ long addr = -1; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return null; @@ -1052,7 +1051,7 @@ } } finally { threads.remove(ti); - end(IOStatus.checkAll(addr)); + endBlocking(IOStatus.checkAll(addr)); } } @@ -1117,7 +1116,7 @@ boolean completed = false; int ti = -1; try { - begin(); + beginBlocking(); ti = threads.add(); if (!isOpen()) return null; @@ -1140,7 +1139,7 @@ flt.remove(fli); threads.remove(ti); try { - end(completed); + endBlocking(completed); } catch (ClosedByInterruptException e) { throw new FileLockInterruptionException(); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -54,6 +54,7 @@ import sun.net.NetHooks; import sun.net.ext.ExtendedSocketOptions; +import sun.net.util.SocketExceptions; import static sun.net.ext.ExtendedSocketOptions.SOCK_STREAM; /** @@ -706,7 +707,7 @@ } catch (IOException ioe) { // connect failed, close the channel close(); - throw ioe; + throw SocketExceptions.of(ioe, isa); } } @@ -792,7 +793,7 @@ } catch (IOException ioe) { // connect failed, close the channel close(); - throw ioe; + throw SocketExceptions.of(ioe, remoteAddress); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/nio/ch/Util.java openjdk-11-11~24/src/java.base/share/classes/sun/nio/ch/Util.java --- openjdk-11-11~19/src/java.base/share/classes/sun/nio/ch/Util.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/nio/ch/Util.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,7 @@ package sun.nio.ch; import java.io.FileDescriptor; +import java.io.IOException; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.nio.ByteBuffer; @@ -35,9 +36,10 @@ import java.util.Collection; import java.util.Iterator; import java.util.Set; + +import jdk.internal.misc.TerminatingThreadLocal; import jdk.internal.misc.Unsafe; import sun.security.action.GetPropertyAction; -import java.io.IOException; public class Util { @@ -50,13 +52,18 @@ private static final long MAX_CACHED_BUFFER_SIZE = getMaxCachedBufferSize(); // Per-thread cache of temporary direct buffers - private static ThreadLocal<BufferCache> bufferCache = - new ThreadLocal<BufferCache>() - { + private static ThreadLocal<BufferCache> bufferCache = new TerminatingThreadLocal<>() { @Override protected BufferCache initialValue() { return new BufferCache(); } + @Override + protected void threadTerminated(BufferCache cache) { // will never be null + while (!cache.isEmpty()) { + ByteBuffer bb = cache.removeFirst(); + free(bb); + } + } }; /** diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java openjdk-11-11~24/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java --- openjdk-11-11~19/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/nio/fs/NativeBuffers.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ package sun.nio.fs; +import jdk.internal.misc.TerminatingThreadLocal; import jdk.internal.misc.Unsafe; /** @@ -37,8 +38,21 @@ private static final Unsafe unsafe = Unsafe.getUnsafe(); private static final int TEMP_BUF_POOL_SIZE = 3; - private static ThreadLocal<NativeBuffer[]> threadLocal = - new ThreadLocal<NativeBuffer[]>(); + private static ThreadLocal<NativeBuffer[]> threadLocal = new TerminatingThreadLocal<>() { + @Override + protected void threadTerminated(NativeBuffer[] buffers) { + // threadLocal may be initialized but with initialValue of null + if (buffers != null) { + for (int i = 0; i < TEMP_BUF_POOL_SIZE; i++) { + NativeBuffer buffer = buffers[i]; + if (buffer != null) { + buffer.free(); + buffers[i] = null; + } + } + } + } + }; /** * Allocates a native buffer, of at least the given size, from the heap. diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java openjdk-11-11~24/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/pkcs12/PKCS12KeyStore.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -282,6 +282,31 @@ } /** + * Retries an action with password "\0" if "" fails. + * @param <T> the return type + */ + @FunctionalInterface + private interface RetryWithZero<T> { + + T tryOnce(char[] password) throws Exception; + + static <S> S run(RetryWithZero<S> f, char[] password) throws Exception { + try { + return f.tryOnce(password); + } catch (Exception e) { + if (password.length == 0) { + // Retry using an empty password with a NUL terminator. + if (debug != null) { + debug.println("Retry with a NUL password"); + } + return f.tryOnce(new char[1]); + } + throw e; + } + } + } + + /** * Private keys and certificates are stored in a map. * Map entries are keyed by alias names. */ @@ -354,7 +379,7 @@ try { PBEParameterSpec pbeSpec; - int ic = 0; + int ic; if (algParams != null) { try { @@ -368,77 +393,69 @@ if (ic > MAX_ITERATION_COUNT) { throw new IOException("PBE iteration count too large"); } + } else { + ic = 0; } - byte[] keyInfo; - while (true) { - try { - // Use JCE - SecretKey skey = getPBEKey(password); - Cipher cipher = Cipher.getInstance( + key = RetryWithZero.run(pass -> { + // Use JCE + SecretKey skey = getPBEKey(pass); + Cipher cipher = Cipher.getInstance( mapPBEParamsToAlgorithm(algOid, algParams)); - cipher.init(Cipher.DECRYPT_MODE, skey, algParams); - keyInfo = cipher.doFinal(encryptedKey); - break; - } catch (Exception e) { - if (password.length == 0) { - // Retry using an empty password - // without a NULL terminator. - password = new char[1]; - continue; - } - throw e; - } - } - - /* - * Parse the key algorithm and then use a JCA key factory - * to re-create the key. - */ - DerValue val = new DerValue(keyInfo); - DerInputStream in = val.toDerInputStream(); - int i = in.getInteger(); - DerValue[] value = in.getSequence(2); - AlgorithmId algId = new AlgorithmId(value[0].getOID()); - String keyAlgo = algId.getName(); - - // decode private key - if (entry instanceof PrivateKeyEntry) { - KeyFactory kfac = KeyFactory.getInstance(keyAlgo); - PKCS8EncodedKeySpec kspec = new PKCS8EncodedKeySpec(keyInfo); - key = kfac.generatePrivate(kspec); - - if (debug != null) { - debug.println("Retrieved a protected private key at alias" + - " '" + alias + "' (" + - new AlgorithmId(algOid).getName() + - " iterations: " + ic + ")"); - } + cipher.init(Cipher.DECRYPT_MODE, skey, algParams); + byte[] keyInfo = cipher.doFinal(encryptedKey); + /* + * Parse the key algorithm and then use a JCA key factory + * to re-create the key. + */ + DerValue val = new DerValue(keyInfo); + DerInputStream in = val.toDerInputStream(); + int i = in.getInteger(); + DerValue[] value = in.getSequence(2); + AlgorithmId algId = new AlgorithmId(value[0].getOID()); + String keyAlgo = algId.getName(); + + // decode private key + if (entry instanceof PrivateKeyEntry) { + KeyFactory kfac = KeyFactory.getInstance(keyAlgo); + PKCS8EncodedKeySpec kspec = new PKCS8EncodedKeySpec(keyInfo); + Key tmp = kfac.generatePrivate(kspec); - // decode secret key - } else { - byte[] keyBytes = in.getOctetString(); - SecretKeySpec secretKeySpec = - new SecretKeySpec(keyBytes, keyAlgo); - - // Special handling required for PBE: needs a PBEKeySpec - if (keyAlgo.startsWith("PBE")) { - SecretKeyFactory sKeyFactory = - SecretKeyFactory.getInstance(keyAlgo); - KeySpec pbeKeySpec = - sKeyFactory.getKeySpec(secretKeySpec, PBEKeySpec.class); - key = sKeyFactory.generateSecret(pbeKeySpec); + if (debug != null) { + debug.println("Retrieved a protected private key at alias" + + " '" + alias + "' (" + + new AlgorithmId(algOid).getName() + + " iterations: " + ic + ")"); + } + return tmp; + // decode secret key } else { - key = secretKeySpec; - } + byte[] keyBytes = in.getOctetString(); + SecretKeySpec secretKeySpec = + new SecretKeySpec(keyBytes, keyAlgo); + + // Special handling required for PBE: needs a PBEKeySpec + Key tmp; + if (keyAlgo.startsWith("PBE")) { + SecretKeyFactory sKeyFactory = + SecretKeyFactory.getInstance(keyAlgo); + KeySpec pbeKeySpec = + sKeyFactory.getKeySpec(secretKeySpec, PBEKeySpec.class); + tmp = sKeyFactory.generateSecret(pbeKeySpec); + } else { + tmp = secretKeySpec; + } - if (debug != null) { - debug.println("Retrieved a protected secret key at alias " + - "'" + alias + "' (" + - new AlgorithmId(algOid).getName() + - " iterations: " + ic + ")"); + if (debug != null) { + debug.println("Retrieved a protected secret key at alias " + + "'" + alias + "' (" + + new AlgorithmId(algOid).getName() + + " iterations: " + ic + ")"); + } + return tmp; } - } + }, password); + } catch (Exception e) { UnrecoverableKeyException uke = new UnrecoverableKeyException("Get Key failed: " + @@ -2009,7 +2026,6 @@ * Spin over the ContentInfos. */ for (int i = 0; i < count; i++) { - byte[] safeContentsData; ContentInfo safeContents; DerInputStream sci; byte[] eAlgId = null; @@ -2017,14 +2033,13 @@ sci = new DerInputStream(safeContentsArray[i].toByteArray()); safeContents = new ContentInfo(sci); contentType = safeContents.getContentType(); - safeContentsData = null; if (contentType.equals(ContentInfo.DATA_OID)) { if (debug != null) { debug.println("Loading PKCS#7 data"); } - safeContentsData = safeContents.getData(); + loadSafeContents(new DerInputStream(safeContents.getData())); } else if (contentType.equals(ContentInfo.ENCRYPTED_DATA_OID)) { if (password == null) { @@ -2048,7 +2063,7 @@ if (seq[2].isConstructed()) newTag |= 0x20; seq[2].resetTag(newTag); - safeContentsData = seq[2].getOctetString(); + byte[] rawData = seq[2].getOctetString(); // parse Algorithm parameters DerInputStream in = seq[1].toDerInputStream(); @@ -2079,32 +2094,25 @@ " iterations: " + ic + ")"); } - while (true) { - try { + try { + RetryWithZero.run(pass -> { // Use JCE - SecretKey skey = getPBEKey(password); - Cipher cipher = Cipher.getInstance(algOid.toString()); + SecretKey skey = getPBEKey(pass); + Cipher cipher = Cipher.getInstance( + mapPBEParamsToAlgorithm(algOid, algParams)); cipher.init(Cipher.DECRYPT_MODE, skey, algParams); - safeContentsData = cipher.doFinal(safeContentsData); - break; - } catch (Exception e) { - if (password.length == 0) { - // Retry using an empty password - // without a NULL terminator. - password = new char[1]; - continue; - } - throw new IOException("keystore password was incorrect", + loadSafeContents(new DerInputStream(cipher.doFinal(rawData))); + return null; + }, password); + } catch (Exception e) { + throw new IOException("keystore password was incorrect", new UnrecoverableKeyException( - "failed to decrypt safe contents entry: " + e)); - } + "failed to decrypt safe contents entry: " + e)); } } else { throw new IOException("public key protected PKCS12" + " not supported"); } - DerInputStream sc = new DerInputStream(safeContentsData); - loadSafeContents(sc, password); } // The MacData is optional. @@ -2128,20 +2136,24 @@ Mac m = Mac.getInstance("HmacPBE" + algName); PBEParameterSpec params = new PBEParameterSpec(macData.getSalt(), ic); - SecretKey key = getPBEKey(password); - m.init(key, params); - m.update(authSafeData); - byte[] macResult = m.doFinal(); - if (debug != null) { - debug.println("Checking keystore integrity " + - "(" + m.getAlgorithm() + " iterations: " + ic + ")"); - } + RetryWithZero.run(pass -> { + SecretKey key = getPBEKey(pass); + m.init(key, params); + m.update(authSafeData); + byte[] macResult = m.doFinal(); - if (!MessageDigest.isEqual(macData.getDigest(), macResult)) { - throw new UnrecoverableKeyException("Failed PKCS12" + - " integrity checking"); - } + if (debug != null) { + debug.println("Checking keystore integrity " + + "(" + m.getAlgorithm() + " iterations: " + ic + ")"); + } + + if (!MessageDigest.isEqual(macData.getDigest(), macResult)) { + throw new UnrecoverableKeyException("Failed PKCS12" + + " integrity checking"); + } + return (Void)null; + }, password); } catch (Exception e) { throw new IOException("Integrity check failed: " + e, e); } @@ -2234,7 +2246,7 @@ else return null; } - private void loadSafeContents(DerInputStream stream, char[] password) + private void loadSafeContents(DerInputStream stream) throws IOException, NoSuchAlgorithmException, CertificateException { DerValue[] safeBags = stream.getSequence(2); diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/provider/AbstractDrbg.java openjdk-11-11~24/src/java.base/share/classes/sun/security/provider/AbstractDrbg.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/provider/AbstractDrbg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/provider/AbstractDrbg.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -516,7 +516,7 @@ * This object uses {@link SeedGenerator#generateSeed(byte[])} to * return a byte array containing {@code minLength} bytes. It is * assumed to support prediction resistance and always contains - * full-entropy. A trusted application can update this field. + * full-entropy. */ private final static EntropySource defaultES = (minE, minLen, maxLen, pr) -> { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/provider/DSA.java openjdk-11-11~24/src/java.base/share/classes/sun/security/provider/DSA.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/provider/DSA.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/provider/DSA.java 2018-07-25 15:36:46.000000000 +0000 @@ -588,7 +588,7 @@ } } protected void engineUpdate(byte[] input, int offset, int len) { - if (ofs + len > digestBuffer.length) { + if (len > (digestBuffer.length - ofs)) { ofs = Integer.MAX_VALUE; } else { System.arraycopy(input, offset, digestBuffer, ofs, len); @@ -597,7 +597,7 @@ } protected final void engineUpdate(ByteBuffer input) { int inputLen = input.remaining(); - if (ofs + inputLen > digestBuffer.length) { + if (inputLen > (digestBuffer.length - ofs)) { ofs = Integer.MAX_VALUE; } else { input.get(digestBuffer, ofs, inputLen); diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/provider/PolicyFile.java openjdk-11-11~24/src/java.base/share/classes/sun/security/provider/PolicyFile.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/provider/PolicyFile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/provider/PolicyFile.java 2018-07-25 15:36:46.000000000 +0000 @@ -44,6 +44,7 @@ import jdk.internal.misc.JavaSecurityAccess; import static jdk.internal.misc.JavaSecurityAccess.ProtectionDomainCache; import jdk.internal.misc.SharedSecrets; +import jdk.internal.util.StaticProperty; import sun.security.util.*; import sun.net.www.ParseUtil; @@ -279,7 +280,7 @@ public URL run() { String sep = File.separator; try { - return Path.of(System.getProperty("java.home"), + return Path.of(StaticProperty.javaHome(), "lib", "security", "default.policy").toUri().toURL(); } catch (MalformedURLException mue) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/provider/SunEntries.java openjdk-11-11~24/src/java.base/share/classes/sun/security/provider/SunEntries.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/provider/SunEntries.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/provider/SunEntries.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,8 @@ import java.net.*; import java.util.Map; import java.security.*; + +import jdk.internal.util.StaticProperty; import sun.security.action.GetPropertyAction; /** @@ -403,7 +405,7 @@ if(deviceURI.isOpaque()) { // File constructor does not accept opaque URI URI localDir = new File( - System.getProperty("user.dir")).toURI(); + StaticProperty.userDir()).toURI(); String uriPath = localDir.toString() + deviceURI.toString().substring(5); return new File(URI.create(uriPath)); diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAKeyFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -100,7 +100,7 @@ private static void checkKeyAlgo(Key key, String expectedAlg) throws InvalidKeyException { String keyAlg = key.getAlgorithm(); - if (!(keyAlg.equalsIgnoreCase(expectedAlg))) { + if (keyAlg == null || !(keyAlg.equalsIgnoreCase(expectedAlg))) { throw new InvalidKeyException("Expected a " + expectedAlg + " key, but got " + keyAlg); } @@ -123,8 +123,7 @@ return (RSAKey)key; } else { try { - String keyAlgo = key.getAlgorithm(); - KeyType type = KeyType.lookup(keyAlgo); + KeyType type = KeyType.lookup(key.getAlgorithm()); RSAKeyFactory kf = RSAKeyFactory.getInstance(type); return (RSAKey) kf.engineTranslateKey(key); } catch (ProviderException e) { @@ -268,8 +267,7 @@ throw new InvalidKeyException("Invalid key", e); } } else if ("X.509".equals(key.getFormat())) { - byte[] encoded = key.getEncoded(); - RSAPublicKey translated = new RSAPublicKeyImpl(encoded); + RSAPublicKey translated = new RSAPublicKeyImpl(key.getEncoded()); // ensure the key algorithm matches the current KeyFactory instance checkKeyAlgo(translated, type.keyAlgo()); return translated; @@ -313,8 +311,8 @@ throw new InvalidKeyException("Invalid key", e); } } else if ("PKCS#8".equals(key.getFormat())) { - byte[] encoded = key.getEncoded(); - RSAPrivateKey translated = RSAPrivateCrtKeyImpl.newKey(encoded); + RSAPrivateKey translated = + RSAPrivateCrtKeyImpl.newKey(key.getEncoded()); // ensure the key algorithm matches the current KeyFactory instance checkKeyAlgo(translated, type.keyAlgo()); return translated; diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAPrivateCrtKeyImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -123,6 +123,10 @@ * Construct a key from its encoding. Called from newKey above. */ RSAPrivateCrtKeyImpl(byte[] encoded) throws InvalidKeyException { + if (encoded == null || encoded.length == 0) { + throw new InvalidKeyException("Missing key encoding"); + } + decode(encoded); RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), e); try { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAPSSSignature.java 2018-07-25 15:36:46.000000000 +0000 @@ -132,7 +132,7 @@ } this.pubKey = (RSAPublicKey) isValid((RSAKey)publicKey); this.privKey = null; - + resetDigest(); } // initialize for signing. See JCA doc @@ -153,6 +153,7 @@ this.pubKey = null; this.random = (random == null? JCAUtil.getSecureRandom() : random); + resetDigest(); } /** @@ -604,16 +605,15 @@ @Override protected AlgorithmParameters engineGetParameters() { - if (this.sigParams == null) { - throw new ProviderException("Missing required PSS parameters"); - } - try { - AlgorithmParameters ap = - AlgorithmParameters.getInstance("RSASSA-PSS"); - ap.init(this.sigParams); - return ap; - } catch (GeneralSecurityException gse) { - throw new ProviderException(gse.getMessage()); + AlgorithmParameters ap = null; + if (this.sigParams != null) { + try { + ap = AlgorithmParameters.getInstance("RSASSA-PSS"); + ap.init(this.sigParams); + } catch (GeneralSecurityException gse) { + throw new ProviderException(gse.getMessage()); + } } + return ap; } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAPublicKeyImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAPublicKeyImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAPublicKeyImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAPublicKeyImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -116,6 +116,9 @@ * Construct a key from its encoding. Used by RSAKeyFactory. */ RSAPublicKeyImpl(byte[] encoded) throws InvalidKeyException { + if (encoded == null || encoded.length == 0) { + throw new InvalidKeyException("Missing key encoding"); + } decode(encoded); // this sets n and e value RSAKeyFactory.checkRSAProviderKeyLengths(n.bitLength(), e); checkExponentRange(n, e); diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAUtil.java openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAUtil.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/rsa/RSAUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/rsa/RSAUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -52,7 +52,11 @@ public String keyAlgo() { return algo; } - public static KeyType lookup(String name) { + public static KeyType lookup(String name) + throws InvalidKeyException, ProviderException { + if (name == null) { + throw new InvalidKeyException("Null key algorithm"); + } for (KeyType kt : KeyType.values()) { if (kt.keyAlgo().equalsIgnoreCase(name)) { return kt; @@ -133,21 +137,24 @@ throws ProviderException { if (params == null) return null; - String algName = params.getAlgorithm(); - KeyType type = KeyType.lookup(algName); - Class<? extends AlgorithmParameterSpec> specCls; - switch (type) { - case RSA: - throw new ProviderException("No params accepted for " + - type.keyAlgo()); - case PSS: - specCls = PSSParameterSpec.class; - break; - default: - throw new ProviderException("Unsupported RSA algorithm: " + algName); - } try { + String algName = params.getAlgorithm(); + KeyType type = KeyType.lookup(algName); + Class<? extends AlgorithmParameterSpec> specCls; + switch (type) { + case RSA: + throw new ProviderException("No params accepted for " + + type.keyAlgo()); + case PSS: + specCls = PSSParameterSpec.class; + break; + default: + throw new ProviderException("Unsupported RSA algorithm: " + algName); + } return params.getParameterSpec(specCls); + } catch (ProviderException pe) { + // pass it up + throw pe; } catch (Exception e) { throw new ProviderException(e); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Alert.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Alert.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Alert.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Alert.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,274 @@ +/* + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.Locale; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLProtocolException; + +/** + * SSL/(D)TLS Alter description + */ +enum Alert { + // Please refer to TLS Alert Registry for the latest (D)TLS Alert values: + // https://www.iana.org/assignments/tls-parameters/ + CLOSE_NOTIFY ((byte)0, "close_notify", false), + UNEXPECTED_MESSAGE ((byte)10, "unexpected_message", false), + BAD_RECORD_MAC ((byte)20, "bad_record_mac", false), + DECRYPTION_FAILED ((byte)21, "decryption_failed", false), + RECORD_OVERFLOW ((byte)22, "record_overflow", false), + DECOMPRESSION_FAILURE ((byte)30, "decompression_failure", false), + HANDSHAKE_FAILURE ((byte)40, "handshake_failure", true), + NO_CERTIFICATE ((byte)41, "no_certificate", true), + BAD_CERTIFICATE ((byte)42, "bad_certificate", true), + UNSUPPORTED_CERTIFCATE ((byte)43, "unsupported_certificate", true), + CERTIFICATE_REVOKED ((byte)44, "certificate_revoked", true), + CERTIFICATE_EXPIRED ((byte)45, "certificate_expired", true), + CERTIFICATE_UNKNOWN ((byte)46, "certificate_unknown", true), + ILLEGAL_PARAMETER ((byte)47, "illegal_parameter", true), + UNKNOWN_CA ((byte)48, "unknown_ca", true), + ACCESS_DENIED ((byte)49, "access_denied", true), + DECODE_ERROR ((byte)50, "decode_error", true), + DECRYPT_ERROR ((byte)51, "decrypt_error", true), + EXPORT_RESTRICTION ((byte)60, "export_restriction", true), + PROTOCOL_VERSION ((byte)70, "protocol_version", true), + INSUFFICIENT_SECURITY ((byte)71, "insufficient_security", true), + INTERNAL_ERROR ((byte)80, "internal_error", false), + INAPPROPRIATE_FALLBACK ((byte)86, "inappropriate_fallback", false), + USER_CANCELED ((byte)90, "user_canceled", false), + NO_RENEGOTIATION ((byte)100, "no_renegotiation", true), + MISSING_EXTENSION ((byte)109, "missing_extension", true), + UNSUPPORTED_EXTENSION ((byte)110, "unsupported_extension", true), + CERT_UNOBTAINABLE ((byte)111, "certificate_unobtainable", true), + UNRECOGNIZED_NAME ((byte)112, "unrecognized_name", true), + BAD_CERT_STATUS_RESPONSE((byte)113, + "bad_certificate_status_response", true), + BAD_CERT_HASH_VALUE ((byte)114, "bad_certificate_hash_value", true), + UNKNOWN_PSK_IDENTITY ((byte)115, "unknown_psk_identity", true), + CERTIFICATE_REQUIRED ((byte)116, "certificate_required", true), + NO_APPLICATION_PROTOCOL ((byte)120, "no_application_protocol", true); + + // ordinal value of the Alert + final byte id; + + // description of the Alert + final String description; + + // Does tha alert happen during handshake only? + final boolean handshakeOnly; + + // Alert message consumer + static final SSLConsumer alertConsumer = new AlertConsumer(); + + private Alert(byte id, String description, boolean handshakeOnly) { + this.id = id; + this.description = description; + this.handshakeOnly = handshakeOnly; + } + + static Alert valueOf(byte id) { + for (Alert al : Alert.values()) { + if (al.id == id) { + return al; + } + } + + return null; + } + + static String nameOf(byte id) { + for (Alert al : Alert.values()) { + if (al.id == id) { + return al.description; + } + } + + return "UNKNOWN ALERT (" + (id & 0x0FF) + ")"; + } + + SSLException createSSLException(String reason) { + return createSSLException(reason, null); + } + + SSLException createSSLException(String reason, Throwable cause) { + if (reason == null) { + reason = (cause != null) ? cause.getMessage() : ""; + } + + SSLException ssle = (this == UNEXPECTED_MESSAGE) ? + new SSLProtocolException(reason) : + (handshakeOnly ? + new SSLHandshakeException(reason) : + new SSLException(reason)); + if (cause != null) { + ssle.initCause(cause); + } + + return ssle; + } + + /** + * SSL/(D)TLS Alert level. + */ + enum Level { + WARNING ((byte)1, "warning"), + FATAL ((byte)2, "fatal"); + + // ordinal value of the Alert level + final byte level; + + // description of the Alert level + final String description; + + private Level(byte level, String description) { + this.level = level; + this.description = description; + } + + static Level valueOf(byte level) { + for (Level lv : Level.values()) { + if (lv.level == level) { + return lv; + } + } + + return null; + } + + static String nameOf(byte level) { + for (Level lv : Level.values()) { + if (lv.level == level) { + return lv.description; + } + } + + return "UNKNOWN ALERT LEVEL (" + (level & 0x0FF) + ")"; + } + } + + /** + * The Alert message. + */ + private static final class AlertMessage { + private final byte level; // level + private final byte id; // description + + AlertMessage(TransportContext context, + ByteBuffer m) throws IOException { + // struct { + // AlertLevel level; + // AlertDescription description; + // } Alert; + if (m.remaining() != 2) { + context.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid Alert message: no sufficient data"); + } + + this.level = m.get(); // level + this.id = m.get(); // description + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"Alert\": '{'\n" + + " \"level\" : \"{0}\",\n" + + " \"description\": \"{1}\"\n" + + "'}'", + Locale.ENGLISH); + + Object[] messageFields = { + Level.nameOf(level), + Alert.nameOf(id) + }; + + return messageFormat.format(messageFields); + } + } + + /** + * Consumer of alert messages + */ + private static final class AlertConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private AlertConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer m) throws IOException { + TransportContext tc = (TransportContext)context; + + AlertMessage am = new AlertMessage(tc, m); + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("Received alert message", am); + } + + Level level = Level.valueOf(am.level); + Alert alert = Alert.valueOf(am.id); + if (alert == Alert.CLOSE_NOTIFY) { + if (tc.handshakeContext != null) { + tc.fatal(Alert.UNEXPECTED_MESSAGE, + "Received close_notify during handshake"); + } + + tc.isInputCloseNotified = true; + tc.closeInbound(); + } else if ((level == Level.WARNING) && (alert != null)) { + // Terminate the connection if an alert with a level of warning + // is received during handshaking, except the no_certificate + // warning. + if (alert.handshakeOnly && (tc.handshakeContext != null)) { + // It's OK to get a no_certificate alert from a client of + // which we requested client authentication. However, + // if we required it, then this is not acceptable. + if (tc.sslConfig.isClientMode || + alert != Alert.NO_CERTIFICATE || + (tc.sslConfig.clientAuthType != + ClientAuthType.CLIENT_AUTH_REQUESTED)) { + tc.fatal(Alert.HANDSHAKE_FAILURE, + "received handshake warning: " + alert.description); + } // Otherwise, ignore the warning + } // Otherwise, ignore the warning. + } else { // fatal or unknown + String diagnostic; + if (alert == null) { + alert = Alert.UNEXPECTED_MESSAGE; + diagnostic = "Unknown alert description (" + am.id + ")"; + } else { + diagnostic = "Received fatal alert: " + alert.description; + } + + tc.fatal(alert, diagnostic, true, null); + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Alerts.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Alerts.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Alerts.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Alerts.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,223 +0,0 @@ -/* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import javax.net.ssl.*; - -/* - * A simple class to congregate alerts, their definitions, and common - * support methods. - */ - -final class Alerts { - - /* - * Alerts are always a fixed two byte format (level/description). - */ - - // warnings and fatal errors are package private facilities/constants - - // Alert levels (enum AlertLevel) - static final byte alert_warning = 1; - static final byte alert_fatal = 2; - - /* - * Alert descriptions (enum AlertDescription) - * - * We may not use them all in our processing, but if someone - * sends us one, we can at least convert it to a string for the - * user. - */ - static final byte alert_close_notify = 0; - static final byte alert_unexpected_message = 10; - static final byte alert_bad_record_mac = 20; - static final byte alert_decryption_failed = 21; - static final byte alert_record_overflow = 22; - static final byte alert_decompression_failure = 30; - static final byte alert_handshake_failure = 40; - static final byte alert_no_certificate = 41; - static final byte alert_bad_certificate = 42; - static final byte alert_unsupported_certificate = 43; - static final byte alert_certificate_revoked = 44; - static final byte alert_certificate_expired = 45; - static final byte alert_certificate_unknown = 46; - static final byte alert_illegal_parameter = 47; - static final byte alert_unknown_ca = 48; - static final byte alert_access_denied = 49; - static final byte alert_decode_error = 50; - static final byte alert_decrypt_error = 51; - static final byte alert_export_restriction = 60; - static final byte alert_protocol_version = 70; - static final byte alert_insufficient_security = 71; - static final byte alert_internal_error = 80; - static final byte alert_user_canceled = 90; - static final byte alert_no_renegotiation = 100; - - // from RFC 3546 (TLS Extensions) - static final byte alert_unsupported_extension = 110; - static final byte alert_certificate_unobtainable = 111; - static final byte alert_unrecognized_name = 112; - static final byte alert_bad_certificate_status_response = 113; - static final byte alert_bad_certificate_hash_value = 114; - - // from RFC 7301 (TLS ALPN Extension) - static final byte alert_no_application_protocol = 120; - - static String alertDescription(byte code) { - switch (code) { - - case alert_close_notify: - return "close_notify"; - case alert_unexpected_message: - return "unexpected_message"; - case alert_bad_record_mac: - return "bad_record_mac"; - case alert_decryption_failed: - return "decryption_failed"; - case alert_record_overflow: - return "record_overflow"; - case alert_decompression_failure: - return "decompression_failure"; - case alert_handshake_failure: - return "handshake_failure"; - case alert_no_certificate: - return "no_certificate"; - case alert_bad_certificate: - return "bad_certificate"; - case alert_unsupported_certificate: - return "unsupported_certificate"; - case alert_certificate_revoked: - return "certificate_revoked"; - case alert_certificate_expired: - return "certificate_expired"; - case alert_certificate_unknown: - return "certificate_unknown"; - case alert_illegal_parameter: - return "illegal_parameter"; - case alert_unknown_ca: - return "unknown_ca"; - case alert_access_denied: - return "access_denied"; - case alert_decode_error: - return "decode_error"; - case alert_decrypt_error: - return "decrypt_error"; - case alert_export_restriction: - return "export_restriction"; - case alert_protocol_version: - return "protocol_version"; - case alert_insufficient_security: - return "insufficient_security"; - case alert_internal_error: - return "internal_error"; - case alert_user_canceled: - return "user_canceled"; - case alert_no_renegotiation: - return "no_renegotiation"; - case alert_unsupported_extension: - return "unsupported_extension"; - case alert_certificate_unobtainable: - return "certificate_unobtainable"; - case alert_unrecognized_name: - return "unrecognized_name"; - case alert_bad_certificate_status_response: - return "bad_certificate_status_response"; - case alert_bad_certificate_hash_value: - return "bad_certificate_hash_value"; - case alert_no_application_protocol: - return "no_application_protocol"; - - default: - return "<UNKNOWN ALERT: " + (code & 0x0ff) + ">"; - } - } - - static SSLException getSSLException(byte description, String reason) { - return getSSLException(description, null, reason); - } - - /* - * Try to be a little more specific in our choice of - * exceptions to throw. - */ - static SSLException getSSLException(byte description, Throwable cause, - String reason) { - - SSLException e; - // the SSLException classes do not have a no-args constructor - // make up a message if there is none - if (reason == null) { - if (cause != null) { - reason = cause.toString(); - } else { - reason = ""; - } - } - switch (description) { - case alert_handshake_failure: - case alert_no_certificate: - case alert_bad_certificate: - case alert_unsupported_certificate: - case alert_certificate_revoked: - case alert_certificate_expired: - case alert_certificate_unknown: - case alert_unknown_ca: - case alert_access_denied: - case alert_decrypt_error: - case alert_export_restriction: - case alert_insufficient_security: - case alert_unsupported_extension: - case alert_certificate_unobtainable: - case alert_unrecognized_name: - case alert_bad_certificate_status_response: - case alert_bad_certificate_hash_value: - case alert_no_application_protocol: - e = new SSLHandshakeException(reason); - break; - - case alert_close_notify: - case alert_unexpected_message: - case alert_bad_record_mac: - case alert_decryption_failed: - case alert_record_overflow: - case alert_decompression_failure: - case alert_illegal_parameter: - case alert_decode_error: - case alert_protocol_version: - case alert_internal_error: - case alert_user_canceled: - case alert_no_renegotiation: - default: - e = new SSLException(reason); - break; - } - - if (cause != null) { - e.initCause(cause); - } - return e; - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/AlpnExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,514 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.charset.StandardCharsets; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLProtocolException; +import javax.net.ssl.SSLSocket; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the "application_layer_protocol_negotiation" extensions [RFC 7301]. + */ +final class AlpnExtension { + static final HandshakeProducer chNetworkProducer = new CHAlpnProducer(); + static final ExtensionConsumer chOnLoadConsumer = new CHAlpnConsumer(); + static final HandshakeAbsence chOnLoadAbsence = new CHAlpnAbsence(); + + static final HandshakeProducer shNetworkProducer = new SHAlpnProducer(); + static final ExtensionConsumer shOnLoadConsumer = new SHAlpnConsumer(); + static final HandshakeAbsence shOnLoadAbsence = new SHAlpnAbsence(); + + // Note: we reuse ServerHello operations for EncryptedExtensions for now. + // Please be careful about any code or specification changes in the future. + static final HandshakeProducer eeNetworkProducer = new SHAlpnProducer(); + static final ExtensionConsumer eeOnLoadConsumer = new SHAlpnConsumer(); + static final HandshakeAbsence eeOnLoadAbsence = new SHAlpnAbsence(); + + static final SSLStringizer alpnStringizer = new AlpnStringizer(); + + /** + * The "application_layer_protocol_negotiation" extension. + * + * See RFC 7301 for the specification of this extension. + */ + static final class AlpnSpec implements SSLExtensionSpec { + final List<String> applicationProtocols; + + private AlpnSpec(String[] applicationProtocols) { + this.applicationProtocols = Collections.unmodifiableList( + Arrays.asList(applicationProtocols)); + } + + private AlpnSpec(ByteBuffer buffer) throws IOException { + // ProtocolName protocol_name_list<2..2^16-1>, RFC 7301. + if (buffer.remaining() < 2) { + throw new SSLProtocolException( + "Invalid application_layer_protocol_negotiation: " + + "insufficient data (length=" + buffer.remaining() + ")"); + } + + int listLen = Record.getInt16(buffer); + if (listLen < 2 || listLen != buffer.remaining()) { + throw new SSLProtocolException( + "Invalid application_layer_protocol_negotiation: " + + "incorrect list length (length=" + listLen + ")"); + } + + List<String> protocolNames = new LinkedList<>(); + while (buffer.hasRemaining()) { + // opaque ProtocolName<1..2^8-1>, RFC 7301. + byte[] bytes = Record.getBytes8(buffer); + if (bytes.length == 0) { + throw new SSLProtocolException( + "Invalid application_layer_protocol_negotiation " + + "extension: empty application protocol name"); + } + + String appProtocol = new String(bytes, StandardCharsets.UTF_8); + protocolNames.add(appProtocol); + } + + this.applicationProtocols = + Collections.unmodifiableList(protocolNames); + } + + @Override + public String toString() { + return applicationProtocols.toString(); + } + } + + private static final class AlpnStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new AlpnSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of the extension in a ClientHello + * handshake message. + */ + private static final class CHAlpnProducer implements HandshakeProducer { + static final int MAX_AP_LENGTH = 255; + static final int MAX_AP_LIST_LENGTH = 65535; + + // Prevent instantiation of this class. + private CHAlpnProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(SSLExtension.CH_ALPN)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.info( + "Ignore client unavailable extension: " + + SSLExtension.CH_ALPN.name); + } + + chc.applicationProtocol = ""; + chc.conContext.applicationProtocol = ""; + return null; + } + + String[] laps = chc.sslConfig.applicationProtocols; + if ((laps == null) || (laps.length == 0)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.info( + "No available application protocols"); + } + return null; + } + + // Produce the extension. + int listLength = 0; // ProtocolNameList length + for (String ap : laps) { + int length = ap.getBytes(StandardCharsets.UTF_8).length; + if (length == 0) { + // log the configuration problem + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.severe( + "Application protocol name cannot be empty"); + } + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Application protocol name cannot be empty"); + } + + if (length <= MAX_AP_LENGTH) { + // opaque ProtocolName<1..2^8-1>, RFC 7301. + listLength += (length + 1); + } else { + // log the configuration problem + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.severe( + "Application protocol name (" + ap + + ") exceeds the size limit (" + + MAX_AP_LENGTH + " bytes)"); + } + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Application protocol name (" + ap + + ") exceeds the size limit (" + + MAX_AP_LENGTH + " bytes)"); + } + + if (listLength > MAX_AP_LIST_LENGTH) { + // log the configuration problem + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.severe( + "The configured application protocols (" + + Arrays.toString(laps) + + ") exceed the size limit (" + + MAX_AP_LIST_LENGTH + " bytes)"); + } + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "The configured application protocols (" + + Arrays.toString(laps) + + ") exceed the size limit (" + + MAX_AP_LIST_LENGTH + " bytes)"); + } + } + + // ProtocolName protocol_name_list<2..2^16-1>, RFC 7301. + byte[] extData = new byte[listLength + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, listLength); + for (String ap : laps) { + Record.putBytes8(m, ap.getBytes(StandardCharsets.UTF_8)); + } + + // Update the context. + chc.handshakeExtensions.put(SSLExtension.CH_ALPN, + new AlpnSpec(chc.sslConfig.applicationProtocols)); + + return extData; + } + } + + /** + * Network data consumer of the extension in a ClientHello + * handshake message. + */ + private static final class CHAlpnConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHAlpnConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SSLExtension.CH_ALPN)) { + shc.applicationProtocol = ""; + shc.conContext.applicationProtocol = ""; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.info( + "Ignore server unavailable extension: " + + SSLExtension.CH_ALPN.name); + } + return; // ignore the extension + } + + // Is the extension enabled? + boolean noAPSelector; + if (shc.conContext.transport instanceof SSLEngine) { + noAPSelector = (shc.sslConfig.engineAPSelector == null); + } else { + noAPSelector = (shc.sslConfig.socketAPSelector == null); + } + + boolean noAlpnProtocols = + shc.sslConfig.applicationProtocols == null || + shc.sslConfig.applicationProtocols.length == 0; + if (noAPSelector && noAlpnProtocols) { + shc.applicationProtocol = ""; + shc.conContext.applicationProtocol = ""; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore server unenabled extension: " + + SSLExtension.CH_ALPN.name); + } + return; // ignore the extension + } + + // Parse the extension. + AlpnSpec spec; + try { + spec = new AlpnSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + if (noAPSelector) { // noAlpnProtocols is false + List<String> protocolNames = spec.applicationProtocols; + boolean matched = false; + // Use server application protocol preference order. + for (String ap : shc.sslConfig.applicationProtocols) { + if (protocolNames.contains(ap)) { + shc.applicationProtocol = ap; + shc.conContext.applicationProtocol = ap; + matched = true; + break; + } + } + + if (!matched) { + shc.conContext.fatal(Alert.NO_APPLICATION_PROTOCOL, + "No matching application layer protocol values"); + } + } // Otherwise, applicationProtocol will be set by the + // application selector callback later. + + shc.handshakeExtensions.put(SSLExtension.CH_ALPN, spec); + + // No impact on session resumption. + // + // [RFC 7301] Unlike many other TLS extensions, this extension + // does not establish properties of the session, only of the + // connection. When session resumption or session tickets are + // used, the previous contents of this extension are irrelevant, + // and only the values in the new handshake messages are + // considered. + } + } + + /** + * The absence processing if the extension is not present in + * a ClientHello handshake message. + */ + private static final class CHAlpnAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Please don't use the previous negotiated application protocol. + shc.applicationProtocol = ""; + shc.conContext.applicationProtocol = ""; + } + } + + /** + * Network data producer of the extension in the ServerHello + * handshake message. + */ + private static final class SHAlpnProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHAlpnProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // In response to ALPN request only + AlpnSpec requestedAlps = + (AlpnSpec)shc.handshakeExtensions.get(SSLExtension.CH_ALPN); + if (requestedAlps == null) { + // Ignore, this extension was not requested and accepted. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + + SSLExtension.SH_ALPN.name); + } + + shc.applicationProtocol = ""; + shc.conContext.applicationProtocol = ""; + return null; + } + + List<String> alps = requestedAlps.applicationProtocols; + if (shc.conContext.transport instanceof SSLEngine) { + if (shc.sslConfig.engineAPSelector != null) { + SSLEngine engine = (SSLEngine)shc.conContext.transport; + shc.applicationProtocol = + shc.sslConfig.engineAPSelector.apply(engine, alps); + if ((shc.applicationProtocol == null) || + (!shc.applicationProtocol.isEmpty() && + !alps.contains(shc.applicationProtocol))) { + shc.conContext.fatal(Alert.NO_APPLICATION_PROTOCOL, + "No matching application layer protocol values"); + } + } + } else { + if (shc.sslConfig.socketAPSelector != null) { + SSLSocket socket = (SSLSocket)shc.conContext.transport; + shc.applicationProtocol = + shc.sslConfig.socketAPSelector.apply(socket, alps); + if ((shc.applicationProtocol == null) || + (!shc.applicationProtocol.isEmpty() && + !alps.contains(shc.applicationProtocol))) { + shc.conContext.fatal(Alert.NO_APPLICATION_PROTOCOL, + "No matching application layer protocol values"); + } + } + } + + if ((shc.applicationProtocol == null) || + (shc.applicationProtocol.isEmpty())) { + // Ignore, no negotiated application layer protocol. + shc.applicationProtocol = ""; + shc.conContext.applicationProtocol = ""; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore, no negotiated application layer protocol"); + } + + return null; + } + + // opaque ProtocolName<1..2^8-1>, RFC 7301. + int listLen = shc.applicationProtocol.length() + 1; + // 1: length byte + // ProtocolName protocol_name_list<2..2^16-1>, RFC 7301. + byte[] extData = new byte[listLen + 2]; // 2: list length + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, listLen); + Record.putBytes8(m, + shc.applicationProtocol.getBytes(StandardCharsets.UTF_8)); + + // Update the context. + shc.conContext.applicationProtocol = shc.applicationProtocol; + + // Clean or register the extension + // + // No further use of the request and respond extension any more. + shc.handshakeExtensions.remove(SSLExtension.CH_ALPN); + + return extData; + } + } + + /** + * Network data consumer of the extension in the ServerHello + * handshake message. + */ + private static final class SHAlpnConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHAlpnConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to ALPN request only + AlpnSpec requestedAlps = + (AlpnSpec)chc.handshakeExtensions.get(SSLExtension.CH_ALPN); + if (requestedAlps == null || + requestedAlps.applicationProtocols == null || + requestedAlps.applicationProtocols.isEmpty()) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected " + SSLExtension.CH_ALPN.name + " extension"); + } + + // Parse the extension. + AlpnSpec spec; + try { + spec = new AlpnSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Only one application protocol is allowed. + if (spec.applicationProtocols.size() != 1) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid " + SSLExtension.CH_ALPN.name + " extension: " + + "Only one application protocol name " + + "is allowed in ServerHello message"); + } + + // The respond application protocol must be one of the requested. + if (!requestedAlps.applicationProtocols.containsAll( + spec.applicationProtocols)) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid " + SSLExtension.CH_ALPN.name + " extension: " + + "Only client specified application protocol " + + "is allowed in ServerHello message"); + } + + // Update the context. + chc.applicationProtocol = spec.applicationProtocols.get(0); + chc.conContext.applicationProtocol = chc.applicationProtocol; + + // Clean or register the extension + // + // No further use of the request and respond extension any more. + chc.handshakeExtensions.remove(SSLExtension.CH_ALPN); + } + } + + /** + * The absence processing if the extension is not present in + * the ServerHello handshake message. + */ + private static final class SHAlpnAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Please don't use the previous negotiated application protocol. + chc.applicationProtocol = ""; + chc.conContext.applicationProtocol = ""; + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ALPNExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ALPNExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ALPNExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ALPNExtension.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,168 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.nio.charset.*; -import java.util.*; - -import javax.net.ssl.*; - -/* - * [RFC 7301] - * This TLS extension facilitates the negotiation of application-layer protocols - * within the TLS handshake. Clients MAY include an extension of type - * "application_layer_protocol_negotiation" in the (extended) ClientHello - * message. The "extension_data" field of this extension SHALL contain a - * "ProtocolNameList" value: - * - * enum { - * application_layer_protocol_negotiation(16), (65535) - * } ExtensionType; - * - * opaque ProtocolName<1..2^8-1>; - * - * struct { - * ProtocolName protocol_name_list<2..2^16-1> - * } ProtocolNameList; - */ -final class ALPNExtension extends HelloExtension { - - final static int ALPN_HEADER_LENGTH = 1; - final static int MAX_APPLICATION_PROTOCOL_LENGTH = 255; - final static int MAX_APPLICATION_PROTOCOL_LIST_LENGTH = 65535; - private int listLength = 0; // ProtocolNameList length - private List<String> protocolNames = null; - - // constructor for ServerHello - ALPNExtension(String protocolName) throws SSLException { - this(new String[]{ protocolName }); - } - - // constructor for ClientHello - ALPNExtension(String[] protocolNames) throws SSLException { - super(ExtensionType.EXT_ALPN); - if (protocolNames.length == 0) { // never null, never empty - throw new IllegalArgumentException( - "The list of application protocols cannot be empty"); - } - this.protocolNames = Arrays.asList(protocolNames); - for (String p : protocolNames) { - int length = p.getBytes(StandardCharsets.UTF_8).length; - if (length == 0) { - throw new SSLProtocolException( - "Application protocol name is empty"); - } - if (length <= MAX_APPLICATION_PROTOCOL_LENGTH) { - listLength += length + ALPN_HEADER_LENGTH; - } else { - throw new SSLProtocolException( - "Application protocol name is too long: " + p); - } - if (listLength > MAX_APPLICATION_PROTOCOL_LIST_LENGTH) { - throw new SSLProtocolException( - "Application protocol name list is too long"); - } - } - } - - // constructor for ServerHello for parsing ALPN extension - ALPNExtension(HandshakeInStream s, int len) throws IOException { - super(ExtensionType.EXT_ALPN); - - if (len >= 2) { - listLength = s.getInt16(); // list length - if (listLength < 2 || listLength + 2 != len) { - throw new SSLProtocolException( - "Invalid " + type + " extension: incorrect list length " + - "(length=" + listLength + ")"); - } - } else { - throw new SSLProtocolException( - "Invalid " + type + " extension: insufficient data " + - "(length=" + len + ")"); - } - - int remaining = listLength; - this.protocolNames = new ArrayList<>(); - while (remaining > 0) { - // opaque ProtocolName<1..2^8-1>; // RFC 7301 - byte[] bytes = s.getBytes8(); - if (bytes.length == 0) { - throw new SSLProtocolException("Invalid " + type + - " extension: empty application protocol name"); - } - String p = - new String(bytes, StandardCharsets.UTF_8); // app protocol - protocolNames.add(p); - remaining -= bytes.length + ALPN_HEADER_LENGTH; - } - - if (remaining != 0) { - throw new SSLProtocolException( - "Invalid " + type + " extension: extra data " + - "(length=" + remaining + ")"); - } - } - - List<String> getPeerAPs() { - return protocolNames; - } - - /* - * Return the length in bytes, including extension type and length fields. - */ - @Override - int length() { - return 6 + listLength; - } - - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - s.putInt16(listLength + 2); // length of extension_data - s.putInt16(listLength); // length of ProtocolNameList - - for (String p : protocolNames) { - s.putBytes8(p.getBytes(StandardCharsets.UTF_8)); - } - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - if (protocolNames == null || protocolNames.isEmpty()) { - sb.append("<empty>"); - } else { - for (String protocolName : protocolNames) { - sb.append("[" + protocolName + "]"); - } - } - - return "Extension " + type + - ", protocol names: " + sb; - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/AppInputStream.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/AppInputStream.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/AppInputStream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/AppInputStream.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,212 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package sun.security.ssl; - -import java.io.InputStream; -import java.io.IOException; -import java.nio.ByteBuffer; - -import javax.net.ssl.SSLProtocolException; - -/** - * InputStream for application data as returned by SSLSocket.getInputStream(). - * - * @author David Brownell - */ -final class AppInputStream extends InputStream { - // the buffer size for each read of network data - private static final int READ_BUFFER_SIZE = 4096; - - // static dummy array we use to implement skip() - private static final byte[] SKIP_ARRAY = new byte[256]; - - // the related socket of the input stream - private final SSLSocketImpl socket; - - // the temporary buffer used to read network - private ByteBuffer buffer; - - // Is application data available in the stream? - private boolean appDataIsAvailable; - - // One element array used to implement the single byte read() method - private final byte[] oneByte = new byte[1]; - - AppInputStream(SSLSocketImpl conn) { - this.buffer = ByteBuffer.allocate(READ_BUFFER_SIZE); - this.socket = conn; - this.appDataIsAvailable = false; - } - - /** - * Return the minimum number of bytes that can be read without blocking. - * - * Currently not synchronized. - */ - @Override - public int available() throws IOException { - if ((!appDataIsAvailable) || socket.checkEOF()) { - return 0; - } - - return buffer.remaining(); - } - - /** - * Read a single byte, returning -1 on non-fault EOF status. - */ - @Override - public synchronized int read() throws IOException { - int n = read(oneByte, 0, 1); - if (n <= 0) { // EOF - return -1; - } - return oneByte[0] & 0xFF; - } - - /** - * Reads up to {@code len} bytes of data from the input stream into an - * array of bytes. An attempt is made to read as many as {@code len} bytes, - * but a smaller number may be read. The number of bytes actually read - * is returned as an integer. - * - * If the layer above needs more data, it asks for more, so we - * are responsible only for blocking to fill at most one buffer, - * and returning "-1" on non-fault EOF status. - */ - @Override - public synchronized int read(byte[] b, int off, int len) - throws IOException { - if (b == null) { - throw new NullPointerException(); - } else if (off < 0 || len < 0 || len > b.length - off) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return 0; - } - - if (socket.checkEOF()) { - return -1; - } - - // Read the available bytes at first. - int remains = available(); - if (remains > 0) { - int howmany = Math.min(remains, len); - buffer.get(b, off, howmany); - - return howmany; - } - - appDataIsAvailable = false; - int volume = 0; - - try { - /* - * Read data if needed ... notice that the connection guarantees - * that handshake, alert, and change cipher spec data streams are - * handled as they arrive, so we never see them here. - */ - while(volume == 0) { - // Clear the buffer for a new record reading. - buffer.clear(); - - // - // grow the buffer if needed - // - - // Read the header of a record into the buffer, and return - // the packet size. - int packetLen = socket.bytesInCompletePacket(); - if (packetLen < 0) { // EOF - return -1; - } - - // Is this packet bigger than SSL/TLS normally allows? - if (packetLen > SSLRecord.maxLargeRecordSize) { - throw new SSLProtocolException( - "Illegal packet size: " + packetLen); - } - - if (packetLen > buffer.remaining()) { - buffer = ByteBuffer.allocate(packetLen); - } - - volume = socket.readRecord(buffer); - if (volume < 0) { // EOF - return -1; - } else if (volume > 0) { - appDataIsAvailable = true; - break; - } - } - - int howmany = Math.min(len, volume); - buffer.get(b, off, howmany); - return howmany; - } catch (Exception e) { - // shutdown and rethrow (wrapped) exception as appropriate - socket.handleException(e); - - // dummy for compiler - return -1; - } - } - - - /** - * Skip n bytes. This implementation is somewhat less efficient - * than possible, but not badly so (redundant copy). We reuse - * the read() code to keep things simpler. Note that SKIP_ARRAY - * is static and may garbled by concurrent use, but we are not interested - * in the data anyway. - */ - @Override - public synchronized long skip(long n) throws IOException { - long skipped = 0; - while (n > 0) { - int len = (int)Math.min(n, SKIP_ARRAY.length); - int r = read(SKIP_ARRAY, 0, len); - if (r <= 0) { - break; - } - n -= r; - skipped += r; - } - return skipped; - } - - /* - * Socket close is already synchronized, no need to block here. - */ - @Override - public void close() throws IOException { - socket.close(); - } - - // inherit default mark/reset behavior (throw Exceptions) from InputStream -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/AppOutputStream.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/AppOutputStream.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/AppOutputStream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/AppOutputStream.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,93 +0,0 @@ -/* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.OutputStream; -import java.io.IOException; -import java.nio.ByteBuffer; - -/* - * OutputStream for application data as returned by SSLSocket.getOutputStream(). - * - * @author David Brownell - */ -class AppOutputStream extends OutputStream { - - private SSLSocketImpl socket; - - // One element array used to implement the write(byte) method - private final byte[] oneByte = new byte[1]; - - AppOutputStream(SSLSocketImpl conn) { - this.socket = conn; - } - - /** - * Write the data out, NOW. - */ - @Override - public synchronized void write(byte[] b, int off, int len) - throws IOException { - if (b == null) { - throw new NullPointerException(); - } else if (off < 0 || len < 0 || len > b.length - off) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return; - } - - // check if the Socket is invalid (error or closed) - socket.checkWrite(); - - // Delegate the writing to the underlying socket. - try { - socket.writeRecord(b, off, len); - socket.checkWrite(); - } catch (Exception e) { - // shutdown and rethrow (wrapped) exception as appropriate - socket.handleException(e); - } - } - - /** - * Write one byte now. - */ - @Override - public synchronized void write(int i) throws IOException { - oneByte[0] = (byte)i; - write(oneByte, 0, 1); - } - - /* - * Socket close is already synchronized, no need to block here. - */ - @Override - public void close() throws IOException { - socket.close(); - } - - // inherit no-op flush() -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Authenticator.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Authenticator.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Authenticator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Authenticator.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,94 +25,80 @@ package sun.security.ssl; +import java.nio.ByteBuffer; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; import java.util.Arrays; +import javax.crypto.Mac; +import javax.crypto.SecretKey; +import sun.security.ssl.CipherSuite.MacAlg; /** * This class represents an SSL/TLS/DTLS message authentication token, * which encapsulates a sequence number and ensures that attempts to * delete or reorder messages can be detected. - * - * Each connection state contains a sequence number, which is maintained - * separately for read and write states. - * - * For SSL/TLS protocols, the sequence number MUST be set to zero - * whenever a connection state is made the active state. - * - * DTLS uses an explicit sequence number, rather than an implicit one. - * Sequence numbers are maintained separately for each epoch, with - * each sequence number initially being 0 for each epoch. The sequence - * number used to compute the DTLS MAC is the 64-bit value formed by - * concatenating the epoch and the sequence number. - * - * Sequence numbers do not wrap. If an implementation would need to wrap - * a sequence number, it must renegotiate instead. A sequence number is - * incremented after each record: specifically, the first record transmitted - * under a particular connection state MUST use sequence number 0. */ -class Authenticator { - +abstract class Authenticator { // byte array containing the additional authentication information for // each record - private final byte[] block; - - // the block size of SSL v3.0: - // sequence number + record type + + record length - private static final int BLOCK_SIZE_SSL = 8 + 1 + 2; - - // the block size of TLS v1.0 and later: - // sequence number + record type + protocol version + record length - private static final int BLOCK_SIZE_TLS = 8 + 1 + 2 + 2; - - // the block size of DTLS v1.0 and later: - // epoch + sequence number + record type + protocol version + record length - private static final int BLOCK_SIZE_DTLS = 2 + 6 + 1 + 2 + 2; - - private final boolean isDTLS; - - /** - * Default construct, no message authentication token is initialized. - * - * Note that this construct can only be called for null MAC - */ - protected Authenticator(boolean isDTLS) { - if (isDTLS) { - // For DTLS protocols, plaintexts use explicit epoch and - // sequence number in each record. The first 8 byte of - // the block is initialized for null MAC so that the - // epoch and sequence number can be acquired to generate - // plaintext records. - block = new byte[8]; - } else { - block = new byte[0]; - } + protected final byte[] block; // at least 8 bytes for sequence number - this.isDTLS = isDTLS; + private Authenticator(byte[] block) { + this.block = block; } /** * Constructs the message authentication token for the specified * SSL/TLS protocol. */ - Authenticator(ProtocolVersion protocolVersion) { - if (protocolVersion.isDTLSProtocol()) { - block = new byte[BLOCK_SIZE_DTLS]; - block[9] = protocolVersion.major; - block[10] = protocolVersion.minor; - - this.isDTLS = true; - } else if (protocolVersion.v >= ProtocolVersion.TLS10.v) { - block = new byte[BLOCK_SIZE_TLS]; - block[9] = protocolVersion.major; - block[10] = protocolVersion.minor; - - this.isDTLS = false; + static Authenticator valueOf(ProtocolVersion protocolVersion) { + if (protocolVersion.isDTLS) { + if (protocolVersion.useTLS13PlusSpec()) { + return new DTLS13Authenticator(protocolVersion); + } else { + return new DTLS10Authenticator(protocolVersion); + } } else { - block = new byte[BLOCK_SIZE_SSL]; + if (protocolVersion.useTLS13PlusSpec()) { + return new TLS13Authenticator(protocolVersion); + } else if (protocolVersion.useTLS10PlusSpec()) { + return new TLS10Authenticator(protocolVersion); + } else { + return new SSL30Authenticator(); + } + } + } - this.isDTLS = false; + @SuppressWarnings({"unchecked"}) + static <T extends Authenticator & MAC> T + valueOf(ProtocolVersion protocolVersion, MacAlg macAlg, + SecretKey key) throws NoSuchAlgorithmException, + InvalidKeyException { + if (protocolVersion.isDTLS) { + if (protocolVersion.useTLS13PlusSpec()) { + throw new RuntimeException("No MacAlg used in DTLS 1.3"); + } else { + return (T)(new DTLS10Mac(protocolVersion, macAlg, key)); + } + } else { + if (protocolVersion.useTLS13PlusSpec()) { + throw new RuntimeException("No MacAlg used in TLS 1.3"); + } else if (protocolVersion.useTLS10PlusSpec()) { + return (T)(new TLS10Mac(protocolVersion, macAlg, key)); + } else { + return (T)(new SSL30Mac(protocolVersion, macAlg, key)); + } } } + static Authenticator nullTlsMac() { + return new SSLNullMac(); + } + + static Authenticator nullDtlsMac() { + return new DTLSNullMac(); + } + /** * Checks whether the sequence number is close to wrap. * @@ -122,25 +108,7 @@ * * @return true if the sequence number is close to wrap */ - final boolean seqNumOverflow() { - /* - * Conservatively, we don't allow more records to be generated - * when there are only 2^8 sequence numbers left. - */ - if (isDTLS) { - return (block.length != 0 && - // no epoch bytes, block[0] and block[1] - block[2] == (byte)0xFF && block[3] == (byte)0xFF && - block[4] == (byte)0xFF && block[5] == (byte)0xFF && - block[6] == (byte)0xFF); - } else { - return (block.length != 0 && - block[0] == (byte)0xFF && block[1] == (byte)0xFF && - block[2] == (byte)0xFF && block[3] == (byte)0xFF && - block[4] == (byte)0xFF && block[5] == (byte)0xFF && - block[6] == (byte)0xFF); - } - } + abstract boolean seqNumOverflow(); /** * Checks whether the sequence number close to renew. @@ -152,21 +120,7 @@ * * @return true if the sequence number is huge enough to renew */ - final boolean seqNumIsHuge() { - /* - * Conservatively, we should ask for renegotiation when there are - * only 2^32 sequence numbers left. - */ - if (isDTLS) { - return (block.length != 0 && - // no epoch bytes, block[0] and block[1] - block[2] == (byte)0xFF && block[3] == (byte)0xFF); - } else { - return (block.length != 0 && - block[0] == (byte)0xFF && block[1] == (byte)0xFF && - block[2] == (byte)0xFF && block[3] == (byte)0xFF); - } - } + abstract boolean seqNumIsHuge(); /** * Gets the current sequence number, including the epoch number for @@ -181,14 +135,9 @@ /** * Sets the epoch number (only apply to DTLS protocols). */ - final void setEpochNumber(int epoch) { - if (!isDTLS) { - throw new RuntimeException( + void setEpochNumber(int epoch) { + throw new UnsupportedOperationException( "Epoch numbers apply to DTLS protocols only"); - } - - block[0] = (byte)((epoch >> 8) & 0xFF); - block[1] = (byte)(epoch & 0xFF); } /** @@ -208,7 +157,7 @@ /** * Acquires the current message authentication information with the * specified record type and fragment length, and then increases the - * sequence number. + * sequence number if using implicit sequence number. * * @param type the record type * @param length the fragment of the record @@ -216,32 +165,465 @@ * * @return the byte array of the current message authentication information */ - final byte[] acquireAuthenticationBytes( + byte[] acquireAuthenticationBytes( byte type, int length, byte[] sequence) { + throw new UnsupportedOperationException("Used by AEAD algorithms only"); + } + + private static class SSLAuthenticator extends Authenticator { + private SSLAuthenticator(byte[] block) { + super(block); + } - byte[] copy = block.clone(); - if (sequence != null) { - if (sequence.length != 8) { - throw new RuntimeException( - "Insufficient explicit sequence number bytes"); + @Override + boolean seqNumOverflow() { + /* + * Conservatively, we don't allow more records to be generated + * when there are only 2^8 sequence numbers left. + */ + return (block.length != 0 && + block[0] == (byte)0xFF && block[1] == (byte)0xFF && + block[2] == (byte)0xFF && block[3] == (byte)0xFF && + block[4] == (byte)0xFF && block[5] == (byte)0xFF && + block[6] == (byte)0xFF); + } + + @Override + boolean seqNumIsHuge() { + return (block.length != 0 && + block[0] == (byte)0xFF && block[1] == (byte)0xFF && + block[2] == (byte)0xFF && block[3] == (byte)0xFF); + } + } + + // For null MAC only. + private static class SSLNullAuthenticator extends SSLAuthenticator { + private SSLNullAuthenticator() { + super(new byte[8]); + } + } + + // For SSL 3.0 + private static class SSL30Authenticator extends SSLAuthenticator { + // Block size of SSL v3.0: + // sequence number + record type + + record length + private static final int BLOCK_SIZE = 11; // 8 + 1 + 2 + + private SSL30Authenticator() { + super(new byte[BLOCK_SIZE]); + } + + @Override + byte[] acquireAuthenticationBytes( + byte type, int length, byte[] sequence) { + byte[] ad = block.clone(); + + // Increase the implicit sequence number in the block array. + increaseSequenceNumber(); + + ad[8] = type; + ad[9] = (byte)(length >> 8); + ad[10] = (byte)(length); + + return ad; + } + } + + // For TLS 1.0 - 1.2 + private static class TLS10Authenticator extends SSLAuthenticator { + // Block size of TLS v1.0/1.1/1.2. + // sequence number + record type + protocol version + record length + private static final int BLOCK_SIZE = 13; // 8 + 1 + 2 + 2 + + private TLS10Authenticator(ProtocolVersion protocolVersion) { + super(new byte[BLOCK_SIZE]); + block[9] = protocolVersion.major; + block[10] = protocolVersion.minor; + } + + @Override + byte[] acquireAuthenticationBytes( + byte type, int length, byte[] sequence) { + byte[] ad = block.clone(); + if (sequence != null) { + if (sequence.length != 8) { + throw new RuntimeException( + "Insufficient explicit sequence number bytes"); + } + + System.arraycopy(sequence, 0, ad, 0, sequence.length); + } else { // Otherwise, use the implicit sequence number. + // Increase the implicit sequence number in the block array. + increaseSequenceNumber(); } - System.arraycopy(sequence, 0, copy, 0, sequence.length); - } // Otherwise, use the implicit sequence number. + ad[8] = type; + ad[11] = (byte)(length >> 8); + ad[12] = (byte)(length); + + return ad; + } + } - if (block.length != 0) { - copy[8] = type; + // For TLS 1.3 + private static final class TLS13Authenticator extends SSLAuthenticator { + // Block size of TLS v1.3: + // record type + protocol version + record length + sequence number + private static final int BLOCK_SIZE = 13; // 1 + 2 + 2 + 8 + + private TLS13Authenticator(ProtocolVersion protocolVersion) { + super(new byte[BLOCK_SIZE]); + block[9] = ProtocolVersion.TLS12.major; + block[10] = ProtocolVersion.TLS12.minor; + } - copy[copy.length - 2] = (byte)(length >> 8); - copy[copy.length - 1] = (byte)(length); + @Override + byte[] acquireAuthenticationBytes( + byte type, int length, byte[] sequence) { + byte[] ad = Arrays.copyOfRange(block, 8, 13); + + // Increase the implicit sequence number in the block array. + increaseSequenceNumber(); + + ad[0] = type; + ad[3] = (byte)(length >> 8); + ad[4] = (byte)(length & 0xFF); - if (sequence == null || sequence.length != 0) { + return ad; + } + } + + private static class DTLSAuthenticator extends Authenticator { + private DTLSAuthenticator(byte[] block) { + super(block); + } + + @Override + boolean seqNumOverflow() { + /* + * Conservatively, we don't allow more records to be generated + * when there are only 2^8 sequence numbers left. + */ + return (block.length != 0 && + // no epoch bytes, block[0] and block[1] + block[2] == (byte)0xFF && block[3] == (byte)0xFF && + block[4] == (byte)0xFF && block[5] == (byte)0xFF && + block[6] == (byte)0xFF); + } + + @Override + boolean seqNumIsHuge() { + return (block.length != 0 && + // no epoch bytes, block[0] and block[1] + block[2] == (byte)0xFF && block[3] == (byte)0xFF); + } + + @Override + void setEpochNumber(int epoch) { + block[0] = (byte)((epoch >> 8) & 0xFF); + block[1] = (byte)(epoch & 0xFF); + } + } + + // For null MAC only. + private static class DTLSNullAuthenticator extends DTLSAuthenticator { + private DTLSNullAuthenticator() { + // For DTLS protocols, plaintexts use explicit epoch and + // sequence number in each record. The first 8 byte of + // the block is initialized for null MAC so that the + // epoch and sequence number can be acquired to generate + // plaintext records. + super(new byte[8]); + } + } + + // DTLS 1.0/1.2 + private static class DTLS10Authenticator extends DTLSAuthenticator { + // Block size of DTLS v1.0 and later: + // epoch + sequence number + + // record type + protocol version + record length + private static final int BLOCK_SIZE = 13; // 2 + 6 + 1 + 2 + 2; + + private DTLS10Authenticator(ProtocolVersion protocolVersion) { + super(new byte[BLOCK_SIZE]); + block[9] = protocolVersion.major; + block[10] = protocolVersion.minor; + } + + @Override + byte[] acquireAuthenticationBytes( + byte type, int length, byte[] sequence) { + byte[] ad = block.clone(); + if (sequence != null) { + if (sequence.length != 8) { + throw new RuntimeException( + "Insufficient explicit sequence number bytes"); + } + + System.arraycopy(sequence, 0, ad, 0, sequence.length); + } else { // Otherwise, use the implicit sequence number. // Increase the implicit sequence number in the block array. increaseSequenceNumber(); } + + ad[8] = type; + ad[11] = (byte)(length >> 8); + ad[12] = (byte)(length); + + return ad; + } + } + + // DTLS 1.3 + private static final class DTLS13Authenticator extends DTLSAuthenticator { + // Block size of DTLS v1.0 and later: + // epoch + sequence number + + // record type + protocol version + record length + private static final int BLOCK_SIZE = 13; // 2 + 6 + 1 + 2 + 2; + + private DTLS13Authenticator(ProtocolVersion protocolVersion) { + super(new byte[BLOCK_SIZE]); + block[9] = ProtocolVersion.TLS12.major; + block[10] = ProtocolVersion.TLS12.minor; + } + + @Override + byte[] acquireAuthenticationBytes( + byte type, int length, byte[] sequence) { + byte[] ad = Arrays.copyOfRange(block, 8, 13); + + // Increase the implicit sequence number in the block array. + increaseSequenceNumber(); + + ad[0] = type; + ad[3] = (byte)(length >> 8); + ad[4] = (byte)(length & 0xFF); + + return ad; + } + } + + interface MAC { + MacAlg macAlg(); + + /** + * Compute and returns the MAC for the remaining data + * in this ByteBuffer. + * + * On return, the bb position == limit, and limit will + * have not changed. + * + * @param type record type + * @param bb a ByteBuffer in which the position and limit + * demarcate the data to be MAC'd. + * @param isSimulated if true, simulate the MAC computation + * @param sequence the explicit sequence number, or null if using + * the implicit sequence number for the computation + * + * @return the MAC result + */ + byte[] compute(byte type, ByteBuffer bb, + byte[] sequence, boolean isSimulated); + + + /** + * Compute and returns the MAC for the remaining data + * in this ByteBuffer. + * + * On return, the bb position == limit, and limit will + * have not changed. + * + * @param type record type + * @param bb a ByteBuffer in which the position and limit + * demarcate the data to be MAC'd. + * @param isSimulated if true, simulate the MAC computation + * + * @return the MAC result + */ + default byte[] compute(byte type, ByteBuffer bb, boolean isSimulated) { + return compute(type, bb, null, isSimulated); + } + } + + private class MacImpl implements MAC { + // internal identifier for the MAC algorithm + private final MacAlg macAlg; + + // JCE Mac object + private final Mac mac; + + private MacImpl() { + macAlg = MacAlg.M_NULL; + mac = null; + } + + private MacImpl(ProtocolVersion protocolVersion, MacAlg macAlg, + SecretKey key) throws NoSuchAlgorithmException, + InvalidKeyException { + if (macAlg == null) { + throw new RuntimeException("Null MacAlg"); + } + + // using SSL MAC computation? + boolean useSSLMac = (protocolVersion.id < ProtocolVersion.TLS10.id); + String algorithm; + switch (macAlg) { + case M_MD5: + algorithm = useSSLMac ? "SslMacMD5" : "HmacMD5"; + break; + case M_SHA: + algorithm = useSSLMac ? "SslMacSHA1" : "HmacSHA1"; + break; + case M_SHA256: + algorithm = "HmacSHA256"; // TLS 1.2+ + break; + case M_SHA384: + algorithm = "HmacSHA384"; // TLS 1.2+ + break; + default: + throw new RuntimeException("Unknown MacAlg " + macAlg); + } + + Mac m = JsseJce.getMac(algorithm); + m.init(key); + this.macAlg = macAlg; + this.mac = m; + } + + @Override + public MacAlg macAlg() { + return macAlg; + } + + @Override + public byte[] compute(byte type, ByteBuffer bb, + byte[] sequence, boolean isSimulated) { + + if (macAlg.size == 0) { + return new byte[0]; + } + + if (!isSimulated) { + // Uses the explicit sequence number for the computation. + byte[] additional = + acquireAuthenticationBytes(type, bb.remaining(), sequence); + mac.update(additional); + } + mac.update(bb); + + return mac.doFinal(); + } + } + + // NULL SSL MAC + private static final + class SSLNullMac extends SSLNullAuthenticator implements MAC { + private final MacImpl macImpl; + public SSLNullMac() { + super(); + this.macImpl = new MacImpl(); } - return copy; + @Override + public MacAlg macAlg() { + return macImpl.macAlg; + } + + @Override + public byte[] compute(byte type, ByteBuffer bb, + byte[] sequence, boolean isSimulated) { + return macImpl.compute(type, bb, sequence, isSimulated); + } + } + + // For SSL 3.0 + private static final + class SSL30Mac extends SSL30Authenticator implements MAC { + private final MacImpl macImpl; + public SSL30Mac(ProtocolVersion protocolVersion, + MacAlg macAlg, SecretKey key) throws NoSuchAlgorithmException, + InvalidKeyException { + super(); + this.macImpl = new MacImpl(protocolVersion, macAlg, key); + } + + @Override + public MacAlg macAlg() { + return macImpl.macAlg; + } + + @Override + public byte[] compute(byte type, ByteBuffer bb, + byte[] sequence, boolean isSimulated) { + return macImpl.compute(type, bb, sequence, isSimulated); + } + } + + // For TLS 1.0 - 1.2 + private static final + class TLS10Mac extends TLS10Authenticator implements MAC { + private final MacImpl macImpl; + public TLS10Mac(ProtocolVersion protocolVersion, + MacAlg macAlg, SecretKey key) throws NoSuchAlgorithmException, + InvalidKeyException { + super(protocolVersion); + this.macImpl = new MacImpl(protocolVersion, macAlg, key); + } + + @Override + public MacAlg macAlg() { + return macImpl.macAlg; + } + + @Override + public byte[] compute(byte type, ByteBuffer bb, + byte[] sequence, boolean isSimulated) { + return macImpl.compute(type, bb, sequence, isSimulated); + } + } + + // NULL DTLS MAC + private static final + class DTLSNullMac extends DTLSNullAuthenticator implements MAC { + private final MacImpl macImpl; + public DTLSNullMac() { + super(); + this.macImpl = new MacImpl(); + } + + @Override + public MacAlg macAlg() { + return macImpl.macAlg; + } + + @Override + public byte[] compute(byte type, ByteBuffer bb, + byte[] sequence, boolean isSimulated) { + return macImpl.compute(type, bb, sequence, isSimulated); + } + } + + // DTLS 1.0/1.2 + private static final class DTLS10Mac + extends DTLS10Authenticator implements MAC { + private final MacImpl macImpl; + public DTLS10Mac(ProtocolVersion protocolVersion, + MacAlg macAlg, SecretKey key) throws NoSuchAlgorithmException, + InvalidKeyException { + super(protocolVersion); + this.macImpl = new MacImpl(protocolVersion, macAlg, key); + } + + @Override + public MacAlg macAlg() { + return macImpl.macAlg; + } + + @Override + public byte[] compute(byte type, ByteBuffer bb, + byte[] sequence, boolean isSimulated) { + return macImpl.compute(type, bb, sequence, isSimulated); + } } static final long toLong(byte[] recordEnS) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/BaseSSLSocketImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,24 +26,23 @@ package sun.security.ssl; import java.io.*; -import java.nio.channels.SocketChannel; import java.net.*; +import java.nio.channels.SocketChannel; import java.util.Set; - import javax.net.ssl.*; /** - * Abstract base class for SSLSocketImpl. Its purpose is to house code with - * no SSL related logic (or no logic at all). This makes SSLSocketImpl shorter - * and easier to read. It contains a few constants and static methods plus - * overridden java.net.Socket methods. + * Abstract base class for SSLSocketImpl. + * + * Its purpose is to house code with no SSL related logic (or no logic at all). + * This makes SSLSocketImpl shorter and easier to read. It contains a few + * constants and static methods plus overridden java.net.Socket methods. * * Methods are defined final to ensure that they are not accidentally * overridden in SSLSocketImpl. * * @see javax.net.ssl.SSLSocket * @see SSLSocketImpl - * */ abstract class BaseSSLSocketImpl extends SSLSocket { @@ -92,7 +91,7 @@ "com.sun.net.ssl.requireCloseNotify"; static final boolean requireCloseNotify = - Debug.getBooleanProperty(PROP_NAME, false); + Utilities.getBooleanProperty(PROP_NAME, false); // // MISC SOCKET METHODS diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ByteBufferInputStream.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ByteBufferInputStream.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ByteBufferInputStream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ByteBufferInputStream.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.*; -import java.nio.*; - -/** - * A simple InputStream which uses ByteBuffers as it's backing store. - * <P> - * The only IOException should come if the InputStream has been closed. - * All other IOException should not occur because all the data is local. - * Data reads on an exhausted ByteBuffer returns a -1. - * - * @author Brad Wetmore - */ -class ByteBufferInputStream extends InputStream { - - ByteBuffer bb; - - ByteBufferInputStream(ByteBuffer bb) { - this.bb = bb; - } - - /** - * Returns a byte from the ByteBuffer. - * - * Increments position(). - */ - @Override - public int read() throws IOException { - - if (bb == null) { - throw new IOException("read on a closed InputStream"); - } - - if (bb.remaining() == 0) { - return -1; - } - - return (bb.get() & 0xFF); // need to be in the range 0 to 255 - } - - /** - * Returns a byte array from the ByteBuffer. - * - * Increments position(). - */ - @Override - public int read(byte[] b) throws IOException { - - if (bb == null) { - throw new IOException("read on a closed InputStream"); - } - - return read(b, 0, b.length); - } - - /** - * Returns a byte array from the ByteBuffer. - * - * Increments position(). - */ - @Override - public int read(byte[] b, int off, int len) throws IOException { - - if (bb == null) { - throw new IOException("read on a closed InputStream"); - } - - if (b == null) { - throw new NullPointerException(); - } else if (off < 0 || len < 0 || len > b.length - off) { - throw new IndexOutOfBoundsException(); - } else if (len == 0) { - return 0; - } - - int length = Math.min(bb.remaining(), len); - if (length == 0) { - return -1; - } - - bb.get(b, off, length); - return length; - } - - /** - * Skips over and discards <code>n</code> bytes of data from this input - * stream. - */ - @Override - public long skip(long n) throws IOException { - - if (bb == null) { - throw new IOException("skip on a closed InputStream"); - } - - if (n <= 0) { - return 0; - } - - /* - * ByteBuffers have at most an int, so lose the upper bits. - * The contract allows this. - */ - int nInt = (int) n; - int skip = Math.min(bb.remaining(), nInt); - - bb.position(bb.position() + skip); - - return nInt; - } - - /** - * Returns the number of bytes that can be read (or skipped over) - * from this input stream without blocking by the next caller of a - * method for this input stream. - */ - @Override - public int available() throws IOException { - - if (bb == null) { - throw new IOException("available on a closed InputStream"); - } - - return bb.remaining(); - } - - /** - * Closes this input stream and releases any system resources associated - * with the stream. - * - * @exception IOException if an I/O error occurs. - */ - @Override - public void close() throws IOException { - bb = null; - } - - /** - * Marks the current position in this input stream. - */ - @Override - public synchronized void mark(int readlimit) {} - - /** - * Repositions this stream to the position at the time the - * <code>mark</code> method was last called on this input stream. - */ - @Override - public synchronized void reset() throws IOException { - throw new IOException("mark/reset not supported"); - } - - /** - * Tests if this input stream supports the <code>mark</code> and - * <code>reset</code> methods. - */ - @Override - public boolean markSupported() { - return false; - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertificateMessage.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1370 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.PublicKey; +import java.security.cert.CertPathValidatorException; +import java.security.cert.CertPathValidatorException.BasicReason; +import java.security.cert.CertPathValidatorException.Reason; +import java.security.cert.CertificateEncodingException; +import java.security.cert.CertificateException; +import java.security.cert.CertificateFactory; +import java.security.cert.CertificateParsingException; +import java.security.cert.X509Certificate; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLProtocolException; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.X509ExtendedTrustManager; +import javax.net.ssl.X509TrustManager; +import javax.security.auth.x500.X500Principal; +import static sun.security.ssl.ClientAuthType.CLIENT_AUTH_REQUIRED; +import sun.security.ssl.ClientHello.ClientHelloMessage; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.X509Authentication.X509Credentials; +import sun.security.ssl.X509Authentication.X509Possession; + +/** + * Pack of the CertificateMessage handshake message. + */ +final class CertificateMessage { + static final SSLConsumer t12HandshakeConsumer = + new T12CertificateConsumer(); + static final HandshakeProducer t12HandshakeProducer = + new T12CertificateProducer(); + + static final SSLConsumer t13HandshakeConsumer = + new T13CertificateConsumer(); + static final HandshakeProducer t13HandshakeProducer = + new T13CertificateProducer(); + + /** + * The Certificate handshake message for TLS 1.2 and previous + * SSL/TLS protocol versions. + * + * In server mode, the certificate handshake message is sent whenever the + * agreed-upon key exchange method uses certificates for authentication. + * In client mode, this message is only sent if the server requests a + * certificate for client authentication. + * + * opaque ASN.1Cert<1..2^24-1>; + * + * SSL 3.0: + * struct { + * ASN.1Cert certificate_list<1..2^24-1>; + * } Certificate; + * Note: For SSL 3.0 client authentication, if no suitable certificate + * is available, the client should send a no_certificate alert instead. + * This alert is only a warning; however, the server may respond with + * a fatal handshake failure alert if client authentication is required. + * + * TLS 1.0/1.1/1.2: + * struct { + * ASN.1Cert certificate_list<0..2^24-1>; + * } Certificate; + */ + static final class T12CertificateMessage extends HandshakeMessage { + final List<byte[]> encodedCertChain; + + T12CertificateMessage(HandshakeContext handshakeContext, + X509Certificate[] certChain) throws SSLException { + super(handshakeContext); + + List<byte[]> encodedCerts = new ArrayList<>(certChain.length); + for (X509Certificate cert : certChain) { + try { + encodedCerts.add(cert.getEncoded()); + } catch (CertificateEncodingException cee) { + // unlikely + handshakeContext.conContext.fatal(Alert.INTERNAL_ERROR, + "Could not encode certificate (" + + cert.getSubjectX500Principal() + ")", cee); + break; + } + } + + this.encodedCertChain = encodedCerts; + } + + T12CertificateMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + int listLen = Record.getInt24(m); + if (listLen > m.remaining()) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Error parsing certificate message:no sufficient data"); + } + if (listLen > 0) { + List<byte[]> encodedCerts = new LinkedList<>(); + while (listLen > 0) { + byte[] encodedCert = Record.getBytes24(m); + listLen -= (3 + encodedCert.length); + encodedCerts.add(encodedCert); + } + this.encodedCertChain = encodedCerts; + } else { + this.encodedCertChain = Collections.emptyList(); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE; + } + + @Override + public int messageLength() { + int msgLen = 3; + for (byte[] encodedCert : encodedCertChain) { + msgLen += (encodedCert.length + 3); + } + + return msgLen; + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + int listLen = 0; + for (byte[] encodedCert : encodedCertChain) { + listLen += (encodedCert.length + 3); + } + + hos.putInt24(listLen); + for (byte[] encodedCert : encodedCertChain) { + hos.putBytes24(encodedCert); + } + } + + @Override + public String toString() { + if (encodedCertChain.isEmpty()) { + return "\"Certificates\": <empty list>"; + } + + Object[] x509Certs = new Object[encodedCertChain.size()]; + try { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + int i = 0; + for (byte[] encodedCert : encodedCertChain) { + Object obj; + try { + obj = (X509Certificate)cf.generateCertificate( + new ByteArrayInputStream(encodedCert)); + } catch (CertificateException ce) { + obj = encodedCert; + } + x509Certs[i++] = obj; + } + } catch (CertificateException ce) { + // no X.509 certificate factory service + int i = 0; + for (byte[] encodedCert : encodedCertChain) { + x509Certs[i++] = encodedCert; + } + } + + MessageFormat messageFormat = new MessageFormat( + "\"Certificates\": [\n" + + "{0}\n" + + "]", + Locale.ENGLISH); + Object[] messageFields = { + SSLLogger.toString(x509Certs) + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "Certificate" handshake message producer for TLS 1.2 and + * previous SSL/TLS protocol versions. + */ + private static final + class T12CertificateProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T12CertificateProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + if (hc.sslConfig.isClientMode) { + return onProduceCertificate( + (ClientHandshakeContext)context, message); + } else { + return onProduceCertificate( + (ServerHandshakeContext)context, message); + } + } + + private byte[] onProduceCertificate(ServerHandshakeContext shc, + SSLHandshake.HandshakeMessage message) throws IOException { + X509Possession x509Possession = null; + for (SSLPossession possession : shc.handshakePossessions) { + if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + break; + } + } + + if (x509Possession == null) { // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "No expected X.509 certificate for server authentication"); + + return null; // make the compiler happy + } + + shc.handshakeSession.setLocalPrivateKey( + x509Possession.popPrivateKey); + shc.handshakeSession.setLocalCertificates(x509Possession.popCerts); + T12CertificateMessage cm = + new T12CertificateMessage(shc, x509Possession.popCerts); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced server Certificate handshake message", cm); + } + + // Output the handshake message. + cm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + + private byte[] onProduceCertificate(ClientHandshakeContext chc, + SSLHandshake.HandshakeMessage message) throws IOException { + X509Possession x509Possession = null; + for (SSLPossession possession : chc.handshakePossessions) { + if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + break; + } + } + + // Report to the server if no appropriate cert was found. For + // SSL 3.0, send a no_certificate alert; TLS 1.0/1.1/1.2 uses + // an empty cert chain instead. + if (x509Possession == null) { + if (chc.negotiatedProtocol.useTLS10PlusSpec()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "No X.509 certificate for client authentication, " + + "use empty Certificate message instead"); + } + + x509Possession = + new X509Possession(null, new X509Certificate[0]); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "No X.509 certificate for client authentication, " + + "send a no_certificate alert"); + } + + chc.conContext.warning(Alert.NO_CERTIFICATE); + return null; + } + } + + chc.handshakeSession.setLocalPrivateKey( + x509Possession.popPrivateKey); + if (x509Possession.popCerts != null && + x509Possession.popCerts.length != 0) { + chc.handshakeSession.setLocalCertificates( + x509Possession.popCerts); + } else { + chc.handshakeSession.setLocalCertificates(null); + } + T12CertificateMessage cm = + new T12CertificateMessage(chc, x509Possession.popCerts); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced client Certificate handshake message", cm); + } + + // Output the handshake message. + cm.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "Certificate" handshake message consumer for TLS 1.2 and + * previous SSL/TLS protocol versions. + */ + static final + class T12CertificateConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T12CertificateConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + + // clean up this consumer + hc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE.id); + + T12CertificateMessage cm = new T12CertificateMessage(hc, message); + if (hc.sslConfig.isClientMode) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming server Certificate handshake message", cm); + } + onCertificate((ClientHandshakeContext)context, cm); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming client Certificate handshake message", cm); + } + onCertificate((ServerHandshakeContext)context, cm); + } + } + + private void onCertificate(ServerHandshakeContext shc, + T12CertificateMessage certificateMessage )throws IOException { + List<byte[]> encodedCerts = certificateMessage.encodedCertChain; + if (encodedCerts == null || encodedCerts.isEmpty()) { + if (shc.sslConfig.clientAuthType != + ClientAuthType.CLIENT_AUTH_REQUESTED) { + // unexpected or require client authentication + shc.conContext.fatal(Alert.BAD_CERTIFICATE, + "Empty server certificate chain"); + } else { + return; + } + } + + X509Certificate[] x509Certs = + new X509Certificate[encodedCerts.size()]; + try { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + int i = 0; + for (byte[] encodedCert : encodedCerts) { + x509Certs[i++] = (X509Certificate)cf.generateCertificate( + new ByteArrayInputStream(encodedCert)); + } + } catch (CertificateException ce) { + shc.conContext.fatal(Alert.BAD_CERTIFICATE, + "Failed to parse server certificates", ce); + } + + checkClientCerts(shc, x509Certs); + + // + // update + // + shc.handshakeCredentials.add( + new X509Credentials(x509Certs[0].getPublicKey(), x509Certs)); + shc.handshakeSession.setPeerCertificates(x509Certs); + } + + private void onCertificate(ClientHandshakeContext chc, + T12CertificateMessage certificateMessage) throws IOException { + List<byte[]> encodedCerts = certificateMessage.encodedCertChain; + if (encodedCerts == null || encodedCerts.isEmpty()) { + chc.conContext.fatal(Alert.BAD_CERTIFICATE, + "Empty server certificate chain"); + } + + X509Certificate[] x509Certs = + new X509Certificate[encodedCerts.size()]; + try { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + int i = 0; + for (byte[] encodedCert : encodedCerts) { + x509Certs[i++] = (X509Certificate)cf.generateCertificate( + new ByteArrayInputStream(encodedCert)); + } + } catch (CertificateException ce) { + chc.conContext.fatal(Alert.BAD_CERTIFICATE, + "Failed to parse server certificates", ce); + } + + // Allow server certificate change in client side during + // renegotiation after a session-resumption abbreviated + // initial handshake? + // + // DO NOT need to check allowUnsafeServerCertChange here. We only + // reserve server certificates when allowUnsafeServerCertChange is + // false. + if (chc.reservedServerCerts != null && + !chc.handshakeSession.useExtendedMasterSecret) { + // It is not necessary to check the certificate update if + // endpoint identification is enabled. + String identityAlg = chc.sslConfig.identificationProtocol; + if ((identityAlg == null || identityAlg.length() == 0) && + !isIdentityEquivalent(x509Certs[0], + chc.reservedServerCerts[0])) { + chc.conContext.fatal(Alert.BAD_CERTIFICATE, + "server certificate change is restricted " + + "during renegotiation"); + } + } + + // ask the trust manager to verify the chain + if (chc.staplingActive) { + // Defer the certificate check until after we've received the + // CertificateStatus message. If that message doesn't come in + // immediately following this message we will execute the + // check from CertificateStatus' absent handler. + chc.deferredCerts = x509Certs; + } else { + // We're not doing stapling, so perform the check right now + checkServerCerts(chc, x509Certs); + } + + // + // update + // + chc.handshakeCredentials.add( + new X509Credentials(x509Certs[0].getPublicKey(), x509Certs)); + chc.handshakeSession.setPeerCertificates(x509Certs); + } + + /* + * Whether the certificates can represent the same identity? + * + * The certificates can be used to represent the same identity: + * 1. If the subject alternative names of IP address are present + * in both certificates, they should be identical; otherwise, + * 2. if the subject alternative names of DNS name are present in + * both certificates, they should be identical; otherwise, + * 3. if the subject fields are present in both certificates, the + * certificate subjects and issuers should be identical. + */ + private static boolean isIdentityEquivalent(X509Certificate thisCert, + X509Certificate prevCert) { + if (thisCert.equals(prevCert)) { + return true; + } + + // check subject alternative names + Collection<List<?>> thisSubjectAltNames = null; + try { + thisSubjectAltNames = thisCert.getSubjectAlternativeNames(); + } catch (CertificateParsingException cpe) { + if (SSLLogger.isOn && SSLLogger.isOn("handshake")) { + SSLLogger.fine( + "Attempt to obtain subjectAltNames extension failed!"); + } + } + + Collection<List<?>> prevSubjectAltNames = null; + try { + prevSubjectAltNames = prevCert.getSubjectAlternativeNames(); + } catch (CertificateParsingException cpe) { + if (SSLLogger.isOn && SSLLogger.isOn("handshake")) { + SSLLogger.fine( + "Attempt to obtain subjectAltNames extension failed!"); + } + } + + if (thisSubjectAltNames != null && prevSubjectAltNames != null) { + // check the iPAddress field in subjectAltName extension + // + // 7: subject alternative name of type IP. + Collection<String> thisSubAltIPAddrs = + getSubjectAltNames(thisSubjectAltNames, 7); + Collection<String> prevSubAltIPAddrs = + getSubjectAltNames(prevSubjectAltNames, 7); + if (thisSubAltIPAddrs != null && prevSubAltIPAddrs != null && + isEquivalent(thisSubAltIPAddrs, prevSubAltIPAddrs)) { + return true; + } + + // check the dNSName field in subjectAltName extension + // 2: subject alternative name of type IP. + Collection<String> thisSubAltDnsNames = + getSubjectAltNames(thisSubjectAltNames, 2); + Collection<String> prevSubAltDnsNames = + getSubjectAltNames(prevSubjectAltNames, 2); + if (thisSubAltDnsNames != null && prevSubAltDnsNames != null && + isEquivalent(thisSubAltDnsNames, prevSubAltDnsNames)) { + return true; + } + } + + // check the certificate subject and issuer + X500Principal thisSubject = thisCert.getSubjectX500Principal(); + X500Principal prevSubject = prevCert.getSubjectX500Principal(); + X500Principal thisIssuer = thisCert.getIssuerX500Principal(); + X500Principal prevIssuer = prevCert.getIssuerX500Principal(); + + return (!thisSubject.getName().isEmpty() && + !prevSubject.getName().isEmpty() && + thisSubject.equals(prevSubject) && + thisIssuer.equals(prevIssuer)); + } + + /* + * Returns the subject alternative name of the specified type in the + * subjectAltNames extension of a certificate. + * + * Note that only those subjectAltName types that use String data + * should be passed into this function. + */ + private static Collection<String> getSubjectAltNames( + Collection<List<?>> subjectAltNames, int type) { + HashSet<String> subAltDnsNames = null; + for (List<?> subjectAltName : subjectAltNames) { + int subjectAltNameType = (Integer)subjectAltName.get(0); + if (subjectAltNameType == type) { + String subAltDnsName = (String)subjectAltName.get(1); + if ((subAltDnsName != null) && !subAltDnsName.isEmpty()) { + if (subAltDnsNames == null) { + subAltDnsNames = + new HashSet<>(subjectAltNames.size()); + } + subAltDnsNames.add(subAltDnsName); + } + } + } + + return subAltDnsNames; + } + + private static boolean isEquivalent(Collection<String> thisSubAltNames, + Collection<String> prevSubAltNames) { + for (String thisSubAltName : thisSubAltNames) { + for (String prevSubAltName : prevSubAltNames) { + // Only allow the exactly match. No wildcard character + // checking. + if (thisSubAltName.equalsIgnoreCase(prevSubAltName)) { + return true; + } + } + } + + return false; + } + + /** + * Perform client-side checking of server certificates. + * + * @param certs an array of {@code X509Certificate} objects presented + * by the server in the ServerCertificate message. + * + * @throws IOException if a failure occurs during validation or + * the trust manager associated with the {@code SSLContext} is not + * an {@code X509ExtendedTrustManager}. + */ + static void checkServerCerts(ClientHandshakeContext chc, + X509Certificate[] certs) throws IOException { + + X509TrustManager tm = chc.sslContext.getX509TrustManager(); + + // find out the key exchange algorithm used + // use "RSA" for non-ephemeral "RSA_EXPORT" + String keyExchangeString; + if (chc.negotiatedCipherSuite.keyExchange == + CipherSuite.KeyExchange.K_RSA_EXPORT || + chc.negotiatedCipherSuite.keyExchange == + CipherSuite.KeyExchange.K_DHE_RSA_EXPORT) { + keyExchangeString = CipherSuite.KeyExchange.K_RSA.name; + } else { + keyExchangeString = chc.negotiatedCipherSuite.keyExchange.name; + } + + try { + if (tm instanceof X509ExtendedTrustManager) { + if (chc.conContext.transport instanceof SSLEngine) { + SSLEngine engine = (SSLEngine)chc.conContext.transport; + ((X509ExtendedTrustManager)tm).checkServerTrusted( + certs.clone(), + keyExchangeString, + engine); + } else { + SSLSocket socket = (SSLSocket)chc.conContext.transport; + ((X509ExtendedTrustManager)tm).checkServerTrusted( + certs.clone(), + keyExchangeString, + socket); + } + } else { + // Unlikely to happen, because we have wrapped the old + // X509TrustManager with the new X509ExtendedTrustManager. + throw new CertificateException( + "Improper X509TrustManager implementation"); + } + + // Once the server certificate chain has been validated, set + // the certificate chain in the TLS session. + chc.handshakeSession.setPeerCertificates(certs); + } catch (CertificateException ce) { + chc.conContext.fatal(getCertificateAlert(chc, ce), ce); + } + } + + private static void checkClientCerts(ServerHandshakeContext shc, + X509Certificate[] certs) throws IOException { + X509TrustManager tm = shc.sslContext.getX509TrustManager(); + + // find out the types of client authentication used + PublicKey key = certs[0].getPublicKey(); + String keyAlgorithm = key.getAlgorithm(); + String authType; + switch (keyAlgorithm) { + case "RSA": + case "DSA": + case "EC": + case "RSASSA-PSS": + authType = keyAlgorithm; + break; + default: + // unknown public key type + authType = "UNKNOWN"; + } + + try { + if (tm instanceof X509ExtendedTrustManager) { + if (shc.conContext.transport instanceof SSLEngine) { + SSLEngine engine = (SSLEngine)shc.conContext.transport; + ((X509ExtendedTrustManager)tm).checkClientTrusted( + certs.clone(), + authType, + engine); + } else { + SSLSocket socket = (SSLSocket)shc.conContext.transport; + ((X509ExtendedTrustManager)tm).checkClientTrusted( + certs.clone(), + authType, + socket); + } + } else { + // Unlikely to happen, because we have wrapped the old + // X509TrustManager with the new X509ExtendedTrustManager. + throw new CertificateException( + "Improper X509TrustManager implementation"); + } + } catch (CertificateException ce) { + shc.conContext.fatal(Alert.CERTIFICATE_UNKNOWN, ce); + } + } + + /** + * When a failure happens during certificate checking from an + * {@link X509TrustManager}, determine what TLS alert description + * to use. + * + * @param cexc The exception thrown by the {@link X509TrustManager} + * + * @return A byte value corresponding to a TLS alert description number. + */ + private static Alert getCertificateAlert( + ClientHandshakeContext chc, CertificateException cexc) { + // The specific reason for the failure will determine how to + // set the alert description value + Alert alert = Alert.CERTIFICATE_UNKNOWN; + + Throwable baseCause = cexc.getCause(); + if (baseCause instanceof CertPathValidatorException) { + CertPathValidatorException cpve = + (CertPathValidatorException)baseCause; + Reason reason = cpve.getReason(); + if (reason == BasicReason.REVOKED) { + alert = chc.staplingActive ? + Alert.BAD_CERT_STATUS_RESPONSE : + Alert.CERTIFICATE_REVOKED; + } else if ( + reason == BasicReason.UNDETERMINED_REVOCATION_STATUS) { + alert = chc.staplingActive ? + Alert.BAD_CERT_STATUS_RESPONSE : + Alert.CERTIFICATE_UNKNOWN; + } + } + + return alert; + } + + } + + /** + * The certificate entry used in Certificate handshake message for TLS 1.3. + */ + static final class CertificateEntry { + final byte[] encoded; // encoded cert or public key + private final SSLExtensions extensions; + + CertificateEntry(byte[] encoded, SSLExtensions extensions) { + this.encoded = encoded; + this.extensions = extensions; + } + + private int getEncodedSize() { + int extLen = extensions.length(); + if (extLen == 0) { + extLen = 2; // empty extensions + } + return 3 + encoded.length + extLen; + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\n'{'\n" + + "{0}\n" + // X.509 certificate + " \"extensions\": '{'\n" + + "{1}\n" + + " '}'\n" + + "'}',", Locale.ENGLISH); + + Object x509Certs; + try { + // Don't support certificate type extension (RawPublicKey) yet. + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + x509Certs = + cf.generateCertificate(new ByteArrayInputStream(encoded)); + } catch (CertificateException ce) { + // no X.509 certificate factory service + x509Certs = encoded; + } + + Object[] messageFields = { + SSLLogger.toString(x509Certs), + Utilities.indent(extensions.toString(), " ") + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The Certificate handshake message for TLS 1.3. + */ + static final class T13CertificateMessage extends HandshakeMessage { + private final byte[] requestContext; + private final List<CertificateEntry> certEntries; + + T13CertificateMessage(HandshakeContext context, + byte[] requestContext, X509Certificate[] certificates) + throws SSLException, CertificateException { + super(context); + + this.requestContext = requestContext.clone(); + this.certEntries = new LinkedList<>(); + for (X509Certificate cert : certificates) { + byte[] encoded = cert.getEncoded(); + SSLExtensions extensions = new SSLExtensions(this); + certEntries.add(new CertificateEntry(encoded, extensions)); + } + } + + T13CertificateMessage(HandshakeContext handshakeContext, + byte[] requestContext, List<CertificateEntry> certificates) { + super(handshakeContext); + + this.requestContext = requestContext.clone(); + this.certEntries = certificates; + } + + T13CertificateMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + // struct { + // opaque certificate_request_context<0..2^8-1>; + // CertificateEntry certificate_list<0..2^24-1>; + // } Certificate; + if (m.remaining() < 4) { + throw new SSLProtocolException( + "Invalid Certificate message: " + + "insufficient data (length=" + m.remaining() + ")"); + } + this.requestContext = Record.getBytes8(m); + + if (m.remaining() < 3) { + throw new SSLProtocolException( + "Invalid Certificate message: " + + "insufficient certificate entries data (length=" + + m.remaining() + ")"); + } + + int listLen = Record.getInt24(m); + if (listLen != m.remaining()) { + throw new SSLProtocolException( + "Invalid Certificate message: " + + "incorrect list length (length=" + listLen + ")"); + } + + SSLExtension[] enabledExtensions = + handshakeContext.sslConfig.getEnabledExtensions( + SSLHandshake.CERTIFICATE); + List<CertificateEntry> certList = new LinkedList<>(); + while (m.hasRemaining()) { + // Note: support only X509 CertificateType right now. + byte[] encodedCert = Record.getBytes24(m); + if (encodedCert.length == 0) { + throw new SSLProtocolException( + "Invalid Certificate message: empty cert_data"); + } + + SSLExtensions extensions = + new SSLExtensions(this, m, enabledExtensions); + certList.add(new CertificateEntry(encodedCert, extensions)); + } + + this.certEntries = Collections.unmodifiableList(certList); + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE; + } + + @Override + public int messageLength() { + int msgLen = 4 + requestContext.length; + for (CertificateEntry entry : certEntries) { + msgLen += entry.getEncodedSize(); + } + + return msgLen; + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + int entryListLen = 0; + for (CertificateEntry entry : certEntries) { + entryListLen += entry.getEncodedSize(); + } + + hos.putBytes8(requestContext); + hos.putInt24(entryListLen); + for (CertificateEntry entry : certEntries) { + hos.putBytes24(entry.encoded); + // Is it an empty extensions? + if (entry.extensions.length() == 0) { + hos.putInt16(0); + } else { + entry.extensions.send(hos); + } + } + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"Certificate\": '{'\n" + + " \"certificate_request_context\": \"{0}\",\n" + + " \"certificate_list\": [{1}\n]\n" + + "'}'", + Locale.ENGLISH); + + StringBuilder builder = new StringBuilder(512); + for (CertificateEntry entry : certEntries) { + builder.append(entry.toString()); + } + + Object[] messageFields = { + Utilities.toHexString(requestContext), + Utilities.indent(builder.toString()) + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "Certificate" handshake message producer for TLS 1.3. + */ + private static final + class T13CertificateProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T13CertificateProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + if (hc.sslConfig.isClientMode) { + return onProduceCertificate( + (ClientHandshakeContext)context, message); + } else { + return onProduceCertificate( + (ServerHandshakeContext)context, message); + } + } + + private byte[] onProduceCertificate(ServerHandshakeContext shc, + HandshakeMessage message) throws IOException { + ClientHelloMessage clientHello = (ClientHelloMessage)message; + + SSLPossession pos = choosePossession(shc, clientHello); + if (pos == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No available authentication scheme"); + return null; // make the complier happy + } + + if (!(pos instanceof X509Possession)) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No X.509 certificate for server authentication"); + } + + X509Possession x509Possession = (X509Possession)pos; + X509Certificate[] localCerts = x509Possession.popCerts; + if (localCerts == null || localCerts.length == 0) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No X.509 certificate for server authentication"); + return null; // make the complier happy + } + + // update the context + shc.handshakePossessions.add(x509Possession); + shc.handshakeSession.setLocalPrivateKey( + x509Possession.popPrivateKey); + shc.handshakeSession.setLocalCertificates(localCerts); + T13CertificateMessage cm; + try { + cm = new T13CertificateMessage(shc, (new byte[0]), localCerts); + } catch (SSLException | CertificateException ce) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Failed to produce server Certificate message", ce); + return null; // make the complier happy + } + + // Check the OCSP stapling extensions and attempt + // to get responses. If the resulting stapleParams is non + // null, it implies that stapling is enabled on the server side. + shc.stapleParams = StatusResponseManager.processStapling(shc); + shc.staplingActive = (shc.stapleParams != null); + + // Process extensions for each CertificateEntry. + // Since there can be multiple CertificateEntries within a + // single CT message, we will pin a specific CertificateEntry + // into the ServerHandshakeContext so individual extension + // producers know which X509Certificate it is processing in + // each call. + SSLExtension[] enabledCTExts = shc.sslConfig.getEnabledExtensions( + SSLHandshake.CERTIFICATE, + Arrays.asList(ProtocolVersion.PROTOCOLS_OF_13)); + for (CertificateEntry certEnt : cm.certEntries) { + shc.currentCertEntry = certEnt; + certEnt.extensions.produce(shc, enabledCTExts); + } + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced server Certificate message", cm); + } + + // Output the handshake message. + cm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + + private static SSLPossession choosePossession( + HandshakeContext hc, + ClientHelloMessage clientHello) throws IOException { + if (hc.peerRequestedCertSignSchemes == null || + hc.peerRequestedCertSignSchemes.isEmpty()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "No signature_algorithms(_cert) in ClientHello"); + } + return null; + } + + Collection<String> checkedKeyTypes = new HashSet<>(); + for (SignatureScheme ss : hc.peerRequestedCertSignSchemes) { + if (checkedKeyTypes.contains(ss.keyAlgorithm)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Unsupported authentication scheme: " + ss.name); + } + continue; + } + + // Don't select a signature scheme unless we will be able to + // produce a CertificateVerify message later + if (SignatureScheme.getPreferableAlgorithm( + hc.peerRequestedSignatureSchemes, + ss, hc.negotiatedProtocol) == null) { + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Unable to produce CertificateVerify for " + + "signature scheme: " + ss.name); + } + checkedKeyTypes.add(ss.keyAlgorithm); + continue; + } + + SSLAuthentication ka = X509Authentication.valueOf(ss); + if (ka == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Unsupported authentication scheme: " + ss.name); + } + checkedKeyTypes.add(ss.keyAlgorithm); + continue; + } + + SSLPossession pos = ka.createPossession(hc); + if (pos == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Unavailable authentication scheme: " + ss.name); + } + continue; + } + + return pos; + } + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("No available authentication scheme"); + } + return null; + } + + private byte[] onProduceCertificate(ClientHandshakeContext chc, + HandshakeMessage message) throws IOException { + ClientHelloMessage clientHello = (ClientHelloMessage)message; + SSLPossession pos = choosePossession(chc, clientHello); + X509Certificate[] localCerts; + if (pos == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("No available client authentication scheme"); + } + localCerts = new X509Certificate[0]; + } else { + chc.handshakePossessions.add(pos); + if (!(pos instanceof X509Possession)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "No X.509 certificate for client authentication"); + } + localCerts = new X509Certificate[0]; + } else { + X509Possession x509Possession = (X509Possession)pos; + localCerts = x509Possession.popCerts; + chc.handshakeSession.setLocalPrivateKey( + x509Possession.popPrivateKey); + } + } + + if (localCerts != null && localCerts.length != 0) { + chc.handshakeSession.setLocalCertificates(localCerts); + } else { + chc.handshakeSession.setLocalCertificates(null); + } + + T13CertificateMessage cm; + try { + cm = new T13CertificateMessage( + chc, chc.certRequestContext, localCerts); + } catch (SSLException | CertificateException ce) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Failed to produce client Certificate message", ce); + return null; + } + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced client Certificate message", cm); + } + + // Output the handshake message. + cm.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "Certificate" handshake message consumer for TLS 1.3. + */ + private static final class T13CertificateConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T13CertificateConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + + // clean up this consumer + hc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE.id); + T13CertificateMessage cm = new T13CertificateMessage(hc, message); + if (hc.sslConfig.isClientMode) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming server Certificate handshake message", cm); + } + onConsumeCertificate((ClientHandshakeContext)context, cm); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming client Certificate handshake message", cm); + } + onConsumeCertificate((ServerHandshakeContext)context, cm); + } + } + + private void onConsumeCertificate(ServerHandshakeContext shc, + T13CertificateMessage certificateMessage )throws IOException { + if (certificateMessage.certEntries == null || + certificateMessage.certEntries.isEmpty()) { + if (shc.sslConfig.clientAuthType == CLIENT_AUTH_REQUIRED) { + shc.conContext.fatal(Alert.BAD_CERTIFICATE, + "Empty client certificate chain"); + } else { + // optional client authentication + return; + } + } + + // check client certificate entries + X509Certificate[] cliCerts = + checkClientCerts(shc, certificateMessage.certEntries); + + // + // update + // + shc.handshakeCredentials.add( + new X509Credentials(cliCerts[0].getPublicKey(), cliCerts)); + shc.handshakeSession.setPeerCertificates(cliCerts); + } + + private void onConsumeCertificate(ClientHandshakeContext chc, + T13CertificateMessage certificateMessage )throws IOException { + if (certificateMessage.certEntries == null || + certificateMessage.certEntries.isEmpty()) { + chc.conContext.fatal(Alert.BAD_CERTIFICATE, + "Empty server certificate chain"); + } + + // Each CertificateEntry will have its own set of extensions + // which must be consumed. + SSLExtension[] enabledExtensions = + chc.sslConfig.getEnabledExtensions(SSLHandshake.CERTIFICATE); + for (CertificateEntry certEnt : certificateMessage.certEntries) { + certEnt.extensions.consumeOnLoad(chc, enabledExtensions); + } + + // check server certificate entries + X509Certificate[] srvCerts = + checkServerCerts(chc, certificateMessage.certEntries); + + // + // update + // + chc.handshakeCredentials.add( + new X509Credentials(srvCerts[0].getPublicKey(), srvCerts)); + chc.handshakeSession.setPeerCertificates(srvCerts); + } + + private static X509Certificate[] checkClientCerts( + ServerHandshakeContext shc, + List<CertificateEntry> certEntries) throws IOException { + X509Certificate[] certs = + new X509Certificate[certEntries.size()]; + try { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + int i = 0; + for (CertificateEntry entry : certEntries) { + certs[i++] = (X509Certificate)cf.generateCertificate( + new ByteArrayInputStream(entry.encoded)); + } + } catch (CertificateException ce) { + shc.conContext.fatal(Alert.BAD_CERTIFICATE, + "Failed to parse server certificates", ce); + } + + // find out the types of client authentication used + String keyAlgorithm = certs[0].getPublicKey().getAlgorithm(); + String authType; + switch (keyAlgorithm) { + case "RSA": + case "DSA": + case "EC": + case "RSASSA-PSS": + authType = keyAlgorithm; + break; + default: + // unknown public key type + authType = "UNKNOWN"; + } + + try { + X509TrustManager tm = shc.sslContext.getX509TrustManager(); + if (tm instanceof X509ExtendedTrustManager) { + if (shc.conContext.transport instanceof SSLEngine) { + SSLEngine engine = (SSLEngine)shc.conContext.transport; + ((X509ExtendedTrustManager)tm).checkClientTrusted( + certs.clone(), + authType, + engine); + } else { + SSLSocket socket = (SSLSocket)shc.conContext.transport; + ((X509ExtendedTrustManager)tm).checkClientTrusted( + certs.clone(), + authType, + socket); + } + } else { + // Unlikely to happen, because we have wrapped the old + // X509TrustManager with the new X509ExtendedTrustManager. + throw new CertificateException( + "Improper X509TrustManager implementation"); + } + + // Once the client certificate chain has been validated, set + // the certificate chain in the TLS session. + shc.handshakeSession.setPeerCertificates(certs); + } catch (CertificateException ce) { + shc.conContext.fatal(Alert.CERTIFICATE_UNKNOWN, ce); + } + + return certs; + } + + private static X509Certificate[] checkServerCerts( + ClientHandshakeContext chc, + List<CertificateEntry> certEntries) throws IOException { + X509Certificate[] certs = + new X509Certificate[certEntries.size()]; + try { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + int i = 0; + for (CertificateEntry entry : certEntries) { + certs[i++] = (X509Certificate)cf.generateCertificate( + new ByteArrayInputStream(entry.encoded)); + } + } catch (CertificateException ce) { + chc.conContext.fatal(Alert.BAD_CERTIFICATE, + "Failed to parse server certificates", ce); + } + + // find out the types of server authentication used + // + // Note that the "UNKNOWN" authentication type is sufficient to + // check the required digitalSignature KeyUsage for TLS 1.3. + String authType = "UNKNOWN"; + + try { + X509TrustManager tm = chc.sslContext.getX509TrustManager(); + if (tm instanceof X509ExtendedTrustManager) { + if (chc.conContext.transport instanceof SSLEngine) { + SSLEngine engine = (SSLEngine)chc.conContext.transport; + ((X509ExtendedTrustManager)tm).checkServerTrusted( + certs.clone(), + authType, + engine); + } else { + SSLSocket socket = (SSLSocket)chc.conContext.transport; + ((X509ExtendedTrustManager)tm).checkServerTrusted( + certs.clone(), + authType, + socket); + } + } else { + // Unlikely to happen, because we have wrapped the old + // X509TrustManager with the new X509ExtendedTrustManager. + throw new CertificateException( + "Improper X509TrustManager implementation"); + } + + // Once the server certificate chain has been validated, set + // the certificate chain in the TLS session. + chc.handshakeSession.setPeerCertificates(certs); + } catch (CertificateException ce) { + chc.conContext.fatal(getCertificateAlert(chc, ce), ce); + } + + return certs; + } + + /** + * When a failure happens during certificate checking from an + * {@link X509TrustManager}, determine what TLS alert description + * to use. + * + * @param cexc The exception thrown by the {@link X509TrustManager} + * + * @return A byte value corresponding to a TLS alert description number. + */ + private static Alert getCertificateAlert( + ClientHandshakeContext chc, CertificateException cexc) { + // The specific reason for the failure will determine how to + // set the alert description value + Alert alert = Alert.CERTIFICATE_UNKNOWN; + + Throwable baseCause = cexc.getCause(); + if (baseCause instanceof CertPathValidatorException) { + CertPathValidatorException cpve = + (CertPathValidatorException)baseCause; + Reason reason = cpve.getReason(); + if (reason == BasicReason.REVOKED) { + alert = chc.staplingActive ? + Alert.BAD_CERT_STATUS_RESPONSE : + Alert.CERTIFICATE_REVOKED; + } else if ( + reason == BasicReason.UNDETERMINED_REVOCATION_STATUS) { + alert = chc.staplingActive ? + Alert.BAD_CERT_STATUS_RESPONSE : + Alert.CERTIFICATE_UNKNOWN; + } + } + + return alert; + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertificateRequest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,890 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.PrivateKey; +import java.security.cert.X509Certificate; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.X509ExtendedKeyManager; +import javax.security.auth.x500.X500Principal; +import sun.security.ssl.CipherSuite.KeyExchange; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.X509Authentication.X509Possession; + +/** + * Pack of the CertificateRequest handshake message. + */ +final class CertificateRequest { + static final SSLConsumer t10HandshakeConsumer = + new T10CertificateRequestConsumer(); + static final HandshakeProducer t10HandshakeProducer = + new T10CertificateRequestProducer(); + + static final SSLConsumer t12HandshakeConsumer = + new T12CertificateRequestConsumer(); + static final HandshakeProducer t12HandshakeProducer = + new T12CertificateRequestProducer(); + + static final SSLConsumer t13HandshakeConsumer = + new T13CertificateRequestConsumer(); + static final HandshakeProducer t13HandshakeProducer = + new T13CertificateRequestProducer(); + + // TLS 1.2 and prior versions + private static enum ClientCertificateType { + // RFC 2246 + RSA_SIGN ((byte)0x01, "rsa_sign", "RSA", true), + DSS_SIGN ((byte)0x02, "dss_sign", "DSA", true), + RSA_FIXED_DH ((byte)0x03, "rsa_fixed_dh"), + DSS_FIXED_DH ((byte)0x04, "dss_fixed_dh"), + + // RFC 4346 + RSA_EPHEMERAL_DH ((byte)0x05, "rsa_ephemeral_dh"), + DSS_EPHEMERAL_DH ((byte)0x06, "dss_ephemeral_dh"), + FORTEZZA_DMS ((byte)0x14, "fortezza_dms"), + + // RFC 4492 + ECDSA_SIGN ((byte)0x40, "ecdsa_sign", + "EC", JsseJce.isEcAvailable()), + RSA_FIXED_ECDH ((byte)0x41, "rsa_fixed_ecdh"), + ECDSA_FIXED_ECDH ((byte)0x42, "ecdsa_fixed_ecdh"); + + private static final byte[] CERT_TYPES = + JsseJce.isEcAvailable() ? new byte[] { + ECDSA_SIGN.id, + RSA_SIGN.id, + DSS_SIGN.id + } : new byte[] { + RSA_SIGN.id, + DSS_SIGN.id + }; + + final byte id; + final String name; + final String keyAlgorithm; + final boolean isAvailable; + + private ClientCertificateType(byte id, String name) { + this(id, name, null, false); + } + + private ClientCertificateType(byte id, String name, + String keyAlgorithm, boolean isAvailable) { + this.id = id; + this.name = name; + this.keyAlgorithm = keyAlgorithm; + this.isAvailable = isAvailable; + } + + private static String nameOf(byte id) { + for (ClientCertificateType cct : ClientCertificateType.values()) { + if (cct.id == id) { + return cct.name; + } + } + return "UNDEFINED-CLIENT-CERTIFICATE-TYPE(" + (int)id + ")"; + } + + private static ClientCertificateType valueOf(byte id) { + for (ClientCertificateType cct : ClientCertificateType.values()) { + if (cct.id == id) { + return cct; + } + } + + return null; + } + + private static String[] getKeyTypes(byte[] ids) { + ArrayList<String> keyTypes = new ArrayList<>(3); + for (byte id : ids) { + ClientCertificateType cct = ClientCertificateType.valueOf(id); + if (cct.isAvailable) { + keyTypes.add(cct.keyAlgorithm); + } + } + + return keyTypes.toArray(new String[0]); + } + } + + /** + * The "CertificateRequest" handshake message for SSL 3.0 and TLS 1.0/1.1. + */ + static final class T10CertificateRequestMessage extends HandshakeMessage { + final byte[] types; // certificate types + final List<byte[]> authorities; // certificate authorities + + T10CertificateRequestMessage(HandshakeContext handshakeContext, + X509Certificate[] trustedCerts, KeyExchange keyExchange) { + super(handshakeContext); + + this.authorities = new ArrayList<>(trustedCerts.length); + for (X509Certificate cert : trustedCerts) { + X500Principal x500Principal = cert.getSubjectX500Principal(); + authorities.add(x500Principal.getEncoded()); + } + + this.types = ClientCertificateType.CERT_TYPES; + } + + T10CertificateRequestMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + // struct { + // ClientCertificateType certificate_types<1..2^8-1>; + // DistinguishedName certificate_authorities<0..2^16-1>; + // } CertificateRequest; + if (m.remaining() < 4) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Incorrect CertificateRequest message: no sufficient data"); + } + this.types = Record.getBytes8(m); + + int listLen = Record.getInt16(m); + if (listLen > m.remaining()) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Incorrect CertificateRequest message:no sufficient data"); + } + + if (listLen > 0) { + this.authorities = new LinkedList<>(); + while (listLen > 0) { + // opaque DistinguishedName<1..2^16-1>; + byte[] encoded = Record.getBytes16(m); + listLen -= (2 + encoded.length); + authorities.add(encoded); + } + } else { + this.authorities = Collections.emptyList(); + } + } + + String[] getKeyTypes() { + return ClientCertificateType.getKeyTypes(types); + } + + X500Principal[] getAuthorities() { + List<X500Principal> principals = + new ArrayList<>(authorities.size()); + for (byte[] encoded : authorities) { + X500Principal principal = new X500Principal(encoded); + principals.add(principal); + } + + return principals.toArray(new X500Principal[0]); + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE_REQUEST; + } + + @Override + public int messageLength() { + int len = 1 + types.length + 2; + for (byte[] encoded : authorities) { + len += encoded.length + 2; + } + return len; + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putBytes8(types); + + int listLen = 0; + for (byte[] encoded : authorities) { + listLen += encoded.length + 2; + } + + hos.putInt16(listLen); + for (byte[] encoded : authorities) { + hos.putBytes16(encoded); + } + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"CertificateRequest\": '{'\n" + + " \"certificate types\": {0}\n" + + " \"certificate authorities\": {1}\n" + + "'}'", + Locale.ENGLISH); + + List<String> typeNames = new ArrayList<>(types.length); + for (byte type : types) { + typeNames.add(ClientCertificateType.nameOf(type)); + } + + List<String> authorityNames = new ArrayList<>(authorities.size()); + for (byte[] encoded : authorities) { + X500Principal principal = new X500Principal(encoded); + authorityNames.add(principal.toString()); + } + Object[] messageFields = { + typeNames, + authorityNames + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "CertificateRequest" handshake message producer for SSL 3.0 and + * TLS 1.0/1.1. + */ + private static final + class T10CertificateRequestProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T10CertificateRequestProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + X509Certificate[] caCerts = + shc.sslContext.getX509TrustManager().getAcceptedIssuers(); + T10CertificateRequestMessage crm = new T10CertificateRequestMessage( + shc, caCerts, shc.negotiatedCipherSuite.keyExchange); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced CertificateRequest handshake message", crm); + } + + // Output the handshake message. + crm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // + // update + // + shc.handshakeConsumers.put(SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE); + shc.handshakeConsumers.put(SSLHandshake.CERTIFICATE_VERIFY.id, + SSLHandshake.CERTIFICATE_VERIFY); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "CertificateRequest" handshake message consumer for SSL 3.0 and + * TLS 1.0/1.1. + */ + private static final + class T10CertificateRequestConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T10CertificateRequestConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // clean up this consumer + chc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE_REQUEST.id); + + T10CertificateRequestMessage crm = + new T10CertificateRequestMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming CertificateRequest handshake message", crm); + } + + // + // validate + // + // blank + + // + // update + // + + // An empty client Certificate handshake message may be allow. + chc.handshakeProducers.put(SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE); + + X509ExtendedKeyManager km = chc.sslContext.getX509KeyManager(); + String clientAlias = null; + if (chc.conContext.transport instanceof SSLSocketImpl) { + clientAlias = km.chooseClientAlias(crm.getKeyTypes(), + crm.getAuthorities(), (SSLSocket)chc.conContext.transport); + } else if (chc.conContext.transport instanceof SSLEngineImpl) { + clientAlias = km.chooseEngineClientAlias(crm.getKeyTypes(), + crm.getAuthorities(), (SSLEngine)chc.conContext.transport); + } + + + if (clientAlias == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("No available client authentication"); + } + return; + } + + PrivateKey clientPrivateKey = km.getPrivateKey(clientAlias); + if (clientPrivateKey == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("No available client private key"); + } + return; + } + + X509Certificate[] clientCerts = km.getCertificateChain(clientAlias); + if ((clientCerts == null) || (clientCerts.length == 0)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("No available client certificate"); + } + return; + } + + chc.handshakePossessions.add( + new X509Possession(clientPrivateKey, clientCerts)); + chc.handshakeProducers.put(SSLHandshake.CERTIFICATE_VERIFY.id, + SSLHandshake.CERTIFICATE_VERIFY); + } + } + + /** + * The CertificateRequest handshake message for TLS 1.2. + */ + static final class T12CertificateRequestMessage extends HandshakeMessage { + final byte[] types; // certificate types + final int[] algorithmIds; // supported signature algorithms + final List<byte[]> authorities; // certificate authorities + + T12CertificateRequestMessage(HandshakeContext handshakeContext, + X509Certificate[] trustedCerts, KeyExchange keyExchange, + List<SignatureScheme> signatureSchemes) throws IOException { + super(handshakeContext); + + this.types = ClientCertificateType.CERT_TYPES; + + if (signatureSchemes == null || signatureSchemes.isEmpty()) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No signature algorithms specified for " + + "CertificateRequest hanshake message"); + } + this.algorithmIds = new int[signatureSchemes.size()]; + int i = 0; + for (SignatureScheme scheme : signatureSchemes) { + algorithmIds[i++] = scheme.id; + } + + this.authorities = new ArrayList<>(trustedCerts.length); + for (X509Certificate cert : trustedCerts) { + X500Principal x500Principal = cert.getSubjectX500Principal(); + authorities.add(x500Principal.getEncoded()); + } + } + + T12CertificateRequestMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + // struct { + // ClientCertificateType certificate_types<1..2^8-1>; + // SignatureAndHashAlgorithm + // supported_signature_algorithms<2..2^16-2>; + // DistinguishedName certificate_authorities<0..2^16-1>; + // } CertificateRequest; + + // certificate_authorities + if (m.remaining() < 8) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateRequest handshake message: " + + "no sufficient data"); + } + this.types = Record.getBytes8(m); + + // supported_signature_algorithms + if (m.remaining() < 6) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateRequest handshake message: " + + "no sufficient data"); + } + + byte[] algs = Record.getBytes16(m); + if (algs == null || algs.length == 0 || (algs.length & 0x01) != 0) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateRequest handshake message: " + + "incomplete signature algorithms"); + } + + this.algorithmIds = new int[(algs.length >> 1)]; + for (int i = 0, j = 0; i < algs.length;) { + byte hash = algs[i++]; + byte sign = algs[i++]; + algorithmIds[j++] = ((hash & 0xFF) << 8) | (sign & 0xFF); + } + + // certificate_authorities + if (m.remaining() < 2) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateRequest handshake message: " + + "no sufficient data"); + } + + int listLen = Record.getInt16(m); + if (listLen > m.remaining()) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateRequest message: no sufficient data"); + } + + if (listLen > 0) { + this.authorities = new LinkedList<>(); + while (listLen > 0) { + // opaque DistinguishedName<1..2^16-1>; + byte[] encoded = Record.getBytes16(m); + listLen -= (2 + encoded.length); + authorities.add(encoded); + } + } else { + this.authorities = Collections.emptyList(); + } + } + + String[] getKeyTypes() { + return ClientCertificateType.getKeyTypes(types); + } + + X500Principal[] getAuthorities() { + List<X500Principal> principals = + new ArrayList<>(authorities.size()); + for (byte[] encoded : authorities) { + X500Principal principal = new X500Principal(encoded); + principals.add(principal); + } + + return principals.toArray(new X500Principal[0]); + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE_REQUEST; + } + + @Override + public int messageLength() { + int len = 1 + types.length + 2 + (algorithmIds.length << 1) + 2; + for (byte[] encoded : authorities) { + len += encoded.length + 2; + } + return len; + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putBytes8(types); + + int listLen = 0; + for (byte[] encoded : authorities) { + listLen += encoded.length + 2; + } + + hos.putInt16(algorithmIds.length << 1); + for (int algorithmId : algorithmIds) { + hos.putInt16(algorithmId); + } + + hos.putInt16(listLen); + for (byte[] encoded : authorities) { + hos.putBytes16(encoded); + } + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"CertificateRequest\": '{'\n" + + " \"certificate types\": {0}\n" + + " \"supported signature algorithms\": {1}\n" + + " \"certificate authorities\": {2}\n" + + "'}'", + Locale.ENGLISH); + + List<String> typeNames = new ArrayList<>(types.length); + for (byte type : types) { + typeNames.add(ClientCertificateType.nameOf(type)); + } + + List<String> algorithmNames = new ArrayList<>(algorithmIds.length); + for (int algorithmId : algorithmIds) { + algorithmNames.add(SignatureScheme.nameOf(algorithmId)); + } + + List<String> authorityNames = new ArrayList<>(authorities.size()); + for (byte[] encoded : authorities) { + X500Principal principal = new X500Principal(encoded); + authorityNames.add(principal.toString()); + } + Object[] messageFields = { + typeNames, + algorithmNames, + authorityNames + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "CertificateRequest" handshake message producer for TLS 1.2. + */ + private static final + class T12CertificateRequestProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T12CertificateRequestProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + if (shc.localSupportedSignAlgs == null) { + shc.localSupportedSignAlgs = + SignatureScheme.getSupportedAlgorithms( + shc.algorithmConstraints, shc.activeProtocols); + } + + if (shc.localSupportedSignAlgs == null || + shc.localSupportedSignAlgs.isEmpty()) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No supported signature algorithm"); + } + + X509Certificate[] caCerts = + shc.sslContext.getX509TrustManager().getAcceptedIssuers(); + T12CertificateRequestMessage crm = new T12CertificateRequestMessage( + shc, caCerts, shc.negotiatedCipherSuite.keyExchange, + shc.localSupportedSignAlgs); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced CertificateRequest handshake message", crm); + } + + // Output the handshake message. + crm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // + // update + // + shc.handshakeConsumers.put(SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE); + shc.handshakeConsumers.put(SSLHandshake.CERTIFICATE_VERIFY.id, + SSLHandshake.CERTIFICATE_VERIFY); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "CertificateRequest" handshake message consumer for TLS 1.2. + */ + private static final + class T12CertificateRequestConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T12CertificateRequestConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // clean up this consumer + chc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE_REQUEST.id); + + T12CertificateRequestMessage crm = + new T12CertificateRequestMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming CertificateRequest handshake message", crm); + } + + // + // validate + // + // blank + + // + // update + // + + // An empty client Certificate handshake message may be allow. + chc.handshakeProducers.put(SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE); + + List<SignatureScheme> sss = new LinkedList<>(); + for (int id : crm.algorithmIds) { + SignatureScheme ss = SignatureScheme.valueOf(id); + if (ss != null) { + sss.add(ss); + } + } + chc.peerRequestedSignatureSchemes = sss; + chc.peerRequestedCertSignSchemes = sss; // use the same schemes + chc.handshakeSession.setPeerSupportedSignatureAlgorithms(sss); + + X509ExtendedKeyManager km = chc.sslContext.getX509KeyManager(); + String clientAlias = null; + if (chc.conContext.transport instanceof SSLSocketImpl) { + clientAlias = km.chooseClientAlias(crm.getKeyTypes(), + crm.getAuthorities(), (SSLSocket)chc.conContext.transport); + } else if (chc.conContext.transport instanceof SSLEngineImpl) { + clientAlias = km.chooseEngineClientAlias(crm.getKeyTypes(), + crm.getAuthorities(), (SSLEngine)chc.conContext.transport); + } + + if (clientAlias == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("No available client authentication"); + } + return; + } + + PrivateKey clientPrivateKey = km.getPrivateKey(clientAlias); + if (clientPrivateKey == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("No available client private key"); + } + return; + } + + X509Certificate[] clientCerts = km.getCertificateChain(clientAlias); + if ((clientCerts == null) || (clientCerts.length == 0)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("No available client certificate"); + } + return; + } + + chc.handshakePossessions.add( + new X509Possession(clientPrivateKey, clientCerts)); + chc.handshakeProducers.put(SSLHandshake.CERTIFICATE_VERIFY.id, + SSLHandshake.CERTIFICATE_VERIFY); + } + } + + /** + * The CertificateRequest handshake message for TLS 1.3. + */ + static final class T13CertificateRequestMessage extends HandshakeMessage { + private final byte[] requestContext; + private final SSLExtensions extensions; + + T13CertificateRequestMessage( + HandshakeContext handshakeContext) throws IOException { + super(handshakeContext); + + this.requestContext = new byte[0]; + this.extensions = new SSLExtensions(this); + } + + T13CertificateRequestMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + // struct { + // opaque certificate_request_context<0..2^8-1>; + // Extension extensions<2..2^16-1>; + // } CertificateRequest; + if (m.remaining() < 5) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateRequest handshake message: " + + "no sufficient data"); + } + this.requestContext = Record.getBytes8(m); + + if (m.remaining() < 4) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateRequest handshake message: " + + "no sufficient extensions data"); + } + SSLExtension[] enabledExtensions = + handshakeContext.sslConfig.getEnabledExtensions( + SSLHandshake.CERTIFICATE_REQUEST); + this.extensions = new SSLExtensions(this, m, enabledExtensions); + } + + @Override + SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE_REQUEST; + } + + @Override + int messageLength() { + // In TLS 1.3, use of certain extensions is mandatory. + return 1 + requestContext.length + extensions.length(); + } + + @Override + void send(HandshakeOutStream hos) throws IOException { + hos.putBytes8(requestContext); + + // In TLS 1.3, use of certain extensions is mandatory. + extensions.send(hos); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"CertificateRequest\": '{'\n" + + " \"certificate_request_context\": \"{0}\",\n" + + " \"extensions\": [\n" + + "{1}\n" + + " ]\n" + + "'}'", + Locale.ENGLISH); + Object[] messageFields = { + Utilities.toHexString(requestContext), + Utilities.indent(Utilities.indent(extensions.toString())) + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "CertificateRequest" handshake message producer for TLS 1.3. + */ + private static final + class T13CertificateRequestProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T13CertificateRequestProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + T13CertificateRequestMessage crm = + new T13CertificateRequestMessage(shc); + // Produce extensions for CertificateRequest handshake message. + SSLExtension[] extTypes = shc.sslConfig.getEnabledExtensions( + SSLHandshake.CERTIFICATE_REQUEST, shc.negotiatedProtocol); + crm.extensions.produce(shc, extTypes); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced CertificateRequest message", crm); + } + + // Output the handshake message. + crm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // + // update + // + shc.certRequestContext = crm.requestContext.clone(); + shc.handshakeConsumers.put(SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE); + shc.handshakeConsumers.put(SSLHandshake.CERTIFICATE_VERIFY.id, + SSLHandshake.CERTIFICATE_VERIFY); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "CertificateRequest" handshake message consumer for TLS 1.3. + */ + private static final + class T13CertificateRequestConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T13CertificateRequestConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // clean up this consumer + chc.handshakeConsumers.remove(SSLHandshake.CERTIFICATE_REQUEST.id); + + T13CertificateRequestMessage crm = + new T13CertificateRequestMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming CertificateRequest handshake message", crm); + } + + // + // validate + // + SSLExtension[] extTypes = chc.sslConfig.getEnabledExtensions( + SSLHandshake.CERTIFICATE_REQUEST); + crm.extensions.consumeOnLoad(chc, extTypes); + + // + // update + // + crm.extensions.consumeOnTrade(chc, extTypes); + + // + // produce + // + chc.certRequestContext = crm.requestContext.clone(); + chc.handshakeProducers.put(SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE); + chc.handshakeProducers.put(SSLHandshake.CERTIFICATE_VERIFY.id, + SSLHandshake.CERTIFICATE_VERIFY); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertificateStatus.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,362 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.List; +import java.util.ArrayList; +import java.util.Locale; +import javax.net.ssl.SSLHandshakeException; +import java.security.cert.X509Certificate; +import sun.security.provider.certpath.OCSPResponse; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import static sun.security.ssl.CertStatusExtension.*; +import static sun.security.ssl.CertificateMessage.*; + +/** + * Consumers and producers for the CertificateStatus handshake message. + * This message takes one of two related but slightly different forms, + * depending on the type of stapling selected by the server. The message + * data will be of the form(s): + * + * [status_request, RFC 6066] + * + * struct { + * CertificateStatusType status_type; + * select (status_type) { + * case ocsp: OCSPResponse; + * } response; + * } CertificateStatus; + * + * opaque OCSPResponse<1..2^24-1>; + * + * [status_request_v2, RFC 6961] + * + * struct { + * CertificateStatusType status_type; + * select (status_type) { + * case ocsp: OCSPResponse; + * case ocsp_multi: OCSPResponseList; + * } response; + * } CertificateStatus; + * + * opaque OCSPResponse<0..2^24-1>; + * + * struct { + * OCSPResponse ocsp_response_list<1..2^24-1>; + * } OCSPResponseList; + */ +final class CertificateStatus { + static final SSLConsumer handshakeConsumer = + new CertificateStatusConsumer(); + static final HandshakeProducer handshakeProducer = + new CertificateStatusProducer(); + static final HandshakeAbsence handshakeAbsence = + new CertificateStatusAbsence(); + + /** + * The CertificateStatus handshake message. + */ + static final class CertificateStatusMessage extends HandshakeMessage { + + final CertStatusRequestType statusType; + int encodedResponsesLen = 0; + int messageLength = -1; + final List<byte[]> encodedResponses = new ArrayList<>(); + + CertificateStatusMessage(HandshakeContext handshakeContext) { + super(handshakeContext); + + ServerHandshakeContext shc = + (ServerHandshakeContext)handshakeContext; + + // Get the Certificates from the SSLContextImpl amd the Stapling + // parameters + StatusResponseManager.StaplingParameters stapleParams = + shc.stapleParams; + if (stapleParams == null) { + throw new IllegalArgumentException( + "Unexpected null stapling parameters"); + } + + X509Certificate[] certChain = + (X509Certificate[])shc.handshakeSession.getLocalCertificates(); + if (certChain == null) { + throw new IllegalArgumentException( + "Unexpected null certificate chain"); + } + + // Walk the certificate list and add the correct encoded responses + // to the encoded responses list + statusType = stapleParams.statReqType; + if (statusType == CertStatusRequestType.OCSP) { + // Just worry about the first cert in the chain + byte[] resp = stapleParams.responseMap.get(certChain[0]); + if (resp == null) { + // A not-found return status means we should include + // a zero-length response in CertificateStatus. + // This is highly unlikely to happen in practice. + resp = new byte[0]; + } + encodedResponses.add(resp); + encodedResponsesLen += resp.length + 3; + } else if (statusType == CertStatusRequestType.OCSP_MULTI) { + for (X509Certificate cert : certChain) { + byte[] resp = stapleParams.responseMap.get(cert); + if (resp == null) { + resp = new byte[0]; + } + encodedResponses.add(resp); + encodedResponsesLen += resp.length + 3; + } + } else { + throw new IllegalArgumentException( + "Unsupported StatusResponseType: " + statusType); + } + + messageLength = messageLength(); + } + + CertificateStatusMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + statusType = CertStatusRequestType.valueOf((byte)Record.getInt8(m)); + if (statusType == CertStatusRequestType.OCSP) { + byte[] respDER = Record.getBytes24(m); + // Convert the incoming bytes to a OCSPResponse strucutre + if (respDER.length > 0) { + encodedResponses.add(respDER); + encodedResponsesLen = 3 + respDER.length; + } else { + handshakeContext.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Zero-length OCSP Response"); + } + } else if (statusType == CertStatusRequestType.OCSP_MULTI) { + int respListLen = Record.getInt24(m); + encodedResponsesLen = respListLen; + + // Add each OCSP reponse into the array list in the order + // we receive them off the wire. A zero-length array is + // allowed for ocsp_multi, and means that a response for + // a given certificate is not available. + while (respListLen > 0) { + byte[] respDER = Record.getBytes24(m); + encodedResponses.add(respDER); + respListLen -= (respDER.length + 3); + } + + if (respListLen != 0) { + handshakeContext.conContext.fatal(Alert.INTERNAL_ERROR, + "Bad OCSP response list length"); + } + } else { + handshakeContext.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsupported StatusResponseType: " + statusType); + } + messageLength = messageLength(); + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE_STATUS; + } + + @Override + public int messageLength() { + int len = 1; + + if (messageLength == -1) { + if (statusType == CertStatusRequestType.OCSP) { + len += encodedResponsesLen; + } else if (statusType == CertStatusRequestType.OCSP_MULTI) { + len += 3 + encodedResponsesLen; + } + messageLength = len; + } + + return messageLength; + } + + @Override + public void send(HandshakeOutStream s) throws IOException { + s.putInt8(statusType.id); + if (statusType == CertStatusRequestType.OCSP) { + s.putBytes24(encodedResponses.get(0)); + } else if (statusType == CertStatusRequestType.OCSP_MULTI) { + s.putInt24(encodedResponsesLen); + for (byte[] respBytes : encodedResponses) { + if (respBytes != null) { + s.putBytes24(respBytes); + } else { + s.putBytes24(null); + } + } + } else { + // It is highly unlikely that we will fall into this section + // of the code. + throw new SSLHandshakeException("Unsupported status_type: " + + statusType.id); + } + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + + // Stringify the encoded OCSP response list + for (byte[] respDER : encodedResponses) { + if (respDER.length > 0) { + try { + OCSPResponse oResp = new OCSPResponse(respDER); + sb.append(oResp.toString()).append("\n"); + } catch (IOException ioe) { + sb.append("OCSP Response Exception: ").append(ioe) + .append("\n"); + } + } else { + sb.append("<Zero-length entry>\n"); + } + } + + MessageFormat messageFormat = new MessageFormat( + "\"CertificateStatus\": '{'\n" + + " \"type\" : \"{0}\",\n" + + " \"responses \" : [\n" + "{1}\n" + " ]\n" + + "'}'", + Locale.ENGLISH); + Object[] messageFields = { + statusType.name, + Utilities.indent(Utilities.indent(sb.toString())) + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The CertificateStatus handshake message consumer. + */ + private static final class CertificateStatusConsumer + implements SSLConsumer { + // Prevent instantiation of this class. + private CertificateStatusConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + ClientHandshakeContext chc = (ClientHandshakeContext)context; + CertificateStatusMessage cst = + new CertificateStatusMessage(chc, message); + + // Log the message + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming server CertificateStatus handshake message", + cst); + } + + // Pin the received responses to the SSLSessionImpl. It will + // be retrieved by the X509TrustManagerImpl during the certficicate + // checking phase. + chc.handshakeSession.setStatusResponses(cst.encodedResponses); + + // Now perform the check + T12CertificateConsumer.checkServerCerts(chc, chc.deferredCerts); + } + } + + /** + * The CertificateStatus handshake message consumer. + */ + private static final class CertificateStatusProducer + implements HandshakeProducer { + // Prevent instantiation of this class. + private CertificateStatusProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // Only the server-side should be a producer of this message + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // If stapling is not active, immediately return without producing + // a message or any further processing. + if (!shc.staplingActive) { + return null; + } + + // Create the CertificateStatus message from info in the + CertificateStatusMessage csm = new CertificateStatusMessage(shc); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced server CertificateStatus handshake message", csm); + } + + // Output the handshake message. + csm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + private static final class CertificateStatusAbsence + implements HandshakeAbsence { + // Prevent instantiation of this class + private CertificateStatusAbsence() { + // blank + } + + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Processing should only continue if stapling is active + if (chc.staplingActive) { + // Because OCSP stapling is active, it means two things + // if we're here: 1) The server hello asserted the + // status_request[_v2] extension. 2) The CertificateStatus + // message was not sent. This means that cert path checking + // was deferred, but must happen immediately. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Server did not send CertificateStatus, " + + "checking cert chain without status info."); + } + T12CertificateConsumer.checkServerCerts(chc, chc.deferredCerts); + } + } + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertificateVerify.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1143 @@ + /* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.*; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.Locale; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.X509Authentication.X509Credentials; +import sun.security.ssl.X509Authentication.X509Possession; +import sun.security.util.HexDumpEncoder; + +/** + * Pack of the CertificateVerify handshake message. + */ +final class CertificateVerify { + static final SSLConsumer s30HandshakeConsumer = + new S30CertificateVerifyConsumer(); + static final HandshakeProducer s30HandshakeProducer = + new S30CertificateVerifyProducer(); + + static final SSLConsumer t10HandshakeConsumer = + new T10CertificateVerifyConsumer(); + static final HandshakeProducer t10HandshakeProducer = + new T10CertificateVerifyProducer(); + + static final SSLConsumer t12HandshakeConsumer = + new T12CertificateVerifyConsumer(); + static final HandshakeProducer t12HandshakeProducer = + new T12CertificateVerifyProducer(); + + static final SSLConsumer t13HandshakeConsumer = + new T13CertificateVerifyConsumer(); + static final HandshakeProducer t13HandshakeProducer = + new T13CertificateVerifyProducer(); + + /** + * The CertificateVerify handshake message (SSL 3.0). + */ + static final class S30CertificateVerifyMessage extends HandshakeMessage { + // signature bytes + private final byte[] signature; + + S30CertificateVerifyMessage(HandshakeContext context, + X509Possession x509Possession) throws IOException { + super(context); + + // This happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + byte[] temproary = null; + String algorithm = x509Possession.popPrivateKey.getAlgorithm(); + try { + Signature signer = + getSignature(algorithm, x509Possession.popPrivateKey); + byte[] hashes = chc.handshakeHash.digest(algorithm, + chc.handshakeSession.getMasterSecret()); + signer.update(hashes); + temproary = signer.sign(); + } catch (NoSuchAlgorithmException nsae) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm (" + algorithm + + ") used in CertificateVerify handshake message", nsae); + } catch (GeneralSecurityException gse) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot produce CertificateVerify signature", gse); + } + + this.signature = temproary; + } + + S30CertificateVerifyMessage(HandshakeContext context, + ByteBuffer m) throws IOException { + super(context); + + // This happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // digitally-signed struct { + // select(SignatureAlgorithm) { + // case anonymous: struct { }; + // case rsa: + // opaque md5_hash[16]; + // opaque sha_hash[20]; + // case dsa: + // opaque sha_hash[20]; + // }; + // } Signature; + if (m.remaining() < 2) { + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateVerify message: no sufficient data"); + } + + // read and verify the signature + this.signature = Record.getBytes16(m); + X509Credentials x509Credentials = null; + for (SSLCredentials cd : shc.handshakeCredentials) { + if (cd instanceof X509Credentials) { + x509Credentials = (X509Credentials)cd; + break; + } + } + + if (x509Credentials == null || + x509Credentials.popPublicKey == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No X509 credentials negotiated for CertificateVerify"); + } + + String algorithm = x509Credentials.popPublicKey.getAlgorithm(); + try { + Signature signer = + getSignature(algorithm, x509Credentials.popPublicKey); + byte[] hashes = shc.handshakeHash.digest(algorithm, + shc.handshakeSession.getMasterSecret()); + signer.update(hashes); + if (!signer.verify(signature)) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid CertificateVerify message: invalid signature"); + } + } catch (NoSuchAlgorithmException nsae) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm (" + algorithm + + ") used in CertificateVerify handshake message", nsae); + } catch (GeneralSecurityException gse) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot verify CertificateVerify signature", gse); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE_VERIFY; + } + + @Override + public int messageLength() { + return 2 + signature.length; // 2: length of signature + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putBytes16(signature); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"CertificateVerify\": '{'\n" + + " \"signature\": '{'\n" + + "{0}\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent( + hexEncoder.encodeBuffer(signature), " ") + }; + + return messageFormat.format(messageFields); + } + + /* + * Get the Signature object appropriate for verification using the + * given signature algorithm. + */ + private static Signature getSignature(String algorithm, + Key key) throws GeneralSecurityException { + Signature signer = null; + switch (algorithm) { + case "RSA": + signer = JsseJce.getSignature(JsseJce.SIGNATURE_RAWRSA); + break; + case "DSA": + signer = JsseJce.getSignature(JsseJce.SIGNATURE_RAWDSA); + break; + case "EC": + signer = JsseJce.getSignature(JsseJce.SIGNATURE_RAWECDSA); + break; + default: + throw new SignatureException("Unrecognized algorithm: " + + algorithm); + } + + if (signer != null) { + if (key instanceof PublicKey) { + signer.initVerify((PublicKey)(key)); + } else { + signer.initSign((PrivateKey)key); + } + } + + return signer; + } + } + + /** + * The "CertificateVerify" handshake message producer. + */ + private static final + class S30CertificateVerifyProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private S30CertificateVerifyProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + X509Possession x509Possession = null; + for (SSLPossession possession : chc.handshakePossessions) { + if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + break; + } + } + + if (x509Possession == null || + x509Possession.popPrivateKey == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "No X.509 credentials negotiated for CertificateVerify"); + } + + return null; + } + + S30CertificateVerifyMessage cvm = + new S30CertificateVerifyMessage(chc, x509Possession); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced CertificateVerify handshake message", cvm); + } + + // Output the handshake message. + cvm.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "CertificateVerify" handshake message consumer. + */ + private static final + class S30CertificateVerifyConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private S30CertificateVerifyConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + S30CertificateVerifyMessage cvm = + new S30CertificateVerifyMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming CertificateVerify handshake message", cvm); + } + + // + // update + // + // Need no additional validation. + + // + // produce + // + // Need no new handshake message producers here. + } + } + + /** + * The CertificateVerify handshake message (TLS 1.0/1.1). + */ + static final class T10CertificateVerifyMessage extends HandshakeMessage { + // signature bytes + private final byte[] signature; + + T10CertificateVerifyMessage(HandshakeContext context, + X509Possession x509Possession) throws IOException { + super(context); + + // This happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + byte[] temproary = null; + String algorithm = x509Possession.popPrivateKey.getAlgorithm(); + try { + Signature signer = + getSignature(algorithm, x509Possession.popPrivateKey); + byte[] hashes = chc.handshakeHash.digest(algorithm); + signer.update(hashes); + temproary = signer.sign(); + } catch (NoSuchAlgorithmException nsae) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm (" + algorithm + + ") used in CertificateVerify handshake message", nsae); + } catch (GeneralSecurityException gse) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot produce CertificateVerify signature", gse); + } + + this.signature = temproary; + } + + T10CertificateVerifyMessage(HandshakeContext context, + ByteBuffer m) throws IOException { + super(context); + + // This happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // digitally-signed struct { + // select(SignatureAlgorithm) { + // case anonymous: struct { }; + // case rsa: + // opaque md5_hash[16]; + // opaque sha_hash[20]; + // case dsa: + // opaque sha_hash[20]; + // }; + // } Signature; + if (m.remaining() < 2) { + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateVerify message: no sufficient data"); + } + + // read and verify the signature + this.signature = Record.getBytes16(m); + X509Credentials x509Credentials = null; + for (SSLCredentials cd : shc.handshakeCredentials) { + if (cd instanceof X509Credentials) { + x509Credentials = (X509Credentials)cd; + break; + } + } + + if (x509Credentials == null || + x509Credentials.popPublicKey == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No X509 credentials negotiated for CertificateVerify"); + } + + String algorithm = x509Credentials.popPublicKey.getAlgorithm(); + try { + Signature signer = + getSignature(algorithm, x509Credentials.popPublicKey); + byte[] hashes = shc.handshakeHash.digest(algorithm); + signer.update(hashes); + if (!signer.verify(signature)) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid CertificateVerify message: invalid signature"); + } + } catch (NoSuchAlgorithmException nsae) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm (" + algorithm + + ") used in CertificateVerify handshake message", nsae); + } catch (GeneralSecurityException gse) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot verify CertificateVerify signature", gse); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE_VERIFY; + } + + @Override + public int messageLength() { + return 2 + signature.length; // 2: length of signature + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putBytes16(signature); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"CertificateVerify\": '{'\n" + + " \"signature\": '{'\n" + + "{0}\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent( + hexEncoder.encodeBuffer(signature), " ") + }; + + return messageFormat.format(messageFields); + } + + /* + * Get the Signature object appropriate for verification using the + * given signature algorithm. + */ + private static Signature getSignature(String algorithm, + Key key) throws GeneralSecurityException { + Signature signer = null; + switch (algorithm) { + case "RSA": + signer = JsseJce.getSignature(JsseJce.SIGNATURE_RAWRSA); + break; + case "DSA": + signer = JsseJce.getSignature(JsseJce.SIGNATURE_RAWDSA); + break; + case "EC": + signer = JsseJce.getSignature(JsseJce.SIGNATURE_RAWECDSA); + break; + default: + throw new SignatureException("Unrecognized algorithm: " + + algorithm); + } + + if (signer != null) { + if (key instanceof PublicKey) { + signer.initVerify((PublicKey)(key)); + } else { + signer.initSign((PrivateKey)key); + } + } + + return signer; + } + } + + /** + * The "CertificateVerify" handshake message producer. + */ + private static final + class T10CertificateVerifyProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T10CertificateVerifyProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + X509Possession x509Possession = null; + for (SSLPossession possession : chc.handshakePossessions) { + if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + break; + } + } + + if (x509Possession == null || + x509Possession.popPrivateKey == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "No X.509 credentials negotiated for CertificateVerify"); + } + + return null; + } + + T10CertificateVerifyMessage cvm = + new T10CertificateVerifyMessage(chc, x509Possession); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced CertificateVerify handshake message", cvm); + } + + // Output the handshake message. + cvm.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "CertificateVerify" handshake message consumer. + */ + private static final + class T10CertificateVerifyConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T10CertificateVerifyConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + T10CertificateVerifyMessage cvm = + new T10CertificateVerifyMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming CertificateVerify handshake message", cvm); + } + + // + // update + // + // Need no additional validation. + + // + // produce + // + // Need no new handshake message producers here. } + } + } + + /** + * The CertificateVerify handshake message (TLS 1.2). + */ + static final class T12CertificateVerifyMessage extends HandshakeMessage { + // the signature algorithm + private final SignatureScheme signatureScheme; + + // signature bytes + private final byte[] signature; + + T12CertificateVerifyMessage(HandshakeContext context, + X509Possession x509Possession) throws IOException { + super(context); + + // This happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + this.signatureScheme = SignatureScheme.getPreferableAlgorithm( + chc.peerRequestedSignatureSchemes, + x509Possession.popPrivateKey, + chc.negotiatedProtocol); + if (signatureScheme == null) { + // Unlikely, the credentials generator should have + // selected the preferable signature algorithm properly. + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "No preferred signature algorithm for CertificateVerify"); + } + + byte[] temproary = null; + try { + Signature signer = + signatureScheme.getSignature(x509Possession.popPrivateKey); + signer.update(chc.handshakeHash.archived()); + temproary = signer.sign(); + } catch (NoSuchAlgorithmException | + InvalidAlgorithmParameterException nsae) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm (" + + signatureScheme.name + + ") used in CertificateVerify handshake message", nsae); + } catch (InvalidKeyException | SignatureException ikse) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot produce CertificateVerify signature", ikse); + } + + this.signature = temproary; + } + + T12CertificateVerifyMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + // This happens in server side only. + ServerHandshakeContext shc = + (ServerHandshakeContext)handshakeContext; + + // struct { + // SignatureAndHashAlgorithm algorithm; + // opaque signature<0..2^16-1>; + // } DigitallySigned; + if (m.remaining() < 4) { + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateVerify message: no sufficient data"); + } + + // SignatureAndHashAlgorithm algorithm + int ssid = Record.getInt16(m); + this.signatureScheme = SignatureScheme.valueOf(ssid); + if (signatureScheme == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid signature algorithm (" + ssid + + ") used in CertificateVerify handshake message"); + } + + if (!shc.localSupportedSignAlgs.contains(signatureScheme)) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsupported signature algorithm (" + + signatureScheme.name + + ") used in CertificateVerify handshake message"); + } + + // read and verify the signature + X509Credentials x509Credentials = null; + for (SSLCredentials cd : shc.handshakeCredentials) { + if (cd instanceof X509Credentials) { + x509Credentials = (X509Credentials)cd; + break; + } + } + + if (x509Credentials == null || + x509Credentials.popPublicKey == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No X509 credentials negotiated for CertificateVerify"); + } + + // opaque signature<0..2^16-1>; + this.signature = Record.getBytes16(m); + try { + Signature signer = + signatureScheme.getSignature(x509Credentials.popPublicKey); + signer.update(shc.handshakeHash.archived()); + if (!signer.verify(signature)) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid CertificateVerify signature"); + } + } catch (NoSuchAlgorithmException | + InvalidAlgorithmParameterException nsae) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm (" + + signatureScheme.name + + ") used in CertificateVerify handshake message", nsae); + } catch (InvalidKeyException | SignatureException ikse) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot verify CertificateVerify signature", ikse); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE_VERIFY; + } + + @Override + public int messageLength() { + return 4 + signature.length; // 2: signature algorithm + // +2: length of signature + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putInt16(signatureScheme.id); + hos.putBytes16(signature); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"CertificateVerify\": '{'\n" + + " \"signature algorithm\": {0}\n" + + " \"signature\": '{'\n" + + "{1}\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + signatureScheme.name, + Utilities.indent( + hexEncoder.encodeBuffer(signature), " ") + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "CertificateVerify" handshake message producer. + */ + private static final + class T12CertificateVerifyProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T12CertificateVerifyProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + X509Possession x509Possession = null; + for (SSLPossession possession : chc.handshakePossessions) { + if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + break; + } + } + + if (x509Possession == null || + x509Possession.popPrivateKey == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "No X.509 credentials negotiated for CertificateVerify"); + } + + return null; + } + + T12CertificateVerifyMessage cvm = + new T12CertificateVerifyMessage(chc, x509Possession); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced CertificateVerify handshake message", cvm); + } + + // Output the handshake message. + cvm.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "CertificateVerify" handshake message consumer. + */ + private static final + class T12CertificateVerifyConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T12CertificateVerifyConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + T12CertificateVerifyMessage cvm = + new T12CertificateVerifyMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming CertificateVerify handshake message", cvm); + } + + // + // update + // + // Need no additional validation. + + // + // produce + // + // Need no new handshake message producers here. + } + } + + /** + * The CertificateVerify handshake message (TLS 1.3). + */ + static final class T13CertificateVerifyMessage extends HandshakeMessage { + private static final byte[] serverSignHead = new byte[] { + // repeated 0x20 for 64 times + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + + // "TLS 1.3, server CertificateVerify" + 0x00 + (byte)0x54, (byte)0x4c, (byte)0x53, (byte)0x20, + (byte)0x31, (byte)0x2e, (byte)0x33, (byte)0x2c, + (byte)0x20, (byte)0x73, (byte)0x65, (byte)0x72, + (byte)0x76, (byte)0x65, (byte)0x72, (byte)0x20, + (byte)0x43, (byte)0x65, (byte)0x72, (byte)0x74, + (byte)0x69, (byte)0x66, (byte)0x69, (byte)0x63, + (byte)0x61, (byte)0x74, (byte)0x65, (byte)0x56, + (byte)0x65, (byte)0x72, (byte)0x69, (byte)0x66, + (byte)0x79, (byte)0x00 + }; + + private static final byte[] clientSignHead = new byte[] { + // repeated 0x20 for 64 times + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + (byte)0x20, (byte)0x20, (byte)0x20, (byte)0x20, + + // "TLS 1.3, client CertificateVerify" + 0x00 + (byte)0x54, (byte)0x4c, (byte)0x53, (byte)0x20, + (byte)0x31, (byte)0x2e, (byte)0x33, (byte)0x2c, + (byte)0x20, (byte)0x63, (byte)0x6c, (byte)0x69, + (byte)0x65, (byte)0x6e, (byte)0x74, (byte)0x20, + (byte)0x43, (byte)0x65, (byte)0x72, (byte)0x74, + (byte)0x69, (byte)0x66, (byte)0x69, (byte)0x63, + (byte)0x61, (byte)0x74, (byte)0x65, (byte)0x56, + (byte)0x65, (byte)0x72, (byte)0x69, (byte)0x66, + (byte)0x79, (byte)0x00 + }; + + + // the signature algorithm + private final SignatureScheme signatureScheme; + + // signature bytes + private final byte[] signature; + + T13CertificateVerifyMessage(HandshakeContext context, + X509Possession x509Possession) throws IOException { + super(context); + + this.signatureScheme = SignatureScheme.getPreferableAlgorithm( + context.peerRequestedSignatureSchemes, + x509Possession.popPrivateKey, + context.negotiatedProtocol); + if (signatureScheme == null) { + // Unlikely, the credentials generator should have + // selected the preferable signature algorithm properly. + context.conContext.fatal(Alert.INTERNAL_ERROR, + "No preferred signature algorithm for CertificateVerify"); + } + + byte[] hashValue = context.handshakeHash.digest(); + byte[] contentCovered; + if (context.sslConfig.isClientMode) { + contentCovered = Arrays.copyOf(clientSignHead, + clientSignHead.length + hashValue.length); + System.arraycopy(hashValue, 0, contentCovered, + clientSignHead.length, hashValue.length); + } else { + contentCovered = Arrays.copyOf(serverSignHead, + serverSignHead.length + hashValue.length); + System.arraycopy(hashValue, 0, contentCovered, + serverSignHead.length, hashValue.length); + } + + byte[] temproary = null; + try { + Signature signer = + signatureScheme.getSignature(x509Possession.popPrivateKey); + signer.update(contentCovered); + temproary = signer.sign(); + } catch (NoSuchAlgorithmException | + InvalidAlgorithmParameterException nsae) { + context.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm (" + + signatureScheme.name + + ") used in CertificateVerify handshake message", nsae); + } catch (InvalidKeyException | SignatureException ikse) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot produce CertificateVerify signature", ikse); + } + + this.signature = temproary; + } + + T13CertificateVerifyMessage(HandshakeContext context, + ByteBuffer m) throws IOException { + super(context); + + // struct { + // SignatureAndHashAlgorithm algorithm; + // opaque signature<0..2^16-1>; + // } DigitallySigned; + if (m.remaining() < 4) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid CertificateVerify message: no sufficient data"); + } + + // SignatureAndHashAlgorithm algorithm + int ssid = Record.getInt16(m); + this.signatureScheme = SignatureScheme.valueOf(ssid); + if (signatureScheme == null) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid signature algorithm (" + ssid + + ") used in CertificateVerify handshake message"); + } + + if (!context.localSupportedSignAlgs.contains(signatureScheme)) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsupported signature algorithm (" + + signatureScheme.name + + ") used in CertificateVerify handshake message"); + } + + // read and verify the signature + X509Credentials x509Credentials = null; + for (SSLCredentials cd : context.handshakeCredentials) { + if (cd instanceof X509Credentials) { + x509Credentials = (X509Credentials)cd; + break; + } + } + + if (x509Credentials == null || + x509Credentials.popPublicKey == null) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No X509 credentials negotiated for CertificateVerify"); + } + + // opaque signature<0..2^16-1>; + this.signature = Record.getBytes16(m); + + byte[] hashValue = context.handshakeHash.digest(); + byte[] contentCovered; + if (context.sslConfig.isClientMode) { + contentCovered = Arrays.copyOf(serverSignHead, + serverSignHead.length + hashValue.length); + System.arraycopy(hashValue, 0, contentCovered, + serverSignHead.length, hashValue.length); + } else { + contentCovered = Arrays.copyOf(clientSignHead, + clientSignHead.length + hashValue.length); + System.arraycopy(hashValue, 0, contentCovered, + clientSignHead.length, hashValue.length); + } + + try { + Signature signer = + signatureScheme.getSignature(x509Credentials.popPublicKey); + signer.update(contentCovered); + if (!signer.verify(signature)) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid CertificateVerify signature"); + } + } catch (NoSuchAlgorithmException | + InvalidAlgorithmParameterException nsae) { + context.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm (" + + signatureScheme.name + + ") used in CertificateVerify handshake message", nsae); + } catch (InvalidKeyException | SignatureException ikse) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot verify CertificateVerify signature", ikse); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CERTIFICATE_VERIFY; + } + + @Override + public int messageLength() { + return 4 + signature.length; // 2: signature algorithm + // +2: length of signature + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putInt16(signatureScheme.id); + hos.putBytes16(signature); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"CertificateVerify\": '{'\n" + + " \"signature algorithm\": {0}\n" + + " \"signature\": '{'\n" + + "{1}\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + signatureScheme.name, + Utilities.indent( + hexEncoder.encodeBuffer(signature), " ") + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "CertificateVerify" handshake message producer. + */ + private static final + class T13CertificateVerifyProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T13CertificateVerifyProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + + X509Possession x509Possession = null; + for (SSLPossession possession : hc.handshakePossessions) { + if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + break; + } + } + + if (x509Possession == null || + x509Possession.popPrivateKey == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "No X.509 credentials negotiated for CertificateVerify"); + } + + return null; + } + + if (hc.sslConfig.isClientMode) { + return onProduceCertificateVerify( + (ClientHandshakeContext)context, x509Possession); + } else { + return onProduceCertificateVerify( + (ServerHandshakeContext)context, x509Possession); + } + } + + private byte[] onProduceCertificateVerify(ServerHandshakeContext shc, + X509Possession x509Possession) throws IOException { + T13CertificateVerifyMessage cvm = + new T13CertificateVerifyMessage(shc, x509Possession); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced server CertificateVerify handshake message", cvm); + } + + // Output the handshake message. + cvm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + + private byte[] onProduceCertificateVerify(ClientHandshakeContext chc, + X509Possession x509Possession) throws IOException { + T13CertificateVerifyMessage cvm = + new T13CertificateVerifyMessage(chc, x509Possession); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced client CertificateVerify handshake message", cvm); + } + + // Output the handshake message. + cvm.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "CertificateVerify" handshake message consumer. + */ + private static final + class T13CertificateVerifyConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T13CertificateVerifyConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The producing happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + T13CertificateVerifyMessage cvm = + new T13CertificateVerifyMessage(hc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming CertificateVerify handshake message", cvm); + } + + // + // update + // + // Need no additional validation. + + // + // produce + // + // Need no new handshake message producers here. + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertSignAlgsExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,348 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.List; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SignatureAlgorithmsExtension.SignatureSchemesSpec; + +/** + * Pack of the "signature_algorithms_cert" extensions. + */ +final class CertSignAlgsExtension { + static final HandshakeProducer chNetworkProducer = + new CHCertSignatureSchemesProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHCertSignatureSchemesConsumer(); + static final HandshakeConsumer chOnTradeConsumer = + new CHCertSignatureSchemesUpdate(); + + static final HandshakeProducer crNetworkProducer = + new CRCertSignatureSchemesProducer(); + static final ExtensionConsumer crOnLoadConsumer = + new CRCertSignatureSchemesConsumer(); + static final HandshakeConsumer crOnTradeConsumer = + new CRCertSignatureSchemesUpdate(); + + static final SSLStringizer ssStringizer = + new CertSignatureSchemesStringizer(); + + private static final + class CertSignatureSchemesStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new SignatureSchemesSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of a "signature_algorithms_cert" extension in + * the ClientHello handshake message. + */ + private static final + class CHCertSignatureSchemesProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHCertSignatureSchemesProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable( + SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable " + + "signature_algorithms_cert extension"); + } + + return null; // ignore the extension + } + + // Produce the extension. + if (chc.localSupportedSignAlgs == null) { + chc.localSupportedSignAlgs = + SignatureScheme.getSupportedAlgorithms( + chc.algorithmConstraints, chc.activeProtocols); + } + + int vectorLen = SignatureScheme.sizeInRecord() * + chc.localSupportedSignAlgs.size(); + byte[] extData = new byte[vectorLen + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, vectorLen); + for (SignatureScheme ss : chc.localSupportedSignAlgs) { + Record.putInt16(m, ss.id); + } + + // Update the context. + chc.handshakeExtensions.put( + SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT, + new SignatureSchemesSpec(chc.localSupportedSignAlgs)); + + return extData; + } + } + + /** + * Network data consumer of a "signature_algorithms_cert" extension in + * the ClientHello handshake message. + */ + private static final + class CHCertSignatureSchemesConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHCertSignatureSchemesConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable( + SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable " + + "signature_algorithms_cert extension"); + } + return; // ignore the extension + } + + // Parse the extension. + SignatureSchemesSpec spec; + try { + spec = new SignatureSchemesSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + shc.handshakeExtensions.put( + SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT, spec); + + // No impact on session resumption. + } + } + + /** + * After session creation consuming of a "signature_algorithms_cert" + * extension in the ClientHello handshake message. + */ + private static final class CHCertSignatureSchemesUpdate + implements HandshakeConsumer { + // Prevent instantiation of this class. + private CHCertSignatureSchemesUpdate() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + SignatureSchemesSpec spec = (SignatureSchemesSpec) + shc.handshakeExtensions.get( + SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT); + if (spec == null) { + // Ignore, no signature_algorithms_cert extension requested. + return; + } + + // update the context + List<SignatureScheme> shemes = + SignatureScheme.getSupportedAlgorithms( + shc.algorithmConstraints, shc.negotiatedProtocol, + spec.signatureSchemes); + shc.peerRequestedCertSignSchemes = shemes; + shc.handshakeSession.setPeerSupportedSignatureAlgorithms(shemes); + + if (!shc.isResumption && shc.negotiatedProtocol.useTLS13PlusSpec()) { + if (shc.sslConfig.clientAuthType != + ClientAuthType.CLIENT_AUTH_NONE) { + shc.handshakeProducers.putIfAbsent( + SSLHandshake.CERTIFICATE_REQUEST.id, + SSLHandshake.CERTIFICATE_REQUEST); + } + shc.handshakeProducers.put(SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE); + shc.handshakeProducers.putIfAbsent( + SSLHandshake.CERTIFICATE_VERIFY.id, + SSLHandshake.CERTIFICATE_VERIFY); + } + } + } + + /** + * Network data producer of a "signature_algorithms_cert" extension in + * the CertificateRequest handshake message. + */ + private static final + class CRCertSignatureSchemesProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CRCertSignatureSchemesProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable( + SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable " + + "signature_algorithms_cert extension"); + } + return null; // ignore the extension + } + + // Produce the extension. + if (shc.localSupportedSignAlgs == null) { + shc.localSupportedSignAlgs = + SignatureScheme.getSupportedAlgorithms( + shc.algorithmConstraints, shc.activeProtocols); + } + + int vectorLen = SignatureScheme.sizeInRecord() * + shc.localSupportedSignAlgs.size(); + byte[] extData = new byte[vectorLen + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, vectorLen); + for (SignatureScheme ss : shc.localSupportedSignAlgs) { + Record.putInt16(m, ss.id); + } + + // Update the context. + shc.handshakeExtensions.put( + SSLExtension.CR_SIGNATURE_ALGORITHMS_CERT, + new SignatureSchemesSpec(shc.localSupportedSignAlgs)); + + return extData; + } + } + + /** + * Network data consumer of a "signature_algorithms_cert" extension in + * the CertificateRequest handshake message. + */ + private static final + class CRCertSignatureSchemesConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CRCertSignatureSchemesConsumer() { + // blank + } + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable( + SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable " + + "signature_algorithms_cert extension"); + } + return; // ignore the extension + } + + // Parse the extension. + SignatureSchemesSpec spec; + try { + spec = new SignatureSchemesSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + chc.handshakeExtensions.put( + SSLExtension.CR_SIGNATURE_ALGORITHMS_CERT, spec); + + // No impact on session resumption. + } + } + + /** + * After session creation consuming of a "signature_algorithms_cert" + * extension in the CertificateRequest handshake message. + */ + private static final class CRCertSignatureSchemesUpdate + implements HandshakeConsumer { + // Prevent instantiation of this class. + private CRCertSignatureSchemesUpdate() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + SignatureSchemesSpec spec = (SignatureSchemesSpec) + chc.handshakeExtensions.get( + SSLExtension.CR_SIGNATURE_ALGORITHMS_CERT); + if (spec == null) { + // Ignore, no "signature_algorithms_cert" extension requested. + return; + } + + // update the context + List<SignatureScheme> shemes = + SignatureScheme.getSupportedAlgorithms( + chc.algorithmConstraints, chc.negotiatedProtocol, + spec.signatureSchemes); + chc.peerRequestedCertSignSchemes = shemes; + chc.handshakeSession.setPeerSupportedSignatureAlgorithms(shemes); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertStatusExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1219 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.io.ByteArrayInputStream; +import java.nio.ByteBuffer; +import java.security.cert.Extension; +import java.security.cert.CertificateFactory; +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import javax.net.ssl.SSLProtocolException; +import sun.security.provider.certpath.OCSPResponse; +import sun.security.provider.certpath.ResponderId; +import static sun.security.ssl.SSLExtension.CH_STATUS_REQUEST; +import static sun.security.ssl.SSLExtension.CH_STATUS_REQUEST_V2; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import static sun.security.ssl.SSLExtension.SH_STATUS_REQUEST; +import static sun.security.ssl.SSLExtension.SH_STATUS_REQUEST_V2; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.util.DerInputStream; +import sun.security.util.DerValue; +import sun.security.util.HexDumpEncoder; + +/** + * Pack of "status_request" and "status_request_v2" extensions. + */ +final class CertStatusExtension { + static final HandshakeProducer chNetworkProducer = + new CHCertStatusReqProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHCertStatusReqConsumer(); + + static final HandshakeProducer shNetworkProducer = + new SHCertStatusReqProducer(); + static final ExtensionConsumer shOnLoadConsumer = + new SHCertStatusReqConsumer(); + + static final HandshakeProducer ctNetworkProducer = + new CTCertStatusResponseProducer(); + static final ExtensionConsumer ctOnLoadConsumer = + new CTCertStatusResponseConsumer(); + + static final SSLStringizer certStatusReqStringizer = + new CertStatusRequestStringizer(); + + static final HandshakeProducer chV2NetworkProducer = + new CHCertStatusReqV2Producer(); + static final ExtensionConsumer chV2OnLoadConsumer = + new CHCertStatusReqV2Consumer(); + + static final HandshakeProducer shV2NetworkProducer = + new SHCertStatusReqV2Producer(); + static final ExtensionConsumer shV2OnLoadConsumer = + new SHCertStatusReqV2Consumer(); + + static final SSLStringizer certStatusReqV2Stringizer = + new CertStatusRequestsStringizer(); + + static final SSLStringizer certStatusRespStringizer = + new CertStatusRespStringizer(); + + /** + * The "status_request" extension. + * + * RFC6066 defines the TLS extension,"status_request" (type 0x5), + * which allows the client to request that the server perform OCSP + * on the client's behalf. + * + * The "extension data" field of this extension contains a + * "CertificateStatusRequest" structure: + * + * struct { + * CertificateStatusType status_type; + * select (status_type) { + * case ocsp: OCSPStatusRequest; + * } request; + * } CertificateStatusRequest; + * + * enum { ocsp(1), (255) } CertificateStatusType; + * + * struct { + * ResponderID responder_id_list<0..2^16-1>; + * Extensions request_extensions; + * } OCSPStatusRequest; + * + * opaque ResponderID<1..2^16-1>; + * opaque Extensions<0..2^16-1>; + */ + static final class CertStatusRequestSpec implements SSLExtensionSpec { + static final CertStatusRequestSpec DEFAULT = + new CertStatusRequestSpec(OCSPStatusRequest.EMPTY_OCSP); + + final CertStatusRequest statusRequest; + + private CertStatusRequestSpec(CertStatusRequest statusRequest) { + this.statusRequest = statusRequest; + } + + private CertStatusRequestSpec(ByteBuffer buffer) throws IOException { + // Is it a empty extension_data? + if (buffer.remaining() == 0) { + // server response + this.statusRequest = null; + return; + } + + if (buffer.remaining() < 1) { + throw new SSLProtocolException( + "Invalid status_request extension: insufficient data"); + } + + byte statusType = (byte)Record.getInt8(buffer); + byte[] encoded = new byte[buffer.remaining()]; + if (encoded.length != 0) { + buffer.get(encoded); + } + if (statusType == CertStatusRequestType.OCSP.id) { + this.statusRequest = new OCSPStatusRequest(statusType, encoded); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.info( + "Unknown certificate status request " + + "(status type: " + statusType + ")"); + } + + this.statusRequest = new CertStatusRequest(statusType, encoded); + } + } + + @Override + public String toString() { + return statusRequest == null ? + "<empty>" : statusRequest.toString(); + } + } + + /** + * Defines the CertificateStatus response structure as outlined in + * RFC 6066. This will contain a status response type, plus a single, + * non-empty OCSP response in DER-encoded form. + * + * struct { + * CertificateStatusType status_type; + * select (status_type) { + * case ocsp: OCSPResponse; + * } response; + * } CertificateStatus; + */ + static final class CertStatusResponseSpec implements SSLExtensionSpec { + final CertStatusResponse statusResponse; + + private CertStatusResponseSpec(CertStatusResponse resp) { + this.statusResponse = resp; + } + + private CertStatusResponseSpec(ByteBuffer buffer) throws IOException { + if (buffer.remaining() < 2) { + throw new SSLProtocolException( + "Invalid status_request extension: insufficient data"); + } + + // Get the status type (1 byte) and response data (vector) + byte type = (byte)Record.getInt8(buffer); + byte[] respData = Record.getBytes24(buffer); + + // Create the CertStatusResponse based on the type + if (type == CertStatusRequestType.OCSP.id) { + this.statusResponse = new OCSPStatusResponse(type, respData); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.info( + "Unknown certificate status response " + + "(status type: " + type + ")"); + } + + this.statusResponse = new CertStatusResponse(type, respData); + } + } + + @Override + public String toString() { + return statusResponse == null ? + "<empty>" : statusResponse.toString(); + } + } + + private static final + class CertStatusRequestStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new CertStatusRequestSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + private static final + class CertStatusRespStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new CertStatusResponseSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + static enum CertStatusRequestType { + OCSP ((byte)0x01, "ocsp"), // RFC 6066/6961 + OCSP_MULTI ((byte)0x02, "ocsp_multi"); // RFC 6961 + + final byte id; + final String name; + + private CertStatusRequestType(byte id, String name) { + this.id = id; + this.name = name; + } + + /** + * Returns the enum constant of the specified id (see RFC 6066). + */ + static CertStatusRequestType valueOf(byte id) { + for (CertStatusRequestType srt : CertStatusRequestType.values()) { + if (srt.id == id) { + return srt; + } + } + + return null; + } + + static String nameOf(byte id) { + for (CertStatusRequestType srt : CertStatusRequestType.values()) { + if (srt.id == id) { + return srt.name; + } + } + + return "UNDEFINED-CERT-STATUS-TYPE(" + id + ")"; + } + } + + static class CertStatusRequest { + final byte statusType; + final byte[] encodedRequest; + + protected CertStatusRequest(byte statusType, byte[] encodedRequest) { + this.statusType = statusType; + this.encodedRequest = encodedRequest; + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"certificate status type\": {0}\n" + + "\"encoded certificate status\": '{'\n" + + "{1}\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + String encoded = hexEncoder.encodeBuffer(encodedRequest); + + Object[] messageFields = { + CertStatusRequestType.nameOf(statusType), + Utilities.indent(encoded) + }; + + return messageFormat.format(messageFields); + } + } + + /* + * RFC6066 defines the TLS extension,"status_request" (type 0x5), + * which allows the client to request that the server perform OCSP + * on the client's behalf. + * + * The RFC defines an OCSPStatusRequest structure: + * + * struct { + * ResponderID responder_id_list<0..2^16-1>; + * Extensions request_extensions; + * } OCSPStatusRequest; + */ + static final class OCSPStatusRequest extends CertStatusRequest { + static final OCSPStatusRequest EMPTY_OCSP; + static final OCSPStatusRequest EMPTY_OCSP_MULTI; + + final List<ResponderId> responderIds; + final List<Extension> extensions; + private final int ridListLen; + private final int extListLen; + + static { + OCSPStatusRequest ocspReq = null; + OCSPStatusRequest multiReq = null; + + try { + ocspReq = new OCSPStatusRequest( + CertStatusRequestType.OCSP.id, + new byte[] {0x00, 0x00, 0x00, 0x00}); + multiReq = new OCSPStatusRequest( + CertStatusRequestType.OCSP_MULTI.id, + new byte[] {0x00, 0x00, 0x00, 0x00}); + } catch (IOException ioe) { + // unlikely + } + + EMPTY_OCSP = ocspReq; + EMPTY_OCSP_MULTI = multiReq; + } + + private OCSPStatusRequest(byte statusType, + byte[] encoded) throws IOException { + super(statusType, encoded); + + if (encoded == null || encoded.length < 4) { + // 2: length of responder_id_list + // +2: length of request_extensions + throw new SSLProtocolException( + "Invalid OCSP status request: insufficient data"); + } + + List<ResponderId> rids = new ArrayList<>(); + List<Extension> exts = new ArrayList<>(); + ByteBuffer m = ByteBuffer.wrap(encoded); + + this.ridListLen = Record.getInt16(m); + if (m.remaining() < (ridListLen + 2)) { + throw new SSLProtocolException( + "Invalid OCSP status request: insufficient data"); + } + + int ridListBytesRemaining = ridListLen; + while (ridListBytesRemaining >= 2) { // 2: length of responder_id + byte[] ridBytes = Record.getBytes16(m); + try { + rids.add(new ResponderId(ridBytes)); + } catch (IOException ioe) { + throw new SSLProtocolException( + "Invalid OCSP status request: invalid responder ID"); + } + ridListBytesRemaining -= ridBytes.length + 2; + } + + if (ridListBytesRemaining != 0) { + throw new SSLProtocolException( + "Invalid OCSP status request: incomplete data"); + } + + byte[] extListBytes = Record.getBytes16(m); + this.extListLen = extListBytes.length; + if (extListLen > 0) { + try { + DerInputStream dis = new DerInputStream(extListBytes); + DerValue[] extSeqContents = + dis.getSequence(extListBytes.length); + for (DerValue extDerVal : extSeqContents) { + exts.add(new sun.security.x509.Extension(extDerVal)); + } + } catch (IOException ioe) { + throw new SSLProtocolException( + "Invalid OCSP status request: invalid extension"); + } + } + + this.responderIds = rids; + this.extensions = exts; + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"certificate status type\": {0}\n" + + "\"OCSP status request\": '{'\n" + + "{1}\n" + + "'}'", + Locale.ENGLISH); + + MessageFormat requestFormat = new MessageFormat( + "\"responder_id\": {0}\n" + + "\"request extensions\": '{'\n" + + "{1}\n" + + "'}'", + Locale.ENGLISH); + + String ridStr = "<empty>"; + if (!responderIds.isEmpty()) { + ridStr = responderIds.toString(); + } + + String extsStr = "<empty>"; + if (!extensions.isEmpty()) { + StringBuilder extBuilder = new StringBuilder(512); + boolean isFirst = true; + for (Extension ext : this.extensions) { + if (isFirst) { + isFirst = false; + } else { + extBuilder.append(",\n"); + } + extBuilder.append( + "{\n" + Utilities.indent(ext.toString()) + "}"); + } + + extsStr = extBuilder.toString(); + } + + Object[] requestFields = { + ridStr, + Utilities.indent(extsStr) + }; + String ocspStatusRequest = requestFormat.format(requestFields); + + Object[] messageFields = { + CertStatusRequestType.nameOf(statusType), + Utilities.indent(ocspStatusRequest) + }; + + return messageFormat.format(messageFields); + } + } + + static class CertStatusResponse { + final byte statusType; + final byte[] encodedResponse; + + protected CertStatusResponse(byte statusType, byte[] respDer) { + this.statusType = statusType; + this.encodedResponse = respDer; + } + + byte[] toByteArray() throws IOException { + // Create a byte array large enough to handle the status_type + // field (1) + OCSP length (3) + OCSP data (variable) + byte[] outData = new byte[encodedResponse.length + 4]; + ByteBuffer buf = ByteBuffer.wrap(outData); + Record.putInt8(buf, statusType); + Record.putBytes24(buf, encodedResponse); + return buf.array(); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"certificate status response type\": {0}\n" + + "\"encoded certificate status\": '{'\n" + + "{1}\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + String encoded = hexEncoder.encodeBuffer(encodedResponse); + + Object[] messageFields = { + CertStatusRequestType.nameOf(statusType), + Utilities.indent(encoded) + }; + + return messageFormat.format(messageFields); + } + } + + static final class OCSPStatusResponse extends CertStatusResponse { + final OCSPResponse ocspResponse; + + private OCSPStatusResponse(byte statusType, + byte[] encoded) throws IOException { + super(statusType, encoded); + + // The DER-encoded OCSP response must not be zero length + if (encoded == null || encoded.length < 1) { + throw new SSLProtocolException( + "Invalid OCSP status response: insufficient data"); + } + + // Otherwise, make an OCSPResponse object from the data + ocspResponse = new OCSPResponse(encoded); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"certificate status response type\": {0}\n" + + "\"OCSP status response\": '{'\n" + + "{1}\n" + + "'}'", + Locale.ENGLISH); + + Object[] messageFields = { + CertStatusRequestType.nameOf(statusType), + Utilities.indent(ocspResponse.toString()) + }; + + return messageFormat.format(messageFields); + } + } + + /** + * Network data producer of a "status_request" extension in the + * ClientHello handshake message. + */ + private static final + class CHCertStatusReqProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHCertStatusReqProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + if (!chc.sslContext.isStaplingEnabled(true)) { + return null; + } + + if (!chc.sslConfig.isAvailable(CH_STATUS_REQUEST)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + + CH_STATUS_REQUEST.name); + } + return null; + } + + // Produce the extension. + // + // We are using empty OCSPStatusRequest at present. May extend to + // support specific responder or extensions later. + byte[] extData = new byte[] {0x01, 0x00, 0x00, 0x00, 0x00}; + + // Update the context. + chc.handshakeExtensions.put( + CH_STATUS_REQUEST, CertStatusRequestSpec.DEFAULT); + + return extData; + } + } + + /** + * Network data consumer of a "status_request" extension in the + * ClientHello handshake message. + */ + private static final + class CHCertStatusReqConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHCertStatusReqConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + if (!shc.sslConfig.isAvailable(CH_STATUS_REQUEST)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Ignore unavailable extension: " + + CH_STATUS_REQUEST.name); + } + return; // ignore the extension + } + + // Parse the extension. + CertStatusRequestSpec spec; + try { + spec = new CertStatusRequestSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + shc.handshakeExtensions.put(CH_STATUS_REQUEST, spec); + if (!shc.isResumption && + !shc.negotiatedProtocol.useTLS13PlusSpec()) { + shc.handshakeProducers.put(SSLHandshake.CERTIFICATE_STATUS.id, + SSLHandshake.CERTIFICATE_STATUS); + } // Otherwise, the certificate status presents in server cert. + + // No impact on session resumption. + } + } + + /** + * Network data producer of a "status_request" extension in the + * ServerHello handshake message. + */ + private static final + class SHCertStatusReqProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHCertStatusReqProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // The StaplingParameters in the ServerHandshakeContext will + // contain the info about what kind of stapling (if any) to + // perform and whether this status_request extension should be + // produced or the status_request_v2 (found in a different producer) + // No explicit check is required for isStaplingEnabled here. If + // it is false then stapleParams will be null. If it is true + // then stapleParams may or may not be false and the check below + // is sufficient. + if ((shc.stapleParams == null) || + (shc.stapleParams.statusRespExt != + SSLExtension.CH_STATUS_REQUEST)) { + return null; // Do not produce status_request in ServerHello + } + + // In response to "status_request" extension request only. + CertStatusRequestSpec spec = (CertStatusRequestSpec) + shc.handshakeExtensions.get(CH_STATUS_REQUEST); + if (spec == null) { + // Ignore, no status_request extension requested. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Ignore unavailable extension: " + + CH_STATUS_REQUEST.name); + } + + return null; // ignore the extension + } + + // Is it a session resuming? + if (shc.isResumption) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "No status_request response for session resuming"); + } + + return null; // ignore the extension + } + + // The "extension_data" in the extended ServerHello handshake + // message MUST be empty. + byte[] extData = new byte[0]; + + // Update the context. + shc.handshakeExtensions.put( + SH_STATUS_REQUEST, CertStatusRequestSpec.DEFAULT); + + return extData; + } + } + + /** + * Network data consumer of a "status_request" extension in the + * ServerHello handshake message. + */ + private static final + class SHCertStatusReqConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHCertStatusReqConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to "status_request" extension request only. + CertStatusRequestSpec requestedCsr = (CertStatusRequestSpec) + chc.handshakeExtensions.get(CH_STATUS_REQUEST); + if (requestedCsr == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected status_request extension in ServerHello"); + } + + // Parse the extension. + if (buffer.hasRemaining()) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid status_request extension in ServerHello message: " + + "the extension data must be empty"); + } + + // Update the context. + chc.handshakeExtensions.put( + SH_STATUS_REQUEST, CertStatusRequestSpec.DEFAULT); + chc.handshakeConsumers.put(SSLHandshake.CERTIFICATE_STATUS.id, + SSLHandshake.CERTIFICATE_STATUS); + + // Since we've received a legitimate status_request in the + // ServerHello, stapling is active if it's been enabled. + chc.staplingActive = chc.sslContext.isStaplingEnabled(true); + + // No impact on session resumption. + } + } + + /** + * The "status_request_v2" extension. + * + * RFC6961 defines the TLS extension,"status_request_v2" (type 0x5), + * which allows the client to request that the server perform OCSP + * on the client's behalf. + * + * The RFC defines an CertStatusReqItemV2 structure: + * + * struct { + * CertificateStatusType status_type; + * uint16 request_length; + * select (status_type) { + * case ocsp: OCSPStatusRequest; + * case ocsp_multi: OCSPStatusRequest; + * } request; + * } CertificateStatusRequestItemV2; + * + * enum { ocsp(1), ocsp_multi(2), (255) } CertificateStatusType; + * struct { + * ResponderID responder_id_list<0..2^16-1>; + * Extensions request_extensions; + * } OCSPStatusRequest; + * + * opaque ResponderID<1..2^16-1>; + * opaque Extensions<0..2^16-1>; + * + * struct { + * CertificateStatusRequestItemV2 + * certificate_status_req_list<1..2^16-1>; + * } CertificateStatusRequestListV2; + */ + static final class CertStatusRequestV2Spec implements SSLExtensionSpec { + static final CertStatusRequestV2Spec DEFAULT = + new CertStatusRequestV2Spec(new CertStatusRequest[] { + OCSPStatusRequest.EMPTY_OCSP_MULTI}); + + final CertStatusRequest[] certStatusRequests; + + private CertStatusRequestV2Spec(CertStatusRequest[] certStatusRequests) { + this.certStatusRequests = certStatusRequests; + } + + private CertStatusRequestV2Spec(ByteBuffer message) throws IOException { + // Is it a empty extension_data? + if (message.remaining() == 0) { + // server response + this.certStatusRequests = new CertStatusRequest[0]; + return; + } + + if (message.remaining() < 5) { // 2: certificate_status_req_list + // +1: status_type + // +2: request_length + throw new SSLProtocolException( + "Invalid status_request_v2 extension: insufficient data"); + } + + int listLen = Record.getInt16(message); + if (listLen <= 0) { + throw new SSLProtocolException( + "certificate_status_req_list length must be positive " + + "(received length: " + listLen + ")"); + } + + int remaining = listLen; + List<CertStatusRequest> statusRequests = new ArrayList<>(); + while (remaining > 0) { + byte statusType = (byte)Record.getInt8(message); + int requestLen = Record.getInt16(message); + + if (message.remaining() < requestLen) { + throw new SSLProtocolException( + "Invalid status_request_v2 extension: " + + "insufficient data (request_length=" + requestLen + + ", remining=" + message.remaining() + ")"); + } + + byte[] encoded = new byte[requestLen]; + if (encoded.length != 0) { + message.get(encoded); + } + remaining -= 3; // 1(status type) + 2(request_length) bytes + remaining -= requestLen; + + if (statusType == CertStatusRequestType.OCSP.id || + statusType == CertStatusRequestType.OCSP_MULTI.id) { + if (encoded.length < 4) { + // 2: length of responder_id_list + // +2: length of request_extensions + throw new SSLProtocolException( + "Invalid status_request_v2 extension: " + + "insufficient data"); + } + statusRequests.add( + new OCSPStatusRequest(statusType, encoded)); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.info( + "Unknown certificate status request " + + "(status type: " + statusType + ")"); + } + statusRequests.add( + new CertStatusRequest(statusType, encoded)); + } + } + + certStatusRequests = + statusRequests.toArray(new CertStatusRequest[0]); + } + + @Override + public String toString() { + if (certStatusRequests == null || certStatusRequests.length == 0) { + return "<empty>"; + } else { + MessageFormat messageFormat = new MessageFormat( + "\"cert status request\": '{'\n{0}\n'}'", Locale.ENGLISH); + + StringBuilder builder = new StringBuilder(512); + boolean isFirst = true; + for (CertStatusRequest csr : certStatusRequests) { + if (isFirst) { + isFirst = false; + } else { + builder.append(", "); + } + Object[] messageFields = { + Utilities.indent(csr.toString()) + }; + builder.append(messageFormat.format(messageFields)); + } + + return builder.toString(); + } + } + } + + private static final + class CertStatusRequestsStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new CertStatusRequestV2Spec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of a "status_request_v2" extension in the + * ClientHello handshake message. + */ + private static final + class CHCertStatusReqV2Producer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHCertStatusReqV2Producer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + if (!chc.sslContext.isStaplingEnabled(true)) { + return null; + } + + if (!chc.sslConfig.isAvailable(CH_STATUS_REQUEST_V2)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Ignore unavailable status_request_v2 extension"); + } + + return null; + } + + // Produce the extension. + // + // We are using empty OCSPStatusRequest at present. May extend to + // support specific responder or extensions later. + byte[] extData = new byte[] { + 0x00, 0x07, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00}; + + // Update the context. + chc.handshakeExtensions.put( + CH_STATUS_REQUEST_V2, CertStatusRequestV2Spec.DEFAULT); + + return extData; + } + } + + /** + * Network data consumer of a "status_request_v2" extension in the + * ClientHello handshake message. + */ + private static final + class CHCertStatusReqV2Consumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHCertStatusReqV2Consumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + if (!shc.sslConfig.isAvailable(CH_STATUS_REQUEST_V2)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Ignore unavailable status_request_v2 extension"); + } + + return; // ignore the extension + } + + // Parse the extension. + CertStatusRequestV2Spec spec; + try { + spec = new CertStatusRequestV2Spec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + shc.handshakeExtensions.put(CH_STATUS_REQUEST_V2, spec); + if (!shc.isResumption) { + shc.handshakeProducers.putIfAbsent( + SSLHandshake.CERTIFICATE_STATUS.id, + SSLHandshake.CERTIFICATE_STATUS); + } + + // No impact on session resumption. + } + } + + /** + * Network data producer of a "status_request_v2" extension in the + * ServerHello handshake message. + */ + private static final + class SHCertStatusReqV2Producer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHCertStatusReqV2Producer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + + ServerHandshakeContext shc = (ServerHandshakeContext)context; + // The StaplingParameters in the ServerHandshakeContext will + // contain the info about what kind of stapling (if any) to + // perform and whether this status_request extension should be + // produced or the status_request_v2 (found in a different producer) + // No explicit check is required for isStaplingEnabled here. If + // it is false then stapleParams will be null. If it is true + // then stapleParams may or may not be false and the check below + // is sufficient. + if ((shc.stapleParams == null) || + (shc.stapleParams.statusRespExt != + SSLExtension.CH_STATUS_REQUEST_V2)) { + return null; // Do not produce status_request_v2 in SH + } + + // In response to "status_request_v2" extension request only + CertStatusRequestV2Spec spec = (CertStatusRequestV2Spec) + shc.handshakeExtensions.get(CH_STATUS_REQUEST_V2); + if (spec == null) { + // Ignore, no status_request_v2 extension requested. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Ignore unavailable status_request_v2 extension"); + } + + return null; // ignore the extension + } + + // Is it a session resuming? + if (shc.isResumption) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "No status_request_v2 response for session resumption"); + } + return null; // ignore the extension + } + + // The "extension_data" in the extended ServerHello handshake + // message MUST be empty. + byte[] extData = new byte[0]; + + // Update the context. + shc.handshakeExtensions.put( + SH_STATUS_REQUEST_V2, CertStatusRequestV2Spec.DEFAULT); + + return extData; + } + } + + /** + * Network data consumer of a "status_request_v2" extension in the + * ServerHello handshake message. + */ + private static final + class SHCertStatusReqV2Consumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHCertStatusReqV2Consumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consumption happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to "status_request" extension request only + CertStatusRequestV2Spec requestedCsr = (CertStatusRequestV2Spec) + chc.handshakeExtensions.get(CH_STATUS_REQUEST_V2); + if (requestedCsr == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected status_request_v2 extension in ServerHello"); + } + + // Parse the extension. + if (buffer.hasRemaining()) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid status_request_v2 extension in ServerHello: " + + "the extension data must be empty"); + } + + // Update the context. + chc.handshakeExtensions.put( + SH_STATUS_REQUEST_V2, CertStatusRequestV2Spec.DEFAULT); + chc.handshakeConsumers.put(SSLHandshake.CERTIFICATE_STATUS.id, + SSLHandshake.CERTIFICATE_STATUS); + + // Since we've received a legitimate status_request in the + // ServerHello, stapling is active if it's been enabled. + chc.staplingActive = chc.sslContext.isStaplingEnabled(true); + + // No impact on session resumption. + } + } + + private static final + class CTCertStatusResponseProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CTCertStatusResponseProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + ServerHandshakeContext shc = (ServerHandshakeContext)context; + byte[] producedData = null; + + // Stapling needs to be active and have valid data to proceed + if (shc.stapleParams == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Stapling is disabled for this connection"); + } + return null; + } + + // There needs to be a non-null CertificateEntry to proceed + if (shc.currentCertEntry == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest("Found null CertificateEntry in context"); + } + return null; + } + + // Pull the certificate from the CertificateEntry and find + // a response from the response map. If one exists we will + // staple it. + try { + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + X509Certificate x509Cert = + (X509Certificate)cf.generateCertificate( + new ByteArrayInputStream( + shc.currentCertEntry.encoded)); + byte[] respBytes = shc.stapleParams.responseMap.get(x509Cert); + if (respBytes == null) { + // We're done with this entry. Clear it from the context + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest("No status response found for " + + x509Cert.getSubjectX500Principal()); + } + shc.currentCertEntry = null; + return null; + } + + // Build a proper response buffer from the stapling information + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest("Found status response for " + + x509Cert.getSubjectX500Principal() + + ", response length: " + respBytes.length); + } + CertStatusResponse certResp = (shc.stapleParams.statReqType == + CertStatusRequestType.OCSP) ? + new OCSPStatusResponse(shc.stapleParams.statReqType.id, + respBytes) : + new CertStatusResponse(shc.stapleParams.statReqType.id, + respBytes); + producedData = certResp.toByteArray(); + } catch (CertificateException ce) { + shc.conContext.fatal(Alert.BAD_CERTIFICATE, + "Failed to parse server certificates", ce); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.BAD_CERT_STATUS_RESPONSE, + "Failed to parse certificate status response", ioe); + } + + // Clear the pinned CertificateEntry from the context + shc.currentCertEntry = null; + return producedData; + } + } + + private static final + class CTCertStatusResponseConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CTCertStatusResponseConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consumption happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Parse the extension. + CertStatusResponseSpec spec; + try { + spec = new CertStatusResponseSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.DECODE_ERROR, ioe); + return; // fatal() always throws, make the compiler happy. + } + + if (chc.sslContext.isStaplingEnabled(true)) { + // Activate stapling + chc.staplingActive = true; + } else { + // Do no further processing of stapled responses + return; + } + + // Get response list from the session. This is unmodifiable + // so we need to create a new list. Then add this new response + // to the end and submit it back to the session object. + if ((chc.handshakeSession != null) && (!chc.isResumption)) { + List<byte[]> respList = new ArrayList<>( + chc.handshakeSession.getStatusResponses()); + respList.add(spec.statusResponse.encodedResponse); + chc.handshakeSession.setStatusResponses(respList); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Ignoring stapled data on resumed session"); + } + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertStatusReqExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertStatusReqExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertStatusReqExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertStatusReqExtension.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.util.Objects; - -/* - * RFC6066 defines the TLS extension,"status_request" (type 0x5), - * which allows the client to request that the server perform OCSP - * on the client's behalf. - * The "extension data" field of this extension contains a - * "CertificateStatusRequest" structure: - * - * struct { - * CertificateStatusType status_type; - * select (status_type) { - * case ocsp: OCSPStatusRequest; - * } request; - * } CertificateStatusRequest; - * - * enum { ocsp(1), (255) } CertificateStatusType; - * - * struct { - * ResponderID responder_id_list<0..2^16-1>; - * Extensions request_extensions; - * } OCSPStatusRequest; - * - * opaque ResponderID<1..2^16-1>; - * opaque Extensions<0..2^16-1>; - */ - -final class CertStatusReqExtension extends HelloExtension { - - private final StatusRequestType statReqType; - private final StatusRequest request; - - - /** - * Construct the default status request extension object. The default - * object results in a status_request extension where the extension - * data segment is zero-length. This is used primarily in ServerHello - * messages where the server asserts it can do RFC 6066 status stapling. - */ - CertStatusReqExtension() { - super(ExtensionType.EXT_STATUS_REQUEST); - statReqType = null; - request = null; - } - - /** - * Construct the status request extension object given a request type - * and {@code StatusRequest} object. - * - * @param reqType a {@code StatusRequestExtType object correspoding - * to the underlying {@code StatusRequest} object. A value of - * {@code null} is not allowed. - * @param statReq the {@code StatusRequest} object used to provide the - * encoding for the TLS extension. A value of {@code null} is not - * allowed. - * - * @throws IllegalArgumentException if the provided {@code StatusRequest} - * does not match the type. - * @throws NullPointerException if either the {@code reqType} or - * {@code statReq} arguments are {@code null}. - */ - CertStatusReqExtension(StatusRequestType reqType, StatusRequest statReq) { - super(ExtensionType.EXT_STATUS_REQUEST); - - statReqType = Objects.requireNonNull(reqType, - "Unallowed null value for status_type"); - request = Objects.requireNonNull(statReq, - "Unallowed null value for request"); - - // There is currently only one known status type (OCSP) - // We can add more clauses to cover other types in the future - if (statReqType == StatusRequestType.OCSP) { - if (!(statReq instanceof OCSPStatusRequest)) { - throw new IllegalArgumentException("StatusRequest not " + - "of type OCSPStatusRequest"); - } - } - } - - /** - * Construct the {@code CertStatusReqExtension} object from data read from - * a {@code HandshakeInputStream} - * - * @param s the {@code HandshakeInputStream} providing the encoded data - * @param len the length of the extension data - * - * @throws IOException if any decoding errors happen during object - * construction. - */ - CertStatusReqExtension(HandshakeInStream s, int len) throws IOException { - super(ExtensionType.EXT_STATUS_REQUEST); - - if (len > 0) { - // Obtain the status type (first byte) - statReqType = StatusRequestType.get(s.getInt8()); - if (statReqType == StatusRequestType.OCSP) { - request = new OCSPStatusRequest(s); - } else { - // This is a status_type we don't understand. Create - // an UnknownStatusRequest in order to preserve the data - request = new UnknownStatusRequest(s, len - 1); - } - } else { - // Treat this as a zero-length extension (i.e. from a ServerHello - statReqType = null; - request = null; - } - } - - /** - * Return the length of the encoded extension, including extension type, - * extension length and status_type fields. - * - * @return the length in bytes, including the extension type and - * length fields. - */ - @Override - int length() { - return (statReqType != null ? 5 + request.length() : 4); - } - - /** - * Send the encoded TLS extension through a {@code HandshakeOutputStream} - * - * @param s the {@code HandshakeOutputStream} used to send the encoded data - * - * @throws IOException tf any errors occur during the encoding process - */ - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - s.putInt16(this.length() - 4); - - if (statReqType != null) { - s.putInt8(statReqType.id); - request.send(s); - } - } - - /** - * Create a string representation of this {@code CertStatusReqExtension} - * - * @return the string representation of this {@code CertStatusReqExtension} - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder("Extension ").append(type); - if (statReqType != null) { - sb.append(": ").append(statReqType).append(", ").append(request); - } - - return sb.toString(); - } - - /** - * Return the type field for this {@code CertStatusReqExtension} - * - * @return the {@code StatusRequestType} for this extension. {@code null} - * will be returned if the default constructor is used to create - * a zero length status_request extension (found in ServerHello - * messages) - */ - StatusRequestType getType() { - return statReqType; - } - - /** - * Get the underlying {@code StatusRequest} for this - * {@code CertStatusReqExtension} - * - * @return the {@code StatusRequest} or {@code null} if the default - * constructor was used to create this extension. - */ - StatusRequest getRequest() { - return request; - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertStatusReqItemV2.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertStatusReqItemV2.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertStatusReqItemV2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertStatusReqItemV2.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.util.Objects; -import javax.net.ssl.SSLException; - -/* - * RFC6961 defines the TLS extension,"status_request_v2" (type 0x5), - * which allows the client to request that the server perform OCSP - * on the client's behalf. - * - * The RFC defines an CertStatusReqItemV2 structure: - * - * struct { - * CertificateStatusType status_type; - * uint16 request_length; - * select (status_type) { - * case ocsp: OCSPStatusRequest; - * case ocsp_multi: OCSPStatusRequest; - * } request; - * } CertificateStatusRequestItemV2; - * - * enum { ocsp(1), ocsp_multi(2), (255) } CertificateStatusType; - */ - -final class CertStatusReqItemV2 { - - private final StatusRequestType statReqType; - private final StatusRequest request; - - /** - * Construct a {@code CertStatusReqItemV2} object using a type value - * and empty ResponderId and Extension lists. - * - * @param reqType the type of request (e.g. ocsp). A {@code null} value - * is not allowed. - * @param statReq the {@code StatusRequest} object used to provide the - * encoding for this {@code CertStatusReqItemV2}. A {@code null} - * value is not allowed. - * - * @throws IllegalArgumentException if the provided {@code StatusRequest} - * does not match the type. - * @throws NullPointerException if either the reqType or statReq arguments - * are {@code null}. - */ - CertStatusReqItemV2(StatusRequestType reqType, StatusRequest statReq) { - statReqType = Objects.requireNonNull(reqType, - "Unallowed null value for status_type"); - request = Objects.requireNonNull(statReq, - "Unallowed null value for request"); - - // There is currently only one known status type (OCSP) - // We can add more clauses to cover other types in the future - if (statReqType.equals(StatusRequestType.OCSP) || - statReqType.equals(StatusRequestType.OCSP_MULTI)) { - if (!(statReq instanceof OCSPStatusRequest)) { - throw new IllegalArgumentException("StatusRequest not " + - "of type OCSPStatusRequest"); - } - } - } - - /** - * Construct a {@code CertStatusReqItemV2} object from encoded bytes - * - * @param requestBytes the encoded bytes for the {@code CertStatusReqItemV2} - * - * @throws IOException if any decoding errors take place - * @throws IllegalArgumentException if the parsed reqType value is not a - * supported status request type. - */ - CertStatusReqItemV2(byte[] reqItemBytes) throws IOException { - ByteBuffer reqBuf = ByteBuffer.wrap(reqItemBytes); - statReqType = StatusRequestType.get(reqBuf.get()); - int requestLength = Short.toUnsignedInt(reqBuf.getShort()); - - if (requestLength == reqBuf.remaining()) { - byte[] statReqBytes = new byte[requestLength]; - reqBuf.get(statReqBytes); - if (statReqType == StatusRequestType.OCSP || - statReqType == StatusRequestType.OCSP_MULTI) { - request = new OCSPStatusRequest(statReqBytes); - } else { - request = new UnknownStatusRequest(statReqBytes); - } - } else { - throw new SSLException("Incorrect request_length: " + - "Expected " + reqBuf.remaining() + ", got " + - requestLength); - } - } - - /** - * Construct an {@code CertStatusReqItemV2} object from data read from - * a {@code HandshakeInputStream} - * - * @param s the {@code HandshakeInputStream} providing the encoded data - * - * @throws IOException if any decoding errors happen during object - * construction. - * @throws IllegalArgumentException if the parsed reqType value is not a - * supported status request type. - */ - CertStatusReqItemV2(HandshakeInStream in) throws IOException { - statReqType = StatusRequestType.get(in.getInt8()); - int requestLength = in.getInt16(); - - if (statReqType == StatusRequestType.OCSP || - statReqType == StatusRequestType.OCSP_MULTI) { - request = new OCSPStatusRequest(in); - } else { - request = new UnknownStatusRequest(in, requestLength); - } - } - - /** - * Return the length of this {@code CertStatusReqItemV2} in its encoded form - * - * @return the encoded length of this {@code CertStatusReqItemV2} - */ - int length() { - // The length is the status type (1 byte) + the request length - // field (2 bytes) + the StatusRequest data length. - return request.length() + 3; - } - - /** - * Send the encoded {@code CertStatusReqItemV2} through a - * {@code HandshakeOutputStream} - * - * @param s the {@code HandshakeOutputStream} used to send the encoded data - * - * @throws IOException if any errors occur during the encoding process - */ - void send(HandshakeOutStream s) throws IOException { - s.putInt8(statReqType.id); - s.putInt16(request.length()); - request.send(s); - } - - /** - * Create a string representation of this {@code CertStatusReqItemV2} - * - * @return the string representation of this {@code CertStatusReqItemV2} - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("CertStatusReqItemV2: ").append(statReqType).append(", "); - sb.append(request.toString()); - - return sb.toString(); - } - - /** - * Return the type field for this {@code CertStatusReqItemV2} - * - * @return the {@code StatusRequestType} for this extension. - */ - StatusRequestType getType() { - return statReqType; - } - - /** - * Get the underlying {@code StatusRequest} for this - * {@code CertStatusReqItemV2} - * - * @return the {@code StatusRequest} - */ - StatusRequest getRequest() { - return request; - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertStatusReqListV2Extension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertStatusReqListV2Extension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CertStatusReqListV2Extension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CertStatusReqListV2Extension.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,220 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.util.List; -import java.util.Collections; -import java.util.ArrayList; -import java.util.Objects; -import javax.net.ssl.SSLException; - -/* - * RFC6066 defines the TLS extension,"status_request" (type 0x5), - * which allows the client to request that the server perform OCSP - * on the client's behalf. - * The "extension data" field of this extension contains a - * "CertificateStatusRequest" structure: - * - * struct { - * CertificateStatusType status_type; - * select (status_type) { - * case ocsp: OCSPStatusRequest; - * } request; - * } CertificateStatusRequest; - * - * enum { ocsp(1), (255) } CertificateStatusType; - * - * struct { - * ResponderID responder_id_list<0..2^16-1>; - * Extensions request_extensions; - * } OCSPStatusRequest; - * - * opaque ResponderID<1..2^16-1>; - * opaque Extensions<0..2^16-1>; - */ - -final class CertStatusReqListV2Extension extends HelloExtension { - - private final List<CertStatusReqItemV2> itemList; - private final int itemListLength; - - /** - * Construct a default {@code CertStatusReqListV2Extension}. The default - * object results in a status_request_v2 extension where the extension - * data segment is zero-length. This is used primarily in ServerHello - * messages where the server asserts it can do RFC 6961 status stapling. - */ - CertStatusReqListV2Extension() { - super(ExtensionType.EXT_STATUS_REQUEST_V2); - itemList = Collections.emptyList(); - itemListLength = 0; - } - - /** - * Construct a {@code CertStatusReqListV2Extension} from a provided list - * of {@code CertStatusReqItemV2} objects. - * - * @param reqList a {@code List} containing one or more - * {@code CertStatusReqItemV2} objects to be included in this TLS - * Hello extension. Passing an empty list will result in the encoded - * extension having a zero-length extension_data segment, and is - * the same as using the default constructor. - * - * @throws NullPointerException if reqList is {@code null} - */ - CertStatusReqListV2Extension(List<CertStatusReqItemV2> reqList) { - super(ExtensionType.EXT_STATUS_REQUEST_V2); - Objects.requireNonNull(reqList, - "Unallowed null value for certificate_status_req_list"); - itemList = Collections.unmodifiableList(new ArrayList<>(reqList)); - itemListLength = calculateListLength(); - } - - /** - * Construct the {@code CertStatusReqListV2Extension} object from data - * read from a {@code HandshakeInputStream} - * - * @param s the {@code HandshakeInputStream} providing the encoded data - * @param len the length of the extension data - * - * @throws IOException if any decoding errors happen during object - * construction. - */ - CertStatusReqListV2Extension(HandshakeInStream s, int len) - throws IOException { - super(ExtensionType.EXT_STATUS_REQUEST_V2); - - if (len <= 0) { - // Handle the empty extension data case (from a ServerHello) - itemList = Collections.emptyList(); - itemListLength = 0; - } else { - List<CertStatusReqItemV2> workingList = new ArrayList<>(); - - itemListLength = s.getInt16(); - if (itemListLength <= 0) { - throw new SSLException("certificate_status_req_list length " + - "must be greater than zero (received length: " + - itemListLength + ")"); - } - - int totalRead = 0; - CertStatusReqItemV2 reqItem; - do { - reqItem = new CertStatusReqItemV2(s); - totalRead += reqItem.length(); - } while (workingList.add(reqItem) && totalRead < itemListLength); - - // If for some reason the add returns false, we may not have read - // all the necessary bytes from the stream. Check this and throw - // an exception if we terminated the loop early. - if (totalRead != itemListLength) { - throw new SSLException("Not all certificate_status_req_list " + - "bytes were read: expected " + itemListLength + - ", read " + totalRead); - } - - itemList = Collections.unmodifiableList(workingList); - } - } - - /** - * Get the list of {@code CertStatusReqItemV2} objects for this extension - * - * @return an unmodifiable list of {@code CertStatusReqItemV2} objects - */ - List<CertStatusReqItemV2> getRequestItems() { - return itemList; - } - - /** - * Return the length of the encoded extension, including extension type - * and extension length fields. - * - * @return the length in bytes, including the extension type and - * extension_data length. - */ - @Override - int length() { - return (itemList.isEmpty() ? 4 : itemListLength + 6); - } - - /** - * Send the encoded {@code CertStatusReqListV2Extension} through a - * {@code HandshakeOutputStream} - * - * @param s the {@code HandshakeOutputStream} used to send the encoded data - * - * @throws IOException if any errors occur during the encoding process - */ - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - s.putInt16(this.length() - 4); - if (itemListLength > 0) { - s.putInt16(itemListLength); - for (CertStatusReqItemV2 item : itemList) { - item.send(s); - } - } - } - - /** - * Create a string representation of this - * {@code CertStatusReqListV2Extension} - * - * @return the string representation of this - * {@code CertStatusReqListV2Extension} - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder("Extension ").append(type); - for (CertStatusReqItemV2 item : itemList) { - sb.append("\n").append(item); - } - - return sb.toString(); - } - - /** - * Determine the length of the certificate_status_req_list field in - * the status_request_v2 extension. - * - * @return the total encoded length of all items in the list, or 0 if the - * encapsulating extension_data is zero-length (from a ServerHello) - */ - private int calculateListLength() { - int listLen = 0; - - for (CertStatusReqItemV2 item : itemList) { - listLen += item.length(); - } - - return listLen; - } - -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ChangeCipherSpec.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,238 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.security.InvalidKeyException; +import java.security.NoSuchAlgorithmException; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.net.ssl.SSLException; +import sun.security.ssl.SSLCipher.SSLReadCipher; +import sun.security.ssl.SSLCipher.SSLWriteCipher; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SSLTrafficKeyDerivation.LegacyTrafficKeyDerivation; + +/** + * Pack of the ChangeCipherSpec message. + */ +final class ChangeCipherSpec { + static final SSLConsumer t10Consumer = + new T10ChangeCipherSpecConsumer(); + static final HandshakeProducer t10Producer = + new T10ChangeCipherSpecProducer(); + static final SSLConsumer t13Consumer = + new T13ChangeCipherSpecConsumer(); + + /** + * The "ChangeCipherSpec" message producer. + */ + private static final + class T10ChangeCipherSpecProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T10ChangeCipherSpecProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + HandshakeContext hc = (HandshakeContext)context; + SSLKeyDerivation kd = hc.handshakeKeyDerivation; + + if (!(kd instanceof LegacyTrafficKeyDerivation)) { + throw new UnsupportedOperationException("Not supported."); + } + LegacyTrafficKeyDerivation tkd = (LegacyTrafficKeyDerivation)kd; + CipherSuite ncs = hc.negotiatedCipherSuite; + Authenticator writeAuthenticator; + if (ncs.bulkCipher.cipherType == CipherType.AEAD_CIPHER) { + writeAuthenticator = + Authenticator.valueOf(hc.negotiatedProtocol); + } else { + try { + writeAuthenticator = Authenticator.valueOf( + hc.negotiatedProtocol, ncs.macAlg, + tkd.getTrafficKey(hc.sslConfig.isClientMode ? + "clientMacKey" : "serverMacKey")); + } catch (NoSuchAlgorithmException | InvalidKeyException e) { + // unlikely + throw new SSLException("Algorithm missing: ", e); + } + } + + SecretKey writeKey = + tkd.getTrafficKey(hc.sslConfig.isClientMode ? + "clientWriteKey" : "serverWriteKey"); + SecretKey writeIv = + tkd.getTrafficKey(hc.sslConfig.isClientMode ? + "clientWriteIv" : "serverWriteIv"); + IvParameterSpec iv = (writeIv == null) ? null : + new IvParameterSpec(writeIv.getEncoded()); + SSLWriteCipher writeCipher; + try { + writeCipher = ncs.bulkCipher.createWriteCipher( + writeAuthenticator, + hc.negotiatedProtocol, writeKey, iv, + hc.sslContext.getSecureRandom()); + } catch (GeneralSecurityException gse) { + // unlikely + throw new SSLException("Algorithm missing: ", gse); + } + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced ChangeCipherSpec message"); + } + + hc.conContext.outputRecord.changeWriteCiphers(writeCipher, true); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "ChangeCipherSpec" message producer. + */ + private static final + class T10ChangeCipherSpecConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T10ChangeCipherSpecConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + TransportContext tc = (TransportContext)context; + + // This consumer can be used only once. + tc.consumers.remove(ContentType.CHANGE_CIPHER_SPEC.id); + + // parse + if (message.remaining() != 1 || message.get() != 1) { + tc.fatal(Alert.UNEXPECTED_MESSAGE, + "Malformed or unexpected ChangeCipherSpec message"); + } + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Consuming ChangeCipherSpec message"); + } + + // validate + if (tc.handshakeContext == null) { + tc.fatal(Alert.HANDSHAKE_FAILURE, + "Unexpected ChangeCipherSpec message"); + } + + + HandshakeContext hc = tc.handshakeContext; + + if (hc.handshakeKeyDerivation == null) { + tc.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected ChangeCipherSpec message"); + } + + SSLKeyDerivation kd = hc.handshakeKeyDerivation; + if (kd instanceof LegacyTrafficKeyDerivation) { + LegacyTrafficKeyDerivation tkd = (LegacyTrafficKeyDerivation)kd; + CipherSuite ncs = hc.negotiatedCipherSuite; + Authenticator readAuthenticator; + if (ncs.bulkCipher.cipherType == CipherType.AEAD_CIPHER) { + readAuthenticator = + Authenticator.valueOf(hc.negotiatedProtocol); + } else { + try { + readAuthenticator = Authenticator.valueOf( + hc.negotiatedProtocol, ncs.macAlg, + tkd.getTrafficKey(hc.sslConfig.isClientMode ? + "serverMacKey" : "clientMacKey")); + } catch (NoSuchAlgorithmException | InvalidKeyException e) { + // unlikely + throw new SSLException("Algorithm missing: ", e); + } + } + + SecretKey readKey = + tkd.getTrafficKey(hc.sslConfig.isClientMode ? + "serverWriteKey" : "clientWriteKey"); + SecretKey readIv = + tkd.getTrafficKey(hc.sslConfig.isClientMode ? + "serverWriteIv" : "clientWriteIv"); + IvParameterSpec iv = (readIv == null) ? null : + new IvParameterSpec(readIv.getEncoded()); + SSLReadCipher readCipher; + try { + readCipher = ncs.bulkCipher.createReadCipher( + readAuthenticator, + hc.negotiatedProtocol, readKey, iv, + hc.sslContext.getSecureRandom()); + } catch (GeneralSecurityException gse) { + // unlikely + throw new SSLException("Algorithm missing: ", gse); + } + tc.inputRecord.changeReadCiphers(readCipher); + } else { + throw new UnsupportedOperationException("Not supported."); + } + } + } + + private static final + class T13ChangeCipherSpecConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T13ChangeCipherSpecConsumer() { + // blank + } + + // An implementation may receive an unencrypted record of type + // change_cipher_spec consisting of the single byte value 0x01 + // at any time after the first ClientHello message has been + // sent or received and before the peer's Finished message has + // been received and MUST simply drop it without further + // processing. + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + TransportContext tc = (TransportContext)context; + + // This consumer can be used only once. + tc.consumers.remove(ContentType.CHANGE_CIPHER_SPEC.id); + + // parse + if (message.remaining() != 1 || message.get() != 1) { + tc.fatal(Alert.UNEXPECTED_MESSAGE, + "Malformed or unexpected ChangeCipherSpec message"); + } + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Consuming ChangeCipherSpec message"); + } + + // no further processing + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CipherBox.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CipherBox.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CipherBox.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CipherBox.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,1150 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package sun.security.ssl; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.Hashtable; -import java.util.Arrays; - -import java.security.*; -import javax.crypto.*; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.GCMParameterSpec; - -import java.nio.*; - -import sun.security.ssl.CipherSuite.*; -import static sun.security.ssl.CipherSuite.*; -import static sun.security.ssl.CipherSuite.CipherType.*; - -import sun.security.util.HexDumpEncoder; - - -/** - * This class handles bulk data enciphering/deciphering for each SSLv3 - * message. This provides data confidentiality. Stream ciphers (such - * as RC4) don't need to do padding; block ciphers (e.g. DES) need it. - * - * Individual instances are obtained by calling the static method - * newCipherBox(), which should only be invoked by BulkCipher.newCipher(). - * - * In RFC 2246, with bock ciphers in CBC mode, the Initialization - * Vector (IV) for the first record is generated with the other keys - * and secrets when the security parameters are set. The IV for - * subsequent records is the last ciphertext block from the previous - * record. - * - * In RFC 4346, the implicit Initialization Vector (IV) is replaced - * with an explicit IV to protect against CBC attacks. RFC 4346 - * recommends two algorithms used to generated the per-record IV. - * The implementation uses the algorithm (2)(b), as described at - * section 6.2.3.2 of RFC 4346. - * - * The usage of IV in CBC block cipher can be illustrated in - * the following diagrams. - * - * (random) - * R P1 IV C1 - * | | | | - * SIV---+ |-----+ |-... |----- |------ - * | | | | | | | | - * +----+ | +----+ | +----+ | +----+ | - * | Ek | | + Ek + | | Dk | | | Dk | | - * +----+ | +----+ | +----+ | +----+ | - * | | | | | | | | - * |----| |----| SIV--+ |----| |-... - * | | | | - * IV C1 R P1 - * (discard) - * - * CBC Encryption CBC Decryption - * - * NOTE that any ciphering involved in key exchange (e.g. with RSA) is - * handled separately. - * - * @author David Brownell - * @author Andreas Sterbenz - */ -final class CipherBox { - - // A CipherBox that implements the identity operation - static final CipherBox NULL = new CipherBox(); - - /* Class and subclass dynamic debugging support */ - private static final Debug debug = Debug.getInstance("ssl"); - - // the protocol version this cipher conforms to - private final ProtocolVersion protocolVersion; - - // cipher object - private final Cipher cipher; - - /** - * secure random - */ - private SecureRandom random; - - /** - * fixed IV, the implicit nonce of AEAD cipher suite, only apply to - * AEAD cipher suites - */ - private final byte[] fixedIv; - - /** - * the key, reserved only for AEAD cipher initialization - */ - private final Key key; - - /** - * the operation mode, reserved for AEAD cipher initialization - */ - private final int mode; - - /** - * the authentication tag size, only apply to AEAD cipher suites - */ - private final int tagSize; - - /** - * the record IV length, only apply to AEAD cipher suites - */ - private final int recordIvSize; - - /** - * cipher type - */ - private final CipherType cipherType; - - /** - * Fixed masks of various block size, as the initial decryption IVs - * for TLS 1.1 or later. - * - * For performance, we do not use random IVs. As the initial decryption - * IVs will be discarded by TLS decryption processes, so the fixed masks - * do not hurt cryptographic strength. - */ - private static Hashtable<Integer, IvParameterSpec> masks; - - /** - * NULL cipherbox. Identity operation, no encryption. - */ - private CipherBox() { - this.protocolVersion = ProtocolVersion.DEFAULT_TLS; - this.cipher = null; - this.cipherType = NULL_CIPHER; - this.fixedIv = new byte[0]; - this.key = null; - this.mode = Cipher.ENCRYPT_MODE; // choose at random - this.random = null; - this.tagSize = 0; - this.recordIvSize = 0; - } - - /** - * Construct a new CipherBox using the cipher transformation. - * - * @exception NoSuchAlgorithmException if no appropriate JCE Cipher - * implementation could be found. - */ - private CipherBox(ProtocolVersion protocolVersion, BulkCipher bulkCipher, - SecretKey key, IvParameterSpec iv, SecureRandom random, - boolean encrypt) throws NoSuchAlgorithmException { - try { - this.protocolVersion = protocolVersion; - this.cipher = JsseJce.getCipher(bulkCipher.transformation); - this.mode = encrypt ? Cipher.ENCRYPT_MODE : Cipher.DECRYPT_MODE; - - if (random == null) { - random = JsseJce.getSecureRandom(); - } - this.random = random; - this.cipherType = bulkCipher.cipherType; - - /* - * RFC 4346 recommends two algorithms used to generated the - * per-record IV. The implementation uses the algorithm (2)(b), - * as described at section 6.2.3.2 of RFC 4346. - * - * As we don't care about the initial IV value for TLS 1.1 or - * later, so if the "iv" parameter is null, we use the default - * value generated by Cipher.init() for encryption, and a fixed - * mask for decryption. - */ - if (iv == null && bulkCipher.ivSize != 0 && - mode == Cipher.DECRYPT_MODE && - protocolVersion.useTLS11PlusSpec()) { - iv = getFixedMask(bulkCipher.ivSize); - } - - if (cipherType == AEAD_CIPHER) { - // AEAD must completely initialize the cipher for each packet, - // and so we save initialization parameters for packet - // processing time. - - // Set the tag size for AEAD cipher - tagSize = bulkCipher.tagSize; - - // Reserve the key for AEAD cipher initialization - this.key = key; - - fixedIv = iv.getIV(); - if (fixedIv == null || - fixedIv.length != bulkCipher.fixedIvSize) { - throw new RuntimeException("Improper fixed IV for AEAD"); - } - - // Set the record IV length for AEAD cipher - recordIvSize = bulkCipher.ivSize - bulkCipher.fixedIvSize; - - // DON'T initialize the cipher for AEAD! - } else { - // CBC only requires one initialization during its lifetime - // (future packets/IVs set the proper CBC state), so we can - // initialize now. - - // Zeroize the variables that only apply to AEAD cipher - this.tagSize = 0; - this.fixedIv = new byte[0]; - this.recordIvSize = 0; - this.key = null; - - // Initialize the cipher - cipher.init(mode, key, iv, random); - } - } catch (NoSuchAlgorithmException e) { - throw e; - } catch (Exception e) { - throw new NoSuchAlgorithmException - ("Could not create cipher " + bulkCipher, e); - } catch (ExceptionInInitializerError e) { - throw new NoSuchAlgorithmException - ("Could not create cipher " + bulkCipher, e); - } - } - - /* - * Factory method to obtain a new CipherBox object. - */ - static CipherBox newCipherBox(ProtocolVersion version, BulkCipher cipher, - SecretKey key, IvParameterSpec iv, SecureRandom random, - boolean encrypt) throws NoSuchAlgorithmException { - if (cipher.allowed == false) { - throw new NoSuchAlgorithmException("Unsupported cipher " + cipher); - } - - if (cipher == BulkCipher.B_NULL) { - return NULL; - } else { - return new CipherBox(version, cipher, key, iv, random, encrypt); - } - } - - /* - * Get a fixed mask, as the initial decryption IVs for TLS 1.1 or later. - */ - private static IvParameterSpec getFixedMask(int ivSize) { - if (masks == null) { - masks = new Hashtable<Integer, IvParameterSpec>(5); - } - - IvParameterSpec iv = masks.get(ivSize); - if (iv == null) { - iv = new IvParameterSpec(new byte[ivSize]); - masks.put(ivSize, iv); - } - - return iv; - } - - /* - * Encrypts a block of data, returning the size of the - * resulting block. - */ - int encrypt(byte[] buf, int offset, int len) { - if (cipher == null) { - return len; - } - - try { - int blockSize = cipher.getBlockSize(); - if (cipherType == BLOCK_CIPHER) { - len = addPadding(buf, offset, len, blockSize); - } - - if (debug != null && Debug.isOn("plaintext")) { - try { - HexDumpEncoder hd = new HexDumpEncoder(); - - System.out.println( - "Padded plaintext before ENCRYPTION: len = " - + len); - hd.encodeBuffer( - new ByteArrayInputStream(buf, offset, len), - System.out); - } catch (IOException e) { } - } - - - if (cipherType == AEAD_CIPHER) { - try { - return cipher.doFinal(buf, offset, len, buf, offset); - } catch (IllegalBlockSizeException | BadPaddingException ibe) { - // unlikely to happen - throw new RuntimeException( - "Cipher error in AEAD mode in JCE provider " + - cipher.getProvider().getName(), ibe); - } - } else { - int newLen = cipher.update(buf, offset, len, buf, offset); - if (newLen != len) { - // catch BouncyCastle buffering error - throw new RuntimeException("Cipher buffering error " + - "in JCE provider " + cipher.getProvider().getName()); - } - return newLen; - } - } catch (ShortBufferException e) { - // unlikely to happen, we should have enough buffer space here - throw new ArrayIndexOutOfBoundsException(e.toString()); - } - } - - /* - * Encrypts a ByteBuffer block of data, returning the size of the - * resulting block. - * - * The byte buffers position and limit initially define the amount - * to encrypt. On return, the position and limit are - * set to last position padded/encrypted. The limit may have changed - * because of the added padding bytes. - */ - int encrypt(ByteBuffer bb, int outLimit) { - - int len = bb.remaining(); - - if (cipher == null) { - bb.position(bb.limit()); - return len; - } - - int pos = bb.position(); - - int blockSize = cipher.getBlockSize(); - if (cipherType == BLOCK_CIPHER) { - // addPadding adjusts pos/limit - len = addPadding(bb, blockSize); - bb.position(pos); - } - - if (debug != null && Debug.isOn("plaintext")) { - try { - HexDumpEncoder hd = new HexDumpEncoder(); - - System.out.println( - "Padded plaintext before ENCRYPTION: len = " - + len); - hd.encodeBuffer(bb.duplicate(), System.out); - - } catch (IOException e) { } - } - - /* - * Encrypt "in-place". This does not add its own padding. - */ - ByteBuffer dup = bb.duplicate(); - if (cipherType == AEAD_CIPHER) { - try { - int outputSize = cipher.getOutputSize(dup.remaining()); - if (outputSize > bb.remaining()) { - // need to expand the limit of the output buffer for - // the authentication tag. - // - // DON'T worry about the buffer's capacity, we have - // reserved space for the authentication tag. - if (outLimit < pos + outputSize) { - // unlikely to happen - throw new ShortBufferException( - "need more space in output buffer"); - } - bb.limit(pos + outputSize); - } - int newLen = cipher.doFinal(dup, bb); - if (newLen != outputSize) { - throw new RuntimeException( - "Cipher buffering error in JCE provider " + - cipher.getProvider().getName()); - } - return newLen; - } catch (IllegalBlockSizeException | - BadPaddingException | ShortBufferException ibse) { - // unlikely to happen - throw new RuntimeException( - "Cipher error in AEAD mode in JCE provider " + - cipher.getProvider().getName(), ibse); - } - } else { - int newLen; - try { - newLen = cipher.update(dup, bb); - } catch (ShortBufferException sbe) { - // unlikely to happen - throw new RuntimeException("Cipher buffering error " + - "in JCE provider " + cipher.getProvider().getName()); - } - - if (bb.position() != dup.position()) { - throw new RuntimeException("bytebuffer padding error"); - } - - if (newLen != len) { - // catch BouncyCastle buffering error - throw new RuntimeException("Cipher buffering error " + - "in JCE provider " + cipher.getProvider().getName()); - } - return newLen; - } - } - - - /* - * Decrypts a block of data, returning the size of the - * resulting block if padding was required. - * - * For SSLv3 and TLSv1.0, with block ciphers in CBC mode the - * Initialization Vector (IV) for the first record is generated by - * the handshake protocol, the IV for subsequent records is the - * last ciphertext block from the previous record. - * - * From TLSv1.1, the implicit IV is replaced with an explicit IV to - * protect against CBC attacks. - * - * Differentiating between bad_record_mac and decryption_failed alerts - * may permit certain attacks against CBC mode. It is preferable to - * uniformly use the bad_record_mac alert to hide the specific type of - * the error. - */ - int decrypt(byte[] buf, int offset, int len, - int tagLen) throws BadPaddingException { - if (cipher == null) { - return len; - } - - try { - int newLen; - if (cipherType == AEAD_CIPHER) { - try { - newLen = cipher.doFinal(buf, offset, len, buf, offset); - } catch (IllegalBlockSizeException ibse) { - // unlikely to happen - throw new RuntimeException( - "Cipher error in AEAD mode in JCE provider " + - cipher.getProvider().getName(), ibse); - } - } else { - newLen = cipher.update(buf, offset, len, buf, offset); - if (newLen != len) { - // catch BouncyCastle buffering error - throw new RuntimeException("Cipher buffering error " + - "in JCE provider " + cipher.getProvider().getName()); - } - } - if (debug != null && Debug.isOn("plaintext")) { - try { - HexDumpEncoder hd = new HexDumpEncoder(); - - System.out.println( - "Padded plaintext after DECRYPTION: len = " - + newLen); - hd.encodeBuffer( - new ByteArrayInputStream(buf, offset, newLen), - System.out); - } catch (IOException e) { } - } - - if (cipherType == BLOCK_CIPHER) { - int blockSize = cipher.getBlockSize(); - newLen = removePadding( - buf, offset, newLen, tagLen, blockSize, protocolVersion); - - if (protocolVersion.useTLS11PlusSpec()) { - if (newLen < blockSize) { - throw new BadPaddingException("The length after " + - "padding removal (" + newLen + ") should be larger " + - "than <" + blockSize + "> since explicit IV used"); - } - } - } - return newLen; - } catch (ShortBufferException e) { - // unlikely to happen, we should have enough buffer space here - throw new ArrayIndexOutOfBoundsException(e.toString()); - } - } - - /* - * Decrypts a block of data, returning the size of the - * resulting block if padding was required. position and limit - * point to the end of the decrypted/depadded data. The initial - * limit and new limit may be different, given we may - * have stripped off some padding bytes. - * - * @see decrypt(byte[], int, int) - */ - int decrypt(ByteBuffer bb, int tagLen) throws BadPaddingException { - - int len = bb.remaining(); - - if (cipher == null) { - bb.position(bb.limit()); - return len; - } - - try { - /* - * Decrypt "in-place". - */ - int pos = bb.position(); - ByteBuffer dup = bb.duplicate(); - int newLen; - if (cipherType == AEAD_CIPHER) { - try { - newLen = cipher.doFinal(dup, bb); - } catch (IllegalBlockSizeException ibse) { - // unlikely to happen - throw new RuntimeException( - "Cipher error in AEAD mode \"" + ibse.getMessage() + - " \"in JCE provider " + cipher.getProvider().getName()); - } - } else { - newLen = cipher.update(dup, bb); - if (newLen != len) { - // catch BouncyCastle buffering error - throw new RuntimeException("Cipher buffering error " + - "in JCE provider " + cipher.getProvider().getName()); - } - } - - // reset the limit to the end of the decryted data - bb.limit(pos + newLen); - - if (debug != null && Debug.isOn("plaintext")) { - try { - HexDumpEncoder hd = new HexDumpEncoder(); - - System.out.println( - "Padded plaintext after DECRYPTION: len = " - + newLen); - - hd.encodeBuffer( - bb.duplicate().position(pos), System.out); - } catch (IOException e) { } - } - - /* - * Remove the block padding. - */ - if (cipherType == BLOCK_CIPHER) { - int blockSize = cipher.getBlockSize(); - bb.position(pos); - newLen = removePadding(bb, tagLen, blockSize, protocolVersion); - - // check the explicit IV of TLS v1.1 or later - if (protocolVersion.useTLS11PlusSpec()) { - if (newLen < blockSize) { - throw new BadPaddingException("The length after " + - "padding removal (" + newLen + ") should be larger " + - "than <" + blockSize + "> since explicit IV used"); - } - - // reset the position to the end of the decrypted data - bb.position(bb.limit()); - } - } - return newLen; - } catch (ShortBufferException e) { - // unlikely to happen, we should have enough buffer space here - throw new ArrayIndexOutOfBoundsException(e.toString()); - } - } - - private static int addPadding(byte[] buf, int offset, int len, - int blockSize) { - int newlen = len + 1; - byte pad; - int i; - - if ((newlen % blockSize) != 0) { - newlen += blockSize - 1; - newlen -= newlen % blockSize; - } - pad = (byte) (newlen - len); - - if (buf.length < (newlen + offset)) { - throw new IllegalArgumentException("no space to pad buffer"); - } - - /* - * TLS version of the padding works for both SSLv3 and TLSv1 - */ - for (i = 0, offset += len; i < pad; i++) { - buf [offset++] = (byte) (pad - 1); - } - return newlen; - } - - /* - * Apply the padding to the buffer. - * - * Limit is advanced to the new buffer length. - * Position is equal to limit. - */ - private static int addPadding(ByteBuffer bb, int blockSize) { - - int len = bb.remaining(); - int offset = bb.position(); - - int newlen = len + 1; - byte pad; - int i; - - if ((newlen % blockSize) != 0) { - newlen += blockSize - 1; - newlen -= newlen % blockSize; - } - pad = (byte) (newlen - len); - - /* - * Update the limit to what will be padded. - */ - bb.limit(newlen + offset); - - /* - * TLS version of the padding works for both SSLv3 and TLSv1 - */ - for (i = 0, offset += len; i < pad; i++) { - bb.put(offset++, (byte) (pad - 1)); - } - - bb.position(offset); - bb.limit(offset); - - return newlen; - } - - /* - * A constant-time check of the padding. - * - * NOTE that we are checking both the padding and the padLen bytes here. - * - * The caller MUST ensure that the len parameter is a positive number. - */ - private static int[] checkPadding( - byte[] buf, int offset, int len, byte pad) { - - if (len <= 0) { - throw new RuntimeException("padding len must be positive"); - } - - // An array of hits is used to prevent Hotspot optimization for - // the purpose of a constant-time check. - int[] results = {0, 0}; // {missed #, matched #} - for (int i = 0; i <= 256;) { - for (int j = 0; j < len && i <= 256; j++, i++) { // j <= i - if (buf[offset + j] != pad) { - results[0]++; // mismatched padding data - } else { - results[1]++; // matched padding data - } - } - } - - return results; - } - - /* - * A constant-time check of the padding. - * - * NOTE that we are checking both the padding and the padLen bytes here. - * - * The caller MUST ensure that the bb parameter has remaining. - */ - private static int[] checkPadding(ByteBuffer bb, byte pad) { - - if (!bb.hasRemaining()) { - throw new RuntimeException("hasRemaining() must be positive"); - } - - // An array of hits is used to prevent Hotspot optimization for - // the purpose of a constant-time check. - int[] results = {0, 0}; // {missed #, matched #} - bb.mark(); - for (int i = 0; i <= 256; bb.reset()) { - for (; bb.hasRemaining() && i <= 256; i++) { - if (bb.get() != pad) { - results[0]++; // mismatched padding data - } else { - results[1]++; // matched padding data - } - } - } - - return results; - } - - /* - * Typical TLS padding format for a 64 bit block cipher is as follows: - * xx xx xx xx xx xx xx 00 - * xx xx xx xx xx xx 01 01 - * ... - * xx 06 06 06 06 06 06 06 - * 07 07 07 07 07 07 07 07 - * TLS also allows any amount of padding from 1 and 256 bytes as long - * as it makes the data a multiple of the block size - */ - private static int removePadding(byte[] buf, int offset, int len, - int tagLen, int blockSize, - ProtocolVersion protocolVersion) throws BadPaddingException { - - // last byte is length byte (i.e. actual padding length - 1) - int padOffset = offset + len - 1; - int padLen = buf[padOffset] & 0xFF; - - int newLen = len - (padLen + 1); - if ((newLen - tagLen) < 0) { - // If the buffer is not long enough to contain the padding plus - // a MAC tag, do a dummy constant-time padding check. - // - // Note that it is a dummy check, so we won't care about what is - // the actual padding data. - checkPadding(buf, offset, len, (byte)(padLen & 0xFF)); - - throw new BadPaddingException("Invalid Padding length: " + padLen); - } - - // The padding data should be filled with the padding length value. - int[] results = checkPadding(buf, offset + newLen, - padLen + 1, (byte)(padLen & 0xFF)); - if (protocolVersion.useTLS10PlusSpec()) { - if (results[0] != 0) { // padding data has invalid bytes - throw new BadPaddingException("Invalid TLS padding data"); - } - } else { // SSLv3 - // SSLv3 requires 0 <= length byte < block size - // some implementations do 1 <= length byte <= block size, - // so accept that as well - // v3 does not require any particular value for the other bytes - if (padLen > blockSize) { - throw new BadPaddingException("Padding length (" + - padLen + ") of SSLv3 message should not be bigger " + - "than the block size (" + blockSize + ")"); - } - } - return newLen; - } - - /* - * Position/limit is equal the removed padding. - */ - private static int removePadding(ByteBuffer bb, - int tagLen, int blockSize, - ProtocolVersion protocolVersion) throws BadPaddingException { - - int len = bb.remaining(); - int offset = bb.position(); - - // last byte is length byte (i.e. actual padding length - 1) - int padOffset = offset + len - 1; - int padLen = bb.get(padOffset) & 0xFF; - - int newLen = len - (padLen + 1); - if ((newLen - tagLen) < 0) { - // If the buffer is not long enough to contain the padding plus - // a MAC tag, do a dummy constant-time padding check. - // - // Note that it is a dummy check, so we won't care about what is - // the actual padding data. - checkPadding(bb.duplicate(), (byte)(padLen & 0xFF)); - - throw new BadPaddingException("Invalid Padding length: " + padLen); - } - - // The padding data should be filled with the padding length value. - int[] results = checkPadding( - bb.duplicate().position(offset + newLen), - (byte)(padLen & 0xFF)); - if (protocolVersion.useTLS10PlusSpec()) { - if (results[0] != 0) { // padding data has invalid bytes - throw new BadPaddingException("Invalid TLS padding data"); - } - } else { // SSLv3 - // SSLv3 requires 0 <= length byte < block size - // some implementations do 1 <= length byte <= block size, - // so accept that as well - // v3 does not require any particular value for the other bytes - if (padLen > blockSize) { - throw new BadPaddingException("Padding length (" + - padLen + ") of SSLv3 message should not be bigger " + - "than the block size (" + blockSize + ")"); - } - } - - /* - * Reset buffer limit to remove padding. - */ - bb.position(offset + newLen); - bb.limit(offset + newLen); - - return newLen; - } - - /* - * Dispose of any intermediate state in the underlying cipher. - * For PKCS11 ciphers, this will release any attached sessions, and - * thus make finalization faster. - */ - void dispose() { - try { - if (cipher != null) { - // ignore return value. - cipher.doFinal(); - } - } catch (Exception e) { - // swallow all types of exceptions. - } - } - - /* - * Does the cipher use CBC mode? - * - * @return true if the cipher use CBC mode, false otherwise. - */ - boolean isCBCMode() { - return cipherType == BLOCK_CIPHER; - } - - /* - * Does the cipher use AEAD mode? - * - * @return true if the cipher use AEAD mode, false otherwise. - */ - boolean isAEADMode() { - return cipherType == AEAD_CIPHER; - } - - /* - * Is the cipher null? - * - * @return true if the cipher is null, false otherwise. - */ - boolean isNullCipher() { - return cipher == null; - } - - /* - * Gets the explicit nonce/IV size of the cipher. - * - * The returned value is the SecurityParameters.record_iv_length in - * RFC 4346/5246. It is the size of explicit IV for CBC mode, and the - * size of explicit nonce for AEAD mode. - * - * @return the explicit nonce size of the cipher. - */ - int getExplicitNonceSize() { - switch (cipherType) { - case BLOCK_CIPHER: - // For block ciphers, the explicit IV length is of length - // SecurityParameters.record_iv_length, which is equal to - // the SecurityParameters.block_size. - if (protocolVersion.useTLS11PlusSpec()) { - return cipher.getBlockSize(); - } - break; - case AEAD_CIPHER: - return recordIvSize; - // It is also the length of sequence number, which is - // used as the nonce_explicit for AEAD cipher suites. - } - - return 0; - } - - /* - * Applies the explicit nonce/IV to this cipher. This method is used to - * decrypt an SSL/TLS input record. - * - * The returned value is the SecurityParameters.record_iv_length in - * RFC 4346/5246. It is the size of explicit IV for CBC mode, and the - * size of explicit nonce for AEAD mode. - * - * @param authenticator the authenticator to get the additional - * authentication data - * @param contentType the content type of the input record - * @param bb the byte buffer to get the explicit nonce from - * - * @return the explicit nonce size of the cipher. - */ - int applyExplicitNonce(Authenticator authenticator, byte contentType, - ByteBuffer bb, byte[] sequence) throws BadPaddingException { - switch (cipherType) { - case BLOCK_CIPHER: - // sanity check length of the ciphertext - int tagLen = (authenticator instanceof MAC) ? - ((MAC)authenticator).MAClen() : 0; - if (tagLen != 0) { - if (!sanityCheck(tagLen, bb.remaining())) { - throw new BadPaddingException( - "ciphertext sanity check failed"); - } - } - - // For block ciphers, the explicit IV length is of length - // SecurityParameters.record_iv_length, which is equal to - // the SecurityParameters.block_size. - if (protocolVersion.useTLS11PlusSpec()) { - return cipher.getBlockSize(); - } - break; - case AEAD_CIPHER: - if (bb.remaining() < (recordIvSize + tagSize)) { - throw new BadPaddingException( - "Insufficient buffer remaining for AEAD cipher " + - "fragment (" + bb.remaining() + "). Needs to be " + - "more than or equal to IV size (" + recordIvSize + - ") + tag size (" + tagSize + ")"); - } - - // initialize the AEAD cipher for the unique IV - byte[] iv = Arrays.copyOf(fixedIv, - fixedIv.length + recordIvSize); - bb.get(iv, fixedIv.length, recordIvSize); - bb.position(bb.position() - recordIvSize); - GCMParameterSpec spec = new GCMParameterSpec(tagSize * 8, iv); - try { - cipher.init(mode, key, spec, random); - } catch (InvalidKeyException | - InvalidAlgorithmParameterException ikae) { - // unlikely to happen - throw new RuntimeException( - "invalid key or spec in GCM mode", ikae); - } - - // update the additional authentication data - byte[] aad = authenticator.acquireAuthenticationBytes( - contentType, bb.remaining() - recordIvSize - tagSize, - sequence); - cipher.updateAAD(aad); - - return recordIvSize; - // It is also the length of sequence number, which is - // used as the nonce_explicit for AEAD cipher suites. - } - - return 0; - } - - /* - * Creates the explicit nonce/IV to this cipher. This method is used to - * encrypt an SSL/TLS output record. - * - * The size of the returned array is the SecurityParameters.record_iv_length - * in RFC 4346/5246. It is the size of explicit IV for CBC mode, and the - * size of explicit nonce for AEAD mode. - * - * @param authenticator the authenticator to get the additional - * authentication data - * @param contentType the content type of the input record - * @param fragmentLength the fragment length of the output record, it is - * the TLSCompressed.length in RFC 4346/5246. - * - * @return the explicit nonce of the cipher. - */ - byte[] createExplicitNonce(Authenticator authenticator, - byte contentType, int fragmentLength) { - - byte[] nonce = new byte[0]; - switch (cipherType) { - case BLOCK_CIPHER: - if (protocolVersion.useTLS11PlusSpec()) { - // For block ciphers, the explicit IV length is of length - // SecurityParameters.record_iv_length, which is equal to - // the SecurityParameters.block_size. - // - // Generate a random number as the explicit IV parameter. - nonce = new byte[cipher.getBlockSize()]; - random.nextBytes(nonce); - } - break; - case AEAD_CIPHER: - // To be unique and aware of overflow-wrap, sequence number - // is used as the nonce_explicit of AEAD cipher suites. - nonce = authenticator.sequenceNumber(); - - // initialize the AEAD cipher for the unique IV - byte[] iv = Arrays.copyOf(fixedIv, - fixedIv.length + nonce.length); - System.arraycopy(nonce, 0, iv, fixedIv.length, nonce.length); - GCMParameterSpec spec = new GCMParameterSpec(tagSize * 8, iv); - try { - cipher.init(mode, key, spec, random); - } catch (InvalidKeyException | - InvalidAlgorithmParameterException ikae) { - // unlikely to happen - throw new RuntimeException( - "invalid key or spec in GCM mode", ikae); - } - - // Update the additional authentication data, using the - // implicit sequence number of the authenticator. - byte[] aad = authenticator.acquireAuthenticationBytes( - contentType, fragmentLength, null); - cipher.updateAAD(aad); - break; - } - - return nonce; - } - - // See also CipherSuite.calculatePacketSize(). - int calculatePacketSize(int fragmentSize, int macLen, int headerSize) { - int packetSize = fragmentSize; - if (cipher != null) { - int blockSize = cipher.getBlockSize(); - switch (cipherType) { - case BLOCK_CIPHER: - packetSize += macLen; - packetSize += 1; // 1 byte padding length field - packetSize += // use the minimal padding - (blockSize - (packetSize % blockSize)) % blockSize; - if (protocolVersion.useTLS11PlusSpec()) { - packetSize += blockSize; // explicit IV - } - - break; - case AEAD_CIPHER: - packetSize += recordIvSize; - packetSize += tagSize; - - break; - default: // NULL_CIPHER or STREAM_CIPHER - packetSize += macLen; - } - } - - return packetSize + headerSize; - } - - // See also CipherSuite.calculateFragSize(). - int calculateFragmentSize(int packetLimit, int macLen, int headerSize) { - int fragLen = packetLimit - headerSize; - if (cipher != null) { - int blockSize = cipher.getBlockSize(); - switch (cipherType) { - case BLOCK_CIPHER: - if (protocolVersion.useTLS11PlusSpec()) { - fragLen -= blockSize; // explicit IV - } - fragLen -= (fragLen % blockSize); // cannot hold a block - // No padding for a maximum fragment. - fragLen -= 1; // 1 byte padding length field: 0x00 - fragLen -= macLen; - - break; - case AEAD_CIPHER: - fragLen -= recordIvSize; - fragLen -= tagSize; - - break; - default: // NULL_CIPHER or STREAM_CIPHER - fragLen -= macLen; - } - } - - return fragLen; - } - - // Estimate the maximum fragment size of a received packet. - int estimateFragmentSize(int packetSize, int macLen, int headerSize) { - int fragLen = packetSize - headerSize; - if (cipher != null) { - int blockSize = cipher.getBlockSize(); - switch (cipherType) { - case BLOCK_CIPHER: - if (protocolVersion.useTLS11PlusSpec()) { - fragLen -= blockSize; // explicit IV - } - // No padding for a maximum fragment. - fragLen -= 1; // 1 byte padding length field: 0x00 - fragLen -= macLen; - - break; - case AEAD_CIPHER: - fragLen -= recordIvSize; - fragLen -= tagSize; - - break; - default: // NULL_CIPHER or STREAM_CIPHER - fragLen -= macLen; - } - } - - return fragLen; - } - - /** - * Sanity check the length of a fragment before decryption. - * - * In CBC mode, check that the fragment length is one or multiple times - * of the block size of the cipher suite, and is at least one (one is the - * smallest size of padding in CBC mode) bigger than the tag size of the - * MAC algorithm except the explicit IV size for TLS 1.1 or later. - * - * In non-CBC mode, check that the fragment length is not less than the - * tag size of the MAC algorithm. - * - * @return true if the length of a fragment matches above requirements - */ - private boolean sanityCheck(int tagLen, int fragmentLen) { - if (!isCBCMode()) { - return fragmentLen >= tagLen; - } - - int blockSize = cipher.getBlockSize(); - if ((fragmentLen % blockSize) == 0) { - int minimal = tagLen + 1; - minimal = (minimal >= blockSize) ? minimal : blockSize; - if (protocolVersion.useTLS11PlusSpec()) { - minimal += blockSize; // plus the size of the explicit IV - } - - return (fragmentLen >= minimal); - } - - return false; - } - -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CipherSuite.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CipherSuite.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CipherSuite.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CipherSuite.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,171 +23,939 @@ * questions. */ - package sun.security.ssl; -import java.util.*; - -import java.security.NoSuchAlgorithmException; -import java.security.InvalidKeyException; -import java.security.SecureRandom; -import java.security.KeyManagementException; - -import javax.crypto.Cipher; -import javax.crypto.SecretKey; -import javax.crypto.spec.IvParameterSpec; -import javax.crypto.spec.SecretKeySpec; - +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import static sun.security.ssl.CipherSuite.HashAlg.*; import static sun.security.ssl.CipherSuite.KeyExchange.*; -import static sun.security.ssl.CipherSuite.PRF.*; -import static sun.security.ssl.CipherSuite.CipherType.*; import static sun.security.ssl.CipherSuite.MacAlg.*; -import static sun.security.ssl.CipherSuite.BulkCipher.*; -import static sun.security.ssl.JsseJce.*; -import static sun.security.ssl.NamedGroupType.*; +import static sun.security.ssl.SSLCipher.*; +import sun.security.ssl.SupportedGroupsExtension.NamedGroupType; +import static sun.security.ssl.SupportedGroupsExtension.NamedGroupType.*; /** - * An SSL/TLS CipherSuite. Constants for the standard key exchange, cipher, - * and mac algorithms are also defined in this class. - * - * The CipherSuite class and the inner classes defined in this file roughly - * follow the type safe enum pattern described in Effective Java. This means: - * - * . instances are immutable, classes are final - * - * . there is a unique instance of every value, i.e. there are never two - * instances representing the same CipherSuite, etc. This means equality - * tests can be performed using == instead of equals() (although that works - * as well). [A minor exception are *unsupported* CipherSuites read from a - * handshake message, but this is usually irrelevant] - * - * . instances are obtained using the static valueOf() factory methods. - * - * . properties are defined as final variables and made available as - * package private variables without method accessors - * - * . if the member variable allowed is false, the given algorithm is either - * unavailable or disabled at compile time + * Enum for SSL/(D)TLS cipher suites. * + * Please refer to the "TLS Cipher Suite Registry" section for more details + * about each cipher suite: + * https://www.iana.org/assignments/tls-parameters/tls-parameters.xml */ -final class CipherSuite implements Comparable<CipherSuite> { +enum CipherSuite { + // + // in preference order + // - // minimum priority for supported CipherSuites - static final int SUPPORTED_SUITES_PRIORITY = 1; + // Definition of the CipherSuites that are enabled by default. + // + // They are listed in preference order, most preferred first, using + // the following criteria: + // 1. Prefer Suite B compliant cipher suites, see RFC6460 (To be + // changed later, see below). + // 2. Prefer the stronger bulk cipher, in the order of AES_256(GCM), + // AES_128(GCM), AES_256, AES_128, 3DES-EDE. + // 3. Prefer the stronger MAC algorithm, in the order of SHA384, + // SHA256, SHA, MD5. + // 4. Prefer the better performance of key exchange and digital + // signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA, + // RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS. + + TLS_AES_128_GCM_SHA256( + 0x1301, true, "TLS_AES_128_GCM_SHA256", + ProtocolVersion.PROTOCOLS_OF_13, B_AES_128_GCM_IV, H_SHA256), + TLS_AES_256_GCM_SHA384( + 0x1302, true, "TLS_AES_256_GCM_SHA384", + ProtocolVersion.PROTOCOLS_OF_13, B_AES_256_GCM_IV, H_SHA384), - // minimum priority for default enabled CipherSuites - static final int DEFAULT_SUITES_PRIORITY = 300; + // Suite B compliant cipher suites, see RFC 6460. + // + // Note that, at present this provider is not Suite B compliant. The + // preference order of the GCM cipher suites does not follow the spec + // of RFC 6460. In this section, only two cipher suites are listed + // so that applications can make use of Suite-B compliant cipher + // suite firstly. + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384( + 0xC02C, true, "TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_ECDSA, B_AES_256_GCM, M_NULL, H_SHA384), + TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256( + 0xC02B, true, "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_ECDSA, B_AES_128_GCM, M_NULL, H_SHA256), + + // AES_256(GCM) + TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384( + 0xC030, true, "TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_RSA, B_AES_256_GCM, M_NULL, H_SHA384), + TLS_RSA_WITH_AES_256_GCM_SHA384( + 0x009D, true, "TLS_RSA_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_RSA, B_AES_256_GCM, M_NULL, H_SHA384), + TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384( + 0xC02E, true, "TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_ECDSA, B_AES_256_GCM, M_NULL, H_SHA384), + TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384( + 0xC032, true, "TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_RSA, B_AES_256_GCM, M_NULL, H_SHA384), + TLS_DHE_RSA_WITH_AES_256_GCM_SHA384( + 0x009F, true, "TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_RSA, B_AES_256_GCM, M_NULL, H_SHA384), + TLS_DHE_DSS_WITH_AES_256_GCM_SHA384( + 0x00A3, true, "TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_DSS, B_AES_256_GCM, M_NULL, H_SHA384), + + // AES_128(GCM) + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256( + 0xC02F, true, "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_RSA, B_AES_128_GCM, M_NULL, H_SHA256), + TLS_RSA_WITH_AES_128_GCM_SHA256( + 0x009C, true, "TLS_RSA_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_RSA, B_AES_128_GCM, M_NULL, H_SHA256), + TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256( + 0xC02D, true, "TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_ECDSA, B_AES_128_GCM, M_NULL, H_SHA256), + TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256( + 0xC031, true, "TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_RSA, B_AES_128_GCM, M_NULL, H_SHA256), + TLS_DHE_RSA_WITH_AES_128_GCM_SHA256( + 0x009E, true, "TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_RSA, B_AES_128_GCM, M_NULL, H_SHA256), + TLS_DHE_DSS_WITH_AES_128_GCM_SHA256( + 0x00A2, true, "TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_DSS, B_AES_128_GCM, M_NULL, H_SHA256), + + // AES_256(CBC) + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384( + 0xC024, true, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_ECDSA, B_AES_256, M_SHA384, H_SHA384), + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384( + 0xC028, true, "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_RSA, B_AES_256, M_SHA384, H_SHA384), + TLS_RSA_WITH_AES_256_CBC_SHA256( + 0x003D, true, "TLS_RSA_WITH_AES_256_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_RSA, B_AES_256, M_SHA256, H_SHA256), + TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384( + 0xC026, true, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_ECDSA, B_AES_256, M_SHA384, H_SHA384), + TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384( + 0xC02A, true, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_RSA, B_AES_256, M_SHA384, H_SHA384), + TLS_DHE_RSA_WITH_AES_256_CBC_SHA256( + 0x006B, true, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_RSA, B_AES_256, M_SHA256, H_SHA256), + TLS_DHE_DSS_WITH_AES_256_CBC_SHA256( + 0x006A, true, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_DSS, B_AES_256, M_SHA256, H_SHA256), + + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA( + 0xC00A, true, "TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDHE_ECDSA, B_AES_256, M_SHA, H_SHA256), + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA( + 0xC014, true, "TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDHE_RSA, B_AES_256, M_SHA, H_SHA256), + TLS_RSA_WITH_AES_256_CBC_SHA( + 0x0035, true, "TLS_RSA_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_RSA, B_AES_256, M_SHA, H_SHA256), + TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA( + 0xC005, true, "TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_ECDSA, B_AES_256, M_SHA, H_SHA256), + TLS_ECDH_RSA_WITH_AES_256_CBC_SHA( + 0xC00F, true, "TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_RSA, B_AES_256, M_SHA, H_SHA256), + TLS_DHE_RSA_WITH_AES_256_CBC_SHA( + 0x0039, true, "TLS_DHE_RSA_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_DHE_RSA, B_AES_256, M_SHA, H_SHA256), + TLS_DHE_DSS_WITH_AES_256_CBC_SHA( + 0x0038, true, "TLS_DHE_DSS_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_DHE_DSS, B_AES_256, M_SHA, H_SHA256), + + // AES_128(CBC) + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256( + 0xC023, true, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_ECDSA, B_AES_128, M_SHA256, H_SHA256), + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256( + 0xC027, true, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDHE_RSA, B_AES_128, M_SHA256, H_SHA256), + TLS_RSA_WITH_AES_128_CBC_SHA256( + 0x003C, true, "TLS_RSA_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_RSA, B_AES_128, M_SHA256, H_SHA256), + TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256( + 0xC025, true, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_ECDSA, B_AES_128, M_SHA256, H_SHA256), + TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256( + 0xC029, true, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_ECDH_RSA, B_AES_128, M_SHA256, H_SHA256), + TLS_DHE_RSA_WITH_AES_128_CBC_SHA256( + 0x0067, true, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_RSA, B_AES_128, M_SHA256, H_SHA256), + TLS_DHE_DSS_WITH_AES_128_CBC_SHA256( + 0x0040, true, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DHE_DSS, B_AES_128, M_SHA256, H_SHA256), + + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA( + 0xC009, true, "TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDHE_ECDSA, B_AES_128, M_SHA, H_SHA256), + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA( + 0xC013, true, "TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDHE_RSA, B_AES_128, M_SHA, H_SHA256), + TLS_RSA_WITH_AES_128_CBC_SHA( + 0x002F, true, "TLS_RSA_WITH_AES_128_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_RSA, B_AES_128, M_SHA, H_SHA256), + TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA( + 0xC004, true, "TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_ECDSA, B_AES_128, M_SHA, H_SHA256), + TLS_ECDH_RSA_WITH_AES_128_CBC_SHA( + 0xC00E, true, "TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_RSA, B_AES_128, M_SHA, H_SHA256), + TLS_DHE_RSA_WITH_AES_128_CBC_SHA( + 0x0033, true, "TLS_DHE_RSA_WITH_AES_128_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_DHE_RSA, B_AES_128, M_SHA, H_SHA256), + TLS_DHE_DSS_WITH_AES_128_CBC_SHA( + 0x0032, true, "TLS_DHE_DSS_WITH_AES_128_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_DHE_DSS, B_AES_128, M_SHA, H_SHA256), + + // 3DES_EDE + TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA( + 0xC008, true, "TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDHE_ECDSA, B_3DES, M_SHA, H_SHA256), + TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA( + 0xC012, true, "TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDHE_RSA, B_3DES, M_SHA, H_SHA256), + SSL_RSA_WITH_3DES_EDE_CBC_SHA( + 0x000A, true, "SSL_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_RSA_WITH_3DES_EDE_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_12, + K_RSA, B_3DES, M_SHA, H_SHA256), + TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA( + 0xC003, true, "TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_ECDSA, B_3DES, M_SHA, H_SHA256), + TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA( + 0xC00D, true, "TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_RSA, B_3DES, M_SHA, H_SHA256), + SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA( + 0x0016, true, "SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", + "TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_12, + K_DHE_RSA, B_3DES, M_SHA, H_SHA256), + SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA( + 0x0013, true, "SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", + "TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_12, + K_DHE_DSS, B_3DES, M_SHA, H_SHA256), + + // Renegotiation protection request Signalling Cipher Suite Value (SCSV). + TLS_EMPTY_RENEGOTIATION_INFO_SCSV( // RFC 5746, TLS 1.2 and prior + 0x00FF, true, "TLS_EMPTY_RENEGOTIATION_INFO_SCSV", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_SCSV, B_NULL, M_NULL, H_NONE), + + // Definition of the CipherSuites that are supported but not enabled + // by default. + // They are listed in preference order, preferred first, using the + // following criteria: + // 1. If a cipher suite has been obsoleted, we put it at the end of + // the list. + // 2. Prefer the stronger bulk cipher, in the order of AES_256, + // AES_128, 3DES-EDE, RC-4, DES, DES40, RC4_40, NULL. + // 3. Prefer the stronger MAC algorithm, in the order of SHA384, + // SHA256, SHA, MD5. + // 4. Prefer the better performance of key exchange and digital + // signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA, + // RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS, anonymous. + TLS_DH_anon_WITH_AES_256_GCM_SHA384( + 0x00A7, false, "TLS_DH_anon_WITH_AES_256_GCM_SHA384", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DH_ANON, B_AES_256_GCM, M_NULL, H_SHA384), + TLS_DH_anon_WITH_AES_128_GCM_SHA256( + 0x00A6, false, "TLS_DH_anon_WITH_AES_128_GCM_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DH_ANON, B_AES_128_GCM, M_NULL, H_SHA256), + TLS_DH_anon_WITH_AES_256_CBC_SHA256( + 0x006D, false, "TLS_DH_anon_WITH_AES_256_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DH_ANON, B_AES_256, M_SHA256, H_SHA256), + TLS_ECDH_anon_WITH_AES_256_CBC_SHA( + 0xC019, false, "TLS_ECDH_anon_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_ANON, B_AES_256, M_SHA, H_SHA256), + TLS_DH_anon_WITH_AES_256_CBC_SHA( + 0x003A, false, "TLS_DH_anon_WITH_AES_256_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_DH_ANON, B_AES_256, M_SHA, H_SHA256), + TLS_DH_anon_WITH_AES_128_CBC_SHA256( + 0x006C, false, "TLS_DH_anon_WITH_AES_128_CBC_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_DH_ANON, B_AES_128, M_SHA256, H_SHA256), + TLS_ECDH_anon_WITH_AES_128_CBC_SHA( + 0xC018, false, "TLS_ECDH_anon_WITH_AES_128_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_ANON, B_AES_128, M_SHA, H_SHA256), + TLS_DH_anon_WITH_AES_128_CBC_SHA( + 0x0034, false, "TLS_DH_anon_WITH_AES_128_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_DH_ANON, B_AES_128, M_SHA, H_SHA256), + TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA( + 0xC017, false, "TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_ANON, B_3DES, M_SHA, H_SHA256), + SSL_DH_anon_WITH_3DES_EDE_CBC_SHA( + 0x001B, false, "SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", + "TLS_DH_anon_WITH_3DES_EDE_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_12, + K_DH_ANON, B_3DES, M_SHA, H_SHA256), + + // RC4 + TLS_ECDHE_ECDSA_WITH_RC4_128_SHA( + 0xC007, false, "TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", "", + ProtocolVersion.PROTOCOLS_TO_TLS12, + K_ECDHE_ECDSA, B_RC4_128, M_SHA, H_SHA256), + TLS_ECDHE_RSA_WITH_RC4_128_SHA( + 0xC011, false, "TLS_ECDHE_RSA_WITH_RC4_128_SHA", "", + ProtocolVersion.PROTOCOLS_TO_TLS12, + K_ECDHE_RSA, B_RC4_128, M_SHA, H_SHA256), + SSL_RSA_WITH_RC4_128_SHA( + 0x0005, false, "SSL_RSA_WITH_RC4_128_SHA", + "TLS_RSA_WITH_RC4_128_SHA", + ProtocolVersion.PROTOCOLS_TO_TLS12, + K_RSA, B_RC4_128, M_SHA, H_SHA256), + TLS_ECDH_ECDSA_WITH_RC4_128_SHA( + 0xC002, false, "TLS_ECDH_ECDSA_WITH_RC4_128_SHA", "", + ProtocolVersion.PROTOCOLS_TO_TLS12, + K_ECDH_ECDSA, B_RC4_128, M_SHA, H_SHA256), + TLS_ECDH_RSA_WITH_RC4_128_SHA( + 0xC00C, false, "TLS_ECDH_RSA_WITH_RC4_128_SHA", "", + ProtocolVersion.PROTOCOLS_TO_TLS12, + K_ECDH_RSA, B_RC4_128, M_SHA, H_SHA256), + SSL_RSA_WITH_RC4_128_MD5( + 0x0004, false, "SSL_RSA_WITH_RC4_128_MD5", + "TLS_RSA_WITH_RC4_128_MD5", + ProtocolVersion.PROTOCOLS_TO_TLS12, + K_RSA, B_RC4_128, M_MD5, H_SHA256), + TLS_ECDH_anon_WITH_RC4_128_SHA( + 0xC016, false, "TLS_ECDH_anon_WITH_RC4_128_SHA", "", + ProtocolVersion.PROTOCOLS_TO_TLS12, + K_ECDH_ANON, B_RC4_128, M_SHA, H_SHA256), + SSL_DH_anon_WITH_RC4_128_MD5( + 0x0018, false, "SSL_DH_anon_WITH_RC4_128_MD5", + "TLS_DH_anon_WITH_RC4_128_MD5", + ProtocolVersion.PROTOCOLS_TO_TLS12, + K_DH_ANON, B_RC4_128, M_MD5, H_SHA256), + + // weak cipher suites obsoleted in TLS 1.2 [RFC 5246] + SSL_RSA_WITH_DES_CBC_SHA( + 0x0009, false, "SSL_RSA_WITH_DES_CBC_SHA", + "TLS_RSA_WITH_DES_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_11, + K_RSA, B_DES, M_SHA, H_NONE), + SSL_DHE_RSA_WITH_DES_CBC_SHA( + 0x0015, false, "SSL_DHE_RSA_WITH_DES_CBC_SHA", + "TLS_DHE_RSA_WITH_DES_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_11, + K_DHE_RSA, B_DES, M_SHA, H_NONE), + SSL_DHE_DSS_WITH_DES_CBC_SHA( + 0x0012, false, "SSL_DHE_DSS_WITH_DES_CBC_SHA", + "TLS_DHE_DSS_WITH_DES_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_11, + K_DHE_DSS, B_DES, M_SHA, H_NONE), + SSL_DH_anon_WITH_DES_CBC_SHA( + 0x001A, false, "SSL_DH_anon_WITH_DES_CBC_SHA", + "TLS_DH_anon_WITH_DES_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_11, + K_DH_ANON, B_DES, M_SHA, H_NONE), + + // weak cipher suites obsoleted in TLS 1.1 [RFC 4346] + SSL_RSA_EXPORT_WITH_DES40_CBC_SHA( + 0x0008, false, "SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", + "TLS_RSA_EXPORT_WITH_DES40_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_10, + K_RSA_EXPORT, B_DES_40, M_SHA, H_NONE), + SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA( + 0x0014, false, "SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", + "TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_10, + K_DHE_RSA_EXPORT, B_DES_40, M_SHA, H_NONE), + SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA( + 0x0011, false, "SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", + "TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_10, + K_DHE_DSS_EXPORT, B_DES_40, M_SHA, H_NONE), + SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA( + 0x0019, false, "SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", + "TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA", + ProtocolVersion.PROTOCOLS_TO_10, + K_DH_ANON_EXPORT, B_DES_40, M_SHA, H_NONE), + SSL_RSA_EXPORT_WITH_RC4_40_MD5( + 0x0003, false, "SSL_RSA_EXPORT_WITH_RC4_40_MD5", + "TLS_RSA_EXPORT_WITH_RC4_40_MD5", + ProtocolVersion.PROTOCOLS_TO_10, + K_RSA_EXPORT, B_DES_40, M_MD5, H_NONE), + SSL_DH_anon_EXPORT_WITH_RC4_40_MD5( + 0x0017, false, "SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", + "TLS_DH_anon_EXPORT_WITH_RC4_40_MD5", + ProtocolVersion.PROTOCOLS_TO_10, + K_DH_ANON, B_DES_40, M_MD5, H_NONE), + + // no traffic encryption cipher suites + TLS_RSA_WITH_NULL_SHA256( + 0x003B, false, "TLS_RSA_WITH_NULL_SHA256", "", + ProtocolVersion.PROTOCOLS_OF_12, + K_RSA, B_NULL, M_SHA256, H_SHA256), + TLS_ECDHE_ECDSA_WITH_NULL_SHA( + 0xC006, false, "TLS_ECDHE_ECDSA_WITH_NULL_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDHE_ECDSA, B_NULL, M_SHA, H_SHA256), + TLS_ECDHE_RSA_WITH_NULL_SHA( + 0xC010, false, "TLS_ECDHE_RSA_WITH_NULL_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDHE_RSA, B_NULL, M_SHA, H_SHA256), + SSL_RSA_WITH_NULL_SHA( + 0x0002, false, "SSL_RSA_WITH_NULL_SHA", + "TLS_RSA_WITH_NULL_SHA", + ProtocolVersion.PROTOCOLS_TO_12, + K_RSA, B_NULL, M_SHA, H_SHA256), + TLS_ECDH_ECDSA_WITH_NULL_SHA( + 0xC001, false, "TLS_ECDH_ECDSA_WITH_NULL_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_ECDSA, B_NULL, M_SHA, H_SHA256), + TLS_ECDH_RSA_WITH_NULL_SHA( + 0xC00B, false, "TLS_ECDH_RSA_WITH_NULL_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_RSA, B_NULL, M_SHA, H_SHA256), + TLS_ECDH_anon_WITH_NULL_SHA( + 0xC015, false, "TLS_ECDH_anon_WITH_NULL_SHA", "", + ProtocolVersion.PROTOCOLS_TO_12, + K_ECDH_ANON, B_NULL, M_SHA, H_SHA256), + SSL_RSA_WITH_NULL_MD5( + 0x0001, false, "SSL_RSA_WITH_NULL_MD5", + "TLS_RSA_WITH_NULL_MD5", + ProtocolVersion.PROTOCOLS_TO_12, + K_RSA, B_NULL, M_MD5, H_SHA256), + + // Definition of the CipherSuites that are not supported but the names + // are known. + TLS_CHACHA20_POLY1305_SHA256( // TLS 1.3 + "TLS_CHACHA20_POLY1305_SHA256", 0x1303), + TLS_AES_128_CCM_SHA256( // TLS 1.3 + "TLS_AES_128_CCM_SHA256", 0x1304), + TLS_AES_128_CCM_8_SHA256( // TLS 1.3 + "TLS_AES_128_CCM_8_SHA256", 0x1305), + + // remaining unsupported ciphersuites defined in RFC2246. + CS_0006("SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", 0x0006), + CS_0007("SSL_RSA_WITH_IDEA_CBC_SHA", 0x0007), + CS_000B("SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x000b), + CS_000C("SSL_DH_DSS_WITH_DES_CBC_SHA", 0x000c), + CS_000D("SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", 0x000d), + CS_000E("SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x000e), + CS_000F("SSL_DH_RSA_WITH_DES_CBC_SHA", 0x000f), + CS_0010("SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", 0x0010), + + // SSL 3.0 Fortezza ciphersuites + CS_001C("SSL_FORTEZZA_DMS_WITH_NULL_SHA", 0x001c), + CS_001D("SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA", 0x001d), + + // 1024/56 bit exportable ciphersuites from expired internet draft + CS_0062("SSL_RSA_EXPORT1024_WITH_DES_CBC_SHA", 0x0062), + CS_0063("SSL_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA", 0x0063), + CS_0064("SSL_RSA_EXPORT1024_WITH_RC4_56_SHA", 0x0064), + CS_0065("SSL_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA", 0x0065), + CS_0066("SSL_DHE_DSS_WITH_RC4_128_SHA", 0x0066), + + // Netscape old and new SSL 3.0 FIPS ciphersuites + // see http://www.mozilla.org/projects/security/pki/nss/ssl/fips-ssl-ciphersuites.html + CS_FFE0("NETSCAPE_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xffe0), + CS_FFE1("NETSCAPE_RSA_FIPS_WITH_DES_CBC_SHA", 0xffe1), + CS_FEFE("SSL_RSA_FIPS_WITH_DES_CBC_SHA", 0xfefe), + CS_FEFF("SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xfeff), + + // Unsupported Kerberos cipher suites from RFC 2712 + CS_001E("TLS_KRB5_WITH_DES_CBC_SHA", 0x001E), + CS_001F("TLS_KRB5_WITH_3DES_EDE_CBC_SHA", 0x001F), + CS_0020("TLS_KRB5_WITH_RC4_128_SHA", 0x0020), + CS_0021("TLS_KRB5_WITH_IDEA_CBC_SHA", 0x0021), + CS_0022("TLS_KRB5_WITH_DES_CBC_MD5", 0x0022), + CS_0023("TLS_KRB5_WITH_3DES_EDE_CBC_MD5", 0x0023), + CS_0024("TLS_KRB5_WITH_RC4_128_MD5", 0x0024), + CS_0025("TLS_KRB5_WITH_IDEA_CBC_MD5", 0x0025), + CS_0026("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 0x0026), + CS_0027("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA", 0x0027), + CS_0028("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 0x0028), + CS_0029("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 0x0029), + CS_002A("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5", 0x002a), + CS_002B("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 0x002B), + + // Unsupported cipher suites from RFC 4162 + CS_0096("TLS_RSA_WITH_SEED_CBC_SHA", 0x0096), + CS_0097("TLS_DH_DSS_WITH_SEED_CBC_SHA", 0x0097), + CS_0098("TLS_DH_RSA_WITH_SEED_CBC_SHA", 0x0098), + CS_0099("TLS_DHE_DSS_WITH_SEED_CBC_SHA", 0x0099), + CS_009A("TLS_DHE_RSA_WITH_SEED_CBC_SHA", 0x009a), + CS_009B("TLS_DH_anon_WITH_SEED_CBC_SHA", 0x009b), + + // Unsupported cipher suites from RFC 4279 + CS_008A("TLS_PSK_WITH_RC4_128_SHA", 0x008a), + CS_008B("TLS_PSK_WITH_3DES_EDE_CBC_SHA", 0x008b), + CS_008C("TLS_PSK_WITH_AES_128_CBC_SHA", 0x008c), + CS_008D("TLS_PSK_WITH_AES_256_CBC_SHA", 0x008d), + CS_008E("TLS_DHE_PSK_WITH_RC4_128_SHA", 0x008e), + CS_008F("TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA", 0x008f), + CS_0090("TLS_DHE_PSK_WITH_AES_128_CBC_SHA", 0x0090), + CS_0091("TLS_DHE_PSK_WITH_AES_256_CBC_SHA", 0x0091), + CS_0092("TLS_RSA_PSK_WITH_RC4_128_SHA", 0x0092), + CS_0093("TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA", 0x0093), + CS_0094("TLS_RSA_PSK_WITH_AES_128_CBC_SHA", 0x0094), + CS_0095("TLS_RSA_PSK_WITH_AES_256_CBC_SHA", 0x0095), + + // Unsupported cipher suites from RFC 4785 + CS_002C("TLS_PSK_WITH_NULL_SHA", 0x002c), + CS_002D("TLS_DHE_PSK_WITH_NULL_SHA", 0x002d), + CS_002E("TLS_RSA_PSK_WITH_NULL_SHA", 0x002e), + + // Unsupported cipher suites from RFC 5246 + CS_0030("TLS_DH_DSS_WITH_AES_128_CBC_SHA", 0x0030), + CS_0031("TLS_DH_RSA_WITH_AES_128_CBC_SHA", 0x0031), + CS_0036("TLS_DH_DSS_WITH_AES_256_CBC_SHA", 0x0036), + CS_0037("TLS_DH_RSA_WITH_AES_256_CBC_SHA", 0x0037), + CS_003E("TLS_DH_DSS_WITH_AES_128_CBC_SHA256", 0x003e), + CS_003F("TLS_DH_RSA_WITH_AES_128_CBC_SHA256", 0x003f), + CS_0068("TLS_DH_DSS_WITH_AES_256_CBC_SHA256", 0x0068), + CS_0069("TLS_DH_RSA_WITH_AES_256_CBC_SHA256", 0x0069), + + // Unsupported cipher suites from RFC 5288 + CS_00A0("TLS_DH_RSA_WITH_AES_128_GCM_SHA256", 0x00a0), + CS_00A1("TLS_DH_RSA_WITH_AES_256_GCM_SHA384", 0x00a1), + CS_00A4("TLS_DH_DSS_WITH_AES_128_GCM_SHA256", 0x00a4), + CS_00A5("TLS_DH_DSS_WITH_AES_256_GCM_SHA384", 0x00a5), + + // Unsupported cipher suites from RFC 5487 + CS_00A8("TLS_PSK_WITH_AES_128_GCM_SHA256", 0x00a8), + CS_00A9("TLS_PSK_WITH_AES_256_GCM_SHA384", 0x00a9), + CS_00AA("TLS_DHE_PSK_WITH_AES_128_GCM_SHA256", 0x00aa), + CS_00AB("TLS_DHE_PSK_WITH_AES_256_GCM_SHA384", 0x00ab), + CS_00AC("TLS_RSA_PSK_WITH_AES_128_GCM_SHA256", 0x00ac), + CS_00AD("TLS_RSA_PSK_WITH_AES_256_GCM_SHA384", 0x00ad), + CS_00AE("TLS_PSK_WITH_AES_128_CBC_SHA256", 0x00ae), + CS_00AF("TLS_PSK_WITH_AES_256_CBC_SHA384", 0x00af), + CS_00B0("TLS_PSK_WITH_NULL_SHA256", 0x00b0), + CS_00B1("TLS_PSK_WITH_NULL_SHA384", 0x00b1), + CS_00B2("TLS_DHE_PSK_WITH_AES_128_CBC_SHA256", 0x00b2), + CS_00B3("TLS_DHE_PSK_WITH_AES_256_CBC_SHA384", 0x00b3), + CS_00B4("TLS_DHE_PSK_WITH_NULL_SHA256", 0x00b4), + CS_00B5("TLS_DHE_PSK_WITH_NULL_SHA384", 0x00b5), + CS_00B6("TLS_RSA_PSK_WITH_AES_128_CBC_SHA256", 0x00b6), + CS_00B7("TLS_RSA_PSK_WITH_AES_256_CBC_SHA384", 0x00b7), + CS_00B8("TLS_RSA_PSK_WITH_NULL_SHA256", 0x00b8), + CS_00B9("TLS_RSA_PSK_WITH_NULL_SHA384", 0x00b9), + + // Unsupported cipher suites from RFC 5932 + CS_0041("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0041), + CS_0042("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA", 0x0042), + CS_0043("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0043), + CS_0044("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA", 0x0044), + CS_0045("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0045), + CS_0046("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA", 0x0046), + CS_0084("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0084), + CS_0085("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA", 0x0085), + CS_0086("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0086), + CS_0087("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA", 0x0087), + CS_0088("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0088), + CS_0089("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA", 0x0089), + CS_00BA("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00ba), + CS_00BB("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256", 0x00bb), + CS_00BC("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00bc), + CS_00BD("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256", 0x00bd), + CS_00BE("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00be), + CS_00BF("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256", 0x00bf), + CS_00C0("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c0), + CS_00C1("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256", 0x00c1), + CS_00C2("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c2), + CS_00C3("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256", 0x00c3), + CS_00C4("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c4), + CS_00C5("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256", 0x00c5), + + // TLS Fallback Signaling Cipher Suite Value (SCSV) RFC 7507 + CS_5600("TLS_FALLBACK_SCSV", 0x5600), + + // Unsupported cipher suites from RFC 5054 + CS_C01A("TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA", 0xc01a), + CS_C01B("TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA", 0xc01b), + CS_C01C("TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA", 0xc01c), + CS_C01D("TLS_SRP_SHA_WITH_AES_128_CBC_SHA", 0xc01d), + CS_C01E("TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA", 0xc01e), + CS_C01F("TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA", 0xc01f), + CS_C020("TLS_SRP_SHA_WITH_AES_256_CBC_SHA", 0xc020), + CS_C021("TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA", 0xc021), + CS_C022("TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA", 0xc022), + + // Unsupported cipher suites from RFC 5489 + CS_C033("TLS_ECDHE_PSK_WITH_RC4_128_SHA", 0xc033), + CS_C034("TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA", 0xc034), + CS_C035("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA", 0xc035), + CS_C036("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA", 0xc036), + CS_C037("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256", 0xc037), + CS_C038("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384", 0xc038), + CS_C039("TLS_ECDHE_PSK_WITH_NULL_SHA", 0xc039), + CS_C03A("TLS_ECDHE_PSK_WITH_NULL_SHA256", 0xc03a), + CS_C03B("TLS_ECDHE_PSK_WITH_NULL_SHA384", 0xc03b), + + // Unsupported cipher suites from RFC 6209 + CS_C03C("TLS_RSA_WITH_ARIA_128_CBC_SHA256", 0xc03c), + CS_C03D("TLS_RSA_WITH_ARIA_256_CBC_SHA384", 0xc03d), + CS_C03E("TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256", 0xc03e), + CS_C03F("TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384", 0xc03f), + CS_C040("TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256", 0xc040), + CS_C041("TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384", 0xc041), + CS_C042("TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256", 0xc042), + CS_C043("TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384", 0xc043), + CS_C044("TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256", 0xc044), + CS_C045("TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384", 0xc045), + CS_C046("TLS_DH_anon_WITH_ARIA_128_CBC_SHA256", 0xc046), + CS_C047("TLS_DH_anon_WITH_ARIA_256_CBC_SHA384", 0xc047), + CS_C048("TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256", 0xc048), + CS_C049("TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384", 0xc049), + CS_C04A("TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256", 0xc04a), + CS_C04B("TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384", 0xc04b), + CS_C04C("TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256", 0xc04c), + CS_C04D("TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384", 0xc04d), + CS_C04E("TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256", 0xc04e), + CS_C04F("TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384", 0xc04f), + CS_C050("TLS_RSA_WITH_ARIA_128_GCM_SHA256", 0xc050), + CS_C051("TLS_RSA_WITH_ARIA_256_GCM_SHA384", 0xc051), + CS_C052("TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256", 0xc052), + CS_C053("TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384", 0xc053), + CS_C054("TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256", 0xc054), + CS_C055("TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384", 0xc055), + CS_C056("TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256", 0xc056), + CS_C057("TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384", 0xc057), + CS_C058("TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256", 0xc058), + CS_C059("TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384", 0xc059), + CS_C05A("TLS_DH_anon_WITH_ARIA_128_GCM_SHA256", 0xc05a), + CS_C05B("TLS_DH_anon_WITH_ARIA_256_GCM_SHA384", 0xc05b), + CS_C05C("TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256", 0xc05c), + CS_C05D("TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384", 0xc05d), + CS_C05E("TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256", 0xc05e), + CS_C05F("TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384", 0xc05f), + CS_C060("TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256", 0xc060), + CS_C061("TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384", 0xc061), + CS_C062("TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256", 0xc062), + CS_C063("TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384", 0xc063), + CS_C064("TLS_PSK_WITH_ARIA_128_CBC_SHA256", 0xc064), + CS_C065("TLS_PSK_WITH_ARIA_256_CBC_SHA384", 0xc065), + CS_C066("TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256", 0xc066), + CS_C067("TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384", 0xc067), + CS_C068("TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256", 0xc068), + CS_C069("TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384", 0xc069), + CS_C06A("TLS_PSK_WITH_ARIA_128_GCM_SHA256", 0xc06a), + CS_C06B("TLS_PSK_WITH_ARIA_256_GCM_SHA384", 0xc06b), + CS_C06C("TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256", 0xc06c), + CS_C06D("TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384", 0xc06d), + CS_C06E("TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256", 0xc06e), + CS_C06F("TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384", 0xc06f), + CS_C070("TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256", 0xc070), + CS_C071("TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384", 0xc071), + + // Unsupported cipher suites from RFC 6367 + CS_C072("TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256", 0xc072), + CS_C073("TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384", 0xc073), + CS_C074("TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256", 0xc074), + CS_C075("TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384", 0xc075), + CS_C076("TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0xc076), + CS_C077("TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384", 0xc077), + CS_C078("TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0xc078), + CS_C079("TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384", 0xc079), + CS_C07A("TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc07a), + CS_C07B("TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc07b), + CS_C07C("TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc07c), + CS_C07D("TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc07d), + CS_C07E("TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc07e), + CS_C07F("TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc07f), + CS_C080("TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256", 0xc080), + CS_C081("TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384", 0xc081), + CS_C082("TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256", 0xc082), + CS_C083("TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384", 0xc083), + CS_C084("TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256", 0xc084), + CS_C085("TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384", 0xc085), + CS_C086("TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc086), + CS_C087("TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc087), + CS_C088("TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc088), + CS_C089("TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc089), + CS_C08A("TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc08a), + CS_C08B("TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc08b), + CS_C08C("TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc08c), + CS_C08D("TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc08d), + CS_C08E("TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256", 0xc08e), + CS_C08F("TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384", 0xc08f), + CS_C090("TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256", 0xc090), + CS_C091("TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384", 0xc091), + CS_C092("TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256", 0xc092), + CS_C093("TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384", 0xc093), + CS_C094("TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256", 0xc094), + CS_C095("TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384", 0xc095), + CS_C096("TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256", 0xc096), + CS_C097("TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384", 0xc097), + CS_C098("TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256", 0xc098), + CS_C099("TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384", 0xc099), + CS_C09A("TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256", 0xc09a), + CS_C09B("TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384", 0xc09b), + + // Unsupported cipher suites from RFC 6655 + CS_C09C("TLS_RSA_WITH_AES_128_CCM", 0xc09c), + CS_C09D("TLS_RSA_WITH_AES_256_CCM", 0xc09d), + CS_C09E("TLS_DHE_RSA_WITH_AES_128_CCM", 0xc09e), + CS_C09F("TLS_DHE_RSA_WITH_AES_256_CCM", 0xc09f), + CS_C0A0("TLS_RSA_WITH_AES_128_CCM_8", 0xc0A0), + CS_C0A1("TLS_RSA_WITH_AES_256_CCM_8", 0xc0A1), + CS_C0A2("TLS_DHE_RSA_WITH_AES_128_CCM_8", 0xc0A2), + CS_C0A3("TLS_DHE_RSA_WITH_AES_256_CCM_8", 0xc0A3), + CS_C0A4("TLS_PSK_WITH_AES_128_CCM", 0xc0A4), + CS_C0A5("TLS_PSK_WITH_AES_256_CCM", 0xc0A5), + CS_C0A6("TLS_DHE_PSK_WITH_AES_128_CCM", 0xc0A6), + CS_C0A7("TLS_DHE_PSK_WITH_AES_256_CCM", 0xc0A7), + CS_C0A8("TLS_PSK_WITH_AES_128_CCM_8", 0xc0A8), + CS_C0A9("TLS_PSK_WITH_AES_256_CCM_8", 0xc0A9), + CS_C0AA("TLS_PSK_DHE_WITH_AES_128_CCM_8", 0xc0Aa), + CS_C0AB("TLS_PSK_DHE_WITH_AES_256_CCM_8", 0xc0Ab), + + // Unsupported cipher suites from RFC 7251 + CS_C0AC("TLS_ECDHE_ECDSA_WITH_AES_128_CCM", 0xc0Ac), + CS_C0AD("TLS_ECDHE_ECDSA_WITH_AES_256_CCM", 0xc0Ad), + CS_C0AE("TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8", 0xc0Ae), + CS_C0AF("TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8", 0xc0Af), - private static final boolean ALLOW_ECC = Debug.getBooleanProperty - ("com.sun.net.ssl.enableECC", true); + C_NULL("SSL_NULL_WITH_NULL_NULL", 0x0000); - // Map Integer(id) -> CipherSuite - // contains all known CipherSuites - private static final Map<Integer,CipherSuite> idMap; + final int id; + final boolean isDefaultEnabled; + final String name; + final List<String> aliases; + final List<ProtocolVersion> supportedProtocols; + final KeyExchange keyExchange; + final SSLCipher bulkCipher; + final MacAlg macAlg; + final HashAlg hashAlg; - // Map String(name) -> CipherSuite - // contains only supported CipherSuites (i.e. allowed == true) - private static final Map<String,CipherSuite> nameMap; + final boolean exportable; - // Protocol defined CipherSuite name, e.g. SSL_RSA_WITH_RC4_128_MD5 - // we use TLS_* only for new CipherSuites, still SSL_* for old ones - final String name; + // known but unsupported cipher suite + private CipherSuite(String name, int id) { + this(id, false, name, "", + ProtocolVersion.PROTOCOLS_EMPTY, null, null, null, null); + } - // id in 16 bit MSB format, i.e. 0x0004 for SSL_RSA_WITH_RC4_128_MD5 - final int id; + // TLS 1.3 cipher suite + private CipherSuite(int id, boolean isDefaultEnabled, + String name, ProtocolVersion[] supportedProtocols, + SSLCipher bulkCipher, HashAlg hashAlg) { + this(id, isDefaultEnabled, name, "", + supportedProtocols, null, bulkCipher, M_NULL, hashAlg); + } + + private CipherSuite(int id, boolean isDefaultEnabled, + String name, String aliases, + ProtocolVersion[] supportedProtocols, + KeyExchange keyExchange, SSLCipher cipher, + MacAlg macAlg, HashAlg hashAlg) { + this.id = id; + this.isDefaultEnabled = isDefaultEnabled; + this.name = name; + if (aliases.isEmpty()) { + this.aliases = Arrays.asList(aliases.split(",")); + } else { + this.aliases = Collections.emptyList(); + } + this.supportedProtocols = Arrays.asList(supportedProtocols); + this.keyExchange = keyExchange; + this.bulkCipher = cipher; + this.macAlg = macAlg; + this.hashAlg = hashAlg; + + this.exportable = (cipher == null ? false : cipher.exportable); + } - // priority for the internal default preference order. the higher the - // better. Each supported CipherSuite *must* have a unique priority. - // Ciphersuites with priority >= DEFAULT_SUITES_PRIORITY are enabled - // by default - final int priority; + static CipherSuite nameOf(String ciperSuiteName) { + for (CipherSuite cs : CipherSuite.values()) { + if (cs.name.equals(ciperSuiteName) || + cs.aliases.contains(ciperSuiteName)) { + return cs; + } + } - // key exchange, bulk cipher, mac and prf algorithms. See those - // classes below. - final KeyExchange keyExchange; - final BulkCipher cipher; - final MacAlg macAlg; - final PRF prfAlg; + return null; + } - // whether a CipherSuite qualifies as exportable under 512/40 bit rules. - // TLS 1.1+ (RFC 4346) must not negotiate to these suites. - final boolean exportable; + static CipherSuite valueOf(int id) { + for (CipherSuite cs : CipherSuite.values()) { + if (cs.id == id) { + return cs; + } + } - // true iff implemented and enabled at compile time - final boolean allowed; + return null; + } - // obsoleted since protocol version - // - // TLS version is used. If checking DTLS versions, please map to - // TLS version firstly. See ProtocolVersion.mapToTLSProtocol(). - final int obsoleted; + static String nameOf(int id) { + for (CipherSuite cs : CipherSuite.values()) { + if (cs.id == id) { + return cs.name; + } + } - // supported since protocol version (TLS version is used) - // - // TLS version is used. If checking DTLS versions, please map to - // TLS version firstly. See ProtocolVersion.mapToTLSProtocol(). - final int supported; + return "UNKNOWN-CIPHER-SUITE(" + Utilities.byte16HexString(id) + ")"; + } - /** - * Constructor for implemented CipherSuites. - */ - private CipherSuite(String name, int id, int priority, - KeyExchange keyExchange, BulkCipher cipher, MacAlg mac, - boolean allowed, int obsoleted, int supported, PRF prfAlg) { - this.name = name; - this.id = id; - this.priority = priority; - this.keyExchange = keyExchange; - this.cipher = cipher; - this.macAlg = mac; - this.exportable = cipher.exportable; - allowed &= keyExchange.allowed; - allowed &= cipher.allowed; - this.allowed = allowed; - this.obsoleted = obsoleted; - this.supported = supported; - this.prfAlg = prfAlg; + static Collection<CipherSuite> allowedCipherSuites() { + Collection<CipherSuite> cipherSuites = new LinkedList<>(); + for (CipherSuite cs : CipherSuite.values()) { + if (!cs.supportedProtocols.isEmpty()) { + cipherSuites.add(cs); + } else { + // values() is ordered, remaining cipher suites are + // not supported. + break; + } + } + return cipherSuites; + } + + static Collection<CipherSuite> defaultCipherSuites() { + Collection<CipherSuite> cipherSuites = new LinkedList<>(); + for (CipherSuite cs : CipherSuite.values()) { + if (cs.isDefaultEnabled) { + cipherSuites.add(cs); + } else { + // values() is ordered, remaining cipher suites are + // not enabled. + break; + } + } + return cipherSuites; } /** - * Constructor for unimplemented CipherSuites. + * Validates and converts an array of cipher suite names. + * + * @throws IllegalArgumentException when one or more of the ciphers named + * by the parameter is not supported, or when the parameter is null. */ - private CipherSuite(String name, int id) { - this.name = name; - this.id = id; - this.allowed = false; + static List<CipherSuite> validValuesOf(String[] names) { + if (names == null) { + throw new IllegalArgumentException("CipherSuites cannot be null"); + } + + List<CipherSuite> cipherSuites = new ArrayList<>(names.length); + for (String name : names) { + if (name == null) { + throw new IllegalArgumentException( + "The specified CipherSuites array contain null element"); + } + + boolean found = false; + for (CipherSuite cs : CipherSuite.values()) { + if (!cs.supportedProtocols.isEmpty()) { + if (cs.name.equals(name) || + cs.aliases.contains(name)) { + cipherSuites.add(cs); + found = true; + break; + } + } else { + // values() is ordered, remaining cipher suites are + // not supported. + break; + } + } + if (!found) { + throw new IllegalArgumentException( + "Unsupported CipherSuite: " + name); + } + } - this.priority = 0; - this.keyExchange = null; - this.cipher = null; - this.macAlg = null; - this.exportable = false; - this.obsoleted = ProtocolVersion.LIMIT_MAX_VALUE; - this.supported = ProtocolVersion.LIMIT_MIN_VALUE; - this.prfAlg = P_NONE; + return Collections.unmodifiableList(cipherSuites); + } + + static String[] namesOf(List<CipherSuite> cipherSuites) { + String[] names = new String[cipherSuites.size()]; + int i = 0; + for (CipherSuite cipherSuite : cipherSuites) { + names[i++] = cipherSuite.name; + } + + return names; } - /** - * Return whether this CipherSuite is available for use. A - * CipherSuite may be unavailable even if it is supported - * (i.e. allowed == true) if the required JCE cipher is not installed. - */ boolean isAvailable() { - return allowed && keyExchange.isAvailable() && cipher.isAvailable(); + // Note: keyExchange is null for TLS 1.3 CipherSuites. + return !supportedProtocols.isEmpty() && + (keyExchange == null || keyExchange.isAvailable()) && + bulkCipher != null && bulkCipher.isAvailable(); + } + + public boolean supports(ProtocolVersion protocolVersion) { + return supportedProtocols.contains(protocolVersion); } boolean isNegotiable() { - return this != C_SCSV && isAvailable(); + return this != TLS_EMPTY_RENEGOTIATION_INFO_SCSV && isAvailable(); } - // See also CipherBox.calculatePacketSize(). + boolean isAnonymous() { + return (keyExchange != null && keyExchange.isAnonymous); + } + + // See also SSLWriteCipher.calculatePacketSize(). int calculatePacketSize(int fragmentSize, ProtocolVersion protocolVersion, boolean isDTLS) { - int packetSize = fragmentSize; - if (cipher != B_NULL) { - int blockSize = cipher.ivSize; - switch (cipher.cipherType) { + if (bulkCipher != null && bulkCipher != B_NULL) { + int blockSize = bulkCipher.ivSize; + switch (bulkCipher.cipherType) { case BLOCK_CIPHER: packetSize += macAlg.size; packetSize += 1; // 1 byte padding length field @@ -198,13 +966,17 @@ } break; - case AEAD_CIPHER: - packetSize += cipher.ivSize - cipher.fixedIvSize; // record IV - packetSize += cipher.tagSize; + case AEAD_CIPHER: + if (protocolVersion == ProtocolVersion.TLS12 || + protocolVersion == ProtocolVersion.DTLS12) { + packetSize += + bulkCipher.ivSize - bulkCipher.fixedIvSize; + } + packetSize += bulkCipher.tagSize; - break; - default: // NULL_CIPHER or STREAM_CIPHER - packetSize += macAlg.size; + break; + default: // NULL_CIPHER or STREAM_CIPHER + packetSize += macAlg.size; } } @@ -215,29 +987,28 @@ // See also CipherBox.calculateFragmentSize(). int calculateFragSize(int packetLimit, ProtocolVersion protocolVersion, boolean isDTLS) { - int fragSize = packetLimit - (isDTLS ? DTLSRecord.headerSize : SSLRecord.headerSize); - if (cipher != B_NULL) { - int blockSize = cipher.ivSize; - switch (cipher.cipherType) { - case BLOCK_CIPHER: - if (protocolVersion.useTLS11PlusSpec()) { - fragSize -= blockSize; // explicit IV - } - fragSize -= (fragSize % blockSize); // cannot hold a block - // No padding for a maximum fragment. - fragSize -= 1; // 1 byte padding length field: 0x00 - fragSize -= macAlg.size; + if (bulkCipher != null && bulkCipher != B_NULL) { + int blockSize = bulkCipher.ivSize; + switch (bulkCipher.cipherType) { + case BLOCK_CIPHER: + if (protocolVersion.useTLS11PlusSpec()) { + fragSize -= blockSize; // explicit IV + } + fragSize -= (fragSize % blockSize); // cannot hold a block + // No padding for a maximum fragment. + fragSize -= 1; // 1 byte padding length field: 0x00 + fragSize -= macAlg.size; - break; - case AEAD_CIPHER: - fragSize -= cipher.tagSize; - fragSize -= cipher.ivSize - cipher.fixedIvSize; // record IV + break; + case AEAD_CIPHER: + fragSize -= bulkCipher.tagSize; + fragSize -= bulkCipher.ivSize - bulkCipher.fixedIvSize; - break; - default: // NULL_CIPHER or STREAM_CIPHER - fragSize -= macAlg.size; + break; + default: // NULL_CIPHER or STREAM_CIPHER + fragSize -= macAlg.size; } } @@ -245,172 +1016,48 @@ } /** - * Compares CipherSuites based on their priority. Has the effect of - * sorting CipherSuites when put in a sorted collection, which is - * used by CipherSuiteList. Follows standard Comparable contract. - * - * Note that for unsupported CipherSuites parsed from a handshake - * message we violate the equals() contract. - */ - @Override - public int compareTo(CipherSuite o) { - return o.priority - priority; - } - - /** - * Returns this.name. - */ - @Override - public String toString() { - return name; - } - - /** - * Return a CipherSuite for the given name. The returned CipherSuite - * is supported by this implementation but may not actually be - * currently useable. See isAvailable(). - * - * @exception IllegalArgumentException if the CipherSuite is unknown or - * unsupported. - */ - static CipherSuite valueOf(String s) { - if (s == null) { - throw new IllegalArgumentException("Name must not be null"); - } - - CipherSuite c = nameMap.get(s); - if ((c == null) || (c.allowed == false)) { - throw new IllegalArgumentException("Unsupported ciphersuite " + s); - } - - return c; - } - - /** - * Return a CipherSuite with the given ID. A temporary object is - * constructed if the ID is unknown. Use isAvailable() to verify that - * the CipherSuite can actually be used. - */ - static CipherSuite valueOf(int id1, int id2) { - id1 &= 0xff; - id2 &= 0xff; - int id = (id1 << 8) | id2; - CipherSuite c = idMap.get(id); - if (c == null) { - String h1 = Integer.toString(id1, 16); - String h2 = Integer.toString(id2, 16); - c = new CipherSuite("Unknown 0x" + h1 + ":0x" + h2, id); - } - return c; - } - - // for use by SSLContextImpl only - static Collection<CipherSuite> allowedCipherSuites() { - return nameMap.values(); - } - - /* - * Use this method when all of the values need to be specified. - * This is primarily used when defining a new ciphersuite for - * TLS 1.2+ that doesn't use the "default" PRF. - */ - private static void add(String name, int id, int priority, - KeyExchange keyExchange, BulkCipher cipher, MacAlg mac, - boolean allowed, int obsoleted, int supported, PRF prf) { - - CipherSuite c = new CipherSuite(name, id, priority, keyExchange, - cipher, mac, allowed, obsoleted, supported, prf); - if (idMap.put(id, c) != null) { - throw new RuntimeException("Duplicate ciphersuite definition: " - + id + ", " + name); - } - if (c.allowed) { - if (nameMap.put(name, c) != null) { - throw new RuntimeException("Duplicate ciphersuite definition: " - + id + ", " + name); - } - } - } - - /* - * Use this method when there is no lower protocol limit where this - * suite can be used, and the PRF is P_SHA256. That is, the - * existing ciphersuites. From RFC 5246: - * - * All cipher suites in this document use P_SHA256. - */ - private static void add(String name, int id, int priority, - KeyExchange keyExchange, BulkCipher cipher, MacAlg mac, - boolean allowed, int obsoleted) { - PRF prf = obsoleted < ProtocolVersion.TLS12.v ? P_NONE : P_SHA256; - - add(name, id, priority, keyExchange, cipher, mac, allowed, obsoleted, - ProtocolVersion.LIMIT_MIN_VALUE, prf); - } - - /* - * Use this method when there is no upper protocol limit. That is, - * suites which have not been obsoleted. - */ - private static void add(String name, int id, int priority, - KeyExchange keyExchange, BulkCipher cipher, MacAlg mac, - boolean allowed) { - add(name, id, priority, keyExchange, cipher, mac, allowed, - ProtocolVersion.LIMIT_MAX_VALUE); - } - - /* - * Use this method to define an unimplemented suite. This provides - * a number<->name mapping that can be used for debugging. - */ - private static void add(String name, int id) { - CipherSuite c = new CipherSuite(name, id); - if (idMap.put(id, c) != null) { - throw new RuntimeException("Duplicate ciphersuite definition: " - + id + ", " + name); - } - } - - /** * An SSL/TLS key exchange algorithm. */ static enum KeyExchange { - - // key exchange algorithms - K_NULL ("NULL", false, NAMED_GROUP_NONE), - K_RSA ("RSA", true, NAMED_GROUP_NONE), - K_RSA_EXPORT ("RSA_EXPORT", true, NAMED_GROUP_NONE), - K_DH_RSA ("DH_RSA", false, NAMED_GROUP_NONE), - K_DH_DSS ("DH_DSS", false, NAMED_GROUP_NONE), - K_DHE_DSS ("DHE_DSS", true, NAMED_GROUP_FFDHE), - K_DHE_RSA ("DHE_RSA", true, NAMED_GROUP_FFDHE), - K_DH_ANON ("DH_anon", true, NAMED_GROUP_FFDHE), - - K_ECDH_ECDSA ("ECDH_ECDSA", ALLOW_ECC, NAMED_GROUP_ECDHE), - K_ECDH_RSA ("ECDH_RSA", ALLOW_ECC, NAMED_GROUP_ECDHE), - K_ECDHE_ECDSA("ECDHE_ECDSA", ALLOW_ECC, NAMED_GROUP_ECDHE), - K_ECDHE_RSA ("ECDHE_RSA", ALLOW_ECC, NAMED_GROUP_ECDHE), - K_ECDH_ANON ("ECDH_anon", ALLOW_ECC, NAMED_GROUP_ECDHE), - - // Kerberos cipher suites - K_KRB5 ("KRB5", true, NAMED_GROUP_NONE), - K_KRB5_EXPORT("KRB5_EXPORT", true, NAMED_GROUP_NONE), + K_NULL ("NULL", false, true, NAMED_GROUP_NONE), + K_RSA ("RSA", true, false, NAMED_GROUP_NONE), + K_RSA_EXPORT ("RSA_EXPORT", true, false, NAMED_GROUP_NONE), + K_DH_RSA ("DH_RSA", false, false, NAMED_GROUP_NONE), + K_DH_DSS ("DH_DSS", false, false, NAMED_GROUP_NONE), + K_DHE_DSS ("DHE_DSS", true, false, NAMED_GROUP_FFDHE), + K_DHE_DSS_EXPORT("DHE_DSS_EXPORT", true, false, NAMED_GROUP_NONE), + K_DHE_RSA ("DHE_RSA", true, false, NAMED_GROUP_FFDHE), + K_DHE_RSA_EXPORT("DHE_RSA_EXPORT", true, false, NAMED_GROUP_NONE), + K_DH_ANON ("DH_anon", true, true, NAMED_GROUP_FFDHE), + K_DH_ANON_EXPORT("DH_anon_EXPORT", true, true, NAMED_GROUP_NONE), + + K_ECDH_ECDSA ("ECDH_ECDSA", true, false, NAMED_GROUP_ECDHE), + K_ECDH_RSA ("ECDH_RSA", true, false, NAMED_GROUP_ECDHE), + K_ECDHE_ECDSA ("ECDHE_ECDSA", true, false, NAMED_GROUP_ECDHE), + K_ECDHE_RSA ("ECDHE_RSA", true, false, NAMED_GROUP_ECDHE), + K_ECDH_ANON ("ECDH_anon", true, true, NAMED_GROUP_ECDHE), // renegotiation protection request signaling cipher suite - K_SCSV ("SCSV", true, NAMED_GROUP_NONE); + K_SCSV ("SCSV", true, true, NAMED_GROUP_NONE); // name of the key exchange algorithm, e.g. DHE_DSS final String name; final boolean allowed; final NamedGroupType groupType; private final boolean alwaysAvailable; + private final boolean isAnonymous; - KeyExchange(String name, boolean allowed, NamedGroupType groupType) { + KeyExchange(String name, boolean allowed, + boolean isAnonymous, NamedGroupType groupType) { this.name = name; - this.allowed = allowed; + if (groupType == NAMED_GROUP_ECDHE) { + this.allowed = JsseJce.ALLOW_ECC; + } else { + this.allowed = allowed; + } this.groupType = groupType; - this.alwaysAvailable = allowed && - (!name.startsWith("EC")) && (!name.startsWith("KRB")); + this.alwaysAvailable = allowed && (!name.startsWith("EC")); + this.isAnonymous = isAnonymous; } boolean isAvailable() { @@ -420,8 +1067,6 @@ if (groupType == NAMED_GROUP_ECDHE) { return (allowed && JsseJce.isEcAvailable()); - } else if (name.startsWith("KRB")) { - return (allowed && JsseJce.isKerberosAvailable()); } else { return allowed; } @@ -433,192 +1078,6 @@ } } - static enum CipherType { - NULL_CIPHER, // null cipher - STREAM_CIPHER, // stream cipher - BLOCK_CIPHER, // block cipher in CBC mode - AEAD_CIPHER // AEAD cipher - } - - /** - * An SSL/TLS bulk cipher algorithm. One instance per combination of - * cipher and key length. - * - * Also contains a factory method to obtain in initialized CipherBox - * for this algorithm. - */ - static enum BulkCipher { - - // export strength ciphers - B_NULL("NULL", NULL_CIPHER, 0, 0, 0, 0, true), - B_RC4_40(CIPHER_RC4, STREAM_CIPHER, 5, 16, 0, 0, true), - B_RC2_40("RC2", BLOCK_CIPHER, 5, 16, 8, 0, false), - B_DES_40(CIPHER_DES, BLOCK_CIPHER, 5, 8, 8, 0, true), - - // domestic strength ciphers - B_RC4_128(CIPHER_RC4, STREAM_CIPHER, 16, 0, 0, true), - B_DES(CIPHER_DES, BLOCK_CIPHER, 8, 8, 0, true), - B_3DES(CIPHER_3DES, BLOCK_CIPHER, 24, 8, 0, true), - B_IDEA("IDEA", BLOCK_CIPHER, 16, 8, 0, false), - B_AES_128(CIPHER_AES, BLOCK_CIPHER, 16, 16, 0, true), - B_AES_256(CIPHER_AES, BLOCK_CIPHER, 32, 16, 0, true), - B_AES_128_GCM(CIPHER_AES_GCM, AEAD_CIPHER, 16, 12, 4, true), - B_AES_256_GCM(CIPHER_AES_GCM, AEAD_CIPHER, 32, 12, 4, true); - - // descriptive name including key size, e.g. AES/128 - final String description; - - // JCE cipher transformation string, e.g. AES/CBC/NoPadding - final String transformation; - - // algorithm name, e.g. AES - final String algorithm; - - // supported and compile time enabled. Also see isAvailable() - final boolean allowed; - - // number of bytes of entropy in the key - final int keySize; - - // length of the actual cipher key in bytes. - // for non-exportable ciphers, this is the same as keySize - final int expandedKeySize; - - // size of the IV - final int ivSize; - - // size of fixed IV - // - // record_iv_length = ivSize - fixedIvSize - final int fixedIvSize; - - // exportable under 512/40 bit rules - final boolean exportable; - - // Is the cipher algorithm of Cipher Block Chaining (CBC) mode? - final CipherType cipherType; - - // size of the authentication tag, only applicable to cipher suites in - // Galois Counter Mode (GCM) - // - // As far as we know, all supported GCM cipher suites use 128-bits - // authentication tags. - final int tagSize = 16; - - // The secure random used to detect the cipher availability. - private static final SecureRandom secureRandom; - - // runtime availability - private final boolean isAvailable; - - static { - try { - secureRandom = JsseJce.getSecureRandom(); - } catch (KeyManagementException kme) { - throw new RuntimeException(kme); - } - } - - BulkCipher(String transformation, CipherType cipherType, int keySize, - int expandedKeySize, int ivSize, - int fixedIvSize, boolean allowed) { - - this.transformation = transformation; - String[] splits = transformation.split("/"); - this.algorithm = splits[0]; - this.cipherType = cipherType; - this.description = this.algorithm + "/" + (keySize << 3); - this.keySize = keySize; - this.ivSize = ivSize; - this.fixedIvSize = fixedIvSize; - this.allowed = allowed; - - this.expandedKeySize = expandedKeySize; - this.exportable = true; - - // availability of this bulk cipher - // - // Currently all supported ciphers except AES are always available - // via the JSSE internal implementations. We also assume AES/128 of - // CBC mode is always available since it is shipped with the SunJCE - // provider. However, AES/256 is unavailable when the default JCE - // policy jurisdiction files are installed because of key length - // restrictions. - this.isAvailable = - allowed ? isUnlimited(keySize, transformation) : false; - } - - BulkCipher(String transformation, CipherType cipherType, int keySize, - int ivSize, int fixedIvSize, boolean allowed) { - this.transformation = transformation; - String[] splits = transformation.split("/"); - this.algorithm = splits[0]; - this.cipherType = cipherType; - this.description = this.algorithm + "/" + (keySize << 3); - this.keySize = keySize; - this.ivSize = ivSize; - this.fixedIvSize = fixedIvSize; - this.allowed = allowed; - - this.expandedKeySize = keySize; - this.exportable = false; - - // availability of this bulk cipher - // - // Currently all supported ciphers except AES are always available - // via the JSSE internal implementations. We also assume AES/128 of - // CBC mode is always available since it is shipped with the SunJCE - // provider. However, AES/256 is unavailable when the default JCE - // policy jurisdiction files are installed because of key length - // restrictions. - this.isAvailable = - allowed ? isUnlimited(keySize, transformation) : false; - } - - /** - * Return an initialized CipherBox for this BulkCipher. - * IV must be null for stream ciphers. - * - * @exception NoSuchAlgorithmException if anything goes wrong - */ - CipherBox newCipher(ProtocolVersion version, SecretKey key, - IvParameterSpec iv, SecureRandom random, - boolean encrypt) throws NoSuchAlgorithmException { - return CipherBox.newCipherBox(version, this, - key, iv, random, encrypt); - } - - /** - * Test if this bulk cipher is available. For use by CipherSuite. - */ - boolean isAvailable() { - return this.isAvailable; - } - - private static boolean isUnlimited(int keySize, String transformation) { - int keySizeInBits = keySize * 8; - if (keySizeInBits > 128) { // need the JCE unlimited - // strength jurisdiction policy - try { - if (Cipher.getMaxAllowedKeyLength( - transformation) < keySizeInBits) { - - return false; - } - } catch (Exception e) { - return false; - } - } - - return true; - } - - @Override - public String toString() { - return description; - } - } - /** * An SSL/TLS key MAC algorithm. * @@ -626,7 +1085,6 @@ * for this algorithm. */ static enum MacAlg { - // MACs M_NULL ("NULL", 0, 0, 0), M_MD5 ("MD5", 16, 64, 9), M_SHA ("SHA", 20, 64, 9), @@ -653,17 +1111,6 @@ this.minimalPaddingSize = minimalPaddingSize; } - /** - * Return an initialized MAC for this MacAlg. ProtocolVersion - * must either be SSL30 (SSLv3 custom MAC) or TLS10 (std. HMAC). - * - * @exception NoSuchAlgorithmException if anything goes wrong - */ - MAC newMac(ProtocolVersion protocolVersion, SecretKey secret) - throws NoSuchAlgorithmException, InvalidKeyException { - return new MAC(this, protocolVersion, secret); - } - @Override public String toString() { return name; @@ -671,975 +1118,29 @@ } /** - * PRFs (PseudoRandom Function) from TLS specifications. + * The hash algorithms used for PRF (PseudoRandom Function) or HKDF. * - * TLS 1.1- uses a single MD5/SHA1-based PRF algorithm for generating - * the necessary material. - * - * In TLS 1.2+, all existing/known CipherSuites use SHA256, however - * new Ciphersuites (e.g. RFC 5288) can define specific PRF hash - * algorithms. + * Note that TLS 1.1- uses a single MD5/SHA1-based PRF algorithm for + * generating the necessary material. */ - static enum PRF { - - // PRF algorithms - P_NONE( "NONE", 0, 0), - P_SHA256("SHA-256", 32, 64), - P_SHA384("SHA-384", 48, 128), - P_SHA512("SHA-512", 64, 128); // not currently used. - - // PRF characteristics - private final String prfHashAlg; - private final int prfHashLength; - private final int prfBlockSize; - - PRF(String prfHashAlg, int prfHashLength, int prfBlockSize) { - this.prfHashAlg = prfHashAlg; - this.prfHashLength = prfHashLength; - this.prfBlockSize = prfBlockSize; - } + static enum HashAlg { + H_NONE ("NONE", 0, 0), + H_SHA256 ("SHA-256", 32, 64), + H_SHA384 ("SHA-384", 48, 128); - String getPRFHashAlg() { - return prfHashAlg; - } + final String name; + final int hashLength; + final int blockSize; - int getPRFHashLength() { - return prfHashLength; + HashAlg(String hashAlg, int hashLength, int blockSize) { + this.name = hashAlg; + this.hashLength = hashLength; + this.blockSize = blockSize; } - int getPRFBlockSize() { - return prfBlockSize; + @Override + public String toString() { + return name; } } - - static { - idMap = new HashMap<Integer,CipherSuite>(); - nameMap = new HashMap<String,CipherSuite>(); - - final boolean F = false; - final boolean T = true; - // N: ciphersuites only allowed if we are not in FIPS mode - final boolean N = (SunJSSE.isFIPS() == false); - - /* - * TLS Cipher Suite Registry, as of November 2015. - * - * http://www.iana.org/assignments/tls-parameters/tls-parameters.xml - * - * Range Registration Procedures Notes - * 000-191 Standards Action Refers to value of first byte - * 192-254 Specification Required Refers to value of first byte - * 255 Reserved for Private Use Refers to value of first byte - * - * Value Description Reference - * 0x00,0x00 TLS_NULL_WITH_NULL_NULL [RFC5246] - * 0x00,0x01 TLS_RSA_WITH_NULL_MD5 [RFC5246] - * 0x00,0x02 TLS_RSA_WITH_NULL_SHA [RFC5246] - * 0x00,0x03 TLS_RSA_EXPORT_WITH_RC4_40_MD5 [RFC4346] - * 0x00,0x04 TLS_RSA_WITH_RC4_128_MD5 [RFC5246] - * 0x00,0x05 TLS_RSA_WITH_RC4_128_SHA [RFC5246] - * 0x00,0x06 TLS_RSA_EXPORT_WITH_RC2_CBC_40_MD5 [RFC4346] - * 0x00,0x07 TLS_RSA_WITH_IDEA_CBC_SHA [RFC5469] - * 0x00,0x08 TLS_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346] - * 0x00,0x09 TLS_RSA_WITH_DES_CBC_SHA [RFC5469] - * 0x00,0x0A TLS_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246] - * 0x00,0x0B TLS_DH_DSS_EXPORT_WITH_DES40_CBC_SHA [RFC4346] - * 0x00,0x0C TLS_DH_DSS_WITH_DES_CBC_SHA [RFC5469] - * 0x00,0x0D TLS_DH_DSS_WITH_3DES_EDE_CBC_SHA [RFC5246] - * 0x00,0x0E TLS_DH_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346] - * 0x00,0x0F TLS_DH_RSA_WITH_DES_CBC_SHA [RFC5469] - * 0x00,0x10 TLS_DH_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246] - * 0x00,0x11 TLS_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA [RFC4346] - * 0x00,0x12 TLS_DHE_DSS_WITH_DES_CBC_SHA [RFC5469] - * 0x00,0x13 TLS_DHE_DSS_WITH_3DES_EDE_CBC_SHA [RFC5246] - * 0x00,0x14 TLS_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA [RFC4346] - * 0x00,0x15 TLS_DHE_RSA_WITH_DES_CBC_SHA [RFC5469] - * 0x00,0x16 TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA [RFC5246] - * 0x00,0x17 TLS_DH_anon_EXPORT_WITH_RC4_40_MD5 [RFC4346] - * 0x00,0x18 TLS_DH_anon_WITH_RC4_128_MD5 [RFC5246] - * 0x00,0x19 TLS_DH_anon_EXPORT_WITH_DES40_CBC_SHA [RFC4346] - * 0x00,0x1A TLS_DH_anon_WITH_DES_CBC_SHA [RFC5469] - * 0x00,0x1B TLS_DH_anon_WITH_3DES_EDE_CBC_SHA [RFC5246] - * 0x00,0x1C-1D Reserved to avoid conflicts with SSLv3 [RFC5246] - * 0x00,0x1E TLS_KRB5_WITH_DES_CBC_SHA [RFC2712] - * 0x00,0x1F TLS_KRB5_WITH_3DES_EDE_CBC_SHA [RFC2712] - * 0x00,0x20 TLS_KRB5_WITH_RC4_128_SHA [RFC2712] - * 0x00,0x21 TLS_KRB5_WITH_IDEA_CBC_SHA [RFC2712] - * 0x00,0x22 TLS_KRB5_WITH_DES_CBC_MD5 [RFC2712] - * 0x00,0x23 TLS_KRB5_WITH_3DES_EDE_CBC_MD5 [RFC2712] - * 0x00,0x24 TLS_KRB5_WITH_RC4_128_MD5 [RFC2712] - * 0x00,0x25 TLS_KRB5_WITH_IDEA_CBC_MD5 [RFC2712] - * 0x00,0x26 TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA [RFC2712] - * 0x00,0x27 TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA [RFC2712] - * 0x00,0x28 TLS_KRB5_EXPORT_WITH_RC4_40_SHA [RFC2712] - * 0x00,0x29 TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 [RFC2712] - * 0x00,0x2A TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5 [RFC2712] - * 0x00,0x2B TLS_KRB5_EXPORT_WITH_RC4_40_MD5 [RFC2712] - * 0x00,0x2C TLS_PSK_WITH_NULL_SHA [RFC4785] - * 0x00,0x2D TLS_DHE_PSK_WITH_NULL_SHA [RFC4785] - * 0x00,0x2E TLS_RSA_PSK_WITH_NULL_SHA [RFC4785] - * 0x00,0x2F TLS_RSA_WITH_AES_128_CBC_SHA [RFC5246] - * 0x00,0x30 TLS_DH_DSS_WITH_AES_128_CBC_SHA [RFC5246] - * 0x00,0x31 TLS_DH_RSA_WITH_AES_128_CBC_SHA [RFC5246] - * 0x00,0x32 TLS_DHE_DSS_WITH_AES_128_CBC_SHA [RFC5246] - * 0x00,0x33 TLS_DHE_RSA_WITH_AES_128_CBC_SHA [RFC5246] - * 0x00,0x34 TLS_DH_anon_WITH_AES_128_CBC_SHA [RFC5246] - * 0x00,0x35 TLS_RSA_WITH_AES_256_CBC_SHA [RFC5246] - * 0x00,0x36 TLS_DH_DSS_WITH_AES_256_CBC_SHA [RFC5246] - * 0x00,0x37 TLS_DH_RSA_WITH_AES_256_CBC_SHA [RFC5246] - * 0x00,0x38 TLS_DHE_DSS_WITH_AES_256_CBC_SHA [RFC5246] - * 0x00,0x39 TLS_DHE_RSA_WITH_AES_256_CBC_SHA [RFC5246] - * 0x00,0x3A TLS_DH_anon_WITH_AES_256_CBC_SHA [RFC5246] - * 0x00,0x3B TLS_RSA_WITH_NULL_SHA256 [RFC5246] - * 0x00,0x3C TLS_RSA_WITH_AES_128_CBC_SHA256 [RFC5246] - * 0x00,0x3D TLS_RSA_WITH_AES_256_CBC_SHA256 [RFC5246] - * 0x00,0x3E TLS_DH_DSS_WITH_AES_128_CBC_SHA256 [RFC5246] - * 0x00,0x3F TLS_DH_RSA_WITH_AES_128_CBC_SHA256 [RFC5246] - * 0x00,0x40 TLS_DHE_DSS_WITH_AES_128_CBC_SHA256 [RFC5246] - * 0x00,0x41 TLS_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932] - * 0x00,0x42 TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA [RFC5932] - * 0x00,0x43 TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932] - * 0x00,0x44 TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA [RFC5932] - * 0x00,0x45 TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA [RFC5932] - * 0x00,0x46 TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA [RFC5932] - * 0x00,0x47-4F Reserved to avoid conflicts with - * deployed implementations [Pasi_Eronen] - * 0x00,0x50-58 Reserved to avoid conflicts [Pasi Eronen] - * 0x00,0x59-5C Reserved to avoid conflicts with - * deployed implementations [Pasi_Eronen] - * 0x00,0x5D-5F Unassigned - * 0x00,0x60-66 Reserved to avoid conflicts with widely - * deployed implementations [Pasi_Eronen] - * 0x00,0x67 TLS_DHE_RSA_WITH_AES_128_CBC_SHA256 [RFC5246] - * 0x00,0x68 TLS_DH_DSS_WITH_AES_256_CBC_SHA256 [RFC5246] - * 0x00,0x69 TLS_DH_RSA_WITH_AES_256_CBC_SHA256 [RFC5246] - * 0x00,0x6A TLS_DHE_DSS_WITH_AES_256_CBC_SHA256 [RFC5246] - * 0x00,0x6B TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 [RFC5246] - * 0x00,0x6C TLS_DH_anon_WITH_AES_128_CBC_SHA256 [RFC5246] - * 0x00,0x6D TLS_DH_anon_WITH_AES_256_CBC_SHA256 [RFC5246] - * 0x00,0x6E-83 Unassigned - * 0x00,0x84 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932] - * 0x00,0x85 TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA [RFC5932] - * 0x00,0x86 TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932] - * 0x00,0x87 TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA [RFC5932] - * 0x00,0x88 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA [RFC5932] - * 0x00,0x89 TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA [RFC5932] - * 0x00,0x8A TLS_PSK_WITH_RC4_128_SHA [RFC4279] - * 0x00,0x8B TLS_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279] - * 0x00,0x8C TLS_PSK_WITH_AES_128_CBC_SHA [RFC4279] - * 0x00,0x8D TLS_PSK_WITH_AES_256_CBC_SHA [RFC4279] - * 0x00,0x8E TLS_DHE_PSK_WITH_RC4_128_SHA [RFC4279] - * 0x00,0x8F TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279] - * 0x00,0x90 TLS_DHE_PSK_WITH_AES_128_CBC_SHA [RFC4279] - * 0x00,0x91 TLS_DHE_PSK_WITH_AES_256_CBC_SHA [RFC4279] - * 0x00,0x92 TLS_RSA_PSK_WITH_RC4_128_SHA [RFC4279] - * 0x00,0x93 TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA [RFC4279] - * 0x00,0x94 TLS_RSA_PSK_WITH_AES_128_CBC_SHA [RFC4279] - * 0x00,0x95 TLS_RSA_PSK_WITH_AES_256_CBC_SHA [RFC4279] - * 0x00,0x96 TLS_RSA_WITH_SEED_CBC_SHA [RFC4162] - * 0x00,0x97 TLS_DH_DSS_WITH_SEED_CBC_SHA [RFC4162] - * 0x00,0x98 TLS_DH_RSA_WITH_SEED_CBC_SHA [RFC4162] - * 0x00,0x99 TLS_DHE_DSS_WITH_SEED_CBC_SHA [RFC4162] - * 0x00,0x9A TLS_DHE_RSA_WITH_SEED_CBC_SHA [RFC4162] - * 0x00,0x9B TLS_DH_anon_WITH_SEED_CBC_SHA [RFC4162] - * 0x00,0x9C TLS_RSA_WITH_AES_128_GCM_SHA256 [RFC5288] - * 0x00,0x9D TLS_RSA_WITH_AES_256_GCM_SHA384 [RFC5288] - * 0x00,0x9E TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 [RFC5288] - * 0x00,0x9F TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 [RFC5288] - * 0x00,0xA0 TLS_DH_RSA_WITH_AES_128_GCM_SHA256 [RFC5288] - * 0x00,0xA1 TLS_DH_RSA_WITH_AES_256_GCM_SHA384 [RFC5288] - * 0x00,0xA2 TLS_DHE_DSS_WITH_AES_128_GCM_SHA256 [RFC5288] - * 0x00,0xA3 TLS_DHE_DSS_WITH_AES_256_GCM_SHA384 [RFC5288] - * 0x00,0xA4 TLS_DH_DSS_WITH_AES_128_GCM_SHA256 [RFC5288] - * 0x00,0xA5 TLS_DH_DSS_WITH_AES_256_GCM_SHA384 [RFC5288] - * 0x00,0xA6 TLS_DH_anon_WITH_AES_128_GCM_SHA256 [RFC5288] - * 0x00,0xA7 TLS_DH_anon_WITH_AES_256_GCM_SHA384 [RFC5288] - * 0x00,0xA8 TLS_PSK_WITH_AES_128_GCM_SHA256 [RFC5487] - * 0x00,0xA9 TLS_PSK_WITH_AES_256_GCM_SHA384 [RFC5487] - * 0x00,0xAA TLS_DHE_PSK_WITH_AES_128_GCM_SHA256 [RFC5487] - * 0x00,0xAB TLS_DHE_PSK_WITH_AES_256_GCM_SHA384 [RFC5487] - * 0x00,0xAC TLS_RSA_PSK_WITH_AES_128_GCM_SHA256 [RFC5487] - * 0x00,0xAD TLS_RSA_PSK_WITH_AES_256_GCM_SHA384 [RFC5487] - * 0x00,0xAE TLS_PSK_WITH_AES_128_CBC_SHA256 [RFC5487] - * 0x00,0xAF TLS_PSK_WITH_AES_256_CBC_SHA384 [RFC5487] - * 0x00,0xB0 TLS_PSK_WITH_NULL_SHA256 [RFC5487] - * 0x00,0xB1 TLS_PSK_WITH_NULL_SHA384 [RFC5487] - * 0x00,0xB2 TLS_DHE_PSK_WITH_AES_128_CBC_SHA256 [RFC5487] - * 0x00,0xB3 TLS_DHE_PSK_WITH_AES_256_CBC_SHA384 [RFC5487] - * 0x00,0xB4 TLS_DHE_PSK_WITH_NULL_SHA256 [RFC5487] - * 0x00,0xB5 TLS_DHE_PSK_WITH_NULL_SHA384 [RFC5487] - * 0x00,0xB6 TLS_RSA_PSK_WITH_AES_128_CBC_SHA256 [RFC5487] - * 0x00,0xB7 TLS_RSA_PSK_WITH_AES_256_CBC_SHA384 [RFC5487] - * 0x00,0xB8 TLS_RSA_PSK_WITH_NULL_SHA256 [RFC5487] - * 0x00,0xB9 TLS_RSA_PSK_WITH_NULL_SHA384 [RFC5487] - * 0x00,0xBA TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] - * 0x00,0xBB TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] - * 0x00,0xBC TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] - * 0x00,0xBD TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] - * 0x00,0xBE TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] - * 0x00,0xBF TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256 [RFC5932] - * 0x00,0xC0 TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] - * 0x00,0xC1 TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] - * 0x00,0xC2 TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] - * 0x00,0xC3 TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] - * 0x00,0xC4 TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] - * 0x00,0xC5 TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256 [RFC5932] - * 0x00,0xC6-FE Unassigned - * 0x00,0xFF TLS_EMPTY_RENEGOTIATION_INFO_SCSV [RFC5746] - * 0x01-55,* Unassigned - * 0x56,0x00 TLS_FALLBACK_SCSV [RFC7507] - * 0x56,0x01-0xC0,0x00 Unassigned - * 0xC0,0x01 TLS_ECDH_ECDSA_WITH_NULL_SHA [RFC4492] - * 0xC0,0x02 TLS_ECDH_ECDSA_WITH_RC4_128_SHA [RFC4492] - * 0xC0,0x03 TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA [RFC4492] - * 0xC0,0x04 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA [RFC4492] - * 0xC0,0x05 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA [RFC4492] - * 0xC0,0x06 TLS_ECDHE_ECDSA_WITH_NULL_SHA [RFC4492] - * 0xC0,0x07 TLS_ECDHE_ECDSA_WITH_RC4_128_SHA [RFC4492] - * 0xC0,0x08 TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA [RFC4492] - * 0xC0,0x09 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA [RFC4492] - * 0xC0,0x0A TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA [RFC4492] - * 0xC0,0x0B TLS_ECDH_RSA_WITH_NULL_SHA [RFC4492] - * 0xC0,0x0C TLS_ECDH_RSA_WITH_RC4_128_SHA [RFC4492] - * 0xC0,0x0D TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA [RFC4492] - * 0xC0,0x0E TLS_ECDH_RSA_WITH_AES_128_CBC_SHA [RFC4492] - * 0xC0,0x0F TLS_ECDH_RSA_WITH_AES_256_CBC_SHA [RFC4492] - * 0xC0,0x10 TLS_ECDHE_RSA_WITH_NULL_SHA [RFC4492] - * 0xC0,0x11 TLS_ECDHE_RSA_WITH_RC4_128_SHA [RFC4492] - * 0xC0,0x12 TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA [RFC4492] - * 0xC0,0x13 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA [RFC4492] - * 0xC0,0x14 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA [RFC4492] - * 0xC0,0x15 TLS_ECDH_anon_WITH_NULL_SHA [RFC4492] - * 0xC0,0x16 TLS_ECDH_anon_WITH_RC4_128_SHA [RFC4492] - * 0xC0,0x17 TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA [RFC4492] - * 0xC0,0x18 TLS_ECDH_anon_WITH_AES_128_CBC_SHA [RFC4492] - * 0xC0,0x19 TLS_ECDH_anon_WITH_AES_256_CBC_SHA [RFC4492] - * 0xC0,0x1A TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA [RFC5054] - * 0xC0,0x1B TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA [RFC5054] - * 0xC0,0x1C TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA [RFC5054] - * 0xC0,0x1D TLS_SRP_SHA_WITH_AES_128_CBC_SHA [RFC5054] - * 0xC0,0x1E TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA [RFC5054] - * 0xC0,0x1F TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA [RFC5054] - * 0xC0,0x20 TLS_SRP_SHA_WITH_AES_256_CBC_SHA [RFC5054] - * 0xC0,0x21 TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA [RFC5054] - * 0xC0,0x22 TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA [RFC5054] - * 0xC0,0x23 TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 [RFC5289] - * 0xC0,0x24 TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 [RFC5289] - * 0xC0,0x25 TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256 [RFC5289] - * 0xC0,0x26 TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384 [RFC5289] - * 0xC0,0x27 TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 [RFC5289] - * 0xC0,0x28 TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 [RFC5289] - * 0xC0,0x29 TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256 [RFC5289] - * 0xC0,0x2A TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384 [RFC5289] - * 0xC0,0x2B TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 [RFC5289] - * 0xC0,0x2C TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 [RFC5289] - * 0xC0,0x2D TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256 [RFC5289] - * 0xC0,0x2E TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384 [RFC5289] - * 0xC0,0x2F TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 [RFC5289] - * 0xC0,0x30 TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 [RFC5289] - * 0xC0,0x31 TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256 [RFC5289] - * 0xC0,0x32 TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384 [RFC5289] - * 0xC0,0x33 TLS_ECDHE_PSK_WITH_RC4_128_SHA [RFC5489] - * 0xC0,0x34 TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA [RFC5489] - * 0xC0,0x35 TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA [RFC5489] - * 0xC0,0x36 TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA [RFC5489] - * 0xC0,0x37 TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256 [RFC5489] - * 0xC0,0x38 TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384 [RFC5489] - * 0xC0,0x39 TLS_ECDHE_PSK_WITH_NULL_SHA [RFC5489] - * 0xC0,0x3A TLS_ECDHE_PSK_WITH_NULL_SHA256 [RFC5489] - * 0xC0,0x3B TLS_ECDHE_PSK_WITH_NULL_SHA384 [RFC5489] - * 0xC0,0x3C TLS_RSA_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x3D TLS_RSA_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x3E TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x3F TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x40 TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x41 TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x42 TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x43 TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x44 TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x45 TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x46 TLS_DH_anon_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x47 TLS_DH_anon_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x48 TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x49 TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x4A TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x4B TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x4C TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x4D TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x4E TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x4F TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x50 TLS_RSA_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x51 TLS_RSA_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x52 TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x53 TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x54 TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x55 TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x56 TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x57 TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x58 TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x59 TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x5A TLS_DH_anon_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x5B TLS_DH_anon_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x5C TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x5D TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x5E TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x5F TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x60 TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x61 TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x62 TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x63 TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x64 TLS_PSK_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x65 TLS_PSK_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x66 TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x67 TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x68 TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x69 TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x6A TLS_PSK_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x6B TLS_PSK_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x6C TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x6D TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x6E TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256 [RFC6209] - * 0xC0,0x6F TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384 [RFC6209] - * 0xC0,0x70 TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256 [RFC6209] - * 0xC0,0x71 TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384 [RFC6209] - * 0xC0,0x72 TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC6367] - * 0xC0,0x73 TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 [RFC6367] - * 0xC0,0x74 TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC6367] - * 0xC0,0x75 TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384 [RFC6367] - * 0xC0,0x76 TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC6367] - * 0xC0,0x77 TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384 [RFC6367] - * 0xC0,0x78 TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256 [RFC6367] - * 0xC0,0x79 TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384 [RFC6367] - * 0xC0,0x7A TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x7B TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x7C TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x7D TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x7E TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x7F TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x80 TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x81 TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x82 TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x83 TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x84 TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x85 TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x86 TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x87 TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x88 TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x89 TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x8A TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x8B TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x8C TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x8D TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x8E TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x8F TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x90 TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x91 TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x92 TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256 [RFC6367] - * 0xC0,0x93 TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384 [RFC6367] - * 0xC0,0x94 TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256 [RFC6367] - * 0xC0,0x95 TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384 [RFC6367] - * 0xC0,0x96 TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 [RFC6367] - * 0xC0,0x97 TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 [RFC6367] - * 0xC0,0x98 TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256 [RFC6367] - * 0xC0,0x99 TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384 [RFC6367] - * 0xC0,0x9A TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256 [RFC6367] - * 0xC0,0x9B TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384 [RFC6367] - * 0xC0,0x9C TLS_RSA_WITH_AES_128_CCM [RFC6655] - * 0xC0,0x9D TLS_RSA_WITH_AES_256_CCM [RFC6655] - * 0xC0,0x9E TLS_DHE_RSA_WITH_AES_128_CCM [RFC6655] - * 0xC0,0x9F TLS_DHE_RSA_WITH_AES_256_CCM [RFC6655] - * 0xC0,0xA0 TLS_RSA_WITH_AES_128_CCM_8 [RFC6655] - * 0xC0,0xA1 TLS_RSA_WITH_AES_256_CCM_8 [RFC6655] - * 0xC0,0xA2 TLS_DHE_RSA_WITH_AES_128_CCM_8 [RFC6655] - * 0xC0,0xA3 TLS_DHE_RSA_WITH_AES_256_CCM_8 [RFC6655] - * 0xC0,0xA4 TLS_PSK_WITH_AES_128_CCM [RFC6655] - * 0xC0,0xA5 TLS_PSK_WITH_AES_256_CCM [RFC6655] - * 0xC0,0xA6 TLS_DHE_PSK_WITH_AES_128_CCM [RFC6655] - * 0xC0,0xA7 TLS_DHE_PSK_WITH_AES_256_CCM [RFC6655] - * 0xC0,0xA8 TLS_PSK_WITH_AES_128_CCM_8 [RFC6655] - * 0xC0,0xA9 TLS_PSK_WITH_AES_256_CCM_8 [RFC6655] - * 0xC0,0xAA TLS_PSK_DHE_WITH_AES_128_CCM_8 [RFC6655] - * 0xC0,0xAB TLS_PSK_DHE_WITH_AES_256_CCM_8 [RFC6655] - * 0xC0,0xAC TLS_ECDHE_ECDSA_WITH_AES_128_CCM [RFC7251] - * 0xC0,0xAD TLS_ECDHE_ECDSA_WITH_AES_256_CCM [RFC7251] - * 0xC0,0xAE TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8 [RFC7251] - * 0xC0,0xAF TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8 [RFC7251] - * 0xC0,0xB0-FF Unassigned - * 0xC1-FD,* Unassigned - * 0xFE,0x00-FD Unassigned - * 0xFE,0xFE-FF Reserved to avoid conflicts with widely - * deployed implementations [Pasi_Eronen] - * 0xFF,0x00-FF Reserved for Private Use [RFC5246] - */ - - add("SSL_NULL_WITH_NULL_NULL", 0x0000, - 1, K_NULL, B_NULL, M_NULL, F); - - /* - * Definition of the CipherSuites that are enabled by default. - * They are listed in preference order, most preferred first, using - * the following criteria: - * 1. Prefer Suite B compliant cipher suites, see RFC6460 (To be - * changed later, see below). - * 2. Prefer the stronger bulk cipher, in the order of AES_256(GCM), - * AES_128(GCM), AES_256, AES_128, 3DES-EDE. - * 3. Prefer the stronger MAC algorithm, in the order of SHA384, - * SHA256, SHA, MD5. - * 4. Prefer the better performance of key exchange and digital - * signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA, - * RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS. - */ - int p = DEFAULT_SUITES_PRIORITY * 2; - - // shorten names to fit the following table cleanly. - int max = ProtocolVersion.LIMIT_MAX_VALUE; - int tls11 = ProtocolVersion.TLS11.v; - int tls12 = ProtocolVersion.TLS12.v; - - // ID Key Exchange Cipher A obs suprt PRF - // ====== ============ ========= = === ===== ======== - - // Suite B compliant cipher suites, see RFC 6460. - // - // Note that, at present this provider is not Suite B compliant. The - // preference order of the GCM cipher suites does not follow the spec - // of RFC 6460. In this section, only two cipher suites are listed - // so that applications can make use of Suite-B compliant cipher - // suite firstly. - add("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", 0xc02c, --p, - K_ECDHE_ECDSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384); - add("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", 0xc02b, --p, - K_ECDHE_ECDSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256); - - // AES_256(GCM) - add("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", 0xc030, --p, - K_ECDHE_RSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384); - add("TLS_RSA_WITH_AES_256_GCM_SHA384", 0x009d, --p, - K_RSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384); - add("TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", 0xc02e, --p, - K_ECDH_ECDSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384); - add("TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", 0xc032, --p, - K_ECDH_RSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384); - add("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", 0x009f, --p, - K_DHE_RSA, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384); - add("TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", 0x00a3, --p, - K_DHE_DSS, B_AES_256_GCM, M_NULL, T, max, tls12, P_SHA384); - - // AES_128(GCM) - add("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", 0xc02f, --p, - K_ECDHE_RSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256); - add("TLS_RSA_WITH_AES_128_GCM_SHA256", 0x009c, --p, - K_RSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256); - add("TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", 0xc02d, --p, - K_ECDH_ECDSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256); - add("TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", 0xc031, --p, - K_ECDH_RSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256); - add("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", 0x009e, --p, - K_DHE_RSA, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256); - add("TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", 0x00a2, --p, - K_DHE_DSS, B_AES_128_GCM, M_NULL, T, max, tls12, P_SHA256); - - // AES_256(CBC) - add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", 0xc024, --p, - K_ECDHE_ECDSA, B_AES_256, M_SHA384, T, max, tls12, P_SHA384); - add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", 0xc028, --p, - K_ECDHE_RSA, B_AES_256, M_SHA384, T, max, tls12, P_SHA384); - add("TLS_RSA_WITH_AES_256_CBC_SHA256", 0x003d, --p, - K_RSA, B_AES_256, M_SHA256, T, max, tls12, P_SHA256); - add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", 0xc026, --p, - K_ECDH_ECDSA, B_AES_256, M_SHA384, T, max, tls12, P_SHA384); - add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", 0xc02a, --p, - K_ECDH_RSA, B_AES_256, M_SHA384, T, max, tls12, P_SHA384); - add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", 0x006b, --p, - K_DHE_RSA, B_AES_256, M_SHA256, T, max, tls12, P_SHA256); - add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", 0x006a, --p, - K_DHE_DSS, B_AES_256, M_SHA256, T, max, tls12, P_SHA256); - - add("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA", 0xC00A, --p, - K_ECDHE_ECDSA, B_AES_256, M_SHA, T); - add("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA", 0xC014, --p, - K_ECDHE_RSA, B_AES_256, M_SHA, T); - add("TLS_RSA_WITH_AES_256_CBC_SHA", 0x0035, --p, - K_RSA, B_AES_256, M_SHA, T); - add("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA", 0xC005, --p, - K_ECDH_ECDSA, B_AES_256, M_SHA, T); - add("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA", 0xC00F, --p, - K_ECDH_RSA, B_AES_256, M_SHA, T); - add("TLS_DHE_RSA_WITH_AES_256_CBC_SHA", 0x0039, --p, - K_DHE_RSA, B_AES_256, M_SHA, T); - add("TLS_DHE_DSS_WITH_AES_256_CBC_SHA", 0x0038, --p, - K_DHE_DSS, B_AES_256, M_SHA, T); - - // AES_128(CBC) - add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", 0xc023, --p, - K_ECDHE_ECDSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256); - add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", 0xc027, --p, - K_ECDHE_RSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256); - add("TLS_RSA_WITH_AES_128_CBC_SHA256", 0x003c, --p, - K_RSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256); - add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", 0xc025, --p, - K_ECDH_ECDSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256); - add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", 0xc029, --p, - K_ECDH_RSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256); - add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", 0x0067, --p, - K_DHE_RSA, B_AES_128, M_SHA256, T, max, tls12, P_SHA256); - add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", 0x0040, --p, - K_DHE_DSS, B_AES_128, M_SHA256, T, max, tls12, P_SHA256); - - add("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA", 0xC009, --p, - K_ECDHE_ECDSA, B_AES_128, M_SHA, T); - add("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA", 0xC013, --p, - K_ECDHE_RSA, B_AES_128, M_SHA, T); - add("TLS_RSA_WITH_AES_128_CBC_SHA", 0x002f, --p, - K_RSA, B_AES_128, M_SHA, T); - add("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA", 0xC004, --p, - K_ECDH_ECDSA, B_AES_128, M_SHA, T); - add("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA", 0xC00E, --p, - K_ECDH_RSA, B_AES_128, M_SHA, T); - add("TLS_DHE_RSA_WITH_AES_128_CBC_SHA", 0x0033, --p, - K_DHE_RSA, B_AES_128, M_SHA, T); - add("TLS_DHE_DSS_WITH_AES_128_CBC_SHA", 0x0032, --p, - K_DHE_DSS, B_AES_128, M_SHA, T); - - // 3DES_EDE - add("TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA", 0xC008, --p, - K_ECDHE_ECDSA, B_3DES, M_SHA, T); - add("TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA", 0xC012, --p, - K_ECDHE_RSA, B_3DES, M_SHA, T); - add("SSL_RSA_WITH_3DES_EDE_CBC_SHA", 0x000a, --p, - K_RSA, B_3DES, M_SHA, T); - add("TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA", 0xC003, --p, - K_ECDH_ECDSA, B_3DES, M_SHA, T); - add("TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA", 0xC00D, --p, - K_ECDH_RSA, B_3DES, M_SHA, T); - add("SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA", 0x0016, --p, - K_DHE_RSA, B_3DES, M_SHA, T); - add("SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA", 0x0013, --p, - K_DHE_DSS, B_3DES, M_SHA, N); - - // Renegotiation protection request Signalling Cipher Suite Value (SCSV) - add("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", 0x00ff, --p, - K_SCSV, B_NULL, M_NULL, T); - - /* - * Definition of the CipherSuites that are supported but not enabled - * by default. - * They are listed in preference order, preferred first, using the - * following criteria: - * 1. CipherSuites for KRB5 need additional KRB5 service - * configuration, and these suites are not common in practice, - * so we put KRB5 based cipher suites at the end of the supported - * list. - * 2. If a cipher suite has been obsoleted, we put it at the end of - * the list. - * 3. Prefer the stronger bulk cipher, in the order of AES_256, - * AES_128, 3DES-EDE, RC-4, DES, DES40, RC4_40, NULL. - * 4. Prefer the stronger MAC algorithm, in the order of SHA384, - * SHA256, SHA, MD5. - * 5. Prefer the better performance of key exchange and digital - * signature algorithm, in the order of ECDHE-ECDSA, ECDHE-RSA, - * RSA, ECDH-ECDSA, ECDH-RSA, DHE-RSA, DHE-DSS, anonymous. - */ - p = DEFAULT_SUITES_PRIORITY; - - add("TLS_DH_anon_WITH_AES_256_GCM_SHA384", 0x00a7, --p, - K_DH_ANON, B_AES_256_GCM, M_NULL, N, max, tls12, P_SHA384); - add("TLS_DH_anon_WITH_AES_128_GCM_SHA256", 0x00a6, --p, - K_DH_ANON, B_AES_128_GCM, M_NULL, N, max, tls12, P_SHA256); - - add("TLS_DH_anon_WITH_AES_256_CBC_SHA256", 0x006d, --p, - K_DH_ANON, B_AES_256, M_SHA256, N, max, tls12, P_SHA256); - add("TLS_ECDH_anon_WITH_AES_256_CBC_SHA", 0xC019, --p, - K_ECDH_ANON, B_AES_256, M_SHA, N); - add("TLS_DH_anon_WITH_AES_256_CBC_SHA", 0x003a, --p, - K_DH_ANON, B_AES_256, M_SHA, N); - - add("TLS_DH_anon_WITH_AES_128_CBC_SHA256", 0x006c, --p, - K_DH_ANON, B_AES_128, M_SHA256, N, max, tls12, P_SHA256); - add("TLS_ECDH_anon_WITH_AES_128_CBC_SHA", 0xC018, --p, - K_ECDH_ANON, B_AES_128, M_SHA, N); - add("TLS_DH_anon_WITH_AES_128_CBC_SHA", 0x0034, --p, - K_DH_ANON, B_AES_128, M_SHA, N); - - add("TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA", 0xC017, --p, - K_ECDH_ANON, B_3DES, M_SHA, N); - add("SSL_DH_anon_WITH_3DES_EDE_CBC_SHA", 0x001b, --p, - K_DH_ANON, B_3DES, M_SHA, N); - - // RC-4 - add("TLS_ECDHE_ECDSA_WITH_RC4_128_SHA", 0xC007, --p, - K_ECDHE_ECDSA, B_RC4_128, M_SHA, N); - add("TLS_ECDHE_RSA_WITH_RC4_128_SHA", 0xC011, --p, - K_ECDHE_RSA, B_RC4_128, M_SHA, N); - add("SSL_RSA_WITH_RC4_128_SHA", 0x0005, --p, - K_RSA, B_RC4_128, M_SHA, N); - add("TLS_ECDH_ECDSA_WITH_RC4_128_SHA", 0xC002, --p, - K_ECDH_ECDSA, B_RC4_128, M_SHA, N); - add("TLS_ECDH_RSA_WITH_RC4_128_SHA", 0xC00C, --p, - K_ECDH_RSA, B_RC4_128, M_SHA, N); - add("SSL_RSA_WITH_RC4_128_MD5", 0x0004, --p, - K_RSA, B_RC4_128, M_MD5, N); - - add("TLS_ECDH_anon_WITH_RC4_128_SHA", 0xC016, --p, - K_ECDH_ANON, B_RC4_128, M_SHA, N); - add("SSL_DH_anon_WITH_RC4_128_MD5", 0x0018, --p, - K_DH_ANON, B_RC4_128, M_MD5, N); - - // weak cipher suites obsoleted in TLS 1.2 - add("SSL_RSA_WITH_DES_CBC_SHA", 0x0009, --p, - K_RSA, B_DES, M_SHA, N, tls12); - add("SSL_DHE_RSA_WITH_DES_CBC_SHA", 0x0015, --p, - K_DHE_RSA, B_DES, M_SHA, N, tls12); - add("SSL_DHE_DSS_WITH_DES_CBC_SHA", 0x0012, --p, - K_DHE_DSS, B_DES, M_SHA, N, tls12); - add("SSL_DH_anon_WITH_DES_CBC_SHA", 0x001a, --p, - K_DH_ANON, B_DES, M_SHA, N, tls12); - - // weak cipher suites obsoleted in TLS 1.1 - add("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0008, --p, - K_RSA_EXPORT, B_DES_40, M_SHA, N, tls11); - add("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0014, --p, - K_DHE_RSA, B_DES_40, M_SHA, N, tls11); - add("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x0011, --p, - K_DHE_DSS, B_DES_40, M_SHA, N, tls11); - add("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", 0x0019, --p, - K_DH_ANON, B_DES_40, M_SHA, N, tls11); - - add("SSL_RSA_EXPORT_WITH_RC4_40_MD5", 0x0003, --p, - K_RSA_EXPORT, B_RC4_40, M_MD5, N, tls11); - add("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", 0x0017, --p, - K_DH_ANON, B_RC4_40, M_MD5, N, tls11); - - add("TLS_RSA_WITH_NULL_SHA256", 0x003b, --p, - K_RSA, B_NULL, M_SHA256, N, max, tls12, P_SHA256); - add("TLS_ECDHE_ECDSA_WITH_NULL_SHA", 0xC006, --p, - K_ECDHE_ECDSA, B_NULL, M_SHA, N); - add("TLS_ECDHE_RSA_WITH_NULL_SHA", 0xC010, --p, - K_ECDHE_RSA, B_NULL, M_SHA, N); - add("SSL_RSA_WITH_NULL_SHA", 0x0002, --p, - K_RSA, B_NULL, M_SHA, N); - add("TLS_ECDH_ECDSA_WITH_NULL_SHA", 0xC001, --p, - K_ECDH_ECDSA, B_NULL, M_SHA, N); - add("TLS_ECDH_RSA_WITH_NULL_SHA", 0xC00B, --p, - K_ECDH_RSA, B_NULL, M_SHA, N); - add("TLS_ECDH_anon_WITH_NULL_SHA", 0xC015, --p, - K_ECDH_ANON, B_NULL, M_SHA, N); - add("SSL_RSA_WITH_NULL_MD5", 0x0001, --p, - K_RSA, B_NULL, M_MD5, N); - - // Supported Kerberos ciphersuites from RFC2712 - add("TLS_KRB5_WITH_3DES_EDE_CBC_SHA", 0x001f, --p, - K_KRB5, B_3DES, M_SHA, N); - add("TLS_KRB5_WITH_3DES_EDE_CBC_MD5", 0x0023, --p, - K_KRB5, B_3DES, M_MD5, N); - add("TLS_KRB5_WITH_RC4_128_SHA", 0x0020, --p, - K_KRB5, B_RC4_128, M_SHA, N); - add("TLS_KRB5_WITH_RC4_128_MD5", 0x0024, --p, - K_KRB5, B_RC4_128, M_MD5, N); - add("TLS_KRB5_WITH_DES_CBC_SHA", 0x001e, --p, - K_KRB5, B_DES, M_SHA, N, tls12); - add("TLS_KRB5_WITH_DES_CBC_MD5", 0x0022, --p, - K_KRB5, B_DES, M_MD5, N, tls12); - add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 0x0026, --p, - K_KRB5_EXPORT, B_DES_40, M_SHA, N, tls11); - add("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 0x0029, --p, - K_KRB5_EXPORT, B_DES_40, M_MD5, N, tls11); - add("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 0x0028, --p, - K_KRB5_EXPORT, B_RC4_40, M_SHA, N, tls11); - add("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 0x002b, --p, - K_KRB5_EXPORT, B_RC4_40, M_MD5, N, tls11); - - /* - * Other values from the TLS Cipher Suite Registry, as of August 2010. - * - * http://www.iana.org/assignments/tls-parameters/tls-parameters.xml - * - * Range Registration Procedures Notes - * 000-191 Standards Action Refers to value of first byte - * 192-254 Specification Required Refers to value of first byte - * 255 Reserved for Private Use Refers to value of first byte - */ - - // Register the names of a few additional CipherSuites. - // Makes them show up as names instead of numbers in - // the debug output. - - // remaining unsupported ciphersuites defined in RFC2246. - add("SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5", 0x0006); - add("SSL_RSA_WITH_IDEA_CBC_SHA", 0x0007); - add("SSL_DH_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x000b); - add("SSL_DH_DSS_WITH_DES_CBC_SHA", 0x000c); - add("SSL_DH_DSS_WITH_3DES_EDE_CBC_SHA", 0x000d); - add("SSL_DH_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x000e); - add("SSL_DH_RSA_WITH_DES_CBC_SHA", 0x000f); - add("SSL_DH_RSA_WITH_3DES_EDE_CBC_SHA", 0x0010); - - // SSL 3.0 Fortezza ciphersuites - add("SSL_FORTEZZA_DMS_WITH_NULL_SHA", 0x001c); - add("SSL_FORTEZZA_DMS_WITH_FORTEZZA_CBC_SHA", 0x001d); - - // 1024/56 bit exportable ciphersuites from expired internet draft - add("SSL_RSA_EXPORT1024_WITH_DES_CBC_SHA", 0x0062); - add("SSL_DHE_DSS_EXPORT1024_WITH_DES_CBC_SHA", 0x0063); - add("SSL_RSA_EXPORT1024_WITH_RC4_56_SHA", 0x0064); - add("SSL_DHE_DSS_EXPORT1024_WITH_RC4_56_SHA", 0x0065); - add("SSL_DHE_DSS_WITH_RC4_128_SHA", 0x0066); - - // Netscape old and new SSL 3.0 FIPS ciphersuites - // see http://www.mozilla.org/projects/security/pki/nss/ssl/fips-ssl-ciphersuites.html - add("NETSCAPE_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xffe0); - add("NETSCAPE_RSA_FIPS_WITH_DES_CBC_SHA", 0xffe1); - add("SSL_RSA_FIPS_WITH_DES_CBC_SHA", 0xfefe); - add("SSL_RSA_FIPS_WITH_3DES_EDE_CBC_SHA", 0xfeff); - - // Unsupported Kerberos cipher suites from RFC 2712 - add("TLS_KRB5_WITH_IDEA_CBC_SHA", 0x0021); - add("TLS_KRB5_WITH_IDEA_CBC_MD5", 0x0025); - add("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_SHA", 0x0027); - add("TLS_KRB5_EXPORT_WITH_RC2_CBC_40_MD5", 0x002a); - - // Unsupported cipher suites from RFC 4162 - add("TLS_RSA_WITH_SEED_CBC_SHA", 0x0096); - add("TLS_DH_DSS_WITH_SEED_CBC_SHA", 0x0097); - add("TLS_DH_RSA_WITH_SEED_CBC_SHA", 0x0098); - add("TLS_DHE_DSS_WITH_SEED_CBC_SHA", 0x0099); - add("TLS_DHE_RSA_WITH_SEED_CBC_SHA", 0x009a); - add("TLS_DH_anon_WITH_SEED_CBC_SHA", 0x009b); - - // Unsupported cipher suites from RFC 4279 - add("TLS_PSK_WITH_RC4_128_SHA", 0x008a); - add("TLS_PSK_WITH_3DES_EDE_CBC_SHA", 0x008b); - add("TLS_PSK_WITH_AES_128_CBC_SHA", 0x008c); - add("TLS_PSK_WITH_AES_256_CBC_SHA", 0x008d); - add("TLS_DHE_PSK_WITH_RC4_128_SHA", 0x008e); - add("TLS_DHE_PSK_WITH_3DES_EDE_CBC_SHA", 0x008f); - add("TLS_DHE_PSK_WITH_AES_128_CBC_SHA", 0x0090); - add("TLS_DHE_PSK_WITH_AES_256_CBC_SHA", 0x0091); - add("TLS_RSA_PSK_WITH_RC4_128_SHA", 0x0092); - add("TLS_RSA_PSK_WITH_3DES_EDE_CBC_SHA", 0x0093); - add("TLS_RSA_PSK_WITH_AES_128_CBC_SHA", 0x0094); - add("TLS_RSA_PSK_WITH_AES_256_CBC_SHA", 0x0095); - - // Unsupported cipher suites from RFC 4785 - add("TLS_PSK_WITH_NULL_SHA", 0x002c); - add("TLS_DHE_PSK_WITH_NULL_SHA", 0x002d); - add("TLS_RSA_PSK_WITH_NULL_SHA", 0x002e); - - // Unsupported cipher suites from RFC 5246 - add("TLS_DH_DSS_WITH_AES_128_CBC_SHA", 0x0030); - add("TLS_DH_RSA_WITH_AES_128_CBC_SHA", 0x0031); - add("TLS_DH_DSS_WITH_AES_256_CBC_SHA", 0x0036); - add("TLS_DH_RSA_WITH_AES_256_CBC_SHA", 0x0037); - add("TLS_DH_DSS_WITH_AES_128_CBC_SHA256", 0x003e); - add("TLS_DH_RSA_WITH_AES_128_CBC_SHA256", 0x003f); - add("TLS_DH_DSS_WITH_AES_256_CBC_SHA256", 0x0068); - add("TLS_DH_RSA_WITH_AES_256_CBC_SHA256", 0x0069); - - // Unsupported cipher suites from RFC 5288 - add("TLS_DH_RSA_WITH_AES_128_GCM_SHA256", 0x00a0); - add("TLS_DH_RSA_WITH_AES_256_GCM_SHA384", 0x00a1); - add("TLS_DH_DSS_WITH_AES_128_GCM_SHA256", 0x00a4); - add("TLS_DH_DSS_WITH_AES_256_GCM_SHA384", 0x00a5); - - // Unsupported cipher suites from RFC 5487 - add("TLS_PSK_WITH_AES_128_GCM_SHA256", 0x00a8); - add("TLS_PSK_WITH_AES_256_GCM_SHA384", 0x00a9); - add("TLS_DHE_PSK_WITH_AES_128_GCM_SHA256", 0x00aa); - add("TLS_DHE_PSK_WITH_AES_256_GCM_SHA384", 0x00ab); - add("TLS_RSA_PSK_WITH_AES_128_GCM_SHA256", 0x00ac); - add("TLS_RSA_PSK_WITH_AES_256_GCM_SHA384", 0x00ad); - add("TLS_PSK_WITH_AES_128_CBC_SHA256", 0x00ae); - add("TLS_PSK_WITH_AES_256_CBC_SHA384", 0x00af); - add("TLS_PSK_WITH_NULL_SHA256", 0x00b0); - add("TLS_PSK_WITH_NULL_SHA384", 0x00b1); - add("TLS_DHE_PSK_WITH_AES_128_CBC_SHA256", 0x00b2); - add("TLS_DHE_PSK_WITH_AES_256_CBC_SHA384", 0x00b3); - add("TLS_DHE_PSK_WITH_NULL_SHA256", 0x00b4); - add("TLS_DHE_PSK_WITH_NULL_SHA384", 0x00b5); - add("TLS_RSA_PSK_WITH_AES_128_CBC_SHA256", 0x00b6); - add("TLS_RSA_PSK_WITH_AES_256_CBC_SHA384", 0x00b7); - add("TLS_RSA_PSK_WITH_NULL_SHA256", 0x00b8); - add("TLS_RSA_PSK_WITH_NULL_SHA384", 0x00b9); - - // Unsupported cipher suites from RFC 5932 - add("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0041); - add("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA", 0x0042); - add("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0043); - add("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA", 0x0044); - add("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA", 0x0045); - add("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA", 0x0046); - add("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0084); - add("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA", 0x0085); - add("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0086); - add("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA", 0x0087); - add("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA", 0x0088); - add("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA", 0x0089); - add("TLS_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00ba); - add("TLS_DH_DSS_WITH_CAMELLIA_128_CBC_SHA256", 0x00bb); - add("TLS_DH_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00bc); - add("TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA256", 0x00bd); - add("TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0x00be); - add("TLS_DH_anon_WITH_CAMELLIA_128_CBC_SHA256", 0x00bf); - add("TLS_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c0); - add("TLS_DH_DSS_WITH_CAMELLIA_256_CBC_SHA256", 0x00c1); - add("TLS_DH_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c2); - add("TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA256", 0x00c3); - add("TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA256", 0x00c4); - add("TLS_DH_anon_WITH_CAMELLIA_256_CBC_SHA256", 0x00c5); - - // TLS Fallback Signaling Cipher Suite Value (SCSV) RFC 7507 - add("TLS_FALLBACK_SCSV", 0x5600); - - // Unsupported cipher suites from RFC 5054 - add("TLS_SRP_SHA_WITH_3DES_EDE_CBC_SHA", 0xc01a); - add("TLS_SRP_SHA_RSA_WITH_3DES_EDE_CBC_SHA", 0xc01b); - add("TLS_SRP_SHA_DSS_WITH_3DES_EDE_CBC_SHA", 0xc01c); - add("TLS_SRP_SHA_WITH_AES_128_CBC_SHA", 0xc01d); - add("TLS_SRP_SHA_RSA_WITH_AES_128_CBC_SHA", 0xc01e); - add("TLS_SRP_SHA_DSS_WITH_AES_128_CBC_SHA", 0xc01f); - add("TLS_SRP_SHA_WITH_AES_256_CBC_SHA", 0xc020); - add("TLS_SRP_SHA_RSA_WITH_AES_256_CBC_SHA", 0xc021); - add("TLS_SRP_SHA_DSS_WITH_AES_256_CBC_SHA", 0xc022); - - // Unsupported cipher suites from RFC 5489 - add("TLS_ECDHE_PSK_WITH_RC4_128_SHA", 0xc033); - add("TLS_ECDHE_PSK_WITH_3DES_EDE_CBC_SHA", 0xc034); - add("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA", 0xc035); - add("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA", 0xc036); - add("TLS_ECDHE_PSK_WITH_AES_128_CBC_SHA256", 0xc037); - add("TLS_ECDHE_PSK_WITH_AES_256_CBC_SHA384", 0xc038); - add("TLS_ECDHE_PSK_WITH_NULL_SHA", 0xc039); - add("TLS_ECDHE_PSK_WITH_NULL_SHA256", 0xc03a); - add("TLS_ECDHE_PSK_WITH_NULL_SHA384", 0xc03b); - - // Unsupported cipher suites from RFC 6209 - add("TLS_RSA_WITH_ARIA_128_CBC_SHA256", 0xc03c); - add("TLS_RSA_WITH_ARIA_256_CBC_SHA384", 0xc03d); - add("TLS_DH_DSS_WITH_ARIA_128_CBC_SHA256", 0xc03e); - add("TLS_DH_DSS_WITH_ARIA_256_CBC_SHA384", 0xc03f); - add("TLS_DH_RSA_WITH_ARIA_128_CBC_SHA256", 0xc040); - add("TLS_DH_RSA_WITH_ARIA_256_CBC_SHA384", 0xc041); - add("TLS_DHE_DSS_WITH_ARIA_128_CBC_SHA256", 0xc042); - add("TLS_DHE_DSS_WITH_ARIA_256_CBC_SHA384", 0xc043); - add("TLS_DHE_RSA_WITH_ARIA_128_CBC_SHA256", 0xc044); - add("TLS_DHE_RSA_WITH_ARIA_256_CBC_SHA384", 0xc045); - add("TLS_DH_anon_WITH_ARIA_128_CBC_SHA256", 0xc046); - add("TLS_DH_anon_WITH_ARIA_256_CBC_SHA384", 0xc047); - add("TLS_ECDHE_ECDSA_WITH_ARIA_128_CBC_SHA256", 0xc048); - add("TLS_ECDHE_ECDSA_WITH_ARIA_256_CBC_SHA384", 0xc049); - add("TLS_ECDH_ECDSA_WITH_ARIA_128_CBC_SHA256", 0xc04a); - add("TLS_ECDH_ECDSA_WITH_ARIA_256_CBC_SHA384", 0xc04b); - add("TLS_ECDHE_RSA_WITH_ARIA_128_CBC_SHA256", 0xc04c); - add("TLS_ECDHE_RSA_WITH_ARIA_256_CBC_SHA384", 0xc04d); - add("TLS_ECDH_RSA_WITH_ARIA_128_CBC_SHA256", 0xc04e); - add("TLS_ECDH_RSA_WITH_ARIA_256_CBC_SHA384", 0xc04f); - add("TLS_RSA_WITH_ARIA_128_GCM_SHA256", 0xc050); - add("TLS_RSA_WITH_ARIA_256_GCM_SHA384", 0xc051); - add("TLS_DHE_RSA_WITH_ARIA_128_GCM_SHA256", 0xc052); - add("TLS_DHE_RSA_WITH_ARIA_256_GCM_SHA384", 0xc053); - add("TLS_DH_RSA_WITH_ARIA_128_GCM_SHA256", 0xc054); - add("TLS_DH_RSA_WITH_ARIA_256_GCM_SHA384", 0xc055); - add("TLS_DHE_DSS_WITH_ARIA_128_GCM_SHA256", 0xc056); - add("TLS_DHE_DSS_WITH_ARIA_256_GCM_SHA384", 0xc057); - add("TLS_DH_DSS_WITH_ARIA_128_GCM_SHA256", 0xc058); - add("TLS_DH_DSS_WITH_ARIA_256_GCM_SHA384", 0xc059); - add("TLS_DH_anon_WITH_ARIA_128_GCM_SHA256", 0xc05a); - add("TLS_DH_anon_WITH_ARIA_256_GCM_SHA384", 0xc05b); - add("TLS_ECDHE_ECDSA_WITH_ARIA_128_GCM_SHA256", 0xc05c); - add("TLS_ECDHE_ECDSA_WITH_ARIA_256_GCM_SHA384", 0xc05d); - add("TLS_ECDH_ECDSA_WITH_ARIA_128_GCM_SHA256", 0xc05e); - add("TLS_ECDH_ECDSA_WITH_ARIA_256_GCM_SHA384", 0xc05f); - add("TLS_ECDHE_RSA_WITH_ARIA_128_GCM_SHA256", 0xc060); - add("TLS_ECDHE_RSA_WITH_ARIA_256_GCM_SHA384", 0xc061); - add("TLS_ECDH_RSA_WITH_ARIA_128_GCM_SHA256", 0xc062); - add("TLS_ECDH_RSA_WITH_ARIA_256_GCM_SHA384", 0xc063); - add("TLS_PSK_WITH_ARIA_128_CBC_SHA256", 0xc064); - add("TLS_PSK_WITH_ARIA_256_CBC_SHA384", 0xc065); - add("TLS_DHE_PSK_WITH_ARIA_128_CBC_SHA256", 0xc066); - add("TLS_DHE_PSK_WITH_ARIA_256_CBC_SHA384", 0xc067); - add("TLS_RSA_PSK_WITH_ARIA_128_CBC_SHA256", 0xc068); - add("TLS_RSA_PSK_WITH_ARIA_256_CBC_SHA384", 0xc069); - add("TLS_PSK_WITH_ARIA_128_GCM_SHA256", 0xc06a); - add("TLS_PSK_WITH_ARIA_256_GCM_SHA384", 0xc06b); - add("TLS_DHE_PSK_WITH_ARIA_128_GCM_SHA256", 0xc06c); - add("TLS_DHE_PSK_WITH_ARIA_256_GCM_SHA384", 0xc06d); - add("TLS_RSA_PSK_WITH_ARIA_128_GCM_SHA256", 0xc06e); - add("TLS_RSA_PSK_WITH_ARIA_256_GCM_SHA384", 0xc06f); - add("TLS_ECDHE_PSK_WITH_ARIA_128_CBC_SHA256", 0xc070); - add("TLS_ECDHE_PSK_WITH_ARIA_256_CBC_SHA384", 0xc071); - - // Unsupported cipher suites from RFC 6367 - add("TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_CBC_SHA256", 0xc072); - add("TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_CBC_SHA384", 0xc073); - add("TLS_ECDH_ECDSA_WITH_CAMELLIA_128_CBC_SHA256", 0xc074); - add("TLS_ECDH_ECDSA_WITH_CAMELLIA_256_CBC_SHA384", 0xc075); - add("TLS_ECDHE_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0xc076); - add("TLS_ECDHE_RSA_WITH_CAMELLIA_256_CBC_SHA384", 0xc077); - add("TLS_ECDH_RSA_WITH_CAMELLIA_128_CBC_SHA256", 0xc078); - add("TLS_ECDH_RSA_WITH_CAMELLIA_256_CBC_SHA384", 0xc079); - add("TLS_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc07a); - add("TLS_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc07b); - add("TLS_DHE_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc07c); - add("TLS_DHE_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc07d); - add("TLS_DH_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc07e); - add("TLS_DH_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc07f); - add("TLS_DHE_DSS_WITH_CAMELLIA_128_GCM_SHA256", 0xc080); - add("TLS_DHE_DSS_WITH_CAMELLIA_256_GCM_SHA384", 0xc081); - add("TLS_DH_DSS_WITH_CAMELLIA_128_GCM_SHA256", 0xc082); - add("TLS_DH_DSS_WITH_CAMELLIA_256_GCM_SHA384", 0xc083); - add("TLS_DH_anon_WITH_CAMELLIA_128_GCM_SHA256", 0xc084); - add("TLS_DH_anon_WITH_CAMELLIA_256_GCM_SHA384", 0xc085); - add("TLS_ECDHE_ECDSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc086); - add("TLS_ECDHE_ECDSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc087); - add("TLS_ECDH_ECDSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc088); - add("TLS_ECDH_ECDSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc089); - add("TLS_ECDHE_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc08a); - add("TLS_ECDHE_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc08b); - add("TLS_ECDH_RSA_WITH_CAMELLIA_128_GCM_SHA256", 0xc08c); - add("TLS_ECDH_RSA_WITH_CAMELLIA_256_GCM_SHA384", 0xc08d); - add("TLS_PSK_WITH_CAMELLIA_128_GCM_SHA256", 0xc08e); - add("TLS_PSK_WITH_CAMELLIA_256_GCM_SHA384", 0xc08f); - add("TLS_DHE_PSK_WITH_CAMELLIA_128_GCM_SHA256", 0xc090); - add("TLS_DHE_PSK_WITH_CAMELLIA_256_GCM_SHA384", 0xc091); - add("TLS_RSA_PSK_WITH_CAMELLIA_128_GCM_SHA256", 0xc092); - add("TLS_RSA_PSK_WITH_CAMELLIA_256_GCM_SHA384", 0xc093); - add("TLS_PSK_WITH_CAMELLIA_128_CBC_SHA256", 0xc094); - add("TLS_PSK_WITH_CAMELLIA_256_CBC_SHA384", 0xc095); - add("TLS_DHE_PSK_WITH_CAMELLIA_128_CBC_SHA256", 0xc096); - add("TLS_DHE_PSK_WITH_CAMELLIA_256_CBC_SHA384", 0xc097); - add("TLS_RSA_PSK_WITH_CAMELLIA_128_CBC_SHA256", 0xc098); - add("TLS_RSA_PSK_WITH_CAMELLIA_256_CBC_SHA384", 0xc099); - add("TLS_ECDHE_PSK_WITH_CAMELLIA_128_CBC_SHA256", 0xc09a); - add("TLS_ECDHE_PSK_WITH_CAMELLIA_256_CBC_SHA384", 0xc09b); - - // Unsupported cipher suites from RFC 6655 - add("TLS_RSA_WITH_AES_128_CCM", 0xc09c); - add("TLS_RSA_WITH_AES_256_CCM", 0xc09d); - add("TLS_DHE_RSA_WITH_AES_128_CCM", 0xc09e); - add("TLS_DHE_RSA_WITH_AES_256_CCM", 0xc09f); - add("TLS_RSA_WITH_AES_128_CCM_8", 0xc0A0); - add("TLS_RSA_WITH_AES_256_CCM_8", 0xc0A1); - add("TLS_DHE_RSA_WITH_AES_128_CCM_8", 0xc0A2); - add("TLS_DHE_RSA_WITH_AES_256_CCM_8", 0xc0A3); - add("TLS_PSK_WITH_AES_128_CCM", 0xc0A4); - add("TLS_PSK_WITH_AES_256_CCM", 0xc0A5); - add("TLS_DHE_PSK_WITH_AES_128_CCM", 0xc0A6); - add("TLS_DHE_PSK_WITH_AES_256_CCM", 0xc0A7); - add("TLS_PSK_WITH_AES_128_CCM_8", 0xc0A8); - add("TLS_PSK_WITH_AES_256_CCM_8", 0xc0A9); - add("TLS_PSK_DHE_WITH_AES_128_CCM_8", 0xc0Aa); - add("TLS_PSK_DHE_WITH_AES_256_CCM_8", 0xc0Ab); - - // Unsupported cipher suites from RFC 7251 - add("TLS_ECDHE_ECDSA_WITH_AES_128_CCM", 0xc0Ac); - add("TLS_ECDHE_ECDSA_WITH_AES_256_CCM", 0xc0Ad); - add("TLS_ECDHE_ECDSA_WITH_AES_128_CCM_8", 0xc0Ae); - add("TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8", 0xc0Af); - } - - // ciphersuite SSL_NULL_WITH_NULL_NULL - static final CipherSuite C_NULL = CipherSuite.valueOf(0, 0); - - // ciphersuite TLS_EMPTY_RENEGOTIATION_INFO_SCSV - static final CipherSuite C_SCSV = CipherSuite.valueOf(0x00, 0xff); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CipherSuiteList.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CipherSuiteList.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CipherSuiteList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CipherSuiteList.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,187 +0,0 @@ -/* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package sun.security.ssl; - -import java.io.*; -import java.util.*; - -import javax.net.ssl.SSLException; -import static sun.security.ssl.NamedGroupType.*; - -/** - * A list of CipherSuites. Also maintains the lists of supported and - * default ciphersuites and supports I/O from handshake streams. - * - * Instances of this class are immutable. - * - */ -final class CipherSuiteList { - - private final Collection<CipherSuite> cipherSuites; - private String[] suiteNames; - private final EnumSet<NamedGroupType> groupsTypes = - EnumSet.noneOf(NamedGroupType.class); - - // for use by buildAvailableCache() and - // Handshaker.getKickstartMessage() only - CipherSuiteList(Collection<CipherSuite> cipherSuites) { - this.cipherSuites = cipherSuites; - for (CipherSuite suite : cipherSuites) { - updateGroupTypes(suite); - } - } - - /** - * Create a CipherSuiteList with a single element. - */ - CipherSuiteList(CipherSuite suite) { - cipherSuites = new ArrayList<CipherSuite>(1); - cipherSuites.add(suite); - updateGroupTypes(suite); - } - - /** - * Construct a CipherSuiteList from a array of names. We don't bother - * to eliminate duplicates. - * - * @exception IllegalArgumentException if the array or any of its elements - * is null or if the ciphersuite name is unrecognized or unsupported - * using currently installed providers. - */ - CipherSuiteList(String[] names) { - if (names == null) { - throw new IllegalArgumentException("CipherSuites may not be null"); - } - cipherSuites = new ArrayList<CipherSuite>(names.length); - for (int i = 0; i < names.length; i++) { - String suiteName = names[i]; - CipherSuite suite = CipherSuite.valueOf(suiteName); - if (suite.isAvailable() == false) { - throw new IllegalArgumentException("Cannot support " - + suiteName + " with currently installed providers"); - } - cipherSuites.add(suite); - updateGroupTypes(suite); - } - } - - /** - * Read a CipherSuiteList from a HandshakeInStream in V3 ClientHello - * format. Does not check if the listed ciphersuites are known or - * supported. - */ - CipherSuiteList(HandshakeInStream in) throws IOException { - byte[] bytes = in.getBytes16(); - if ((bytes.length & 1) != 0) { - throw new SSLException("Invalid ClientHello message"); - } - cipherSuites = new ArrayList<CipherSuite>(bytes.length >> 1); - for (int i = 0; i < bytes.length; i += 2) { - CipherSuite suite = CipherSuite.valueOf(bytes[i], bytes[i+1]); - cipherSuites.add(suite); - updateGroupTypes(suite); - } - } - - // Please don't use this method except constructors. - private void updateGroupTypes(CipherSuite cipherSuite) { - if (cipherSuite.keyExchange != null && (!cipherSuite.exportable)) { - NamedGroupType groupType = cipherSuite.keyExchange.groupType; - if ((groupType != NAMED_GROUP_NONE) && - (!groupsTypes.contains(groupType))) { - groupsTypes.add(groupType); - } - } - } - - /** - * Return whether this list contains the given CipherSuite. - */ - boolean contains(CipherSuite suite) { - return cipherSuites.contains(suite); - } - - // Return whether this list contains cipher suites of a named group type. - boolean contains(NamedGroupType groupType) { - return groupsTypes.contains(groupType); - } - - /** - * Return an Iterator for the CipherSuites in this list. - */ - Iterator<CipherSuite> iterator() { - return cipherSuites.iterator(); - } - - /** - * Return a reference to the internal Collection of CipherSuites. - * The Collection MUST NOT be modified. - */ - Collection<CipherSuite> collection() { - return cipherSuites; - } - - /** - * Return the number of CipherSuites in this list. - */ - int size() { - return cipherSuites.size(); - } - - /** - * Return an array with the names of the CipherSuites in this list. - */ - synchronized String[] toStringArray() { - if (suiteNames == null) { - suiteNames = new String[cipherSuites.size()]; - int i = 0; - for (CipherSuite c : cipherSuites) { - suiteNames[i++] = c.name; - } - } - return suiteNames.clone(); - } - - @Override - public String toString() { - return cipherSuites.toString(); - } - - /** - * Write this list to an HandshakeOutStream in V3 ClientHello format. - */ - void send(HandshakeOutStream s) throws IOException { - byte[] suiteBytes = new byte[cipherSuites.size() * 2]; - int i = 0; - for (CipherSuite c : cipherSuites) { - suiteBytes[i] = (byte)(c.id >> 8); - suiteBytes[i+1] = (byte)c.id; - i += 2; - } - s.putBytes16(suiteBytes); - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Ciphertext.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Ciphertext.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Ciphertext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Ciphertext.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,120 +26,30 @@ package sun.security.ssl; import javax.net.ssl.SSLEngineResult.HandshakeStatus; -import static sun.security.ssl.HandshakeMessage.*; /* - * enumeration of record type + * Ciphertext */ final class Ciphertext { static final Ciphertext CIPHERTEXT_NULL = new Ciphertext(); - RecordType recordType; - long recordSN; + final byte contentType; + final byte handshakeType; + final long recordSN; HandshakeStatus handshakeStatus; // null if not used or not handshaking - Ciphertext() { - this.recordType = null; + private Ciphertext() { + this.contentType = 0; + this.handshakeType = -1; this.recordSN = -1L; this.handshakeStatus = null; } - Ciphertext(RecordType recordType, long recordSN) { - this.recordType = recordType; + Ciphertext(byte contentType, byte handshakeType, long recordSN) { + this.contentType = contentType; + this.handshakeType = handshakeType; this.recordSN = recordSN; this.handshakeStatus = null; } - - static enum RecordType { - RECORD_CHANGE_CIPHER_SPEC ( - Record.ct_change_cipher_spec, ht_not_applicable), - RECORD_ALERT ( - Record.ct_alert, ht_not_applicable), - RECORD_HELLO_REQUEST ( - Record.ct_handshake, ht_hello_request), - RECORD_CLIENT_HELLO ( - Record.ct_handshake, ht_client_hello), - RECORD_SERVER_HELLO ( - Record.ct_handshake, ht_server_hello), - RECORD_HELLO_VERIFY_REQUEST ( - Record.ct_handshake, ht_hello_verify_request), - RECORD_NEW_SESSION_TICKET ( - Record.ct_handshake, ht_new_session_ticket), - RECORD_CERTIFICATE ( - Record.ct_handshake, ht_certificate), - RECORD_SERVER_KEY_EXCHANGE ( - Record.ct_handshake, ht_server_key_exchange), - RECORD_CERTIFICATE_REQUEST ( - Record.ct_handshake, ht_certificate_request), - RECORD_SERVER_HELLO_DONE ( - Record.ct_handshake, ht_server_hello_done), - RECORD_CERTIFICATE_VERIFY ( - Record.ct_handshake, ht_certificate_verify), - RECORD_CLIENT_KEY_EXCHANGE ( - Record.ct_handshake, ht_client_key_exchange), - RECORD_FINISHED ( - Record.ct_handshake, ht_finished), - RECORD_CERTIFICATE_URL ( - Record.ct_handshake, ht_certificate_url), - RECORD_CERTIFICATE_STATUS ( - Record.ct_handshake, ht_certificate_status), - RECORD_SUPPLIEMENTAL_DATA ( - Record.ct_handshake, ht_supplemental_data), - RECORD_APPLICATION_DATA ( - Record.ct_application_data, ht_not_applicable); - - byte contentType; - byte handshakeType; - - private RecordType(byte contentType, byte handshakeType) { - this.contentType = contentType; - this.handshakeType = handshakeType; - } - - static RecordType valueOf(byte contentType, byte handshakeType) { - if (contentType == Record.ct_change_cipher_spec) { - return RECORD_CHANGE_CIPHER_SPEC; - } else if (contentType == Record.ct_alert) { - return RECORD_ALERT; - } else if (contentType == Record.ct_application_data) { - return RECORD_APPLICATION_DATA; - } else if (handshakeType == ht_hello_request) { - return RECORD_HELLO_REQUEST; - } else if (handshakeType == ht_client_hello) { - return RECORD_CLIENT_HELLO; - } else if (handshakeType == ht_server_hello) { - return RECORD_SERVER_HELLO; - } else if (handshakeType == ht_hello_verify_request) { - return RECORD_HELLO_VERIFY_REQUEST; - } else if (handshakeType == ht_new_session_ticket) { - return RECORD_NEW_SESSION_TICKET; - } else if (handshakeType == ht_certificate) { - return RECORD_CERTIFICATE; - } else if (handshakeType == ht_server_key_exchange) { - return RECORD_SERVER_KEY_EXCHANGE; - } else if (handshakeType == ht_certificate_request) { - return RECORD_CERTIFICATE_REQUEST; - } else if (handshakeType == ht_server_hello_done) { - return RECORD_SERVER_HELLO_DONE; - } else if (handshakeType == ht_certificate_verify) { - return RECORD_CERTIFICATE_VERIFY; - } else if (handshakeType == ht_client_key_exchange) { - return RECORD_CLIENT_KEY_EXCHANGE; - } else if (handshakeType == ht_finished) { - return RECORD_FINISHED; - } else if (handshakeType == ht_certificate_url) { - return RECORD_CERTIFICATE_URL; - } else if (handshakeType == ht_certificate_status) { - return RECORD_CERTIFICATE_STATUS; - } else if (handshakeType == ht_supplemental_data) { - return RECORD_SUPPLIEMENTAL_DATA; - } - - // otherwise, invalid record type - throw new IllegalArgumentException( - "Invalid record type (ContentType:" + contentType + - ", HandshakeType:" + handshakeType + ")"); - } - } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CipherType.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CipherType.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CipherType.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CipherType.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +/** + * Enum for SSL/(D)TLS cipher types. + */ +enum CipherType { + NULL_CIPHER, // null cipher + STREAM_CIPHER, // stream cipher + BLOCK_CIPHER, // block cipher in CBC mode + AEAD_CIPHER // AEAD cipher +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientHandshakeContext.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientHandshakeContext.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientHandshakeContext.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientHandshakeContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.security.cert.X509Certificate; + +import sun.security.ssl.ClientHello.ClientHelloMessage; + +class ClientHandshakeContext extends HandshakeContext { + /* + * Allow unsafe server certificate change? + * + * Server certificate change during SSL/TLS renegotiation may be considered + * unsafe, as described in the Triple Handshake attacks: + * + * https://secure-resumption.com/tlsauth.pdf + * + * Endpoint identification (See + * SSLParameters.getEndpointIdentificationAlgorithm()) is a pretty nice + * guarantee that the server certificate change in renegotiation is legal. + * However, endpoint identification is only enabled for HTTPS and LDAP + * over SSL/TLS by default. It is not enough to protect SSL/TLS + * connections other than HTTPS and LDAP. + * + * The renegotiation indication extension (See RFC 5746) is a pretty + * strong guarantee that the endpoints on both client and server sides + * are identical on the same connection. However, the Triple Handshake + * attacks can bypass this guarantee if there is a session-resumption + * handshake between the initial full handshake and the renegotiation + * full handshake. + * + * Server certificate change may be unsafe and should be restricted if + * endpoint identification is not enabled and the previous handshake is + * a session-resumption abbreviated initial handshake, unless the + * identities represented by both certificates can be regraded as the + * same (See isIdentityEquivalent()). + * + * Considering the compatibility impact and the actual requirements to + * support server certificate change in practice, the system property, + * jdk.tls.allowUnsafeServerCertChange, is used to define whether unsafe + * server certificate change in renegotiation is allowed or not. The + * default value of the system property is "false". To mitigate the + * compatibility impact, applications may want to set the system + * property to "true" at their own risk. + * + * If the value of the system property is "false", server certificate + * change in renegotiation after a session-resumption abbreviated initial + * handshake is restricted (See isIdentityEquivalent()). + * + * If the system property is set to "true" explicitly, the restriction on + * server certificate change in renegotiation is disabled. + */ + static final boolean allowUnsafeServerCertChange = + Utilities.getBooleanProperty( + "jdk.tls.allowUnsafeServerCertChange", false); + + /* + * the reserved server certificate chain in previous handshaking + * + * The server certificate chain is only reserved if the previous + * handshake is a session-resumption abbreviated initial handshake. + */ + X509Certificate[] reservedServerCerts = null; + + X509Certificate[] deferredCerts; + + ClientHelloMessage initialClientHelloMsg = null; + + ClientHandshakeContext(SSLContextImpl sslContext, + TransportContext conContext) throws IOException { + super(sslContext, conContext); + } + + @Override + void kickstart() throws IOException { + if (kickstartMessageDelivered) { + return; + } + + SSLHandshake.kickstart(this); + kickstartMessageDelivered = true; + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientHandshaker.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,2004 +0,0 @@ -/* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.*; -import java.math.BigInteger; -import java.security.*; -import java.util.*; - -import java.security.interfaces.ECPublicKey; -import java.security.interfaces.RSAPublicKey; -import java.security.spec.ECParameterSpec; - -import java.security.cert.X509Certificate; -import java.security.cert.CertificateException; -import java.security.cert.CertificateParsingException; -import java.security.cert.CertPathValidatorException; -import java.security.cert.CertPathValidatorException.Reason; -import java.security.cert.CertPathValidatorException.BasicReason; -import javax.security.auth.x500.X500Principal; - -import javax.crypto.SecretKey; - -import javax.net.ssl.*; - -import sun.security.ssl.HandshakeMessage.*; -import static sun.security.ssl.CipherSuite.KeyExchange.*; - -/** - * ClientHandshaker does the protocol handshaking from the point - * of view of a client. It is driven asychronously by handshake messages - * as delivered by the parent Handshaker class, and also uses - * common functionality (e.g. key generation) that is provided there. - * - * @author David Brownell - */ -final class ClientHandshaker extends Handshaker { - - // constants for subject alt names of type DNS and IP - private static final int ALTNAME_DNS = 2; - private static final int ALTNAME_IP = 7; - - // the server's public key from its certificate. - private PublicKey serverKey; - - // the server's ephemeral public key from the server key exchange message - // for ECDHE/ECDH_anon and RSA_EXPORT. - private PublicKey ephemeralServerKey; - - // server's ephemeral public value for DHE/DH_anon key exchanges - private BigInteger serverDH; - - private DHCrypt dh; - - private ECDHCrypt ecdh; - - private CertificateRequest certRequest; - - private boolean serverKeyExchangeReceived; - - private boolean staplingActive = false; - private X509Certificate[] deferredCerts; - - /* - * The RSA PreMasterSecret needs to know the version of - * ClientHello that was used on this handshake. This represents - * the "max version" this client is supporting. In the - * case of an initial handshake, it's the max version enabled, - * but in the case of a resumption attempt, it's the version - * of the session we're trying to resume. - */ - private ProtocolVersion maxProtocolVersion; - - // To switch off the SNI extension. - private static final boolean enableSNIExtension = - Debug.getBooleanProperty("jsse.enableSNIExtension", true); - - /* - * Allow unsafe server certificate change? - * - * Server certificate change during SSL/TLS renegotiation may be considered - * unsafe, as described in the Triple Handshake attacks: - * - * https://secure-resumption.com/tlsauth.pdf - * - * Endpoint identification (See - * SSLParameters.getEndpointIdentificationAlgorithm()) is a pretty nice - * guarantee that the server certificate change in renegotiation is legal. - * However, endpoing identification is only enabled for HTTPS and LDAP - * over SSL/TLS by default. It is not enough to protect SSL/TLS - * connections other than HTTPS and LDAP. - * - * The renegotiation indication extension (See RFC 5764) is a pretty - * strong guarantee that the endpoints on both client and server sides - * are identical on the same connection. However, the Triple Handshake - * attacks can bypass this guarantee if there is a session-resumption - * handshake between the initial full handshake and the renegotiation - * full handshake. - * - * Server certificate change may be unsafe and should be restricted if - * endpoint identification is not enabled and the previous handshake is - * a session-resumption abbreviated initial handshake, unless the - * identities represented by both certificates can be regraded as the - * same (See isIdentityEquivalent()). - * - * Considering the compatibility impact and the actual requirements to - * support server certificate change in practice, the system property, - * jdk.tls.allowUnsafeServerCertChange, is used to define whether unsafe - * server certificate change in renegotiation is allowed or not. The - * default value of the system property is "false". To mitigate the - * compactibility impact, applications may want to set the system - * property to "true" at their own risk. - * - * If the value of the system property is "false", server certificate - * change in renegotiation after a session-resumption abbreviated initial - * handshake is restricted (See isIdentityEquivalent()). - * - * If the system property is set to "true" explicitly, the restriction on - * server certificate change in renegotiation is disabled. - */ - private static final boolean allowUnsafeServerCertChange = - Debug.getBooleanProperty("jdk.tls.allowUnsafeServerCertChange", false); - - // To switch off the max_fragment_length extension. - private static final boolean enableMFLExtension = - Debug.getBooleanProperty("jsse.enableMFLExtension", false); - - // To switch off the supported_groups extension for DHE cipher suite. - private static final boolean enableFFDHE = - Debug.getBooleanProperty("jsse.enableFFDHE", true); - - // Whether an ALPN extension was sent in the ClientHello - private boolean alpnActive = false; - - private List<SNIServerName> requestedServerNames = - Collections.<SNIServerName>emptyList(); - - // maximum fragment length - private int requestedMFLength = -1; // -1: no fragment length limit - - private boolean serverNamesAccepted = false; - - private ClientHello initialClientHelloMsg = null; // DTLS only - - /* - * the reserved server certificate chain in previous handshaking - * - * The server certificate chain is only reserved if the previous - * handshake is a session-resumption abbreviated initial handshake. - */ - private X509Certificate[] reservedServerCerts = null; - - /* - * Constructors - */ - ClientHandshaker(SSLSocketImpl socket, SSLContextImpl context, - ProtocolList enabledProtocols, - ProtocolVersion activeProtocolVersion, - boolean isInitialHandshake, boolean secureRenegotiation, - byte[] clientVerifyData, byte[] serverVerifyData) { - - super(socket, context, enabledProtocols, true, true, - activeProtocolVersion, isInitialHandshake, secureRenegotiation, - clientVerifyData, serverVerifyData); - } - - ClientHandshaker(SSLEngineImpl engine, SSLContextImpl context, - ProtocolList enabledProtocols, - ProtocolVersion activeProtocolVersion, - boolean isInitialHandshake, boolean secureRenegotiation, - byte[] clientVerifyData, byte[] serverVerifyData, - boolean isDTLS) { - - super(engine, context, enabledProtocols, true, true, - activeProtocolVersion, isInitialHandshake, secureRenegotiation, - clientVerifyData, serverVerifyData, isDTLS); - } - - /* - * This routine handles all the client side handshake messages, one at - * a time. Given the message type (and in some cases the pending cipher - * spec) it parses the type-specific message. Then it calls a function - * that handles that specific message. - * - * It updates the state machine (need to verify it) as each message - * is processed, and writes responses as needed using the connection - * in the constructor. - */ - @Override - void processMessage(byte type, int messageLen) throws IOException { - // check the handshake state - List<Byte> ignoredOptStates = handshakeState.check(type); - - // If the state machine has skipped over certificate status - // and stapling was enabled, we need to check the chain immediately - // because it was deferred, waiting for CertificateStatus. - if (staplingActive && ignoredOptStates.contains( - HandshakeMessage.ht_certificate_status)) { - checkServerCerts(deferredCerts); - serverKey = session.getPeerCertificates()[0].getPublicKey(); - } - - switch (type) { - case HandshakeMessage.ht_hello_request: - HelloRequest helloRequest = new HelloRequest(input); - handshakeState.update(helloRequest, resumingSession); - this.serverHelloRequest(helloRequest); - break; - - case HandshakeMessage.ht_hello_verify_request: - if (!isDTLS) { - throw new SSLProtocolException( - "hello_verify_request is not a SSL/TLS handshake message"); - } - - HelloVerifyRequest helloVerifyRequest = - new HelloVerifyRequest(input, messageLen); - handshakeState.update(helloVerifyRequest, resumingSession); - this.helloVerifyRequest(helloVerifyRequest); - break; - - case HandshakeMessage.ht_server_hello: - ServerHello serverHello = new ServerHello(input, messageLen); - this.serverHello(serverHello); - - // This handshake state update needs the resumingSession value - // set by serverHello(). - handshakeState.update(serverHello, resumingSession); - break; - - case HandshakeMessage.ht_certificate: - if (keyExchange == K_DH_ANON || keyExchange == K_ECDH_ANON - || ClientKeyExchangeService.find(keyExchange.name) != null) { - // No external key exchange provider needs a cert now. - fatalSE(Alerts.alert_unexpected_message, - "unexpected server cert chain"); - // NOTREACHED - } - CertificateMsg certificateMsg = new CertificateMsg(input); - handshakeState.update(certificateMsg, resumingSession); - this.serverCertificate(certificateMsg); - if (!staplingActive) { - // If we are not doing stapling, we can set serverKey right - // away. Otherwise, we will wait until verification of the - // chain has completed after CertificateStatus; - serverKey = session.getPeerCertificates()[0].getPublicKey(); - } - break; - - case HandshakeMessage.ht_certificate_status: - CertificateStatus certStatusMsg = new CertificateStatus(input); - handshakeState.update(certStatusMsg, resumingSession); - this.certificateStatus(certStatusMsg); - serverKey = session.getPeerCertificates()[0].getPublicKey(); - break; - - case HandshakeMessage.ht_server_key_exchange: - serverKeyExchangeReceived = true; - switch (keyExchange) { - case K_RSA_EXPORT: - /** - * The server key exchange message is sent by the server only - * when the server certificate message does not contain the - * proper amount of data to allow the client to exchange a - * premaster secret, such as when RSA_EXPORT is used and the - * public key in the server certificate is longer than 512 bits. - */ - if (serverKey == null) { - throw new SSLProtocolException - ("Server did not send certificate message"); - } - - if (!(serverKey instanceof RSAPublicKey)) { - throw new SSLProtocolException("Protocol violation:" + - " the certificate type must be appropriate for the" + - " selected cipher suite's key exchange algorithm"); - } - - if (JsseJce.getRSAKeyLength(serverKey) <= 512) { - throw new SSLProtocolException("Protocol violation:" + - " server sent a server key exchange message for" + - " key exchange " + keyExchange + - " when the public key in the server certificate" + - " is less than or equal to 512 bits in length"); - } - - try { - RSA_ServerKeyExchange rsaSrvKeyExchange = - new RSA_ServerKeyExchange(input); - handshakeState.update(rsaSrvKeyExchange, resumingSession); - this.serverKeyExchange(rsaSrvKeyExchange); - } catch (GeneralSecurityException e) { - throw new SSLException("Server key", e); - } - break; - case K_DH_ANON: - try { - DH_ServerKeyExchange dhSrvKeyExchange = - new DH_ServerKeyExchange(input, protocolVersion); - handshakeState.update(dhSrvKeyExchange, resumingSession); - this.serverKeyExchange(dhSrvKeyExchange); - } catch (GeneralSecurityException e) { - throw new SSLException("Server key", e); - } - break; - case K_DHE_DSS: - case K_DHE_RSA: - try { - DH_ServerKeyExchange dhSrvKeyExchange = - new DH_ServerKeyExchange( - input, serverKey, - clnt_random.random_bytes, svr_random.random_bytes, - messageLen, - getLocalSupportedSignAlgs(), protocolVersion); - handshakeState.update(dhSrvKeyExchange, resumingSession); - this.serverKeyExchange(dhSrvKeyExchange); - } catch (GeneralSecurityException e) { - throw new SSLException("Server key", e); - } - break; - case K_ECDHE_ECDSA: - case K_ECDHE_RSA: - case K_ECDH_ANON: - try { - ECDH_ServerKeyExchange ecdhSrvKeyExchange = - new ECDH_ServerKeyExchange - (input, serverKey, clnt_random.random_bytes, - svr_random.random_bytes, - getLocalSupportedSignAlgs(), protocolVersion); - handshakeState.update(ecdhSrvKeyExchange, resumingSession); - this.serverKeyExchange(ecdhSrvKeyExchange); - } catch (GeneralSecurityException e) { - throw new SSLException("Server key", e); - } - break; - case K_RSA: - case K_DH_RSA: - case K_DH_DSS: - case K_ECDH_ECDSA: - case K_ECDH_RSA: - throw new SSLProtocolException( - "Protocol violation: server sent a server key exchange" - + " message for key exchange " + keyExchange); - default: - throw new SSLProtocolException( - "unsupported or unexpected key exchange algorithm = " - + keyExchange); - } - break; - - case HandshakeMessage.ht_certificate_request: - // save for later, it's handled by serverHelloDone - if ((keyExchange == K_DH_ANON) || (keyExchange == K_ECDH_ANON)) { - throw new SSLHandshakeException( - "Client authentication requested for "+ - "anonymous cipher suite."); - } else if (ClientKeyExchangeService.find(keyExchange.name) != null) { - // No external key exchange provider needs a cert now. - throw new SSLHandshakeException( - "Client certificate requested for "+ - "external cipher suite: " + keyExchange); - } - certRequest = new CertificateRequest(input, protocolVersion); - if (debug != null && Debug.isOn("handshake")) { - certRequest.print(System.out); - } - handshakeState.update(certRequest, resumingSession); - - if (protocolVersion.useTLS12PlusSpec()) { - Collection<SignatureAndHashAlgorithm> peerSignAlgs = - certRequest.getSignAlgorithms(); - if (peerSignAlgs == null || peerSignAlgs.isEmpty()) { - throw new SSLHandshakeException( - "No peer supported signature algorithms"); - } - - Collection<SignatureAndHashAlgorithm> supportedPeerSignAlgs = - SignatureAndHashAlgorithm.getSupportedAlgorithms( - algorithmConstraints, peerSignAlgs); - if (supportedPeerSignAlgs.isEmpty()) { - throw new SSLHandshakeException( - "No supported signature and hash algorithm in common"); - } - - setPeerSupportedSignAlgs(supportedPeerSignAlgs); - session.setPeerSupportedSignatureAlgorithms( - supportedPeerSignAlgs); - } - - break; - - case HandshakeMessage.ht_server_hello_done: - ServerHelloDone serverHelloDone = new ServerHelloDone(input); - handshakeState.update(serverHelloDone, resumingSession); - this.serverHelloDone(serverHelloDone); - - break; - - case HandshakeMessage.ht_finished: - Finished serverFinished = - new Finished(protocolVersion, input, cipherSuite); - handshakeState.update(serverFinished, resumingSession); - this.serverFinished(serverFinished); - - break; - - default: - throw new SSLProtocolException( - "Illegal client handshake msg, " + type); - } - } - - /* - * Used by the server to kickstart negotiations -- this requests a - * "client hello" to renegotiate current cipher specs (e.g. maybe lots - * of data has been encrypted with the same keys, or the server needs - * the client to present a certificate). - */ - private void serverHelloRequest(HelloRequest mesg) throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - // - // Could be (e.g. at connection setup) that we already - // sent the "client hello" but the server's not seen it. - // - if (!clientHelloDelivered) { - if (!secureRenegotiation && !allowUnsafeRenegotiation) { - // renegotiation is not allowed. - if (activeProtocolVersion.useTLS10PlusSpec()) { - // response with a no_renegotiation warning, - warningSE(Alerts.alert_no_renegotiation); - - // invalidate the handshake so that the caller can - // dispose this object. - invalidated = true; - - // If there is still unread block in the handshake - // input stream, it would be truncated with the disposal - // and the next handshake message will become incomplete. - // - // However, according to SSL/TLS specifications, no more - // handshake message should immediately follow ClientHello - // or HelloRequest. So just let it be. - } else { - // For SSLv3, send the handshake_failure fatal error. - // Note that SSLv3 does not define a no_renegotiation - // alert like TLSv1. However we cannot ignore the message - // simply, otherwise the other side was waiting for a - // response that would never come. - fatalSE(Alerts.alert_handshake_failure, - "Renegotiation is not allowed"); - } - } else { - if (!secureRenegotiation) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println( - "Warning: continue with insecure renegotiation"); - } - } - kickstart(); - } - } - } - - private void helloVerifyRequest( - HelloVerifyRequest mesg) throws IOException { - - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - // - // Note that HelloVerifyRequest.server_version is used solely to - // indicate packet formatting, and not as part of version negotiation. - // Need not to check version values match for HelloVerifyRequest - // message. - // - initialClientHelloMsg.cookie = mesg.cookie.clone(); - - if (debug != null && Debug.isOn("handshake")) { - initialClientHelloMsg.print(System.out); - } - - // deliver the ClientHello message with cookie - initialClientHelloMsg.write(output); - handshakeState.update(initialClientHelloMsg, resumingSession); - } - - /* - * Server chooses session parameters given options created by the - * client -- basically, cipher options, session id, and someday a - * set of compression options. - * - * There are two branches of the state machine, decided by the - * details of this message. One is the "fast" handshake, where we - * can resume the pre-existing session we asked resume. The other - * is a more expensive "full" handshake, with key exchange and - * probably authentication getting done. - */ - private void serverHello(ServerHello mesg) throws IOException { - // Dispose the reserved ClientHello message (if exists). - initialClientHelloMsg = null; - - serverKeyExchangeReceived = false; - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - // check if the server selected protocol version is OK for us - ProtocolVersion mesgVersion = mesg.protocolVersion; - if (!isNegotiable(mesgVersion)) { - throw new SSLHandshakeException( - "Server chose " + mesgVersion + - ", but that protocol version is not enabled or not supported " + - "by the client."); - } - - handshakeHash.protocolDetermined(mesgVersion); - - // Set protocolVersion and propagate to SSLSocket and the - // Handshake streams - setVersion(mesgVersion); - - // check the "renegotiation_info" extension - RenegotiationInfoExtension serverHelloRI = (RenegotiationInfoExtension) - mesg.extensions.get(ExtensionType.EXT_RENEGOTIATION_INFO); - if (serverHelloRI != null) { - if (isInitialHandshake) { - // verify the length of the "renegotiated_connection" field - if (!serverHelloRI.isEmpty()) { - // abort the handshake with a fatal handshake_failure alert - fatalSE(Alerts.alert_handshake_failure, - "The renegotiation_info field is not empty"); - } - - secureRenegotiation = true; - } else { - // For a legacy renegotiation, the client MUST verify that - // it does not contain the "renegotiation_info" extension. - if (!secureRenegotiation) { - fatalSE(Alerts.alert_handshake_failure, - "Unexpected renegotiation indication extension"); - } - - // verify the client_verify_data and server_verify_data values - byte[] verifyData = - new byte[clientVerifyData.length + serverVerifyData.length]; - System.arraycopy(clientVerifyData, 0, verifyData, - 0, clientVerifyData.length); - System.arraycopy(serverVerifyData, 0, verifyData, - clientVerifyData.length, serverVerifyData.length); - if (!MessageDigest.isEqual(verifyData, - serverHelloRI.getRenegotiatedConnection())) { - fatalSE(Alerts.alert_handshake_failure, - "Incorrect verify data in ServerHello " + - "renegotiation_info message"); - } - } - } else { - // no renegotiation indication extension - if (isInitialHandshake) { - if (!allowLegacyHelloMessages) { - // abort the handshake with a fatal handshake_failure alert - fatalSE(Alerts.alert_handshake_failure, - "Failed to negotiate the use of secure renegotiation"); - } - - secureRenegotiation = false; - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Warning: No renegotiation " + - "indication extension in ServerHello"); - } - } else { - // For a secure renegotiation, the client must abort the - // handshake if no "renegotiation_info" extension is present. - if (secureRenegotiation) { - fatalSE(Alerts.alert_handshake_failure, - "No renegotiation indication extension"); - } - - // we have already allowed unsafe renegotation before request - // the renegotiation. - } - } - - // - // Save server nonce, we always use it to compute connection - // keys and it's also used to create the master secret if we're - // creating a new session (i.e. in the full handshake). - // - svr_random = mesg.svr_random; - - if (isNegotiable(mesg.cipherSuite) == false) { - fatalSE(Alerts.alert_illegal_parameter, - "Server selected improper ciphersuite " + mesg.cipherSuite); - } - - setCipherSuite(mesg.cipherSuite); - if (protocolVersion.useTLS12PlusSpec()) { - handshakeHash.setFinishedAlg(cipherSuite.prfAlg.getPRFHashAlg()); - } - - if (mesg.compression_method != 0) { - fatalSE(Alerts.alert_illegal_parameter, - "compression type not supported, " - + mesg.compression_method); - // NOTREACHED - } - - // so far so good, let's look at the session - if (session != null) { - // we tried to resume, let's see what the server decided - if (session.getSessionId().equals(mesg.sessionId)) { - // server resumed the session, let's make sure everything - // checks out - - // Verify that the session ciphers are unchanged. - CipherSuite sessionSuite = session.getSuite(); - if (cipherSuite != sessionSuite) { - throw new SSLProtocolException - ("Server returned wrong cipher suite for session"); - } - - // verify protocol version match - ProtocolVersion sessionVersion = session.getProtocolVersion(); - if (protocolVersion != sessionVersion) { - throw new SSLProtocolException - ("Server resumed session with wrong protocol version"); - } - - // validate subject identity - ClientKeyExchangeService p = - ClientKeyExchangeService.find( - sessionSuite.keyExchange.name); - if (p != null) { - Principal localPrincipal = session.getLocalPrincipal(); - - if (p.isRelated(true, getAccSE(), localPrincipal)) { - if (debug != null && Debug.isOn("session")) - System.out.println("Subject identity is same"); - } else { - throw new SSLProtocolException( - "Server resumed session with " + - "wrong subject identity or no subject"); - } - } - - // looks fine; resume it. - resumingSession = true; - calculateConnectionKeys(session.getMasterSecret()); - if (debug != null && Debug.isOn("session")) { - System.out.println("%% Server resumed " + session); - } - } else { - // we wanted to resume, but the server refused - // - // Invalidate the session for initial handshake in case - // of reusing next time. - if (isInitialHandshake) { - session.invalidate(); - } - session = null; - if (!enableNewSession) { - throw new SSLException("New session creation is disabled"); - } - } - } - - // check the "max_fragment_length" extension - MaxFragmentLengthExtension maxFragLenExt = (MaxFragmentLengthExtension) - mesg.extensions.get(ExtensionType.EXT_MAX_FRAGMENT_LENGTH); - if (maxFragLenExt != null) { - if ((requestedMFLength == -1) || - maxFragLenExt.getMaxFragLen() != requestedMFLength) { - // If the client did not request this extension, or the - // response value is different from the length it requested, - // abort the handshake with a fatal illegal_parameter alert. - fatalSE(Alerts.alert_illegal_parameter, - "Failed to negotiate the max_fragment_length"); - } - } else if (!resumingSession) { - // no "max_fragment_length" extension - requestedMFLength = -1; - } // Otherwise, using the value negotiated during the original - // session initiation - - // check the "extended_master_secret" extension - ExtendedMasterSecretExtension extendedMasterSecretExt = - (ExtendedMasterSecretExtension)mesg.extensions.get( - ExtensionType.EXT_EXTENDED_MASTER_SECRET); - if (extendedMasterSecretExt != null) { - // Is it the expected server extension? - if (!useExtendedMasterSecret || - !mesgVersion.useTLS10PlusSpec() || !requestedToUseEMS) { - fatalSE(Alerts.alert_unsupported_extension, - "Server sent the extended_master_secret " + - "extension improperly"); - } - - // For abbreviated handshake, if the original session did not use - // the "extended_master_secret" extension but the new ServerHello - // contains the extension, the client MUST abort the handshake. - if (resumingSession && (session != null) && - !session.getUseExtendedMasterSecret()) { - fatalSE(Alerts.alert_unsupported_extension, - "Server sent an unexpected extended_master_secret " + - "extension on session resumption"); - } - } else { - if (useExtendedMasterSecret && !allowLegacyMasterSecret) { - // For full handshake, if a client receives a ServerHello - // without the extension, it SHOULD abort the handshake if - // it does not wish to interoperate with legacy servers. - fatalSE(Alerts.alert_handshake_failure, - "Extended Master Secret extension is required"); - } - - if (resumingSession && (session != null)) { - if (session.getUseExtendedMasterSecret()) { - // For abbreviated handshake, if the original session used - // the "extended_master_secret" extension but the new - // ServerHello does not contain the extension, the client - // MUST abort the handshake. - fatalSE(Alerts.alert_handshake_failure, - "Missing Extended Master Secret extension " + - "on session resumption"); - } else if (useExtendedMasterSecret && !allowLegacyResumption) { - // Unlikely, abbreviated handshake should be discarded. - fatalSE(Alerts.alert_handshake_failure, - "Extended Master Secret extension is required"); - } - } - } - - // check the ALPN extension - ALPNExtension serverHelloALPN = - (ALPNExtension) mesg.extensions.get(ExtensionType.EXT_ALPN); - - if (serverHelloALPN != null) { - // Check whether an ALPN extension was sent in ClientHello message - if (!alpnActive) { - fatalSE(Alerts.alert_unsupported_extension, - "Server sent " + ExtensionType.EXT_ALPN + - " extension when not requested by client"); - } - - List<String> protocols = serverHelloALPN.getPeerAPs(); - // Only one application protocol name should be present - String p; - if ((protocols.size() == 1) && - !((p = protocols.get(0)).isEmpty())) { - int i; - for (i = 0; i < localApl.length; i++) { - if (localApl[i].equals(p)) { - break; - } - } - if (i == localApl.length) { - fatalSE(Alerts.alert_handshake_failure, - "Server has selected an application protocol name " + - "which was not offered by the client: " + p); - } - applicationProtocol = p; - } else { - fatalSE(Alerts.alert_handshake_failure, - "Incorrect data in ServerHello " + ExtensionType.EXT_ALPN + - " message"); - } - } else { - applicationProtocol = ""; - } - - if (resumingSession && session != null) { - setHandshakeSessionSE(session); - // Reserve the handshake state if this is a session-resumption - // abbreviated initial handshake. - if (isInitialHandshake) { - session.setAsSessionResumption(true); - } - - return; - } - - // check extensions - for (HelloExtension ext : mesg.extensions.list()) { - ExtensionType type = ext.type; - if (type == ExtensionType.EXT_SERVER_NAME) { - serverNamesAccepted = true; - } else if (type == ExtensionType.EXT_STATUS_REQUEST || - type == ExtensionType.EXT_STATUS_REQUEST_V2) { - // Only enable the stapling feature if the client asserted - // these extensions. - if (sslContext.isStaplingEnabled(true)) { - staplingActive = true; - } else { - fatalSE(Alerts.alert_unexpected_message, "Server set " + - type + " extension when not requested by client"); - } - } else if ((type != ExtensionType.EXT_SUPPORTED_GROUPS) - && (type != ExtensionType.EXT_EC_POINT_FORMATS) - && (type != ExtensionType.EXT_SERVER_NAME) - && (type != ExtensionType.EXT_ALPN) - && (type != ExtensionType.EXT_RENEGOTIATION_INFO) - && (type != ExtensionType.EXT_STATUS_REQUEST) - && (type != ExtensionType.EXT_STATUS_REQUEST_V2) - && (type != ExtensionType.EXT_EXTENDED_MASTER_SECRET)) { - // Note: Better to check client requested extensions rather - // than all supported extensions. - fatalSE(Alerts.alert_unsupported_extension, - "Server sent an unsupported extension: " + type); - } - } - - // Create a new session, we need to do the full handshake - session = new SSLSessionImpl(protocolVersion, cipherSuite, - getLocalSupportedSignAlgs(), - mesg.sessionId, getHostSE(), getPortSE(), - (extendedMasterSecretExt != null)); - session.setRequestedServerNames(requestedServerNames); - session.setNegotiatedMaxFragSize(requestedMFLength); - session.setMaximumPacketSize(maximumPacketSize); - setHandshakeSessionSE(session); - if (debug != null && Debug.isOn("handshake")) { - System.out.println("** " + cipherSuite); - } - } - - /* - * Server's own key was either a signing-only key, or was too - * large for export rules ... this message holds an ephemeral - * RSA key to use for key exchange. - */ - private void serverKeyExchange(RSA_ServerKeyExchange mesg) - throws IOException, GeneralSecurityException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - if (!mesg.verify(serverKey, clnt_random, svr_random)) { - fatalSE(Alerts.alert_handshake_failure, - "server key exchange invalid"); - // NOTREACHED - } - ephemeralServerKey = mesg.getPublicKey(); - - // check constraints of RSA PublicKey - if (!algorithmConstraints.permits( - EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), ephemeralServerKey)) { - - throw new SSLHandshakeException("RSA ServerKeyExchange " + - "does not comply to algorithm constraints"); - } - } - - /* - * Diffie-Hellman key exchange. We save the server public key and - * our own D-H algorithm object so we can defer key calculations - * until after we've sent the client key exchange message (which - * gives client and server some useful parallelism). - * - * Note per section 3 of RFC 7919, if the server is not compatible with - * FFDHE specification, the client MAY decide to continue the connection - * if the selected DHE group is acceptable under local policy, or it MAY - * decide to terminate the connection with a fatal insufficient_security - * (71) alert. The algorithm constraints mechanism is JDK local policy - * used for additional DHE parameters checking. So this implementation - * does not check the server compatibility and just pass to the local - * algorithm constraints checking. The client will continue the - * connection if the server selected DHE group is acceptable by the - * specified algorithm constraints. - */ - private void serverKeyExchange(DH_ServerKeyExchange mesg) - throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - dh = new DHCrypt(mesg.getModulus(), mesg.getBase(), - sslContext.getSecureRandom()); - serverDH = mesg.getServerPublicKey(); - - // check algorithm constraints - dh.checkConstraints(algorithmConstraints, serverDH); - } - - private void serverKeyExchange(ECDH_ServerKeyExchange mesg) - throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - ECPublicKey key = mesg.getPublicKey(); - ecdh = new ECDHCrypt(key.getParams(), sslContext.getSecureRandom()); - ephemeralServerKey = key; - - // check constraints of EC PublicKey - if (!algorithmConstraints.permits( - EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), ephemeralServerKey)) { - - throw new SSLHandshakeException("ECDH ServerKeyExchange " + - "does not comply to algorithm constraints"); - } - } - - /* - * The server's "Hello Done" message is the client's sign that - * it's time to do all the hard work. - */ - private void serverHelloDone(ServerHelloDone mesg) throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - /* - * FIRST ... if requested, send an appropriate Certificate chain - * to authenticate the client, and remember the associated private - * key to sign the CertificateVerify message. - */ - PrivateKey signingKey = null; - - if (certRequest != null) { - X509ExtendedKeyManager km = sslContext.getX509KeyManager(); - - ArrayList<String> keytypesTmp = new ArrayList<>(4); - - for (int i = 0; i < certRequest.types.length; i++) { - String typeName; - - switch (certRequest.types[i]) { - case CertificateRequest.cct_rsa_sign: - typeName = "RSA"; - break; - - case CertificateRequest.cct_dss_sign: - typeName = "DSA"; - break; - - case CertificateRequest.cct_ecdsa_sign: - // ignore if we do not have EC crypto available - typeName = JsseJce.isEcAvailable() ? "EC" : null; - break; - - // Fixed DH/ECDH client authentication not supported - // - // case CertificateRequest.cct_rsa_fixed_dh: - // case CertificateRequest.cct_dss_fixed_dh: - // case CertificateRequest.cct_rsa_fixed_ecdh: - // case CertificateRequest.cct_ecdsa_fixed_ecdh: - // - // Any other values (currently not used in TLS) - // - // case CertificateRequest.cct_rsa_ephemeral_dh: - // case CertificateRequest.cct_dss_ephemeral_dh: - default: - typeName = null; - break; - } - - if ((typeName != null) && (!keytypesTmp.contains(typeName))) { - keytypesTmp.add(typeName); - } - } - - String alias = null; - int keytypesTmpSize = keytypesTmp.size(); - if (keytypesTmpSize != 0) { - String[] keytypes = - keytypesTmp.toArray(new String[keytypesTmpSize]); - - if (conn != null) { - alias = km.chooseClientAlias(keytypes, - certRequest.getAuthorities(), conn); - } else { - alias = km.chooseEngineClientAlias(keytypes, - certRequest.getAuthorities(), engine); - } - } - - CertificateMsg m1 = null; - if (alias != null) { - X509Certificate[] certs = km.getCertificateChain(alias); - if ((certs != null) && (certs.length != 0)) { - PublicKey publicKey = certs[0].getPublicKey(); - if (publicKey != null) { - m1 = new CertificateMsg(certs); - signingKey = km.getPrivateKey(alias); - session.setLocalPrivateKey(signingKey); - session.setLocalCertificates(certs); - } - } - } - if (m1 == null) { - // - // No appropriate cert was found ... report this to the - // server. For SSLv3, send the no_certificate alert; - // TLS uses an empty cert chain instead. - // - if (protocolVersion.useTLS10PlusSpec()) { - m1 = new CertificateMsg(new X509Certificate [0]); - } else { - warningSE(Alerts.alert_no_certificate); - } - if (debug != null && Debug.isOn("handshake")) { - System.out.println( - "Warning: no suitable certificate found - " + - "continuing without client authentication"); - } - } - - // - // At last ... send any client certificate chain. - // - if (m1 != null) { - if (debug != null && Debug.isOn("handshake")) { - m1.print(System.out); - } - m1.write(output); - handshakeState.update(m1, resumingSession); - } - } - - /* - * SECOND ... send the client key exchange message. The - * procedure used is a function of the cipher suite selected; - * one is always needed. - */ - HandshakeMessage m2; - - switch (keyExchange) { - - case K_RSA: - case K_RSA_EXPORT: - if (serverKey == null) { - throw new SSLProtocolException - ("Server did not send certificate message"); - } - - if (!(serverKey instanceof RSAPublicKey)) { - throw new SSLProtocolException - ("Server certificate does not include an RSA key"); - } - - /* - * For RSA key exchange, we randomly generate a new - * pre-master secret and encrypt it with the server's - * public key. Then we save that pre-master secret - * so that we can calculate the keying data later; - * it's a performance speedup not to do that until - * the client's waiting for the server response, but - * more of a speedup for the D-H case. - * - * If the RSA_EXPORT scheme is active, when the public - * key in the server certificate is less than or equal - * to 512 bits in length, use the cert's public key, - * otherwise, the ephemeral one. - */ - PublicKey key; - if (keyExchange == K_RSA) { - key = serverKey; - } else { // K_RSA_EXPORT - if (JsseJce.getRSAKeyLength(serverKey) <= 512) { - // extraneous ephemeralServerKey check done - // above in processMessage() - key = serverKey; - } else { - if (ephemeralServerKey == null) { - throw new SSLProtocolException("Server did not send" + - " a RSA_EXPORT Server Key Exchange message"); - } - key = ephemeralServerKey; - } - } - - m2 = new RSAClientKeyExchange(protocolVersion, maxProtocolVersion, - sslContext.getSecureRandom(), key); - break; - case K_DH_RSA: - case K_DH_DSS: - /* - * For DH Key exchange, we only need to make sure the server - * knows our public key, so we calculate the same pre-master - * secret. - * - * For certs that had DH keys in them, we send an empty - * handshake message (no key) ... we flag this case by - * passing a null "dhPublic" value. - * - * Otherwise we send ephemeral DH keys, unsigned. - */ - // if (useDH_RSA || useDH_DSS) - m2 = new DHClientKeyExchange(); - break; - case K_DHE_RSA: - case K_DHE_DSS: - case K_DH_ANON: - if (dh == null) { - throw new SSLProtocolException - ("Server did not send a DH Server Key Exchange message"); - } - m2 = new DHClientKeyExchange(dh.getPublicKey()); - break; - case K_ECDHE_RSA: - case K_ECDHE_ECDSA: - case K_ECDH_ANON: - if (ecdh == null) { - throw new SSLProtocolException - ("Server did not send a ECDH Server Key Exchange message"); - } - m2 = new ECDHClientKeyExchange(ecdh.getPublicKey()); - break; - case K_ECDH_RSA: - case K_ECDH_ECDSA: - if (serverKey == null) { - throw new SSLProtocolException - ("Server did not send certificate message"); - } - if (serverKey instanceof ECPublicKey == false) { - throw new SSLProtocolException - ("Server certificate does not include an EC key"); - } - ECParameterSpec params = ((ECPublicKey)serverKey).getParams(); - ecdh = new ECDHCrypt(params, sslContext.getSecureRandom()); - m2 = new ECDHClientKeyExchange(ecdh.getPublicKey()); - break; - default: - ClientKeyExchangeService p = - ClientKeyExchangeService.find(keyExchange.name); - if (p == null) { - // somethings very wrong - throw new RuntimeException - ("Unsupported key exchange: " + keyExchange); - } - String sniHostname = null; - for (SNIServerName serverName : requestedServerNames) { - if (serverName instanceof SNIHostName) { - sniHostname = ((SNIHostName) serverName).getAsciiName(); - break; - } - } - - ClientKeyExchange exMsg = null; - if (sniHostname != null) { - // use first requested SNI hostname - try { - exMsg = p.createClientExchange( - sniHostname, getAccSE(), protocolVersion, - sslContext.getSecureRandom()); - } catch(IOException e) { - if (serverNamesAccepted) { - // server accepted requested SNI hostname, - // so it must be used - throw e; - } - // fallback to using hostname - if (debug != null && Debug.isOn("handshake")) { - System.out.println( - "Warning, cannot use Server Name Indication: " - + e.getMessage()); - } - } - } - - if (exMsg == null) { - String hostname = getHostSE(); - if (hostname == null) { - throw new IOException("Hostname is required" + - " to use " + keyExchange + " key exchange"); - } - exMsg = p.createClientExchange( - hostname, getAccSE(), protocolVersion, - sslContext.getSecureRandom()); - } - - // Record the principals involved in exchange - session.setPeerPrincipal(exMsg.getPeerPrincipal()); - session.setLocalPrincipal(exMsg.getLocalPrincipal()); - m2 = exMsg; - break; - } - if (debug != null && Debug.isOn("handshake")) { - m2.print(System.out); - } - m2.write(output); - handshakeState.update(m2, resumingSession); - - /* - * THIRD, send a "change_cipher_spec" record followed by the - * "Finished" message. We flush the messages we've queued up, to - * get concurrency between client and server. The concurrency is - * useful as we calculate the master secret, which is needed both - * to compute the "Finished" message, and to compute the keys used - * to protect all records following the change_cipher_spec. - */ - output.flush(); - - /* - * We deferred calculating the master secret and this connection's - * keying data; we do it now. Deferring this calculation is good - * from a performance point of view, since it lets us do it during - * some time that network delays and the server's own calculations - * would otherwise cause to be "dead" in the critical path. - */ - SecretKey preMasterSecret; - switch (keyExchange) { - case K_RSA: - case K_RSA_EXPORT: - preMasterSecret = ((RSAClientKeyExchange)m2).preMaster; - break; - case K_DHE_RSA: - case K_DHE_DSS: - case K_DH_ANON: - preMasterSecret = dh.getAgreedSecret(serverDH, true); - break; - case K_ECDHE_RSA: - case K_ECDHE_ECDSA: - case K_ECDH_ANON: - preMasterSecret = ecdh.getAgreedSecret(ephemeralServerKey); - break; - case K_ECDH_RSA: - case K_ECDH_ECDSA: - preMasterSecret = ecdh.getAgreedSecret(serverKey); - break; - default: - if (ClientKeyExchangeService.find(keyExchange.name) != null) { - preMasterSecret = - ((ClientKeyExchange) m2).clientKeyExchange(); - } else { - throw new IOException("Internal error: unknown key exchange " - + keyExchange); - } - } - - calculateKeys(preMasterSecret, null); - - /* - * FOURTH, if we sent a Certificate, we need to send a signed - * CertificateVerify (unless the key in the client's certificate - * was a Diffie-Hellman key). - * - * This uses a hash of the previous handshake messages ... either - * a nonfinal one (if the particular implementation supports it) - * or else using the third element in the arrays of hashes being - * computed. - */ - if (signingKey != null) { - CertificateVerify m3; - try { - SignatureAndHashAlgorithm preferableSignatureAlgorithm = null; - if (protocolVersion.useTLS12PlusSpec()) { - preferableSignatureAlgorithm = - SignatureAndHashAlgorithm.getPreferableAlgorithm( - getPeerSupportedSignAlgs(), - signingKey.getAlgorithm(), signingKey); - - if (preferableSignatureAlgorithm == null) { - throw new SSLHandshakeException( - "No supported signature algorithm"); - } - - String hashAlg = - SignatureAndHashAlgorithm.getHashAlgorithmName( - preferableSignatureAlgorithm); - if (hashAlg == null || hashAlg.length() == 0) { - throw new SSLHandshakeException( - "No supported hash algorithm"); - } - } - - m3 = new CertificateVerify(protocolVersion, handshakeHash, - signingKey, session.getMasterSecret(), - sslContext.getSecureRandom(), - preferableSignatureAlgorithm); - } catch (GeneralSecurityException e) { - fatalSE(Alerts.alert_handshake_failure, - "Error signing certificate verify", e); - // NOTREACHED, make compiler happy - m3 = null; - } - if (debug != null && Debug.isOn("handshake")) { - m3.print(System.out); - } - m3.write(output); - handshakeState.update(m3, resumingSession); - output.flush(); - } - - /* - * OK, that's that! - */ - sendChangeCipherAndFinish(false); - - // expecting the final ChangeCipherSpec and Finished messages - expectingFinishFlightSE(); - } - - - /* - * "Finished" is the last handshake message sent. If we got this - * far, the MAC has been validated post-decryption. We validate - * the two hashes here as an additional sanity check, protecting - * the handshake against various active attacks. - */ - private void serverFinished(Finished mesg) throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - boolean verified = mesg.verify(handshakeHash, Finished.SERVER, - session.getMasterSecret()); - - if (!verified) { - fatalSE(Alerts.alert_illegal_parameter, - "server 'finished' message doesn't verify"); - // NOTREACHED - } - - /* - * save server verify data for secure renegotiation - */ - if (secureRenegotiation) { - serverVerifyData = mesg.getVerifyData(); - } - - /* - * Reset the handshake state if this is not an initial handshake. - */ - if (!isInitialHandshake) { - session.setAsSessionResumption(false); - } - - /* - * OK, it verified. If we're doing the fast handshake, add that - * "Finished" message to the hash of handshake messages, then send - * our own change_cipher_spec and Finished message for the server - * to verify in turn. These are the last handshake messages. - * - * In any case, update the session cache. We're done handshaking, - * so there are no threats any more associated with partially - * completed handshakes. - */ - if (resumingSession) { - sendChangeCipherAndFinish(true); - } else { - handshakeFinished = true; - } - session.setLastAccessedTime(System.currentTimeMillis()); - - if (!resumingSession) { - if (session.isRejoinable()) { - ((SSLSessionContextImpl) sslContext - .engineGetClientSessionContext()) - .put(session); - if (debug != null && Debug.isOn("session")) { - System.out.println("%% Cached client session: " + session); - } - } else if (debug != null && Debug.isOn("session")) { - System.out.println( - "%% Didn't cache non-resumable client session: " - + session); - } - } - } - - - /* - * Send my change-cipher-spec and Finished message ... done as the - * last handshake act in either the short or long sequences. In - * the short one, we've already seen the server's Finished; in the - * long one, we wait for it now. - */ - private void sendChangeCipherAndFinish(boolean finishedTag) - throws IOException { - - // Reload if this message has been reserved. - handshakeHash.reload(); - - Finished mesg = new Finished(protocolVersion, handshakeHash, - Finished.CLIENT, session.getMasterSecret(), cipherSuite); - - /* - * Send the change_cipher_spec message, then the Finished message - * which we just calculated (and protected using the keys we just - * calculated). Server responds with its Finished message, except - * in the "fast handshake" (resume session) case. - */ - sendChangeCipherSpec(mesg, finishedTag); - - /* - * save client verify data for secure renegotiation - */ - if (secureRenegotiation) { - clientVerifyData = mesg.getVerifyData(); - } - } - - - /* - * Returns a ClientHello message to kickstart renegotiations - */ - @Override - HandshakeMessage getKickstartMessage() throws SSLException { - // session ID of the ClientHello message - SessionId sessionId = SSLSessionImpl.nullSession.getSessionId(); - - // a list of cipher suites sent by the client - CipherSuiteList cipherSuites = getActiveCipherSuites(); - - // set the max protocol version this client is supporting. - maxProtocolVersion = protocolVersion; - - // - // Try to resume an existing session. This might be mandatory, - // given certain API options. - // - session = ((SSLSessionContextImpl)sslContext - .engineGetClientSessionContext()) - .get(getHostSE(), getPortSE()); - if (debug != null && Debug.isOn("session")) { - if (session != null) { - System.out.println("%% Client cached " - + session - + (session.isRejoinable() ? "" : " (not rejoinable)")); - } else { - System.out.println("%% No cached client session"); - } - } - if (session != null) { - // If unsafe server certificate change is not allowed, reserve - // current server certificates if the previous handshake is a - // session-resumption abbreviated initial handshake. - if (!allowUnsafeServerCertChange && session.isSessionResumption()) { - try { - // If existing, peer certificate chain cannot be null. - reservedServerCerts = - (X509Certificate[])session.getPeerCertificates(); - } catch (SSLPeerUnverifiedException puve) { - // Maybe not certificate-based, ignore the exception. - } - } - - if (!session.isRejoinable()) { - session = null; - } - } - - if (session != null) { - CipherSuite sessionSuite = session.getSuite(); - ProtocolVersion sessionVersion = session.getProtocolVersion(); - if (isNegotiable(sessionSuite) == false) { - if (debug != null && Debug.isOn("session")) { - System.out.println("%% can't resume, unavailable cipher"); - } - session = null; - } - - if ((session != null) && !isNegotiable(sessionVersion)) { - if (debug != null && Debug.isOn("session")) { - System.out.println("%% can't resume, protocol disabled"); - } - session = null; - } - - if ((session != null) && useExtendedMasterSecret) { - boolean isTLS10Plus = sessionVersion.useTLS10PlusSpec(); - if (isTLS10Plus && !session.getUseExtendedMasterSecret()) { - if (!allowLegacyResumption) { - // perform full handshake instead - // - // The client SHOULD NOT offer an abbreviated handshake - // to resume a session that does not use an extended - // master secret. Instead, it SHOULD offer a full - // handshake. - session = null; - } - } - - if ((session != null) && !allowUnsafeServerCertChange) { - // It is fine to move on with abbreviate handshake if - // endpoint identification is enabled. - String identityAlg = getEndpointIdentificationAlgorithmSE(); - if ((identityAlg == null || identityAlg.length() == 0)) { - if (isTLS10Plus) { - if (!session.getUseExtendedMasterSecret()) { - // perform full handshake instead - session = null; - } // Otherwise, use extended master secret. - } else { - // The extended master secret extension does not - // apply to SSL 3.0. Perform a full handshake - // instead. - // - // Note that the useExtendedMasterSecret is - // extended to protect SSL 3.0 connections, - // by discarding abbreviate handshake. - session = null; - } - } - } - } - - if (session != null) { - if (debug != null) { - if (Debug.isOn("handshake") || Debug.isOn("session")) { - System.out.println("%% Try resuming " + session - + " from port " + getLocalPortSE()); - } - } - - sessionId = session.getSessionId(); - maxProtocolVersion = sessionVersion; - - // Update SSL version number in underlying SSL socket and - // handshake output stream, so that the output records (at the - // record layer) have the correct version - setVersion(sessionVersion); - } - - /* - * Force use of the previous session ciphersuite, and - * add the SCSV if enabled. - */ - if (!enableNewSession) { - if (session == null) { - throw new SSLHandshakeException( - "Can't reuse existing SSL client session"); - } - - Collection<CipherSuite> cipherList = new ArrayList<>(2); - cipherList.add(sessionSuite); - if (!secureRenegotiation && - cipherSuites.contains(CipherSuite.C_SCSV)) { - cipherList.add(CipherSuite.C_SCSV); - } // otherwise, renegotiation_info extension will be used - - cipherSuites = new CipherSuiteList(cipherList); - } - } - - if (session == null && !enableNewSession) { - throw new SSLHandshakeException("No existing session to resume"); - } - - // exclude SCSV for secure renegotiation - if (secureRenegotiation && cipherSuites.contains(CipherSuite.C_SCSV)) { - Collection<CipherSuite> cipherList = - new ArrayList<>(cipherSuites.size() - 1); - for (CipherSuite suite : cipherSuites.collection()) { - if (suite != CipherSuite.C_SCSV) { - cipherList.add(suite); - } - } - - cipherSuites = new CipherSuiteList(cipherList); - } - - // make sure there is a negotiable cipher suite. - boolean negotiable = false; - for (CipherSuite suite : cipherSuites.collection()) { - if (isNegotiable(suite)) { - negotiable = true; - break; - } - } - - if (!negotiable) { - throw new SSLHandshakeException("No negotiable cipher suite"); - } - - // Not a TLS1.2+ handshake - // For SSLv2Hello, HandshakeHash.reset() will be called, so we - // cannot call HandshakeHash.protocolDetermined() here. As it does - // not follow the spec that HandshakeHash.reset() can be only be - // called before protocolDetermined. - // if (maxProtocolVersion.v < ProtocolVersion.TLS12.v) { - // handshakeHash.protocolDetermined(maxProtocolVersion); - // } - - // create the ClientHello message - ClientHello clientHelloMessage = new ClientHello( - sslContext.getSecureRandom(), maxProtocolVersion, - sessionId, cipherSuites, isDTLS); - - // Add named groups extension for ECDHE and FFDHE if necessary. - SupportedGroupsExtension sge = - SupportedGroupsExtension.createExtension( - algorithmConstraints, - cipherSuites, enableFFDHE); - if (sge != null) { - clientHelloMessage.extensions.add(sge); - // Add elliptic point format extensions - if (cipherSuites.contains(NamedGroupType.NAMED_GROUP_ECDHE)) { - clientHelloMessage.extensions.add( - EllipticPointFormatsExtension.DEFAULT); - } - } - - // add signature_algorithm extension - if (maxProtocolVersion.useTLS12PlusSpec()) { - // we will always send the signature_algorithm extension - Collection<SignatureAndHashAlgorithm> localSignAlgs = - getLocalSupportedSignAlgs(); - if (localSignAlgs.isEmpty()) { - throw new SSLHandshakeException( - "No supported signature algorithm"); - } - - clientHelloMessage.addSignatureAlgorithmsExtension(localSignAlgs); - } - - // add Extended Master Secret extension - if (useExtendedMasterSecret && maxProtocolVersion.useTLS10PlusSpec()) { - if ((session == null) || session.getUseExtendedMasterSecret()) { - clientHelloMessage.addExtendedMasterSecretExtension(); - requestedToUseEMS = true; - } - } - - // add server_name extension - if (enableSNIExtension) { - if (session != null) { - requestedServerNames = session.getRequestedServerNames(); - } else { - requestedServerNames = serverNames; - } - - if (!requestedServerNames.isEmpty()) { - clientHelloMessage.addSNIExtension(requestedServerNames); - } - } - - // add max_fragment_length extension - if (enableMFLExtension) { - if (session != null) { - // The same extension should be sent for resumption. - requestedMFLength = session.getNegotiatedMaxFragSize(); - } else if (maximumPacketSize != 0) { - // Maybe we can calculate the fragment size more accurate - // by condering the enabled cipher suites in the future. - requestedMFLength = maximumPacketSize; - if (isDTLS) { - requestedMFLength -= DTLSRecord.maxPlaintextPlusSize; - } else { - requestedMFLength -= SSLRecord.maxPlaintextPlusSize; - } - } else { - // Need no max_fragment_length extension. - requestedMFLength = -1; - } - - if ((requestedMFLength > 0) && - MaxFragmentLengthExtension.needFragLenNego(requestedMFLength)) { - - requestedMFLength = - MaxFragmentLengthExtension.getValidMaxFragLen( - requestedMFLength); - clientHelloMessage.addMFLExtension(requestedMFLength); - } else { - requestedMFLength = -1; - } - } - - // Add status_request and status_request_v2 extensions - if (sslContext.isStaplingEnabled(true)) { - clientHelloMessage.addCertStatusReqListV2Extension(); - clientHelloMessage.addCertStatusRequestExtension(); - } - - // Add ALPN extension - if (localApl != null && localApl.length > 0) { - clientHelloMessage.addALPNExtension(localApl); - alpnActive = true; - } - - // reset the client random cookie - clnt_random = clientHelloMessage.clnt_random; - - /* - * need to set the renegotiation_info extension for: - * 1: secure renegotiation - * 2: initial handshake and no SCSV in the ClientHello - * 3: insecure renegotiation and no SCSV in the ClientHello - */ - if (secureRenegotiation || - !cipherSuites.contains(CipherSuite.C_SCSV)) { - clientHelloMessage.addRenegotiationInfoExtension(clientVerifyData); - } - - if (isDTLS) { - // Cookie exchange need to reserve the initial ClientHello message. - initialClientHelloMsg = clientHelloMessage; - } - - return clientHelloMessage; - } - - /* - * Fault detected during handshake. - */ - @Override - void handshakeAlert(byte description) throws SSLProtocolException { - String message = Alerts.alertDescription(description); - - if (debug != null && Debug.isOn("handshake")) { - System.out.println("SSL - handshake alert: " + message); - } - throw new SSLProtocolException("handshake alert: " + message); - } - - /* - * Unless we are using an anonymous ciphersuite, the server always - * sends a certificate message (for the CipherSuites we currently - * support). The trust manager verifies the chain for us. - */ - private void serverCertificate(CertificateMsg mesg) throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - X509Certificate[] peerCerts = mesg.getCertificateChain(); - if (peerCerts.length == 0) { - fatalSE(Alerts.alert_bad_certificate, "empty certificate chain"); - } - - // Allow server certificate change in client side during renegotiation - // after a session-resumption abbreviated initial handshake? - // - // DO NOT need to check allowUnsafeServerCertChange here. We only - // reserve server certificates when allowUnsafeServerCertChange is - // flase. - // - // Allow server certificate change if it is negotiated to use the - // extended master secret. - if ((reservedServerCerts != null) && - !session.getUseExtendedMasterSecret()) { - // It is not necessary to check the certificate update if endpoint - // identification is enabled. - String identityAlg = getEndpointIdentificationAlgorithmSE(); - if ((identityAlg == null || identityAlg.length() == 0) && - !isIdentityEquivalent(peerCerts[0], reservedServerCerts[0])) { - - fatalSE(Alerts.alert_bad_certificate, - "server certificate change is restricted " + - "during renegotiation"); - } - } - - // ask the trust manager to verify the chain - if (staplingActive) { - // Defer the certificate check until after we've received the - // CertificateStatus message. If that message doesn't come in - // immediately following this message we will execute the check - // directly from processMessage before any other SSL/TLS processing. - deferredCerts = peerCerts; - } else { - // We're not doing stapling, so perform the check right now - checkServerCerts(peerCerts); - } - } - - /** - * If certificate status stapling has been enabled, the server will send - * one or more status messages to the client. - * - * @param mesg a {@code CertificateStatus} object built from the data - * sent by the server. - * - * @throws IOException if any parsing errors occur. - */ - private void certificateStatus(CertificateStatus mesg) throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - // Perform the certificate check using the deferred certificates - // and responses that we have obtained. - session.setStatusResponses(mesg.getResponses()); - checkServerCerts(deferredCerts); - } - - /* - * Whether the certificates can represent the same identity? - * - * The certificates can be used to represent the same identity: - * 1. If the subject alternative names of IP address are present in - * both certificates, they should be identical; otherwise, - * 2. if the subject alternative names of DNS name are present in - * both certificates, they should be identical; otherwise, - * 3. if the subject fields are present in both certificates, the - * certificate subjects and issuers should be identical. - */ - private static boolean isIdentityEquivalent(X509Certificate thisCert, - X509Certificate prevCert) { - if (thisCert.equals(prevCert)) { - return true; - } - - // check subject alternative names - Collection<List<?>> thisSubjectAltNames = null; - try { - thisSubjectAltNames = thisCert.getSubjectAlternativeNames(); - } catch (CertificateParsingException cpe) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println( - "Attempt to obtain subjectAltNames extension failed!"); - } - } - - Collection<List<?>> prevSubjectAltNames = null; - try { - prevSubjectAltNames = prevCert.getSubjectAlternativeNames(); - } catch (CertificateParsingException cpe) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println( - "Attempt to obtain subjectAltNames extension failed!"); - } - } - - if ((thisSubjectAltNames != null) && (prevSubjectAltNames != null)) { - // check the iPAddress field in subjectAltName extension - Collection<String> thisSubAltIPAddrs = - getSubjectAltNames(thisSubjectAltNames, ALTNAME_IP); - Collection<String> prevSubAltIPAddrs = - getSubjectAltNames(prevSubjectAltNames, ALTNAME_IP); - if ((thisSubAltIPAddrs != null) && (prevSubAltIPAddrs != null) && - (isEquivalent(thisSubAltIPAddrs, prevSubAltIPAddrs))) { - - return true; - } - - // check the dNSName field in subjectAltName extension - Collection<String> thisSubAltDnsNames = - getSubjectAltNames(thisSubjectAltNames, ALTNAME_DNS); - Collection<String> prevSubAltDnsNames = - getSubjectAltNames(prevSubjectAltNames, ALTNAME_DNS); - if ((thisSubAltDnsNames != null) && (prevSubAltDnsNames != null) && - (isEquivalent(thisSubAltDnsNames, prevSubAltDnsNames))) { - - return true; - } - } - - // check the certificate subject and issuer - X500Principal thisSubject = thisCert.getSubjectX500Principal(); - X500Principal prevSubject = prevCert.getSubjectX500Principal(); - X500Principal thisIssuer = thisCert.getIssuerX500Principal(); - X500Principal prevIssuer = prevCert.getIssuerX500Principal(); - if (!thisSubject.getName().isEmpty() && - !prevSubject.getName().isEmpty() && - thisSubject.equals(prevSubject) && - thisIssuer.equals(prevIssuer)) { - return true; - } - - return false; - } - - /* - * Returns the subject alternative name of the specified type in the - * subjectAltNames extension of a certificate. - * - * Note that only those subjectAltName types that use String data - * should be passed into this function. - */ - private static Collection<String> getSubjectAltNames( - Collection<List<?>> subjectAltNames, int type) { - - HashSet<String> subAltDnsNames = null; - for (List<?> subjectAltName : subjectAltNames) { - int subjectAltNameType = (Integer)subjectAltName.get(0); - if (subjectAltNameType == type) { - String subAltDnsName = (String)subjectAltName.get(1); - if ((subAltDnsName != null) && !subAltDnsName.isEmpty()) { - if (subAltDnsNames == null) { - subAltDnsNames = - new HashSet<>(subjectAltNames.size()); - } - subAltDnsNames.add(subAltDnsName); - } - } - } - - return subAltDnsNames; - } - - private static boolean isEquivalent(Collection<String> thisSubAltNames, - Collection<String> prevSubAltNames) { - - for (String thisSubAltName : thisSubAltNames) { - for (String prevSubAltName : prevSubAltNames) { - // Only allow the exactly match. Check no wildcard character. - if (thisSubAltName.equalsIgnoreCase(prevSubAltName)) { - return true; - } - } - } - - return false; - } - - /** - * Perform client-side checking of server certificates. - * - * @param certs an array of {@code X509Certificate} objects presented - * by the server in the ServerCertificate message. - * - * @throws IOException if a failure occurs during validation or - * the trust manager associated with the {@code SSLContext} is not - * an {@code X509ExtendedTrustManager}. - */ - private void checkServerCerts(X509Certificate[] certs) - throws IOException { - X509TrustManager tm = sslContext.getX509TrustManager(); - - // find out the key exchange algorithm used - // use "RSA" for non-ephemeral "RSA_EXPORT" - String keyExchangeString; - if (keyExchange == K_RSA_EXPORT && !serverKeyExchangeReceived) { - keyExchangeString = K_RSA.name; - } else { - keyExchangeString = keyExchange.name; - } - - try { - if (tm instanceof X509ExtendedTrustManager) { - if (conn != null) { - ((X509ExtendedTrustManager)tm).checkServerTrusted( - certs.clone(), - keyExchangeString, - conn); - } else { - ((X509ExtendedTrustManager)tm).checkServerTrusted( - certs.clone(), - keyExchangeString, - engine); - } - } else { - // Unlikely to happen, because we have wrapped the old - // X509TrustManager with the new X509ExtendedTrustManager. - throw new CertificateException( - "Improper X509TrustManager implementation"); - } - - // Once the server certificate chain has been validated, set - // the certificate chain in the TLS session. - session.setPeerCertificates(certs); - } catch (CertificateException ce) { - fatalSE(getCertificateAlert(ce), ce); - } - } - - /** - * When a failure happens during certificate checking from an - * {@link X509TrustManager}, determine what TLS alert description to use. - * - * @param cexc The exception thrown by the {@link X509TrustManager} - * - * @return A byte value corresponding to a TLS alert description number. - */ - private byte getCertificateAlert(CertificateException cexc) { - // The specific reason for the failure will determine how to - // set the alert description value - byte alertDesc = Alerts.alert_certificate_unknown; - - Throwable baseCause = cexc.getCause(); - if (baseCause instanceof CertPathValidatorException) { - CertPathValidatorException cpve = - (CertPathValidatorException)baseCause; - Reason reason = cpve.getReason(); - if (reason == BasicReason.REVOKED) { - alertDesc = staplingActive ? - Alerts.alert_bad_certificate_status_response : - Alerts.alert_certificate_revoked; - } else if (reason == BasicReason.UNDETERMINED_REVOCATION_STATUS) { - alertDesc = staplingActive ? - Alerts.alert_bad_certificate_status_response : - Alerts.alert_certificate_unknown; - } - } - - return alertDesc; - } -} - diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientHello.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientHello.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientHello.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientHello.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1397 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLPeerUnverifiedException; +import javax.net.ssl.SSLProtocolException; +import static sun.security.ssl.ClientAuthType.CLIENT_AUTH_REQUIRED; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SupportedVersionsExtension.CHSupportedVersionsSpec; + +/** + * Pack of the ClientHello handshake message. + */ +final class ClientHello { + static final SSLProducer kickstartProducer = + new ClientHelloKickstartProducer(); + static final SSLConsumer handshakeConsumer = + new ClientHelloConsumer(); + static final HandshakeProducer handshakeProducer = + new ClientHelloProducer(); + + private static final HandshakeConsumer t12HandshakeConsumer = + new T12ClientHelloConsumer(); + private static final HandshakeConsumer t13HandshakeConsumer = + new T13ClientHelloConsumer(); + private static final HandshakeConsumer d12HandshakeConsumer = + new D12ClientHelloConsumer(); + private static final HandshakeConsumer d13HandshakeConsumer = + new D13ClientHelloConsumer(); + + /** + * The ClientHello handshake message. + * + * See RFC 5264/4346/2246/6347 for the specifications. + */ + static final class ClientHelloMessage extends HandshakeMessage { + private final boolean isDTLS; + + final int clientVersion; + final RandomCookie clientRandom; + final SessionId sessionId; + private byte[] cookie; // DTLS only + final int[] cipherSuiteIds; + final List<CipherSuite> cipherSuites; // known cipher suites only + final byte[] compressionMethod; + final SSLExtensions extensions; + + private static final byte[] NULL_COMPRESSION = new byte[] {0}; + + ClientHelloMessage(HandshakeContext handshakeContext, + int clientVersion, SessionId sessionId, + List<CipherSuite> cipherSuites, SecureRandom generator) { + super(handshakeContext); + this.isDTLS = handshakeContext.sslContext.isDTLS(); + + this.clientVersion = clientVersion; + this.clientRandom = new RandomCookie(generator); + this.sessionId = sessionId; + if (isDTLS) { + this.cookie = new byte[0]; + } else { + this.cookie = null; + } + + this.cipherSuites = cipherSuites; + this.cipherSuiteIds = getCipherSuiteIds(cipherSuites); + this.extensions = new SSLExtensions(this); + + // Don't support compression. + this.compressionMethod = NULL_COMPRESSION; + } + + /* Read up to the binders in the PSK extension. After this method + * returns, the ByteBuffer position will be at end of the message + * fragment that should be hashed to produce the PSK binder values. + * The client of this method can use this position to determine the + * message fragment and produce the binder values. + */ + static void readPartial(TransportContext tc, + ByteBuffer m) throws IOException { + boolean isDTLS = tc.sslContext.isDTLS(); + + // version + Record.getInt16(m); + + new RandomCookie(m); + + // session ID + Record.getBytes8(m); + + // DTLS cookie + if (isDTLS) { + Record.getBytes8(m); + } + + // cipher suite IDs + Record.getBytes16(m); + // compression method + Record.getBytes8(m); + // read extensions, if present + if (m.remaining() >= 2) { + int remaining = Record.getInt16(m); + while (remaining > 0) { + int id = Record.getInt16(m); + int extLen = Record.getInt16(m); + remaining -= extLen + 4; + + if (id == SSLExtension.CH_PRE_SHARED_KEY.id) { + // ensure pre_shared_key is the last extension + if (remaining > 0) { + tc.fatal(Alert.ILLEGAL_PARAMETER, + "pre_shared_key extension is not last"); + } + // read only up to the IDs + Record.getBytes16(m); + return; + } else { + m.position(m.position() + extLen); + + } + } + } // Otherwise, ignore the remaining bytes. + } + + ClientHelloMessage(HandshakeContext handshakeContext, ByteBuffer m, + SSLExtension[] supportedExtensions) throws IOException { + super(handshakeContext); + this.isDTLS = handshakeContext.sslContext.isDTLS(); + + this.clientVersion = ((m.get() & 0xFF) << 8) | (m.get() & 0xFF); + this.clientRandom = new RandomCookie(m); + this.sessionId = new SessionId(Record.getBytes8(m)); + try { + sessionId.checkLength(clientVersion); + } catch (SSLProtocolException ex) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, ex); + } + if (isDTLS) { + this.cookie = Record.getBytes8(m); + } else { + this.cookie = null; + } + + byte[] encodedIds = Record.getBytes16(m); + if (encodedIds.length == 0 || (encodedIds.length & 0x01) != 0) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid ClientHello message"); + } + + this.cipherSuiteIds = new int[encodedIds.length >> 1]; + for (int i = 0, j = 0; i < encodedIds.length; i++, j++) { + cipherSuiteIds[j] = + ((encodedIds[i++] & 0xFF) << 8) | (encodedIds[i] & 0xFF); + } + this.cipherSuites = getCipherSuites(cipherSuiteIds); + + this.compressionMethod = Record.getBytes8(m); + // In TLS 1.3, use of certain extensions is mandatory. + if (m.hasRemaining()) { + this.extensions = + new SSLExtensions(this, m, supportedExtensions); + } else { + this.extensions = new SSLExtensions(this); + } + } + + void setHelloCookie(byte[] cookie) { + this.cookie = cookie; + } + + // DTLS 1.0/1.2, for cookie generation. + byte[] getHelloCookieBytes() { + HandshakeOutStream hos = new HandshakeOutStream(null); + try { + // copied from send() method + hos.putInt8((byte)((clientVersion >>> 8) & 0xFF)); + hos.putInt8((byte)(clientVersion & 0xFF)); + hos.write(clientRandom.randomBytes, 0, 32); + hos.putBytes8(sessionId.getId()); + // ignore cookie + hos.putBytes16(getEncodedCipherSuites()); + hos.putBytes8(compressionMethod); + extensions.send(hos); // In TLS 1.3, use of certain + // extensions is mandatory. + } catch (IOException ioe) { + // unlikely + } + + return hos.toByteArray(); + } + + // (D)TLS 1.3, for cookie generation. + byte[] getHeaderBytes() { + HandshakeOutStream hos = new HandshakeOutStream(null); + try { + // copied from send() method + hos.putInt8((byte)((clientVersion >>> 8) & 0xFF)); + hos.putInt8((byte)(clientVersion & 0xFF)); + hos.write(clientRandom.randomBytes, 0, 32); + hos.putBytes8(sessionId.getId()); + hos.putBytes16(getEncodedCipherSuites()); + hos.putBytes8(compressionMethod); + } catch (IOException ioe) { + // unlikely + } + + return hos.toByteArray(); + } + + private static int[] getCipherSuiteIds( + List<CipherSuite> cipherSuites) { + if (cipherSuites != null) { + int[] ids = new int[cipherSuites.size()]; + int i = 0; + for (CipherSuite cipherSuite : cipherSuites) { + ids[i++] = cipherSuite.id; + } + + return ids; + } + + return new int[0]; + } + + private static List<CipherSuite> getCipherSuites(int[] ids) { + List<CipherSuite> cipherSuites = new LinkedList<>(); + for (int id : ids) { + CipherSuite cipherSuite = CipherSuite.valueOf(id); + if (cipherSuite != null) { + cipherSuites.add(cipherSuite); + } + } + + return Collections.unmodifiableList(cipherSuites); + } + + private List<String> getCipherSuiteNames() { + List<String> names = new LinkedList<>(); + for (int id : cipherSuiteIds) { + names.add(CipherSuite.nameOf(id) + + "(" + Utilities.byte16HexString(id) + ")"); } + + return names; + } + + private byte[] getEncodedCipherSuites() { + byte[] encoded = new byte[cipherSuiteIds.length << 1]; + int i = 0; + for (int id : cipherSuiteIds) { + encoded[i++] = (byte)(id >> 8); + encoded[i++] = (byte)id; + } + return encoded; + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CLIENT_HELLO; + } + + @Override + public int messageLength() { + /* + * Add fixed size parts of each field... + * version + random + session + cipher + compress + */ + return (2 + 32 + 1 + 2 + 1 + + sessionId.length() /* ... + variable parts */ + + (isDTLS ? (1 + cookie.length) : 0) + + (cipherSuiteIds.length * 2) + + compressionMethod.length) + + extensions.length(); // In TLS 1.3, use of certain + // extensions is mandatory. + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + sendCore(hos); + extensions.send(hos); // In TLS 1.3, use of certain + // extensions is mandatory. + } + + void sendCore(HandshakeOutStream hos) throws IOException { + hos.putInt8((byte) (clientVersion >>> 8)); + hos.putInt8((byte) clientVersion); + hos.write(clientRandom.randomBytes, 0, 32); + hos.putBytes8(sessionId.getId()); + if (isDTLS) { + hos.putBytes8(cookie); + } + hos.putBytes16(getEncodedCipherSuites()); + hos.putBytes8(compressionMethod); + } + + @Override + public String toString() { + if (isDTLS) { + MessageFormat messageFormat = new MessageFormat( + "\"ClientHello\": '{'\n" + + " \"client version\" : \"{0}\",\n" + + " \"random\" : \"{1}\",\n" + + " \"session id\" : \"{2}\",\n" + + " \"cookie\" : \"{3}\",\n" + + " \"cipher suites\" : \"{4}\",\n" + + " \"compression methods\" : \"{5}\",\n" + + " \"extensions\" : [\n" + + "{6}\n" + + " ]\n" + + "'}'", + Locale.ENGLISH); + Object[] messageFields = { + ProtocolVersion.nameOf(clientVersion), + Utilities.toHexString(clientRandom.randomBytes), + sessionId.toString(), + Utilities.toHexString(cookie), + getCipherSuiteNames().toString(), + Utilities.toHexString(compressionMethod), + Utilities.indent(Utilities.indent(extensions.toString())) + }; + + return messageFormat.format(messageFields); + } else { + MessageFormat messageFormat = new MessageFormat( + "\"ClientHello\": '{'\n" + + " \"client version\" : \"{0}\",\n" + + " \"random\" : \"{1}\",\n" + + " \"session id\" : \"{2}\",\n" + + " \"cipher suites\" : \"{3}\",\n" + + " \"compression methods\" : \"{4}\",\n" + + " \"extensions\" : [\n" + + "{5}\n" + + " ]\n" + + "'}'", + Locale.ENGLISH); + Object[] messageFields = { + ProtocolVersion.nameOf(clientVersion), + Utilities.toHexString(clientRandom.randomBytes), + sessionId.toString(), + getCipherSuiteNames().toString(), + Utilities.toHexString(compressionMethod), + Utilities.indent(Utilities.indent(extensions.toString())) + }; + + return messageFormat.format(messageFields); + } + } + } + + /** + * The "ClientHello" handshake message kick start producer. + */ + private static final + class ClientHelloKickstartProducer implements SSLProducer { + // Prevent instantiation of this class. + private ClientHelloKickstartProducer() { + // blank + } + + // Produce kickstart handshake message. + @Override + public byte[] produce(ConnectionContext context) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // clean up this producer + chc.handshakeProducers.remove(SSLHandshake.CLIENT_HELLO.id); + + // the max protocol version this client is supporting. + ProtocolVersion maxProtocolVersion = chc.maximumActiveProtocol; + + // session ID of the ClientHello message + SessionId sessionId = SSLSessionImpl.nullSession.getSessionId(); + + // a list of cipher suites sent by the client + List<CipherSuite> cipherSuites = chc.activeCipherSuites; + + // + // Try to resume an existing session. + // + SSLSessionContextImpl ssci = (SSLSessionContextImpl) + chc.sslContext.engineGetClientSessionContext(); + SSLSessionImpl session = ssci.get( + chc.conContext.transport.getPeerHost(), + chc.conContext.transport.getPeerPort()); + if (session != null) { + // If unsafe server certificate change is not allowed, reserve + // current server certificates if the previous handshake is a + // session-resumption abbreviated initial handshake. + if (!ClientHandshakeContext.allowUnsafeServerCertChange && + session.isSessionResumption()) { + try { + // If existing, peer certificate chain cannot be null. + chc.reservedServerCerts = + (X509Certificate[])session.getPeerCertificates(); + } catch (SSLPeerUnverifiedException puve) { + // Maybe not certificate-based, ignore the exception. + } + } + + if (!session.isRejoinable()) { + session = null; + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, the session is not rejoinable"); + } + } + } + + CipherSuite sessionSuite = null; + if (session != null) { + sessionSuite = session.getSuite(); + if (!chc.isNegotiable(sessionSuite)) { + session = null; + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, unavailable session cipher suite"); + } + } + } + + ProtocolVersion sessionVersion = null; + if (session != null) { + sessionVersion = session.getProtocolVersion(); + if (!chc.isNegotiable(sessionVersion)) { + session = null; + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, unavailable protocol version"); + } + } + } + + if (session != null && + !sessionVersion.useTLS13PlusSpec() && + SSLConfiguration.useExtendedMasterSecret) { + + boolean isEmsAvailable = chc.sslConfig.isAvailable( + SSLExtension.CH_EXTENDED_MASTER_SECRET, sessionVersion); + if (isEmsAvailable && !session.useExtendedMasterSecret && + !SSLConfiguration.allowLegacyResumption) { + // perform full handshake instead + // + // The client SHOULD NOT offer an abbreviated handshake + // to resume a session that does not use an extended + // master secret. Instead, it SHOULD offer a full + // handshake. + session = null; + } + + if ((session != null) && + !ClientHandshakeContext.allowUnsafeServerCertChange) { + // It is fine to move on with abbreviate handshake if + // endpoint identification is enabled. + String identityAlg = chc.sslConfig.identificationProtocol; + if ((identityAlg == null || identityAlg.length() == 0)) { + if (isEmsAvailable) { + if (!session.useExtendedMasterSecret) { + // perform full handshake instead + session = null; + } // Otherwise, use extended master secret. + } else { + // The extended master secret extension does not + // apply to SSL 3.0. Perform a full handshake + // instead. + // + // Note that the useExtendedMasterSecret is + // extended to protect SSL 3.0 connections, + // by discarding abbreviate handshake. + session = null; + } + } + } + } + + if (session != null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest("Try resuming session", session); + } + + // only set session id if session is 1.2 or earlier + if (!session.getProtocolVersion().useTLS13PlusSpec()) { + sessionId = session.getSessionId(); + } + if (!maxProtocolVersion.equals(sessionVersion)) { + maxProtocolVersion = sessionVersion; + + // Update protocol version number in underlying socket and + // handshake output stream, so that the output records + // (at the record layer) have the correct version + chc.setVersion(sessionVersion); + } + + // If no new session is allowed, force use of the previous + // session ciphersuite, and add the renegotiation SCSV if + // necessary. + if (!chc.sslConfig.enableSessionCreation) { + if (!chc.conContext.isNegotiated && + !sessionVersion.useTLS13PlusSpec() && + cipherSuites.contains( + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) { + cipherSuites = Arrays.asList(sessionSuite, + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV); + } else { // otherwise, use renegotiation_info extension + cipherSuites = Arrays.asList(sessionSuite); + } + + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "No new session is allowed, so try to resume " + + "the session cipher suite only", sessionSuite); + } + } + + chc.isResumption = true; + chc.resumingSession = session; + } + + if (session == null) { + if (!chc.sslConfig.enableSessionCreation) { + throw new SSLHandshakeException( + "No new session is allowed and " + + "no existing session can be resumed"); + } + + if (maxProtocolVersion.useTLS13PlusSpec() && + SSLConfiguration.useCompatibilityMode) { + // In compatibility mode, the TLS 1.3 legacy_session_id + // field MUST be non-empty, so a client not offering a + // pre-TLS 1.3 session MUST generate a new 32-byte value. + sessionId = + new SessionId(true, chc.sslContext.getSecureRandom()); + } + } + + ProtocolVersion minimumVersion = ProtocolVersion.NONE; + for (ProtocolVersion pv : chc.activeProtocols) { + if (minimumVersion == ProtocolVersion.NONE || + pv.compare(minimumVersion) < 0) { + minimumVersion = pv; + } + } + + // exclude SCSV for secure renegotiation + if (!minimumVersion.useTLS13PlusSpec()) { + if (chc.conContext.secureRenegotiation && + cipherSuites.contains( + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) { + // The cipherSuites may be unmodifiable + cipherSuites = new LinkedList<>(cipherSuites); + cipherSuites.remove( + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV); + } + } + + // make sure there is a negotiable cipher suite. + boolean negotiable = false; + for (CipherSuite suite : cipherSuites) { + if (chc.isNegotiable(suite)) { + negotiable = true; + break; + } + } + if (!negotiable) { + throw new SSLHandshakeException("No negotiable cipher suite"); + } + + // Create the handshake message. + ProtocolVersion clientHelloVersion = maxProtocolVersion; + if (clientHelloVersion.useTLS13PlusSpec()) { + // In (D)TLS 1.3, the client indicates its version preferences + // in the "supported_versions" extension and the client_version + // (legacy_version) field MUST be set to (D)TLS 1.2. + if (clientHelloVersion.isDTLS) { + clientHelloVersion = ProtocolVersion.DTLS12; + } else { + clientHelloVersion = ProtocolVersion.TLS12; + } + } + + ClientHelloMessage chm = new ClientHelloMessage(chc, + clientHelloVersion.id, sessionId, cipherSuites, + chc.sslContext.getSecureRandom()); + + // cache the client random number for further using + chc.clientHelloRandom = chm.clientRandom; + chc.clientHelloVersion = clientHelloVersion.id; + + // Produce extensions for ClientHello handshake message. + SSLExtension[] extTypes = chc.sslConfig.getEnabledExtensions( + SSLHandshake.CLIENT_HELLO, chc.activeProtocols); + chm.extensions.produce(chc, extTypes); + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced ClientHello handshake message", chm); + } + + // Output the handshake message. + chm.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // Reserve the initial ClientHello message for the follow on + // cookie exchange if needed. + chc.initialClientHelloMsg = chm; + + // What's the expected response? + chc.handshakeConsumers.put( + SSLHandshake.SERVER_HELLO.id, SSLHandshake.SERVER_HELLO); + if (chc.sslContext.isDTLS() && + !minimumVersion.useTLS13PlusSpec()) { + chc.handshakeConsumers.put( + SSLHandshake.HELLO_VERIFY_REQUEST.id, + SSLHandshake.HELLO_VERIFY_REQUEST); + } + + // The handshake message has been delivered. + return null; + } + } + + private static final + class ClientHelloProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private ClientHelloProducer() { + // blank + } + + // Response to one of the following handshake message: + // HelloRequest (SSL 3.0/TLS 1.0/1.1/1.2) + // ServerHello(HelloRetryRequest) (TLS 1.3) + // HelloVerifyRequest (DTLS 1.0/1.2) + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + SSLHandshake ht = message.handshakeType(); + if (ht == null) { + throw new UnsupportedOperationException("Not supported yet."); + } + + switch (ht) { + case HELLO_REQUEST: + // SSL 3.0/TLS 1.0/1.1/1.2 + try { + chc.kickstart(); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, ioe); + } + + // The handshake message has been delivered. + return null; + case HELLO_VERIFY_REQUEST: + // DTLS 1.0/1.2 + // + // The HelloVerifyRequest consumer should have updated the + // ClientHello handshake message with cookie. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced ClientHello(cookie) handshake message", + chc.initialClientHelloMsg); + } + + // Output the handshake message. + chc.initialClientHelloMsg.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // What's the expected response? + chc.handshakeConsumers.put(SSLHandshake.SERVER_HELLO.id, + SSLHandshake.SERVER_HELLO); + + ProtocolVersion minimumVersion = ProtocolVersion.NONE; + for (ProtocolVersion pv : chc.activeProtocols) { + if (minimumVersion == ProtocolVersion.NONE || + pv.compare(minimumVersion) < 0) { + minimumVersion = pv; + } + } + if (chc.sslContext.isDTLS() && + !minimumVersion.useTLS13PlusSpec()) { + chc.handshakeConsumers.put( + SSLHandshake.HELLO_VERIFY_REQUEST.id, + SSLHandshake.HELLO_VERIFY_REQUEST); + } + + // The handshake message has been delivered. + return null; + case HELLO_RETRY_REQUEST: + // TLS 1.3 + // The HelloRetryRequest consumer should have updated the + // ClientHello handshake message with cookie. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced ClientHello(HRR) handshake message", + chc.initialClientHelloMsg); + } + + // Output the handshake message. + chc.initialClientHelloMsg.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // What's the expected response? + chc.conContext.consumers.putIfAbsent( + ContentType.CHANGE_CIPHER_SPEC.id, + ChangeCipherSpec.t13Consumer); + chc.handshakeConsumers.put(SSLHandshake.SERVER_HELLO.id, + SSLHandshake.SERVER_HELLO); + + // The handshake message has been delivered. + return null; + default: + throw new UnsupportedOperationException( + "Not supported yet."); + } + } + } + + /** + * The "ClientHello" handshake message consumer. + */ + private static final class ClientHelloConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private ClientHelloConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // clean up this consumer + shc.handshakeConsumers.remove(SSLHandshake.CLIENT_HELLO.id); + if (!shc.handshakeConsumers.isEmpty()) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "No more handshake message allowed " + + "in a ClientHello flight"); + } + + // Get enabled extension types in ClientHello handshake message. + SSLExtension[] enabledExtensions = + shc.sslConfig.getEnabledExtensions( + SSLHandshake.CLIENT_HELLO); + + ClientHelloMessage chm = + new ClientHelloMessage(shc, message, enabledExtensions); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Consuming ClientHello handshake message", chm); + } + + shc.clientHelloVersion = chm.clientVersion; + onClientHello(shc, chm); + } + + private void onClientHello(ServerHandshakeContext context, + ClientHelloMessage clientHello) throws IOException { + // Negotiate protocol version. + // + // Check and launch SupportedVersions. + SSLExtension[] extTypes = new SSLExtension[] { + SSLExtension.CH_SUPPORTED_VERSIONS + }; + clientHello.extensions.consumeOnLoad(context, extTypes); + + ProtocolVersion negotiatedProtocol; + CHSupportedVersionsSpec svs = + (CHSupportedVersionsSpec)context.handshakeExtensions.get( + SSLExtension.CH_SUPPORTED_VERSIONS); + if (svs != null) { + negotiatedProtocol = + negotiateProtocol(context, svs.requestedProtocols); + } else { + negotiatedProtocol = + negotiateProtocol(context, clientHello.clientVersion); + } + context.negotiatedProtocol = negotiatedProtocol; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Negotiated protocol version: " + negotiatedProtocol.name); + } + + // Consume the handshake message for the specific protocol version. + if (negotiatedProtocol.isDTLS) { + if (negotiatedProtocol.useTLS13PlusSpec()) { + d13HandshakeConsumer.consume(context, clientHello); + } else { + d12HandshakeConsumer.consume(context, clientHello); + } + } else { + if (negotiatedProtocol.useTLS13PlusSpec()) { + t13HandshakeConsumer.consume(context, clientHello); + } else { + t12HandshakeConsumer.consume(context, clientHello); + } + } + } + + // Select a protocol version according to the + // ClientHello.client_version. + private ProtocolVersion negotiateProtocol( + ServerHandshakeContext context, + int clientHelloVersion) throws SSLException { + + // Per TLS 1.3 specification, server MUST negotiate TLS 1.2 or prior + // even if ClientHello.client_version is 0x0304 or later. + int chv = clientHelloVersion; + if (context.sslContext.isDTLS()) { + if (chv < ProtocolVersion.DTLS12.id) { + chv = ProtocolVersion.DTLS12.id; + } + } else { + if (chv > ProtocolVersion.TLS12.id) { + chv = ProtocolVersion.TLS12.id; + } + } + + // Select a protocol version from the activated protocols. + ProtocolVersion pv = ProtocolVersion.selectedFrom( + context.activeProtocols, chv); + if (pv == null || pv == ProtocolVersion.NONE || + pv == ProtocolVersion.SSL20Hello) { + context.conContext.fatal(Alert.PROTOCOL_VERSION, + "Client requested protocol " + + ProtocolVersion.nameOf(clientHelloVersion) + + " is not enabled or supported in server context"); + } + + return pv; + } + + // Select a protocol version according to the + // supported_versions extension. + private ProtocolVersion negotiateProtocol( + ServerHandshakeContext context, + int[] clientSupportedVersions) throws SSLException { + + // The client supported protocol versions are present in client + // preference order. This implementation chooses to use the server + // preference of protocol versions instead. + for (ProtocolVersion spv : context.activeProtocols) { + if (spv == ProtocolVersion.SSL20Hello) { + continue; + } + for (int cpv : clientSupportedVersions) { + if (cpv == ProtocolVersion.SSL20Hello.id) { + continue; + } + if (spv.id == cpv) { + return spv; + } + } + } + + // No protocol version can be negotiated. + context.conContext.fatal(Alert.PROTOCOL_VERSION, + "The client supported protocol versions " + Arrays.toString( + ProtocolVersion.toStringArray(clientSupportedVersions)) + + " are not accepted by server preferences " + + context.activeProtocols); + + return null; // make the compiler happy + } + } + + /** + * The "ClientHello" handshake message consumer for TLS 1.2 and + * prior SSL/TLS protocol versions. + */ + private static final + class T12ClientHelloConsumer implements HandshakeConsumer { + // Prevent instantiation of this class. + private T12ClientHelloConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + ClientHelloMessage clientHello = (ClientHelloMessage)message; + + // + // validate + // + + // Reject client initiated renegotiation? + // + // If server side should reject client-initiated renegotiation, + // send an Alert.HANDSHAKE_FAILURE fatal alert, not a + // no_renegotiation warning alert (no_renegotiation must be a + // warning: RFC 2246). no_renegotiation might seem more + // natural at first, but warnings are not appropriate because + // the sending party does not know how the receiving party + // will behave. This state must be treated as a fatal server + // condition. + // + // This will not have any impact on server initiated renegotiation. + if (shc.conContext.isNegotiated) { + if (!shc.conContext.secureRenegotiation && + !HandshakeContext.allowUnsafeRenegotiation) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsafe renegotiation is not allowed"); + } + + if (ServerHandshakeContext.rejectClientInitiatedRenego && + !shc.kickstartMessageDelivered) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Client initiated renegotiation is not allowed"); + } + } + + // Is it an abbreviated handshake? + if (clientHello.sessionId.length() != 0) { + SSLSessionImpl previous = ((SSLSessionContextImpl)shc.sslContext + .engineGetServerSessionContext()) + .get(clientHello.sessionId.getId()); + + boolean resumingSession = + (previous != null) && previous.isRejoinable(); + if (!resumingSession) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, " + + "the existing session is not rejoinable"); + } + } + // Validate the negotiated protocol version. + if (resumingSession) { + ProtocolVersion sessionProtocol = + previous.getProtocolVersion(); + if (sessionProtocol != shc.negotiatedProtocol) { + resumingSession = false; + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, not the same protocol version"); + } + } + } + + // Validate the required client authentication. + if (resumingSession && + (shc.sslConfig.clientAuthType == CLIENT_AUTH_REQUIRED)) { + try { + previous.getPeerPrincipal(); + } catch (SSLPeerUnverifiedException e) { + resumingSession = false; + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, " + + "client authentication is required"); + } + } + } + + // Validate that the cached cipher suite. + if (resumingSession) { + CipherSuite suite = previous.getSuite(); + if ((!shc.isNegotiable(suite)) || + (!clientHello.cipherSuites.contains(suite))) { + resumingSession = false; + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, " + + "the session cipher suite is absent"); + } + } + } + + // So far so good. Note that the handshake extensions may reset + // the resuming options later. + shc.isResumption = resumingSession; + shc.resumingSession = resumingSession ? previous : null; + } + + // cache the client random number for further using + shc.clientHelloRandom = clientHello.clientRandom; + + // Check and launch ClientHello extensions. + SSLExtension[] extTypes = shc.sslConfig.getEnabledExtensions( + SSLHandshake.CLIENT_HELLO); + clientHello.extensions.consumeOnLoad(shc, extTypes); + + // + // update + // + if (!shc.conContext.isNegotiated) { + shc.conContext.protocolVersion = shc.negotiatedProtocol; + shc.conContext.outputRecord.setVersion(shc.negotiatedProtocol); + } + + // update the responders + // + // Only need to ServerHello, which may add more responders later. + // Note that ServerHello and HelloRetryRequest share the same + // handshake type/id. The ServerHello producer may be replaced + // by HelloRetryRequest producer if needed. + shc.handshakeProducers.put(SSLHandshake.SERVER_HELLO.id, + SSLHandshake.SERVER_HELLO); + + // + // produce + // + SSLHandshake[] probableHandshakeMessages = new SSLHandshake[] { + SSLHandshake.SERVER_HELLO, + + // full handshake messages + SSLHandshake.CERTIFICATE, + SSLHandshake.CERTIFICATE_STATUS, + SSLHandshake.SERVER_KEY_EXCHANGE, + SSLHandshake.CERTIFICATE_REQUEST, + SSLHandshake.SERVER_HELLO_DONE, + + // abbreviated handshake messages + SSLHandshake.FINISHED + }; + + for (SSLHandshake hs : probableHandshakeMessages) { + HandshakeProducer handshakeProducer = + shc.handshakeProducers.remove(hs.id); + if (handshakeProducer != null) { + handshakeProducer.produce(context, clientHello); + } + } + } + } + + /** + * The "ClientHello" handshake message consumer for TLS 1.3. + */ + private static final + class T13ClientHelloConsumer implements HandshakeConsumer { + // Prevent instantiation of this class. + private T13ClientHelloConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + ClientHelloMessage clientHello = (ClientHelloMessage)message; + + // The client may send a dummy change_cipher_spec record + // immediately after the first ClientHello. + shc.conContext.consumers.putIfAbsent( + ContentType.CHANGE_CIPHER_SPEC.id, + ChangeCipherSpec.t13Consumer); + + // Is it a resumption? + // + // Check and launch the "psk_key_exchange_modes" and + // "pre_shared_key" extensions first, which will reset the + // resuming session, no matter the extensions present or not. + shc.isResumption = true; + SSLExtension[] extTypes = new SSLExtension[] { + SSLExtension.PSK_KEY_EXCHANGE_MODES, + SSLExtension.CH_PRE_SHARED_KEY + }; + clientHello.extensions.consumeOnLoad(shc, extTypes); + + // Check and launch ClientHello extensions other than + // "psk_key_exchange_modes", "pre_shared_key", "protocol_version" + // and "key_share" extensions. + // + // These extensions may discard session resumption, or ask for + // hello retry. + extTypes = shc.sslConfig.getExclusiveExtensions( + SSLHandshake.CLIENT_HELLO, + Arrays.asList( + SSLExtension.PSK_KEY_EXCHANGE_MODES, + SSLExtension.CH_PRE_SHARED_KEY, + SSLExtension.CH_SUPPORTED_VERSIONS)); + clientHello.extensions.consumeOnLoad(shc, extTypes); + + if (!shc.handshakeProducers.isEmpty()) { + // Should be HelloRetryRequest producer. + goHelloRetryRequest(shc, clientHello); + } else { + goServerHello(shc, clientHello); + } + } + + private void goHelloRetryRequest(ServerHandshakeContext shc, + ClientHelloMessage clientHello) throws IOException { + HandshakeProducer handshakeProducer = + shc.handshakeProducers.remove( + SSLHandshake.HELLO_RETRY_REQUEST.id); + if (handshakeProducer != null) { + handshakeProducer.produce(shc, clientHello); + } else { + // unlikely + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No HelloRetryRequest producer: " + shc.handshakeProducers); + } + + if (!shc.handshakeProducers.isEmpty()) { + // unlikely, but please double check. + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "unknown handshake producers: " + shc.handshakeProducers); + } + } + + private void goServerHello(ServerHandshakeContext shc, + ClientHelloMessage clientHello) throws IOException { + // + // validate + // + shc.clientHelloRandom = clientHello.clientRandom; + + // + // update + // + if (!shc.conContext.isNegotiated) { + shc.conContext.protocolVersion = shc.negotiatedProtocol; + shc.conContext.outputRecord.setVersion(shc.negotiatedProtocol); + } + + // update the responders + // + // Only ServerHello/HelloRetryRequest producer, which adds + // more responders later. + shc.handshakeProducers.put(SSLHandshake.SERVER_HELLO.id, + SSLHandshake.SERVER_HELLO); + + SSLHandshake[] probableHandshakeMessages = new SSLHandshake[] { + SSLHandshake.SERVER_HELLO, + + // full handshake messages + SSLHandshake.ENCRYPTED_EXTENSIONS, + SSLHandshake.CERTIFICATE_REQUEST, + SSLHandshake.CERTIFICATE, + SSLHandshake.CERTIFICATE_VERIFY, + SSLHandshake.FINISHED + }; + + // + // produce + // + for (SSLHandshake hs : probableHandshakeMessages) { + HandshakeProducer handshakeProducer = + shc.handshakeProducers.remove(hs.id); + if (handshakeProducer != null) { + handshakeProducer.produce(shc, clientHello); + } + } + } + } + + /** + * The "ClientHello" handshake message consumer for DTLS 1.2 and + * previous DTLS protocol versions. + */ + private static final + class D12ClientHelloConsumer implements HandshakeConsumer { + // Prevent instantiation of this class. + private D12ClientHelloConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + ClientHelloMessage clientHello = (ClientHelloMessage)message; + + // + // validate + // + + // Reject client initiated renegotiation? + // + // If server side should reject client-initiated renegotiation, + // send an Alert.HANDSHAKE_FAILURE fatal alert, not a + // no_renegotiation warning alert (no_renegotiation must be a + // warning: RFC 2246). no_renegotiation might seem more + // natural at first, but warnings are not appropriate because + // the sending party does not know how the receiving party + // will behave. This state must be treated as a fatal server + // condition. + // + // This will not have any impact on server initiated renegotiation. + if (shc.conContext.isNegotiated) { + if (!shc.conContext.secureRenegotiation && + !HandshakeContext.allowUnsafeRenegotiation) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsafe renegotiation is not allowed"); + } + + if (ServerHandshakeContext.rejectClientInitiatedRenego && + !shc.kickstartMessageDelivered) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Client initiated renegotiation is not allowed"); + } + } + + // Is it an abbreviated handshake? + if (clientHello.sessionId.length() != 0) { + SSLSessionImpl previous = ((SSLSessionContextImpl)shc.sslContext + .engineGetServerSessionContext()) + .get(clientHello.sessionId.getId()); + + boolean resumingSession = + (previous != null) && previous.isRejoinable(); + if (!resumingSession) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, " + + "the existing session is not rejoinable"); + } + } + // Validate the negotiated protocol version. + if (resumingSession) { + ProtocolVersion sessionProtocol = + previous.getProtocolVersion(); + if (sessionProtocol != shc.negotiatedProtocol) { + resumingSession = false; + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, not the same protocol version"); + } + } + } + + // Validate the required client authentication. + if (resumingSession && + (shc.sslConfig.clientAuthType == CLIENT_AUTH_REQUIRED)) { + + try { + previous.getPeerPrincipal(); + } catch (SSLPeerUnverifiedException e) { + resumingSession = false; + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, " + + "client authentication is required"); + } + } + } + + // Validate that the cached cipher suite. + if (resumingSession) { + CipherSuite suite = previous.getSuite(); + if ((!shc.isNegotiable(suite)) || + (!clientHello.cipherSuites.contains(suite))) { + resumingSession = false; + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, " + + "the session cipher suite is absent"); + } + } + } + + // So far so good. Note that the handshake extensions may reset + // the resuming options later. + shc.isResumption = resumingSession; + shc.resumingSession = resumingSession ? previous : null; + } + + HelloCookieManager hcm = + shc.sslContext.getHelloCookieManager(ProtocolVersion.DTLS10); + if (!shc.isResumption && + !hcm.isCookieValid(shc, clientHello, clientHello.cookie)) { + // + // Perform cookie exchange for DTLS handshaking if no cookie + // or the cookie is invalid in the ClientHello message. + // + // update the responders + shc.handshakeProducers.put( + SSLHandshake.HELLO_VERIFY_REQUEST.id, + SSLHandshake.HELLO_VERIFY_REQUEST); + + // + // produce response handshake message + // + SSLHandshake.HELLO_VERIFY_REQUEST.produce(context, clientHello); + + return; + } + + // cache the client random number for further using + shc.clientHelloRandom = clientHello.clientRandom; + + // Check and launch ClientHello extensions. + SSLExtension[] extTypes = shc.sslConfig.getEnabledExtensions( + SSLHandshake.CLIENT_HELLO); + clientHello.extensions.consumeOnLoad(shc, extTypes); + + // + // update + // + if (!shc.conContext.isNegotiated) { + shc.conContext.protocolVersion = shc.negotiatedProtocol; + shc.conContext.outputRecord.setVersion(shc.negotiatedProtocol); + } + + // update the responders + // + // Only need to ServerHello, which may add more responders later. + shc.handshakeProducers.put(SSLHandshake.SERVER_HELLO.id, + SSLHandshake.SERVER_HELLO); + + // + // produce + // + SSLHandshake[] probableHandshakeMessages = new SSLHandshake[] { + SSLHandshake.SERVER_HELLO, + + // full handshake messages + SSLHandshake.CERTIFICATE, + SSLHandshake.CERTIFICATE_STATUS, + SSLHandshake.SERVER_KEY_EXCHANGE, + SSLHandshake.CERTIFICATE_REQUEST, + SSLHandshake.SERVER_HELLO_DONE, + + // abbreviated handshake messages + SSLHandshake.FINISHED + }; + + for (SSLHandshake hs : probableHandshakeMessages) { + HandshakeProducer handshakeProducer = + shc.handshakeProducers.remove(hs.id); + if (handshakeProducer != null) { + handshakeProducer.produce(context, clientHello); + } + } + } + } + + /** + * The "ClientHello" handshake message consumer for DTLS 1.3. + */ + private static final + class D13ClientHelloConsumer implements HandshakeConsumer { + // Prevent instantiation of this class. + private D13ClientHelloConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientKeyExchange.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,36 +25,89 @@ package sun.security.ssl; -import javax.crypto.SecretKey; import java.io.IOException; -import java.io.PrintStream; -import java.security.Principal; +import java.nio.ByteBuffer; +import java.util.Map; +import sun.security.ssl.SSLHandshake.HandshakeMessage; /** - * Models a non-certificate based ClientKeyExchange + * Pack of the "ClientKeyExchange" handshake message. */ -public abstract class ClientKeyExchange extends HandshakeMessage { - - public ClientKeyExchange() { +final class ClientKeyExchange { + static final SSLConsumer handshakeConsumer = + new ClientKeyExchangeConsumer(); + static final HandshakeProducer handshakeProducer = + new ClientKeyExchangeProducer(); + + + /** + * The "ClientKeyExchange" handshake message producer. + */ + private static final + class ClientKeyExchangeProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private ClientKeyExchangeProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + SSLKeyExchange ke = SSLKeyExchange.valueOf( + chc.negotiatedCipherSuite.keyExchange, + chc.negotiatedProtocol); + if (ke != null) { + for (Map.Entry<Byte, HandshakeProducer> hp : + ke.getHandshakeProducers(chc)) { + if (hp.getKey() == SSLHandshake.CLIENT_KEY_EXCHANGE.id) { + return hp.getValue().produce(context, message); + } + } + } + + // not consumer defined. + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected ClientKeyExchange handshake message."); + return null; // make the compiler happe + } } - @Override - int messageType() { - return ht_client_key_exchange; + /** + * The "ClientKeyExchange" handshake message consumer. + */ + private static final + class ClientKeyExchangeConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private ClientKeyExchangeConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + // clean up this consumer + shc.handshakeConsumers.remove(SSLHandshake.CLIENT_KEY_EXCHANGE.id); + SSLKeyExchange ke = SSLKeyExchange.valueOf( + shc.negotiatedCipherSuite.keyExchange, + shc.negotiatedProtocol); + if (ke != null) { + for (Map.Entry<Byte, SSLConsumer> hc : + ke.getHandshakeConsumers(shc)) { + if (hc.getKey() == SSLHandshake.CLIENT_KEY_EXCHANGE.id) { + hc.getValue().consume(context, message); + return; + } + } + } + + // not consumer defined. + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected ClientKeyExchange handshake message."); + } } - - @Override - public abstract int messageLength(); - - @Override - public abstract void send(HandshakeOutStream s) throws IOException; - - @Override - public abstract void print(PrintStream s) throws IOException; - - public abstract SecretKey clientKeyExchange(); - - public abstract Principal getPeerPrincipal(); - - public abstract Principal getLocalPrincipal(); } + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ClientKeyExchangeService.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import sun.security.action.GetPropertyAction; - -import java.io.File; -import java.io.FilePermission; -import java.io.IOException; -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.Principal; -import java.security.PrivilegedAction; -import java.security.SecureRandom; -import java.util.*; - -/** - * Models a service that provides support for a particular client key exchange - * mode. Currently used to implement Kerberos-related cipher suites. - * - * @since 9 - */ -public interface ClientKeyExchangeService { - - static class Loader { - private static final Map<String,ClientKeyExchangeService> - providers = new HashMap<>(); - - static { - String path = GetPropertyAction.privilegedGetProperty("java.home"); - ServiceLoader<ClientKeyExchangeService> sc = - AccessController.doPrivileged( - (PrivilegedAction<ServiceLoader<ClientKeyExchangeService>>) - () -> ServiceLoader.loadInstalled(ClientKeyExchangeService.class), - null, - new FilePermission(new File(path, "-").toString(), "read")); - Iterator<ClientKeyExchangeService> iter = sc.iterator(); - while (iter.hasNext()) { - ClientKeyExchangeService cs = iter.next(); - for (String ex: cs.supported()) { - providers.put(ex, cs); - } - } - } - - } - - public static ClientKeyExchangeService find(String ex) { - return Loader.providers.get(ex); - } - - - /** - * Returns the supported key exchange modes by this provider. - * @return the supported key exchange modes - */ - String[] supported(); - - /** - * Returns a generalized credential object on the server side. The server - * side can use the info to determine if a cipher suite can be enabled. - * @param acc the AccessControlContext of the SSL session - * @return the credential object - */ - Object getServiceCreds(AccessControlContext acc); - - /** - * Returns the host name for a service principal. The info can be used in - * SNI or host name verifier. - * @param principal the principal of a service - * @return the string formed host name - */ - String getServiceHostName(Principal principal); - - /** - * Returns whether the specified principal is related to the current - * SSLSession. The info can be used to verify a SSL resume. - * @param isClient if true called from client side, otherwise from server - * @param acc the AccessControlContext of the SSL session - * @param p the specified principal - * @return true if related - */ - boolean isRelated(boolean isClient, AccessControlContext acc, Principal p); - - /** - * Creates the ClientKeyExchange object on the client side. - * @param serverName the intented peer name - * @param acc the AccessControlContext of the SSL session - * @param protocolVersion the TLS protocol version - * @param rand the SecureRandom that will used to generate the premaster - * @return the new Exchanger object - * @throws IOException if there is an error - */ - ClientKeyExchange createClientExchange(String serverName, AccessControlContext acc, - ProtocolVersion protocolVersion, SecureRandom rand) throws IOException; - - /** - * Create the ClientKeyExchange on the server side. - * @param protocolVersion the protocol version - * @param clientVersion the input protocol version - * @param rand a SecureRandom object used to generate premaster - * (if the server has to create one) - * @param encodedTicket the ticket from client - * @param encrypted the encrypted premaster secret from client - * @param acc the AccessControlContext of the SSL session - * @param ServiceCreds the service side credentials object as retrived from - * {@link #getServiceCreds} - * @return the new Exchanger object - * @throws IOException if there is an error - */ - ClientKeyExchange createServerExchange( - ProtocolVersion protocolVersion, ProtocolVersion clientVersion, - SecureRandom rand, byte[] encodedTicket, byte[] encrypted, - AccessControlContext acc, Object ServiceCreds) throws IOException; -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ConnectionContext.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ConnectionContext.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ConnectionContext.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ConnectionContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +/** + * SSL/(D)TLS connection context. + */ +interface ConnectionContext { + // blank +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ContentType.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ContentType.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ContentType.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ContentType.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +/** + * Enum for SSL/(D)TLS content types. + */ +enum ContentType { + INVALID ((byte)0, "invalid", + ProtocolVersion.PROTOCOLS_OF_13), + CHANGE_CIPHER_SPEC ((byte)20, "change_cipher_spec", + ProtocolVersion.PROTOCOLS_TO_12), + ALERT ((byte)21, "alert", + ProtocolVersion.PROTOCOLS_TO_13), + HANDSHAKE ((byte)22, "handshake", + ProtocolVersion.PROTOCOLS_TO_13), + APPLICATION_DATA ((byte)23, "application_data", + ProtocolVersion.PROTOCOLS_TO_13); + + final byte id; + final String name; + final ProtocolVersion[] supportedProtocols; + + private ContentType(byte id, String name, + ProtocolVersion[] supportedProtocols) { + this.id = id; + this.name = name; + this.supportedProtocols = supportedProtocols; + } + + static ContentType valueOf(byte id) { + for (ContentType ct : ContentType.values()) { + if (ct.id == id) { + return ct; + } + } + + return null; + } + + static String nameOf(byte id) { + for (ContentType ct : ContentType.values()) { + if (ct.id == id) { + return ct.name; + } + } + + return "<UNKNOWN CONTENT TYPE: " + (id & 0x0FF) + ">"; + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CookieExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CookieExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/CookieExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/CookieExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,318 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.Locale; +import javax.net.ssl.SSLProtocolException; + +import sun.security.ssl.ClientHello.ClientHelloMessage; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.ServerHello.ServerHelloMessage; +import sun.security.util.HexDumpEncoder; + +public class CookieExtension { + static final HandshakeProducer chNetworkProducer = + new CHCookieProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHCookieConsumer(); + static final HandshakeConsumer chOnTradeConsumer = + new CHCookieUpdate(); + + static final HandshakeProducer hrrNetworkProducer = + new HRRCookieProducer(); + static final ExtensionConsumer hrrOnLoadConsumer = + new HRRCookieConsumer(); + + static final HandshakeProducer hrrNetworkReproducer = + new HRRCookieReproducer(); + + static final CookieStringizer cookieStringizer = + new CookieStringizer(); + + /** + * The "cookie" extension. + */ + static class CookieSpec implements SSLExtensionSpec { + final byte[] cookie; + + private CookieSpec(ByteBuffer m) throws IOException { + // opaque cookie<1..2^16-1>; + if (m.remaining() < 3) { + throw new SSLProtocolException( + "Invalid cookie extension: insufficient data"); + } + + this.cookie = Record.getBytes16(m); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"cookie\": '{'\n" + + "{0}\n" + + "'}',", Locale.ENGLISH); + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent(hexEncoder.encode(cookie)) + }; + + return messageFormat.format(messageFields); + } + } + + private static final class CookieStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new CookieSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + private static final + class CHCookieProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHCookieProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + ClientHandshakeContext chc = (ClientHandshakeContext) context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(SSLExtension.CH_COOKIE)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable cookie extension"); + } + return null; + } + + // response to an HelloRetryRequest cookie + CookieSpec spec = (CookieSpec)chc.handshakeExtensions.get( + SSLExtension.HRR_COOKIE); + + if (spec != null && + spec.cookie != null && spec.cookie.length != 0) { + byte[] extData = new byte[spec.cookie.length + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putBytes16(m, spec.cookie); + return extData; + } + + return null; + } + } + + private static final + class CHCookieConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHCookieConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SSLExtension.CH_COOKIE)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable cookie extension"); + } + return; // ignore the extension + } + + CookieSpec spec; + try { + spec = new CookieSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + shc.handshakeExtensions.put(SSLExtension.CH_COOKIE, spec); + + // No impact on session resumption. + // + // Note that the protocol version negotiation happens before the + // session resumption negotiation. And the session resumption + // negotiation depends on the negotiated protocol version. + } + } + + private static final + class CHCookieUpdate implements HandshakeConsumer { + // Prevent instantiation of this class. + private CHCookieUpdate() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + ClientHelloMessage clientHello = (ClientHelloMessage)message; + + CookieSpec spec = (CookieSpec) + shc.handshakeExtensions.get(SSLExtension.CH_COOKIE); + if (spec == null) { + // Ignore, no "cookie" extension requested. + return; + } + + HelloCookieManager hcm = + shc.sslContext.getHelloCookieManager(shc.negotiatedProtocol); + if (!hcm.isCookieValid(shc, clientHello, spec.cookie)) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "unrecognized cookie"); + return; // fatal() always throws, make the compiler happy. + } + } + } + + private static final + class HRRCookieProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private HRRCookieProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + ServerHelloMessage hrrm = (ServerHelloMessage)message; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SSLExtension.HRR_COOKIE)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable cookie extension"); + } + return null; + } + + HelloCookieManager hcm = + shc.sslContext.getHelloCookieManager(shc.negotiatedProtocol); + + byte[] cookie = hcm.createCookie(shc, hrrm.clientHello); + + byte[] extData = new byte[cookie.length + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putBytes16(m, cookie); + + return extData; + } + } + + private static final + class HRRCookieConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private HRRCookieConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(SSLExtension.HRR_COOKIE)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable cookie extension"); + } + return; // ignore the extension + } + + CookieSpec spec; + try { + spec = new CookieSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + chc.handshakeExtensions.put(SSLExtension.HRR_COOKIE, spec); + } + } + + private static final + class HRRCookieReproducer implements HandshakeProducer { + // Prevent instantiation of this class. + private HRRCookieReproducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext) context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SSLExtension.HRR_COOKIE)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable cookie extension"); + } + return null; + } + + // copy of the ClientHello cookie + CookieSpec spec = (CookieSpec)shc.handshakeExtensions.get( + SSLExtension.CH_COOKIE); + + if (spec != null && + spec.cookie != null && spec.cookie.length != 0) { + byte[] extData = new byte[spec.cookie.length + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putBytes16(m, spec.cookie); + return extData; + } + + return null; + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Debug.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Debug.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Debug.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Debug.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,250 +0,0 @@ -/* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.PrintStream; -import java.util.Locale; - -import sun.security.util.HexDumpEncoder; -import java.nio.ByteBuffer; - -import sun.security.action.GetPropertyAction; - -/** - * This class has be shamefully lifted from sun.security.util.Debug - * - * @author Gary Ellison - */ -public class Debug { - - private String prefix; - - private static String args; - - static { - args = GetPropertyAction.privilegedGetProperty("javax.net.debug", ""); - args = args.toLowerCase(Locale.ENGLISH); - if (args.equals("help")) { - Help(); - } - } - - public static void Help() - { - System.err.println(); - System.err.println("all turn on all debugging"); - System.err.println("ssl turn on ssl debugging"); - System.err.println(); - System.err.println("The following can be used with ssl:"); - System.err.println("\trecord enable per-record tracing"); - System.err.println("\thandshake print each handshake message"); - System.err.println("\tkeygen print key generation data"); - System.err.println("\tsession print session activity"); - System.err.println("\tdefaultctx print default SSL initialization"); - System.err.println("\tsslctx print SSLContext tracing"); - System.err.println("\tsessioncache print session cache tracing"); - System.err.println("\tkeymanager print key manager tracing"); - System.err.println("\ttrustmanager print trust manager tracing"); - System.err.println("\tpluggability print pluggability tracing"); - System.err.println(); - System.err.println("\thandshake debugging can be widened with:"); - System.err.println("\tdata hex dump of each handshake message"); - System.err.println("\tverbose verbose handshake message printing"); - System.err.println(); - System.err.println("\trecord debugging can be widened with:"); - System.err.println("\tplaintext hex dump of record plaintext"); - System.err.println("\tpacket print raw SSL/TLS packets"); - System.err.println(); - System.exit(0); - } - - /** - * Get a Debug object corresponding to whether or not the given - * option is set. Set the prefix to be the same as option. - */ - - public static Debug getInstance(String option) - { - return getInstance(option, option); - } - - /** - * Get a Debug object corresponding to whether or not the given - * option is set. Set the prefix to be prefix. - */ - public static Debug getInstance(String option, String prefix) - { - if (isOn(option)) { - Debug d = new Debug(); - d.prefix = prefix; - return d; - } else { - return null; - } - } - - /** - * True if the property "javax.net.debug" contains the - * string "option". - */ - public static boolean isOn(String option) - { - if (args == null) { - return false; - } else { - int n = 0; - option = option.toLowerCase(Locale.ENGLISH); - - if (args.indexOf("all") != -1) { - return true; - } else if ((n = args.indexOf("ssl")) != -1) { - if (args.indexOf("sslctx", n) == -1) { - // don't enable data and plaintext options by default - if (!(option.equals("data") - || option.equals("packet") - || option.equals("plaintext"))) { - return true; - } - } - } - return (args.indexOf(option) != -1); - } - } - - /** - * print a message to stderr that is prefixed with the prefix - * created from the call to getInstance. - */ - - public void println(String message) - { - System.err.println(prefix + ": "+message); - } - - /** - * Print a message to stdout. - */ - static void log(String message) { - System.out.println(Thread.currentThread().getName() + ": " + message); - } - - /** - * print a blank line to stderr that is prefixed with the prefix. - */ - - public void println() - { - System.err.println(prefix + ":"); - } - - /** - * print a message to stderr that is prefixed with the prefix. - */ - public static void println(String prefix, String message) - { - System.err.println(prefix + ": "+message); - } - - public static void println(PrintStream s, String name, byte[] data) { - s.print(name + ": { "); - if (data == null) { - s.print("null"); - } else { - for (int i = 0; i < data.length; i++) { - if (i != 0) s.print(", "); - s.print(data[i] & 0x0ff); - } - } - s.println(" }"); - } - - /** - * Return the value of the boolean System property propName. - * - * Note use of privileged action. Do NOT make accessible to applications. - */ - static boolean getBooleanProperty(String propName, boolean defaultValue) { - // if set, require value of either true or false - String b = GetPropertyAction.privilegedGetProperty(propName); - if (b == null) { - return defaultValue; - } else if (b.equalsIgnoreCase("false")) { - return false; - } else if (b.equalsIgnoreCase("true")) { - return true; - } else { - throw new RuntimeException("Value of " + propName - + " must either be 'true' or 'false'"); - } - } - - static String toString(byte[] b) { - return sun.security.util.Debug.toString(b); - } - - static void printHex(String prefix, byte[] bytes) { - HexDumpEncoder dump = new HexDumpEncoder(); - - synchronized (System.out) { - System.out.println(prefix); - try { - dump.encodeBuffer(bytes, System.out); - } catch (Exception e) { - // ignore - } - System.out.flush(); - } - } - - static void printHex(String prefix, ByteBuffer bb) { - HexDumpEncoder dump = new HexDumpEncoder(); - - synchronized (System.out) { - System.out.println(prefix); - try { - dump.encodeBuffer(bb.slice(), System.out); - } catch (Exception e) { - // ignore - } - System.out.flush(); - } - } - - static void printHex(String prefix, byte[] bytes, int offset, int length) { - HexDumpEncoder dump = new HexDumpEncoder(); - - synchronized (System.out) { - System.out.println(prefix); - try { - ByteBuffer bb = ByteBuffer.wrap(bytes, offset, length); - dump.encodeBuffer(bb, System.out); - } catch (Exception e) { - // ignore - } - System.out.flush(); - } - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DHClientKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,88 +23,299 @@ * questions. */ - package sun.security.ssl; import java.io.IOException; -import java.io.PrintStream; import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.security.CryptoPrimitive; +import java.security.GeneralSecurityException; +import java.security.KeyFactory; +import java.text.MessageFormat; +import java.util.EnumSet; +import java.util.Locale; +import javax.crypto.SecretKey; +import javax.crypto.interfaces.DHPublicKey; +import javax.crypto.spec.DHParameterSpec; +import javax.crypto.spec.DHPublicKeySpec; import javax.net.ssl.SSLHandshakeException; +import sun.security.ssl.DHKeyExchange.DHECredentials; +import sun.security.ssl.DHKeyExchange.DHEPossession; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.util.HexDumpEncoder; -/* - * Message used by clients to send their Diffie-Hellman public - * keys to servers. - * - * @author David Brownell +/** + * Pack of the "ClientKeyExchange" handshake message. */ -final class DHClientKeyExchange extends HandshakeMessage { +final class DHClientKeyExchange { + static final DHClientKeyExchangeConsumer dhHandshakeConsumer = + new DHClientKeyExchangeConsumer(); + static final DHClientKeyExchangeProducer dhHandshakeProducer = + new DHClientKeyExchangeProducer(); + + /** + * The DiffieHellman ClientKeyExchange handshake message. + * + * If the client has sent a certificate which contains a suitable + * DiffieHellman key (for fixed_dh client authentication), then the + * client public value is implicit and does not need to be sent again. + * In this case, the client key exchange message will be sent, but it + * MUST be empty. + * + * Currently, we don't support cipher suite that requires implicit public + * key of client. + */ + private static final + class DHClientKeyExchangeMessage extends HandshakeMessage { + private byte[] y; // 1 to 2^16 - 1 bytes + + DHClientKeyExchangeMessage( + HandshakeContext handshakeContext) throws IOException { + super(handshakeContext); + // This happens in client side only. + ClientHandshakeContext chc = + (ClientHandshakeContext)handshakeContext; + + DHEPossession dhePossession = null; + for (SSLPossession possession : chc.handshakePossessions) { + if (possession instanceof DHEPossession) { + dhePossession = (DHEPossession)possession; + break; + } + } + + if (dhePossession == null) { + // unlikely + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No DHE credentials negotiated for client key exchange"); + } + + DHPublicKey publicKey = dhePossession.publicKey; + DHParameterSpec params = publicKey.getParams(); + this.y = Utilities.toByteArray(publicKey.getY()); + } - @Override - int messageType() { - return ht_client_key_exchange; - } + DHClientKeyExchangeMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + // This happens in server side only. + ServerHandshakeContext shc = + (ServerHandshakeContext)handshakeContext; + + if (m.remaining() < 3) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid DH ClientKeyExchange message: insufficient data"); + } + + this.y = Record.getBytes16(m); + + if (m.hasRemaining()) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid DH ClientKeyExchange message: unknown extra data"); + } + } - /* - * This value may be empty if it was included in the - * client's certificate ... - */ - private byte[] dh_Yc; // 1 to 2^16 -1 bytes + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CLIENT_KEY_EXCHANGE; + } - BigInteger getClientPublicKey() { - return dh_Yc == null ? null : new BigInteger(1, dh_Yc); - } + @Override + public int messageLength() { + return y.length + 2; // 2: length filed + } - /* - * Either pass the client's public key explicitly (because it's - * using DHE or DH_anon), or implicitly (the public key was in the - * certificate). - */ - DHClientKeyExchange(BigInteger publicKey) { - dh_Yc = toByteArray(publicKey); - } + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putBytes16(y); + } - DHClientKeyExchange() { - dh_Yc = null; + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"DH ClientKeyExchange\": '{'\n" + + " \"parameters\": '{'\n" + + " \"dh_Yc\": '{'\n" + + "{0}\n" + + " '}',\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent( + hexEncoder.encodeBuffer(y), " "), + }; + return messageFormat.format(messageFields); + } } - /* - * Get the client's public key either explicitly or implicitly. - * (It's ugly to have an empty record be sent in the latter case, - * but that's what the protocol spec requires.) + /** + * The DiffieHellman "ClientKeyExchange" handshake message producer. */ - DHClientKeyExchange(HandshakeInStream input) throws IOException { - if (input.available() >= 2) { - dh_Yc = input.getBytes16(); - } else { - // currently, we don't support cipher suites that requires - // implicit public key of client. - throw new SSLHandshakeException( - "Unsupported implicit client DiffieHellman public key"); + private static final + class DHClientKeyExchangeProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private DHClientKeyExchangeProducer() { + // blank } - } - @Override - int messageLength() { - if (dh_Yc == null) { - return 0; - } else { - return dh_Yc.length + 2; - } - } + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + DHECredentials dheCredentials = null; + for (SSLCredentials cd : chc.handshakeCredentials) { + if (cd instanceof DHECredentials) { + dheCredentials = (DHECredentials)cd; + break; + } + } + + if (dheCredentials == null) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No DHE credentials negotiated for client key exchange"); + } + + + DHEPossession dhePossession = new DHEPossession( + dheCredentials, chc.sslContext.getSecureRandom()); + chc.handshakePossessions.add(dhePossession); + DHClientKeyExchangeMessage ckem = + new DHClientKeyExchangeMessage(chc); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced DH ClientKeyExchange handshake message", ckem); + } + + // Output the handshake message. + ckem.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // update the states + SSLKeyExchange ke = SSLKeyExchange.valueOf( + chc.negotiatedCipherSuite.keyExchange, + chc.negotiatedProtocol); + if (ke == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key exchange type"); + } else { + SSLKeyDerivation masterKD = ke.createKeyDerivation(chc); + SecretKey masterSecret = + masterKD.deriveKey("MasterSecret", null); + chc.handshakeSession.setMasterSecret(masterSecret); + + SSLTrafficKeyDerivation kd = + SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol); + if (kd == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + chc.negotiatedProtocol); + } else { + chc.handshakeKeyDerivation = + kd.createKeyDerivation(chc, masterSecret); + } + } - @Override - void send(HandshakeOutStream s) throws IOException { - if (dh_Yc != null && dh_Yc.length != 0) { - s.putBytes16(dh_Yc); + // The handshake message has been delivered. + return null; } } - @Override - void print(PrintStream s) throws IOException { - s.println("*** ClientKeyExchange, DH"); + /** + * The DiffieHellman "ClientKeyExchange" handshake message consumer. + */ + private static final + class DHClientKeyExchangeConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private DHClientKeyExchangeConsumer() { + // blank + } - if (debug != null && Debug.isOn("verbose")) { - Debug.println(s, "DH Public key", dh_Yc); + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + DHEPossession dhePossession = null; + for (SSLPossession possession : shc.handshakePossessions) { + if (possession instanceof DHEPossession) { + dhePossession = (DHEPossession)possession; + break; + } + } + + if (dhePossession == null) { + // unlikely + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No expected DHE possessions for client key exchange"); + } + + SSLKeyExchange ke = SSLKeyExchange.valueOf( + shc.negotiatedCipherSuite.keyExchange, + shc.negotiatedProtocol); + if (ke == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key exchange type"); + } + + DHClientKeyExchangeMessage ckem = + new DHClientKeyExchangeMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming DH ClientKeyExchange handshake message", ckem); + } + + // create the credentials + try { + DHParameterSpec params = dhePossession.publicKey.getParams(); + DHPublicKeySpec spec = new DHPublicKeySpec( + new BigInteger(1, ckem.y), + params.getP(), params.getG()); + KeyFactory kf = JsseJce.getKeyFactory("DiffieHellman"); + DHPublicKey peerPublicKey = + (DHPublicKey)kf.generatePublic(spec); + + // check constraints of peer DHPublicKey + if (!shc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + peerPublicKey)) { + throw new SSLHandshakeException( + "DHPublicKey does not comply to algorithm constraints"); + } + + NamedGroup namedGroup = NamedGroup.valueOf(params); + shc.handshakeCredentials.add( + new DHECredentials(peerPublicKey, namedGroup)); + } catch (GeneralSecurityException | java.io.IOException e) { + throw (SSLHandshakeException)(new SSLHandshakeException( + "Could not generate DHPublicKey").initCause(e)); + } + + // update the states + SSLKeyDerivation masterKD = ke.createKeyDerivation(shc); + SecretKey masterSecret = + masterKD.deriveKey("MasterSecret", null); + shc.handshakeSession.setMasterSecret(masterSecret); + + SSLTrafficKeyDerivation kd = + SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol); + if (kd == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + shc.negotiatedProtocol); + } else { + shc.handshakeKeyDerivation = + kd.createKeyDerivation(shc, masterSecret); + } } } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DHCrypt.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DHCrypt.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DHCrypt.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DHCrypt.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,278 +0,0 @@ -/* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package sun.security.ssl; - -import java.math.BigInteger; -import java.security.*; -import javax.net.ssl.SSLHandshakeException; -import javax.crypto.SecretKey; -import javax.crypto.KeyAgreement; -import javax.crypto.interfaces.DHPublicKey; -import javax.crypto.spec.*; -import java.util.EnumSet; - -import sun.security.util.KeyUtil; - -/** - * This class implements the Diffie-Hellman key exchange algorithm. - * D-H means combining your private key with your partners public key to - * generate a number. The peer does the same with its private key and our - * public key. Through the magic of Diffie-Hellman we both come up with the - * same number. This number is secret (discounting MITM attacks) and hence - * called the shared secret. It has the same length as the modulus, e.g. 512 - * or 1024 bit. Man-in-the-middle attacks are typically countered by an - * independent authentication step using certificates (RSA, DSA, etc.). - * - * The thing to note is that the shared secret is constant for two partners - * with constant private keys. This is often not what we want, which is why - * it is generally a good idea to create a new private key for each session. - * Generating a private key involves one modular exponentiation assuming - * suitable D-H parameters are available. - * - * General usage of this class (TLS DHE case): - * . if we are server, call DHCrypt(keyLength,random). This generates - * an ephemeral keypair of the request length. - * . if we are client, call DHCrypt(modulus, base, random). This - * generates an ephemeral keypair using the parameters specified by - * the server. - * . send parameters and public value to remote peer - * . receive peers ephemeral public key - * . call getAgreedSecret() to calculate the shared secret - * - * In TLS the server chooses the parameter values itself, the client must use - * those sent to it by the server. - * - * The use of ephemeral keys as described above also achieves what is called - * "forward secrecy". This means that even if the authentication keys are - * broken at a later date, the shared secret remains secure. The session is - * compromised only if the authentication keys are already broken at the - * time the key exchange takes place and an active MITM attack is used. - * This is in contrast to straightforward encrypting RSA key exchanges. - * - * @author David Brownell - */ -final class DHCrypt { - - // group parameters (prime modulus and generator) - private BigInteger modulus; // P (aka N) - private BigInteger base; // G (aka alpha) - - // our private key (including private component x) - private PrivateKey privateKey; - - // public component of our key, X = (g ^ x) mod p - private BigInteger publicValue; // X (aka y) - - // the times to recove from failure if public key validation - private static int MAX_FAILOVER_TIMES = 2; - - /** - * Generate a Diffie-Hellman keypair of the specified size. - */ - DHCrypt(int keyLength, SecureRandom random) { - this(keyLength, - PredefinedDHParameterSpecs.definedParams.get(keyLength), random); - } - - /** - * Generate a Diffie-Hellman keypair using the specified parameters. - * - * @param modulus the Diffie-Hellman modulus P - * @param base the Diffie-Hellman base G - */ - DHCrypt(BigInteger modulus, BigInteger base, SecureRandom random) { - this(modulus.bitLength(), - new DHParameterSpec(modulus, base), random); - } - - /** - * Generate a Diffie-Hellman keypair using the named group. - */ - DHCrypt(NamedGroup namedGroup, SecureRandom random) { - this(-1, // The length (-1) is not used in the implementation. - SupportedGroupsExtension.getDHParameterSpec(namedGroup), random); - } - - /** - * Generate a Diffie-Hellman keypair using the specified size and - * parameters. - */ - private DHCrypt(int keyLength, - DHParameterSpec params, SecureRandom random) { - - try { - KeyPairGenerator kpg = JsseJce.getKeyPairGenerator("DiffieHellman"); - if (params != null) { - kpg.initialize(params, random); - } else { - kpg.initialize(keyLength, random); - } - - DHPublicKeySpec spec = generateDHPublicKeySpec(kpg); - if (spec == null) { - throw new RuntimeException("Could not generate DH keypair"); - } - - publicValue = spec.getY(); - modulus = spec.getP(); - base = spec.getG(); - } catch (GeneralSecurityException e) { - throw new RuntimeException("Could not generate DH keypair", e); - } - } - - static DHPublicKeySpec getDHPublicKeySpec(PublicKey key) { - if (key instanceof DHPublicKey) { - DHPublicKey dhKey = (DHPublicKey)key; - DHParameterSpec params = dhKey.getParams(); - return new DHPublicKeySpec(dhKey.getY(), - params.getP(), params.getG()); - } - try { - KeyFactory factory = JsseJce.getKeyFactory("DiffieHellman"); - return factory.getKeySpec(key, DHPublicKeySpec.class); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - - /** Returns the Diffie-Hellman modulus. */ - BigInteger getModulus() { - return modulus; - } - - /** Returns the Diffie-Hellman base (generator). */ - BigInteger getBase() { - return base; - } - - /** - * Gets the public key of this end of the key exchange. - */ - BigInteger getPublicKey() { - return publicValue; - } - - /** - * Get the secret data that has been agreed on through Diffie-Hellman - * key agreement protocol. Note that in the two party protocol, if - * the peer keys are already known, no other data needs to be sent in - * order to agree on a secret. That is, a secured message may be - * sent without any mandatory round-trip overheads. - * - * <P>It is illegal to call this member function if the private key - * has not been set (or generated). - * - * @param peerPublicKey the peer's public key. - * @param keyIsValidated whether the {@code peerPublicKey} has beed - * validated - * @return the secret, which is an unsigned big-endian integer - * the same size as the Diffie-Hellman modulus. - */ - SecretKey getAgreedSecret(BigInteger peerPublicValue, - boolean keyIsValidated) throws SSLHandshakeException { - try { - KeyFactory kf = JsseJce.getKeyFactory("DiffieHellman"); - DHPublicKeySpec spec = - new DHPublicKeySpec(peerPublicValue, modulus, base); - PublicKey publicKey = kf.generatePublic(spec); - KeyAgreement ka = JsseJce.getKeyAgreement("DiffieHellman"); - - // validate the Diffie-Hellman public key - if (!keyIsValidated && - !KeyUtil.isOracleJCEProvider(ka.getProvider().getName())) { - try { - KeyUtil.validate(spec); - } catch (InvalidKeyException ike) { - // prefer handshake_failure alert to internal_error alert - throw new SSLHandshakeException(ike.getMessage()); - } - } - - ka.init(privateKey); - ka.doPhase(publicKey, true); - return ka.generateSecret("TlsPremasterSecret"); - } catch (GeneralSecurityException e) { - throw (SSLHandshakeException) new SSLHandshakeException( - "Could not generate secret").initCause(e); - } - } - - // Check constraints of the specified DH public key. - void checkConstraints(AlgorithmConstraints constraints, - BigInteger peerPublicValue) throws SSLHandshakeException { - - try { - KeyFactory kf = JsseJce.getKeyFactory("DiffieHellman"); - DHPublicKeySpec spec = - new DHPublicKeySpec(peerPublicValue, modulus, base); - DHPublicKey publicKey = (DHPublicKey)kf.generatePublic(spec); - - // check constraints of DHPublicKey - if (!constraints.permits( - EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), publicKey)) { - throw new SSLHandshakeException( - "DHPublicKey does not comply to algorithm constraints"); - } - } catch (GeneralSecurityException gse) { - throw (SSLHandshakeException) new SSLHandshakeException( - "Could not generate DHPublicKey").initCause(gse); - } - } - - // Generate and validate DHPublicKeySpec - private DHPublicKeySpec generateDHPublicKeySpec(KeyPairGenerator kpg) - throws GeneralSecurityException { - - boolean doExtraValiadtion = - (!KeyUtil.isOracleJCEProvider(kpg.getProvider().getName())); - for (int i = 0; i <= MAX_FAILOVER_TIMES; i++) { - KeyPair kp = kpg.generateKeyPair(); - privateKey = kp.getPrivate(); - DHPublicKeySpec spec = getDHPublicKeySpec(kp.getPublic()); - - // validate the Diffie-Hellman public key - if (doExtraValiadtion) { - try { - KeyUtil.validate(spec); - } catch (InvalidKeyException ivke) { - if (i == MAX_FAILOVER_TIMES) { - throw ivke; - } - // otherwise, ignore the exception and try the next one - continue; - } - } - - return spec; - } - - return null; - } -} - diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DHKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DHKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DHKeyExchange.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DHKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,534 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.math.BigInteger; +import java.security.GeneralSecurityException; +import java.security.InvalidKeyException; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.InvalidKeySpecException; +import javax.crypto.KeyAgreement; +import javax.crypto.SecretKey; +import javax.crypto.interfaces.DHPublicKey; +import javax.crypto.spec.DHParameterSpec; +import javax.crypto.spec.DHPublicKeySpec; +import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.SSLHandshakeException; +import sun.security.action.GetPropertyAction; +import sun.security.ssl.CipherSuite.HashAlg; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.SupportedGroupsExtension.NamedGroupType; +import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; +import sun.security.ssl.X509Authentication.X509Possession; +import sun.security.util.KeyUtil; + +final class DHKeyExchange { + static final SSLPossessionGenerator poGenerator = + new DHEPossessionGenerator(false); + static final SSLPossessionGenerator poExportableGenerator = + new DHEPossessionGenerator(true); + static final SSLKeyAgreementGenerator kaGenerator = + new DHEKAGenerator(); + + static final class DHECredentials implements SSLCredentials { + final DHPublicKey popPublicKey; + final NamedGroup namedGroup; + + DHECredentials(DHPublicKey popPublicKey, NamedGroup namedGroup) { + this.popPublicKey = popPublicKey; + this.namedGroup = namedGroup; + } + + static DHECredentials valueOf(NamedGroup ng, + byte[] encodedPublic) throws IOException, GeneralSecurityException { + + if (ng.type != NamedGroupType.NAMED_GROUP_FFDHE) { + throw new RuntimeException( + "Credentials decoding: Not FFDHE named group"); + } + + if (encodedPublic == null || encodedPublic.length == 0) { + return null; + } + + DHParameterSpec params = (DHParameterSpec)ng.getParameterSpec(); + if (params == null) { + return null; + } + + KeyFactory kf = JsseJce.getKeyFactory("DiffieHellman"); + DHPublicKeySpec spec = new DHPublicKeySpec( + new BigInteger(1, encodedPublic), + params.getP(), params.getG()); + DHPublicKey publicKey = + (DHPublicKey)kf.generatePublic(spec); + + return new DHECredentials(publicKey, ng); + } + } + + static final class DHEPossession implements SSLPossession { + final PrivateKey privateKey; + final DHPublicKey publicKey; + final NamedGroup namedGroup; + + DHEPossession(NamedGroup namedGroup, SecureRandom random) { + try { + KeyPairGenerator kpg = + JsseJce.getKeyPairGenerator("DiffieHellman"); + DHParameterSpec params = + (DHParameterSpec)namedGroup.getParameterSpec(); + kpg.initialize(params, random); + KeyPair kp = generateDHKeyPair(kpg); + if (kp == null) { + throw new RuntimeException("Could not generate DH keypair"); + } + privateKey = kp.getPrivate(); + publicKey = (DHPublicKey)kp.getPublic(); + } catch (GeneralSecurityException gse) { + throw new RuntimeException( + "Could not generate DH keypair", gse); + } + + this.namedGroup = namedGroup; + } + + DHEPossession(int keyLength, SecureRandom random) { + DHParameterSpec params = + PredefinedDHParameterSpecs.definedParams.get(keyLength); + try { + KeyPairGenerator kpg = + JsseJce.getKeyPairGenerator("DiffieHellman"); + if (params != null) { + kpg.initialize(params, random); + } else { + kpg.initialize(keyLength, random); + } + + KeyPair kp = generateDHKeyPair(kpg); + if (kp == null) { + throw new RuntimeException( + "Could not generate DH keypair of " + + keyLength + " bits"); + } + privateKey = kp.getPrivate(); + publicKey = (DHPublicKey)kp.getPublic(); + } catch (GeneralSecurityException gse) { + throw new RuntimeException( + "Could not generate DH keypair", gse); + } + + this.namedGroup = NamedGroup.valueOf(publicKey.getParams()); + } + + DHEPossession(DHECredentials credentials, SecureRandom random) { + try { + KeyPairGenerator kpg = + JsseJce.getKeyPairGenerator("DiffieHellman"); + kpg.initialize(credentials.popPublicKey.getParams(), random); + KeyPair kp = generateDHKeyPair(kpg); + if (kp == null) { + throw new RuntimeException("Could not generate DH keypair"); + } + privateKey = kp.getPrivate(); + publicKey = (DHPublicKey)kp.getPublic(); + } catch (GeneralSecurityException gse) { + throw new RuntimeException( + "Could not generate DH keypair", gse); + } + + this.namedGroup = credentials.namedGroup; + } + + // Generate and validate DHPublicKeySpec + private KeyPair generateDHKeyPair( + KeyPairGenerator kpg) throws GeneralSecurityException { + boolean doExtraValiadtion = + (!KeyUtil.isOracleJCEProvider(kpg.getProvider().getName())); + boolean isRecovering = false; + for (int i = 0; i <= 2; i++) { // Try to recover from failure. + KeyPair kp = kpg.generateKeyPair(); + // validate the Diffie-Hellman public key + if (doExtraValiadtion) { + DHPublicKeySpec spec = getDHPublicKeySpec(kp.getPublic()); + try { + KeyUtil.validate(spec); + } catch (InvalidKeyException ivke) { + if (isRecovering) { + throw ivke; + } + // otherwise, ignore the exception and try again + isRecovering = true; + continue; + } + } + + return kp; + } + + return null; + } + + private static DHPublicKeySpec getDHPublicKeySpec(PublicKey key) { + if (key instanceof DHPublicKey) { + DHPublicKey dhKey = (DHPublicKey)key; + DHParameterSpec params = dhKey.getParams(); + return new DHPublicKeySpec(dhKey.getY(), + params.getP(), params.getG()); + } + try { + KeyFactory factory = JsseJce.getKeyFactory("DiffieHellman"); + return factory.getKeySpec(key, DHPublicKeySpec.class); + } catch (NoSuchAlgorithmException | InvalidKeySpecException e) { + // unlikely + throw new RuntimeException("Unable to get DHPublicKeySpec", e); + } + } + + @Override + public byte[] encode() { + // Note: the DH public value is encoded as a big-endian integer + // and padded to the left with zeros to the size of p in bytes. + byte[] encoded = publicKey.getY().toByteArray(); + int pSize = KeyUtil.getKeySize(publicKey); + if (pSize > 0 && encoded.length < pSize) { + byte[] buffer = new byte[pSize]; + System.arraycopy(encoded, 0, + buffer, pSize - encoded.length, encoded.length); + encoded = buffer; + } + + return encoded; + } + } + + private static final class + DHEPossessionGenerator implements SSLPossessionGenerator { + // Flag to use smart ephemeral DH key which size matches the + // corresponding authentication key + private static final boolean useSmartEphemeralDHKeys; + + // Flag to use legacy ephemeral DH key which size is 512 bits for + // exportable cipher suites, and 768 bits for others + private static final boolean useLegacyEphemeralDHKeys; + + // The customized ephemeral DH key size for non-exportable + // cipher suites. + private static final int customizedDHKeySize; + + // Is it for exportable cipher suite? + private final boolean exportable; + + static { + String property = GetPropertyAction.privilegedGetProperty( + "jdk.tls.ephemeralDHKeySize"); + if (property == null || property.length() == 0) { + useLegacyEphemeralDHKeys = false; + useSmartEphemeralDHKeys = false; + customizedDHKeySize = -1; + } else if ("matched".equals(property)) { + useLegacyEphemeralDHKeys = false; + useSmartEphemeralDHKeys = true; + customizedDHKeySize = -1; + } else if ("legacy".equals(property)) { + useLegacyEphemeralDHKeys = true; + useSmartEphemeralDHKeys = false; + customizedDHKeySize = -1; + } else { + useLegacyEphemeralDHKeys = false; + useSmartEphemeralDHKeys = false; + + try { + // DH parameter generation can be extremely slow, best to + // use one of the supported pre-computed DH parameters + // (see DHCrypt class). + customizedDHKeySize = Integer.parseUnsignedInt(property); + if (customizedDHKeySize < 1024 || + customizedDHKeySize > 8192 || + (customizedDHKeySize & 0x3f) != 0) { + throw new IllegalArgumentException( + "Unsupported customized DH key size: " + + customizedDHKeySize + ". " + + "The key size must be multiple of 64, " + + "and range from 1024 to 8192 (inclusive)"); + } + } catch (NumberFormatException nfe) { + throw new IllegalArgumentException( + "Invalid system property jdk.tls.ephemeralDHKeySize"); + } + } + } + + // Prevent instantiation of this class. + private DHEPossessionGenerator(boolean exportable) { + this.exportable = exportable; + } + + // Used for ServerKeyExchange, TLS 1.2 and prior versions. + @Override + public SSLPossession createPossession(HandshakeContext context) { + NamedGroup preferableNamedGroup = null; + if (!useLegacyEphemeralDHKeys && + (context.clientRequestedNamedGroups != null) && + (!context.clientRequestedNamedGroups.isEmpty())) { + preferableNamedGroup = + SupportedGroups.getPreferredGroup( + context.negotiatedProtocol, + context.algorithmConstraints, + NamedGroupType.NAMED_GROUP_FFDHE, + context.clientRequestedNamedGroups); + if (preferableNamedGroup != null) { + return new DHEPossession(preferableNamedGroup, + context.sslContext.getSecureRandom()); + } + } + + /* + * 768 bits ephemeral DH private keys were used to be used in + * ServerKeyExchange except that exportable ciphers max out at 512 + * bits modulus values. We still adhere to this behavior in legacy + * mode (system property "jdk.tls.ephemeralDHKeySize" is defined + * as "legacy"). + * + * Old JDK (JDK 7 and previous) releases don't support DH keys + * bigger than 1024 bits. We have to consider the compatibility + * requirement. 1024 bits DH key is always used for non-exportable + * cipher suites in default mode (system property + * "jdk.tls.ephemeralDHKeySize" is not defined). + * + * However, if applications want more stronger strength, setting + * system property "jdk.tls.ephemeralDHKeySize" to "matched" + * is a workaround to use ephemeral DH key which size matches the + * corresponding authentication key. For example, if the public key + * size of an authentication certificate is 2048 bits, then the + * ephemeral DH key size should be 2048 bits accordingly unless + * the cipher suite is exportable. This key sizing scheme keeps + * the cryptographic strength consistent between authentication + * keys and key-exchange keys. + * + * Applications may also want to customize the ephemeral DH key + * size to a fixed length for non-exportable cipher suites. This + * can be approached by setting system property + * "jdk.tls.ephemeralDHKeySize" to a valid positive integer between + * 1024 and 8192 bits, inclusive. + * + * Note that the minimum acceptable key size is 1024 bits except + * exportable cipher suites or legacy mode. + * + * Note that per RFC 2246, the key size limit of DH is 512 bits for + * exportable cipher suites. Because of the weakness, exportable + * cipher suites are deprecated since TLS v1.1 and they are not + * enabled by default in Oracle provider. The legacy behavior is + * reserved and 512 bits DH key is always used for exportable + * cipher suites. + */ + int keySize = exportable ? 512 : 1024; // default mode + if (!exportable) { + if (useLegacyEphemeralDHKeys) { // legacy mode + keySize = 768; + } else if (useSmartEphemeralDHKeys) { // matched mode + PrivateKey key = null; + ServerHandshakeContext shc = + (ServerHandshakeContext)context; + if (shc.interimAuthn instanceof X509Possession) { + key = ((X509Possession)shc.interimAuthn).popPrivateKey; + } + + if (key != null) { + int ks = KeyUtil.getKeySize(key); + + // DH parameter generation can be extremely slow, make + // sure to use one of the supported pre-computed DH + // parameters. + // + // Old deployed applications may not be ready to + // support DH key sizes bigger than 2048 bits. Please + // DON'T use value other than 1024 and 2048 at present. + // May improve the underlying providers and key size + // limit in the future when the compatibility and + // interoperability impact is limited. + keySize = ks <= 1024 ? 1024 : 2048; + } // Otherwise, anonymous cipher suites, 1024-bit is used. + } else if (customizedDHKeySize > 0) { // customized mode + keySize = customizedDHKeySize; + } + } + + return new DHEPossession( + keySize, context.sslContext.getSecureRandom()); + } + } + + private static final + class DHEKAGenerator implements SSLKeyAgreementGenerator { + static private DHEKAGenerator instance = new DHEKAGenerator(); + + // Prevent instantiation of this class. + private DHEKAGenerator() { + // blank + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext context) throws IOException { + DHEPossession dhePossession = null; + DHECredentials dheCredentials = null; + for (SSLPossession poss : context.handshakePossessions) { + if (!(poss instanceof DHEPossession)) { + continue; + } + + DHEPossession dhep = (DHEPossession)poss; + for (SSLCredentials cred : context.handshakeCredentials) { + if (!(cred instanceof DHECredentials)) { + continue; + } + DHECredentials dhec = (DHECredentials)cred; + if (dhep.namedGroup != null && dhec.namedGroup != null) { + if (dhep.namedGroup.equals(dhec.namedGroup)) { + dheCredentials = (DHECredentials)cred; + break; + } + } else { + DHParameterSpec pps = dhep.publicKey.getParams(); + DHParameterSpec cps = dhec.popPublicKey.getParams(); + if (pps.getP().equals(cps.getP()) && + pps.getG().equals(cps.getG())) { + dheCredentials = (DHECredentials)cred; + break; + } + } + } + + if (dheCredentials != null) { + dhePossession = (DHEPossession)poss; + break; + } + } + + if (dhePossession == null || dheCredentials == null) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No sufficient DHE key agreement parameters negotiated"); + } + + return new DHEKAKeyDerivation(context, + dhePossession.privateKey, dheCredentials.popPublicKey); + } + + private static final + class DHEKAKeyDerivation implements SSLKeyDerivation { + private final HandshakeContext context; + private final PrivateKey localPrivateKey; + private final PublicKey peerPublicKey; + + DHEKAKeyDerivation(HandshakeContext context, + PrivateKey localPrivateKey, + PublicKey peerPublicKey) { + this.context = context; + this.localPrivateKey = localPrivateKey; + this.peerPublicKey = peerPublicKey; + } + + @Override + public SecretKey deriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + if (!context.negotiatedProtocol.useTLS13PlusSpec()) { + return t12DeriveKey(algorithm, params); + } else { + return t13DeriveKey(algorithm, params); + } + } + + private SecretKey t12DeriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + try { + KeyAgreement ka = JsseJce.getKeyAgreement("DiffieHellman"); + ka.init(localPrivateKey); + ka.doPhase(peerPublicKey, true); + SecretKey preMasterSecret = + ka.generateSecret("TlsPremasterSecret"); + SSLMasterKeyDerivation mskd = + SSLMasterKeyDerivation.valueOf( + context.negotiatedProtocol); + if (mskd == null) { + // unlikely + throw new SSLHandshakeException( + "No expected master key derivation for protocol: " + + context.negotiatedProtocol.name); + } + SSLKeyDerivation kd = mskd.createKeyDerivation( + context, preMasterSecret); + return kd.deriveKey("MasterSecret", params); + } catch (GeneralSecurityException gse) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(gse); + } + } + + private SecretKey t13DeriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + try { + KeyAgreement ka = JsseJce.getKeyAgreement("DiffieHellman"); + ka.init(localPrivateKey); + ka.doPhase(peerPublicKey, true); + SecretKey sharedSecret = + ka.generateSecret("TlsPremasterSecret"); + + HashAlg hashAlg = context.negotiatedCipherSuite.hashAlg; + SSLKeyDerivation kd = context.handshakeKeyDerivation; + HKDF hkdf = new HKDF(hashAlg.name); + if (kd == null) { // No PSK is in use. + // If PSK is not in use Early Secret will still be + // HKDF-Extract(0, 0). + byte[] zeros = new byte[hashAlg.hashLength]; + SecretKeySpec ikm = + new SecretKeySpec(zeros, "TlsPreSharedSecret"); + SecretKey earlySecret = + hkdf.extract(zeros, ikm, "TlsEarlySecret"); + kd = new SSLSecretDerivation(context, earlySecret); + } + + // derive salt secret + SecretKey saltSecret = kd.deriveKey("TlsSaltSecret", null); + + // derive handshake secret + return hkdf.extract(saltSecret, sharedSecret, algorithm); + } catch (GeneralSecurityException gse) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(gse); + } + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DHServerKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,565 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.security.CryptoPrimitive; +import java.security.GeneralSecurityException; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.Signature; +import java.security.SignatureException; +import java.text.MessageFormat; +import java.util.EnumSet; +import java.util.Locale; +import javax.crypto.interfaces.DHPublicKey; +import javax.crypto.spec.DHParameterSpec; +import javax.crypto.spec.DHPublicKeySpec; +import sun.security.ssl.DHKeyExchange.DHECredentials; +import sun.security.ssl.DHKeyExchange.DHEPossession; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.X509Authentication.X509Credentials; +import sun.security.ssl.X509Authentication.X509Possession; +import sun.security.util.HexDumpEncoder; +import sun.security.util.KeyUtil; + +/** + * Pack of the ServerKeyExchange handshake message. + */ +final class DHServerKeyExchange { + static final SSLConsumer dhHandshakeConsumer = + new DHServerKeyExchangeConsumer(); + static final HandshakeProducer dhHandshakeProducer = + new DHServerKeyExchangeProducer(); + + /** + * The DiffieHellman ServerKeyExchange handshake message. + */ + private static final + class DHServerKeyExchangeMessage extends HandshakeMessage { + // public key encapsulated in this message + private final byte[] p; // 1 to 2^16 - 1 bytes + private final byte[] g; // 1 to 2^16 - 1 bytes + private final byte[] y; // 1 to 2^16 - 1 bytes + + // the signature algorithm used by this ServerKeyExchange message + private final boolean useExplicitSigAlgorithm; + private final SignatureScheme signatureScheme; + + // signature bytes, or null if anonymous + private final byte[] paramsSignature; + + DHServerKeyExchangeMessage( + HandshakeContext handshakeContext) throws IOException { + super(handshakeContext); + + // This happens in server side only. + ServerHandshakeContext shc = + (ServerHandshakeContext)handshakeContext; + + DHEPossession dhePossession = null; + X509Possession x509Possession = null; + for (SSLPossession possession : shc.handshakePossessions) { + if (possession instanceof DHEPossession) { + dhePossession = (DHEPossession)possession; + if (x509Possession != null) { + break; + } + } else if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + if (dhePossession != null) { + break; + } + } + } + + if (dhePossession == null) { + // unlikely + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No DHE credentials negotiated for server key exchange"); + } + DHPublicKey publicKey = dhePossession.publicKey; + DHParameterSpec params = publicKey.getParams(); + this.p = Utilities.toByteArray(params.getP()); + this.g = Utilities.toByteArray(params.getG()); + this.y = Utilities.toByteArray(publicKey.getY()); + + if (x509Possession == null) { + // anonymous, no authentication, no signature + paramsSignature = null; + signatureScheme = null; + useExplicitSigAlgorithm = false; + } else { + useExplicitSigAlgorithm = + shc.negotiatedProtocol.useTLS12PlusSpec(); + Signature signer = null; + if (useExplicitSigAlgorithm) { + signatureScheme = SignatureScheme.getPreferableAlgorithm( + shc.peerRequestedSignatureSchemes, + x509Possession.popPrivateKey, + shc.negotiatedProtocol); + if (signatureScheme == null) { + // Unlikely, the credentials generator should have + // selected the preferable signature algorithm properly. + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "No preferred signature algorithm"); + } + try { + signer = signatureScheme.getSignature( + x509Possession.popPrivateKey); + } catch (NoSuchAlgorithmException | InvalidKeyException | + InvalidAlgorithmParameterException nsae) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm: " + + signatureScheme.name, nsae); + } + } else { + signatureScheme = null; + try { + signer = getSignature( + x509Possession.popPrivateKey.getAlgorithm(), + x509Possession.popPrivateKey); + } catch (NoSuchAlgorithmException | InvalidKeyException e) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm: " + + x509Possession.popPrivateKey.getAlgorithm(), e); + } + } + + byte[] signature = null; + try { + updateSignature(signer, shc.clientHelloRandom.randomBytes, + shc.serverHelloRandom.randomBytes); + signature = signer.sign(); + } catch (SignatureException ex) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failed to sign dhe parameters: " + + x509Possession.popPrivateKey.getAlgorithm(), ex); + } + paramsSignature = signature; + } + } + + DHServerKeyExchangeMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + // This happens in client side only. + ClientHandshakeContext chc = + (ClientHandshakeContext)handshakeContext; + + this.p = Record.getBytes16(m); + this.g = Record.getBytes16(m); + this.y = Record.getBytes16(m); + + try { + KeyUtil.validate(new DHPublicKeySpec( + new BigInteger(1, y), + new BigInteger(1, p), + new BigInteger(1, p))); + } catch (InvalidKeyException ike) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid DH ServerKeyExchange: invalid parameters", ike); + } + + X509Credentials x509Credentials = null; + for (SSLCredentials cd : chc.handshakeCredentials) { + if (cd instanceof X509Credentials) { + x509Credentials = (X509Credentials)cd; + break; + } + } + + if (x509Credentials == null) { + // anonymous, no authentication, no signature + if (m.hasRemaining()) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid DH ServerKeyExchange: unknown extra data"); + } + + this.signatureScheme = null; + this.paramsSignature = null; + this.useExplicitSigAlgorithm = false; + + return; + } + + this.useExplicitSigAlgorithm = + chc.negotiatedProtocol.useTLS12PlusSpec(); + if (useExplicitSigAlgorithm) { + int ssid = Record.getInt16(m); + signatureScheme = SignatureScheme.valueOf(ssid); + if (signatureScheme == null) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid signature algorithm (" + ssid + + ") used in DH ServerKeyExchange handshake message"); + } + + if (!chc.localSupportedSignAlgs.contains(signatureScheme)) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsupported signature algorithm (" + + signatureScheme.name + + ") used in DH ServerKeyExchange handshake message"); + } + } else { + this.signatureScheme = null; + } + + // read and verify the signature + this.paramsSignature = Record.getBytes16(m); + Signature signer; + if (useExplicitSigAlgorithm) { + try { + signer = signatureScheme.getSignature( + x509Credentials.popPublicKey); + } catch (NoSuchAlgorithmException | InvalidKeyException | + InvalidAlgorithmParameterException nsae) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm: " + + signatureScheme.name, nsae); + + return; // make the compiler happe + } + } else { + try { + signer = getSignature( + x509Credentials.popPublicKey.getAlgorithm(), + x509Credentials.popPublicKey); + } catch (NoSuchAlgorithmException | InvalidKeyException e) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm: " + + x509Credentials.popPublicKey.getAlgorithm(), e); + + return; // make the compiler happe + } + } + + try { + updateSignature(signer, + chc.clientHelloRandom.randomBytes, + chc.serverHelloRandom.randomBytes); + + if (!signer.verify(paramsSignature)) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid signature on DH ServerKeyExchange message"); + } + } catch (SignatureException ex) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot verify DH ServerKeyExchange signature", ex); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.SERVER_KEY_EXCHANGE; + } + + @Override + public int messageLength() { + int sigLen = 0; + if (paramsSignature != null) { + sigLen = 2 + paramsSignature.length; + if (useExplicitSigAlgorithm) { + sigLen += SignatureScheme.sizeInRecord(); + } + } + + return 6 + p.length + g.length + y.length + sigLen; + // 6: overhead for p, g, y values + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putBytes16(p); + hos.putBytes16(g); + hos.putBytes16(y); + + if (paramsSignature != null) { + if (useExplicitSigAlgorithm) { + hos.putInt16(signatureScheme.id); + } + + hos.putBytes16(paramsSignature); + } + } + + @Override + public String toString() { + if (paramsSignature == null) { // anonymous + MessageFormat messageFormat = new MessageFormat( + "\"DH ServerKeyExchange\": '{'\n" + + " \"parameters\": '{'\n" + + " \"dh_p\": '{'\n" + + "{0}\n" + + " '}',\n" + + " \"dh_g\": '{'\n" + + "{1}\n" + + " '}',\n" + + " \"dh_Ys\": '{'\n" + + "{2}\n" + + " '}',\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent( + hexEncoder.encodeBuffer(p), " "), + Utilities.indent( + hexEncoder.encodeBuffer(g), " "), + Utilities.indent( + hexEncoder.encodeBuffer(y), " "), + }; + + return messageFormat.format(messageFields); + } + + if (useExplicitSigAlgorithm) { + MessageFormat messageFormat = new MessageFormat( + "\"DH ServerKeyExchange\": '{'\n" + + " \"parameters\": '{'\n" + + " \"dh_p\": '{'\n" + + "{0}\n" + + " '}',\n" + + " \"dh_g\": '{'\n" + + "{1}\n" + + " '}',\n" + + " \"dh_Ys\": '{'\n" + + "{2}\n" + + " '}',\n" + + " '}',\n" + + " \"digital signature\": '{'\n" + + " \"signature algorithm\": \"{3}\"\n" + + " \"signature\": '{'\n" + + "{4}\n" + + " '}',\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent( + hexEncoder.encodeBuffer(p), " "), + Utilities.indent( + hexEncoder.encodeBuffer(g), " "), + Utilities.indent( + hexEncoder.encodeBuffer(y), " "), + signatureScheme.name, + Utilities.indent( + hexEncoder.encodeBuffer(paramsSignature), " ") + }; + + return messageFormat.format(messageFields); + } else { + MessageFormat messageFormat = new MessageFormat( + "\"DH ServerKeyExchange\": '{'\n" + + " \"parameters\": '{'\n" + + " \"dh_p\": '{'\n" + + "{0}\n" + + " '}',\n" + + " \"dh_g\": '{'\n" + + "{1}\n" + + " '}',\n" + + " \"dh_Ys\": '{'\n" + + "{2}\n" + + " '}',\n" + + " '}',\n" + + " \"signature\": '{'\n" + + "{3}\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent( + hexEncoder.encodeBuffer(p), " "), + Utilities.indent( + hexEncoder.encodeBuffer(g), " "), + Utilities.indent( + hexEncoder.encodeBuffer(y), " "), + Utilities.indent( + hexEncoder.encodeBuffer(paramsSignature), " ") + }; + + return messageFormat.format(messageFields); + } + } + + private static Signature getSignature(String keyAlgorithm, + Key key) throws NoSuchAlgorithmException, InvalidKeyException { + Signature signer = null; + switch (keyAlgorithm) { + case "DSA": + signer = JsseJce.getSignature(JsseJce.SIGNATURE_DSA); + break; + case "RSA": + signer = RSASignature.getInstance(); + break; + default: + throw new NoSuchAlgorithmException( + "neither an RSA or a DSA key : " + keyAlgorithm); + } + + if (signer != null) { + if (key instanceof PublicKey) { + signer.initVerify((PublicKey)(key)); + } else { + signer.initSign((PrivateKey)key); + } + } + + return signer; + } + + /* + * Update sig with nonces and Diffie-Hellman public key. + */ + private void updateSignature(Signature sig, byte[] clntNonce, + byte[] svrNonce) throws SignatureException { + int tmp; + + sig.update(clntNonce); + sig.update(svrNonce); + + sig.update((byte)(p.length >> 8)); + sig.update((byte)(p.length & 0x0ff)); + sig.update(p); + + sig.update((byte)(g.length >> 8)); + sig.update((byte)(g.length & 0x0ff)); + sig.update(g); + + sig.update((byte)(y.length >> 8)); + sig.update((byte)(y.length & 0x0ff)); + sig.update(y); + } + } + + /** + * The DiffieHellman "ServerKeyExchange" handshake message producer. + */ + static final class DHServerKeyExchangeProducer + implements HandshakeProducer { + // Prevent instantiation of this class. + private DHServerKeyExchangeProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + DHServerKeyExchangeMessage skem = + new DHServerKeyExchangeMessage(shc); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced DH ServerKeyExchange handshake message", skem); + } + + // Output the handshake message. + skem.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The DiffieHellman "ServerKeyExchange" handshake message consumer. + */ + static final class DHServerKeyExchangeConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private DHServerKeyExchangeConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + DHServerKeyExchangeMessage skem = + new DHServerKeyExchangeMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming DH ServerKeyExchange handshake message", skem); + } + + // + // validate + // + // check constraints of EC PublicKey + DHPublicKey publicKey; + try { + KeyFactory kf = JsseJce.getKeyFactory("DiffieHellman"); + DHPublicKeySpec spec = new DHPublicKeySpec( + new BigInteger(1, skem.y), + new BigInteger(1, skem.p), + new BigInteger(1, skem.g)); + publicKey = (DHPublicKey)kf.generatePublic(spec); + } catch (GeneralSecurityException gse) { + chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, + "Could not generate DHPublicKey", gse); + + return; // make the compiler happy + } + + if (!chc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), publicKey)) { + chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, + "DH ServerKeyExchange does not comply to " + + "algorithm constraints"); + } + + // + // update + // + NamedGroup namedGroup = NamedGroup.valueOf(publicKey.getParams()); + chc.handshakeCredentials.add( + new DHECredentials(publicKey, namedGroup)); + + // + // produce + // + // Need no new handshake message producers here. + } + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DTLSInputRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -18,56 +18,41 @@ * 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 + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 9406+5 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package sun.security.ssl; -import java.io.*; -import java.nio.*; -import java.util.*; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; import javax.crypto.BadPaddingException; - -import javax.net.ssl.*; - -import sun.security.util.HexDumpEncoder; -import static sun.security.ssl.HandshakeMessage.*; +import javax.net.ssl.SSLException; +import sun.security.ssl.SSLCipher.SSLReadCipher; /** * DTLS {@code InputRecord} implementation for {@code SSLEngine}. */ final class DTLSInputRecord extends InputRecord implements DTLSRecord { - private DTLSReassembler reassembler = null; + private int readEpoch; - int readEpoch; - - int prevReadEpoch; - Authenticator prevReadAuthenticator; - CipherBox prevReadCipher; - - DTLSInputRecord() { + DTLSInputRecord(HandshakeHash handshakeHash) { + super(handshakeHash, SSLReadCipher.nullDTlsReadCipher()); this.readEpoch = 0; - this.readAuthenticator = new MAC(true); - - this.prevReadEpoch = 0; - this.prevReadCipher = CipherBox.NULL; - this.prevReadAuthenticator = new MAC(true); } @Override - void changeReadCiphers(Authenticator readAuthenticator, - CipherBox readCipher) { - - prevReadCipher.dispose(); - - this.prevReadAuthenticator = this.readAuthenticator; - this.prevReadCipher = this.readCipher; - this.prevReadEpoch = this.readEpoch; - - this.readAuthenticator = readAuthenticator; + void changeReadCiphers(SSLReadCipher readCipher) { this.readCipher = readCipher; this.readEpoch++; } @@ -75,7 +60,6 @@ @Override public synchronized void close() throws IOException { if (!isClosed) { - prevReadCipher.dispose(); super.close(); } } @@ -87,14 +71,8 @@ @Override int estimateFragmentSize(int packetSize) { - int macLen = 0; - if (readAuthenticator instanceof MAC) { - macLen = ((MAC)readAuthenticator).MAClen(); - } - if (packetSize > 0) { - return readCipher.estimateFragmentSize( - packetSize, macLen, headerSize); + return readCipher.estimateFragmentSize(packetSize, headerSize); } else { return Record.maxDataSize; } @@ -108,6 +86,11 @@ } @Override + void finishHandshake() { + reassembler = null; + } + + @Override Plaintext acquirePlaintext() { if (reassembler != null) { return reassembler.acquirePlaintext(); @@ -116,16 +99,28 @@ return null; } - @Override - Plaintext decode(ByteBuffer packet) { + @Override + Plaintext[] decode(ByteBuffer[] srcs, int srcsOffset, + int srcsLength) throws IOException, BadPaddingException { + if (srcs == null || srcs.length == 0 || srcsLength == 0) { + Plaintext pt = acquirePlaintext(); + return pt == null ? new Plaintext[0] : new Plaintext[] { pt }; + } else if (srcsLength == 1) { + return decode(srcs[srcsOffset]); + } else { + ByteBuffer packet = extract(srcs, + srcsOffset, srcsLength, DTLSRecord.headerSize); + return decode(packet); + } + } + Plaintext[] decode(ByteBuffer packet) { if (isClosed) { return null; } - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw read]: length = " + packet.remaining(), packet); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw read", packet); } // The caller should have validated the record. @@ -149,20 +144,20 @@ int contentLen = ((packet.get() & 0xFF) << 8) | (packet.get() & 0xFF); // pos: 11, 12 - if (debug != null && Debug.isOn("record")) { - Debug.log("READ: " + - ProtocolVersion.valueOf(majorVersion, minorVersion) + - " " + Record.contentName(contentType) + ", length = " + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine("READ: " + + ProtocolVersion.nameOf(majorVersion, minorVersion) + + " " + ContentType.nameOf(contentType) + ", length = " + contentLen); } - int recLim = srcPos + DTLSRecord.headerSize + contentLen; + int recLim = Math.addExact(srcPos, DTLSRecord.headerSize + contentLen); - if (this.prevReadEpoch > recordEpoch) { + if (this.readEpoch > recordEpoch) { // Reset the position of the packet buffer. packet.position(recLim); - if (debug != null && Debug.isOn("record")) { - Debug.printHex("READ: discard this old record", recordEnS); + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine("READ: discard this old record", recordEnS); } return null; } @@ -171,20 +166,23 @@ if (this.readEpoch < recordEpoch) { // Discard the record younger than the current epcoh if: // 1. it is not a handshake message, or - // 2. it is not of next epoch. - if (((contentType != Record.ct_handshake) && - (contentType != Record.ct_change_cipher_spec)) || + // 3. it is not of next epoch. + if ((contentType != ContentType.HANDSHAKE.id && + contentType != ContentType.CHANGE_CIPHER_SPEC.id) || + (reassembler == null && + contentType != ContentType.HANDSHAKE.id) || (this.readEpoch < (recordEpoch - 1))) { packet.position(recLim); - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Premature record (epoch), discard it."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("Premature record (epoch), discard it."); } return null; } + // Not ready to decrypt this record, may be an encrypted Finished // message, need to buffer it. byte[] fragment = new byte[contentLen]; @@ -193,80 +191,65 @@ majorVersion, minorVersion, recordEnS, recordEpoch, recordSeq, true); + if (reassembler == null) { + reassembler = new DTLSReassembler(recordEpoch); + } reassembler.queueUpFragment(buffered); // consume the full record in the packet buffer. packet.position(recLim); - return reassembler.acquirePlaintext(); + Plaintext pt = reassembler.acquirePlaintext(); + return pt == null ? null : new Plaintext[] { pt }; } // - // Now, the message is of this epoch or the previous epoch. + // Now, the message is of this epoch. // - Authenticator decodeAuthenticator; - CipherBox decodeCipher; - if (this.readEpoch == recordEpoch) { - decodeAuthenticator = readAuthenticator; - decodeCipher = readCipher; - } else { // prevReadEpoch == recordEpoch - decodeAuthenticator = prevReadAuthenticator; - decodeCipher = prevReadCipher; - } - // decrypt the fragment packet.limit(recLim); packet.position(srcPos + DTLSRecord.headerSize); ByteBuffer plaintextFragment; try { - plaintextFragment = decrypt(decodeAuthenticator, - decodeCipher, contentType, packet, recordEnS); - } catch (BadPaddingException bpe) { - if (debug != null && Debug.isOn("ssl")) { - Debug.log("Discard invalid record: " + bpe); + Plaintext plaintext = + readCipher.decrypt(contentType, packet, recordEnS); + plaintextFragment = plaintext.fragment; + contentType = plaintext.contentType; + } catch (GeneralSecurityException gse) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("Discard invalid record: " + gse); } // invalid, discard this record [section 4.1.2.7, RFC 6347] return null; } finally { - // comsume a complete record + // consume a complete record packet.limit(srcLim); packet.position(recLim); } - if (contentType != Record.ct_change_cipher_spec && - contentType != Record.ct_handshake) { // app data or alert + if (contentType != ContentType.CHANGE_CIPHER_SPEC.id && + contentType != ContentType.HANDSHAKE.id) { // app data or alert // no retransmission // Cleanup the handshake reassembler if necessary. if ((reassembler != null) && (reassembler.handshakeEpoch < recordEpoch)) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Cleanup the handshake reassembler"); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("Cleanup the handshake reassembler"); } reassembler = null; } - return new Plaintext(contentType, majorVersion, minorVersion, - recordEpoch, Authenticator.toLong(recordEnS), - plaintextFragment); + return new Plaintext[] { + new Plaintext(contentType, majorVersion, minorVersion, + recordEpoch, Authenticator.toLong(recordEnS), + plaintextFragment)}; } - if (contentType == Record.ct_change_cipher_spec) { + if (contentType == ContentType.CHANGE_CIPHER_SPEC.id) { if (reassembler == null) { - if (this.readEpoch != recordEpoch) { - // handshake has not started, should be an - // old handshake message, discard it. - - if (debug != null && Debug.isOn("verbose")) { - Debug.log( - "Lagging behind ChangeCipherSpec, discard it."); - } - - return null; - } - reassembler = new DTLSReassembler(recordEpoch); } @@ -284,26 +267,15 @@ if (hsFrag == null) { // invalid, discard this record - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Invalid handshake message, discard it."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Invalid handshake message, discard it."); } return null; } if (reassembler == null) { - if (this.readEpoch != recordEpoch) { - // handshake has not started, should be an - // old handshake message, discard it. - - if (debug != null && Debug.isOn("verbose")) { - Debug.log( - "Lagging behind handshake record, discard it."); - } - - return null; - } - reassembler = new DTLSReassembler(recordEpoch); } @@ -314,18 +286,25 @@ // Completed the read of the full record. Acquire the reassembled // messages. if (reassembler != null) { - return reassembler.acquirePlaintext(); + Plaintext pt = reassembler.acquirePlaintext(); + return pt == null ? null : new Plaintext[] { pt }; } - if (debug != null && Debug.isOn("verbose")) { - Debug.log("The reassembler is not initialized yet."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("The reassembler is not initialized yet."); } return null; } @Override - int bytesInCompletePacket(ByteBuffer packet) throws SSLException { + int bytesInCompletePacket( + ByteBuffer[] srcs, int srcsOffset, int srcsLength) throws IOException { + + return bytesInCompletePacket(srcs[srcsOffset]); + } + + private int bytesInCompletePacket(ByteBuffer packet) throws SSLException { // DTLS length field is in bytes 11/12 if (packet.remaining() < headerSize) { @@ -337,15 +316,20 @@ // Check the content type of the record. byte contentType = packet.get(pos); - if (!Record.isValidContentType(contentType)) { + if (ContentType.valueOf(contentType) == null) { throw new SSLException( "Unrecognized SSL message, plaintext connection?"); } // Check the protocol version of the record. - ProtocolVersion recordVersion = - ProtocolVersion.valueOf(packet.get(pos + 1), packet.get(pos + 2)); - checkRecordVersion(recordVersion, false); + byte majorVersion = packet.get(pos + 1); + byte minorVersion = packet.get(pos + 2); + if (!ProtocolVersion.isNegotiable( + majorVersion, minorVersion, true, false)) { + throw new SSLException("Unrecognized record version " + + ProtocolVersion.nameOf(majorVersion, minorVersion) + + " , plaintext connection?"); + } // Get the fragment length of the record. int fragLen = ((packet.get(pos + 11) & 0xFF) << 8) + @@ -359,17 +343,6 @@ return fragLen; } - @Override - void checkRecordVersion(ProtocolVersion recordVersion, - boolean allowSSL20Hello) throws SSLException { - - if (!recordVersion.maybeDTLSProtocol()) { - throw new SSLException( - "Unrecognized record version " + recordVersion + - " , plaintext connection?"); - } - } - private static HandshakeFragment parseHandshakeMessage( byte contentType, byte majorVersion, byte minorVersion, byte[] recordEnS, int recordEpoch, long recordSeq, @@ -377,8 +350,8 @@ int remaining = plaintextFragment.remaining(); if (remaining < handshakeHeaderSize) { - if (debug != null && Debug.isOn("ssl")) { - Debug.log("Discard invalid record: " + + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("Discard invalid record: " + "too small record to hold a handshake fragment"); } @@ -403,8 +376,8 @@ ((plaintextFragment.get() & 0xFF) << 8) | (plaintextFragment.get() & 0xFF); // pos: 9-11 if ((remaining - handshakeHeaderSize) < fragmentLength) { - if (debug != null && Debug.isOn("ssl")) { - Debug.log("Discard invalid record: " + + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("Discard invalid record: " + "not a complete handshake fragment in the record"); } @@ -461,20 +434,20 @@ @Override public int compareTo(RecordFragment o) { - if (this.contentType == Record.ct_change_cipher_spec) { - if (o.contentType == Record.ct_change_cipher_spec) { + if (this.contentType == ContentType.CHANGE_CIPHER_SPEC.id) { + if (o.contentType == ContentType.CHANGE_CIPHER_SPEC.id) { // Only one incoming ChangeCipherSpec message for an epoch. // // Ignore duplicated ChangeCipherSpec messages. return Integer.compare(this.recordEpoch, o.recordEpoch); } else if ((this.recordEpoch == o.recordEpoch) && - (o.contentType == Record.ct_handshake)) { + (o.contentType == ContentType.HANDSHAKE.id)) { // ChangeCipherSpec is the latest message of an epoch. return 1; } - } else if (o.contentType == Record.ct_change_cipher_spec) { + } else if (o.contentType == ContentType.CHANGE_CIPHER_SPEC.id) { if ((this.recordEpoch == o.recordEpoch) && - (this.contentType == Record.ct_handshake)) { + (this.contentType == ContentType.HANDSHAKE.id)) { // ChangeCipherSpec is the latest message of an epoch. return -1; } else { @@ -559,7 +532,7 @@ } private static final class HandshakeFlight implements Cloneable { - static final byte HF_UNKNOWN = HandshakeMessage.ht_not_applicable; + static final byte HF_UNKNOWN = SSLHandshake.NOT_APPLICABLE.id; byte handshakeType; // handshake type int flightEpoch; // the epoch of the first message @@ -665,7 +638,7 @@ } if (isMinimalFlightMessage && (hsf.fragmentOffset == 0) && - (hsf.handshakeType != HandshakeMessage.ht_finished)) { + (hsf.handshakeType != SSLHandshake.FINISHED.id)) { // reset the handshake flight handshakeFlight.handshakeType = hsf.handshakeType; @@ -673,7 +646,7 @@ handshakeFlight.minMessageSeq = hsf.messageSeq; } - if (hsf.handshakeType == HandshakeMessage.ht_finished) { + if (hsf.handshakeType == SSLHandshake.FINISHED.id) { handshakeFlight.maxMessageSeq = hsf.messageSeq; handshakeFlight.maxRecordEpoch = hsf.recordEpoch; handshakeFlight.maxRecordSeq = hsf.recordSeq; @@ -718,8 +691,8 @@ // It's OK to discard retransmission as the handshake hash // is computed as if each handshake message had been sent // as a single fragment. - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Have got the full message, discard it."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("Have got the full message, discard it."); } return; @@ -742,8 +715,8 @@ ((hole.limit > hsf.fragmentOffset) && (hole.limit < fragmentLimit))) { - if (debug != null && Debug.isOn("ssl")) { - Debug.log("Discard invalid record: " + + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("Discard invalid record: " + "handshake fragment ranges are overlapping"); } @@ -773,7 +746,7 @@ } // buffer this fragment - if (hsf.handshakeType == HandshakeMessage.ht_finished) { + if (hsf.handshakeType == SSLHandshake.FINISHED.id) { // Need no status update. bufferedFragments.add(hsf); } else { @@ -849,7 +822,9 @@ if (precedingFlight.maxMessageSeq < hsf.messageSeq) { isNewFlight = true; } - } else if (rf.contentType != Record.ct_change_cipher_spec) { + } else if ( + rf.contentType != ContentType.CHANGE_CIPHER_SPEC.id) { + // ciphertext if (precedingFlight.maxRecordEpoch < rf.recordEpoch) { isNewFlight = true; @@ -904,8 +879,9 @@ int previousEpoch = nextRecordEpoch - 1; if (rf.recordEpoch < previousEpoch) { // Too old to use, discard this record. - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Too old epoch to use this record, discard it."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Too old epoch to use this record, discard it."); } return false; @@ -932,7 +908,9 @@ if (precedingFlight.minMessageSeq > hsf.messageSeq) { isDesired = false; } - } else if (rf.contentType == Record.ct_change_cipher_spec) { + } else if ( + rf.contentType == ContentType.CHANGE_CIPHER_SPEC.id) { + // ChangeCipherSpec if (precedingFlight.flightEpoch != rf.recordEpoch) { isDesired = false; @@ -948,8 +926,9 @@ if (!isDesired) { // Too old to use, discard this retransmitted record - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Too old retransmission to use, discard it."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Too old retransmission to use, discard it."); } return false; @@ -960,8 +939,9 @@ // Previously disordered record for the current epoch. // // Should has been retransmitted. Discard this record. - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Lagging behind record (sequence), discard it."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Lagging behind record (sequence), discard it."); } return false; @@ -978,8 +958,8 @@ Plaintext acquirePlaintext() { if (bufferedFragments.isEmpty()) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log("No received handshake messages"); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("No received handshake messages"); } return null; } @@ -999,8 +979,8 @@ // Reset the next handshake flight. resetHandshakeFlight(precedingFlight); - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Received a retransmission flight."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("Received a retransmission flight."); } return Plaintext.PLAINTEXT_NULL; @@ -1011,9 +991,10 @@ } if (!flightIsReady) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log("The handshake flight is not ready to use: " + - handshakeFlight.handshakeType); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "The handshake flight is not ready to use: " + + handshakeFlight.handshakeType); } return null; } @@ -1036,7 +1017,7 @@ resetHandshakeFlight(precedingFlight); if (expectCCSFlight && - (precedingFlight.flightEpoch == + (precedingFlight.handshakeType == HandshakeFlight.HF_UNKNOWN)) { expectCCSFlight = false; } @@ -1088,13 +1069,13 @@ } private Plaintext acquireCachedMessage() { - RecordFragment rFrag = bufferedFragments.first(); if (readEpoch != rFrag.recordEpoch) { if (readEpoch > rFrag.recordEpoch) { // discard old records - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Discard old buffered ciphertext fragments."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Discard old buffered ciphertext fragments."); } bufferedFragments.remove(rFrag); // popup the fragment } @@ -1104,8 +1085,9 @@ flightIsReady = false; } - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Not yet ready to decrypt the cached fragments."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Not yet ready to decrypt the cached fragments."); } return null; } @@ -1115,11 +1097,13 @@ ByteBuffer fragment = ByteBuffer.wrap(rFrag.fragment); ByteBuffer plaintextFragment = null; try { - plaintextFragment = decrypt(readAuthenticator, readCipher, + Plaintext plaintext = readCipher.decrypt( rFrag.contentType, fragment, rFrag.recordEnS); - } catch (BadPaddingException bpe) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Discard invalid record: " + bpe); + plaintextFragment = plaintext.fragment; + rFrag.contentType = plaintext.contentType; + } catch (GeneralSecurityException gse) { + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("Discard invalid record: ", gse); } // invalid, discard this record [section 4.1.2.7, RFC 6347] @@ -1130,7 +1114,7 @@ // end of this flight), ClinetHello or HelloRequest (the // beginning of the next flight) message. Need not to check // any ChangeCipherSpec message. - if (rFrag.contentType == Record.ct_handshake) { + if (rFrag.contentType == ContentType.HANDSHAKE.id) { while (plaintextFragment.remaining() > 0) { HandshakeFragment hsFrag = parseHandshakeMessage( rFrag.contentType, @@ -1140,8 +1124,8 @@ if (hsFrag == null) { // invalid, discard this record - if (debug != null && Debug.isOn("verbose")) { - Debug.printHex( + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( "Invalid handshake fragment, discard it", plaintextFragment); } @@ -1153,7 +1137,7 @@ // been checked and updated for the Finished handshake // message before the decryption. Please don't update // flightIsReady for Finished messages. - if (hsFrag.handshakeType != HandshakeMessage.ht_finished) { + if (hsFrag.handshakeType != SSLHandshake.FINISHED.id) { flightIsReady = false; needToCheckFlight = true; } @@ -1172,7 +1156,7 @@ private Plaintext acquireHandshakeMessage() { RecordFragment rFrag = bufferedFragments.first(); - if (rFrag.contentType == Record.ct_change_cipher_spec) { + if (rFrag.contentType == ContentType.CHANGE_CIPHER_SPEC.id) { this.nextRecordEpoch = rFrag.recordEpoch + 1; // For retransmissions, the next record sequence number is a @@ -1183,16 +1167,12 @@ // Popup the fragment. bufferedFragments.remove(rFrag); - - // Reload if this message has been reserved for handshake hash. - handshakeHash.reload(); - return new Plaintext(rFrag.contentType, rFrag.majorVersion, rFrag.minorVersion, rFrag.recordEpoch, Authenticator.toLong(rFrag.recordEnS), ByteBuffer.wrap(rFrag.fragment)); - } else { // rFrag.contentType == Record.ct_handshake + } else { // rFrag.contentType == ContentType.HANDSHAKE.id HandshakeFragment hsFrag = (HandshakeFragment)rFrag; if ((hsFrag.messageLength == hsFrag.fragmentLength) && (hsFrag.fragmentOffset == 0)) { // no fragmentation @@ -1204,7 +1184,8 @@ // Note: may try to avoid byte array copy in the future. byte[] recordFrag = new byte[hsFrag.messageLength + 4]; - Plaintext plaintext = new Plaintext(hsFrag.contentType, + Plaintext plaintext = new Plaintext( + hsFrag.contentType, hsFrag.majorVersion, hsFrag.minorVersion, hsFrag.recordEpoch, Authenticator.toLong(hsFrag.recordEnS), @@ -1230,7 +1211,8 @@ // // Note: may try to avoid byte array copy in the future. byte[] recordFrag = new byte[hsFrag.messageLength + 4]; - Plaintext plaintext = new Plaintext(hsFrag.contentType, + Plaintext plaintext = new Plaintext( + hsFrag.contentType, hsFrag.majorVersion, hsFrag.minorVersion, hsFrag.recordEpoch, Authenticator.toLong(hsFrag.recordEnS), @@ -1264,7 +1246,7 @@ // read the next buffered record if (!bufferedFragments.isEmpty()) { rFrag = bufferedFragments.first(); - if (rFrag.contentType != Record.ct_handshake) { + if (rFrag.contentType != ContentType.HANDSHAKE.id) { break; } else { hmFrag = (HandshakeFragment)rFrag; @@ -1293,29 +1275,30 @@ if (expectCCSFlight) { // Have the ChangeCipherSpec/Finished flight been received? boolean isReady = hasFinishedMessage(bufferedFragments); - if (debug != null && Debug.isOn("verbose")) { - Debug.log( + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( "Has the final flight been received? " + isReady); } return isReady; } - if (debug != null && Debug.isOn("verbose")) { - Debug.log("No flight is received yet."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("No flight is received yet."); } return false; } - if ((flightType == HandshakeMessage.ht_client_hello) || - (flightType == HandshakeMessage.ht_hello_request) || - (flightType == HandshakeMessage.ht_hello_verify_request)) { + if ((flightType == SSLHandshake.CLIENT_HELLO.id) || + (flightType == SSLHandshake.HELLO_REQUEST.id) || + (flightType == SSLHandshake.HELLO_VERIFY_REQUEST.id)) { // single handshake message flight boolean isReady = hasCompleted(flightType); - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Is the handshake message completed? " + isReady); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Is the handshake message completed? " + isReady); } return isReady; @@ -1324,11 +1307,11 @@ // // the ServerHello flight // - if (flightType == HandshakeMessage.ht_server_hello) { + if (flightType == SSLHandshake.SERVER_HELLO.id) { // Firstly, check the first flight handshake message. if (!hasCompleted(flightType)) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log( + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( "The ServerHello message is not completed yet."); } @@ -1339,8 +1322,8 @@ // an abbreviated handshake // if (hasFinishedMessage(bufferedFragments)) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log("It's an abbreviated handshake."); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("It's an abbreviated handshake."); } return true; @@ -1350,11 +1333,12 @@ // a full handshake // List<HoleDescriptor> holes = handshakeFlight.holesMap.get( - HandshakeMessage.ht_server_hello_done); + SSLHandshake.SERVER_HELLO_DONE.id); if ((holes == null) || !holes.isEmpty()) { // Not yet got the final message of the flight. - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Not yet got the ServerHelloDone message"); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Not yet got the ServerHelloDone message"); } return false; @@ -1364,8 +1348,9 @@ boolean isReady = hasCompleted(bufferedFragments, handshakeFlight.minMessageSeq, handshakeFlight.maxMessageSeq); - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Is the ServerHello flight (message " + + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Is the ServerHello flight (message " + handshakeFlight.minMessageSeq + "-" + handshakeFlight.maxMessageSeq + ") completed? " + isReady); @@ -1381,13 +1366,13 @@ // ht_supplemental_data and ht_certificate_url are // suppported in the future. // - if ((flightType == HandshakeMessage.ht_certificate) || - (flightType == HandshakeMessage.ht_client_key_exchange)) { + if ((flightType == SSLHandshake.CERTIFICATE.id) || + (flightType == SSLHandshake.CLIENT_KEY_EXCHANGE.id)) { // Firstly, check the first flight handshake message. if (!hasCompleted(flightType)) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log( + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( "The ClientKeyExchange or client Certificate " + "message is not completed yet."); } @@ -1396,12 +1381,12 @@ } // Is client CertificateVerify a mandatory message? - if (flightType == HandshakeMessage.ht_certificate) { + if (flightType == SSLHandshake.CERTIFICATE.id) { if (needClientVerify(bufferedFragments) && - !hasCompleted(ht_certificate_verify)) { + !hasCompleted(SSLHandshake.CERTIFICATE_VERIFY.id)) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log( + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( "Not yet have the CertificateVerify message"); } @@ -1411,8 +1396,8 @@ if (!hasFinishedMessage(bufferedFragments)) { // not yet have the ChangeCipherSpec/Finished messages - if (debug != null && Debug.isOn("verbose")) { - Debug.log( + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( "Not yet have the ChangeCipherSpec and " + "Finished messages"); } @@ -1424,8 +1409,9 @@ boolean isReady = hasCompleted(bufferedFragments, handshakeFlight.minMessageSeq, handshakeFlight.maxMessageSeq); - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Is the ClientKeyExchange flight (message " + + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Is the ClientKeyExchange flight (message " + handshakeFlight.minMessageSeq + "-" + handshakeFlight.maxMessageSeq + ") completed? " + isReady); @@ -1437,8 +1423,8 @@ // // Otherwise, need to receive more handshake messages. // - if (debug != null && Debug.isOn("verbose")) { - Debug.log("Need to receive more handshake messages"); + if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("Need to receive more handshake messages"); } return false; @@ -1456,12 +1442,12 @@ boolean hasCCS = false; boolean hasFin = false; for (RecordFragment fragment : fragments) { - if (fragment.contentType == Record.ct_change_cipher_spec) { + if (fragment.contentType == ContentType.CHANGE_CIPHER_SPEC.id) { if (hasFin) { return true; } hasCCS = true; - } else if (fragment.contentType == Record.ct_handshake) { + } else if (fragment.contentType == ContentType.HANDSHAKE.id) { // Finished is the first expected message of a new epoch. if (fragment.isCiphertext) { if (hasCCS) { @@ -1484,13 +1470,13 @@ // The caller should have checked the completion of the first // present handshake message. Need not to check it again. for (RecordFragment rFrag : fragments) { - if ((rFrag.contentType != Record.ct_handshake) || + if ((rFrag.contentType != ContentType.HANDSHAKE.id) || rFrag.isCiphertext) { break; } HandshakeFragment hsFrag = (HandshakeFragment)rFrag; - if (hsFrag.handshakeType != HandshakeMessage.ht_certificate) { + if (hsFrag.handshakeType != SSLHandshake.CERTIFICATE.id) { continue; } @@ -1519,7 +1505,7 @@ // The caller should have checked the completion of the first // present handshake message. Need not to check it again. for (RecordFragment rFrag : fragments) { - if ((rFrag.contentType != Record.ct_handshake) || + if ((rFrag.contentType != ContentType.HANDSHAKE.id) || rFrag.isCiphertext) { break; } @@ -1546,32 +1532,16 @@ private void handshakeHashing( HandshakeFragment hsFrag, Plaintext plaintext) { - byte hsType = hsFrag.handshakeType; - if ((hsType == HandshakeMessage.ht_hello_request) || - (hsType == HandshakeMessage.ht_hello_verify_request)) { - + if (!handshakeHash.isHashable(hsType)) { // omitted from handshake hash computation return; } - if ((hsFrag.messageSeq == 0) && - (hsType == HandshakeMessage.ht_client_hello)) { - - // omit initial ClientHello message - // - // 4: handshake header - // 2: ClientHello.client_version - // 32: ClientHello.random - int sidLen = plaintext.fragment.get(38); - - if (sidLen == 0) { // empty session_id, initial handshake - return; - } - } - - // calculate the DTLS header - byte[] temporary = new byte[12]; // 12: handshake header size + // calculate the DTLS header and reserve the handshake message + plaintext.fragment.position(4); // ignore the TLS header + byte[] temporary = new byte[plaintext.fragment.remaining() + 12]; + // 12: handshake header size // Handshake.msg_type temporary[0] = hsFrag.handshakeType; @@ -1595,25 +1565,9 @@ temporary[10] = temporary[2]; temporary[11] = temporary[3]; - plaintext.fragment.position(4); // ignore the TLS header - if ((hsType != HandshakeMessage.ht_finished) && - (hsType != HandshakeMessage.ht_certificate_verify)) { - - if (handshakeHash == null) { - // used for cache only - handshakeHash = new HandshakeHash(false); - } - handshakeHash.update(temporary, 0, 12); - handshakeHash.update(plaintext.fragment); - } else { - // Reserve until this handshake message has been processed. - if (handshakeHash == null) { - // used for cache only - handshakeHash = new HandshakeHash(false); - } - handshakeHash.reserve(temporary, 0, 12); - handshakeHash.reserve(plaintext.fragment); - } + plaintext.fragment.get(temporary, + 12, plaintext.fragment.remaining()); + handshakeHash.receive(temporary); plaintext.fragment.position(0); // restore the position } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DTLSOutputRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,13 +28,8 @@ import java.io.*; import java.nio.*; import java.util.*; - -import javax.crypto.BadPaddingException; - import javax.net.ssl.*; - -import sun.security.util.HexDumpEncoder; -import static sun.security.ssl.Ciphertext.RecordType; +import sun.security.ssl.SSLCipher.SSLWriteCipher; /** * DTLS {@code OutputRecord} implementation for {@code SSLEngine}. @@ -47,54 +42,62 @@ int prevWriteEpoch; Authenticator prevWriteAuthenticator; - CipherBox prevWriteCipher; + SSLWriteCipher prevWriteCipher; - private LinkedList<RecordMemo> alertMemos = new LinkedList<>(); + private final LinkedList<RecordMemo> alertMemos = new LinkedList<>(); - DTLSOutputRecord() { - this.writeAuthenticator = new MAC(true); + DTLSOutputRecord(HandshakeHash handshakeHash) { + super(handshakeHash, SSLWriteCipher.nullDTlsWriteCipher()); this.writeEpoch = 0; this.prevWriteEpoch = 0; - this.prevWriteCipher = CipherBox.NULL; - this.prevWriteAuthenticator = new MAC(true); + this.prevWriteCipher = SSLWriteCipher.nullDTlsWriteCipher(); this.packetSize = DTLSRecord.maxRecordSize; - this.protocolVersion = ProtocolVersion.DEFAULT_DTLS; + this.protocolVersion = ProtocolVersion.NONE; + } + + @Override + void initHandshaker() { + // clean up + fragmenter = null; } @Override - void changeWriteCiphers(Authenticator writeAuthenticator, - CipherBox writeCipher) throws IOException { + void finishHandshake() { + // Nothing to do here currently. + } - encodeChangeCipherSpec(); + @Override + void changeWriteCiphers(SSLWriteCipher writeCipher, + boolean useChangeCipherSpec) throws IOException { + if (useChangeCipherSpec) { + encodeChangeCipherSpec(); + } prevWriteCipher.dispose(); - this.prevWriteAuthenticator = this.writeAuthenticator; this.prevWriteCipher = this.writeCipher; this.prevWriteEpoch = this.writeEpoch; - this.writeAuthenticator = writeAuthenticator; this.writeCipher = writeCipher; this.writeEpoch++; this.isFirstAppOutputRecord = true; // set the epoch number - this.writeAuthenticator.setEpochNumber(this.writeEpoch); + this.writeCipher.authenticator.setEpochNumber(this.writeEpoch); } @Override void encodeAlert(byte level, byte description) throws IOException { RecordMemo memo = new RecordMemo(); - memo.contentType = Record.ct_alert; + memo.contentType = ContentType.ALERT.id; memo.majorVersion = protocolVersion.major; memo.minorVersion = protocolVersion.minor; memo.encodeEpoch = writeEpoch; memo.encodeCipher = writeCipher; - memo.encodeAuthenticator = writeAuthenticator; memo.fragment = new byte[2]; memo.fragment[0] = level; @@ -114,7 +117,6 @@ @Override void encodeHandshake(byte[] source, int offset, int length) throws IOException { - if (firstMessage) { firstMessage = false; } @@ -127,30 +129,53 @@ } @Override - Ciphertext encode(ByteBuffer[] sources, int offset, int length, + Ciphertext encode( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { + return encode(srcs, srcsOffset, srcsLength, dsts[0]); + } + + private Ciphertext encode(ByteBuffer[] sources, int offset, int length, ByteBuffer destination) throws IOException { - if (writeAuthenticator.seqNumOverflow()) { - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", sequence number extremely close to overflow " + + if (writeCipher.authenticator.seqNumOverflow()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine( + "sequence number extremely close to overflow " + "(2^64-1 packets). Closing connection."); } throw new SSLHandshakeException("sequence number overflow"); } - // not apply to handshake message - int macLen = 0; - if (writeAuthenticator instanceof MAC) { - macLen = ((MAC)writeAuthenticator).MAClen(); + // Don't process the incoming record until all of the buffered records + // get handled. May need retransmission if no sources specified. + if (!isEmpty() || sources == null || sources.length == 0) { + Ciphertext ct = acquireCiphertext(destination); + if (ct != null) { + return ct; + } + } + + if (sources == null || sources.length == 0) { + return null; + } + + int srcsRemains = 0; + for (int i = offset; i < offset + length; i++) { + srcsRemains += sources[i].remaining(); + } + + if (srcsRemains == 0) { + return null; } + // not apply to handshake message int fragLen; if (packetSize > 0) { fragLen = Math.min(maxRecordSize, packetSize); fragLen = writeCipher.calculateFragmentSize( - fragLen, macLen, headerSize); + fragLen, headerSize); fragLen = Math.min(fragLen, Record.maxDataSize); } else { @@ -183,44 +208,38 @@ destination.limit(destination.position()); destination.position(dstContent); - if ((debug != null) && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + " " + - Record.contentName(Record.ct_application_data) + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "WRITE: " + protocolVersion + " " + + ContentType.APPLICATION_DATA.name + ", length = " + destination.remaining()); } // Encrypt the fragment and wrap up a record. - long recordSN = encrypt(writeAuthenticator, writeCipher, - Record.ct_application_data, destination, + long recordSN = encrypt(writeCipher, + ContentType.APPLICATION_DATA.id, destination, dstPos, dstLim, headerSize, - protocolVersion, true); + protocolVersion); - if ((debug != null) && Debug.isOn("packet")) { + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { ByteBuffer temporary = destination.duplicate(); temporary.limit(temporary.position()); temporary.position(dstPos); - Debug.printHex( - "[Raw write]: length = " + temporary.remaining(), - temporary); + SSLLogger.fine("Raw write", temporary); } // remain the limit unchanged destination.limit(dstLim); - return new Ciphertext(RecordType.RECORD_APPLICATION_DATA, recordSN); + return new Ciphertext(ContentType.APPLICATION_DATA.id, + SSLHandshake.NOT_APPLICABLE.id, recordSN); } - @Override - Ciphertext acquireCiphertext(ByteBuffer destination) throws IOException { + private Ciphertext acquireCiphertext( + ByteBuffer destination) throws IOException { if (alertMemos != null && !alertMemos.isEmpty()) { RecordMemo memo = alertMemos.pop(); - int macLen = 0; - if (memo.encodeAuthenticator instanceof MAC) { - macLen = ((MAC)memo.encodeAuthenticator).MAClen(); - } - int dstPos = destination.position(); int dstLim = destination.limit(); int dstContent = dstPos + headerSize + @@ -232,32 +251,32 @@ destination.limit(destination.position()); destination.position(dstContent); - if ((debug != null) && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + " " + - Record.contentName(Record.ct_alert) + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "WRITE: " + protocolVersion + " " + + ContentType.ALERT.name + ", length = " + destination.remaining()); } // Encrypt the fragment and wrap up a record. - long recordSN = encrypt(memo.encodeAuthenticator, memo.encodeCipher, - Record.ct_alert, destination, dstPos, dstLim, headerSize, + long recordSN = encrypt(memo.encodeCipher, + ContentType.ALERT.id, + destination, dstPos, dstLim, headerSize, ProtocolVersion.valueOf(memo.majorVersion, - memo.minorVersion), true); + memo.minorVersion)); - if ((debug != null) && Debug.isOn("packet")) { + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { ByteBuffer temporary = destination.duplicate(); temporary.limit(temporary.position()); temporary.position(dstPos); - Debug.printHex( - "[Raw write]: length = " + temporary.remaining(), - temporary); + SSLLogger.fine("Raw write", temporary); } // remain the limit unchanged destination.limit(dstLim); - return new Ciphertext(RecordType.RECORD_ALERT, recordSN); + return new Ciphertext(ContentType.ALERT.id, + SSLHandshake.NOT_APPLICABLE.id, recordSN); } if (fragmenter != null) { @@ -274,12 +293,6 @@ } @Override - void initHandshaker() { - // clean up - fragmenter = null; - } - - @Override void launchRetransmission() { // Note: Please don't retransmit if there are handshake messages // or alerts waiting in the queue. @@ -295,8 +308,7 @@ byte majorVersion; byte minorVersion; int encodeEpoch; - CipherBox encodeCipher; - Authenticator encodeAuthenticator; + SSLWriteCipher encodeCipher; byte[] fragment; } @@ -308,7 +320,8 @@ } private final class DTLSFragmenter { - private LinkedList<RecordMemo> handshakeMemos = new LinkedList<>(); + private final LinkedList<RecordMemo> handshakeMemos = + new LinkedList<>(); private int acquireIndex = 0; private int messageSequence = 0; private boolean flightIsReady = false; @@ -336,12 +349,11 @@ RecordMemo memo = new RecordMemo(); - memo.contentType = Record.ct_change_cipher_spec; + memo.contentType = ContentType.CHANGE_CIPHER_SPEC.id; memo.majorVersion = protocolVersion.major; memo.minorVersion = protocolVersion.minor; memo.encodeEpoch = writeEpoch; memo.encodeCipher = writeCipher; - memo.encodeAuthenticator = writeAuthenticator; memo.fragment = new byte[1]; memo.fragment[0] = 1; @@ -361,12 +373,11 @@ HandshakeMemo memo = new HandshakeMemo(); - memo.contentType = Record.ct_handshake; + memo.contentType = ContentType.HANDSHAKE.id; memo.majorVersion = protocolVersion.major; memo.minorVersion = protocolVersion.minor; memo.encodeEpoch = writeEpoch; memo.encodeCipher = writeCipher; - memo.encodeAuthenticator = writeAuthenticator; memo.handshakeType = buf[offset]; memo.messageSequence = messageSequence++; @@ -379,12 +390,12 @@ handshakeHashing(memo, memo.fragment); handshakeMemos.add(memo); - if ((memo.handshakeType == HandshakeMessage.ht_client_hello) || - (memo.handshakeType == HandshakeMessage.ht_hello_request) || + if ((memo.handshakeType == SSLHandshake.CLIENT_HELLO.id) || + (memo.handshakeType == SSLHandshake.HELLO_REQUEST.id) || (memo.handshakeType == - HandshakeMessage.ht_hello_verify_request) || - (memo.handshakeType == HandshakeMessage.ht_server_hello_done) || - (memo.handshakeType == HandshakeMessage.ht_finished)) { + SSLHandshake.HELLO_VERIFY_REQUEST.id) || + (memo.handshakeType == SSLHandshake.SERVER_HELLO_DONE.id) || + (memo.handshakeType == SSLHandshake.FINISHED.id)) { flightIsReady = true; } @@ -401,22 +412,17 @@ RecordMemo memo = handshakeMemos.get(acquireIndex); HandshakeMemo hsMemo = null; - if (memo.contentType == Record.ct_handshake) { + if (memo.contentType == ContentType.HANDSHAKE.id) { hsMemo = (HandshakeMemo)memo; } - int macLen = 0; - if (memo.encodeAuthenticator instanceof MAC) { - macLen = ((MAC)memo.encodeAuthenticator).MAClen(); - } - // ChangeCipherSpec message is pretty small. Don't worry about // the fragmentation of ChangeCipherSpec record. int fragLen; if (packetSize > 0) { fragLen = Math.min(maxRecordSize, packetSize); fragLen = memo.encodeCipher.calculateFragmentSize( - fragLen, macLen, 25); // 25: header size + fragLen, 25); // 25: header size // 13: DTLS record // 12: DTLS handshake message fragLen = Math.min(fragLen, Record.maxDataSize); @@ -459,27 +465,26 @@ dstBuf.limit(dstBuf.position()); dstBuf.position(dstContent); - if ((debug != null) && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + " " + - Record.contentName(memo.contentType) + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "WRITE: " + protocolVersion + " " + + ContentType.nameOf(memo.contentType) + ", length = " + dstBuf.remaining()); } // Encrypt the fragment and wrap up a record. - long recordSN = encrypt(memo.encodeAuthenticator, memo.encodeCipher, + long recordSN = encrypt(memo.encodeCipher, memo.contentType, dstBuf, dstPos, dstLim, headerSize, ProtocolVersion.valueOf(memo.majorVersion, - memo.minorVersion), true); + memo.minorVersion)); - if ((debug != null) && Debug.isOn("packet")) { + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { ByteBuffer temporary = dstBuf.duplicate(); temporary.limit(temporary.position()); temporary.position(dstPos); - Debug.printHex( - "[Raw write]: length = " + temporary.remaining(), - temporary); + SSLLogger.fine( + "Raw write (" + temporary.remaining() + ")", temporary); } // remain the limit unchanged @@ -492,39 +497,23 @@ acquireIndex++; } - return new Ciphertext(RecordType.valueOf( - hsMemo.contentType, hsMemo.handshakeType), recordSN); + return new Ciphertext(hsMemo.contentType, + hsMemo.handshakeType, recordSN); } else { acquireIndex++; - return new Ciphertext( - RecordType.RECORD_CHANGE_CIPHER_SPEC, recordSN); + return new Ciphertext(ContentType.CHANGE_CIPHER_SPEC.id, + SSLHandshake.NOT_APPLICABLE.id, recordSN); } } private void handshakeHashing(HandshakeMemo hsFrag, byte[] hsBody) { byte hsType = hsFrag.handshakeType; - if ((hsType == HandshakeMessage.ht_hello_request) || - (hsType == HandshakeMessage.ht_hello_verify_request)) { - + if (!handshakeHash.isHashable(hsType)) { // omitted from handshake hash computation return; } - if ((hsFrag.messageSequence == 0) && - (hsType == HandshakeMessage.ht_client_hello)) { - - // omit initial ClientHello message - // - // 2: ClientHello.client_version - // 32: ClientHello.random - int sidLen = hsBody[34]; - - if (sidLen == 0) { // empty session_id, initial handshake - return; - } - } - // calculate the DTLS header byte[] temporary = new byte[12]; // 12: handshake header size @@ -550,17 +539,8 @@ temporary[10] = temporary[2]; temporary[11] = temporary[3]; - if ((hsType != HandshakeMessage.ht_finished) && - (hsType != HandshakeMessage.ht_certificate_verify)) { - - handshakeHash.update(temporary, 0, 12); - handshakeHash.update(hsBody, 0, hsBody.length); - } else { - // Reserve until this handshake message has been processed. - handshakeHash.reserve(temporary, 0, 12); - handshakeHash.reserve(hsBody, 0, hsBody.length); - } - + handshakeHash.deliver(temporary, 0, 12); + handshakeHash.deliver(hsBody, 0, hsBody.length); } boolean isEmpty() { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DTLSRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DTLSRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/DTLSRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/DTLSRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,30 +61,6 @@ + maxMacSize; // MAC or AEAD tag /* - * For CBC protection in SSL3/TLS1, we break some plaintext into two - * packets. Max application data size for the second packet. - */ - static final int maxDataSizeMinusOneByteRecord = - maxDataSize // max data size - - ( // max one byte record size - headerPlusMaxIVSize // header + iv - + 1 // one byte data - + maxPadding // padding - + maxMacSize // MAC - ); - - /* - * Maximum record size for alert and change cipher spec records. - * They only contain 2 and 1 bytes of data, respectively. - * Allocate a smaller array. - */ - static final int maxAlertRecordSize = - headerPlusMaxIVSize // header + iv - + 2 // alert - + maxPadding // padding - + maxMacSize; // MAC - - /* * Minimum record size of Certificate handshake message. * Client sends a certificate message containing no certificates if no * suitable certificate is available. That is, the certificate_list diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECDHClientKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,60 +26,515 @@ package sun.security.ssl; import java.io.IOException; -import java.io.PrintStream; - +import java.nio.ByteBuffer; +import java.security.AlgorithmConstraints; +import java.security.CryptoPrimitive; +import java.security.GeneralSecurityException; +import java.security.KeyFactory; +import java.security.PrivateKey; import java.security.PublicKey; +import java.security.interfaces.ECPrivateKey; import java.security.interfaces.ECPublicKey; -import java.security.spec.*; +import java.security.spec.ECParameterSpec; +import java.security.spec.ECPoint; +import java.security.spec.ECPublicKeySpec; +import java.text.MessageFormat; +import java.util.EnumSet; +import java.util.Locale; +import javax.crypto.SecretKey; +import javax.net.ssl.SSLHandshakeException; +import sun.security.ssl.ECDHKeyExchange.ECDHECredentials; +import sun.security.ssl.ECDHKeyExchange.ECDHEPossession; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.X509Authentication.X509Credentials; +import sun.security.ssl.X509Authentication.X509Possession; +import sun.security.util.HexDumpEncoder; /** - * ClientKeyExchange message for all ECDH based key exchange methods. It - * contains the client's ephemeral public value. - * - * @since 1.6 - * @author Andreas Sterbenz + * Pack of the "ClientKeyExchange" handshake message. */ -final class ECDHClientKeyExchange extends HandshakeMessage { +final class ECDHClientKeyExchange { + static final SSLConsumer ecdhHandshakeConsumer = + new ECDHClientKeyExchangeConsumer(); + static final HandshakeProducer ecdhHandshakeProducer = + new ECDHClientKeyExchangeProducer(); + + static final SSLConsumer ecdheHandshakeConsumer = + new ECDHEClientKeyExchangeConsumer(); + static final HandshakeProducer ecdheHandshakeProducer = + new ECDHEClientKeyExchangeProducer(); + + /** + * The ECDH/ECDHE ClientKeyExchange handshake message. + */ + private static final + class ECDHClientKeyExchangeMessage extends HandshakeMessage { + private final byte[] encodedPoint; + + ECDHClientKeyExchangeMessage(HandshakeContext handshakeContext, + ECPublicKey publicKey) { + super(handshakeContext); + + ECPoint point = publicKey.getW(); + ECParameterSpec params = publicKey.getParams(); + encodedPoint = JsseJce.encodePoint(point, params.getCurve()); + } - @Override - int messageType() { - return ht_client_key_exchange; - } + ECDHClientKeyExchangeMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + if (m.remaining() != 0) { // explicit PublicValueEncoding + this.encodedPoint = Record.getBytes8(m); + } else { + this.encodedPoint = new byte[0]; + } + } - private byte[] encodedPoint; + // Check constraints of the specified EC public key. + static void checkConstraints(AlgorithmConstraints constraints, + ECPublicKey publicKey, + byte[] encodedPoint) throws SSLHandshakeException { + + try { + ECParameterSpec params = publicKey.getParams(); + ECPoint point = + JsseJce.decodePoint(encodedPoint, params.getCurve()); + ECPublicKeySpec spec = new ECPublicKeySpec(point, params); + + KeyFactory kf = JsseJce.getKeyFactory("EC"); + ECPublicKey peerPublicKey = + (ECPublicKey)kf.generatePublic(spec); + + // check constraints of ECPublicKey + if (!constraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + peerPublicKey)) { + throw new SSLHandshakeException( + "ECPublicKey does not comply to algorithm constraints"); + } + } catch (GeneralSecurityException | java.io.IOException e) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate ECPublicKey").initCause(e); + } + } - byte[] getEncodedPoint() { - return encodedPoint; - } + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CLIENT_KEY_EXCHANGE; + } + + @Override + public int messageLength() { + if (encodedPoint == null || encodedPoint.length == 0) { + return 0; + } else { + return 1 + encodedPoint.length; + } + } - // Called by the client with its ephemeral public key. - ECDHClientKeyExchange(PublicKey publicKey) { - ECPublicKey ecKey = (ECPublicKey)publicKey; - ECPoint point = ecKey.getW(); - ECParameterSpec params = ecKey.getParams(); - encodedPoint = JsseJce.encodePoint(point, params.getCurve()); + @Override + public void send(HandshakeOutStream hos) throws IOException { + if (encodedPoint != null && encodedPoint.length != 0) { + hos.putBytes8(encodedPoint); + } + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"ECDH ClientKeyExchange\": '{'\n" + + " \"ecdh public\": '{'\n" + + "{0}\n" + + " '}',\n" + + "'}'", + Locale.ENGLISH); + if (encodedPoint == null || encodedPoint.length == 0) { + Object[] messageFields = { + " <implicit>" + }; + return messageFormat.format(messageFields); + } else { + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent( + hexEncoder.encodeBuffer(encodedPoint), " "), + }; + return messageFormat.format(messageFields); + } + } } - ECDHClientKeyExchange(HandshakeInStream input) throws IOException { - encodedPoint = input.getBytes8(); + /** + * The ECDH "ClientKeyExchange" handshake message producer. + */ + private static final + class ECDHClientKeyExchangeProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private ECDHClientKeyExchangeProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + X509Credentials x509Credentials = null; + for (SSLCredentials credential : chc.handshakeCredentials) { + if (credential instanceof X509Credentials) { + x509Credentials = (X509Credentials)credential; + break; + } + } + + if (x509Credentials == null) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "No server certificate for ECDH client key exchange"); + } + + PublicKey publicKey = x509Credentials.popPublicKey; + if (!publicKey.getAlgorithm().equals("EC")) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Not EC server certificate for ECDH client key exchange"); + } + + ECParameterSpec params = ((ECPublicKey)publicKey).getParams(); + NamedGroup namedGroup = NamedGroup.valueOf(params); + if (namedGroup == null) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unsupported EC server cert for ECDH client key exchange"); + } + + ECDHEPossession ecdhePossession = new ECDHEPossession( + namedGroup, chc.sslContext.getSecureRandom()); + chc.handshakePossessions.add(ecdhePossession); + ECDHClientKeyExchangeMessage cke = + new ECDHClientKeyExchangeMessage( + chc, ecdhePossession.publicKey); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced ECDH ClientKeyExchange handshake message", cke); + } + + // Output the handshake message. + cke.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // update the states + SSLKeyExchange ke = SSLKeyExchange.valueOf( + chc.negotiatedCipherSuite.keyExchange, + chc.negotiatedProtocol); + if (ke == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key exchange type"); + } else { + SSLKeyDerivation masterKD = ke.createKeyDerivation(chc); + SecretKey masterSecret = + masterKD.deriveKey("MasterSecret", null); + chc.handshakeSession.setMasterSecret(masterSecret); + + SSLTrafficKeyDerivation kd = + SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol); + if (kd == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + chc.negotiatedProtocol); + } else { + chc.handshakeKeyDerivation = + kd.createKeyDerivation(chc, masterSecret); + } + } + + // The handshake message has been delivered. + return null; + } } - @Override - int messageLength() { - return encodedPoint.length + 1; + /** + * The ECDH "ClientKeyExchange" handshake message consumer. + */ + private static final + class ECDHClientKeyExchangeConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private ECDHClientKeyExchangeConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + X509Possession x509Possession = null; + for (SSLPossession possession : shc.handshakePossessions) { + if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + break; + } + } + + if (x509Possession == null) { + // unlikely, have been checked during cipher suite negotiation. + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "No expected EC server cert for ECDH client key exchange"); + return; // make the compiler happy + } + + PrivateKey privateKey = x509Possession.popPrivateKey; + if (!privateKey.getAlgorithm().equals("EC")) { + // unlikely, have been checked during cipher suite negotiation. + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Not EC server cert for ECDH client key exchange"); + } + + ECParameterSpec params = ((ECPrivateKey)privateKey).getParams(); + NamedGroup namedGroup = NamedGroup.valueOf(params); + if (namedGroup == null) { + // unlikely, have been checked during cipher suite negotiation. + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unsupported EC server cert for ECDH client key exchange"); + } + + SSLKeyExchange ke = SSLKeyExchange.valueOf( + shc.negotiatedCipherSuite.keyExchange, + shc.negotiatedProtocol); + if (ke == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key exchange type"); + return; // make the compiler happy + } + + // parse the handshake message + ECDHClientKeyExchangeMessage cke = + new ECDHClientKeyExchangeMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming ECDH ClientKeyExchange handshake message", cke); + } + + // create the credentials + try { + ECPoint point = + JsseJce.decodePoint(cke.encodedPoint, params.getCurve()); + ECPublicKeySpec spec = new ECPublicKeySpec(point, params); + + KeyFactory kf = JsseJce.getKeyFactory("EC"); + ECPublicKey peerPublicKey = + (ECPublicKey)kf.generatePublic(spec); + + // check constraints of peer ECPublicKey + if (!shc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + peerPublicKey)) { + throw new SSLHandshakeException( + "ECPublicKey does not comply to algorithm constraints"); + } + + shc.handshakeCredentials.add(new ECDHECredentials( + peerPublicKey, namedGroup)); + } catch (GeneralSecurityException | java.io.IOException e) { + throw (SSLHandshakeException)(new SSLHandshakeException( + "Could not generate ECPublicKey").initCause(e)); + } + + // update the states + SSLKeyDerivation masterKD = ke.createKeyDerivation(shc); + SecretKey masterSecret = + masterKD.deriveKey("MasterSecret", null); + shc.handshakeSession.setMasterSecret(masterSecret); + + SSLTrafficKeyDerivation kd = + SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol); + if (kd == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + shc.negotiatedProtocol); + } else { + shc.handshakeKeyDerivation = + kd.createKeyDerivation(shc, masterSecret); + } + } } - @Override - void send(HandshakeOutStream s) throws IOException { - s.putBytes8(encodedPoint); + /** + * The ECDHE "ClientKeyExchange" handshake message producer. + */ + private static final + class ECDHEClientKeyExchangeProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private ECDHEClientKeyExchangeProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + ECDHECredentials ecdheCredentials = null; + for (SSLCredentials cd : chc.handshakeCredentials) { + if (cd instanceof ECDHECredentials) { + ecdheCredentials = (ECDHECredentials)cd; + break; + } + } + + if (ecdheCredentials == null) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "No ECDHE credentials negotiated for client key exchange"); + } + + ECDHEPossession ecdhePossession = new ECDHEPossession( + ecdheCredentials, chc.sslContext.getSecureRandom()); + chc.handshakePossessions.add(ecdhePossession); + ECDHClientKeyExchangeMessage cke = + new ECDHClientKeyExchangeMessage( + chc, ecdhePossession.publicKey); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced ECDHE ClientKeyExchange handshake message", cke); + } + + // Output the handshake message. + cke.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // update the states + SSLKeyExchange ke = SSLKeyExchange.valueOf( + chc.negotiatedCipherSuite.keyExchange, + chc.negotiatedProtocol); + if (ke == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key exchange type"); + } else { + SSLKeyDerivation masterKD = ke.createKeyDerivation(chc); + SecretKey masterSecret = + masterKD.deriveKey("MasterSecret", null); + chc.handshakeSession.setMasterSecret(masterSecret); + + SSLTrafficKeyDerivation kd = + SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol); + if (kd == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + chc.negotiatedProtocol); + } else { + chc.handshakeKeyDerivation = + kd.createKeyDerivation(chc, masterSecret); + } + } + + // The handshake message has been delivered. + return null; + } } - @Override - void print(PrintStream s) throws IOException { - s.println("*** ECDHClientKeyExchange"); + /** + * The ECDHE "ClientKeyExchange" handshake message consumer. + */ + private static final + class ECDHEClientKeyExchangeConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private ECDHEClientKeyExchangeConsumer() { + // blank + } - if (debug != null && Debug.isOn("verbose")) { - Debug.println(s, "ECDH Public value", encodedPoint); + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + ECDHEPossession ecdhePossession = null; + for (SSLPossession possession : shc.handshakePossessions) { + if (possession instanceof ECDHEPossession) { + ecdhePossession = (ECDHEPossession)possession; + break; + } + } + if (ecdhePossession == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "No expected ECDHE possessions for client key exchange"); + return; // make the compiler happy + } + + ECParameterSpec params = ecdhePossession.publicKey.getParams(); + NamedGroup namedGroup = NamedGroup.valueOf(params); + if (namedGroup == null) { + // unlikely, have been checked during cipher suite negotiation. + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unsupported EC server cert for ECDHE client key exchange"); + } + + SSLKeyExchange ke = SSLKeyExchange.valueOf( + shc.negotiatedCipherSuite.keyExchange, + shc.negotiatedProtocol); + if (ke == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key exchange type"); + return; // make the compiler happy + } + + // parse the handshake message + ECDHClientKeyExchangeMessage cke = + new ECDHClientKeyExchangeMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming ECDHE ClientKeyExchange handshake message", cke); + } + + // create the credentials + try { + ECPoint point = + JsseJce.decodePoint(cke.encodedPoint, params.getCurve()); + ECPublicKeySpec spec = new ECPublicKeySpec(point, params); + + KeyFactory kf = JsseJce.getKeyFactory("EC"); + ECPublicKey peerPublicKey = + (ECPublicKey)kf.generatePublic(spec); + + // check constraints of peer ECPublicKey + if (!shc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + peerPublicKey)) { + throw new SSLHandshakeException( + "ECPublicKey does not comply to algorithm constraints"); + } + + shc.handshakeCredentials.add(new ECDHECredentials( + peerPublicKey, namedGroup)); + } catch (GeneralSecurityException | java.io.IOException e) { + throw (SSLHandshakeException)(new SSLHandshakeException( + "Could not generate ECPublicKey").initCause(e)); + } + + // update the states + SSLKeyDerivation masterKD = ke.createKeyDerivation(shc); + SecretKey masterSecret = + masterKD.deriveKey("MasterSecret", null); + shc.handshakeSession.setMasterSecret(masterSecret); + + SSLTrafficKeyDerivation kd = + SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol); + if (kd == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + shc.negotiatedProtocol); + } else { + shc.handshakeKeyDerivation = + kd.createKeyDerivation(shc, masterSecret); + } } } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECDHCrypt.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECDHCrypt.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECDHCrypt.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECDHCrypt.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,153 +0,0 @@ -/* - * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.security.*; -import java.security.interfaces.ECPublicKey; -import java.security.spec.*; - -import java.util.EnumSet; -import javax.crypto.SecretKey; -import javax.crypto.KeyAgreement; -import javax.net.ssl.SSLHandshakeException; - -/** - * Helper class for the ECDH key exchange. It generates the appropriate - * ephemeral keys as necessary and performs the actual shared secret derivation. - * - * @since 1.6 - * @author Andreas Sterbenz - */ -final class ECDHCrypt { - - // our private key - private PrivateKey privateKey; - - // our public key - private ECPublicKey publicKey; - - // Called by ServerHandshaker for static ECDH - ECDHCrypt(PrivateKey privateKey, PublicKey publicKey) { - this.privateKey = privateKey; - this.publicKey = (ECPublicKey)publicKey; - } - - // Called by ServerHandshaker for ephemeral ECDH - ECDHCrypt(NamedGroup namedGroup, SecureRandom random) { - try { - KeyPairGenerator kpg = JsseJce.getKeyPairGenerator("EC"); - ECGenParameterSpec params = - SupportedGroupsExtension.getECGenParamSpec(namedGroup); - kpg.initialize(params, random); - KeyPair kp = kpg.generateKeyPair(); - privateKey = kp.getPrivate(); - publicKey = (ECPublicKey)kp.getPublic(); - } catch (GeneralSecurityException e) { - throw new RuntimeException("Could not generate ECDH keypair", e); - } - } - - // Called by ClientHandshaker with params it received from the server - ECDHCrypt(ECParameterSpec params, SecureRandom random) { - try { - KeyPairGenerator kpg = JsseJce.getKeyPairGenerator("EC"); - kpg.initialize(params, random); - KeyPair kp = kpg.generateKeyPair(); - privateKey = kp.getPrivate(); - publicKey = (ECPublicKey)kp.getPublic(); - } catch (GeneralSecurityException e) { - throw new RuntimeException("Could not generate ECDH keypair", e); - } - } - - /** - * Gets the public key of this end of the key exchange. - */ - PublicKey getPublicKey() { - return publicKey; - } - - // called by ClientHandshaker with either the server's static or - // ephemeral public key - SecretKey getAgreedSecret( - PublicKey peerPublicKey) throws SSLHandshakeException { - - try { - KeyAgreement ka = JsseJce.getKeyAgreement("ECDH"); - ka.init(privateKey); - ka.doPhase(peerPublicKey, true); - return ka.generateSecret("TlsPremasterSecret"); - } catch (GeneralSecurityException e) { - throw (SSLHandshakeException) new SSLHandshakeException( - "Could not generate secret").initCause(e); - } - } - - // called by ServerHandshaker - SecretKey getAgreedSecret( - byte[] encodedPoint) throws SSLHandshakeException { - - try { - ECParameterSpec params = publicKey.getParams(); - ECPoint point = - JsseJce.decodePoint(encodedPoint, params.getCurve()); - KeyFactory kf = JsseJce.getKeyFactory("EC"); - ECPublicKeySpec spec = new ECPublicKeySpec(point, params); - PublicKey peerPublicKey = kf.generatePublic(spec); - return getAgreedSecret(peerPublicKey); - } catch (GeneralSecurityException | java.io.IOException e) { - throw (SSLHandshakeException) new SSLHandshakeException( - "Could not generate secret").initCause(e); - } - } - - // Check constraints of the specified EC public key. - void checkConstraints(AlgorithmConstraints constraints, - byte[] encodedPoint) throws SSLHandshakeException { - - try { - - ECParameterSpec params = publicKey.getParams(); - ECPoint point = - JsseJce.decodePoint(encodedPoint, params.getCurve()); - ECPublicKeySpec spec = new ECPublicKeySpec(point, params); - - KeyFactory kf = JsseJce.getKeyFactory("EC"); - ECPublicKey publicKey = (ECPublicKey)kf.generatePublic(spec); - - // check constraints of ECPublicKey - if (!constraints.permits( - EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), publicKey)) { - throw new SSLHandshakeException( - "ECPublicKey does not comply to algorithm constraints"); - } - } catch (GeneralSecurityException | java.io.IOException e) { - throw (SSLHandshakeException) new SSLHandshakeException( - "Could not generate ECPublicKey").initCause(e); - } - } - -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECDHKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECDHKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECDHKeyExchange.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECDHKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,485 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.security.AlgorithmConstraints; +import java.security.CryptoPrimitive; +import java.security.GeneralSecurityException; +import java.security.KeyFactory; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.interfaces.ECPrivateKey; +import java.security.interfaces.ECPublicKey; +import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.ECGenParameterSpec; +import java.security.spec.ECParameterSpec; +import java.security.spec.ECPoint; +import java.security.spec.ECPublicKeySpec; +import java.util.EnumSet; +import javax.crypto.KeyAgreement; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.SSLHandshakeException; +import sun.security.ssl.CipherSuite.HashAlg; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.SupportedGroupsExtension.NamedGroupType; +import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; +import sun.security.ssl.X509Authentication.X509Credentials; +import sun.security.ssl.X509Authentication.X509Possession; +import sun.security.util.ECUtil; + +final class ECDHKeyExchange { + static final SSLPossessionGenerator poGenerator = + new ECDHEPossessionGenerator(); + static final SSLKeyAgreementGenerator ecdheKAGenerator = + new ECDHEKAGenerator(); + static final SSLKeyAgreementGenerator ecdhKAGenerator = + new ECDHKAGenerator(); + + static final class ECDHECredentials implements SSLCredentials { + final ECPublicKey popPublicKey; + final NamedGroup namedGroup; + + ECDHECredentials(ECPublicKey popPublicKey, NamedGroup namedGroup) { + this.popPublicKey = popPublicKey; + this.namedGroup = namedGroup; + } + + static ECDHECredentials valueOf(NamedGroup namedGroup, + byte[] encodedPoint) throws IOException, GeneralSecurityException { + + if (namedGroup.type != NamedGroupType.NAMED_GROUP_ECDHE) { + throw new RuntimeException( + "Credentials decoding: Not ECDHE named group"); + } + + if (encodedPoint == null || encodedPoint.length == 0) { + return null; + } + + ECParameterSpec parameters = + JsseJce.getECParameterSpec(namedGroup.oid); + if (parameters == null) { + return null; + } + + ECPoint point = JsseJce.decodePoint( + encodedPoint, parameters.getCurve()); + KeyFactory factory = JsseJce.getKeyFactory("EC"); + ECPublicKey publicKey = (ECPublicKey)factory.generatePublic( + new ECPublicKeySpec(point, parameters)); + return new ECDHECredentials(publicKey, namedGroup); + } + } + + static final class ECDHEPossession implements SSLPossession { + final PrivateKey privateKey; + final ECPublicKey publicKey; + final NamedGroup namedGroup; + + ECDHEPossession(NamedGroup namedGroup, SecureRandom random) { + try { + KeyPairGenerator kpg = JsseJce.getKeyPairGenerator("EC"); + ECGenParameterSpec params = + (ECGenParameterSpec)namedGroup.getParameterSpec(); + kpg.initialize(params, random); + KeyPair kp = kpg.generateKeyPair(); + privateKey = kp.getPrivate(); + publicKey = (ECPublicKey)kp.getPublic(); + } catch (GeneralSecurityException e) { + throw new RuntimeException( + "Could not generate ECDH keypair", e); + } + + this.namedGroup = namedGroup; + } + + ECDHEPossession(ECDHECredentials credentials, SecureRandom random) { + ECParameterSpec params = credentials.popPublicKey.getParams(); + try { + KeyPairGenerator kpg = JsseJce.getKeyPairGenerator("EC"); + kpg.initialize(params, random); + KeyPair kp = kpg.generateKeyPair(); + privateKey = kp.getPrivate(); + publicKey = (ECPublicKey)kp.getPublic(); + } catch (GeneralSecurityException e) { + throw new RuntimeException( + "Could not generate ECDH keypair", e); + } + + this.namedGroup = credentials.namedGroup; + } + + @Override + public byte[] encode() { + return ECUtil.encodePoint( + publicKey.getW(), publicKey.getParams().getCurve()); + } + + // called by ClientHandshaker with either the server's static or + // ephemeral public key + SecretKey getAgreedSecret( + PublicKey peerPublicKey) throws SSLHandshakeException { + + try { + KeyAgreement ka = JsseJce.getKeyAgreement("ECDH"); + ka.init(privateKey); + ka.doPhase(peerPublicKey, true); + return ka.generateSecret("TlsPremasterSecret"); + } catch (GeneralSecurityException e) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(e); + } + } + + // called by ServerHandshaker + SecretKey getAgreedSecret( + byte[] encodedPoint) throws SSLHandshakeException { + try { + ECParameterSpec params = publicKey.getParams(); + ECPoint point = + JsseJce.decodePoint(encodedPoint, params.getCurve()); + KeyFactory kf = JsseJce.getKeyFactory("EC"); + ECPublicKeySpec spec = new ECPublicKeySpec(point, params); + PublicKey peerPublicKey = kf.generatePublic(spec); + return getAgreedSecret(peerPublicKey); + } catch (GeneralSecurityException | java.io.IOException e) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(e); + } + } + + // Check constraints of the specified EC public key. + void checkConstraints(AlgorithmConstraints constraints, + byte[] encodedPoint) throws SSLHandshakeException { + try { + + ECParameterSpec params = publicKey.getParams(); + ECPoint point = + JsseJce.decodePoint(encodedPoint, params.getCurve()); + ECPublicKeySpec spec = new ECPublicKeySpec(point, params); + + KeyFactory kf = JsseJce.getKeyFactory("EC"); + ECPublicKey pubKey = (ECPublicKey)kf.generatePublic(spec); + + // check constraints of ECPublicKey + if (!constraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), pubKey)) { + throw new SSLHandshakeException( + "ECPublicKey does not comply to algorithm constraints"); + } + } catch (GeneralSecurityException | java.io.IOException e) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate ECPublicKey").initCause(e); + } + } + } + + private static final + class ECDHEPossessionGenerator implements SSLPossessionGenerator { + // Prevent instantiation of this class. + private ECDHEPossessionGenerator() { + // blank + } + + @Override + public SSLPossession createPossession(HandshakeContext context) { + NamedGroup preferableNamedGroup = null; + if ((context.clientRequestedNamedGroups != null) && + (!context.clientRequestedNamedGroups.isEmpty())) { + preferableNamedGroup = SupportedGroups.getPreferredGroup( + context.negotiatedProtocol, + context.algorithmConstraints, + NamedGroupType.NAMED_GROUP_ECDHE, + context.clientRequestedNamedGroups); + } else { + preferableNamedGroup = SupportedGroups.getPreferredGroup( + context.negotiatedProtocol, + context.algorithmConstraints, + NamedGroupType.NAMED_GROUP_ECDHE); + } + + if (preferableNamedGroup != null) { + return new ECDHEPossession(preferableNamedGroup, + context.sslContext.getSecureRandom()); + } + + // no match found, cannot use this cipher suite. + // + return null; + } + } + + private static final + class ECDHKAGenerator implements SSLKeyAgreementGenerator { + // Prevent instantiation of this class. + private ECDHKAGenerator() { + // blank + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext context) throws IOException { + if (context instanceof ServerHandshakeContext) { + return createServerKeyDerivation( + (ServerHandshakeContext)context); + } else { + return createClientKeyDerivation( + (ClientHandshakeContext)context); + } + } + + private SSLKeyDerivation createServerKeyDerivation( + ServerHandshakeContext shc) throws IOException { + X509Possession x509Possession = null; + ECDHECredentials ecdheCredentials = null; + for (SSLPossession poss : shc.handshakePossessions) { + if (!(poss instanceof X509Possession)) { + continue; + } + + PrivateKey privateKey = ((X509Possession)poss).popPrivateKey; + if (!privateKey.getAlgorithm().equals("EC")) { + continue; + } + + ECParameterSpec params = ((ECPrivateKey)privateKey).getParams(); + NamedGroup ng = NamedGroup.valueOf(params); + if (ng == null) { + // unlikely, have been checked during cipher suite negotiation. + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unsupported EC server cert for ECDH key exchange"); + } + + for (SSLCredentials cred : shc.handshakeCredentials) { + if (!(cred instanceof ECDHECredentials)) { + continue; + } + if (ng.equals(((ECDHECredentials)cred).namedGroup)) { + ecdheCredentials = (ECDHECredentials)cred; + break; + } + } + + if (ecdheCredentials != null) { + x509Possession = (X509Possession)poss; + break; + } + } + + if (x509Possession == null || ecdheCredentials == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No sufficient ECDHE key agreement parameters negotiated"); + } + + return new ECDHEKAKeyDerivation(shc, + x509Possession.popPrivateKey, ecdheCredentials.popPublicKey); + } + + private SSLKeyDerivation createClientKeyDerivation( + ClientHandshakeContext chc) throws IOException { + ECDHEPossession ecdhePossession = null; + X509Credentials x509Credentials = null; + for (SSLPossession poss : chc.handshakePossessions) { + if (!(poss instanceof ECDHEPossession)) { + continue; + } + + NamedGroup ng = ((ECDHEPossession)poss).namedGroup; + for (SSLCredentials cred : chc.handshakeCredentials) { + if (!(cred instanceof X509Credentials)) { + continue; + } + + PublicKey publicKey = ((X509Credentials)cred).popPublicKey; + if (!publicKey.getAlgorithm().equals("EC")) { + continue; + } + ECParameterSpec params = + ((ECPublicKey)publicKey).getParams(); + NamedGroup namedGroup = NamedGroup.valueOf(params); + if (namedGroup == null) { + // unlikely, should have been checked previously + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unsupported EC server cert for ECDH key exchange"); + } + + if (ng.equals(namedGroup)) { + x509Credentials = (X509Credentials)cred; + break; + } + } + + if (x509Credentials != null) { + ecdhePossession = (ECDHEPossession)poss; + break; + } + } + + if (ecdhePossession == null || x509Credentials == null) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No sufficient ECDH key agreement parameters negotiated"); + } + + return new ECDHEKAKeyDerivation(chc, + ecdhePossession.privateKey, x509Credentials.popPublicKey); + } + } + + private static final + class ECDHEKAGenerator implements SSLKeyAgreementGenerator { + // Prevent instantiation of this class. + private ECDHEKAGenerator() { + // blank + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext context) throws IOException { + ECDHEPossession ecdhePossession = null; + ECDHECredentials ecdheCredentials = null; + for (SSLPossession poss : context.handshakePossessions) { + if (!(poss instanceof ECDHEPossession)) { + continue; + } + + NamedGroup ng = ((ECDHEPossession)poss).namedGroup; + for (SSLCredentials cred : context.handshakeCredentials) { + if (!(cred instanceof ECDHECredentials)) { + continue; + } + if (ng.equals(((ECDHECredentials)cred).namedGroup)) { + ecdheCredentials = (ECDHECredentials)cred; + break; + } + } + + if (ecdheCredentials != null) { + ecdhePossession = (ECDHEPossession)poss; + break; + } + } + + if (ecdhePossession == null || ecdheCredentials == null) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No sufficient ECDHE key agreement parameters negotiated"); + } + + return new ECDHEKAKeyDerivation(context, + ecdhePossession.privateKey, ecdheCredentials.popPublicKey); + } + } + + private static final + class ECDHEKAKeyDerivation implements SSLKeyDerivation { + private final HandshakeContext context; + private final PrivateKey localPrivateKey; + private final PublicKey peerPublicKey; + + ECDHEKAKeyDerivation(HandshakeContext context, + PrivateKey localPrivateKey, + PublicKey peerPublicKey) { + this.context = context; + this.localPrivateKey = localPrivateKey; + this.peerPublicKey = peerPublicKey; + } + + @Override + public SecretKey deriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + if (!context.negotiatedProtocol.useTLS13PlusSpec()) { + return t12DeriveKey(algorithm, params); + } else { + return t13DeriveKey(algorithm, params); + } + } + + private SecretKey t12DeriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + try { + KeyAgreement ka = JsseJce.getKeyAgreement("ECDH"); + ka.init(localPrivateKey); + ka.doPhase(peerPublicKey, true); + SecretKey preMasterSecret = + ka.generateSecret("TlsPremasterSecret"); + + SSLMasterKeyDerivation mskd = + SSLMasterKeyDerivation.valueOf( + context.negotiatedProtocol); + if (mskd == null) { + // unlikely + throw new SSLHandshakeException( + "No expected master key derivation for protocol: " + + context.negotiatedProtocol.name); + } + SSLKeyDerivation kd = mskd.createKeyDerivation( + context, preMasterSecret); + return kd.deriveKey("MasterSecret", params); + } catch (GeneralSecurityException gse) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(gse); + } + } + + private SecretKey t13DeriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + try { + KeyAgreement ka = JsseJce.getKeyAgreement("ECDH"); + ka.init(localPrivateKey); + ka.doPhase(peerPublicKey, true); + SecretKey sharedSecret = + ka.generateSecret("TlsPremasterSecret"); + + HashAlg hashAlg = context.negotiatedCipherSuite.hashAlg; + SSLKeyDerivation kd = context.handshakeKeyDerivation; + HKDF hkdf = new HKDF(hashAlg.name); + if (kd == null) { // No PSK is in use. + // If PSK is not in use Early Secret will still be + // HKDF-Extract(0, 0). + byte[] zeros = new byte[hashAlg.hashLength]; + SecretKeySpec ikm = + new SecretKeySpec(zeros, "TlsPreSharedSecret"); + SecretKey earlySecret = + hkdf.extract(zeros, ikm, "TlsEarlySecret"); + kd = new SSLSecretDerivation(context, earlySecret); + } + + // derive salt secret + SecretKey saltSecret = kd.deriveKey("TlsSaltSecret", null); + + // derive handshake secret + return hkdf.extract(saltSecret, sharedSecret, algorithm); + } catch (GeneralSecurityException gse) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(gse); + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECDHServerKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,567 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.CryptoPrimitive; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.Signature; +import java.security.SignatureException; +import java.security.interfaces.ECPublicKey; +import java.security.spec.ECParameterSpec; +import java.security.spec.ECPoint; +import java.security.spec.ECPublicKeySpec; +import java.security.spec.InvalidKeySpecException; +import java.text.MessageFormat; +import java.util.EnumSet; +import java.util.Locale; +import sun.security.ssl.ECDHKeyExchange.ECDHECredentials; +import sun.security.ssl.ECDHKeyExchange.ECDHEPossession; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; +import sun.security.ssl.X509Authentication.X509Credentials; +import sun.security.ssl.X509Authentication.X509Possession; +import sun.security.util.HexDumpEncoder; + +/** + * Pack of the ServerKeyExchange handshake message. + */ +final class ECDHServerKeyExchange { + static final SSLConsumer ecdheHandshakeConsumer = + new ECDHServerKeyExchangeConsumer(); + static final HandshakeProducer ecdheHandshakeProducer = + new ECDHServerKeyExchangeProducer(); + + /** + * The ECDH ServerKeyExchange handshake message. + */ + private static final + class ECDHServerKeyExchangeMessage extends HandshakeMessage { + private static final byte CURVE_NAMED_CURVE = (byte)0x03; + + // id of the named curve + private final NamedGroup namedGroup; + + // encoded public point + private final byte[] publicPoint; + + // signature bytes, or null if anonymous + private final byte[] paramsSignature; + + // public key object encapsulated in this message + private final ECPublicKey publicKey; + + private final boolean useExplicitSigAlgorithm; + + // the signature algorithm used by this ServerKeyExchange message + private final SignatureScheme signatureScheme; + + ECDHServerKeyExchangeMessage( + HandshakeContext handshakeContext) throws IOException { + super(handshakeContext); + + // This happens in server side only. + ServerHandshakeContext shc = + (ServerHandshakeContext)handshakeContext; + + ECDHEPossession ecdhePossession = null; + X509Possession x509Possession = null; + for (SSLPossession possession : shc.handshakePossessions) { + if (possession instanceof ECDHEPossession) { + ecdhePossession = (ECDHEPossession)possession; + if (x509Possession != null) { + break; + } + } else if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + if (ecdhePossession != null) { + break; + } + } + } + + if (ecdhePossession == null) { + // unlikely + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No ECDHE credentials negotiated for server key exchange"); + } + + publicKey = ecdhePossession.publicKey; + ECParameterSpec params = publicKey.getParams(); + ECPoint point = publicKey.getW(); + publicPoint = JsseJce.encodePoint(point, params.getCurve()); + + this.namedGroup = NamedGroup.valueOf(params); + if ((namedGroup == null) || (namedGroup.oid == null) ) { + // unlikely + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unnamed EC parameter spec: " + params); + } + + if (x509Possession == null) { + // anonymous, no authentication, no signature + paramsSignature = null; + signatureScheme = null; + useExplicitSigAlgorithm = false; + } else { + useExplicitSigAlgorithm = + shc.negotiatedProtocol.useTLS12PlusSpec(); + Signature signer = null; + if (useExplicitSigAlgorithm) { + signatureScheme = SignatureScheme.getPreferableAlgorithm( + shc.peerRequestedSignatureSchemes, + x509Possession.popPrivateKey, + shc.negotiatedProtocol); + if (signatureScheme == null) { + // Unlikely, the credentials generator should have + // selected the preferable signature algorithm properly. + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "No preferred signature algorithm for " + + x509Possession.popPrivateKey.getAlgorithm() + + " key"); + } + try { + signer = signatureScheme.getSignature( + x509Possession.popPrivateKey); + } catch (NoSuchAlgorithmException | InvalidKeyException | + InvalidAlgorithmParameterException nsae) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm: " + + signatureScheme.name, nsae); + } + } else { + signatureScheme = null; + try { + signer = getSignature( + x509Possession.popPrivateKey.getAlgorithm(), + x509Possession.popPrivateKey); + } catch (NoSuchAlgorithmException | InvalidKeyException e) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm: " + + x509Possession.popPrivateKey.getAlgorithm(), e); + } + } + + byte[] signature = null; + try { + updateSignature(signer, shc.clientHelloRandom.randomBytes, + shc.serverHelloRandom.randomBytes, + namedGroup.id, publicPoint); + signature = signer.sign(); + } catch (SignatureException ex) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failed to sign ecdhe parameters: " + + x509Possession.popPrivateKey.getAlgorithm(), ex); + } + paramsSignature = signature; + } + } + + ECDHServerKeyExchangeMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + // This happens in client side only. + ClientHandshakeContext chc = + (ClientHandshakeContext)handshakeContext; + + byte curveType = (byte)Record.getInt8(m); + if (curveType != CURVE_NAMED_CURVE) { + // Unlikely as only the named curves should be negotiated. + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unsupported ECCurveType: " + curveType); + } + + int namedGroupId = Record.getInt16(m); + this.namedGroup = NamedGroup.valueOf(namedGroupId); + if (namedGroup == null) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unknown named group ID: " + namedGroupId); + } + + if (!SupportedGroups.isSupported(namedGroup)) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unsupported named group: " + namedGroup); + } + + if (namedGroup.oid == null) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Unknown named EC curve: " + namedGroup); + } + + ECParameterSpec parameters = + JsseJce.getECParameterSpec(namedGroup.oid); + if (parameters == null) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No supported EC parameter: " + namedGroup); + } + + publicPoint = Record.getBytes8(m); + if (publicPoint.length == 0) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Insufficient ECPoint data: " + namedGroup); + } + + ECPublicKey ecPublicKey = null; + try { + ECPoint point = + JsseJce.decodePoint(publicPoint, parameters.getCurve()); + KeyFactory factory = JsseJce.getKeyFactory("EC"); + ecPublicKey = (ECPublicKey)factory.generatePublic( + new ECPublicKeySpec(point, parameters)); + } catch (NoSuchAlgorithmException | + InvalidKeySpecException | IOException ex) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid ECPoint: " + namedGroup, ex); + } + + publicKey = ecPublicKey; + + X509Credentials x509Credentials = null; + for (SSLCredentials cd : chc.handshakeCredentials) { + if (cd instanceof X509Credentials) { + x509Credentials = (X509Credentials)cd; + break; + } + } + + if (x509Credentials == null) { + // anonymous, no authentication, no signature + if (m.hasRemaining()) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid DH ServerKeyExchange: unknown extra data"); + } + this.signatureScheme = null; + this.paramsSignature = null; + this.useExplicitSigAlgorithm = false; + + return; + } + + this.useExplicitSigAlgorithm = + chc.negotiatedProtocol.useTLS12PlusSpec(); + if (useExplicitSigAlgorithm) { + int ssid = Record.getInt16(m); + signatureScheme = SignatureScheme.valueOf(ssid); + if (signatureScheme == null) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid signature algorithm (" + ssid + + ") used in ECDH ServerKeyExchange handshake message"); + } + + if (!chc.localSupportedSignAlgs.contains(signatureScheme)) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsupported signature algorithm (" + + signatureScheme.name + + ") used in ECDH ServerKeyExchange handshake message"); + } + } else { + signatureScheme = null; + } + + // read and verify the signature + paramsSignature = Record.getBytes16(m); + Signature signer; + if (useExplicitSigAlgorithm) { + try { + signer = signatureScheme.getSignature( + x509Credentials.popPublicKey); + } catch (NoSuchAlgorithmException | InvalidKeyException | + InvalidAlgorithmParameterException nsae) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm: " + + signatureScheme.name, nsae); + + return; // make the compiler happe + } + } else { + try { + signer = getSignature( + x509Credentials.popPublicKey.getAlgorithm(), + x509Credentials.popPublicKey); + } catch (NoSuchAlgorithmException | InvalidKeyException e) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Unsupported signature algorithm: " + + x509Credentials.popPublicKey.getAlgorithm(), e); + + return; // make the compiler happe + } + } + + try { + updateSignature(signer, + chc.clientHelloRandom.randomBytes, + chc.serverHelloRandom.randomBytes, + namedGroup.id, publicPoint); + + if (!signer.verify(paramsSignature)) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid ECDH ServerKeyExchange signature"); + } + } catch (SignatureException ex) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Cannot verify ECDH ServerKeyExchange signature", ex); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.SERVER_KEY_EXCHANGE; + } + + @Override + public int messageLength() { + int sigLen = 0; + if (paramsSignature != null) { + sigLen = 2 + paramsSignature.length; + if (useExplicitSigAlgorithm) { + sigLen += SignatureScheme.sizeInRecord(); + } + } + + return 4 + publicPoint.length + sigLen; + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putInt8(CURVE_NAMED_CURVE); + hos.putInt16(namedGroup.id); + hos.putBytes8(publicPoint); + if (paramsSignature != null) { + if (useExplicitSigAlgorithm) { + hos.putInt16(signatureScheme.id); + } + + hos.putBytes16(paramsSignature); + } + } + + @Override + public String toString() { + if (useExplicitSigAlgorithm) { + MessageFormat messageFormat = new MessageFormat( + "\"ECDH ServerKeyExchange\": '{'\n" + + " \"parameters\": '{'\n" + + " \"named group\": \"{0}\"\n" + + " \"ecdh public\": '{'\n" + + "{1}\n" + + " '}',\n" + + " '}',\n" + + " \"digital signature\": '{'\n" + + " \"signature algorithm\": \"{2}\"\n" + + " \"signature\": '{'\n" + + "{3}\n" + + " '}',\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + namedGroup.name, + Utilities.indent( + hexEncoder.encodeBuffer(publicPoint), " "), + signatureScheme.name, + Utilities.indent( + hexEncoder.encodeBuffer(paramsSignature), " ") + }; + return messageFormat.format(messageFields); + } else if (paramsSignature != null) { + MessageFormat messageFormat = new MessageFormat( + "\"ECDH ServerKeyExchange\": '{'\n" + + " \"parameters\": '{'\n" + + " \"named group\": \"{0}\"\n" + + " \"ecdh public\": '{'\n" + + "{1}\n" + + " '}',\n" + + " '}',\n" + + " \"signature\": '{'\n" + + "{2}\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + namedGroup.name, + Utilities.indent( + hexEncoder.encodeBuffer(publicPoint), " "), + Utilities.indent( + hexEncoder.encodeBuffer(paramsSignature), " ") + }; + + return messageFormat.format(messageFields); + } else { // anonymous + MessageFormat messageFormat = new MessageFormat( + "\"ECDH ServerKeyExchange\": '{'\n" + + " \"parameters\": '{'\n" + + " \"named group\": \"{0}\"\n" + + " \"ecdh public\": '{'\n" + + "{1}\n" + + " '}',\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + namedGroup.name, + Utilities.indent( + hexEncoder.encodeBuffer(publicPoint), " "), + }; + + return messageFormat.format(messageFields); + } + } + + private static Signature getSignature(String keyAlgorithm, + Key key) throws NoSuchAlgorithmException, InvalidKeyException { + Signature signer = null; + switch (keyAlgorithm) { + case "EC": + signer = JsseJce.getSignature(JsseJce.SIGNATURE_ECDSA); + break; + case "RSA": + signer = RSASignature.getInstance(); + break; + default: + throw new NoSuchAlgorithmException( + "neither an RSA or a EC key : " + keyAlgorithm); + } + + if (signer != null) { + if (key instanceof PublicKey) { + signer.initVerify((PublicKey)(key)); + } else { + signer.initSign((PrivateKey)key); + } + } + + return signer; + } + + private static void updateSignature(Signature sig, + byte[] clntNonce, byte[] svrNonce, int namedGroupId, + byte[] publicPoint) throws SignatureException { + sig.update(clntNonce); + sig.update(svrNonce); + + sig.update(CURVE_NAMED_CURVE); + sig.update((byte)((namedGroupId >> 8) & 0xFF)); + sig.update((byte)(namedGroupId & 0xFF)); + sig.update((byte)publicPoint.length); + sig.update(publicPoint); + } + } + + /** + * The ECDH "ServerKeyExchange" handshake message producer. + */ + private static final + class ECDHServerKeyExchangeProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private ECDHServerKeyExchangeProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + ECDHServerKeyExchangeMessage skem = + new ECDHServerKeyExchangeMessage(shc); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced ECDH ServerKeyExchange handshake message", skem); + } + + // Output the handshake message. + skem.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The ECDH "ServerKeyExchange" handshake message consumer. + */ + private static final + class ECDHServerKeyExchangeConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private ECDHServerKeyExchangeConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + ECDHServerKeyExchangeMessage skem = + new ECDHServerKeyExchangeMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming ECDH ServerKeyExchange handshake message", skem); + } + + // + // validate + // + // check constraints of EC PublicKey + if (!chc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + skem.publicKey)) { + chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, + "ECDH ServerKeyExchange does not comply " + + "to algorithm constraints"); + } + + // + // update + // + chc.handshakeCredentials.add( + new ECDHECredentials(skem.publicKey, skem.namedGroup)); + + // + // produce + // + // Need no new handshake message producers here. + } + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ECPointFormatsExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,302 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.Locale; +import javax.net.ssl.SSLProtocolException; +import static sun.security.ssl.SSLExtension.CH_EC_POINT_FORMATS; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SupportedGroupsExtension.NamedGroupType; + +/** + * Pack of the "ec_point_formats" extensions [RFC 4492]. + */ +final class ECPointFormatsExtension { + static final HandshakeProducer chNetworkProducer = + new CHECPointFormatsProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHECPointFormatsConsumer(); + + static final ExtensionConsumer shOnLoadConsumer = + new SHECPointFormatsConsumer(); + + static final SSLStringizer epfStringizer = + new ECPointFormatsStringizer(); + + /** + * The "ec_point_formats" extension. + */ + static class ECPointFormatsSpec implements SSLExtensionSpec { + static final ECPointFormatsSpec DEFAULT = + new ECPointFormatsSpec(new byte[] {ECPointFormat.UNCOMPRESSED.id}); + + final byte[] formats; + + ECPointFormatsSpec(byte[] formats) { + this.formats = formats; + } + + private ECPointFormatsSpec(ByteBuffer m) throws IOException { + if (!m.hasRemaining()) { + throw new SSLProtocolException( + "Invalid ec_point_formats extension: " + + "insufficient data"); + } + + this.formats = Record.getBytes8(m); + } + + private boolean hasUncompressedFormat() { + for (byte format : formats) { + if (format == ECPointFormat.UNCOMPRESSED.id) { + return true; + } + } + + return false; + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"formats\": '['{0}']'", Locale.ENGLISH); + if (formats == null || formats.length == 0) { + Object[] messageFields = { + "<no EC point format specified>" + }; + return messageFormat.format(messageFields); + } else { + StringBuilder builder = new StringBuilder(512); + boolean isFirst = true; + for (byte pf : formats) { + if (isFirst) { + isFirst = false; + } else { + builder.append(", "); + } + + builder.append(ECPointFormat.nameOf(pf)); + } + + Object[] messageFields = { + builder.toString() + }; + + return messageFormat.format(messageFields); + } + } + } + + private static final class ECPointFormatsStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new ECPointFormatsSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + private static enum ECPointFormat { + UNCOMPRESSED ((byte)0, "uncompressed"), + ANSIX962_COMPRESSED_PRIME ((byte)1, "ansiX962_compressed_prime"), + FMT_ANSIX962_COMPRESSED_CHAR2 ((byte)2, "ansiX962_compressed_char2"); + + final byte id; + final String name; + + private ECPointFormat(byte id, String name) { + this.id = id; + this.name = name; + } + + static String nameOf(int id) { + for (ECPointFormat pf: ECPointFormat.values()) { + if (pf.id == id) { + return pf.name; + } + } + return "UNDEFINED-EC-POINT-FORMAT(" + id + ")"; + } + } + + /** + * Network data producer of a "ec_point_formats" extension in + * the ClientHello handshake message. + */ + private static final + class CHECPointFormatsProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHECPointFormatsProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(CH_EC_POINT_FORMATS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable ec_point_formats extension"); + } + return null; + } + + // Produce the extension. + // + // produce the extension only if EC cipher suite is activated. + if (NamedGroupType.NAMED_GROUP_ECDHE.isSupported( + chc.activeCipherSuites)) { + // We are using uncompressed ECPointFormat only at present. + byte[] extData = new byte[] {0x01, 0x00}; + + // Update the context. + chc.handshakeExtensions.put( + CH_EC_POINT_FORMATS, ECPointFormatsSpec.DEFAULT); + + return extData; + } + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Need no ec_point_formats extension"); + } + return null; + } + } + + /** + * Network data consumer of a "ec_point_formats" extension in + * the ClientHello handshake message. + */ + private static final + class CHECPointFormatsConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHECPointFormatsConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(CH_EC_POINT_FORMATS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable ec_point_formats extension"); + } + return; // ignore the extension + } + + // Parse the extension. + ECPointFormatsSpec spec; + try { + spec = new ECPointFormatsSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // per RFC 4492, uncompressed points must always be supported. + if (!spec.hasUncompressedFormat()) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid ec_point_formats extension data: " + + "peer does not support uncompressed points"); + } + + // Update the context. + shc.handshakeExtensions.put(CH_EC_POINT_FORMATS, spec); + + // No impact on session resumption, as only uncompressed points + // are supported at present. + } + } + + /** + * Network data consumer of a "ec_point_formats" extension in + * the ServerHello handshake message. + */ + private static final + class SHECPointFormatsConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHECPointFormatsConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to "ec_point_formats" extension request only + ECPointFormatsSpec requestedSpec = (ECPointFormatsSpec) + chc.handshakeExtensions.get(CH_EC_POINT_FORMATS); + if (requestedSpec == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected ec_point_formats extension in ServerHello"); + } + + // Parse the extension. + ECPointFormatsSpec spec; + try { + spec = new ECPointFormatsSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // per RFC 4492, uncompressed points must always be supported. + if (!spec.hasUncompressedFormat()) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid ec_point_formats extension data: " + + "peer does not support uncompressed points"); + } + + // Update the context. + chc.handshakeExtensions.put(CH_EC_POINT_FORMATS, spec); + + // No impact on session resumption, as only uncompressed points + // are supported at present. + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/EllipticPointFormatsExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/EllipticPointFormatsExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/EllipticPointFormatsExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/EllipticPointFormatsExtension.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -import javax.net.ssl.SSLProtocolException; - -final class EllipticPointFormatsExtension extends HelloExtension { - - static final int FMT_UNCOMPRESSED = 0; - static final int FMT_ANSIX962_COMPRESSED_PRIME = 1; - static final int FMT_ANSIX962_COMPRESSED_CHAR2 = 2; - - static final HelloExtension DEFAULT = - new EllipticPointFormatsExtension(new byte[] {FMT_UNCOMPRESSED}); - - private final byte[] formats; - - private EllipticPointFormatsExtension(byte[] formats) { - super(ExtensionType.EXT_EC_POINT_FORMATS); - this.formats = formats; - } - - EllipticPointFormatsExtension(HandshakeInStream s, int len) - throws IOException { - super(ExtensionType.EXT_EC_POINT_FORMATS); - formats = s.getBytes8(); - // RFC 4492 says uncompressed points must always be supported. - // Check just to make sure. - boolean uncompressed = false; - for (int format : formats) { - if (format == FMT_UNCOMPRESSED) { - uncompressed = true; - break; - } - } - if (uncompressed == false) { - throw new SSLProtocolException - ("Peer does not support uncompressed points"); - } - } - - @Override - int length() { - return 5 + formats.length; - } - - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - s.putInt16(formats.length + 1); - s.putBytes8(formats); - } - - private static String toString(byte format) { - int f = format & 0xff; - switch (f) { - case FMT_UNCOMPRESSED: - return "uncompressed"; - case FMT_ANSIX962_COMPRESSED_PRIME: - return "ansiX962_compressed_prime"; - case FMT_ANSIX962_COMPRESSED_CHAR2: - return "ansiX962_compressed_char2"; - default: - return "unknown-" + f; - } - } - - @Override - public String toString() { - List<String> list = new ArrayList<String>(); - for (byte format : formats) { - list.add(toString(format)); - } - return "Extension " + type + ", formats: " + list; - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/EncryptedExtensions.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,193 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.Locale; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the EncryptedExtensions handshake message. + */ +final class EncryptedExtensions { + static final HandshakeProducer handshakeProducer = + new EncryptedExtensionsProducer(); + static final SSLConsumer handshakeConsumer = + new EncryptedExtensionsConsumer(); + + /** + * The EncryptedExtensions handshake message. + */ + static final class EncryptedExtensionsMessage extends HandshakeMessage { + private final SSLExtensions extensions; + + EncryptedExtensionsMessage( + HandshakeContext handshakeContext) throws IOException { + super(handshakeContext); + this.extensions = new SSLExtensions(this); + } + + EncryptedExtensionsMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + // struct { + // Extension extensions<0..2^16-1>; + // } EncryptedExtensions; + if (m.remaining() < 2) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid EncryptedExtensions handshake message: " + + "no sufficient data"); + } + + SSLExtension[] encryptedExtensions = + handshakeContext.sslConfig.getEnabledExtensions( + SSLHandshake.ENCRYPTED_EXTENSIONS); + this.extensions = new SSLExtensions(this, m, encryptedExtensions); + } + + @Override + SSLHandshake handshakeType() { + return SSLHandshake.ENCRYPTED_EXTENSIONS; + } + + @Override + int messageLength() { + int extLen = extensions.length(); + if (extLen == 0) { + extLen = 2; // empty extensions + } + return extLen; + } + + @Override + void send(HandshakeOutStream hos) throws IOException { + // Is it an empty extensions? + if (extensions.length() == 0) { + hos.putInt16(0); + } else { + extensions.send(hos); + } + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"EncryptedExtensions\": [\n" + + "{0}\n" + + "]", + Locale.ENGLISH); + Object[] messageFields = { + Utilities.indent(extensions.toString()) + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The EncryptedExtensions handshake message consumer. + */ + private static final class EncryptedExtensionsProducer + implements HandshakeProducer { + // Prevent instantiation of this class. + private EncryptedExtensionsProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + EncryptedExtensionsMessage eem = + new EncryptedExtensionsMessage(shc); + SSLExtension[] extTypes = + shc.sslConfig.getEnabledExtensions( + SSLHandshake.ENCRYPTED_EXTENSIONS, + shc.negotiatedProtocol); + eem.extensions.produce(shc, extTypes); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced EncryptedExtensions message", eem); + } + + // Output the handshake message. + eem.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The EncryptedExtensions handshake message consumer. + */ + private static final class EncryptedExtensionsConsumer + implements SSLConsumer { + // Prevent instantiation of this class. + private EncryptedExtensionsConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // clean up this consumer + chc.handshakeConsumers.remove(SSLHandshake.ENCRYPTED_EXTENSIONS.id); + + EncryptedExtensionsMessage eem = + new EncryptedExtensionsMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming EncryptedExtensions handshake message", eem); + } + + // + // validate + // + SSLExtension[] extTypes = chc.sslConfig.getEnabledExtensions( + SSLHandshake.ENCRYPTED_EXTENSIONS); + eem.extensions.consumeOnLoad(chc, extTypes); + + // + // update + // + eem.extensions.consumeOnTrade(chc, extTypes); + + // + // produce + // + // Need no new handshake message producers here. + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/EphemeralKeyManager.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/EphemeralKeyManager.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/EphemeralKeyManager.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/EphemeralKeyManager.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ExtendedMasterSecretExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright (c) 2017, Red Hat, Inc. and/or its affiliates. + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,46 +27,365 @@ package sun.security.ssl; import java.io.IOException; +import java.nio.ByteBuffer; import javax.net.ssl.SSLProtocolException; +import static sun.security.ssl.SSLExtension.CH_EXTENDED_MASTER_SECRET; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import static sun.security.ssl.SSLExtension.SH_EXTENDED_MASTER_SECRET; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; /** - * Extended Master Secret TLS extension (TLS 1.0+). This extension - * defines how to calculate the TLS connection master secret and - * mitigates some types of man-in-the-middle attacks. - * - * See further information in - * <a href="https://tools.ietf.org/html/rfc7627">RFC 7627</a>. - * - * @author Martin Balao (mbalao@redhat.com) + * Pack of the "extended_master_secret" extensions [RFC 7627]. */ -final class ExtendedMasterSecretExtension extends HelloExtension { - ExtendedMasterSecretExtension() { - super(ExtensionType.EXT_EXTENDED_MASTER_SECRET); +final class ExtendedMasterSecretExtension { + static final HandshakeProducer chNetworkProducer = + new CHExtendedMasterSecretProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHExtendedMasterSecretConsumer(); + static final HandshakeAbsence chOnLoadAbsence = + new CHExtendedMasterSecretAbsence(); + + static final HandshakeProducer shNetworkProducer = + new SHExtendedMasterSecretProducer(); + static final ExtensionConsumer shOnLoadConsumer = + new SHExtendedMasterSecretConsumer(); + static final HandshakeAbsence shOnLoadAbsence = + new SHExtendedMasterSecretAbsence(); + + static final SSLStringizer emsStringizer = + new ExtendedMasterSecretStringizer(); + + /** + * The "extended_master_secret" extension. + */ + static final class ExtendedMasterSecretSpec implements SSLExtensionSpec { + // A nominal object that does not holding any real renegotiation info. + static final ExtendedMasterSecretSpec NOMINAL = + new ExtendedMasterSecretSpec(); + + private ExtendedMasterSecretSpec() { + // blank + } + + private ExtendedMasterSecretSpec(ByteBuffer m) throws IOException { + // Parse the extension. + if (m.hasRemaining()) { + throw new SSLProtocolException( + "Invalid extended_master_secret extension data: " + + "not empty"); + } + } + + @Override + public String toString() { + return "<empty>"; + } + } + + private static final + class ExtendedMasterSecretStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new ExtendedMasterSecretSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of a "extended_master_secret" extension in + * the ClientHello handshake message. + */ + private static final + class CHExtendedMasterSecretProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHExtendedMasterSecretProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(CH_EXTENDED_MASTER_SECRET) || + !SSLConfiguration.useExtendedMasterSecret || + !chc.conContext.protocolVersion.useTLS10PlusSpec()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extended_master_secret extension"); + } + + return null; + } + + if (chc.handshakeSession == null || + chc.handshakeSession.useExtendedMasterSecret) { + byte[] extData = new byte[0]; + chc.handshakeExtensions.put(CH_EXTENDED_MASTER_SECRET, + ExtendedMasterSecretSpec.NOMINAL); + + return extData; + } + + return null; + } + } + + /** + * Network data producer of a "extended_master_secret" extension in + * the ServerHello handshake message. + */ + private static final + class CHExtendedMasterSecretConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHExtendedMasterSecretConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(CH_EXTENDED_MASTER_SECRET) || + !SSLConfiguration.useExtendedMasterSecret || + !shc.negotiatedProtocol.useTLS10PlusSpec()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Ignore unavailable extension: " + + CH_EXTENDED_MASTER_SECRET.name); + } + return; // ignore the extension + } + + // Parse the extension. + ExtendedMasterSecretSpec spec; + try { + spec = new ExtendedMasterSecretSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + if (shc.isResumption && shc.resumingSession != null && + !shc.resumingSession.useExtendedMasterSecret) { + // For abbreviated handshake request, If the original + // session did not use the "extended_master_secret" + // extension but the new ClientHello contains the + // extension, then the server MUST NOT perform the + // abbreviated handshake. Instead, it SHOULD continue + // with a full handshake. + shc.isResumption = false; + shc.resumingSession = null; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "abort session resumption which did not use " + + "Extended Master Secret extension"); + } + } + + // Update the context. + // + shc.handshakeExtensions.put( + CH_EXTENDED_MASTER_SECRET, ExtendedMasterSecretSpec.NOMINAL); + + // No impact on session resumption. + } } - ExtendedMasterSecretExtension(HandshakeInStream s, - int len) throws IOException { - super(ExtensionType.EXT_EXTENDED_MASTER_SECRET); + /** + * The absence processing if a "extended_master_secret" extension is + * not present in the ClientHello handshake message. + */ + private static final + class CHExtendedMasterSecretAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(CH_EXTENDED_MASTER_SECRET) || + !SSLConfiguration.useExtendedMasterSecret) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Ignore unavailable extension: " + + CH_EXTENDED_MASTER_SECRET.name); + } + return; // ignore the extension + } - if (len != 0) { - throw new SSLProtocolException("Invalid " + type + " extension"); + if (shc.negotiatedProtocol.useTLS10PlusSpec() && + !SSLConfiguration.allowLegacyMasterSecret) { + // For full handshake, if the server receives a ClientHello + // without the extension, it SHOULD abort the handshake if + // it does not wish to interoperate with legacy clients. + // + // As if extended master extension is required for full + // handshake, it MUST be used in abbreviated handshake too. + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Extended Master Secret extension is required"); + } + + if (shc.isResumption && shc.resumingSession != null) { + if (shc.resumingSession.useExtendedMasterSecret) { + // For abbreviated handshake request, if the original + // session used the "extended_master_secret" extension + // but the new ClientHello does not contain it, the + // server MUST abort the abbreviated handshake. + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Missing Extended Master Secret extension " + + "on session resumption"); + } else { + // For abbreviated handshake request, if neither the + // original session nor the new ClientHello uses the + // extension, the server SHOULD abort the handshake. + if (!SSLConfiguration.allowLegacyResumption) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Missing Extended Master Secret extension " + + "on session resumption"); + } else { // Otherwise, continue with a full handshake. + shc.isResumption = false; + shc.resumingSession = null; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "abort session resumption, " + + "missing Extended Master Secret extension"); + } + } + } + } } } - @Override - int length() { - return 4; // 4: extension type and length fields + /** + * Network data producer of a "extended_master_secret" extension in + * the ServerHello handshake message. + */ + private static final + class SHExtendedMasterSecretProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHExtendedMasterSecretProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + if (shc.handshakeSession.useExtendedMasterSecret) { + byte[] extData = new byte[0]; + shc.handshakeExtensions.put(SH_EXTENDED_MASTER_SECRET, + ExtendedMasterSecretSpec.NOMINAL); + + return extData; + } + + return null; + } } - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); // ExtensionType extension_type; - s.putInt16(0); // extension_data length + /** + * Network data consumer of a "extended_master_secret" extension in + * the ServerHello handshake message. + */ + private static final + class SHExtendedMasterSecretConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHExtendedMasterSecretConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to the client extended_master_secret extension + // request, which is mandatory for ClientHello message. + ExtendedMasterSecretSpec requstedSpec = (ExtendedMasterSecretSpec) + chc.handshakeExtensions.get(CH_EXTENDED_MASTER_SECRET); + if (requstedSpec == null) { + chc.conContext.fatal(Alert.UNSUPPORTED_EXTENSION, + "Server sent the extended_master_secret " + + "extension improperly"); + } + + // Parse the extension. + ExtendedMasterSecretSpec spec; + try { + spec = new ExtendedMasterSecretSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + if (chc.isResumption && chc.resumingSession != null && + !chc.resumingSession.useExtendedMasterSecret) { + chc.conContext.fatal(Alert.UNSUPPORTED_EXTENSION, + "Server sent an unexpected extended_master_secret " + + "extension on session resumption"); + } + + // Update the context. + chc.handshakeExtensions.put( + SH_EXTENDED_MASTER_SECRET, ExtendedMasterSecretSpec.NOMINAL); + + // No impact on session resumption. + } } - @Override - public String toString() { - return "Extension " + type; + /** + * The absence processing if a "extended_master_secret" extension is + * not present in the ServerHello handshake message. + */ + private static final + class SHExtendedMasterSecretAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + if (SSLConfiguration.useExtendedMasterSecret && + !SSLConfiguration.allowLegacyMasterSecret) { + // For full handshake, if a client receives a ServerHello + // without the extension, it SHOULD abort the handshake if + // it does not wish to interoperate with legacy servers. + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Extended Master Secret extension is required"); + } + + if (chc.isResumption && chc.resumingSession != null) { + if (chc.resumingSession.useExtendedMasterSecret) { + // For abbreviated handshake, if the original session used + // the "extended_master_secret" extension but the new + // ServerHello does not contain the extension, the client + // MUST abort the handshake. + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Missing Extended Master Secret extension " + + "on session resumption"); + } else if (SSLConfiguration.useExtendedMasterSecret && + !SSLConfiguration.allowLegacyResumption && + chc.negotiatedProtocol.useTLS10PlusSpec()) { + // Unlikely, abbreviated handshake should be discarded. + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Extended Master Secret extension is required"); + } + } + } } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ExtensionType.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ExtensionType.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ExtensionType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ExtensionType.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.util.ArrayList; -import java.util.List; - -final class ExtensionType { - - final int id; - final String name; - - private ExtensionType(int id, String name) { - this.id = id; - this.name = name; - } - - @Override - public String toString() { - return name; - } - - static List<ExtensionType> knownExtensions = new ArrayList<>(16); - - static ExtensionType get(int id) { - for (ExtensionType ext : knownExtensions) { - if (ext.id == id) { - return ext; - } - } - return new ExtensionType(id, "type_" + id); - } - - private static ExtensionType e(int id, String name) { - ExtensionType ext = new ExtensionType(id, name); - knownExtensions.add(ext); - return ext; - } - - // extensions defined in RFC 3546 - static final ExtensionType EXT_SERVER_NAME = - e(0x0000, "server_name"); // IANA registry value: 0 - static final ExtensionType EXT_MAX_FRAGMENT_LENGTH = - e(0x0001, "max_fragment_length"); // IANA registry value: 1 - static final ExtensionType EXT_CLIENT_CERTIFICATE_URL = - e(0x0002, "client_certificate_url"); // IANA registry value: 2 - static final ExtensionType EXT_TRUSTED_CA_KEYS = - e(0x0003, "trusted_ca_keys"); // IANA registry value: 3 - static final ExtensionType EXT_TRUNCATED_HMAC = - e(0x0004, "truncated_hmac"); // IANA registry value: 4 - static final ExtensionType EXT_STATUS_REQUEST = - e(0x0005, "status_request"); // IANA registry value: 5 - - // extensions defined in RFC 4681 - static final ExtensionType EXT_USER_MAPPING = - e(0x0006, "user_mapping"); // IANA registry value: 6 - - // extensions defined in RFC 5081 - static final ExtensionType EXT_CERT_TYPE = - e(0x0009, "cert_type"); // IANA registry value: 9 - - // extensions defined in RFC 4492 (ECC) and RFC 7919 (FFDHE) - static final ExtensionType EXT_SUPPORTED_GROUPS = - e(0x000A, "supported_groups"); // IANA registry value: 10 - static final ExtensionType EXT_EC_POINT_FORMATS = - e(0x000B, "ec_point_formats"); // IANA registry value: 11 - - // extensions defined in RFC 5054 - static final ExtensionType EXT_SRP = - e(0x000C, "srp"); // IANA registry value: 12 - - // extensions defined in RFC 5246 - static final ExtensionType EXT_SIGNATURE_ALGORITHMS = - e(0x000D, "signature_algorithms"); // IANA registry value: 13 - - // extension defined in RFC 7301 (ALPN) - static final ExtensionType EXT_ALPN = - e(0x0010, "application_layer_protocol_negotiation"); - // IANA registry value: 16 - - // extensions defined in RFC 6961 - static final ExtensionType EXT_STATUS_REQUEST_V2 = - e(0x0011, "status_request_v2"); // IANA registry value: 17 - - // extensions defined in RFC 7627 - static final ExtensionType EXT_EXTENDED_MASTER_SECRET = - e(0x0017, "extended_master_secret"); // IANA registry value: 23 - - // extensions defined in RFC 5746 - static final ExtensionType EXT_RENEGOTIATION_INFO = - e(0xff01, "renegotiation_info"); // IANA registry value: 65281 -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Finished.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Finished.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Finished.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Finished.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1077 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.security.InvalidKeyException; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.ProviderException; +import java.security.spec.AlgorithmParameterSpec; +import java.text.MessageFormat; +import java.util.Locale; +import javax.crypto.KeyGenerator; +import javax.crypto.Mac; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import sun.security.internal.spec.TlsPrfParameterSpec; +import sun.security.ssl.CipherSuite.HashAlg; +import static sun.security.ssl.CipherSuite.HashAlg.H_NONE; +import sun.security.ssl.SSLBasicKeyDerivation.SecretSizeSpec; +import sun.security.ssl.SSLCipher.SSLReadCipher; +import sun.security.ssl.SSLCipher.SSLWriteCipher; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.util.HexDumpEncoder; + +/** + * Pack of the Finished handshake message. + */ +final class Finished { + static final SSLConsumer t12HandshakeConsumer = + new T12FinishedConsumer(); + static final HandshakeProducer t12HandshakeProducer = + new T12FinishedProducer(); + + static final SSLConsumer t13HandshakeConsumer = + new T13FinishedConsumer(); + static final HandshakeProducer t13HandshakeProducer = + new T13FinishedProducer(); + + /** + * The Finished handshake message. + */ + private static final class FinishedMessage extends HandshakeMessage { + private final byte[] verifyData; + + FinishedMessage(HandshakeContext context) throws IOException { + super(context); + + VerifyDataScheme vds = + VerifyDataScheme.valueOf(context.negotiatedProtocol); + + byte[] vd = null; + try { + vd = vds.createVerifyData(context, false); + } catch (IOException ioe) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Failed to generate verify_data", ioe); + } + + this.verifyData = vd; + } + + FinishedMessage(HandshakeContext context, + ByteBuffer m) throws IOException { + super(context); + int verifyDataLen = 12; + if (context.negotiatedProtocol == ProtocolVersion.SSL30) { + verifyDataLen = 36; + } else if (context.negotiatedProtocol.useTLS13PlusSpec()) { + verifyDataLen = + context.negotiatedCipherSuite.hashAlg.hashLength; + } + + if (m.remaining() != verifyDataLen) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Inappropriate finished message: need " + verifyDataLen + + " but remaining " + m.remaining() + " bytes verify_data"); + } + + this.verifyData = new byte[verifyDataLen]; + m.get(verifyData); + + VerifyDataScheme vd = + VerifyDataScheme.valueOf(context.negotiatedProtocol); + byte[] myVerifyData; + try { + myVerifyData = vd.createVerifyData(context, true); + } catch (IOException ioe) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Failed to generate verify_data", ioe); + return; // make the compiler happy + } + if (!MessageDigest.isEqual(myVerifyData, verifyData)) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "The Finished message cannot be verified."); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.FINISHED; + } + + @Override + public int messageLength() { + return verifyData.length; + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.write(verifyData); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"Finished\": '{'\n" + + " \"verify data\": '{'\n" + + "{0}\n" + + " '}'" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent(hexEncoder.encode(verifyData), " "), + }; + return messageFormat.format(messageFields); + } + } + + interface VerifyDataGenerator { + byte[] createVerifyData(HandshakeContext context, + boolean isValidation) throws IOException; + } + + enum VerifyDataScheme { + SSL30 ("kdf_ssl30", new S30VerifyDataGenerator()), + TLS10 ("kdf_tls10", new T10VerifyDataGenerator()), + TLS12 ("kdf_tls12", new T12VerifyDataGenerator()), + TLS13 ("kdf_tls13", new T13VerifyDataGenerator()); + + final String name; + final VerifyDataGenerator generator; + + VerifyDataScheme(String name, VerifyDataGenerator verifyDataGenerator) { + this.name = name; + this.generator = verifyDataGenerator; + } + + static VerifyDataScheme valueOf(ProtocolVersion protocolVersion) { + switch (protocolVersion) { + case SSL30: + return VerifyDataScheme.SSL30; + case TLS10: + case TLS11: + case DTLS10: + return VerifyDataScheme.TLS10; + case TLS12: + case DTLS12: + return VerifyDataScheme.TLS12; + case TLS13: + return VerifyDataScheme.TLS13; + default: + return null; + } + } + + public byte[] createVerifyData(HandshakeContext context, + boolean isValidation) throws IOException { + if (generator != null) { + return generator.createVerifyData(context, isValidation); + } + + throw new UnsupportedOperationException("Not supported yet."); + } + } + + // SSL 3.0 + private static final + class S30VerifyDataGenerator implements VerifyDataGenerator { + @Override + public byte[] createVerifyData(HandshakeContext context, + boolean isValidation) throws IOException { + HandshakeHash handshakeHash = context.handshakeHash; + SecretKey masterSecretKey = + context.handshakeSession.getMasterSecret(); + + boolean useClientLabel = + (context.sslConfig.isClientMode && !isValidation) || + (!context.sslConfig.isClientMode && isValidation); + return handshakeHash.digest(useClientLabel, masterSecretKey); + } + } + + // TLS 1.0, TLS 1.1, DTLS 1.0 + private static final + class T10VerifyDataGenerator implements VerifyDataGenerator { + @Override + public byte[] createVerifyData(HandshakeContext context, + boolean isValidation) throws IOException { + HandshakeHash handshakeHash = context.handshakeHash; + SecretKey masterSecretKey = + context.handshakeSession.getMasterSecret(); + + boolean useClientLabel = + (context.sslConfig.isClientMode && !isValidation) || + (!context.sslConfig.isClientMode && isValidation); + String tlsLabel; + if (useClientLabel) { + tlsLabel = "client finished"; + } else { + tlsLabel = "server finished"; + } + + try { + byte[] seed = handshakeHash.digest(); + String prfAlg = "SunTlsPrf"; + HashAlg hashAlg = H_NONE; + + /* + * RFC 5246/7.4.9 says that finished messages can + * be ciphersuite-specific in both length/PRF hash + * algorithm. If we ever run across a different + * length, this call will need to be updated. + */ + @SuppressWarnings("deprecation") + TlsPrfParameterSpec spec = new TlsPrfParameterSpec( + masterSecretKey, tlsLabel, seed, 12, + hashAlg.name, hashAlg.hashLength, hashAlg.blockSize); + KeyGenerator kg = JsseJce.getKeyGenerator(prfAlg); + kg.init(spec); + SecretKey prfKey = kg.generateKey(); + if (!"RAW".equals(prfKey.getFormat())) { + throw new ProviderException( + "Invalid PRF output, format must be RAW. " + + "Format received: " + prfKey.getFormat()); + } + byte[] finished = prfKey.getEncoded(); + return finished; + } catch (GeneralSecurityException e) { + throw new RuntimeException("PRF failed", e); + } + } + } + + // TLS 1.2 + private static final + class T12VerifyDataGenerator implements VerifyDataGenerator { + @Override + public byte[] createVerifyData(HandshakeContext context, + boolean isValidation) throws IOException { + CipherSuite cipherSuite = context.negotiatedCipherSuite; + HandshakeHash handshakeHash = context.handshakeHash; + SecretKey masterSecretKey = + context.handshakeSession.getMasterSecret(); + + boolean useClientLabel = + (context.sslConfig.isClientMode && !isValidation) || + (!context.sslConfig.isClientMode && isValidation); + String tlsLabel; + if (useClientLabel) { + tlsLabel = "client finished"; + } else { + tlsLabel = "server finished"; + } + + try { + byte[] seed = handshakeHash.digest(); + String prfAlg = "SunTls12Prf"; + HashAlg hashAlg = cipherSuite.hashAlg; + + /* + * RFC 5246/7.4.9 says that finished messages can + * be ciphersuite-specific in both length/PRF hash + * algorithm. If we ever run across a different + * length, this call will need to be updated. + */ + @SuppressWarnings("deprecation") + TlsPrfParameterSpec spec = new TlsPrfParameterSpec( + masterSecretKey, tlsLabel, seed, 12, + hashAlg.name, hashAlg.hashLength, hashAlg.blockSize); + KeyGenerator kg = JsseJce.getKeyGenerator(prfAlg); + kg.init(spec); + SecretKey prfKey = kg.generateKey(); + if (!"RAW".equals(prfKey.getFormat())) { + throw new ProviderException( + "Invalid PRF output, format must be RAW. " + + "Format received: " + prfKey.getFormat()); + } + byte[] finished = prfKey.getEncoded(); + return finished; + } catch (GeneralSecurityException e) { + throw new RuntimeException("PRF failed", e); + } + } + } + + // TLS 1.2 + private static final + class T13VerifyDataGenerator implements VerifyDataGenerator { + private static final byte[] hkdfLabel = "tls13 finished".getBytes(); + private static final byte[] hkdfContext = new byte[0]; + + @Override + public byte[] createVerifyData(HandshakeContext context, + boolean isValidation) throws IOException { + // create finished secret key + HashAlg hashAlg = + context.negotiatedCipherSuite.hashAlg; + SecretKey secret = isValidation ? + context.baseReadSecret : context.baseWriteSecret; + SSLBasicKeyDerivation kdf = new SSLBasicKeyDerivation( + secret, hashAlg.name, + hkdfLabel, hkdfContext, hashAlg.hashLength); + AlgorithmParameterSpec keySpec = + new SecretSizeSpec(hashAlg.hashLength); + SecretKey finishedSecret = + kdf.deriveKey("TlsFinishedSecret", keySpec); + + String hmacAlg = + "Hmac" + hashAlg.name.replace("-", ""); + try { + Mac hmac = JsseJce.getMac(hmacAlg); + hmac.init(finishedSecret); + return hmac.doFinal(context.handshakeHash.digest()); + } catch (NoSuchAlgorithmException |InvalidKeyException ex) { + throw new ProviderException( + "Failed to generate verify_data", ex); + } + } + } + + /** + * The "Finished" handshake message producer. + */ + private static final + class T12FinishedProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T12FinishedProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + if (hc.sslConfig.isClientMode) { + return onProduceFinished( + (ClientHandshakeContext)context, message); + } else { + return onProduceFinished( + (ServerHandshakeContext)context, message); + } + } + + private byte[] onProduceFinished(ClientHandshakeContext chc, + HandshakeMessage message) throws IOException { + // Refresh handshake hash + chc.handshakeHash.update(); + + FinishedMessage fm = new FinishedMessage(chc); + + // Change write cipher and delivery ChangeCipherSpec message. + ChangeCipherSpec.t10Producer.produce(chc, message); + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced client Finished handshake message", fm); + } + + // Output the handshake message. + fm.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + /* + * save server verify data for secure renegotiation + */ + if (chc.conContext.secureRenegotiation) { + chc.conContext.clientVerifyData = fm.verifyData; + } + + // update the consumers and producers + if (!chc.isResumption) { + chc.conContext.consumers.put(ContentType.CHANGE_CIPHER_SPEC.id, + ChangeCipherSpec.t10Consumer); + chc.handshakeConsumers.put( + SSLHandshake.FINISHED.id, SSLHandshake.FINISHED); + chc.conContext.inputRecord.expectingFinishFlight(); + } else { + if (chc.handshakeSession.isRejoinable()) { + ((SSLSessionContextImpl)chc.sslContext. + engineGetClientSessionContext()).put( + chc.handshakeSession); + } + chc.conContext.conSession = chc.handshakeSession.finish(); + chc.conContext.protocolVersion = chc.negotiatedProtocol; + + // handshake context cleanup. + chc.handshakeFinished = true; + + // May need to retransmit the last flight for DTLS. + if (!chc.sslContext.isDTLS()) { + chc.conContext.finishHandshake(); + } + } + + // The handshake message has been delivered. + return null; + } + + private byte[] onProduceFinished(ServerHandshakeContext shc, + HandshakeMessage message) throws IOException { + // Refresh handshake hash + shc.handshakeHash.update(); + + FinishedMessage fm = new FinishedMessage(shc); + + // Change write cipher and delivery ChangeCipherSpec message. + ChangeCipherSpec.t10Producer.produce(shc, message); + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced server Finished handshake message", fm); + } + + // Output the handshake message. + fm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + /* + * save client verify data for secure renegotiation + */ + if (shc.conContext.secureRenegotiation) { + shc.conContext.serverVerifyData = fm.verifyData; + } + + // update the consumers and producers + if (shc.isResumption) { + shc.conContext.consumers.put(ContentType.CHANGE_CIPHER_SPEC.id, + ChangeCipherSpec.t10Consumer); + shc.handshakeConsumers.put( + SSLHandshake.FINISHED.id, SSLHandshake.FINISHED); + shc.conContext.inputRecord.expectingFinishFlight(); + } else { + if (shc.handshakeSession.isRejoinable()) { + ((SSLSessionContextImpl)shc.sslContext. + engineGetServerSessionContext()).put( + shc.handshakeSession); + } + shc.conContext.conSession = shc.handshakeSession.finish(); + shc.conContext.protocolVersion = shc.negotiatedProtocol; + + // handshake context cleanup. + shc.handshakeFinished = true; + + // May need to retransmit the last flight for DTLS. + if (!shc.sslContext.isDTLS()) { + shc.conContext.finishHandshake(); + } + } + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "Finished" handshake message consumer. + */ + private static final class T12FinishedConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T12FinishedConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + + // This consumer can be used only once. + hc.handshakeConsumers.remove(SSLHandshake.FINISHED.id); + + // We should not be processing finished messages unless + // we have received ChangeCipherSpec + if (hc.conContext.consumers.containsKey( + ContentType.CHANGE_CIPHER_SPEC.id)) { + hc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Missing ChangeCipherSpec message"); + } + + if (hc.sslConfig.isClientMode) { + onConsumeFinished((ClientHandshakeContext)context, message); + } else { + onConsumeFinished((ServerHandshakeContext)context, message); + } + } + + private void onConsumeFinished(ClientHandshakeContext chc, + ByteBuffer message) throws IOException { + FinishedMessage fm = new FinishedMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming server Finished handshake message", fm); + } + + if (chc.conContext.secureRenegotiation) { + chc.conContext.serverVerifyData = fm.verifyData; + } + + if (!chc.isResumption) { + if (chc.handshakeSession.isRejoinable()) { + ((SSLSessionContextImpl)chc.sslContext. + engineGetClientSessionContext()).put( + chc.handshakeSession); + } + chc.conContext.conSession = chc.handshakeSession.finish(); + chc.conContext.protocolVersion = chc.negotiatedProtocol; + + // handshake context cleanup. + chc.handshakeFinished = true; + + // May need to retransmit the last flight for DTLS. + if (!chc.sslContext.isDTLS()) { + chc.conContext.finishHandshake(); + } + } else { + chc.handshakeProducers.put(SSLHandshake.FINISHED.id, + SSLHandshake.FINISHED); + } + + // + // produce + // + SSLHandshake[] probableHandshakeMessages = new SSLHandshake[] { + SSLHandshake.FINISHED + }; + + for (SSLHandshake hs : probableHandshakeMessages) { + HandshakeProducer handshakeProducer = + chc.handshakeProducers.remove(hs.id); + if (handshakeProducer != null) { + handshakeProducer.produce(chc, fm); + } + } + } + + private void onConsumeFinished(ServerHandshakeContext shc, + ByteBuffer message) throws IOException { + FinishedMessage fm = new FinishedMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming client Finished handshake message", fm); + } + + if (shc.conContext.secureRenegotiation) { + shc.conContext.clientVerifyData = fm.verifyData; + } + + if (shc.isResumption) { + if (shc.handshakeSession.isRejoinable()) { + ((SSLSessionContextImpl)shc.sslContext. + engineGetServerSessionContext()).put( + shc.handshakeSession); + } + shc.conContext.conSession = shc.handshakeSession.finish(); + shc.conContext.protocolVersion = shc.negotiatedProtocol; + + // handshake context cleanup. + shc.handshakeFinished = true; + + // May need to retransmit the last flight for DTLS. + if (!shc.sslContext.isDTLS()) { + shc.conContext.finishHandshake(); + } + } else { + shc.handshakeProducers.put(SSLHandshake.FINISHED.id, + SSLHandshake.FINISHED); + } + + // + // produce + // + SSLHandshake[] probableHandshakeMessages = new SSLHandshake[] { + SSLHandshake.FINISHED + }; + + for (SSLHandshake hs : probableHandshakeMessages) { + HandshakeProducer handshakeProducer = + shc.handshakeProducers.remove(hs.id); + if (handshakeProducer != null) { + handshakeProducer.produce(shc, fm); + } + } + } + } + + /** + * The "Finished" handshake message producer. + */ + private static final + class T13FinishedProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T13FinishedProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + if (hc.sslConfig.isClientMode) { + return onProduceFinished( + (ClientHandshakeContext)context, message); + } else { + return onProduceFinished( + (ServerHandshakeContext)context, message); + } + } + + private byte[] onProduceFinished(ClientHandshakeContext chc, + HandshakeMessage message) throws IOException { + // Refresh handshake hash + chc.handshakeHash.update(); + + FinishedMessage fm = new FinishedMessage(chc); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced client Finished handshake message", fm); + } + + // Output the handshake message. + fm.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // save server verify data for secure renegotiation + if (chc.conContext.secureRenegotiation) { + chc.conContext.clientVerifyData = fm.verifyData; + } + + // update the context + // Change client/server application traffic secrets. + SSLKeyDerivation kd = chc.handshakeKeyDerivation; + if (kd == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "no key derivation"); + return null; // make the compiler happy + } + + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol); + if (kdg == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + chc.negotiatedProtocol); + return null; // make the compiler happy + } + + try { + // update the application traffic read keys. + SecretKey writeSecret = kd.deriveKey( + "TlsClientAppTrafficSecret", null); + + SSLKeyDerivation writeKD = + kdg.createKeyDerivation(chc, writeSecret); + SecretKey writeKey = writeKD.deriveKey( + "TlsKey", null); + SecretKey writeIvSecret = writeKD.deriveKey( + "TlsIv", null); + IvParameterSpec writeIv = + new IvParameterSpec(writeIvSecret.getEncoded()); + SSLWriteCipher writeCipher = + chc.negotiatedCipherSuite.bulkCipher.createWriteCipher( + Authenticator.valueOf(chc.negotiatedProtocol), + chc.negotiatedProtocol, writeKey, writeIv, + chc.sslContext.getSecureRandom()); + + chc.baseWriteSecret = writeSecret; + chc.conContext.outputRecord.changeWriteCiphers( + writeCipher, false); + + } catch (GeneralSecurityException gse) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failure to derive application secrets", gse); + return null; // make the compiler happy + } + + // The resumption master secret is stored in the session so + // it can be used after the handshake is completed. + SSLSecretDerivation sd = ((SSLSecretDerivation) kd).forContext(chc); + SecretKey resumptionMasterSecret = sd.deriveKey( + "TlsResumptionMasterSecret", null); + chc.handshakeSession.setResumptionMasterSecret(resumptionMasterSecret); + + chc.conContext.conSession = chc.handshakeSession.finish(); + chc.conContext.protocolVersion = chc.negotiatedProtocol; + + // handshake context cleanup. + chc.handshakeFinished = true; + chc.conContext.finishHandshake(); + + // The handshake message has been delivered. + return null; + } + + private byte[] onProduceFinished(ServerHandshakeContext shc, + HandshakeMessage message) throws IOException { + // Refresh handshake hash + shc.handshakeHash.update(); + + FinishedMessage fm = new FinishedMessage(shc); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced server Finished handshake message", fm); + } + + // Output the handshake message. + fm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // Change client/server application traffic secrets. + SSLKeyDerivation kd = shc.handshakeKeyDerivation; + if (kd == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "no key derivation"); + return null; // make the compiler happy + } + + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol); + if (kdg == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + shc.negotiatedProtocol); + return null; // make the compiler happy + } + + // derive salt secret + try { + SecretKey saltSecret = kd.deriveKey("TlsSaltSecret", null); + + // derive application secrets + HashAlg hashAlg = shc.negotiatedCipherSuite.hashAlg; + HKDF hkdf = new HKDF(hashAlg.name); + byte[] zeros = new byte[hashAlg.hashLength]; + SecretKeySpec sharedSecret = + new SecretKeySpec(zeros, "TlsZeroSecret"); + SecretKey masterSecret = + hkdf.extract(saltSecret, sharedSecret, "TlsMasterSecret"); + + SSLKeyDerivation secretKD = + new SSLSecretDerivation(shc, masterSecret); + + // update the handshake traffic write keys. + SecretKey writeSecret = secretKD.deriveKey( + "TlsServerAppTrafficSecret", null); + SSLKeyDerivation writeKD = + kdg.createKeyDerivation(shc, writeSecret); + SecretKey writeKey = writeKD.deriveKey( + "TlsKey", null); + SecretKey writeIvSecret = writeKD.deriveKey( + "TlsIv", null); + IvParameterSpec writeIv = + new IvParameterSpec(writeIvSecret.getEncoded()); + SSLWriteCipher writeCipher = + shc.negotiatedCipherSuite.bulkCipher.createWriteCipher( + Authenticator.valueOf(shc.negotiatedProtocol), + shc.negotiatedProtocol, writeKey, writeIv, + shc.sslContext.getSecureRandom()); + + shc.baseWriteSecret = writeSecret; + shc.conContext.outputRecord.changeWriteCiphers( + writeCipher, false); + + // update the context for the following key derivation + shc.handshakeKeyDerivation = secretKD; + } catch (GeneralSecurityException gse) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failure to derive application secrets", gse); + return null; // make the compiler happy + } + + /* + * save client verify data for secure renegotiation + */ + if (shc.conContext.secureRenegotiation) { + shc.conContext.serverVerifyData = fm.verifyData; + } + + // update the context + shc.handshakeConsumers.put( + SSLHandshake.FINISHED.id, SSLHandshake.FINISHED); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "Finished" handshake message consumer. + */ + private static final class T13FinishedConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private T13FinishedConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + if (hc.sslConfig.isClientMode) { + onConsumeFinished( + (ClientHandshakeContext)context, message); + } else { + onConsumeFinished( + (ServerHandshakeContext)context, message); + } + } + + private void onConsumeFinished(ClientHandshakeContext chc, + ByteBuffer message) throws IOException { + FinishedMessage fm = new FinishedMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming server Finished handshake message", fm); + } + + // Save client verify data for secure renegotiation. + if (chc.conContext.secureRenegotiation) { + chc.conContext.serverVerifyData = fm.verifyData; + } + + // + // validate + // + // blank + + // + // update + // + // A change_cipher_spec record received after the peer's Finished + // message MUST be treated as an unexpected record type. + chc.conContext.consumers.remove(ContentType.CHANGE_CIPHER_SPEC.id); + + // Change client/server application traffic secrets. + // Refresh handshake hash + chc.handshakeHash.update(); + SSLKeyDerivation kd = chc.handshakeKeyDerivation; + if (kd == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "no key derivation"); + return; // make the compiler happy + } + + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol); + if (kdg == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + chc.negotiatedProtocol); + return; // make the compiler happy + } + + // save the session + if (!chc.isResumption && chc.handshakeSession.isRejoinable()) { + SSLSessionContextImpl sessionContext = (SSLSessionContextImpl) + chc.sslContext.engineGetClientSessionContext(); + sessionContext.put(chc.handshakeSession); + } + + // derive salt secret + try { + SecretKey saltSecret = kd.deriveKey("TlsSaltSecret", null); + + // derive application secrets + HashAlg hashAlg = chc.negotiatedCipherSuite.hashAlg; + HKDF hkdf = new HKDF(hashAlg.name); + byte[] zeros = new byte[hashAlg.hashLength]; + SecretKeySpec sharedSecret = + new SecretKeySpec(zeros, "TlsZeroSecret"); + SecretKey masterSecret = + hkdf.extract(saltSecret, sharedSecret, "TlsMasterSecret"); + + SSLKeyDerivation secretKD = + new SSLSecretDerivation(chc, masterSecret); + + // update the handshake traffic read keys. + SecretKey readSecret = secretKD.deriveKey( + "TlsServerAppTrafficSecret", null); + SSLKeyDerivation writeKD = + kdg.createKeyDerivation(chc, readSecret); + SecretKey readKey = writeKD.deriveKey( + "TlsKey", null); + SecretKey readIvSecret = writeKD.deriveKey( + "TlsIv", null); + IvParameterSpec readIv = + new IvParameterSpec(readIvSecret.getEncoded()); + SSLReadCipher readCipher = + chc.negotiatedCipherSuite.bulkCipher.createReadCipher( + Authenticator.valueOf(chc.negotiatedProtocol), + chc.negotiatedProtocol, readKey, readIv, + chc.sslContext.getSecureRandom()); + + chc.baseReadSecret = readSecret; + chc.conContext.inputRecord.changeReadCiphers(readCipher); + + // update the context for the following key derivation + chc.handshakeKeyDerivation = secretKD; + } catch (GeneralSecurityException gse) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failure to derive application secrets", gse); + return; // make the compiler happy + } + + // + // produce + // + chc.handshakeProducers.put(SSLHandshake.FINISHED.id, + SSLHandshake.FINISHED); + SSLHandshake[] probableHandshakeMessages = new SSLHandshake[] { + // full handshake messages + SSLHandshake.CERTIFICATE, + SSLHandshake.CERTIFICATE_VERIFY, + SSLHandshake.FINISHED + }; + + for (SSLHandshake hs : probableHandshakeMessages) { + HandshakeProducer handshakeProducer = + chc.handshakeProducers.remove(hs.id); + if (handshakeProducer != null) { + handshakeProducer.produce(chc, null); + } + } + } + + private void onConsumeFinished(ServerHandshakeContext shc, + ByteBuffer message) throws IOException { + FinishedMessage fm = new FinishedMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming client Finished handshake message", fm); + } + + if (shc.conContext.secureRenegotiation) { + shc.conContext.clientVerifyData = fm.verifyData; + } + + // + // validate + // + // blank + + // + // update + // + // Change client/server application traffic secrets. + SSLKeyDerivation kd = shc.handshakeKeyDerivation; + if (kd == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "no key derivation"); + return; // make the compiler happy + } + + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol); + if (kdg == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + shc.negotiatedProtocol); + return; // make the compiler happy + } + + // save the session + if (!shc.isResumption && shc.handshakeSession.isRejoinable()) { + SSLSessionContextImpl sessionContext = (SSLSessionContextImpl) + shc.sslContext.engineGetServerSessionContext(); + sessionContext.put(shc.handshakeSession); + } + + try { + // update the application traffic read keys. + SecretKey readSecret = kd.deriveKey( + "TlsClientAppTrafficSecret", null); + + SSLKeyDerivation readKD = + kdg.createKeyDerivation(shc, readSecret); + SecretKey readKey = readKD.deriveKey( + "TlsKey", null); + SecretKey readIvSecret = readKD.deriveKey( + "TlsIv", null); + IvParameterSpec readIv = + new IvParameterSpec(readIvSecret.getEncoded()); + SSLReadCipher readCipher = + shc.negotiatedCipherSuite.bulkCipher.createReadCipher( + Authenticator.valueOf(shc.negotiatedProtocol), + shc.negotiatedProtocol, readKey, readIv, + shc.sslContext.getSecureRandom()); + + shc.baseReadSecret = readSecret; + shc.conContext.inputRecord.changeReadCiphers(readCipher); + + // The resumption master secret is stored in the session so + // it can be used after the handshake is completed. + shc.handshakeHash.update(); + SSLSecretDerivation sd = ((SSLSecretDerivation)kd).forContext(shc); + SecretKey resumptionMasterSecret = sd.deriveKey( + "TlsResumptionMasterSecret", null); + shc.handshakeSession.setResumptionMasterSecret(resumptionMasterSecret); + } catch (GeneralSecurityException gse) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failure to derive application secrets", gse); + return; // make the compiler happy + } + + // update connection context + shc.conContext.conSession = shc.handshakeSession.finish(); + shc.conContext.protocolVersion = shc.negotiatedProtocol; + + // handshake context cleanup. + shc.handshakeFinished = true; + + // May need to retransmit the last flight for DTLS. + if (!shc.sslContext.isDTLS()) { + shc.conContext.finishHandshake(); + } + + // + // produce + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Sending new session ticket"); + } + NewSessionTicket.kickstartProducer.produce(shc); + + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeAbsence.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeAbsence.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeAbsence.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeAbsence.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,42 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Interface for handshake message or extension absence on handshake + * message processing. + * + * This is typically used after the SSLSession object created, so that the + * extension can update/impact the session object. + */ +interface HandshakeAbsence { + void absent(ConnectionContext context, + HandshakeMessage message) throws IOException; +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeConsumer.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeConsumer.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeConsumer.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeConsumer.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +interface HandshakeConsumer { + // message: the handshake message to be consumed. + void consume(ConnectionContext context, + HandshakeMessage message) throws IOException; +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,557 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.AlgorithmConstraints; +import java.security.CryptoPrimitive; +import java.util.AbstractMap.SimpleImmutableEntry; +import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumMap; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Queue; +import javax.crypto.SecretKey; +import javax.net.ssl.SNIServerName; +import javax.net.ssl.SSLHandshakeException; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.SupportedGroupsExtension.NamedGroupType; +import static sun.security.ssl.SupportedGroupsExtension.NamedGroupType.*; +import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; +import sun.security.ssl.PskKeyExchangeModesExtension.PskKeyExchangeMode; + +abstract class HandshakeContext implements ConnectionContext { + // System properties + + // By default, disable the unsafe legacy session renegotiation. + static final boolean allowUnsafeRenegotiation = + Utilities.getBooleanProperty( + "sun.security.ssl.allowUnsafeRenegotiation", false); + + // For maximum interoperability and backward compatibility, RFC 5746 + // allows server (or client) to accept ClientHello (or ServerHello) + // message without the secure renegotiation_info extension or SCSV. + // + // For maximum security, RFC 5746 also allows server (or client) to + // reject such message with a fatal "handshake_failure" alert. + // + // By default, allow such legacy hello messages. + static final boolean allowLegacyHelloMessages = + Utilities.getBooleanProperty( + "sun.security.ssl.allowLegacyHelloMessages", true); + + // registered handshake message actors + LinkedHashMap<Byte, SSLConsumer> handshakeConsumers; + final HashMap<Byte, HandshakeProducer> handshakeProducers; + + // context + final SSLContextImpl sslContext; + final TransportContext conContext; + final SSLConfiguration sslConfig; + + // consolidated parameters + final List<ProtocolVersion> activeProtocols; + final List<CipherSuite> activeCipherSuites; + final AlgorithmConstraints algorithmConstraints; + final ProtocolVersion maximumActiveProtocol; + + // output stream + final HandshakeOutStream handshakeOutput; + + // handshake transcript hash + final HandshakeHash handshakeHash; + + // negotiated security parameters + SSLSessionImpl handshakeSession; + boolean handshakeFinished; + // boolean isInvalidated; + + boolean kickstartMessageDelivered; + + // Resumption + boolean isResumption; + SSLSessionImpl resumingSession; + + final Queue<Map.Entry<Byte, ByteBuffer>> delegatedActions; + volatile boolean taskDelegated = false; + volatile Exception delegatedThrown = null; + + ProtocolVersion negotiatedProtocol; + CipherSuite negotiatedCipherSuite; + final List<SSLPossession> handshakePossessions; + final List<SSLCredentials> handshakeCredentials; + SSLKeyDerivation handshakeKeyDerivation; + SSLKeyExchange handshakeKeyExchange; + SecretKey baseReadSecret; + SecretKey baseWriteSecret; + + // protocol version being established + int clientHelloVersion; + String applicationProtocol; + + RandomCookie clientHelloRandom; + RandomCookie serverHelloRandom; + byte[] certRequestContext; + + //////////////////// + // Extensions + + // the extensions used in the handshake + final Map<SSLExtension, SSLExtension.SSLExtensionSpec> + handshakeExtensions; + + // MaxFragmentLength + int maxFragmentLength; + + // SignatureScheme + List<SignatureScheme> localSupportedSignAlgs; + List<SignatureScheme> peerRequestedSignatureSchemes; + List<SignatureScheme> peerRequestedCertSignSchemes; + + // SupportedGroups + List<NamedGroup> clientRequestedNamedGroups; + + // HelloRetryRequest + NamedGroup serverSelectedNamedGroup; + + // if server name indicator is negotiated + // + // May need a public API for the indication in the future. + List<SNIServerName> requestedServerNames; + SNIServerName negotiatedServerName; + + // OCSP Stapling info + boolean staplingActive = false; + + protected HandshakeContext(SSLContextImpl sslContext, + TransportContext conContext) throws IOException { + this.sslContext = sslContext; + this.conContext = conContext; + this.sslConfig = (SSLConfiguration)conContext.sslConfig.clone(); + + this.activeProtocols = getActiveProtocols(sslConfig.enabledProtocols, + sslConfig.enabledCipherSuites, sslConfig.algorithmConstraints); + if (activeProtocols.isEmpty()) { + throw new SSLHandshakeException( + "No appropriate protocol (protocol is disabled or " + + "cipher suites are inappropriate)"); + } + + ProtocolVersion maximumVersion = ProtocolVersion.NONE; + for (ProtocolVersion pv : this.activeProtocols) { + if (maximumVersion == ProtocolVersion.NONE || + pv.compare(maximumVersion) > 0) { + maximumVersion = pv; + } + } + this.maximumActiveProtocol = maximumVersion; + this.activeCipherSuites = getActiveCipherSuites(this.activeProtocols, + sslConfig.enabledCipherSuites, sslConfig.algorithmConstraints); + if (activeCipherSuites.isEmpty()) { + throw new SSLHandshakeException("No appropriate cipher suite"); + } + this.algorithmConstraints = + new SSLAlgorithmConstraints(sslConfig.algorithmConstraints); + + this.handshakeConsumers = new LinkedHashMap<>(); + this.handshakeProducers = new HashMap<>(); + this.handshakeHash = conContext.inputRecord.handshakeHash; + this.handshakeOutput = new HandshakeOutStream(conContext.outputRecord); + + this.handshakeFinished = false; + this.kickstartMessageDelivered = false; + + this.delegatedActions = new LinkedList<>(); + this.handshakeExtensions = new HashMap<>(); + this.handshakePossessions = new LinkedList<>(); + this.handshakeCredentials = new LinkedList<>(); + this.requestedServerNames = null; + this.negotiatedServerName = null; + this.negotiatedCipherSuite = conContext.cipherSuite; + initialize(); + } + + /** + * Constructor for PostHandshakeContext + */ + HandshakeContext(TransportContext conContext) { + this.sslContext = conContext.sslContext; + this.conContext = conContext; + this.sslConfig = conContext.sslConfig; + + this.negotiatedProtocol = conContext.protocolVersion; + this.negotiatedCipherSuite = conContext.cipherSuite; + this.handshakeOutput = new HandshakeOutStream(conContext.outputRecord); + this.delegatedActions = new LinkedList<>(); + + this.handshakeProducers = null; + this.handshakeHash = null; + this.activeProtocols = null; + this.activeCipherSuites = null; + this.algorithmConstraints = null; + this.maximumActiveProtocol = null; + this.handshakeExtensions = Collections.emptyMap(); // Not in TLS13 + this.handshakePossessions = null; + this.handshakeCredentials = null; + } + + // Initialize the non-final class variables. + private void initialize() { + ProtocolVersion inputHelloVersion; + ProtocolVersion outputHelloVersion; + if (conContext.isNegotiated) { + inputHelloVersion = conContext.protocolVersion; + outputHelloVersion = conContext.protocolVersion; + } else { + if (activeProtocols.contains(ProtocolVersion.SSL20Hello)) { + inputHelloVersion = ProtocolVersion.SSL20Hello; + + // Per TLS 1.3 protocol, implementation MUST NOT send an SSL + // version 2.0 compatible CLIENT-HELLO. + if (maximumActiveProtocol.useTLS13PlusSpec()) { + outputHelloVersion = maximumActiveProtocol; + } else { + outputHelloVersion = ProtocolVersion.SSL20Hello; + } + } else { + inputHelloVersion = maximumActiveProtocol; + outputHelloVersion = maximumActiveProtocol; + } + } + + conContext.inputRecord.setHelloVersion(inputHelloVersion); + conContext.outputRecord.setHelloVersion(outputHelloVersion); + + if (!conContext.isNegotiated) { + conContext.protocolVersion = maximumActiveProtocol; + } + conContext.outputRecord.setVersion(conContext.protocolVersion); + } + + private static List<ProtocolVersion> getActiveProtocols( + List<ProtocolVersion> enabledProtocols, + List<CipherSuite> enabledCipherSuites, + AlgorithmConstraints algorithmConstraints) { + boolean enabledSSL20Hello = false; + ArrayList<ProtocolVersion> protocols = new ArrayList<>(4); + for (ProtocolVersion protocol : enabledProtocols) { + if (!enabledSSL20Hello && protocol == ProtocolVersion.SSL20Hello) { + enabledSSL20Hello = true; + continue; + } + + if (!algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + protocol.name, null)) { + // Ignore disabled protocol. + continue; + } + + boolean found = false; + Map<NamedGroupType, Boolean> cachedStatus = + new EnumMap<>(NamedGroupType.class); + for (CipherSuite suite : enabledCipherSuites) { + if (suite.isAvailable() && suite.supports(protocol)) { + if (isActivatable(suite, + algorithmConstraints, cachedStatus)) { + protocols.add(protocol); + found = true; + break; + } + } else if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "Ignore unsupported cipher suite: " + suite + + " for " + protocol); + } + } + + if (!found && (SSLLogger.isOn) && SSLLogger.isOn("handshake")) { + SSLLogger.fine( + "No available cipher suite for " + protocol); + } + } + + if (!protocols.isEmpty()) { + if (enabledSSL20Hello) { + protocols.add(ProtocolVersion.SSL20Hello); + } + Collections.sort(protocols); + } + + return Collections.unmodifiableList(protocols); + } + + private static List<CipherSuite> getActiveCipherSuites( + List<ProtocolVersion> enabledProtocols, + List<CipherSuite> enabledCipherSuites, + AlgorithmConstraints algorithmConstraints) { + + List<CipherSuite> suites = new LinkedList<>(); + if (enabledProtocols != null && !enabledProtocols.isEmpty()) { + Map<NamedGroupType, Boolean> cachedStatus = + new EnumMap<>(NamedGroupType.class); + for (CipherSuite suite : enabledCipherSuites) { + if (!suite.isAvailable()) { + continue; + } + + boolean isSupported = false; + for (ProtocolVersion protocol : enabledProtocols) { + if (!suite.supports(protocol)) { + continue; + } + if (isActivatable(suite, + algorithmConstraints, cachedStatus)) { + suites.add(suite); + isSupported = true; + break; + } + } + + if (!isSupported && + SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.finest( + "Ignore unsupported cipher suite: " + suite); + } + } + } + + return Collections.unmodifiableList(suites); + } + + /** + * Parse the handshake record and return the contentType + */ + static byte getHandshakeType(TransportContext conContext, + Plaintext plaintext) throws IOException { + // struct { + // HandshakeType msg_type; /* handshake type */ + // uint24 length; /* bytes in message */ + // select (HandshakeType) { + // ... + // } body; + // } Handshake; + + if (plaintext.contentType != ContentType.HANDSHAKE.id) { + conContext.fatal(Alert.INTERNAL_ERROR, + "Unexpected operation for record: " + plaintext.contentType); + + return 0; + } + + if (plaintext.fragment == null || plaintext.fragment.remaining() < 4) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid handshake message: insufficient data"); + + return 0; + } + + byte handshakeType = (byte)Record.getInt8(plaintext.fragment); + int handshakeLen = Record.getInt24(plaintext.fragment); + if (handshakeLen != plaintext.fragment.remaining()) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid handshake message: insufficient handshake body"); + + return 0; + } + + return handshakeType; + } + + void dispatch(byte handshakeType, Plaintext plaintext) throws IOException { + if (conContext.transport.useDelegatedTask()) { + boolean hasDelegated = !delegatedActions.isEmpty(); + if (hasDelegated || + (handshakeType != SSLHandshake.FINISHED.id && + handshakeType != SSLHandshake.KEY_UPDATE.id && + handshakeType != SSLHandshake.NEW_SESSION_TICKET.id)) { + if (!hasDelegated) { + taskDelegated = false; + delegatedThrown = null; + } + + // Clone the fragment for delegated actions. + // + // The plaintext may share the application buffers. It is + // fine to use shared buffers if no delegated actions. + // However, for delegated actions, the shared buffers may be + // polluted in application layer before the delegated actions + // executed. + ByteBuffer fragment = ByteBuffer.wrap( + new byte[plaintext.fragment.remaining()]); + fragment.put(plaintext.fragment); + fragment = fragment.rewind(); + + delegatedActions.add(new SimpleImmutableEntry<>( + handshakeType, + fragment + )); + } else { + dispatch(handshakeType, plaintext.fragment); + } + } else { + dispatch(handshakeType, plaintext.fragment); + } + } + + void dispatch(byte handshakeType, + ByteBuffer fragment) throws IOException { + SSLConsumer consumer; + if (handshakeType == SSLHandshake.HELLO_REQUEST.id) { + // For TLS 1.2 and prior versions, the HelloRequest message MAY + // be sent by the server at any time. + consumer = SSLHandshake.HELLO_REQUEST; + } else { + consumer = handshakeConsumers.get(handshakeType); + } + + if (consumer == null) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected handshake message: " + + SSLHandshake.nameOf(handshakeType)); + return; + } + + try { + consumer.consume(this, fragment); + } catch (UnsupportedOperationException unsoe) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported handshake message: " + + SSLHandshake.nameOf(handshakeType), unsoe); + } + + // update handshake hash after handshake message consumption. + handshakeHash.consume(); + } + + abstract void kickstart() throws IOException; + + /** + * Check if the given cipher suite is enabled and available within + * the current active cipher suites. + * + * Does not check if the required server certificates are available. + */ + boolean isNegotiable(CipherSuite cs) { + return isNegotiable(activeCipherSuites, cs); + } + + /** + * Check if the given cipher suite is enabled and available within + * the proposed cipher suite list. + * + * Does not check if the required server certificates are available. + */ + static final boolean isNegotiable( + List<CipherSuite> proposed, CipherSuite cs) { + return proposed.contains(cs) && cs.isNegotiable(); + } + + /** + * Check if the given cipher suite is enabled and available within + * the proposed cipher suite list and specific protocol version. + * + * Does not check if the required server certificates are available. + */ + static final boolean isNegotiable(List<CipherSuite> proposed, + ProtocolVersion protocolVersion, CipherSuite cs) { + return proposed.contains(cs) && + cs.isNegotiable() && cs.supports(protocolVersion); + } + + /** + * Check if the given protocol version is enabled and available. + */ + boolean isNegotiable(ProtocolVersion protocolVersion) { + return activeProtocols.contains(protocolVersion); + } + + /** + * Set the active protocol version and propagate it to the SSLSocket + * and our handshake streams. Called from ClientHandshaker + * and ServerHandshaker with the negotiated protocol version. + */ + void setVersion(ProtocolVersion protocolVersion) { + this.conContext.protocolVersion = protocolVersion; + } + + private static boolean isActivatable(CipherSuite suite, + AlgorithmConstraints algorithmConstraints, + Map<NamedGroupType, Boolean> cachedStatus) { + + if (algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), suite.name, null)) { + if (suite.keyExchange == null) { + // TLS 1.3, no definition of key exchange in cipher suite. + return true; + } + + boolean available; + NamedGroupType groupType = suite.keyExchange.groupType; + if (groupType != NAMED_GROUP_NONE) { + Boolean checkedStatus = cachedStatus.get(groupType); + if (checkedStatus == null) { + available = SupportedGroups.isActivatable( + algorithmConstraints, groupType); + cachedStatus.put(groupType, available); + + if (!available && + SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("No activated named group"); + } + } else { + available = checkedStatus; + } + + if (!available && SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine( + "No active named group, ignore " + suite); + } + return available; + } else { + return true; + } + } else if (SSLLogger.isOn && SSLLogger.isOn("verbose")) { + SSLLogger.fine("Ignore disabled cipher suite: " + suite); + } + + return false; + } + + List<SNIServerName> getRequestedServerNames() { + if (requestedServerNames == null) { + return Collections.<SNIServerName>emptyList(); + } + return requestedServerNames; + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeHash.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,514 +23,623 @@ * questions. */ - package sun.security.ssl; import java.io.ByteArrayOutputStream; -import java.security.*; -import java.util.Locale; +import java.io.IOException; import java.nio.ByteBuffer; +import java.security.MessageDigest; +import java.util.Arrays; +import java.util.LinkedList; +import javax.crypto.SecretKey; +import sun.security.util.MessageDigestSpi2; -/** - * Abstraction for the SSL/TLS hash of all handshake messages that is - * maintained to verify the integrity of the negotiation. Internally, - * it consists of an MD5 and an SHA1 digest. They are used in the client - * and server finished messages and in certificate verify messages (if sent). - * - * This class transparently deals with cloneable and non-cloneable digests. - * - * This class now supports TLS 1.2 also. The key difference for TLS 1.2 - * is that you cannot determine the hash algorithms for CertificateVerify - * at a early stage. On the other hand, it's simpler than TLS 1.1 (and earlier) - * that there is no messy MD5+SHA1 digests. - * - * You need to obey these conventions when using this class: - * - * 1. protocolDetermined(version) should be called when the negotiated - * protocol version is determined. - * - * 2. Before protocolDetermined() is called, only update(), and reset() - * and setFinishedAlg() can be called. - * - * 3. After protocolDetermined() is called, reset() cannot be called. - * - * 4. After protocolDetermined() is called, if the version is pre-TLS 1.2, - * getFinishedHash() cannot be called. Otherwise, - * getMD5Clone() and getSHAClone() cannot be called. - * - * 5. getMD5Clone() and getSHAClone() can only be called after - * protocolDetermined() is called and version is pre-TLS 1.2. - * - * 6. getFinishedHash() can only be called after protocolDetermined() - * and setFinishedAlg() have been called and the version is TLS 1.2. - * - * Suggestion: Call protocolDetermined() and setFinishedAlg() - * as early as possible. - * - * Example: - * <pre> - * HandshakeHash hh = new HandshakeHash(...) - * hh.protocolDetermined(ProtocolVersion.TLS12); - * hh.update(clientHelloBytes); - * hh.setFinishedAlg("SHA-256"); - * hh.update(serverHelloBytes); - * ... - * hh.update(CertificateVerifyBytes); - * ... - * hh.update(finished1); - * byte[] finDigest1 = hh.getFinishedHash(); - * hh.update(finished2); - * byte[] finDigest2 = hh.getFinishedHash(); - * </pre> - */ final class HandshakeHash { + private TranscriptHash transcriptHash; + private LinkedList<byte[]> reserves; // one handshake message per entry + private boolean hasBeenUsed; + + HandshakeHash() { + this.transcriptHash = new CacheOnlyHash(); + this.reserves = new LinkedList<>(); + this.hasBeenUsed = false; + } + + // fix the negotiated protocol version and cipher suite + void determine(ProtocolVersion protocolVersion, + CipherSuite cipherSuite) { + if (!(transcriptHash instanceof CacheOnlyHash)) { + throw new IllegalStateException( + "Not expected instance of transcript hash"); + } + + CacheOnlyHash coh = (CacheOnlyHash)transcriptHash; + if (protocolVersion.useTLS13PlusSpec()) { + transcriptHash = new T13HandshakeHash(cipherSuite); + } else if (protocolVersion.useTLS12PlusSpec()) { + transcriptHash = new T12HandshakeHash(cipherSuite); + } else if (protocolVersion.useTLS10PlusSpec()) { + transcriptHash = new T10HandshakeHash(cipherSuite); + } else { + transcriptHash = new S30HandshakeHash(cipherSuite); + } + + byte[] reserved = coh.baos.toByteArray(); + if (reserved.length != 0) { + transcriptHash.update(reserved, 0, reserved.length); + } + } + + HandshakeHash copy() { + if (transcriptHash instanceof CacheOnlyHash) { + HandshakeHash result = new HandshakeHash(); + result.transcriptHash = ((CacheOnlyHash)transcriptHash).copy(); + result.reserves = new LinkedList<>(reserves); + result.hasBeenUsed = hasBeenUsed; + return result; + } else { + throw new IllegalStateException("Hash does not support copying"); + } + } + + void receive(byte[] input) { + reserves.add(Arrays.copyOf(input, input.length)); + } - // Common + void receive(ByteBuffer input, int length) { + if (input.hasArray()) { + int from = input.position() + input.arrayOffset(); + int to = from + length; + reserves.add(Arrays.copyOfRange(input.array(), from, to)); + } else { + int inPos = input.position(); + byte[] holder = new byte[length]; + input.get(holder); + input.position(inPos); + reserves.add(Arrays.copyOf(holder, holder.length)); + } + } + void receive(ByteBuffer input) { + receive(input, input.remaining()); + } - // -1: unknown - // 1: <=TLS 1.1 - // 2: TLS 1.2 - private int version = -1; - private ByteArrayOutputStream data = new ByteArrayOutputStream(); - - // For TLS 1.1 - private MessageDigest md5, sha; - private final int clonesNeeded; // needs to be saved for later use - - // For TLS 1.2 - private MessageDigest finMD; - - // Cache for input record handshake hash computation - private ByteArrayOutputStream reserve = new ByteArrayOutputStream(); - - /** - * Create a new HandshakeHash. needCertificateVerify indicates whether - * a hash for the certificate verify message is required. - */ - HandshakeHash(boolean needCertificateVerify) { - // We may rework the code later, but for now we use hard-coded number - // of clones if the underlying MessageDigests are not cloneable. - // - // The number used here is based on the current handshake protocols and - // implementation. It may be changed if the handshake processe gets - // changed in the future, for example adding a new extension that - // requires handshake hash. Please be careful about the number of - // clones if additional handshak hash is required in the future. - // - // For the current implementation, the handshake hash is required for - // the following items: - // . CertificateVerify handshake message (optional) - // . client Finished handshake message - // . server Finished Handshake message - // . the extended Master Secret extension [RFC 7627] - // - // Note that a late call to server setNeedClientAuth dose not update - // the number of clones. We may address the issue later. - // - // Note for safety, we allocate one more clone for the current - // implementation. We may consider it more carefully in the future - // for the exact number or rework the code in a different way. - clonesNeeded = needCertificateVerify ? 5 : 4; + // For HelloRetryRequest only! Please use this method very carefully! + void push(byte[] input) { + reserves.push(Arrays.copyOf(input, input.length)); } - void reserve(ByteBuffer input) { + // For PreSharedKey to modify the state of the PSK binder hash + byte[] removeLastReceived() { + return reserves.removeLast(); + } + + void deliver(byte[] input) { + update(); + transcriptHash.update(input, 0, input.length); + } + + void deliver(byte[] input, int offset, int length) { + update(); + transcriptHash.update(input, offset, length); + } + + void deliver(ByteBuffer input) { + update(); if (input.hasArray()) { - reserve.write(input.array(), + transcriptHash.update(input.array(), input.position() + input.arrayOffset(), input.remaining()); } else { int inPos = input.position(); byte[] holder = new byte[input.remaining()]; input.get(holder); input.position(inPos); - reserve.write(holder, 0, holder.length); + transcriptHash.update(holder, 0, holder.length); } } - void reserve(byte[] b, int offset, int len) { - reserve.write(b, offset, len); + // Use one handshake message if it has not been used. + void utilize() { + if (hasBeenUsed) { + return; + } + if (reserves.size() != 0) { + byte[] holder = reserves.remove(); + transcriptHash.update(holder, 0, holder.length); + hasBeenUsed = true; + } } - void reload() { - if (reserve.size() != 0) { - byte[] bytes = reserve.toByteArray(); - reserve.reset(); - update(bytes, 0, bytes.length); + // Consume one handshake message if it has not been consumed. + void consume() { + if (hasBeenUsed) { + hasBeenUsed = false; + return; + } + if (reserves.size() != 0) { + byte[] holder = reserves.remove(); + transcriptHash.update(holder, 0, holder.length); } } - void update(ByteBuffer input) { + void update() { + while (reserves.size() != 0) { + byte[] holder = reserves.remove(); + transcriptHash.update(holder, 0, holder.length); + } + hasBeenUsed = false; + } - // reload if there are reserved messages. - reload(); + byte[] digest() { + // Note that the reserve handshake message may be not a part of + // the expected digest. + return transcriptHash.digest(); + } - int inPos = input.position(); - switch (version) { - case 1: - md5.update(input); - input.position(inPos); + void finish() { + this.transcriptHash = new CacheOnlyHash(); + this.reserves = new LinkedList<>(); + this.hasBeenUsed = false; + } - sha.update(input); - input.position(inPos); + // Optional + byte[] archived() { + // Note that the reserve handshake message may be not a part of + // the expected digest. + return transcriptHash.archived(); + } - break; - default: - if (finMD != null) { - finMD.update(input); - input.position(inPos); - } - if (input.hasArray()) { - data.write(input.array(), - inPos + input.arrayOffset(), input.remaining()); - } else { - byte[] holder = new byte[input.remaining()]; - input.get(holder); - input.position(inPos); - data.write(holder, 0, holder.length); - } - break; - } + // Optional, TLS 1.0/1.1 only + byte[] digest(String algorithm) { + T10HandshakeHash hh = (T10HandshakeHash)transcriptHash; + return hh.digest(algorithm); } - void update(byte handshakeType, byte[] handshakeBody) { + // Optional, SSL 3.0 only + byte[] digest(String algorithm, SecretKey masterSecret) { + S30HandshakeHash hh = (S30HandshakeHash)transcriptHash; + return hh.digest(algorithm, masterSecret); + } - // reload if there are reserved messages. - reload(); + // Optional, SSL 3.0 only + byte[] digest(boolean useClientLabel, SecretKey masterSecret) { + S30HandshakeHash hh = (S30HandshakeHash)transcriptHash; + return hh.digest(useClientLabel, masterSecret); + } - switch (version) { - case 1: - md5.update(handshakeType); - sha.update(handshakeType); - - md5.update((byte)((handshakeBody.length >> 16) & 0xFF)); - sha.update((byte)((handshakeBody.length >> 16) & 0xFF)); - md5.update((byte)((handshakeBody.length >> 8) & 0xFF)); - sha.update((byte)((handshakeBody.length >> 8) & 0xFF)); - md5.update((byte)(handshakeBody.length & 0xFF)); - sha.update((byte)(handshakeBody.length & 0xFF)); - - md5.update(handshakeBody); - sha.update(handshakeBody); - break; - default: - if (finMD != null) { - finMD.update(handshakeType); - finMD.update((byte)((handshakeBody.length >> 16) & 0xFF)); - finMD.update((byte)((handshakeBody.length >> 8) & 0xFF)); - finMD.update((byte)(handshakeBody.length & 0xFF)); - finMD.update(handshakeBody); - } - data.write(handshakeType); - data.write((byte)((handshakeBody.length >> 16) & 0xFF)); - data.write((byte)((handshakeBody.length >> 8) & 0xFF)); - data.write((byte)(handshakeBody.length & 0xFF)); - data.write(handshakeBody, 0, handshakeBody.length); - break; - } + public boolean isHashable(byte handshakeType) { + return handshakeType != SSLHandshake.HELLO_REQUEST.id && + handshakeType != SSLHandshake.HELLO_VERIFY_REQUEST.id; } - void update(byte[] b, int offset, int len) { - - // reload if there are reserved messages. - reload(); - - switch (version) { - case 1: - md5.update(b, offset, len); - sha.update(b, offset, len); - break; - default: - if (finMD != null) { - finMD.update(b, offset, len); - } - data.write(b, offset, len); - break; - } + interface TranscriptHash { + void update(byte[] input, int offset, int length); + byte[] digest(); + byte[] archived(); // optional } - /** - * Reset the remaining digests. Note this does *not* reset the number of - * digest clones that can be obtained. Digests that have already been - * cloned and are gone remain gone. - */ - void reset() { - if (version != -1) { - throw new RuntimeException( - "reset() can be only be called before protocolDetermined"); + // For cache only. + private static final class CacheOnlyHash implements TranscriptHash { + private final ByteArrayOutputStream baos; + + CacheOnlyHash() { + this.baos = new ByteArrayOutputStream(); + } + + @Override + public void update(byte[] input, int offset, int length) { + baos.write(input, offset, length); + } + + @Override + public byte[] digest() { + throw new IllegalStateException( + "Not expected call to handshake hash digest"); + } + + @Override + public byte[] archived() { + return baos.toByteArray(); + } + + CacheOnlyHash copy() { + CacheOnlyHash result = new CacheOnlyHash(); + try { + baos.writeTo(result.baos); + } catch (IOException ex) { + throw new RuntimeException("unable to to clone hash state"); + } + return result; } - data.reset(); } + static final class S30HandshakeHash implements TranscriptHash { + static final byte[] MD5_pad1 = genPad(0x36, 48); + static final byte[] MD5_pad2 = genPad(0x5c, 48); - void protocolDetermined(ProtocolVersion pv) { + static final byte[] SHA_pad1 = genPad(0x36, 40); + static final byte[] SHA_pad2 = genPad(0x5c, 40); - // Do not set again, will ignore - if (version != -1) { - return; + private static final byte[] SSL_CLIENT = { 0x43, 0x4C, 0x4E, 0x54 }; + private static final byte[] SSL_SERVER = { 0x53, 0x52, 0x56, 0x52 }; + + private final MessageDigest mdMD5; + private final MessageDigest mdSHA; + private final TranscriptHash md5; + private final TranscriptHash sha; + private final ByteArrayOutputStream baos; + + S30HandshakeHash(CipherSuite cipherSuite) { + this.mdMD5 = JsseJce.getMessageDigest("MD5"); + this.mdSHA = JsseJce.getMessageDigest("SHA"); + + boolean hasArchived = false; + if (mdMD5 instanceof Cloneable) { + md5 = new CloneableHash(mdMD5); + } else { + hasArchived = true; + md5 = new NonCloneableHash(mdMD5); + } + if (mdSHA instanceof Cloneable) { + sha = new CloneableHash(mdSHA); + } else { + hasArchived = true; + sha = new NonCloneableHash(mdSHA); + } + + if (hasArchived) { + this.baos = null; + } else { + this.baos = new ByteArrayOutputStream(); + } } - if (pv.maybeDTLSProtocol()) { - version = pv.compareTo(ProtocolVersion.DTLS12) >= 0 ? 2 : 1; - } else { - version = pv.compareTo(ProtocolVersion.TLS12) >= 0 ? 2 : 1; + @Override + public void update(byte[] input, int offset, int length) { + md5.update(input, offset, length); + sha.update(input, offset, length); + if (baos != null) { + baos.write(input, offset, length); + } } - switch (version) { - case 1: - // initiate md5, sha and call update on saved array + + @Override + public byte[] digest() { + byte[] digest = new byte[36]; + System.arraycopy(md5.digest(), 0, digest, 0, 16); + System.arraycopy(sha.digest(), 0, digest, 16, 20); + + return digest; + } + + @Override + public byte[] archived() { + if (baos != null) { + return baos.toByteArray(); + } else if (md5 instanceof NonCloneableHash) { + return md5.archived(); + } else { + return sha.archived(); + } + } + + byte[] digest(boolean useClientLabel, SecretKey masterSecret) { + MessageDigest md5Clone = cloneMd5(); + MessageDigest shaClone = cloneSha(); + + if (useClientLabel) { + md5Clone.update(SSL_CLIENT); + shaClone.update(SSL_CLIENT); + } else { + md5Clone.update(SSL_SERVER); + shaClone.update(SSL_SERVER); + } + + updateDigest(md5Clone, MD5_pad1, MD5_pad2, masterSecret); + updateDigest(shaClone, SHA_pad1, SHA_pad2, masterSecret); + + byte[] digest = new byte[36]; + System.arraycopy(md5Clone.digest(), 0, digest, 0, 16); + System.arraycopy(shaClone.digest(), 0, digest, 16, 20); + + return digest; + } + + byte[] digest(String algorithm, SecretKey masterSecret) { + if ("RSA".equalsIgnoreCase(algorithm)) { + MessageDigest md5Clone = cloneMd5(); + MessageDigest shaClone = cloneSha(); + updateDigest(md5Clone, MD5_pad1, MD5_pad2, masterSecret); + updateDigest(shaClone, SHA_pad1, SHA_pad2, masterSecret); + + byte[] digest = new byte[36]; + System.arraycopy(md5Clone.digest(), 0, digest, 0, 16); + System.arraycopy(shaClone.digest(), 0, digest, 16, 20); + + return digest; + } else { + MessageDigest shaClone = cloneSha(); + updateDigest(shaClone, SHA_pad1, SHA_pad2, masterSecret); + return shaClone.digest(); + } + } + + private static byte[] genPad(int b, int count) { + byte[] padding = new byte[count]; + Arrays.fill(padding, (byte)b); + return padding; + } + + private MessageDigest cloneMd5() { + MessageDigest md5Clone; + if (mdMD5 instanceof Cloneable) { try { - md5 = CloneableDigest.getDigest("MD5", clonesNeeded); - sha = CloneableDigest.getDigest("SHA", clonesNeeded); - } catch (NoSuchAlgorithmException e) { - throw new RuntimeException - ("Algorithm MD5 or SHA not available", e); + md5Clone = (MessageDigest)mdMD5.clone(); + } catch (CloneNotSupportedException ex) { // unlikely + throw new RuntimeException( + "MessageDigest does no support clone operation"); } - byte[] bytes = data.toByteArray(); - update(bytes, 0, bytes.length); - break; - case 2: - break; + } else { + md5Clone = JsseJce.getMessageDigest("MD5"); + md5Clone.update(md5.archived()); + } + + return md5Clone; } - } - ///////////////////////////////////////////////////////////// - // Below are old methods for pre-TLS 1.1 - ///////////////////////////////////////////////////////////// + private MessageDigest cloneSha() { + MessageDigest shaClone; + if (mdSHA instanceof Cloneable) { + try { + shaClone = (MessageDigest)mdSHA.clone(); + } catch (CloneNotSupportedException ex) { // unlikely + throw new RuntimeException( + "MessageDigest does no support clone operation"); + } + } else { + shaClone = JsseJce.getMessageDigest("SHA"); + shaClone.update(sha.archived()); + } - /** - * Return a new MD5 digest updated with all data hashed so far. - */ - MessageDigest getMD5Clone() { - if (version != 1) { - throw new RuntimeException( - "getMD5Clone() can be only be called for TLS 1.1"); + return shaClone; } - return cloneDigest(md5); - } - /** - * Return a new SHA digest updated with all data hashed so far. - */ - MessageDigest getSHAClone() { - if (version != 1) { - throw new RuntimeException( - "getSHAClone() can be only be called for TLS 1.1"); + private static void updateDigest(MessageDigest md, + byte[] pad1, byte[] pad2, SecretKey masterSecret) { + byte[] keyBytes = "RAW".equals(masterSecret.getFormat()) + ? masterSecret.getEncoded() : null; + if (keyBytes != null) { + md.update(keyBytes); + } else { + digestKey(md, masterSecret); + } + md.update(pad1); + byte[] temp = md.digest(); + + if (keyBytes != null) { + md.update(keyBytes); + } else { + digestKey(md, masterSecret); + } + md.update(pad2); + md.update(temp); } - return cloneDigest(sha); - } - private static MessageDigest cloneDigest(MessageDigest digest) { - try { - return (MessageDigest)digest.clone(); - } catch (CloneNotSupportedException e) { - // cannot occur for digests generated via CloneableDigest - throw new RuntimeException("Could not clone digest", e); + private static void digestKey(MessageDigest md, SecretKey key) { + try { + if (md instanceof MessageDigestSpi2) { + ((MessageDigestSpi2)md).engineUpdate(key); + } else { + throw new Exception( + "Digest does not support implUpdate(SecretKey)"); + } + } catch (Exception e) { + throw new RuntimeException( + "Could not obtain encoded key and " + + "MessageDigest cannot digest key", e); + } } } - ///////////////////////////////////////////////////////////// - // Below are new methods for TLS 1.2 - ///////////////////////////////////////////////////////////// - - private static String normalizeAlgName(String alg) { - alg = alg.toUpperCase(Locale.US); - if (alg.startsWith("SHA")) { - if (alg.length() == 3) { - return "SHA-1"; + // TLS 1.0 and TLS 1.1 + static final class T10HandshakeHash implements TranscriptHash { + private final TranscriptHash md5; + private final TranscriptHash sha; + private final ByteArrayOutputStream baos; + + T10HandshakeHash(CipherSuite cipherSuite) { + MessageDigest mdMD5 = JsseJce.getMessageDigest("MD5"); + MessageDigest mdSHA = JsseJce.getMessageDigest("SHA"); + + boolean hasArchived = false; + if (mdMD5 instanceof Cloneable) { + md5 = new CloneableHash(mdMD5); + } else { + hasArchived = true; + md5 = new NonCloneableHash(mdMD5); + } + if (mdSHA instanceof Cloneable) { + sha = new CloneableHash(mdSHA); + } else { + hasArchived = true; + sha = new NonCloneableHash(mdSHA); } - if (alg.charAt(3) != '-') { - return "SHA-" + alg.substring(3); + + if (hasArchived) { + this.baos = null; + } else { + this.baos = new ByteArrayOutputStream(); } } - return alg; - } - /** - * Specifies the hash algorithm used in Finished. This should be called - * based in info in ServerHello. - * Can be called multiple times. - */ - void setFinishedAlg(String s) { - if (s == null) { - throw new RuntimeException( - "setFinishedAlg's argument cannot be null"); + + @Override + public void update(byte[] input, int offset, int length) { + md5.update(input, offset, length); + sha.update(input, offset, length); + if (baos != null) { + baos.write(input, offset, length); + } } - // Can be called multiple times, but only set once - if (finMD != null) return; + @Override + public byte[] digest() { + byte[] digest = new byte[36]; + System.arraycopy(md5.digest(), 0, digest, 0, 16); + System.arraycopy(sha.digest(), 0, digest, 16, 20); - try { - // See comment in the contructor. - finMD = CloneableDigest.getDigest(normalizeAlgName(s), 4); - } catch (NoSuchAlgorithmException e) { - throw new Error(e); + return digest; } - finMD.update(data.toByteArray()); - } - byte[] getAllHandshakeMessages() { - return data.toByteArray(); - } + byte[] digest(String algorithm) { + if ("RSA".equalsIgnoreCase(algorithm)) { + return digest(); + } else { + return sha.digest(); + } + } - /** - * Calculates the hash in Finished. Must be called after setFinishedAlg(). - * This method can be called twice, for Finished messages of the server - * side and client side respectively. - */ - byte[] getFinishedHash() { - try { - return cloneDigest(finMD).digest(); - } catch (Exception e) { - throw new Error("Error during hash calculation", e); + @Override + public byte[] archived() { + if (baos != null) { + return baos.toByteArray(); + } else if (md5 instanceof NonCloneableHash) { + return md5.archived(); + } else { + return sha.archived(); + } } } -} -/** - * A wrapper for MessageDigests that simulates cloning of non-cloneable - * digests. It uses the standard MessageDigest API and therefore can be used - * transparently in place of a regular digest. - * - * Note that we extend the MessageDigest class directly rather than - * MessageDigestSpi. This works because MessageDigest was originally designed - * this way in the JDK 1.1 days which allows us to avoid creating an internal - * provider. - * - * It can be "cloned" a limited number of times, which is specified at - * construction time. This is achieved by internally maintaining n digests - * in parallel. Consequently, it is only 1/n-th times as fast as the original - * digest. - * - * Example: - * MessageDigest md = CloneableDigest.getDigest("SHA", 2); - * md.update(data1); - * MessageDigest md2 = (MessageDigest)md.clone(); - * md2.update(data2); - * byte[] d1 = md2.digest(); // digest of data1 || data2 - * md.update(data3); - * byte[] d2 = md.digest(); // digest of data1 || data3 - * - * This class is not thread safe. - * - */ -final class CloneableDigest extends MessageDigest implements Cloneable { + static final class T12HandshakeHash implements TranscriptHash { + private final TranscriptHash transcriptHash; + private final ByteArrayOutputStream baos; + + T12HandshakeHash(CipherSuite cipherSuite) { + MessageDigest md = + JsseJce.getMessageDigest(cipherSuite.hashAlg.name); + if (md instanceof Cloneable) { + transcriptHash = new CloneableHash(md); + this.baos = null; + } else { + transcriptHash = new NonCloneableHash(md); + this.baos = new ByteArrayOutputStream(); + } + } - /** - * The individual MessageDigests. Initially, all elements are non-null. - * When clone() is called, the non-null element with the maximum index is - * returned and the array element set to null. - * - * All non-null element are always in the same state. - */ - private final MessageDigest[] digests; - - private CloneableDigest(MessageDigest digest, int n, String algorithm) - throws NoSuchAlgorithmException { - super(algorithm); - digests = new MessageDigest[n]; - digests[0] = digest; - for (int i = 1; i < n; i++) { - digests[i] = JsseJce.getMessageDigest(algorithm); + @Override + public void update(byte[] input, int offset, int length) { + transcriptHash.update(input, offset, length); + if (baos != null) { + baos.write(input, offset, length); + } } - } - /** - * Return a MessageDigest for the given algorithm that can be cloned the - * specified number of times. If the default implementation supports - * cloning, it is returned. Otherwise, an instance of this class is - * returned. - */ - static MessageDigest getDigest(String algorithm, int n) - throws NoSuchAlgorithmException { - MessageDigest digest = JsseJce.getMessageDigest(algorithm); - try { - digest.clone(); - // already cloneable, use it - return digest; - } catch (CloneNotSupportedException e) { - return new CloneableDigest(digest, n, algorithm); + @Override + public byte[] digest() { + return transcriptHash.digest(); } - } - /** - * Check if this object is still usable. If it has already been cloned the - * maximum number of times, there are no digests left and this object can no - * longer be used. - */ - private void checkState() { - // XXX handshaking currently doesn't stop updating hashes... - // if (digests[0] == null) { - // throw new IllegalStateException("no digests left"); - // } + @Override + public byte[] archived() { + if (baos != null) { + return baos.toByteArray(); + } else { + return transcriptHash.archived(); + } + } } - @Override - protected int engineGetDigestLength() { - checkState(); - return digests[0].getDigestLength(); - } + static final class T13HandshakeHash implements TranscriptHash { + private final TranscriptHash transcriptHash; + private final ByteArrayOutputStream baos; + + T13HandshakeHash(CipherSuite cipherSuite) { + MessageDigest md = + JsseJce.getMessageDigest(cipherSuite.hashAlg.name); + if (md instanceof Cloneable) { + transcriptHash = new CloneableHash(md); + this.baos = null; + } else { + transcriptHash = new NonCloneableHash(md); + this.baos = new ByteArrayOutputStream(); + } + } - @Override - protected void engineUpdate(byte b) { - checkState(); - for (int i = 0; (i < digests.length) && (digests[i] != null); i++) { - digests[i].update(b); + @Override + public void update(byte[] input, int offset, int length) { + transcriptHash.update(input, offset, length); + if (baos != null) { + baos.write(input, offset, length); + } } - } - @Override - protected void engineUpdate(byte[] b, int offset, int len) { - checkState(); - for (int i = 0; (i < digests.length) && (digests[i] != null); i++) { - digests[i].update(b, offset, len); + @Override + public byte[] digest() { + return transcriptHash.digest(); } - } - @Override - protected byte[] engineDigest() { - checkState(); - byte[] digest = digests[0].digest(); - digestReset(); - return digest; - } + @Override + public byte[] archived() { + if (baos != null) { + return baos.toByteArray(); + } else { + return transcriptHash.archived(); + } - @Override - protected int engineDigest(byte[] buf, int offset, int len) - throws DigestException { - checkState(); - int n = digests[0].digest(buf, offset, len); - digestReset(); - return n; + // throw new UnsupportedOperationException("Not supported yet."); + } } - /** - * Reset all digests after a digest() call. digests[0] has already been - * implicitly reset by the digest() call and does not need to be reset - * again. - */ - private void digestReset() { - for (int i = 1; (i < digests.length) && (digests[i] != null); i++) { - digests[i].reset(); + static final class CloneableHash implements TranscriptHash { + private final MessageDigest md; + + CloneableHash(MessageDigest md) { + this.md = md; } - } - @Override - protected void engineReset() { - checkState(); - for (int i = 0; (i < digests.length) && (digests[i] != null); i++) { - digests[i].reset(); + @Override + public void update(byte[] input, int offset, int length) { + md.update(input, offset, length); } - } - @Override - public Object clone() { - checkState(); - for (int i = digests.length - 1; i >= 0; i--) { - if (digests[i] != null) { - MessageDigest digest = digests[i]; - digests[i] = null; - return digest; + @Override + public byte[] digest() { + try { + return ((MessageDigest)md.clone()).digest(); + } catch (CloneNotSupportedException ex) { + // unlikely + return new byte[0]; } } - // cannot occur - throw new InternalError(); + + @Override + public byte[] archived() { + throw new UnsupportedOperationException("Not supported yet."); + } } + static final class NonCloneableHash implements TranscriptHash { + private final MessageDigest md; + private final ByteArrayOutputStream baos = new ByteArrayOutputStream(); + + NonCloneableHash(MessageDigest md) { + this.md = md; + } + + @Override + public void update(byte[] input, int offset, int length) { + baos.write(input, offset, length); + } + + @Override + public byte[] digest() { + byte[] bytes = baos.toByteArray(); + md.reset(); + return md.digest(bytes); + } + + @Override + public byte[] archived() { + return baos.toByteArray(); + } + } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeInStream.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeInStream.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeInStream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeInStream.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,179 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.nio.ByteBuffer; - -import javax.net.ssl.SSLException; - -/** - * InputStream for handshake data, used internally only. Contains the - * handshake message buffer and methods to parse them. - * - * Once a new handshake record arrives, it is buffered in this class until - * processed by the Handshaker. The buffer may also contain incomplete - * handshake messages in case the message is split across multiple records. - * Handshaker.processRecord deals with all that. It may also contain - * handshake messages larger than the default buffer size (e.g. large - * certificate messages). The buffer is grown dynamically to handle that. - * - * Note that this class only handles Handshake messages in TLS format. - * DTLS Handshake messages should be converted into TLS format before - * calling into this method. - * - * @author David Brownell - */ - -// This class is used to handle plain text handshake messages. -// -public final class HandshakeInStream extends ByteArrayInputStream { - - /* - * Construct the stream; we'll be accumulating hashes of the - * input records using two sets of digests. - */ - HandshakeInStream() { - super(new byte[0]); // lazy to alloacte the internal buffer - } - - // - // overridden ByteArrayInputStream methods - // - - @Override - public int read(byte[] b) throws IOException { - if (super.read(b) != b.length) { - throw new SSLException("Unexpected end of handshake data"); - } - - return b.length; - } - - // - // handshake input stream management functions - // - - /* - * Here's an incoming record with handshake data. Queue the contents; - * it might be one or more entire messages, complete a message that's - * partly queued, or both. - */ - void incomingRecord(ByteBuffer in) throws IOException { - int len; - - // Move any unread data to the front of the buffer. - if (pos != 0) { - len = count - pos; - if (len != 0) { - System.arraycopy(buf, pos, buf, 0, len); - } - pos = 0; - count = len; - } - - // Grow buffer if needed. - len = in.remaining() + count; - if (buf.length < len) { - byte[] newbuf = new byte[len]; - if (count != 0) { - System.arraycopy(buf, 0, newbuf, 0, count); - } - buf = newbuf; - } - - // Append the incoming record to the buffer - in.get(buf, count, in.remaining()); - count = len; - } - - // - // Message parsing methods - // - - /* - * Read 8, 16, 24, and 32 bit SSL integer data types, encoded - * in standard big-endian form. - */ - int getInt8() throws IOException { - verifyLength(1); - return read(); - } - - int getInt16() throws IOException { - verifyLength(2); - return (getInt8() << 8) | getInt8(); - } - - int getInt24() throws IOException { - verifyLength(3); - return (getInt8() << 16) | (getInt8() << 8) | getInt8(); - } - - int getInt32() throws IOException { - verifyLength(4); - return (getInt8() << 24) | (getInt8() << 16) - | (getInt8() << 8) | getInt8(); - } - - /* - * Read byte vectors with 8, 16, and 24 bit length encodings. - */ - byte[] getBytes8() throws IOException { - int len = getInt8(); - verifyLength(len); - byte[] b = new byte[len]; - - read(b); - return b; - } - - public byte[] getBytes16() throws IOException { - int len = getInt16(); - verifyLength(len); - byte[] b = new byte[len]; - - read(b); - return b; - } - - byte[] getBytes24() throws IOException { - int len = getInt24(); - verifyLength(len); - byte[] b = new byte[len]; - - read(b); - return b; - } - - // Is a length greater than available bytes in the record? - private void verifyLength(int len) throws SSLException { - if (len > available()) { - throw new SSLException("Unexpected end of handshake data"); - } - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeMessage.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,2430 +0,0 @@ -/* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.*; -import java.math.BigInteger; -import java.security.*; -import java.security.interfaces.*; -import java.security.spec.*; -import java.security.cert.*; -import java.security.cert.Certificate; -import java.util.*; -import java.util.concurrent.ConcurrentHashMap; - -import java.lang.reflect.*; - -import javax.security.auth.x500.X500Principal; - -import javax.crypto.KeyGenerator; -import javax.crypto.SecretKey; -import javax.crypto.spec.DHPublicKeySpec; - -import javax.net.ssl.*; - -import sun.security.internal.spec.TlsPrfParameterSpec; -import sun.security.ssl.CipherSuite.*; -import static sun.security.ssl.CipherSuite.PRF.*; -import sun.security.util.KeyUtil; -import sun.security.util.MessageDigestSpi2; -import sun.security.provider.certpath.OCSPResponse; - -/** - * Many data structures are involved in the handshake messages. These - * classes are used as structures, with public data members. They are - * not visible outside the SSL package. - * - * Handshake messages all have a common header format, and they are all - * encoded in a "handshake data" SSL record substream. The base class - * here (HandshakeMessage) provides a common framework and records the - * SSL record type of the particular handshake message. - * - * This file contains subclasses for all the basic handshake messages. - * All handshake messages know how to encode and decode themselves on - * SSL streams; this facilitates using the same code on SSL client and - * server sides, although they don't send and receive the same messages. - * - * Messages also know how to print themselves, which is quite handy - * for debugging. They always identify their type, and can optionally - * dump all of their content. - * - * @author David Brownell - */ -public abstract class HandshakeMessage { - - /* Class and subclass dynamic debugging support */ - public static final Debug debug = Debug.getInstance("ssl"); - - // enum HandshakeType: - // - // Please update the isUnsupported() method accordingly if the handshake - // types get updated in the future. - static final byte ht_hello_request = 0; // RFC 5246 - static final byte ht_client_hello = 1; // RFC 5246 - static final byte ht_server_hello = 2; // RFC 5246 - static final byte ht_hello_verify_request = 3; // RFC 6347 - static final byte ht_new_session_ticket = 4; // RFC 4507 - - static final byte ht_certificate = 11; // RFC 5246 - static final byte ht_server_key_exchange = 12; // RFC 5246 - static final byte ht_certificate_request = 13; // RFC 5246 - static final byte ht_server_hello_done = 14; // RFC 5246 - static final byte ht_certificate_verify = 15; // RFC 5246 - static final byte ht_client_key_exchange = 16; // RFC 5246 - - static final byte ht_finished = 20; // RFC 5246 - static final byte ht_certificate_url = 21; // RFC 6066 - static final byte ht_certificate_status = 22; // RFC 6066 - static final byte ht_supplemental_data = 23; // RFC 4680 - - static final byte ht_not_applicable = -1; // N/A - - /* - * SSL 3.0 MAC padding constants. - * Also used by CertificateVerify and Finished during the handshake. - */ - static final byte[] MD5_pad1 = genPad(0x36, 48); - static final byte[] MD5_pad2 = genPad(0x5c, 48); - - static final byte[] SHA_pad1 = genPad(0x36, 40); - static final byte[] SHA_pad2 = genPad(0x5c, 40); - - // default constructor - HandshakeMessage() { - } - - /** - * Utility method to convert a BigInteger to a byte array in unsigned - * format as needed in the handshake messages. BigInteger uses - * 2's complement format, i.e. it prepends an extra zero if the MSB - * is set. We remove that. - */ - static byte[] toByteArray(BigInteger bi) { - byte[] b = bi.toByteArray(); - if ((b.length > 1) && (b[0] == 0)) { - int n = b.length - 1; - byte[] newarray = new byte[n]; - System.arraycopy(b, 1, newarray, 0, n); - b = newarray; - } - return b; - } - - static boolean isUnsupported(byte handshakeType) { - return (handshakeType != ht_hello_request) && - (handshakeType != ht_client_hello) && - (handshakeType != ht_server_hello) && - (handshakeType != ht_hello_verify_request) && - (handshakeType != ht_new_session_ticket) && - (handshakeType != ht_certificate) && - (handshakeType != ht_server_key_exchange) && - (handshakeType != ht_certificate_request) && - (handshakeType != ht_server_hello_done) && - (handshakeType != ht_certificate_verify) && - (handshakeType != ht_client_key_exchange) && - (handshakeType != ht_finished) && - (handshakeType != ht_certificate_url) && - (handshakeType != ht_certificate_status) && - (handshakeType != ht_supplemental_data); - } - - private static byte[] genPad(int b, int count) { - byte[] padding = new byte[count]; - Arrays.fill(padding, (byte)b); - return padding; - } - - /* - * Write a handshake message on the (handshake) output stream. - * This is just a four byte header followed by the data. - * - * NOTE that huge messages -- notably, ones with huge cert - * chains -- are handled correctly. - */ - final void write(HandshakeOutStream s) throws IOException { - int len = messageLength(); - if (len >= Record.OVERFLOW_OF_INT24) { - throw new SSLException("Handshake message too big" - + ", type = " + messageType() + ", len = " + len); - } - s.write(messageType()); - s.putInt24(len); - send(s); - s.complete(); - } - - /* - * Subclasses implement these methods so those kinds of - * messages can be emitted. Base class delegates to subclass. - */ - abstract int messageType(); - abstract int messageLength(); - abstract void send(HandshakeOutStream s) throws IOException; - - /* - * Write a descriptive message on the output stream; for debugging. - */ - abstract void print(PrintStream p) throws IOException; - -// -// NOTE: the rest of these classes are nested within this one, and are -// imported by other classes in this package. There are a few other -// handshake message classes, not neatly nested here because of current -// licensing requirement for native (RSA) methods. They belong here, -// but those native methods complicate things a lot! -// - - -/* - * HelloRequest ... SERVER --> CLIENT - * - * Server can ask the client to initiate a new handshake, e.g. to change - * session parameters after a connection has been (re)established. - */ -static final class HelloRequest extends HandshakeMessage { - @Override - int messageType() { return ht_hello_request; } - - HelloRequest() { } - - HelloRequest(HandshakeInStream in) throws IOException - { - // nothing in this message - } - - @Override - int messageLength() { return 0; } - - @Override - void send(HandshakeOutStream out) throws IOException - { - // nothing in this messaage - } - - @Override - void print(PrintStream out) throws IOException - { - out.println("*** HelloRequest (empty)"); - } - -} - -/* - * HelloVerifyRequest ... SERVER --> CLIENT [DTLS only] - * - * The definition of HelloVerifyRequest is as follows: - * - * struct { - * ProtocolVersion server_version; - * opaque cookie<0..2^8-1>; - * } HelloVerifyRequest; - * - * For DTLS protocols, once the client has transmitted the ClientHello message, - * it expects to see a HelloVerifyRequest from the server. However, if the - * server's message is lost, the client knows that either the ClientHello or - * the HelloVerifyRequest has been lost and retransmits. [RFC 6347] - */ -static final class HelloVerifyRequest extends HandshakeMessage { - ProtocolVersion protocolVersion; - byte[] cookie; // 1 to 2^8 - 1 bytes - - HelloVerifyRequest(HelloCookieManager helloCookieManager, - ClientHello clientHelloMsg) { - - this.protocolVersion = clientHelloMsg.protocolVersion; - this.cookie = helloCookieManager.getCookie(clientHelloMsg); - } - - HelloVerifyRequest( - HandshakeInStream input, int messageLength) throws IOException { - - this.protocolVersion = - ProtocolVersion.valueOf(input.getInt8(), input.getInt8()); - this.cookie = input.getBytes8(); - - // Is it a valid cookie? - HelloCookieManager.checkCookie(protocolVersion, cookie); - } - - @Override - int messageType() { - return ht_hello_verify_request; - } - - @Override - int messageLength() { - return 2 + cookie.length; // 2: the length of protocolVersion - } - - @Override - void send(HandshakeOutStream hos) throws IOException { - hos.putInt8(protocolVersion.major); - hos.putInt8(protocolVersion.minor); - hos.putBytes8(cookie); - } - - @Override - void print(PrintStream out) throws IOException { - out.println("*** HelloVerifyRequest"); - if (debug != null && Debug.isOn("verbose")) { - out.println("server_version: " + protocolVersion); - Debug.println(out, "cookie", cookie); - } - } -} - -/* - * ClientHello ... CLIENT --> SERVER - * - * Client initiates handshake by telling server what it wants, and what it - * can support (prioritized by what's first in the ciphe suite list). - * - * By RFC2246:7.4.1.2 it's explicitly anticipated that this message - * will have more data added at the end ... e.g. what CAs the client trusts. - * Until we know how to parse it, we will just read what we know - * about, and let our caller handle the jumps over unknown data. - */ -static final class ClientHello extends HandshakeMessage { - - ProtocolVersion protocolVersion; - RandomCookie clnt_random; - SessionId sessionId; - byte[] cookie; // DTLS only - private CipherSuiteList cipherSuites; - private final boolean isDTLS; - byte[] compression_methods; - - HelloExtensions extensions = new HelloExtensions(); - - private static final byte[] NULL_COMPRESSION = new byte[] {0}; - - ClientHello(SecureRandom generator, ProtocolVersion protocolVersion, - SessionId sessionId, CipherSuiteList cipherSuites, - boolean isDTLS) { - - this.isDTLS = isDTLS; - this.protocolVersion = protocolVersion; - this.sessionId = sessionId; - this.cipherSuites = cipherSuites; - if (isDTLS) { - this.cookie = new byte[0]; - } else { - this.cookie = null; - } - - clnt_random = new RandomCookie(generator); - compression_methods = NULL_COMPRESSION; - } - - ClientHello(HandshakeInStream s, - int messageLength, boolean isDTLS) throws IOException { - - this.isDTLS = isDTLS; - - protocolVersion = ProtocolVersion.valueOf(s.getInt8(), s.getInt8()); - clnt_random = new RandomCookie(s); - sessionId = new SessionId(s.getBytes8()); - sessionId.checkLength(protocolVersion); - if (isDTLS) { - cookie = s.getBytes8(); - } else { - cookie = null; - } - - cipherSuites = new CipherSuiteList(s); - compression_methods = s.getBytes8(); - if (messageLength() != messageLength) { - extensions = new HelloExtensions(s); - } - } - - CipherSuiteList getCipherSuites() { - return cipherSuites; - } - - // add renegotiation_info extension - void addRenegotiationInfoExtension(byte[] clientVerifyData) { - HelloExtension renegotiationInfo = new RenegotiationInfoExtension( - clientVerifyData, new byte[0]); - extensions.add(renegotiationInfo); - } - - // add server_name extension - void addSNIExtension(List<SNIServerName> serverNames) { - try { - extensions.add(new ServerNameExtension(serverNames)); - } catch (IOException ioe) { - // ignore the exception and return - } - } - - // add signature_algorithm extension - void addSignatureAlgorithmsExtension( - Collection<SignatureAndHashAlgorithm> algorithms) { - HelloExtension signatureAlgorithm = - new SignatureAlgorithmsExtension(algorithms); - extensions.add(signatureAlgorithm); - } - - void addExtendedMasterSecretExtension() { - extensions.add(new ExtendedMasterSecretExtension()); - } - - void addMFLExtension(int maximumPacketSize) { - HelloExtension maxFragmentLength = - new MaxFragmentLengthExtension(maximumPacketSize); - extensions.add(maxFragmentLength); - } - - void updateHelloCookie(MessageDigest cookieDigest) { - // - // Just use HandshakeOutStream to compute the hello verify cookie. - // Not actually used to output handshake message records. - // - HandshakeOutStream hos = new HandshakeOutStream(null); - - try { - send(hos, false); // Do not count hello verify cookie. - } catch (IOException ioe) { - // unlikely to happen - } - - cookieDigest.update(hos.toByteArray()); - } - - // Add status_request extension type - void addCertStatusRequestExtension() { - extensions.add(new CertStatusReqExtension(StatusRequestType.OCSP, - new OCSPStatusRequest())); - } - - // Add status_request_v2 extension type - void addCertStatusReqListV2Extension() { - // Create a default OCSPStatusRequest that we can use for both - // OCSP_MULTI and OCSP request list items. - OCSPStatusRequest osr = new OCSPStatusRequest(); - List<CertStatusReqItemV2> itemList = new ArrayList<>(2); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - osr)); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP, osr)); - extensions.add(new CertStatusReqListV2Extension(itemList)); - } - - // add application_layer_protocol_negotiation extension - void addALPNExtension(String[] applicationProtocols) throws SSLException { - extensions.add(new ALPNExtension(applicationProtocols)); - } - - @Override - int messageType() { return ht_client_hello; } - - @Override - int messageLength() { - /* - * Add fixed size parts of each field... - * version + random + session + cipher + compress - */ - return (2 + 32 + 1 + 2 + 1 - + sessionId.length() /* ... + variable parts */ - + (isDTLS ? (1 + cookie.length) : 0) - + (cipherSuites.size() * 2) - + compression_methods.length) - + extensions.length(); - } - - @Override - void send(HandshakeOutStream s) throws IOException { - send(s, true); // Count hello verify cookie. - } - - @Override - void print(PrintStream s) throws IOException { - s.println("*** ClientHello, " + protocolVersion); - - if (debug != null && Debug.isOn("verbose")) { - s.print("RandomCookie: "); - clnt_random.print(s); - - s.print("Session ID: "); - s.println(sessionId); - - if (isDTLS) { - Debug.println(s, "cookie", cookie); - } - - s.println("Cipher Suites: " + cipherSuites); - - Debug.println(s, "Compression Methods", compression_methods); - extensions.print(s); - s.println("***"); - } - } - - private void send(HandshakeOutStream s, - boolean computeCookie) throws IOException { - s.putInt8(protocolVersion.major); - s.putInt8(protocolVersion.minor); - clnt_random.send(s); - s.putBytes8(sessionId.getId()); - if (isDTLS && computeCookie) { - s.putBytes8(cookie); - } - cipherSuites.send(s); - s.putBytes8(compression_methods); - extensions.send(s); - } - -} - -/* - * ServerHello ... SERVER --> CLIENT - * - * Server chooses protocol options from among those it supports and the - * client supports. Then it sends the basic session descriptive parameters - * back to the client. - */ -static final -class ServerHello extends HandshakeMessage -{ - @Override - int messageType() { return ht_server_hello; } - - ProtocolVersion protocolVersion; - RandomCookie svr_random; - SessionId sessionId; - CipherSuite cipherSuite; - byte compression_method; - HelloExtensions extensions = new HelloExtensions(); - - ServerHello() { - // empty - } - - ServerHello(HandshakeInStream input, int messageLength) - throws IOException { - protocolVersion = ProtocolVersion.valueOf(input.getInt8(), - input.getInt8()); - svr_random = new RandomCookie(input); - sessionId = new SessionId(input.getBytes8()); - sessionId.checkLength(protocolVersion); - cipherSuite = CipherSuite.valueOf(input.getInt8(), input.getInt8()); - compression_method = (byte)input.getInt8(); - if (messageLength() != messageLength) { - extensions = new HelloExtensions(input); - } - } - - @Override - int messageLength() - { - // almost fixed size, except session ID and extensions: - // major + minor = 2 - // random = 32 - // session ID len field = 1 - // cipher suite + compression = 3 - // extensions: if present, 2 + length of extensions - return 38 + sessionId.length() + extensions.length(); - } - - @Override - void send(HandshakeOutStream s) throws IOException - { - s.putInt8(protocolVersion.major); - s.putInt8(protocolVersion.minor); - svr_random.send(s); - s.putBytes8(sessionId.getId()); - s.putInt8(cipherSuite.id >> 8); - s.putInt8(cipherSuite.id & 0xff); - s.putInt8(compression_method); - extensions.send(s); - } - - @Override - void print(PrintStream s) throws IOException - { - s.println("*** ServerHello, " + protocolVersion); - - if (debug != null && Debug.isOn("verbose")) { - s.print("RandomCookie: "); - svr_random.print(s); - - s.print("Session ID: "); - s.println(sessionId); - - s.println("Cipher Suite: " + cipherSuite); - s.println("Compression Method: " + compression_method); - extensions.print(s); - s.println("***"); - } - } -} - - -/* - * CertificateMsg ... send by both CLIENT and SERVER - * - * Each end of a connection may need to pass its certificate chain to - * the other end. Such chains are intended to validate an identity with - * reference to some certifying authority. Examples include companies - * like Verisign, or financial institutions. There's some control over - * the certifying authorities which are sent. - * - * NOTE: that these messages might be huge, taking many handshake records. - * Up to 2^48 bytes of certificate may be sent, in records of at most 2^14 - * bytes each ... up to 2^32 records sent on the output stream. - */ -static final -class CertificateMsg extends HandshakeMessage -{ - @Override - int messageType() { return ht_certificate; } - - private X509Certificate[] chain; - - private List<byte[]> encodedChain; - - private int messageLength; - - CertificateMsg(X509Certificate[] certs) { - chain = certs; - } - - CertificateMsg(HandshakeInStream input) throws IOException { - int chainLen = input.getInt24(); - List<Certificate> v = new ArrayList<>(4); - - CertificateFactory cf = null; - while (chainLen > 0) { - byte[] cert = input.getBytes24(); - chainLen -= (3 + cert.length); - try { - if (cf == null) { - cf = CertificateFactory.getInstance("X.509"); - } - v.add(cf.generateCertificate(new ByteArrayInputStream(cert))); - } catch (CertificateException e) { - throw (SSLProtocolException)new SSLProtocolException( - e.getMessage()).initCause(e); - } - } - - chain = v.toArray(new X509Certificate[v.size()]); - } - - @Override - int messageLength() { - if (encodedChain == null) { - messageLength = 3; - encodedChain = new ArrayList<byte[]>(chain.length); - try { - for (X509Certificate cert : chain) { - byte[] b = cert.getEncoded(); - encodedChain.add(b); - messageLength += b.length + 3; - } - } catch (CertificateEncodingException e) { - encodedChain = null; - throw new RuntimeException("Could not encode certificates", e); - } - } - return messageLength; - } - - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt24(messageLength() - 3); - for (byte[] b : encodedChain) { - s.putBytes24(b); - } - } - - @Override - void print(PrintStream s) throws IOException { - s.println("*** Certificate chain"); - - if (chain.length == 0) { - s.println("<Empty>"); - } else if (debug != null && Debug.isOn("verbose")) { - for (int i = 0; i < chain.length; i++) { - s.println("chain [" + i + "] = " + chain[i]); - } - } - s.println("***"); - } - - X509Certificate[] getCertificateChain() { - return chain.clone(); - } -} - -/* - * CertificateStatus ... SERVER --> CLIENT - * - * When a ClientHello asserting the status_request or status_request_v2 - * extensions is accepted by the server, it will fetch and return one - * or more status responses in this handshake message. - * - * NOTE: Like the Certificate handshake message, this can potentially - * be a very large message both due to the size of multiple status - * responses and the certificate chains that are often attached to them. - * Up to 2^24 bytes of status responses may be sent, possibly fragmented - * over multiple TLS records. - */ -static final class CertificateStatus extends HandshakeMessage -{ - private final StatusRequestType statusType; - private int encodedResponsesLen; - private int messageLength = -1; - private List<byte[]> encodedResponses; - - @Override - int messageType() { return ht_certificate_status; } - - /** - * Create a CertificateStatus message from the certificates and their - * respective OCSP responses - * - * @param type an indication of the type of response (OCSP or OCSP_MULTI) - * @param responses a {@code List} of OCSP responses in DER-encoded form. - * For the OCSP type, only the first entry in the response list is - * used, and must correspond to the end-entity certificate sent to the - * peer. Zero-length or null values for the response data are not - * allowed for the OCSP type. For the OCSP_MULTI type, each entry in - * the list should match its corresponding certificate sent in the - * Server Certificate message. Where an OCSP response does not exist, - * either a zero-length array or a null value should be used. - * - * @throws SSLException if an unsupported StatusRequestType or invalid - * OCSP response data is provided. - */ - CertificateStatus(StatusRequestType type, X509Certificate[] chain, - Map<X509Certificate, byte[]> responses) { - statusType = type; - encodedResponsesLen = 0; - encodedResponses = new ArrayList<>(chain.length); - - Objects.requireNonNull(chain, "Null chain not allowed"); - Objects.requireNonNull(responses, "Null responses not allowed"); - - if (statusType == StatusRequestType.OCSP) { - // Just get the response for the end-entity certificate - byte[] respDER = responses.get(chain[0]); - if (respDER != null && respDER.length > 0) { - encodedResponses.add(respDER); - encodedResponsesLen = 3 + respDER.length; - } else { - throw new IllegalArgumentException("Zero-length or null " + - "OCSP Response"); - } - } else if (statusType == StatusRequestType.OCSP_MULTI) { - for (X509Certificate cert : chain) { - byte[] respDER = responses.get(cert); - if (respDER != null) { - encodedResponses.add(respDER); - encodedResponsesLen += (respDER.length + 3); - } else { - // If we cannot find a response for a given certificate - // then use a zero-length placeholder. - encodedResponses.add(new byte[0]); - encodedResponsesLen += 3; - } - } - } else { - throw new IllegalArgumentException( - "Unsupported StatusResponseType: " + statusType); - } - } - - /** - * Decode the CertificateStatus handshake message coming from a - * {@code HandshakeInputStream}. - * - * @param input the {@code HandshakeInputStream} containing the - * CertificateStatus message bytes. - * - * @throws SSLHandshakeException if a zero-length response is found in the - * OCSP response type, or an unsupported response type is detected. - * @throws IOException if a decoding error occurs. - */ - CertificateStatus(HandshakeInStream input) throws IOException { - encodedResponsesLen = 0; - encodedResponses = new ArrayList<>(); - - statusType = StatusRequestType.get(input.getInt8()); - if (statusType == StatusRequestType.OCSP) { - byte[] respDER = input.getBytes24(); - // Convert the incoming bytes to a OCSPResponse strucutre - if (respDER.length > 0) { - encodedResponses.add(respDER); - encodedResponsesLen = 3 + respDER.length; - } else { - throw new SSLHandshakeException("Zero-length OCSP Response"); - } - } else if (statusType == StatusRequestType.OCSP_MULTI) { - int respListLen = input.getInt24(); - encodedResponsesLen = respListLen; - - // Add each OCSP reponse into the array list in the order - // we receive them off the wire. A zero-length array is - // allowed for ocsp_multi, and means that a response for - // a given certificate is not available. - while (respListLen > 0) { - byte[] respDER = input.getBytes24(); - encodedResponses.add(respDER); - respListLen -= (respDER.length + 3); - } - - if (respListLen != 0) { - throw new SSLHandshakeException( - "Bad OCSP response list length"); - } - } else { - throw new SSLHandshakeException("Unsupported StatusResponseType: " + - statusType); - } - } - - /** - * Get the length of the CertificateStatus message. - * - * @return the length of the message in bytes. - */ - @Override - int messageLength() { - int len = 1; // Length + Status type - - if (messageLength == -1) { - if (statusType == StatusRequestType.OCSP) { - len += encodedResponsesLen; - } else if (statusType == StatusRequestType.OCSP_MULTI) { - len += 3 + encodedResponsesLen; - } - messageLength = len; - } - - return messageLength; - } - - /** - * Encode the CertificateStatus handshake message and place it on a - * {@code HandshakeOutputStream}. - * - * @param s the HandshakeOutputStream that will the message bytes. - * - * @throws IOException if an encoding error occurs. - */ - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt8(statusType.id); - if (statusType == StatusRequestType.OCSP) { - s.putBytes24(encodedResponses.get(0)); - } else if (statusType == StatusRequestType.OCSP_MULTI) { - s.putInt24(encodedResponsesLen); - for (byte[] respBytes : encodedResponses) { - if (respBytes != null) { - s.putBytes24(respBytes); - } else { - s.putBytes24(null); - } - } - } else { - // It is highly unlikely that we will fall into this section of - // the code. - throw new SSLHandshakeException("Unsupported status_type: " + - statusType.id); - } - } - - /** - * Display a human-readable representation of the CertificateStatus message. - * - * @param s the PrintStream used to display the message data. - * - * @throws IOException if any errors occur while parsing the OCSP response - * bytes into a readable form. - */ - @Override - void print(PrintStream s) throws IOException { - s.println("*** CertificateStatus"); - if (debug != null && Debug.isOn("verbose")) { - s.println("Type: " + statusType); - if (statusType == StatusRequestType.OCSP) { - OCSPResponse oResp = new OCSPResponse(encodedResponses.get(0)); - s.println(oResp); - } else if (statusType == StatusRequestType.OCSP_MULTI) { - int numResponses = encodedResponses.size(); - s.println(numResponses + - (numResponses == 1 ? " entry:" : " entries:")); - for (byte[] respDER : encodedResponses) { - if (respDER.length > 0) { - OCSPResponse oResp = new OCSPResponse(respDER); - s.println(oResp); - } else { - s.println("<Zero-length entry>"); - } - } - } - } - } - - /** - * Get the type of CertificateStatus message - * - * @return the {@code StatusRequestType} for this CertificateStatus - * message. - */ - StatusRequestType getType() { - return statusType; - } - - /** - * Get the list of non-zero length OCSP responses. - * The responses returned in this list can be used to map to - * {@code X509Certificate} objects provided by the peer and - * provided to a {@code PKIXRevocationChecker}. - * - * @return an unmodifiable List of zero or more byte arrays, each one - * consisting of a single status response. - */ - List<byte[]> getResponses() { - return Collections.unmodifiableList(encodedResponses); - } -} - -/* - * ServerKeyExchange ... SERVER --> CLIENT - * - * The cipher suite selected, when combined with the certificate exchanged, - * implies one of several different kinds of key exchange. Most current - * cipher suites require the server to send more than its certificate. - * - * The primary exceptions are when a server sends an encryption-capable - * RSA public key in its cert, to be used with RSA (or RSA_export) key - * exchange; and when a server sends its Diffie-Hellman cert. Those kinds - * of key exchange do not require a ServerKeyExchange message. - * - * Key exchange can be viewed as having three modes, which are explicit - * for the Diffie-Hellman flavors and poorly specified for RSA ones: - * - * - "Ephemeral" keys. Here, a "temporary" key is allocated by the - * server, and signed. Diffie-Hellman keys signed using RSA or - * DSS are ephemeral (DHE flavor). RSA keys get used to do the same - * thing, to cut the key size down to 512 bits (export restrictions) - * or for signing-only RSA certificates. - * - * - Anonymity. Here no server certificate is sent, only the public - * key of the server. This case is subject to man-in-the-middle - * attacks. This can be done with Diffie-Hellman keys (DH_anon) or - * with RSA keys, but is only used in SSLv3 for DH_anon. - * - * - "Normal" case. Here a server certificate is sent, and the public - * key there is used directly in exchanging the premaster secret. - * For example, Diffie-Hellman "DH" flavor, and any RSA flavor with - * only 512 bit keys. - * - * If a server certificate is sent, there is no anonymity. However, - * when a certificate is sent, ephemeral keys may still be used to - * exchange the premaster secret. That's how RSA_EXPORT often works, - * as well as how the DHE_* flavors work. - */ -abstract static class ServerKeyExchange extends HandshakeMessage -{ - @Override - int messageType() { return ht_server_key_exchange; } -} - - -/* - * Using RSA for Key Exchange: exchange a session key that's not as big - * as the signing-only key. Used for export applications, since exported - * RSA encryption keys can't be bigger than 512 bytes. - * - * This is never used when keys are 512 bits or smaller, and isn't used - * on "US Domestic" ciphers in any case. - */ -static final -class RSA_ServerKeyExchange extends ServerKeyExchange -{ - private byte[] rsa_modulus; // 1 to 2^16 - 1 bytes - private byte[] rsa_exponent; // 1 to 2^16 - 1 bytes - - private Signature signature; - private byte[] signatureBytes; - - /* - * Hash the nonces and the ephemeral RSA public key. - */ - private void updateSignature(byte[] clntNonce, byte[] svrNonce) - throws SignatureException { - int tmp; - - signature.update(clntNonce); - signature.update(svrNonce); - - tmp = rsa_modulus.length; - signature.update((byte)(tmp >> 8)); - signature.update((byte)(tmp & 0x0ff)); - signature.update(rsa_modulus); - - tmp = rsa_exponent.length; - signature.update((byte)(tmp >> 8)); - signature.update((byte)(tmp & 0x0ff)); - signature.update(rsa_exponent); - } - - - /* - * Construct an RSA server key exchange message, using data - * known _only_ to the server. - * - * The client knows the public key corresponding to this private - * key, from the Certificate message sent previously. To comply - * with US export regulations we use short RSA keys ... either - * long term ones in the server's X509 cert, or else ephemeral - * ones sent using this message. - */ - RSA_ServerKeyExchange(PublicKey ephemeralKey, PrivateKey privateKey, - RandomCookie clntNonce, RandomCookie svrNonce, SecureRandom sr) - throws GeneralSecurityException { - RSAPublicKeySpec rsaKey = JsseJce.getRSAPublicKeySpec(ephemeralKey); - rsa_modulus = toByteArray(rsaKey.getModulus()); - rsa_exponent = toByteArray(rsaKey.getPublicExponent()); - signature = RSASignature.getInstance(); - signature.initSign(privateKey, sr); - updateSignature(clntNonce.random_bytes, svrNonce.random_bytes); - signatureBytes = signature.sign(); - } - - - /* - * Parse an RSA server key exchange message, using data known - * to the client (and, in some situations, eavesdroppers). - */ - RSA_ServerKeyExchange(HandshakeInStream input) - throws IOException, NoSuchAlgorithmException { - signature = RSASignature.getInstance(); - rsa_modulus = input.getBytes16(); - rsa_exponent = input.getBytes16(); - signatureBytes = input.getBytes16(); - } - - /* - * Get the ephemeral RSA public key that will be used in this - * SSL connection. - */ - PublicKey getPublicKey() { - try { - KeyFactory kfac = JsseJce.getKeyFactory("RSA"); - // modulus and exponent are always positive - RSAPublicKeySpec kspec = new RSAPublicKeySpec( - new BigInteger(1, rsa_modulus), - new BigInteger(1, rsa_exponent)); - return kfac.generatePublic(kspec); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - - /* - * Verify the signed temporary key using the hashes computed - * from it and the two nonces. This is called by clients - * with "exportable" RSA flavors. - */ - boolean verify(PublicKey certifiedKey, RandomCookie clntNonce, - RandomCookie svrNonce) throws GeneralSecurityException { - signature.initVerify(certifiedKey); - updateSignature(clntNonce.random_bytes, svrNonce.random_bytes); - return signature.verify(signatureBytes); - } - - @Override - int messageLength() { - return 6 + rsa_modulus.length + rsa_exponent.length - + signatureBytes.length; - } - - @Override - void send(HandshakeOutStream s) throws IOException { - s.putBytes16(rsa_modulus); - s.putBytes16(rsa_exponent); - s.putBytes16(signatureBytes); - } - - @Override - void print(PrintStream s) throws IOException { - s.println("*** RSA ServerKeyExchange"); - - if (debug != null && Debug.isOn("verbose")) { - Debug.println(s, "RSA Modulus", rsa_modulus); - Debug.println(s, "RSA Public Exponent", rsa_exponent); - } - } -} - - -/* - * Using Diffie-Hellman algorithm for key exchange. All we really need to - * do is securely get Diffie-Hellman keys (using the same P, G parameters) - * to our peer, then we automatically have a shared secret without need - * to exchange any more data. (D-H only solutions, such as SKIP, could - * eliminate key exchange negotiations and get faster connection setup. - * But they still need a signature algorithm like DSS/DSA to support the - * trusted distribution of keys without relying on unscalable physical - * key distribution systems.) - * - * This class supports several DH-based key exchange algorithms, though - * perhaps eventually each deserves its own class. Notably, this has - * basic support for DH_anon and its DHE_DSS and DHE_RSA signed variants. - */ -static final -class DH_ServerKeyExchange extends ServerKeyExchange -{ - // Fix message encoding, see 4348279 - private static final boolean dhKeyExchangeFix = - Debug.getBooleanProperty("com.sun.net.ssl.dhKeyExchangeFix", true); - - private byte[] dh_p; // 1 to 2^16 - 1 bytes - private byte[] dh_g; // 1 to 2^16 - 1 bytes - private byte[] dh_Ys; // 1 to 2^16 - 1 bytes - - private byte[] signature; - - // protocol version being established using this ServerKeyExchange message - ProtocolVersion protocolVersion; - - // the preferable signature algorithm used by this ServerKeyExchange message - private SignatureAndHashAlgorithm preferableSignatureAlgorithm; - - /* - * Construct from initialized DH key object, for DH_anon - * key exchange. - */ - DH_ServerKeyExchange(DHCrypt obj, ProtocolVersion protocolVersion) { - this.protocolVersion = protocolVersion; - this.preferableSignatureAlgorithm = null; - - // The DH key has been validated in the constructor of DHCrypt. - setValues(obj); - signature = null; - } - - /* - * Construct from initialized DH key object and the key associated - * with the cert chain which was sent ... for DHE_DSS and DHE_RSA - * key exchange. (Constructor called by server.) - */ - DH_ServerKeyExchange(DHCrypt obj, PrivateKey key, byte[] clntNonce, - byte[] svrNonce, SecureRandom sr, - SignatureAndHashAlgorithm signAlgorithm, - ProtocolVersion protocolVersion) throws GeneralSecurityException { - - this.protocolVersion = protocolVersion; - - // The DH key has been validated in the constructor of DHCrypt. - setValues(obj); - - Signature sig; - if (protocolVersion.useTLS12PlusSpec()) { - this.preferableSignatureAlgorithm = signAlgorithm; - sig = JsseJce.getSignature(signAlgorithm.getAlgorithmName()); - } else { - this.preferableSignatureAlgorithm = null; - if (key.getAlgorithm().equals("DSA")) { - sig = JsseJce.getSignature(JsseJce.SIGNATURE_DSA); - } else { - sig = RSASignature.getInstance(); - } - } - - sig.initSign(key, sr); - updateSignature(sig, clntNonce, svrNonce); - signature = sig.sign(); - } - - /* - * Construct a DH_ServerKeyExchange message from an input - * stream, as if sent from server to client for use with - * DH_anon key exchange - */ - DH_ServerKeyExchange(HandshakeInStream input, - ProtocolVersion protocolVersion) - throws IOException, GeneralSecurityException { - - this.protocolVersion = protocolVersion; - this.preferableSignatureAlgorithm = null; - - dh_p = input.getBytes16(); - dh_g = input.getBytes16(); - dh_Ys = input.getBytes16(); - KeyUtil.validate(new DHPublicKeySpec(new BigInteger(1, dh_Ys), - new BigInteger(1, dh_p), - new BigInteger(1, dh_g))); - - signature = null; - } - - /* - * Construct a DH_ServerKeyExchange message from an input stream - * and a certificate, as if sent from server to client for use with - * DHE_DSS or DHE_RSA key exchange. (Called by client.) - */ - DH_ServerKeyExchange(HandshakeInStream input, PublicKey publicKey, - byte[] clntNonce, byte[] svrNonce, int messageSize, - Collection<SignatureAndHashAlgorithm> localSupportedSignAlgs, - ProtocolVersion protocolVersion) - throws IOException, GeneralSecurityException { - - this.protocolVersion = protocolVersion; - - // read params: ServerDHParams - dh_p = input.getBytes16(); - dh_g = input.getBytes16(); - dh_Ys = input.getBytes16(); - KeyUtil.validate(new DHPublicKeySpec(new BigInteger(1, dh_Ys), - new BigInteger(1, dh_p), - new BigInteger(1, dh_g))); - - // read the signature and hash algorithm - if (protocolVersion.useTLS12PlusSpec()) { - int hash = input.getInt8(); // hash algorithm - int signature = input.getInt8(); // signature algorithm - - preferableSignatureAlgorithm = - SignatureAndHashAlgorithm.valueOf(hash, signature, 0); - - // Is it a local supported signature algorithm? - if (!localSupportedSignAlgs.contains( - preferableSignatureAlgorithm)) { - throw new SSLHandshakeException( - "Unsupported SignatureAndHashAlgorithm in " + - "ServerKeyExchange message: " + - preferableSignatureAlgorithm); - } - } else { - this.preferableSignatureAlgorithm = null; - } - - // read the signature - byte[] signature; - if (dhKeyExchangeFix) { - signature = input.getBytes16(); - } else { - messageSize -= (dh_p.length + 2); - messageSize -= (dh_g.length + 2); - messageSize -= (dh_Ys.length + 2); - - signature = new byte[messageSize]; - input.read(signature); - } - - Signature sig; - String algorithm = publicKey.getAlgorithm(); - if (protocolVersion.useTLS12PlusSpec()) { - sig = JsseJce.getSignature( - preferableSignatureAlgorithm.getAlgorithmName()); - } else { - switch (algorithm) { - case "DSA": - sig = JsseJce.getSignature(JsseJce.SIGNATURE_DSA); - break; - case "RSA": - sig = RSASignature.getInstance(); - break; - default: - throw new SSLKeyException( - "neither an RSA or a DSA key: " + algorithm); - } - } - - sig.initVerify(publicKey); - updateSignature(sig, clntNonce, svrNonce); - - if (sig.verify(signature) == false ) { - throw new SSLKeyException("Server D-H key verification failed"); - } - } - - /* Return the Diffie-Hellman modulus */ - BigInteger getModulus() { - return new BigInteger(1, dh_p); - } - - /* Return the Diffie-Hellman base/generator */ - BigInteger getBase() { - return new BigInteger(1, dh_g); - } - - /* Return the server's Diffie-Hellman public key */ - BigInteger getServerPublicKey() { - return new BigInteger(1, dh_Ys); - } - - /* - * Update sig with nonces and Diffie-Hellman public key. - */ - private void updateSignature(Signature sig, byte[] clntNonce, - byte[] svrNonce) throws SignatureException { - int tmp; - - sig.update(clntNonce); - sig.update(svrNonce); - - tmp = dh_p.length; - sig.update((byte)(tmp >> 8)); - sig.update((byte)(tmp & 0x0ff)); - sig.update(dh_p); - - tmp = dh_g.length; - sig.update((byte)(tmp >> 8)); - sig.update((byte)(tmp & 0x0ff)); - sig.update(dh_g); - - tmp = dh_Ys.length; - sig.update((byte)(tmp >> 8)); - sig.update((byte)(tmp & 0x0ff)); - sig.update(dh_Ys); - } - - private void setValues(DHCrypt obj) { - dh_p = toByteArray(obj.getModulus()); - dh_g = toByteArray(obj.getBase()); - dh_Ys = toByteArray(obj.getPublicKey()); - } - - @Override - int messageLength() { - int temp = 6; // overhead for p, g, y(s) values. - - temp += dh_p.length; - temp += dh_g.length; - temp += dh_Ys.length; - - if (signature != null) { - if (protocolVersion.useTLS12PlusSpec()) { - temp += SignatureAndHashAlgorithm.sizeInRecord(); - } - - temp += signature.length; - if (dhKeyExchangeFix) { - temp += 2; - } - } - - return temp; - } - - @Override - void send(HandshakeOutStream s) throws IOException { - s.putBytes16(dh_p); - s.putBytes16(dh_g); - s.putBytes16(dh_Ys); - - if (signature != null) { - if (protocolVersion.useTLS12PlusSpec()) { - s.putInt8(preferableSignatureAlgorithm.getHashValue()); - s.putInt8(preferableSignatureAlgorithm.getSignatureValue()); - } - - if (dhKeyExchangeFix) { - s.putBytes16(signature); - } else { - s.write(signature); - } - } - } - - @Override - void print(PrintStream s) throws IOException { - s.println("*** Diffie-Hellman ServerKeyExchange"); - - if (debug != null && Debug.isOn("verbose")) { - Debug.println(s, "DH Modulus", dh_p); - Debug.println(s, "DH Base", dh_g); - Debug.println(s, "Server DH Public Key", dh_Ys); - - if (signature == null) { - s.println("Anonymous"); - } else { - if (protocolVersion.useTLS12PlusSpec()) { - s.println("Signature Algorithm " + - preferableSignatureAlgorithm.getAlgorithmName()); - } - - s.println("Signed with a DSA or RSA public key"); - } - } - } -} - -/* - * ECDH server key exchange message. Sent by the server for ECDHE and ECDH_anon - * ciphersuites to communicate its ephemeral public key (including the - * EC domain parameters). - * - * We support named curves only, no explicitly encoded curves. - */ -static final -class ECDH_ServerKeyExchange extends ServerKeyExchange { - - // constants for ECCurveType - private static final int CURVE_EXPLICIT_PRIME = 1; - private static final int CURVE_EXPLICIT_CHAR2 = 2; - private static final int CURVE_NAMED_CURVE = 3; - - // id of the named group we are using - private int groupId; - - // encoded public point - private byte[] pointBytes; - - // signature bytes (or null if anonymous) - private byte[] signatureBytes; - - // public key object encapsulated in this message - private ECPublicKey publicKey; - - // protocol version being established using this ServerKeyExchange message - ProtocolVersion protocolVersion; - - // the preferable signature algorithm used by this ServerKeyExchange message - private SignatureAndHashAlgorithm preferableSignatureAlgorithm; - - ECDH_ServerKeyExchange(ECDHCrypt obj, PrivateKey privateKey, - byte[] clntNonce, byte[] svrNonce, SecureRandom sr, - SignatureAndHashAlgorithm signAlgorithm, - ProtocolVersion protocolVersion) - throws SSLHandshakeException, GeneralSecurityException { - - this.protocolVersion = protocolVersion; - - publicKey = (ECPublicKey)obj.getPublicKey(); - ECParameterSpec params = publicKey.getParams(); - ECPoint point = publicKey.getW(); - pointBytes = JsseJce.encodePoint(point, params.getCurve()); - - NamedGroup namedGroup = NamedGroup.valueOf(params); - if ((namedGroup == null) || (namedGroup.oid == null) ){ - // unlikely - throw new SSLHandshakeException( - "Unnamed EC parameter spec: " + params); - } - groupId = namedGroup.id; - - if (privateKey == null) { - // ECDH_anon - return; - } - - Signature sig; - if (protocolVersion.useTLS12PlusSpec()) { - this.preferableSignatureAlgorithm = signAlgorithm; - sig = JsseJce.getSignature(signAlgorithm.getAlgorithmName()); - } else { - sig = getSignature(privateKey.getAlgorithm()); - } - sig.initSign(privateKey, sr); - - updateSignature(sig, clntNonce, svrNonce); - signatureBytes = sig.sign(); - } - - /* - * Parse an ECDH server key exchange message. - */ - ECDH_ServerKeyExchange(HandshakeInStream input, PublicKey signingKey, - byte[] clntNonce, byte[] svrNonce, - Collection<SignatureAndHashAlgorithm> localSupportedSignAlgs, - ProtocolVersion protocolVersion) - throws IOException, GeneralSecurityException { - - this.protocolVersion = protocolVersion; - - // read params: ServerECDHParams - int curveType = input.getInt8(); - ECParameterSpec parameters; - // These parsing errors should never occur as we negotiated - // the supported curves during the exchange of the Hello messages. - if (curveType == CURVE_NAMED_CURVE) { - groupId = input.getInt16(); - NamedGroup namedGroup = NamedGroup.valueOf(groupId); - if (namedGroup == null) { - throw new SSLHandshakeException( - "Unknown named group ID: " + groupId); - } - - if (!SupportedGroupsExtension.supports(namedGroup)) { - throw new SSLHandshakeException( - "Unsupported named group: " + namedGroup); - } - - if (namedGroup.oid == null) { - throw new SSLHandshakeException( - "Unknown named EC curve: " + namedGroup); - } - - parameters = JsseJce.getECParameterSpec(namedGroup.oid); - if (parameters == null) { - throw new SSLHandshakeException( - "No supported EC parameter for named group: " + namedGroup); - } - } else { - throw new SSLHandshakeException( - "Unsupported ECCurveType: " + curveType); - } - pointBytes = input.getBytes8(); - - ECPoint point = JsseJce.decodePoint(pointBytes, parameters.getCurve()); - KeyFactory factory = JsseJce.getKeyFactory("EC"); - publicKey = (ECPublicKey)factory.generatePublic( - new ECPublicKeySpec(point, parameters)); - - if (signingKey == null) { - // ECDH_anon - return; - } - - // read the signature and hash algorithm - if (protocolVersion.useTLS12PlusSpec()) { - int hash = input.getInt8(); // hash algorithm - int signature = input.getInt8(); // signature algorithm - - preferableSignatureAlgorithm = - SignatureAndHashAlgorithm.valueOf(hash, signature, 0); - - // Is it a local supported signature algorithm? - if (!localSupportedSignAlgs.contains( - preferableSignatureAlgorithm)) { - throw new SSLHandshakeException( - "Unsupported SignatureAndHashAlgorithm in " + - "ServerKeyExchange message: " + - preferableSignatureAlgorithm); - } - } - - // read the signature - signatureBytes = input.getBytes16(); - - // verify the signature - Signature sig; - if (protocolVersion.useTLS12PlusSpec()) { - sig = JsseJce.getSignature( - preferableSignatureAlgorithm.getAlgorithmName()); - } else { - sig = getSignature(signingKey.getAlgorithm()); - } - sig.initVerify(signingKey); - - updateSignature(sig, clntNonce, svrNonce); - - if (sig.verify(signatureBytes) == false ) { - throw new SSLKeyException( - "Invalid signature on ECDH server key exchange message"); - } - } - - /* - * Get the ephemeral EC public key encapsulated in this message. - */ - ECPublicKey getPublicKey() { - return publicKey; - } - - private static Signature getSignature(String keyAlgorithm) - throws NoSuchAlgorithmException { - switch (keyAlgorithm) { - case "EC": - return JsseJce.getSignature(JsseJce.SIGNATURE_ECDSA); - case "RSA": - return RSASignature.getInstance(); - default: - throw new NoSuchAlgorithmException( - "neither an RSA or a EC key : " + keyAlgorithm); - } - } - - private void updateSignature(Signature sig, byte[] clntNonce, - byte[] svrNonce) throws SignatureException { - sig.update(clntNonce); - sig.update(svrNonce); - - sig.update((byte)CURVE_NAMED_CURVE); - sig.update((byte)(groupId >> 8)); - sig.update((byte)groupId); - sig.update((byte)pointBytes.length); - sig.update(pointBytes); - } - - @Override - int messageLength() { - int sigLen = 0; - if (signatureBytes != null) { - sigLen = 2 + signatureBytes.length; - if (protocolVersion.useTLS12PlusSpec()) { - sigLen += SignatureAndHashAlgorithm.sizeInRecord(); - } - } - - return 4 + pointBytes.length + sigLen; - } - - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt8(CURVE_NAMED_CURVE); - s.putInt16(groupId); - s.putBytes8(pointBytes); - - if (signatureBytes != null) { - if (protocolVersion.useTLS12PlusSpec()) { - s.putInt8(preferableSignatureAlgorithm.getHashValue()); - s.putInt8(preferableSignatureAlgorithm.getSignatureValue()); - } - - s.putBytes16(signatureBytes); - } - } - - @Override - void print(PrintStream s) throws IOException { - s.println("*** ECDH ServerKeyExchange"); - - if (debug != null && Debug.isOn("verbose")) { - if (signatureBytes == null) { - s.println("Anonymous"); - } else { - if (protocolVersion.useTLS12PlusSpec()) { - s.println("Signature Algorithm " + - preferableSignatureAlgorithm.getAlgorithmName()); - } - } - - s.println("Server key: " + publicKey); - } - } -} - -static final class DistinguishedName { - - /* - * DER encoded distinguished name. - * TLS requires that its not longer than 65535 bytes. - */ - byte[] name; - - DistinguishedName(HandshakeInStream input) throws IOException { - name = input.getBytes16(); - } - - DistinguishedName(X500Principal dn) { - name = dn.getEncoded(); - } - - X500Principal getX500Principal() throws IOException { - try { - return new X500Principal(name); - } catch (IllegalArgumentException e) { - throw (SSLProtocolException)new SSLProtocolException( - e.getMessage()).initCause(e); - } - } - - int length() { - return 2 + name.length; - } - - void send(HandshakeOutStream output) throws IOException { - output.putBytes16(name); - } - - void print(PrintStream output) throws IOException { - X500Principal principal = new X500Principal(name); - output.println("<" + principal.toString() + ">"); - } -} - -/* - * CertificateRequest ... SERVER --> CLIENT - * - * Authenticated servers may ask clients to authenticate themselves - * in turn, using this message. - * - * Prior to TLS 1.2, the structure of the message is defined as: - * struct { - * ClientCertificateType certificate_types<1..2^8-1>; - * DistinguishedName certificate_authorities<0..2^16-1>; - * } CertificateRequest; - * - * In TLS 1.2, the structure is changed to: - * struct { - * ClientCertificateType certificate_types<1..2^8-1>; - * SignatureAndHashAlgorithm - * supported_signature_algorithms<2^16-1>; - * DistinguishedName certificate_authorities<0..2^16-1>; - * } CertificateRequest; - * - */ -static final -class CertificateRequest extends HandshakeMessage -{ - // enum ClientCertificateType - static final int cct_rsa_sign = 1; - static final int cct_dss_sign = 2; - static final int cct_rsa_fixed_dh = 3; - static final int cct_dss_fixed_dh = 4; - - // The existance of these two values is a bug in the SSL specification. - // They are never used in the protocol. - static final int cct_rsa_ephemeral_dh = 5; - static final int cct_dss_ephemeral_dh = 6; - - // From RFC 4492 (ECC) - static final int cct_ecdsa_sign = 64; - static final int cct_rsa_fixed_ecdh = 65; - static final int cct_ecdsa_fixed_ecdh = 66; - - private static final byte[] TYPES_NO_ECC = { cct_rsa_sign, cct_dss_sign }; - private static final byte[] TYPES_ECC = - { cct_rsa_sign, cct_dss_sign, cct_ecdsa_sign }; - - byte[] types; // 1 to 255 types - DistinguishedName[] authorities; // 3 to 2^16 - 1 - // ... "3" because that's the smallest DER-encoded X500 DN - - // protocol version being established using this CertificateRequest message - ProtocolVersion protocolVersion; - - // supported_signature_algorithms for TLS 1.2 or later - private Collection<SignatureAndHashAlgorithm> algorithms; - - // length of supported_signature_algorithms - private int algorithmsLen; - - CertificateRequest(X509Certificate[] ca, KeyExchange keyExchange, - Collection<SignatureAndHashAlgorithm> signAlgs, - ProtocolVersion protocolVersion) throws IOException { - - this.protocolVersion = protocolVersion; - - // always use X500Principal - authorities = new DistinguishedName[ca.length]; - for (int i = 0; i < ca.length; i++) { - X500Principal x500Principal = ca[i].getSubjectX500Principal(); - authorities[i] = new DistinguishedName(x500Principal); - } - // we support RSA, DSS, and ECDSA client authentication and they - // can be used with all ciphersuites. If this changes, the code - // needs to be adapted to take keyExchange into account. - // We only request ECDSA client auth if we have ECC crypto available. - this.types = JsseJce.isEcAvailable() ? TYPES_ECC : TYPES_NO_ECC; - - // Use supported_signature_algorithms for TLS 1.2 or later. - if (protocolVersion.useTLS12PlusSpec()) { - if (signAlgs == null || signAlgs.isEmpty()) { - throw new SSLProtocolException( - "No supported signature algorithms"); - } - - algorithms = new ArrayList<SignatureAndHashAlgorithm>(signAlgs); - algorithmsLen = - SignatureAndHashAlgorithm.sizeInRecord() * algorithms.size(); - } else { - algorithms = new ArrayList<SignatureAndHashAlgorithm>(); - algorithmsLen = 0; - } - } - - CertificateRequest(HandshakeInStream input, - ProtocolVersion protocolVersion) throws IOException { - - this.protocolVersion = protocolVersion; - - // Read the certificate_types. - types = input.getBytes8(); - - // Read the supported_signature_algorithms for TLS 1.2 or later. - if (protocolVersion.useTLS12PlusSpec()) { - algorithmsLen = input.getInt16(); - if (algorithmsLen < 2) { - throw new SSLProtocolException( - "Invalid supported_signature_algorithms field: " + - algorithmsLen); - } - - algorithms = new ArrayList<SignatureAndHashAlgorithm>(); - int remains = algorithmsLen; - int sequence = 0; - while (remains > 1) { // needs at least two bytes - int hash = input.getInt8(); // hash algorithm - int signature = input.getInt8(); // signature algorithm - - SignatureAndHashAlgorithm algorithm = - SignatureAndHashAlgorithm.valueOf(hash, signature, - ++sequence); - algorithms.add(algorithm); - remains -= 2; // one byte for hash, one byte for signature - } - - if (remains != 0) { - throw new SSLProtocolException( - "Invalid supported_signature_algorithms field. remains: " + - remains); - } - } else { - algorithms = new ArrayList<SignatureAndHashAlgorithm>(); - algorithmsLen = 0; - } - - // read the certificate_authorities - int len = input.getInt16(); - ArrayList<DistinguishedName> v = new ArrayList<>(); - while (len >= 3) { - DistinguishedName dn = new DistinguishedName(input); - v.add(dn); - len -= dn.length(); - } - - if (len != 0) { - throw new SSLProtocolException( - "Bad CertificateRequest DN length: " + len); - } - - authorities = v.toArray(new DistinguishedName[v.size()]); - } - - X500Principal[] getAuthorities() throws IOException { - X500Principal[] ret = new X500Principal[authorities.length]; - for (int i = 0; i < authorities.length; i++) { - ret[i] = authorities[i].getX500Principal(); - } - return ret; - } - - Collection<SignatureAndHashAlgorithm> getSignAlgorithms() { - return algorithms; - } - - @Override - int messageType() { - return ht_certificate_request; - } - - @Override - int messageLength() { - int len = 1 + types.length + 2; - - if (protocolVersion.useTLS12PlusSpec()) { - len += algorithmsLen + 2; - } - - for (int i = 0; i < authorities.length; i++) { - len += authorities[i].length(); - } - - return len; - } - - @Override - void send(HandshakeOutStream output) throws IOException { - // put certificate_types - output.putBytes8(types); - - // put supported_signature_algorithms - if (protocolVersion.useTLS12PlusSpec()) { - output.putInt16(algorithmsLen); - for (SignatureAndHashAlgorithm algorithm : algorithms) { - output.putInt8(algorithm.getHashValue()); // hash - output.putInt8(algorithm.getSignatureValue()); // signature - } - } - - // put certificate_authorities - int len = 0; - for (int i = 0; i < authorities.length; i++) { - len += authorities[i].length(); - } - - output.putInt16(len); - for (int i = 0; i < authorities.length; i++) { - authorities[i].send(output); - } - } - - @Override - void print(PrintStream s) throws IOException { - s.println("*** CertificateRequest"); - - if (debug != null && Debug.isOn("verbose")) { - s.print("Cert Types: "); - for (int i = 0; i < types.length; i++) { - switch (types[i]) { - case cct_rsa_sign: - s.print("RSA"); break; - case cct_dss_sign: - s.print("DSS"); break; - case cct_rsa_fixed_dh: - s.print("Fixed DH (RSA sig)"); break; - case cct_dss_fixed_dh: - s.print("Fixed DH (DSS sig)"); break; - case cct_rsa_ephemeral_dh: - s.print("Ephemeral DH (RSA sig)"); break; - case cct_dss_ephemeral_dh: - s.print("Ephemeral DH (DSS sig)"); break; - case cct_ecdsa_sign: - s.print("ECDSA"); break; - case cct_rsa_fixed_ecdh: - s.print("Fixed ECDH (RSA sig)"); break; - case cct_ecdsa_fixed_ecdh: - s.print("Fixed ECDH (ECDSA sig)"); break; - default: - s.print("Type-" + (types[i] & 0xff)); break; - } - if (i != types.length - 1) { - s.print(", "); - } - } - s.println(); - - if (protocolVersion.useTLS12PlusSpec()) { - StringBuilder sb = new StringBuilder(); - boolean opened = false; - for (SignatureAndHashAlgorithm signAlg : algorithms) { - if (opened) { - sb.append(", ").append(signAlg.getAlgorithmName()); - } else { - sb.append(signAlg.getAlgorithmName()); - opened = true; - } - } - s.println("Supported Signature Algorithms: " + sb); - } - - s.println("Cert Authorities:"); - if (authorities.length == 0) { - s.println("<Empty>"); - } else { - for (int i = 0; i < authorities.length; i++) { - authorities[i].print(s); - } - } - } - } -} - - -/* - * ServerHelloDone ... SERVER --> CLIENT - * - * When server's done sending its messages in response to the client's - * "hello" (e.g. its own hello, certificate, key exchange message, perhaps - * client certificate request) it sends this message to flag that it's - * done that part of the handshake. - */ -static final -class ServerHelloDone extends HandshakeMessage -{ - @Override - int messageType() { return ht_server_hello_done; } - - ServerHelloDone() { } - - ServerHelloDone(HandshakeInStream input) - { - // nothing to do - } - - @Override - int messageLength() - { - return 0; - } - - @Override - void send(HandshakeOutStream s) throws IOException - { - // nothing to send - } - - @Override - void print(PrintStream s) throws IOException - { - s.println("*** ServerHelloDone"); - } -} - - -/* - * CertificateVerify ... CLIENT --> SERVER - * - * Sent after client sends signature-capable certificates (e.g. not - * Diffie-Hellman) to verify. - */ -static final class CertificateVerify extends HandshakeMessage { - - // the signature bytes - private byte[] signature; - - // protocol version being established using this CertificateVerify message - ProtocolVersion protocolVersion; - - // the preferable signature algorithm used by this CertificateVerify message - private SignatureAndHashAlgorithm preferableSignatureAlgorithm = null; - - /* - * Create an RSA or DSA signed certificate verify message. - */ - CertificateVerify(ProtocolVersion protocolVersion, - HandshakeHash handshakeHash, PrivateKey privateKey, - SecretKey masterSecret, SecureRandom sr, - SignatureAndHashAlgorithm signAlgorithm) - throws GeneralSecurityException { - - this.protocolVersion = protocolVersion; - - String algorithm = privateKey.getAlgorithm(); - Signature sig = null; - if (protocolVersion.useTLS12PlusSpec()) { - this.preferableSignatureAlgorithm = signAlgorithm; - sig = JsseJce.getSignature(signAlgorithm.getAlgorithmName()); - } else { - sig = getSignature(protocolVersion, algorithm); - } - sig.initSign(privateKey, sr); - updateSignature(sig, protocolVersion, handshakeHash, algorithm, - masterSecret); - signature = sig.sign(); - } - - // - // Unmarshal the signed data from the input stream. - // - CertificateVerify(HandshakeInStream input, - Collection<SignatureAndHashAlgorithm> localSupportedSignAlgs, - ProtocolVersion protocolVersion) throws IOException { - - this.protocolVersion = protocolVersion; - - // read the signature and hash algorithm - if (protocolVersion.useTLS12PlusSpec()) { - int hashAlg = input.getInt8(); // hash algorithm - int signAlg = input.getInt8(); // signature algorithm - - preferableSignatureAlgorithm = - SignatureAndHashAlgorithm.valueOf(hashAlg, signAlg, 0); - - // Is it a local supported signature algorithm? - if (!localSupportedSignAlgs.contains( - preferableSignatureAlgorithm)) { - throw new SSLHandshakeException( - "Unsupported SignatureAndHashAlgorithm in " + - "CertificateVerify message: " + preferableSignatureAlgorithm); - } - } - - // read the signature - signature = input.getBytes16(); - } - - /* - * Get the preferable signature algorithm used by this message - */ - SignatureAndHashAlgorithm getPreferableSignatureAlgorithm() { - return preferableSignatureAlgorithm; - } - - /* - * Verify a certificate verify message. Return the result of verification, - * if there is a problem throw a GeneralSecurityException. - */ - boolean verify(ProtocolVersion protocolVersion, - HandshakeHash handshakeHash, PublicKey publicKey, - SecretKey masterSecret) throws GeneralSecurityException { - String algorithm = publicKey.getAlgorithm(); - Signature sig = null; - if (protocolVersion.useTLS12PlusSpec()) { - sig = JsseJce.getSignature( - preferableSignatureAlgorithm.getAlgorithmName()); - } else { - sig = getSignature(protocolVersion, algorithm); - } - sig.initVerify(publicKey); - updateSignature(sig, protocolVersion, handshakeHash, algorithm, - masterSecret); - return sig.verify(signature); - } - - /* - * Get the Signature object appropriate for verification using the - * given signature algorithm and protocol version. - */ - private static Signature getSignature(ProtocolVersion protocolVersion, - String algorithm) throws GeneralSecurityException { - switch (algorithm) { - case "RSA": - return RSASignature.getInternalInstance(); - case "DSA": - return JsseJce.getSignature(JsseJce.SIGNATURE_RAWDSA); - case "EC": - return JsseJce.getSignature(JsseJce.SIGNATURE_RAWECDSA); - default: - throw new SignatureException("Unrecognized algorithm: " - + algorithm); - } - } - - /* - * Update the Signature with the data appropriate for the given - * signature algorithm and protocol version so that the object is - * ready for signing or verifying. - */ - private static void updateSignature(Signature sig, - ProtocolVersion protocolVersion, - HandshakeHash handshakeHash, String algorithm, SecretKey masterKey) - throws SignatureException { - - if (algorithm.equals("RSA")) { - if (!protocolVersion.useTLS12PlusSpec()) { // TLS1.1- - MessageDigest md5Clone = handshakeHash.getMD5Clone(); - MessageDigest shaClone = handshakeHash.getSHAClone(); - - if (!protocolVersion.useTLS10PlusSpec()) { // SSLv3 - updateDigest(md5Clone, MD5_pad1, MD5_pad2, masterKey); - updateDigest(shaClone, SHA_pad1, SHA_pad2, masterKey); - } - - // The signature must be an instance of RSASignature, need - // to use these hashes directly. - RSASignature.setHashes(sig, md5Clone, shaClone); - } else { // TLS1.2+ - sig.update(handshakeHash.getAllHandshakeMessages()); - } - } else { // DSA, ECDSA - if (!protocolVersion.useTLS12PlusSpec()) { // TLS1.1- - MessageDigest shaClone = handshakeHash.getSHAClone(); - - if (!protocolVersion.useTLS10PlusSpec()) { // SSLv3 - updateDigest(shaClone, SHA_pad1, SHA_pad2, masterKey); - } - - sig.update(shaClone.digest()); - } else { // TLS1.2+ - sig.update(handshakeHash.getAllHandshakeMessages()); - } - } - } - - /* - * Update the MessageDigest for SSLv3 certificate verify or finished - * message calculation. The digest must already have been updated with - * all preceding handshake messages. - * Used by the Finished class as well. - */ - private static void updateDigest(MessageDigest md, - byte[] pad1, byte[] pad2, - SecretKey masterSecret) { - // Digest the key bytes if available. - // Otherwise (sensitive key), try digesting the key directly. - // That is currently only implemented in SunPKCS11 using a private - // reflection API, so we avoid that if possible. - byte[] keyBytes = "RAW".equals(masterSecret.getFormat()) - ? masterSecret.getEncoded() : null; - if (keyBytes != null) { - md.update(keyBytes); - } else { - digestKey(md, masterSecret); - } - md.update(pad1); - byte[] temp = md.digest(); - - if (keyBytes != null) { - md.update(keyBytes); - } else { - digestKey(md, masterSecret); - } - md.update(pad2); - md.update(temp); - } - - private static void digestKey(MessageDigest md, SecretKey key) { - try { - if (md instanceof MessageDigestSpi2) { - ((MessageDigestSpi2)md).engineUpdate(key); - } else { - throw new Exception( - "Digest does not support implUpdate(SecretKey)"); - } - } catch (Exception e) { - throw new RuntimeException( - "Could not obtain encoded key and " - + "MessageDigest cannot digest key", e); - } - } - - @Override - int messageType() { - return ht_certificate_verify; - } - - @Override - int messageLength() { - int temp = 2; - - if (protocolVersion.useTLS12PlusSpec()) { - temp += SignatureAndHashAlgorithm.sizeInRecord(); - } - - return temp + signature.length; - } - - @Override - void send(HandshakeOutStream s) throws IOException { - if (protocolVersion.useTLS12PlusSpec()) { - s.putInt8(preferableSignatureAlgorithm.getHashValue()); - s.putInt8(preferableSignatureAlgorithm.getSignatureValue()); - } - - s.putBytes16(signature); - } - - @Override - void print(PrintStream s) throws IOException { - s.println("*** CertificateVerify"); - - if (debug != null && Debug.isOn("verbose")) { - if (protocolVersion.useTLS12PlusSpec()) { - s.println("Signature Algorithm " + - preferableSignatureAlgorithm.getAlgorithmName()); - } - } - } -} - - -/* - * FINISHED ... sent by both CLIENT and SERVER - * - * This is the FINISHED message as defined in the SSL and TLS protocols. - * Both protocols define this handshake message slightly differently. - * This class supports both formats. - * - * When handshaking is finished, each side sends a "change_cipher_spec" - * record, then immediately sends a "finished" handshake message prepared - * according to the newly adopted cipher spec. - * - * NOTE that until this is sent, no application data may be passed, unless - * some non-default cipher suite has already been set up on this connection - * connection (e.g. a previous handshake arranged one). - */ -static final class Finished extends HandshakeMessage { - - // constant for a Finished message sent by the client - static final int CLIENT = 1; - - // constant for a Finished message sent by the server - static final int SERVER = 2; - - // enum Sender: "CLNT" and "SRVR" - private static final byte[] SSL_CLIENT = { 0x43, 0x4C, 0x4E, 0x54 }; - private static final byte[] SSL_SERVER = { 0x53, 0x52, 0x56, 0x52 }; - - /* - * Contents of the finished message ("checksum"). For TLS, it - * is 12 bytes long, for SSLv3 36 bytes. - */ - private byte[] verifyData; - - /* - * Current cipher suite we are negotiating. TLS 1.2 has - * ciphersuite-defined PRF algorithms. - */ - private ProtocolVersion protocolVersion; - private CipherSuite cipherSuite; - - /* - * Create a finished message to send to the remote peer. - */ - Finished(ProtocolVersion protocolVersion, HandshakeHash handshakeHash, - int sender, SecretKey master, CipherSuite cipherSuite) { - this.protocolVersion = protocolVersion; - this.cipherSuite = cipherSuite; - verifyData = getFinished(handshakeHash, sender, master); - } - - /* - * Constructor that reads FINISHED message from stream. - */ - Finished(ProtocolVersion protocolVersion, HandshakeInStream input, - CipherSuite cipherSuite) throws IOException { - this.protocolVersion = protocolVersion; - this.cipherSuite = cipherSuite; - int msgLen = protocolVersion.useTLS10PlusSpec() ? 12 : 36; - verifyData = new byte[msgLen]; - input.read(verifyData); - } - - /* - * Verify that the hashes here are what would have been produced - * according to a given set of inputs. This is used to ensure that - * both client and server are fully in sync, and that the handshake - * computations have been successful. - */ - boolean verify(HandshakeHash handshakeHash, int sender, SecretKey master) { - byte[] myFinished = getFinished(handshakeHash, sender, master); - return MessageDigest.isEqual(myFinished, verifyData); - } - - /* - * Perform the actual finished message calculation. - */ - private byte[] getFinished(HandshakeHash handshakeHash, - int sender, SecretKey masterKey) { - byte[] sslLabel; - String tlsLabel; - if (sender == CLIENT) { - sslLabel = SSL_CLIENT; - tlsLabel = "client finished"; - } else if (sender == SERVER) { - sslLabel = SSL_SERVER; - tlsLabel = "server finished"; - } else { - throw new RuntimeException("Invalid sender: " + sender); - } - - if (protocolVersion.useTLS10PlusSpec()) { - // TLS 1.0+ - try { - byte[] seed; - String prfAlg; - PRF prf; - - // Get the KeyGenerator alg and calculate the seed. - if (protocolVersion.useTLS12PlusSpec()) { - // TLS 1.2+ or DTLS 1.2+ - seed = handshakeHash.getFinishedHash(); - - prfAlg = "SunTls12Prf"; - prf = cipherSuite.prfAlg; - } else { - // TLS 1.0/1.1, DTLS 1.0 - MessageDigest md5Clone = handshakeHash.getMD5Clone(); - MessageDigest shaClone = handshakeHash.getSHAClone(); - seed = new byte[36]; - md5Clone.digest(seed, 0, 16); - shaClone.digest(seed, 16, 20); - - prfAlg = "SunTlsPrf"; - prf = P_NONE; - } - - String prfHashAlg = prf.getPRFHashAlg(); - int prfHashLength = prf.getPRFHashLength(); - int prfBlockSize = prf.getPRFBlockSize(); - - /* - * RFC 5246/7.4.9 says that finished messages can - * be ciphersuite-specific in both length/PRF hash - * algorithm. If we ever run across a different - * length, this call will need to be updated. - */ - @SuppressWarnings("deprecation") - TlsPrfParameterSpec spec = new TlsPrfParameterSpec( - masterKey, tlsLabel, seed, 12, - prfHashAlg, prfHashLength, prfBlockSize); - - KeyGenerator kg = JsseJce.getKeyGenerator(prfAlg); - kg.init(spec); - SecretKey prfKey = kg.generateKey(); - if ("RAW".equals(prfKey.getFormat()) == false) { - throw new ProviderException( - "Invalid PRF output, format must be RAW. " + - "Format received: " + prfKey.getFormat()); - } - byte[] finished = prfKey.getEncoded(); - return finished; - } catch (GeneralSecurityException e) { - throw new RuntimeException("PRF failed", e); - } - } else { - // SSLv3 - MessageDigest md5Clone = handshakeHash.getMD5Clone(); - MessageDigest shaClone = handshakeHash.getSHAClone(); - updateDigest(md5Clone, sslLabel, MD5_pad1, MD5_pad2, masterKey); - updateDigest(shaClone, sslLabel, SHA_pad1, SHA_pad2, masterKey); - byte[] finished = new byte[36]; - try { - md5Clone.digest(finished, 0, 16); - shaClone.digest(finished, 16, 20); - } catch (DigestException e) { - // cannot occur - throw new RuntimeException("Digest failed", e); - } - return finished; - } - } - - /* - * Update the MessageDigest for SSLv3 finished message calculation. - * The digest must already have been updated with all preceding handshake - * messages. This operation is almost identical to the certificate verify - * hash, reuse that code. - */ - private static void updateDigest(MessageDigest md, byte[] sender, - byte[] pad1, byte[] pad2, SecretKey masterSecret) { - md.update(sender); - CertificateVerify.updateDigest(md, pad1, pad2, masterSecret); - } - - // get the verify_data of the finished message - byte[] getVerifyData() { - return verifyData; - } - - @Override - int messageType() { return ht_finished; } - - @Override - int messageLength() { - return verifyData.length; - } - - @Override - void send(HandshakeOutStream out) throws IOException { - out.write(verifyData); - } - - @Override - void print(PrintStream s) throws IOException { - s.println("*** Finished"); - if (debug != null && Debug.isOn("verbose")) { - Debug.println(s, "verify_data", verifyData); - s.println("***"); - } - } -} - -// -// END of nested classes -// - -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeOutStream.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeOutStream.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeOutStream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeOutStream.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,11 +56,12 @@ throw new RuntimeException("handshake message is not available"); } - // outputRecord cannot be null - outputRecord.encodeHandshake(buf, 0, count); + if (outputRecord != null) { + outputRecord.encodeHandshake(buf, 0, count); - // reset the byte array output stream - reset(); + // reset the byte array output stream + reset(); + } // otherwise, the handshake outstream is temporarily used only. } // @@ -76,7 +77,9 @@ @Override public void flush() throws IOException { - outputRecord.flush(); + if (outputRecord != null) { + outputRecord.flush(); + } } // @@ -104,6 +107,13 @@ super.write(i >> 16); super.write(i >> 8); super.write(i); + } + + void putInt32(int i) throws IOException { + super.write(i >> 24); + super.write(i >> 16); + super.write(i >> 8); + super.write(i); } /* diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeProducer.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeProducer.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeProducer.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeProducer.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +interface HandshakeProducer { + // return the encoded producing if it has not been dumped to the context + // + // message: the handshake message responded to, can be null for producing + // of kickstart handshake message + byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException; +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Handshaker.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Handshaker.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Handshaker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Handshaker.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,1623 +0,0 @@ -/* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package sun.security.ssl; - -import java.io.*; -import java.util.*; -import java.security.*; -import java.nio.ByteBuffer; -import java.util.function.BiFunction; - -import javax.crypto.*; -import javax.crypto.spec.*; - -import javax.net.ssl.*; -import sun.security.util.HexDumpEncoder; - -import sun.security.internal.spec.*; -import sun.security.internal.interfaces.TlsMasterSecret; - -import sun.security.ssl.HandshakeMessage.*; -import sun.security.ssl.CipherSuite.*; - -import static sun.security.ssl.CipherSuite.PRF.*; -import static sun.security.ssl.CipherSuite.CipherType.*; -import static sun.security.ssl.NamedGroupType.*; - -/** - * Handshaker ... processes handshake records from an SSL V3.0 - * data stream, handling all the details of the handshake protocol. - * - * Note that the real protocol work is done in two subclasses, the base - * class just provides the control flow and key generation framework. - * - * @author David Brownell - */ -abstract class Handshaker { - - // protocol version being established using this Handshaker - ProtocolVersion protocolVersion; - - // the currently active protocol version during a renegotiation - ProtocolVersion activeProtocolVersion; - - // security parameters for secure renegotiation. - boolean secureRenegotiation; - byte[] clientVerifyData; - byte[] serverVerifyData; - - // Is it an initial negotiation or a renegotiation? - boolean isInitialHandshake; - - // List of enabled protocols - private ProtocolList enabledProtocols; - - // List of enabled CipherSuites - private CipherSuiteList enabledCipherSuites; - - // The endpoint identification protocol - String identificationProtocol; - - // The cryptographic algorithm constraints - AlgorithmConstraints algorithmConstraints = null; - - // Local supported signature and algorithms - private Collection<SignatureAndHashAlgorithm> localSupportedSignAlgs; - - // Peer supported signature and algorithms - Collection<SignatureAndHashAlgorithm> peerSupportedSignAlgs; - - /* - * List of active protocols - * - * Active protocols is a subset of enabled protocols, and will - * contain only those protocols that have vaild cipher suites - * enabled. - */ - private ProtocolList activeProtocols; - - /* - * List of active cipher suites - * - * Active cipher suites is a subset of enabled cipher suites, and will - * contain only those cipher suites available for the active protocols. - */ - private CipherSuiteList activeCipherSuites; - - // The server name indication and matchers - List<SNIServerName> serverNames = Collections.<SNIServerName>emptyList(); - Collection<SNIMatcher> sniMatchers = Collections.<SNIMatcher>emptyList(); - - // List of local ApplicationProtocols - String[] localApl = null; - - // Negotiated ALPN value - String applicationProtocol = null; - - // Application protocol callback function (for SSLEngine) - BiFunction<SSLEngine,List<String>,String> - appProtocolSelectorSSLEngine = null; - - // Application protocol callback function (for SSLSocket) - BiFunction<SSLSocket,List<String>,String> - appProtocolSelectorSSLSocket = null; - - // The maximum expected network packet size for SSL/TLS/DTLS records. - int maximumPacketSize = 0; - - private boolean isClient; - private boolean needCertVerify; - - SSLSocketImpl conn = null; - SSLEngineImpl engine = null; - - HandshakeHash handshakeHash; - HandshakeInStream input; - HandshakeOutStream output; - SSLContextImpl sslContext; - RandomCookie clnt_random, svr_random; - SSLSessionImpl session; - - HandshakeStateManager handshakeState; - boolean clientHelloDelivered; - boolean serverHelloRequested; - boolean handshakeActivated; - boolean handshakeFinished; - - // current CipherSuite. Never null, initially SSL_NULL_WITH_NULL_NULL - CipherSuite cipherSuite; - - // current key exchange. Never null, initially K_NULL - KeyExchange keyExchange; - - // True if this session is being resumed (fast handshake) - boolean resumingSession; - - // True if it's OK to start a new SSL session - boolean enableNewSession; - - // Whether local cipher suites preference should be honored during - // handshaking? - // - // Note that in this provider, this option only applies to server side. - // Local cipher suites preference is always honored in client side in - // this provider. - boolean preferLocalCipherSuites = false; - - // Temporary storage for the individual keys. Set by - // calculateConnectionKeys() and cleared once the ciphers are - // activated. - private SecretKey clntWriteKey, svrWriteKey; - private IvParameterSpec clntWriteIV, svrWriteIV; - private SecretKey clntMacSecret, svrMacSecret; - - /* - * Delegated task subsystem data structures. - * - * If thrown is set, we need to propagate this back immediately - * on entry into processMessage(). - * - * Data is protected by the SSLEngine.this lock. - */ - private volatile boolean taskDelegated = false; - private volatile DelegatedTask<?> delegatedTask = null; - private volatile Exception thrown = null; - - // Could probably use a java.util.concurrent.atomic.AtomicReference - // here instead of using this lock. Consider changing. - private Object thrownLock = new Object(); - - /* Class and subclass dynamic debugging support */ - static final Debug debug = Debug.getInstance("ssl"); - - // By default, disable the unsafe legacy session renegotiation - static final boolean allowUnsafeRenegotiation = Debug.getBooleanProperty( - "sun.security.ssl.allowUnsafeRenegotiation", false); - - // For maximum interoperability and backward compatibility, RFC 5746 - // allows server (or client) to accept ClientHello (or ServerHello) - // message without the secure renegotiation_info extension or SCSV. - // - // For maximum security, RFC 5746 also allows server (or client) to - // reject such message with a fatal "handshake_failure" alert. - // - // By default, allow such legacy hello messages. - static final boolean allowLegacyHelloMessages = Debug.getBooleanProperty( - "sun.security.ssl.allowLegacyHelloMessages", true); - - // To prevent the TLS renegotiation issues, by setting system property - // "jdk.tls.rejectClientInitiatedRenegotiation" to true, applications in - // server side can disable all client initiated SSL renegotiations - // regardless of the support of TLS protocols. - // - // By default, allow client initiated renegotiations. - static final boolean rejectClientInitiatedRenego = - Debug.getBooleanProperty( - "jdk.tls.rejectClientInitiatedRenegotiation", false); - - // To switch off the extended_master_secret extension. - static final boolean useExtendedMasterSecret; - - // Allow session resumption without Extended Master Secret extension. - static final boolean allowLegacyResumption = - Debug.getBooleanProperty("jdk.tls.allowLegacyResumption", true); - - // Allow full handshake without Extended Master Secret extension. - static final boolean allowLegacyMasterSecret = - Debug.getBooleanProperty("jdk.tls.allowLegacyMasterSecret", true); - - // Is it requested to use extended master secret extension? - boolean requestedToUseEMS = false; - - // need to dispose the object when it is invalidated - boolean invalidated; - - /* - * Is this an instance for Datagram Transport Layer Security (DTLS)? - */ - final boolean isDTLS; - - // Is the extended_master_secret extension supported? - static { - boolean supportExtendedMasterSecret = true; - try { - KeyGenerator kg = - JsseJce.getKeyGenerator("SunTlsExtendedMasterSecret"); - } catch (NoSuchAlgorithmException nae) { - supportExtendedMasterSecret = false; - } - - if (supportExtendedMasterSecret) { - useExtendedMasterSecret = Debug.getBooleanProperty( - "jdk.tls.useExtendedMasterSecret", true); - } else { - useExtendedMasterSecret = false; - } - } - - Handshaker(SSLSocketImpl c, SSLContextImpl context, - ProtocolList enabledProtocols, boolean needCertVerify, - boolean isClient, ProtocolVersion activeProtocolVersion, - boolean isInitialHandshake, boolean secureRenegotiation, - byte[] clientVerifyData, byte[] serverVerifyData) { - this.conn = c; - this.isDTLS = false; - init(context, enabledProtocols, needCertVerify, isClient, - activeProtocolVersion, isInitialHandshake, secureRenegotiation, - clientVerifyData, serverVerifyData); - } - - Handshaker(SSLEngineImpl engine, SSLContextImpl context, - ProtocolList enabledProtocols, boolean needCertVerify, - boolean isClient, ProtocolVersion activeProtocolVersion, - boolean isInitialHandshake, boolean secureRenegotiation, - byte[] clientVerifyData, byte[] serverVerifyData, - boolean isDTLS) { - this.engine = engine; - this.isDTLS = isDTLS; - init(context, enabledProtocols, needCertVerify, isClient, - activeProtocolVersion, isInitialHandshake, secureRenegotiation, - clientVerifyData, serverVerifyData); - } - - private void init(SSLContextImpl context, ProtocolList enabledProtocols, - boolean needCertVerify, boolean isClient, - ProtocolVersion activeProtocolVersion, - boolean isInitialHandshake, boolean secureRenegotiation, - byte[] clientVerifyData, byte[] serverVerifyData) { - - if (debug != null && Debug.isOn("handshake")) { - System.out.println( - "Allow unsafe renegotiation: " + allowUnsafeRenegotiation + - "\nAllow legacy hello messages: " + allowLegacyHelloMessages + - "\nIs initial handshake: " + isInitialHandshake + - "\nIs secure renegotiation: " + secureRenegotiation); - } - - this.sslContext = context; - this.isClient = isClient; - this.needCertVerify = needCertVerify; - this.activeProtocolVersion = activeProtocolVersion; - this.isInitialHandshake = isInitialHandshake; - this.secureRenegotiation = secureRenegotiation; - this.clientVerifyData = clientVerifyData; - this.serverVerifyData = serverVerifyData; - this.enableNewSession = true; - this.invalidated = false; - this.handshakeState = new HandshakeStateManager(isDTLS); - this.clientHelloDelivered = false; - this.serverHelloRequested = false; - this.handshakeActivated = false; - this.handshakeFinished = false; - - setCipherSuite(CipherSuite.C_NULL); - setEnabledProtocols(enabledProtocols); - - if (conn != null) { - algorithmConstraints = new SSLAlgorithmConstraints(conn, true); - } else { // engine != null - algorithmConstraints = new SSLAlgorithmConstraints(engine, true); - } - } - - /* - * Reroutes calls to the SSLSocket or SSLEngine (*SE). - * - * We could have also done it by extra classes - * and letting them override, but this seemed much - * less involved. - */ - void fatalSE(byte b, String diagnostic) throws IOException { - fatalSE(b, diagnostic, null); - } - - void fatalSE(byte b, Throwable cause) throws IOException { - fatalSE(b, null, cause); - } - - void fatalSE(byte b, String diagnostic, Throwable cause) - throws IOException { - if (conn != null) { - conn.fatal(b, diagnostic, cause); - } else { - engine.fatal(b, diagnostic, cause); - } - } - - void warningSE(byte b) { - if (conn != null) { - conn.warning(b); - } else { - engine.warning(b); - } - } - - // ONLY used by ClientHandshaker to setup the peer host in SSLSession. - String getHostSE() { - if (conn != null) { - return conn.getHost(); - } else { - return engine.getPeerHost(); - } - } - - // ONLY used by ServerHandshaker to setup the peer host in SSLSession. - String getHostAddressSE() { - if (conn != null) { - return conn.getInetAddress().getHostAddress(); - } else { - /* - * This is for caching only, doesn't matter that's is really - * a hostname. The main thing is that it doesn't do - * a reverse DNS lookup, potentially slowing things down. - */ - return engine.getPeerHost(); - } - } - - int getPortSE() { - if (conn != null) { - return conn.getPort(); - } else { - return engine.getPeerPort(); - } - } - - int getLocalPortSE() { - if (conn != null) { - return conn.getLocalPort(); - } else { - return -1; - } - } - - AccessControlContext getAccSE() { - if (conn != null) { - return conn.getAcc(); - } else { - return engine.getAcc(); - } - } - - String getEndpointIdentificationAlgorithmSE() { - SSLParameters paras; - if (conn != null) { - paras = conn.getSSLParameters(); - } else { - paras = engine.getSSLParameters(); - } - - return paras.getEndpointIdentificationAlgorithm(); - } - - private void setVersionSE(ProtocolVersion protocolVersion) { - if (conn != null) { - conn.setVersion(protocolVersion); - } else { - engine.setVersion(protocolVersion); - } - } - - /** - * Set the active protocol version and propagate it to the SSLSocket - * and our handshake streams. Called from ClientHandshaker - * and ServerHandshaker with the negotiated protocol version. - */ - void setVersion(ProtocolVersion protocolVersion) { - this.protocolVersion = protocolVersion; - setVersionSE(protocolVersion); - } - - /** - * Set the enabled protocols. Called from the constructor or - * SSLSocketImpl/SSLEngineImpl.setEnabledProtocols() (if the - * handshake is not yet in progress). - */ - void setEnabledProtocols(ProtocolList enabledProtocols) { - activeCipherSuites = null; - activeProtocols = null; - - this.enabledProtocols = enabledProtocols; - } - - /** - * Set the enabled cipher suites. Called from - * SSLSocketImpl/SSLEngineImpl.setEnabledCipherSuites() (if the - * handshake is not yet in progress). - */ - void setEnabledCipherSuites(CipherSuiteList enabledCipherSuites) { - activeCipherSuites = null; - activeProtocols = null; - this.enabledCipherSuites = enabledCipherSuites; - } - - /** - * Set the algorithm constraints. Called from the constructor or - * SSLSocketImpl/SSLEngineImpl.setAlgorithmConstraints() (if the - * handshake is not yet in progress). - */ - void setAlgorithmConstraints(AlgorithmConstraints algorithmConstraints) { - activeCipherSuites = null; - activeProtocols = null; - - this.algorithmConstraints = - new SSLAlgorithmConstraints(algorithmConstraints); - this.localSupportedSignAlgs = null; - } - - Collection<SignatureAndHashAlgorithm> getLocalSupportedSignAlgs() { - if (localSupportedSignAlgs == null) { - localSupportedSignAlgs = - SignatureAndHashAlgorithm.getSupportedAlgorithms( - algorithmConstraints); - } - - return localSupportedSignAlgs; - } - - void setPeerSupportedSignAlgs( - Collection<SignatureAndHashAlgorithm> algorithms) { - peerSupportedSignAlgs = - new ArrayList<SignatureAndHashAlgorithm>(algorithms); - } - - Collection<SignatureAndHashAlgorithm> getPeerSupportedSignAlgs() { - return peerSupportedSignAlgs; - } - - - /** - * Set the identification protocol. Called from the constructor or - * SSLSocketImpl/SSLEngineImpl.setIdentificationProtocol() (if the - * handshake is not yet in progress). - */ - void setIdentificationProtocol(String protocol) { - this.identificationProtocol = protocol; - } - - /** - * Sets the server name indication of the handshake. - */ - void setSNIServerNames(List<SNIServerName> serverNames) { - // The serverNames parameter is unmodifiable. - this.serverNames = serverNames; - } - - /** - * Sets the server name matchers of the handshaking. - */ - void setSNIMatchers(Collection<SNIMatcher> sniMatchers) { - // The sniMatchers parameter is unmodifiable. - this.sniMatchers = sniMatchers; - } - - /** - * Sets the maximum packet size of the handshaking. - */ - void setMaximumPacketSize(int maximumPacketSize) { - this.maximumPacketSize = maximumPacketSize; - } - - /** - * Sets the Application Protocol list. - */ - void setApplicationProtocols(String[] apl) { - this.localApl = apl; - } - - /** - * Gets the "negotiated" ALPN value. - */ - String getHandshakeApplicationProtocol() { - return applicationProtocol; - } - - /** - * Sets the Application Protocol selector function for SSLEngine. - */ - void setApplicationProtocolSelectorSSLEngine( - BiFunction<SSLEngine,List<String>,String> selector) { - this.appProtocolSelectorSSLEngine = selector; - } - - /** - * Sets the Application Protocol selector function for SSLSocket. - */ - void setApplicationProtocolSelectorSSLSocket( - BiFunction<SSLSocket,List<String>,String> selector) { - this.appProtocolSelectorSSLSocket = selector; - } - - /** - * Sets the cipher suites preference. - */ - void setUseCipherSuitesOrder(boolean on) { - this.preferLocalCipherSuites = on; - } - - /** - * Prior to handshaking, activate the handshake and initialize the version, - * input stream and output stream. - */ - void activate(ProtocolVersion helloVersion) throws IOException { - if (activeProtocols == null) { - activeProtocols = getActiveProtocols(); - } - - if (activeProtocols.collection().isEmpty() || - activeProtocols.max.v == ProtocolVersion.NONE.v) { - throw new SSLHandshakeException( - "No appropriate protocol (protocol is disabled or " + - "cipher suites are inappropriate)"); - } - - if (activeCipherSuites == null) { - activeCipherSuites = getActiveCipherSuites(); - } - - if (activeCipherSuites.collection().isEmpty()) { - throw new SSLHandshakeException("No appropriate cipher suite"); - } - - // temporary protocol version until the actual protocol version - // is negotiated in the Hello exchange. This affects the record - // version we sent with the ClientHello. - if (!isInitialHandshake) { - protocolVersion = activeProtocolVersion; - } else { - protocolVersion = activeProtocols.max; - } - - if (helloVersion == null || helloVersion.v == ProtocolVersion.NONE.v) { - helloVersion = activeProtocols.helloVersion; - } - - // We accumulate digests of the handshake messages so that - // we can read/write CertificateVerify and Finished messages, - // getting assurance against some particular active attacks. - handshakeHash = new HandshakeHash(needCertVerify); - - // Generate handshake input/output stream. - if (conn != null) { - input = new HandshakeInStream(); - output = new HandshakeOutStream(conn.outputRecord); - - conn.inputRecord.setHandshakeHash(handshakeHash); - conn.inputRecord.setHelloVersion(helloVersion); - - conn.outputRecord.setHandshakeHash(handshakeHash); - conn.outputRecord.setHelloVersion(helloVersion); - conn.outputRecord.setVersion(protocolVersion); - } else if (engine != null) { - input = new HandshakeInStream(); - output = new HandshakeOutStream(engine.outputRecord); - - engine.inputRecord.setHandshakeHash(handshakeHash); - engine.inputRecord.setHelloVersion(helloVersion); - - engine.outputRecord.setHandshakeHash(handshakeHash); - engine.outputRecord.setHelloVersion(helloVersion); - engine.outputRecord.setVersion(protocolVersion); - } - - handshakeActivated = true; - } - - /** - * Set cipherSuite and keyExchange to the given CipherSuite. - * Does not perform any verification that this is a valid selection, - * this must be done before calling this method. - */ - void setCipherSuite(CipherSuite s) { - this.cipherSuite = s; - this.keyExchange = s.keyExchange; - } - - /** - * Check if the given ciphersuite is enabled and available within the - * current active cipher suites. - * - * Does not check if the required server certificates are available. - */ - boolean isNegotiable(CipherSuite s) { - if (activeCipherSuites == null) { - activeCipherSuites = getActiveCipherSuites(); - } - - return isNegotiable(activeCipherSuites, s); - } - - /** - * Check if the given ciphersuite is enabled and available within the - * proposed cipher suite list. - * - * Does not check if the required server certificates are available. - */ - static final boolean isNegotiable(CipherSuiteList proposed, CipherSuite s) { - return proposed.contains(s) && s.isNegotiable(); - } - - /** - * Check if the given protocol version is enabled and available. - */ - boolean isNegotiable(ProtocolVersion protocolVersion) { - if (activeProtocols == null) { - activeProtocols = getActiveProtocols(); - } - - return activeProtocols.contains(protocolVersion); - } - - /** - * Select a protocol version from the list. Called from - * ServerHandshaker to negotiate protocol version. - * - * Return the lower of the protocol version suggested in the - * clien hello and the highest supported by the server. - */ - ProtocolVersion selectProtocolVersion(ProtocolVersion protocolVersion) { - if (activeProtocols == null) { - activeProtocols = getActiveProtocols(); - } - - return activeProtocols.selectProtocolVersion(protocolVersion); - } - - /** - * Get the active cipher suites. - * - * In TLS 1.1, many weak or vulnerable cipher suites were obsoleted, - * such as TLS_RSA_EXPORT_WITH_RC4_40_MD5. The implementation MUST NOT - * negotiate these cipher suites in TLS 1.1 or later mode. - * - * Therefore, when the active protocols only include TLS 1.1 or later, - * the client cannot request to negotiate those obsoleted cipher - * suites. That is, the obsoleted suites should not be included in the - * client hello. So we need to create a subset of the enabled cipher - * suites, the active cipher suites, which does not contain obsoleted - * cipher suites of the minimum active protocol. - * - * Return empty list instead of null if no active cipher suites. - */ - CipherSuiteList getActiveCipherSuites() { - if (activeCipherSuites == null) { - if (activeProtocols == null) { - activeProtocols = getActiveProtocols(); - } - - ArrayList<CipherSuite> suites = new ArrayList<>(); - if (!(activeProtocols.collection().isEmpty()) && - activeProtocols.min.v != ProtocolVersion.NONE.v) { - Map<NamedGroupType, Boolean> cachedStatus = - new EnumMap<>(NamedGroupType.class); - for (CipherSuite suite : enabledCipherSuites.collection()) { - if (suite.isAvailable() && - (!activeProtocols.min.obsoletes(suite)) && - activeProtocols.max.supports(suite)) { - if (isActivatable(suite, cachedStatus)) { - suites.add(suite); - } - } else if (debug != null && Debug.isOn("verbose")) { - if (activeProtocols.min.obsoletes(suite)) { - System.out.println( - "Ignoring obsoleted cipher suite: " + suite); - } else { - System.out.println( - "Ignoring unsupported cipher suite: " + suite); - } - } - } - } - activeCipherSuites = new CipherSuiteList(suites); - } - - return activeCipherSuites; - } - - /* - * Get the active protocol versions. - * - * In TLS 1.1, many weak or vulnerable cipher suites were obsoleted, - * such as TLS_RSA_EXPORT_WITH_RC4_40_MD5. The implementation MUST NOT - * negotiate these cipher suites in TLS 1.1 or later mode. - * - * For example, if "TLS_RSA_EXPORT_WITH_RC4_40_MD5" is the - * only enabled cipher suite, the client cannot request TLS 1.1 or - * later, even though TLS 1.1 or later is enabled. We need to create a - * subset of the enabled protocols, called the active protocols, which - * contains protocols appropriate to the list of enabled Ciphersuites. - * - * Return empty list instead of null if no active protocol versions. - */ - ProtocolList getActiveProtocols() { - if (activeProtocols == null) { - boolean enabledSSL20Hello = false; - boolean checkedCurves = false; - boolean hasCurves = false; - ArrayList<ProtocolVersion> protocols = new ArrayList<>(4); - for (ProtocolVersion protocol : enabledProtocols.collection()) { - // Need not to check the SSL20Hello protocol. - if (protocol.v == ProtocolVersion.SSL20Hello.v) { - enabledSSL20Hello = true; - continue; - } - - if (!algorithmConstraints.permits( - EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), - protocol.name, null)) { - if (debug != null && Debug.isOn("verbose")) { - System.out.println( - "Ignoring disabled protocol: " + protocol); - } - - continue; - } - - boolean found = false; - Map<NamedGroupType, Boolean> cachedStatus = - new EnumMap<>(NamedGroupType.class); - for (CipherSuite suite : enabledCipherSuites.collection()) { - if (suite.isAvailable() && (!protocol.obsoletes(suite)) && - protocol.supports(suite)) { - if (isActivatable(suite, cachedStatus)) { - protocols.add(protocol); - found = true; - break; - } - } else if (debug != null && Debug.isOn("verbose")) { - System.out.println( - "Ignoring unsupported cipher suite: " + suite + - " for " + protocol); - } - } - - if (!found && (debug != null) && Debug.isOn("handshake")) { - System.out.println( - "No available cipher suite for " + protocol); - } - } - - if (!protocols.isEmpty() && enabledSSL20Hello) { - protocols.add(ProtocolVersion.SSL20Hello); - } - - activeProtocols = new ProtocolList(protocols); - } - - return activeProtocols; - } - - private boolean isActivatable(CipherSuite suite, - Map<NamedGroupType, Boolean> cachedStatus) { - - if (algorithmConstraints.permits( - EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), suite.name, null)) { - boolean available = true; - NamedGroupType groupType = suite.keyExchange.groupType; - if (groupType != NAMED_GROUP_NONE) { - Boolean checkedStatus = cachedStatus.get(groupType); - if (checkedStatus == null) { - available = SupportedGroupsExtension.isActivatable( - algorithmConstraints, groupType); - cachedStatus.put(groupType, available); - - if (!available && debug != null && Debug.isOn("verbose")) { - System.out.println("No activated named group"); - } - } else { - available = checkedStatus.booleanValue(); - } - - if (!available && debug != null && Debug.isOn("verbose")) { - System.out.println( - "No active named group, ignore " + suite); - } - - return available; - } else { - return true; - } - } else if (debug != null && Debug.isOn("verbose")) { - System.out.println("Ignoring disabled cipher suite: " + suite); - } - - return false; - } - - /** - * As long as handshaking has not activated, we can - * change whether session creations are allowed. - * - * Callers should do their own checking if handshaking - * has activated. - */ - void setEnableSessionCreation(boolean newSessions) { - enableNewSession = newSessions; - } - - /** - * Create a new read cipher and return it to caller. - */ - CipherBox newReadCipher() throws NoSuchAlgorithmException { - BulkCipher cipher = cipherSuite.cipher; - CipherBox box; - if (isClient) { - box = cipher.newCipher(protocolVersion, svrWriteKey, svrWriteIV, - sslContext.getSecureRandom(), false); - svrWriteKey = null; - svrWriteIV = null; - } else { - box = cipher.newCipher(protocolVersion, clntWriteKey, clntWriteIV, - sslContext.getSecureRandom(), false); - clntWriteKey = null; - clntWriteIV = null; - } - return box; - } - - /** - * Create a new write cipher and return it to caller. - */ - CipherBox newWriteCipher() throws NoSuchAlgorithmException { - BulkCipher cipher = cipherSuite.cipher; - CipherBox box; - if (isClient) { - box = cipher.newCipher(protocolVersion, clntWriteKey, clntWriteIV, - sslContext.getSecureRandom(), true); - clntWriteKey = null; - clntWriteIV = null; - } else { - box = cipher.newCipher(protocolVersion, svrWriteKey, svrWriteIV, - sslContext.getSecureRandom(), true); - svrWriteKey = null; - svrWriteIV = null; - } - return box; - } - - /** - * Create a new read MAC and return it to caller. - */ - Authenticator newReadAuthenticator() - throws NoSuchAlgorithmException, InvalidKeyException { - - Authenticator authenticator = null; - if (cipherSuite.cipher.cipherType == AEAD_CIPHER) { - authenticator = new Authenticator(protocolVersion); - } else { - MacAlg macAlg = cipherSuite.macAlg; - if (isClient) { - authenticator = macAlg.newMac(protocolVersion, svrMacSecret); - svrMacSecret = null; - } else { - authenticator = macAlg.newMac(protocolVersion, clntMacSecret); - clntMacSecret = null; - } - } - - return authenticator; - } - - /** - * Create a new write MAC and return it to caller. - */ - Authenticator newWriteAuthenticator() - throws NoSuchAlgorithmException, InvalidKeyException { - - Authenticator authenticator = null; - if (cipherSuite.cipher.cipherType == AEAD_CIPHER) { - authenticator = new Authenticator(protocolVersion); - } else { - MacAlg macAlg = cipherSuite.macAlg; - if (isClient) { - authenticator = macAlg.newMac(protocolVersion, clntMacSecret); - clntMacSecret = null; - } else { - authenticator = macAlg.newMac(protocolVersion, svrMacSecret); - svrMacSecret = null; - } - } - - return authenticator; - } - - /* - * Returns true iff the handshake sequence is done, so that - * this freshly created session can become the current one. - */ - boolean isDone() { - return started() && handshakeState.isEmpty() && handshakeFinished; - } - - - /* - * Returns the session which was created through this - * handshake sequence ... should be called after isDone() - * returns true. - */ - SSLSessionImpl getSession() { - return session; - } - - /* - * Set the handshake session - */ - void setHandshakeSessionSE(SSLSessionImpl handshakeSession) { - if (conn != null) { - conn.setHandshakeSession(handshakeSession); - } else { - engine.setHandshakeSession(handshakeSession); - } - } - - void expectingFinishFlightSE() { - if (conn != null) { - conn.expectingFinishFlight(); - } else { - engine.expectingFinishFlight(); - } - } - - /* - * Returns true if renegotiation is in use for this connection. - */ - boolean isSecureRenegotiation() { - return secureRenegotiation; - } - - /* - * Returns the verify_data from the Finished message sent by the client. - */ - byte[] getClientVerifyData() { - return clientVerifyData; - } - - /* - * Returns the verify_data from the Finished message sent by the server. - */ - byte[] getServerVerifyData() { - return serverVerifyData; - } - - /* - * This routine is fed SSL handshake records when they become available, - * and processes messages found therein. - */ - void processRecord(ByteBuffer record, - boolean expectingFinished) throws IOException { - - checkThrown(); - - /* - * Store the incoming handshake data, then see if we can - * now process any completed handshake messages - */ - input.incomingRecord(record); - - /* - * We don't need to create a separate delegatable task - * for finished messages. - */ - if ((conn != null) || expectingFinished) { - processLoop(); - } else { - delegateTask(new PrivilegedExceptionAction<Void>() { - @Override - public Void run() throws Exception { - processLoop(); - return null; - } - }); - } - } - - /* - * On input, we hash messages one at a time since servers may need - * to access an intermediate hash to validate a CertificateVerify - * message. - * - * Note that many handshake messages can come in one record (and often - * do, to reduce network resource utilization), and one message can also - * require multiple records (e.g. very large Certificate messages). - */ - void processLoop() throws IOException { - - // need to read off 4 bytes at least to get the handshake - // message type and length. - while (input.available() >= 4) { - byte messageType; - int messageLen; - - /* - * See if we can read the handshake message header, and - * then the entire handshake message. If not, wait till - * we can read and process an entire message. - */ - input.mark(4); - - messageType = (byte)input.getInt8(); - if (HandshakeMessage.isUnsupported(messageType)) { - throw new SSLProtocolException( - "Received unsupported or unknown handshake message: " + - messageType); - } - - messageLen = input.getInt24(); - - if (input.available() < messageLen) { - input.reset(); - return; - } - - // Set the flags in the message receiving side. - if (messageType == HandshakeMessage.ht_client_hello) { - clientHelloDelivered = true; - } else if (messageType == HandshakeMessage.ht_hello_request) { - serverHelloRequested = true; - } - - /* - * Process the message. We require - * that processMessage() consumes the entire message. In - * lieu of explicit error checks (how?!) we assume that the - * data will look like garbage on encoding/processing errors, - * and that other protocol code will detect such errors. - * - * Note that digesting is normally deferred till after the - * message has been processed, though to process at least the - * client's Finished message (i.e. send the server's) we need - * to acccelerate that digesting. - * - * Also, note that hello request messages are never hashed; - * that includes the hello request header, too. - */ - processMessage(messageType, messageLen); - - // Reload if this message has been reserved. - // - // Note: in the implementation, only certificate_verify and - // finished messages are reserved. - if ((messageType == HandshakeMessage.ht_finished) || - (messageType == HandshakeMessage.ht_certificate_verify)) { - - handshakeHash.reload(); - } - } - } - - - /** - * Returns true iff the handshaker has been activated. - * - * In activated state, the handshaker may not send any messages out. - */ - boolean activated() { - return handshakeActivated; - } - - /** - * Returns true iff the handshaker has sent any messages. - */ - boolean started() { - return (serverHelloRequested || clientHelloDelivered); - } - - /* - * Used to kickstart the negotiation ... either writing a - * ClientHello or a HelloRequest as appropriate, whichever - * the subclass returns. NOP if handshaking's already started. - */ - void kickstart() throws IOException { - if ((isClient && clientHelloDelivered) || - (!isClient && serverHelloRequested)) { - return; - } - - HandshakeMessage m = getKickstartMessage(); - handshakeState.update(m, resumingSession); - - if (debug != null && Debug.isOn("handshake")) { - m.print(System.out); - } - m.write(output); - output.flush(); - - // Set the flags in the message delivering side. - int handshakeType = m.messageType(); - if (handshakeType == HandshakeMessage.ht_hello_request) { - serverHelloRequested = true; - } else { // HandshakeMessage.ht_client_hello - clientHelloDelivered = true; - } - } - - /** - * Both client and server modes can start handshaking; but the - * message they send to do so is different. - */ - abstract HandshakeMessage getKickstartMessage() throws SSLException; - - /* - * Client and Server side protocols are each driven though this - * call, which processes a single message and drives the appropriate - * side of the protocol state machine (depending on the subclass). - */ - abstract void processMessage(byte messageType, int messageLen) - throws IOException; - - /* - * Most alerts in the protocol relate to handshaking problems. - * Alerts are detected as the connection reads data. - */ - abstract void handshakeAlert(byte description) throws SSLProtocolException; - - /* - * Sends a change cipher spec message and updates the write side - * cipher state so that future messages use the just-negotiated spec. - */ - void sendChangeCipherSpec(Finished mesg, boolean lastMessage) - throws IOException { - - output.flush(); // i.e. handshake data - - /* - * The write cipher state is protected by the connection write lock - * so we must grab it while making the change. We also - * make sure no writes occur between sending the ChangeCipherSpec - * message, installing the new cipher state, and sending the - * Finished message. - * - * We already hold SSLEngine/SSLSocket "this" by virtue - * of this being called from the readRecord code. - */ - if (conn != null) { - conn.writeLock.lock(); - try { - handshakeState.changeCipherSpec(false, isClient); - conn.changeWriteCiphers(); - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - handshakeState.update(mesg, resumingSession); - mesg.write(output); - output.flush(); - } finally { - conn.writeLock.unlock(); - } - } else { - synchronized (engine.writeLock) { - handshakeState.changeCipherSpec(false, isClient); - engine.changeWriteCiphers(); - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - handshakeState.update(mesg, resumingSession); - mesg.write(output); - output.flush(); - } - } - - if (lastMessage) { - handshakeFinished = true; - } - } - - void receiveChangeCipherSpec() throws IOException { - handshakeState.changeCipherSpec(true, isClient); - } - - /* - * Single access point to key calculation logic. Given the - * pre-master secret and the nonces from client and server, - * produce all the keying material to be used. - */ - void calculateKeys(SecretKey preMasterSecret, ProtocolVersion version) { - SecretKey master = calculateMasterSecret(preMasterSecret, version); - session.setMasterSecret(master); - calculateConnectionKeys(master); - } - - /* - * Calculate the master secret from its various components. This is - * used for key exchange by all cipher suites. - * - * The master secret is the catenation of three MD5 hashes, each - * consisting of the pre-master secret and a SHA1 hash. Those three - * SHA1 hashes are of (different) constant strings, the pre-master - * secret, and the nonces provided by the client and the server. - */ - @SuppressWarnings("deprecation") - private SecretKey calculateMasterSecret(SecretKey preMasterSecret, - ProtocolVersion requestedVersion) { - - if (debug != null && Debug.isOn("keygen")) { - HexDumpEncoder dump = new HexDumpEncoder(); - - System.out.println("SESSION KEYGEN:"); - - System.out.println("PreMaster Secret:"); - printHex(dump, preMasterSecret.getEncoded()); - - // Nonces are dumped with connection keygen, no - // benefit to doing it twice - } - - // What algs/params do we need to use? - String masterAlg; - PRF prf; - - byte majorVersion = protocolVersion.major; - byte minorVersion = protocolVersion.minor; - if (protocolVersion.isDTLSProtocol()) { - // Use TLS version number for DTLS key calculation - if (protocolVersion.v == ProtocolVersion.DTLS10.v) { - majorVersion = ProtocolVersion.TLS11.major; - minorVersion = ProtocolVersion.TLS11.minor; - - masterAlg = "SunTlsMasterSecret"; - prf = P_NONE; - } else { // DTLS 1.2 - majorVersion = ProtocolVersion.TLS12.major; - minorVersion = ProtocolVersion.TLS12.minor; - - masterAlg = "SunTls12MasterSecret"; - prf = cipherSuite.prfAlg; - } - } else { - if (protocolVersion.v >= ProtocolVersion.TLS12.v) { - masterAlg = "SunTls12MasterSecret"; - prf = cipherSuite.prfAlg; - } else { - masterAlg = "SunTlsMasterSecret"; - prf = P_NONE; - } - } - - String prfHashAlg = prf.getPRFHashAlg(); - int prfHashLength = prf.getPRFHashLength(); - int prfBlockSize = prf.getPRFBlockSize(); - - TlsMasterSecretParameterSpec spec; - if (session.getUseExtendedMasterSecret()) { - // reset to use the extended master secret algorithm - masterAlg = "SunTlsExtendedMasterSecret"; - - byte[] sessionHash = null; - if (protocolVersion.useTLS12PlusSpec()) { - sessionHash = handshakeHash.getFinishedHash(); - } else { - // TLS 1.0/1.1, DTLS 1.0 - sessionHash = new byte[36]; - try { - handshakeHash.getMD5Clone().digest(sessionHash, 0, 16); - handshakeHash.getSHAClone().digest(sessionHash, 16, 20); - } catch (DigestException de) { - throw new ProviderException(de); - } - } - - spec = new TlsMasterSecretParameterSpec( - preMasterSecret, - (majorVersion & 0xFF), (minorVersion & 0xFF), - sessionHash, - prfHashAlg, prfHashLength, prfBlockSize); - } else { - spec = new TlsMasterSecretParameterSpec( - preMasterSecret, - (majorVersion & 0xFF), (minorVersion & 0xFF), - clnt_random.random_bytes, svr_random.random_bytes, - prfHashAlg, prfHashLength, prfBlockSize); - } - - try { - KeyGenerator kg = JsseJce.getKeyGenerator(masterAlg); - kg.init(spec); - return kg.generateKey(); - } catch (InvalidAlgorithmParameterException | - NoSuchAlgorithmException iae) { - // unlikely to happen, otherwise, must be a provider exception - // - // For RSA premaster secrets, do not signal a protocol error - // due to the Bleichenbacher attack. See comments further down. - if (debug != null && Debug.isOn("handshake")) { - System.out.println("RSA master secret generation error:"); - iae.printStackTrace(System.out); - } - throw new ProviderException(iae); - - } - } - - /* - * Calculate the keys needed for this connection, once the session's - * master secret has been calculated. Uses the master key and nonces; - * the amount of keying material generated is a function of the cipher - * suite that's been negotiated. - * - * This gets called both on the "full handshake" (where we exchanged - * a premaster secret and started a new session) as well as on the - * "fast handshake" (where we just resumed a pre-existing session). - */ - @SuppressWarnings("deprecation") - void calculateConnectionKeys(SecretKey masterKey) { - /* - * For both the read and write sides of the protocol, we use the - * master to generate MAC secrets and cipher keying material. Block - * ciphers need initialization vectors, which we also generate. - * - * First we figure out how much keying material is needed. - */ - int hashSize = cipherSuite.macAlg.size; - boolean is_exportable = cipherSuite.exportable; - BulkCipher cipher = cipherSuite.cipher; - int expandedKeySize = is_exportable ? cipher.expandedKeySize : 0; - - // Which algs/params do we need to use? - String keyMaterialAlg; - PRF prf; - - byte majorVersion = protocolVersion.major; - byte minorVersion = protocolVersion.minor; - if (protocolVersion.isDTLSProtocol()) { - // Use TLS version number for DTLS key calculation - if (protocolVersion.v == ProtocolVersion.DTLS10.v) { - majorVersion = ProtocolVersion.TLS11.major; - minorVersion = ProtocolVersion.TLS11.minor; - - keyMaterialAlg = "SunTlsKeyMaterial"; - prf = P_NONE; - } else { // DTLS 1.2+ - majorVersion = ProtocolVersion.TLS12.major; - minorVersion = ProtocolVersion.TLS12.minor; - - keyMaterialAlg = "SunTls12KeyMaterial"; - prf = cipherSuite.prfAlg; - } - } else { - if (protocolVersion.v >= ProtocolVersion.TLS12.v) { - keyMaterialAlg = "SunTls12KeyMaterial"; - prf = cipherSuite.prfAlg; - } else { - keyMaterialAlg = "SunTlsKeyMaterial"; - prf = P_NONE; - } - } - - String prfHashAlg = prf.getPRFHashAlg(); - int prfHashLength = prf.getPRFHashLength(); - int prfBlockSize = prf.getPRFBlockSize(); - - // TLS v1.1+ and DTLS use an explicit IV in CBC cipher suites to - // protect against the CBC attacks. AEAD/GCM cipher suites in TLS - // v1.2 or later use a fixed IV as the implicit part of the partially - // implicit nonce technique described in RFC 5116. - int ivSize = cipher.ivSize; - if (cipher.cipherType == AEAD_CIPHER) { - ivSize = cipher.fixedIvSize; - } else if ((cipher.cipherType == BLOCK_CIPHER) && - protocolVersion.useTLS11PlusSpec()) { - ivSize = 0; - } - - TlsKeyMaterialParameterSpec spec = new TlsKeyMaterialParameterSpec( - masterKey, (majorVersion & 0xFF), (minorVersion & 0xFF), - clnt_random.random_bytes, svr_random.random_bytes, - cipher.algorithm, cipher.keySize, expandedKeySize, - ivSize, hashSize, - prfHashAlg, prfHashLength, prfBlockSize); - - try { - KeyGenerator kg = JsseJce.getKeyGenerator(keyMaterialAlg); - kg.init(spec); - TlsKeyMaterialSpec keySpec = (TlsKeyMaterialSpec)kg.generateKey(); - - // Return null if cipher keys are not supposed to be generated. - clntWriteKey = keySpec.getClientCipherKey(); - svrWriteKey = keySpec.getServerCipherKey(); - - // Return null if IVs are not supposed to be generated. - clntWriteIV = keySpec.getClientIv(); - svrWriteIV = keySpec.getServerIv(); - - // Return null if MAC keys are not supposed to be generated. - clntMacSecret = keySpec.getClientMacKey(); - svrMacSecret = keySpec.getServerMacKey(); - } catch (GeneralSecurityException e) { - throw new ProviderException(e); - } - - // - // Dump the connection keys as they're generated. - // - if (debug != null && Debug.isOn("keygen")) { - synchronized (System.out) { - HexDumpEncoder dump = new HexDumpEncoder(); - - System.out.println("CONNECTION KEYGEN:"); - - // Inputs: - System.out.println("Client Nonce:"); - printHex(dump, clnt_random.random_bytes); - System.out.println("Server Nonce:"); - printHex(dump, svr_random.random_bytes); - System.out.println("Master Secret:"); - printHex(dump, masterKey.getEncoded()); - - // Outputs: - if (clntMacSecret != null) { - System.out.println("Client MAC write Secret:"); - printHex(dump, clntMacSecret.getEncoded()); - System.out.println("Server MAC write Secret:"); - printHex(dump, svrMacSecret.getEncoded()); - } else { - System.out.println("... no MAC keys used for this cipher"); - } - - if (clntWriteKey != null) { - System.out.println("Client write key:"); - printHex(dump, clntWriteKey.getEncoded()); - System.out.println("Server write key:"); - printHex(dump, svrWriteKey.getEncoded()); - } else { - System.out.println("... no encryption keys used"); - } - - if (clntWriteIV != null) { - System.out.println("Client write IV:"); - printHex(dump, clntWriteIV.getIV()); - System.out.println("Server write IV:"); - printHex(dump, svrWriteIV.getIV()); - } else { - if (protocolVersion.useTLS11PlusSpec()) { - System.out.println( - "... no IV derived for this protocol"); - } else { - System.out.println("... no IV used for this cipher"); - } - } - System.out.flush(); - } - } - } - - private static void printHex(HexDumpEncoder dump, byte[] bytes) { - if (bytes == null) { - System.out.println("(key bytes not available)"); - } else { - try { - dump.encodeBuffer(bytes, System.out); - } catch (IOException e) { - // just for debugging, ignore this - } - } - } - - /* - * Implement a simple task delegator. - * - * We are currently implementing this as a single delegator, may - * try for parallel tasks later. Client Authentication could - * benefit from this, where ClientKeyExchange/CertificateVerify - * could be carried out in parallel. - */ - class DelegatedTask<E> implements Runnable { - - private PrivilegedExceptionAction<E> pea; - - DelegatedTask(PrivilegedExceptionAction<E> pea) { - this.pea = pea; - } - - public void run() { - synchronized (engine) { - try { - AccessController.doPrivileged(pea, engine.getAcc()); - } catch (PrivilegedActionException pae) { - thrown = pae.getException(); - } catch (RuntimeException rte) { - thrown = rte; - } - delegatedTask = null; - taskDelegated = false; - } - } - } - - private <T> void delegateTask(PrivilegedExceptionAction<T> pea) { - delegatedTask = new DelegatedTask<T>(pea); - taskDelegated = false; - thrown = null; - } - - DelegatedTask<?> getTask() { - if (!taskDelegated) { - taskDelegated = true; - return delegatedTask; - } else { - return null; - } - } - - /* - * See if there are any tasks which need to be delegated - * - * Locked by SSLEngine.this. - */ - boolean taskOutstanding() { - return (delegatedTask != null); - } - - /* - * The previous caller failed for some reason, report back the - * Exception. We won't worry about Error's. - * - * Locked by SSLEngine.this. - */ - void checkThrown() throws SSLException { - synchronized (thrownLock) { - if (thrown != null) { - - String msg = thrown.getMessage(); - - if (msg == null) { - msg = "Delegated task threw Exception/Error"; - } - - /* - * See what the underlying type of exception is. We should - * throw the same thing. Chain thrown to the new exception. - */ - Exception e = thrown; - thrown = null; - - if (e instanceof RuntimeException) { - throw new RuntimeException(msg, e); - } else if (e instanceof SSLHandshakeException) { - throw (SSLHandshakeException) - new SSLHandshakeException(msg).initCause(e); - } else if (e instanceof SSLKeyException) { - throw (SSLKeyException) - new SSLKeyException(msg).initCause(e); - } else if (e instanceof SSLPeerUnverifiedException) { - throw (SSLPeerUnverifiedException) - new SSLPeerUnverifiedException(msg).initCause(e); - } else if (e instanceof SSLProtocolException) { - throw (SSLProtocolException) - new SSLProtocolException(msg).initCause(e); - } else { - /* - * If it's SSLException or any other Exception, - * we'll wrap it in an SSLException. - */ - throw new SSLException(msg, e); - } - } - } - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeStateManager.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeStateManager.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HandshakeStateManager.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HandshakeStateManager.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,922 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.util.Collections; -import java.util.List; -import java.util.LinkedList; -import java.util.HashMap; -import javax.net.ssl.SSLProtocolException; - -import static sun.security.ssl.CipherSuite.KeyExchange; -import static sun.security.ssl.CipherSuite.KeyExchange.*; -import static sun.security.ssl.HandshakeStateManager.HandshakeState.*; -import static sun.security.ssl.HandshakeMessage.*; - -/* - * Handshake state manager. - * - * Messages flow for a full handshake: - * - * - - - * | HelloRequest (No.0, RFC 5246) [*] | - * | <-------------------------------------------- | - * | | - * | ClientHello (No.1, RFC 5246) | - * | --------------------------------------------> | - * | | - * | - HelloVerifyRequest (No.3, RFC 6347) - | - * | D | <-------------------------------------------- | D | - * | T | | T | - * | L | ClientHello (No.1, RFC 5246) | L | - * | S | --------------------------------------------> | S | - * | - - | - * | | - * C | ServerHello (No.2, RFC 5246) | S - * L | SupplementalData (No.23, RFC4680) [*] | E - * I | Certificate (No.11, RFC 5246) [*] | R - * E | CertificateStatus (No.22, RFC 6066) [*] | V - * N | ServerKeyExchange (No.12, RFC 5246) [*] | E - * T | CertificateRequest (No.13, RFC 5246) [*] | R - * | ServerHelloDone (No.14, RFC 5246) | - * | <-------------------------------------------- | - * | | - * | SupplementalData (No.23, RFC4680) [*] | - * | Certificate (No.11, RFC 5246) [*] Or | - * | CertificateURL (No.21, RFC6066) [*] | - * | ClientKeyExchange (No.16, RFC 5246) | - * | CertificateVerify (No.15, RFC 5246) [*] | - * | [ChangeCipherSpec] (RFC 5246) | - * | Finished (No.20, RFC 5246) | - * | --------------------------------------------> | - * | | - * | NewSessionTicket (No.4, RFC4507) [*] | - * | [ChangeCipherSpec] (RFC 5246) | - * | Finished (No.20, RFC 5246) | - * | <-------------------------------------------- | - * - - - * [*] Indicates optional or situation-dependent messages that are not - * always sent. - * - * Message flow for an abbreviated handshake: - * - - - * | ClientHello (No.1, RFC 5246) | - * | --------------------------------------------> | - * | | - * C | ServerHello (No.2, RFC 5246) | S - * L | NewSessionTicket (No.4, RFC4507) [*] | E - * I | [ChangeCipherSpec] (RFC 5246) | R - * E | Finished (No.20, RFC 5246) | V - * N | <-------------------------------------------- | E - * T | | R - * | [ChangeCipherSpec] (RFC 5246) | - * | Finished (No.20, RFC 5246) | - * | --------------------------------------------> | - * - - - * - * - * State machine of handshake states: - * - * +--------------+ - * START -----> | HelloRequest | - * | +--------------+ - * | | - * v v - * +---------------------+ --> +---------------------+ - * | ClientHello | | HelloVerifyRequest | - * +---------------------+ <-- +---------------------+ - * | - * | - * ========================================================================= - * | - * v - * +---------------------+ - * | ServerHello | ----------------------------------+------+ - * +---------------------+ --> +-------------------------+ | | - * | | Server SupplementalData | | | - * | +-------------------------+ | | - * | | | | - * v v | | - * +---------------------+ | | - * +---- | Server Certificate | | | - * | +---------------------+ | | - * | | | | - * | | +--------------------+ | | - * | +-> | CertificateStatus | | | - * | | +--------------------+ v | - * | | | | +--------------------+ | - * | v v +--> | ServerKeyExchange | | - * | +---------------------+ | +--------------------+ | - * | | CertificateRequest | | | | - * | +---------------------+ <-+---------+ | - * | | | | | - * v v | | | - * +---------------------+ <-------+ | | - * | ServerHelloDone | <-----------------+ | - * +---------------------+ | - * | | | - * | | | - * | | | - * ========================================================================= - * | | | - * | v | - * | +-------------------------+ | - * | | Client SupplementalData | --------------+ | - * | +-------------------------+ | | - * | | | | - * | v | | - * | +--------------------+ | | - * +-> | Client Certificate | ALT. | | - * | +--------------------+----------------+ | | - * | | CertificateURL | | | - * | +----------------+ | | - * v | | - * +-------------------+ <------------------------+ | - * | ClientKeyExchange | | - * +-------------------+ | - * | | | - * | v | - * | +-------------------+ | - * | | CertificateVerify | | - * | +-------------------+ | - * | | | - * v v | - * +-------------------------+ | - * | Client ChangeCipherSpec | <---------------+ | - * +-------------------------+ | | - * | | | - * v | | - * +-----------------+ (abbreviated) | | - * | Client Finished | -------------> END | | - * +-----------------+ (Abbreviated handshake) | | - * | | | - * | (full) | | - * | | | - * ================================ | | - * | | | - * | ================================ - * | | | - * v | | - * +------------------+ | (abbreviated) | - * | NewSessionTicket | <--------------------------------+ - * +------------------+ | | - * | | | - * v | | - * +-------------------------+ | (abbreviated) | - * | Server ChangeCipherSpec | <-------------------------------------+ - * +-------------------------+ | - * | | - * v | - * +-----------------+ (abbreviated) | - * | Server Finished | -------------------------+ - * +-----------------+ - * | (full) - * v - * END (Full handshake) - * - * - * The scenarios of the use of this class: - * 1. Create an instance of HandshakeStateManager during the initializtion - * handshake. - * 2. If receiving a handshake message, call HandshakeStateManager.check() - * to make sure that the message is of the expected handshake type. And - * then call HandshakeStateManager.update() in case handshake states may - * be impacted by this new incoming handshake message. - * 3. On delivering a handshake message, call HandshakeStateManager.update() - * in case handshake states may by thie new outgoing handshake message. - * 4. On receiving and delivering ChangeCipherSpec message, call - * HandshakeStateManager.changeCipherSpec() to check the present sequence - * of this message, and update the states if necessary. - */ -final class HandshakeStateManager { - // upcoming handshake states. - private LinkedList<HandshakeState> upcomingStates; - private LinkedList<HandshakeState> alternatives; - - private boolean isDTLS; - - private static final boolean debugIsOn; - - private static final HashMap<Byte, String> handshakeTypes; - - static { - debugIsOn = (Handshaker.debug != null) && - Debug.isOn("handshake") && Debug.isOn("verbose"); - handshakeTypes = new HashMap<>(15); - - handshakeTypes.put(ht_hello_request, "hello_request"); - handshakeTypes.put(ht_client_hello, "client_hello"); - handshakeTypes.put(ht_server_hello, "server_hello"); - handshakeTypes.put(ht_hello_verify_request, "hello_verify_request"); - handshakeTypes.put(ht_new_session_ticket, "session_ticket"); - handshakeTypes.put(ht_certificate, "certificate"); - handshakeTypes.put(ht_server_key_exchange, "server_key_exchange"); - handshakeTypes.put(ht_certificate_request, "certificate_request"); - handshakeTypes.put(ht_server_hello_done, "server_hello_done"); - handshakeTypes.put(ht_certificate_verify, "certificate_verify"); - handshakeTypes.put(ht_client_key_exchange, "client_key_exchange"); - handshakeTypes.put(ht_finished, "finished"); - handshakeTypes.put(ht_certificate_url, "certificate_url"); - handshakeTypes.put(ht_certificate_status, "certificate_status"); - handshakeTypes.put(ht_supplemental_data, "supplemental_data"); - } - - HandshakeStateManager(boolean isDTLS) { - this.upcomingStates = new LinkedList<>(); - this.alternatives = new LinkedList<>(); - this.isDTLS = isDTLS; - } - - // - // enumation of handshake type - // - static enum HandshakeState { - HS_HELLO_REQUEST( - "hello_request", - HandshakeMessage.ht_hello_request), - HS_CLIENT_HELLO( - "client_hello", - HandshakeMessage.ht_client_hello), - HS_HELLO_VERIFY_REQUEST( - "hello_verify_request", - HandshakeMessage.ht_hello_verify_request), - HS_SERVER_HELLO( - "server_hello", - HandshakeMessage.ht_server_hello), - HS_SERVER_SUPPLEMENTAL_DATA( - "server supplemental_data", - HandshakeMessage.ht_supplemental_data, true), - HS_SERVER_CERTIFICATE( - "server certificate", - HandshakeMessage.ht_certificate), - HS_CERTIFICATE_STATUS( - "certificate_status", - HandshakeMessage.ht_certificate_status, true), - HS_SERVER_KEY_EXCHANGE( - "server_key_exchange", - HandshakeMessage.ht_server_key_exchange, true), - HS_CERTIFICATE_REQUEST( - "certificate_request", - HandshakeMessage.ht_certificate_request, true), - HS_SERVER_HELLO_DONE( - "server_hello_done", - HandshakeMessage.ht_server_hello_done), - HS_CLIENT_SUPPLEMENTAL_DATA( - "client supplemental_data", - HandshakeMessage.ht_supplemental_data, true), - HS_CLIENT_CERTIFICATE( - "client certificate", - HandshakeMessage.ht_certificate, true), - HS_CERTIFICATE_URL( - "certificate_url", - HandshakeMessage.ht_certificate_url, true), - HS_CLIENT_KEY_EXCHANGE( - "client_key_exchange", - HandshakeMessage.ht_client_key_exchange), - HS_CERTIFICATE_VERIFY( - "certificate_verify", - HandshakeMessage.ht_certificate_verify, true), - HS_CLIENT_CHANGE_CIPHER_SPEC( - "client change_cipher_spec", - HandshakeMessage.ht_not_applicable), - HS_CLEINT_FINISHED( - "client finished", - HandshakeMessage.ht_finished), - HS_NEW_SESSION_TICKET( - "session_ticket", - HandshakeMessage.ht_new_session_ticket), - HS_SERVER_CHANGE_CIPHER_SPEC( - "server change_cipher_spec", - HandshakeMessage.ht_not_applicable), - HS_SERVER_FINISHED( - "server finished", - HandshakeMessage.ht_finished); - - final String description; - final byte handshakeType; - final boolean isOptional; - - HandshakeState(String description, byte handshakeType) { - this.description = description; - this.handshakeType = handshakeType; - this.isOptional = false; - } - - HandshakeState(String description, - byte handshakeType, boolean isOptional) { - - this.description = description; - this.handshakeType = handshakeType; - this.isOptional = isOptional; - } - - public String toString() { - return description + "[" + handshakeType + "]" + - (isOptional ? "(optional)" : ""); - } - } - - boolean isEmpty() { - return upcomingStates.isEmpty(); - } - - List<Byte> check(byte handshakeType) throws SSLProtocolException { - List<Byte> ignoredOptional = new LinkedList<>(); - String exceptionMsg = - "Handshake message sequence violation, " + handshakeType; - - if (debugIsOn) { - System.out.println( - "check handshake state: " + toString(handshakeType)); - } - - if (upcomingStates.isEmpty()) { - // Is it a kickstart message? - if ((handshakeType != HandshakeMessage.ht_hello_request) && - (handshakeType != HandshakeMessage.ht_client_hello)) { - - throw new SSLProtocolException( - "Handshake message sequence violation, " + handshakeType); - } - - // It is a kickstart message. - return Collections.emptyList(); - } - - // Ignore the checking for HelloRequest messages as they - // may be sent by the server at any time. - if (handshakeType == HandshakeMessage.ht_hello_request) { - return Collections.emptyList(); - } - - for (HandshakeState handshakeState : upcomingStates) { - if (handshakeState.handshakeType == handshakeType) { - // It's the expected next handshake type. - return ignoredOptional; - } - - if (handshakeState.isOptional) { - ignoredOptional.add(handshakeState.handshakeType); - continue; - } else { - for (HandshakeState alternative : alternatives) { - if (alternative.handshakeType == handshakeType) { - return ignoredOptional; - } - - if (alternative.isOptional) { - continue; - } else { - throw new SSLProtocolException(exceptionMsg); - } - } - } - - throw new SSLProtocolException(exceptionMsg); - } - - // Not an expected Handshake message. - throw new SSLProtocolException( - "Handshake message sequence violation, " + handshakeType); - } - - void update(HandshakeMessage handshakeMessage, - boolean isAbbreviated) throws SSLProtocolException { - - byte handshakeType = (byte)handshakeMessage.messageType(); - String exceptionMsg = - "Handshake message sequence violation, " + handshakeType; - - if (debugIsOn) { - System.out.println( - "update handshake state: " + toString(handshakeType)); - } - - boolean hasPresentState = false; - switch (handshakeType) { - case HandshakeMessage.ht_hello_request: - // - // State machine: - // PRESENT: START - // TO : ClientHello - // - - // No old state to update. - - // Add the upcoming states. - if (!upcomingStates.isEmpty()) { - // A ClientHello message should be followed. - upcomingStates.add(HS_CLIENT_HELLO); - - } // Otherwise, ignore this HelloRequest message. - - break; - - case HandshakeMessage.ht_client_hello: - // - // State machine: - // PRESENT: START - // HS_CLIENT_HELLO - // TO : HS_HELLO_VERIFY_REQUEST (DTLS) - // HS_SERVER_HELLO - // - - // Check and update the present state. - if (!upcomingStates.isEmpty()) { - // The current state should be HS_CLIENT_HELLO. - HandshakeState handshakeState = upcomingStates.pop(); - if (handshakeState != HS_CLIENT_HELLO) { - throw new SSLProtocolException(exceptionMsg); - } - } - - // Add the upcoming states. - ClientHello clientHello = (ClientHello)handshakeMessage; - if (isDTLS) { - // Is it an initial ClientHello message? - if (clientHello.cookie == null || - clientHello.cookie.length == 0) { - // Is it an abbreviated handshake? - if (clientHello.sessionId.length() != 0) { - // A HelloVerifyRequest message or a ServerHello - // message may follow the abbreviated session - // resuming handshake request. - upcomingStates.add(HS_HELLO_VERIFY_REQUEST); - alternatives.add(HS_SERVER_HELLO); - } else { - // A HelloVerifyRequest message should follow - // the initial ClientHello message. - upcomingStates.add(HS_HELLO_VERIFY_REQUEST); - } - } else { - // A HelloVerifyRequest may be followed if the cookie - // cannot be verified. - upcomingStates.add(HS_SERVER_HELLO); - alternatives.add(HS_HELLO_VERIFY_REQUEST); - } - } else { - upcomingStates.add(HS_SERVER_HELLO); - } - - break; - - case HandshakeMessage.ht_hello_verify_request: - // - // State machine: - // PRESENT: HS_HELLO_VERIFY_REQUEST - // TO : HS_CLIENT_HELLO - // - // Note that this state may have an alternative option. - - // Check and update the present state. - if (!upcomingStates.isEmpty()) { - // The current state should be HS_HELLO_VERIFY_REQUEST. - HandshakeState handshakeState = upcomingStates.pop(); - HandshakeState alternative = null; - if (!alternatives.isEmpty()) { - alternative = alternatives.pop(); - } - - if ((handshakeState != HS_HELLO_VERIFY_REQUEST) && - (alternative != HS_HELLO_VERIFY_REQUEST)) { - - throw new SSLProtocolException(exceptionMsg); - } - } else { - // No present state. - throw new SSLProtocolException(exceptionMsg); - } - - // Add the upcoming states. - upcomingStates.add(HS_CLIENT_HELLO); - - break; - - case HandshakeMessage.ht_server_hello: - // - // State machine: - // PRESENT: HS_SERVER_HELLO - // TO : - // Full handshake state stacks - // (ServerHello Flight) - // HS_SERVER_SUPPLEMENTAL_DATA [optional] - // --> HS_SERVER_CERTIFICATE [optional] - // --> HS_CERTIFICATE_STATUS [optional] - // --> HS_SERVER_KEY_EXCHANGE [optional] - // --> HS_CERTIFICATE_REQUEST [optional] - // --> HS_SERVER_HELLO_DONE - // (Client ClientKeyExchange Flight) - // --> HS_CLIENT_SUPPLEMENTAL_DATA [optional] - // --> HS_CLIENT_CERTIFICATE or - // HS_CERTIFICATE_URL - // --> HS_CLIENT_KEY_EXCHANGE - // --> HS_CERTIFICATE_VERIFY [optional] - // --> HS_CLIENT_CHANGE_CIPHER_SPEC - // --> HS_CLEINT_FINISHED - // (Server Finished Flight) - // --> HS_CLIENT_SUPPLEMENTAL_DATA [optional] - // - // Abbreviated handshake state stacks - // (Server Finished Flight) - // HS_NEW_SESSION_TICKET - // --> HS_SERVER_CHANGE_CIPHER_SPEC - // --> HS_SERVER_FINISHED - // (Client Finished Flight) - // --> HS_CLIENT_CHANGE_CIPHER_SPEC - // --> HS_CLEINT_FINISHED - // - // Note that this state may have an alternative option. - - // Check and update the present state. - if (!upcomingStates.isEmpty()) { - // The current state should be HS_SERVER_HELLO - HandshakeState handshakeState = upcomingStates.pop(); - HandshakeState alternative = null; - if (!alternatives.isEmpty()) { - alternative = alternatives.pop(); - } - - if ((handshakeState != HS_SERVER_HELLO) && - (alternative != HS_SERVER_HELLO)) { - - throw new SSLProtocolException(exceptionMsg); - } - } else { - // No present state. - throw new SSLProtocolException(exceptionMsg); - } - - // Add the upcoming states. - ServerHello serverHello = (ServerHello)handshakeMessage; - HelloExtensions hes = serverHello.extensions; - - - // Not support SessionTicket extension yet. - // - // boolean hasSessionTicketExt = - // (hes.get(HandshakeMessage.ht_new_session_ticket) != null); - - if (isAbbreviated) { - // Not support SessionTicket extension yet. - // - // // Mandatory NewSessionTicket message - // if (hasSessionTicketExt) { - // upcomingStates.add(HS_NEW_SESSION_TICKET); - // } - - // Mandatory server ChangeCipherSpec and Finished messages - upcomingStates.add(HS_SERVER_CHANGE_CIPHER_SPEC); - upcomingStates.add(HS_SERVER_FINISHED); - - // Mandatory client ChangeCipherSpec and Finished messages - upcomingStates.add(HS_CLIENT_CHANGE_CIPHER_SPEC); - upcomingStates.add(HS_CLEINT_FINISHED); - } else { - // Not support SupplementalData extension yet. - // - // boolean hasSupplementalDataExt = - // (hes.get(HandshakeMessage.ht_supplemental_data) != null); - - // Not support CertificateURL extension yet. - // - // boolean hasCertificateUrlExt = - // (hes.get(ExtensionType EXT_CLIENT_CERTIFICATE_URL) - // != null); - - // Not support SupplementalData extension yet. - // - // // Optional SupplementalData message - // if (hasSupplementalDataExt) { - // upcomingStates.add(HS_SERVER_SUPPLEMENTAL_DATA); - // } - - // Need server Certificate message or not? - KeyExchange keyExchange = serverHello.cipherSuite.keyExchange; - if ((keyExchange != K_KRB5) && - (keyExchange != K_KRB5_EXPORT) && - (keyExchange != K_DH_ANON) && - (keyExchange != K_ECDH_ANON)) { - // Mandatory Certificate message - upcomingStates.add(HS_SERVER_CERTIFICATE); - } - - // Optional CertificateStatus message - if (hes.get(ExtensionType.EXT_STATUS_REQUEST) != null || - hes.get(ExtensionType.EXT_STATUS_REQUEST_V2) != null) { - upcomingStates.add(HS_CERTIFICATE_STATUS); - } - - // Need ServerKeyExchange message or not? - if ((keyExchange == K_RSA_EXPORT) || - (keyExchange == K_DHE_RSA) || - (keyExchange == K_DHE_DSS) || - (keyExchange == K_DH_ANON) || - (keyExchange == K_ECDHE_RSA) || - (keyExchange == K_ECDHE_ECDSA) || - (keyExchange == K_ECDH_ANON)) { - // Optional ServerKeyExchange message - upcomingStates.add(HS_SERVER_KEY_EXCHANGE); - } - - // Optional CertificateRequest message - upcomingStates.add(HS_CERTIFICATE_REQUEST); - - // Mandatory ServerHelloDone message - upcomingStates.add(HS_SERVER_HELLO_DONE); - - // Not support SupplementalData extension yet. - // - // // Optional SupplementalData message - // if (hasSupplementalDataExt) { - // upcomingStates.add(HS_CLIENT_SUPPLEMENTAL_DATA); - // } - - // Optional client Certificate message - upcomingStates.add(HS_CLIENT_CERTIFICATE); - - // Not support CertificateURL extension yet. - // - // // Alternative CertificateURL message, optional too. - // // - // // Please put CertificateURL rather than Certificate - // // message in the alternatives list. So that we can - // // simplify the process of this alternative pair later. - // if (hasCertificateUrlExt) { - // alternatives.add(HS_CERTIFICATE_URL); - // } - - // Mandatory ClientKeyExchange message - upcomingStates.add(HS_CLIENT_KEY_EXCHANGE); - - // Optional CertificateVerify message - upcomingStates.add(HS_CERTIFICATE_VERIFY); - - // Mandatory client ChangeCipherSpec and Finished messages - upcomingStates.add(HS_CLIENT_CHANGE_CIPHER_SPEC); - upcomingStates.add(HS_CLEINT_FINISHED); - - // Not support SessionTicket extension yet. - // - // // Mandatory NewSessionTicket message - // if (hasSessionTicketExt) { - // upcomingStates.add(HS_NEW_SESSION_TICKET); - // } - - // Mandatory server ChangeCipherSpec and Finished messages - upcomingStates.add(HS_SERVER_CHANGE_CIPHER_SPEC); - upcomingStates.add(HS_SERVER_FINISHED); - } - - break; - - case HandshakeMessage.ht_certificate: - // - // State machine: - // PRESENT: HS_CERTIFICATE_URL or - // HS_CLIENT_CERTIFICATE - // TO : HS_CLIENT_KEY_EXCHANGE - // - // Or - // - // PRESENT: HS_SERVER_CERTIFICATE - // TO : HS_CERTIFICATE_STATUS [optional] - // HS_SERVER_KEY_EXCHANGE [optional] - // HS_CERTIFICATE_REQUEST [optional] - // HS_SERVER_HELLO_DONE - // - // Note that this state may have an alternative option. - - // Check and update the present state. - while (!upcomingStates.isEmpty()) { - HandshakeState handshakeState = upcomingStates.pop(); - if (handshakeState.handshakeType == handshakeType) { - hasPresentState = true; - - // The current state should be HS_CLIENT_CERTIFICATE or - // HS_SERVER_CERTIFICATE. - // - // Note that we won't put HS_CLIENT_CERTIFICATE into - // the alternative list. - if ((handshakeState != HS_CLIENT_CERTIFICATE) && - (handshakeState != HS_SERVER_CERTIFICATE)) { - throw new SSLProtocolException(exceptionMsg); - } - - // Is it an expected client Certificate message? - boolean isClientMessage = false; - if (!upcomingStates.isEmpty()) { - // If the next expected message is ClientKeyExchange, - // this one should be an expected client Certificate - // message. - HandshakeState nextState = upcomingStates.getFirst(); - if (nextState == HS_CLIENT_KEY_EXCHANGE) { - isClientMessage = true; - } - } - - if (isClientMessage) { - if (handshakeState != HS_CLIENT_CERTIFICATE) { - throw new SSLProtocolException(exceptionMsg); - } - - // Not support CertificateURL extension yet. - /******************************************* - // clear up the alternatives list - if (!alternatives.isEmpty()) { - HandshakeState alternative = alternatives.pop(); - - if (alternative != HS_CERTIFICATE_URL) { - throw new SSLProtocolException(exceptionMsg); - } - } - ********************************************/ - } else { - if ((handshakeState != HS_SERVER_CERTIFICATE)) { - throw new SSLProtocolException(exceptionMsg); - } - } - - break; - } else if (!handshakeState.isOptional) { - throw new SSLProtocolException(exceptionMsg); - } // Otherwise, looking for next state track. - } - - // No present state. - if (!hasPresentState) { - throw new SSLProtocolException(exceptionMsg); - } - - // no new upcoming states. - - break; - - // Not support CertificateURL extension yet. - /*************************************************/ - case HandshakeMessage.ht_certificate_url: - // - // State machine: - // PRESENT: HS_CERTIFICATE_URL or - // HS_CLIENT_CERTIFICATE - // TO : HS_CLIENT_KEY_EXCHANGE - // - // Note that this state may have an alternative option. - - // Check and update the present state. - while (!upcomingStates.isEmpty()) { - // The current state should be HS_CLIENT_CERTIFICATE. - // - // Note that we won't put HS_CLIENT_CERTIFICATE into - // the alternative list. - HandshakeState handshakeState = upcomingStates.pop(); - if (handshakeState.handshakeType == - HS_CLIENT_CERTIFICATE.handshakeType) { - hasPresentState = true; - - // Look for HS_CERTIFICATE_URL state track. - if (!alternatives.isEmpty()) { - HandshakeState alternative = alternatives.pop(); - - if (alternative != HS_CERTIFICATE_URL) { - throw new SSLProtocolException(exceptionMsg); - } - } else { - // No alternative CertificateUR state track. - throw new SSLProtocolException(exceptionMsg); - } - - if ((handshakeState != HS_CLIENT_CERTIFICATE)) { - throw new SSLProtocolException(exceptionMsg); - } - - break; - } else if (!handshakeState.isOptional) { - throw new SSLProtocolException(exceptionMsg); - } // Otherwise, looking for next state track. - - } - - // No present state. - if (!hasPresentState) { - // No present state. - throw new SSLProtocolException(exceptionMsg); - } - - // no new upcoming states. - - break; - /*************************************************/ - - default: - // Check and update the present state. - while (!upcomingStates.isEmpty()) { - HandshakeState handshakeState = upcomingStates.pop(); - if (handshakeState.handshakeType == handshakeType) { - hasPresentState = true; - break; - } else if (!handshakeState.isOptional) { - throw new SSLProtocolException(exceptionMsg); - } // Otherwise, looking for next state track. - } - - // No present state. - if (!hasPresentState) { - throw new SSLProtocolException(exceptionMsg); - } - - // no new upcoming states. - } - - if (debugIsOn) { - for (HandshakeState handshakeState : upcomingStates) { - System.out.println( - "upcoming handshake states: " + handshakeState); - } - for (HandshakeState handshakeState : alternatives) { - System.out.println( - "upcoming handshake alternative state: " + handshakeState); - } - } - } - - void changeCipherSpec(boolean isInput, - boolean isClient) throws SSLProtocolException { - - if (debugIsOn) { - System.out.println( - "update handshake state: change_cipher_spec"); - } - - String exceptionMsg = "ChangeCipherSpec message sequence violation"; - - HandshakeState expectedState; - if ((isClient && isInput) || (!isClient && !isInput)) { - expectedState = HS_SERVER_CHANGE_CIPHER_SPEC; - } else { - expectedState = HS_CLIENT_CHANGE_CIPHER_SPEC; - } - - boolean hasPresentState = false; - - // Check and update the present state. - while (!upcomingStates.isEmpty()) { - HandshakeState handshakeState = upcomingStates.pop(); - if (handshakeState == expectedState) { - hasPresentState = true; - break; - } else if (!handshakeState.isOptional) { - throw new SSLProtocolException(exceptionMsg); - } // Otherwise, looking for next state track. - } - - // No present state. - if (!hasPresentState) { - throw new SSLProtocolException(exceptionMsg); - } - - // no new upcoming states. - - if (debugIsOn) { - for (HandshakeState handshakeState : upcomingStates) { - System.out.println( - "upcoming handshake states: " + handshakeState); - } - for (HandshakeState handshakeState : alternatives) { - System.out.println( - "upcoming handshake alternative state: " + handshakeState); - } - } - } - - private static String toString(byte handshakeType) { - String s = handshakeTypes.get(handshakeType); - if (s == null) { - s = "unknown"; - } - return (s + "[" + handshakeType + "]"); - } -} - diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloCookieManager.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,119 +26,315 @@ package sun.security.ssl; import java.io.IOException; -import javax.net.ssl.SSLProtocolException; import java.security.MessageDigest; import java.security.SecureRandom; +import java.util.Arrays; +import static sun.security.ssl.ClientHello.ClientHelloMessage; -import sun.security.ssl.HandshakeMessage.ClientHello; - -/* - * HelloVerifyRequest cookie manager +/** + * (D)TLS handshake cookie manager */ -final class HelloCookieManager { - // the cookie secret life time - private static long COOKIE_TIMING_WINDOW = 3600000; // in milliseconds - private static int COOKIE_MAX_LENGTH_DTLS10 = 32; // 32 bytes - private static int COOKIE_MAX_LENGTH_DTLS12 = 0xFF; // 2^8 -1 bytes - - private final SecureRandom secureRandom; - private final MessageDigest cookieDigest; - - private int cookieVersion; // allow to wrap - private long secretLifetime; - private byte[] cookieSecret; - - private int prevCookieVersion; - private byte[] prevCookieSecret; - - HelloCookieManager(SecureRandom secureRandom) { - this.secureRandom = secureRandom; - this.cookieDigest = JsseJce.getMessageDigest("SHA-256"); - - this.cookieVersion = secureRandom.nextInt(); - this.secretLifetime = 0; - this.cookieSecret = null; +abstract class HelloCookieManager { - this.prevCookieVersion = 0; - this.prevCookieSecret = null; - } + static class Builder { + + final SecureRandom secureRandom; + + private volatile D10HelloCookieManager d10HelloCookieManager; + private volatile D13HelloCookieManager d13HelloCookieManager; + private volatile T13HelloCookieManager t13HelloCookieManager; + + Builder(SecureRandom secureRandom) { + this.secureRandom = secureRandom; + } - // Used by server side to generate cookies in HelloVerifyRequest message. - synchronized byte[] getCookie(ClientHello clientHelloMsg) { - if (secretLifetime < System.currentTimeMillis()) { - if (cookieSecret != null) { - prevCookieVersion = cookieVersion; - prevCookieSecret = cookieSecret.clone(); + HelloCookieManager valueOf(ProtocolVersion protocolVersion) { + if (protocolVersion.isDTLS) { + if (protocolVersion.useTLS13PlusSpec()) { + if (d13HelloCookieManager != null) { + return d13HelloCookieManager; + } + + synchronized (this) { + if (d13HelloCookieManager == null) { + d13HelloCookieManager = + new D13HelloCookieManager(secureRandom); + } + } + + return d13HelloCookieManager; + } else { + if (d10HelloCookieManager != null) { + return d10HelloCookieManager; + } + + synchronized (this) { + if (d10HelloCookieManager == null) { + d10HelloCookieManager = + new D10HelloCookieManager(secureRandom); + } + } + + return d10HelloCookieManager; + } } else { - cookieSecret = new byte[32]; + if (protocolVersion.useTLS13PlusSpec()) { + if (t13HelloCookieManager != null) { + return t13HelloCookieManager; + } + + synchronized (this) { + if (t13HelloCookieManager == null) { + t13HelloCookieManager = + new T13HelloCookieManager(secureRandom); + } + } + + return t13HelloCookieManager; + } } - cookieVersion++; - secureRandom.nextBytes(cookieSecret); - secretLifetime = System.currentTimeMillis() + COOKIE_TIMING_WINDOW; + return null; } + } - clientHelloMsg.updateHelloCookie(cookieDigest); - byte[] cookie = cookieDigest.digest(cookieSecret); // 32 bytes - cookie[0] = (byte)((cookieVersion >> 24) & 0xFF); - cookie[1] = (byte)((cookieVersion >> 16) & 0xFF); - cookie[2] = (byte)((cookieVersion >> 8) & 0xFF); - cookie[3] = (byte)(cookieVersion & 0xFF); + abstract byte[] createCookie(ServerHandshakeContext context, + ClientHelloMessage clientHello) throws IOException; - return cookie; - } + abstract boolean isCookieValid(ServerHandshakeContext context, + ClientHelloMessage clientHello, byte[] cookie) throws IOException; + + // DTLS 1.0/1.2 + private static final + class D10HelloCookieManager extends HelloCookieManager { + + final SecureRandom secureRandom; + private int cookieVersion; // allow to wrap, version + sequence + private byte[] cookieSecret; + private byte[] legacySecret; + + D10HelloCookieManager(SecureRandom secureRandom) { + this.secureRandom = secureRandom; + + this.cookieVersion = secureRandom.nextInt(); + this.cookieSecret = new byte[32]; + this.legacySecret = new byte[32]; - // Used by server side to check the cookie in ClientHello message. - synchronized boolean isValid(ClientHello clientHelloMsg) { - byte[] cookie = clientHelloMsg.cookie; - - // no cookie exchange or not a valid cookie length - if ((cookie == null) || (cookie.length != 32)) { - return false; - } - - int version = ((cookie[0] & 0xFF) << 24) | - ((cookie[1] & 0xFF) << 16) | - ((cookie[2] & 0xFF) << 8) | - (cookie[3] & 0xFF); - - byte[] secret; - if (version == cookieVersion) { - secret = cookieSecret; - } else if (version == prevCookieVersion) { - secret = prevCookieSecret; - } else { - return false; // may be out of the timing window + secureRandom.nextBytes(cookieSecret); + System.arraycopy(cookieSecret, 0, legacySecret, 0, 32); } - clientHelloMsg.updateHelloCookie(cookieDigest); - byte[] target = cookieDigest.digest(secret); // 32 bytes + @Override + byte[] createCookie(ServerHandshakeContext context, + ClientHelloMessage clientHello) throws IOException { + int version; + byte[] secret; + + synchronized (this) { + version = cookieVersion; + secret = cookieSecret; + + // the cookie secret usage limit is 2^24 + if ((cookieVersion & 0xFFFFFF) == 0) { // reset the secret + System.arraycopy(cookieSecret, 0, legacySecret, 0, 32); + secureRandom.nextBytes(cookieSecret); + } - for (int i = 4; i < 32; i++) { - if (cookie[i] != target[i]) { + cookieVersion++; + } + + MessageDigest md = JsseJce.getMessageDigest("SHA-256"); + byte[] helloBytes = clientHello.getHelloCookieBytes(); + md.update(helloBytes); + byte[] cookie = md.digest(secret); // 32 bytes + cookie[0] = (byte)((version >> 24) & 0xFF); + + return cookie; + } + + @Override + boolean isCookieValid(ServerHandshakeContext context, + ClientHelloMessage clientHello, byte[] cookie) throws IOException { + // no cookie exchange or not a valid cookie length + if ((cookie == null) || (cookie.length != 32)) { return false; } + + byte[] secret; + synchronized (this) { + if (((cookieVersion >> 24) & 0xFF) == cookie[0]) { + secret = cookieSecret; + } else { + secret = legacySecret; // including out of window cookies + } + } + + MessageDigest md = JsseJce.getMessageDigest("SHA-256"); + byte[] helloBytes = clientHello.getHelloCookieBytes(); + md.update(helloBytes); + byte[] target = md.digest(secret); // 32 bytes + target[0] = cookie[0]; + + return Arrays.equals(target, cookie); + } + } + + private static final + class D13HelloCookieManager extends HelloCookieManager { + D13HelloCookieManager(SecureRandom secureRandom) { + } + + @Override + byte[] createCookie(ServerHandshakeContext context, + ClientHelloMessage clientHello) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); } - return true; + @Override + boolean isCookieValid(ServerHandshakeContext context, + ClientHelloMessage clientHello, byte[] cookie) throws IOException { + throw new UnsupportedOperationException("Not supported yet."); + } } - // Used by client side to check the cookie in HelloVerifyRequest message. - static void checkCookie(ProtocolVersion protocolVersion, - byte[] cookie) throws IOException { - if (cookie != null && cookie.length != 0) { - int limit = COOKIE_MAX_LENGTH_DTLS12; - if (protocolVersion.v == ProtocolVersion.DTLS10.v) { - limit = COOKIE_MAX_LENGTH_DTLS10; - } + private static final + class T13HelloCookieManager extends HelloCookieManager { + + final SecureRandom secureRandom; + private int cookieVersion; // version + sequence + private final byte[] cookieSecret; + private final byte[] legacySecret; + + T13HelloCookieManager(SecureRandom secureRandom) { + this.secureRandom = secureRandom; + this.cookieVersion = secureRandom.nextInt(); + this.cookieSecret = new byte[64]; + this.legacySecret = new byte[64]; + + secureRandom.nextBytes(cookieSecret); + System.arraycopy(cookieSecret, 0, legacySecret, 0, 64); + } + + @Override + byte[] createCookie(ServerHandshakeContext context, + ClientHelloMessage clientHello) throws IOException { + int version; + byte[] secret; + + synchronized (this) { + version = cookieVersion; + secret = cookieSecret; + + // the cookie secret usage limit is 2^24 + if ((cookieVersion & 0xFFFFFF) == 0) { // reset the secret + System.arraycopy(cookieSecret, 0, legacySecret, 0, 64); + secureRandom.nextBytes(cookieSecret); + } - if (cookie.length > COOKIE_MAX_LENGTH_DTLS10) { - throw new SSLProtocolException( - "Invalid HelloVerifyRequest.cookie (length = " + - cookie.length + " bytes)"); + cookieVersion++; // allow wrapped version number } + + MessageDigest md = JsseJce.getMessageDigest( + context.negotiatedCipherSuite.hashAlg.name); + byte[] headerBytes = clientHello.getHeaderBytes(); + md.update(headerBytes); + byte[] headerCookie = md.digest(secret); + + // hash of ClientHello handshake message + context.handshakeHash.update(); + byte[] clientHelloHash = context.handshakeHash.digest(); + + // version and cipher suite + // + // Store the negotiated cipher suite in the cookie as well. + // cookie[0]/[1]: cipher suite + // cookie[2]: cookie version + // + (hash length): Mac(ClientHello header) + // + (hash length): Hash(ClientHello) + byte[] prefix = new byte[] { + (byte)((context.negotiatedCipherSuite.id >> 8) & 0xFF), + (byte)(context.negotiatedCipherSuite.id & 0xFF), + (byte)((version >> 24) & 0xFF) + }; + + byte[] cookie = Arrays.copyOf(prefix, + prefix.length + headerCookie.length + clientHelloHash.length); + System.arraycopy(headerCookie, 0, cookie, + prefix.length, headerCookie.length); + System.arraycopy(clientHelloHash, 0, cookie, + prefix.length + headerCookie.length, clientHelloHash.length); + + return cookie; } - // Otherwise, no cookie exchange. + @Override + boolean isCookieValid(ServerHandshakeContext context, + ClientHelloMessage clientHello, byte[] cookie) throws IOException { + // no cookie exchange or not a valid cookie length + if ((cookie == null) || (cookie.length <= 32)) { // 32: roughly + return false; + } + + int csId = ((cookie[0] & 0xFF) << 8) | (cookie[1] & 0xFF); + CipherSuite cs = CipherSuite.valueOf(csId); + if (cs == null || cs.hashAlg == null || cs.hashAlg.hashLength == 0) { + return false; + } + + int hashLen = cs.hashAlg.hashLength; + if (cookie.length != (3 + hashLen * 2)) { + return false; + } + + byte[] prevHeadCookie = + Arrays.copyOfRange(cookie, 3, 3 + hashLen); + byte[] prevClientHelloHash = + Arrays.copyOfRange(cookie, 3 + hashLen, cookie.length); + + byte[] secret; + synchronized (this) { + if ((byte)((cookieVersion >> 24) & 0xFF) == cookie[2]) { + secret = cookieSecret; + } else { + secret = legacySecret; // including out of window cookies + } + } + + MessageDigest md = JsseJce.getMessageDigest(cs.hashAlg.name); + byte[] headerBytes = clientHello.getHeaderBytes(); + md.update(headerBytes); + byte[] headerCookie = md.digest(secret); + + if (!Arrays.equals(headerCookie, prevHeadCookie)) { + return false; + } + + // Use the ClientHello hash in the cookie for transtript + // hash calculation for stateless HelloRetryRequest. + // + // Transcript-Hash(ClientHello1, HelloRetryRequest, ... Mn) = + // Hash(message_hash || /* Handshake type */ + // 00 00 Hash.length || /* Handshake message length (bytes) */ + // Hash(ClientHello1) || /* Hash of ClientHello1 */ + // HelloRetryRequest || ... || Mn) + + // Reproduce HelloRetryRequest handshake message + byte[] hrrMessage = + ServerHello.hrrReproducer.produce(context, clientHello); + context.handshakeHash.push(hrrMessage); + + // Construct the 1st ClientHello message for transcript hash + byte[] hashedClientHello = new byte[4 + hashLen]; + hashedClientHello[0] = SSLHandshake.MESSAGE_HASH.id; + hashedClientHello[1] = (byte)0x00; + hashedClientHello[2] = (byte)0x00; + hashedClientHello[3] = (byte)(hashLen & 0xFF); + System.arraycopy(prevClientHelloHash, 0, + hashedClientHello, 4, hashLen); + + context.handshakeHash.push(hashedClientHello); + + return true; + } } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloExtension.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; - -abstract class HelloExtension { - - final ExtensionType type; - - HelloExtension(ExtensionType type) { - this.type = type; - } - - // Length of the encoded extension, including the type and length fields - abstract int length(); - - abstract void send(HandshakeOutStream s) throws IOException; - - @Override - public abstract String toString(); - -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloExtensions.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloExtensions.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloExtensions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloExtensions.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,163 +0,0 @@ -/* - * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.io.PrintStream; -import java.util.*; -import javax.net.ssl.*; - -/** - * This file contains all the classes relevant to TLS Extensions for the - * ClientHello and ServerHello messages. The extension mechanism and - * several extensions are defined in RFC 6066. Additional extensions are - * defined in the ECC RFC 4492 and the ALPN extension is defined in RFC 7301. - * - * Currently, only the two ECC extensions are fully supported. - * - * The classes contained in this file are: - * . HelloExtensions: a List of extensions as used in the client hello - * and server hello messages. - * . ExtensionType: an enum style class for the extension type - * . HelloExtension: abstract base class for all extensions. All subclasses - * must be immutable. - * - * . UnknownExtension: used to represent all parsed extensions that we do not - * explicitly support. - * . ServerNameExtension: the server_name extension. - * . SignatureAlgorithmsExtension: the signature_algorithms extension. - * . SupportedGroupsExtension: the supported groups extension. - * . EllipticPointFormatsExtension: the ECC supported point formats - * (compressed/uncompressed) extension. - * . ALPNExtension: the application_layer_protocol_negotiation extension. - * - * @since 1.6 - * @author Andreas Sterbenz - */ -final class HelloExtensions { - - private List<HelloExtension> extensions; - private int encodedLength; - - HelloExtensions() { - extensions = Collections.emptyList(); - } - - HelloExtensions(HandshakeInStream s) throws IOException { - int len = s.getInt16(); - extensions = new ArrayList<HelloExtension>(); - encodedLength = len + 2; - while (len > 0) { - int type = s.getInt16(); - int extlen = s.getInt16(); - ExtensionType extType = ExtensionType.get(type); - HelloExtension extension; - if (extType == ExtensionType.EXT_SERVER_NAME) { - extension = new ServerNameExtension(s, extlen); - } else if (extType == ExtensionType.EXT_SIGNATURE_ALGORITHMS) { - extension = new SignatureAlgorithmsExtension(s, extlen); - } else if (extType == ExtensionType.EXT_SUPPORTED_GROUPS) { - extension = new SupportedGroupsExtension(s, extlen); - } else if (extType == ExtensionType.EXT_EC_POINT_FORMATS) { - extension = new EllipticPointFormatsExtension(s, extlen); - } else if (extType == ExtensionType.EXT_RENEGOTIATION_INFO) { - extension = new RenegotiationInfoExtension(s, extlen); - } else if (extType == ExtensionType.EXT_ALPN) { - extension = new ALPNExtension(s, extlen); - } else if (extType == ExtensionType.EXT_MAX_FRAGMENT_LENGTH) { - extension = new MaxFragmentLengthExtension(s, extlen); - } else if (extType == ExtensionType.EXT_STATUS_REQUEST) { - extension = new CertStatusReqExtension(s, extlen); - } else if (extType == ExtensionType.EXT_STATUS_REQUEST_V2) { - extension = new CertStatusReqListV2Extension(s, extlen); - } else if (extType == ExtensionType.EXT_EXTENDED_MASTER_SECRET) { - extension = new ExtendedMasterSecretExtension(s, extlen); - } else { - extension = new UnknownExtension(s, extlen, extType); - } - extensions.add(extension); - len -= extlen + 4; - } - if (len != 0) { - throw new SSLProtocolException( - "Error parsing extensions: extra data"); - } - } - - // Return the List of extensions. Must not be modified by the caller. - List<HelloExtension> list() { - return extensions; - } - - void add(HelloExtension ext) { - if (extensions.isEmpty()) { - extensions = new ArrayList<HelloExtension>(); - } - extensions.add(ext); - encodedLength = -1; - } - - HelloExtension get(ExtensionType type) { - for (HelloExtension ext : extensions) { - if (ext.type == type) { - return ext; - } - } - return null; - } - - int length() { - if (encodedLength >= 0) { - return encodedLength; - } - if (extensions.isEmpty()) { - encodedLength = 0; - } else { - encodedLength = 2; - for (HelloExtension ext : extensions) { - encodedLength += ext.length(); - } - } - return encodedLength; - } - - void send(HandshakeOutStream s) throws IOException { - int length = length(); - if (length == 0) { - return; - } - s.putInt16(length - 2); - for (HelloExtension ext : extensions) { - ext.send(s); - } - } - - void print(PrintStream s) throws IOException { - for (HelloExtension ext : extensions) { - s.println(ext.toString()); - } - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloRequest.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloRequest.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloRequest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloRequest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the HelloRequest handshake message. + */ +final class HelloRequest { + static final SSLProducer kickstartProducer = + new HelloRequestKickstartProducer(); + + static final SSLConsumer handshakeConsumer = + new HelloRequestConsumer(); + static final HandshakeProducer handshakeProducer = + new HelloRequestProducer(); + + /** + * The HelloRequest handshake message. + * + * [RFC 5246] The HelloRequest message MAY be sent by the server at any + * time. HelloRequest is a simple notification that the client should + * begin the negotiation process anew. + * + * struct { } HelloRequest; + */ + static final class HelloRequestMessage extends HandshakeMessage { + HelloRequestMessage(HandshakeContext handshakeContext) { + super(handshakeContext); + } + + HelloRequestMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + if (m.hasRemaining()) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Error parsing HelloRequest message: not empty"); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.HELLO_REQUEST; + } + + @Override + public int messageLength() { + return 0; + } + + @Override + public void send(HandshakeOutStream s) throws IOException { + // empty, nothing to send + } + + @Override + public String toString() { + return "<empty>"; + } + } + + /** + * The "HelloRequest" handshake message kick start producer. + */ + private static final + class HelloRequestKickstartProducer implements SSLProducer { + // Prevent instantiation of this class. + private HelloRequestKickstartProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + HelloRequestMessage hrm = new HelloRequestMessage(shc); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced HelloRequest handshake message", hrm); + } + + // Output the handshake message. + hrm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // update the context + + // What's the expected response? + shc.handshakeConsumers.put( + SSLHandshake.CLIENT_HELLO.id, SSLHandshake.CLIENT_HELLO); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "HelloRequest" handshake message producer. + */ + private static final class HelloRequestProducer + implements HandshakeProducer { + // Prevent instantiation of this class. + private HelloRequestProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + HelloRequestMessage hrm = new HelloRequestMessage(shc); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced HelloRequest handshake message", hrm); + } + + // Output the handshake message. + hrm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // update the context + + // What's the expected response? + shc.handshakeConsumers.put( + SSLHandshake.CLIENT_HELLO.id, SSLHandshake.CLIENT_HELLO); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "HelloRequest" handshake message consumer. + */ + private static final class HelloRequestConsumer + implements SSLConsumer { + + // Prevent instantiation of this class. + private HelloRequestConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // For TLS 1.2 and prior versions, the HelloRequest message MAY + // be sent by the server at any time. Please don't clean up this + // handshake consumer. + HelloRequestMessage hrm = new HelloRequestMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming HelloRequest handshake message", hrm); + } + + if (!chc.kickstartMessageDelivered) { + if (!chc.conContext.secureRenegotiation && + !HandshakeContext.allowUnsafeRenegotiation) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsafe renegotiation is not allowed"); + } + + if (!chc.conContext.secureRenegotiation) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Continue with insecure renegotiation"); + } + } + + // update the responders + chc.handshakeProducers.put( + SSLHandshake.CLIENT_HELLO.id, + SSLHandshake.CLIENT_HELLO); + + // + // produce response handshake message + // + SSLHandshake.CLIENT_HELLO.produce(context, hrm); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ingore HelloRequest, handshaking is in progress"); + } + } + } + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HelloVerifyRequest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.Locale; +import sun.security.ssl.ClientHello.ClientHelloMessage; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the HelloVerifyRequest handshake message. + */ +final class HelloVerifyRequest { + static final SSLConsumer handshakeConsumer = + new HelloVerifyRequestConsumer(); + static final HandshakeProducer handshakeProducer = + new HelloVerifyRequestProducer(); + + /** + * The HelloVerifyRequest handshake message [RFC 6347]. + */ + static final class HelloVerifyRequestMessage extends HandshakeMessage { + final int serverVersion; + final byte[] cookie; + + HelloVerifyRequestMessage(HandshakeContext context, + HandshakeMessage message) throws IOException { + super(context); + // This happens in server side only. + ServerHandshakeContext shc = + (ServerHandshakeContext)context; + ClientHelloMessage clientHello = (ClientHelloMessage)message; + + HelloCookieManager hcMgr = + shc.sslContext.getHelloCookieManager(ProtocolVersion.DTLS10); + this.serverVersion = shc.clientHelloVersion; + this.cookie = hcMgr.createCookie(shc, clientHello); + } + + HelloVerifyRequestMessage(HandshakeContext context, + ByteBuffer m) throws IOException { + super(context); + // This happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // struct { + // ProtocolVersion server_version; + // opaque cookie<0..2^8-1>; + // } HelloVerifyRequest; + if (m.remaining() < 3) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid HelloVerifyRequest: no sufficient data"); + } + + byte major = m.get(); + byte minor = m.get(); + this.serverVersion = ((major & 0xFF) << 8) | (minor & 0xFF); + this.cookie = Record.getBytes8(m); + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.HELLO_VERIFY_REQUEST; + } + + @Override + public int messageLength() { + return 3 + cookie.length; // 2: the length of protocol version + // +1: the cookie length + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putInt8((byte)((serverVersion >>> 8) & 0xFF)); + hos.putInt8((byte)(serverVersion & 0xFF)); + hos.putBytes8(cookie); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"HelloVerifyRequest\": '{'\n" + + " \"server version\" : \"{0}\",\n" + + " \"cookie\" : \"{1}\",\n" + + "'}'", + Locale.ENGLISH); + Object[] messageFields = { + ProtocolVersion.nameOf(serverVersion), + Utilities.toHexString(cookie), + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "HelloVerifyRequest" handshake message producer. + */ + private static final + class HelloVerifyRequestProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private HelloVerifyRequestProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // clean up this producer + shc.handshakeProducers.remove(SSLHandshake.HELLO_VERIFY_REQUEST.id); + + HelloVerifyRequestMessage hvrm = + new HelloVerifyRequestMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced HelloVerifyRequest handshake message", hvrm); + } + + // Output the handshake message. + hvrm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // update the context + + // Stateless, clean up the handshake context as well? + shc.handshakeHash.finish(); // forgot about the handshake hash + shc.handshakeExtensions.clear(); + + // What's the expected response? + shc.handshakeConsumers.put( + SSLHandshake.CLIENT_HELLO.id, SSLHandshake.CLIENT_HELLO); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "HelloVerifyRequest" handshake message consumer. + */ + private static final class HelloVerifyRequestConsumer + implements SSLConsumer { + + // Prevent instantiation of this class. + private HelloVerifyRequestConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // clean up this consumer + chc.handshakeConsumers.remove(SSLHandshake.HELLO_VERIFY_REQUEST.id); + if (!chc.handshakeConsumers.isEmpty()) { + chc.handshakeConsumers.remove(SSLHandshake.SERVER_HELLO.id); + } + if (!chc.handshakeConsumers.isEmpty()) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "No more message expected before " + + "HelloVerifyRequest is processed"); + } + + // Refresh handshake hash. + chc.handshakeHash.finish(); // forgot about the handshake hash + + HelloVerifyRequestMessage hvrm = + new HelloVerifyRequestMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming HelloVerifyRequest handshake message", hvrm); + } + + // Note that HelloVerifyRequest.server_version is used solely to + // indicate packet formatting, and not as part of version + // negotiation. Need not to check version values match for + // HelloVerifyRequest message. + chc.initialClientHelloMsg.setHelloCookie(hvrm.cookie); + + // + // produce response handshake message + // + SSLHandshake.CLIENT_HELLO.produce(context, hvrm); + } + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HKDF.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HKDF.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/HKDF.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/HKDF.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,186 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.security.NoSuchAlgorithmException; +import java.security.InvalidKeyException; +import javax.crypto.Mac; +import javax.crypto.SecretKey; +import javax.crypto.ShortBufferException; +import javax.crypto.spec.SecretKeySpec; +import java.util.Objects; + +/** + * An implementation of the HKDF key derivation algorithm outlined in RFC 5869, + * specific to the needs of TLS 1.3 key derivation in JSSE. This is not a + * general purpose HKDF implementation and is suited only to single-key output + * derivations. + * + * HKDF objects are created by specifying a message digest algorithm. That + * digest algorithm will be used by the HMAC function as part of the HKDF + * derivation process. + */ +final class HKDF { + private final String hmacAlg; + private final Mac hmacObj; + private final int hmacLen; + + /** + * Create an HDKF object, specifying the underlying message digest + * algorithm. + * + * @param hashAlg a standard name corresponding to a supported message + * digest algorithm. + * + * @throws NoSuchAlgorithmException if that message digest algorithm does + * not have an HMAC variant supported on any available provider. + */ + HKDF(String hashAlg) throws NoSuchAlgorithmException { + Objects.requireNonNull(hashAlg, + "Must provide underlying HKDF Digest algorithm."); + hmacAlg = "Hmac" + hashAlg.replace("-", ""); + hmacObj = JsseJce.getMac(hmacAlg); + hmacLen = hmacObj.getMacLength(); + } + + /** + * Perform the HMAC-Extract derivation. + * + * @param salt a salt value, implemented as a {@code SecretKey}. A + * {@code null} value is allowed, which will internally use an array of + * zero bytes the same size as the underlying hash output length. + * @param inputKey the input keying material provided as a + * {@code SecretKey}. + * @param keyAlg the algorithm name assigned to the resulting + * {@code SecretKey} object. + * + * @return a {@code SecretKey} that is the result of the HKDF extract + * operation. + * + * @throws InvalidKeyException if the {@code salt} parameter cannot be + * used to initialize the underlying HMAC. + */ + SecretKey extract(SecretKey salt, SecretKey inputKey, String keyAlg) + throws InvalidKeyException { + if (salt == null) { + salt = new SecretKeySpec(new byte[hmacLen], "HKDF-Salt"); + } + hmacObj.init(salt); + + return new SecretKeySpec(hmacObj.doFinal(inputKey.getEncoded()), + keyAlg); + } + + /** + * Perform the HMAC-Extract derivation. + * + * @param salt a salt value as cleartext bytes. A {@code null} value is + * allowed, which will internally use an array of zero bytes the same + * size as the underlying hash output length. + * @param inputKey the input keying material provided as a + * {@code SecretKey}. + * @param keyAlg the algorithm name assigned to the resulting + * {@code SecretKey} object. + * + * @return a {@code SecretKey} that is the result of the HKDF extract + * operation. + * + * @throws InvalidKeyException if the {@code salt} parameter cannot be + * used to initialize the underlying HMAC. + */ + SecretKey extract(byte[] salt, SecretKey inputKey, String keyAlg) + throws InvalidKeyException { + if (salt == null) { + salt = new byte[hmacLen]; + } + return extract(new SecretKeySpec(salt, "HKDF-Salt"), inputKey, keyAlg); + } + + /** + * Perform the HKDF-Expand derivation for a single-key output. + * + * @param pseudoRandKey the pseudo random key (PRK). + * @param info optional context-specific info. A {@code null} value is + * allowed in which case a zero-length byte array will be used. + * @param outLen the length of the resulting {@code SecretKey} + * @param keyAlg the algorithm name applied to the resulting + * {@code SecretKey} + * + * @return the resulting key derivation as a {@code SecretKey} object + * + * @throws InvalidKeyException if the underlying HMAC operation cannot + * be initialized using the provided {@code pseudoRandKey} object. + */ + SecretKey expand(SecretKey pseudoRandKey, byte[] info, int outLen, + String keyAlg) throws InvalidKeyException { + byte[] kdfOutput; + + // Calculate the number of rounds of HMAC that are needed to + // meet the requested data. Then set up the buffers we will need. + Objects.requireNonNull(pseudoRandKey, "A null PRK is not allowed."); + + // Output from the expand operation must be <= 255 * hmac length + if (outLen > 255 * hmacLen) { + throw new IllegalArgumentException("Requested output length " + + "exceeds maximum length allowed for HKDF expansion"); + } + hmacObj.init(pseudoRandKey); + if (info == null) { + info = new byte[0]; + } + int rounds = (outLen + hmacLen - 1) / hmacLen; + kdfOutput = new byte[rounds * hmacLen]; + int offset = 0; + int tLength = 0; + + for (int i = 0; i < rounds ; i++) { + + // Calculate this round + try { + // Add T(i). This will be an empty string on the first + // iteration since tLength starts at zero. After the first + // iteration, tLength is changed to the HMAC length for the + // rest of the loop. + hmacObj.update(kdfOutput, + Math.max(0, offset - hmacLen), tLength); + hmacObj.update(info); // Add info + hmacObj.update((byte)(i + 1)); // Add round number + hmacObj.doFinal(kdfOutput, offset); + + tLength = hmacLen; + offset += hmacLen; // For next iteration + } catch (ShortBufferException sbe) { + // This really shouldn't happen given that we've + // sized the buffers to their largest possible size up-front, + // but just in case... + throw new RuntimeException(sbe); + } + } + + return new SecretKeySpec(kdfOutput, 0, outLen, keyAlg); + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/InputRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/InputRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/InputRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/InputRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,16 +25,14 @@ package sun.security.ssl; -import java.io.*; -import java.nio.*; -import java.util.*; - +import java.io.Closeable; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.BufferUnderflowException; +import java.nio.ByteBuffer; import javax.crypto.BadPaddingException; - -import javax.net.ssl.*; - -import sun.security.util.HexDumpEncoder; - +import sun.security.ssl.SSLCipher.SSLReadCipher; /** * {@code InputRecord} takes care of the management of SSL/TLS/DTLS input @@ -42,15 +40,12 @@ * * @author David Brownell */ -class InputRecord implements Record, Closeable { - - /* Class and subclass dynamic debugging support */ - static final Debug debug = Debug.getInstance("ssl"); - - Authenticator readAuthenticator; - CipherBox readCipher; +abstract class InputRecord implements Record, Closeable { + SSLReadCipher readCipher; + // Needed for KeyUpdate, used after Handshake.Finished + TransportContext tc; - HandshakeHash handshakeHash; + final HandshakeHash handshakeHash; boolean isClosed; // The ClientHello version to accept. If set to ProtocolVersion.SSL20Hello @@ -61,10 +56,11 @@ // fragment size int fragmentSize; - InputRecord() { - this.readCipher = CipherBox.NULL; - this.readAuthenticator = null; // Please override this assignment. - this.helloVersion = ProtocolVersion.DEFAULT_HELLO; + InputRecord(HandshakeHash handshakeHash, SSLReadCipher readCipher) { + this.readCipher = readCipher; + this.helloVersion = ProtocolVersion.TLS10; + this.handshakeHash = handshakeHash; + this.isClosed = false; this.fragmentSize = Record.maxDataSize; } @@ -72,41 +68,9 @@ this.helloVersion = helloVersion; } - ProtocolVersion getHelloVersion() { - return helloVersion; - } - - /* - * Set instance for the computation of handshake hashes. - * - * For handshaking, we need to be able to hash every byte above the - * record marking layer. This is where we're guaranteed to see those - * bytes, so this is where we can hash them ... especially in the - * case of hashing the initial V2 message! - */ - void setHandshakeHash(HandshakeHash handshakeHash) { - if (handshakeHash != null) { - byte[] reserved = null; - if (this.handshakeHash != null) { - reserved = this.handshakeHash.getAllHandshakeMessages(); - } - if ((reserved != null) && (reserved.length != 0)) { - handshakeHash.update(reserved, 0, reserved.length); - - if (debug != null && Debug.isOn("data")) { - Debug.printHex( - "[reserved] handshake hash: len = " + reserved.length, - reserved); - } - } - } - - this.handshakeHash = handshakeHash; - } - boolean seqNumIsHuge() { - return (readAuthenticator != null) && - readAuthenticator.seqNumIsHuge(); + return (readCipher.authenticator != null) && + readCipher.authenticator.seqNumIsHuge(); } boolean isEmpty() { @@ -118,6 +82,11 @@ // blank } + // apply to DTLS SSLEngine + void finishHandshake() { + // blank + } + /** * Prevent any more data from being read into this record, * and flag the record as holding no data. @@ -130,9 +99,12 @@ } } + synchronized boolean isClosed() { + return isClosed; + } + // apply to SSLSocket and SSLEngine - void changeReadCiphers( - Authenticator readAuthenticator, CipherBox readCipher) { + void changeReadCiphers(SSLReadCipher readCipher) { /* * Dispose of any intermediate state in the underlying cipher. @@ -144,7 +116,6 @@ */ readCipher.dispose(); - this.readAuthenticator = readAuthenticator; this.readCipher = readCipher; } @@ -160,22 +131,20 @@ * @return -1 if there are not enough bytes to tell (small header), */ // apply to SSLEngine only - int bytesInCompletePacket(ByteBuffer buf) throws SSLException { - throw new UnsupportedOperationException(); + int bytesInCompletePacket( + ByteBuffer[] srcs, int srcsOffset, int srcsLength) throws IOException { + + throw new UnsupportedOperationException("Not supported yet."); } // apply to SSLSocket only - int bytesInCompletePacket(InputStream is) throws IOException { + int bytesInCompletePacket() throws IOException { throw new UnsupportedOperationException(); } - /** - * Return true if the specified record protocol version is out of the - * range of the possible supported versions. - */ - void checkRecordVersion(ProtocolVersion version, - boolean allowSSL20Hello) throws SSLException { - // blank + // apply to SSLSocket only + void setReceiverStream(InputStream inputStream) { + throw new UnsupportedOperationException(); } // apply to DTLS SSLEngine only @@ -186,17 +155,8 @@ // read, decrypt and decompress the network record. // - // apply to SSLEngine only - Plaintext decode(ByteBuffer netData) - throws IOException, BadPaddingException { - throw new UnsupportedOperationException(); - } - - // apply to SSLSocket only - Plaintext decode(InputStream is, ByteBuffer destination) - throws IOException, BadPaddingException { - throw new UnsupportedOperationException(); - } + abstract Plaintext[] decode(ByteBuffer[] srcs, int srcsOffset, + int srcsLength) throws IOException, BadPaddingException; // apply to SSLSocket only void setDeliverStream(OutputStream outputStream) { @@ -216,9 +176,7 @@ // Not apply to DTLS static ByteBuffer convertToClientHello(ByteBuffer packet) { - int srcPos = packet.position(); - int srcLim = packet.limit(); byte firstByte = packet.get(); byte secondByte = packet.get(); @@ -244,7 +202,7 @@ // 1: length byte of ClientHello.session_id // 2: length bytes of ClientHello.cipher_suites // 2: empty ClientHello.compression_methods - int requiredSize = 48 + sessionIdLen + ((cipherSpecLen * 2 ) / 3 ); + int requiredSize = 48 + sessionIdLen + ((cipherSpecLen * 2 ) / 3); byte[] converted = new byte[requiredSize]; /* @@ -252,7 +210,7 @@ * that's now buffered up. (Lengths are fixed up later). */ // Note: need not to set the header actually. - converted[0] = ct_handshake; + converted[0] = ContentType.HANDSHAKE.id; converted[1] = majorVersion; converted[2] = minorVersion; // header [3..4] for handshake message length @@ -325,7 +283,7 @@ j = pointer + 2; for (int i = 0; i < cipherSpecLen; i += 3) { if (packet.get() != 0) { - // Ignore version 2.0 specifix cipher suite. Clients + // Ignore version 2.0 specific cipher suite. Clients // should also include the version 3.0 equivalent in // the V2ClientHello message. packet.get(); // ignore the 2nd byte @@ -372,237 +330,61 @@ return ByteBuffer.wrap(converted, 5, pointer - 5); // 5: header size } - static ByteBuffer decrypt(Authenticator authenticator, CipherBox box, - byte contentType, ByteBuffer bb) throws BadPaddingException { - - return decrypt(authenticator, box, contentType, bb, null); - } - - static ByteBuffer decrypt(Authenticator authenticator, - CipherBox box, byte contentType, ByteBuffer bb, - byte[] sequence) throws BadPaddingException { - - BadPaddingException reservedBPE = null; - int tagLen = - (authenticator instanceof MAC) ? ((MAC)authenticator).MAClen() : 0; - int cipheredLength = bb.remaining(); - int srcPos = bb.position(); - if (!box.isNullCipher()) { - try { - // apply explicit nonce for AEAD/CBC cipher suites if needed - int nonceSize = box.applyExplicitNonce( - authenticator, contentType, bb, sequence); - - // decrypt the content - if (box.isAEADMode()) { - // DON'T decrypt the nonce_explicit for AEAD mode - bb.position(srcPos + nonceSize); - } // The explicit IV for CBC mode can be decrypted. - - // Note that the CipherBox.decrypt() does not change - // the capacity of the buffer. - box.decrypt(bb, tagLen); - // We don't actually remove the nonce. - bb.position(srcPos + nonceSize); - } catch (BadPaddingException bpe) { - // RFC 2246 states that decryption_failed should be used - // for this purpose. However, that allows certain attacks, - // so we just send bad record MAC. We also need to make - // sure to always check the MAC to avoid a timing attack - // for the same issue. See paper by Vaudenay et al and the - // update in RFC 4346/5246. - // - // Failover to message authentication code checking. - reservedBPE = bpe; - } - } - - // Requires message authentication code for null, stream and block - // cipher suites. - if ((authenticator instanceof MAC) && (tagLen != 0)) { - MAC signer = (MAC)authenticator; - int contentLen = bb.remaining() - tagLen; - - // Note that although it is not necessary, we run the same MAC - // computation and comparison on the payload for both stream - // cipher and CBC block cipher. - if (contentLen < 0) { - // negative data length, something is wrong - if (reservedBPE == null) { - reservedBPE = new BadPaddingException("bad record"); - } - - // set offset of the dummy MAC - contentLen = cipheredLength - tagLen; - bb.limit(srcPos + cipheredLength); - } - - // Run MAC computation and comparison on the payload. - // - // MAC data would be stripped off during the check. - if (checkMacTags(contentType, bb, signer, sequence, false)) { - if (reservedBPE == null) { - reservedBPE = new BadPaddingException("bad record MAC"); + // Extract an SSL/(D)TLS record from the specified source buffers. + static ByteBuffer extract( + ByteBuffer[] buffers, int offset, int length, int headerSize) { + + boolean hasFullHeader = false; + int contentLen = -1; + for (int i = offset, j = 0; + i < (offset + length) && j < headerSize; i++) { + int remains = buffers[i].remaining(); + int pos = buffers[i].position(); + for (int k = 0; k < remains && j < headerSize; j++, k++) { + byte b = buffers[i].get(pos + k); + if (j == (headerSize - 2)) { + contentLen = ((b & 0xFF) << 8); + } else if (j == (headerSize -1)) { + contentLen |= (b & 0xFF); + hasFullHeader = true; + break; } } - - // Run MAC computation and comparison on the remainder. - // - // It is only necessary for CBC block cipher. It is used to get a - // constant time of MAC computation and comparison on each record. - if (box.isCBCMode()) { - int remainingLen = calculateRemainingLen( - signer, cipheredLength, contentLen); - - // NOTE: remainingLen may be bigger (less than 1 block of the - // hash algorithm of the MAC) than the cipheredLength. - // - // Is it possible to use a static buffer, rather than allocate - // it dynamically? - remainingLen += signer.MAClen(); - ByteBuffer temporary = ByteBuffer.allocate(remainingLen); - - // Won't need to worry about the result on the remainder. And - // then we won't need to worry about what's actual data to - // check MAC tag on. We start the check from the header of the - // buffer so that we don't need to construct a new byte buffer. - checkMacTags(contentType, temporary, signer, sequence, true); - } } - // Is it a failover? - if (reservedBPE != null) { - throw reservedBPE; + if (!hasFullHeader) { + throw new BufferUnderflowException(); } - return bb.slice(); - } - - /* - * Run MAC computation and comparison - * - */ - private static boolean checkMacTags(byte contentType, ByteBuffer bb, - MAC signer, byte[] sequence, boolean isSimulated) { - - int tagLen = signer.MAClen(); - int position = bb.position(); - int lim = bb.limit(); - int macOffset = lim - tagLen; - - bb.limit(macOffset); - byte[] hash = signer.compute(contentType, bb, sequence, isSimulated); - if (hash == null || tagLen != hash.length) { - // Something is wrong with MAC implementation. - throw new RuntimeException("Internal MAC error"); - } - - bb.position(macOffset); - bb.limit(lim); - try { - int[] results = compareMacTags(bb, hash); - return (results[0] != 0); - } finally { - // reset to the data - bb.position(position); - bb.limit(macOffset); - } - } - - /* - * A constant-time comparison of the MAC tags. - * - * Please DON'T change the content of the ByteBuffer parameter! - */ - private static int[] compareMacTags(ByteBuffer bb, byte[] tag) { - - // An array of hits is used to prevent Hotspot optimization for - // the purpose of a constant-time check. - int[] results = {0, 0}; // {missed #, matched #} - - // The caller ensures there are enough bytes available in the buffer. - // So we won't need to check the remaining of the buffer. - for (int i = 0; i < tag.length; i++) { - if (bb.get() != tag[i]) { - results[0]++; // mismatched bytes - } else { - results[1]++; // matched bytes + int packetLen = headerSize + contentLen; + int remains = 0; + for (int i = offset; i < offset + length; i++) { + remains += buffers[i].remaining(); + if (remains >= packetLen) { + break; } } - return results; - } - - /* - * Run MAC computation and comparison - * - * Please DON'T change the content of the byte buffer parameter! - */ - private static boolean checkMacTags(byte contentType, byte[] buffer, - int offset, int contentLen, MAC signer, boolean isSimulated) { - - int tagLen = signer.MAClen(); - byte[] hash = signer.compute( - contentType, buffer, offset, contentLen, isSimulated); - if (hash == null || tagLen != hash.length) { - // Something is wrong with MAC implementation. - throw new RuntimeException("Internal MAC error"); + if (remains < packetLen) { + throw new BufferUnderflowException(); } - int[] results = compareMacTags(buffer, offset + contentLen, hash); - return (results[0] != 0); - } - - /* - * A constant-time comparison of the MAC tags. - * - * Please DON'T change the content of the byte buffer parameter! - */ - private static int[] compareMacTags( - byte[] buffer, int offset, byte[] tag) { + byte[] packet = new byte[packetLen]; + int packetOffset = 0; + int packetSpaces = packetLen; + for (int i = offset; i < offset + length; i++) { + if (buffers[i].hasRemaining()) { + int len = Math.min(packetSpaces, buffers[i].remaining()); + buffers[i].get(packet, packetOffset, len); + packetOffset += len; + packetSpaces -= len; + } - // An array of hits is used to prevent Hotspot optimization for - // the purpose of a constant-time check. - int[] results = {0, 0}; // {missed #, matched #} - - // The caller ensures there are enough bytes available in the buffer. - // So we won't need to check the length of the buffer. - for (int i = 0; i < tag.length; i++) { - if (buffer[offset + i] != tag[i]) { - results[0]++; // mismatched bytes - } else { - results[1]++; // matched bytes + if (packetSpaces <= 0) { + break; } } - return results; - } - - /* - * Calculate the length of a dummy buffer to run MAC computation - * and comparison on the remainder. - * - * The caller MUST ensure that the fullLen is not less than usedLen. - */ - private static int calculateRemainingLen( - MAC signer, int fullLen, int usedLen) { - - int blockLen = signer.hashBlockLen(); - int minimalPaddingLen = signer.minimalPaddingLen(); - - // (blockLen - minimalPaddingLen) is the maximum message size of - // the last block of hash function operation. See FIPS 180-4, or - // MD5 specification. - fullLen += 13 - (blockLen - minimalPaddingLen); - usedLen += 13 - (blockLen - minimalPaddingLen); - - // Note: fullLen is always not less than usedLen, and blockLen - // is always bigger than minimalPaddingLen, so we don't worry - // about negative values. 0x01 is added to the result to ensure - // that the return value is positive. The extra one byte does - // not impact the overall MAC compression function evaluations. - return 0x01 + (int)(Math.ceil(fullLen/(1.0d * blockLen)) - - Math.ceil(usedLen/(1.0d * blockLen))) * blockLen; + return ByteBuffer.wrap(packet); } } - diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/JsseJce.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/JsseJce.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/JsseJce.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/JsseJce.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,25 +25,16 @@ package sun.security.ssl; -import java.util.*; import java.math.BigInteger; - import java.security.*; import java.security.interfaces.RSAPublicKey; import java.security.spec.*; - +import java.util.*; import javax.crypto.*; - -// explicit import to override the Provider class in this package -import java.security.Provider; - -// need internal Sun classes for FIPS tricks -import sun.security.jca.Providers; import sun.security.jca.ProviderList; - -import sun.security.util.ECUtil; - +import sun.security.jca.Providers; import static sun.security.ssl.SunJSSE.cryptoProvider; +import sun.security.util.ECUtil; import static sun.security.util.SecurityConstants.PROVIDER_VER; /** @@ -53,18 +44,11 @@ * @author Andreas Sterbenz */ final class JsseJce { + static final boolean ALLOW_ECC = + Utilities.getBooleanProperty("com.sun.net.ssl.enableECC", true); private static final ProviderList fipsProviderList; - // Flag indicating whether Kerberos crypto is available. - // If true, then all the Kerberos-based crypto we need is available. - private static final boolean kerberosAvailable; - static { - ClientKeyExchangeService p = - ClientKeyExchangeService.find("KRB5"); - kerberosAvailable = (p != null); - } - static { // force FIPS flag initialization // Because isFIPS() is synchronized and cryptoProvider is not modified @@ -116,37 +100,45 @@ * Can be used for encryption, decryption, signing, verifying. */ static final String CIPHER_RSA_PKCS1 = "RSA/ECB/PKCS1Padding"; + /** * JCE transformation string for the stream cipher RC4. */ static final String CIPHER_RC4 = "RC4"; + /** * JCE transformation string for DES in CBC mode without padding. */ static final String CIPHER_DES = "DES/CBC/NoPadding"; + /** * JCE transformation string for (3-key) Triple DES in CBC mode * without padding. */ static final String CIPHER_3DES = "DESede/CBC/NoPadding"; + /** * JCE transformation string for AES in CBC mode * without padding. */ static final String CIPHER_AES = "AES/CBC/NoPadding"; + /** * JCE transformation string for AES in GCM mode * without padding. */ static final String CIPHER_AES_GCM = "AES/GCM/NoPadding"; + /** * JCA identifier string for DSA, i.e. a DSA with SHA-1. */ static final String SIGNATURE_DSA = "DSA"; + /** * JCA identifier string for ECDSA, i.e. a ECDSA with SHA-1. */ static final String SIGNATURE_ECDSA = "SHA1withECDSA"; + /** * JCA identifier string for Raw DSA, i.e. a DSA signature without * hashing where the application provides the SHA-1 hash of the data. @@ -154,17 +146,20 @@ * for compatibility. */ static final String SIGNATURE_RAWDSA = "RawDSA"; + /** * JCA identifier string for Raw ECDSA, i.e. a DSA signature without * hashing where the application provides the SHA-1 hash of the data. */ static final String SIGNATURE_RAWECDSA = "NONEwithECDSA"; + /** * JCA identifier string for Raw RSA, i.e. a RSA PKCS#1 v1.5 signature * without hashing where the application provides the hash of the data. * Used for RSA client authentication with a 36 byte hash. */ static final String SIGNATURE_RAWRSA = "NONEwithRSA"; + /** * JCA identifier string for the SSL/TLS style RSA Signature. I.e. * an signature using RSA with PKCS#1 v1.5 padding signing a @@ -180,10 +175,6 @@ return EcAvailability.isAvailable; } - static boolean isKerberosAvailable() { - return kerberosAvailable; - } - /** * Return an JCE cipher implementation for the specified algorithm. */ @@ -299,7 +290,8 @@ for (Provider.Service s : cryptoProvider.getServices()) { if (s.getType().equals("SecureRandom")) { try { - return SecureRandom.getInstance(s.getAlgorithm(), cryptoProvider); + return SecureRandom.getInstance( + s.getAlgorithm(), cryptoProvider); } catch (NoSuchAlgorithmException ee) { // ignore } @@ -394,7 +386,7 @@ // See Effective Java Second Edition: Item 71. private static class EcAvailability { // Is EC crypto available? - private final static boolean isAvailable; + private static final boolean isAvailable; static { boolean mediator = true; diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/KeyManagerFactoryImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/KeyManagerFactoryImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/KeyManagerFactoryImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/KeyManagerFactoryImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -91,9 +91,11 @@ keyManager = new X509KeyManagerImpl( Collections.<Builder>emptyList()); } else { - if (SunJSSE.isFIPS() && (ks.getProvider() != SunJSSE.cryptoProvider)) { - throw new KeyStoreException("FIPS mode: KeyStore must be " - + "from provider " + SunJSSE.cryptoProvider.getName()); + if (SunJSSE.isFIPS() && + (ks.getProvider() != SunJSSE.cryptoProvider)) { + throw new KeyStoreException( + "FIPS mode: KeyStore must be " + + "from provider " + SunJSSE.cryptoProvider.getName()); } try { Builder builder = Builder.newInstance(ks, @@ -114,7 +116,6 @@ "Parameters must be instance of KeyStoreBuilderParameters"); } if (SunJSSE.isFIPS()) { - // XXX should be fixed throw new InvalidAlgorithmParameterException ("FIPS mode: KeyStoreBuilderParameters not supported"); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/KeyShareExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,954 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.CryptoPrimitive; +import java.security.GeneralSecurityException; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.Collections; +import java.util.EnumSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import javax.net.ssl.SSLProtocolException; +import sun.security.ssl.DHKeyExchange.DHECredentials; +import sun.security.ssl.DHKeyExchange.DHEPossession; +import sun.security.ssl.ECDHKeyExchange.ECDHECredentials; +import sun.security.ssl.ECDHKeyExchange.ECDHEPossession; +import sun.security.ssl.KeyShareExtension.CHKeyShareSpec; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.SupportedGroupsExtension.NamedGroupType; +import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; +import sun.security.util.HexDumpEncoder; + +/** + * Pack of the "key_share" extensions. + */ +final class KeyShareExtension { + static final HandshakeProducer chNetworkProducer = + new CHKeyShareProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHKeyShareConsumer(); + static final SSLStringizer chStringizer = + new CHKeyShareStringizer(); + + static final HandshakeProducer shNetworkProducer = + new SHKeyShareProducer(); + static final ExtensionConsumer shOnLoadConsumer = + new SHKeyShareConsumer(); + static final HandshakeAbsence shOnLoadAbsence = + new SHKeyShareAbsence(); + static final SSLStringizer shStringizer = + new SHKeyShareStringizer(); + + static final HandshakeProducer hrrNetworkProducer = + new HRRKeyShareProducer(); + static final ExtensionConsumer hrrOnLoadConsumer = + new HRRKeyShareConsumer(); + static final HandshakeProducer hrrNetworkReproducer = + new HRRKeyShareReproducer(); + static final SSLStringizer hrrStringizer = + new HRRKeyShareStringizer(); + + /** + * The key share entry used in "key_share" extensions. + */ + private static final class KeyShareEntry { + final int namedGroupId; + final byte[] keyExchange; + + private KeyShareEntry(int namedGroupId, byte[] keyExchange) { + this.namedGroupId = namedGroupId; + this.keyExchange = keyExchange; + } + + private byte[] getEncoded() { + byte[] buffer = new byte[keyExchange.length + 4]; + // 2: named group id + // +2: key exchange length + ByteBuffer m = ByteBuffer.wrap(buffer); + try { + Record.putInt16(m, namedGroupId); + Record.putBytes16(m, keyExchange); + } catch (IOException ioe) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Unlikely IOException", ioe); + } + } + + return buffer; + } + + private int getEncodedSize() { + return keyExchange.length + 4; // 2: named group id + // +2: key exchange length + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\n'{'\n" + + " \"named group\": {0}\n" + + " \"key_exchange\": '{'\n" + + "{1}\n" + + " '}'\n" + + "'}',", Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + NamedGroup.nameOf(namedGroupId), + Utilities.indent(hexEncoder.encode(keyExchange), " ") + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "key_share" extension in a ClientHello handshake message. + */ + static final class CHKeyShareSpec implements SSLExtensionSpec { + final List<KeyShareEntry> clientShares; + + private CHKeyShareSpec(List<KeyShareEntry> clientShares) { + this.clientShares = clientShares; + } + + private CHKeyShareSpec(ByteBuffer buffer) throws IOException { + // struct { + // KeyShareEntry client_shares<0..2^16-1>; + // } KeyShareClientHello; + if (buffer.remaining() < 2) { + throw new SSLProtocolException( + "Invalid key_share extension: " + + "insufficient data (length=" + buffer.remaining() + ")"); + } + + int listLen = Record.getInt16(buffer); + if (listLen != buffer.remaining()) { + throw new SSLProtocolException( + "Invalid key_share extension: " + + "incorrect list length (length=" + listLen + ")"); + } + + List<KeyShareEntry> keyShares = new LinkedList<>(); + while (buffer.hasRemaining()) { + int namedGroupId = Record.getInt16(buffer); + byte[] keyExchange = Record.getBytes16(buffer); + if (keyExchange.length == 0) { + throw new SSLProtocolException( + "Invalid key_share extension: empty key_exchange"); + } + + keyShares.add(new KeyShareEntry(namedGroupId, keyExchange)); + } + + this.clientShares = Collections.unmodifiableList(keyShares); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"client_shares\": '['{0}\n']'", Locale.ENGLISH); + + StringBuilder builder = new StringBuilder(512); + for (KeyShareEntry entry : clientShares) { + builder.append(entry.toString()); + } + + Object[] messageFields = { + Utilities.indent(builder.toString()) + }; + + return messageFormat.format(messageFields); + } + } + + private static final class CHKeyShareStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new CHKeyShareSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of the extension in a ClientHello + * handshake message. + */ + private static final + class CHKeyShareProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHKeyShareProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(SSLExtension.CH_KEY_SHARE)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable key_share extension"); + } + return null; + } + + List<NamedGroup> namedGroups; + if (chc.serverSelectedNamedGroup != null) { + // Response to HelloRetryRequest + namedGroups = Arrays.asList(chc.serverSelectedNamedGroup); + } else { + namedGroups = chc.clientRequestedNamedGroups; + if (namedGroups == null || namedGroups.isEmpty()) { + // No supported groups. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore key_share extension, no supported groups"); + } + return null; + } + } + + List<KeyShareEntry> keyShares = new LinkedList<>(); + for (NamedGroup ng : namedGroups) { + SSLKeyExchange ke = SSLKeyExchange.valueOf(ng); + if (ke == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "No key exchange for named group " + ng.name); + } + continue; + } + + SSLPossession[] poses = ke.createPossessions(chc); + for (SSLPossession pos : poses) { + // update the context + chc.handshakePossessions.add(pos); + if (!(pos instanceof ECDHEPossession) && + !(pos instanceof DHEPossession)) { + // May need more possesion types in the future. + continue; + } + + keyShares.add(new KeyShareEntry(ng.id, pos.encode())); + } + + // One key share entry only. Too much key share entries makes + // the ClientHello handshake message really big. + if (!keyShares.isEmpty()) { + break; + } + } + + int listLen = 0; + for (KeyShareEntry entry : keyShares) { + listLen += entry.getEncodedSize(); + } + byte[] extData = new byte[listLen + 2]; // 2: list length + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, listLen); + for (KeyShareEntry entry : keyShares) { + m.put(entry.getEncoded()); + } + + // update the context + chc.handshakeExtensions.put(SSLExtension.CH_KEY_SHARE, + new CHKeyShareSpec(keyShares)); + + return extData; + } + } + + /** + * Network data consumer of the extension in a ClientHello + * handshake message. + */ + private static final class CHKeyShareConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHKeyShareConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + if (shc.handshakeExtensions.containsKey(SSLExtension.CH_KEY_SHARE)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "The key_share extension has been loaded"); + } + return; + } + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SSLExtension.CH_KEY_SHARE)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable key_share extension"); + } + return; // ignore the extension + } + + // Parse the extension + CHKeyShareSpec spec; + try { + spec = new CHKeyShareSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + List<SSLCredentials> credentials = new LinkedList<>(); + for (KeyShareEntry entry : spec.clientShares) { + NamedGroup ng = NamedGroup.valueOf(entry.namedGroupId); + if (ng == null || !SupportedGroups.isActivatable( + shc.sslConfig.algorithmConstraints, ng)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unsupported named group: " + + NamedGroup.nameOf(entry.namedGroupId)); + } + continue; + } + + if (ng.type == NamedGroupType.NAMED_GROUP_ECDHE) { + try { + ECDHECredentials ecdhec = + ECDHECredentials.valueOf(ng, entry.keyExchange); + if (ecdhec != null) { + if (!shc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + ecdhec.popPublicKey)) { + SSLLogger.warning( + "ECDHE key share entry does not " + + "comply to algorithm constraints"); + } else { + credentials.add(ecdhec); + } + } + } catch (IOException | GeneralSecurityException ex) { + SSLLogger.warning( + "Cannot decode named group: " + + NamedGroup.nameOf(entry.namedGroupId)); + } + } else if (ng.type == NamedGroupType.NAMED_GROUP_FFDHE) { + try { + DHECredentials dhec = + DHECredentials.valueOf(ng, entry.keyExchange); + if (dhec != null) { + if (!shc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + dhec.popPublicKey)) { + SSLLogger.warning( + "DHE key share entry does not " + + "comply to algorithm constraints"); + } else { + credentials.add(dhec); + } + } + } catch (IOException | GeneralSecurityException ex) { + SSLLogger.warning( + "Cannot decode named group: " + + NamedGroup.nameOf(entry.namedGroupId)); + } + } + } + + if (!credentials.isEmpty()) { + shc.handshakeCredentials.addAll(credentials); + } else { + // New handshake credentials are required from the client side. + shc.handshakeProducers.put( + SSLHandshake.HELLO_RETRY_REQUEST.id, + SSLHandshake.HELLO_RETRY_REQUEST); + } + + // update the context + shc.handshakeExtensions.put(SSLExtension.CH_KEY_SHARE, spec); + } + } + + /** + * The key share entry used in ServerHello "key_share" extensions. + */ + static final class SHKeyShareSpec implements SSLExtensionSpec { + final KeyShareEntry serverShare; + + SHKeyShareSpec(KeyShareEntry serverShare) { + this.serverShare = serverShare; + } + + private SHKeyShareSpec(ByteBuffer buffer) throws IOException { + // struct { + // KeyShareEntry server_share; + // } KeyShareServerHello; + if (buffer.remaining() < 5) { // 5: minimal server_share + throw new SSLProtocolException( + "Invalid key_share extension: " + + "insufficient data (length=" + buffer.remaining() + ")"); + } + + int namedGroupId = Record.getInt16(buffer); + byte[] keyExchange = Record.getBytes16(buffer); + + if (buffer.hasRemaining()) { + throw new SSLProtocolException( + "Invalid key_share extension: unknown extra data"); + } + + this.serverShare = new KeyShareEntry(namedGroupId, keyExchange); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"server_share\": '{'\n" + + " \"named group\": {0}\n" + + " \"key_exchange\": '{'\n" + + "{1}\n" + + " '}'\n" + + "'}',", Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + NamedGroup.nameOf(serverShare.namedGroupId), + Utilities.indent( + hexEncoder.encode(serverShare.keyExchange), " ") + }; + + return messageFormat.format(messageFields); + } + } + + private static final class SHKeyShareStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new SHKeyShareSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of the extension in a ServerHello + * handshake message. + */ + private static final class SHKeyShareProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHKeyShareProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // In response to key_share request only + CHKeyShareSpec kss = + (CHKeyShareSpec)shc.handshakeExtensions.get( + SSLExtension.CH_KEY_SHARE); + if (kss == null) { + // Unlikely, no key_share extension requested. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore, no client key_share extension"); + } + return null; + } + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SSLExtension.SH_KEY_SHARE)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore, no available server key_share extension"); + } + return null; + } + + // use requested key share entries + if ((shc.handshakeCredentials == null) || + shc.handshakeCredentials.isEmpty()) { + // Unlikely, HelloRetryRequest should be used ealier. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "No available client key share entries"); + } + return null; + } + + KeyShareEntry keyShare = null; + for (SSLCredentials cd : shc.handshakeCredentials) { + NamedGroup ng = null; + if (cd instanceof ECDHECredentials) { + ng = ((ECDHECredentials)cd).namedGroup; + } else if (cd instanceof DHECredentials) { + ng = ((DHECredentials)cd).namedGroup; + } + + if (ng == null) { + continue; + } + + SSLKeyExchange ke = SSLKeyExchange.valueOf(ng); + if (ke == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "No key exchange for named group " + ng.name); + } + continue; + } + + SSLPossession[] poses = ke.createPossessions(shc); + for (SSLPossession pos : poses) { + if (!(pos instanceof ECDHEPossession) && + !(pos instanceof DHEPossession)) { + // May need more possesion types in the future. + continue; + } + + // update the context + shc.handshakeKeyExchange = ke; + shc.handshakePossessions.add(pos); + keyShare = new KeyShareEntry(ng.id, pos.encode()); + break; + } + + if (keyShare != null) { + for (Map.Entry<Byte, HandshakeProducer> me : + ke.getHandshakeProducers(shc)) { + shc.handshakeProducers.put( + me.getKey(), me.getValue()); + } + + // We have got one! Don't forgor to break. + break; + } + } + + if (keyShare == null) { + // Unlikely, HelloRetryRequest should be used instead ealier. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "No available server key_share extension"); + } + return null; + } + + byte[] extData = keyShare.getEncoded(); + + // update the context + SHKeyShareSpec spec = new SHKeyShareSpec(keyShare); + shc.handshakeExtensions.put(SSLExtension.SH_KEY_SHARE, spec); + + return extData; + } + } + + /** + * Network data consumer of the extension in a ServerHello + * handshake message. + */ + private static final class SHKeyShareConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHKeyShareConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // Happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + if (chc.clientRequestedNamedGroups == null || + chc.clientRequestedNamedGroups.isEmpty()) { + // No supported groups. + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected key_share extension in ServerHello"); + return; // fatal() always throws, make the compiler happy. + } + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(SSLExtension.SH_KEY_SHARE)) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported key_share extension in ServerHello"); + return; // fatal() always throws, make the compiler happy. + } + + // Parse the extension + SHKeyShareSpec spec; + try { + spec = new SHKeyShareSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + KeyShareEntry keyShare = spec.serverShare; + NamedGroup ng = NamedGroup.valueOf(keyShare.namedGroupId); + if (ng == null || !SupportedGroups.isActivatable( + chc.sslConfig.algorithmConstraints, ng)) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported named group: " + + NamedGroup.nameOf(keyShare.namedGroupId)); + return; // fatal() always throws, make the compiler happy. + } + + SSLKeyExchange ke = SSLKeyExchange.valueOf(ng); + if (ke == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "No key exchange for named group " + ng.name); + return; // fatal() always throws, make the compiler happy. + } + + SSLCredentials credentials = null; + if (ng.type == NamedGroupType.NAMED_GROUP_ECDHE) { + try { + ECDHECredentials ecdhec = + ECDHECredentials.valueOf(ng, keyShare.keyExchange); + if (ecdhec != null) { + if (!chc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + ecdhec.popPublicKey)) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "ECDHE key share entry does not " + + "comply to algorithm constraints"); + } else { + credentials = ecdhec; + } + } + } catch (IOException | GeneralSecurityException ex) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Cannot decode named group: " + + NamedGroup.nameOf(keyShare.namedGroupId)); + } + } else if (ng.type == NamedGroupType.NAMED_GROUP_FFDHE) { + try { + DHECredentials dhec = + DHECredentials.valueOf(ng, keyShare.keyExchange); + if (dhec != null) { + if (!chc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + dhec.popPublicKey)) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "DHE key share entry does not " + + "comply to algorithm constraints"); + } else { + credentials = dhec; + } + } + } catch (IOException | GeneralSecurityException ex) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Cannot decode named group: " + + NamedGroup.nameOf(keyShare.namedGroupId)); + } + } else { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported named group: " + + NamedGroup.nameOf(keyShare.namedGroupId)); + } + + if (credentials == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported named group: " + ng.name); + } + + // update the context + chc.handshakeKeyExchange = ke; + chc.handshakeCredentials.add(credentials); + chc.handshakeExtensions.put(SSLExtension.SH_KEY_SHARE, spec); + } + } + + /** + * The absence processing if the extension is not present in + * the ServerHello handshake message. + */ + private static final class SHKeyShareAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Cannot use the previous requested key shares any more. + if (SSLLogger.isOn && SSLLogger.isOn("handshake")) { + SSLLogger.fine( + "No key_share extension in ServerHello, " + + "cleanup the key shares if necessary"); + } + chc.handshakePossessions.clear(); + } + } + + /** + * The key share entry used in HelloRetryRequest "key_share" extensions. + */ + static final class HRRKeyShareSpec implements SSLExtensionSpec { + final int selectedGroup; + + HRRKeyShareSpec(NamedGroup serverGroup) { + this.selectedGroup = serverGroup.id; + } + + private HRRKeyShareSpec(ByteBuffer buffer) throws IOException { + // struct { + // NamedGroup selected_group; + // } KeyShareHelloRetryRequest; + if (buffer.remaining() != 2) { + throw new SSLProtocolException( + "Invalid key_share extension: " + + "improper data (length=" + buffer.remaining() + ")"); + } + + this.selectedGroup = Record.getInt16(buffer); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"selected group\": '['{0}']'", Locale.ENGLISH); + + Object[] messageFields = { + NamedGroup.nameOf(selectedGroup) + }; + return messageFormat.format(messageFields); + } + } + + private static final class HRRKeyShareStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new HRRKeyShareSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of the extension in a HelloRetryRequest + * handshake message. + */ + private static final + class HRRKeyShareProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private HRRKeyShareProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext) context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SSLExtension.HRR_KEY_SHARE)) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported key_share extension in HelloRetryRequest"); + return null; // make the compiler happy. + } + + if (shc.clientRequestedNamedGroups == null || + shc.clientRequestedNamedGroups.isEmpty()) { + // No supported groups. + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected key_share extension in HelloRetryRequest"); + return null; // make the compiler happy. + } + + NamedGroup selectedGroup = null; + for (NamedGroup ng : shc.clientRequestedNamedGroups) { + if (SupportedGroups.isActivatable( + shc.sslConfig.algorithmConstraints, ng)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "HelloRetryRequest selected named group: " + + ng.name); + } + + selectedGroup = ng; + break; + } + } + + if (selectedGroup == null) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + new IOException("No common named group")); + return null; // make the complier happy + } + + byte[] extdata = new byte[] { + (byte)((selectedGroup.id >> 8) & 0xFF), + (byte)(selectedGroup.id & 0xFF) + }; + + // update the context + shc.serverSelectedNamedGroup = selectedGroup; + shc.handshakeExtensions.put(SSLExtension.HRR_KEY_SHARE, + new HRRKeyShareSpec(selectedGroup)); + + return extdata; + } + } + + /** + * Network data producer of the extension for stateless + * HelloRetryRequest reconstruction. + */ + private static final + class HRRKeyShareReproducer implements HandshakeProducer { + // Prevent instantiation of this class. + private HRRKeyShareReproducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext) context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SSLExtension.HRR_KEY_SHARE)) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported key_share extension in HelloRetryRequest"); + return null; // make the compiler happy. + } + + CHKeyShareSpec spec = (CHKeyShareSpec)shc.handshakeExtensions.get( + SSLExtension.CH_KEY_SHARE); + if (spec != null && spec.clientShares != null && + spec.clientShares.size() == 1) { + int namedGroupId = spec.clientShares.get(0).namedGroupId; + + byte[] extdata = new byte[] { + (byte)((namedGroupId >> 8) & 0xFF), + (byte)(namedGroupId & 0xFF) + }; + + return extdata; + } + + return null; + } + } + + /** + * Network data consumer of the extension in a HelloRetryRequest + * handshake message. + */ + private static final + class HRRKeyShareConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private HRRKeyShareConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(SSLExtension.HRR_KEY_SHARE)) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported key_share extension in HelloRetryRequest"); + return; // make the compiler happy. + } + + if (chc.clientRequestedNamedGroups == null || + chc.clientRequestedNamedGroups.isEmpty()) { + // No supported groups. + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected key_share extension in HelloRetryRequest"); + return; // make the compiler happy. + } + + // Parse the extension + HRRKeyShareSpec spec; + try { + spec = new HRRKeyShareSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + NamedGroup serverGroup = NamedGroup.valueOf(spec.selectedGroup); + if (serverGroup == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported HelloRetryRequest selected group: " + + NamedGroup.nameOf(spec.selectedGroup)); + return; // fatal() always throws, make the compiler happy. + } + + if (!chc.clientRequestedNamedGroups.contains(serverGroup)) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected HelloRetryRequest selected group: " + + serverGroup.name); + return; // fatal() always throws, make the compiler happy. + } + + // update the context + + // When sending the new ClientHello, the client MUST replace the + // original "key_share" extension with one containing only a new + // KeyShareEntry for the group indicated in the selected_group + // field of the triggering HelloRetryRequest. + // + chc.serverSelectedNamedGroup = serverGroup; + chc.handshakeExtensions.put(SSLExtension.HRR_KEY_SHARE, spec); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/KeyUpdate.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,324 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.text.MessageFormat; +import java.util.Locale; + +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SSLCipher.SSLReadCipher; +import sun.security.ssl.SSLCipher.SSLWriteCipher; + +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; + +/** + * Pack of the KeyUpdate handshake message. + */ +final class KeyUpdate { + static final SSLProducer kickstartProducer = + new KeyUpdateKickstartProducer(); + + static final SSLConsumer handshakeConsumer = + new KeyUpdateConsumer(); + static final HandshakeProducer handshakeProducer = + new KeyUpdateProducer(); + + /** + * The KeyUpdate handshake message. + * + * The KeyUpdate handshake message is used to indicate that the sender is + * updating its sending cryptographic keys. + * + * enum { + * update_not_requested(0), update_requested(1), (255) + * } KeyUpdateRequest; + * + * struct { + * KeyUpdateRequest request_update; + * } KeyUpdate; + */ + static final class KeyUpdateMessage extends HandshakeMessage { + private final KeyUpdateRequest status; + + KeyUpdateMessage(PostHandshakeContext context, + KeyUpdateRequest status) { + super(context); + this.status = status; + } + + KeyUpdateMessage(PostHandshakeContext context, + ByteBuffer m) throws IOException { + super(context); + + if (m.remaining() != 1) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "KeyUpdate has an unexpected length of "+ + m.remaining()); + } + + byte request = m.get(); + this.status = KeyUpdateRequest.valueOf(request); + if (status == null) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid KeyUpdate message value: " + + KeyUpdateRequest.nameOf(request)); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.KEY_UPDATE; + } + + @Override + public int messageLength() { + // one byte enum + return 1; + } + + @Override + public void send(HandshakeOutStream s) throws IOException { + s.putInt8(status.id); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"KeyUpdate\": '{'\n" + + " \"request_update\": {0}\n" + + "'}'", + Locale.ENGLISH); + + Object[] messageFields = { + status.name + }; + + return messageFormat.format(messageFields); + } + } + + enum KeyUpdateRequest { + NOTREQUESTED ((byte)0, "update_not_requested"), + REQUESTED ((byte)1, "update_requested"); + + final byte id; + final String name; + + private KeyUpdateRequest(byte id, String name) { + this.id = id; + this.name = name; + } + + static KeyUpdateRequest valueOf(byte id) { + for (KeyUpdateRequest kur : KeyUpdateRequest.values()) { + if (kur.id == id) { + return kur; + } + } + + return null; + } + + static String nameOf(byte id) { + for (KeyUpdateRequest kur : KeyUpdateRequest.values()) { + if (kur.id == id) { + return kur.name; + } + } + + return "<UNKNOWN KeyUpdateRequest TYPE: " + (id & 0x0FF) + ">"; + } + } + + private static final + class KeyUpdateKickstartProducer implements SSLProducer { + // Prevent instantiation of this class. + private KeyUpdateKickstartProducer() { + // blank + } + + // Produce kickstart handshake message. + @Override + public byte[] produce(ConnectionContext context) throws IOException { + PostHandshakeContext hc = (PostHandshakeContext)context; + return handshakeProducer.produce(context, + new KeyUpdateMessage(hc, KeyUpdateRequest.REQUESTED)); + } + } + + /** + * The "KeyUpdate" handshake message consumer. + */ + private static final class KeyUpdateConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private KeyUpdateConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + PostHandshakeContext hc = (PostHandshakeContext)context; + KeyUpdateMessage km = new KeyUpdateMessage(hc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming KeyUpdate post-handshake message", km); + } + + // Update read key and IV. + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(hc.conContext.protocolVersion); + if (kdg == null) { + // unlikely + hc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + hc.conContext.protocolVersion); + return; + } + + SSLKeyDerivation skd = kdg.createKeyDerivation(hc, + hc.conContext.inputRecord.readCipher.baseSecret); + if (skd == null) { + // unlikely + hc.conContext.fatal(Alert.INTERNAL_ERROR, "no key derivation"); + return; + } + + SecretKey nplus1 = skd.deriveKey("TlsUpdateNplus1", null); + SSLKeyDerivation kd = kdg.createKeyDerivation(hc, nplus1); + SecretKey key = kd.deriveKey("TlsKey", null); + IvParameterSpec ivSpec = new IvParameterSpec( + kd.deriveKey("TlsIv", null).getEncoded()); + try { + SSLReadCipher rc = + hc.negotiatedCipherSuite.bulkCipher.createReadCipher( + Authenticator.valueOf(hc.conContext.protocolVersion), + hc.conContext.protocolVersion, key, ivSpec, + hc.sslContext.getSecureRandom()); + hc.conContext.inputRecord.changeReadCiphers(rc); + hc.conContext.inputRecord.readCipher.baseSecret = nplus1; + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("KeyUpdate: read key updated"); + } + } catch (GeneralSecurityException gse) { + hc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failure to derive read secrets", gse); + return; + } + + if (km.status == KeyUpdateRequest.REQUESTED) { + // Update the write key and IV. + handshakeProducer.produce(hc, + new KeyUpdateMessage(hc, KeyUpdateRequest.NOTREQUESTED)); + return; + } + + // clean handshake context + hc.conContext.finishPostHandshake(); + } + } + + /** + * The "KeyUpdate" handshake message producer. + */ + private static final class KeyUpdateProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private KeyUpdateProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + PostHandshakeContext hc = (PostHandshakeContext)context; + KeyUpdateMessage km = (KeyUpdateMessage)message; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced KeyUpdate post-handshake message", km); + } + + // Update the write key and IV. + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(hc.conContext.protocolVersion); + if (kdg == null) { + // unlikely + hc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + hc.conContext.protocolVersion); + return null; + } + + SSLKeyDerivation skd = kdg.createKeyDerivation(hc, + hc.conContext.outputRecord.writeCipher.baseSecret); + if (skd == null) { + // unlikely + hc.conContext.fatal(Alert.INTERNAL_ERROR, "no key derivation"); + return null; + } + + SecretKey nplus1 = skd.deriveKey("TlsUpdateNplus1", null); + SSLKeyDerivation kd = kdg.createKeyDerivation(hc, nplus1); + SecretKey key = kd.deriveKey("TlsKey", null); + IvParameterSpec ivSpec = new IvParameterSpec( + kd.deriveKey("TlsIv", null).getEncoded()); + + SSLWriteCipher wc; + try { + wc = hc.negotiatedCipherSuite.bulkCipher.createWriteCipher( + Authenticator.valueOf(hc.conContext.protocolVersion), + hc.conContext.protocolVersion, key, ivSpec, + hc.sslContext.getSecureRandom()); + } catch (GeneralSecurityException gse) { + hc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failure to derive write secrets", gse); + return null; + } + + // Output the handshake message. + km.write(hc.handshakeOutput); + hc.handshakeOutput.flush(); + + // change write cipher + hc.conContext.outputRecord.changeWriteCiphers(wc, false); + hc.conContext.outputRecord.writeCipher.baseSecret = nplus1; + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("KeyUpdate: write key updated"); + } + + // clean handshake context + hc.conContext.finishPostHandshake(); + + // The handshake message has been delivered. + return null; + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/MAC.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/MAC.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/MAC.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/MAC.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,199 +0,0 @@ -/* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.security.InvalidKeyException; -import java.security.NoSuchAlgorithmException; - -import java.nio.ByteBuffer; - -import javax.crypto.Mac; -import javax.crypto.SecretKey; - -import sun.security.ssl.CipherSuite.MacAlg; -import static sun.security.ssl.CipherSuite.*; -import static sun.security.ssl.CipherSuite.MacAlg.*; - -/** - * This class computes the "Message Authentication Code" (MAC) for each - * SSL stream and block cipher message. This is essentially a shared-secret - * signature, used to provide integrity protection for SSL messages. The - * MAC is actually one of several keyed hashes, as associated with the cipher - * suite and protocol version. (SSL v3.0 uses one construct, TLS uses another.) - * - * @author David Brownell - * @author Andreas Sterbenz - */ -final class MAC extends Authenticator { - - static final MAC TLS_NULL = new MAC(false); - - // Value of the null MAC is fixed - private static final byte[] nullMAC = new byte[0]; - - // internal identifier for the MAC algorithm - private final MacAlg macAlg; - - // JCE Mac object - private final Mac mac; - - MAC(boolean isDTLS) { - super(isDTLS); - - macAlg = M_NULL; - mac = null; - } - - /** - * Set up, configured for the given MAC type and version. - */ - MAC(MacAlg macAlg, ProtocolVersion protocolVersion, SecretKey key) - throws NoSuchAlgorithmException, InvalidKeyException { - super(protocolVersion); - this.macAlg = macAlg; - - String algorithm; - - // using SSL MAC computation? - boolean useSSLMac = (protocolVersion.v < ProtocolVersion.TLS10.v); - - if (macAlg == M_MD5) { - algorithm = useSSLMac ? "SslMacMD5" : "HmacMD5"; - } else if (macAlg == M_SHA) { - algorithm = useSSLMac ? "SslMacSHA1" : "HmacSHA1"; - } else if (macAlg == M_SHA256) { - algorithm = "HmacSHA256"; // TLS 1.2+ - } else if (macAlg == M_SHA384) { - algorithm = "HmacSHA384"; // TLS 1.2+ - } else { - throw new RuntimeException("Unknown Mac " + macAlg); - } - - mac = JsseJce.getMac(algorithm); - mac.init(key); - } - - /** - * Returns the length of the MAC. - */ - int MAClen() { - return macAlg.size; - } - - /** - * Returns the hash function block length of the MAC alorithm. - */ - int hashBlockLen() { - return macAlg.hashBlockSize; - } - - /** - * Returns the hash function minimal padding length of the MAC alorithm. - */ - int minimalPaddingLen() { - return macAlg.minimalPaddingSize; - } - - /** - * Computes and returns the MAC for the data in this byte array. - * - * @param type record type - * @param buf compressed record on which the MAC is computed - * @param offset start of compressed record data - * @param len the size of the compressed record - * @param isSimulated if true, simulate the MAC computation - * - * @return the MAC result - */ - final byte[] compute(byte type, byte buf[], - int offset, int len, boolean isSimulated) { - if (macAlg.size == 0) { - return nullMAC; - } - - if (!isSimulated) { - // Uses the implicit sequence number for the computation. - byte[] additional = acquireAuthenticationBytes(type, len, null); - mac.update(additional); - } - mac.update(buf, offset, len); - - return mac.doFinal(); - } - - /** - * Compute and returns the MAC for the remaining data - * in this ByteBuffer. - * - * On return, the bb position == limit, and limit will - * have not changed. - * - * @param type record type - * @param bb a ByteBuffer in which the position and limit - * demarcate the data to be MAC'd. - * @param isSimulated if true, simulate the MAC computation - * @param sequence the explicit sequence number, or null if using - * the implicit sequence number for the computation - * - * @return the MAC result - */ - final byte[] compute(byte type, ByteBuffer bb, - byte[] sequence, boolean isSimulated) { - - if (macAlg.size == 0) { - return nullMAC; - } - - if (!isSimulated) { - // Uses the explicit sequence number for the computation. - byte[] additional = - acquireAuthenticationBytes(type, bb.remaining(), sequence); - mac.update(additional); - } - mac.update(bb); - - return mac.doFinal(); - } - - /** - * Compute and returns the MAC for the remaining data - * in this ByteBuffer. - * - * On return, the bb position == limit, and limit will - * have not changed. - * - * @param type record type - * @param bb a ByteBuffer in which the position and limit - * demarcate the data to be MAC'd. - * @param isSimulated if true, simulate the MAC computation - * - * @return the MAC result - */ - final byte[] compute(byte type, ByteBuffer bb, boolean isSimulated) { - // Uses the implicit sequence number for the computation. - return compute(type, bb, null, isSimulated); - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/MaxFragExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,620 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import javax.net.ssl.SSLProtocolException; +import static sun.security.ssl.SSLExtension.CH_MAX_FRAGMENT_LENGTH; +import static sun.security.ssl.SSLExtension.EE_MAX_FRAGMENT_LENGTH; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import static sun.security.ssl.SSLExtension.SH_MAX_FRAGMENT_LENGTH; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the "max_fragment_length" extensions [RFC6066]. + */ +final class MaxFragExtension { + static final HandshakeProducer chNetworkProducer = + new CHMaxFragmentLengthProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHMaxFragmentLengthConsumer(); + + static final HandshakeProducer shNetworkProducer = + new SHMaxFragmentLengthProducer(); + static final ExtensionConsumer shOnLoadConsumer = + new SHMaxFragmentLengthConsumer(); + static final HandshakeConsumer shOnTradeConsumer = + new SHMaxFragmentLengthUpdate(); + + static final HandshakeProducer eeNetworkProducer = + new EEMaxFragmentLengthProducer(); + static final ExtensionConsumer eeOnLoadConsumer = + new EEMaxFragmentLengthConsumer(); + static final HandshakeConsumer eeOnTradeConsumer = + new EEMaxFragmentLengthUpdate(); + + static final SSLStringizer maxFragLenStringizer = + new MaxFragLenStringizer(); + + /** + * The "max_fragment_length" extension [RFC 6066]. + */ + static final class MaxFragLenSpec implements SSLExtensionSpec { + byte id; + + private MaxFragLenSpec(byte id) { + this.id = id; + } + + private MaxFragLenSpec(ByteBuffer buffer) throws IOException { + if (buffer.remaining() != 1) { + throw new SSLProtocolException( + "Invalid max_fragment_length extension data"); + } + + this.id = buffer.get(); + } + + @Override + public String toString() { + return MaxFragLenEnum.nameOf(id); + } + } + + private static final class MaxFragLenStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new MaxFragLenSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + static enum MaxFragLenEnum { + MFL_512 ((byte)0x01, 512, "2^9"), + MFL_1024 ((byte)0x02, 1024, "2^10"), + MFL_2048 ((byte)0x03, 2048, "2^11"), + MFL_4096 ((byte)0x04, 4096, "2^12"); + + final byte id; + final int fragmentSize; + final String description; + + private MaxFragLenEnum(byte id, int fragmentSize, String description) { + this.id = id; + this.fragmentSize = fragmentSize; + this.description = description; + } + + private static MaxFragLenEnum valueOf(byte id) { + for (MaxFragLenEnum mfl : MaxFragLenEnum.values()) { + if (mfl.id == id) { + return mfl; + } + } + + return null; + } + + private static String nameOf(byte id) { + for (MaxFragLenEnum mfl : MaxFragLenEnum.values()) { + if (mfl.id == id) { + return mfl.description; + } + } + + return "UNDEFINED-MAX-FRAGMENT-LENGTH(" + id + ")"; + } + + /** + * Returns the best match enum constant of the specified + * fragment size. + */ + static MaxFragLenEnum valueOf(int fragmentSize) { + if (fragmentSize <= 0) { + return null; + } else if (fragmentSize < 1024) { + return MFL_512; + } else if (fragmentSize < 2048) { + return MFL_1024; + } else if (fragmentSize < 4096) { + return MFL_2048; + } else if (fragmentSize == 4096) { + return MFL_4096; + } + + return null; + } + } + + /** + * Network data producer of a "max_fragment_length" extension in + * the ClientHello handshake message. + */ + private static final + class CHMaxFragmentLengthProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHMaxFragmentLengthProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(CH_MAX_FRAGMENT_LENGTH)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable max_fragment_length extension"); + } + return null; + } + + // Produce the extension and update the context. + int requestedMFLength; + if (chc.isResumption && (chc.resumingSession != null)) { + // The same extension should be sent for resumption. + requestedMFLength = + chc.resumingSession.getNegotiatedMaxFragSize(); + } else if (chc.sslConfig.maximumPacketSize != 0) { + // Maybe we can calculate the fragment size more accurate + // by condering the enabled cipher suites in the future. + requestedMFLength = chc.sslConfig.maximumPacketSize; + if (chc.sslContext.isDTLS()) { + requestedMFLength -= DTLSRecord.maxPlaintextPlusSize; + } else { + requestedMFLength -= SSLRecord.maxPlaintextPlusSize; + } + } else { + // Need no max_fragment_length extension. + requestedMFLength = -1; + } + + MaxFragLenEnum mfl = MaxFragLenEnum.valueOf(requestedMFLength); + if (mfl != null) { + // update the context. + chc.handshakeExtensions.put( + CH_MAX_FRAGMENT_LENGTH, new MaxFragLenSpec(mfl.id)); + + return new byte[] { mfl.id }; + } else { + // log and ignore, no MFL extension. + chc.maxFragmentLength = -1; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "No available max_fragment_length extension can " + + "be used for fragment size of " + + requestedMFLength + "bytes"); + } + } + + return null; + } + } + + /** + * Network data consumer of a "max_fragment_length" extension in + * the ClientHello handshake message. + */ + private static final + class CHMaxFragmentLengthConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHMaxFragmentLengthConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + if (!shc.sslConfig.isAvailable(CH_MAX_FRAGMENT_LENGTH)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable max_fragment_length extension"); + } + return; // ignore the extension + } + + // Parse the extension. + MaxFragLenSpec spec; + try { + spec = new MaxFragLenSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + MaxFragLenEnum mfle = MaxFragLenEnum.valueOf(spec.id); + if (mfle == null) { + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "the requested maximum fragment length is other " + + "than the allowed values"); + } + + // Update the context. + shc.maxFragmentLength = mfle.fragmentSize; + shc.handshakeExtensions.put(CH_MAX_FRAGMENT_LENGTH, spec); + + // No impact on session resumption. + } + } + + /** + * Network data producer of a "max_fragment_length" extension in + * the ServerHello handshake message. + */ + private static final + class SHMaxFragmentLengthProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHMaxFragmentLengthProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // In response to "max_fragment_length" extension request only + MaxFragLenSpec spec = (MaxFragLenSpec) + shc.handshakeExtensions.get(CH_MAX_FRAGMENT_LENGTH); + if (spec == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Ignore unavailable max_fragment_length extension"); + } + return null; // ignore the extension + } + + if ((shc.maxFragmentLength > 0) && + (shc.sslConfig.maximumPacketSize != 0)) { + int estimatedMaxFragSize = + shc.negotiatedCipherSuite.calculatePacketSize( + shc.maxFragmentLength, shc.negotiatedProtocol, + shc.sslContext.isDTLS()); + if (estimatedMaxFragSize > shc.sslConfig.maximumPacketSize) { + // For better interoperability, abort the maximum + // fragment length negotiation, rather than terminate + // the connection with a fatal alert. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Abort the maximum fragment length negotiation, " + + "may overflow the maximum packet size limit."); + } + shc.maxFragmentLength = -1; + } + } + + // update the context + if (shc.maxFragmentLength > 0) { + shc.handshakeSession.setNegotiatedMaxFragSize( + shc.maxFragmentLength); + shc.conContext.inputRecord.changeFragmentSize( + shc.maxFragmentLength); + shc.conContext.outputRecord.changeFragmentSize( + shc.maxFragmentLength); + + // The response extension data is the same as the requested one. + shc.handshakeExtensions.put(SH_MAX_FRAGMENT_LENGTH, spec); + return new byte[] { spec.id }; + } + + return null; + } + } + + /** + * Network data consumer of a "max_fragment_length" extension in + * the ServerHello handshake message. + */ + private static final + class SHMaxFragmentLengthConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHMaxFragmentLengthConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to "max_fragment_length" extension request only + MaxFragLenSpec requestedSpec = (MaxFragLenSpec) + chc.handshakeExtensions.get(CH_MAX_FRAGMENT_LENGTH); + if (requestedSpec == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected max_fragment_length extension in ServerHello"); + } + + // Parse the extension. + MaxFragLenSpec spec; + try { + spec = new MaxFragLenSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + if (spec.id != requestedSpec.id) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "The maximum fragment length response is not requested"); + } + + MaxFragLenEnum mfle = MaxFragLenEnum.valueOf(spec.id); + if (mfle == null) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "the requested maximum fragment length is other " + + "than the allowed values"); + } + + // update the context + chc.maxFragmentLength = mfle.fragmentSize; + chc.handshakeExtensions.put(SH_MAX_FRAGMENT_LENGTH, spec); + } + } + + /** + * After session creation consuming of a "max_fragment_length" + * extension in the ClientHello handshake message. + */ + private static final class SHMaxFragmentLengthUpdate + implements HandshakeConsumer { + + // Prevent instantiation of this class. + private SHMaxFragmentLengthUpdate() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + MaxFragLenSpec spec = (MaxFragLenSpec) + chc.handshakeExtensions.get(SH_MAX_FRAGMENT_LENGTH); + if (spec == null) { + // Ignore, no "max_fragment_length" extension response. + return; + } + + if ((chc.maxFragmentLength > 0) && + (chc.sslConfig.maximumPacketSize != 0)) { + int estimatedMaxFragSize = + chc.negotiatedCipherSuite.calculatePacketSize( + chc.maxFragmentLength, chc.negotiatedProtocol, + chc.sslContext.isDTLS()); + if (estimatedMaxFragSize > chc.sslConfig.maximumPacketSize) { + // For better interoperability, abort the maximum + // fragment length negotiation, rather than terminate + // the connection with a fatal alert. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Abort the maximum fragment length negotiation, " + + "may overflow the maximum packet size limit."); + } + chc.maxFragmentLength = -1; + } + } + + // update the context + if (chc.maxFragmentLength > 0) { + chc.handshakeSession.setNegotiatedMaxFragSize( + chc.maxFragmentLength); + chc.conContext.inputRecord.changeFragmentSize( + chc.maxFragmentLength); + chc.conContext.outputRecord.changeFragmentSize( + chc.maxFragmentLength); + } + } + } + + /** + * Network data producer of a "max_fragment_length" extension in + * the EncryptedExtensions handshake message. + */ + private static final + class EEMaxFragmentLengthProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private EEMaxFragmentLengthProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // In response to "max_fragment_length" extension request only + MaxFragLenSpec spec = (MaxFragLenSpec) + shc.handshakeExtensions.get(CH_MAX_FRAGMENT_LENGTH); + if (spec == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Ignore unavailable max_fragment_length extension"); + } + return null; // ignore the extension + } + + if ((shc.maxFragmentLength > 0) && + (shc.sslConfig.maximumPacketSize != 0)) { + int estimatedMaxFragSize = + shc.negotiatedCipherSuite.calculatePacketSize( + shc.maxFragmentLength, shc.negotiatedProtocol, + shc.sslContext.isDTLS()); + if (estimatedMaxFragSize > shc.sslConfig.maximumPacketSize) { + // For better interoperability, abort the maximum + // fragment length negotiation, rather than terminate + // the connection with a fatal alert. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Abort the maximum fragment length negotiation, " + + "may overflow the maximum packet size limit."); + } + shc.maxFragmentLength = -1; + } + } + + // update the context + if (shc.maxFragmentLength > 0) { + shc.handshakeSession.setNegotiatedMaxFragSize( + shc.maxFragmentLength); + shc.conContext.inputRecord.changeFragmentSize( + shc.maxFragmentLength); + shc.conContext.outputRecord.changeFragmentSize( + shc.maxFragmentLength); + + // The response extension data is the same as the requested one. + shc.handshakeExtensions.put(EE_MAX_FRAGMENT_LENGTH, spec); + return new byte[] { spec.id }; + } + + return null; + } + } + + /** + * Network data consumer of a "max_fragment_length" extension in the + * EncryptedExtensions handshake message. + */ + private static final + class EEMaxFragmentLengthConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private EEMaxFragmentLengthConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to "max_fragment_length" extension request only + MaxFragLenSpec requestedSpec = (MaxFragLenSpec) + chc.handshakeExtensions.get(CH_MAX_FRAGMENT_LENGTH); + if (requestedSpec == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected max_fragment_length extension in ServerHello"); + } + + // Parse the extension. + MaxFragLenSpec spec; + try { + spec = new MaxFragLenSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + if (spec.id != requestedSpec.id) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "The maximum fragment length response is not requested"); + } + + MaxFragLenEnum mfle = MaxFragLenEnum.valueOf(spec.id); + if (mfle == null) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "the requested maximum fragment length is other " + + "than the allowed values"); + } + + // update the context + chc.maxFragmentLength = mfle.fragmentSize; + chc.handshakeExtensions.put(EE_MAX_FRAGMENT_LENGTH, spec); + } + } + + /** + * After session creation consuming of a "max_fragment_length" + * extension in the EncryptedExtensions handshake message. + */ + private static final + class EEMaxFragmentLengthUpdate implements HandshakeConsumer { + // Prevent instantiation of this class. + private EEMaxFragmentLengthUpdate() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + MaxFragLenSpec spec = (MaxFragLenSpec) + chc.handshakeExtensions.get(EE_MAX_FRAGMENT_LENGTH); + if (spec == null) { + // Ignore, no "max_fragment_length" extension response. + return; + } + + if ((chc.maxFragmentLength > 0) && + (chc.sslConfig.maximumPacketSize != 0)) { + int estimatedMaxFragSize = + chc.negotiatedCipherSuite.calculatePacketSize( + chc.maxFragmentLength, chc.negotiatedProtocol, + chc.sslContext.isDTLS()); + if (estimatedMaxFragSize > chc.sslConfig.maximumPacketSize) { + // For better interoperability, abort the maximum + // fragment length negotiation, rather than terminate + // the connection with a fatal alert. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Abort the maximum fragment length negotiation, " + + "may overflow the maximum packet size limit."); + } + chc.maxFragmentLength = -1; + } + } + + // update the context + if (chc.maxFragmentLength > 0) { + chc.handshakeSession.setNegotiatedMaxFragSize( + chc.maxFragmentLength); + chc.conContext.inputRecord.changeFragmentSize( + chc.maxFragmentLength); + chc.conContext.outputRecord.changeFragmentSize( + chc.maxFragmentLength); + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/MaxFragmentLengthExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/MaxFragmentLengthExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/MaxFragmentLengthExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/MaxFragmentLengthExtension.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,139 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import javax.net.ssl.SSLProtocolException; - -/* - * [RFC6066] TLS specifies a fixed maximum plaintext fragment length of - * 2^14 bytes. It may be desirable for constrained clients to negotiate - * a smaller maximum fragment length due to memory limitations or bandwidth - * limitations. - * - * In order to negotiate smaller maximum fragment lengths, clients MAY - * include an extension of type "max_fragment_length" in the (extended) - * client hello. The "extension_data" field of this extension SHALL - * contain: - * - * enum{ - * 2^9(1), 2^10(2), 2^11(3), 2^12(4), (255) - * } MaxFragmentLength; - * - * whose value is the desired maximum fragment length. - */ -final class MaxFragmentLengthExtension extends HelloExtension { - - private static final int MAX_FRAGMENT_LENGTH_512 = 1; // 2^9 - private static final int MAX_FRAGMENT_LENGTH_1024 = 2; // 2^10 - private static final int MAX_FRAGMENT_LENGTH_2048 = 3; // 2^11 - private static final int MAX_FRAGMENT_LENGTH_4096 = 4; // 2^12 - - final int maxFragmentLength; - - MaxFragmentLengthExtension(int fragmentSize) { - super(ExtensionType.EXT_MAX_FRAGMENT_LENGTH); - - if (fragmentSize < 1024) { - maxFragmentLength = MAX_FRAGMENT_LENGTH_512; - } else if (fragmentSize < 2048) { - maxFragmentLength = MAX_FRAGMENT_LENGTH_1024; - } else if (fragmentSize < 4096) { - maxFragmentLength = MAX_FRAGMENT_LENGTH_2048; - } else { - maxFragmentLength = MAX_FRAGMENT_LENGTH_4096; - } - } - - MaxFragmentLengthExtension(HandshakeInStream s, int len) - throws IOException { - super(ExtensionType.EXT_MAX_FRAGMENT_LENGTH); - - // check the extension length - if (len != 1) { - throw new SSLProtocolException("Invalid " + type + " extension"); - } - - maxFragmentLength = s.getInt8(); - if ((maxFragmentLength > 4) || (maxFragmentLength < 1)) { - throw new SSLProtocolException("Invalid " + type + " extension"); - } - } - - // Length of the encoded extension, including the type and length fields - @Override - int length() { - return 5; // 4: extension type and length fields - // 1: MaxFragmentLength field - } - - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - s.putInt16(1); - s.putInt8(maxFragmentLength); - } - - int getMaxFragLen() { - switch (maxFragmentLength) { - case MAX_FRAGMENT_LENGTH_512: - return 512; - case MAX_FRAGMENT_LENGTH_1024: - return 1024; - case MAX_FRAGMENT_LENGTH_2048: - return 2048; - case MAX_FRAGMENT_LENGTH_4096: - return 4096; - } - - // unlikely to happen - return -1; - } - - static boolean needFragLenNego(int fragmentSize) { - return (fragmentSize > 0) && (fragmentSize <= 4096); - } - - static int getValidMaxFragLen(int fragmentSize) { - if (fragmentSize < 1024) { - return 512; - } else if (fragmentSize < 2048) { - return 1024; - } else if (fragmentSize < 4096) { - return 2048; - } else if (fragmentSize == 4096) { - return 4096; - } else { - return 16384; - } - } - - @Override - public String toString() { - return "Extension " + type + ", max_fragment_length: " + - "(2^" + (maxFragmentLength + 8) + ")"; - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/NamedGroup.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/NamedGroup.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/NamedGroup.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/NamedGroup.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,169 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.security.spec.ECParameterSpec; -import java.security.spec.ECGenParameterSpec; -import static sun.security.ssl.NamedGroupType.*; - -enum NamedGroup { - // Elliptic Curves (RFC 4492) - // - // See sun.security.util.CurveDB for the OIDs - - // NIST K-163 - SECT163_K1(1, NAMED_GROUP_ECDHE, "sect163k1", "1.3.132.0.1", true), - - SECT163_R1(2, NAMED_GROUP_ECDHE, "sect163r1", "1.3.132.0.2", false), - - // NIST B-163 - SECT163_R2(3, NAMED_GROUP_ECDHE, "sect163r2", "1.3.132.0.15", true), - - SECT193_R1(4, NAMED_GROUP_ECDHE, "sect193r1", "1.3.132.0.24", false), - SECT193_R2(5, NAMED_GROUP_ECDHE, "sect193r2", "1.3.132.0.25", false), - - // NIST K-233 - SECT233_K1(6, NAMED_GROUP_ECDHE, "sect233k1", "1.3.132.0.26", true), - - // NIST B-233 - SECT233_R1(7, NAMED_GROUP_ECDHE, "sect233r1", "1.3.132.0.27", true), - - SECT239_K1(8, NAMED_GROUP_ECDHE, "sect239k1", "1.3.132.0.3", false), - - // NIST K-283 - SECT283_K1(9, NAMED_GROUP_ECDHE, "sect283k1", "1.3.132.0.16", true), - - // NIST B-283 - SECT283_R1(10, NAMED_GROUP_ECDHE, "sect283r1", "1.3.132.0.17", true), - - // NIST K-409 - SECT409_K1(11, NAMED_GROUP_ECDHE, "sect409k1", "1.3.132.0.36", true), - - // NIST B-409 - SECT409_R1(12, NAMED_GROUP_ECDHE, "sect409r1", "1.3.132.0.37", true), - - // NIST K-571 - SECT571_K1(13, NAMED_GROUP_ECDHE, "sect571k1", "1.3.132.0.38", true), - - // NIST B-571 - SECT571_R1(14, NAMED_GROUP_ECDHE, "sect571r1", "1.3.132.0.39", true), - - SECP160_K1(15, NAMED_GROUP_ECDHE, "secp160k1", "1.3.132.0.9", false), - SECP160_R1(16, NAMED_GROUP_ECDHE, "secp160r1", "1.3.132.0.8", false), - SECP160_R2(17, NAMED_GROUP_ECDHE, "secp160r2", "1.3.132.0.30", false), - SECP192_K1(18, NAMED_GROUP_ECDHE, "secp192k1", "1.3.132.0.31", false), - - // NIST P-192 - SECP192_R1(19, NAMED_GROUP_ECDHE, "secp192r1", "1.2.840.10045.3.1.1", true), - - SECP224_K1(20, NAMED_GROUP_ECDHE, "secp224k1", "1.3.132.0.32", false), - // NIST P-224 - SECP224_R1(21, NAMED_GROUP_ECDHE, "secp224r1", "1.3.132.0.33", true), - - SECP256_K1(22, NAMED_GROUP_ECDHE, "secp256k1", "1.3.132.0.10", false), - - // NIST P-256 - SECP256_R1(23, NAMED_GROUP_ECDHE, "secp256r1", "1.2.840.10045.3.1.7", true), - - // NIST P-384 - SECP384_R1(24, NAMED_GROUP_ECDHE, "secp384r1", "1.3.132.0.34", true), - - // NIST P-521 - SECP521_R1(25, NAMED_GROUP_ECDHE, "secp521r1", "1.3.132.0.35", true), - - // Finite Field Diffie-Hellman Ephemeral Parameters (RFC 7919) - FFDHE_2048(256, NAMED_GROUP_FFDHE, "ffdhe2048", true), - FFDHE_3072(257, NAMED_GROUP_FFDHE, "ffdhe3072", true), - FFDHE_4096(258, NAMED_GROUP_FFDHE, "ffdhe4096", true), - FFDHE_6144(259, NAMED_GROUP_FFDHE, "ffdhe6144", true), - FFDHE_8192(260, NAMED_GROUP_FFDHE, "ffdhe8192", true); - - int id; - NamedGroupType type; - String name; - String oid; - String algorithm; - boolean isFips; - - // Constructor used for Elliptic Curve Groups (ECDHE) - NamedGroup(int id, NamedGroupType type, - String name, String oid, boolean isFips) { - this.id = id; - this.type = type; - this.name = name; - this.oid = oid; - this.algorithm = "EC"; - this.isFips = isFips; - } - - // Constructor used for Finite Field Diffie-Hellman Groups (FFDHE) - NamedGroup(int id, NamedGroupType type, String name, boolean isFips) { - this.id = id; - this.type = type; - this.name = name; - this.oid = null; - this.algorithm = "DiffieHellman"; - this.isFips = isFips; - } - - static NamedGroup valueOf(int id) { - for (NamedGroup group : NamedGroup.values()) { - if (group.id == id) { - return group; - } - } - - return null; - } - - static NamedGroup nameOf(String name) { - for (NamedGroup group : NamedGroup.values()) { - if (group.name.equals(name)) { - return group; - } - } - - return null; - } - - static NamedGroup valueOf(ECParameterSpec params) { - String oid = JsseJce.getNamedCurveOid(params); - if ((oid != null) && (!oid.isEmpty())) { - for (NamedGroup group : NamedGroup.values()) { - if (oid.equals(group.oid)) { - return group; - } - } - } - - return null; - } - - @Override - public String toString() { - return this.name; - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/NamedGroupType.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/NamedGroupType.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/NamedGroupType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/NamedGroupType.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -enum NamedGroupType { - NAMED_GROUP_ECDHE, // Elliptic Curve Groups (ECDHE) - NAMED_GROUP_FFDHE, // Finite Field Groups (DHE) - NAMED_GROUP_NONE // No predefined named group -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/NewSessionTicket.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,392 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.security.ssl; + +import java.io.IOException; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.security.ProviderException; +import java.security.SecureRandom; +import java.text.MessageFormat; +import java.util.Locale; +import java.util.Optional; +import javax.crypto.SecretKey; +import javax.net.ssl.SSLHandshakeException; +import sun.security.ssl.PskKeyExchangeModesExtension.PskKeyExchangeModesSpec; + +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the NewSessionTicket handshake message. + */ +final class NewSessionTicket { + private static final int MAX_TICKET_LIFETIME = 604800; // seconds, 7 days + + static final SSLConsumer handshakeConsumer = + new NewSessionTicketConsumer(); + static final SSLProducer kickstartProducer = + new NewSessionTicketKickstartProducer(); + static final HandshakeProducer handshakeProducer = + new NewSessionTicketProducer(); + + /** + * The NewSessionTicketMessage handshake message. + */ + static final class NewSessionTicketMessage extends HandshakeMessage { + final int ticketLifetime; + final int ticketAgeAdd; + final byte[] ticketNonce; + final byte[] ticket; + final SSLExtensions extensions; + + NewSessionTicketMessage(HandshakeContext context, + int ticketLifetime, SecureRandom generator, + byte[] ticketNonce, byte[] ticket) { + super(context); + + this.ticketLifetime = ticketLifetime; + this.ticketAgeAdd = generator.nextInt(); + this.ticketNonce = ticketNonce; + this.ticket = ticket; + this.extensions = new SSLExtensions(this); + } + + NewSessionTicketMessage(HandshakeContext context, + ByteBuffer m) throws IOException { + super(context); + + // struct { + // uint32 ticket_lifetime; + // uint32 ticket_age_add; + // opaque ticket_nonce<0..255>; + // opaque ticket<1..2^16-1>; + // Extension extensions<0..2^16-2>; + // } NewSessionTicket; + if (m.remaining() < 14) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid NewSessionTicket message: no sufficient data"); + } + + this.ticketLifetime = Record.getInt32(m); + this.ticketAgeAdd = Record.getInt32(m); + this.ticketNonce = Record.getBytes8(m); + + if (m.remaining() < 5) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid NewSessionTicket message: no sufficient data"); + } + + this.ticket = Record.getBytes16(m); + if (ticket.length == 0) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No ticket in the NewSessionTicket handshake message"); + } + + if (m.remaining() < 2) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid NewSessionTicket message: no sufficient data"); + } + + SSLExtension[] supportedExtensions = + context.sslConfig.getEnabledExtensions( + SSLHandshake.NEW_SESSION_TICKET); + this.extensions = new SSLExtensions(this, m, supportedExtensions); + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.NEW_SESSION_TICKET; + } + + @Override + public int messageLength() { + int extLen = extensions.length(); + if (extLen == 0) { + extLen = 2; // empty extensions + } + + return 8 + ticketNonce.length + 1 + + ticket.length + 2 + extLen; + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putInt32(ticketLifetime); + hos.putInt32(ticketAgeAdd); + hos.putBytes8(ticketNonce); + hos.putBytes16(ticket); + + // Is it an empty extensions? + if (extensions.length() == 0) { + hos.putInt16(0); + } else { + extensions.send(hos); + } + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"NewSessionTicket\": '{'\n" + + " \"ticket_lifetime\" : \"{0}\",\n" + + " \"ticket_age_add\" : \"{1}\",\n" + + " \"ticket_nonce\" : \"{2}\",\n" + + " \"ticket\" : \"{3}\",\n" + + " \"extensions\" : [\n" + + "{4}\n" + + " ]\n" + + "'}'", + Locale.ENGLISH); + + Object[] messageFields = { + ticketLifetime, + "<omitted>", //ticketAgeAdd should not be logged + Utilities.toHexString(ticketNonce), + Utilities.toHexString(ticket), + Utilities.indent(extensions.toString(), " ") + }; + + return messageFormat.format(messageFields); + } + } + + private static SecretKey derivePreSharedKey(CipherSuite.HashAlg hashAlg, + SecretKey resumptionMasterSecret, byte[] nonce) throws IOException { + try { + HKDF hkdf = new HKDF(hashAlg.name); + byte[] hkdfInfo = SSLSecretDerivation.createHkdfInfo( + "tls13 resumption".getBytes(), nonce, hashAlg.hashLength); + return hkdf.expand(resumptionMasterSecret, hkdfInfo, + hashAlg.hashLength, "TlsPreSharedKey"); + } catch (GeneralSecurityException gse) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not derive PSK").initCause(gse); + } + } + + private static final + class NewSessionTicketKickstartProducer implements SSLProducer { + // Prevent instantiation of this class. + private NewSessionTicketKickstartProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is this session resumable? + if (!shc.handshakeSession.isRejoinable()) { + return null; + } + + // What's the requested PSK key exchange modes? + // + // Note that currently, the NewSessionTicket post-handshake is + // produced and delivered only in the current handshake context + // if required. + PskKeyExchangeModesSpec pkemSpec = + (PskKeyExchangeModesSpec)shc.handshakeExtensions.get( + SSLExtension.PSK_KEY_EXCHANGE_MODES); + if (pkemSpec == null || !pkemSpec.contains( + PskKeyExchangeModesExtension.PskKeyExchangeMode.PSK_DHE_KE)) { + // Client doesn't support PSK with (EC)DHE key establishment. + return null; + } + + // get a new session ID + SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) + shc.sslContext.engineGetServerSessionContext(); + SessionId newId = new SessionId(true, + shc.sslContext.getSecureRandom()); + + Optional<SecretKey> resumptionMasterSecret = + shc.handshakeSession.getResumptionMasterSecret(); + if (!resumptionMasterSecret.isPresent()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Session has no resumption secret. No ticket sent."); + } + return null; + } + + // construct the PSK and handshake message + BigInteger nonce = shc.handshakeSession.incrTicketNonceCounter(); + byte[] nonceArr = nonce.toByteArray(); + SecretKey psk = derivePreSharedKey( + shc.negotiatedCipherSuite.hashAlg, + resumptionMasterSecret.get(), nonceArr); + + int sessionTimeoutSeconds = sessionCache.getSessionTimeout(); + if (sessionTimeoutSeconds > MAX_TICKET_LIFETIME) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Session timeout is too long. No ticket sent."); + } + return null; + } + NewSessionTicketMessage nstm = new NewSessionTicketMessage(shc, + sessionTimeoutSeconds, shc.sslContext.getSecureRandom(), + nonceArr, newId.getId()); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced NewSessionTicket handshake message", nstm); + } + + // create and cache the new session + // The new session must be a child of the existing session so + // they will be invalidated together, etc. + SSLSessionImpl sessionCopy = new SSLSessionImpl(shc, + shc.handshakeSession.getSuite(), newId, + shc.handshakeSession.getCreationTime()); + shc.handshakeSession.addChild(sessionCopy); + sessionCopy.setPreSharedKey(psk); + sessionCopy.setPskIdentity(newId.getId()); + sessionCopy.setTicketAgeAdd(nstm.ticketAgeAdd); + sessionCache.put(sessionCopy); + + // Output the handshake message. + nstm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The message has been delivered. + return null; + } + } + + /** + * The "NewSessionTicket" handshake message producer. + */ + private static final class NewSessionTicketProducer + implements HandshakeProducer { + + // Prevent instantiation of this class. + private NewSessionTicketProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + + // NSTM may be sent in response to handshake messages. + // For example: key update + + throw new ProviderException( + "NewSessionTicket handshake producer not implemented"); + } + } + + private static final + class NewSessionTicketConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private NewSessionTicketConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + + // Note: Although the resumption master secret depends on the + // client's second flight, servers which do not request client + // authentication MAY compute the remainder of the transcript + // independently and then send a NewSessionTicket immediately + // upon sending its Finished rather than waiting for the client + // Finished. + // + // The consuming happens in client side only. As the server + // may send the NewSessionTicket before handshake complete, the + // context may be a PostHandshakeContext or HandshakeContext + // instance. + HandshakeContext hc = (HandshakeContext)context; + NewSessionTicketMessage nstm = + new NewSessionTicketMessage(hc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming NewSessionTicket message", nstm); + } + + // discard tickets with timeout 0 + if (nstm.ticketLifetime <= 0 || + nstm.ticketLifetime > MAX_TICKET_LIFETIME) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Discarding NewSessionTicket with lifetime " + + nstm.ticketLifetime, nstm); + } + return; + } + + SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) + hc.sslContext.engineGetClientSessionContext(); + + if (sessionCache.getSessionTimeout() > MAX_TICKET_LIFETIME) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Session cache lifetime is too long. Discarding ticket."); + } + return; + } + + SSLSessionImpl sessionToSave = hc.conContext.conSession; + + Optional<SecretKey> resumptionMasterSecret = + sessionToSave.getResumptionMasterSecret(); + if (!resumptionMasterSecret.isPresent()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Session has no resumption master secret. Ignoring ticket."); + } + return; + } + + // derive the PSK + SecretKey psk = derivePreSharedKey( + sessionToSave.getSuite().hashAlg, resumptionMasterSecret.get(), + nstm.ticketNonce); + + // create and cache the new session + // The new session must be a child of the existing session so + // they will be invalidated together, etc. + SessionId newId = + new SessionId(true, hc.sslContext.getSecureRandom()); + SSLSessionImpl sessionCopy = new SSLSessionImpl( + hc, sessionToSave.getSuite(), newId, + sessionToSave.getCreationTime()); + sessionToSave.addChild(sessionCopy); + sessionCopy.setPreSharedKey(psk); + sessionCopy.setTicketAgeAdd(nstm.ticketAgeAdd); + sessionCopy.setPskIdentity(nstm.ticket); + sessionCache.put(sessionCopy); + + // clean handshake context + hc.conContext.finishPostHandshake(); + } + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/OCSPStatusRequest.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/OCSPStatusRequest.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/OCSPStatusRequest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/OCSPStatusRequest.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,358 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.nio.ByteBuffer; -import java.security.cert.Extension; -import java.util.ArrayList; -import java.util.List; -import java.util.Collections; -import javax.net.ssl.SSLException; -import sun.security.util.DerValue; -import sun.security.util.DerInputStream; -import sun.security.util.DerOutputStream; -import sun.security.provider.certpath.ResponderId; - -/* - * RFC6066 defines the TLS extension,"status_request" (type 0x5), - * which allows the client to request that the server perform OCSP - * on the client's behalf. - * - * The RFC defines an OCSPStatusRequest structure: - * - * struct { - * ResponderID responder_id_list<0..2^16-1>; - * Extensions request_extensions; - * } OCSPStatusRequest; - */ -final class OCSPStatusRequest implements StatusRequest { - - private final List<ResponderId> responderIds; - private final List<Extension> extensions; - private int encodedLen; - private int ridListLen; - private int extListLen; - - /** - * Construct a default {@code OCSPStatusRequest} object with empty - * responder ID and code extension list fields. - */ - OCSPStatusRequest() { - responderIds = new ArrayList<>(); - extensions = new ArrayList<>(); - encodedLen = this.length(); - } - - /** - * Construct an {@code OCSPStatusRequest} object using the provided - * {@code ResponderId} and {@code Extension} lists. - * - * @param respIds the list of {@code ResponderId} objects to be placed - * into the {@code OCSPStatusRequest}. If the user wishes to place - * no {@code ResponderId} objects in the request, either an empty - * {@code List} or {@code null} is acceptable. - * @param exts the list of {@code Extension} objects to be placed into - * the {@code OCSPStatusRequest} If the user wishes to place - * no {@code Extension} objects in the request, either an empty - * {@code List} or {@code null} is acceptable. - */ - OCSPStatusRequest(List<ResponderId> respIds, List<Extension> exts) { - responderIds = new ArrayList<>(respIds != null ? respIds : - Collections.emptyList()); - extensions = new ArrayList<>(exts != null ? exts : - Collections.emptyList()); - encodedLen = this.length(); - } - - /** - * Construct an {@code OCSPStatusRequest} object from data read from - * a {@code HandshakeInputStream} - * - * @param s the {@code HandshakeInputStream} providing the encoded data - * - * @throws IOException if any decoding errors happen during object - * construction. - */ - OCSPStatusRequest(HandshakeInStream in) throws IOException { - responderIds = new ArrayList<>(); - extensions = new ArrayList<>(); - - int ridListBytesRemaining = in.getInt16(); - while (ridListBytesRemaining != 0) { - byte[] ridBytes = in.getBytes16(); - responderIds.add(new ResponderId(ridBytes)); - ridListBytesRemaining -= (ridBytes.length + 2); - // Make sure that no individual responder ID's length caused an - // overrun relative to the outer responder ID list length - if (ridListBytesRemaining < 0) { - throw new SSLException("Responder ID length overflow: " + - "current rid = " + ridBytes.length + ", remaining = " + - ridListBytesRemaining); - } - } - - int extensionLength = in.getInt16(); - if (extensionLength > 0) { - byte[] extensionData = new byte[extensionLength]; - in.read(extensionData); - DerInputStream dis = new DerInputStream(extensionData); - DerValue[] extSeqContents = dis.getSequence(extensionData.length); - for (DerValue extDerVal : extSeqContents) { - extensions.add(new sun.security.x509.Extension(extDerVal)); - } - } - } - - /** - * Construct an {@code OCSPStatusRequest} from its encoded form - * - * @param requestBytes the status request extension bytes - * - * @throws IOException if any error occurs during decoding - */ - OCSPStatusRequest(byte[] requestBytes) throws IOException { - responderIds = new ArrayList<>(); - extensions = new ArrayList<>(); - ByteBuffer reqBuf = ByteBuffer.wrap(requestBytes); - - // Get the ResponderId list length - encodedLen = requestBytes.length; - ridListLen = Short.toUnsignedInt(reqBuf.getShort()); - int endOfRidList = reqBuf.position() + ridListLen; - - // The end position of the ResponderId list in the ByteBuffer - // should be at least 2 less than the end of the buffer. This - // 2 byte defecit is the minimum length required to encode a - // zero-length extensions segment. - if (reqBuf.limit() - endOfRidList < 2) { - throw new SSLException - ("ResponderId List length exceeds provided buffer - Len: " - + ridListLen + ", Buffer: " + reqBuf.remaining()); - } - - while (reqBuf.position() < endOfRidList) { - int ridLength = Short.toUnsignedInt(reqBuf.getShort()); - // Make sure an individual ResponderId length doesn't - // run past the end of the ResponderId list portion of the - // provided buffer. - if (reqBuf.position() + ridLength > endOfRidList) { - throw new SSLException - ("ResponderId length exceeds list length - Off: " - + reqBuf.position() + ", Length: " + ridLength - + ", End offset: " + endOfRidList); - } - - // Consume/add the ResponderId - if (ridLength > 0) { - byte[] ridData = new byte[ridLength]; - reqBuf.get(ridData); - responderIds.add(new ResponderId(ridData)); - } - } - - // Get the Extensions length - int extensionsLen = Short.toUnsignedInt(reqBuf.getShort()); - - // The end of the extensions should also be the end of the - // encoded OCSPStatusRequest - if (extensionsLen != reqBuf.remaining()) { - throw new SSLException("Incorrect extensions length: Read " - + extensionsLen + ", Data length: " + reqBuf.remaining()); - } - - // Extensions are a SEQUENCE of Extension - if (extensionsLen > 0) { - byte[] extensionData = new byte[extensionsLen]; - reqBuf.get(extensionData); - DerInputStream dis = new DerInputStream(extensionData); - DerValue[] extSeqContents = dis.getSequence(extensionData.length); - for (DerValue extDerVal : extSeqContents) { - extensions.add(new sun.security.x509.Extension(extDerVal)); - } - } - } - - /** - * Obtain the length of the {@code OCSPStatusRequest} object in its - * encoded form - * - * @return the length of the {@code OCSPStatusRequest} object in its - * encoded form - */ - @Override - public int length() { - // If we've previously calculated encodedLen simply return it - if (encodedLen != 0) { - return encodedLen; - } - - ridListLen = 0; - for (ResponderId rid : responderIds) { - ridListLen += rid.length() + 2; - } - - extListLen = 0; - if (!extensions.isEmpty()) { - try { - DerOutputStream extSequence = new DerOutputStream(); - DerOutputStream extEncoding = new DerOutputStream(); - for (Extension ext : extensions) { - ext.encode(extEncoding); - } - extSequence.write(DerValue.tag_Sequence, extEncoding); - extListLen = extSequence.size(); - } catch (IOException ioe) { - // Not sure what to do here - } - } - - // Total length is the responder ID list length and extensions length - // plus each lists' 2-byte length fields. - encodedLen = ridListLen + extListLen + 4; - - return encodedLen; - } - - /** - * Send the encoded {@code OCSPStatusRequest} out through the provided - * {@code HandshakeOutputStream} - * - * @param s the {@code HandshakeOutputStream} on which to send the encoded - * data - * - * @throws IOException if any encoding errors occur - */ - @Override - public void send(HandshakeOutStream s) throws IOException { - s.putInt16(ridListLen); - for (ResponderId rid : responderIds) { - s.putBytes16(rid.getEncoded()); - } - - DerOutputStream seqOut = new DerOutputStream(); - DerOutputStream extBytes = new DerOutputStream(); - - if (extensions.size() > 0) { - for (Extension ext : extensions) { - ext.encode(extBytes); - } - seqOut.write(DerValue.tag_Sequence, extBytes); - } - s.putBytes16(seqOut.toByteArray()); - } - - /** - * Determine if a provided {@code OCSPStatusRequest} objects is equal to - * this one. - * - * @param obj an {@code OCSPStatusRequest} object to be compared against - * - * @return {@code true} if the objects are equal, {@code false} otherwise. - * Equivalence is established if the lists of responder IDs and - * extensions between the two objects are also equal. - */ - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } else if (this == obj) { - return true; - } else if (obj instanceof OCSPStatusRequest) { - OCSPStatusRequest respObj = (OCSPStatusRequest)obj; - return responderIds.equals(respObj.getResponderIds()) && - extensions.equals(respObj.getExtensions()); - } - - return false; - } - - /** - * Returns the hash code value for this {@code OCSPStatusRequest} - * - * @return the hash code value for this {@code OCSPStatusRequest} - */ - @Override - public int hashCode() { - int result = 17; - - result = 31 * result + responderIds.hashCode(); - result = 31 * result + extensions.hashCode(); - - return result; - } - - /** - * Create a string representation of this {@code OCSPStatusRequest} - * - * @return a string representation of this {@code OCSPStatusRequest} - */ - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("OCSPStatusRequest\n"); - sb.append(" ResponderIds:"); - - if (responderIds.isEmpty()) { - sb.append(" <EMPTY>"); - } else { - for (ResponderId rid : responderIds) { - sb.append("\n ").append(rid.toString()); - } - } - - sb.append("\n").append(" Extensions:"); - if (extensions.isEmpty()) { - sb.append(" <EMPTY>"); - } else { - for (Extension ext : extensions) { - sb.append("\n ").append(ext.toString()); - } - } - - return sb.toString(); - } - - /** - * Get the list of {@code ResponderId} objects for this - * {@code OCSPStatusRequest} - * - * @return an unmodifiable {@code List} of {@code ResponderId} objects - */ - List<ResponderId> getResponderIds() { - return Collections.unmodifiableList(responderIds); - } - - /** - * Get the list of {@code Extension} objects for this - * {@code OCSPStatusRequest} - * - * @return an unmodifiable {@code List} of {@code Extension} objects - */ - List<Extension> getExtensions() { - return Collections.unmodifiableList(extensions); - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/OutputRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/OutputRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/OutputRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/OutputRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,30 +25,27 @@ package sun.security.ssl; -import java.io.*; -import java.nio.*; -import java.util.Arrays; - -import javax.net.ssl.SSLException; -import sun.security.util.HexDumpEncoder; - +import java.io.ByteArrayOutputStream; +import java.io.Closeable; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import sun.security.ssl.SSLCipher.SSLWriteCipher; /** - * {@code OutputRecord} takes care of the management of SSL/TLS/DTLS output - * records, including buffering, encryption, handshake messages marshal, etc. + * {@code OutputRecord} takes care of the management of SSL/(D)TLS + * output records, including buffering, encryption, handshake + * messages marshal, etc. * * @author David Brownell */ -abstract class OutputRecord extends ByteArrayOutputStream - implements Record, Closeable { - - /* Class and subclass dynamic debugging support */ - static final Debug debug = Debug.getInstance("ssl"); - - Authenticator writeAuthenticator; - CipherBox writeCipher; +abstract class OutputRecord + extends ByteArrayOutputStream implements Record, Closeable { + SSLWriteCipher writeCipher; + // Needed for KeyUpdate, used after Handshake.Finished + TransportContext tc; - HandshakeHash handshakeHash; + final HandshakeHash handshakeHash; boolean firstMessage; // current protocol version, sent as record version @@ -75,16 +72,18 @@ * Mappings from V3 cipher suite encodings to their pure V2 equivalents. * This is taken from the SSL V3 specification, Appendix E. */ - private static int[] V3toV2CipherMap1 = + private static final int[] V3toV2CipherMap1 = {-1, -1, -1, 0x02, 0x01, -1, 0x04, 0x05, -1, 0x06, 0x07}; - private static int[] V3toV2CipherMap3 = + private static final int[] V3toV2CipherMap3 = {-1, -1, -1, 0x80, 0x80, -1, 0x80, 0x80, -1, 0x40, 0xC0}; - OutputRecord() { - this.writeCipher = CipherBox.NULL; + OutputRecord(HandshakeHash handshakeHash, SSLWriteCipher writeCipher) { + this.writeCipher = writeCipher; this.firstMessage = true; this.fragmentSize = Record.maxDataSize; + this.handshakeHash = handshakeHash; + // Please set packetSize and protocolVersion in the implementation. } @@ -100,15 +99,6 @@ } /* - * For handshaking, we need to be able to hash every byte above the - * record marking layer. This is where we're guaranteed to see those - * bytes, so this is where we can hash them. - */ - void setHandshakeHash(HandshakeHash handshakeHash) { - this.handshakeHash = handshakeHash; - } - - /* * Return true iff the record is empty -- to avoid doing the work * of sending empty records over the network. */ @@ -117,8 +107,8 @@ } boolean seqNumIsHuge() { - return (writeAuthenticator != null) && - writeAuthenticator.seqNumIsHuge(); + return (writeCipher.authenticator != null) && + writeCipher.authenticator.seqNumIsHuge(); } // SSLEngine and SSLSocket @@ -132,8 +122,10 @@ abstract void encodeChangeCipherSpec() throws IOException; // apply to SSLEngine only - Ciphertext encode(ByteBuffer[] sources, int offset, int length, - ByteBuffer destination) throws IOException { + Ciphertext encode( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { + throw new UnsupportedOperationException(); } @@ -143,7 +135,8 @@ } // apply to SSLSocket only - void deliver(byte[] source, int offset, int length) throws IOException { + void deliver( + byte[] source, int offset, int length) throws IOException { throw new UnsupportedOperationException(); } @@ -152,15 +145,11 @@ throw new UnsupportedOperationException(); } - // apply to SSLEngine only - Ciphertext acquireCiphertext(ByteBuffer destination) throws IOException { - throw new UnsupportedOperationException(); - } - - void changeWriteCiphers(Authenticator writeAuthenticator, - CipherBox writeCipher) throws IOException { - - encodeChangeCipherSpec(); + void changeWriteCiphers(SSLWriteCipher writeCipher, + boolean useChangeCipherSpec) throws IOException { + if (useChangeCipherSpec) { + encodeChangeCipherSpec(); + } /* * Dispose of any intermediate state in the underlying cipher. @@ -172,7 +161,6 @@ */ writeCipher.dispose(); - this.writeAuthenticator = writeAuthenticator; this.writeCipher = writeCipher; this.isFirstAppOutputRecord = true; } @@ -195,6 +183,11 @@ } // apply to DTLS SSLEngine + void finishHandshake() { + // blank + } + + // apply to DTLS SSLEngine void launchRetransmission() { // blank } @@ -207,6 +200,10 @@ } } + synchronized boolean isClosed() { + return isClosed; + } + // // shared helpers // @@ -216,103 +213,131 @@ // To be consistent with the spec of SSLEngine.wrap() methods, the // destination ByteBuffer's position is updated to reflect the amount // of data produced. The limit remains the same. - static long encrypt(Authenticator authenticator, - CipherBox encCipher, byte contentType, ByteBuffer destination, + static long encrypt( + SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, int headerOffset, int dstLim, int headerSize, - ProtocolVersion protocolVersion, boolean isDTLS) { - - byte[] sequenceNumber = null; - int dstContent = destination.position(); - - // Acquire the current sequence number before using. + ProtocolVersion protocolVersion) { + boolean isDTLS = protocolVersion.isDTLS; if (isDTLS) { - sequenceNumber = authenticator.sequenceNumber(); + if (protocolVersion.useTLS13PlusSpec()) { + return d13Encrypt(encCipher, + contentType, destination, headerOffset, + dstLim, headerSize, protocolVersion); + } else { + return d10Encrypt(encCipher, + contentType, destination, headerOffset, + dstLim, headerSize, protocolVersion); + } + } else { + if (protocolVersion.useTLS13PlusSpec()) { + return t13Encrypt(encCipher, + contentType, destination, headerOffset, + dstLim, headerSize, protocolVersion); + } else { + return t10Encrypt(encCipher, + contentType, destination, headerOffset, + dstLim, headerSize, protocolVersion); + } } + } - // The sequence number may be shared for different purpose. - boolean sharedSequenceNumber = false; + static long d13Encrypt( + SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, + int headerOffset, int dstLim, int headerSize, + ProtocolVersion protocolVersion) { + throw new UnsupportedOperationException("Not supported yet."); + } - // "flip" but skip over header again, add MAC & encrypt - if (authenticator instanceof MAC) { - MAC signer = (MAC)authenticator; - if (signer.MAClen() != 0) { - byte[] hash = signer.compute(contentType, destination, false); - - /* - * position was advanced to limit in MAC compute above. - * - * Mark next area as writable (above layers should have - * established that we have plenty of room), then write - * out the hash. - */ - destination.limit(destination.limit() + hash.length); - destination.put(hash); - - // reset the position and limit - destination.limit(destination.position()); - destination.position(dstContent); - - // The signer has used and increased the sequence number. - if (isDTLS) { - sharedSequenceNumber = true; - } - } + private static long d10Encrypt( + SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, + int headerOffset, int dstLim, int headerSize, + ProtocolVersion protocolVersion) { + byte[] sequenceNumber = encCipher.authenticator.sequenceNumber(); + encCipher.encrypt(contentType, destination); + + // Finish out the record header. + int fragLen = destination.limit() - headerOffset - headerSize; + + destination.put(headerOffset, contentType); // content type + destination.put(headerOffset + 1, protocolVersion.major); + destination.put(headerOffset + 2, protocolVersion.minor); + + // epoch and sequence_number + destination.put(headerOffset + 3, sequenceNumber[0]); + destination.put(headerOffset + 4, sequenceNumber[1]); + destination.put(headerOffset + 5, sequenceNumber[2]); + destination.put(headerOffset + 6, sequenceNumber[3]); + destination.put(headerOffset + 7, sequenceNumber[4]); + destination.put(headerOffset + 8, sequenceNumber[5]); + destination.put(headerOffset + 9, sequenceNumber[6]); + destination.put(headerOffset + 10, sequenceNumber[7]); + + // fragment length + destination.put(headerOffset + 11, (byte)(fragLen >> 8)); + destination.put(headerOffset + 12, (byte)fragLen); + + // Update destination position to reflect the amount of data produced. + destination.position(destination.limit()); + + return Authenticator.toLong(sequenceNumber); + } + + static long t13Encrypt( + SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, + int headerOffset, int dstLim, int headerSize, + ProtocolVersion protocolVersion) { + if (!encCipher.isNullCipher()) { + // inner plaintext, using zero length padding. + int endOfPt = destination.limit(); + destination.limit(endOfPt + 1); + destination.put(endOfPt, contentType); } + // use the right TLSCiphertext.opaque_type and legacy_record_version + ProtocolVersion pv = protocolVersion; if (!encCipher.isNullCipher()) { - if (protocolVersion.useTLS11PlusSpec() && - (encCipher.isCBCMode() || encCipher.isAEADMode())) { - byte[] nonce = encCipher.createExplicitNonce( - authenticator, contentType, destination.remaining()); - destination.position(headerOffset + headerSize); - destination.put(nonce); - } - if (!encCipher.isAEADMode()) { - // The explicit IV in TLS 1.1 and later can be encrypted. - destination.position(headerOffset + headerSize); - } // Otherwise, DON'T encrypt the nonce_explicit for AEAD mode - - // Encrypt may pad, so again the limit may be changed. - encCipher.encrypt(destination, dstLim); - - // The cipher has used and increased the sequence number. - if (isDTLS && encCipher.isAEADMode()) { - sharedSequenceNumber = true; - } - } else { - destination.position(destination.limit()); + pv = ProtocolVersion.TLS12; + contentType = ContentType.APPLICATION_DATA.id; + } else if (protocolVersion.useTLS13PlusSpec()) { + pv = ProtocolVersion.TLS12; } + byte[] sequenceNumber = encCipher.authenticator.sequenceNumber(); + encCipher.encrypt(contentType, destination); + + // Finish out the record header. + int fragLen = destination.limit() - headerOffset - headerSize; + destination.put(headerOffset, contentType); + destination.put(headerOffset + 1, pv.major); + destination.put(headerOffset + 2, pv.minor); + + // fragment length + destination.put(headerOffset + 3, (byte)(fragLen >> 8)); + destination.put(headerOffset + 4, (byte)fragLen); + + // Update destination position to reflect the amount of data produced. + destination.position(destination.limit()); + + return Authenticator.toLong(sequenceNumber); + } + + static long t10Encrypt( + SSLWriteCipher encCipher, byte contentType, ByteBuffer destination, + int headerOffset, int dstLim, int headerSize, + ProtocolVersion protocolVersion) { + byte[] sequenceNumber = encCipher.authenticator.sequenceNumber(); + encCipher.encrypt(contentType, destination); + // Finish out the record header. int fragLen = destination.limit() - headerOffset - headerSize; destination.put(headerOffset, contentType); // content type destination.put(headerOffset + 1, protocolVersion.major); destination.put(headerOffset + 2, protocolVersion.minor); - if (!isDTLS) { - // fragment length - destination.put(headerOffset + 3, (byte)(fragLen >> 8)); - destination.put(headerOffset + 4, (byte)fragLen); - } else { - // epoch and sequence_number - destination.put(headerOffset + 3, sequenceNumber[0]); - destination.put(headerOffset + 4, sequenceNumber[1]); - destination.put(headerOffset + 5, sequenceNumber[2]); - destination.put(headerOffset + 6, sequenceNumber[3]); - destination.put(headerOffset + 7, sequenceNumber[4]); - destination.put(headerOffset + 8, sequenceNumber[5]); - destination.put(headerOffset + 9, sequenceNumber[6]); - destination.put(headerOffset + 10, sequenceNumber[7]); - - // fragment length - destination.put(headerOffset + 11, (byte)(fragLen >> 8)); - destination.put(headerOffset + 12, (byte)fragLen); - - // Increase the sequence number for next use if it is not shared. - if (!sharedSequenceNumber) { - authenticator.increaseSequenceNumber(); - } - } + + // fragment length + destination.put(headerOffset + 3, (byte)(fragLen >> 8)); + destination.put(headerOffset + 4, (byte)fragLen); // Update destination position to reflect the amount of data produced. destination.position(destination.limit()); @@ -324,55 +349,78 @@ // // Uses the internal expandable buf variable and the current // protocolVersion variable. - void encrypt(Authenticator authenticator, - CipherBox encCipher, byte contentType, int headerSize) { + long encrypt( + SSLWriteCipher encCipher, byte contentType, int headerSize) { + if (protocolVersion.useTLS13PlusSpec()) { + return t13Encrypt(encCipher, contentType, headerSize); + } else { + return t10Encrypt(encCipher, contentType, headerSize); + } + } - int position = headerSize + writeCipher.getExplicitNonceSize(); + private static final class T13PaddingHolder { + private static final byte[] zeros = new byte[16]; + } - // "flip" but skip over header again, add MAC & encrypt - int macLen = 0; - if (authenticator instanceof MAC) { - MAC signer = (MAC)authenticator; - macLen = signer.MAClen(); - if (macLen != 0) { - byte[] hash = signer.compute(contentType, - buf, position, (count - position), false); + long t13Encrypt( + SSLWriteCipher encCipher, byte contentType, int headerSize) { + if (!encCipher.isNullCipher()) { + // inner plaintext + write(contentType); + write(T13PaddingHolder.zeros, 0, T13PaddingHolder.zeros.length); + } - write(hash, 0, hash.length); - } + byte[] sequenceNumber = encCipher.authenticator.sequenceNumber(); + int position = headerSize; + int contentLen = count - position; + + // ensure the capacity + int packetSize = encCipher.calculatePacketSize(contentLen, headerSize); + if (packetSize > buf.length) { + byte[] newBuf = new byte[packetSize]; + System.arraycopy(buf, 0, newBuf, 0, count); + buf = newBuf; } + // use the right TLSCiphertext.opaque_type and legacy_record_version + ProtocolVersion pv = protocolVersion; if (!encCipher.isNullCipher()) { - // Requires explicit IV/nonce for CBC/AEAD cipher suites for - // TLS 1.1 or later. - if (protocolVersion.useTLS11PlusSpec() && - (encCipher.isCBCMode() || encCipher.isAEADMode())) { - - byte[] nonce = encCipher.createExplicitNonce( - authenticator, contentType, (count - position)); - int noncePos = position - nonce.length; - System.arraycopy(nonce, 0, buf, noncePos, nonce.length); - } + pv = ProtocolVersion.TLS12; + contentType = ContentType.APPLICATION_DATA.id; + } else { + pv = ProtocolVersion.TLS12; + } - if (!encCipher.isAEADMode()) { - // The explicit IV in TLS 1.1 and later can be encrypted. - position = headerSize; - } // Otherwise, DON'T encrypt the nonce_explicit for AEAD mode - - // increase buf capacity if necessary - int fragSize = count - position; - int packetSize = - encCipher.calculatePacketSize(fragSize, macLen, headerSize); - if (packetSize > (buf.length - position)) { - byte[] newBuf = new byte[position + packetSize]; - System.arraycopy(buf, 0, newBuf, 0, count); - buf = newBuf; - } + ByteBuffer destination = ByteBuffer.wrap(buf, position, contentLen); + count = headerSize + encCipher.encrypt(contentType, destination); + + // Fill out the header, write it and the message. + int fragLen = count - headerSize; - // Encrypt may pad, so again the count may be changed. - count = position + - encCipher.encrypt(buf, position, (count - position)); + buf[0] = contentType; + buf[1] = pv.major; + buf[2] = pv.minor; + buf[3] = (byte)((fragLen >> 8) & 0xFF); + buf[4] = (byte)(fragLen & 0xFF); + + return Authenticator.toLong(sequenceNumber); + } + + long t10Encrypt( + SSLWriteCipher encCipher, byte contentType, int headerSize) { + byte[] sequenceNumber = encCipher.authenticator.sequenceNumber(); + int position = headerSize + writeCipher.getExplicitNonceSize(); + int contentLen = count - position; + + // ensure the capacity + int packetSize = encCipher.calculatePacketSize(contentLen, headerSize); + if (packetSize > buf.length) { + byte[] newBuf = new byte[packetSize]; + System.arraycopy(buf, 0, newBuf, 0, count); + buf = newBuf; } + ByteBuffer destination = ByteBuffer.wrap(buf, position, contentLen); + count = headerSize + encCipher.encrypt(contentType, destination); // Fill out the header, write it and the message. int fragLen = count - headerSize; @@ -381,11 +429,12 @@ buf[2] = protocolVersion.minor; buf[3] = (byte)((fragLen >> 8) & 0xFF); buf[4] = (byte)(fragLen & 0xFF); + + return Authenticator.toLong(sequenceNumber); } static ByteBuffer encodeV2ClientHello( byte[] fragment, int offset, int length) throws IOException { - int v3SessIdLenOffset = offset + 34; // 2: client_version // 32: random @@ -449,7 +498,7 @@ dstBuf.position(0); dstBuf.put((byte)(0x80 | ((msgLen >>> 8) & 0xFF))); // pos: 0 dstBuf.put((byte)(msgLen & 0xFF)); // pos: 1 - dstBuf.put(HandshakeMessage.ht_client_hello); // pos: 2 + dstBuf.put(SSLHandshake.CLIENT_HELLO.id); // pos: 2 dstBuf.put(fragment[offset]); // major version, pos: 3 dstBuf.put(fragment[offset + 1]); // minor version, pos: 4 dstBuf.put((byte)(v2CSLen >>> 8)); // pos: 5 diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Plaintext.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Plaintext.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Plaintext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Plaintext.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,16 +34,16 @@ final class Plaintext { static final Plaintext PLAINTEXT_NULL = new Plaintext(); - byte contentType; - byte majorVersion; - byte minorVersion; - int recordEpoch; // incremented on every cipher state change - long recordSN; // contains epcoh number (epoch | sequence) - ByteBuffer fragment; // null if need to be reassembled + final byte contentType; + final byte majorVersion; + final byte minorVersion; + final int recordEpoch; // increments on every cipher state change + final long recordSN; // epoch | sequence number + final ByteBuffer fragment; // null if need to be reassembled - HandshakeStatus handshakeStatus; // null if not used or not handshaking + HandshakeStatus handshakeStatus; // null if not used or not handshaking - Plaintext() { + private Plaintext() { this.contentType = 0; this.majorVersion = 0; this.minorVersion = 0; @@ -53,7 +53,8 @@ this.handshakeStatus = null; } - Plaintext(byte contentType, byte majorVersion, byte minorVersion, + Plaintext(byte contentType, + byte majorVersion, byte minorVersion, int recordEpoch, long recordSN, ByteBuffer fragment) { this.contentType = contentType; @@ -66,6 +67,7 @@ this.handshakeStatus = null; } + @Override public String toString() { return "contentType: " + contentType + "/" + "majorVersion: " + majorVersion + "/" + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/PostHandshakeContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.Map; + +/** + * A compact implementation of HandshakeContext for post-handshake messages + */ +final class PostHandshakeContext extends HandshakeContext { + private final static Map<Byte, SSLConsumer> consumers = Map.of( + SSLHandshake.KEY_UPDATE.id, SSLHandshake.KEY_UPDATE, + SSLHandshake.NEW_SESSION_TICKET.id, SSLHandshake.NEW_SESSION_TICKET); + + PostHandshakeContext(TransportContext context) throws IOException { + super(context); + + if (!negotiatedProtocol.useTLS13PlusSpec()) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Post-handshake not supported in " + negotiatedProtocol.name); + } + + this.localSupportedSignAlgs = new ArrayList<SignatureScheme>( + context.conSession.getLocalSupportedSignatureSchemes()); + + handshakeConsumers = new LinkedHashMap<>(consumers); + handshakeFinished = true; + } + + @Override + void kickstart() throws IOException { + SSLHandshake.kickstart(this); + } + + @Override + void dispatch(byte handshakeType, ByteBuffer fragment) throws IOException { + SSLConsumer consumer = handshakeConsumers.get(handshakeType); + if (consumer == null) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected post-handshake message: " + + SSLHandshake.nameOf(handshakeType)); + return; + } + + try { + consumer.consume(this, fragment); + } catch (UnsupportedOperationException unsoe) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unsupported post-handshake message: " + + SSLHandshake.nameOf(handshakeType), unsoe); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/PredefinedDHParameterSpecs.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/PredefinedDHParameterSpecs.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/PredefinedDHParameterSpecs.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/PredefinedDHParameterSpecs.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,21 +25,19 @@ package sun.security.ssl; -import java.security.*; import java.math.BigInteger; -import java.util.regex.Pattern; -import java.util.regex.Matcher; -import java.util.Map; -import java.util.HashMap; +import java.security.*; import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import javax.crypto.spec.DHParameterSpec; /** * Predefined default DH ephemeral parameters. */ final class PredefinedDHParameterSpecs { - private final static boolean debugIsOn = - (Debug.getInstance("ssl") != null) && Debug.isOn("sslctx"); // // Default DH ephemeral parameters @@ -209,15 +207,15 @@ // a measure of the uncertainty that prime modulus p is not a prime // // see BigInteger.isProbablePrime(int certainty) - private final static int PRIME_CERTAINTY = 120; + private static final int PRIME_CERTAINTY = 120; // the known security property, jdk.tls.server.defaultDHEParameters - private final static String PROPERTY_NAME = + private static final String PROPERTY_NAME = "jdk.tls.server.defaultDHEParameters"; private static final Pattern spacesPattern = Pattern.compile("\\s+"); - private final static Pattern syntaxPattern = Pattern.compile( + private static final Pattern syntaxPattern = Pattern.compile( "(\\{[0-9A-Fa-f]+,[0-9A-Fa-f]+\\})" + "(,\\{[0-9A-Fa-f]+,[0-9A-Fa-f]+\\})*"); @@ -225,10 +223,10 @@ "\\{([0-9A-Fa-f]+),([0-9A-Fa-f]+)\\}"); // cache of predefined default DH ephemeral parameters - final static Map<Integer, DHParameterSpec> definedParams; + static final Map<Integer, DHParameterSpec> definedParams; // cache of Finite Field DH Ephemeral parameters (RFC 7919/FFDHE) - final static Map<Integer, DHParameterSpec> ffdheParams; + static final Map<Integer, DHParameterSpec> ffdheParams; static { String property = AccessController.doPrivileged( @@ -252,8 +250,9 @@ Matcher spacesMatcher = spacesPattern.matcher(property); property = spacesMatcher.replaceAll(""); - if (debugIsOn) { - System.out.println("The Security Property " + + if (SSLLogger.isOn && SSLLogger.isOn("sslctx")) { + SSLLogger.fine( + "The Security Property " + PROPERTY_NAME + ": " + property); } } @@ -267,8 +266,8 @@ String primeModulus = paramsFinder.group(1); BigInteger p = new BigInteger(primeModulus, 16); if (!p.isProbablePrime(PRIME_CERTAINTY)) { - if (debugIsOn) { - System.out.println( + if (SSLLogger.isOn && SSLLogger.isOn("sslctx")) { + SSLLogger.fine( "Prime modulus p in Security Property, " + PROPERTY_NAME + ", is not a prime: " + primeModulus); @@ -284,8 +283,8 @@ int primeLen = p.bitLength(); defaultParams.put(primeLen, spec); } - } else if (debugIsOn) { - System.out.println("Invalid Security Property, " + + } else if (SSLLogger.isOn && SSLLogger.isOn("sslctx")) { + SSLLogger.fine("Invalid Security Property, " + PROPERTY_NAME + ", definition"); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/PreSharedKeyExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,869 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.*; +import java.text.MessageFormat; +import java.util.List; +import java.util.ArrayList; +import java.util.Locale; +import java.util.Arrays; +import java.util.Optional; +import java.util.Collection; +import javax.crypto.Mac; +import javax.crypto.SecretKey; +import javax.net.ssl.SSLPeerUnverifiedException; +import static sun.security.ssl.ClientAuthType.CLIENT_AUTH_REQUIRED; +import sun.security.ssl.ClientHello.ClientHelloMessage; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import static sun.security.ssl.SSLExtension.*; + +/** + * Pack of the "pre_shared_key" extension. + */ +final class PreSharedKeyExtension { + static final HandshakeProducer chNetworkProducer = + new CHPreSharedKeyProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHPreSharedKeyConsumer(); + static final HandshakeAbsence chOnLoadAbsence = + new CHPreSharedKeyAbsence(); + static final HandshakeConsumer chOnTradeConsumer = + new CHPreSharedKeyUpdate(); + static final SSLStringizer chStringizer = + new CHPreSharedKeyStringizer(); + + static final HandshakeProducer shNetworkProducer = + new SHPreSharedKeyProducer(); + static final ExtensionConsumer shOnLoadConsumer = + new SHPreSharedKeyConsumer(); + static final HandshakeAbsence shOnLoadAbsence = + new SHPreSharedKeyAbsence(); + static final SSLStringizer shStringizer = + new SHPreSharedKeyStringizer(); + + private static final class PskIdentity { + final byte[] identity; + final int obfuscatedAge; + + PskIdentity(byte[] identity, int obfuscatedAge) { + this.identity = identity; + this.obfuscatedAge = obfuscatedAge; + } + + int getEncodedLength() { + return 2 + identity.length + 4; + } + + void writeEncoded(ByteBuffer m) throws IOException { + Record.putBytes16(m, identity); + Record.putInt32(m, obfuscatedAge); + } + + @Override + public String toString() { + return "{" + Utilities.toHexString(identity) + "," + + obfuscatedAge + "}"; + } + } + + private static final + class CHPreSharedKeySpec implements SSLExtensionSpec { + final List<PskIdentity> identities; + final List<byte[]> binders; + + CHPreSharedKeySpec(List<PskIdentity> identities, List<byte[]> binders) { + this.identities = identities; + this.binders = binders; + } + + CHPreSharedKeySpec(HandshakeContext context, + ByteBuffer m) throws IOException { + // struct { + // PskIdentity identities<7..2^16-1>; + // PskBinderEntry binders<33..2^16-1>; + // } OfferedPsks; + if (m.remaining() < 44) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid pre_shared_key extension: " + + "insufficient data (length=" + m.remaining() + ")"); + } + + int idEncodedLength = Record.getInt16(m); + if (idEncodedLength < 7) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid pre_shared_key extension: " + + "insufficient identities (length=" + idEncodedLength + ")"); + } + + identities = new ArrayList<>(); + int idReadLength = 0; + while (idReadLength < idEncodedLength) { + byte[] id = Record.getBytes16(m); + if (id.length < 1) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid pre_shared_key extension: " + + "insufficient identity (length=" + id.length + ")"); + } + int obfuscatedTicketAge = Record.getInt32(m); + + PskIdentity pskId = new PskIdentity(id, obfuscatedTicketAge); + identities.add(pskId); + idReadLength += pskId.getEncodedLength(); + } + + if (m.remaining() < 35) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid pre_shared_key extension: " + + "insufficient binders data (length=" + + m.remaining() + ")"); + } + + int bindersEncodedLen = Record.getInt16(m); + if (bindersEncodedLen < 33) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid pre_shared_key extension: " + + "insufficient binders (length=" + + bindersEncodedLen + ")"); + } + + binders = new ArrayList<>(); + int bindersReadLength = 0; + while (bindersReadLength < bindersEncodedLen) { + byte[] binder = Record.getBytes8(m); + if (binder.length < 32) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid pre_shared_key extension: " + + "insufficient binder entry (length=" + + binder.length + ")"); + } + binders.add(binder); + bindersReadLength += 1 + binder.length; + } + } + + int getIdsEncodedLength() { + int idEncodedLength = 0; + for (PskIdentity curId : identities) { + idEncodedLength += curId.getEncodedLength(); + } + + return idEncodedLength; + } + + int getBindersEncodedLength() { + int binderEncodedLength = 0; + for (byte[] curBinder : binders) { + binderEncodedLength += 1 + curBinder.length; + } + + return binderEncodedLength; + } + + byte[] getEncoded() throws IOException { + int idsEncodedLength = getIdsEncodedLength(); + int bindersEncodedLength = getBindersEncodedLength(); + int encodedLength = 4 + idsEncodedLength + bindersEncodedLength; + byte[] buffer = new byte[encodedLength]; + ByteBuffer m = ByteBuffer.wrap(buffer); + Record.putInt16(m, idsEncodedLength); + for (PskIdentity curId : identities) { + curId.writeEncoded(m); + } + Record.putInt16(m, bindersEncodedLength); + for (byte[] curBinder : binders) { + Record.putBytes8(m, curBinder); + } + + return buffer; + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"PreSharedKey\": '{'\n" + + " \"identities\" : \"{0}\",\n" + + " \"binders\" : \"{1}\",\n" + + "'}'", + Locale.ENGLISH); + + Object[] messageFields = { + Utilities.indent(identitiesString()), + Utilities.indent(bindersString()) + }; + + return messageFormat.format(messageFields); + } + + String identitiesString() { + StringBuilder result = new StringBuilder(); + for (PskIdentity curId : identities) { + result.append(curId.toString() + "\n"); + } + + return result.toString(); + } + + String bindersString() { + StringBuilder result = new StringBuilder(); + for (byte[] curBinder : binders) { + result.append("{" + Utilities.toHexString(curBinder) + "}\n"); + } + + return result.toString(); + } + } + + private static final + class CHPreSharedKeyStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + // As the HandshakeContext parameter of CHPreSharedKeySpec + // constructor is used for fatal alert only, we can use + // null HandshakeContext here as we don't care about exception. + // + // Please take care of this code if the CHPreSharedKeySpec + // constructor is updated in the future. + return (new CHPreSharedKeySpec(null, buffer)).toString(); + } catch (Exception ex) { + // For debug logging only, so please swallow exceptions. + return ex.getMessage(); + } + } + } + + private static final + class SHPreSharedKeySpec implements SSLExtensionSpec { + final int selectedIdentity; + + SHPreSharedKeySpec(int selectedIdentity) { + this.selectedIdentity = selectedIdentity; + } + + SHPreSharedKeySpec(HandshakeContext context, + ByteBuffer m) throws IOException { + if (m.remaining() < 2) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Invalid pre_shared_key extension: " + + "insufficient selected_identity (length=" + + m.remaining() + ")"); + } + this.selectedIdentity = Record.getInt16(m); + } + + byte[] getEncoded() throws IOException { + return new byte[] { + (byte)((selectedIdentity >> 8) & 0xFF), + (byte)(selectedIdentity & 0xFF) + }; + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"PreSharedKey\": '{'\n" + + " \"selected_identity\" : \"{0}\",\n" + + "'}'", + Locale.ENGLISH); + + Object[] messageFields = { + Utilities.byte16HexString(selectedIdentity) + }; + + return messageFormat.format(messageFields); + } + } + + private static final + class SHPreSharedKeyStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + // As the HandshakeContext parameter of SHPreSharedKeySpec + // constructor is used for fatal alert only, we can use + // null HandshakeContext here as we don't care about exception. + // + // Please take care of this code if the SHPreSharedKeySpec + // constructor is updated in the future. + return (new SHPreSharedKeySpec(null, buffer)).toString(); + } catch (Exception ex) { + // For debug logging only, so please swallow exceptions. + return ex.getMessage(); + } + } + } + + private static final + class CHPreSharedKeyConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHPreSharedKeyConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, + ByteBuffer buffer) throws IOException { + ClientHelloMessage clientHello = (ClientHelloMessage) message; + ServerHandshakeContext shc = (ServerHandshakeContext)context; + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SSLExtension.CH_PRE_SHARED_KEY)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable pre_shared_key extension"); + } + return; // ignore the extension + } + + // Parse the extension. + CHPreSharedKeySpec pskSpec = null; + try { + pskSpec = new CHPreSharedKeySpec(shc, buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // The "psk_key_exchange_modes" extension should have been loaded. + if (!shc.handshakeExtensions.containsKey( + SSLExtension.PSK_KEY_EXCHANGE_MODES)) { + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Client sent PSK but not PSK modes, or the PSK " + + "extension is not the last extension"); + } + + // error if id and binder lists are not the same length + if (pskSpec.identities.size() != pskSpec.binders.size()) { + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "PSK extension has incorrect number of binders"); + } + + if (shc.isResumption) { // resumingSession may not be set + SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) + shc.sslContext.engineGetServerSessionContext(); + int idIndex = 0; + for (PskIdentity requestedId : pskSpec.identities) { + SSLSessionImpl s = sessionCache.get(requestedId.identity); + if (s != null && canRejoin(clientHello, shc, s)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Resuming session: ", s); + } + + // binder will be checked later + shc.resumingSession = s; + shc.handshakeExtensions.put(SH_PRE_SHARED_KEY, + new SHPreSharedKeySpec(idIndex)); // for the index + break; + } + + ++idIndex; + } + + if (idIndex == pskSpec.identities.size()) { + // no resumable session + shc.isResumption = false; + shc.resumingSession = null; + } + } + + // update the context + shc.handshakeExtensions.put( + SSLExtension.CH_PRE_SHARED_KEY, pskSpec); + } + } + + private static boolean canRejoin(ClientHelloMessage clientHello, + ServerHandshakeContext shc, SSLSessionImpl s) { + + boolean result = s.isRejoinable() && s.getPreSharedKey().isPresent(); + + // Check protocol version + if (result && s.getProtocolVersion() != shc.negotiatedProtocol) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + + SSLLogger.finest("Can't resume, incorrect protocol version"); + } + result = false; + } + + // Validate the required client authentication. + if (result && + (shc.sslConfig.clientAuthType == CLIENT_AUTH_REQUIRED)) { + try { + s.getPeerPrincipal(); + } catch (SSLPeerUnverifiedException e) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, " + + "client authentication is required"); + } + result = false; + } + + // Make sure the list of supported signature algorithms matches + Collection<SignatureScheme> sessionSigAlgs = + s.getLocalSupportedSignatureSchemes(); + if (result && + !shc.localSupportedSignAlgs.containsAll(sessionSigAlgs)) { + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Can't resume. Session uses different " + + "signature algorithms"); + } + result = false; + } + } + + // Ensure cipher suite can be negotiated + if (result && (!shc.isNegotiable(s.getSuite()) || + !clientHello.cipherSuites.contains(s.getSuite()))) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Can't resume, unavailable session cipher suite"); + } + result = false; + } + + return result; + } + + private static final + class CHPreSharedKeyUpdate implements HandshakeConsumer { + // Prevent instantiation of this class. + private CHPreSharedKeyUpdate() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + ServerHandshakeContext shc = (ServerHandshakeContext)context; + if (!shc.isResumption || shc.resumingSession == null) { + // not resuming---nothing to do + return; + } + + CHPreSharedKeySpec chPsk = (CHPreSharedKeySpec) + shc.handshakeExtensions.get(SSLExtension.CH_PRE_SHARED_KEY); + SHPreSharedKeySpec shPsk = (SHPreSharedKeySpec) + shc.handshakeExtensions.get(SSLExtension.SH_PRE_SHARED_KEY); + if (chPsk == null || shPsk == null) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Required extensions are unavailable"); + } + + byte[] binder = chPsk.binders.get(shPsk.selectedIdentity); + + // set up PSK binder hash + HandshakeHash pskBinderHash = shc.handshakeHash.copy(); + byte[] lastMessage = pskBinderHash.removeLastReceived(); + ByteBuffer messageBuf = ByteBuffer.wrap(lastMessage); + // skip the type and length + messageBuf.position(4); + // read to find the beginning of the binders + ClientHelloMessage.readPartial(shc.conContext, messageBuf); + int length = messageBuf.position(); + messageBuf.position(0); + pskBinderHash.receive(messageBuf, length); + + checkBinder(shc, shc.resumingSession, pskBinderHash, binder); + } + } + + private static void checkBinder(ServerHandshakeContext shc, + SSLSessionImpl session, + HandshakeHash pskBinderHash, byte[] binder) throws IOException { + Optional<SecretKey> pskOpt = session.getPreSharedKey(); + if (!pskOpt.isPresent()) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Session has no PSK"); + } + SecretKey psk = pskOpt.get(); + + SecretKey binderKey = deriveBinderKey(psk, session); + byte[] computedBinder = + computeBinder(binderKey, session, pskBinderHash); + if (!Arrays.equals(binder, computedBinder)) { + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Incorect PSK binder value"); + } + } + + // Class that produces partial messages used to compute binder hash + static final class PartialClientHelloMessage extends HandshakeMessage { + + private final ClientHello.ClientHelloMessage msg; + private final CHPreSharedKeySpec psk; + + PartialClientHelloMessage(HandshakeContext ctx, + ClientHello.ClientHelloMessage msg, + CHPreSharedKeySpec psk) { + super(ctx); + + this.msg = msg; + this.psk = psk; + } + + @Override + SSLHandshake handshakeType() { + return msg.handshakeType(); + } + + private int pskTotalLength() { + return psk.getIdsEncodedLength() + + psk.getBindersEncodedLength() + 8; + } + + @Override + int messageLength() { + + if (msg.extensions.get(SSLExtension.CH_PRE_SHARED_KEY) != null) { + return msg.messageLength(); + } else { + return msg.messageLength() + pskTotalLength(); + } + } + + @Override + void send(HandshakeOutStream hos) throws IOException { + msg.sendCore(hos); + + // complete extensions + int extsLen = msg.extensions.length(); + if (msg.extensions.get(SSLExtension.CH_PRE_SHARED_KEY) == null) { + extsLen += pskTotalLength(); + } + hos.putInt16(extsLen - 2); + // write the complete extensions + for (SSLExtension ext : SSLExtension.values()) { + byte[] extData = msg.extensions.get(ext); + if (extData == null) { + continue; + } + // the PSK could be there from an earlier round + if (ext == SSLExtension.CH_PRE_SHARED_KEY) { + continue; + } + int extID = ext.id; + hos.putInt16(extID); + hos.putBytes16(extData); + } + + // partial PSK extension + int extID = SSLExtension.CH_PRE_SHARED_KEY.id; + hos.putInt16(extID); + byte[] encodedPsk = psk.getEncoded(); + hos.putInt16(encodedPsk.length); + hos.write(encodedPsk, 0, psk.getIdsEncodedLength() + 2); + } + } + + private static final + class CHPreSharedKeyProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHPreSharedKeyProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + if (!chc.isResumption || chc.resumingSession == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("No session to resume."); + } + return null; + } + + // Make sure the list of supported signature algorithms matches + Collection<SignatureScheme> sessionSigAlgs = + chc.resumingSession.getLocalSupportedSignatureSchemes(); + if (!chc.localSupportedSignAlgs.containsAll(sessionSigAlgs)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Existing session uses different " + + "signature algorithms"); + } + return null; + } + + // The session must have a pre-shared key + Optional<SecretKey> pskOpt = chc.resumingSession.getPreSharedKey(); + if (!pskOpt.isPresent()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Existing session has no PSK."); + } + return null; + } + SecretKey psk = pskOpt.get(); + Optional<byte[]> pskIdOpt = chc.resumingSession.getPskIdentity(); + if (!pskIdOpt.isPresent()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "PSK has no identity, or identity was already used"); + } + return null; + } + byte[] pskId = pskIdOpt.get(); + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Found resumable session. Preparing PSK message."); + } + + List<PskIdentity> identities = new ArrayList<>(); + int ageMillis = (int)(System.currentTimeMillis() - + chc.resumingSession.getTicketCreationTime()); + int obfuscatedAge = + ageMillis + chc.resumingSession.getTicketAgeAdd(); + identities.add(new PskIdentity(pskId, obfuscatedAge)); + + SecretKey binderKey = deriveBinderKey(psk, chc.resumingSession); + ClientHelloMessage clientHello = (ClientHelloMessage)message; + CHPreSharedKeySpec pskPrototype = createPskPrototype( + chc.resumingSession.getSuite().hashAlg.hashLength, identities); + HandshakeHash pskBinderHash = chc.handshakeHash.copy(); + + byte[] binder = computeBinder(binderKey, pskBinderHash, + chc.resumingSession, chc, clientHello, pskPrototype); + + List<byte[]> binders = new ArrayList<>(); + binders.add(binder); + + CHPreSharedKeySpec pskMessage = + new CHPreSharedKeySpec(identities, binders); + chc.handshakeExtensions.put(CH_PRE_SHARED_KEY, pskMessage); + return pskMessage.getEncoded(); + } + + private CHPreSharedKeySpec createPskPrototype( + int hashLength, List<PskIdentity> identities) { + List<byte[]> binders = new ArrayList<>(); + byte[] binderProto = new byte[hashLength]; + for (PskIdentity curId : identities) { + binders.add(binderProto); + } + + return new CHPreSharedKeySpec(identities, binders); + } + } + + private static byte[] computeBinder(SecretKey binderKey, + SSLSessionImpl session, + HandshakeHash pskBinderHash) throws IOException { + + pskBinderHash.determine( + session.getProtocolVersion(), session.getSuite()); + pskBinderHash.update(); + byte[] digest = pskBinderHash.digest(); + + return computeBinder(binderKey, session, digest); + } + + private static byte[] computeBinder(SecretKey binderKey, + HandshakeHash hash, SSLSessionImpl session, + HandshakeContext ctx, ClientHello.ClientHelloMessage hello, + CHPreSharedKeySpec pskPrototype) throws IOException { + + PartialClientHelloMessage partialMsg = + new PartialClientHelloMessage(ctx, hello, pskPrototype); + + SSLEngineOutputRecord record = new SSLEngineOutputRecord(hash); + HandshakeOutStream hos = new HandshakeOutStream(record); + partialMsg.write(hos); + + hash.determine(session.getProtocolVersion(), session.getSuite()); + hash.update(); + byte[] digest = hash.digest(); + + return computeBinder(binderKey, session, digest); + } + + private static byte[] computeBinder(SecretKey binderKey, + SSLSessionImpl session, byte[] digest) throws IOException { + try { + CipherSuite.HashAlg hashAlg = session.getSuite().hashAlg; + HKDF hkdf = new HKDF(hashAlg.name); + byte[] label = ("tls13 finished").getBytes(); + byte[] hkdfInfo = SSLSecretDerivation.createHkdfInfo( + label, new byte[0], hashAlg.hashLength); + SecretKey finishedKey = hkdf.expand( + binderKey, hkdfInfo, hashAlg.hashLength, "TlsBinderKey"); + + String hmacAlg = + "Hmac" + hashAlg.name.replace("-", ""); + try { + Mac hmac = JsseJce.getMac(hmacAlg); + hmac.init(finishedKey); + return hmac.doFinal(digest); + } catch (NoSuchAlgorithmException | InvalidKeyException ex) { + throw new IOException(ex); + } + } catch (GeneralSecurityException ex) { + throw new IOException(ex); + } + } + + private static SecretKey deriveBinderKey(SecretKey psk, + SSLSessionImpl session) throws IOException { + try { + CipherSuite.HashAlg hashAlg = session.getSuite().hashAlg; + HKDF hkdf = new HKDF(hashAlg.name); + byte[] zeros = new byte[hashAlg.hashLength]; + SecretKey earlySecret = hkdf.extract(zeros, psk, "TlsEarlySecret"); + + byte[] label = ("tls13 res binder").getBytes(); + MessageDigest md = MessageDigest.getInstance(hashAlg.toString());; + byte[] hkdfInfo = SSLSecretDerivation.createHkdfInfo( + label, md.digest(new byte[0]), hashAlg.hashLength); + return hkdf.expand(earlySecret, + hkdfInfo, hashAlg.hashLength, "TlsBinderKey"); + } catch (GeneralSecurityException ex) { + throw new IOException(ex); + } + } + + private static final + class CHPreSharedKeyAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Handling pre_shared_key absence."); + } + + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Resumption is only determined by PSK, when enabled + shc.resumingSession = null; + shc.isResumption = false; + } + } + + private static final + class SHPreSharedKeyConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHPreSharedKeyConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a response of the specific request? + if (!chc.handshakeExtensions.containsKey( + SSLExtension.CH_PRE_SHARED_KEY)) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Server sent unexpected pre_shared_key extension"); + } + + SHPreSharedKeySpec shPsk = new SHPreSharedKeySpec(chc, buffer); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Received pre_shared_key extension: ", shPsk); + } + + // The PSK identity should not be reused, even if it is + // not selected. + chc.resumingSession.consumePskIdentity(); + + if (shPsk.selectedIdentity != 0) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Selected identity index is not in correct range."); + } + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Resuming session: ", chc.resumingSession); + } + + // remove the session from the cache + SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) + chc.sslContext.engineGetClientSessionContext(); + sessionCache.remove(chc.resumingSession.getSessionId()); + } + } + + private static final + class SHPreSharedKeyAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Handling pre_shared_key absence."); + } + + if (chc.handshakeExtensions.containsKey( + SSLExtension.CH_PRE_SHARED_KEY)) { + // The PSK identity should not be reused, even if it is + // not selected. + chc.resumingSession.consumePskIdentity(); + } + + // The server refused to resume, or the client did not + // request 1.3 resumption. + chc.resumingSession = null; + chc.isResumption = false; + } + } + + private static final + class SHPreSharedKeyProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHPreSharedKeyProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + ServerHandshakeContext shc = (ServerHandshakeContext)context; + SHPreSharedKeySpec psk = (SHPreSharedKeySpec) + shc.handshakeExtensions.get(SH_PRE_SHARED_KEY); + if (psk == null) { + return null; + } + + return psk.getEncoded(); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ProtocolList.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ProtocolList.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ProtocolList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ProtocolList.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.util.*; - -/** - * A list of ProtocolVersions. Also maintains the list of supported protocols. - * Instances of this class are immutable. Some member variables are final - * and can be accessed directly without method accessors. - * - * @author Andreas Sterbenz - * @since 1.4.1 - */ -final class ProtocolList { - - // the sorted protocol version list - private final ArrayList<ProtocolVersion> protocols; - - private String[] protocolNames; - - // the minimum and maximum ProtocolVersions in this list - final ProtocolVersion min, max; - - // the format for the hello version to use - final ProtocolVersion helloVersion; - - ProtocolList(String[] names) { - this(convert(names)); - } - - ProtocolList(ArrayList<ProtocolVersion> versions) { - this.protocols = versions; - - if ((protocols.size() == 1) && - protocols.contains(ProtocolVersion.SSL20Hello)) { - throw new IllegalArgumentException("SSLv2Hello cannot be " + - "enabled unless at least one other supported version " + - "is also enabled."); - } - - if (protocols.size() != 0) { - Collections.sort(protocols); - min = protocols.get(0); - max = protocols.get(protocols.size() - 1); - helloVersion = protocols.get(0); - } else { - min = ProtocolVersion.NONE; - max = ProtocolVersion.NONE; - helloVersion = ProtocolVersion.NONE; - } - } - - private static ArrayList<ProtocolVersion> convert(String[] names) { - if (names == null) { - throw new IllegalArgumentException("Protocols may not be null"); - } - - ArrayList<ProtocolVersion> versions = new ArrayList<>(names.length); - for (int i = 0; i < names.length; i++ ) { - ProtocolVersion version = ProtocolVersion.valueOf(names[i]); - if (versions.contains(version) == false) { - versions.add(version); - } - } - - return versions; - } - - /** - * Return whether this list contains the specified protocol version. - * SSLv2Hello is not a real protocol version we support, we always - * return false for it. - */ - boolean contains(ProtocolVersion protocolVersion) { - if (protocolVersion == ProtocolVersion.SSL20Hello) { - return false; - } - return protocols.contains(protocolVersion); - } - - /** - * Return a reference to the internal Collection of CipherSuites. - * The Collection MUST NOT be modified. - */ - Collection<ProtocolVersion> collection() { - return protocols; - } - - /** - * Select a protocol version from the list. - * - * Return the lower of the protocol version of that suggested by - * the <code>protocolVersion</code> and the highest version of this - * protocol list, or null if no protocol version is available. - * - * The method is used by TLS server to negotiated the protocol - * version between client suggested protocol version in the - * client hello and protocol versions supported by the server. - */ - ProtocolVersion selectProtocolVersion(ProtocolVersion protocolVersion) { - ProtocolVersion selectedVersion = null; - for (ProtocolVersion pv : protocols) { - if (pv.compareTo(protocolVersion) > 0) { - break; // Safe to break here as this.protocols is sorted, - // and DTLS and SSL/TLS protocols are not mixed. - } - selectedVersion = pv; - } - - return selectedVersion; - } - - /** - * Return an array with the names of the ProtocolVersions in this list. - */ - synchronized String[] toStringArray() { - if (protocolNames == null) { - protocolNames = new String[protocols.size()]; - int i = 0; - for (ProtocolVersion version : protocols) { - protocolNames[i++] = version.name; - } - } - return protocolNames.clone(); - } - - @Override - public String toString() { - return protocols.toString(); - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ProtocolVersion.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,291 +25,389 @@ package sun.security.ssl; -import java.util.*; import java.security.CryptoPrimitive; -import sun.security.ssl.CipherSuite.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; /** - * Type safe enum for an SSL/TLS protocol version. Instances are obtained - * using the static factory methods or by referencing the static members - * in this class. Member variables are final and can be accessed without - * accessor methods. - * - * There is only ever one instance per supported protocol version, this - * means == can be used for comparision instead of equals() if desired. - * - * Checks for a particular version number should generally take this form: - * - * <pre>{@code - * if (protocolVersion.v >= ProtocolVersion.TLS10) { - * // TLS 1.0 code goes here - * } else { - * // SSL 3.0 code here - * } - * }</pre> + * Enum for an SSL/TLS/DTLS protocol version. * * @author Andreas Sterbenz * @since 1.4.1 */ -public final class ProtocolVersion implements Comparable<ProtocolVersion> { - - // The limit of maximum protocol version - static final int LIMIT_MAX_VALUE = 0xFFFF; +enum ProtocolVersion { +// TLS13 (0x0304, "TLSv1.3", false), + TLS13 (SSLConfiguration.tls13VN, "TLSv1.3", false), + TLS12 (0x0303, "TLSv1.2", false), + TLS11 (0x0302, "TLSv1.1", false), + TLS10 (0x0301, "TLSv1", false), + SSL30 (0x0300, "SSLv3", false), + SSL20Hello (0x0002, "SSLv2Hello", false), - // The limit of minimum protocol version - static final int LIMIT_MIN_VALUE = 0x0000; + DTLS12 (0xFEFD, "DTLSv1.2", true), + DTLS10 (0xFEFF, "DTLSv1.0", true), // Dummy protocol version value for invalid SSLSession - static final ProtocolVersion NONE = new ProtocolVersion(-1, "NONE"); - - // If enabled, send/accept SSLv2 hello messages - static final ProtocolVersion SSL20Hello = - new ProtocolVersion(0x0002, "SSLv2Hello"); - - // SSL 3.0 - static final ProtocolVersion SSL30 = new ProtocolVersion(0x0300, "SSLv3"); - - // TLS 1.0 - static final ProtocolVersion TLS10 = new ProtocolVersion(0x0301, "TLSv1"); - - // TLS 1.1 - static final ProtocolVersion TLS11 = new ProtocolVersion(0x0302, "TLSv1.1"); + NONE (-1, "NONE", false); - // TLS 1.2 - static final ProtocolVersion TLS12 = new ProtocolVersion(0x0303, "TLSv1.2"); - // DTLS 1.0 - // {254, 255}, the version value of DTLS 1.0. - static final ProtocolVersion DTLS10 = - new ProtocolVersion(0xFEFF, "DTLSv1.0"); + final int id; + final String name; + final boolean isDTLS; + final byte major; + final byte minor; + final boolean isAvailable; - // No DTLS 1.1, that version number was skipped in order to harmonize - // version numbers with TLS. + // The limit of maximum protocol version + static final int LIMIT_MAX_VALUE = 0xFFFF; - // DTLS 1.2 - // {254, 253}, the version value of DTLS 1.2. - static final ProtocolVersion DTLS12 = - new ProtocolVersion(0xFEFD, "DTLSv1.2"); + // The limit of minimum protocol version + static final int LIMIT_MIN_VALUE = 0x0000; - private static final boolean FIPS = SunJSSE.isFIPS(); + // (D)TLS ProtocolVersion array for TLS 1.0 and previous versions. + static final ProtocolVersion[] PROTOCOLS_TO_10 = new ProtocolVersion[] { + TLS10, SSL30 + }; + + // (D)TLS ProtocolVersion array for TLS 1.1/DTLS 1.0 and previous versions. + static final ProtocolVersion[] PROTOCOLS_TO_11 = new ProtocolVersion[] { + TLS11, TLS10, SSL30, DTLS10 + }; + + // (D)TLS ProtocolVersion array for (D)TLS 1.2 and previous versions. + static final ProtocolVersion[] PROTOCOLS_TO_12 = new ProtocolVersion[] { + TLS12, TLS11, TLS10, SSL30, DTLS12, DTLS10 + }; + + // (D)TLS ProtocolVersion array for (D)TLS 1.3 and previous versions. + static final ProtocolVersion[] PROTOCOLS_TO_13 = new ProtocolVersion[] { + TLS13, TLS12, TLS11, TLS10, SSL30, DTLS12, DTLS10 + }; + + // No protocol version specified. + static final ProtocolVersion[] PROTOCOLS_OF_NONE = new ProtocolVersion[] { + NONE + }; + + // (D)TLS ProtocolVersion array for SSL 3.0. + static final ProtocolVersion[] PROTOCOLS_OF_30 = new ProtocolVersion[] { + SSL30 + }; + + // (D)TLS ProtocolVersion array for TLS 1.1/DTSL 1.0. + static final ProtocolVersion[] PROTOCOLS_OF_11 = new ProtocolVersion[] { + TLS11, DTLS10 + }; + + // (D)TLS ProtocolVersion array for (D)TLS 1.2. + static final ProtocolVersion[] PROTOCOLS_OF_12 = new ProtocolVersion[] { + TLS12, DTLS12 + }; + + // (D)TLS ProtocolVersion array for (D)TLS 1.3. + static final ProtocolVersion[] PROTOCOLS_OF_13 = new ProtocolVersion[] { + TLS13 + }; + + // (D)TLS ProtocolVersion array for TSL 1.0/1.1 and DTLS 1.0. + static final ProtocolVersion[] PROTOCOLS_10_11 = new ProtocolVersion[] { + TLS11, TLS10, DTLS10 + }; + + // (D)TLS ProtocolVersion array for TSL 1.1/1.2 and DTLS 1.0/1.2. + static final ProtocolVersion[] PROTOCOLS_11_12 = new ProtocolVersion[] { + TLS12, TLS11, DTLS12, DTLS10 + }; + + // (D)TLS ProtocolVersion array for TSL 1.2/1.3 and DTLS 1.2/1.3. + static final ProtocolVersion[] PROTOCOLS_12_13 = new ProtocolVersion[] { + TLS13, TLS12, DTLS12 + }; + + // (D)TLS ProtocolVersion array for TSL 1.0/1.1/1.2 and DTLS 1.0/1.2. + static final ProtocolVersion[] PROTOCOLS_10_12 = new ProtocolVersion[] { + TLS12, TLS11, TLS10, DTLS12, DTLS10 + }; + + // TLS ProtocolVersion array for TLS 1.2 and previous versions. + static final ProtocolVersion[] PROTOCOLS_TO_TLS12 = new ProtocolVersion[] { + TLS12, TLS11, TLS10, SSL30 + }; + + // TLS ProtocolVersion array for TLS 1.1 and previous versions. + static final ProtocolVersion[] PROTOCOLS_TO_TLS11 = new ProtocolVersion[] { + TLS11, TLS10, SSL30 + }; + + // TLS ProtocolVersion array for TLS 1.0 and previous versions. + static final ProtocolVersion[] PROTOCOLS_TO_TLS10 = new ProtocolVersion[] { + TLS10, SSL30 + }; - // minimum version we implement (SSL 3.0) - static final ProtocolVersion MIN = FIPS ? TLS10 : SSL30; + // Empty ProtocolVersion array + static final ProtocolVersion[] PROTOCOLS_EMPTY = new ProtocolVersion[0]; - // maximum version we implement (TLS 1.2) - static final ProtocolVersion MAX = TLS12; + private ProtocolVersion(int id, String name, boolean isDTLS) { + this.id = id; + this.name = name; + this.isDTLS = isDTLS; + this.major = (byte)((id >>> 8) & 0xFF); + this.minor = (byte)(id & 0xFF); + + this.isAvailable = SSLAlgorithmConstraints.DEFAULT_SSL_ONLY.permits( + EnumSet.<CryptoPrimitive>of(CryptoPrimitive.KEY_AGREEMENT), + name, null); + } - // SSL/TLS ProtocolVersion to use by default (TLS 1.2) - static final ProtocolVersion DEFAULT_TLS = TLS12; + /** + * Return a ProtocolVersion with the specified major and minor + * version numbers. + */ + static ProtocolVersion valueOf(byte major, byte minor) { + for (ProtocolVersion pv : ProtocolVersion.values()) { + if ((pv.major == major) && (pv.minor == minor)) { + return pv; + } + } - // DTLS ProtocolVersion to use by default (TLS 1.2) - static final ProtocolVersion DEFAULT_DTLS = DTLS12; + return null; + } - // Default version for hello messages (SSLv2Hello) - static final ProtocolVersion DEFAULT_HELLO = FIPS ? TLS10 : SSL30; + /** + * Return a ProtocolVersion with the specified version number. + */ + static ProtocolVersion valueOf(int id) { + for (ProtocolVersion pv : ProtocolVersion.values()) { + if (pv.id == id) { + return pv; + } + } - // Available protocols - // - // Including all supported protocols except the disabled ones. - static final Set<ProtocolVersion> availableProtocols; + return null; + } - // version in 16 bit MSB format as it appears in records and - // messages, i.e. 0x0301 for TLS 1.0 - public final int v; + /** + * Return name of a (D)TLS protocol specified by major and + * minor version numbers. + */ + static String nameOf(byte major, byte minor) { + for (ProtocolVersion pv : ProtocolVersion.values()) { + if ((pv.major == major) && (pv.minor == minor)) { + return pv.name; + } + } - // major and minor version - public final byte major, minor; + return "(D)TLS-" + major + "." + minor; + } - // name used in JSSE (e.g. TLSv1 for TLS 1.0) - final String name; + /** + * Return name of a (D)TLS protocol specified by a protocol number. + */ + static String nameOf(int id) { + return nameOf((byte)((id >>> 8) & 0xFF), (byte)(id & 0xFF)); + } - // Initialize the available protocols. - static { - Set<ProtocolVersion> protocols = new HashSet<>(7); - - ProtocolVersion[] pvs = new ProtocolVersion[] { - SSL20Hello, SSL30, TLS10, TLS11, TLS12, DTLS10, DTLS12}; - EnumSet<CryptoPrimitive> cryptoPrimitives = - EnumSet.<CryptoPrimitive>of(CryptoPrimitive.KEY_AGREEMENT); - for (ProtocolVersion p : pvs) { - if (SSLAlgorithmConstraints.DEFAULT_SSL_ONLY.permits( - cryptoPrimitives, p.name, null)) { - protocols.add(p); + /** + * Return a ProtocolVersion for the given (D)TLS protocol name. + */ + static ProtocolVersion nameOf(String name) { + for (ProtocolVersion pv : ProtocolVersion.values()) { + if (pv.name.equals(name)) { + return pv; } } - availableProtocols = - Collections.<ProtocolVersion>unmodifiableSet(protocols); - } - - // private - private ProtocolVersion(int v, String name) { - this.v = v; - this.name = name; - major = (byte)(v >>> 8); - minor = (byte)(v & 0xFF); + return null; } - // private - private static ProtocolVersion valueOf(int v) { - if (v == SSL30.v) { - return SSL30; - } else if (v == TLS10.v) { - return TLS10; - } else if (v == TLS11.v) { - return TLS11; - } else if (v == TLS12.v) { - return TLS12; - } else if (v == SSL20Hello.v) { - return SSL20Hello; - } else if (v == DTLS10.v) { - return DTLS10; - } else if (v == DTLS12.v) { - return DTLS12; + /** + * Return true if the specific (D)TLS protocol is negotiable. + * + * Used to filter out SSLv2Hello and protocol numbers less than the + * minimal supported protocol versions. + */ + static boolean isNegotiable( + byte major, byte minor, boolean isDTLS, boolean allowSSL20Hello) { + int v = ((major & 0xFF) << 8) | (minor & 0xFF); + if (isDTLS) { + return v <= DTLS10.id; } else { - int major = (v >>> 8) & 0xFF; - int minor = v & 0xFF; - return new ProtocolVersion(v, "Unknown-" + major + "." + minor); + if (v < SSL30.id) { + if (!allowSSL20Hello || (v != SSL20Hello.id)) { + return false; + } + } + return true; } } /** - * Return a ProtocolVersion with the specified major and minor version - * numbers. Never throws exceptions. + * Get names of a list of ProtocolVersion objects. */ - public static ProtocolVersion valueOf(int major, int minor) { - return valueOf(((major & 0xFF) << 8) | (minor & 0xFF)); + static String[] toStringArray(List<ProtocolVersion> protocolVersions) { + if ((protocolVersions != null) && !protocolVersions.isEmpty()) { + String[] protocolNames = new String[protocolVersions.size()]; + int i = 0; + for (ProtocolVersion pv : protocolVersions) { + protocolNames[i++] = pv.name; + } + + return protocolNames; + } + + return new String[0]; } /** - * Return a ProtocolVersion for the given name. - * - * @exception IllegalArgumentException if name is null or does not - * identify a supported protocol + * Get names of a list of protocol version identifiers. */ - static ProtocolVersion valueOf(String name) { - if (name == null) { - throw new IllegalArgumentException("Protocol cannot be null"); - } - - if (FIPS && (name.equals(SSL30.name) || name.equals(SSL20Hello.name))) { - throw new IllegalArgumentException( - "Only TLS 1.0 or later allowed in FIPS mode"); - } - - if (name.equals(SSL30.name)) { - return SSL30; - } else if (name.equals(TLS10.name)) { - return TLS10; - } else if (name.equals(TLS11.name)) { - return TLS11; - } else if (name.equals(TLS12.name)) { - return TLS12; - } else if (name.equals(SSL20Hello.name)) { - return SSL20Hello; - } else if (name.equals(DTLS10.name)) { - return DTLS10; - } else if (name.equals(DTLS12.name)) { - return DTLS12; - } else { - throw new IllegalArgumentException(name); + static String[] toStringArray(int[] protocolVersions) { + if ((protocolVersions != null) && protocolVersions.length != 0) { + String[] protocolNames = new String[protocolVersions.length]; + int i = 0; + for (int pv : protocolVersions) { + protocolNames[i++] = ProtocolVersion.nameOf(pv); + } + + return protocolNames; } - } - @Override - public String toString() { - return name; + return new String[0]; } /** - * Compares this object with the specified object for order. + * Get a list of ProtocolVersion objects of an array protocol + * version names. */ - @Override - public int compareTo(ProtocolVersion protocolVersion) { - if (maybeDTLSProtocol()) { - if (!protocolVersion.maybeDTLSProtocol()) { - throw new IllegalArgumentException("Not DTLS protocol"); - } + static List<ProtocolVersion> namesOf(String[] protocolNames) { + if (protocolNames == null || protocolNames.length == 0) { + return Collections.<ProtocolVersion>emptyList(); + } - return protocolVersion.v - this.v; - } else { - if (protocolVersion.maybeDTLSProtocol()) { - throw new IllegalArgumentException("Not TLS protocol"); + List<ProtocolVersion> pvs = new ArrayList<>(protocolNames.length); + for (String pn : protocolNames) { + ProtocolVersion pv = ProtocolVersion.nameOf(pn); + if (pv == null) { + throw new IllegalArgumentException( + "Unsupported protocol" + pn); } - return this.v - protocolVersion.v; + pvs.add(pv); } + + return Collections.unmodifiableList(pvs); } /** - * Returns true if a ProtocolVersion represents a DTLS protocol. + * Return true if the specific protocol version name is + * of (D)TLS 1.2 or newer version. */ - boolean isDTLSProtocol() { - return this.v == DTLS12.v || this.v == DTLS10.v; + static boolean useTLS12PlusSpec(String name) { + ProtocolVersion pv = ProtocolVersion.nameOf(name); + if (pv != null && pv != NONE) { + return pv.isDTLS ? (pv.id <= DTLS12.id) : (pv.id >= TLS12.id); + } + + return false; } /** - * Returns true if a ProtocolVersion may represent a DTLS protocol. + * Compares this object with the specified ProtocolVersion. + * + * @see java.lang.Comparable */ - boolean maybeDTLSProtocol() { - return (this.major & 0x80) != 0; + int compare(ProtocolVersion that) { + if (this == that) { + return 0; + } + + if (this == ProtocolVersion.NONE) { + return -1; + } else if (that == ProtocolVersion.NONE) { + return 1; + } + + if (isDTLS) { + return that.id - this.id; + } else { + return this.id - that.id; + } } + /** + * Return true if this ProtocolVersion object is of (D)TLS 1.3 or + * newer version. + */ + boolean useTLS13PlusSpec() { + return isDTLS ? (this.id < DTLS12.id) : (this.id >= TLS13.id); + } + + /** + * Return true if this ProtocolVersion object is of (D)TLS 1.2 or + * newer version. + */ boolean useTLS12PlusSpec() { - return maybeDTLSProtocol() ? (this.v <= DTLS12.v) : (this.v >= TLS12.v); + return isDTLS ? (this.id <= DTLS12.id) : (this.id >= TLS12.id); } + /** + * Return true if this ProtocolVersion object is of + * TLS 1.1/DTLS 1.0 or newer version. + */ boolean useTLS11PlusSpec() { - return maybeDTLSProtocol() ? true : (this.v >= TLS11.v); + return isDTLS ? true : (this.id >= TLS11.id); } + /** + * Return true if this ProtocolVersion object is of TLS 1.0 or + * newer version. + */ boolean useTLS10PlusSpec() { - return maybeDTLSProtocol() ? true : (this.v >= TLS10.v); + return isDTLS ? true : (this.id >= TLS10.id); } - boolean obsoletes(CipherSuite suite) { - ProtocolVersion proto = this; - if (proto.isDTLSProtocol()) { - // DTLS bans stream ciphers. - if (suite.cipher.cipherType == CipherType.STREAM_CIPHER) { - return true; - } - - proto = mapToTLSProtocol(this); - } - - return (proto.v >= suite.obsoleted); + /** + * Return true if this ProtocolVersion object is of TLS 1.0 or + * newer version. + */ + static boolean useTLS10PlusSpec(int id, boolean isDTLS) { + return isDTLS ? true : (id >= TLS10.id); } - boolean supports(CipherSuite suite) { - ProtocolVersion proto = this; - if (proto.isDTLSProtocol()) { - // DTLS bans stream ciphers. - if (suite.cipher.cipherType == CipherType.STREAM_CIPHER) { - return false; - } - - proto = mapToTLSProtocol(this); - } - - return (proto.v >= suite.supported); + /** + * Return true if this ProtocolVersion object is of (D)TLS 1.3 or + * newer version. + */ + static boolean useTLS13PlusSpec(int id, boolean isDTLS) { + return isDTLS ? (id < DTLS12.id) : (id >= TLS13.id); } - // Map a specified protocol to the corresponding TLS version. - // - // DTLS 1.2 -> TLS 1.2 - // DTLS 1.0 -> TLS 1.1 - private static ProtocolVersion mapToTLSProtocol( - ProtocolVersion protocolVersion) { - - if (protocolVersion.isDTLSProtocol()) { - if (protocolVersion.v == DTLS10.v) { - protocolVersion = TLS11; - } else { // DTLS12 - protocolVersion = TLS12; + /** + * Select the lower of that suggested protocol version and + * the highest of the listed protocol versions. + * + * @param listedVersions the listed protocol version + * @param suggestedVersion the suggested protocol version + */ + static ProtocolVersion selectedFrom( + List<ProtocolVersion> listedVersions, int suggestedVersion) { + ProtocolVersion selectedVersion = ProtocolVersion.NONE; + for (ProtocolVersion pv : listedVersions) { + if (pv.id == suggestedVersion) { + return pv; + } else if (pv.isDTLS) { + if (pv.id > suggestedVersion && pv.id < selectedVersion.id) { + selectedVersion = pv; + } + } else { + if (pv.id < suggestedVersion && pv.id > selectedVersion.id) { + selectedVersion = pv; + } } } - return protocolVersion; + return selectedVersion; } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/PskKeyExchangeModesExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,333 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.*; +import javax.net.ssl.SSLProtocolException; +import sun.security.ssl.SSLExtension.ExtensionConsumer; + +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the "psk_key_exchange_modes" extensions. + */ +final class PskKeyExchangeModesExtension { + static final HandshakeProducer chNetworkProducer = + new PskKeyExchangeModesProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new PskKeyExchangeModesConsumer(); + static final HandshakeAbsence chOnLoadAbsence = + new PskKeyExchangeModesOnLoadAbsence(); + static final HandshakeAbsence chOnTradeAbsence = + new PskKeyExchangeModesOnTradeAbsence(); + + static final SSLStringizer pkemStringizer = + new PskKeyExchangeModesStringizer(); + + enum PskKeyExchangeMode { + PSK_KE ((byte)0, "psk_ke"), + PSK_DHE_KE ((byte)1, "psk_dhe_ke"); + + final byte id; + final String name; + + PskKeyExchangeMode(byte id, String name) { + this.id = id; + this.name = name; + } + + static PskKeyExchangeMode valueOf(byte id) { + for(PskKeyExchangeMode pkem : values()) { + if (pkem.id == id) { + return pkem; + } + } + + return null; + } + + static String nameOf(byte id) { + for (PskKeyExchangeMode pkem : PskKeyExchangeMode.values()) { + if (pkem.id == id) { + return pkem.name; + } + } + + return "<UNKNOWN PskKeyExchangeMode TYPE: " + (id & 0x0FF) + ">"; + } + } + + static final + class PskKeyExchangeModesSpec implements SSLExtensionSpec { + private static final PskKeyExchangeModesSpec DEFAULT = + new PskKeyExchangeModesSpec(new byte[] { + PskKeyExchangeMode.PSK_DHE_KE.id}); + + final byte[] modes; + + PskKeyExchangeModesSpec(byte[] modes) { + this.modes = modes; + } + + PskKeyExchangeModesSpec(ByteBuffer m) throws IOException { + if (m.remaining() < 2) { + throw new SSLProtocolException( + "Invalid psk_key_exchange_modes extension: " + + "insufficient data"); + } + + this.modes = Record.getBytes8(m); + } + + boolean contains(PskKeyExchangeMode mode) { + if (modes != null) { + for (byte m : modes) { + if (mode.id == m) { + return true; + } + } + } + + return false; + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"ke_modes\": '['{0}']'", Locale.ENGLISH); + if (modes == null || modes.length == 0) { + Object[] messageFields = { + "<no PSK key exchange modes specified>" + }; + return messageFormat.format(messageFields); + } else { + StringBuilder builder = new StringBuilder(64); + boolean isFirst = true; + for (byte mode : modes) { + if (isFirst) { + isFirst = false; + } else { + builder.append(", "); + } + + builder.append(PskKeyExchangeMode.nameOf(mode)); + } + + Object[] messageFields = { + builder.toString() + }; + + return messageFormat.format(messageFields); + } + } + } + + private static final + class PskKeyExchangeModesStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new PskKeyExchangeModesSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data consumer of a "psk_key_exchange_modes" extension in + * the ClientHello handshake message. + */ + private static final + class PskKeyExchangeModesConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private PskKeyExchangeModesConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable( + SSLExtension.PSK_KEY_EXCHANGE_MODES)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable psk_key_exchange_modes extension"); + } + + // No session resumption is allowed. + if (shc.isResumption && shc.resumingSession != null) { + shc.isResumption = false; + shc.resumingSession = null; + } + + return; // ignore the extension + } + + // Parse the extension. + PskKeyExchangeModesSpec spec; + try { + spec = new PskKeyExchangeModesSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + shc.handshakeExtensions.put( + SSLExtension.PSK_KEY_EXCHANGE_MODES, spec); + + // Impact on session resumption. + // + // Do the requested modes support session resumption? + if (shc.isResumption) { // resumingSession may not be set + // Note: psk_dhe_ke is the only supported mode now. If the + // psk_ke mode is supported in the future, may need an update + // here. + if (!spec.contains(PskKeyExchangeMode.PSK_DHE_KE)) { + shc.isResumption = false; + shc.resumingSession = null; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "abort session resumption, " + + "no supported psk_dhe_ke PSK key exchange mode"); + } + } + } + } + } + + /** + * Network data producer of a "psk_key_exchange_modes" extension in the + * ClientHello handshake message. + */ + private static final + class PskKeyExchangeModesProducer implements HandshakeProducer { + + // Prevent instantiation of this class. + private PskKeyExchangeModesProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable( + SSLExtension.PSK_KEY_EXCHANGE_MODES)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore unavailable psk_key_exchange_modes extension"); + } + + return null; + } + + byte[] extData = new byte[] {0x01, 0x01}; // psk_dhe_ke + + // Update the context. + chc.handshakeExtensions.put( + SSLExtension.PSK_KEY_EXCHANGE_MODES, + PskKeyExchangeModesSpec.DEFAULT); + + return extData; + } + } + /** + * The absence processing if a "psk_key_exchange_modes" extension is + * not present in the ClientHello handshake message. + */ + private static final + class PskKeyExchangeModesOnLoadAbsence implements HandshakeAbsence { + + // Prevent instantiation of this class. + private PskKeyExchangeModesOnLoadAbsence() { + // blank + } + + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // No session resumptio is allowed. + if (shc.isResumption) { // resumingSession may not be set + shc.isResumption = false; + shc.resumingSession = null; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "abort session resumption, " + + "no supported psk_dhe_ke PSK key exchange mode"); + } + } + } + } + + /** + * The absence processing if a "signature_algorithms" extension is + * not present in the ClientHello handshake message. + */ + private static final + class PskKeyExchangeModesOnTradeAbsence implements HandshakeAbsence { + + // Prevent instantiation of this class. + private PskKeyExchangeModesOnTradeAbsence() { + // blank + } + + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // A client MUST provide a "psk_key_exchange_modes" extension if + // it offers a "pre_shared_key" extension. If clients offer + // "pre_shared_key" without a "psk_key_exchange_modes" extension, + // servers MUST abort the handshake. + SSLExtensionSpec spec = + shc.handshakeExtensions.get(SSLExtension.CH_PRE_SHARED_KEY); + if (spec == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "pre_shared_key key extension is offered " + + "without a psk_key_exchange_modes extension"); + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RandomCookie.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RandomCookie.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RandomCookie.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RandomCookie.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,11 +23,12 @@ * questions. */ - package sun.security.ssl; import java.io.*; +import java.nio.ByteBuffer; import java.security.SecureRandom; +import java.util.Arrays; /* * RandomCookie ... SSL hands standard format random cookies (nonces) @@ -37,33 +38,102 @@ * @author David Brownell */ final class RandomCookie { + final byte[] randomBytes = new byte[32]; // exactly 32 bytes + + private static final byte[] hrrRandomBytes = new byte[] { + (byte)0xCF, (byte)0x21, (byte)0xAD, (byte)0x74, + (byte)0xE5, (byte)0x9A, (byte)0x61, (byte)0x11, + (byte)0xBE, (byte)0x1D, (byte)0x8C, (byte)0x02, + (byte)0x1E, (byte)0x65, (byte)0xB8, (byte)0x91, + (byte)0xC2, (byte)0xA2, (byte)0x11, (byte)0x16, + (byte)0x7A, (byte)0xBB, (byte)0x8C, (byte)0x5E, + (byte)0x07, (byte)0x9E, (byte)0x09, (byte)0xE2, + (byte)0xC8, (byte)0xA8, (byte)0x33, (byte)0x9C + }; + + private static final byte[] t12Protection = new byte[] { + (byte)0x44, (byte)0x4F, (byte)0x57, (byte)0x4E, + (byte)0x47, (byte)0x52, (byte)0x44, (byte)0x01 + }; + + private static final byte[] t11Protection = new byte[] { + (byte)0x44, (byte)0x4F, (byte)0x57, (byte)0x4E, + (byte)0x47, (byte)0x52, (byte)0x44, (byte)0x00 + }; - byte[] random_bytes; // exactly 32 bytes + static final RandomCookie hrrRandom = new RandomCookie(hrrRandomBytes); RandomCookie(SecureRandom generator) { - random_bytes = new byte[32]; - generator.nextBytes(random_bytes); + generator.nextBytes(randomBytes); + } + + // Used for server random generation with version downgrade protection. + RandomCookie(HandshakeContext context) { + SecureRandom generator = context.sslContext.getSecureRandom(); + generator.nextBytes(randomBytes); + + // TLS 1.3 has a downgrade protection mechanism embedded in the + // server's random value. TLS 1.3 servers which negotiate TLS 1.2 + // or below in response to a ClientHello MUST set the last eight + // bytes of their Random value specially. + byte[] protection = null; + if (context.maximumActiveProtocol.useTLS13PlusSpec()) { + if (!context.negotiatedProtocol.useTLS13PlusSpec()) { + if (context.negotiatedProtocol.useTLS12PlusSpec()) { + protection = t12Protection; + } else { + protection = t11Protection; + } + } + } else if (context.maximumActiveProtocol.useTLS12PlusSpec()) { + if (!context.negotiatedProtocol.useTLS12PlusSpec()) { + protection = t11Protection; + } + } + + if (protection != null) { + System.arraycopy(protection, 0, randomBytes, + randomBytes.length - protection.length, protection.length); + } } - RandomCookie(HandshakeInStream m) throws IOException { - random_bytes = new byte[32]; - m.read(random_bytes, 0, 32); + RandomCookie(ByteBuffer m) throws IOException { + m.get(randomBytes); } - void send(HandshakeOutStream out) throws IOException { - out.write(random_bytes, 0, 32); + private RandomCookie(byte[] randomBytes) { + System.arraycopy(randomBytes, 0, this.randomBytes, 0, 32); } - void print(PrintStream s) { - s.print("random_bytes = {"); - for (int i = 0; i < 32; i++) { - int k = random_bytes[i] & 0xFF; - if (i != 0) { - s.print(' '); + @Override + public String toString() { + return "random_bytes = {" + Utilities.toHexString(randomBytes) + "}"; + } + + boolean isHelloRetryRequest() { + return Arrays.equals(hrrRandomBytes, randomBytes); + } + + // Used for client random validation of version downgrade protection. + boolean isVersionDowngrade(HandshakeContext context) { + if (context.maximumActiveProtocol.useTLS13PlusSpec()) { + if (!context.negotiatedProtocol.useTLS13PlusSpec()) { + return isT12Downgrade() || isT11Downgrade(); + } + } else if (context.maximumActiveProtocol.useTLS12PlusSpec()) { + if (!context.negotiatedProtocol.useTLS12PlusSpec()) { + return isT11Downgrade(); } - s.print(Utilities.hexDigits[k >>> 4]); - s.print(Utilities.hexDigits[k & 0xf]); } - s.println("}"); + + return false; + } + + private boolean isT12Downgrade() { + return Arrays.equals(randomBytes, 24, 32, t12Protection, 0, 8); + } + + private boolean isT11Downgrade() { + return Arrays.equals(randomBytes, 24, 32, t11Protection, 0, 8); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Record.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Record.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Record.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Record.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,27 +25,19 @@ package sun.security.ssl; +import java.io.IOException; +import java.nio.ByteBuffer; +import javax.net.ssl.SSLException; + /** - * SSL/TLS/DTLS records, as pulled off (and put onto) a TCP stream. This is - * the base interface, which defines common information and interfaces + * SSL/(D)TLS record. + * + * This is the base interface, which defines common information and interfaces * used by both Input and Output records. * * @author David Brownell */ interface Record { - - /* - * There are four record types, which are part of the interface - * to this level (along with the maximum record size). - * - * enum { change_cipher_spec(20), alert(21), handshake(22), - * application_data(23), (255) } ContentType; - */ - static final byte ct_change_cipher_spec = 20; - static final byte ct_alert = 21; - static final byte ct_handshake = 22; - static final byte ct_application_data = 23; - static final int maxMacSize = 48; // the max supported MAC or // AEAD tag size static final int maxDataSize = 16384; // 2^14 bytes of data @@ -59,35 +51,146 @@ * System property to enable/disable CBC protection in SSL3/TLS1. */ static final boolean enableCBCProtection = - Debug.getBooleanProperty("jsse.enableCBCProtection", true); + Utilities.getBooleanProperty("jsse.enableCBCProtection", true); /* * The overflow values of integers of 8, 16 and 24 bits. */ - static final int OVERFLOW_OF_INT08 = (1 << 8); - static final int OVERFLOW_OF_INT16 = (1 << 16); - static final int OVERFLOW_OF_INT24 = (1 << 24); - - /** - * Return a description for the given content type. - */ - static String contentName(byte contentType) { - switch (contentType) { - case ct_change_cipher_spec: - return "Change Cipher Spec"; - case ct_alert: - return "Alert"; - case ct_handshake: - return "Handshake"; - case ct_application_data: - return "Application Data"; - default: - return "contentType = " + contentType; + static final int OVERFLOW_OF_INT08 = (0x01 << 8); + static final int OVERFLOW_OF_INT16 = (0x01 << 16); + static final int OVERFLOW_OF_INT24 = (0x01 << 24); + + /* + * Read 8, 16, 24, and 32 bit integer data types, encoded + * in standard big-endian form. + */ + static int getInt8(ByteBuffer m) throws IOException { + verifyLength(m, 1); + return (m.get() & 0xFF); + } + + static int getInt16(ByteBuffer m) throws IOException { + verifyLength(m, 2); + return ((m.get() & 0xFF) << 8) | + (m.get() & 0xFF); + } + + static int getInt24(ByteBuffer m) throws IOException { + verifyLength(m, 3); + return ((m.get() & 0xFF) << 16) | + ((m.get() & 0xFF) << 8) | + (m.get() & 0xFF); + } + + static int getInt32(ByteBuffer m) throws IOException { + verifyLength(m, 4); + return ((m.get() & 0xFF) << 24) | + ((m.get() & 0xFF) << 16) | + ((m.get() & 0xFF) << 8) | + (m.get() & 0xFF); + } + + /* + * Read byte vectors with 8, 16, and 24 bit length encodings. + */ + static byte[] getBytes8(ByteBuffer m) throws IOException { + int len = Record.getInt8(m); + verifyLength(m, len); + byte[] b = new byte[len]; + + m.get(b); + return b; + } + + static byte[] getBytes16(ByteBuffer m) throws IOException { + int len = Record.getInt16(m); + verifyLength(m, len); + byte[] b = new byte[len]; + + m.get(b); + return b; + } + + static byte[] getBytes24(ByteBuffer m) throws IOException { + int len = Record.getInt24(m); + verifyLength(m, len); + byte[] b = new byte[len]; + + m.get(b); + return b; + } + + /* + * Write 8, 16, 24, and 32 bit integer data types, encoded + * in standard big-endian form. + */ + static void putInt8(ByteBuffer m, int i) throws IOException { + verifyLength(m, 1); + m.put((byte)(i & 0xFF)); + } + + static void putInt16(ByteBuffer m, int i) throws IOException { + verifyLength(m, 2); + m.put((byte)((i >> 8) & 0xFF)); + m.put((byte)(i & 0xFF)); + } + + static void putInt24(ByteBuffer m, int i) throws IOException { + verifyLength(m, 3); + m.put((byte)((i >> 16) & 0xFF)); + m.put((byte)((i >> 8) & 0xFF)); + m.put((byte)(i & 0xFF)); + } + + static void putInt32(ByteBuffer m, int i) throws IOException { + m.put((byte)((i >> 24) & 0xFF)); + m.put((byte)((i >> 16) & 0xFF)); + m.put((byte)((i >> 8) & 0xFF)); + m.put((byte)(i & 0xFF)); + } + + /* + * Write byte vectors with 8, 16, and 24 bit length encodings. + */ + static void putBytes8(ByteBuffer m, byte[] s) throws IOException { + if (s == null || s.length == 0) { + verifyLength(m, 1); + putInt8(m, 0); + } else { + verifyLength(m, 1 + s.length); + putInt8(m, s.length); + m.put(s); } } - static boolean isValidContentType(byte contentType) { - return (contentType == 20) || (contentType == 21) || - (contentType == 22) || (contentType == 23); + static void putBytes16(ByteBuffer m, byte[] s) throws IOException { + if (s == null || s.length == 0) { + verifyLength(m, 2); + putInt16(m, 0); + } else { + verifyLength(m, 2 + s.length); + putInt16(m, s.length); + m.put(s); + } + } + + static void putBytes24(ByteBuffer m, byte[] s) throws IOException { + if (s == null || s.length == 0) { + verifyLength(m, 3); + putInt24(m, 0); + } else { + verifyLength(m, 3 + s.length); + putInt24(m, s.length); + m.put(s); + } + } + + // Verify that the buffer has sufficient remaining. + static void verifyLength( + ByteBuffer m, int len) throws SSLException { + if (len > m.remaining()) { + throw new SSLException("Insufficient space in the buffer, " + + "may be cause by an unexpected end of handshake data."); + } } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RenegoInfoExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,558 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.Locale; +import javax.net.ssl.SSLProtocolException; +import sun.security.ssl.ClientHello.ClientHelloMessage; +import static sun.security.ssl.SSLExtension.CH_RENEGOTIATION_INFO; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import static sun.security.ssl.SSLExtension.SH_RENEGOTIATION_INFO; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the "renegotiation_info" extensions [RFC 5746]. + */ +final class RenegoInfoExtension { + static final HandshakeProducer chNetworkProducer = + new CHRenegotiationInfoProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHRenegotiationInfoConsumer(); + static final HandshakeAbsence chOnLoadAbsence = + new CHRenegotiationInfoAbsence(); + + static final HandshakeProducer shNetworkProducer = + new SHRenegotiationInfoProducer(); + static final ExtensionConsumer shOnLoadConsumer = + new SHRenegotiationInfoConsumer(); + static final HandshakeAbsence shOnLoadAbsence = + new SHRenegotiationInfoAbsence(); + + static final SSLStringizer rniStringizer = + new RenegotiationInfoStringizer(); + + /** + * The "renegotiation_info" extension. + */ + static final class RenegotiationInfoSpec implements SSLExtensionSpec { + // A nominal object that does not holding any real renegotiation info. + static final RenegotiationInfoSpec NOMINAL = + new RenegotiationInfoSpec(new byte[0]); + + private final byte[] renegotiatedConnection; + + private RenegotiationInfoSpec(byte[] renegotiatedConnection) { + this.renegotiatedConnection = Arrays.copyOf( + renegotiatedConnection, renegotiatedConnection.length); + } + + private RenegotiationInfoSpec(ByteBuffer m) throws IOException { + // Parse the extension. + if (!m.hasRemaining() || m.remaining() < 1) { + throw new SSLProtocolException( + "Invalid renegotiation_info extension data: " + + "insufficient data"); + } + this.renegotiatedConnection = Record.getBytes8(m); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"renegotiated connection\": '['{0}']'", Locale.ENGLISH); + if (renegotiatedConnection.length == 0) { + Object[] messageFields = { + "<no renegotiated connection>" + }; + return messageFormat.format(messageFields); + } else { + Object[] messageFields = { + Utilities.toHexString(renegotiatedConnection) + }; + return messageFormat.format(messageFields); + } + } + } + + private static final + class RenegotiationInfoStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new RenegotiationInfoSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of a "renegotiation_info" extension in + * the ClientHello handshake message. + */ + private static final + class CHRenegotiationInfoProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHRenegotiationInfoProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(CH_RENEGOTIATION_INFO)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable renegotiation_info extension"); + } + + return null; + } + + if (!chc.conContext.isNegotiated) { + if (chc.activeCipherSuites.contains( + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) { + // Using the the TLS_EMPTY_RENEGOTIATION_INFO_SCSV instead. + return null; + } + + // initial handshaking. + // + // If this is the initial handshake for a connection, then the + // "renegotiated_connection" field is of zero length in both + // the ClientHello and the ServerHello. [RFC 5746] + byte[] extData = new byte[] { 0x00 }; + chc.handshakeExtensions.put( + CH_RENEGOTIATION_INFO, RenegotiationInfoSpec.NOMINAL); + + return extData; + } else if (chc.conContext.secureRenegotiation) { + // secure renegotiation + // + // For ClientHello handshake message in renegotiation, this + // field contains the "client_verify_data". + byte[] extData = + new byte[chc.conContext.clientVerifyData.length + 1]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putBytes8(m, chc.conContext.clientVerifyData); + + // The conContext.clientVerifyData will be used for further + // processing, so it does not matter to save whatever in the + // RenegotiationInfoSpec object. + chc.handshakeExtensions.put( + CH_RENEGOTIATION_INFO, RenegotiationInfoSpec.NOMINAL); + + return extData; + } else { // not secure renegotiation + if (HandshakeContext.allowUnsafeRenegotiation) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("Using insecure renegotiation"); + } + + return null; + } else { + // terminate the session. + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "insecure renegotiation is not allowed"); + } + } + + return null; + } + } + + /** + * Network data producer of a "renegotiation_info" extension in + * the ServerHello handshake message. + */ + private static final + class CHRenegotiationInfoConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHRenegotiationInfoConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(CH_RENEGOTIATION_INFO)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Ignore unavailable extension: " + + CH_RENEGOTIATION_INFO.name); + } + return; // ignore the extension + } + + // Parse the extension. + RenegotiationInfoSpec spec; + try { + spec = new RenegotiationInfoSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + if (!shc.conContext.isNegotiated) { + // initial handshaking. + if (spec.renegotiatedConnection.length != 0) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid renegotiation_info extension data: not empty"); + } + shc.conContext.secureRenegotiation = true; + } else { + if (!shc.conContext.secureRenegotiation) { + // Unexpected RI extension for insecure renegotiation, + // abort the handshake with a fatal handshake_failure alert. + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "The renegotiation_info is present in a insecure " + + "renegotiation"); + } else { + // verify the client_verify_data value + if (!Arrays.equals(shc.conContext.clientVerifyData, + spec.renegotiatedConnection)) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid renegotiation_info extension data: " + + "incorrect verify data in ClientHello"); + } + } + } + + // Update the context. + // + // The conContext.clientVerifyData will be used for further + // processing, so it does not matter to save whatever in the + // RenegotiationInfoSpec object. + shc.handshakeExtensions.put( + CH_RENEGOTIATION_INFO, RenegotiationInfoSpec.NOMINAL); + + // No impact on session resumption. + } + } + + /** + * The absence processing if a "renegotiation_info" extension is + * not present in the ClientHello handshake message. + */ + private static final + class CHRenegotiationInfoAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + ClientHelloMessage clientHello = (ClientHelloMessage)message; + + if (!shc.conContext.isNegotiated) { + // initial handshaking. + for (int id : clientHello.cipherSuiteIds) { + if (id == + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV.id) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Safe renegotiation, using the SCSV signgling"); + } + shc.conContext.secureRenegotiation = true; + return; + } + } + + if (!HandshakeContext.allowLegacyHelloMessages) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Failed to negotiate the use of secure renegotiation"); + } // otherwise, allow legacy hello message + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("Warning: No renegotiation " + + "indication in ClientHello, allow legacy ClientHello"); + } + + shc.conContext.secureRenegotiation = false; + } else if (shc.conContext.secureRenegotiation) { + // Require secure renegotiation, terminate the connection. + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Inconsistent secure renegotiation indication"); + } else { // renegotiation, not secure + if (HandshakeContext.allowUnsafeRenegotiation) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("Using insecure renegotiation"); + } + } else { + // Unsafe renegotiation should have been aborted in + // ealier processes. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Terminate insecure renegotiation"); + } + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsafe renegotiation is not allowed"); + } + } + } + } + + /** + * Network data producer of a "renegotiation_info" extension in + * the ServerHello handshake message. + */ + private static final + class SHRenegotiationInfoProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHRenegotiationInfoProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // In response to "renegotiation_info" extension request only. + RenegotiationInfoSpec requestedSpec = (RenegotiationInfoSpec) + shc.handshakeExtensions.get(CH_RENEGOTIATION_INFO); + if (requestedSpec == null && !shc.conContext.secureRenegotiation) { + // Ignore, no renegotiation_info extension or SCSV signgling + // requested. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Ignore unavailable renegotiation_info extension"); + } + return null; // ignore the extension + } + + if (!shc.conContext.secureRenegotiation) { + // Ignore, no secure renegotiation is negotiated. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "No secure renegotiation has been negotiated"); + } + return null; // ignore the extension + } + + if (!shc.conContext.isNegotiated) { + // initial handshaking. + // + // If this is the initial handshake for a connection, then the + // "renegotiated_connection" field is of zero length in both + // the ClientHello and the ServerHello. [RFC 5746] + byte[] extData = new byte[] { 0x00 }; + + // The conContext.client/serverVerifyData will be used for + // further processing, so it does not matter to save whatever + // in the RenegotiationInfoSpec object. + shc.handshakeExtensions.put( + SH_RENEGOTIATION_INFO, RenegotiationInfoSpec.NOMINAL); + + return extData; + } else { + // secure renegotiation + // + // For secure renegotiation, the server MUST include a + // "renegotiation_info" extension containing the saved + // client_verify_data and server_verify_data in the ServerHello. + int infoLen = shc.conContext.clientVerifyData.length + + shc.conContext.serverVerifyData.length; + byte[] extData = new byte[infoLen + 1]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt8(m, infoLen); + m.put(shc.conContext.clientVerifyData); + m.put(shc.conContext.serverVerifyData); + + // The conContext.client/serverVerifyData will be used for + // further processing, so it does not matter to save whatever + // in the RenegotiationInfoSpec object. + shc.handshakeExtensions.put( + SH_RENEGOTIATION_INFO, RenegotiationInfoSpec.NOMINAL); + + return extData; + } + } + } + + /** + * Network data consumer of a "renegotiation_info" extension in + * the ServerHello handshake message. + */ + private static final + class SHRenegotiationInfoConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHRenegotiationInfoConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to the client renegotiation_info extension request + // or SCSV signling, which is mandatory for ClientHello message. + RenegotiationInfoSpec requestedSpec = (RenegotiationInfoSpec) + chc.handshakeExtensions.get(CH_RENEGOTIATION_INFO); + if (requestedSpec == null && + !chc.activeCipherSuites.contains( + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Missing renegotiation_info and SCSV detected in " + + "ClientHello"); + } + + // Parse the extension. + RenegotiationInfoSpec spec; + try { + spec = new RenegotiationInfoSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + + if (!chc.conContext.isNegotiated) { // initial handshake + // If the extension is present, set the secure_renegotiation + // flag to TRUE. The client MUST then verify that the + // length of the "renegotiated_connection" field is zero, + // and if it is not, MUST abort the handshake (by sending + // a fatal handshake_failure alert). [RFC 5746] + if (spec.renegotiatedConnection.length != 0) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid renegotiation_info in ServerHello: " + + "not empty renegotiated_connection"); + } + + chc.conContext.secureRenegotiation = true; + } else { // renegotiation + // The client MUST then verify that the first half of the + // "renegotiated_connection" field is equal to the saved + // client_verify_data value, and the second half is equal to the + // saved server_verify_data value. If they are not, the client + // MUST abort the handshake. [RFC 5746] + int infoLen = chc.conContext.clientVerifyData.length + + chc.conContext.serverVerifyData.length; + if (spec.renegotiatedConnection.length != infoLen) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid renegotiation_info in ServerHello: " + + "invalid renegotiated_connection length (" + + spec.renegotiatedConnection.length + ")"); + } + + byte[] cvd = chc.conContext.clientVerifyData; + if (!Arrays.equals(spec.renegotiatedConnection, + 0, cvd.length, cvd, 0, cvd.length)) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid renegotiation_info in ServerHello: " + + "unmatched client_verify_data value"); + } + byte[] svd = chc.conContext.serverVerifyData; + if (!Arrays.equals(spec.renegotiatedConnection, + cvd.length, infoLen, svd, 0, svd.length)) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid renegotiation_info in ServerHello: " + + "unmatched server_verify_data value"); + } + } + + // Update the context. + chc.handshakeExtensions.put( + SH_RENEGOTIATION_INFO, RenegotiationInfoSpec.NOMINAL); + + // No impact on session resumption. + } + } + + /** + * The absence processing if a "renegotiation_info" extension is + * not present in the ServerHello handshake message. + */ + private static final + class SHRenegotiationInfoAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to the client renegotiation_info extension request + // or SCSV signling, which is mandatory for ClientHello message. + RenegotiationInfoSpec requestedSpec = (RenegotiationInfoSpec) + chc.handshakeExtensions.get(CH_RENEGOTIATION_INFO); + if (requestedSpec == null && + !chc.activeCipherSuites.contains( + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV)) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Missing renegotiation_info and SCSV detected in " + + "ClientHello"); + } + + if (!chc.conContext.isNegotiated) { + // initial handshaking. + if (!HandshakeContext.allowLegacyHelloMessages) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Failed to negotiate the use of secure renegotiation"); + } // otherwise, allow legacy hello message + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("Warning: No renegotiation " + + "indication in ServerHello, allow legacy ServerHello"); + } + + chc.conContext.secureRenegotiation = false; + } else if (chc.conContext.secureRenegotiation) { + // Require secure renegotiation, terminate the connection. + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Inconsistent secure renegotiation indication"); + } else { // renegotiation, not secure + if (HandshakeContext.allowUnsafeRenegotiation) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("Using insecure renegotiation"); + } + } else { + // Unsafe renegotiation should have been aborted in + // ealier processes. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Terminate insecure renegotiation"); + } + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Unsafe renegotiation is not allowed"); + } + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RenegotiationInfoExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RenegotiationInfoExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RenegotiationInfoExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RenegotiationInfoExtension.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; - -import javax.net.ssl.SSLProtocolException; - -/* - * For secure renegotiation, RFC5746 defines a new TLS extension, - * "renegotiation_info" (with extension type 0xff01), which contains a - * cryptographic binding to the enclosing TLS connection (if any) for - * which the renegotiation is being performed. The "extension data" - * field of this extension contains a "RenegotiationInfo" structure: - * - * struct { - * opaque renegotiated_connection<0..255>; - * } RenegotiationInfo; - */ -final class RenegotiationInfoExtension extends HelloExtension { - private final byte[] renegotiated_connection; - - RenegotiationInfoExtension(byte[] clientVerifyData, - byte[] serverVerifyData) { - super(ExtensionType.EXT_RENEGOTIATION_INFO); - - if (clientVerifyData.length != 0) { - renegotiated_connection = - new byte[clientVerifyData.length + serverVerifyData.length]; - System.arraycopy(clientVerifyData, 0, renegotiated_connection, - 0, clientVerifyData.length); - - if (serverVerifyData.length != 0) { - System.arraycopy(serverVerifyData, 0, renegotiated_connection, - clientVerifyData.length, serverVerifyData.length); - } - } else { - // ignore both the client and server verify data. - renegotiated_connection = new byte[0]; - } - } - - RenegotiationInfoExtension(HandshakeInStream s, int len) - throws IOException { - super(ExtensionType.EXT_RENEGOTIATION_INFO); - - // check the extension length - if (len < 1) { - throw new SSLProtocolException("Invalid " + type + " extension"); - } - - int renegoInfoDataLen = s.getInt8(); - if (renegoInfoDataLen + 1 != len) { // + 1 = the byte we just read - throw new SSLProtocolException("Invalid " + type + " extension"); - } - - renegotiated_connection = new byte[renegoInfoDataLen]; - if (renegoInfoDataLen != 0) { - s.read(renegotiated_connection, 0, renegoInfoDataLen); - } - } - - - // Length of the encoded extension, including the type and length fields - @Override - int length() { - return 5 + renegotiated_connection.length; - } - - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - s.putInt16(renegotiated_connection.length + 1); - s.putBytes8(renegotiated_connection); - } - - boolean isEmpty() { - return renegotiated_connection.length == 0; - } - - byte[] getRenegotiatedConnection() { - return renegotiated_connection; - } - - @Override - public String toString() { - return "Extension " + type + ", renegotiated_connection: " + - (renegotiated_connection.length == 0 ? "<empty>" : - Debug.toString(renegotiated_connection)); - } - -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RSAClientKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,247 +23,299 @@ * questions. */ - package sun.security.ssl; -import java.io.*; -import java.security.*; - -import javax.crypto.*; - -import javax.net.ssl.*; - -import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec; -import sun.security.util.KeyUtil; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.text.MessageFormat; +import java.util.Locale; +import javax.crypto.SecretKey; +import sun.security.ssl.RSAKeyExchange.EphemeralRSACredentials; +import sun.security.ssl.RSAKeyExchange.EphemeralRSAPossession; +import sun.security.ssl.RSAKeyExchange.RSAPremasterSecret; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.X509Authentication.X509Credentials; +import sun.security.ssl.X509Authentication.X509Possession; +import sun.security.util.HexDumpEncoder; /** - * This is the client key exchange message (CLIENT --> SERVER) used with - * all RSA key exchanges; it holds the RSA-encrypted pre-master secret. - * - * The message is encrypted using PKCS #1 block type 02 encryption with the - * server's public key. The padding and resulting message size is a function - * of this server's public key modulus size, but the pre-master secret is - * always exactly 48 bytes. - * + * Pack of the "ClientKeyExchange" handshake message. */ -final class RSAClientKeyExchange extends HandshakeMessage { +final class RSAClientKeyExchange { + static final SSLConsumer rsaHandshakeConsumer = + new RSAClientKeyExchangeConsumer(); + static final HandshakeProducer rsaHandshakeProducer = + new RSAClientKeyExchangeProducer(); - /* - * The following field values were encrypted with the server's public - * key (or temp key from server key exchange msg) and are presented - * here in DECRYPTED form. + /** + * The RSA ClientKeyExchange handshake message. */ - private ProtocolVersion protocolVersion; // preMaster [0,1] - SecretKey preMaster; - private byte[] encrypted; // same size as public modulus - - /* - * Client randomly creates a pre-master secret and encrypts it - * using the server's RSA public key; only the server can decrypt - * it, using its RSA private key. Result is the same size as the - * server's public key, and uses PKCS #1 block format 02. - */ - @SuppressWarnings("deprecation") - RSAClientKeyExchange(ProtocolVersion protocolVersion, - ProtocolVersion maxVersion, - SecureRandom generator, PublicKey publicKey) throws IOException { - if (publicKey.getAlgorithm().equals("RSA") == false) { - throw new SSLKeyException("Public key not of type RSA: " + - publicKey.getAlgorithm()); + private static final + class RSAClientKeyExchangeMessage extends HandshakeMessage { + final int protocolVersion; + final boolean useTLS10PlusSpec; + final byte[] encrypted; + + RSAClientKeyExchangeMessage(HandshakeContext context, + RSAPremasterSecret premaster, + PublicKey publicKey) throws GeneralSecurityException { + super(context); + this.protocolVersion = context.clientHelloVersion; + this.encrypted = premaster.getEncoded( + publicKey, context.sslContext.getSecureRandom()); + this.useTLS10PlusSpec = ProtocolVersion.useTLS10PlusSpec( + protocolVersion, context.sslContext.isDTLS()); + } + + RSAClientKeyExchangeMessage(HandshakeContext context, + ByteBuffer m) throws IOException { + super(context); + + if (m.remaining() < 2) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid RSA ClientKeyExchange message: insufficient data"); + } + + this.protocolVersion = context.clientHelloVersion; + this.useTLS10PlusSpec = ProtocolVersion.useTLS10PlusSpec( + protocolVersion, context.sslContext.isDTLS()); + if (useTLS10PlusSpec) { + this.encrypted = Record.getBytes16(m); + } else { // SSL 3.0 + this.encrypted = new byte[m.remaining()]; + m.get(encrypted); + } } - this.protocolVersion = protocolVersion; - try { - String s = protocolVersion.useTLS12PlusSpec() ? - "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret"; - KeyGenerator kg = JsseJce.getKeyGenerator(s); - kg.init(new TlsRsaPremasterSecretParameterSpec( - maxVersion.v, protocolVersion.v), generator); - preMaster = kg.generateKey(); - - Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); - cipher.init(Cipher.WRAP_MODE, publicKey, generator); - encrypted = cipher.wrap(preMaster); - } catch (GeneralSecurityException e) { - throw (SSLKeyException)new SSLKeyException - ("RSA premaster secret error").initCause(e); + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.CLIENT_KEY_EXCHANGE; } - } - /* - * Retrieving the cipher's provider name for the debug purposes - * can throw an exception by itself. - */ - private static String safeProviderName(Cipher cipher) { - try { - return cipher.getProvider().toString(); - } catch (Exception e) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Retrieving The Cipher provider name" + - " caused exception " + e.getMessage()); + @Override + public int messageLength() { + if (useTLS10PlusSpec) { + return encrypted.length + 2; + } else { + return encrypted.length; } } - try { - return cipher.toString() + " (provider name not available)"; - } catch (Exception e) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Retrieving The Cipher name" + - " caused exception " + e.getMessage()); + + @Override + public void send(HandshakeOutStream hos) throws IOException { + if (useTLS10PlusSpec) { + hos.putBytes16(encrypted); + } else { + hos.write(encrypted); } } - return "(cipher/provider names not available)"; + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"RSA ClientKeyExchange\": '{'\n" + + " \"client_version\": {0}\n" + + " \"encncrypted\": '{'\n" + + "{1}\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + ProtocolVersion.nameOf(protocolVersion), + Utilities.indent( + hexEncoder.encodeBuffer(encrypted), " "), + }; + return messageFormat.format(messageFields); + } } - /* - * Server gets the PKCS #1 (block format 02) data, decrypts - * it with its private key. + /** + * The RSA "ClientKeyExchange" handshake message producer. */ - @SuppressWarnings("deprecation") - RSAClientKeyExchange(ProtocolVersion currentVersion, - ProtocolVersion maxVersion, - SecureRandom generator, HandshakeInStream input, - int messageSize, PrivateKey privateKey) throws IOException { - - if (privateKey.getAlgorithm().equals("RSA") == false) { - throw new SSLKeyException("Private key not of type RSA: " + - privateKey.getAlgorithm()); - } + private static final + class RSAClientKeyExchangeProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private RSAClientKeyExchangeProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // This happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + EphemeralRSACredentials rsaCredentials = null; + X509Credentials x509Credentials = null; + for (SSLCredentials credential : chc.handshakeCredentials) { + if (credential instanceof EphemeralRSACredentials) { + rsaCredentials = (EphemeralRSACredentials)credential; + if (x509Credentials != null) { + break; + } + } else if (credential instanceof X509Credentials) { + x509Credentials = (X509Credentials)credential; + if (rsaCredentials != null) { + break; + } + } + } - if (currentVersion.useTLS10PlusSpec()) { - encrypted = input.getBytes16(); - } else { - encrypted = new byte [messageSize]; - if (input.read(encrypted) != messageSize) { - throw new SSLProtocolException( - "SSL: read PreMasterSecret: short read"); + if (rsaCredentials == null && x509Credentials == null) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No RSA credentials negotiated for client key exchange"); } - } - byte[] encoded = null; - try { - boolean needFailover = false; - Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); + PublicKey publicKey = (rsaCredentials != null) ? + rsaCredentials.popPublicKey : x509Credentials.popPublicKey; + if (!publicKey.getAlgorithm().equals("RSA")) { // unlikely + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Not RSA public key for client key exchange"); + } + + RSAPremasterSecret premaster; + RSAClientKeyExchangeMessage ckem; try { - // Try UNWRAP_MODE mode firstly. - cipher.init(Cipher.UNWRAP_MODE, privateKey, - new TlsRsaPremasterSecretParameterSpec( - maxVersion.v, currentVersion.v), - generator); - - // The provider selection can be delayed, please don't call - // any Cipher method before the call to Cipher.init(). - needFailover = !KeyUtil.isOracleJCEProvider( - cipher.getProvider().getName()); - } catch (InvalidKeyException | UnsupportedOperationException iue) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("The Cipher provider " - + safeProviderName(cipher) - + " caused exception: " + iue.getMessage()); - } + premaster = RSAPremasterSecret.createPremasterSecret(chc); + chc.handshakePossessions.add(premaster); + ckem = new RSAClientKeyExchangeMessage( + chc, premaster, publicKey); + } catch (GeneralSecurityException gse) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Cannot generate RSA premaster secret", gse); - needFailover = true; + return null; // make the compiler happy + } + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced RSA ClientKeyExchange handshake message", ckem); } - if (needFailover) { - // The cipher might be spoiled by unsuccessful call to init(), - // so request a fresh instance - cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); - - // Use DECRYPT_MODE and dispose the previous initialization. - cipher.init(Cipher.DECRYPT_MODE, privateKey); - boolean failed = false; - try { - encoded = cipher.doFinal(encrypted); - } catch (BadPaddingException bpe) { - // Note: encoded == null - failed = true; - } - encoded = KeyUtil.checkTlsPreMasterSecretKey( - maxVersion.v, currentVersion.v, - generator, encoded, failed); - preMaster = generatePreMasterSecret( - maxVersion.v, currentVersion.v, - encoded, generator); + // Output the handshake message. + ckem.write(chc.handshakeOutput); + chc.handshakeOutput.flush(); + + // update the states + SSLKeyExchange ke = SSLKeyExchange.valueOf( + chc.negotiatedCipherSuite.keyExchange, + chc.negotiatedProtocol); + if (ke == null) { // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key exchange type"); } else { - // the cipher should have been initialized - preMaster = (SecretKey)cipher.unwrap(encrypted, - "TlsRsaPremasterSecret", Cipher.SECRET_KEY); - } - } catch (InvalidKeyException ibk) { - // the message is too big to process with RSA - throw new SSLException( - "Unable to process PreMasterSecret", ibk); - } catch (Exception e) { - // unlikely to happen, otherwise, must be a provider exception - if (debug != null && Debug.isOn("handshake")) { - System.out.println("RSA premaster secret decryption error:"); - e.printStackTrace(System.out); + SSLKeyDerivation masterKD = ke.createKeyDerivation(chc); + SecretKey masterSecret = + masterKD.deriveKey("MasterSecret", null); + + // update the states + chc.handshakeSession.setMasterSecret(masterSecret); + SSLTrafficKeyDerivation kd = + SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol); + if (kd == null) { // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + chc.negotiatedProtocol); + } else { + chc.handshakeKeyDerivation = + kd.createKeyDerivation(chc, masterSecret); + } } - throw new RuntimeException("Could not generate dummy secret", e); + + // The handshake message has been delivered. + return null; } } - // generate a premaster secret with the specified version number - @SuppressWarnings("deprecation") - private static SecretKey generatePreMasterSecret( - int clientVersion, int serverVersion, - byte[] encodedSecret, SecureRandom generator) { - - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Generating a premaster secret"); - } + /** + * The RSA "ClientKeyExchange" handshake message consumer. + */ + private static final + class RSAClientKeyExchangeConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private RSAClientKeyExchangeConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + EphemeralRSAPossession rsaPossession = null; + X509Possession x509Possession = null; + for (SSLPossession possession : shc.handshakePossessions) { + if (possession instanceof EphemeralRSAPossession) { + rsaPossession = (EphemeralRSAPossession)possession; + break; + } else if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + if (rsaPossession != null) { + break; + } + } + } - try { - String s = ((clientVersion >= ProtocolVersion.TLS12.v) ? - "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret"); - KeyGenerator kg = JsseJce.getKeyGenerator(s); - kg.init(new TlsRsaPremasterSecretParameterSpec( - clientVersion, serverVersion, encodedSecret), - generator); - return kg.generateKey(); - } catch (InvalidAlgorithmParameterException | - NoSuchAlgorithmException iae) { - // unlikely to happen, otherwise, must be a provider exception - if (debug != null && Debug.isOn("handshake")) { - System.out.println("RSA premaster secret generation error:"); - iae.printStackTrace(System.out); + if (rsaPossession == null && x509Possession == null) { // unlikely + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No RSA possessions negotiated for client key exchange"); } - throw new RuntimeException("Could not generate premaster secret", iae); - } - } - @Override - int messageType() { - return ht_client_key_exchange; - } + PrivateKey privateKey = (rsaPossession != null) ? + rsaPossession.popPrivateKey : x509Possession.popPrivateKey; + if (!privateKey.getAlgorithm().equals("RSA")) { // unlikely + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Not RSA private key for client key exchange"); + } - @Override - int messageLength() { - if (protocolVersion.useTLS10PlusSpec()) { - return encrypted.length + 2; - } else { - return encrypted.length; - } - } + RSAClientKeyExchangeMessage ckem = + new RSAClientKeyExchangeMessage(shc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming RSA ClientKeyExchange handshake message", ckem); + } - @Override - void send(HandshakeOutStream s) throws IOException { - if (protocolVersion.useTLS10PlusSpec()) { - s.putBytes16(encrypted); - } else { - s.write(encrypted); - } - } + // create the credentials + RSAPremasterSecret premaster; + try { + premaster = + RSAPremasterSecret.decode(shc, privateKey, ckem.encrypted); + shc.handshakeCredentials.add(premaster); + } catch (GeneralSecurityException gse) { + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Cannot decode RSA premaster secret", gse); + } - @Override - void print(PrintStream s) throws IOException { - String version = "version not available/extractable"; - - byte[] ba = preMaster.getEncoded(); - if (ba != null && ba.length >= 2) { - version = ProtocolVersion.valueOf(ba[0], ba[1]).name; + // update the states + SSLKeyExchange ke = SSLKeyExchange.valueOf( + shc.negotiatedCipherSuite.keyExchange, + shc.negotiatedProtocol); + if (ke == null) { // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key exchange type"); + } else { + SSLKeyDerivation masterKD = ke.createKeyDerivation(shc); + SecretKey masterSecret = + masterKD.deriveKey("MasterSecret", null); + + // update the states + shc.handshakeSession.setMasterSecret(masterSecret); + SSLTrafficKeyDerivation kd = + SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol); + if (kd == null) { // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + shc.negotiatedProtocol); + } else { + shc.handshakeKeyDerivation = + kd.createKeyDerivation(shc, masterSecret); + } + } } - - s.println("*** ClientKeyExchange, RSA PreMasterSecret, " + version); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RSAKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,313 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.security.GeneralSecurityException; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.KeyPair; +import java.security.NoSuchAlgorithmException; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.AlgorithmParameterSpec; +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; +import javax.net.ssl.SSLHandshakeException; +import sun.security.internal.spec.TlsRsaPremasterSecretParameterSpec; +import sun.security.util.KeyUtil; + +final class RSAKeyExchange { + static final SSLPossessionGenerator poGenerator = + new EphemeralRSAPossessionGenerator(); + static final SSLKeyAgreementGenerator kaGenerator = + new RSAKAGenerator(); + + static final class EphemeralRSAPossession implements SSLPossession { + // Proof of possession of the private key corresponding to the public + // key for which a certificate is being provided for authentication. + final RSAPublicKey popPublicKey; + final PrivateKey popPrivateKey; + + EphemeralRSAPossession(PrivateKey popPrivateKey, + RSAPublicKey popPublicKey) { + this.popPublicKey = popPublicKey; + this.popPrivateKey = popPrivateKey; + } + } + + static final class EphemeralRSACredentials implements SSLCredentials { + final RSAPublicKey popPublicKey; + + EphemeralRSACredentials(RSAPublicKey popPublicKey) { + this.popPublicKey = popPublicKey; + } + } + + private static final class EphemeralRSAPossessionGenerator + implements SSLPossessionGenerator { + // Prevent instantiation of this class. + private EphemeralRSAPossessionGenerator() { + // blank + } + + @Override + public SSLPossession createPossession(HandshakeContext context) { + try { + EphemeralKeyManager ekm = + context.sslContext.getEphemeralKeyManager(); + KeyPair kp = ekm.getRSAKeyPair( + true, context.sslContext.getSecureRandom()); + if (kp != null) { + return new EphemeralRSAPossession( + kp.getPrivate(), (RSAPublicKey)kp.getPublic()); + } else { + // Could not generate the ephemeral key, ignore. + return null; + } + } catch (RuntimeException rte) { + // Could not determine keylength, ignore. + return null; + } + } + } + + static final + class RSAPremasterSecret implements SSLPossession, SSLCredentials { + final SecretKey premasterSecret; + + RSAPremasterSecret(SecretKey premasterSecret) { + this.premasterSecret = premasterSecret; + } + + byte[] getEncoded(PublicKey publicKey, + SecureRandom secureRandom) throws GeneralSecurityException { + Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); + cipher.init(Cipher.WRAP_MODE, publicKey, secureRandom); + return cipher.wrap(premasterSecret); + } + + @SuppressWarnings("deprecation") + static RSAPremasterSecret createPremasterSecret( + ClientHandshakeContext chc) throws GeneralSecurityException { + String algorithm = chc.negotiatedProtocol.useTLS12PlusSpec() ? + "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret"; + KeyGenerator kg = JsseJce.getKeyGenerator(algorithm); + TlsRsaPremasterSecretParameterSpec spec = + new TlsRsaPremasterSecretParameterSpec( + chc.clientHelloVersion, + chc.negotiatedProtocol.id); + kg.init(spec, chc.sslContext.getSecureRandom()); + + return new RSAPremasterSecret(kg.generateKey()); + } + + @SuppressWarnings("deprecation") + static RSAPremasterSecret decode(ServerHandshakeContext shc, + PrivateKey privateKey, + byte[] encrypted) throws GeneralSecurityException { + + byte[] encoded = null; + boolean needFailover = false; + Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); + try { + // Try UNWRAP_MODE mode firstly. + cipher.init(Cipher.UNWRAP_MODE, privateKey, + new TlsRsaPremasterSecretParameterSpec( + shc.clientHelloVersion, + shc.negotiatedProtocol.id), + shc.sslContext.getSecureRandom()); + + // The provider selection can be delayed, please don't call + // any Cipher method before the call to Cipher.init(). + needFailover = !KeyUtil.isOracleJCEProvider( + cipher.getProvider().getName()); + } catch (InvalidKeyException | UnsupportedOperationException iue) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("The Cipher provider " + + safeProviderName(cipher) + + " caused exception: " + iue.getMessage()); + } + + needFailover = true; + } + + SecretKey preMaster; + if (needFailover) { + // The cipher might be spoiled by unsuccessful call to init(), + // so request a fresh instance + cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); + + // Use DECRYPT_MODE and dispose the previous initialization. + cipher.init(Cipher.DECRYPT_MODE, privateKey); + boolean failed = false; + try { + encoded = cipher.doFinal(encrypted); + } catch (BadPaddingException bpe) { + // Note: encoded == null + failed = true; + } + encoded = KeyUtil.checkTlsPreMasterSecretKey( + shc.clientHelloVersion, shc.negotiatedProtocol.id, + shc.sslContext.getSecureRandom(), encoded, failed); + preMaster = generatePremasterSecret( + shc.clientHelloVersion, shc.negotiatedProtocol.id, + encoded, shc.sslContext.getSecureRandom()); + } else { + // the cipher should have been initialized + preMaster = (SecretKey)cipher.unwrap(encrypted, + "TlsRsaPremasterSecret", Cipher.SECRET_KEY); + } + + return new RSAPremasterSecret(preMaster); + } + + /* + * Retrieving the cipher's provider name for the debug purposes + * can throw an exception by itself. + */ + private static String safeProviderName(Cipher cipher) { + try { + return cipher.getProvider().toString(); + } catch (Exception e) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Retrieving The Cipher provider name" + + " caused exception ", e); + } + } + try { + return cipher.toString() + " (provider name not available)"; + } catch (Exception e) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Retrieving The Cipher name" + + " caused exception ", e); + } + } + + return "(cipher/provider names not available)"; + } + + // generate a premaster secret with the specified version number + @SuppressWarnings("deprecation") + private static SecretKey generatePremasterSecret( + int clientVersion, int serverVersion, byte[] encodedSecret, + SecureRandom generator) throws GeneralSecurityException { + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Generating a premaster secret"); + } + + try { + String s = ((clientVersion >= ProtocolVersion.TLS12.id) ? + "SunTls12RsaPremasterSecret" : "SunTlsRsaPremasterSecret"); + KeyGenerator kg = JsseJce.getKeyGenerator(s); + kg.init(new TlsRsaPremasterSecretParameterSpec( + clientVersion, serverVersion, encodedSecret), + generator); + return kg.generateKey(); + } catch (InvalidAlgorithmParameterException | + NoSuchAlgorithmException iae) { + // unlikely to happen, otherwise, must be a provider exception + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("RSA premaster secret generation error:"); + iae.printStackTrace(System.out); + } + + throw new GeneralSecurityException( + "Could not generate premaster secret", iae); + } + } + } + + private static final + class RSAKAGenerator implements SSLKeyAgreementGenerator { + // Prevent instantiation of this class. + private RSAKAGenerator() { + // blank + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext context) throws IOException { + RSAPremasterSecret premaster = null; + if (context instanceof ClientHandshakeContext) { + for (SSLPossession possession : context.handshakePossessions) { + if (possession instanceof RSAPremasterSecret) { + premaster = (RSAPremasterSecret)possession; + break; + } + } + } else { + for (SSLCredentials credential : context.handshakeCredentials) { + if (credential instanceof RSAPremasterSecret) { + premaster = (RSAPremasterSecret)credential; + break; + } + } + } + + if (premaster == null) { + context.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No sufficient RSA key agreement parameters negotiated"); + } + + return new RSAKAKeyDerivation(context, premaster.premasterSecret); + } + + private static final + class RSAKAKeyDerivation implements SSLKeyDerivation { + private final HandshakeContext context; + private final SecretKey preMasterSecret; + + RSAKAKeyDerivation( + HandshakeContext context, SecretKey preMasterSecret) { + this.context = context; + this.preMasterSecret = preMasterSecret; + } + + @Override + public SecretKey deriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + SSLMasterKeyDerivation mskd = + SSLMasterKeyDerivation.valueOf( + context.negotiatedProtocol); + if (mskd == null) { + // unlikely + throw new SSLHandshakeException( + "No expected master key derivation for protocol: " + + context.negotiatedProtocol.name); + } + SSLKeyDerivation kd = mskd.createKeyDerivation( + context, preMasterSecret); + return kd.deriveKey("MasterSecret", params); + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RSAServerKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,340 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.math.BigInteger; +import java.nio.ByteBuffer; +import java.security.CryptoPrimitive; +import java.security.GeneralSecurityException; +import java.security.InvalidKeyException; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.Signature; +import java.security.SignatureException; +import java.security.interfaces.RSAPublicKey; +import java.security.spec.RSAPublicKeySpec; +import java.text.MessageFormat; +import java.util.EnumSet; +import java.util.Locale; +import sun.security.ssl.RSAKeyExchange.EphemeralRSACredentials; +import sun.security.ssl.RSAKeyExchange.EphemeralRSAPossession; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.X509Authentication.X509Credentials; +import sun.security.ssl.X509Authentication.X509Possession; +import sun.security.util.HexDumpEncoder; + +/** + * Pack of the ServerKeyExchange handshake message. + */ +final class RSAServerKeyExchange { + static final SSLConsumer rsaHandshakeConsumer = + new RSAServerKeyExchangeConsumer(); + static final HandshakeProducer rsaHandshakeProducer = + new RSAServerKeyExchangeProducer(); + + /** + * The ephemeral RSA ServerKeyExchange handshake message. + * + * Used for RSA_EXPORT, SSL 3.0 and TLS 1.0 only. + */ + private static final + class RSAServerKeyExchangeMessage extends HandshakeMessage { + // public key encapsulated in this message + private final byte[] modulus; // 1 to 2^16 - 1 bytes + private final byte[] exponent; // 1 to 2^16 - 1 bytes + + // signature bytes, none-null as no anonymous RSA key exchange. + private final byte[] paramsSignature; + + private RSAServerKeyExchangeMessage(HandshakeContext handshakeContext, + X509Possession x509Possession, + EphemeralRSAPossession rsaPossession) throws IOException { + super(handshakeContext); + + // This happens in server side only. + ServerHandshakeContext shc = + (ServerHandshakeContext)handshakeContext; + + RSAPublicKey publicKey = rsaPossession.popPublicKey; + RSAPublicKeySpec spec = JsseJce.getRSAPublicKeySpec(publicKey); + this.modulus = Utilities.toByteArray(spec.getModulus()); + this.exponent = Utilities.toByteArray(spec.getPublicExponent()); + byte[] signature = null; + try { + Signature signer = RSASignature.getInstance(); + signer.initSign(x509Possession.popPrivateKey, + shc.sslContext.getSecureRandom()); + updateSignature(signer, + shc.clientHelloRandom.randomBytes, + shc.serverHelloRandom.randomBytes); + signature = signer.sign(); + } catch (NoSuchAlgorithmException | + InvalidKeyException | SignatureException ex) { + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failed to sign ephemeral RSA parameters", ex); + } + + this.paramsSignature = signature; + } + + RSAServerKeyExchangeMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + + // This happens in client side only. + ClientHandshakeContext chc = + (ClientHandshakeContext)handshakeContext; + + this.modulus = Record.getBytes16(m); + this.exponent = Record.getBytes16(m); + this.paramsSignature = Record.getBytes16(m); + + X509Credentials x509Credentials = null; + for (SSLCredentials cd : chc.handshakeCredentials) { + if (cd instanceof X509Credentials) { + x509Credentials = (X509Credentials)cd; + break; + } + } + + if (x509Credentials == null) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No RSA credentials negotiated for server key exchange"); + } + + try { + Signature signer = RSASignature.getInstance(); + signer.initVerify(x509Credentials.popPublicKey); + updateSignature(signer, + chc.clientHelloRandom.randomBytes, + chc.serverHelloRandom.randomBytes); + if (!signer.verify(paramsSignature)) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Invalid signature of RSA ServerKeyExchange message"); + } + } catch (NoSuchAlgorithmException | + InvalidKeyException | SignatureException ex) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Failed to sign ephemeral RSA parameters", ex); + } + } + + @Override + SSLHandshake handshakeType() { + return SSLHandshake.SERVER_KEY_EXCHANGE; + } + + @Override + int messageLength() { + return 6 + modulus.length + exponent.length + + paramsSignature.length; + } + + @Override + void send(HandshakeOutStream hos) throws IOException { + hos.putBytes16(modulus); + hos.putBytes16(exponent); + hos.putBytes16(paramsSignature); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"RSA ServerKeyExchange\": '{'\n" + + " \"parameters\": '{'\n" + + " \"rsa_modulus\": '{'\n" + + "{0}\n" + + " '}',\n" + + " \"rsa_exponent\": '{'\n" + + "{1}\n" + + " '}'\n" + + " '}',\n" + + " \"digital signature\": '{'\n" + + " \"signature\": '{'\n" + + "{2}\n" + + " '}',\n" + + " '}'\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + Object[] messageFields = { + Utilities.indent( + hexEncoder.encodeBuffer(modulus), " "), + Utilities.indent( + hexEncoder.encodeBuffer(exponent), " "), + Utilities.indent( + hexEncoder.encodeBuffer(paramsSignature), " ") + }; + return messageFormat.format(messageFields); + } + + /* + * Hash the nonces and the ephemeral RSA public key. + */ + private void updateSignature(Signature signature, + byte[] clntNonce, byte[] svrNonce) throws SignatureException { + signature.update(clntNonce); + signature.update(svrNonce); + + signature.update((byte)(modulus.length >> 8)); + signature.update((byte)(modulus.length & 0x0ff)); + signature.update(modulus); + + signature.update((byte)(exponent.length >> 8)); + signature.update((byte)(exponent.length & 0x0ff)); + signature.update(exponent); + } + } + + /** + * The RSA "ServerKeyExchange" handshake message producer. + */ + private static final + class RSAServerKeyExchangeProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private RSAServerKeyExchangeProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + EphemeralRSAPossession rsaPossession = null; + X509Possession x509Possession = null; + for (SSLPossession possession : shc.handshakePossessions) { + if (possession instanceof EphemeralRSAPossession) { + rsaPossession = (EphemeralRSAPossession)possession; + if (x509Possession != null) { + break; + } + } else if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + if (rsaPossession != null) { + break; + } + } + } + + if (rsaPossession == null) { + // The X.509 certificate itself should be used for RSA_EXPORT + // key exchange. The ServerKeyExchange handshake message is + // not needed. + return null; + } else if (x509Possession == null) { + // unlikely + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No RSA certificate negotiated for server key exchange"); + } else if (!"RSA".equals( + x509Possession.popPrivateKey.getAlgorithm())) { + // unlikely + shc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "No X.509 possession can be used for " + + "ephemeral RSA ServerKeyExchange"); + } + + RSAServerKeyExchangeMessage skem = + new RSAServerKeyExchangeMessage( + shc, x509Possession, rsaPossession); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced RSA ServerKeyExchange handshake message", skem); + } + + // Output the handshake message. + skem.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The RSA "ServerKeyExchange" handshake message consumer. + */ + private static final + class RSAServerKeyExchangeConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private RSAServerKeyExchangeConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + RSAServerKeyExchangeMessage skem = + new RSAServerKeyExchangeMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming RSA ServerKeyExchange handshake message", skem); + } + + // + // validate + // + // check constraints of RSA PublicKey + RSAPublicKey publicKey; + try { + KeyFactory kf = JsseJce.getKeyFactory("RSA"); + RSAPublicKeySpec spec = new RSAPublicKeySpec( + new BigInteger(1, skem.modulus), + new BigInteger(1, skem.exponent)); + publicKey = (RSAPublicKey)kf.generatePublic(spec); + } catch (GeneralSecurityException gse) { + chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, + "Could not generate RSAPublicKey", gse); + + return; // make the compiler happy + } + + if (!chc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), publicKey)) { + chc.conContext.fatal(Alert.INSUFFICIENT_SECURITY, + "RSA ServerKeyExchange does not comply to " + + "algorithm constraints"); + } + + // + // update + // + chc.handshakeCredentials.add(new EphemeralRSACredentials(publicKey)); + + // + // produce + // + // Need no new handshake message producers here. + } + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RSASignature.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RSASignature.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/RSASignature.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/RSASignature.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,6 @@ * questions. */ - package sun.security.ssl; import java.security.*; @@ -46,71 +45,38 @@ * getInternalInstance() method. * * This class is not thread safe. - * */ public final class RSASignature extends SignatureSpi { - private final Signature rawRsa; - private MessageDigest md5, sha; - - // flag indicating if the MessageDigests are in reset state - private boolean isReset; + private final MessageDigest mdMD5; + private final MessageDigest mdSHA; public RSASignature() throws NoSuchAlgorithmException { super(); rawRsa = JsseJce.getSignature(JsseJce.SIGNATURE_RAWRSA); - isReset = true; + this.mdMD5 = JsseJce.getMessageDigest("MD5"); + this.mdSHA = JsseJce.getMessageDigest("SHA"); } /** - * Get an implementation for the RSA signature. Follows the standard - * JCA getInstance() model, so it return the implementation from the - * provider with the highest precedence, which may be this class. + * Get an implementation for the RSA signature. + * + * Follows the standard JCA getInstance() model, so it return the + * implementation from the provider with the highest precedence, + * which may be this class. */ static Signature getInstance() throws NoSuchAlgorithmException { return JsseJce.getSignature(JsseJce.SIGNATURE_SSLRSA); } - /** - * Get an internal implementation for the RSA signature. Used for RSA - * client authentication, which needs the ability to set the digests - * to externally provided values via the setHashes() method. - */ - static Signature getInternalInstance() - throws NoSuchAlgorithmException, NoSuchProviderException { - return Signature.getInstance(JsseJce.SIGNATURE_SSLRSA, "SunJSSE"); - } - - /** - * Set the MD5 and SHA hashes to the provided objects. - */ - @SuppressWarnings("deprecation") - static void setHashes(Signature sig, MessageDigest md5, MessageDigest sha) { - sig.setParameter("hashes", new MessageDigest[] {md5, sha}); - } - - /** - * Reset the MessageDigests unless they are already reset. - */ - private void reset() { - if (isReset == false) { - md5.reset(); - sha.reset(); - isReset = true; - } - } - - private static void checkNull(Key key) throws InvalidKeyException { - if (key == null) { - throw new InvalidKeyException("Key must not be null"); - } - } - @Override protected void engineInitVerify(PublicKey publicKey) throws InvalidKeyException { - checkNull(publicKey); - reset(); + if (publicKey == null) { + throw new InvalidKeyException("Public key must not be null"); + } + mdMD5.reset(); + mdSHA.reset(); rawRsa.initVerify(publicKey); } @@ -123,42 +89,31 @@ @Override protected void engineInitSign(PrivateKey privateKey, SecureRandom random) throws InvalidKeyException { - checkNull(privateKey); - reset(); - rawRsa.initSign(privateKey, random); - } - - // lazily initialize the MessageDigests - private void initDigests() { - if (md5 == null) { - md5 = JsseJce.getMD5(); - sha = JsseJce.getSHA(); + if (privateKey == null) { + throw new InvalidKeyException("Private key must not be null"); } + mdMD5.reset(); + mdSHA.reset(); + rawRsa.initSign(privateKey, random); } @Override protected void engineUpdate(byte b) { - initDigests(); - isReset = false; - md5.update(b); - sha.update(b); + mdMD5.update(b); + mdSHA.update(b); } @Override protected void engineUpdate(byte[] b, int off, int len) { - initDigests(); - isReset = false; - md5.update(b, off, len); - sha.update(b, off, len); + mdMD5.update(b, off, len); + mdSHA.update(b, off, len); } private byte[] getDigest() throws SignatureException { try { - initDigests(); byte[] data = new byte[36]; - md5.digest(data, 0, 16); - sha.digest(data, 16, 20); - isReset = true; + mdMD5.digest(data, 0, 16); + mdSHA.digest(data, 16, 20); return data; } catch (DigestException e) { // should never occur @@ -186,19 +141,9 @@ @Override @SuppressWarnings("deprecation") - protected void engineSetParameter(String param, Object value) - throws InvalidParameterException { - if (param.equals("hashes") == false) { - throw new InvalidParameterException - ("Parameter not supported: " + param); - } - if (value instanceof MessageDigest[] == false) { - throw new InvalidParameterException - ("value must be MessageDigest[]"); - } - MessageDigest[] digests = (MessageDigest[])value; - md5 = digests[0]; - sha = digests[1]; + protected void engineSetParameter(String param, + Object value) throws InvalidParameterException { + throw new InvalidParameterException("Parameters not supported"); } @Override @@ -211,8 +156,8 @@ @Override @SuppressWarnings("deprecation") - protected Object engineGetParameter(String param) - throws InvalidParameterException { + protected Object engineGetParameter( + String param) throws InvalidParameterException { throw new InvalidParameterException("Parameters not supported"); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerHandshakeContext.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerHandshakeContext.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerHandshakeContext.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerHandshakeContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.security.AlgorithmConstraints; +import java.security.AccessController; +import sun.security.util.LegacyAlgorithmConstraints; +import sun.security.action.GetLongAction; + +class ServerHandshakeContext extends HandshakeContext { + // To prevent the TLS renegotiation issues, by setting system property + // "jdk.tls.rejectClientInitiatedRenegotiation" to true, applications in + // server side can disable all client initiated SSL renegotiation + // regardless of the support of TLS protocols. + // + // By default, allow client initiated renegotiation. + static final boolean rejectClientInitiatedRenego = + Utilities.getBooleanProperty( + "jdk.tls.rejectClientInitiatedRenegotiation", false); + + // legacy algorithm constraints + static final AlgorithmConstraints legacyAlgorithmConstraints = + new LegacyAlgorithmConstraints( + LegacyAlgorithmConstraints.PROPERTY_TLS_LEGACY_ALGS, + new SSLAlgorithmDecomposer()); + + // temporary authentication information + SSLPossession interimAuthn; + + StatusResponseManager.StaplingParameters stapleParams; + CertificateMessage.CertificateEntry currentCertEntry; + private static final long DEFAULT_STATUS_RESP_DELAY = 5000L; + final long statusRespTimeout; + + + ServerHandshakeContext(SSLContextImpl sslContext, + TransportContext conContext) throws IOException { + super(sslContext, conContext); + long respTimeOut = AccessController.doPrivileged( + new GetLongAction("jdk.tls.stapling.responseTimeout", + DEFAULT_STATUS_RESP_DELAY)); + statusRespTimeout = respTimeOut >= 0 ? respTimeOut : + DEFAULT_STATUS_RESP_DELAY; + handshakeConsumers.put( + SSLHandshake.CLIENT_HELLO.id, SSLHandshake.CLIENT_HELLO); + } + + @Override + void kickstart() throws IOException { + if (!conContext.isNegotiated || kickstartMessageDelivered) { + return; + } + + SSLHandshake.kickstart(this); + kickstartMessageDelivered = true; + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerHandshaker.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,2344 +0,0 @@ -/* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - - -package sun.security.ssl; - -import java.io.*; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.security.*; -import java.security.cert.*; -import java.security.interfaces.*; -import java.security.spec.ECParameterSpec; -import java.math.BigInteger; -import java.util.function.BiFunction; - -import javax.crypto.SecretKey; -import javax.net.ssl.*; - -import sun.security.action.GetLongAction; -import sun.security.util.KeyUtil; -import sun.security.util.LegacyAlgorithmConstraints; -import sun.security.action.GetPropertyAction; -import sun.security.ssl.HandshakeMessage.*; -import sun.security.ssl.CipherSuite.*; -import sun.security.ssl.SignatureAndHashAlgorithm.*; -import static sun.security.ssl.CipherSuite.KeyExchange.*; - -/** - * ServerHandshaker does the protocol handshaking from the point - * of view of a server. It is driven asychronously by handshake messages - * as delivered by the parent Handshaker class, and also uses - * common functionality (e.g. key generation) that is provided there. - * - * @author David Brownell - */ -final class ServerHandshaker extends Handshaker { - - // The default number of milliseconds the handshaker will wait for - // revocation status responses. - private static final long DEFAULT_STATUS_RESP_DELAY = 5000; - - // is the server going to require the client to authenticate? - private ClientAuthType doClientAuth; - - // our authentication info - private X509Certificate[] certs; - private PrivateKey privateKey; - - private Object serviceCreds; - - // flag to check for clientCertificateVerify message - private boolean needClientVerify = false; - - /* - * For exportable ciphersuites using non-exportable key sizes, we use - * ephemeral RSA keys. We could also do anonymous RSA in the same way - * but there are no such ciphersuites currently defined. - */ - private PrivateKey tempPrivateKey; - private PublicKey tempPublicKey; - - /* - * For anonymous and ephemeral Diffie-Hellman key exchange, we use - * ephemeral Diffie-Hellman keys. - */ - private DHCrypt dh; - - // Helper for ECDH based key exchanges - private ECDHCrypt ecdh; - - // version request by the client in its ClientHello - // we remember it for the RSA premaster secret version check - private ProtocolVersion clientRequestedVersion; - - // client supported elliptic curves - private SupportedGroupsExtension requestedGroups; - - // the preferable signature algorithm used by ServerKeyExchange message - SignatureAndHashAlgorithm preferableSignatureAlgorithm; - - // Flag to use smart ephemeral DH key which size matches the corresponding - // authentication key - private static final boolean useSmartEphemeralDHKeys; - - // Flag to use legacy ephemeral DH key which size is 512 bits for - // exportable cipher suites, and 768 bits for others - private static final boolean useLegacyEphemeralDHKeys; - - // The customized ephemeral DH key size for non-exportable cipher suites. - private static final int customizedDHKeySize; - - // legacy algorithm constraints - private static final AlgorithmConstraints legacyAlgorithmConstraints = - new LegacyAlgorithmConstraints( - LegacyAlgorithmConstraints.PROPERTY_TLS_LEGACY_ALGS, - new SSLAlgorithmDecomposer()); - - private long statusRespTimeout; - - static { - String property = GetPropertyAction - .privilegedGetProperty("jdk.tls.ephemeralDHKeySize"); - if (property == null || property.length() == 0) { - useLegacyEphemeralDHKeys = false; - useSmartEphemeralDHKeys = false; - customizedDHKeySize = -1; - } else if ("matched".equals(property)) { - useLegacyEphemeralDHKeys = false; - useSmartEphemeralDHKeys = true; - customizedDHKeySize = -1; - } else if ("legacy".equals(property)) { - useLegacyEphemeralDHKeys = true; - useSmartEphemeralDHKeys = false; - customizedDHKeySize = -1; - } else { - useLegacyEphemeralDHKeys = false; - useSmartEphemeralDHKeys = false; - - try { - // DH parameter generation can be extremely slow, best to - // use one of the supported pre-computed DH parameters - // (see DHCrypt class). - customizedDHKeySize = Integer.parseUnsignedInt(property); - if (customizedDHKeySize < 1024 || customizedDHKeySize > 8192 || - (customizedDHKeySize & 0x3f) != 0) { - throw new IllegalArgumentException( - "Unsupported customized DH key size: " + - customizedDHKeySize + ". " + - "The key size must be multiple of 64, " + - "and can only range from 1024 to 8192 (inclusive)"); - } - } catch (NumberFormatException nfe) { - throw new IllegalArgumentException( - "Invalid system property jdk.tls.ephemeralDHKeySize"); - } - } - } - - /* - * Constructor ... use the keys found in the auth context. - */ - ServerHandshaker(SSLSocketImpl socket, SSLContextImpl context, - ProtocolList enabledProtocols, ClientAuthType clientAuth, - ProtocolVersion activeProtocolVersion, boolean isInitialHandshake, - boolean secureRenegotiation, - byte[] clientVerifyData, byte[] serverVerifyData) { - - super(socket, context, enabledProtocols, - (clientAuth != ClientAuthType.CLIENT_AUTH_NONE), false, - activeProtocolVersion, isInitialHandshake, secureRenegotiation, - clientVerifyData, serverVerifyData); - doClientAuth = clientAuth; - statusRespTimeout = AccessController.doPrivileged( - new GetLongAction("jdk.tls.stapling.responseTimeout", - DEFAULT_STATUS_RESP_DELAY)); - statusRespTimeout = statusRespTimeout >= 0 ? statusRespTimeout : - DEFAULT_STATUS_RESP_DELAY; - } - - /* - * Constructor ... use the keys found in the auth context. - */ - ServerHandshaker(SSLEngineImpl engine, SSLContextImpl context, - ProtocolList enabledProtocols, ClientAuthType clientAuth, - ProtocolVersion activeProtocolVersion, - boolean isInitialHandshake, boolean secureRenegotiation, - byte[] clientVerifyData, byte[] serverVerifyData, - boolean isDTLS) { - - super(engine, context, enabledProtocols, - (clientAuth != ClientAuthType.CLIENT_AUTH_NONE), false, - activeProtocolVersion, isInitialHandshake, secureRenegotiation, - clientVerifyData, serverVerifyData, isDTLS); - doClientAuth = clientAuth; - statusRespTimeout = AccessController.doPrivileged( - new GetLongAction("jdk.tls.stapling.responseTimeout", - DEFAULT_STATUS_RESP_DELAY)); - statusRespTimeout = statusRespTimeout >= 0 ? statusRespTimeout : - DEFAULT_STATUS_RESP_DELAY; - } - - /* - * As long as handshaking has not started, we can change - * whether client authentication is required. Otherwise, - * we will need to wait for the next handshake. - */ - void setClientAuth(ClientAuthType clientAuth) { - doClientAuth = clientAuth; - } - - /* - * This routine handles all the server side handshake messages, one at - * a time. Given the message type (and in some cases the pending cipher - * spec) it parses the type-specific message. Then it calls a function - * that handles that specific message. - * - * It updates the state machine as each message is processed, and writes - * responses as needed using the connection in the constructor. - */ - @Override - void processMessage(byte type, int message_len) - throws IOException { - - // check the handshake state - handshakeState.check(type); - - switch (type) { - case HandshakeMessage.ht_client_hello: - ClientHello ch = new ClientHello(input, message_len, isDTLS); - handshakeState.update(ch, resumingSession); - - /* - * send it off for processing. - */ - this.clientHello(ch); - break; - - case HandshakeMessage.ht_certificate: - if (doClientAuth == ClientAuthType.CLIENT_AUTH_NONE) { - fatalSE(Alerts.alert_unexpected_message, - "client sent unsolicited cert chain"); - // NOTREACHED - } - CertificateMsg certificateMsg = new CertificateMsg(input); - handshakeState.update(certificateMsg, resumingSession); - this.clientCertificate(certificateMsg); - break; - - case HandshakeMessage.ht_client_key_exchange: - SecretKey preMasterSecret; - switch (keyExchange) { - case K_RSA: - case K_RSA_EXPORT: - /* - * The client's pre-master secret is decrypted using - * either the server's normal private RSA key, or the - * temporary one used for non-export or signing-only - * certificates/keys. - */ - RSAClientKeyExchange pms = new RSAClientKeyExchange( - protocolVersion, clientRequestedVersion, - sslContext.getSecureRandom(), input, - message_len, privateKey); - handshakeState.update(pms, resumingSession); - preMasterSecret = this.clientKeyExchange(pms); - break; - case K_DHE_RSA: - case K_DHE_DSS: - case K_DH_ANON: - /* - * The pre-master secret is derived using the normal - * Diffie-Hellman calculation. Note that the main - * protocol difference in these five flavors is in how - * the ServerKeyExchange message was constructed! - */ - DHClientKeyExchange dhcke = new DHClientKeyExchange(input); - handshakeState.update(dhcke, resumingSession); - preMasterSecret = this.clientKeyExchange(dhcke); - break; - case K_ECDH_RSA: - case K_ECDH_ECDSA: - case K_ECDHE_RSA: - case K_ECDHE_ECDSA: - case K_ECDH_ANON: - ECDHClientKeyExchange ecdhcke = - new ECDHClientKeyExchange(input); - handshakeState.update(ecdhcke, resumingSession); - preMasterSecret = this.clientKeyExchange(ecdhcke); - break; - default: - ClientKeyExchangeService p = - ClientKeyExchangeService.find(keyExchange.name); - if (p == null) { - throw new SSLProtocolException - ("Unrecognized key exchange: " + keyExchange); - } - byte[] encodedTicket = input.getBytes16(); - input.getBytes16(); - byte[] secret = input.getBytes16(); - ClientKeyExchange cke = p.createServerExchange(protocolVersion, - clientRequestedVersion, - sslContext.getSecureRandom(), - encodedTicket, - secret, - this.getAccSE(), serviceCreds); - handshakeState.update(cke, resumingSession); - preMasterSecret = this.clientKeyExchange(cke); - break; - } - - // - // All keys are calculated from the premaster secret - // and the exchanged nonces in the same way. - // - calculateKeys(preMasterSecret, clientRequestedVersion); - break; - - case HandshakeMessage.ht_certificate_verify: - CertificateVerify cvm = - new CertificateVerify(input, - getLocalSupportedSignAlgs(), protocolVersion); - handshakeState.update(cvm, resumingSession); - this.clientCertificateVerify(cvm); - - break; - - case HandshakeMessage.ht_finished: - Finished cfm = - new Finished(protocolVersion, input, cipherSuite); - handshakeState.update(cfm, resumingSession); - this.clientFinished(cfm); - - break; - - default: - throw new SSLProtocolException( - "Illegal server handshake msg, " + type); - } - - } - - - /* - * ClientHello presents the server with a bunch of options, to which the - * server replies with a ServerHello listing the ones which this session - * will use. If needed, it also writes its Certificate plus in some cases - * a ServerKeyExchange message. It may also write a CertificateRequest, - * to elicit a client certificate. - * - * All these messages are terminated by a ServerHelloDone message. In - * most cases, all this can be sent in a single Record. - */ - private void clientHello(ClientHello mesg) throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - // Reject client initiated renegotiation? - // - // If server side should reject client-initiated renegotiation, - // send an alert_handshake_failure fatal alert, not a no_renegotiation - // warning alert (no_renegotiation must be a warning: RFC 2246). - // no_renegotiation might seem more natural at first, but warnings - // are not appropriate because the sending party does not know how - // the receiving party will behave. This state must be treated as - // a fatal server condition. - // - // This will not have any impact on server initiated renegotiation. - if (rejectClientInitiatedRenego && !isInitialHandshake && - !serverHelloRequested) { - fatalSE(Alerts.alert_handshake_failure, - "Client initiated renegotiation is not allowed"); - } - - // check the server name indication if required - ServerNameExtension clientHelloSNIExt = (ServerNameExtension) - mesg.extensions.get(ExtensionType.EXT_SERVER_NAME); - if (!sniMatchers.isEmpty()) { - // we do not reject client without SNI extension - if (clientHelloSNIExt != null && - !clientHelloSNIExt.isMatched(sniMatchers)) { - fatalSE(Alerts.alert_unrecognized_name, - "Unrecognized server name indication"); - } - } - - // Does the message include security renegotiation indication? - boolean renegotiationIndicated = false; - - // check the TLS_EMPTY_RENEGOTIATION_INFO_SCSV - CipherSuiteList cipherSuites = mesg.getCipherSuites(); - if (cipherSuites.contains(CipherSuite.C_SCSV)) { - renegotiationIndicated = true; - if (isInitialHandshake) { - secureRenegotiation = true; - } else { - // abort the handshake with a fatal handshake_failure alert - if (secureRenegotiation) { - fatalSE(Alerts.alert_handshake_failure, - "The SCSV is present in a secure renegotiation"); - } else { - fatalSE(Alerts.alert_handshake_failure, - "The SCSV is present in a insecure renegotiation"); - } - } - } - - // check the "renegotiation_info" extension - RenegotiationInfoExtension clientHelloRI = (RenegotiationInfoExtension) - mesg.extensions.get(ExtensionType.EXT_RENEGOTIATION_INFO); - if (clientHelloRI != null) { - renegotiationIndicated = true; - if (isInitialHandshake) { - // verify the length of the "renegotiated_connection" field - if (!clientHelloRI.isEmpty()) { - // abort the handshake with a fatal handshake_failure alert - fatalSE(Alerts.alert_handshake_failure, - "The renegotiation_info field is not empty"); - } - - secureRenegotiation = true; - } else { - if (!secureRenegotiation) { - // unexpected RI extension for insecure renegotiation, - // abort the handshake with a fatal handshake_failure alert - fatalSE(Alerts.alert_handshake_failure, - "The renegotiation_info is present in a insecure " + - "renegotiation"); - } - - // verify the client_verify_data value - if (!MessageDigest.isEqual(clientVerifyData, - clientHelloRI.getRenegotiatedConnection())) { - fatalSE(Alerts.alert_handshake_failure, - "Incorrect verify data in ClientHello " + - "renegotiation_info message"); - } - } - } else if (!isInitialHandshake && secureRenegotiation) { - // if the connection's "secure_renegotiation" flag is set to TRUE - // and the "renegotiation_info" extension is not present, abort - // the handshake. - fatalSE(Alerts.alert_handshake_failure, - "Inconsistent secure renegotiation indication"); - } - - // if there is no security renegotiation indication or the previous - // handshake is insecure. - if (!renegotiationIndicated || !secureRenegotiation) { - if (isInitialHandshake) { - if (!allowLegacyHelloMessages) { - // abort the handshake with a fatal handshake_failure alert - fatalSE(Alerts.alert_handshake_failure, - "Failed to negotiate the use of secure renegotiation"); - } - - // continue with legacy ClientHello - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Warning: No renegotiation " + - "indication in ClientHello, allow legacy ClientHello"); - } - } else if (!allowUnsafeRenegotiation) { - // abort the handshake - if (activeProtocolVersion.useTLS10PlusSpec()) { - // respond with a no_renegotiation warning - warningSE(Alerts.alert_no_renegotiation); - - // invalidate the handshake so that the caller can - // dispose this object. - invalidated = true; - - // If there is still unread block in the handshake - // input stream, it would be truncated with the disposal - // and the next handshake message will become incomplete. - // - // However, according to SSL/TLS specifications, no more - // handshake message could immediately follow ClientHello - // or HelloRequest. But in case of any improper messages, - // we'd better check to ensure there is no remaining bytes - // in the handshake input stream. - if (input.available() > 0) { - fatalSE(Alerts.alert_unexpected_message, - "ClientHello followed by an unexpected " + - "handshake message"); - } - - return; - } else { - // For SSLv3, send the handshake_failure fatal error. - // Note that SSLv3 does not define a no_renegotiation - // alert like TLSv1. However we cannot ignore the message - // simply, otherwise the other side was waiting for a - // response that would never come. - fatalSE(Alerts.alert_handshake_failure, - "Renegotiation is not allowed"); - } - } else { // !isInitialHandshake && allowUnsafeRenegotiation - // continue with unsafe renegotiation. - if (debug != null && Debug.isOn("handshake")) { - System.out.println( - "Warning: continue with insecure renegotiation"); - } - } - } - - // check the "max_fragment_length" extension - MaxFragmentLengthExtension maxFragLenExt = (MaxFragmentLengthExtension) - mesg.extensions.get(ExtensionType.EXT_MAX_FRAGMENT_LENGTH); - if ((maxFragLenExt != null) && (maximumPacketSize != 0)) { - // Not yet consider the impact of IV/MAC/padding. - int estimatedMaxFragSize = maximumPacketSize; - if (isDTLS) { - estimatedMaxFragSize -= DTLSRecord.headerSize; - } else { - estimatedMaxFragSize -= SSLRecord.headerSize; - } - - if (maxFragLenExt.getMaxFragLen() > estimatedMaxFragSize) { - // For better interoperability, abort the maximum fragment - // length negotiation, rather than terminate the connection - // with a fatal alert. - maxFragLenExt = null; - - // fatalSE(Alerts.alert_illegal_parameter, - // "Not an allowed max_fragment_length value"); - } - } - - // check out the "extended_master_secret" extension - if (useExtendedMasterSecret) { - ExtendedMasterSecretExtension extendedMasterSecretExtension = - (ExtendedMasterSecretExtension)mesg.extensions.get( - ExtensionType.EXT_EXTENDED_MASTER_SECRET); - if (extendedMasterSecretExtension != null) { - requestedToUseEMS = true; - } else if (mesg.protocolVersion.useTLS10PlusSpec()) { - if (!allowLegacyMasterSecret) { - // For full handshake, if the server receives a ClientHello - // without the extension, it SHOULD abort the handshake if - // it does not wish to interoperate with legacy clients. - // - // As if extended master extension is required for full - // handshake, it MUST be used in abbreviated handshake too. - fatalSE(Alerts.alert_handshake_failure, - "Extended Master Secret extension is required"); - } - } - } - - // check the ALPN extension - ALPNExtension clientHelloALPN = (ALPNExtension) - mesg.extensions.get(ExtensionType.EXT_ALPN); - - // Use the application protocol callback when provided. - // Otherwise use the local list of application protocols. - boolean hasAPCallback = - ((engine != null && appProtocolSelectorSSLEngine != null) || - (conn != null && appProtocolSelectorSSLSocket != null)); - - if (!hasAPCallback) { - if ((clientHelloALPN != null) && (localApl.length > 0)) { - - // Intersect the requested and the locally supported, - // and save for later. - String negotiatedValue = null; - List<String> protocols = clientHelloALPN.getPeerAPs(); - - // Use server preference order - for (String ap : localApl) { - if (protocols.contains(ap)) { - negotiatedValue = ap; - break; - } - } - - if (negotiatedValue == null) { - fatalSE(Alerts.alert_no_application_protocol, - new SSLHandshakeException( - "No matching ALPN values")); - } - applicationProtocol = negotiatedValue; - - } else { - applicationProtocol = ""; - } - } // Otherwise, applicationProtocol will be set by the callback. - - session = null; // forget about the current session - // - // Here we go down either of two paths: (a) the fast one, where - // the client's asked to rejoin an existing session, and the server - // permits this; (b) the other one, where a new session is created. - // - if (mesg.sessionId.length() != 0) { - // client is trying to resume a session, let's see... - - SSLSessionImpl previous = ((SSLSessionContextImpl)sslContext - .engineGetServerSessionContext()) - .get(mesg.sessionId.getId()); - // - // Check if we can use the fast path, resuming a session. We - // can do so iff we have a valid record for that session, and - // the cipher suite for that session was on the list which the - // client requested, and if we're not forgetting any needed - // authentication on the part of the client. - // - if (previous != null) { - resumingSession = previous.isRejoinable(); - - if (resumingSession) { - ProtocolVersion oldVersion = previous.getProtocolVersion(); - // cannot resume session with different version - if (oldVersion != mesg.protocolVersion) { - resumingSession = false; - } - } - - if (resumingSession && useExtendedMasterSecret) { - if (requestedToUseEMS && - !previous.getUseExtendedMasterSecret()) { - // For abbreviated handshake request, If the original - // session did not use the "extended_master_secret" - // extension but the new ClientHello contains the - // extension, then the server MUST NOT perform the - // abbreviated handshake. Instead, it SHOULD continue - // with a full handshake. - resumingSession = false; - } else if (!requestedToUseEMS && - previous.getUseExtendedMasterSecret()) { - // For abbreviated handshake request, if the original - // session used the "extended_master_secret" extension - // but the new ClientHello does not contain it, the - // server MUST abort the abbreviated handshake. - fatalSE(Alerts.alert_handshake_failure, - "Missing Extended Master Secret extension " + - "on session resumption"); - } else if (!requestedToUseEMS && - !previous.getUseExtendedMasterSecret()) { - // For abbreviated handshake request, if neither the - // original session nor the new ClientHello uses the - // extension, the server SHOULD abort the handshake. - if (!allowLegacyResumption) { - fatalSE(Alerts.alert_handshake_failure, - "Missing Extended Master Secret extension " + - "on session resumption"); - } else { // Otherwise, continue with a full handshake. - resumingSession = false; - } - } - } - - // cannot resume session with different server name indication - if (resumingSession) { - List<SNIServerName> oldServerNames = - previous.getRequestedServerNames(); - if (clientHelloSNIExt != null) { - if (!clientHelloSNIExt.isIdentical(oldServerNames)) { - resumingSession = false; - } - } else if (!oldServerNames.isEmpty()) { - resumingSession = false; - } - - if (!resumingSession && - debug != null && Debug.isOn("handshake")) { - System.out.println( - "The requested server name indication " + - "is not identical to the previous one"); - } - } - - if (resumingSession && - (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUIRED)) { - try { - previous.getPeerPrincipal(); - } catch (SSLPeerUnverifiedException e) { - resumingSession = false; - } - } - - // validate subject identity - if (resumingSession) { - CipherSuite suite = previous.getSuite(); - ClientKeyExchangeService p = - ClientKeyExchangeService.find(suite.keyExchange.name); - if (p != null) { - Principal localPrincipal = previous.getLocalPrincipal(); - - if (p.isRelated( - false, getAccSE(), localPrincipal)) { - if (debug != null && Debug.isOn("session")) - System.out.println("Subject can" + - " provide creds for princ"); - } else { - resumingSession = false; - if (debug != null && Debug.isOn("session")) - System.out.println("Subject cannot" + - " provide creds for princ"); - } - } - } - - if (resumingSession) { - CipherSuite suite = previous.getSuite(); - // verify that the ciphersuite from the cached session - // is in the list of client requested ciphersuites and - // we have it enabled - if ((isNegotiable(suite) == false) || - (mesg.getCipherSuites().contains(suite) == false)) { - resumingSession = false; - } else { - // everything looks ok, set the ciphersuite - // this should be done last when we are sure we - // will resume - setCipherSuite(suite); - } - } - - if (resumingSession) { - session = previous; - if (debug != null && - (Debug.isOn("handshake") || Debug.isOn("session"))) { - System.out.println("%% Resuming " + session); - } - } - } - } // else client did not try to resume - - // cookie exchange - if (isDTLS && !resumingSession) { - HelloCookieManager hcMgr = sslContext.getHelloCookieManager(); - if ((mesg.cookie == null) || (mesg.cookie.length == 0) || - (!hcMgr.isValid(mesg))) { - - // - // Perform cookie exchange for DTLS handshaking if no cookie - // or the cookie is invalid in the ClientHello message. - // - HelloVerifyRequest m0 = new HelloVerifyRequest(hcMgr, mesg); - - if (debug != null && Debug.isOn("handshake")) { - m0.print(System.out); - } - - m0.write(output); - handshakeState.update(m0, resumingSession); - output.flush(); - - return; - } - } - - /* - * FIRST, construct the ServerHello using the options and priorities - * from the ClientHello. Update the (pending) cipher spec as we do - * so, and save the client's version to protect against rollback - * attacks. - * - * There are a bunch of minor tasks here, and one major one: deciding - * if the short or the full handshake sequence will be used. - */ - ServerHello m1 = new ServerHello(); - - clientRequestedVersion = mesg.protocolVersion; - - // select a proper protocol version. - ProtocolVersion selectedVersion = - selectProtocolVersion(clientRequestedVersion); - if (selectedVersion == null || - selectedVersion.v == ProtocolVersion.SSL20Hello.v) { - fatalSE(Alerts.alert_handshake_failure, - "Client requested protocol " + clientRequestedVersion + - " not enabled or not supported"); - } - - handshakeHash.protocolDetermined(selectedVersion); - setVersion(selectedVersion); - - m1.protocolVersion = protocolVersion; - - // - // random ... save client and server values for later use - // in computing the master secret (from pre-master secret) - // and thence the other crypto keys. - // - // NOTE: this use of three inputs to generating _each_ set - // of ciphers slows things down, but it does increase the - // security since each connection in the session can hold - // its own authenticated (and strong) keys. One could make - // creation of a session a rare thing... - // - clnt_random = mesg.clnt_random; - svr_random = new RandomCookie(sslContext.getSecureRandom()); - m1.svr_random = svr_random; - - // - // If client hasn't specified a session we can resume, start a - // new one and choose its cipher suite and compression options. - // Unless new session creation is disabled for this connection! - // - if (session == null) { - if (!enableNewSession) { - throw new SSLException("Client did not resume a session"); - } - - requestedGroups = (SupportedGroupsExtension) - mesg.extensions.get(ExtensionType.EXT_SUPPORTED_GROUPS); - - // We only need to handle the "signature_algorithm" extension - // for full handshakes and TLS 1.2 or later. - if (protocolVersion.useTLS12PlusSpec()) { - SignatureAlgorithmsExtension signAlgs = - (SignatureAlgorithmsExtension)mesg.extensions.get( - ExtensionType.EXT_SIGNATURE_ALGORITHMS); - if (signAlgs != null) { - Collection<SignatureAndHashAlgorithm> peerSignAlgs = - signAlgs.getSignAlgorithms(); - if (peerSignAlgs == null || peerSignAlgs.isEmpty()) { - throw new SSLHandshakeException( - "No peer supported signature algorithms"); - } - - Collection<SignatureAndHashAlgorithm> - supportedPeerSignAlgs = - SignatureAndHashAlgorithm.getSupportedAlgorithms( - algorithmConstraints, peerSignAlgs); - if (supportedPeerSignAlgs.isEmpty()) { - throw new SSLHandshakeException( - "No signature and hash algorithm in common"); - } - - setPeerSupportedSignAlgs(supportedPeerSignAlgs); - } // else, need to use peer implicit supported signature algs - } - - session = new SSLSessionImpl(protocolVersion, CipherSuite.C_NULL, - getLocalSupportedSignAlgs(), - sslContext.getSecureRandom(), - getHostAddressSE(), getPortSE(), - (requestedToUseEMS && - protocolVersion.useTLS10PlusSpec())); - - if (protocolVersion.useTLS12PlusSpec()) { - if (peerSupportedSignAlgs != null) { - session.setPeerSupportedSignatureAlgorithms( - peerSupportedSignAlgs); - } // else, we will set the implicit peer supported signature - // algorithms in chooseCipherSuite() - } - - // set the server name indication in the session - List<SNIServerName> clientHelloSNI = - Collections.<SNIServerName>emptyList(); - if (clientHelloSNIExt != null) { - clientHelloSNI = clientHelloSNIExt.getServerNames(); - } - session.setRequestedServerNames(clientHelloSNI); - - // set the handshake session - setHandshakeSessionSE(session); - - // choose cipher suite and corresponding private key - chooseCipherSuite(mesg); - - session.setSuite(cipherSuite); - session.setLocalPrivateKey(privateKey); - - // chooseCompression(mesg); - - // set the negotiated maximum fragment in the session - // - // The protocol version and cipher suite have been negotiated - // in previous processes. - if (maxFragLenExt != null) { - int maxFragLen = maxFragLenExt.getMaxFragLen(); - - // More check of the requested "max_fragment_length" extension. - if (maximumPacketSize != 0) { - int estimatedMaxFragSize = cipherSuite.calculatePacketSize( - maxFragLen, protocolVersion, isDTLS); - if (estimatedMaxFragSize > maximumPacketSize) { - // For better interoperability, abort the maximum - // fragment length negotiation, rather than terminate - // the connection with a fatal alert. - maxFragLenExt = null; - - // fatalSE(Alerts.alert_illegal_parameter, - // "Not an allowed max_fragment_length value"); - } - } - - if (maxFragLenExt != null) { - session.setNegotiatedMaxFragSize(maxFragLen); - } - } - - session.setMaximumPacketSize(maximumPacketSize); - } else { - // set the handshake session - setHandshakeSessionSE(session); - } - - if (protocolVersion.useTLS12PlusSpec()) { - handshakeHash.setFinishedAlg(cipherSuite.prfAlg.getPRFHashAlg()); - } - - m1.cipherSuite = cipherSuite; - m1.sessionId = session.getSessionId(); - m1.compression_method = session.getCompression(); - - if (secureRenegotiation) { - // For ServerHellos that are initial handshakes, then the - // "renegotiated_connection" field in "renegotiation_info" - // extension is of zero length. - // - // For ServerHellos that are renegotiating, this field contains - // the concatenation of client_verify_data and server_verify_data. - // - // Note that for initial handshakes, both the clientVerifyData - // variable and serverVerifyData variable are of zero length. - HelloExtension serverHelloRI = new RenegotiationInfoExtension( - clientVerifyData, serverVerifyData); - m1.extensions.add(serverHelloRI); - } - - if (!sniMatchers.isEmpty() && clientHelloSNIExt != null) { - // When resuming a session, the server MUST NOT include a - // server_name extension in the server hello. - if (!resumingSession) { - ServerNameExtension serverHelloSNI = new ServerNameExtension(); - m1.extensions.add(serverHelloSNI); - } - } - - if ((maxFragLenExt != null) && !resumingSession) { - // When resuming a session, the server MUST NOT include a - // max_fragment_length extension in the server hello. - // - // Otherwise, use the same value as the requested extension. - m1.extensions.add(maxFragLenExt); - } - - if (session.getUseExtendedMasterSecret()) { - m1.extensions.add(new ExtendedMasterSecretExtension()); - } - - StaplingParameters staplingParams = processStapling(mesg); - if (staplingParams != null) { - // We now can safely assert status_request[_v2] in our - // ServerHello, and know for certain that we can provide - // responses back to this client for this connection. - if (staplingParams.statusRespExt == - ExtensionType.EXT_STATUS_REQUEST) { - m1.extensions.add(new CertStatusReqExtension()); - } else if (staplingParams.statusRespExt == - ExtensionType.EXT_STATUS_REQUEST_V2) { - m1.extensions.add(new CertStatusReqListV2Extension()); - } - } - - // Prepare the ALPN response - if (clientHelloALPN != null) { - List<String> peerAPs = clientHelloALPN.getPeerAPs(); - - // check for a callback function - if (hasAPCallback) { - if (conn != null) { - applicationProtocol = - appProtocolSelectorSSLSocket.apply(conn, peerAPs); - } else { - applicationProtocol = - appProtocolSelectorSSLEngine.apply(engine, peerAPs); - } - } - - // check for no-match and that the selected name was also proposed - // by the TLS peer - if (applicationProtocol == null || - (!applicationProtocol.isEmpty() && - !peerAPs.contains(applicationProtocol))) { - - fatalSE(Alerts.alert_no_application_protocol, - new SSLHandshakeException( - "No matching ALPN values")); - - } else if (!applicationProtocol.isEmpty()) { - m1.extensions.add(new ALPNExtension(applicationProtocol)); - } - } else { - // Nothing was negotiated, returned at end of the handshake - applicationProtocol = ""; - } - - if (debug != null && Debug.isOn("handshake")) { - m1.print(System.out); - System.out.println("Cipher suite: " + session.getSuite()); - } - m1.write(output); - handshakeState.update(m1, resumingSession); - - // - // If we are resuming a session, we finish writing handshake - // messages right now and then finish. - // - if (resumingSession) { - calculateConnectionKeys(session.getMasterSecret()); - sendChangeCipherAndFinish(false); - - // expecting the final ChangeCipherSpec and Finished messages - expectingFinishFlightSE(); - - return; - } - - - /* - * SECOND, write the server Certificate(s) if we need to. - * - * NOTE: while an "anonymous RSA" mode is explicitly allowed by - * the protocol, we can't support it since all of the SSL flavors - * defined in the protocol spec are explicitly stated to require - * using RSA certificates. - */ - if (ClientKeyExchangeService.find( - cipherSuite.keyExchange.name) != null) { - // No external key exchange provider needs a cert now. - } else if ((keyExchange != K_DH_ANON) && (keyExchange != K_ECDH_ANON)) { - if (certs == null) { - throw new RuntimeException("no certificates"); - } - - CertificateMsg m2 = new CertificateMsg(certs); - - /* - * Set local certs in the SSLSession, output - * debug info, and then actually write to the client. - */ - session.setLocalCertificates(certs); - if (debug != null && Debug.isOn("handshake")) { - m2.print(System.out); - } - m2.write(output); - handshakeState.update(m2, resumingSession); - - // XXX has some side effects with OS TCP buffering, - // leave it out for now - - // let client verify chain in the meantime... - // output.flush(); - } else { - if (certs != null) { - throw new RuntimeException("anonymous keyexchange with certs"); - } - } - - /** - * The CertificateStatus message ... only if it is needed. - * This would only be needed if we've established that this handshake - * supports status stapling and there is at least one response to - * return to the client. - */ - if (staplingParams != null) { - CertificateStatus csMsg = new CertificateStatus( - staplingParams.statReqType, certs, - staplingParams.responseMap); - if (debug != null && Debug.isOn("handshake")) { - csMsg.print(System.out); - } - csMsg.write(output); - handshakeState.update(csMsg, resumingSession); - } - - /* - * THIRD, the ServerKeyExchange message ... iff it's needed. - * - * It's usually needed unless there's an encryption-capable - * RSA cert, or a D-H cert. The notable exception is that - * exportable ciphers used with big RSA keys need to downgrade - * to use short RSA keys, even when the key/cert encrypts OK. - */ - - ServerKeyExchange m3; - switch (keyExchange) { - case K_RSA: - // no server key exchange for RSA ciphersuites - m3 = null; - break; - case K_RSA_EXPORT: - if (JsseJce.getRSAKeyLength(certs[0].getPublicKey()) > 512) { - try { - m3 = new RSA_ServerKeyExchange( - tempPublicKey, privateKey, - clnt_random, svr_random, - sslContext.getSecureRandom()); - privateKey = tempPrivateKey; - } catch (GeneralSecurityException e) { - m3 = null; // make compiler happy - throw new SSLException( - "Error generating RSA server key exchange", e); - } - } else { - // RSA_EXPORT with short key, don't need ServerKeyExchange - m3 = null; - } - break; - case K_DHE_RSA: - case K_DHE_DSS: - try { - m3 = new DH_ServerKeyExchange(dh, - privateKey, - clnt_random.random_bytes, - svr_random.random_bytes, - sslContext.getSecureRandom(), - preferableSignatureAlgorithm, - protocolVersion); - } catch (GeneralSecurityException e) { - m3 = null; // make compiler happy - throw new SSLException( - "Error generating DH server key exchange", e); - } - break; - case K_DH_ANON: - m3 = new DH_ServerKeyExchange(dh, protocolVersion); - break; - case K_ECDHE_RSA: - case K_ECDHE_ECDSA: - case K_ECDH_ANON: - try { - m3 = new ECDH_ServerKeyExchange(ecdh, - privateKey, - clnt_random.random_bytes, - svr_random.random_bytes, - sslContext.getSecureRandom(), - preferableSignatureAlgorithm, - protocolVersion); - } catch (GeneralSecurityException e) { - m3 = null; // make compiler happy - throw new SSLException( - "Error generating ECDH server key exchange", e); - } - break; - case K_ECDH_RSA: - case K_ECDH_ECDSA: - // ServerKeyExchange not used for fixed ECDH - m3 = null; - break; - default: - ClientKeyExchangeService p = - ClientKeyExchangeService.find(keyExchange.name); - if (p != null) { - // No external key exchange provider needs a cert now. - m3 = null; - break; - } - throw new RuntimeException("internal error: " + keyExchange); - } - if (m3 != null) { - if (debug != null && Debug.isOn("handshake")) { - m3.print(System.out); - } - m3.write(output); - handshakeState.update(m3, resumingSession); - } - - // - // FOURTH, the CertificateRequest message. The details of - // the message can be affected by the key exchange algorithm - // in use. For example, certs with fixed Diffie-Hellman keys - // are only useful with the DH_DSS and DH_RSA key exchange - // algorithms. - // - // Needed only if server requires client to authenticate self. - // Illegal for anonymous flavors, so we need to check that. - // - // No external key exchange provider needs a cert now. - if (doClientAuth != ClientAuthType.CLIENT_AUTH_NONE && - keyExchange != K_DH_ANON && keyExchange != K_ECDH_ANON && - ClientKeyExchangeService.find(keyExchange.name) == null) { - - CertificateRequest m4; - X509Certificate[] caCerts; - - Collection<SignatureAndHashAlgorithm> localSignAlgs = null; - if (protocolVersion.useTLS12PlusSpec()) { - // We currently use all local upported signature and hash - // algorithms. However, to minimize the computation cost - // of requested hash algorithms, we may use a restricted - // set of signature algorithms in the future. - localSignAlgs = getLocalSupportedSignAlgs(); - if (localSignAlgs.isEmpty()) { - throw new SSLHandshakeException( - "No supported signature algorithm"); - } - - Set<String> localHashAlgs = - SignatureAndHashAlgorithm.getHashAlgorithmNames( - localSignAlgs); - if (localHashAlgs.isEmpty()) { - throw new SSLHandshakeException( - "No supported signature algorithm"); - } - } - - caCerts = sslContext.getX509TrustManager().getAcceptedIssuers(); - m4 = new CertificateRequest(caCerts, keyExchange, - localSignAlgs, protocolVersion); - - if (debug != null && Debug.isOn("handshake")) { - m4.print(System.out); - } - m4.write(output); - handshakeState.update(m4, resumingSession); - } - - /* - * FIFTH, say ServerHelloDone. - */ - ServerHelloDone m5 = new ServerHelloDone(); - - if (debug != null && Debug.isOn("handshake")) { - m5.print(System.out); - } - m5.write(output); - handshakeState.update(m5, resumingSession); - - /* - * Flush any buffered messages so the client will see them. - * Ideally, all the messages above go in a single network level - * message to the client. Without big Certificate chains, it's - * going to be the common case. - */ - output.flush(); - } - - /* - * Choose cipher suite from among those supported by client. Sets - * the cipherSuite and keyExchange variables. - */ - private void chooseCipherSuite(ClientHello mesg) throws IOException { - CipherSuiteList prefered; - CipherSuiteList proposed; - if (preferLocalCipherSuites) { - prefered = getActiveCipherSuites(); - proposed = mesg.getCipherSuites(); - } else { - prefered = mesg.getCipherSuites(); - proposed = getActiveCipherSuites(); - } - - List<CipherSuite> legacySuites = new ArrayList<>(); - for (CipherSuite suite : prefered.collection()) { - if (isNegotiable(proposed, suite) == false) { - continue; - } - - if (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUIRED) { - if ((suite.keyExchange == K_DH_ANON) || - (suite.keyExchange == K_ECDH_ANON)) { - continue; - } - } - - if (!legacyAlgorithmConstraints.permits(null, suite.name, null)) { - legacySuites.add(suite); - continue; - } - - if (trySetCipherSuite(suite) == false) { - continue; - } - - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Standard ciphersuite chosen: " + suite); - } - return; - } - - for (CipherSuite suite : legacySuites) { - if (trySetCipherSuite(suite)) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Legacy ciphersuite chosen: " + suite); - } - return; - } - } - - fatalSE(Alerts.alert_handshake_failure, "no cipher suites in common"); - } - - /** - * Set the given CipherSuite, if possible. Return the result. - * The call succeeds if the CipherSuite is available and we have - * the necessary certificates to complete the handshake. We don't - * check if the CipherSuite is actually enabled. - * - * If successful, this method also generates ephemeral keys if - * required for this ciphersuite. This may take some time, so this - * method should only be called if you really want to use the - * CipherSuite. - * - * This method is called from chooseCipherSuite() in this class. - */ - boolean trySetCipherSuite(CipherSuite suite) { - /* - * If we're resuming a session we know we can - * support this key exchange algorithm and in fact - * have already cached the result of it in - * the session state. - */ - if (resumingSession) { - return true; - } - - if (suite.isNegotiable() == false) { - return false; - } - - // must not negotiate the obsoleted weak cipher suites. - if (protocolVersion.obsoletes(suite)) { - return false; - } - - // must not negotiate unsupported cipher suites. - if (!protocolVersion.supports(suite)) { - return false; - } - - KeyExchange keyExchange = suite.keyExchange; - - // null out any existing references - privateKey = null; - certs = null; - dh = null; - tempPrivateKey = null; - tempPublicKey = null; - - Collection<SignatureAndHashAlgorithm> supportedSignAlgs = null; - if (protocolVersion.useTLS12PlusSpec()) { - if (peerSupportedSignAlgs != null) { - supportedSignAlgs = peerSupportedSignAlgs; - } else { - SignatureAndHashAlgorithm algorithm = null; - - // we may optimize the performance - switch (keyExchange) { - // If the negotiated key exchange algorithm is one of - // (RSA, DHE_RSA, DH_RSA, RSA_PSK, ECDH_RSA, ECDHE_RSA), - // behave as if client had sent the value {sha1,rsa}. - case K_RSA: - case K_DHE_RSA: - case K_DH_RSA: - // case K_RSA_PSK: - case K_ECDH_RSA: - case K_ECDHE_RSA: - algorithm = SignatureAndHashAlgorithm.valueOf( - HashAlgorithm.SHA1.value, - SignatureAlgorithm.RSA.value, 0); - break; - // If the negotiated key exchange algorithm is one of - // (DHE_DSS, DH_DSS), behave as if the client had - // sent the value {sha1,dsa}. - case K_DHE_DSS: - case K_DH_DSS: - algorithm = SignatureAndHashAlgorithm.valueOf( - HashAlgorithm.SHA1.value, - SignatureAlgorithm.DSA.value, 0); - break; - // If the negotiated key exchange algorithm is one of - // (ECDH_ECDSA, ECDHE_ECDSA), behave as if the client - // had sent value {sha1,ecdsa}. - case K_ECDH_ECDSA: - case K_ECDHE_ECDSA: - algorithm = SignatureAndHashAlgorithm.valueOf( - HashAlgorithm.SHA1.value, - SignatureAlgorithm.ECDSA.value, 0); - break; - default: - // no peer supported signature algorithms - } - - if (algorithm == null) { - supportedSignAlgs = - Collections.<SignatureAndHashAlgorithm>emptySet(); - } else { - supportedSignAlgs = - new ArrayList<SignatureAndHashAlgorithm>(1); - supportedSignAlgs.add(algorithm); - - supportedSignAlgs = - SignatureAndHashAlgorithm.getSupportedAlgorithms( - algorithmConstraints, supportedSignAlgs); - - // May be no default activated signature algorithm, but - // let the following process make the final decision. - } - - // Sets the peer supported signature algorithm to use in KM - // temporarily. - session.setPeerSupportedSignatureAlgorithms(supportedSignAlgs); - } - } - - // The named group used for ECDHE and FFDHE. - NamedGroup namedGroup = null; - switch (keyExchange) { - case K_RSA: - // need RSA certs for authentication - if (setupPrivateKeyAndChain("RSA") == false) { - return false; - } - break; - case K_RSA_EXPORT: - // need RSA certs for authentication - if (setupPrivateKeyAndChain("RSA") == false) { - return false; - } - - try { - if (JsseJce.getRSAKeyLength(certs[0].getPublicKey()) > 512) { - if (!setupEphemeralRSAKeys(suite.exportable)) { - return false; - } - } - } catch (RuntimeException e) { - // could not determine keylength, ignore key - return false; - } - break; - case K_DHE_RSA: - // Is ephemeral DH cipher suite usable for the connection? - // - // [RFC 7919] If a compatible TLS server receives a Supported - // Groups extension from a client that includes any FFDHE group - // (i.e., any codepoint between 256 and 511, inclusive, even if - // unknown to the server), and if none of the client-proposed - // FFDHE groups are known and acceptable to the server, then - // the server MUST NOT select an FFDHE cipher suite. In this - // case, the server SHOULD select an acceptable non-FFDHE cipher - // suite from the client's offered list. If the extension is - // present with FFDHE groups, none of the client's offered - // groups are acceptable by the server, and none of the client's - // proposed non-FFDHE cipher suites are acceptable to the server, - // the server MUST end the connection with a fatal TLS alert - // of type insufficient_security(71). - // - // Note: For compatibility, if an application is customized to - // use legacy sizes (512 bits for exportable cipher suites and - // 768 bits for others), or the cipher suite is exportable, the - // FFDHE extension will not be used. - if ((!useLegacyEphemeralDHKeys) && (!suite.exportable) && - (requestedGroups != null) && requestedGroups.hasFFDHEGroup()) { - - namedGroup = requestedGroups.getPreferredGroup( - algorithmConstraints, NamedGroupType.NAMED_GROUP_FFDHE); - if (namedGroup == null) { - // no match found, cannot use this cipher suite. - return false; - } - } - - // need RSA certs for authentication - if (setupPrivateKeyAndChain("RSA") == false) { - return false; - } - - // get preferable peer signature algorithm for server key exchange - if (protocolVersion.useTLS12PlusSpec()) { - preferableSignatureAlgorithm = - SignatureAndHashAlgorithm.getPreferableAlgorithm( - supportedSignAlgs, "RSA", privateKey); - if (preferableSignatureAlgorithm == null) { - if ((debug != null) && Debug.isOn("handshake")) { - System.out.println( - "No signature and hash algorithm for cipher " + - suite); - } - return false; - } - } - - setupEphemeralDHKeys(namedGroup, suite.exportable, privateKey); - break; - case K_ECDHE_RSA: - // Is ECDHE cipher suite usable for the connection? - namedGroup = (requestedGroups != null) ? - requestedGroups.getPreferredGroup( - algorithmConstraints, NamedGroupType.NAMED_GROUP_ECDHE) : - SupportedGroupsExtension.getPreferredECGroup( - algorithmConstraints); - if (namedGroup == null) { - // no match found, cannot use this ciphersuite - return false; - } - - // need RSA certs for authentication - if (setupPrivateKeyAndChain("RSA") == false) { - return false; - } - - // get preferable peer signature algorithm for server key exchange - if (protocolVersion.useTLS12PlusSpec()) { - preferableSignatureAlgorithm = - SignatureAndHashAlgorithm.getPreferableAlgorithm( - supportedSignAlgs, "RSA", privateKey); - if (preferableSignatureAlgorithm == null) { - if ((debug != null) && Debug.isOn("handshake")) { - System.out.println( - "No signature and hash algorithm for cipher " + - suite); - } - return false; - } - } - - setupEphemeralECDHKeys(namedGroup); - break; - case K_DHE_DSS: - // Is ephemeral DH cipher suite usable for the connection? - // - // See comment in K_DHE_RSA case. - if ((!useLegacyEphemeralDHKeys) && (!suite.exportable) && - (requestedGroups != null) && requestedGroups.hasFFDHEGroup()) { - - namedGroup = requestedGroups.getPreferredGroup( - algorithmConstraints, NamedGroupType.NAMED_GROUP_FFDHE); - if (namedGroup == null) { - // no match found, cannot use this cipher suite. - return false; - } - } - - // get preferable peer signature algorithm for server key exchange - if (protocolVersion.useTLS12PlusSpec()) { - preferableSignatureAlgorithm = - SignatureAndHashAlgorithm.getPreferableAlgorithm( - supportedSignAlgs, "DSA"); - if (preferableSignatureAlgorithm == null) { - if ((debug != null) && Debug.isOn("handshake")) { - System.out.println( - "No signature and hash algorithm for cipher " + - suite); - } - return false; - } - } - - // need DSS certs for authentication - if (setupPrivateKeyAndChain("DSA") == false) { - return false; - } - - setupEphemeralDHKeys(namedGroup, suite.exportable, privateKey); - break; - case K_ECDHE_ECDSA: - // Is ECDHE cipher suite usable for the connection? - namedGroup = (requestedGroups != null) ? - requestedGroups.getPreferredGroup( - algorithmConstraints, NamedGroupType.NAMED_GROUP_ECDHE) : - SupportedGroupsExtension.getPreferredECGroup( - algorithmConstraints); - if (namedGroup == null) { - // no match found, cannot use this ciphersuite - return false; - } - - // get preferable peer signature algorithm for server key exchange - if (protocolVersion.useTLS12PlusSpec()) { - preferableSignatureAlgorithm = - SignatureAndHashAlgorithm.getPreferableAlgorithm( - supportedSignAlgs, "ECDSA"); - if (preferableSignatureAlgorithm == null) { - if ((debug != null) && Debug.isOn("handshake")) { - System.out.println( - "No signature and hash algorithm for cipher " + - suite); - } - return false; - } - } - - // need EC cert - if (setupPrivateKeyAndChain("EC") == false) { - return false; - } - - setupEphemeralECDHKeys(namedGroup); - break; - case K_ECDH_RSA: - // need EC cert - if (setupPrivateKeyAndChain("EC") == false) { - return false; - } - setupStaticECDHKeys(); - break; - case K_ECDH_ECDSA: - // need EC cert - if (setupPrivateKeyAndChain("EC") == false) { - return false; - } - setupStaticECDHKeys(); - break; - case K_DH_ANON: - // Is ephemeral DH cipher suite usable for the connection? - // - // See comment in K_DHE_RSA case. - if ((!useLegacyEphemeralDHKeys) && (!suite.exportable) && - (requestedGroups != null) && requestedGroups.hasFFDHEGroup()) { - namedGroup = requestedGroups.getPreferredGroup( - algorithmConstraints, NamedGroupType.NAMED_GROUP_FFDHE); - if (namedGroup == null) { - // no match found, cannot use this cipher suite. - return false; - } - } - - // no certs needed for anonymous - setupEphemeralDHKeys(namedGroup, suite.exportable, null); - break; - case K_ECDH_ANON: - // Is ECDHE cipher suite usable for the connection? - namedGroup = (requestedGroups != null) ? - requestedGroups.getPreferredGroup( - algorithmConstraints, NamedGroupType.NAMED_GROUP_ECDHE) : - SupportedGroupsExtension.getPreferredECGroup( - algorithmConstraints); - if (namedGroup == null) { - // no match found, cannot use this ciphersuite - return false; - } - - // no certs needed for anonymous - setupEphemeralECDHKeys(namedGroup); - break; - default: - ClientKeyExchangeService p = - ClientKeyExchangeService.find(keyExchange.name); - if (p == null) { - // internal error, unknown key exchange - throw new RuntimeException( - "Unrecognized cipherSuite: " + suite); - } - // need service creds - if (serviceCreds == null) { - AccessControlContext acc = getAccSE(); - serviceCreds = p.getServiceCreds(acc); - if (serviceCreds != null) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Using serviceCreds"); - } - } - if (serviceCreds == null) { - return false; - } - } - break; - } - setCipherSuite(suite); - - // set the peer implicit supported signature algorithms - if (protocolVersion.useTLS12PlusSpec()) { - if (peerSupportedSignAlgs == null) { - setPeerSupportedSignAlgs(supportedSignAlgs); - // we had alreay update the session - } - } - return true; - } - - /* - * Get some "ephemeral" RSA keys for this context. This means - * generating them if it's not already been done. - * - * Note that we currently do not implement any ciphersuites that use - * strong ephemeral RSA. (We do not support the EXPORT1024 ciphersuites - * and standard RSA ciphersuites prohibit ephemeral mode for some reason) - * This means that export is always true and 512 bit keys are generated. - */ - private boolean setupEphemeralRSAKeys(boolean export) { - KeyPair kp = sslContext.getEphemeralKeyManager(). - getRSAKeyPair(export, sslContext.getSecureRandom()); - if (kp == null) { - return false; - } else { - tempPublicKey = kp.getPublic(); - tempPrivateKey = kp.getPrivate(); - return true; - } - } - - /* - * Acquire some "ephemeral" Diffie-Hellman keys for this handshake. - * We don't reuse these, for improved forward secrecy. - */ - private void setupEphemeralDHKeys( - NamedGroup namedGroup, boolean export, Key key) { - // Are the client and server willing to negotiate FFDHE groups? - if ((!useLegacyEphemeralDHKeys) && (!export) && (namedGroup != null)) { - dh = new DHCrypt(namedGroup, sslContext.getSecureRandom()); - - return; - } // Otherwise, the client is not compatible with FFDHE extension. - - /* - * 768 bits ephemeral DH private keys were used to be used in - * ServerKeyExchange except that exportable ciphers max out at 512 - * bits modulus values. We still adhere to this behavior in legacy - * mode (system property "jdk.tls.ephemeralDHKeySize" is defined - * as "legacy"). - * - * Old JDK (JDK 7 and previous) releases don't support DH keys bigger - * than 1024 bits. We have to consider the compatibility requirement. - * 1024 bits DH key is always used for non-exportable cipher suites - * in default mode (system property "jdk.tls.ephemeralDHKeySize" - * is not defined). - * - * However, if applications want more stronger strength, setting - * system property "jdk.tls.ephemeralDHKeySize" to "matched" - * is a workaround to use ephemeral DH key which size matches the - * corresponding authentication key. For example, if the public key - * size of an authentication certificate is 2048 bits, then the - * ephemeral DH key size should be 2048 bits accordingly unless - * the cipher suite is exportable. This key sizing scheme keeps - * the cryptographic strength consistent between authentication - * keys and key-exchange keys. - * - * Applications may also want to customize the ephemeral DH key size - * to a fixed length for non-exportable cipher suites. This can be - * approached by setting system property "jdk.tls.ephemeralDHKeySize" - * to a valid positive integer between 1024 and 8192 bits, inclusive. - * - * Note that the minimum acceptable key size is 1024 bits except - * exportable cipher suites or legacy mode. - * - * Note that per RFC 2246, the key size limit of DH is 512 bits for - * exportable cipher suites. Because of the weakness, exportable - * cipher suites are deprecated since TLS v1.1 and they are not - * enabled by default in Oracle provider. The legacy behavior is - * reserved and 512 bits DH key is always used for exportable - * cipher suites. - */ - int keySize = export ? 512 : 1024; // default mode - if (!export) { - if (useLegacyEphemeralDHKeys) { // legacy mode - keySize = 768; - } else if (useSmartEphemeralDHKeys) { // matched mode - if (key != null) { - int ks = KeyUtil.getKeySize(key); - - // DH parameter generation can be extremely slow, make - // sure to use one of the supported pre-computed DH - // parameters (see DHCrypt class). - // - // Old deployed applications may not be ready to support - // DH key sizes bigger than 2048 bits. Please DON'T use - // value other than 1024 and 2048 at present. May improve - // the underlying providers and key size limit in the - // future when the compatibility and interoperability - // impact is limited. - // - // keySize = ks <= 1024 ? 1024 : (ks >= 2048 ? 2048 : ks); - keySize = ks <= 1024 ? 1024 : 2048; - } // Otherwise, anonymous cipher suites, 1024-bit is used. - } else if (customizedDHKeySize > 0) { // customized mode - keySize = customizedDHKeySize; - } - } - - dh = new DHCrypt(keySize, sslContext.getSecureRandom()); - } - - /** - * Setup the ephemeral ECDH parameters. - */ - private void setupEphemeralECDHKeys(NamedGroup namedGroup) { - ecdh = new ECDHCrypt(namedGroup, sslContext.getSecureRandom()); - } - - private void setupStaticECDHKeys() { - // don't need to check whether the curve is supported, already done - // in setupPrivateKeyAndChain(). - ecdh = new ECDHCrypt(privateKey, certs[0].getPublicKey()); - } - - /** - * Retrieve the server key and certificate for the specified algorithm - * from the KeyManager and set the instance variables. - * - * @return true if successful, false if not available or invalid - */ - private boolean setupPrivateKeyAndChain(String algorithm) { - X509ExtendedKeyManager km = sslContext.getX509KeyManager(); - String alias; - if (conn != null) { - alias = km.chooseServerAlias(algorithm, null, conn); - } else { - alias = km.chooseEngineServerAlias(algorithm, null, engine); - } - if (alias == null) { - return false; - } - PrivateKey tempPrivateKey = km.getPrivateKey(alias); - if (tempPrivateKey == null) { - return false; - } - X509Certificate[] tempCerts = km.getCertificateChain(alias); - if ((tempCerts == null) || (tempCerts.length == 0)) { - return false; - } - String keyAlgorithm = algorithm.split("_")[0]; - PublicKey publicKey = tempCerts[0].getPublicKey(); - if ((tempPrivateKey.getAlgorithm().equals(keyAlgorithm) == false) - || (publicKey.getAlgorithm().equals(keyAlgorithm) == false)) { - return false; - } - // For ECC certs, check whether we support the EC domain parameters. - // If the client sent a SupportedEllipticCurves ClientHello extension, - // check against that too. - if (keyAlgorithm.equals("EC")) { - if (publicKey instanceof ECPublicKey == false) { - return false; - } - ECParameterSpec params = ((ECPublicKey)publicKey).getParams(); - NamedGroup namedGroup = NamedGroup.valueOf(params); - if ((namedGroup == null) || - (!SupportedGroupsExtension.supports(namedGroup)) || - ((requestedGroups != null) && - !requestedGroups.contains(namedGroup.id))) { - return false; - } - } - this.privateKey = tempPrivateKey; - this.certs = tempCerts; - return true; - } - - /* - * Returns premaster secret for external key exchange services. - */ - private SecretKey clientKeyExchange(ClientKeyExchange mesg) - throws IOException { - - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - // Record the principals involved in exchange - session.setPeerPrincipal(mesg.getPeerPrincipal()); - session.setLocalPrincipal(mesg.getLocalPrincipal()); - - return mesg.clientKeyExchange(); - } - - /* - * Diffie Hellman key exchange is used when the server presented - * D-H parameters in its certificate (signed using RSA or DSS/DSA), - * or else the server presented no certificate but sent D-H params - * in a ServerKeyExchange message. Use of D-H is specified by the - * cipher suite chosen. - * - * The message optionally contains the client's D-H public key (if - * it wasn't not sent in a client certificate). As always with D-H, - * if a client and a server have each other's D-H public keys and - * they use common algorithm parameters, they have a shared key - * that's derived via the D-H calculation. That key becomes the - * pre-master secret. - */ - private SecretKey clientKeyExchange(DHClientKeyExchange mesg) - throws IOException { - - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - BigInteger publicKeyValue = mesg.getClientPublicKey(); - - // check algorithm constraints - dh.checkConstraints(algorithmConstraints, publicKeyValue); - - return dh.getAgreedSecret(publicKeyValue, false); - } - - private SecretKey clientKeyExchange(ECDHClientKeyExchange mesg) - throws IOException { - - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - byte[] publicPoint = mesg.getEncodedPoint(); - - // check algorithm constraints - ecdh.checkConstraints(algorithmConstraints, publicPoint); - - return ecdh.getAgreedSecret(publicPoint); - } - - /* - * Client wrote a message to verify the certificate it sent earlier. - * - * Note that this certificate isn't involved in key exchange. Client - * authentication messages are included in the checksums used to - * validate the handshake (e.g. Finished messages). Other than that, - * the _exact_ identity of the client is less fundamental to protocol - * security than its role in selecting keys via the pre-master secret. - */ - private void clientCertificateVerify(CertificateVerify mesg) - throws IOException { - - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - if (protocolVersion.useTLS12PlusSpec()) { - SignatureAndHashAlgorithm signAlg = - mesg.getPreferableSignatureAlgorithm(); - if (signAlg == null) { - throw new SSLHandshakeException( - "Illegal CertificateVerify message"); - } - - String hashAlg = - SignatureAndHashAlgorithm.getHashAlgorithmName(signAlg); - if (hashAlg == null || hashAlg.length() == 0) { - throw new SSLHandshakeException( - "No supported hash algorithm"); - } - } - - try { - PublicKey publicKey = - session.getPeerCertificates()[0].getPublicKey(); - - boolean valid = mesg.verify(protocolVersion, handshakeHash, - publicKey, session.getMasterSecret()); - if (valid == false) { - fatalSE(Alerts.alert_bad_certificate, - "certificate verify message signature error"); - } - } catch (GeneralSecurityException e) { - fatalSE(Alerts.alert_bad_certificate, - "certificate verify format error", e); - } - - // reset the flag for clientCertificateVerify message - needClientVerify = false; - } - - - /* - * Client writes "finished" at the end of its handshake, after cipher - * spec is changed. We verify it and then send ours. - * - * When we're resuming a session, we'll have already sent our own - * Finished message so just the verification is needed. - */ - private void clientFinished(Finished mesg) throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - /* - * Verify if client did send the certificate when client - * authentication was required, otherwise server should not proceed - */ - if (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUIRED) { - // get X500Principal of the end-entity certificate for X509-based - // ciphersuites, or Kerberos principal for Kerberos ciphersuites, etc - session.getPeerPrincipal(); - } - - /* - * Verify if client did send clientCertificateVerify message following - * the client Certificate, otherwise server should not proceed - */ - if (needClientVerify) { - fatalSE(Alerts.alert_handshake_failure, - "client did not send certificate verify message"); - } - - /* - * Verify the client's message with the "before" digest of messages, - * and forget about continuing to use that digest. - */ - boolean verified = mesg.verify(handshakeHash, Finished.CLIENT, - session.getMasterSecret()); - - if (!verified) { - fatalSE(Alerts.alert_handshake_failure, - "client 'finished' message doesn't verify"); - // NOTREACHED - } - - /* - * save client verify data for secure renegotiation - */ - if (secureRenegotiation) { - clientVerifyData = mesg.getVerifyData(); - } - - /* - * OK, it verified. If we're doing the full handshake, add that - * "Finished" message to the hash of handshake messages, then send - * the change_cipher_spec and Finished message. - */ - if (!resumingSession) { - sendChangeCipherAndFinish(true); - } else { - handshakeFinished = true; - } - - /* - * Update the session cache only after the handshake completed, else - * we're open to an attack against a partially completed handshake. - */ - session.setLastAccessedTime(System.currentTimeMillis()); - if (!resumingSession && session.isRejoinable()) { - ((SSLSessionContextImpl)sslContext.engineGetServerSessionContext()) - .put(session); - if (debug != null && Debug.isOn("session")) { - System.out.println( - "%% Cached server session: " + session); - } - } else if (!resumingSession && - debug != null && Debug.isOn("session")) { - System.out.println( - "%% Didn't cache non-resumable server session: " - + session); - } - } - - /* - * Compute finished message with the "server" digest (and then forget - * about that digest, it can't be used again). - */ - private void sendChangeCipherAndFinish(boolean finishedTag) - throws IOException { - - // Reload if this message has been reserved. - handshakeHash.reload(); - - Finished mesg = new Finished(protocolVersion, handshakeHash, - Finished.SERVER, session.getMasterSecret(), cipherSuite); - - /* - * Send the change_cipher_spec record; then our Finished handshake - * message will be the last handshake message. Flush, and now we - * are ready for application data!! - */ - sendChangeCipherSpec(mesg, finishedTag); - - /* - * save server verify data for secure renegotiation - */ - if (secureRenegotiation) { - serverVerifyData = mesg.getVerifyData(); - } - } - - - /* - * Returns a HelloRequest message to kickstart renegotiations - */ - @Override - HandshakeMessage getKickstartMessage() { - return new HelloRequest(); - } - - - /* - * Fault detected during handshake. - */ - @Override - void handshakeAlert(byte description) throws SSLProtocolException { - - String message = Alerts.alertDescription(description); - - if (debug != null && Debug.isOn("handshake")) { - System.out.println("SSL -- handshake alert: " - + message); - } - - /* - * It's ok to get a no_certificate alert from a client of which - * we *requested* authentication information. - * However, if we *required* it, then this is not acceptable. - * - * Anyone calling getPeerCertificates() on the - * session will get an SSLPeerUnverifiedException. - */ - if ((description == Alerts.alert_no_certificate) && - (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUESTED)) { - return; - } - - throw new SSLProtocolException("handshake alert: " + message); - } - - /* - * RSA key exchange is normally used. The client encrypts a "pre-master - * secret" with the server's public key, from the Certificate (or else - * ServerKeyExchange) message that was sent to it by the server. That's - * decrypted using the private key before we get here. - */ - private SecretKey clientKeyExchange(RSAClientKeyExchange mesg) - throws IOException { - - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - return mesg.preMaster; - } - - /* - * Verify the certificate sent by the client. We'll only get one if we - * sent a CertificateRequest to request client authentication. If we - * are in TLS mode, the client may send a message with no certificates - * to indicate it does not have an appropriate chain. (In SSLv3 mode, - * it would send a no certificate alert). - */ - private void clientCertificate(CertificateMsg mesg) throws IOException { - if (debug != null && Debug.isOn("handshake")) { - mesg.print(System.out); - } - - X509Certificate[] peerCerts = mesg.getCertificateChain(); - - if (peerCerts.length == 0) { - /* - * If the client authentication is only *REQUESTED* (e.g. - * not *REQUIRED*, this is an acceptable condition.) - */ - if (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUESTED) { - return; - } else { - fatalSE(Alerts.alert_bad_certificate, - "null cert chain"); - } - } - - // ask the trust manager to verify the chain - X509TrustManager tm = sslContext.getX509TrustManager(); - - try { - // find out the types of client authentication used - PublicKey key = peerCerts[0].getPublicKey(); - String keyAlgorithm = key.getAlgorithm(); - String authType; - if (keyAlgorithm.equals("RSA")) { - authType = "RSA"; - } else if (keyAlgorithm.equals("DSA")) { - authType = "DSA"; - } else if (keyAlgorithm.equals("EC")) { - authType = "EC"; - } else { - // unknown public key type - authType = "UNKNOWN"; - } - - if (tm instanceof X509ExtendedTrustManager) { - if (conn != null) { - ((X509ExtendedTrustManager)tm).checkClientTrusted( - peerCerts.clone(), - authType, - conn); - } else { - ((X509ExtendedTrustManager)tm).checkClientTrusted( - peerCerts.clone(), - authType, - engine); - } - } else { - // Unlikely to happen, because we have wrapped the old - // X509TrustManager with the new X509ExtendedTrustManager. - throw new CertificateException( - "Improper X509TrustManager implementation"); - } - } catch (CertificateException e) { - // This will throw an exception, so include the original error. - fatalSE(Alerts.alert_certificate_unknown, e); - } - // set the flag for clientCertificateVerify message - needClientVerify = true; - - session.setPeerCertificates(peerCerts); - } - - private StaplingParameters processStapling(ClientHello mesg) { - StaplingParameters params = null; - ExtensionType ext = null; - StatusRequestType type = null; - StatusRequest req = null; - Map<X509Certificate, byte[]> responses; - - // If this feature has not been enabled, then no more processing - // is necessary. Also we will only staple if we're doing a full - // handshake. - if (!sslContext.isStaplingEnabled(false) || resumingSession) { - return null; - } - - // Check if the client has asserted the status_request[_v2] extension(s) - CertStatusReqExtension statReqExt = (CertStatusReqExtension) - mesg.extensions.get(ExtensionType.EXT_STATUS_REQUEST); - CertStatusReqListV2Extension statReqExtV2 = - (CertStatusReqListV2Extension)mesg.extensions.get( - ExtensionType.EXT_STATUS_REQUEST_V2); - - // Determine which type of stapling we are doing and assert the - // proper extension in the server hello. - // Favor status_request_v2 over status_request and ocsp_multi - // over ocsp. - // If multiple ocsp or ocsp_multi types exist, select the first - // instance of a given type. Also since we don't support ResponderId - // selection yet, only accept a request if the ResponderId field - // is empty. - if (statReqExtV2 != null) { // RFC 6961 stapling - ext = ExtensionType.EXT_STATUS_REQUEST_V2; - List<CertStatusReqItemV2> reqItems = - statReqExtV2.getRequestItems(); - int ocspIdx = -1; - int ocspMultiIdx = -1; - for (int pos = 0; (pos < reqItems.size() && - (ocspIdx == -1 || ocspMultiIdx == -1)); pos++) { - CertStatusReqItemV2 item = reqItems.get(pos); - StatusRequestType curType = item.getType(); - if (ocspIdx < 0 && curType == StatusRequestType.OCSP) { - OCSPStatusRequest ocspReq = - (OCSPStatusRequest)item.getRequest(); - if (ocspReq.getResponderIds().isEmpty()) { - ocspIdx = pos; - } - } else if (ocspMultiIdx < 0 && - curType == StatusRequestType.OCSP_MULTI) { - // If the type is OCSP, then the request - // is guaranteed to be OCSPStatusRequest - OCSPStatusRequest ocspReq = - (OCSPStatusRequest)item.getRequest(); - if (ocspReq.getResponderIds().isEmpty()) { - ocspMultiIdx = pos; - } - } - } - if (ocspMultiIdx >= 0) { - type = reqItems.get(ocspMultiIdx).getType(); - req = reqItems.get(ocspMultiIdx).getRequest(); - } else if (ocspIdx >= 0) { - type = reqItems.get(ocspIdx).getType(); - req = reqItems.get(ocspIdx).getRequest(); - } else { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Warning: No suitable request " + - "found in the status_request_v2 extension."); - } - } - } - - // Only attempt to process a status_request extension if: - // * The status_request extension is set AND - // * either the status_request_v2 extension is not present OR - // * none of the underlying OCSPStatusRequest structures is suitable - // for stapling. - // If either of the latter two bullet items is true the ext, type and - // req variables should all be null. If any are null we will try - // processing an asserted status_request. - if ((statReqExt != null) && - (ext == null || type == null || req == null)) { - ext = ExtensionType.EXT_STATUS_REQUEST; - type = statReqExt.getType(); - if (type == StatusRequestType.OCSP) { - // If the type is OCSP, then the request is guaranteed - // to be OCSPStatusRequest - OCSPStatusRequest ocspReq = - (OCSPStatusRequest)statReqExt.getRequest(); - if (ocspReq.getResponderIds().isEmpty()) { - req = ocspReq; - } else { - if (debug != null && Debug.isOn("handshake")) { - req = null; - System.out.println("Warning: No suitable request " + - "found in the status_request extension."); - } - } - } - } - - // If, after walking through the extensions we were unable to - // find a suitable StatusRequest, then stapling is disabled. - // The ext, type and req variables must have been set to continue. - if (type == null || req == null || ext == null) { - return null; - } - - // Get the OCSP responses from the StatusResponseManager - StatusResponseManager statRespMgr = - sslContext.getStatusResponseManager(); - if (statRespMgr != null) { - responses = statRespMgr.get(type, req, certs, statusRespTimeout, - TimeUnit.MILLISECONDS); - if (!responses.isEmpty()) { - // If this RFC 6066-style stapling (SSL cert only) then the - // response cannot be zero length - if (type == StatusRequestType.OCSP) { - byte[] respDER = responses.get(certs[0]); - if (respDER == null || respDER.length <= 0) { - return null; - } - } - params = new StaplingParameters(ext, type, req, responses); - } - } else { - // This should not happen, but if lazy initialization of the - // StatusResponseManager doesn't occur we should turn off stapling. - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Warning: lazy initialization " + - "of the StatusResponseManager failed. " + - "Stapling has been disabled."); - } - } - - return params; - } - - /** - * Inner class used to hold stapling parameters needed by the handshaker - * when stapling is active. - */ - private class StaplingParameters { - private final ExtensionType statusRespExt; - private final StatusRequestType statReqType; - private final StatusRequest statReqData; - private final Map<X509Certificate, byte[]> responseMap; - - StaplingParameters(ExtensionType ext, StatusRequestType type, - StatusRequest req, Map<X509Certificate, byte[]> responses) { - statusRespExt = ext; - statReqType = type; - statReqData = req; - responseMap = responses; - } - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerHelloDone.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,178 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the ServerHelloDone handshake message. + */ +final class ServerHelloDone { + static final SSLConsumer handshakeConsumer = + new ServerHelloDoneConsumer(); + static final HandshakeProducer handshakeProducer = + new ServerHelloDoneProducer(); + + /** + * The ServerHelloDone handshake message. + */ + static final class ServerHelloDoneMessage extends HandshakeMessage { + ServerHelloDoneMessage(HandshakeContext handshakeContext) { + super(handshakeContext); + } + + ServerHelloDoneMessage(HandshakeContext handshakeContext, + ByteBuffer m) throws IOException { + super(handshakeContext); + if (m.hasRemaining()) { + handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Error parsing ServerHelloDone message: not empty"); + } + } + + @Override + public SSLHandshake handshakeType() { + return SSLHandshake.SERVER_HELLO_DONE; + } + + @Override + public int messageLength() { + return 0; + } + + @Override + public void send(HandshakeOutStream s) throws IOException { + // empty, nothing to send + } + + @Override + public String toString() { + return "<empty>"; + } + } + + /** + * The "ServerHelloDone" handshake message producer. + */ + private static final + class ServerHelloDoneProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private ServerHelloDoneProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + ServerHelloDoneMessage shdm = new ServerHelloDoneMessage(shc); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced ServerHelloDone handshake message", shdm); + } + + // Output the handshake message. + shdm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // + // update + // + shc.handshakeConsumers.put(SSLHandshake.CLIENT_KEY_EXCHANGE.id, + SSLHandshake.CLIENT_KEY_EXCHANGE); + shc.conContext.consumers.put(ContentType.CHANGE_CIPHER_SPEC.id, + ChangeCipherSpec.t10Consumer); + shc.handshakeConsumers.put(SSLHandshake.FINISHED.id, + SSLHandshake.FINISHED); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "ServerHelloDone" handshake message consumer. + */ + private static final + class ServerHelloDoneConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private ServerHelloDoneConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // clean up this consumer + chc.handshakeConsumers.clear(); + + ServerHelloDoneMessage shdm = + new ServerHelloDoneMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Consuming ServerHelloDone handshake message", shdm); + } + + // + // validate + // + // blank + + // + // update + // + chc.handshakeProducers.put(SSLHandshake.CLIENT_KEY_EXCHANGE.id, + SSLHandshake.CLIENT_KEY_EXCHANGE); + chc.handshakeProducers.put(SSLHandshake.FINISHED.id, + SSLHandshake.FINISHED); + // + // produce + // + SSLHandshake[] probableHandshakeMessages = new SSLHandshake[] { + // full handshake messages + SSLHandshake.CERTIFICATE, + SSLHandshake.CLIENT_KEY_EXCHANGE, + SSLHandshake.CERTIFICATE_VERIFY, + SSLHandshake.FINISHED + }; + + for (SSLHandshake hs : probableHandshakeMessages) { + HandshakeProducer handshakeProducer = + chc.handshakeProducers.remove(hs.id); + if (handshakeProducer != null) { + handshakeProducer.produce(context, null); + } + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerHello.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerHello.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerHello.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerHello.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1458 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.AlgorithmConstraints; +import java.security.GeneralSecurityException; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Optional; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; +import sun.security.ssl.CipherSuite.KeyExchange; +import sun.security.ssl.ClientHello.ClientHelloMessage; +import sun.security.ssl.SSLCipher.SSLReadCipher; +import sun.security.ssl.SSLCipher.SSLWriteCipher; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.ssl.SupportedVersionsExtension.SHSupportedVersionsSpec; + +/** + * Pack of the ServerHello/HelloRetryRequest handshake message. + */ +final class ServerHello { + static final SSLConsumer handshakeConsumer = + new ServerHelloConsumer(); + static final HandshakeProducer t12HandshakeProducer = + new T12ServerHelloProducer(); + static final HandshakeProducer t13HandshakeProducer = + new T13ServerHelloProducer(); + static final HandshakeProducer hrrHandshakeProducer = + new T13HelloRetryRequestProducer(); + + static final HandshakeProducer hrrReproducer = + new T13HelloRetryRequestReproducer(); + + private static final HandshakeConsumer t12HandshakeConsumer = + new T12ServerHelloConsumer(); + private static final HandshakeConsumer t13HandshakeConsumer = + new T13ServerHelloConsumer(); + + private static final HandshakeConsumer d12HandshakeConsumer = + new T12ServerHelloConsumer(); + private static final HandshakeConsumer d13HandshakeConsumer = + new T13ServerHelloConsumer(); + + private static final HandshakeConsumer t13HrrHandshakeConsumer = + new T13HelloRetryRequestConsumer(); + private static final HandshakeConsumer d13HrrHandshakeConsumer = + new T13HelloRetryRequestConsumer(); + + /** + * The ServerHello handshake message. + */ + static final class ServerHelloMessage extends HandshakeMessage { + final ProtocolVersion serverVersion; // TLS 1.3 legacy + final RandomCookie serverRandom; + final SessionId sessionId; // TLS 1.3 legacy + final CipherSuite cipherSuite; + final byte compressionMethod; // TLS 1.3 legacy + final SSLExtensions extensions; + + // The HelloRetryRequest producer needs to use the ClientHello message + // for cookie generation. Please don't use this field for other + // purpose unless it is really necessary. + final ClientHelloMessage clientHello; + + // Reserved for HelloRetryRequest consumer. Please don't use this + // field for other purpose unless it is really necessary. + final ByteBuffer handshakeRecord; + + ServerHelloMessage(HandshakeContext context, + ProtocolVersion serverVersion, SessionId sessionId, + CipherSuite cipherSuite, RandomCookie serverRandom, + ClientHelloMessage clientHello) { + super(context); + + this.serverVersion = serverVersion; + this.serverRandom = serverRandom; + this.sessionId = sessionId; + this.cipherSuite = cipherSuite; + this.compressionMethod = 0x00; // Don't support compression. + this.extensions = new SSLExtensions(this); + + // Reserve the ClientHello message for cookie generation. + this.clientHello = clientHello; + + // The handshakeRecord field is used for HelloRetryRequest consumer + // only. It's fine to set it to null for generating side of the + // ServerHello/HelloRetryRequest message. + this.handshakeRecord = null; + } + + ServerHelloMessage(HandshakeContext context, + ByteBuffer m) throws IOException { + super(context); + + // Reserve for HelloRetryRequest consumer if needed. + this.handshakeRecord = m.duplicate(); + + byte major = m.get(); + byte minor = m.get(); + this.serverVersion = ProtocolVersion.valueOf(major, minor); + if (this.serverVersion == null) { + // The client should only request for known protocol versions. + context.conContext.fatal(Alert.PROTOCOL_VERSION, + "Unsupported protocol version: " + + ProtocolVersion.nameOf(major, minor)); + } + + this.serverRandom = new RandomCookie(m); + this.sessionId = new SessionId(Record.getBytes8(m)); + sessionId.checkLength(serverVersion.id); + + + int cipherSuiteId = Record.getInt16(m); + this.cipherSuite = CipherSuite.valueOf(cipherSuiteId); + if (cipherSuite == null || !context.isNegotiable(cipherSuite)) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Server selected improper ciphersuite " + + CipherSuite.nameOf(cipherSuiteId)); + } + + this.compressionMethod = m.get(); + if (compressionMethod != 0) { + context.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "compression type not supported, " + compressionMethod); + } + + SSLExtension[] supportedExtensions; + if (serverRandom.isHelloRetryRequest()) { + supportedExtensions = context.sslConfig.getEnabledExtensions( + SSLHandshake.HELLO_RETRY_REQUEST); + } else { + supportedExtensions = context.sslConfig.getEnabledExtensions( + SSLHandshake.SERVER_HELLO); + } + + if (m.hasRemaining()) { + this.extensions = + new SSLExtensions(this, m, supportedExtensions); + } else { + this.extensions = new SSLExtensions(this); + } + + // The clientHello field is used for HelloRetryRequest producer + // only. It's fine to set it to null for receiving side of + // ServerHello/HelloRetryRequest message. + this.clientHello = null; // not used, let it be null; + } + + @Override + public SSLHandshake handshakeType() { + return serverRandom.isHelloRetryRequest() ? + SSLHandshake.HELLO_RETRY_REQUEST : SSLHandshake.SERVER_HELLO; + } + + @Override + public int messageLength() { + // almost fixed header size, except session ID and extensions: + // major + minor = 2 + // random = 32 + // session ID len field = 1 + // cipher suite = 2 + // compression = 1 + // extensions: if present, 2 + length of extensions + // In TLS 1.3, use of certain extensions is mandatory. + return 38 + sessionId.length() + extensions.length(); + } + + @Override + public void send(HandshakeOutStream hos) throws IOException { + hos.putInt8(serverVersion.major); + hos.putInt8(serverVersion.minor); + hos.write(serverRandom.randomBytes); + hos.putBytes8(sessionId.getId()); + hos.putInt8((cipherSuite.id >> 8) & 0xFF); + hos.putInt8(cipherSuite.id & 0xff); + hos.putInt8(compressionMethod); + + extensions.send(hos); // In TLS 1.3, use of certain + // extensions is mandatory. + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"{0}\": '{'\n" + + " \"server version\" : \"{1}\",\n" + + " \"random\" : \"{2}\",\n" + + " \"session id\" : \"{3}\",\n" + + " \"cipher suite\" : \"{4}\",\n" + + " \"compression methods\" : \"{5}\",\n" + + " \"extensions\" : [\n" + + "{6}\n" + + " ]\n" + + "'}'", + Locale.ENGLISH); + Object[] messageFields = { + serverRandom.isHelloRetryRequest() ? + "HelloRetryRequest" : "ServerHello", + serverVersion.name, + Utilities.toHexString(serverRandom.randomBytes), + sessionId.toString(), + cipherSuite.name + "(" + + Utilities.byte16HexString(cipherSuite.id) + ")", + Utilities.toHexString(compressionMethod), + Utilities.indent(extensions.toString(), " ") + }; + + return messageFormat.format(messageFields); + } + } + + /** + * The "ServerHello" handshake message producer. + */ + private static final class T12ServerHelloProducer + implements HandshakeProducer { + + // Prevent instantiation of this class. + private T12ServerHelloProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + ClientHelloMessage clientHello = (ClientHelloMessage)message; + + // If client hasn't specified a session we can resume, start a + // new one and choose its cipher suite and compression options, + // unless new session creation is disabled for this connection! + if (!shc.isResumption || shc.resumingSession == null) { + if (!shc.sslConfig.enableSessionCreation) { + throw new SSLException( + "Not resumption, and no new session is allowed"); + } + + if (shc.localSupportedSignAlgs == null) { + shc.localSupportedSignAlgs = + SignatureScheme.getSupportedAlgorithms( + shc.algorithmConstraints, shc.activeProtocols); + } + + SSLSessionImpl session = + new SSLSessionImpl(shc, CipherSuite.C_NULL); + session.setMaximumPacketSize(shc.sslConfig.maximumPacketSize); + shc.handshakeSession = session; + + // consider the handshake extension impact + SSLExtension[] enabledExtensions = + shc.sslConfig.getEnabledExtensions( + SSLHandshake.CLIENT_HELLO, shc.negotiatedProtocol); + clientHello.extensions.consumeOnTrade(shc, enabledExtensions); + + // negotiate the cipher suite. + KeyExchangeProperties credentials = + chooseCipherSuite(shc, clientHello); + if (credentials == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "no cipher suites in common"); + + return null; // make the compiler happy + } + shc.negotiatedCipherSuite = credentials.cipherSuite; + shc.handshakeKeyExchange = credentials.keyExchange; + shc.handshakeSession.setSuite(credentials.cipherSuite); + shc.handshakePossessions.addAll( + Arrays.asList(credentials.possessions)); + shc.handshakeHash.determine( + shc.negotiatedProtocol, shc.negotiatedCipherSuite); + + // Check the incoming OCSP stapling extensions and attempt + // to get responses. If the resulting stapleParams is non + // null, it implies that stapling is enabled on the server side. + shc.stapleParams = StatusResponseManager.processStapling(shc); + shc.staplingActive = (shc.stapleParams != null); + + // update the responders + SSLKeyExchange ke = credentials.keyExchange; + if (ke != null) { + for (Map.Entry<Byte, HandshakeProducer> me : + ke.getHandshakeProducers(shc)) { + shc.handshakeProducers.put( + me.getKey(), me.getValue()); + } + } + + if ((ke != null) && + (shc.sslConfig.clientAuthType != + ClientAuthType.CLIENT_AUTH_NONE) && + !shc.negotiatedCipherSuite.isAnonymous()) { + for (SSLHandshake hs : + ke.getRelatedHandshakers(shc)) { + if (hs == SSLHandshake.CERTIFICATE) { + shc.handshakeProducers.put( + SSLHandshake.CERTIFICATE_REQUEST.id, + SSLHandshake.CERTIFICATE_REQUEST); + break; + } + } + } + shc.handshakeProducers.put(SSLHandshake.SERVER_HELLO_DONE.id, + SSLHandshake.SERVER_HELLO_DONE); + } else { + shc.handshakeSession = shc.resumingSession; + shc.negotiatedProtocol = + shc.resumingSession.getProtocolVersion(); + shc.negotiatedCipherSuite = shc.resumingSession.getSuite(); + shc.handshakeHash.determine( + shc.negotiatedProtocol, shc.negotiatedCipherSuite); + } + + // Generate the ServerHello handshake message. + ServerHelloMessage shm = new ServerHelloMessage(shc, + shc.negotiatedProtocol, + shc.handshakeSession.getSessionId(), + shc.negotiatedCipherSuite, + new RandomCookie(shc), + clientHello); + shc.serverHelloRandom = shm.serverRandom; + + // Produce extensions for ServerHello handshake message. + SSLExtension[] serverHelloExtensions = + shc.sslConfig.getEnabledExtensions( + SSLHandshake.SERVER_HELLO, shc.negotiatedProtocol); + shm.extensions.produce(shc, serverHelloExtensions); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced ServerHello handshake message", shm); + } + + // Output the handshake message. + shm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + if (shc.isResumption && shc.resumingSession != null) { + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol); + if (kdg == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + shc.negotiatedProtocol); + } else { + shc.handshakeKeyDerivation = kdg.createKeyDerivation( + shc, shc.resumingSession.getMasterSecret()); + } + + // update the responders + shc.handshakeProducers.put(SSLHandshake.FINISHED.id, + SSLHandshake.FINISHED); + } + + // The handshake message has been delivered. + return null; + } + + private static KeyExchangeProperties chooseCipherSuite( + ServerHandshakeContext shc, + ClientHelloMessage clientHello) throws IOException { + List<CipherSuite> preferred; + List<CipherSuite> proposed; + if (shc.sslConfig.preferLocalCipherSuites) { + preferred = shc.activeCipherSuites; + proposed = clientHello.cipherSuites; + } else { + preferred = clientHello.cipherSuites; + proposed = shc.activeCipherSuites; + } + + List<CipherSuite> legacySuites = new LinkedList<>(); + for (CipherSuite cs : preferred) { + if (!HandshakeContext.isNegotiable( + proposed, shc.negotiatedProtocol, cs)) { + continue; + } + + if (shc.sslConfig.clientAuthType == + ClientAuthType.CLIENT_AUTH_REQUIRED) { + if ((cs.keyExchange == KeyExchange.K_DH_ANON) || + (cs.keyExchange == KeyExchange.K_ECDH_ANON)) { + continue; + } + } + + SSLKeyExchange ke = SSLKeyExchange.valueOf( + cs.keyExchange, shc.negotiatedProtocol); + if (ke == null) { + continue; + } + if (!ServerHandshakeContext.legacyAlgorithmConstraints.permits( + null, cs.name, null)) { + legacySuites.add(cs); + continue; + } + + SSLPossession[] hcds = ke.createPossessions(shc); + if ((hcds == null) || (hcds.length == 0)) { + continue; + } + + // The cipher suite has been negotiated. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("use cipher suite " + cs.name); + } + + return new KeyExchangeProperties(cs, ke, hcds); + } + + for (CipherSuite cs : legacySuites) { + SSLKeyExchange ke = SSLKeyExchange.valueOf( + cs.keyExchange, shc.negotiatedProtocol); + if (ke != null) { + SSLPossession[] hcds = ke.createPossessions(shc); + if ((hcds != null) && (hcds.length != 0)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "use legacy cipher suite " + cs.name); + } + return new KeyExchangeProperties(cs, ke, hcds); + } + } + } + + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "no cipher suites in common"); + + return null; // make the compiler happy. + } + + private static final class KeyExchangeProperties { + final CipherSuite cipherSuite; + final SSLKeyExchange keyExchange; + final SSLPossession[] possessions; + + private KeyExchangeProperties(CipherSuite cipherSuite, + SSLKeyExchange keyExchange, SSLPossession[] possessions) { + this.cipherSuite = cipherSuite; + this.keyExchange = keyExchange; + this.possessions = possessions; + } + } + } + + /** + * The "ServerHello" handshake message producer. + */ + private static final + class T13ServerHelloProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T13ServerHelloProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + ClientHelloMessage clientHello = (ClientHelloMessage)message; + + // If client hasn't specified a session we can resume, start a + // new one and choose its cipher suite and compression options, + // unless new session creation is disabled for this connection! + if (!shc.isResumption || shc.resumingSession == null) { + if (!shc.sslConfig.enableSessionCreation) { + throw new SSLException( + "Not resumption, and no new session is allowed"); + } + + if (shc.localSupportedSignAlgs == null) { + shc.localSupportedSignAlgs = + SignatureScheme.getSupportedAlgorithms( + shc.algorithmConstraints, shc.activeProtocols); + } + + SSLSessionImpl session = + new SSLSessionImpl(shc, CipherSuite.C_NULL); + session.setMaximumPacketSize(shc.sslConfig.maximumPacketSize); + shc.handshakeSession = session; + + // consider the handshake extension impact + SSLExtension[] enabledExtensions = + shc.sslConfig.getEnabledExtensions( + SSLHandshake.CLIENT_HELLO, shc.negotiatedProtocol); + clientHello.extensions.consumeOnTrade(shc, enabledExtensions); + + // negotiate the cipher suite. + CipherSuite cipherSuite = chooseCipherSuite(shc, clientHello); + if (cipherSuite == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "no cipher suites in common"); + return null; // make the compiler happy + } + shc.negotiatedCipherSuite = cipherSuite; + shc.handshakeSession.setSuite(cipherSuite); + shc.handshakeHash.determine( + shc.negotiatedProtocol, shc.negotiatedCipherSuite); + } else { + shc.handshakeSession = shc.resumingSession; + + // consider the handshake extension impact + SSLExtension[] enabledExtensions = + shc.sslConfig.getEnabledExtensions( + SSLHandshake.CLIENT_HELLO, shc.negotiatedProtocol); + clientHello.extensions.consumeOnTrade(shc, enabledExtensions); + + shc.negotiatedProtocol = + shc.resumingSession.getProtocolVersion(); + shc.negotiatedCipherSuite = shc.resumingSession.getSuite(); + shc.handshakeHash.determine( + shc.negotiatedProtocol, shc.negotiatedCipherSuite); + + setUpPskKD(shc, + shc.resumingSession.consumePreSharedKey().get()); + + // The session can't be resumed again---remove it from cache + SSLSessionContextImpl sessionCache = (SSLSessionContextImpl) + shc.sslContext.engineGetServerSessionContext(); + sessionCache.remove(shc.resumingSession.getSessionId()); + } + + // update the responders + shc.handshakeProducers.put(SSLHandshake.ENCRYPTED_EXTENSIONS.id, + SSLHandshake.ENCRYPTED_EXTENSIONS); + shc.handshakeProducers.put(SSLHandshake.FINISHED.id, + SSLHandshake.FINISHED); + + // Generate the ServerHello handshake message. + ServerHelloMessage shm = new ServerHelloMessage(shc, + ProtocolVersion.TLS12, // use legacy version + clientHello.sessionId, // echo back + shc.negotiatedCipherSuite, + new RandomCookie(shc), + clientHello); + shc.serverHelloRandom = shm.serverRandom; + + // Produce extensions for ServerHello handshake message. + SSLExtension[] serverHelloExtensions = + shc.sslConfig.getEnabledExtensions( + SSLHandshake.SERVER_HELLO, shc.negotiatedProtocol); + shm.extensions.produce(shc, serverHelloExtensions); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Produced ServerHello handshake message", shm); + } + + // Output the handshake message. + shm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // Change client/server handshake traffic secrets. + // Refresh handshake hash + shc.handshakeHash.update(); + + // Change client/server handshake traffic secrets. + SSLKeyExchange ke = shc.handshakeKeyExchange; + if (ke == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not negotiated key shares"); + return null; // make the compiler happy + } + + SSLKeyDerivation handshakeKD = ke.createKeyDerivation(shc); + SecretKey handshakeSecret = handshakeKD.deriveKey( + "TlsHandshakeSecret", null); + + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(shc.negotiatedProtocol); + if (kdg == null) { + // unlikely + shc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + shc.negotiatedProtocol); + return null; // make the compiler happy + } + + SSLKeyDerivation kd = + new SSLSecretDerivation(shc, handshakeSecret); + + // update the handshake traffic read keys. + SecretKey readSecret = kd.deriveKey( + "TlsClientHandshakeTrafficSecret", null); + SSLKeyDerivation readKD = + kdg.createKeyDerivation(shc, readSecret); + SecretKey readKey = readKD.deriveKey( + "TlsKey", null); + SecretKey readIvSecret = readKD.deriveKey( + "TlsIv", null); + IvParameterSpec readIv = + new IvParameterSpec(readIvSecret.getEncoded()); + SSLReadCipher readCipher; + try { + readCipher = + shc.negotiatedCipherSuite.bulkCipher.createReadCipher( + Authenticator.valueOf(shc.negotiatedProtocol), + shc.negotiatedProtocol, readKey, readIv, + shc.sslContext.getSecureRandom()); + } catch (GeneralSecurityException gse) { + // unlikely + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Missing cipher algorithm", gse); + return null; // make the compiler happy + } + + shc.baseReadSecret = readSecret; + shc.conContext.inputRecord.changeReadCiphers(readCipher); + + // update the handshake traffic write secret. + SecretKey writeSecret = kd.deriveKey( + "TlsServerHandshakeTrafficSecret", null); + SSLKeyDerivation writeKD = + kdg.createKeyDerivation(shc, writeSecret); + SecretKey writeKey = writeKD.deriveKey( + "TlsKey", null); + SecretKey writeIvSecret = writeKD.deriveKey( + "TlsIv", null); + IvParameterSpec writeIv = + new IvParameterSpec(writeIvSecret.getEncoded()); + SSLWriteCipher writeCipher; + try { + writeCipher = + shc.negotiatedCipherSuite.bulkCipher.createWriteCipher( + Authenticator.valueOf(shc.negotiatedProtocol), + shc.negotiatedProtocol, writeKey, writeIv, + shc.sslContext.getSecureRandom()); + } catch (GeneralSecurityException gse) { + // unlikely + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Missing cipher algorithm", gse); + return null; // make the compiler happy + } + + shc.baseWriteSecret = writeSecret; + shc.conContext.outputRecord.changeWriteCiphers( + writeCipher, (clientHello.sessionId.length() != 0)); + + // Update the context for master key derivation. + shc.handshakeKeyDerivation = kd; + + // The handshake message has been delivered. + return null; + } + + private static CipherSuite chooseCipherSuite( + ServerHandshakeContext shc, + ClientHelloMessage clientHello) throws IOException { + List<CipherSuite> preferred; + List<CipherSuite> proposed; + if (shc.sslConfig.preferLocalCipherSuites) { + preferred = shc.activeCipherSuites; + proposed = clientHello.cipherSuites; + } else { + preferred = clientHello.cipherSuites; + proposed = shc.activeCipherSuites; + } + + CipherSuite legacySuite = null; + AlgorithmConstraints legacyConstraints = + ServerHandshakeContext.legacyAlgorithmConstraints; + for (CipherSuite cs : preferred) { + if (!HandshakeContext.isNegotiable( + proposed, shc.negotiatedProtocol, cs)) { + continue; + } + + if ((legacySuite == null) && + !legacyConstraints.permits(null, cs.name, null)) { + legacySuite = cs; + continue; + } + + // The cipher suite has been negotiated. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("use cipher suite " + cs.name); + } + return cs; + } + + if (legacySuite != null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "use legacy cipher suite " + legacySuite.name); + } + return legacySuite; + } + + // no cipher suites in common + return null; + } + } + + /** + * The "HelloRetryRequest" handshake message producer. + */ + private static final + class T13HelloRetryRequestProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T13HelloRetryRequestProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + ServerHandshakeContext shc = (ServerHandshakeContext) context; + ClientHelloMessage clientHello = (ClientHelloMessage) message; + + // negotiate the cipher suite. + CipherSuite cipherSuite = + T13ServerHelloProducer.chooseCipherSuite(shc, clientHello); + if (cipherSuite == null) { + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "no cipher suites in common for hello retry request"); + return null; // make the compiler happy + } + + ServerHelloMessage hhrm = new ServerHelloMessage(shc, + ProtocolVersion.TLS12, // use legacy version + clientHello.sessionId, // echo back + cipherSuite, + RandomCookie.hrrRandom, + clientHello + ); + + shc.negotiatedCipherSuite = cipherSuite; + shc.handshakeHash.determine( + shc.negotiatedProtocol, shc.negotiatedCipherSuite); + + // Produce extensions for HelloRetryRequest handshake message. + SSLExtension[] serverHelloExtensions = + shc.sslConfig.getEnabledExtensions( + SSLHandshake.HELLO_RETRY_REQUEST, shc.negotiatedProtocol); + hhrm.extensions.produce(shc, serverHelloExtensions); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Produced HelloRetryRequest handshake message", hhrm); + } + + // Output the handshake message. + hhrm.write(shc.handshakeOutput); + shc.handshakeOutput.flush(); + + // Stateless, shall we clean up the handshake context as well? + shc.handshakeHash.finish(); // forgot about the handshake hash + shc.handshakeExtensions.clear(); + + // What's the expected response? + shc.handshakeConsumers.put( + SSLHandshake.CLIENT_HELLO.id, SSLHandshake.CLIENT_HELLO); + + // The handshake message has been delivered. + return null; + } + } + + /** + * The "HelloRetryRequest" handshake message reproducer. + */ + private static final + class T13HelloRetryRequestReproducer implements HandshakeProducer { + // Prevent instantiation of this class. + private T13HelloRetryRequestReproducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + ServerHandshakeContext shc = (ServerHandshakeContext) context; + ClientHelloMessage clientHello = (ClientHelloMessage) message; + + // negotiate the cipher suite. + CipherSuite cipherSuite = shc.negotiatedCipherSuite; + ServerHelloMessage hhrm = new ServerHelloMessage(shc, + ProtocolVersion.TLS12, // use legacy version + clientHello.sessionId, // echo back + cipherSuite, + RandomCookie.hrrRandom, + clientHello + ); + + // Produce extensions for HelloRetryRequest handshake message. + SSLExtension[] serverHelloExtensions = + shc.sslConfig.getEnabledExtensions( + SSLHandshake.MESSAGE_HASH, shc.negotiatedProtocol); + hhrm.extensions.produce(shc, serverHelloExtensions); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Reproduced HelloRetryRequest handshake message", hhrm); + } + + HandshakeOutStream hos = new HandshakeOutStream(null); + hhrm.write(hos); + + return hos.toByteArray(); + } + } + + /** + * The "ServerHello" handshake message consumer. + */ + private static final + class ServerHelloConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private ServerHelloConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // clean up this consumer + chc.handshakeConsumers.remove(SSLHandshake.SERVER_HELLO.id); + if (!chc.handshakeConsumers.isEmpty()) { + // DTLS 1.0/1.2 + chc.handshakeConsumers.remove( + SSLHandshake.HELLO_VERIFY_REQUEST.id); + } + if (!chc.handshakeConsumers.isEmpty()) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "No more message expected before ServerHello is processed"); + } + + ServerHelloMessage shm = new ServerHelloMessage(chc, message); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Consuming ServerHello handshake message", shm); + } + + if (shm.serverRandom.isHelloRetryRequest()) { + onHelloRetryRequest(chc, shm); + } else { + onServerHello(chc, shm); + } + } + + private void onHelloRetryRequest(ClientHandshakeContext chc, + ServerHelloMessage helloRetryRequest) throws IOException { + // Negotiate protocol version. + // + // Check and launch SupportedVersions. + SSLExtension[] extTypes = new SSLExtension[] { + SSLExtension.HRR_SUPPORTED_VERSIONS + }; + helloRetryRequest.extensions.consumeOnLoad(chc, extTypes); + + ProtocolVersion serverVersion; + SHSupportedVersionsSpec svs = + (SHSupportedVersionsSpec)chc.handshakeExtensions.get( + SSLExtension.HRR_SUPPORTED_VERSIONS); + if (svs != null) { + serverVersion = // could be null + ProtocolVersion.valueOf(svs.selectedVersion); + } else { + serverVersion = helloRetryRequest.serverVersion; + } + + if (!chc.activeProtocols.contains(serverVersion)) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "The server selected protocol version " + serverVersion + + " is not accepted by client preferences " + + chc.activeProtocols); + } + + if (!serverVersion.useTLS13PlusSpec()) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "Unexpected HelloRetryRequest for " + serverVersion.name); + } + + chc.negotiatedProtocol = serverVersion; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Negotiated protocol version: " + serverVersion.name); + } + + // TLS 1.3 key share extension may have produced client + // possessions for TLS 1.3 key exchanges. + // + // Clean up before producing new client key share possessions. + chc.handshakePossessions.clear(); + + if (serverVersion.isDTLS) { + d13HrrHandshakeConsumer.consume(chc, helloRetryRequest); + } else { + t13HrrHandshakeConsumer.consume(chc, helloRetryRequest); + } + } + + private void onServerHello(ClientHandshakeContext chc, + ServerHelloMessage serverHello) throws IOException { + // Negotiate protocol version. + // + // Check and launch SupportedVersions. + SSLExtension[] extTypes = new SSLExtension[] { + SSLExtension.SH_SUPPORTED_VERSIONS + }; + serverHello.extensions.consumeOnLoad(chc, extTypes); + + ProtocolVersion serverVersion; + SHSupportedVersionsSpec svs = + (SHSupportedVersionsSpec)chc.handshakeExtensions.get( + SSLExtension.SH_SUPPORTED_VERSIONS); + if (svs != null) { + serverVersion = // could be null + ProtocolVersion.valueOf(svs.selectedVersion); + } else { + serverVersion = serverHello.serverVersion; + } + + if (!chc.activeProtocols.contains(serverVersion)) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "The server selected protocol version " + serverVersion + + " is not accepted by client preferences " + + chc.activeProtocols); + } + + chc.negotiatedProtocol = serverVersion; + if (!chc.conContext.isNegotiated) { + chc.conContext.protocolVersion = chc.negotiatedProtocol; + chc.conContext.outputRecord.setVersion(chc.negotiatedProtocol); + } + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Negotiated protocol version: " + serverVersion.name); + } + + if (serverHello.serverRandom.isVersionDowngrade(chc)) { + chc.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "A potential protocol version downgrade attack"); + } + + // Consume the handshake message for the specific protocol version. + if (serverVersion.isDTLS) { + if (serverVersion.useTLS13PlusSpec()) { + d13HandshakeConsumer.consume(chc, serverHello); + } else { + // TLS 1.3 key share extension may have produced client + // possessions for TLS 1.3 key exchanges. + chc.handshakePossessions.clear(); + + d12HandshakeConsumer.consume(chc, serverHello); + } + } else { + if (serverVersion.useTLS13PlusSpec()) { + t13HandshakeConsumer.consume(chc, serverHello); + } else { + // TLS 1.3 key share extension may have produced client + // possessions for TLS 1.3 key exchanges. + chc.handshakePossessions.clear(); + + t12HandshakeConsumer.consume(chc, serverHello); + } + } + } + } + + private static final + class T12ServerHelloConsumer implements HandshakeConsumer { + // Prevent instantiation of this class. + private T12ServerHelloConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + ServerHelloMessage serverHello = (ServerHelloMessage)message; + if (!chc.isNegotiable(serverHello.serverVersion)) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "Server chose " + serverHello.serverVersion + + ", but that protocol version is not enabled or " + + "not supported by the client."); + } + + // chc.negotiatedProtocol = serverHello.serverVersion; + chc.negotiatedCipherSuite = serverHello.cipherSuite; + chc.handshakeHash.determine( + chc.negotiatedProtocol, chc.negotiatedCipherSuite); + chc.serverHelloRandom = serverHello.serverRandom; + if (chc.negotiatedCipherSuite.keyExchange == null) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "TLS 1.2 or prior version does not support the " + + "server cipher suite: " + chc.negotiatedCipherSuite.name); + } + + // + // validate + // + + // Check and launch the "renegotiation_info" extension. + SSLExtension[] extTypes = new SSLExtension[] { + SSLExtension.SH_RENEGOTIATION_INFO + }; + serverHello.extensions.consumeOnLoad(chc, extTypes); + + // Is it session resuming? + if (chc.resumingSession != null) { + // we tried to resume, let's see what the server decided + if (serverHello.sessionId.equals( + chc.resumingSession.getSessionId())) { + // server resumed the session, let's make sure everything + // checks out + + // Verify that the session ciphers are unchanged. + CipherSuite sessionSuite = chc.resumingSession.getSuite(); + if (chc.negotiatedCipherSuite != sessionSuite) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "Server returned wrong cipher suite for session"); + } + + // verify protocol version match + ProtocolVersion sessionVersion = + chc.resumingSession.getProtocolVersion(); + if (chc.negotiatedProtocol != sessionVersion) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "Server resumed with wrong protocol version"); + } + + // looks fine; resume it. + chc.isResumption = true; + chc.resumingSession.setAsSessionResumption(true); + chc.handshakeSession = chc.resumingSession; + } else { + // we wanted to resume, but the server refused + // + // Invalidate the session for initial handshake in case + // of reusing next time. + if (chc.resumingSession != null) { + chc.resumingSession.invalidate(); + chc.resumingSession = null; + } + chc.isResumption = false; + if (!chc.sslConfig.enableSessionCreation) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "New session creation is disabled"); + } + } + } + + // Check and launch ClientHello extensions. + extTypes = chc.sslConfig.getEnabledExtensions( + SSLHandshake.SERVER_HELLO); + serverHello.extensions.consumeOnLoad(chc, extTypes); + + if (!chc.isResumption) { + if (chc.resumingSession != null) { + // in case the resumption happens next time. + chc.resumingSession.invalidate(); + chc.resumingSession = null; + } + + if (!chc.sslConfig.enableSessionCreation) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "New session creation is disabled"); + } + chc.handshakeSession = new SSLSessionImpl(chc, + chc.negotiatedCipherSuite, + serverHello.sessionId); + chc.handshakeSession.setMaximumPacketSize( + chc.sslConfig.maximumPacketSize); + } + + // + // update + // + serverHello.extensions.consumeOnTrade(chc, extTypes); + + // update the consumers and producers + if (chc.isResumption) { + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol); + if (kdg == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + chc.negotiatedProtocol); + } else { + chc.handshakeKeyDerivation = kdg.createKeyDerivation( + chc, chc.resumingSession.getMasterSecret()); + } + + chc.conContext.consumers.putIfAbsent( + ContentType.CHANGE_CIPHER_SPEC.id, + ChangeCipherSpec.t10Consumer); + chc.handshakeConsumers.put( + SSLHandshake.FINISHED.id, + SSLHandshake.FINISHED); + } else { + SSLKeyExchange ke = SSLKeyExchange.valueOf( + chc.negotiatedCipherSuite.keyExchange, + chc.negotiatedProtocol); + chc.handshakeKeyExchange = ke; + if (ke != null) { + for (SSLHandshake handshake : + ke.getRelatedHandshakers(chc)) { + chc.handshakeConsumers.put(handshake.id, handshake); + } + } + + chc.handshakeConsumers.put(SSLHandshake.SERVER_HELLO_DONE.id, + SSLHandshake.SERVER_HELLO_DONE); + } + + // + // produce + // + // Need no new handshake message producers here. + } + } + + private static void setUpPskKD(HandshakeContext hc, + SecretKey psk) throws SSLHandshakeException { + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Using PSK to derive early secret"); + } + + try { + CipherSuite.HashAlg hashAlg = hc.negotiatedCipherSuite.hashAlg; + HKDF hkdf = new HKDF(hashAlg.name); + byte[] zeros = new byte[hashAlg.hashLength]; + SecretKey earlySecret = hkdf.extract(zeros, psk, "TlsEarlySecret"); + hc.handshakeKeyDerivation = + new SSLSecretDerivation(hc, earlySecret); + } catch (GeneralSecurityException gse) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(gse); + } + } + + private static final + class T13ServerHelloConsumer implements HandshakeConsumer { + // Prevent instantiation of this class. + private T13ServerHelloConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + ServerHelloMessage serverHello = (ServerHelloMessage)message; + if (serverHello.serverVersion != ProtocolVersion.TLS12) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "The ServerHello.legacy_version field is not TLS 1.2"); + } + + chc.negotiatedCipherSuite = serverHello.cipherSuite; + chc.handshakeHash.determine( + chc.negotiatedProtocol, chc.negotiatedCipherSuite); + chc.serverHelloRandom = serverHello.serverRandom; + + // + // validate + // + + // Check and launch ServerHello extensions. + SSLExtension[] extTypes = chc.sslConfig.getEnabledExtensions( + SSLHandshake.SERVER_HELLO); + serverHello.extensions.consumeOnLoad(chc, extTypes); + if (!chc.isResumption) { + if (chc.resumingSession != null) { + // in case the resumption happens next time. + chc.resumingSession.invalidate(); + chc.resumingSession = null; + } + + if (!chc.sslConfig.enableSessionCreation) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "New session creation is disabled"); + } + chc.handshakeSession = new SSLSessionImpl(chc, + chc.negotiatedCipherSuite, + serverHello.sessionId); + chc.handshakeSession.setMaximumPacketSize( + chc.sslConfig.maximumPacketSize); + } else { + // The PSK is consumed to allow it to be deleted + Optional<SecretKey> psk = + chc.resumingSession.consumePreSharedKey(); + if(!psk.isPresent()) { + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "No PSK available. Unable to resume."); + } + + chc.handshakeSession = chc.resumingSession; + + setUpPskKD(chc, psk.get()); + } + + // + // update + // + serverHello.extensions.consumeOnTrade(chc, extTypes); + + // Change client/server handshake traffic secrets. + // Refresh handshake hash + chc.handshakeHash.update(); + + SSLKeyExchange ke = chc.handshakeKeyExchange; + if (ke == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not negotiated key shares"); + return; // make the compiler happy + } + + SSLKeyDerivation handshakeKD = ke.createKeyDerivation(chc); + SecretKey handshakeSecret = handshakeKD.deriveKey( + "TlsHandshakeSecret", null); + SSLTrafficKeyDerivation kdg = + SSLTrafficKeyDerivation.valueOf(chc.negotiatedProtocol); + if (kdg == null) { + // unlikely + chc.conContext.fatal(Alert.INTERNAL_ERROR, + "Not supported key derivation: " + + chc.negotiatedProtocol); + return; // make the compiler happy + } + + SSLKeyDerivation secretKD = + new SSLSecretDerivation(chc, handshakeSecret); + + // update the handshake traffic read keys. + SecretKey readSecret = secretKD.deriveKey( + "TlsServerHandshakeTrafficSecret", null); + + SSLKeyDerivation readKD = + kdg.createKeyDerivation(chc, readSecret); + SecretKey readKey = readKD.deriveKey( + "TlsKey", null); + SecretKey readIvSecret = readKD.deriveKey( + "TlsIv", null); + IvParameterSpec readIv = + new IvParameterSpec(readIvSecret.getEncoded()); + SSLReadCipher readCipher; + try { + readCipher = + chc.negotiatedCipherSuite.bulkCipher.createReadCipher( + Authenticator.valueOf(chc.negotiatedProtocol), + chc.negotiatedProtocol, readKey, readIv, + chc.sslContext.getSecureRandom()); + } catch (GeneralSecurityException gse) { + // unlikely + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Missing cipher algorithm", gse); + return; // make the compiler happy + } + + chc.baseReadSecret = readSecret; + chc.conContext.inputRecord.changeReadCiphers(readCipher); + + // update the handshake traffic write keys. + SecretKey writeSecret = secretKD.deriveKey( + "TlsClientHandshakeTrafficSecret", null); + SSLKeyDerivation writeKD = + kdg.createKeyDerivation(chc, writeSecret); + SecretKey writeKey = writeKD.deriveKey( + "TlsKey", null); + SecretKey writeIvSecret = writeKD.deriveKey( + "TlsIv", null); + IvParameterSpec writeIv = + new IvParameterSpec(writeIvSecret.getEncoded()); + SSLWriteCipher writeCipher; + try { + writeCipher = + chc.negotiatedCipherSuite.bulkCipher.createWriteCipher( + Authenticator.valueOf(chc.negotiatedProtocol), + chc.negotiatedProtocol, writeKey, writeIv, + chc.sslContext.getSecureRandom()); + } catch (GeneralSecurityException gse) { + // unlikely + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Missing cipher algorithm", gse); + return; // make the compiler happy + } + + chc.baseWriteSecret = writeSecret; + chc.conContext.outputRecord.changeWriteCiphers( + writeCipher, (serverHello.sessionId.length() != 0)); + + // Should use resumption_master_secret for TLS 1.3. + // chc.handshakeSession.setMasterSecret(masterSecret); + + // Update the context for master key derivation. + chc.handshakeKeyDerivation = secretKD; + + // update the consumers and producers + // + // The server sends a dummy change_cipher_spec record immediately + // after its first handshake message. This may either be after a + // ServerHello or a HelloRetryRequest. + chc.conContext.consumers.putIfAbsent( + ContentType.CHANGE_CIPHER_SPEC.id, + ChangeCipherSpec.t13Consumer); + + chc.handshakeConsumers.put( + SSLHandshake.ENCRYPTED_EXTENSIONS.id, + SSLHandshake.ENCRYPTED_EXTENSIONS); + + // Support cert authentication only, when not PSK. + chc.handshakeConsumers.put( + SSLHandshake.CERTIFICATE_REQUEST.id, + SSLHandshake.CERTIFICATE_REQUEST); + chc.handshakeConsumers.put( + SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE); + chc.handshakeConsumers.put( + SSLHandshake.CERTIFICATE_VERIFY.id, + SSLHandshake.CERTIFICATE_VERIFY); + + chc.handshakeConsumers.put( + SSLHandshake.FINISHED.id, + SSLHandshake.FINISHED); + + // + // produce + // + // Need no new handshake message producers here. + } + } + + private static final + class T13HelloRetryRequestConsumer implements HandshakeConsumer { + // Prevent instantiation of this class. + private T13HelloRetryRequestConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + ServerHelloMessage helloRetryRequest = (ServerHelloMessage)message; + if (helloRetryRequest.serverVersion != ProtocolVersion.TLS12) { + chc.conContext.fatal(Alert.PROTOCOL_VERSION, + "The HelloRetryRequest.legacy_version is not TLS 1.2"); + } + + chc.negotiatedCipherSuite = helloRetryRequest.cipherSuite; + + // + // validate + // + + // Check and launch ClientHello extensions. + SSLExtension[] extTypes = chc.sslConfig.getEnabledExtensions( + SSLHandshake.HELLO_RETRY_REQUEST); + helloRetryRequest.extensions.consumeOnLoad(chc, extTypes); + + // + // update + // + helloRetryRequest.extensions.consumeOnTrade(chc, extTypes); + + // Change client/server handshake traffic secrets. + // Refresh handshake hash + chc.handshakeHash.finish(); // reset the handshake hash + + // calculate the transcript hash of the 1st ClientHello message + HandshakeOutStream hos = new HandshakeOutStream(null); + try { + chc.initialClientHelloMsg.write(hos); + } catch (IOException ioe) { + // unlikely + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Failed to construct message hash", ioe); + } + chc.handshakeHash.deliver(hos.toByteArray()); + chc.handshakeHash.determine( + chc.negotiatedProtocol, chc.negotiatedCipherSuite); + byte[] clientHelloHash = chc.handshakeHash.digest(); + + // calculate the message_hash + // + // Transcript-Hash(ClientHello1, HelloRetryRequest, ... Mn) = + // Hash(message_hash || /* Handshake type */ + // 00 00 Hash.length || /* Handshake message length (bytes) */ + // Hash(ClientHello1) || /* Hash of ClientHello1 */ + // HelloRetryRequest || ... || Mn) + int hashLen = chc.negotiatedCipherSuite.hashAlg.hashLength; + byte[] hashedClientHello = new byte[4 + hashLen]; + hashedClientHello[0] = SSLHandshake.MESSAGE_HASH.id; + hashedClientHello[1] = (byte)0x00; + hashedClientHello[2] = (byte)0x00; + hashedClientHello[3] = (byte)(hashLen & 0xFF); + System.arraycopy(clientHelloHash, 0, + hashedClientHello, 4, hashLen); + + chc.handshakeHash.finish(); // reset the handshake hash + chc.handshakeHash.deliver(hashedClientHello); + + int hrrBodyLen = helloRetryRequest.handshakeRecord.remaining(); + byte[] hrrMessage = new byte[4 + hrrBodyLen]; + hrrMessage[0] = SSLHandshake.HELLO_RETRY_REQUEST.id; + hrrMessage[1] = (byte)((hrrBodyLen >> 16) & 0xFF); + hrrMessage[2] = (byte)((hrrBodyLen >> 8) & 0xFF); + hrrMessage[3] = (byte)(hrrBodyLen & 0xFF); + + ByteBuffer hrrBody = helloRetryRequest.handshakeRecord.duplicate(); + hrrBody.get(hrrMessage, 4, hrrBodyLen); + + chc.handshakeHash.receive(hrrMessage); + + // Update the initial ClientHello handshake message. + chc.initialClientHelloMsg.extensions.reproduce(chc, + new SSLExtension[] { + SSLExtension.CH_COOKIE, + SSLExtension.CH_KEY_SHARE, + SSLExtension.CH_PRE_SHARED_KEY + }); + + // + // produce response handshake message + // + SSLHandshake.CLIENT_HELLO.produce(context, helloRetryRequest); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.Map; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the ServerKeyExchange handshake message. + */ +final class ServerKeyExchange { + static final SSLConsumer handshakeConsumer = + new ServerKeyExchangeConsumer(); + static final HandshakeProducer handshakeProducer = + new ServerKeyExchangeProducer(); + + /** + * The "ServerKeyExchange" handshake message producer. + */ + private static final + class ServerKeyExchangeProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private ServerKeyExchangeProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + SSLKeyExchange ke = SSLKeyExchange.valueOf( + shc.negotiatedCipherSuite.keyExchange, + shc.negotiatedProtocol); + if (ke != null) { + for (Map.Entry<Byte, HandshakeProducer> hc : + ke.getHandshakeProducers(shc)) { + if (hc.getKey() == SSLHandshake.SERVER_KEY_EXCHANGE.id) { + return hc.getValue().produce(context, message); + } + } + } + + // not producer defined. + shc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No ServerKeyExchange handshake message can be produced."); + return null; // make the compiler happe + } + } + + /** + * The "ServerKeyExchange" handshake message consumer. + */ + private static final + class ServerKeyExchangeConsumer implements SSLConsumer { + // Prevent instantiation of this class. + private ServerKeyExchangeConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // clean up this consumer + chc.handshakeConsumers.remove(SSLHandshake.SERVER_KEY_EXCHANGE.id); + + SSLKeyExchange ke = SSLKeyExchange.valueOf( + chc.negotiatedCipherSuite.keyExchange, + chc.negotiatedProtocol); + if (ke != null) { + for (Map.Entry<Byte, SSLConsumer> hc : + ke.getHandshakeConsumers(chc)) { + if (hc.getKey() == SSLHandshake.SERVER_KEY_EXCHANGE.id) { + hc.getValue().consume(context, message); + return; + } + } + } + + // no consumer defined. + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected ServerKeyExchange handshake message."); + } + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/ServerNameExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,258 +26,561 @@ package sun.security.ssl; import java.io.IOException; +import java.nio.ByteBuffer; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; -import java.util.List; import java.util.LinkedHashMap; +import java.util.List; import java.util.Map; - +import java.util.Objects; import javax.net.ssl.SNIHostName; import javax.net.ssl.SNIMatcher; import javax.net.ssl.SNIServerName; import javax.net.ssl.SSLProtocolException; import javax.net.ssl.StandardConstants; +import static sun.security.ssl.SSLExtension.CH_SERVER_NAME; +import static sun.security.ssl.SSLExtension.EE_SERVER_NAME; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import static sun.security.ssl.SSLExtension.SH_SERVER_NAME; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; -/* - * [RFC 4366/6066] To facilitate secure connections to servers that host - * multiple 'virtual' servers at a single underlying network address, clients - * MAY include an extension of type "server_name" in the (extended) client - * hello. The "extension_data" field of this extension SHALL contain - * "ServerNameList" where: - * - * struct { - * NameType name_type; - * select (name_type) { - * case host_name: HostName; - * } name; - * } ServerName; - * - * enum { - * host_name(0), (255) - * } NameType; - * - * opaque HostName<1..2^16-1>; - * - * struct { - * ServerName server_name_list<1..2^16-1> - * } ServerNameList; +/** + * Pack of the "server_name" extensions [RFC 4366/6066]. */ -final class ServerNameExtension extends HelloExtension { - - // For backward compatibility, all future data structures associated with - // new NameTypes MUST begin with a 16-bit length field. - static final int NAME_HEADER_LENGTH = 3; // NameType: 1 byte - // Name length: 2 bytes - private Map<Integer, SNIServerName> sniMap; - private int listLength; // ServerNameList length - - // constructor for ServerHello - ServerNameExtension() throws IOException { - super(ExtensionType.EXT_SERVER_NAME); - - listLength = 0; - sniMap = Collections.<Integer, SNIServerName>emptyMap(); - } +final class ServerNameExtension { + static final HandshakeProducer chNetworkProducer = + new CHServerNameProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHServerNameConsumer(); + static final SSLStringizer chStringizer = + new CHServerNamesStringizer(); + + static final HandshakeProducer shNetworkProducer = + new SHServerNameProducer(); + static final ExtensionConsumer shOnLoadConsumer = + new SHServerNameConsumer(); + static final SSLStringizer shStringizer = + new SHServerNamesStringizer(); + + static final HandshakeProducer eeNetworkProducer = + new EEServerNameProducer(); + static final ExtensionConsumer eeOnLoadConsumer = + new EEServerNameConsumer(); - // constructor for ClientHello - ServerNameExtension(List<SNIServerName> serverNames) - throws IOException { - super(ExtensionType.EXT_SERVER_NAME); - - listLength = 0; - sniMap = new LinkedHashMap<>(); - for (SNIServerName serverName : serverNames) { - // check for duplicated server name type - if (sniMap.put(serverName.getType(), serverName) != null) { - // unlikely to happen, but in case ... - throw new RuntimeException( - "Duplicated server name of type " + serverName.getType()); - } - - listLength += serverName.getEncoded().length + NAME_HEADER_LENGTH; - } - - // This constructor is used for ClientHello only. Empty list is - // not allowed in client mode. - if (listLength == 0) { - throw new RuntimeException("The ServerNameList cannot be empty"); + /** + * The "server_name" extension. + * + * See RFC 4366/6066 for the specification of the extension. + */ + static final class CHServerNamesSpec implements SSLExtensionSpec { + // For backward compatibility, all future data structures associated + // with new NameTypes MUST begin with a 16-bit length field. + static final int NAME_HEADER_LENGTH = 3; // 1: NameType + // +2: Name length + final List<SNIServerName> serverNames; + + private CHServerNamesSpec(List<SNIServerName> serverNames) { + this.serverNames = + Collections.<SNIServerName>unmodifiableList(serverNames); } - } - // constructor for ServerHello for parsing SNI extension - ServerNameExtension(HandshakeInStream s, int len) - throws IOException { - super(ExtensionType.EXT_SERVER_NAME); - - int remains = len; - if (len >= 2) { // "server_name" extension in ClientHello - listLength = s.getInt16(); // ServerNameList length - if (listLength == 0 || listLength + 2 != len) { + private CHServerNamesSpec(ByteBuffer buffer) throws IOException { + if (buffer.remaining() < 2) { throw new SSLProtocolException( - "Invalid " + type + " extension"); + "Invalid server_name extension: insufficient data"); } - remains -= 2; - sniMap = new LinkedHashMap<>(); - while (remains > 0) { - int code = s.getInt8(); // NameType + int sniLen = Record.getInt16(buffer); + if ((sniLen == 0) || sniLen != buffer.remaining()) { + throw new SSLProtocolException( + "Invalid server_name extension: incomplete data"); + } - // HostName (length read in getBytes16); - byte[] encoded = s.getBytes16(); + Map<Integer, SNIServerName> sniMap = new LinkedHashMap<>(); + while (buffer.hasRemaining()) { + int nameType = Record.getInt8(buffer); SNIServerName serverName; - switch (code) { - case StandardConstants.SNI_HOST_NAME: - if (encoded.length == 0) { - throw new SSLProtocolException( - "Empty HostName in server name indication"); - } - try { - serverName = new SNIHostName(encoded); - } catch (IllegalArgumentException iae) { - SSLProtocolException spe = new SSLProtocolException( - "Illegal server name, type=host_name(" + - code + "), name=" + - (new String(encoded, StandardCharsets.UTF_8)) + - ", value=" + Debug.toString(encoded)); - spe.initCause(iae); - throw spe; - } - break; - default: - try { - serverName = new UnknownServerName(code, encoded); - } catch (IllegalArgumentException iae) { - SSLProtocolException spe = new SSLProtocolException( - "Illegal server name, type=(" + code + - "), value=" + Debug.toString(encoded)); - spe.initCause(iae); - throw spe; - } + + // HostName (length read in getBytes16); + // + // [RFC 6066] The data structure associated with the host_name + // NameType is a variable-length vector that begins with a + // 16-bit length. For backward compatibility, all future data + // structures associated with new NameTypes MUST begin with a + // 16-bit length field. TLS MAY treat provided server names as + // opaque data and pass the names and types to the application. + byte[] encoded = Record.getBytes16(buffer); + if (nameType == StandardConstants.SNI_HOST_NAME) { + if (encoded.length == 0) { + throw new SSLProtocolException( + "Empty HostName in server_name extension"); + } + + try { + serverName = new SNIHostName(encoded); + } catch (IllegalArgumentException iae) { + SSLProtocolException spe = new SSLProtocolException( + "Illegal server name, type=host_name(" + + nameType + "), name=" + + (new String(encoded, StandardCharsets.UTF_8)) + + ", value={" + + Utilities.toHexString(encoded) + "}"); + throw (SSLProtocolException)spe.initCause(iae); + } + } else { + try { + serverName = new UnknownServerName(nameType, encoded); + } catch (IllegalArgumentException iae) { + SSLProtocolException spe = new SSLProtocolException( + "Illegal server name, type=(" + nameType + + "), value={" + + Utilities.toHexString(encoded) + "}"); + throw (SSLProtocolException)spe.initCause(iae); + } } + // check for duplicated server name type if (sniMap.put(serverName.getType(), serverName) != null) { throw new SSLProtocolException( "Duplicated server name of type " + serverName.getType()); } + } + + this.serverNames = new ArrayList<>(sniMap.values()); + } + + @Override + public String toString() { + if (serverNames == null || serverNames.isEmpty()) { + return "<no server name indicator specified>"; + } else { + StringBuilder builder = new StringBuilder(512); + for (SNIServerName sn : serverNames) { + builder.append(sn.toString()); + builder.append("\n"); + } - remains -= encoded.length + NAME_HEADER_LENGTH; + return builder.toString(); } - } else if (len == 0) { // "server_name" extension in ServerHello - listLength = 0; - sniMap = Collections.<Integer, SNIServerName>emptyMap(); } - if (remains != 0) { - throw new SSLProtocolException("Invalid server_name extension"); + private static class UnknownServerName extends SNIServerName { + UnknownServerName(int code, byte[] encoded) { + super(code, encoded); + } } } - List<SNIServerName> getServerNames() { - if (sniMap != null && !sniMap.isEmpty()) { - return Collections.<SNIServerName>unmodifiableList( - new ArrayList<>(sniMap.values())); + private static final class CHServerNamesStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new CHServerNamesSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } } + } + + /** + * Network data producer of a "server_name" extension in the + * ClientHello handshake message. + */ + private static final + class CHServerNameProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHServerNameProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(CH_SERVER_NAME)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore unavailable server_name extension"); + } + return null; + } + + // Produce the extension. + List<SNIServerName> serverNames; + if (chc.isResumption && (chc.resumingSession != null)) { + serverNames = + chc.resumingSession.getRequestedServerNames(); + } else { + serverNames = chc.sslConfig.serverNames; + } // Shall we use host too? + + // Empty server name list is not allowed in client mode. + if ((serverNames != null) && !serverNames.isEmpty()) { + int sniLen = 0; + for (SNIServerName sniName : serverNames) { + // For backward compatibility, all future data structures + // associated with new NameTypes MUST begin with a 16-bit + // length field. The header length of server name is 3 + // bytes, including 1 byte NameType, and 2 bytes length + // of the name. + sniLen += CHServerNamesSpec.NAME_HEADER_LENGTH; + sniLen += sniName.getEncoded().length; + } + + byte[] extData = new byte[sniLen + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, sniLen); + for (SNIServerName sniName : serverNames) { + Record.putInt8(m, sniName.getType()); + Record.putBytes16(m, sniName.getEncoded()); + } + + // Update the context. + chc.requestedServerNames = serverNames; + chc.handshakeExtensions.put(CH_SERVER_NAME, + new CHServerNamesSpec(serverNames)); - return Collections.<SNIServerName>emptyList(); + return extData; + } + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("Unable to indicate server name"); + } + return null; + } } - /* - * Is the extension recognized by the corresponding matcher? - * - * This method is used to check whether the server name indication can - * be recognized by the server name matchers. - * - * Per RFC 6066, if the server understood the ClientHello extension but - * does not recognize the server name, the server SHOULD take one of two - * actions: either abort the handshake by sending a fatal-level - * unrecognized_name(112) alert or continue the handshake. - * - * If there is an instance of SNIMatcher defined for a particular name - * type, it must be used to perform match operations on the server name. + /** + * Network data consumer of a "server_name" extension in the + * ClientHello handshake message. */ - boolean isMatched(Collection<SNIMatcher> matchers) { - if (sniMap != null && !sniMap.isEmpty()) { - for (SNIMatcher matcher : matchers) { - SNIServerName sniName = sniMap.get(matcher.getType()); - if (sniName != null && (!matcher.matches(sniName))) { - return false; + private static final + class CHServerNameConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHServerNameConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(CH_SERVER_NAME)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + CH_SERVER_NAME.name); + } + return; // ignore the extension + } + + // Parse the extension. + CHServerNamesSpec spec; + try { + spec = new CHServerNamesSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + shc.handshakeExtensions.put(CH_SERVER_NAME, spec); + + // Does the server match the server name request? + SNIServerName sni = null; + if (!shc.sslConfig.sniMatchers.isEmpty()) { + sni = chooseSni(shc.sslConfig.sniMatchers, spec.serverNames); + if (sni != null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "server name indication (" + + sni + ") is accepted"); + } + } else { + // We do not reject client without SNI extension currently. + shc.conContext.fatal(Alert.UNRECOGNIZED_NAME, + "Unrecognized server name indication"); + } + } else { + // Note: Servers MAY require clients to send a valid + // "server_name" extension and respond to a ClientHello + // lacking a "server_name" extension by terminating the + // connection with a "missing_extension" alert. + // + // We do not reject client without SNI extension currently. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "no server name matchers, " + + "ignore server name indication"); } } + + // Impact on session resumption. + // + // Does the resuming session have the same principal? + if (shc.isResumption && shc.resumingSession != null) { + // A server that implements this extension MUST NOT accept + // the request to resume the session if the server_name + // extension contains a different name. + // + // May only need to check that the session SNI is one of + // the requested server names. + if (!Objects.equals( + sni, shc.resumingSession.serverNameIndication)) { + shc.isResumption = false; + shc.resumingSession = null; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "abort session resumption, " + + "different server name indication used"); + } + } + } + + shc.requestedServerNames = spec.serverNames; + shc.negotiatedServerName = sni; } - return true; + private static SNIServerName chooseSni(Collection<SNIMatcher> matchers, + List<SNIServerName> sniNames) { + if (sniNames != null && !sniNames.isEmpty()) { + for (SNIMatcher matcher : matchers) { + int matcherType = matcher.getType(); + for (SNIServerName sniName : sniNames) { + if (sniName.getType() == matcherType) { + if (matcher.matches(sniName)) { + return sniName; + } + + // no duplicated entry in the server names list. + break; + } + } + } + } + + return null; + } } - /* - * Is the extension is identical to a server name list? - * - * This method is used to check the server name indication during session - * resumption. + /** + * The "server_name" extension in the ServerHello handshake message. * - * Per RFC 6066, when the server is deciding whether or not to accept a - * request to resume a session, the contents of a server_name extension - * MAY be used in the lookup of the session in the session cache. The - * client SHOULD include the same server_name extension in the session - * resumption request as it did in the full handshake that established - * the session. A server that implements this extension MUST NOT accept - * the request to resume the session if the server_name extension contains - * a different name. Instead, it proceeds with a full handshake to - * establish a new session. When resuming a session, the server MUST NOT - * include a server_name extension in the server hello. + * The "extension_data" field of this extension shall be empty. */ - boolean isIdentical(List<SNIServerName> other) { - if (other.size() == sniMap.size()) { - for(SNIServerName sniInOther : other) { - SNIServerName sniName = sniMap.get(sniInOther.getType()); - if (sniName == null || !sniInOther.equals(sniName)) { - return false; - } - } + static final class SHServerNamesSpec implements SSLExtensionSpec { + static final SHServerNamesSpec DEFAULT = new SHServerNamesSpec(); - return true; + private SHServerNamesSpec() { + // blank } - return false; + private SHServerNamesSpec(ByteBuffer buffer) throws IOException { + if (buffer.remaining() != 0) { + throw new SSLProtocolException( + "Invalid ServerHello server_name extension: not empty"); + } + } + + @Override + public String toString() { + return "<empty extension_data field>"; + } } - @Override - int length() { - return listLength == 0 ? 4 : 6 + listLength; + private static final class SHServerNamesStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new SHServerNamesSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } } - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - if (listLength == 0) { - s.putInt16(listLength); // in ServerHello, empty extension_data - } else { - s.putInt16(listLength + 2); // length of extension_data - s.putInt16(listLength); // length of ServerNameList - - for (SNIServerName sniName : sniMap.values()) { - s.putInt8(sniName.getType()); // server name type - s.putBytes16(sniName.getEncoded()); // server name value + /** + * Network data producer of a "server_name" extension in the + * ServerHello handshake message. + */ + private static final + class SHServerNameProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHServerNameProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // In response to "server_name" extension request only + CHServerNamesSpec spec = (CHServerNamesSpec) + shc.handshakeExtensions.get(CH_SERVER_NAME); + if (spec == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Ignore unavailable extension: " + SH_SERVER_NAME.name); + } + return null; // ignore the extension + } + + // When resuming a session, the server MUST NOT include a + // server_name extension in the server hello. + if (shc.isResumption || shc.negotiatedServerName == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "No expected server name indication response"); + } + return null; // ignore the extension } + + // Produce the extension and update the context. + shc.handshakeExtensions.put( + SH_SERVER_NAME, SHServerNamesSpec.DEFAULT); + + return (new byte[0]); // the empty extension_data } } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - for (SNIServerName sniName : sniMap.values()) { - sb.append("[" + sniName + "]"); + /** + * Network data consumer of a "server_name" extension in the + * ServerHello handshake message. + */ + private static final + class SHServerNameConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHServerNameConsumer() { + // blank } - return "Extension " + type + ", server_name: " + sb; + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to "server_name" extension request only + CHServerNamesSpec spec = (CHServerNamesSpec) + chc.handshakeExtensions.get(CH_SERVER_NAME); + if (spec == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected ServerHello server_name extension"); + } + + // Parse the extension. + if (buffer.remaining() != 0) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid ServerHello server_name extension"); + } + + // Update the context. + chc.handshakeExtensions.put( + SH_SERVER_NAME, SHServerNamesSpec.DEFAULT); + // The negotiated server name is unknown in client side. Just + // use the first request name as the value is not actually used + // in the current implementation. + chc.negotiatedServerName = spec.serverNames.get(0); + } } - private static class UnknownServerName extends SNIServerName { - UnknownServerName(int code, byte[] encoded) { - super(code, encoded); + /** + * Network data producer of a "server_name" extension in the + * EncryptedExtensions handshake message. + */ + private static final + class EEServerNameProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private EEServerNameProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // In response to "server_name" extension request only + CHServerNamesSpec spec = (CHServerNamesSpec) + shc.handshakeExtensions.get(CH_SERVER_NAME); + if (spec == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "Ignore unavailable extension: " + EE_SERVER_NAME.name); + } + return null; // ignore the extension + } + + // When resuming a session, the server MUST NOT include a + // server_name extension in the server hello. + if (shc.isResumption || shc.negotiatedServerName == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest( + "No expected server name indication response"); + } + return null; // ignore the extension + } + + // Produce the extension and update the context. + shc.handshakeExtensions.put( + EE_SERVER_NAME, SHServerNamesSpec.DEFAULT); + + return (new byte[0]); // the empty extension_data } } + /** + * Network data consumer of a "server_name" extension in the + * EncryptedExtensions handshake message. + */ + private static final + class EEServerNameConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private EEServerNameConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // In response to "server_name" extension request only + CHServerNamesSpec spec = (CHServerNamesSpec) + chc.handshakeExtensions.get(CH_SERVER_NAME); + if (spec == null) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected EncryptedExtensions server_name extension"); + } + + // Parse the extension. + if (buffer.remaining() != 0) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, + "Invalid EncryptedExtensions server_name extension"); + } + + // Update the context. + chc.handshakeExtensions.put( + EE_SERVER_NAME, SHServerNamesSpec.DEFAULT); + // The negotiated server name is unknown in client side. Just + // use the first request name as the value is not actually used + // in the current implementation. + chc.negotiatedServerName = spec.serverNames.get(0); + } + } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SessionId.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SessionId.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SessionId.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SessionId.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,105 +23,83 @@ * questions. */ - package sun.security.ssl; import java.security.SecureRandom; +import java.util.Arrays; import javax.net.ssl.SSLProtocolException; /** - * Encapsulates an SSL session ID. SSL Session IDs are not reused by - * servers during the lifetime of any sessions it created. Sessions may - * be used by many connections, either concurrently (for example, two - * connections to a web server at the same time) or sequentially (over as - * long a time period as is allowed by a given server). + * Encapsulates an SSL session ID. * * @author Satish Dharmaraj * @author David Brownell */ -final -class SessionId -{ - static int MAX_LENGTH = 32; - private byte[] sessionId; // max 32 bytes - - /** Constructs a new session ID ... perhaps for a rejoinable session */ - SessionId (boolean isRejoinable, SecureRandom generator) - { - if (isRejoinable) - // this will be unique, it's a timestamp plus much randomness - sessionId = new RandomCookie (generator).random_bytes; - else - sessionId = new byte [0]; - } - - /** Constructs a session ID from a byte array (max size 32 bytes) */ - SessionId (byte[] sessionId) - { this.sessionId = sessionId; } - - /** Returns the length of the ID, in bytes */ - int length () - { return sessionId.length; } - - /** Returns the bytes in the ID. May be an empty array. */ - byte[] getId () - { - return sessionId.clone (); +final class SessionId { + private static final int MAX_LENGTH = 32; + private final byte[] sessionId; // max 32 bytes + + // Constructs a new session ID ... perhaps for a rejoinable session + SessionId(boolean isRejoinable, SecureRandom generator) { + if (isRejoinable && (generator != null)) { + sessionId = new RandomCookie(generator).randomBytes; + } else { + sessionId = new byte[0]; + } + } + + // Constructs a session ID from a byte array (max size 32 bytes) + SessionId(byte[] sessionId) { + this.sessionId = sessionId.clone(); + } + + // Returns the length of the ID, in bytes + int length() { + return sessionId.length; + } + + // Returns the bytes in the ID. May be an empty array. + byte[] getId() { + return sessionId.clone(); } - /** Returns the ID as a string */ + // Returns the ID as a string @Override - public String toString () - { - int len = sessionId.length; - StringBuilder sb = new StringBuilder (10 + 2 * len); - - sb.append("{"); - for (int i = 0; i < len; i++) { - sb.append(0x0ff & sessionId[i]); - if (i != (len - 1)) - sb.append (", "); + public String toString() { + if (sessionId.length == 0) { + return ""; } - sb.append("}"); - return sb.toString (); + + return Utilities.toHexString(sessionId); } - /** Returns a value which is the same for session IDs which are equal */ + // Returns a value which is the same for session IDs which are equal @Override - public int hashCode () - { - int retval = 0; - - for (int i = 0; i < sessionId.length; i++) - retval += sessionId [i]; - return retval; + public int hashCode() { + return Arrays.hashCode(sessionId); } - /** Returns true if the parameter is the same session ID */ + // Returns true if the parameter is the same session ID @Override - public boolean equals (Object obj) - { - if (!(obj instanceof SessionId)) - return false; - - SessionId s = (SessionId) obj; - byte[] b = s.getId (); - - if (b.length != sessionId.length) - return false; - for (int i = 0; i < sessionId.length; i++) { - if (b [i] != sessionId [i]) - return false; + public boolean equals (Object obj) { + if (obj == this) { + return true; } - return true; + + if (obj instanceof SessionId) { + SessionId that = (SessionId)obj; + return Arrays.equals(this.sessionId, that.sessionId); + } + + return false; } /** * Checks the length of the session ID to make sure it sits within * the range called out in the specification */ - void checkLength(ProtocolVersion pv) throws SSLProtocolException { + void checkLength(int protocolVersion) throws SSLProtocolException { // As of today all versions of TLS have a 32-byte maximum length. // In the future we can do more here to support protocol versions // that may have longer max lengths. @@ -130,5 +108,4 @@ sessionId.length + " bytes)"); } } - } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SignatureAlgorithmsExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,110 +26,530 @@ package sun.security.ssl; import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; - +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.Arrays; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; import javax.net.ssl.SSLProtocolException; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; -/* - * [RFC5246] The client uses the "signature_algorithms" extension to - * indicate to the server which signature/hash algorithm pairs may be - * used in digital signatures. The "extension_data" field of this - * extension contains a "supported_signature_algorithms" value. - * - * enum { - * none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), - * sha512(6), (255) - * } HashAlgorithm; - * - * enum { anonymous(0), rsa(1), dsa(2), ecdsa(3), (255) } - * SignatureAlgorithm; - * - * struct { - * HashAlgorithm hash; - * SignatureAlgorithm signature; - * } SignatureAndHashAlgorithm; - * - * SignatureAndHashAlgorithm - * supported_signature_algorithms<2..2^16-2>; +/** + * Pack of the "signature_algorithms" extensions [RFC 5246]. */ -final class SignatureAlgorithmsExtension extends HelloExtension { +final class SignatureAlgorithmsExtension { + static final HandshakeProducer chNetworkProducer = + new CHSignatureSchemesProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHSignatureSchemesConsumer(); + static final HandshakeAbsence chOnLoadAbsence = + new CHSignatureSchemesOnLoadAbsence(); + static final HandshakeConsumer chOnTradeConsumer = + new CHSignatureSchemesUpdate(); + static final HandshakeAbsence chOnTradeAbsence = + new CHSignatureSchemesOnTradeAbsence(); + + static final HandshakeProducer crNetworkProducer = + new CRSignatureSchemesProducer(); + static final ExtensionConsumer crOnLoadConsumer = + new CRSignatureSchemesConsumer(); + static final HandshakeAbsence crOnLoadAbsence = + new CRSignatureSchemesAbsence(); + static final HandshakeConsumer crOnTradeConsumer = + new CRSignatureSchemesUpdate(); + + static final SSLStringizer ssStringizer = + new SignatureSchemesStringizer(); + + /** + * The "signature_algorithms" extension. + */ + static final class SignatureSchemesSpec implements SSLExtensionSpec { + final int[] signatureSchemes; + + SignatureSchemesSpec(List<SignatureScheme> schemes) { + if (schemes != null) { + signatureSchemes = new int[schemes.size()]; + int i = 0; + for (SignatureScheme scheme : schemes) { + signatureSchemes[i++] = scheme.id; + } + } else { + this.signatureSchemes = new int[0]; + } + } + + SignatureSchemesSpec(ByteBuffer buffer) throws IOException { + if (buffer.remaining() < 2) { // 2: the length of the list + throw new SSLProtocolException( + "Invalid signature_algorithms: insufficient data"); + } + + byte[] algs = Record.getBytes16(buffer); + if (buffer.hasRemaining()) { + throw new SSLProtocolException( + "Invalid signature_algorithms: unknown extra data"); + } + + if (algs == null || algs.length == 0 || (algs.length & 0x01) != 0) { + throw new SSLProtocolException( + "Invalid signature_algorithms: incomplete data"); + } - private Collection<SignatureAndHashAlgorithm> algorithms; - private int algorithmsLen; // length of supported_signature_algorithms + int[] schemes = new int[algs.length / 2]; + for (int i = 0, j = 0; i < algs.length;) { + byte hash = algs[i++]; + byte sign = algs[i++]; + schemes[j++] = ((hash & 0xFF) << 8) | (sign & 0xFF); + } - SignatureAlgorithmsExtension( - Collection<SignatureAndHashAlgorithm> signAlgs) { + this.signatureSchemes = schemes; + } - super(ExtensionType.EXT_SIGNATURE_ALGORITHMS); + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"signature schemes\": '['{0}']'", Locale.ENGLISH); + + if (signatureSchemes == null || signatureSchemes.length == 0) { + Object[] messageFields = { + "<no supported signature schemes specified>" + }; + return messageFormat.format(messageFields); + } else { + StringBuilder builder = new StringBuilder(512); + boolean isFirst = true; + for (int pv : signatureSchemes) { + if (isFirst) { + isFirst = false; + } else { + builder.append(", "); + } + + builder.append(SignatureScheme.nameOf(pv)); + } + + Object[] messageFields = { + builder.toString() + }; - algorithms = new ArrayList<SignatureAndHashAlgorithm>(signAlgs); - algorithmsLen = - SignatureAndHashAlgorithm.sizeInRecord() * algorithms.size(); + return messageFormat.format(messageFields); + } + } } - SignatureAlgorithmsExtension(HandshakeInStream s, int len) - throws IOException { - super(ExtensionType.EXT_SIGNATURE_ALGORITHMS); + private static final + class SignatureSchemesStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new SignatureSchemesSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } - algorithmsLen = s.getInt16(); - if (algorithmsLen == 0 || algorithmsLen + 2 != len) { - throw new SSLProtocolException("Invalid " + type + " extension"); + /** + * Network data producer of a "signature_algorithms" extension in + * the ClientHello handshake message. + */ + private static final + class CHSignatureSchemesProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHSignatureSchemesProducer() { + // blank } - algorithms = new ArrayList<SignatureAndHashAlgorithm>(); - int remains = algorithmsLen; - int sequence = 0; - while (remains > 1) { // needs at least two bytes - int hash = s.getInt8(); // hash algorithm - int signature = s.getInt8(); // signature algorithm + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable( + SSLExtension.CH_SIGNATURE_ALGORITHMS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable signature_algorithms extension"); + } + return null; + } + + // Produce the extension. + if (chc.localSupportedSignAlgs == null) { + chc.localSupportedSignAlgs = + SignatureScheme.getSupportedAlgorithms( + chc.algorithmConstraints, chc.activeProtocols); + } + + int vectorLen = SignatureScheme.sizeInRecord() * + chc.localSupportedSignAlgs.size(); + byte[] extData = new byte[vectorLen + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, vectorLen); + for (SignatureScheme ss : chc.localSupportedSignAlgs) { + Record.putInt16(m, ss.id); + } + + // Update the context. + chc.handshakeExtensions.put( + SSLExtension.CH_SIGNATURE_ALGORITHMS, + new SignatureSchemesSpec(chc.localSupportedSignAlgs)); + + return extData; + } + } - SignatureAndHashAlgorithm algorithm = - SignatureAndHashAlgorithm.valueOf(hash, signature, ++sequence); - algorithms.add(algorithm); - remains -= 2; // one byte for hash, one byte for signature + /** + * Network data consumer of a "signature_algorithms" extension in + * the ClientHello handshake message. + */ + private static final + class CHSignatureSchemesConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHSignatureSchemesConsumer() { + // blank } - if (remains != 0) { - throw new SSLProtocolException("Invalid server_name extension"); + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable( + SSLExtension.CH_SIGNATURE_ALGORITHMS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable signature_algorithms extension"); + } + return; // ignore the extension + } + + // Parse the extension. + SignatureSchemesSpec spec; + try { + spec = new SignatureSchemesSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + shc.handshakeExtensions.put( + SSLExtension.CH_SIGNATURE_ALGORITHMS, spec); + + // No impact on session resumption. } } - Collection<SignatureAndHashAlgorithm> getSignAlgorithms() { - return algorithms; + /** + * After session creation consuming of a "signature_algorithms" + * extension in the ClientHello handshake message. + */ + private static final class CHSignatureSchemesUpdate + implements HandshakeConsumer { + // Prevent instantiation of this class. + private CHSignatureSchemesUpdate() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + SignatureSchemesSpec spec = + (SignatureSchemesSpec)shc.handshakeExtensions.get( + SSLExtension.CH_SIGNATURE_ALGORITHMS); + if (spec == null) { + // Ignore, no "signature_algorithms" extension requested. + return; + } + + // update the context + List<SignatureScheme> sss = + SignatureScheme.getSupportedAlgorithms( + shc.algorithmConstraints, shc.negotiatedProtocol, + spec.signatureSchemes); + shc.peerRequestedSignatureSchemes = sss; + + // If no "signature_algorithms_cert" extension is present, then + // the "signature_algorithms" extension also applies to + // signatures appearing in certificates. + SignatureSchemesSpec certSpec = + (SignatureSchemesSpec)shc.handshakeExtensions.get( + SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT); + if (certSpec == null) { + shc.peerRequestedCertSignSchemes = sss; + shc.handshakeSession.setPeerSupportedSignatureAlgorithms(sss); + } + + if (!shc.isResumption && + shc.negotiatedProtocol.useTLS13PlusSpec()) { + if (shc.sslConfig.clientAuthType != + ClientAuthType.CLIENT_AUTH_NONE) { + shc.handshakeProducers.putIfAbsent( + SSLHandshake.CERTIFICATE_REQUEST.id, + SSLHandshake.CERTIFICATE_REQUEST); + } + shc.handshakeProducers.put( + SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE); + shc.handshakeProducers.putIfAbsent( + SSLHandshake.CERTIFICATE_VERIFY.id, + SSLHandshake.CERTIFICATE_VERIFY); + } + } } - @Override - int length() { - return 6 + algorithmsLen; + /** + * The absence processing if a "signature_algorithms" extension is + * not present in the ClientHello handshake message. + */ + private static final + class CHSignatureSchemesOnLoadAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // This is a mandatory extension for certificate authentication + // in TLS 1.3. + // + // We may support the server authentication other than X.509 + // certificate later. + if (shc.negotiatedProtocol.useTLS13PlusSpec()) { + shc.conContext.fatal(Alert.MISSING_EXTENSION, + "No mandatory signature_algorithms extension in the " + + "received CertificateRequest handshake message"); + } + } } - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - s.putInt16(algorithmsLen + 2); - s.putInt16(algorithmsLen); + /** + * The absence processing if a "signature_algorithms" extension is + * not present in the ClientHello handshake message. + */ + private static final + class CHSignatureSchemesOnTradeAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + if (shc.negotiatedProtocol.useTLS12PlusSpec()) { + // Use default hash and signature algorithm: + // {sha1,rsa} + // {sha1,dsa} + // {sha1,ecdsa} + // Per RFC 5246, If the client supports only the default hash + // and signature algorithms, it MAY omit the + // signature_algorithms extension. If the client does not + // support the default algorithms, or supports other hash + // and signature algorithms (and it is willing to use them + // for verifying messages sent by the server, i.e., server + // certificates and server key exchange), it MUST send the + // signature_algorithms extension, listing the algorithms it + // is willing to accept. + List<SignatureScheme> shemes = Arrays.asList( + SignatureScheme.RSA_PKCS1_SHA1, + SignatureScheme.DSA_SHA1, + SignatureScheme.ECDSA_SHA1 + ); + + shc.peerRequestedSignatureSchemes = shemes; + if (shc.peerRequestedCertSignSchemes == null || + shc.peerRequestedCertSignSchemes.isEmpty()) { + shc.peerRequestedCertSignSchemes = shemes; + } - for (SignatureAndHashAlgorithm algorithm : algorithms) { - s.putInt8(algorithm.getHashValue()); // HashAlgorithm - s.putInt8(algorithm.getSignatureValue()); // SignatureAlgorithm + // Use the default peer signature algorithms. + shc.handshakeSession.setUseDefaultPeerSignAlgs(); + } } } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - boolean opened = false; - for (SignatureAndHashAlgorithm signAlg : algorithms) { - if (opened) { - sb.append(", " + signAlg.getAlgorithmName()); - } else { - sb.append(signAlg.getAlgorithmName()); - opened = true; + /** + * Network data producer of a "signature_algorithms" extension in + * the CertificateRequest handshake message. + */ + private static final + class CRSignatureSchemesProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CRSignatureSchemesProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + // + // Note that this is a mandatory extension for CertificateRequest + // handshake message in TLS 1.3. + if (!shc.sslConfig.isAvailable( + SSLExtension.CR_SIGNATURE_ALGORITHMS)) { + shc.conContext.fatal(Alert.MISSING_EXTENSION, + "No available signature_algorithms extension " + + "for client certificate authentication"); + return null; // make the compiler happy + } + + // Produce the extension. + if (shc.localSupportedSignAlgs == null) { + shc.localSupportedSignAlgs = + SignatureScheme.getSupportedAlgorithms( + shc.algorithmConstraints, shc.activeProtocols); + } + + int vectorLen = SignatureScheme.sizeInRecord() * + shc.localSupportedSignAlgs.size(); + byte[] extData = new byte[vectorLen + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, vectorLen); + for (SignatureScheme ss : shc.localSupportedSignAlgs) { + Record.putInt16(m, ss.id); } + + // Update the context. + shc.handshakeExtensions.put( + SSLExtension.CR_SIGNATURE_ALGORITHMS, + new SignatureSchemesSpec(shc.localSupportedSignAlgs)); + + return extData; } + } - return "Extension " + type + ", signature_algorithms: " + sb; + /** + * Network data consumer of a "signature_algorithms" extension in + * the CertificateRequest handshake message. + */ + private static final + class CRSignatureSchemesConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CRSignatureSchemesConsumer() { + // blank + } + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + // + // Note that this is a mandatory extension for CertificateRequest + // handshake message in TLS 1.3. + if (!chc.sslConfig.isAvailable( + SSLExtension.CR_SIGNATURE_ALGORITHMS)) { + chc.conContext.fatal(Alert.HANDSHAKE_FAILURE, + "No available signature_algorithms extension " + + "for client certificate authentication"); + return; // make the compiler happy + } + + // Parse the extension. + SignatureSchemesSpec spec; + try { + spec = new SignatureSchemesSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + List<SignatureScheme> knownSignatureSchemes = new LinkedList<>(); + for (int id : spec.signatureSchemes) { + SignatureScheme ss = SignatureScheme.valueOf(id); + if (ss != null) { + knownSignatureSchemes.add(ss); + } + } + + // Update the context. + // chc.peerRequestedSignatureSchemes = knownSignatureSchemes; + chc.handshakeExtensions.put( + SSLExtension.CR_SIGNATURE_ALGORITHMS, spec); + + // No impact on session resumption. + } } -} + /** + * After session creation consuming of a "signature_algorithms" + * extension in the CertificateRequest handshake message. + */ + private static final class CRSignatureSchemesUpdate + implements HandshakeConsumer { + // Prevent instantiation of this class. + private CRSignatureSchemesUpdate() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + SignatureSchemesSpec spec = + (SignatureSchemesSpec)chc.handshakeExtensions.get( + SSLExtension.CR_SIGNATURE_ALGORITHMS); + if (spec == null) { + // Ignore, no "signature_algorithms" extension requested. + return; + } + + // update the context + List<SignatureScheme> sss = + SignatureScheme.getSupportedAlgorithms( + chc.algorithmConstraints, chc.negotiatedProtocol, + spec.signatureSchemes); + chc.peerRequestedSignatureSchemes = sss; + + // If no "signature_algorithms_cert" extension is present, then + // the "signature_algorithms" extension also applies to + // signatures appearing in certificates. + SignatureSchemesSpec certSpec = + (SignatureSchemesSpec)chc.handshakeExtensions.get( + SSLExtension.CH_SIGNATURE_ALGORITHMS_CERT); + if (certSpec == null) { + chc.peerRequestedCertSignSchemes = sss; + chc.handshakeSession.setPeerSupportedSignatureAlgorithms(sss); + } + } + } + + /** + * The absence processing if a "signature_algorithms" extension is + * not present in the CertificateRequest handshake message. + */ + private static final + class CRSignatureSchemesAbsence implements HandshakeAbsence { + @Override + public void absent(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // This is a mandatory extension for CertificateRequest handshake + // message in TLS 1.3. + chc.conContext.fatal(Alert.MISSING_EXTENSION, + "No mandatory signature_algorithms extension in the " + + "received CertificateRequest handshake message"); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SignatureAndHashAlgorithm.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,441 +0,0 @@ -/* - * Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.security.AlgorithmConstraints; -import java.security.CryptoPrimitive; -import java.security.PrivateKey; -import java.security.Security; - -import java.util.Set; -import java.util.HashSet; -import java.util.Map; -import java.util.EnumSet; -import java.util.TreeMap; -import java.util.Collection; -import java.util.Collections; -import java.util.ArrayList; - -import sun.security.util.KeyUtil; - -/** - * Signature and hash algorithm. - * - * [RFC5246] The client uses the "signature_algorithms" extension to - * indicate to the server which signature/hash algorithm pairs may be - * used in digital signatures. The "extension_data" field of this - * extension contains a "supported_signature_algorithms" value. - * - * enum { - * none(0), md5(1), sha1(2), sha224(3), sha256(4), sha384(5), - * sha512(6), (255) - * } HashAlgorithm; - * - * enum { anonymous(0), rsa(1), dsa(2), ecdsa(3), (255) } - * SignatureAlgorithm; - * - * struct { - * HashAlgorithm hash; - * SignatureAlgorithm signature; - * } SignatureAndHashAlgorithm; - */ -final class SignatureAndHashAlgorithm { - - // minimum priority for default enabled algorithms - static final int SUPPORTED_ALG_PRIORITY_MAX_NUM = 0x00F0; - - // performance optimization - private static final Set<CryptoPrimitive> SIGNATURE_PRIMITIVE_SET = - Collections.unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE)); - - // supported pairs of signature and hash algorithm - private static final Map<Integer, SignatureAndHashAlgorithm> supportedMap; - private static final Map<Integer, SignatureAndHashAlgorithm> priorityMap; - - // the hash algorithm - private HashAlgorithm hash; - - // id in 16 bit MSB format, i.e. 0x0603 for SHA512withECDSA - private int id; - - // the standard algorithm name, for example "SHA512withECDSA" - private String algorithm; - - // Priority for the preference order. The lower the better. - // - // If the algorithm is unsupported, its priority should be bigger - // than SUPPORTED_ALG_PRIORITY_MAX_NUM. - private int priority; - - // constructor for supported algorithm - private SignatureAndHashAlgorithm(HashAlgorithm hash, - SignatureAlgorithm signature, String algorithm, int priority) { - this.hash = hash; - this.algorithm = algorithm; - this.id = ((hash.value & 0xFF) << 8) | (signature.value & 0xFF); - this.priority = priority; - } - - // constructor for unsupported algorithm - private SignatureAndHashAlgorithm(String algorithm, int id, int sequence) { - this.hash = HashAlgorithm.valueOf((id >> 8) & 0xFF); - this.algorithm = algorithm; - this.id = id; - - // add one more to the sequence number, in case that the number is zero - this.priority = SUPPORTED_ALG_PRIORITY_MAX_NUM + sequence + 1; - } - - // Note that we do not use the sequence argument for supported algorithms, - // so please don't sort by comparing the objects read from handshake - // messages. - static SignatureAndHashAlgorithm valueOf(int hash, - int signature, int sequence) { - hash &= 0xFF; - signature &= 0xFF; - - int id = (hash << 8) | signature; - SignatureAndHashAlgorithm signAlg = supportedMap.get(id); - if (signAlg == null) { - // unsupported algorithm - signAlg = new SignatureAndHashAlgorithm( - "Unknown (hash:0x" + Integer.toString(hash, 16) + - ", signature:0x" + Integer.toString(signature, 16) + ")", - id, sequence); - } - - return signAlg; - } - - int getHashValue() { - return (id >> 8) & 0xFF; - } - - int getSignatureValue() { - return id & 0xFF; - } - - String getAlgorithmName() { - return algorithm; - } - - // return the size of a SignatureAndHashAlgorithm structure in TLS record - static int sizeInRecord() { - return 2; - } - - // Get local supported algorithm collection complying to - // algorithm constraints - static Collection<SignatureAndHashAlgorithm> - getSupportedAlgorithms(AlgorithmConstraints constraints) { - - Collection<SignatureAndHashAlgorithm> supported = new ArrayList<>(); - for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) { - if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && - constraints.permits(SIGNATURE_PRIMITIVE_SET, - sigAlg.algorithm, null)) { - supported.add(sigAlg); - } - } - - return supported; - } - - // Get supported algorithm collection from an untrusted collection - static Collection<SignatureAndHashAlgorithm> getSupportedAlgorithms( - AlgorithmConstraints constraints, - Collection<SignatureAndHashAlgorithm> algorithms ) { - Collection<SignatureAndHashAlgorithm> supported = new ArrayList<>(); - for (SignatureAndHashAlgorithm sigAlg : algorithms) { - if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && - constraints.permits(SIGNATURE_PRIMITIVE_SET, - sigAlg.algorithm, null)) { - supported.add(sigAlg); - } - } - - return supported; - } - - static String[] getAlgorithmNames( - Collection<SignatureAndHashAlgorithm> algorithms) { - ArrayList<String> algorithmNames = new ArrayList<>(); - if (algorithms != null) { - for (SignatureAndHashAlgorithm sigAlg : algorithms) { - algorithmNames.add(sigAlg.algorithm); - } - } - - String[] array = new String[algorithmNames.size()]; - return algorithmNames.toArray(array); - } - - static Set<String> getHashAlgorithmNames( - Collection<SignatureAndHashAlgorithm> algorithms) { - Set<String> algorithmNames = new HashSet<>(); - if (algorithms != null) { - for (SignatureAndHashAlgorithm sigAlg : algorithms) { - if (sigAlg.hash.value > 0) { - algorithmNames.add(sigAlg.hash.standardName); - } - } - } - - return algorithmNames; - } - - static String getHashAlgorithmName(SignatureAndHashAlgorithm algorithm) { - return algorithm.hash.standardName; - } - - private static void supports(HashAlgorithm hash, - SignatureAlgorithm signature, String algorithm, int priority) { - - SignatureAndHashAlgorithm pair = - new SignatureAndHashAlgorithm(hash, signature, algorithm, priority); - if (supportedMap.put(pair.id, pair) != null) { - throw new RuntimeException( - "Duplicate SignatureAndHashAlgorithm definition, id: " + - pair.id); - } - if (priorityMap.put(pair.priority, pair) != null) { - throw new RuntimeException( - "Duplicate SignatureAndHashAlgorithm definition, priority: " + - pair.priority); - } - } - - static SignatureAndHashAlgorithm getPreferableAlgorithm( - Collection<SignatureAndHashAlgorithm> algorithms, String expected) { - - return SignatureAndHashAlgorithm.getPreferableAlgorithm( - algorithms, expected, null); - } - - static SignatureAndHashAlgorithm getPreferableAlgorithm( - Collection<SignatureAndHashAlgorithm> algorithms, - String expected, PrivateKey signingKey) { - - int maxDigestLength = getMaxDigestLength(signingKey); - for (SignatureAndHashAlgorithm algorithm : algorithms) { - int signValue = algorithm.id & 0xFF; - if ((expected == null) || - (expected.equalsIgnoreCase("rsa") && - signValue == SignatureAlgorithm.RSA.value) || - (expected.equalsIgnoreCase("dsa") && - signValue == SignatureAlgorithm.DSA.value) || - (expected.equalsIgnoreCase("ecdsa") && - signValue == SignatureAlgorithm.ECDSA.value) || - (expected.equalsIgnoreCase("ec") && - signValue == SignatureAlgorithm.ECDSA.value)) { - - if (algorithm.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM && - algorithm.hash.length <= maxDigestLength) { - - return algorithm; - } - } - } - - return null; - } - - /* - * Need to check key length to match the length of hash value - */ - private static int getMaxDigestLength(PrivateKey signingKey) { - int maxDigestLength = Integer.MAX_VALUE; - - // only need to check RSA algorithm at present. - if (signingKey != null && - "rsa".equalsIgnoreCase(signingKey.getAlgorithm())) { - /* - * RSA keys of 512 bits have been shown to be practically - * breakable, it does not make much sense to use the strong - * hash algorithm for keys whose key size less than 512 bits. - * So it is not necessary to caculate the required max digest - * length exactly. - * - * If key size is greater than or equals to 768, there is no max - * digest length limitation in currect implementation. - * - * If key size is greater than or equals to 512, but less than - * 768, the digest length should be less than or equal to 32 bytes. - * - * If key size is less than 512, the digest length should be - * less than or equal to 20 bytes. - */ - int keySize = KeyUtil.getKeySize(signingKey); - if (keySize >= 768) { - maxDigestLength = HashAlgorithm.SHA512.length; - } else if ((keySize >= 512) && (keySize < 768)) { - maxDigestLength = HashAlgorithm.SHA256.length; - } else if ((keySize > 0) && (keySize < 512)) { - maxDigestLength = HashAlgorithm.SHA1.length; - } // Otherwise, cannot determine the key size, prefer the most - // preferable hash algorithm. - } - - return maxDigestLength; - } - - static enum HashAlgorithm { - UNDEFINED("undefined", "", -1, -1), - NONE( "none", "NONE", 0, -1), - MD5( "md5", "MD5", 1, 16), - SHA1( "sha1", "SHA-1", 2, 20), - SHA224( "sha224", "SHA-224", 3, 28), - SHA256( "sha256", "SHA-256", 4, 32), - SHA384( "sha384", "SHA-384", 5, 48), - SHA512( "sha512", "SHA-512", 6, 64); - - final String name; // not the standard signature algorithm name - // except the UNDEFINED, other names are defined - // by TLS 1.2 protocol - final String standardName; // the standard MessageDigest algorithm name - final int value; - final int length; // digest length in bytes, -1 means not applicable - - private HashAlgorithm(String name, String standardName, - int value, int length) { - this.name = name; - this.standardName = standardName; - this.value = value; - this.length = length; - } - - static HashAlgorithm valueOf(int value) { - HashAlgorithm algorithm = UNDEFINED; - switch (value) { - case 0: - algorithm = NONE; - break; - case 1: - algorithm = MD5; - break; - case 2: - algorithm = SHA1; - break; - case 3: - algorithm = SHA224; - break; - case 4: - algorithm = SHA256; - break; - case 5: - algorithm = SHA384; - break; - case 6: - algorithm = SHA512; - break; - } - - return algorithm; - } - } - - static enum SignatureAlgorithm { - UNDEFINED("undefined", -1), - ANONYMOUS("anonymous", 0), - RSA( "rsa", 1), - DSA( "dsa", 2), - ECDSA( "ecdsa", 3); - - final String name; // not the standard signature algorithm name - // except the UNDEFINED, other names are defined - // by TLS 1.2 protocol - final int value; - - private SignatureAlgorithm(String name, int value) { - this.name = name; - this.value = value; - } - - static SignatureAlgorithm valueOf(int value) { - SignatureAlgorithm algorithm = UNDEFINED; - switch (value) { - case 0: - algorithm = ANONYMOUS; - break; - case 1: - algorithm = RSA; - break; - case 2: - algorithm = DSA; - break; - case 3: - algorithm = ECDSA; - break; - } - - return algorithm; - } - } - - static { - supportedMap = Collections.synchronizedSortedMap( - new TreeMap<Integer, SignatureAndHashAlgorithm>()); - priorityMap = Collections.synchronizedSortedMap( - new TreeMap<Integer, SignatureAndHashAlgorithm>()); - - synchronized (supportedMap) { - int p = SUPPORTED_ALG_PRIORITY_MAX_NUM; - supports(HashAlgorithm.MD5, SignatureAlgorithm.RSA, - "MD5withRSA", --p); - supports(HashAlgorithm.SHA1, SignatureAlgorithm.DSA, - "SHA1withDSA", --p); - supports(HashAlgorithm.SHA1, SignatureAlgorithm.RSA, - "SHA1withRSA", --p); - supports(HashAlgorithm.SHA1, SignatureAlgorithm.ECDSA, - "SHA1withECDSA", --p); - - if (Security.getProvider("SunMSCAPI") == null) { - supports(HashAlgorithm.SHA224, SignatureAlgorithm.DSA, - "SHA224withDSA", --p); - supports(HashAlgorithm.SHA224, SignatureAlgorithm.RSA, - "SHA224withRSA", --p); - supports(HashAlgorithm.SHA224, SignatureAlgorithm.ECDSA, - "SHA224withECDSA", --p); - } - - supports(HashAlgorithm.SHA256, SignatureAlgorithm.DSA, - "SHA256withDSA", --p); - supports(HashAlgorithm.SHA256, SignatureAlgorithm.RSA, - "SHA256withRSA", --p); - supports(HashAlgorithm.SHA256, SignatureAlgorithm.ECDSA, - "SHA256withECDSA", --p); - supports(HashAlgorithm.SHA384, SignatureAlgorithm.RSA, - "SHA384withRSA", --p); - supports(HashAlgorithm.SHA384, SignatureAlgorithm.ECDSA, - "SHA384withECDSA", --p); - supports(HashAlgorithm.SHA512, SignatureAlgorithm.RSA, - "SHA512withRSA", --p); - supports(HashAlgorithm.SHA512, SignatureAlgorithm.ECDSA, - "SHA512withECDSA", --p); - } - } -} - diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SignatureScheme.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,485 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.security.*; +import java.security.interfaces.ECPrivateKey; +import java.security.spec.AlgorithmParameterSpec; +import java.security.spec.ECParameterSpec; +import java.security.spec.MGF1ParameterSpec; +import java.security.spec.PSSParameterSpec; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumSet; +import java.util.LinkedList; +import java.util.List; +import java.util.Set; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.SupportedGroupsExtension.NamedGroupType; +import sun.security.util.KeyUtil; + +enum SignatureScheme { + // EdDSA algorithms + ED25519 (0x0807, "ed25519", "ed25519", + "ed25519", + ProtocolVersion.PROTOCOLS_OF_13), + ED448 (0x0808, "ed448", "ed448", + "ed448", + ProtocolVersion.PROTOCOLS_OF_13), + + // ECDSA algorithms + ECDSA_SECP256R1_SHA256 (0x0403, "ecdsa_secp256r1_sha256", + "SHA256withECDSA", + "EC", + NamedGroup.SECP256_R1, + ProtocolVersion.PROTOCOLS_TO_13), + ECDSA_SECP384R1_SHA384 (0x0503, "ecdsa_secp384r1_sha384", + "SHA384withECDSA", + "EC", + NamedGroup.SECP384_R1, + ProtocolVersion.PROTOCOLS_TO_13), + ECDSA_SECP512R1_SHA512 (0x0603, "ecdsa_secp512r1_sha512", + "SHA512withECDSA", + "EC", + NamedGroup.SECP521_R1, + ProtocolVersion.PROTOCOLS_TO_13), + + // RSASSA-PSS algorithms with public key OID rsaEncryption + // + // The minimalKeySize is calculated as (See RFC 8017 for details): + // hash length + salt length + 16 + RSA_PSS_RSAE_SHA256 (0x0804, "rsa_pss_rsae_sha256", + "RSASSA-PSS", "RSA", + SigAlgParamSpec.RSA_PSS_SHA256, 528, + ProtocolVersion.PROTOCOLS_12_13), + RSA_PSS_RSAE_SHA384 (0x0805, "rsa_pss_rsae_sha384", + "RSASSA-PSS", "RSA", + SigAlgParamSpec.RSA_PSS_SHA384, 784, + ProtocolVersion.PROTOCOLS_12_13), + RSA_PSS_RSAE_SHA512 (0x0806, "rsa_pss_rsae_sha512", + "RSASSA-PSS", "RSA", + SigAlgParamSpec.RSA_PSS_SHA512, 1040, + ProtocolVersion.PROTOCOLS_12_13), + + // RSASSA-PSS algorithms with public key OID RSASSA-PSS + // + // The minimalKeySize is calculated as (See RFC 8017 for details): + // hash length + salt length + 16 + RSA_PSS_PSS_SHA256 (0x0809, "rsa_pss_pss_sha256", + "RSASSA-PSS", "RSASSA-PSS", + SigAlgParamSpec.RSA_PSS_SHA256, 528, + ProtocolVersion.PROTOCOLS_12_13), + RSA_PSS_PSS_SHA384 (0x080A, "rsa_pss_pss_sha384", + "RSASSA-PSS", "RSASSA-PSS", + SigAlgParamSpec.RSA_PSS_SHA384, 784, + ProtocolVersion.PROTOCOLS_12_13), + RSA_PSS_PSS_SHA512 (0x080B, "rsa_pss_pss_sha512", + "RSASSA-PSS", "RSASSA-PSS", + SigAlgParamSpec.RSA_PSS_SHA512, 1040, + ProtocolVersion.PROTOCOLS_12_13), + + // RSASSA-PKCS1-v1_5 algorithms + RSA_PKCS1_SHA256 (0x0401, "rsa_pkcs1_sha256", "SHA256withRSA", + "RSA", null, null, 511, + ProtocolVersion.PROTOCOLS_TO_13, + ProtocolVersion.PROTOCOLS_TO_12), + RSA_PKCS1_SHA384 (0x0501, "rsa_pkcs1_sha384", "SHA384withRSA", + "RSA", null, null, 768, + ProtocolVersion.PROTOCOLS_TO_13, + ProtocolVersion.PROTOCOLS_TO_12), + RSA_PKCS1_SHA512 (0x0601, "rsa_pkcs1_sha512", "SHA512withRSA", + "RSA", null, null, 768, + ProtocolVersion.PROTOCOLS_TO_13, + ProtocolVersion.PROTOCOLS_TO_12), + + // Legacy algorithms + DSA_SHA256 (0x0402, "dsa_sha256", "SHA256withDSA", + "DSA", + ProtocolVersion.PROTOCOLS_TO_12), + ECDSA_SHA224 (0x0303, "ecdsa_sha224", "SHA224withECDSA", + "EC", + ProtocolVersion.PROTOCOLS_TO_12), + RSA_SHA224 (0x0301, "rsa_sha224", "SHA224withRSA", + "RSA", 511, + ProtocolVersion.PROTOCOLS_TO_12), + DSA_SHA224 (0x0302, "dsa_sha224", "SHA224withDSA", + "DSA", + ProtocolVersion.PROTOCOLS_TO_12), + ECDSA_SHA1 (0x0203, "ecdsa_sha1", "SHA1withECDSA", + "EC", + ProtocolVersion.PROTOCOLS_TO_13), + RSA_PKCS1_SHA1 (0x0201, "rsa_pkcs1_sha1", "SHA1withRSA", + "RSA", null, null, 511, + ProtocolVersion.PROTOCOLS_TO_13, + ProtocolVersion.PROTOCOLS_TO_12), + DSA_SHA1 (0x0202, "dsa_sha1", "SHA1withDSA", + "DSA", + ProtocolVersion.PROTOCOLS_TO_12), + RSA_MD5 (0x0101, "rsa_md5", "MD5withRSA", + "RSA", 511, + ProtocolVersion.PROTOCOLS_TO_12); + + final int id; // hash + signature + final String name; // literal name + private final String algorithm; // signature algorithm + final String keyAlgorithm; // signature key algorithm + private final AlgorithmParameterSpec signAlgParameter; + private final NamedGroup namedGroup; // associated named group + + // The minimal required key size in bits. + // + // Only need to check RSA algorithm at present. RSA keys of 512 bits + // have been shown to be practically breakable, it does not make much + // sense to use the strong hash algorithm for keys whose key size less + // than 512 bits. So it is not necessary to calculate the minimal + // required key size exactly for a hash algorithm. + // + // Note that some provider may use 511 bits for 512-bit strength RSA keys. + final int minimalKeySize; + final List<ProtocolVersion> supportedProtocols; + + // Some signature schemes are supported in different versions for handshake + // messages and certificates. This field holds the supported protocols + // for handshake messages. + final List<ProtocolVersion> handshakeSupportedProtocols; + final boolean isAvailable; + + private static final String[] hashAlgorithms = new String[] { + "none", "md5", "sha1", "sha224", + "sha256", "sha384", "sha512" + }; + + private static final String[] signatureAlgorithms = new String[] { + "anonymous", "rsa", "dsa", "ecdsa", + }; + + static enum SigAlgParamSpec { // support RSASSA-PSS only now + RSA_PSS_SHA256 ("SHA-256", 32), + RSA_PSS_SHA384 ("SHA-384", 48), + RSA_PSS_SHA512 ("SHA-512", 64); + + final private AlgorithmParameterSpec parameterSpec; + final boolean isAvailable; + + SigAlgParamSpec(String hash, int saltLength) { + // See RFC 8017 + PSSParameterSpec pssParamSpec = + new PSSParameterSpec(hash, "MGF1", + new MGF1ParameterSpec(hash), saltLength, 1); + + boolean mediator = true; + try { + Signature signer = JsseJce.getSignature("RSASSA-PSS"); + signer.setParameter(pssParamSpec); + } catch (InvalidAlgorithmParameterException | + NoSuchAlgorithmException exp) { + mediator = false; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "RSASSA-PSS signature with " + hash + + " is not supported by the underlying providers", exp); + } + } + + this.isAvailable = mediator; + this.parameterSpec = mediator ? pssParamSpec : null; + } + + AlgorithmParameterSpec getParameterSpec() { + return parameterSpec; + } + } + + // performance optimization + private static final Set<CryptoPrimitive> SIGNATURE_PRIMITIVE_SET = + Collections.unmodifiableSet(EnumSet.of(CryptoPrimitive.SIGNATURE)); + + + private SignatureScheme(int id, String name, + String algorithm, String keyAlgorithm, + ProtocolVersion[] supportedProtocols) { + this(id, name, algorithm, keyAlgorithm, -1, supportedProtocols); + } + + private SignatureScheme(int id, String name, + String algorithm, String keyAlgorithm, + int minimalKeySize, + ProtocolVersion[] supportedProtocols) { + this(id, name, algorithm, keyAlgorithm, + null, minimalKeySize, supportedProtocols); + } + + private SignatureScheme(int id, String name, + String algorithm, String keyAlgorithm, + SigAlgParamSpec signAlgParamSpec, int minimalKeySize, + ProtocolVersion[] supportedProtocols) { + this(id, name, algorithm, keyAlgorithm, + signAlgParamSpec, null, minimalKeySize, + supportedProtocols, supportedProtocols); + } + + private SignatureScheme(int id, String name, + String algorithm, String keyAlgorithm, + NamedGroup namedGroup, + ProtocolVersion[] supportedProtocols) { + this(id, name, algorithm, keyAlgorithm, + null, namedGroup, -1, + supportedProtocols, supportedProtocols); + } + + private SignatureScheme(int id, String name, + String algorithm, String keyAlgorithm, + SigAlgParamSpec signAlgParamSpec, + NamedGroup namedGroup, int minimalKeySize, + ProtocolVersion[] supportedProtocols, + ProtocolVersion[] handshakeSupportedProtocols) { + this.id = id; + this.name = name; + this.algorithm = algorithm; + this.keyAlgorithm = keyAlgorithm; + this.signAlgParameter = + signAlgParamSpec != null ? signAlgParamSpec.parameterSpec : null; + this.namedGroup = namedGroup; + this.minimalKeySize = minimalKeySize; + this.supportedProtocols = Arrays.asList(supportedProtocols); + this.handshakeSupportedProtocols = + Arrays.asList(handshakeSupportedProtocols); + + boolean mediator = true; + if (signAlgParamSpec != null) { + mediator = signAlgParamSpec.isAvailable; + } else { + try { + JsseJce.getSignature(algorithm); + } catch (Exception e) { + mediator = false; + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Signature algorithm, " + algorithm + + ", is not supported by the underlying providers"); + } + } + } + + if (mediator && ((id >> 8) & 0xFF) == 0x03) { // SHA224 + // There are some problems to use SHA224 on Windows. + if (Security.getProvider("SunMSCAPI") != null) { + mediator = false; + } + } + + this.isAvailable = mediator; + } + + static SignatureScheme valueOf(int id) { + for (SignatureScheme ss: SignatureScheme.values()) { + if (ss.id == id) { + return ss; + } + } + + return null; + } + + static String nameOf(int id) { + for (SignatureScheme ss: SignatureScheme.values()) { + if (ss.id == id) { + return ss.name; + } + } + + // Use TLS 1.2 style name for unknown signature scheme. + int hashId = ((id >> 8) & 0xFF); + int signId = (id & 0xFF); + String hashName = (hashId >= hashAlgorithms.length) ? + "UNDEFINED-HASH(" + hashId + ")" : hashAlgorithms[hashId]; + String signName = (signId >= signatureAlgorithms.length) ? + "UNDEFINED-SIGNATURE(" + signId + ")" : + signatureAlgorithms[signId]; + + return signName + "_" + hashName; + } + + // Return the size of a SignatureScheme structure in TLS record + static int sizeInRecord() { + return 2; + } + + // Get local supported algorithm collection complying to algorithm + // constraints. + static List<SignatureScheme> getSupportedAlgorithms( + AlgorithmConstraints constraints, + List<ProtocolVersion> activeProtocols) { + List<SignatureScheme> supported = new LinkedList<>(); + for (SignatureScheme ss: SignatureScheme.values()) { + if (!ss.isAvailable) { + continue; + } + + boolean isMatch = false; + for (ProtocolVersion pv : activeProtocols) { + if (ss.supportedProtocols.contains(pv)) { + isMatch = true; + break; + } + } + + if (isMatch) { + if (constraints.permits( + SIGNATURE_PRIMITIVE_SET, ss.algorithm, null)) { + supported.add(ss); + } else if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Ignore disabled signature sheme: " + ss.name); + } + } else if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.finest( + "Ignore inactive signature sheme: " + ss.name); + } + } + + return supported; + } + + static List<SignatureScheme> getSupportedAlgorithms( + AlgorithmConstraints constraints, + ProtocolVersion protocolVersion, int[] algorithmIds) { + List<SignatureScheme> supported = new LinkedList<>(); + for (int ssid : algorithmIds) { + SignatureScheme ss = SignatureScheme.valueOf(ssid); + if (ss == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Unsupported signature scheme: " + + SignatureScheme.nameOf(ssid)); + } + } else if (ss.isAvailable && + ss.supportedProtocols.contains(protocolVersion) && + constraints.permits(SIGNATURE_PRIMITIVE_SET, + ss.algorithm, null)) { + supported.add(ss); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Unsupported signature scheme: " + ss.name); + } + } + } + + return supported; + } + + static SignatureScheme getPreferableAlgorithm( + List<SignatureScheme> schemes, + SignatureScheme certScheme, + ProtocolVersion version) { + + for (SignatureScheme ss : schemes) { + if (ss.isAvailable && + ss.handshakeSupportedProtocols.contains(version) && + certScheme.keyAlgorithm.equalsIgnoreCase(ss.keyAlgorithm)) { + + return ss; + } + } + + return null; + } + + static SignatureScheme getPreferableAlgorithm( + List<SignatureScheme> schemes, + PrivateKey signingKey, + ProtocolVersion version) { + + String keyAlgorithm = signingKey.getAlgorithm(); + int keySize; + // Only need to check RSA algorithm at present. + if (keyAlgorithm.equalsIgnoreCase("RSA") || + keyAlgorithm.equalsIgnoreCase("RSASSA-PSS")) { + keySize = KeyUtil.getKeySize(signingKey); + } else { + keySize = Integer.MAX_VALUE; + } + for (SignatureScheme ss : schemes) { + if (ss.isAvailable && (keySize >= ss.minimalKeySize) && + ss.handshakeSupportedProtocols.contains(version) && + keyAlgorithm.equalsIgnoreCase(ss.keyAlgorithm)) { + if (ss.namedGroup != null && + ss.namedGroup.type == NamedGroupType.NAMED_GROUP_ECDHE) { + ECParameterSpec params = + ((ECPrivateKey)signingKey).getParams(); + if (ss.namedGroup == NamedGroup.valueOf(params)) { + return ss; + } + } else { + return ss; + } + } + } + + return null; + } + + static String[] getAlgorithmNames(Collection<SignatureScheme> schemes) { + if (schemes != null) { + ArrayList<String> names = new ArrayList<>(schemes.size()); + for (SignatureScheme scheme : schemes) { + names.add(scheme.algorithm); + } + + return names.toArray(new String[0]); + } + + return new String[0]; + } + + Signature getSignature(Key key) throws NoSuchAlgorithmException, + InvalidAlgorithmParameterException, InvalidKeyException { + if (!isAvailable) { + return null; + } + + Signature signer = JsseJce.getSignature(algorithm); + if (key instanceof PublicKey) { + signer.initVerify((PublicKey)(key)); + } else { + signer.initSign((PrivateKey)key); + } + + // Important note: Please don't set the parameters before signature + // or verification initialization, so that the crypto provider can + // be selected properly. + if (signAlgParameter != null) { + signer.setParameter(signAlgParameter); + } + + return signer; + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmConstraints.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,18 +26,13 @@ package sun.security.ssl; import java.security.AlgorithmConstraints; -import java.security.CryptoPrimitive; import java.security.AlgorithmParameters; - -import javax.net.ssl.*; - +import java.security.CryptoPrimitive; import java.security.Key; - import java.util.Set; - +import javax.net.ssl.*; import sun.security.util.DisabledAlgorithmConstraints; import static sun.security.util.DisabledAlgorithmConstraints.*; -import sun.security.ssl.CipherSuite.*; /** * Algorithm constraints for disabled algorithms property @@ -55,10 +50,10 @@ new DisabledAlgorithmConstraints(PROPERTY_CERTPATH_DISABLED_ALGS, new SSLAlgorithmDecomposer(true)); - private AlgorithmConstraints userAlgConstraints = null; - private AlgorithmConstraints peerAlgConstraints = null; + private final AlgorithmConstraints userSpecifiedConstraints; + private final AlgorithmConstraints peerSpecifiedConstraints; - private boolean enabledX509DisabledAlgConstraints = true; + private final boolean enabledX509DisabledAlgConstraints; // the default algorithm constraints static final AlgorithmConstraints DEFAULT = @@ -68,60 +63,102 @@ static final AlgorithmConstraints DEFAULT_SSL_ONLY = new SSLAlgorithmConstraints((SSLSocket)null, false); - SSLAlgorithmConstraints(AlgorithmConstraints algorithmConstraints) { - userAlgConstraints = algorithmConstraints; + SSLAlgorithmConstraints(AlgorithmConstraints userSpecifiedConstraints) { + this.userSpecifiedConstraints = userSpecifiedConstraints; + this.peerSpecifiedConstraints = null; + this.enabledX509DisabledAlgConstraints = true; } SSLAlgorithmConstraints(SSLSocket socket, boolean withDefaultCertPathConstraints) { + AlgorithmConstraints configuredConstraints = null; if (socket != null) { - userAlgConstraints = - socket.getSSLParameters().getAlgorithmConstraints(); - } - - if (!withDefaultCertPathConstraints) { - enabledX509DisabledAlgConstraints = false; - } + // Note that the KeyManager or TrustManager implementation may be + // not implemented in the same provider as SSLSocket/SSLEngine. + // Please check the instance before casting to use SSLSocketImpl. + if (socket instanceof SSLSocketImpl) { + HandshakeContext hc = + ((SSLSocketImpl)socket).conContext.handshakeContext; + if (hc != null) { + configuredConstraints = hc.sslConfig.algorithmConstraints; + } else { + configuredConstraints = null; + } + } else { + configuredConstraints = + socket.getSSLParameters().getAlgorithmConstraints(); + } + } + this.userSpecifiedConstraints = configuredConstraints; + this.peerSpecifiedConstraints = null; + this.enabledX509DisabledAlgConstraints = withDefaultCertPathConstraints; } SSLAlgorithmConstraints(SSLEngine engine, boolean withDefaultCertPathConstraints) { + AlgorithmConstraints configuredConstraints = null; if (engine != null) { - userAlgConstraints = - engine.getSSLParameters().getAlgorithmConstraints(); - } - - if (!withDefaultCertPathConstraints) { - enabledX509DisabledAlgConstraints = false; - } + // Note that the KeyManager or TrustManager implementation may be + // not implemented in the same provider as SSLSocket/SSLEngine. + // Please check the instance before casting to use SSLEngineImpl. + if (engine instanceof SSLEngineImpl) { + HandshakeContext hc = + ((SSLEngineImpl)engine).conContext.handshakeContext; + if (hc != null) { + configuredConstraints = hc.sslConfig.algorithmConstraints; + } else { + configuredConstraints = null; + } + } else { + configuredConstraints = + engine.getSSLParameters().getAlgorithmConstraints(); + } + } + this.userSpecifiedConstraints = configuredConstraints; + this.peerSpecifiedConstraints = null; + this.enabledX509DisabledAlgConstraints = withDefaultCertPathConstraints; } SSLAlgorithmConstraints(SSLSocket socket, String[] supportedAlgorithms, boolean withDefaultCertPathConstraints) { + AlgorithmConstraints configuredConstraints = null; + AlgorithmConstraints negotiatedConstraints = null; if (socket != null) { - userAlgConstraints = - socket.getSSLParameters().getAlgorithmConstraints(); - peerAlgConstraints = - new SupportedSignatureAlgorithmConstraints(supportedAlgorithms); - } + HandshakeContext hc = + ((SSLSocketImpl)socket).conContext.handshakeContext; + if (hc != null) { + configuredConstraints = hc.sslConfig.algorithmConstraints; + } else { + configuredConstraints = null; + } - if (!withDefaultCertPathConstraints) { - enabledX509DisabledAlgConstraints = false; + negotiatedConstraints = + new SupportedSignatureAlgorithmConstraints(supportedAlgorithms); } + this.userSpecifiedConstraints = configuredConstraints; + this.peerSpecifiedConstraints = negotiatedConstraints; + this.enabledX509DisabledAlgConstraints = withDefaultCertPathConstraints; } SSLAlgorithmConstraints(SSLEngine engine, String[] supportedAlgorithms, boolean withDefaultCertPathConstraints) { + AlgorithmConstraints configuredConstraints = null; + AlgorithmConstraints negotiatedConstraints = null; if (engine != null) { - userAlgConstraints = - engine.getSSLParameters().getAlgorithmConstraints(); - peerAlgConstraints = - new SupportedSignatureAlgorithmConstraints(supportedAlgorithms); - } + HandshakeContext hc = + ((SSLEngineImpl)engine).conContext.handshakeContext; + if (hc != null) { + configuredConstraints = hc.sslConfig.algorithmConstraints; + } else { + configuredConstraints = null; + } - if (!withDefaultCertPathConstraints) { - enabledX509DisabledAlgConstraints = false; + negotiatedConstraints = + new SupportedSignatureAlgorithmConstraints(supportedAlgorithms); } + this.userSpecifiedConstraints = configuredConstraints; + this.peerSpecifiedConstraints = negotiatedConstraints; + this.enabledX509DisabledAlgConstraints = withDefaultCertPathConstraints; } @Override @@ -130,13 +167,13 @@ boolean permitted = true; - if (peerAlgConstraints != null) { - permitted = peerAlgConstraints.permits( + if (peerSpecifiedConstraints != null) { + permitted = peerSpecifiedConstraints.permits( primitives, algorithm, parameters); } - if (permitted && userAlgConstraints != null) { - permitted = userAlgConstraints.permits( + if (permitted && userSpecifiedConstraints != null) { + permitted = userSpecifiedConstraints.permits( primitives, algorithm, parameters); } @@ -158,12 +195,12 @@ boolean permitted = true; - if (peerAlgConstraints != null) { - permitted = peerAlgConstraints.permits(primitives, key); + if (peerSpecifiedConstraints != null) { + permitted = peerSpecifiedConstraints.permits(primitives, key); } - if (permitted && userAlgConstraints != null) { - permitted = userAlgConstraints.permits(primitives, key); + if (permitted && userSpecifiedConstraints != null) { + permitted = userSpecifiedConstraints.permits(primitives, key); } if (permitted) { @@ -183,13 +220,13 @@ boolean permitted = true; - if (peerAlgConstraints != null) { - permitted = peerAlgConstraints.permits( + if (peerSpecifiedConstraints != null) { + permitted = peerSpecifiedConstraints.permits( primitives, algorithm, key, parameters); } - if (permitted && userAlgConstraints != null) { - permitted = userAlgConstraints.permits( + if (permitted && userSpecifiedConstraints != null) { + permitted = userSpecifiedConstraints.permits( primitives, algorithm, key, parameters); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLAlgorithmDecomposer.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,9 +27,12 @@ import java.util.HashSet; import java.util.Set; -import sun.security.util.AlgorithmDecomposer; -import static sun.security.ssl.CipherSuite.*; +import sun.security.ssl.CipherSuite.HashAlg; +import sun.security.ssl.CipherSuite.KeyExchange; import static sun.security.ssl.CipherSuite.KeyExchange.*; +import sun.security.ssl.CipherSuite.MacAlg; +import static sun.security.ssl.SSLCipher.*; +import sun.security.util.AlgorithmDecomposer; /** * The class decomposes standard SSL/TLS cipher suites into sub-elements. @@ -126,18 +129,13 @@ } break; default: - if (ClientKeyExchangeService.find(keyExchange.name) != null) { - if (!onlyX509) { - components.add(keyExchange.name); - } - } // otherwise ignore } return components; } - private Set<String> decomposes(CipherSuite.BulkCipher bulkCipher) { + private Set<String> decomposes(SSLCipher bulkCipher) { Set<String> components = new HashSet<>(); if (bulkCipher.transformation != null) { @@ -185,7 +183,7 @@ } private Set<String> decomposes(CipherSuite.MacAlg macAlg, - BulkCipher cipher) { + SSLCipher cipher) { Set<String> components = new HashSet<>(); if (macAlg == CipherSuite.MacAlg.M_NULL @@ -211,8 +209,26 @@ return components; } - private Set<String> decompose(KeyExchange keyExchange, BulkCipher cipher, - MacAlg macAlg) { + private Set<String> decomposes(CipherSuite.HashAlg hashAlg) { + Set<String> components = new HashSet<>(); + + if (hashAlg == CipherSuite.HashAlg.H_SHA256) { + components.add("SHA256"); + components.add("SHA-256"); + components.add("HmacSHA256"); + } else if (hashAlg == CipherSuite.HashAlg.H_SHA384) { + components.add("SHA384"); + components.add("SHA-384"); + components.add("HmacSHA384"); + } + + return components; + } + + private Set<String> decompose(KeyExchange keyExchange, + SSLCipher cipher, + MacAlg macAlg, + HashAlg hashAlg) { Set<String> components = new HashSet<>(); if (keyExchange != null) { @@ -233,6 +249,10 @@ components.addAll(decomposes(macAlg, cipher)); } + if (hashAlg != null) { + components.addAll(decomposes(hashAlg)); + } + return components; } @@ -241,18 +261,19 @@ if (algorithm.startsWith("SSL_") || algorithm.startsWith("TLS_")) { CipherSuite cipherSuite = null; try { - cipherSuite = CipherSuite.valueOf(algorithm); + cipherSuite = CipherSuite.nameOf(algorithm); } catch (IllegalArgumentException iae) { // ignore: unknown or unsupported ciphersuite } if (cipherSuite != null) { - return decompose(cipherSuite.keyExchange, cipherSuite.cipher, - cipherSuite.macAlg); + return decompose(cipherSuite.keyExchange, + cipherSuite.bulkCipher, + cipherSuite.macAlg, + cipherSuite.hashAlg); } } return super.decompose(algorithm); } - } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLAuthentication.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLAuthentication.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLAuthentication.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLAuthentication.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +interface SSLAuthentication + extends SSLPossessionGenerator, SSLHandshakeBinding { + // blank +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLBasicKeyDerivation.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLBasicKeyDerivation.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLBasicKeyDerivation.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLBasicKeyDerivation.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,81 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.security.spec.AlgorithmParameterSpec; +import javax.crypto.SecretKey; +import javax.net.ssl.SSLHandshakeException; + +final class SSLBasicKeyDerivation implements SSLKeyDerivation { + private final String hashAlg; + private final SecretKey secret; + private final byte[] hkdfInfo; + + SSLBasicKeyDerivation(SecretKey secret, String hashAlg, + byte[] label, byte[] context, int length) { + this.hashAlg = hashAlg.replace("-", ""); + this.secret = secret; + this.hkdfInfo = createHkdfInfo(label, context, length); + } + + @Override + public SecretKey deriveKey(String algorithm, + AlgorithmParameterSpec keySpec) throws IOException { + try { + HKDF hkdf = new HKDF(hashAlg); + return hkdf.expand(secret, hkdfInfo, + ((SecretSizeSpec)keySpec).length, algorithm); + } catch (GeneralSecurityException gse) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(gse); + } + } + + private static byte[] createHkdfInfo( + byte[] label, byte[] context, int length) { + byte[] info = new byte[4 + label.length + context.length]; + ByteBuffer m = ByteBuffer.wrap(info); + try { + Record.putInt16(m, length); + Record.putBytes8(m, label); + Record.putBytes8(m, context); + } catch (IOException ioe) { + // unlikely + } + return info; + } + + static class SecretSizeSpec implements AlgorithmParameterSpec { + final int length; + + SecretSizeSpec(int length) { + this.length = length; + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLCipher.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLCipher.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLCipher.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLCipher.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,2369 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.nio.ByteBuffer; +import java.security.AccessController; +import java.security.GeneralSecurityException; +import java.security.InvalidAlgorithmParameterException; +import java.security.InvalidKeyException; +import java.security.Key; +import java.security.PrivilegedAction; +import java.security.SecureRandom; +import java.security.Security; +import java.security.spec.AlgorithmParameterSpec; +import java.util.AbstractMap.SimpleImmutableEntry; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import javax.crypto.BadPaddingException; +import javax.crypto.Cipher; +import javax.crypto.IllegalBlockSizeException; +import javax.crypto.SecretKey; +import javax.crypto.ShortBufferException; +import javax.crypto.spec.GCMParameterSpec; +import javax.crypto.spec.IvParameterSpec; +import sun.security.ssl.Authenticator.MAC; +import static sun.security.ssl.CipherType.*; +import static sun.security.ssl.JsseJce.*; + +enum SSLCipher { + // exportable ciphers + @SuppressWarnings({"unchecked", "rawtypes"}) + B_NULL("NULL", NULL_CIPHER, 0, 0, 0, 0, true, true, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new NullReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_NONE + ), + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new NullReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_13 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new NullWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_NONE + ), + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new NullWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_13 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_RC4_40(CIPHER_RC4, STREAM_CIPHER, 5, 16, 0, 0, true, true, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new StreamReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new StreamWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_RC2_40("RC2", BLOCK_CIPHER, 5, 16, 8, 0, false, true, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new StreamReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new StreamWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_DES_40(CIPHER_DES, BLOCK_CIPHER, 5, 8, 8, 0, true, true, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T10BlockReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T10BlockWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ) + })), + + // domestic strength ciphers + @SuppressWarnings({"unchecked", "rawtypes"}) + B_RC4_128(CIPHER_RC4, STREAM_CIPHER, 16, 16, 0, 0, true, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new StreamReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_12 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new StreamWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_DES(CIPHER_DES, BLOCK_CIPHER, 8, 8, 8, 0, true, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T10BlockReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ), + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T11BlockReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_11 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T10BlockWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ), + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T11BlockWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_11 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_3DES(CIPHER_3DES, BLOCK_CIPHER, 24, 24, 8, 0, true, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T10BlockReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ), + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T11BlockReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_11_12 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T10BlockWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ), + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T11BlockWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_11_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_IDEA("IDEA", BLOCK_CIPHER, 16, 16, 8, 0, false, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + null, + ProtocolVersion.PROTOCOLS_TO_12 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + null, + ProtocolVersion.PROTOCOLS_TO_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_AES_128(CIPHER_AES, BLOCK_CIPHER, 16, 16, 16, 0, true, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T10BlockReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ), + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T11BlockReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_11_12 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T10BlockWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ), + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T11BlockWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_11_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_AES_256(CIPHER_AES, BLOCK_CIPHER, 32, 32, 16, 0, true, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T10BlockReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ), + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T11BlockReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_11_12 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T10BlockWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_TO_10 + ), + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T11BlockWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_11_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_AES_128_GCM(CIPHER_AES_GCM, AEAD_CIPHER, 16, 16, 12, 4, true, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T12GcmReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_12 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T12GcmWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_AES_256_GCM(CIPHER_AES_GCM, AEAD_CIPHER, 32, 32, 12, 4, true, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T12GcmReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_12 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T12GcmWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_AES_128_GCM_IV(CIPHER_AES_GCM, AEAD_CIPHER, 16, 16, 12, 0, true, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T13GcmReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T13GcmWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + B_AES_256_GCM_IV(CIPHER_AES_GCM, AEAD_CIPHER, 32, 32, 12, 0, true, false, + (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<ReadCipherGenerator, ProtocolVersion[]>( + new T13GcmReadCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<WriteCipherGenerator, ProtocolVersion[]>( + new T13GcmWriteCipherGenerator(), + ProtocolVersion.PROTOCOLS_OF_13 + ) + })); + + // descriptive name including key size, e.g. AES/128 + final String description; + + // JCE cipher transformation string, e.g. AES/CBC/NoPadding + final String transformation; + + // algorithm name, e.g. AES + final String algorithm; + + // supported and compile time enabled. Also see isAvailable() + final boolean allowed; + + // number of bytes of entropy in the key + final int keySize; + + // length of the actual cipher key in bytes. + // for non-exportable ciphers, this is the same as keySize + final int expandedKeySize; + + // size of the IV + final int ivSize; + + // size of fixed IV + // + // record_iv_length = ivSize - fixedIvSize + final int fixedIvSize; + + // exportable under 512/40 bit rules + final boolean exportable; + + // Is the cipher algorithm of Cipher Block Chaining (CBC) mode? + final CipherType cipherType; + + // size of the authentication tag, only applicable to cipher suites in + // Galois Counter Mode (GCM) + // + // As far as we know, all supported GCM cipher suites use 128-bits + // authentication tags. + final int tagSize = 16; + + // runtime availability + private final boolean isAvailable; + + private final Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[] readCipherGenerators; + private final Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[] writeCipherGenerators; + + // Map of Ciphers listed in jdk.tls.KeyLimit + private static final HashMap<String, Long> cipherLimits = new HashMap<>(); + + // Keywords found on the jdk.tls.KeyLimit security property. + final static String tag[] = {"KEYUPDATE"}; + + static { + final long max = 4611686018427387904L; // 2^62 + String prop = AccessController.doPrivileged( + new PrivilegedAction<String>() { + @Override + public String run() { + return Security.getProperty("jdk.tls.keyLimits"); + } + }); + + if (prop != null) { + String propvalue[] = prop.split(","); + + for (String entry : propvalue) { + int index; + // If this is not a UsageLimit, goto to next entry. + String values[] = entry.trim().toUpperCase().split(" "); + + if (values[1].contains(tag[0])) { + index = 0; + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("jdk.net.keyLimits: Unknown action: " + + entry); + } + continue; + } + + long size; + int i = values[2].indexOf("^"); + try { + if (i >= 0) { + size = (long) Math.pow(2, + Integer.parseInt(values[2].substring(i + 1))); + } else { + size = Long.parseLong(values[2]); + } + if (size < 1 || size > max) { + throw new NumberFormatException("Length exceeded limits"); + } + } catch (NumberFormatException e) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("jdk.net.keyLimits: " + e.getMessage() + + ": " + entry); + } + continue; + } + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("jdk.net.keyLimits: entry = " + entry + + ". " + values[0] + ":" + tag[index] + " = " + size); + } + cipherLimits.put(values[0] + ":" + tag[index], size); + } + } + } + + private SSLCipher(String transformation, + CipherType cipherType, int keySize, + int expandedKeySize, int ivSize, + int fixedIvSize, boolean allowed, boolean exportable, + Map.Entry<ReadCipherGenerator, + ProtocolVersion[]>[] readCipherGenerators, + Map.Entry<WriteCipherGenerator, + ProtocolVersion[]>[] writeCipherGenerators) { + this.transformation = transformation; + String[] splits = transformation.split("/"); + this.algorithm = splits[0]; + this.cipherType = cipherType; + this.description = this.algorithm + "/" + (keySize << 3); + this.keySize = keySize; + this.ivSize = ivSize; + this.fixedIvSize = fixedIvSize; + this.allowed = allowed; + + this.expandedKeySize = expandedKeySize; + this.exportable = exportable; + + // availability of this bulk cipher + // + // We assume all supported ciphers are always available since they are + // shipped with the SunJCE provider. However, AES/256 is unavailable + // when the default JCE policy jurisdiction files are installed because + // of key length restrictions. + this.isAvailable = allowed && isUnlimited(keySize, transformation); + + this.readCipherGenerators = readCipherGenerators; + this.writeCipherGenerators = writeCipherGenerators; + } + + SSLReadCipher createReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SecretKey key, IvParameterSpec iv, + SecureRandom random) throws GeneralSecurityException { + if (readCipherGenerators.length == 0) { + return null; + } + + ReadCipherGenerator rcg = null; + for (Map.Entry<ReadCipherGenerator, + ProtocolVersion[]> me : readCipherGenerators) { + for (ProtocolVersion pv : me.getValue()) { + if (protocolVersion == pv) { + rcg = me.getKey(); + } + } + } + + if (rcg != null) { + return rcg.createCipher(this, authenticator, + protocolVersion, transformation, key, iv, random); + } + return null; + } + + SSLWriteCipher createWriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SecretKey key, IvParameterSpec iv, + SecureRandom random) throws GeneralSecurityException { + if (readCipherGenerators.length == 0) { + return null; + } + + WriteCipherGenerator rcg = null; + for (Map.Entry<WriteCipherGenerator, + ProtocolVersion[]> me : writeCipherGenerators) { + for (ProtocolVersion pv : me.getValue()) { + if (protocolVersion == pv) { + rcg = me.getKey(); + } + } + } + + if (rcg != null) { + return rcg.createCipher(this, authenticator, + protocolVersion, transformation, key, iv, random); + } + return null; + } + + /** + * Test if this bulk cipher is available. For use by CipherSuite. + */ + boolean isAvailable() { + return this.isAvailable; + } + + private static boolean isUnlimited(int keySize, String transformation) { + int keySizeInBits = keySize * 8; + if (keySizeInBits > 128) { // need the JCE unlimited + // strength jurisdiction policy + try { + if (Cipher.getMaxAllowedKeyLength( + transformation) < keySizeInBits) { + return false; + } + } catch (Exception e) { + return false; + } + } + + return true; + } + + @Override + public String toString() { + return description; + } + + interface ReadCipherGenerator { + SSLReadCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException; + } + + abstract static class SSLReadCipher { + final Authenticator authenticator; + final ProtocolVersion protocolVersion; + boolean keyLimitEnabled = false; + long keyLimitCountdown = 0; + SecretKey baseSecret; + + SSLReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion) { + this.authenticator = authenticator; + this.protocolVersion = protocolVersion; + } + + static final SSLReadCipher nullTlsReadCipher() { + try { + return B_NULL.createReadCipher( + Authenticator.nullTlsMac(), + ProtocolVersion.NONE, null, null, null); + } catch (GeneralSecurityException gse) { + // unlikely + throw new RuntimeException("Cannot create NULL SSLCipher", gse); + } + } + + static final SSLReadCipher nullDTlsReadCipher() { + try { + return B_NULL.createReadCipher( + Authenticator.nullDtlsMac(), + ProtocolVersion.NONE, null, null, null); + } catch (GeneralSecurityException gse) { + // unlikely + throw new RuntimeException("Cannot create NULL SSLCipher", gse); + } + } + + abstract Plaintext decrypt(byte contentType, ByteBuffer bb, + byte[] sequence) throws GeneralSecurityException; + + void dispose() { + // blank + } + + abstract int estimateFragmentSize(int packetSize, int headerSize); + + boolean isNullCipher() { + return false; + } + + /** + * Check if processed bytes have reached the key usage limit. + * If key usage limit is not be monitored, return false. + */ + public boolean atKeyLimit() { + if (keyLimitCountdown >= 0) { + return false; + } + + // Turn off limit checking as KeyUpdate will be occurring + keyLimitEnabled = false; + return true; + } + } + + interface WriteCipherGenerator { + SSLWriteCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException; + } + + abstract static class SSLWriteCipher { + final Authenticator authenticator; + final ProtocolVersion protocolVersion; + boolean keyLimitEnabled = false; + long keyLimitCountdown = 0; + SecretKey baseSecret; + + SSLWriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion) { + this.authenticator = authenticator; + this.protocolVersion = protocolVersion; + } + + abstract int encrypt(byte contentType, ByteBuffer bb); + + static final SSLWriteCipher nullTlsWriteCipher() { + try { + return B_NULL.createWriteCipher( + Authenticator.nullTlsMac(), + ProtocolVersion.NONE, null, null, null); + } catch (GeneralSecurityException gse) { + // unlikely + throw new RuntimeException( + "Cannot create NULL SSL write Cipher", gse); + } + } + + static final SSLWriteCipher nullDTlsWriteCipher() { + try { + return B_NULL.createWriteCipher( + Authenticator.nullDtlsMac(), + ProtocolVersion.NONE, null, null, null); + } catch (GeneralSecurityException gse) { + // unlikely + throw new RuntimeException( + "Cannot create NULL SSL write Cipher", gse); + } + } + + void dispose() { + // blank + } + + abstract int getExplicitNonceSize(); + abstract int calculateFragmentSize(int packetLimit, int headerSize); + abstract int calculatePacketSize(int fragmentSize, int headerSize); + + boolean isCBCMode() { + return false; + } + + boolean isNullCipher() { + return false; + } + + /** + * Check if processed bytes have reached the key usage limit. + * If key usage limit is not be monitored, return false. + */ + public boolean atKeyLimit() { + if (keyLimitCountdown >= 0) { + return false; + } + + // Turn off limit checking as KeyUpdate will be occurring + keyLimitEnabled = false; + return true; + } + } + + private static final + class NullReadCipherGenerator implements ReadCipherGenerator { + @Override + public SSLReadCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new NullReadCipher(authenticator, protocolVersion); + } + + static final class NullReadCipher extends SSLReadCipher { + NullReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion) { + super(authenticator, protocolVersion); + } + + @Override + public Plaintext decrypt(byte contentType, ByteBuffer bb, + byte[] sequence) throws GeneralSecurityException { + MAC signer = (MAC)authenticator; + if (signer.macAlg().size != 0) { + checkStreamMac(signer, bb, contentType, sequence); + } else { + authenticator.increaseSequenceNumber(); + } + + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + @Override + int estimateFragmentSize(int packetSize, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + return packetSize - headerSize - macLen; + } + + @Override + boolean isNullCipher() { + return true; + } + } + } + + private static final + class NullWriteCipherGenerator implements WriteCipherGenerator { + @Override + public SSLWriteCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new NullWriteCipher(authenticator, protocolVersion); + } + + static final class NullWriteCipher extends SSLWriteCipher { + NullWriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion) { + super(authenticator, protocolVersion); + } + + @Override + public int encrypt(byte contentType, ByteBuffer bb) { + // add message authentication code + MAC signer = (MAC)authenticator; + if (signer.macAlg().size != 0) { + addMac(signer, bb, contentType); + } else { + authenticator.increaseSequenceNumber(); + } + + int len = bb.remaining(); + bb.position(bb.limit()); + return len; + } + + + @Override + int getExplicitNonceSize() { + return 0; + } + + @Override + int calculateFragmentSize(int packetLimit, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + return packetLimit - headerSize - macLen; + } + + @Override + int calculatePacketSize(int fragmentSize, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + return fragmentSize + headerSize + macLen; + } + + @Override + boolean isNullCipher() { + return true; + } + } + } + + private static final + class StreamReadCipherGenerator implements ReadCipherGenerator { + @Override + public SSLReadCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new StreamReadCipher(authenticator, protocolVersion, + algorithm, key, params, random); + } + + static final class StreamReadCipher extends SSLReadCipher { + private final Cipher cipher; + + StreamReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + cipher.init(Cipher.DECRYPT_MODE, key, params, random); + } + + @Override + public Plaintext decrypt(byte contentType, ByteBuffer bb, + byte[] sequence) throws GeneralSecurityException { + int len = bb.remaining(); + int pos = bb.position(); + ByteBuffer dup = bb.duplicate(); + try { + if (len != cipher.update(dup, bb)) { + // catch BouncyCastle buffering error + throw new RuntimeException( + "Unexpected number of plaintext bytes"); + } + if (bb.position() != dup.position()) { + throw new RuntimeException( + "Unexpected ByteBuffer position"); + } + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + bb.position(pos); + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Plaintext after DECRYPTION", bb.duplicate()); + } + + MAC signer = (MAC)authenticator; + if (signer.macAlg().size != 0) { + checkStreamMac(signer, bb, contentType, sequence); + } else { + authenticator.increaseSequenceNumber(); + } + + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int estimateFragmentSize(int packetSize, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + return packetSize - headerSize - macLen; + } + } + } + + private static final + class StreamWriteCipherGenerator implements WriteCipherGenerator { + @Override + public SSLWriteCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new StreamWriteCipher(authenticator, + protocolVersion, algorithm, key, params, random); + } + + static final class StreamWriteCipher extends SSLWriteCipher { + private final Cipher cipher; + + StreamWriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + cipher.init(Cipher.ENCRYPT_MODE, key, params, random); + } + + @Override + public int encrypt(byte contentType, ByteBuffer bb) { + // add message authentication code + MAC signer = (MAC)authenticator; + if (signer.macAlg().size != 0) { + addMac(signer, bb, contentType); + } else { + authenticator.increaseSequenceNumber(); + } + + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.finest( + "Padded plaintext before ENCRYPTION", bb.duplicate()); + } + + int len = bb.remaining(); + ByteBuffer dup = bb.duplicate(); + try { + if (len != cipher.update(dup, bb)) { + // catch BouncyCastle buffering error + throw new RuntimeException( + "Unexpected number of plaintext bytes"); + } + if (bb.position() != dup.position()) { + throw new RuntimeException( + "Unexpected ByteBuffer position"); + } + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + + return len; + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int getExplicitNonceSize() { + return 0; + } + + @Override + int calculateFragmentSize(int packetLimit, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + return packetLimit - headerSize - macLen; + } + + @Override + int calculatePacketSize(int fragmentSize, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + return fragmentSize + headerSize + macLen; + } + } + } + + private static final + class T10BlockReadCipherGenerator implements ReadCipherGenerator { + @Override + public SSLReadCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new BlockReadCipher(authenticator, + protocolVersion, algorithm, key, params, random); + } + + static final class BlockReadCipher extends SSLReadCipher { + private final Cipher cipher; + + BlockReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + cipher.init(Cipher.DECRYPT_MODE, key, params, random); + } + + @Override + public Plaintext decrypt(byte contentType, ByteBuffer bb, + byte[] sequence) throws GeneralSecurityException { + BadPaddingException reservedBPE = null; + + // sanity check length of the ciphertext + MAC signer = (MAC)authenticator; + int cipheredLength = bb.remaining(); + int tagLen = signer.macAlg().size; + if (tagLen != 0) { + if (!sanityCheck(tagLen, bb.remaining())) { + reservedBPE = new BadPaddingException( + "ciphertext sanity check failed"); + } + } + // decryption + int len = bb.remaining(); + int pos = bb.position(); + ByteBuffer dup = bb.duplicate(); + try { + if (len != cipher.update(dup, bb)) { + // catch BouncyCastle buffering error + throw new RuntimeException( + "Unexpected number of plaintext bytes"); + } + + if (bb.position() != dup.position()) { + throw new RuntimeException( + "Unexpected ByteBuffer position"); + } + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Padded plaintext after DECRYPTION", + bb.duplicate().position(pos)); + } + + // remove the block padding + int blockSize = cipher.getBlockSize(); + bb.position(pos); + try { + removePadding(bb, tagLen, blockSize, protocolVersion); + } catch (BadPaddingException bpe) { + if (reservedBPE == null) { + reservedBPE = bpe; + } + } + + // Requires message authentication code for null, stream and + // block cipher suites. + try { + if (tagLen != 0) { + checkCBCMac(signer, bb, + contentType, cipheredLength, sequence); + } else { + authenticator.increaseSequenceNumber(); + } + } catch (BadPaddingException bpe) { + if (reservedBPE == null) { + reservedBPE = bpe; + } + } + + // Is it a failover? + if (reservedBPE != null) { + throw reservedBPE; + } + + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int estimateFragmentSize(int packetSize, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + + // No padding for a maximum fragment. + // + // 1 byte padding length field: 0x00 + return packetSize - headerSize - macLen - 1; + } + + /** + * Sanity check the length of a fragment before decryption. + * + * In CBC mode, check that the fragment length is one or multiple + * times of the block size of the cipher suite, and is at least + * one (one is the smallest size of padding in CBC mode) bigger + * than the tag size of the MAC algorithm except the explicit IV + * size for TLS 1.1 or later. + * + * In non-CBC mode, check that the fragment length is not less than + * the tag size of the MAC algorithm. + * + * @return true if the length of a fragment matches above + * requirements + */ + private boolean sanityCheck(int tagLen, int fragmentLen) { + int blockSize = cipher.getBlockSize(); + if ((fragmentLen % blockSize) == 0) { + int minimal = tagLen + 1; + minimal = (minimal >= blockSize) ? minimal : blockSize; + + return (fragmentLen >= minimal); + } + + return false; + } + } + } + + private static final + class T10BlockWriteCipherGenerator implements WriteCipherGenerator { + @Override + public SSLWriteCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new BlockWriteCipher(authenticator, + protocolVersion, algorithm, key, params, random); + } + + static final class BlockWriteCipher extends SSLWriteCipher { + private final Cipher cipher; + + BlockWriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + cipher.init(Cipher.ENCRYPT_MODE, key, params, random); + } + + @Override + public int encrypt(byte contentType, ByteBuffer bb) { + int pos = bb.position(); + + // add message authentication code + MAC signer = (MAC)authenticator; + if (signer.macAlg().size != 0) { + addMac(signer, bb, contentType); + } else { + authenticator.increaseSequenceNumber(); + } + + int blockSize = cipher.getBlockSize(); + int len = addPadding(bb, blockSize); + bb.position(pos); + + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Padded plaintext before ENCRYPTION", + bb.duplicate()); + } + + ByteBuffer dup = bb.duplicate(); + try { + if (len != cipher.update(dup, bb)) { + // catch BouncyCastle buffering error + throw new RuntimeException( + "Unexpected number of plaintext bytes"); + } + + if (bb.position() != dup.position()) { + throw new RuntimeException( + "Unexpected ByteBuffer position"); + } + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + + return len; + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int getExplicitNonceSize() { + return 0; + } + + @Override + int calculateFragmentSize(int packetLimit, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + int blockSize = cipher.getBlockSize(); + int fragLen = packetLimit - headerSize; + fragLen -= (fragLen % blockSize); // cannot hold a block + // No padding for a maximum fragment. + fragLen -= 1; // 1 byte padding length field: 0x00 + fragLen -= macLen; + return fragLen; + } + + @Override + int calculatePacketSize(int fragmentSize, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + int blockSize = cipher.getBlockSize(); + int paddedLen = fragmentSize + macLen + 1; + if ((paddedLen % blockSize) != 0) { + paddedLen += blockSize - 1; + paddedLen -= paddedLen % blockSize; + } + + return headerSize + paddedLen; + } + + @Override + boolean isCBCMode() { + return true; + } + } + } + + // For TLS 1.1 and 1.2 + private static final + class T11BlockReadCipherGenerator implements ReadCipherGenerator { + @Override + public SSLReadCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, ProtocolVersion protocolVersion, + String algorithm, Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new BlockReadCipher(authenticator, protocolVersion, + sslCipher, algorithm, key, params, random); + } + + static final class BlockReadCipher extends SSLReadCipher { + private final Cipher cipher; + + BlockReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + if (params == null) { + params = new IvParameterSpec(new byte[sslCipher.ivSize]); + } + cipher.init(Cipher.DECRYPT_MODE, key, params, random); + } + + @Override + public Plaintext decrypt(byte contentType, ByteBuffer bb, + byte[] sequence) throws GeneralSecurityException { + BadPaddingException reservedBPE = null; + + // sanity check length of the ciphertext + MAC signer = (MAC)authenticator; + int cipheredLength = bb.remaining(); + int tagLen = signer.macAlg().size; + if (tagLen != 0) { + if (!sanityCheck(tagLen, bb.remaining())) { + reservedBPE = new BadPaddingException( + "ciphertext sanity check failed"); + } + } + + // decryption + int len = bb.remaining(); + int pos = bb.position(); + ByteBuffer dup = bb.duplicate(); + try { + if (len != cipher.update(dup, bb)) { + // catch BouncyCastle buffering error + throw new RuntimeException( + "Unexpected number of plaintext bytes"); + } + + if (bb.position() != dup.position()) { + throw new RuntimeException( + "Unexpected ByteBuffer position"); + } + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Padded plaintext after DECRYPTION", + bb.duplicate().position(pos)); + } + + // Ignore the explicit nonce. + bb.position(pos + cipher.getBlockSize()); + pos = bb.position(); + + // remove the block padding + int blockSize = cipher.getBlockSize(); + bb.position(pos); + try { + removePadding(bb, tagLen, blockSize, protocolVersion); + } catch (BadPaddingException bpe) { + if (reservedBPE == null) { + reservedBPE = bpe; + } + } + + // Requires message authentication code for null, stream and + // block cipher suites. + try { + if (tagLen != 0) { + checkCBCMac(signer, bb, + contentType, cipheredLength, sequence); + } else { + authenticator.increaseSequenceNumber(); + } + } catch (BadPaddingException bpe) { + if (reservedBPE == null) { + reservedBPE = bpe; + } + } + + // Is it a failover? + if (reservedBPE != null) { + throw reservedBPE; + } + + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int estimateFragmentSize(int packetSize, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + + // No padding for a maximum fragment. + // + // 1 byte padding length field: 0x00 + int nonceSize = cipher.getBlockSize(); + return packetSize - headerSize - nonceSize - macLen - 1; + } + + /** + * Sanity check the length of a fragment before decryption. + * + * In CBC mode, check that the fragment length is one or multiple + * times of the block size of the cipher suite, and is at least + * one (one is the smallest size of padding in CBC mode) bigger + * than the tag size of the MAC algorithm except the explicit IV + * size for TLS 1.1 or later. + * + * In non-CBC mode, check that the fragment length is not less than + * the tag size of the MAC algorithm. + * + * @return true if the length of a fragment matches above + * requirements + */ + private boolean sanityCheck(int tagLen, int fragmentLen) { + int blockSize = cipher.getBlockSize(); + if ((fragmentLen % blockSize) == 0) { + int minimal = tagLen + 1; + minimal = (minimal >= blockSize) ? minimal : blockSize; + minimal += blockSize; + + return (fragmentLen >= minimal); + } + + return false; + } + } + } + + // For TLS 1.1 and 1.2 + private static final + class T11BlockWriteCipherGenerator implements WriteCipherGenerator { + @Override + public SSLWriteCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, ProtocolVersion protocolVersion, + String algorithm, Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new BlockWriteCipher(authenticator, protocolVersion, + sslCipher, algorithm, key, params, random); + } + + static final class BlockWriteCipher extends SSLWriteCipher { + private final Cipher cipher; + private final SecureRandom random; + + BlockWriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + this.random = random; + if (params == null) { + params = new IvParameterSpec(new byte[sslCipher.ivSize]); + } + cipher.init(Cipher.ENCRYPT_MODE, key, params, random); + } + + @Override + public int encrypt(byte contentType, ByteBuffer bb) { + // To be unique and aware of overflow-wrap, sequence number + // is used as the nonce_explicit of block cipher suites. + int pos = bb.position(); + + // add message authentication code + MAC signer = (MAC)authenticator; + if (signer.macAlg().size != 0) { + addMac(signer, bb, contentType); + } else { + authenticator.increaseSequenceNumber(); + } + + // DON'T WORRY, the nonce spaces are considered already. + byte[] nonce = new byte[cipher.getBlockSize()]; + random.nextBytes(nonce); + pos = pos - nonce.length; + bb.position(pos); + bb.put(nonce); + bb.position(pos); + + int blockSize = cipher.getBlockSize(); + int len = addPadding(bb, blockSize); + bb.position(pos); + + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Padded plaintext before ENCRYPTION", + bb.duplicate()); + } + + ByteBuffer dup = bb.duplicate(); + try { + if (len != cipher.update(dup, bb)) { + // catch BouncyCastle buffering error + throw new RuntimeException( + "Unexpected number of plaintext bytes"); + } + + if (bb.position() != dup.position()) { + throw new RuntimeException( + "Unexpected ByteBuffer position"); + } + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + + return len; + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int getExplicitNonceSize() { + return cipher.getBlockSize(); + } + + @Override + int calculateFragmentSize(int packetLimit, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + int blockSize = cipher.getBlockSize(); + int fragLen = packetLimit - headerSize - blockSize; + fragLen -= (fragLen % blockSize); // cannot hold a block + // No padding for a maximum fragment. + fragLen -= 1; // 1 byte padding length field: 0x00 + fragLen -= macLen; + return fragLen; + } + + @Override + int calculatePacketSize(int fragmentSize, int headerSize) { + int macLen = ((MAC)authenticator).macAlg().size; + int blockSize = cipher.getBlockSize(); + int paddedLen = fragmentSize + macLen + 1; + if ((paddedLen % blockSize) != 0) { + paddedLen += blockSize - 1; + paddedLen -= paddedLen % blockSize; + } + + return headerSize + blockSize + paddedLen; + } + + @Override + boolean isCBCMode() { + return true; + } + } + } + + private static final + class T12GcmReadCipherGenerator implements ReadCipherGenerator { + @Override + public SSLReadCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new GcmReadCipher(authenticator, protocolVersion, sslCipher, + algorithm, key, params, random); + } + + static final class GcmReadCipher extends SSLReadCipher { + private final Cipher cipher; + private final int tagSize; + private final Key key; + private final byte[] fixedIv; + private final int recordIvSize; + private final SecureRandom random; + + GcmReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + this.tagSize = sslCipher.tagSize; + this.key = key; + this.fixedIv = ((IvParameterSpec)params).getIV(); + this.recordIvSize = sslCipher.ivSize - sslCipher.fixedIvSize; + this.random = random; + + // DON'T initialize the cipher for AEAD! + } + + @Override + public Plaintext decrypt(byte contentType, ByteBuffer bb, + byte[] sequence) throws GeneralSecurityException { + if (bb.remaining() < (recordIvSize + tagSize)) { + throw new BadPaddingException( + "Insufficient buffer remaining for AEAD cipher " + + "fragment (" + bb.remaining() + "). Needs to be " + + "more than or equal to IV size (" + recordIvSize + + ") + tag size (" + tagSize + ")"); + } + + // initialize the AEAD cipher for the unique IV + byte[] iv = Arrays.copyOf(fixedIv, + fixedIv.length + recordIvSize); + bb.get(iv, fixedIv.length, recordIvSize); + GCMParameterSpec spec = new GCMParameterSpec(tagSize * 8, iv); + try { + cipher.init(Cipher.DECRYPT_MODE, key, spec, random); + } catch (InvalidKeyException | + InvalidAlgorithmParameterException ikae) { + // unlikely to happen + throw new RuntimeException( + "invalid key or spec in GCM mode", ikae); + } + + // update the additional authentication data + byte[] aad = authenticator.acquireAuthenticationBytes( + contentType, bb.remaining() - tagSize, + sequence); + cipher.updateAAD(aad); + + // DON'T decrypt the nonce_explicit for AEAD mode. The buffer + // position has moved out of the nonce_explicit range. + int len, pos = bb.position(); + ByteBuffer dup = bb.duplicate(); + try { + len = cipher.doFinal(dup, bb); + } catch (IllegalBlockSizeException ibse) { + // unlikely to happen + throw new RuntimeException( + "Cipher error in AEAD mode \"" + ibse.getMessage() + + " \"in JCE provider " + cipher.getProvider().getName()); + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + // reset the limit to the end of the decrypted data + bb.position(pos); + bb.limit(pos + len); + + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Plaintext after DECRYPTION", bb.duplicate()); + } + + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int estimateFragmentSize(int packetSize, int headerSize) { + return packetSize - headerSize - recordIvSize - tagSize; + } + } + } + + private static final + class T12GcmWriteCipherGenerator implements WriteCipherGenerator { + @Override + public SSLWriteCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, + ProtocolVersion protocolVersion, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new GcmWriteCipher(authenticator, protocolVersion, sslCipher, + algorithm, key, params, random); + } + + private static final class GcmWriteCipher extends SSLWriteCipher { + private final Cipher cipher; + private final int tagSize; + private final Key key; + private final byte[] fixedIv; + private final int recordIvSize; + private final SecureRandom random; + + GcmWriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + this.tagSize = sslCipher.tagSize; + this.key = key; + this.fixedIv = ((IvParameterSpec)params).getIV(); + this.recordIvSize = sslCipher.ivSize - sslCipher.fixedIvSize; + this.random = random; + + // DON'T initialize the cipher for AEAD! + } + + @Override + public int encrypt(byte contentType, + ByteBuffer bb) { + // To be unique and aware of overflow-wrap, sequence number + // is used as the nonce_explicit of AEAD cipher suites. + byte[] nonce = authenticator.sequenceNumber(); + + // initialize the AEAD cipher for the unique IV + byte[] iv = Arrays.copyOf(fixedIv, + fixedIv.length + nonce.length); + System.arraycopy(nonce, 0, iv, fixedIv.length, nonce.length); + + GCMParameterSpec spec = new GCMParameterSpec(tagSize * 8, iv); + try { + cipher.init(Cipher.ENCRYPT_MODE, key, spec, random); + } catch (InvalidKeyException | + InvalidAlgorithmParameterException ikae) { + // unlikely to happen + throw new RuntimeException( + "invalid key or spec in GCM mode", ikae); + } + + // Update the additional authentication data, using the + // implicit sequence number of the authenticator. + byte[] aad = authenticator.acquireAuthenticationBytes( + contentType, bb.remaining(), null); + cipher.updateAAD(aad); + + // DON'T WORRY, the nonce spaces are considered already. + bb.position(bb.position() - nonce.length); + bb.put(nonce); + + // DON'T encrypt the nonce for AEAD mode. + int len, pos = bb.position(); + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Plaintext before ENCRYPTION", + bb.duplicate()); + } + + ByteBuffer dup = bb.duplicate(); + int outputSize = cipher.getOutputSize(dup.remaining()); + if (outputSize > bb.remaining()) { + // Need to expand the limit of the output buffer for + // the authentication tag. + // + // DON'T worry about the buffer's capacity, we have + // reserved space for the authentication tag. + bb.limit(pos + outputSize); + } + + try { + len = cipher.doFinal(dup, bb); + } catch (IllegalBlockSizeException | + BadPaddingException | ShortBufferException ibse) { + // unlikely to happen + throw new RuntimeException( + "Cipher error in AEAD mode in JCE provider " + + cipher.getProvider().getName(), ibse); + } + + if (len != outputSize) { + throw new RuntimeException( + "Cipher buffering error in JCE provider " + + cipher.getProvider().getName()); + } + + return len + nonce.length; + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int getExplicitNonceSize() { + return recordIvSize; + } + + @Override + int calculateFragmentSize(int packetLimit, int headerSize) { + return packetLimit - headerSize - recordIvSize - tagSize; + } + + @Override + int calculatePacketSize(int fragmentSize, int headerSize) { + return fragmentSize + headerSize + recordIvSize + tagSize; + } + } + } + + private static final + class T13GcmReadCipherGenerator implements ReadCipherGenerator { + + @Override + public SSLReadCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, ProtocolVersion protocolVersion, + String algorithm, Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new GcmReadCipher(authenticator, protocolVersion, sslCipher, + algorithm, key, params, random); + } + + static final class GcmReadCipher extends SSLReadCipher { + private final Cipher cipher; + private final int tagSize; + private final Key key; + private final byte[] iv; + private final SecureRandom random; + + GcmReadCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + this.tagSize = sslCipher.tagSize; + this.key = key; + this.iv = ((IvParameterSpec)params).getIV(); + this.random = random; + + keyLimitCountdown = cipherLimits.getOrDefault( + algorithm.toUpperCase() + ":" + tag[0], 0L); + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("KeyLimit read side: algorithm = " + + algorithm.toUpperCase() + ":" + tag[0] + + "\ncountdown value = " + keyLimitCountdown); + } + if (keyLimitCountdown > 0) { + keyLimitEnabled = true; + } + // DON'T initialize the cipher for AEAD! + } + + @Override + public Plaintext decrypt(byte contentType, ByteBuffer bb, + byte[] sequence) throws GeneralSecurityException { + // An implementation may receive an unencrypted record of type + // change_cipher_spec consisting of the single byte value 0x01 + // at any time after the first ClientHello message has been + // sent or received and before the peer's Finished message has + // been received and MUST simply drop it without further + // processing. + if (contentType == ContentType.CHANGE_CIPHER_SPEC.id) { + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + if (bb.remaining() <= tagSize) { + throw new BadPaddingException( + "Insufficient buffer remaining for AEAD cipher " + + "fragment (" + bb.remaining() + "). Needs to be " + + "more than tag size (" + tagSize + ")"); + } + + byte[] sn = sequence; + if (sn == null) { + sn = authenticator.sequenceNumber(); + } + byte[] nonce = iv.clone(); + int offset = nonce.length - sn.length; + for (int i = 0; i < sn.length; i++) { + nonce[offset + i] ^= sn[i]; + } + + // initialize the AEAD cipher for the unique IV + GCMParameterSpec spec = + new GCMParameterSpec(tagSize * 8, nonce); + try { + cipher.init(Cipher.DECRYPT_MODE, key, spec, random); + } catch (InvalidKeyException | + InvalidAlgorithmParameterException ikae) { + // unlikely to happen + throw new RuntimeException( + "invalid key or spec in GCM mode", ikae); + } + + // Update the additional authentication data, using the + // implicit sequence number of the authenticator. + byte[] aad = authenticator.acquireAuthenticationBytes( + contentType, bb.remaining(), sn); + cipher.updateAAD(aad); + + int len, pos = bb.position(); + ByteBuffer dup = bb.duplicate(); + try { + len = cipher.doFinal(dup, bb); + } catch (IllegalBlockSizeException ibse) { + // unlikely to happen + throw new RuntimeException( + "Cipher error in AEAD mode \"" + ibse.getMessage() + + " \"in JCE provider " + cipher.getProvider().getName()); + } catch (ShortBufferException sbe) { + // catch BouncyCastle buffering error + throw new RuntimeException("Cipher buffering error in " + + "JCE provider " + cipher.getProvider().getName(), sbe); + } + // reset the limit to the end of the decrypted data + bb.position(pos); + bb.limit(pos + len); + + // remove inner plaintext padding + int i = bb.limit() - 1; + for (; i > 0 && bb.get(i) == 0; i--) { + // blank + } + if (i < (pos + 1)) { + throw new BadPaddingException( + "Incorrect inner plaintext: no content type"); + } + contentType = bb.get(i); + bb.limit(i); + + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Plaintext after DECRYPTION", bb.duplicate()); + } + if (keyLimitEnabled) { + keyLimitCountdown -= len; + } + + return new Plaintext(contentType, + ProtocolVersion.NONE.major, ProtocolVersion.NONE.minor, + -1, -1L, bb.slice()); + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int estimateFragmentSize(int packetSize, int headerSize) { + return packetSize - headerSize - tagSize; + } + } + } + + private static final + class T13GcmWriteCipherGenerator implements WriteCipherGenerator { + @Override + public SSLWriteCipher createCipher(SSLCipher sslCipher, + Authenticator authenticator, ProtocolVersion protocolVersion, + String algorithm, Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + return new GcmWriteCipher(authenticator, protocolVersion, sslCipher, + algorithm, key, params, random); + } + + private static final class GcmWriteCipher extends SSLWriteCipher { + private final Cipher cipher; + private final int tagSize; + private final Key key; + private final byte[] iv; + private final SecureRandom random; + + GcmWriteCipher(Authenticator authenticator, + ProtocolVersion protocolVersion, + SSLCipher sslCipher, String algorithm, + Key key, AlgorithmParameterSpec params, + SecureRandom random) throws GeneralSecurityException { + super(authenticator, protocolVersion); + this.cipher = JsseJce.getCipher(algorithm); + this.tagSize = sslCipher.tagSize; + this.key = key; + this.iv = ((IvParameterSpec)params).getIV(); + this.random = random; + + keyLimitCountdown = cipherLimits.getOrDefault( + algorithm.toUpperCase() + ":" + tag[0], 0L); + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("KeyLimit write side: algorithm = " + + algorithm.toUpperCase() + ":" + tag[0] + + "\ncountdown value = " + keyLimitCountdown); + } + if (keyLimitCountdown > 0) { + keyLimitEnabled = true; + } + + // DON'T initialize the cipher for AEAD! + } + + @Override + public int encrypt(byte contentType, + ByteBuffer bb) { + byte[] sn = authenticator.sequenceNumber(); + byte[] nonce = iv.clone(); + int offset = nonce.length - sn.length; + for (int i = 0; i < sn.length; i++) { + nonce[offset + i] ^= sn[i]; + } + + // initialize the AEAD cipher for the unique IV + GCMParameterSpec spec = + new GCMParameterSpec(tagSize * 8, nonce); + try { + cipher.init(Cipher.ENCRYPT_MODE, key, spec, random); + } catch (InvalidKeyException | + InvalidAlgorithmParameterException ikae) { + // unlikely to happen + throw new RuntimeException( + "invalid key or spec in GCM mode", ikae); + } + + // Update the additional authentication data, using the + // implicit sequence number of the authenticator. + int outputSize = cipher.getOutputSize(bb.remaining()); + byte[] aad = authenticator.acquireAuthenticationBytes( + contentType, outputSize, sn); + cipher.updateAAD(aad); + + int len, pos = bb.position(); + if (SSLLogger.isOn && SSLLogger.isOn("plaintext")) { + SSLLogger.fine( + "Plaintext before ENCRYPTION", + bb.duplicate()); + } + + ByteBuffer dup = bb.duplicate(); + if (outputSize > bb.remaining()) { + // Need to expand the limit of the output buffer for + // the authentication tag. + // + // DON'T worry about the buffer's capacity, we have + // reserved space for the authentication tag. + bb.limit(pos + outputSize); + } + + try { + len = cipher.doFinal(dup, bb); + } catch (IllegalBlockSizeException | + BadPaddingException | ShortBufferException ibse) { + // unlikely to happen + throw new RuntimeException( + "Cipher error in AEAD mode in JCE provider " + + cipher.getProvider().getName(), ibse); + } + + if (len != outputSize) { + throw new RuntimeException( + "Cipher buffering error in JCE provider " + + cipher.getProvider().getName()); + } + + if (keyLimitEnabled) { + keyLimitCountdown -= len; + } + return len; + } + + @Override + void dispose() { + if (cipher != null) { + try { + cipher.doFinal(); + } catch (Exception e) { + // swallow all types of exceptions. + } + } + } + + @Override + int getExplicitNonceSize() { + return 0; + } + + @Override + int calculateFragmentSize(int packetLimit, int headerSize) { + return packetLimit - headerSize - tagSize; + } + + @Override + int calculatePacketSize(int fragmentSize, int headerSize) { + return fragmentSize + headerSize + tagSize; + } + } + } + + private static void addMac(MAC signer, + ByteBuffer destination, byte contentType) { + if (signer.macAlg().size != 0) { + int dstContent = destination.position(); + byte[] hash = signer.compute(contentType, destination, false); + + /* + * position was advanced to limit in MAC compute above. + * + * Mark next area as writable (above layers should have + * established that we have plenty of room), then write + * out the hash. + */ + destination.limit(destination.limit() + hash.length); + destination.put(hash); + + // reset the position and limit + destination.position(dstContent); + } + } + + // for null and stream cipher + private static void checkStreamMac(MAC signer, ByteBuffer bb, + byte contentType, byte[] sequence) throws BadPaddingException { + int tagLen = signer.macAlg().size; + + // Requires message authentication code for null, stream and + // block cipher suites. + if (tagLen != 0) { + int contentLen = bb.remaining() - tagLen; + if (contentLen < 0) { + throw new BadPaddingException("bad record"); + } + + // Run MAC computation and comparison on the payload. + // + // MAC data would be stripped off during the check. + if (checkMacTags(contentType, bb, signer, sequence, false)) { + throw new BadPaddingException("bad record MAC"); + } + } + } + + // for CBC cipher + private static void checkCBCMac(MAC signer, ByteBuffer bb, + byte contentType, int cipheredLength, + byte[] sequence) throws BadPaddingException { + BadPaddingException reservedBPE = null; + int tagLen = signer.macAlg().size; + int pos = bb.position(); + + if (tagLen != 0) { + int contentLen = bb.remaining() - tagLen; + if (contentLen < 0) { + reservedBPE = new BadPaddingException("bad record"); + + // set offset of the dummy MAC + contentLen = cipheredLength - tagLen; + bb.limit(pos + cipheredLength); + } + + // Run MAC computation and comparison on the payload. + // + // MAC data would be stripped off during the check. + if (checkMacTags(contentType, bb, signer, sequence, false)) { + if (reservedBPE == null) { + reservedBPE = + new BadPaddingException("bad record MAC"); + } + } + + // Run MAC computation and comparison on the remainder. + int remainingLen = calculateRemainingLen( + signer, cipheredLength, contentLen); + + // NOTE: remainingLen may be bigger (less than 1 block of the + // hash algorithm of the MAC) than the cipheredLength. + // + // Is it possible to use a static buffer, rather than allocate + // it dynamically? + remainingLen += signer.macAlg().size; + ByteBuffer temporary = ByteBuffer.allocate(remainingLen); + + // Won't need to worry about the result on the remainder. And + // then we won't need to worry about what's actual data to + // check MAC tag on. We start the check from the header of the + // buffer so that we don't need to construct a new byte buffer. + checkMacTags(contentType, temporary, signer, sequence, true); + } + + // Is it a failover? + if (reservedBPE != null) { + throw reservedBPE; + } + } + + /* + * Run MAC computation and comparison + */ + private static boolean checkMacTags(byte contentType, ByteBuffer bb, + MAC signer, byte[] sequence, boolean isSimulated) { + int tagLen = signer.macAlg().size; + int position = bb.position(); + int lim = bb.limit(); + int macOffset = lim - tagLen; + + bb.limit(macOffset); + byte[] hash = signer.compute(contentType, bb, sequence, isSimulated); + if (hash == null || tagLen != hash.length) { + // Something is wrong with MAC implementation. + throw new RuntimeException("Internal MAC error"); + } + + bb.position(macOffset); + bb.limit(lim); + try { + int[] results = compareMacTags(bb, hash); + return (results[0] != 0); + } finally { + // reset to the data + bb.position(position); + bb.limit(macOffset); + } + } + + /* + * A constant-time comparison of the MAC tags. + * + * Please DON'T change the content of the ByteBuffer parameter! + */ + private static int[] compareMacTags(ByteBuffer bb, byte[] tag) { + // An array of hits is used to prevent Hotspot optimization for + // the purpose of a constant-time check. + int[] results = {0, 0}; // {missed #, matched #} + + // The caller ensures there are enough bytes available in the buffer. + // So we won't need to check the remaining of the buffer. + for (byte t : tag) { + if (bb.get() != t) { + results[0]++; // mismatched bytes + } else { + results[1]++; // matched bytes + } + } + + return results; + } + + /* + * Calculate the length of a dummy buffer to run MAC computation + * and comparison on the remainder. + * + * The caller MUST ensure that the fullLen is not less than usedLen. + */ + private static int calculateRemainingLen( + MAC signer, int fullLen, int usedLen) { + + int blockLen = signer.macAlg().hashBlockSize; + int minimalPaddingLen = signer.macAlg().minimalPaddingSize; + + // (blockLen - minimalPaddingLen) is the maximum message size of + // the last block of hash function operation. See FIPS 180-4, or + // MD5 specification. + fullLen += 13 - (blockLen - minimalPaddingLen); + usedLen += 13 - (blockLen - minimalPaddingLen); + + // Note: fullLen is always not less than usedLen, and blockLen + // is always bigger than minimalPaddingLen, so we don't worry + // about negative values. 0x01 is added to the result to ensure + // that the return value is positive. The extra one byte does + // not impact the overall MAC compression function evaluations. + return 0x01 + (int)(Math.ceil(fullLen/(1.0d * blockLen)) - + Math.ceil(usedLen/(1.0d * blockLen))) * blockLen; + } + + private static int addPadding(ByteBuffer bb, int blockSize) { + + int len = bb.remaining(); + int offset = bb.position(); + + int newlen = len + 1; + byte pad; + int i; + + if ((newlen % blockSize) != 0) { + newlen += blockSize - 1; + newlen -= newlen % blockSize; + } + pad = (byte) (newlen - len); + + /* + * Update the limit to what will be padded. + */ + bb.limit(newlen + offset); + + /* + * TLS version of the padding works for both SSLv3 and TLSv1 + */ + for (i = 0, offset += len; i < pad; i++) { + bb.put(offset++, (byte) (pad - 1)); + } + + bb.position(offset); + bb.limit(offset); + + return newlen; + } + + private static int removePadding(ByteBuffer bb, + int tagLen, int blockSize, + ProtocolVersion protocolVersion) throws BadPaddingException { + int len = bb.remaining(); + int offset = bb.position(); + + // last byte is length byte (i.e. actual padding length - 1) + int padOffset = offset + len - 1; + int padLen = bb.get(padOffset) & 0xFF; + + int newLen = len - (padLen + 1); + if ((newLen - tagLen) < 0) { + // If the buffer is not long enough to contain the padding plus + // a MAC tag, do a dummy constant-time padding check. + // + // Note that it is a dummy check, so we won't care about what is + // the actual padding data. + checkPadding(bb.duplicate(), (byte)(padLen & 0xFF)); + + throw new BadPaddingException("Invalid Padding length: " + padLen); + } + + // The padding data should be filled with the padding length value. + int[] results = checkPadding( + bb.duplicate().position(offset + newLen), + (byte)(padLen & 0xFF)); + if (protocolVersion.useTLS10PlusSpec()) { + if (results[0] != 0) { // padding data has invalid bytes + throw new BadPaddingException("Invalid TLS padding data"); + } + } else { // SSLv3 + // SSLv3 requires 0 <= length byte < block size + // some implementations do 1 <= length byte <= block size, + // so accept that as well + // v3 does not require any particular value for the other bytes + if (padLen > blockSize) { + throw new BadPaddingException("Padding length (" + + padLen + ") of SSLv3 message should not be bigger " + + "than the block size (" + blockSize + ")"); + } + } + + // Reset buffer limit to remove padding. + bb.limit(offset + newLen); + + return newLen; + } + + /* + * A constant-time check of the padding. + * + * NOTE that we are checking both the padding and the padLen bytes here. + * + * The caller MUST ensure that the bb parameter has remaining. + */ + private static int[] checkPadding(ByteBuffer bb, byte pad) { + if (!bb.hasRemaining()) { + throw new RuntimeException("hasRemaining() must be positive"); + } + + // An array of hits is used to prevent Hotspot optimization for + // the purpose of a constant-time check. + int[] results = {0, 0}; // {missed #, matched #} + bb.mark(); + for (int i = 0; i <= 256; bb.reset()) { + for (; bb.hasRemaining() && i <= 256; i++) { + if (bb.get() != pad) { + results[0]++; // mismatched padding data + } else { + results[1]++; // matched padding data + } + } + } + + return results; + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,420 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.AlgorithmConstraints; +import java.security.NoSuchAlgorithmException; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.function.BiFunction; +import javax.net.ssl.HandshakeCompletedListener; +import javax.net.ssl.SNIMatcher; +import javax.net.ssl.SNIServerName; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLSocket; +import sun.security.ssl.SSLExtension.ClientExtensions; +import sun.security.ssl.SSLExtension.ServerExtensions; + +/** + * SSL/(D)TLS configuration. + */ +final class SSLConfiguration implements Cloneable { + // configurations with SSLParameters + AlgorithmConstraints algorithmConstraints; + List<ProtocolVersion> enabledProtocols; + List<CipherSuite> enabledCipherSuites; + ClientAuthType clientAuthType; + String identificationProtocol; + List<SNIServerName> serverNames; + Collection<SNIMatcher> sniMatchers; + String[] applicationProtocols; + boolean preferLocalCipherSuites; + boolean enableRetransmissions; + int maximumPacketSize; + + // the maximum protocol version of enabled protocols + ProtocolVersion maximumProtocolVersion; + + // Configurations per SSLSocket or SSLEngine instance. + boolean isClientMode; + boolean enableSessionCreation; + + // the application layer protocol negotiation configuration + BiFunction<SSLSocket, List<String>, String> socketAPSelector; + BiFunction<SSLEngine, List<String>, String> engineAPSelector; + + HashMap<HandshakeCompletedListener, AccessControlContext> + handshakeListeners; + + boolean noSniExtension; + boolean noSniMatcher; + + // To switch off the extended_master_secret extension. + static final boolean useExtendedMasterSecret; + + // Allow session resumption without Extended Master Secret extension. + static final boolean allowLegacyResumption = + Utilities.getBooleanProperty("jdk.tls.allowLegacyResumption", true); + + // Allow full handshake without Extended Master Secret extension. + static final boolean allowLegacyMasterSecret = + Utilities.getBooleanProperty("jdk.tls.allowLegacyMasterSecret", true); + + // Allow full handshake without Extended Master Secret extension. + static final boolean useCompatibilityMode = Utilities.getBooleanProperty( + "jdk.tls.client.useCompatibilityMode", true); + +// TODO: Please remove after TLS 1.3 draft interop testing +// delete me +static int tls13VN; + + // Is the extended_master_secret extension supported? + static { + boolean supportExtendedMasterSecret = Utilities.getBooleanProperty( + "jdk.tls.useExtendedMasterSecret", true); + if (supportExtendedMasterSecret) { + try { + JsseJce.getKeyGenerator("SunTlsExtendedMasterSecret"); + } catch (NoSuchAlgorithmException nae) { + supportExtendedMasterSecret = false; + } + } + useExtendedMasterSecret = supportExtendedMasterSecret; + +// delete me +try { + tls13VN = + AccessController.doPrivileged( + new PrivilegedExceptionAction<Integer>() { + @Override + public Integer run() throws Exception { + return Integer.parseInt( + System.getProperty("jdk.tls13.version", "0304"), 16); + } + }); +} catch (PrivilegedActionException ex) { + // blank +} + } + + SSLConfiguration(SSLContextImpl sslContext, boolean isClientMode) { + + // Configurations with SSLParameters, default values. + this.algorithmConstraints = SSLAlgorithmConstraints.DEFAULT; + this.enabledProtocols = + sslContext.getDefaultProtocolVersions(!isClientMode); + this.enabledCipherSuites = + sslContext.getDefaultCipherSuites(!isClientMode); + this.clientAuthType = ClientAuthType.CLIENT_AUTH_NONE; + + this.identificationProtocol = null; + this.serverNames = Collections.<SNIServerName>emptyList(); + this.sniMatchers = Collections.<SNIMatcher>emptyList(); + this.preferLocalCipherSuites = false; + + this.applicationProtocols = new String[0]; + this.enableRetransmissions = sslContext.isDTLS(); + this.maximumPacketSize = 0; // please reset it explicitly later + + this.maximumProtocolVersion = ProtocolVersion.NONE; + for (ProtocolVersion pv : enabledProtocols) { + if (pv.compareTo(maximumProtocolVersion) > 0) { + this.maximumProtocolVersion = pv; + } + } + + // Configurations per SSLSocket or SSLEngine instance. + this.isClientMode = isClientMode; + this.enableSessionCreation = true; + this.socketAPSelector = null; + this.engineAPSelector = null; + + this.handshakeListeners = null; + this.noSniExtension = false; + this.noSniMatcher = false; + } + + SSLParameters getSSLParameters() { + SSLParameters params = new SSLParameters(); + + params.setAlgorithmConstraints(this.algorithmConstraints); + params.setProtocols(ProtocolVersion.toStringArray(enabledProtocols)); + params.setCipherSuites(CipherSuite.namesOf(enabledCipherSuites)); + switch (this.clientAuthType) { + case CLIENT_AUTH_REQUIRED: + params.setNeedClientAuth(true); + break; + case CLIENT_AUTH_REQUESTED: + params.setWantClientAuth(true); + break; + default: + params.setWantClientAuth(false); + } + params.setEndpointIdentificationAlgorithm(this.identificationProtocol); + + if (serverNames.isEmpty() && !noSniExtension) { + // 'null' indicates none has been set + params.setServerNames(null); + } else { + params.setServerNames(this.serverNames); + } + + if (sniMatchers.isEmpty() && !noSniMatcher) { + // 'null' indicates none has been set + params.setSNIMatchers(null); + } else { + params.setSNIMatchers(this.sniMatchers); + } + + params.setApplicationProtocols(this.applicationProtocols); + params.setUseCipherSuitesOrder(this.preferLocalCipherSuites); + params.setEnableRetransmissions(this.enableRetransmissions); + params.setMaximumPacketSize(this.maximumPacketSize); + + return params; + } + + void setSSLParameters(SSLParameters params) { + AlgorithmConstraints ac = params.getAlgorithmConstraints(); + if (ac != null) { + this.algorithmConstraints = ac; + } // otherwise, use the default value + + String[] sa = params.getCipherSuites(); + if (sa != null) { + this.enabledCipherSuites = CipherSuite.validValuesOf(sa); + } // otherwise, use the default values + + sa = params.getProtocols(); + if (sa != null) { + this.enabledProtocols = ProtocolVersion.namesOf(sa); + + this.maximumProtocolVersion = ProtocolVersion.NONE; + for (ProtocolVersion pv : enabledProtocols) { + if (pv.compareTo(maximumProtocolVersion) > 0) { + this.maximumProtocolVersion = pv; + } + } + } // otherwise, use the default values + + if (params.getNeedClientAuth()) { + this.clientAuthType = ClientAuthType.CLIENT_AUTH_REQUIRED; + } else if (params.getWantClientAuth()) { + this.clientAuthType = ClientAuthType.CLIENT_AUTH_REQUESTED; + } else { + this.clientAuthType = ClientAuthType.CLIENT_AUTH_NONE; + } + + String s = params.getEndpointIdentificationAlgorithm(); + if (s != null) { + this.identificationProtocol = s; + } // otherwise, use the default value + + List<SNIServerName> sniNames = params.getServerNames(); + if (sniNames != null) { + this.noSniExtension = sniNames.isEmpty(); + this.serverNames = sniNames; + } // null if none has been set + + Collection<SNIMatcher> matchers = params.getSNIMatchers(); + if (matchers != null) { + this.noSniMatcher = matchers.isEmpty(); + this.sniMatchers = matchers; + } // null if none has been set + + sa = params.getApplicationProtocols(); + if (sa != null) { + this.applicationProtocols = sa; + } // otherwise, use the default values + + this.preferLocalCipherSuites = params.getUseCipherSuitesOrder(); + this.enableRetransmissions = params.getEnableRetransmissions(); + this.maximumPacketSize = params.getMaximumPacketSize(); + } + + // SSLSocket only + void addHandshakeCompletedListener( + HandshakeCompletedListener listener) { + + if (handshakeListeners == null) { + handshakeListeners = new HashMap<>(4); + } + + handshakeListeners.put(listener, AccessController.getContext()); + } + + // SSLSocket only + void removeHandshakeCompletedListener( + HandshakeCompletedListener listener) { + + if (handshakeListeners == null) { + throw new IllegalArgumentException("no listeners"); + } + + if (handshakeListeners.remove(listener) == null) { + throw new IllegalArgumentException("listener not registered"); + } + + if (handshakeListeners.isEmpty()) { + handshakeListeners = null; + } + } + + /** + * Return true if the extension is available. + */ + boolean isAvailable(SSLExtension extension) { + for (ProtocolVersion protocolVersion : enabledProtocols) { + if (extension.isAvailable(protocolVersion)) { + if (isClientMode ? + ClientExtensions.defaults.contains(extension) : + ServerExtensions.defaults.contains(extension)) { + return true; + } + } + } + + return false; + } + + /** + * Return true if the extension is available for the specific protocol. + */ + boolean isAvailable(SSLExtension extension, + ProtocolVersion protocolVersion) { + return extension.isAvailable(protocolVersion) && + (isClientMode ? ClientExtensions.defaults.contains(extension) : + ServerExtensions.defaults.contains(extension)); + } + + /** + * Get the enabled extensions for the specific handshake message. + * + * Used to consume handshake extensions. + */ + SSLExtension[] getEnabledExtensions(SSLHandshake handshakeType) { + List<SSLExtension> extensions = new ArrayList<>(); + for (SSLExtension extension : SSLExtension.values()) { + if (extension.handshakeType == handshakeType) { + if (isAvailable(extension)) { + extensions.add(extension); + } + } + } + + return extensions.toArray(new SSLExtension[0]); + } + + /** + * Get the enabled extensions for the specific handshake message, excluding + * the specified extensions. + * + * Used to consume handshake extensions. + */ + SSLExtension[] getExclusiveExtensions(SSLHandshake handshakeType, + List<SSLExtension> excluded) { + List<SSLExtension> extensions = new ArrayList<>(); + for (SSLExtension extension : SSLExtension.values()) { + if (extension.handshakeType == handshakeType) { + if (isAvailable(extension) && !excluded.contains(extension)) { + extensions.add(extension); + } + } + } + + return extensions.toArray(new SSLExtension[0]); + } + + /** + * Get the enabled extensions for the specific handshake message + * and the specific protocol version. + * + * Used to produce handshake extensions after handshake protocol + * version negotiation. + */ + SSLExtension[] getEnabledExtensions( + SSLHandshake handshakeType, ProtocolVersion protocolVersion) { + return getEnabledExtensions( + handshakeType, Arrays.asList(protocolVersion)); + } + + /** + * Get the enabled extensions for the specific handshake message + * and the specific protocol versions. + * + * Used to produce ClientHello extensions before handshake protocol + * version negotiation. + */ + SSLExtension[] getEnabledExtensions( + SSLHandshake handshakeType, List<ProtocolVersion> activeProtocols) { + List<SSLExtension> extensions = new ArrayList<>(); + for (SSLExtension extension : SSLExtension.values()) { + if (extension.handshakeType == handshakeType) { + if (!isAvailable(extension)) { + continue; + } + + for (ProtocolVersion protocolVersion : activeProtocols) { + if (extension.isAvailable(protocolVersion)) { + extensions.add(extension); + break; + } + } + } + } + + return extensions.toArray(new SSLExtension[0]); + } + + @Override + @SuppressWarnings({"unchecked", "CloneDeclaresCloneNotSupported"}) + public Object clone() { + // Note that only references to the configurations are copied. + try { + SSLConfiguration config = (SSLConfiguration)super.clone(); + if (handshakeListeners != null) { + config.handshakeListeners = + (HashMap<HandshakeCompletedListener, AccessControlContext>) + handshakeListeners.clone(); + } + + return config; + } catch (CloneNotSupportedException cnse) { + // unlikely + } + + return null; // unlikely + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLConsumer.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLConsumer.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLConsumer.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLConsumer.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; + +interface SSLConsumer { + void consume(ConnectionContext context, + ByteBuffer message) throws IOException; +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLContextImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,23 +25,25 @@ package sun.security.ssl; -import java.net.Socket; - import java.io.*; -import java.util.*; +import java.net.Socket; import java.security.*; import java.security.cert.*; -import java.security.cert.Certificate; - +import java.util.*; import javax.net.ssl.*; - -import sun.security.provider.certpath.AlgorithmChecker; import sun.security.action.GetPropertyAction; +import sun.security.provider.certpath.AlgorithmChecker; import sun.security.validator.Validator; -public abstract class SSLContextImpl extends SSLContextSpi { +/** + * Implementation of an SSLContext. + * + * Implementation note: Instances of this class and the child classes are + * immutable, except that the context initialization (SSLContext.init()) may + * reset the key, trust managers and source of secure random. + */ - private static final Debug debug = Debug.getInstance("ssl"); +public abstract class SSLContextImpl extends SSLContextSpi { private final EphemeralKeyManager ephemeralKeyManager; private final SSLSessionContextImpl clientCache; @@ -54,15 +56,15 @@ private SecureRandom secureRandom; // DTLS cookie exchange manager - private volatile HelloCookieManager helloCookieManager; + private volatile HelloCookieManager.Builder helloCookieManagerBuilder; - private final boolean clientEnableStapling = Debug.getBooleanProperty( + private final boolean clientEnableStapling = Utilities.getBooleanProperty( "jdk.tls.client.enableStatusRequestExtension", true); - private final boolean serverEnableStapling = Debug.getBooleanProperty( + private final boolean serverEnableStapling = Utilities.getBooleanProperty( "jdk.tls.server.enableStatusRequestExtension", false); - private final static Collection<CipherSuite> clientCustomizedCipherSuites = + private static final Collection<CipherSuite> clientCustomizedCipherSuites = getCustomizedCipherSuites("jdk.tls.client.cipherSuites"); - private final static Collection<CipherSuite> serverCustomizedCipherSuites = + private static final Collection<CipherSuite> serverCustomizedCipherSuites = getCustomizedCipherSuites("jdk.tls.server.cipherSuites"); private volatile StatusResponseManager statusResponseManager; @@ -109,12 +111,12 @@ * first connection to timeout and fail. Make sure it is * primed and ready by getting some initial output from it. */ - if (debug != null && Debug.isOn("sslctx")) { - System.out.println("trigger seeding of SecureRandom"); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,sslctx")) { + SSLLogger.finest("trigger seeding of SecureRandom"); } secureRandom.nextInt(); - if (debug != null && Debug.isOn("sslctx")) { - System.out.println("done seeding SecureRandom"); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,sslctx")) { + SSLLogger.finest("done seeding of SecureRandom"); } isInitialized = true; @@ -168,10 +170,10 @@ if (km instanceof X509ExtendedKeyManager) { return (X509ExtendedKeyManager)km; } - if (debug != null && Debug.isOn("sslctx")) { - System.out.println( - "X509KeyManager passed to " + - "SSLContext.init(): need an " + + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,sslctx")) { + SSLLogger.warning( + "X509KeyManager passed to SSLContext.init(): need an " + "X509ExtendedKeyManager for SSLEngine use"); } return new AbstractKeyManagerWrapper((X509KeyManager)km); @@ -242,36 +244,26 @@ return ephemeralKeyManager; } - // Used for DTLS in server mode only, see ServerHandshaker. - HelloCookieManager getHelloCookieManager() { - if (!isInitialized) { - throw new IllegalStateException("SSLContext is not initialized"); - } - - if (helloCookieManager != null) { - return helloCookieManager; - } - - synchronized (this) { - if (helloCookieManager == null) { - helloCookieManager = getHelloCookieManager(secureRandom); + // Used for DTLS in server mode only. + HelloCookieManager getHelloCookieManager(ProtocolVersion protocolVersion) { + if (helloCookieManagerBuilder == null) { + synchronized (this) { + if (helloCookieManagerBuilder == null) { + helloCookieManagerBuilder = + new HelloCookieManager.Builder(secureRandom); + } } } - return helloCookieManager; - } - - HelloCookieManager getHelloCookieManager(SecureRandom secureRandom) { - throw new UnsupportedOperationException( - "Cookie exchange applies to DTLS only"); + return helloCookieManagerBuilder.valueOf(protocolVersion); } StatusResponseManager getStatusResponseManager() { if (serverEnableStapling && statusResponseManager == null) { synchronized (this) { if (statusResponseManager == null) { - if (debug != null && Debug.isOn("sslctx")) { - System.out.println( + if (SSLLogger.isOn && SSLLogger.isOn("ssl,sslctx")) { + SSLLogger.finest( "Initializing StatusResponseManager"); } statusResponseManager = new StatusResponseManager(); @@ -282,52 +274,55 @@ return statusResponseManager; } - // Get supported ProtocolList. - abstract ProtocolList getSuportedProtocolList(); + // Get supported protocols. + abstract List<ProtocolVersion> getSupportedProtocolVersions(); - // Get default ProtocolList for server mode. - abstract ProtocolList getServerDefaultProtocolList(); + // Get default protocols for server mode. + abstract List<ProtocolVersion> getServerDefaultProtocolVersions(); - // Get default ProtocolList for client mode. - abstract ProtocolList getClientDefaultProtocolList(); + // Get default protocols for client mode. + abstract List<ProtocolVersion> getClientDefaultProtocolVersions(); - // Get supported CipherSuiteList. - abstract CipherSuiteList getSupportedCipherSuiteList(); + // Get supported CipherSuite list. + abstract List<CipherSuite> getSupportedCipherSuites(); - // Get default CipherSuiteList for server mode. - abstract CipherSuiteList getServerDefaultCipherSuiteList(); + // Get default CipherSuite list for server mode. + abstract List<CipherSuite> getServerDefaultCipherSuites(); - // Get default CipherSuiteList for client mode. - abstract CipherSuiteList getClientDefaultCipherSuiteList(); + // Get default CipherSuite list for client mode. + abstract List<CipherSuite> getClientDefaultCipherSuites(); - // Get default ProtocolList. - ProtocolList getDefaultProtocolList(boolean roleIsServer) { - return roleIsServer ? getServerDefaultProtocolList() - : getClientDefaultProtocolList(); + // Is the context for DTLS protocols? + abstract boolean isDTLS(); + + // Get default protocols. + List<ProtocolVersion> getDefaultProtocolVersions(boolean roleIsServer) { + return roleIsServer ? getServerDefaultProtocolVersions() + : getClientDefaultProtocolVersions(); } - // Get default CipherSuiteList. - CipherSuiteList getDefaultCipherSuiteList(boolean roleIsServer) { - return roleIsServer ? getServerDefaultCipherSuiteList() - : getClientDefaultCipherSuiteList(); + // Get default CipherSuite list. + List<CipherSuite> getDefaultCipherSuites(boolean roleIsServer) { + return roleIsServer ? getServerDefaultCipherSuites() + : getClientDefaultCipherSuites(); } /** * Return whether a protocol list is the original default enabled * protocols. See: SSLSocket/SSLEngine.setEnabledProtocols() */ - boolean isDefaultProtocolList(ProtocolList protocols) { - return (protocols == getServerDefaultProtocolList()) || - (protocols == getClientDefaultProtocolList()); + boolean isDefaultProtocolVesions(List<ProtocolVersion> protocols) { + return (protocols == getServerDefaultProtocolVersions()) || + (protocols == getClientDefaultProtocolVersions()); } /** * Return whether a protocol list is the original default enabled * protocols. See: SSLSocket/SSLEngine.setEnabledProtocols() */ - boolean isDefaultCipherSuiteList(CipherSuiteList cipherSuites) { - return (cipherSuites == getServerDefaultCipherSuiteList()) || - (cipherSuites == getClientDefaultCipherSuiteList()); + boolean isDefaultCipherSuiteList(List<CipherSuite> cipherSuites) { + return (cipherSuites == getServerDefaultCipherSuites()) || + (cipherSuites == getClientDefaultCipherSuites()); } /** @@ -342,93 +337,83 @@ return isClient ? clientEnableStapling : serverEnableStapling; } - /* * Return the list of all available CipherSuites that are supported * using currently installed providers. */ - private static CipherSuiteList getApplicableSupportedCipherSuiteList( - ProtocolList protocols) { + private static List<CipherSuite> getApplicableSupportedCipherSuites( + List<ProtocolVersion> protocols) { - return getApplicableCipherSuiteList( - CipherSuite.allowedCipherSuites(), - protocols, CipherSuite.SUPPORTED_SUITES_PRIORITY); + return getApplicableCipherSuites( + CipherSuite.allowedCipherSuites(), protocols); } /* * Return the list of all available CipherSuites that are default enabled * in client or server side. */ - private static CipherSuiteList getApplicableEnabledCipherSuiteList( - ProtocolList protocols, boolean isClient) { + private static List<CipherSuite> getApplicableEnabledCipherSuites( + List<ProtocolVersion> protocols, boolean isClient) { if (isClient) { if (!clientCustomizedCipherSuites.isEmpty()) { - return getApplicableCipherSuiteList( - clientCustomizedCipherSuites, - protocols, CipherSuite.SUPPORTED_SUITES_PRIORITY); + return getApplicableCipherSuites( + clientCustomizedCipherSuites, protocols); } } else { if (!serverCustomizedCipherSuites.isEmpty()) { - return getApplicableCipherSuiteList( - serverCustomizedCipherSuites, - protocols, CipherSuite.SUPPORTED_SUITES_PRIORITY); + return getApplicableCipherSuites( + serverCustomizedCipherSuites, protocols); } } - return getApplicableCipherSuiteList( - CipherSuite.allowedCipherSuites(), - protocols, CipherSuite.DEFAULT_SUITES_PRIORITY); + return getApplicableCipherSuites( + CipherSuite.defaultCipherSuites(), protocols); } /* * Return the list of available CipherSuites which are applicable to * the specified protocols. */ - private static CipherSuiteList getApplicableCipherSuiteList( + private static List<CipherSuite> getApplicableCipherSuites( Collection<CipherSuite> allowedCipherSuites, - ProtocolList protocols, int minPriority) { - + List<ProtocolVersion> protocols) { TreeSet<CipherSuite> suites = new TreeSet<>(); - if (!(protocols.collection().isEmpty()) && - protocols.min.v != ProtocolVersion.NONE.v) { + if (protocols != null && (!protocols.isEmpty())) { for (CipherSuite suite : allowedCipherSuites) { - if (!suite.allowed || suite.priority < minPriority) { + if (!suite.isAvailable()) { continue; } - if (suite.isAvailable() && - !protocols.min.obsoletes(suite) && - protocols.max.supports(suite)) { + boolean isSupported = false; + for (ProtocolVersion protocol : protocols) { + if (!suite.supports(protocol)) { + continue; + } + if (SSLAlgorithmConstraints.DEFAULT.permits( EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), suite.name, null)) { suites.add(suite); - } else { - if (debug != null && Debug.isOn("sslctx") && - Debug.isOn("verbose")) { - System.out.println( - "Ignoring disabled cipher suite: " + - suite.name); - } - } - } else if (debug != null && - Debug.isOn("sslctx") && Debug.isOn("verbose")) { - if (protocols.min.obsoletes(suite)) { - System.out.println( - "Ignoring obsoleted cipher suite: " + suite); - } else if (!protocols.max.supports(suite)) { - System.out.println( - "Ignoring unsupported cipher suite: " + suite); - } else { - System.out.println( - "Ignoring unavailable cipher suite: " + suite); + isSupported = true; + } else if (SSLLogger.isOn && + SSLLogger.isOn("ssl,sslctx,verbose")) { + SSLLogger.fine( + "Ignore disabled cipher suite: " + suite.name); } + + break; + } + + if (!isSupported && SSLLogger.isOn && + SSLLogger.isOn("ssl,sslctx,verbose")) { + SSLLogger.finest( + "Ignore unsupported cipher suite: " + suite); } } } - return new CipherSuiteList(suites); + return new ArrayList<>(suites); } /* @@ -438,8 +423,8 @@ String propertyName) { String property = GetPropertyAction.privilegedGetProperty(propertyName); - if (debug != null && Debug.isOn("sslctx")) { - System.out.println( + if (SSLLogger.isOn && SSLLogger.isOn("ssl,sslctx")) { + SSLLogger.fine( "System property " + propertyName + " is set to '" + property + "'"); } @@ -463,10 +448,10 @@ CipherSuite suite; try { - suite = CipherSuite.valueOf(cipherSuiteNames[i]); + suite = CipherSuite.nameOf(cipherSuiteNames[i]); } catch (IllegalArgumentException iae) { - if (debug != null && Debug.isOn("sslctx")) { - System.out.println( + if (SSLLogger.isOn && SSLLogger.isOn("ssl,sslctx")) { + SSLLogger.fine( "Unknown or unsupported cipher suite name: " + cipherSuiteNames[i]); } @@ -474,11 +459,11 @@ continue; } - if (suite.isAvailable()) { + if (suite != null && suite.isAvailable()) { cipherSuites.add(suite); } else { - if (debug != null && Debug.isOn("sslctx")) { - System.out.println( + if (SSLLogger.isOn && SSLLogger.isOn("ssl,sslctx")) { + SSLLogger.fine( "The current installed providers do not " + "support cipher suite: " + cipherSuiteNames[i]); } @@ -492,23 +477,23 @@ } - private static String[] getAvailableProtocols( + private static List<ProtocolVersion> getAvailableProtocols( ProtocolVersion[] protocolCandidates) { - List<String> availableProtocols = Collections.<String>emptyList(); - if (protocolCandidates != null && protocolCandidates.length != 0) { + List<ProtocolVersion> availableProtocols = + Collections.<ProtocolVersion>emptyList(); + if (protocolCandidates != null && protocolCandidates.length != 0) { availableProtocols = new ArrayList<>(protocolCandidates.length); for (ProtocolVersion p : protocolCandidates) { - if (ProtocolVersion.availableProtocols.contains(p)) { - availableProtocols.add(p.name); + if (p.isAvailable) { + availableProtocols.add(p); } } } - return availableProtocols.toArray(new String[0]); + return availableProtocols; } - /* * The SSLContext implementation for SSL/(D)TLS algorithm * @@ -548,79 +533,108 @@ * @see SSLContext */ private abstract static class AbstractTLSContext extends SSLContextImpl { - private static final ProtocolList supportedProtocolList; - private static final ProtocolList serverDefaultProtocolList; + private static final List<ProtocolVersion> supportedProtocols; + private static final List<ProtocolVersion> serverDefaultProtocols; - private static final CipherSuiteList supportedCipherSuiteList; - private static final CipherSuiteList serverDefaultCipherSuiteList; + private static final List<CipherSuite> supportedCipherSuites; + private static final List<CipherSuite> serverDefaultCipherSuites; static { if (SunJSSE.isFIPS()) { - supportedProtocolList = new ProtocolList(new String[] { - ProtocolVersion.TLS10.name, - ProtocolVersion.TLS11.name, - ProtocolVersion.TLS12.name - }); + supportedProtocols = Arrays.asList( + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, + ProtocolVersion.TLS11, + ProtocolVersion.TLS10 + ); - serverDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { - ProtocolVersion.TLS10, + serverDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, ProtocolVersion.TLS11, - ProtocolVersion.TLS12 - })); - } else { - supportedProtocolList = new ProtocolList(new String[] { - ProtocolVersion.SSL20Hello.name, - ProtocolVersion.SSL30.name, - ProtocolVersion.TLS10.name, - ProtocolVersion.TLS11.name, - ProtocolVersion.TLS12.name + ProtocolVersion.TLS10 }); - - serverDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { - ProtocolVersion.SSL20Hello, - ProtocolVersion.SSL30, + } else { + supportedProtocols = Arrays.asList( + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, + ProtocolVersion.TLS11, ProtocolVersion.TLS10, + ProtocolVersion.SSL30, + ProtocolVersion.SSL20Hello + ); + + serverDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, ProtocolVersion.TLS11, - ProtocolVersion.TLS12 - })); + ProtocolVersion.TLS10, + ProtocolVersion.SSL30, + ProtocolVersion.SSL20Hello + }); } - supportedCipherSuiteList = getApplicableSupportedCipherSuiteList( - supportedProtocolList); - serverDefaultCipherSuiteList = getApplicableEnabledCipherSuiteList( - serverDefaultProtocolList, false); + supportedCipherSuites = getApplicableSupportedCipherSuites( + supportedProtocols); + serverDefaultCipherSuites = getApplicableEnabledCipherSuites( + serverDefaultProtocols, false); } @Override - ProtocolList getSuportedProtocolList() { - return supportedProtocolList; + List<ProtocolVersion> getSupportedProtocolVersions() { + return supportedProtocols; } @Override - CipherSuiteList getSupportedCipherSuiteList() { - return supportedCipherSuiteList; + List<CipherSuite> getSupportedCipherSuites() { + return supportedCipherSuites; } @Override - ProtocolList getServerDefaultProtocolList() { - return serverDefaultProtocolList; + List<ProtocolVersion> getServerDefaultProtocolVersions() { + return serverDefaultProtocols; } @Override - CipherSuiteList getServerDefaultCipherSuiteList() { - return serverDefaultCipherSuiteList; + List<CipherSuite> getServerDefaultCipherSuites() { + return serverDefaultCipherSuites; } @Override SSLEngine createSSLEngineImpl() { - return new SSLEngineImpl(this, false); + return new SSLEngineImpl(this); } @Override SSLEngine createSSLEngineImpl(String host, int port) { - return new SSLEngineImpl(this, host, port, false); + return new SSLEngineImpl(this, host, port); + } + + @Override + boolean isDTLS() { + return false; + } + + static ProtocolVersion[] getSupportedProtocols() { + if (SunJSSE.isFIPS()) { + return new ProtocolVersion[] { + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, + ProtocolVersion.TLS11, + ProtocolVersion.TLS10 + }; + } else { + return new ProtocolVersion[]{ + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, + ProtocolVersion.TLS11, + ProtocolVersion.TLS10, + ProtocolVersion.SSL30, + ProtocolVersion.SSL20Hello + }; + } } } @@ -630,35 +644,35 @@ * @see SSLContext */ public static final class TLS10Context extends AbstractTLSContext { - private static final ProtocolList clientDefaultProtocolList; - private static final CipherSuiteList clientDefaultCipherSuiteList; + private static final List<ProtocolVersion> clientDefaultProtocols; + private static final List<CipherSuite> clientDefaultCipherSuites; static { if (SunJSSE.isFIPS()) { - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { ProtocolVersion.TLS10 - })); + }); } else { - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { - ProtocolVersion.SSL30, - ProtocolVersion.TLS10 - })); + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.TLS10, + ProtocolVersion.SSL30 + }); } - clientDefaultCipherSuiteList = getApplicableEnabledCipherSuiteList( - clientDefaultProtocolList, true); + clientDefaultCipherSuites = getApplicableEnabledCipherSuites( + clientDefaultProtocols, true); } @Override - ProtocolList getClientDefaultProtocolList() { - return clientDefaultProtocolList; + List<ProtocolVersion> getClientDefaultProtocolVersions() { + return clientDefaultProtocols; } @Override - CipherSuiteList getClientDefaultCipherSuiteList() { - return clientDefaultCipherSuiteList; + List<CipherSuite> getClientDefaultCipherSuites() { + return clientDefaultCipherSuites; } } @@ -668,38 +682,38 @@ * @see SSLContext */ public static final class TLS11Context extends AbstractTLSContext { - private static final ProtocolList clientDefaultProtocolList; - private static final CipherSuiteList clientDefaultCipherSuiteList; + private static final List<ProtocolVersion> clientDefaultProtocols; + private static final List<CipherSuite> clientDefaultCipherSuites; static { if (SunJSSE.isFIPS()) { - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { - ProtocolVersion.TLS10, - ProtocolVersion.TLS11 - })); + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.TLS11, + ProtocolVersion.TLS10 + }); } else { - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { - ProtocolVersion.SSL30, + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.TLS11, ProtocolVersion.TLS10, - ProtocolVersion.TLS11 - })); + ProtocolVersion.SSL30 + }); } - clientDefaultCipherSuiteList = getApplicableEnabledCipherSuiteList( - clientDefaultProtocolList, true); + clientDefaultCipherSuites = getApplicableEnabledCipherSuites( + clientDefaultProtocols, true); } @Override - ProtocolList getClientDefaultProtocolList() { - return clientDefaultProtocolList; + List<ProtocolVersion> getClientDefaultProtocolVersions() { + return clientDefaultProtocols; } @Override - CipherSuiteList getClientDefaultCipherSuiteList() { - return clientDefaultCipherSuiteList; + List<CipherSuite> getClientDefaultCipherSuites() { + return clientDefaultCipherSuites; } } @@ -709,39 +723,83 @@ * @see SSLContext */ public static final class TLS12Context extends AbstractTLSContext { - private static final ProtocolList clientDefaultProtocolList; - private static final CipherSuiteList clientDefaultCipherSuiteList; + private static final List<ProtocolVersion> clientDefaultProtocols; + private static final List<CipherSuite> clientDefaultCipherSuites; static { if (SunJSSE.isFIPS()) { - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { - ProtocolVersion.TLS10, + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.TLS12, ProtocolVersion.TLS11, - ProtocolVersion.TLS12 - })); + ProtocolVersion.TLS10 + }); } else { - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { - ProtocolVersion.SSL30, + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.TLS12, + ProtocolVersion.TLS11, ProtocolVersion.TLS10, + ProtocolVersion.SSL30 + }); + } + + clientDefaultCipherSuites = getApplicableEnabledCipherSuites( + clientDefaultProtocols, true); + } + + @Override + List<ProtocolVersion> getClientDefaultProtocolVersions() { + return clientDefaultProtocols; + } + + @Override + List<CipherSuite> getClientDefaultCipherSuites() { + return clientDefaultCipherSuites; + } + } + + /* + * The SSLContext implementation for TLS1.3 algorithm + * + * @see SSLContext + */ + public static final class TLS13Context extends AbstractTLSContext { + private static final List<ProtocolVersion> clientDefaultProtocols; + private static final List<CipherSuite> clientDefaultCipherSuites; + + static { + if (SunJSSE.isFIPS()) { + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, + ProtocolVersion.TLS11, + ProtocolVersion.TLS10 + }); + } else { + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, ProtocolVersion.TLS11, - ProtocolVersion.TLS12 - })); + ProtocolVersion.TLS10, + ProtocolVersion.SSL30 + }); } - clientDefaultCipherSuiteList = getApplicableEnabledCipherSuiteList( - clientDefaultProtocolList, true); + clientDefaultCipherSuites = getApplicableEnabledCipherSuites( + clientDefaultProtocols, true); } @Override - ProtocolList getClientDefaultProtocolList() { - return clientDefaultProtocolList; + List<ProtocolVersion> getClientDefaultProtocolVersions() { + return clientDefaultProtocols; } @Override - CipherSuiteList getClientDefaultCipherSuiteList() { - return clientDefaultCipherSuiteList; + List<CipherSuite> getClientDefaultCipherSuites() { + return clientDefaultCipherSuites; } } @@ -751,10 +809,15 @@ * @see SSLContext */ private static class CustomizedSSLProtocols { - private static final String PROPERTY_NAME = "jdk.tls.client.protocols"; + private static final String JDK_TLS_CLIENT_PROTOCOLS = + "jdk.tls.client.protocols"; + private static final String JDK_TLS_SERVER_PROTOCOLS = + "jdk.tls.server.protocols"; static IllegalArgumentException reservedException = null; - static ArrayList<ProtocolVersion> - customizedProtocols = new ArrayList<>(); + static final ArrayList<ProtocolVersion> customizedClientProtocols = + new ArrayList<>(); + static final ArrayList<ProtocolVersion> customizedServerProtocols = + new ArrayList<>(); // Don't want a java.lang.LinkageError for illegal system property. // @@ -763,9 +826,18 @@ // the provider service. Instead, please handle the initialization // exception in the caller's constructor. static { - String property = GetPropertyAction - .privilegedGetProperty(PROPERTY_NAME); - if (property != null && property.length() != 0) { + populate(JDK_TLS_CLIENT_PROTOCOLS, customizedClientProtocols); + populate(JDK_TLS_SERVER_PROTOCOLS, customizedServerProtocols); + } + + private static void populate(String propname, + ArrayList<ProtocolVersion> arrayList) { + String property = GetPropertyAction.privilegedGetProperty(propname); + if (property == null) { + return; + } + + if (property.length() != 0) { // remove double quote marks from beginning/end of the property if (property.length() > 1 && property.charAt(0) == '"' && property.charAt(property.length() - 1) == '"') { @@ -773,33 +845,32 @@ } } - if (property != null && property.length() != 0) { + if (property.length() != 0) { String[] protocols = property.split(","); for (int i = 0; i < protocols.length; i++) { protocols[i] = protocols[i].trim(); // Is it a supported protocol name? - try { - ProtocolVersion pro = - ProtocolVersion.valueOf(protocols[i]); - - if (SunJSSE.isFIPS() && - ((pro.v == ProtocolVersion.SSL30.v) || - (pro.v == ProtocolVersion.SSL20Hello.v))) { - reservedException = new IllegalArgumentException( - PROPERTY_NAME + ": " + pro + - " is not FIPS compliant"); - - break; - } + ProtocolVersion pv = + ProtocolVersion.nameOf(protocols[i]); + if (pv == null) { + reservedException = new IllegalArgumentException( + propname + ": " + protocols[i] + + " is not a supported SSL protocol name"); + } - // ignore duplicated protocols - if (!customizedProtocols.contains(pro)) { - customizedProtocols.add(pro); - } - } catch (IllegalArgumentException iae) { + if (SunJSSE.isFIPS() && + ((pv == ProtocolVersion.SSL30) || + (pv == ProtocolVersion.SSL20Hello))) { reservedException = new IllegalArgumentException( - PROPERTY_NAME + ": " + protocols[i] + - " is not a standard SSL protocol name", iae); + propname + ": " + pv + + " is not FIPS compliant"); + + break; + } + + // ignore duplicated protocols + if (!arrayList.contains(pv)) { + arrayList.add(pv); } } } @@ -813,10 +884,11 @@ */ private static class CustomizedTLSContext extends AbstractTLSContext { - private static final ProtocolList clientDefaultProtocolList; - private static final CipherSuiteList clientDefaultCipherSuiteList; - - private static IllegalArgumentException reservedException = null; + private static final List<ProtocolVersion> clientDefaultProtocols; + private static final List<ProtocolVersion> serverDefaultProtocols; + private static final List<CipherSuite> clientDefaultCipherSuites; + private static final List<CipherSuite> serverDefaultCipherSuites; + private static final IllegalArgumentException reservedException; // Don't want a java.lang.LinkageError for illegal system property. // @@ -827,49 +899,69 @@ static { reservedException = CustomizedSSLProtocols.reservedException; if (reservedException == null) { - ArrayList<ProtocolVersion> - customizedTLSProtocols = new ArrayList<>(); - for (ProtocolVersion protocol : - CustomizedSSLProtocols.customizedProtocols) { - if (!protocol.isDTLSProtocol()) { - customizedTLSProtocols.add(protocol); - } + clientDefaultProtocols = customizedProtocols(true, + CustomizedSSLProtocols.customizedClientProtocols); + serverDefaultProtocols = customizedProtocols(false, + CustomizedSSLProtocols.customizedServerProtocols); + + clientDefaultCipherSuites = + getApplicableEnabledCipherSuites( + clientDefaultProtocols, true); + serverDefaultCipherSuites = + getApplicableEnabledCipherSuites( + serverDefaultProtocols, false); + + } else { + // unlikely to be used + clientDefaultProtocols = null; + serverDefaultProtocols = null; + clientDefaultCipherSuites = null; + serverDefaultCipherSuites = null; + } + } + + private static List<ProtocolVersion> customizedProtocols( + boolean client, List<ProtocolVersion> customized) { + List<ProtocolVersion> refactored = new ArrayList<>(); + for (ProtocolVersion pv : customized) { + if (!pv.isDTLS) { + refactored.add(pv); } + } - // candidates for available protocols - ProtocolVersion[] candidates; - if (customizedTLSProtocols.isEmpty()) { - // Use the default enabled client protocols if no - // customized TLS protocols. - if (SunJSSE.isFIPS()) { - candidates = new ProtocolVersion[] { - ProtocolVersion.TLS10, - ProtocolVersion.TLS11, - ProtocolVersion.TLS12 - }; - } else { - candidates = new ProtocolVersion[] { - ProtocolVersion.SSL30, - ProtocolVersion.TLS10, - ProtocolVersion.TLS11, - ProtocolVersion.TLS12 - }; - } + // Use the default enabled protocols if no customization + ProtocolVersion[] candidates; + if (refactored.isEmpty()) { + if (client) { + candidates = getProtocols(); } else { - // Use the customized TLS protocols. - candidates = - new ProtocolVersion[customizedTLSProtocols.size()]; - candidates = customizedTLSProtocols.toArray(candidates); + candidates = getSupportedProtocols(); } + } else { + // Use the customized TLS protocols. + candidates = + refactored.toArray(new ProtocolVersion[refactored.size()]); + } - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(candidates)); - clientDefaultCipherSuiteList = - getApplicableEnabledCipherSuiteList( - clientDefaultProtocolList, true); + return getAvailableProtocols(candidates); + } + + static ProtocolVersion[] getProtocols() { + if (SunJSSE.isFIPS()) { + return new ProtocolVersion[]{ + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, + ProtocolVersion.TLS11, + ProtocolVersion.TLS10 + }; } else { - clientDefaultProtocolList = null; // unlikely to be used - clientDefaultCipherSuiteList = null; // unlikely to be used + return new ProtocolVersion[]{ + ProtocolVersion.TLS13, + ProtocolVersion.TLS12, + ProtocolVersion.TLS11, + ProtocolVersion.TLS10, + ProtocolVersion.SSL30 + }; } } @@ -880,14 +972,26 @@ } @Override - ProtocolList getClientDefaultProtocolList() { - return clientDefaultProtocolList; + List<ProtocolVersion> getClientDefaultProtocolVersions() { + return clientDefaultProtocols; } @Override - CipherSuiteList getClientDefaultCipherSuiteList() { - return clientDefaultCipherSuiteList; + List<ProtocolVersion> getServerDefaultProtocolVersions() { + return serverDefaultProtocols; } + + @Override + List<CipherSuite> getClientDefaultCipherSuites() { + return clientDefaultCipherSuites; + } + + @Override + List<CipherSuite> getServerDefaultCipherSuites() { + return serverDefaultCipherSuites; + } + + } /* @@ -909,30 +1013,33 @@ private static final TrustManager[] trustManagers; private static final KeyManager[] keyManagers; - static Exception reservedException = null; + private static final Exception reservedException; static { + Exception reserved = null; TrustManager[] tmMediator; try { tmMediator = getTrustManagers(); } catch (Exception e) { - reservedException = e; + reserved = e; tmMediator = new TrustManager[0]; } trustManagers = tmMediator; - if (reservedException == null) { + if (reserved == null) { KeyManager[] kmMediator; try { kmMediator = getKeyManagers(); } catch (Exception e) { - reservedException = e; + reserved = e; kmMediator = new KeyManager[0]; } keyManagers = kmMediator; } else { keyManagers = new KeyManager[0]; } + + reservedException = reserved; } private static TrustManager[] getTrustManagers() throws Exception { @@ -976,11 +1083,11 @@ final String defaultKeyStore = props.get("keyStore"); String defaultKeyStoreType = props.get("keyStoreType"); String defaultKeyStoreProvider = props.get("keyStoreProvider"); - if (debug != null && Debug.isOn("defaultctx")) { - System.out.println("keyStore is : " + defaultKeyStore); - System.out.println("keyStore type is : " + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,defaultctx")) { + SSLLogger.fine("keyStore is : " + defaultKeyStore); + SSLLogger.fine("keyStore type is : " + defaultKeyStoreType); - System.out.println("keyStore provider is : " + + SSLLogger.fine("keyStore provider is : " + defaultKeyStoreProvider); } @@ -1014,8 +1121,8 @@ * Try to initialize key store. */ if ((defaultKeyStoreType.length()) != 0) { - if (debug != null && Debug.isOn("defaultctx")) { - System.out.println("init keystore"); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,defaultctx")) { + SSLLogger.finest("init keystore"); } if (defaultKeyStoreProvider.length() == 0) { ks = KeyStore.getInstance(defaultKeyStoreType); @@ -1037,8 +1144,8 @@ /* * Try to initialize key manager. */ - if (debug != null && Debug.isOn("defaultctx")) { - System.out.println("init keymanager of type " + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,defaultctx")) { + SSLLogger.fine("init keymanager of type " + KeyManagerFactory.getDefaultAlgorithm()); } KeyManagerFactory kmf = KeyManagerFactory.getInstance( @@ -1095,8 +1202,8 @@ super.engineInit(DefaultManagersHolder.keyManagers, DefaultManagersHolder.trustManagers, null); } catch (Exception e) { - if (debug != null && Debug.isOn("defaultctx")) { - System.out.println("default context init failed: " + e); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,defaultctx")) { + SSLLogger.fine("default context init failed: ", e); } throw e; } @@ -1128,65 +1235,65 @@ * @see SSLContext */ private abstract static class AbstractDTLSContext extends SSLContextImpl { - private static final ProtocolList supportedProtocolList; - private static final ProtocolList serverDefaultProtocolList; + private static final List<ProtocolVersion> supportedProtocols; + private static final List<ProtocolVersion> serverDefaultProtocols; - private static final CipherSuiteList supportedCipherSuiteList; - private static final CipherSuiteList serverDefaultCipherSuiteList; + private static final List<CipherSuite> supportedCipherSuites; + private static final List<CipherSuite> serverDefaultCipherSuites; static { // Both DTLSv1.0 and DTLSv1.2 can be used in FIPS mode. - supportedProtocolList = new ProtocolList(new String[] { - ProtocolVersion.DTLS10.name, - ProtocolVersion.DTLS12.name - }); + supportedProtocols = Arrays.asList( + ProtocolVersion.DTLS12, + ProtocolVersion.DTLS10 + ); // available protocols for server mode - serverDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { - ProtocolVersion.DTLS10, - ProtocolVersion.DTLS12 - })); + serverDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.DTLS12, + ProtocolVersion.DTLS10 + }); - supportedCipherSuiteList = getApplicableSupportedCipherSuiteList( - supportedProtocolList); - serverDefaultCipherSuiteList = getApplicableEnabledCipherSuiteList( - serverDefaultProtocolList, false); + supportedCipherSuites = getApplicableSupportedCipherSuites( + supportedProtocols); + serverDefaultCipherSuites = getApplicableEnabledCipherSuites( + serverDefaultProtocols, false); } @Override - ProtocolList getSuportedProtocolList() { - return supportedProtocolList; + List<ProtocolVersion> getSupportedProtocolVersions() { + return supportedProtocols; } @Override - CipherSuiteList getSupportedCipherSuiteList() { - return supportedCipherSuiteList; + List<CipherSuite> getSupportedCipherSuites() { + return supportedCipherSuites; } @Override - ProtocolList getServerDefaultProtocolList() { - return serverDefaultProtocolList; + List<ProtocolVersion> getServerDefaultProtocolVersions() { + return serverDefaultProtocols; } @Override - CipherSuiteList getServerDefaultCipherSuiteList() { - return serverDefaultCipherSuiteList; + List<CipherSuite> getServerDefaultCipherSuites() { + return serverDefaultCipherSuites; } @Override SSLEngine createSSLEngineImpl() { - return new SSLEngineImpl(this, true); + return new SSLEngineImpl(this); } @Override SSLEngine createSSLEngineImpl(String host, int port) { - return new SSLEngineImpl(this, host, port, true); + return new SSLEngineImpl(this, host, port); } @Override - HelloCookieManager getHelloCookieManager(SecureRandom secureRandom) { - return new HelloCookieManager(secureRandom); + boolean isDTLS() { + return true; } } @@ -1196,28 +1303,28 @@ * @see SSLContext */ public static final class DTLS10Context extends AbstractDTLSContext { - private static final ProtocolList clientDefaultProtocolList; - private static final CipherSuiteList clientDefaultCipherSuiteList; + private static final List<ProtocolVersion> clientDefaultProtocols; + private static final List<CipherSuite> clientDefaultCipherSuites; static { // available protocols for client mode - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { ProtocolVersion.DTLS10 - })); + }); - clientDefaultCipherSuiteList = getApplicableEnabledCipherSuiteList( - clientDefaultProtocolList, true); + clientDefaultCipherSuites = getApplicableEnabledCipherSuites( + clientDefaultProtocols, true); } @Override - ProtocolList getClientDefaultProtocolList() { - return clientDefaultProtocolList; + List<ProtocolVersion> getClientDefaultProtocolVersions() { + return clientDefaultProtocols; } @Override - CipherSuiteList getClientDefaultCipherSuiteList() { - return clientDefaultCipherSuiteList; + List<CipherSuite> getClientDefaultCipherSuites() { + return clientDefaultCipherSuites; } } @@ -1227,29 +1334,29 @@ * @see SSLContext */ public static final class DTLS12Context extends AbstractDTLSContext { - private static final ProtocolList clientDefaultProtocolList; - private static final CipherSuiteList clientDefaultCipherSuiteList; + private static final List<ProtocolVersion> clientDefaultProtocols; + private static final List<CipherSuite> clientDefaultCipherSuites; static { // available protocols for client mode - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(new ProtocolVersion[] { - ProtocolVersion.DTLS10, - ProtocolVersion.DTLS12 - })); + clientDefaultProtocols = getAvailableProtocols( + new ProtocolVersion[] { + ProtocolVersion.DTLS12, + ProtocolVersion.DTLS10 + }); - clientDefaultCipherSuiteList = getApplicableEnabledCipherSuiteList( - clientDefaultProtocolList, true); + clientDefaultCipherSuites = getApplicableEnabledCipherSuites( + clientDefaultProtocols, true); } @Override - ProtocolList getClientDefaultProtocolList() { - return clientDefaultProtocolList; + List<ProtocolVersion> getClientDefaultProtocolVersions() { + return clientDefaultProtocols; } @Override - CipherSuiteList getClientDefaultCipherSuiteList() { - return clientDefaultCipherSuiteList; + List<CipherSuite> getClientDefaultCipherSuites() { + return clientDefaultCipherSuites; } } @@ -1259,8 +1366,10 @@ * @see SSLContext */ private static class CustomizedDTLSContext extends AbstractDTLSContext { - private static final ProtocolList clientDefaultProtocolList; - private static final CipherSuiteList clientDefaultCipherSuiteList; + private static final List<ProtocolVersion> clientDefaultProtocols; + private static final List<ProtocolVersion> serverDefaultProtocols; + private static final List<CipherSuite> clientDefaultCipherSuites; + private static final List<CipherSuite> serverDefaultCipherSuites; private static IllegalArgumentException reservedException = null; @@ -1273,43 +1382,53 @@ static { reservedException = CustomizedSSLProtocols.reservedException; if (reservedException == null) { - ArrayList<ProtocolVersion> - customizedDTLSProtocols = new ArrayList<>(); - for (ProtocolVersion protocol : - CustomizedSSLProtocols.customizedProtocols) { - if (protocol.isDTLSProtocol()) { - customizedDTLSProtocols.add(protocol); - } - } + clientDefaultProtocols = customizedProtocols(true, + CustomizedSSLProtocols.customizedClientProtocols); + serverDefaultProtocols = customizedProtocols(false, + CustomizedSSLProtocols.customizedServerProtocols); + + clientDefaultCipherSuites = + getApplicableEnabledCipherSuites( + clientDefaultProtocols, true); + serverDefaultCipherSuites = + getApplicableEnabledCipherSuites( + serverDefaultProtocols, false); - // candidates for available protocols - ProtocolVersion[] candidates; - if (customizedDTLSProtocols.isEmpty()) { - // Use the default enabled client protocols if no - // customized TLS protocols. - // - // Both DTLSv1.0 and DTLSv1.2 can be used in FIPS mode. - candidates = new ProtocolVersion[] { - ProtocolVersion.DTLS10, - ProtocolVersion.DTLS12 - }; + } else { + // unlikely to be used + clientDefaultProtocols = null; + serverDefaultProtocols = null; + clientDefaultCipherSuites = null; + serverDefaultCipherSuites = null; + } + } - } else { - // Use the customized TLS protocols. - candidates = - new ProtocolVersion[customizedDTLSProtocols.size()]; - candidates = customizedDTLSProtocols.toArray(candidates); + private static List<ProtocolVersion> customizedProtocols(boolean client, + List<ProtocolVersion> customized) { + List<ProtocolVersion> refactored = new ArrayList<>(); + for (ProtocolVersion pv : customized) { + if (pv.isDTLS) { + refactored.add(pv); } + } - clientDefaultProtocolList = new ProtocolList( - getAvailableProtocols(candidates)); - clientDefaultCipherSuiteList = - getApplicableEnabledCipherSuiteList( - clientDefaultProtocolList, true); + ProtocolVersion[] candidates; + // Use the default enabled protocols if no customization + if (refactored.isEmpty()) { + candidates = new ProtocolVersion[]{ + ProtocolVersion.DTLS12, + ProtocolVersion.DTLS10 + }; + if (!client) + return Arrays.asList(candidates); } else { - clientDefaultProtocolList = null; // unlikely to be used - clientDefaultCipherSuiteList = null; // unlikely to be used + // Use the customized TLS protocols. + candidates = + new ProtocolVersion[customized.size()]; + candidates = customized.toArray(candidates); } + + return getAvailableProtocols(candidates); } protected CustomizedDTLSContext() { @@ -1319,13 +1438,23 @@ } @Override - ProtocolList getClientDefaultProtocolList() { - return clientDefaultProtocolList; + List<ProtocolVersion> getClientDefaultProtocolVersions() { + return clientDefaultProtocols; + } + + @Override + List<ProtocolVersion> getServerDefaultProtocolVersions() { + return serverDefaultProtocols; } @Override - CipherSuiteList getClientDefaultCipherSuiteList() { - return clientDefaultCipherSuiteList; + List<CipherSuite> getClientDefaultCipherSuites() { + return clientDefaultCipherSuites; + } + + @Override + List<CipherSuite> getServerDefaultCipherSuites() { + return serverDefaultCipherSuites; } } @@ -1340,7 +1469,6 @@ } - final class AbstractTrustManagerWrapper extends X509ExtendedTrustManager implements X509TrustManager { @@ -1417,10 +1545,8 @@ } // try the best to check the algorithm constraints - ProtocolVersion protocolVersion = - ProtocolVersion.valueOf(session.getProtocol()); - AlgorithmConstraints constraints = null; - if (protocolVersion.useTLS12PlusSpec()) { + AlgorithmConstraints constraints; + if (ProtocolVersion.useTLS12PlusSpec(session.getProtocol())) { if (session instanceof ExtendedSSLSession) { ExtendedSSLSession extSession = (ExtendedSSLSession)session; @@ -1459,10 +1585,8 @@ } // try the best to check the algorithm constraints - ProtocolVersion protocolVersion = - ProtocolVersion.valueOf(session.getProtocol()); - AlgorithmConstraints constraints = null; - if (protocolVersion.useTLS12PlusSpec()) { + AlgorithmConstraints constraints; + if (ProtocolVersion.useTLS12PlusSpec(session.getProtocol())) { if (session instanceof ExtendedSSLSession) { ExtendedSSLSession extSession = (ExtendedSSLSession)session; @@ -1484,8 +1608,8 @@ } private void checkAlgorithmConstraints(X509Certificate[] chain, - AlgorithmConstraints constraints, boolean isClient) throws CertificateException { - + AlgorithmConstraints constraints, + boolean isClient) throws CertificateException { try { // Does the certificate chain end with a trusted certificate? int checkedLength = chain.length - 1; @@ -1503,11 +1627,12 @@ // A forward checker, need to check from trust to target if (checkedLength >= 0) { AlgorithmChecker checker = - new AlgorithmChecker(constraints, null, - (isClient ? Validator.VAR_TLS_CLIENT : Validator.VAR_TLS_SERVER)); + new AlgorithmChecker(constraints, null, + (isClient ? Validator.VAR_TLS_CLIENT : + Validator.VAR_TLS_SERVER)); checker.init(false); for (int i = checkedLength; i >= 0; i--) { - Certificate cert = chain[i]; + X509Certificate cert = chain[i]; // We don't care about the unresolved critical extensions. checker.check(cert, Collections.<String>emptySet()); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLCredentials.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLCredentials.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLCredentials.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLCredentials.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +interface SSLCredentials { +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLEngineImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,761 +25,468 @@ package sun.security.ssl; -import java.io.*; -import java.nio.*; -import java.security.*; -import java.util.*; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.nio.ReadOnlyBufferException; +import java.security.AccessController; +import java.security.PrivilegedActionException; +import java.security.PrivilegedExceptionAction; +import java.util.List; +import java.util.Map; import java.util.function.BiFunction; - -import javax.crypto.BadPaddingException; - -import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLEngineResult; +import javax.net.ssl.SSLEngineResult.HandshakeStatus; +import javax.net.ssl.SSLEngineResult.Status; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLKeyException; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLPeerUnverifiedException; +import javax.net.ssl.SSLProtocolException; +import javax.net.ssl.SSLSession; /** * Implementation of an non-blocking SSLEngine. * - * *Currently*, the SSLEngine code exists in parallel with the current - * SSLSocket. As such, the current implementation is using legacy code - * with many of the same abstractions. However, it varies in many - * areas, most dramatically in the IO handling. - * - * There are three main I/O threads that can be existing in parallel: - * wrap(), unwrap(), and beginHandshake(). We are encouraging users to - * not call multiple instances of wrap or unwrap, because the data could - * appear to flow out of the SSLEngine in a non-sequential order. We - * take all steps we can to at least make sure the ordering remains - * consistent, but once the calls returns, anything can happen. For - * example, thread1 and thread2 both call wrap, thread1 gets the first - * packet, thread2 gets the second packet, but thread2 gets control back - * before thread1, and sends the data. The receiving side would see an - * out-of-order error. - * * @author Brad Wetmore */ -public final class SSLEngineImpl extends SSLEngine { +final class SSLEngineImpl extends SSLEngine implements SSLTransport { + private final SSLContextImpl sslContext; + final TransportContext conContext; - // - // Fields and global comments - // - - /* - * There's a state machine associated with each connection, which - * among other roles serves to negotiate session changes. - * - * - START with constructor, until the TCP connection's around. - * - HANDSHAKE picks session parameters before allowing traffic. - * There are many substates due to sequencing requirements - * for handshake messages. - * - DATA may be transmitted. - * - RENEGOTIATE state allows concurrent data and handshaking - * traffic ("same" substates as HANDSHAKE), and terminates - * in selection of new session (and connection) parameters - * - ERROR state immediately precedes abortive disconnect. - * - CLOSED when one side closes down, used to start the shutdown - * process. SSL connection objects are not reused. - * - * State affects what SSL record types may legally be sent: - * - * - Handshake ... only in HANDSHAKE and RENEGOTIATE states - * - App Data ... only in DATA and RENEGOTIATE states - * - Alert ... in HANDSHAKE, DATA, RENEGOTIATE - * - * Re what may be received: same as what may be sent, except that - * HandshakeRequest handshaking messages can come from servers even - * in the application data state, to request entry to RENEGOTIATE. - * - * The state machine within HANDSHAKE and RENEGOTIATE states controls - * the pending session, not the connection state, until the change - * cipher spec and "Finished" handshake messages are processed and - * make the "new" session become the current one. - * - * NOTE: details of the SMs always need to be nailed down better. - * The text above illustrates the core ideas. - * - * +---->-------+------>--------->-------+ - * | | | - * <-----< ^ ^ <-----< | - *START>----->HANDSHAKE>----->DATA>----->RENEGOTIATE | - * v v v | - * | | | | - * +------------+---------------+ | - * | | - * v | - * ERROR>------>----->CLOSED<--------<----+ + /** + * Constructor for an SSLEngine from SSLContext, without + * host/port hints. * - * ALSO, note that the purpose of handshaking (renegotiation is - * included) is to assign a different, and perhaps new, session to - * the connection. The SSLv3 spec is a bit confusing on that new - * protocol feature. - */ - private int connectionState; - - private static final int cs_START = 0; - private static final int cs_HANDSHAKE = 1; - private static final int cs_DATA = 2; - private static final int cs_RENEGOTIATE = 3; - private static final int cs_ERROR = 4; - private static final int cs_CLOSED = 6; - - /* - * Once we're in state cs_CLOSED, we can continue to - * wrap/unwrap until we finish sending/receiving the messages - * for close_notify. - */ - private boolean inboundDone = false; - private boolean outboundDone = false; - - /* - * The authentication context holds all information used to establish - * who this end of the connection is (certificate chains, private keys, - * etc) and who is trusted (e.g. as CAs or websites). - */ - private SSLContextImpl sslContext; - - /* - * This connection is one of (potentially) many associated with - * any given session. The output of the handshake protocol is a - * new session ... although all the protocol description talks - * about changing the cipher spec (and it does change), in fact - * that's incidental since it's done by changing everything that - * is associated with a session at the same time. (TLS/IETF may - * change that to add client authentication w/o new key exchg.) - */ - private Handshaker handshaker; - private SSLSessionImpl sess; - private volatile SSLSessionImpl handshakeSession; - - /* - * Flag indicating if the next record we receive MUST be a Finished - * message. Temporarily set during the handshake to ensure that - * a change cipher spec message is followed by a finished message. + * This Engine will not be able to cache sessions, but must renegotiate + * everything by hand. */ - private boolean expectingFinished; - - - /* - * If someone tries to closeInbound() (say at End-Of-Stream) - * our engine having received a close_notify, we need to - * notify the app that we may have a truncation attack underway. - */ - private boolean recvCN; + SSLEngineImpl(SSLContextImpl sslContext) { + this(sslContext, null, -1); + } - /* - * For improved diagnostics, we detail connection closure - * If the engine is closed (connectionState >= cs_ERROR), - * closeReason != null indicates if the engine was closed - * because of an error or because or normal shutdown. + /** + * Constructor for an SSLEngine from SSLContext. */ - private SSLException closeReason; + SSLEngineImpl(SSLContextImpl sslContext, + String host, int port) { + super(host, port); + this.sslContext = sslContext; + HandshakeHash handshakeHash = new HandshakeHash(); + if (sslContext.isDTLS()) { + this.conContext = new TransportContext(sslContext, this, + new DTLSInputRecord(handshakeHash), + new DTLSOutputRecord(handshakeHash)); + } else { + this.conContext = new TransportContext(sslContext, this, + new SSLEngineInputRecord(handshakeHash), + new SSLEngineOutputRecord(handshakeHash)); + } - /* - * Per-connection private state that doesn't change when the - * session is changed. - */ - private ClientAuthType doClientAuth = - ClientAuthType.CLIENT_AUTH_NONE; - private boolean enableSessionCreation = true; - InputRecord inputRecord; - OutputRecord outputRecord; - private AccessControlContext acc; - - // The cipher suites enabled for use on this connection. - private CipherSuiteList enabledCipherSuites; - - // the endpoint identification protocol - private String identificationProtocol = null; - - // The cryptographic algorithm constraints - private AlgorithmConstraints algorithmConstraints = null; - - // The server name indication and matchers - List<SNIServerName> serverNames = - Collections.<SNIServerName>emptyList(); - Collection<SNIMatcher> sniMatchers = - Collections.<SNIMatcher>emptyList(); - - // Configured application protocol values - String[] applicationProtocols = new String[0]; - - // Negotiated application protocol value. - // - // The value under negotiation will be obtained from handshaker. - String applicationProtocol = null; - - // Callback function that selects the application protocol value during - // the SSL/TLS handshake. - BiFunction<SSLEngine, List<String>, String> applicationProtocolSelector; - - // Have we been told whether we're client or server? - private boolean serverModeSet = false; - private boolean roleIsServer; + // Server name indication is a connection scope extension. + if (host != null) { + this.conContext.sslConfig.serverNames = + Utilities.addToSNIServerNameList( + conContext.sslConfig.serverNames, host); + } + } - /* - * The protocol versions enabled for use on this connection. - * - * Note: we support a pseudo protocol called SSLv2Hello which when - * set will result in an SSL v2 Hello being sent with SSL (version 3.0) - * or TLS (version 3.1, 3.2, etc.) version info. - */ - private ProtocolList enabledProtocols; + @Override + public synchronized void beginHandshake() throws SSLException { + if (conContext.isUnsureMode) { + throw new IllegalStateException( + "Client/Server mode has not yet been set."); + } - /* - * The SSL version associated with this connection. - */ - private ProtocolVersion protocolVersion; + try { + conContext.kickstart(); + } catch (IOException ioe) { + conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Couldn't kickstart handshaking", ioe); + } catch (Exception ex) { // including RuntimeException + conContext.fatal(Alert.INTERNAL_ERROR, + "Fail to begin handshake", ex); + } + } - /* - * security parameters for secure renegotiation. - */ - private boolean secureRenegotiation; - private byte[] clientVerifyData; - private byte[] serverVerifyData; - - /* - * READ ME * READ ME * READ ME * READ ME * READ ME * READ ME * - * IMPORTANT STUFF TO UNDERSTANDING THE SYNCHRONIZATION ISSUES. - * READ ME * READ ME * READ ME * READ ME * READ ME * READ ME * - * - * There are several locks here. - * - * The primary lock is the per-instance lock used by - * synchronized(this) and the synchronized methods. It controls all - * access to things such as the connection state and variables which - * affect handshaking. If we are inside a synchronized method, we - * can access the state directly, otherwise, we must use the - * synchronized equivalents. - * - * Note that we must never acquire the <code>this</code> lock after - * <code>writeLock</code> or run the risk of deadlock. - * - * Grab some coffee, and be careful with any code changes. - */ - private Object wrapLock; - private Object unwrapLock; - Object writeLock; - - /* - * Whether local cipher suites preference in server side should be - * honored during handshaking? - */ - private boolean preferLocalCipherSuites = false; + @Override + public synchronized SSLEngineResult wrap(ByteBuffer[] appData, + int offset, int length, ByteBuffer netData) throws SSLException { + return wrap(appData, offset, length, new ByteBuffer[]{ netData }, 0, 1); + } - /* - * whether DTLS handshake retransmissions should be enabled? - */ - private boolean enableRetransmissions = false; + // @Override + public synchronized SSLEngineResult wrap( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws SSLException { - /* - * The maximum expected network packet size for SSL/TLS/DTLS records. - */ - private int maximumPacketSize = 0; + if (conContext.isUnsureMode) { + throw new IllegalStateException( + "Client/Server mode has not yet been set."); + } - /* - * Is this an instance for Datagram Transport Layer Security (DTLS)? - */ - private final boolean isDTLS; + // See if the handshaker needs to report back some SSLException. + if (conContext.outputRecord.isEmpty()) { + checkTaskThrown(); + } // Otherwise, deliver cached records before throwing task exception. - /* - * Class and subclass dynamic debugging support - */ - private static final Debug debug = Debug.getInstance("ssl"); + // check parameters + checkParams(srcs, srcsOffset, srcsLength, dsts, dstsOffset, dstsLength); - // - // Initialization/Constructors - // + try { + return writeRecord( + srcs, srcsOffset, srcsLength, dsts, dstsOffset, dstsLength); + } catch (SSLProtocolException spe) { + // may be an unexpected handshake message + conContext.fatal(Alert.UNEXPECTED_MESSAGE, spe); + } catch (IOException ioe) { + conContext.fatal(Alert.INTERNAL_ERROR, + "problem wrapping app data", ioe); + } catch (Exception ex) { // including RuntimeException + conContext.fatal(Alert.INTERNAL_ERROR, + "Fail to wrap application data", ex); + } - /** - * Constructor for an SSLEngine from SSLContext, without - * host/port hints. This Engine will not be able to cache - * sessions, but must renegotiate everything by hand. - */ - SSLEngineImpl(SSLContextImpl ctx, boolean isDTLS) { - super(); - this.isDTLS = isDTLS; - init(ctx, isDTLS); + return null; // make compiler happy } - /** - * Constructor for an SSLEngine from SSLContext. - */ - SSLEngineImpl(SSLContextImpl ctx, String host, int port, boolean isDTLS) { - super(host, port); - this.isDTLS = isDTLS; - init(ctx, isDTLS); - } + private SSLEngineResult writeRecord( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { - /** - * Initializes the Engine - */ - private void init(SSLContextImpl ctx, boolean isDTLS) { - if (debug != null && Debug.isOn("ssl")) { - System.out.println("Using SSLEngineImpl."); + if (isOutboundDone()) { + return new SSLEngineResult( + Status.CLOSED, getHandshakeStatus(), 0, 0); } - sslContext = ctx; - sess = SSLSessionImpl.nullSession; - handshakeSession = null; - protocolVersion = isDTLS ? - ProtocolVersion.DEFAULT_DTLS : ProtocolVersion.DEFAULT_TLS; + HandshakeContext hc = conContext.handshakeContext; + HandshakeStatus hsStatus = null; + if (!conContext.isNegotiated && + !conContext.isClosed() && !conContext.isBroken) { + conContext.kickstart(); - /* - * State is cs_START until we initialize the handshaker. - * - * Apps using SSLEngine are probably going to be server. - * Somewhat arbitrary choice. - */ - roleIsServer = true; - connectionState = cs_START; + hsStatus = getHandshakeStatus(); + if (hsStatus == HandshakeStatus.NEED_UNWRAP) { + /* + * For DTLS, if the handshake state is + * HandshakeStatus.NEED_UNWRAP, a call to SSLEngine.wrap() + * means that the previous handshake packets (if delivered) + * get lost, and need retransmit the handshake messages. + */ + if (!sslContext.isDTLS() || hc == null || + !hc.sslConfig.enableRetransmissions || + conContext.outputRecord.firstMessage) { - // default server name indication - serverNames = - Utilities.addToSNIServerNameList(serverNames, getPeerHost()); - - // default security parameters for secure renegotiation - secureRenegotiation = false; - clientVerifyData = new byte[0]; - serverVerifyData = new byte[0]; - - enabledCipherSuites = - sslContext.getDefaultCipherSuiteList(roleIsServer); - enabledProtocols = - sslContext.getDefaultProtocolList(roleIsServer); - - wrapLock = new Object(); - unwrapLock = new Object(); - writeLock = new Object(); + return new SSLEngineResult(Status.OK, hsStatus, 0, 0); + } // otherwise, need retransmission + } + } - /* - * Save the Access Control Context. This will be used later - * for a couple of things, including providing a context to - * run tasks in, and for determining which credentials - * to use for Subject based (JAAS) decisions - */ - acc = AccessController.getContext(); + if (hsStatus == null) { + hsStatus = getHandshakeStatus(); + } /* - * All outbound application data goes through this OutputRecord, - * other data goes through their respective records created - * elsewhere. All inbound data goes through this one - * input record. + * If we have a task outstanding, this *MUST* be done before + * doing any more wrapping, because we could be in the middle + * of receiving a handshake message, for example, a finished + * message which would change the ciphers. */ - if (isDTLS) { - enableRetransmissions = true; + if (hsStatus == HandshakeStatus.NEED_TASK) { + return new SSLEngineResult(Status.OK, hsStatus, 0, 0); + } - // SSLEngine needs no record local buffer - outputRecord = new DTLSOutputRecord(); - inputRecord = new DTLSInputRecord(); + int dstsRemains = 0; + for (int i = dstsOffset; i < dstsOffset + dstsLength; i++) { + dstsRemains += dsts[i].remaining(); + } - } else { - outputRecord = new SSLEngineOutputRecord(); - inputRecord = new SSLEngineInputRecord(); + // Check destination buffer size. + // + // We can be smarter about using smaller buffer sizes later. For + // now, force it to be large enough to handle any valid record. + if (dstsRemains < conContext.conSession.getPacketBufferSize()) { + return new SSLEngineResult( + Status.BUFFER_OVERFLOW, getHandshakeStatus(), 0, 0); } - maximumPacketSize = outputRecord.getMaxPacketSize(); - } + int srcsRemains = 0; + for (int i = srcsOffset; i < srcsOffset + srcsLength; i++) { + srcsRemains += srcs[i].remaining(); + } - /** - * Initialize the handshaker object. This means: - * - * . if a handshake is already in progress (state is cs_HANDSHAKE - * or cs_RENEGOTIATE), do nothing and return - * - * . if the engine is already closed, throw an Exception (internal error) - * - * . otherwise (cs_START or cs_DATA), create the appropriate handshaker - * object and advance the connection state (to cs_HANDSHAKE or - * cs_RENEGOTIATE, respectively). - * - * This method is called right after a new engine is created, when - * starting renegotiation, or when changing client/server mode of the - * engine. - */ - private void initHandshaker() { - switch (connectionState) { + Ciphertext ciphertext = null; + try { + // Acquire the buffered to-be-delivered records or retransmissions. + // + // May have buffered records, or need retransmission if handshaking. + if (!conContext.outputRecord.isEmpty() || (hc != null && + hc.sslConfig.enableRetransmissions && + hc.sslContext.isDTLS() && + hsStatus == HandshakeStatus.NEED_UNWRAP)) { + ciphertext = encode(null, 0, 0, + dsts, dstsOffset, dstsLength); + } - // - // Starting a new handshake. - // - case cs_START: - case cs_DATA: - break; + if (ciphertext == null && srcsRemains != 0) { + ciphertext = encode(srcs, srcsOffset, srcsLength, + dsts, dstsOffset, dstsLength); + } + } catch (IOException ioe) { + if (ioe instanceof SSLException) { + throw ioe; + } else { + throw new SSLException("Write problems", ioe); + } + } - // - // We're already in the middle of a handshake. - // - case cs_HANDSHAKE: - case cs_RENEGOTIATE: - return; + /* + * Check for status. + */ + Status status = (isOutboundDone() ? Status.CLOSED : Status.OK); + if (ciphertext != null && ciphertext.handshakeStatus != null) { + hsStatus = ciphertext.handshakeStatus; + } else { + hsStatus = getHandshakeStatus(); + } - // - // Anyone allowed to call this routine is required to - // do so ONLY if the connection state is reasonable... - // - default: - throw new IllegalStateException("Internal error"); + int deltaSrcs = srcsRemains; + for (int i = srcsOffset; i < srcsOffset + srcsLength; i++) { + deltaSrcs -= srcs[i].remaining(); } - // state is either cs_START or cs_DATA - if (connectionState == cs_START) { - connectionState = cs_HANDSHAKE; - } else { // cs_DATA - connectionState = cs_RENEGOTIATE; - } - - if (roleIsServer) { - handshaker = new ServerHandshaker(this, sslContext, - enabledProtocols, doClientAuth, - protocolVersion, connectionState == cs_HANDSHAKE, - secureRenegotiation, clientVerifyData, serverVerifyData, - isDTLS); - handshaker.setSNIMatchers(sniMatchers); - handshaker.setUseCipherSuitesOrder(preferLocalCipherSuites); - } else { - handshaker = new ClientHandshaker(this, sslContext, - enabledProtocols, - protocolVersion, connectionState == cs_HANDSHAKE, - secureRenegotiation, clientVerifyData, serverVerifyData, - isDTLS); - handshaker.setSNIServerNames(serverNames); - } - handshaker.setMaximumPacketSize(maximumPacketSize); - handshaker.setEnabledCipherSuites(enabledCipherSuites); - handshaker.setEnableSessionCreation(enableSessionCreation); - handshaker.setApplicationProtocols(applicationProtocols); - handshaker.setApplicationProtocolSelectorSSLEngine( - applicationProtocolSelector); + int deltaDsts = dstsRemains; + for (int i = dstsOffset; i < dstsOffset + dstsLength; i++) { + deltaDsts -= dsts[i].remaining(); + } - outputRecord.initHandshaker(); + return new SSLEngineResult(status, hsStatus, deltaSrcs, deltaDsts, + ciphertext != null ? ciphertext.recordSN : -1L); } - /* - * Report the current status of the Handshaker - */ - private HandshakeStatus getHSStatus(HandshakeStatus hss) { + private Ciphertext encode( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { - if (hss != null) { - return hss; + Ciphertext ciphertext = null; + try { + ciphertext = conContext.outputRecord.encode( + srcs, srcsOffset, srcsLength, dsts, dstsOffset, dstsLength); + } catch (SSLHandshakeException she) { + // may be record sequence number overflow + conContext.fatal(Alert.HANDSHAKE_FAILURE, she); + } catch (IOException e) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, e); } - synchronized (this) { - if (!outputRecord.isEmpty()) { - // If no handshaking, special case to wrap alters. - return HandshakeStatus.NEED_WRAP; - } else if (handshaker != null) { - if (handshaker.taskOutstanding()) { - return HandshakeStatus.NEED_TASK; - } else if (isDTLS && !inputRecord.isEmpty()) { - return HandshakeStatus.NEED_UNWRAP_AGAIN; - } else { - return HandshakeStatus.NEED_UNWRAP; - } - } else if (connectionState == cs_CLOSED) { - /* - * Special case where we're closing, but - * still need the close_notify before we - * can officially be closed. - * - * Note isOutboundDone is taken care of by - * hasOutboundData() above. - */ - if (!isInboundDone()) { - return HandshakeStatus.NEED_UNWRAP; - } // else not handshaking + if (ciphertext == null) { + return Ciphertext.CIPHERTEXT_NULL; + } + + // Is the handshake completed? + boolean needRetransmission = + conContext.sslContext.isDTLS() && + conContext.handshakeContext != null && + conContext.handshakeContext.sslConfig.enableRetransmissions; + HandshakeStatus hsStatus = + tryToFinishHandshake(ciphertext.contentType); + if (needRetransmission && + hsStatus == HandshakeStatus.FINISHED && + conContext.sslContext.isDTLS() && + ciphertext.handshakeType == SSLHandshake.FINISHED.id) { + // Retransmit the last flight for DTLS. + // + // The application data transactions may begin immediately + // after the last flight. If the last flight get lost, the + // application data may be discarded accordingly. As could + // be an issue for some applications. This impact can be + // mitigated by sending the last fligth twice. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,verbose")) { + SSLLogger.finest("retransmit the last flight messages"); } - return HandshakeStatus.NOT_HANDSHAKING; + conContext.outputRecord.launchRetransmission(); + hsStatus = HandshakeStatus.NEED_WRAP; } - } - private synchronized void checkTaskThrown() throws SSLException { - if (handshaker != null) { - handshaker.checkThrown(); + if (hsStatus == null) { + hsStatus = conContext.getHandshakeStatus(); } - } - // - // Handshaking and connection state code - // + // Is the sequence number is nearly overflow? + if (conContext.outputRecord.seqNumIsHuge()) { + hsStatus = tryKeyUpdate(hsStatus); + } - /* - * Provides "this" synchronization for connection state. - * Otherwise, you can access it directly. - */ - private synchronized int getConnectionState() { - return connectionState; - } + // update context status + ciphertext.handshakeStatus = hsStatus; - private synchronized void setConnectionState(int state) { - connectionState = state; + return ciphertext; } - /* - * Get the Access Control Context. - * - * Used for a known context to - * run tasks in, and for determining which credentials - * to use for Subject-based (JAAS) decisions. - */ - AccessControlContext getAcc() { - return acc; - } + private HandshakeStatus tryToFinishHandshake(byte contentType) { + HandshakeStatus hsStatus = null; + if ((contentType == ContentType.HANDSHAKE.id) && + conContext.outputRecord.isEmpty()) { + if (conContext.handshakeContext == null) { + hsStatus = HandshakeStatus.FINISHED; + } else if (conContext.isPostHandshakeContext()) { + // unlikely, but just in case. + hsStatus = conContext.finishPostHandshake(); + } else if (conContext.handshakeContext.handshakeFinished) { + hsStatus = conContext.finishHandshake(); + } + } // Otherwise, the followed call to getHSStatus() will help. - /* - * Is a handshake currently underway? - */ - @Override - public SSLEngineResult.HandshakeStatus getHandshakeStatus() { - return getHSStatus(null); + return hsStatus; } - /* - * used by Handshaker to change the active write cipher, follows - * the output of the CCS message. + /** + * Try renegotiation or key update for sequence number wrap. * - * Also synchronized on "this" from readRecord/delegatedTask. + * Note that in order to maintain the handshake status properly, we check + * the sequence number after the last record reading/writing process. As + * we request renegotiation or close the connection for wrapped sequence + * number when there is enough sequence number space left to handle a few + * more records, so the sequence number of the last record cannot be + * wrapped. */ - void changeWriteCiphers() throws IOException { - - Authenticator writeAuthenticator; - CipherBox writeCipher; - try { - writeCipher = handshaker.newWriteCipher(); - writeAuthenticator = handshaker.newWriteAuthenticator(); - } catch (GeneralSecurityException e) { - // "can't happen" - throw new SSLException("Algorithm missing: ", e); + private HandshakeStatus tryKeyUpdate( + HandshakeStatus currentHandshakeStatus) throws IOException { + // Don't bother to kickstart the renegotiation or key update when the + // local is asking for it. + if ((conContext.handshakeContext == null) && + !conContext.isClosed() && !conContext.isBroken) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest("key update to wrap sequence number"); + } + conContext.keyUpdate(); + return conContext.getHandshakeStatus(); } - outputRecord.changeWriteCiphers(writeAuthenticator, writeCipher); - } - - /* - * Updates the SSL version associated with this connection. - * Called from Handshaker once it has determined the negotiated version. - */ - synchronized void setVersion(ProtocolVersion protocolVersion) { - this.protocolVersion = protocolVersion; - outputRecord.setVersion(protocolVersion); + return currentHandshakeStatus; } + private static void checkParams( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) { - /** - * Kickstart the handshake if it is not already in progress. - * This means: - * - * . if handshaking is already underway, do nothing and return - * - * . if the engine is not connected or already closed, throw an - * Exception. - * - * . otherwise, call initHandshake() to initialize the handshaker - * object and progress the state. Then, send the initial - * handshaking message if appropriate (always on clients and - * on servers when renegotiating). - */ - private synchronized void kickstartHandshake() throws IOException { - switch (connectionState) { + if ((srcs == null) || (dsts == null)) { + throw new IllegalArgumentException( + "source or destination buffer is null"); + } - case cs_START: - if (!serverModeSet) { - throw new IllegalStateException( - "Client/Server mode not yet set."); - } - initHandshaker(); - break; - - case cs_HANDSHAKE: - // handshaker already setup, proceed - break; - - case cs_DATA: - if (!secureRenegotiation && !Handshaker.allowUnsafeRenegotiation) { - throw new SSLHandshakeException( - "Insecure renegotiation is not allowed"); - } - - if (!secureRenegotiation) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println( - "Warning: Using insecure renegotiation"); - } - } + if ((dstsOffset < 0) || (dstsLength < 0) || + (dstsOffset > dsts.length - dstsLength)) { + throw new IndexOutOfBoundsException( + "index out of bound of the destination buffers"); + } - // initialize the handshaker, move to cs_RENEGOTIATE - initHandshaker(); - break; - - case cs_RENEGOTIATE: - // handshaking already in progress, return - return; - - default: - // cs_ERROR/cs_CLOSED - throw new SSLException("SSLEngine is closing/closed"); + if ((srcsOffset < 0) || (srcsLength < 0) || + (srcsOffset > srcs.length - srcsLength)) { + throw new IndexOutOfBoundsException( + "index out of bound of the source buffers"); } - // - // Kickstart handshake state machine if we need to ... - // - if (!handshaker.activated()) { - // prior to handshaking, activate the handshake - if (connectionState == cs_RENEGOTIATE) { - // don't use SSLv2Hello when renegotiating - handshaker.activate(protocolVersion); - } else { - handshaker.activate(null); + for (int i = dstsOffset; i < dstsOffset + dstsLength; i++) { + if (dsts[i] == null) { + throw new IllegalArgumentException( + "destination buffer[" + i + "] == null"); } - if (handshaker instanceof ClientHandshaker) { - // send client hello - handshaker.kickstart(); - } else { // instanceof ServerHandshaker - if (connectionState == cs_HANDSHAKE) { - // initial handshake, no kickstart message to send - } else { - // we want to renegotiate, send hello request - handshaker.kickstart(); - } + /* + * Make sure the destination bufffers are writable. + */ + if (dsts[i].isReadOnly()) { + throw new ReadOnlyBufferException(); } } - } - /* - * Start a SSLEngine handshake - */ - @Override - public void beginHandshake() throws SSLException { - try { - kickstartHandshake(); - } catch (Exception e) { - fatal(Alerts.alert_handshake_failure, - "Couldn't kickstart handshaking", e); + for (int i = srcsOffset; i < srcsOffset + srcsLength; i++) { + if (srcs[i] == null) { + throw new IllegalArgumentException( + "source buffer[" + i + "] == null"); + } } } + @Override + public synchronized SSLEngineResult unwrap(ByteBuffer src, + ByteBuffer[] dsts, int offset, int length) throws SSLException { + return unwrap( + new ByteBuffer[]{src}, 0, 1, dsts, offset, length); + } - // - // Read/unwrap side - // + // @Override + public synchronized SSLEngineResult unwrap( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws SSLException { + if (conContext.isUnsureMode) { + throw new IllegalStateException( + "Client/Server mode has not yet been set."); + } - /** - * Unwraps a buffer. Does a variety of checks before grabbing - * the unwrapLock, which blocks multiple unwraps from occurring. - */ - @Override - public SSLEngineResult unwrap(ByteBuffer netData, ByteBuffer[] appData, - int offset, int length) throws SSLException { + // See if the handshaker needs to report back some SSLException. + checkTaskThrown(); - // check engine parameters - checkEngineParas(netData, appData, offset, length, false); + // check parameters + checkParams(srcs, srcsOffset, srcsLength, dsts, dstsOffset, dstsLength); try { - synchronized (unwrapLock) { - return readNetRecord(netData, appData, offset, length); - } + return readRecord( + srcs, srcsOffset, srcsLength, dsts, dstsOffset, dstsLength); } catch (SSLProtocolException spe) { // may be an unexpected handshake message - fatal(Alerts.alert_unexpected_message, spe.getMessage(), spe); - return null; // make compiler happy - } catch (Exception e) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, + spe.getMessage(), spe); + } catch (IOException ioe) { /* * Don't reset position so it looks like we didn't * consume anything. We did consume something, and it * got us into this situation, so report that much back. * Our days of consuming are now over anyway. */ - fatal(Alerts.alert_internal_error, - "problem unwrapping net record", e); - return null; // make compiler happy - } - } - - private static void checkEngineParas(ByteBuffer netData, - ByteBuffer[] appData, int offset, int len, boolean isForWrap) { - - if ((netData == null) || (appData == null)) { - throw new IllegalArgumentException("src/dst is null"); - } - - if ((offset < 0) || (len < 0) || (offset > appData.length - len)) { - throw new IndexOutOfBoundsException(); - } - - /* - * If wrapping, make sure the destination bufffer is writable. - */ - if (isForWrap && netData.isReadOnly()) { - throw new ReadOnlyBufferException(); + conContext.fatal(Alert.INTERNAL_ERROR, + "problem unwrapping net record", ioe); + } catch (Exception ex) { // including RuntimeException + conContext.fatal(Alert.INTERNAL_ERROR, + "Fail to unwrap network record", ex); } - for (int i = offset; i < offset + len; i++) { - if (appData[i] == null) { - throw new IllegalArgumentException( - "appData[" + i + "] == null"); - } - - /* - * If unwrapping, make sure the destination bufffers are writable. - */ - if (!isForWrap && appData[i].isReadOnly()) { - throw new ReadOnlyBufferException(); - } - } + return null; // make compiler happy } - /* - * Makes additional checks for unwrap, but this time more - * specific to this packet and the current state of the machine. - */ - private SSLEngineResult readNetRecord(ByteBuffer netData, - ByteBuffer[] appData, int offset, int length) throws IOException { - - Status status = null; - HandshakeStatus hsStatus = null; - - /* - * See if the handshaker needs to report back some SSLException. - */ - checkTaskThrown(); + private SSLEngineResult readRecord( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { /* * Check if we are closing/closed. */ if (isInboundDone()) { - return new SSLEngineResult(Status.CLOSED, getHSStatus(null), 0, 0); + return new SSLEngineResult( + Status.CLOSED, getHandshakeStatus(), 0, 0); } - /* - * If we're still in cs_HANDSHAKE, make sure it's been - * started. - */ - synchronized (this) { - if ((connectionState == cs_HANDSHAKE) || - (connectionState == cs_START)) { - kickstartHandshake(); - - /* - * If there's still outbound data to flush, we - * can return without trying to unwrap anything. - */ - hsStatus = getHSStatus(null); + HandshakeStatus hsStatus = null; + if (!conContext.isNegotiated && + !conContext.isClosed() && !conContext.isBroken) { + conContext.kickstart(); - if (hsStatus == HandshakeStatus.NEED_WRAP) { - return new SSLEngineResult(Status.OK, hsStatus, 0, 0); - } + /* + * If there's still outbound data to flush, we + * can return without trying to unwrap anything. + */ + hsStatus = getHandshakeStatus(); + if (hsStatus == HandshakeStatus.NEED_WRAP) { + return new SSLEngineResult(Status.OK, hsStatus, 0, 0); } } - /* - * Grab a copy of this if it doesn't already exist, - * and we can use it several places before anything major - * happens on this side. Races aren't critical - * here. - */ if (hsStatus == null) { - hsStatus = getHSStatus(null); + hsStatus = getHandshakeStatus(); } /* @@ -795,42 +502,61 @@ if (hsStatus == SSLEngineResult.HandshakeStatus.NEED_UNWRAP_AGAIN) { Plaintext plainText = null; try { - plainText = readRecord(null, null, 0, 0); - } catch (SSLException e) { - throw e; - } catch (IOException e) { - throw new SSLException("readRecord", e); + plainText = decode(null, 0, 0, + dsts, dstsOffset, dstsLength); + } catch (IOException ioe) { + if (ioe instanceof SSLException) { + throw ioe; + } else { + throw new SSLException("readRecord", ioe); + } } - status = (isInboundDone() ? Status.CLOSED : Status.OK); - hsStatus = getHSStatus(plainText.handshakeStatus); + Status status = (isInboundDone() ? Status.CLOSED : Status.OK); + if (plainText.handshakeStatus != null) { + hsStatus = plainText.handshakeStatus; + } else { + hsStatus = getHandshakeStatus(); + } return new SSLEngineResult( status, hsStatus, 0, 0, plainText.recordSN); } + int srcsRemains = 0; + for (int i = srcsOffset; i < srcsOffset + srcsLength; i++) { + srcsRemains += srcs[i].remaining(); + } + + if (srcsRemains == 0) { + return new SSLEngineResult( + Status.BUFFER_UNDERFLOW, hsStatus, 0, 0); + } + /* * Check the packet to make sure enough is here. * This will also indirectly check for 0 len packets. */ int packetLen = 0; try { - packetLen = inputRecord.bytesInCompletePacket(netData); + packetLen = conContext.inputRecord.bytesInCompletePacket( + srcs, srcsOffset, srcsLength); } catch (SSLException ssle) { // Need to discard invalid records for DTLS protocols. - if (isDTLS) { - if (debug != null && Debug.isOn("ssl")) { - System.out.println( - Thread.currentThread().getName() + - " discard invalid record: " + ssle); + if (sslContext.isDTLS()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,verbose")) { + SSLLogger.finest("Discard invalid DTLS records", ssle); } // invalid, discard the entire data [section 4.1.2.7, RFC 6347] - int deltaNet = netData.remaining(); - netData.position(netData.limit()); - - status = (isInboundDone() ? Status.CLOSED : Status.OK); - hsStatus = getHSStatus(hsStatus); + int deltaNet = 0; + // int deltaNet = netData.remaining(); + // netData.position(netData.limit()); + + Status status = (isInboundDone() ? Status.CLOSED : Status.OK); + if (hsStatus == null) { + hsStatus = getHandshakeStatus(); + } return new SSLEngineResult(status, hsStatus, deltaNet, 0, -1L); } else { @@ -839,10 +565,10 @@ } // Is this packet bigger than SSL/TLS normally allows? - if (packetLen > sess.getPacketBufferSize()) { - int largestRecordSize = isDTLS ? + if (packetLen > conContext.conSession.getPacketBufferSize()) { + int largestRecordSize = sslContext.isDTLS() ? DTLSRecord.maxRecordSize : SSLRecord.maxLargeRecordSize; - if ((packetLen <= largestRecordSize) && !isDTLS) { + if ((packetLen <= largestRecordSize) && !sslContext.isDTLS()) { // Expand the expected maximum packet/application buffer // sizes. // @@ -850,11 +576,11 @@ // Old behavior: shall we honor the System Property // "jsse.SSLEngine.acceptLargeFragments" if it is "false"? - sess.expandBufferSizes(); + conContext.conSession.expandBufferSizes(); } // check the packet again - largestRecordSize = sess.getPacketBufferSize(); + largestRecordSize = conContext.conSession.getPacketBufferSize(); if (packetLen > largestRecordSize) { throw new SSLProtocolException( "Input record too big: max = " + @@ -862,1449 +588,398 @@ } } - int netPos = netData.position(); - int appRemains = 0; - for (int i = offset; i < offset + length; i++) { - if (appData[i] == null) { - throw new IllegalArgumentException( - "appData[" + i + "] == null"); - } - appRemains += appData[i].remaining(); - } - - /* - * Check for OVERFLOW. - * - * Delay enforcing the application buffer free space requirement - * until after the initial handshaking. - */ - // synchronize connectionState? - if ((connectionState == cs_DATA) || - (connectionState == cs_RENEGOTIATE)) { - - int FragLen = inputRecord.estimateFragmentSize(packetLen); - if (FragLen > appRemains) { - return new SSLEngineResult( - Status.BUFFER_OVERFLOW, hsStatus, 0, 0); - } - } - - // check for UNDERFLOW. - if ((packetLen == -1) || (netData.remaining() < packetLen)) { - return new SSLEngineResult(Status.BUFFER_UNDERFLOW, hsStatus, 0, 0); - } - - /* - * We're now ready to actually do the read. - */ - Plaintext plainText = null; - try { - plainText = readRecord(netData, appData, offset, length); - } catch (SSLException e) { - throw e; - } catch (IOException e) { - throw new SSLException("readRecord", e); - } - - /* - * Check the various condition that we could be reporting. - * - * It's *possible* something might have happened between the - * above and now, but it was better to minimally lock "this" - * during the read process. We'll return the current - * status, which is more representative of the current state. - * - * status above should cover: FINISHED, NEED_TASK - */ - status = (isInboundDone() ? Status.CLOSED : Status.OK); - hsStatus = getHSStatus(plainText.handshakeStatus); - - int deltaNet = netData.position() - netPos; - int deltaApp = appRemains; - for (int i = offset; i < offset + length; i++) { - deltaApp -= appData[i].remaining(); - } - - return new SSLEngineResult( - status, hsStatus, deltaNet, deltaApp, plainText.recordSN); - } - - // the caller have synchronized readLock - void expectingFinishFlight() { - inputRecord.expectingFinishFlight(); - } - - /* - * Actually do the read record processing. - * - * Returns a Status if it can make specific determinations - * of the engine state. In particular, we need to signal - * that a handshake just completed. - * - * It would be nice to be symmetrical with the write side and move - * the majority of this to SSLInputRecord, but there's too much - * SSLEngine state to do that cleanly. It must still live here. - */ - private Plaintext readRecord(ByteBuffer netData, - ByteBuffer[] appData, int offset, int length) throws IOException { - - /* - * The various operations will return new sliced BB's, - * this will avoid having to worry about positions and - * limits in the netBB. - */ - Plaintext plainText = null; - - if (getConnectionState() == cs_ERROR) { - return Plaintext.PLAINTEXT_NULL; - } - - /* - * Read a record ... maybe emitting an alert if we get a - * comprehensible but unsupported "hello" message during - * format checking (e.g. V2). - */ - try { - if (isDTLS) { - // Don't process the incoming record until all of the - // buffered records get handled. - plainText = inputRecord.acquirePlaintext(); - } - - if ((!isDTLS || plainText == null) && netData != null) { - plainText = inputRecord.decode(netData); - } - } catch (UnsupportedOperationException unsoe) { // SSLv2Hello - // Hack code to deliver SSLv2 error message for SSL/TLS connections. - if (!isDTLS) { - outputRecord.encodeV2NoCipher(); - } - - fatal(Alerts.alert_unexpected_message, unsoe); - } catch (BadPaddingException e) { - /* - * The basic SSLv3 record protection involves (optional) - * encryption for privacy, and an integrity check ensuring - * data origin authentication. We do them both here, and - * throw a fatal alert if the integrity check fails. - */ - byte alertType = (connectionState != cs_DATA) ? - Alerts.alert_handshake_failure : - Alerts.alert_bad_record_mac; - fatal(alertType, e.getMessage(), e); - } catch (SSLHandshakeException she) { - // may be record sequence number overflow - fatal(Alerts.alert_handshake_failure, she); - } catch (IOException ioe) { - fatal(Alerts.alert_unexpected_message, ioe); - } - - // plainText should never be null for TLS protocols - HandshakeStatus hsStatus = null; - if (plainText == Plaintext.PLAINTEXT_NULL) { - // Only happens for DTLS protocols. - // - // Received a retransmitted flight, and need to retransmit the - // previous delivered handshake flight messages. - if (enableRetransmissions) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log( - "Retransmit the previous handshake flight messages."); - } - - synchronized (this) { - outputRecord.launchRetransmission(); - } - } // Otherwise, discard the retransmitted flight. - } else if (!isDTLS || plainText != null) { - hsStatus = processInputRecord(plainText, appData, offset, length); - } - - if (hsStatus == null) { - hsStatus = getHSStatus(null); - } - - if (plainText == null) { - plainText = Plaintext.PLAINTEXT_NULL; - } - plainText.handshakeStatus = hsStatus; - - return plainText; - } - - /* - * Process the record. - */ - private synchronized HandshakeStatus processInputRecord( - Plaintext plainText, - ByteBuffer[] appData, int offset, int length) throws IOException { - - HandshakeStatus hsStatus = null; - switch (plainText.contentType) { - case Record.ct_handshake: - /* - * Handshake messages always go to a pending session - * handshaker ... if there isn't one, create one. This - * must work asynchronously, for renegotiation. - * - * NOTE that handshaking will either resume a session - * which was in the cache (and which might have other - * connections in it already), or else will start a new - * session (new keys exchanged) with just this connection - * in it. - */ - initHandshaker(); - if (!handshaker.activated()) { - // prior to handshaking, activate the handshake - if (connectionState == cs_RENEGOTIATE) { - // don't use SSLv2Hello when renegotiating - handshaker.activate(protocolVersion); - } else { - handshaker.activate(null); - } - } - - /* - * process the handshake record ... may contain just - * a partial handshake message or multiple messages. - * - * The handshaker state machine will ensure that it's - * a finished message. - */ - handshaker.processRecord(plainText.fragment, expectingFinished); - expectingFinished = false; - - if (handshaker.invalidated) { - finishHandshake(); - - // if state is cs_RENEGOTIATE, revert it to cs_DATA - if (connectionState == cs_RENEGOTIATE) { - connectionState = cs_DATA; - } - } else if (handshaker.isDone()) { - // reset the parameters for secure renegotiation. - secureRenegotiation = - handshaker.isSecureRenegotiation(); - clientVerifyData = handshaker.getClientVerifyData(); - serverVerifyData = handshaker.getServerVerifyData(); - // set connection ALPN value - applicationProtocol = - handshaker.getHandshakeApplicationProtocol(); - - sess = handshaker.getSession(); - handshakeSession = null; - if (outputRecord.isEmpty()) { - hsStatus = finishHandshake(); - connectionState = cs_DATA; - } - - // No handshakeListeners here. That's a - // SSLSocket thing. - } else if (handshaker.taskOutstanding()) { - hsStatus = HandshakeStatus.NEED_TASK; - } - break; - - case Record.ct_application_data: - // Pass this right back up to the application. - if ((connectionState != cs_DATA) - && (connectionState != cs_RENEGOTIATE) - && (connectionState != cs_CLOSED)) { - throw new SSLProtocolException( - "Data received in non-data state: " + - connectionState); - } - - if (expectingFinished) { - throw new SSLProtocolException - ("Expecting finished message, received data"); - } - - if (!inboundDone) { - ByteBuffer fragment = plainText.fragment; - int remains = fragment.remaining(); - - // Should have enough room in appData. - for (int i = offset; - ((i < (offset + length)) && (remains > 0)); i++) { - int amount = Math.min(appData[i].remaining(), remains); - fragment.limit(fragment.position() + amount); - appData[i].put(fragment); - remains -= amount; - } - } - - break; - - case Record.ct_alert: - recvAlert(plainText.fragment); - break; - - case Record.ct_change_cipher_spec: - if ((connectionState != cs_HANDSHAKE - && connectionState != cs_RENEGOTIATE)) { - // For the CCS message arriving in the wrong state - fatal(Alerts.alert_unexpected_message, - "illegal change cipher spec msg, conn state = " - + connectionState); - } else if (plainText.fragment.remaining() != 1 - || plainText.fragment.get() != 1) { - // For structural/content issues with the CCS - fatal(Alerts.alert_unexpected_message, - "Malformed change cipher spec msg"); - } - - // - // The first message after a change_cipher_spec - // record MUST be a "Finished" handshake record, - // else it's a protocol violation. We force this - // to be checked by a minor tweak to the state - // machine. - // - handshaker.receiveChangeCipherSpec(); - - CipherBox readCipher; - Authenticator readAuthenticator; - try { - readCipher = handshaker.newReadCipher(); - readAuthenticator = handshaker.newReadAuthenticator(); - } catch (GeneralSecurityException e) { - // can't happen - throw new SSLException("Algorithm missing: ", e); - } - inputRecord.changeReadCiphers(readAuthenticator, readCipher); - - // next message MUST be a finished message - expectingFinished = true; - break; - - default: - // - // TLS requires that unrecognized records be ignored. - // - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", Received record type: " + plainText.contentType); - } - break; - } // switch - - /* - * We only need to check the sequence number state for - * non-handshaking record. - * - * Note that in order to maintain the handshake status - * properly, we check the sequence number after the last - * record reading process. As we request renegotiation - * or close the connection for wrapped sequence number - * when there is enough sequence number space left to - * handle a few more records, so the sequence number - * of the last record cannot be wrapped. - */ - hsStatus = getHSStatus(hsStatus); - if (connectionState < cs_ERROR && !isInboundDone() && - (hsStatus == HandshakeStatus.NOT_HANDSHAKING) && - (inputRecord.seqNumIsHuge())) { - /* - * Ask for renegotiation when need to renew sequence number. - * - * Don't bother to kickstart the renegotiation when the local is - * asking for it. - */ - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", request renegotiation " + - "to avoid sequence number overflow"); - } - - beginHandshake(); - - hsStatus = getHSStatus(null); - } - - return hsStatus; - } - - - // - // write/wrap side - // - - - /** - * Wraps a buffer. Does a variety of checks before grabbing - * the wrapLock, which blocks multiple wraps from occurring. - */ - @Override - public SSLEngineResult wrap(ByteBuffer[] appData, - int offset, int length, ByteBuffer netData) throws SSLException { - - // check engine parameters - checkEngineParas(netData, appData, offset, length, true); - - /* - * We can be smarter about using smaller buffer sizes later. - * For now, force it to be large enough to handle any valid record. - */ - if (netData.remaining() < sess.getPacketBufferSize()) { - return new SSLEngineResult( - Status.BUFFER_OVERFLOW, getHSStatus(null), 0, 0); - } - - try { - synchronized (wrapLock) { - return writeAppRecord(appData, offset, length, netData); - } - } catch (SSLProtocolException spe) { - // may be an unexpected handshake message - fatal(Alerts.alert_unexpected_message, spe.getMessage(), spe); - return null; // make compiler happy - } catch (Exception e) { - fatal(Alerts.alert_internal_error, - "problem wrapping app data", e); - return null; // make compiler happy - } - } - - /* - * Makes additional checks for unwrap, but this time more - * specific to this packet and the current state of the machine. - */ - private SSLEngineResult writeAppRecord(ByteBuffer[] appData, - int offset, int length, ByteBuffer netData) throws IOException { - - Status status = null; - HandshakeStatus hsStatus = null; - - /* - * See if the handshaker needs to report back some SSLException. - */ - checkTaskThrown(); - - /* - * short circuit if we're closed/closing. - */ - if (isOutboundDone()) { - return new SSLEngineResult(Status.CLOSED, getHSStatus(null), 0, 0); - } - - /* - * If we're still in cs_HANDSHAKE, make sure it's been - * started. - */ - synchronized (this) { - if ((connectionState == cs_HANDSHAKE) || - (connectionState == cs_START)) { - - kickstartHandshake(); - - /* - * If there's no HS data available to write, we can return - * without trying to wrap anything. - */ - hsStatus = getHSStatus(null); - if (hsStatus == HandshakeStatus.NEED_UNWRAP) { - /* - * For DTLS, if the handshake state is - * HandshakeStatus.NEED_UNWRAP, a call to SSLEngine.wrap() - * means that the previous handshake packets (if delivered) - * get lost, and need retransmit the handshake messages. - */ - if (!isDTLS || !enableRetransmissions || - (handshaker == null) || outputRecord.firstMessage) { - - return new SSLEngineResult(Status.OK, hsStatus, 0, 0); - } // otherwise, need retransmission - } - } - } - - /* - * Grab a copy of this if it doesn't already exist, - * and we can use it several places before anything major - * happens on this side. Races aren't critical - * here. - */ - if (hsStatus == null) { - hsStatus = getHSStatus(null); - } - - /* - * If we have a task outstanding, this *MUST* be done before - * doing any more wrapping, because we could be in the middle - * of receiving a handshake message, for example, a finished - * message which would change the ciphers. - */ - if (hsStatus == HandshakeStatus.NEED_TASK) { - return new SSLEngineResult(Status.OK, hsStatus, 0, 0); - } - - /* - * This will obtain any waiting outbound data, or will - * process the outbound appData. - */ - int netPos = netData.position(); - int appRemains = 0; - for (int i = offset; i < offset + length; i++) { - if (appData[i] == null) { - throw new IllegalArgumentException( - "appData[" + i + "] == null"); - } - appRemains += appData[i].remaining(); - } - - Ciphertext ciphertext = null; - try { - if (appRemains != 0) { - synchronized (writeLock) { - ciphertext = writeRecord(appData, offset, length, netData); - } - } else { - synchronized (writeLock) { - ciphertext = writeRecord(null, 0, 0, netData); - } - } - } catch (SSLException e) { - throw e; - } catch (IOException e) { - throw new SSLException("Write problems", e); - } - - /* - * writeRecord might have reported some status. - * Now check for the remaining cases. - * - * status above should cover: NEED_WRAP/FINISHED - */ - status = (isOutboundDone() ? Status.CLOSED : Status.OK); - hsStatus = getHSStatus(ciphertext.handshakeStatus); - - int deltaNet = netData.position() - netPos; - int deltaApp = appRemains; - for (int i = offset; i < offset + length; i++) { - deltaApp -= appData[i].remaining(); - } - - return new SSLEngineResult( - status, hsStatus, deltaApp, deltaNet, ciphertext.recordSN); - } - - /* - * Central point to write/get all of the outgoing data. - */ - private Ciphertext writeRecord(ByteBuffer[] appData, - int offset, int length, ByteBuffer netData) throws IOException { - - Ciphertext ciphertext = null; - try { - // Acquire the buffered to-be-delivered records or retransmissions. - // - // May have buffered records, or need retransmission if handshaking. - if (!outputRecord.isEmpty() || - (enableRetransmissions && handshaker != null)) { - ciphertext = outputRecord.acquireCiphertext(netData); - } - - if ((ciphertext == null) && (appData != null)) { - ciphertext = outputRecord.encode( - appData, offset, length, netData); - } - } catch (SSLHandshakeException she) { - // may be record sequence number overflow - fatal(Alerts.alert_handshake_failure, she); - - return Ciphertext.CIPHERTEXT_NULL; // make the complier happy - } catch (IOException e) { - fatal(Alerts.alert_unexpected_message, e); - - return Ciphertext.CIPHERTEXT_NULL; // make the complier happy - } - - if (ciphertext == null) { - return Ciphertext.CIPHERTEXT_NULL; - } - - HandshakeStatus hsStatus = null; - Ciphertext.RecordType recordType = ciphertext.recordType; - if ((recordType.contentType == Record.ct_handshake) && - (recordType.handshakeType == HandshakeMessage.ht_finished) && - outputRecord.isEmpty()) { - - if (handshaker == null) { - hsStatus = HandshakeStatus.FINISHED; - } else if (handshaker.isDone()) { - hsStatus = finishHandshake(); - connectionState = cs_DATA; - - // Retransmit the last flight twice. - // - // The application data transactions may begin immediately - // after the last flight. If the last flight get lost, the - // application data may be discarded accordingly. As could - // be an issue for some applications. This impact can be - // mitigated by sending the last fligth twice. - if (isDTLS && enableRetransmissions) { - if (debug != null && Debug.isOn("verbose")) { - Debug.log( - "Retransmit the last flight messages."); - } - - synchronized (this) { - outputRecord.launchRetransmission(); - } - - hsStatus = HandshakeStatus.NEED_WRAP; - } - } - } // Otherwise, the followed call to getHSStatus() will help. - - /* - * We only need to check the sequence number state for - * non-handshaking record. - * - * Note that in order to maintain the handshake status - * properly, we check the sequence number after the last - * record writing process. As we request renegotiation - * or close the connection for wrapped sequence number - * when there is enough sequence number space left to - * handle a few more records, so the sequence number - * of the last record cannot be wrapped. - */ - hsStatus = getHSStatus(hsStatus); - if (connectionState < cs_ERROR && !isOutboundDone() && - (hsStatus == HandshakeStatus.NOT_HANDSHAKING) && - (outputRecord.seqNumIsHuge())) { - /* - * Ask for renegotiation when need to renew sequence number. - * - * Don't bother to kickstart the renegotiation when the local is - * asking for it. - */ - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", request renegotiation " + - "to avoid sequence number overflow"); - } - - beginHandshake(); - - hsStatus = getHSStatus(null); - } - ciphertext.handshakeStatus = hsStatus; - - return ciphertext; - } - - private HandshakeStatus finishHandshake() { - handshaker = null; - inputRecord.setHandshakeHash(null); - outputRecord.setHandshakeHash(null); - connectionState = cs_DATA; - - return HandshakeStatus.FINISHED; - } - - // - // Close code - // - - /** - * Signals that no more outbound application data will be sent - * on this <code>SSLEngine</code>. - */ - private void closeOutboundInternal() { - - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", closeOutboundInternal()"); - } - - /* - * Already closed, ignore - */ - if (outboundDone) { - return; - } - - switch (connectionState) { - - /* - * If we haven't even started yet, don't bother reading inbound. - */ - case cs_START: - try { - outputRecord.close(); - } catch (IOException ioe) { - // ignore - } - outboundDone = true; - - try { - inputRecord.close(); - } catch (IOException ioe) { - // ignore - } - inboundDone = true; - break; - - case cs_ERROR: - case cs_CLOSED: - break; - - /* - * Otherwise we indicate clean termination. - */ - // case cs_HANDSHAKE: - // case cs_DATA: - // case cs_RENEGOTIATE: - default: - warning(Alerts.alert_close_notify); - try { - outputRecord.close(); - } catch (IOException ioe) { - // ignore - } - outboundDone = true; - break; - } - - connectionState = cs_CLOSED; - } - - @Override - public synchronized void closeOutbound() { - /* - * Dump out a close_notify to the remote side - */ - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", called closeOutbound()"); - } - - closeOutboundInternal(); - } - - /** - * Returns the outbound application data closure state - */ - @Override - public boolean isOutboundDone() { - return outboundDone && outputRecord.isEmpty(); - } - - /** - * Signals that no more inbound network data will be sent - * to this <code>SSLEngine</code>. - */ - private void closeInboundInternal() { - - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", closeInboundInternal()"); - } - - /* - * Already closed, ignore - */ - if (inboundDone) { - return; - } - - closeOutboundInternal(); - - try { - inputRecord.close(); - } catch (IOException ioe) { - // ignore - } - inboundDone = true; - - connectionState = cs_CLOSED; - } - - /* - * Close the inbound side of the connection. We grab the - * lock here, and do the real work in the internal verison. - * We do check for truncation attacks. - */ - @Override - public synchronized void closeInbound() throws SSLException { - /* - * Currently closes the outbound side as well. The IETF TLS - * working group has expressed the opinion that 1/2 open - * connections are not allowed by the spec. May change - * someday in the future. - */ - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", called closeInbound()"); - } - - /* - * No need to throw an Exception if we haven't even started yet. - */ - if ((connectionState != cs_START) && !recvCN) { - recvCN = true; // Only receive the Exception once - fatal(Alerts.alert_internal_error, - "Inbound closed before receiving peer's close_notify: " + - "possible truncation attack?"); - } else { - /* - * Currently, this is a no-op, but in case we change - * the close inbound code later. - */ - closeInboundInternal(); - } - } - - /** - * Returns the network inbound data closure state - */ - @Override - public synchronized boolean isInboundDone() { - return inboundDone; - } - - - // - // Misc stuff - // - - - /** - * Returns the current <code>SSLSession</code> for this - * <code>SSLEngine</code> - * <P> - * These can be long lived, and frequently correspond to an - * entire login session for some user. - */ - @Override - public synchronized SSLSession getSession() { - return sess; - } - - @Override - public synchronized SSLSession getHandshakeSession() { - return handshakeSession; - } - - synchronized void setHandshakeSession(SSLSessionImpl session) { - // update the fragment size, which may be negotiated during handshaking - inputRecord.changeFragmentSize(session.getNegotiatedMaxFragSize()); - outputRecord.changeFragmentSize(session.getNegotiatedMaxFragSize()); - - handshakeSession = session; - } - - /** - * Returns a delegated <code>Runnable</code> task for - * this <code>SSLEngine</code>. - */ - @Override - public synchronized Runnable getDelegatedTask() { - if (handshaker != null) { - return handshaker.getTask(); - } - return null; - } - - - // - // EXCEPTION AND ALERT HANDLING - // - - /* - * Send a warning alert. - */ - void warning(byte description) { - sendAlert(Alerts.alert_warning, description); - } - - synchronized void fatal(byte description, String diagnostic) - throws SSLException { - fatal(description, diagnostic, null, false); - } - - synchronized void fatal(byte description, Throwable cause) - throws SSLException { - fatal(description, null, cause, false); - } - - synchronized void fatal(byte description, String diagnostic, - Throwable cause) throws SSLException { - fatal(description, diagnostic, cause, false); - } - - /* - * We've got a fatal error here, so start the shutdown process. - * - * Because of the way the code was written, we have some code - * calling fatal directly when the "description" is known - * and some throwing Exceptions which are then caught by higher - * levels which then call here. This code needs to determine - * if one of the lower levels has already started the process. - * - * We won't worry about Errors, if we have one of those, - * we're in worse trouble. Note: the networking code doesn't - * deal with Errors either. - */ - synchronized void fatal(byte description, String diagnostic, - Throwable cause, boolean recvFatalAlert) throws SSLException { - /* - * If we have no further information, make a general-purpose - * message for folks to see. We generally have one or the other. + * Check for OVERFLOW. + * + * Delay enforcing the application buffer free space requirement + * until after the initial handshaking. */ - if (diagnostic == null) { - diagnostic = "General SSLEngine problem"; - } - if (cause == null) { - cause = Alerts.getSSLException(description, cause, diagnostic); + int dstsRemains = 0; + for (int i = dstsOffset; i < dstsOffset + dstsLength; i++) { + dstsRemains += dsts[i].remaining(); } - /* - * If we've already shutdown because of an error, - * there is nothing we can do except rethrow the exception. - * - * Most exceptions seen here will be SSLExceptions. - * We may find the occasional Exception which hasn't been - * converted to a SSLException, so we'll do it here. - */ - if (closeReason != null) { - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", fatal: engine already closed. Rethrowing " + - cause.toString()); - } - if (cause instanceof RuntimeException) { - throw (RuntimeException)cause; - } else if (cause instanceof SSLException) { - throw (SSLException)cause; - } else if (cause instanceof Exception) { - throw new SSLException("fatal SSLEngine condition", cause); + if (conContext.isNegotiated) { + int FragLen = + conContext.inputRecord.estimateFragmentSize(packetLen); + if (FragLen > dstsRemains) { + return new SSLEngineResult( + Status.BUFFER_OVERFLOW, hsStatus, 0, 0); } } - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() - + ", fatal error: " + description + - ": " + diagnostic + "\n" + cause.toString()); + // check for UNDERFLOW. + if ((packetLen == -1) || (srcsRemains < packetLen)) { + return new SSLEngineResult(Status.BUFFER_UNDERFLOW, hsStatus, 0, 0); } /* - * Ok, this engine's going down. + * We're now ready to actually do the read. */ - int oldState = connectionState; - connectionState = cs_ERROR; - + Plaintext plainText = null; try { - inputRecord.close(); + plainText = decode(srcs, srcsOffset, srcsLength, + dsts, dstsOffset, dstsLength); } catch (IOException ioe) { - // ignore - } - inboundDone = true; - - sess.invalidate(); - if (handshakeSession != null) { - handshakeSession.invalidate(); + if (ioe instanceof SSLException) { + throw ioe; + } else { + throw new SSLException("readRecord", ioe); + } } /* - * If we haven't even started handshaking yet, or we are the - * recipient of a fatal alert, no need to generate a fatal close - * alert. + * Check the various condition that we could be reporting. + * + * It's *possible* something might have happened between the + * above and now, but it was better to minimally lock "this" + * during the read process. We'll return the current + * status, which is more representative of the current state. + * + * status above should cover: FINISHED, NEED_TASK */ - if (oldState != cs_START && !recvFatalAlert) { - sendAlert(Alerts.alert_fatal, description); - } - - if (cause instanceof SSLException) { // only true if != null - closeReason = (SSLException)cause; + Status status = (isInboundDone() ? Status.CLOSED : Status.OK); + if (plainText.handshakeStatus != null) { + hsStatus = plainText.handshakeStatus; } else { - /* - * Including RuntimeExceptions, but we'll throw those - * down below. The closeReason isn't used again, - * except for null checks. - */ - closeReason = - Alerts.getSSLException(description, cause, diagnostic); + hsStatus = getHandshakeStatus(); } - try { - outputRecord.close(); - } catch (IOException ioe) { - // ignore + int deltaNet = srcsRemains; + for (int i = srcsOffset; i < srcsOffset + srcsLength; i++) { + deltaNet -= srcs[i].remaining(); } - outboundDone = true; - connectionState = cs_CLOSED; - - if (cause instanceof RuntimeException) { - throw (RuntimeException)cause; - } else { - throw closeReason; + int deltaApp = dstsRemains; + for (int i = dstsOffset; i < dstsOffset + dstsLength; i++) { + deltaApp -= dsts[i].remaining(); } - } - /* - * Process an incoming alert ... caller must already have synchronized - * access to "this". - */ - private void recvAlert(ByteBuffer fragment) throws IOException { - byte level = fragment.get(); - byte description = fragment.get(); - - if (debug != null && (Debug.isOn("record") || - Debug.isOn("handshake"))) { - synchronized (System.out) { - System.out.print(Thread.currentThread().getName()); - System.out.print(", RECV " + protocolVersion + " ALERT: "); - if (level == Alerts.alert_fatal) { - System.out.print("fatal, "); - } else if (level == Alerts.alert_warning) { - System.out.print("warning, "); - } else { - System.out.print("<level " + (0x0ff & level) + ">, "); - } - System.out.println(Alerts.alertDescription(description)); - } - } + return new SSLEngineResult( + status, hsStatus, deltaNet, deltaApp, plainText.recordSN); + } - if (level == Alerts.alert_warning) { - if (description == -1) { // check for short message - fatal(Alerts.alert_illegal_parameter, "Short alert message"); - } else if (description == Alerts.alert_close_notify) { - if (connectionState == cs_HANDSHAKE) { - fatal(Alerts.alert_unexpected_message, - "Received close_notify during handshake"); - } else { - recvCN = true; - closeInboundInternal(); // reply to close - } + private Plaintext decode( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { + + Plaintext pt = SSLTransport.decode(conContext, + srcs, srcsOffset, srcsLength, + dsts, dstsOffset, dstsLength); + + // Is the handshake completed? + if (pt != Plaintext.PLAINTEXT_NULL) { + HandshakeStatus hsStatus = tryToFinishHandshake(pt.contentType); + if (hsStatus == null) { + pt.handshakeStatus = conContext.getHandshakeStatus(); } else { - - // - // The other legal warnings relate to certificates, - // e.g. no_certificate, bad_certificate, etc; these - // are important to the handshaking code, which can - // also handle illegal protocol alerts if needed. - // - if (handshaker != null) { - handshaker.handshakeAlert(description); - } + pt.handshakeStatus = hsStatus; } - } else { // fatal or unknown level - String reason = "Received fatal alert: " - + Alerts.alertDescription(description); - // The inbound and outbound queues will be closed as part of - // the call to fatal. The handhaker to needs to be set to null - // so subsequent calls to getHandshakeStatus will return - // NOT_HANDSHAKING. - handshaker = null; - Throwable cause = Alerts.getSSLException(description, reason); - fatal(description, null, cause, true); + // Is the sequence number is nearly overflow? + if (conContext.inputRecord.seqNumIsHuge()) { + pt.handshakeStatus = + tryKeyUpdate(pt.handshakeStatus); + } } - } - - /* - * Emit alerts. Caller must have synchronized with "this". - */ - private void sendAlert(byte level, byte description) { - // the connectionState cannot be cs_START - if (connectionState >= cs_CLOSED) { - return; - } + return pt; + } - // For initial handshaking, don't send alert message to peer if - // handshaker has not started. - // - // Shall we send an fatal alter to terminate the connection gracefully? - if (connectionState <= cs_HANDSHAKE && - (handshaker == null || !handshaker.started() || - !handshaker.activated())) { - return; + @Override + public synchronized Runnable getDelegatedTask() { + if (conContext.handshakeContext != null && // PRE or POST handshake + !conContext.handshakeContext.taskDelegated && + !conContext.handshakeContext.delegatedActions.isEmpty()) { + conContext.handshakeContext.taskDelegated = true; + return new DelegatedTask(this); } - try { - outputRecord.encodeAlert(level, description); - } catch (IOException ioe) { - // ignore - } + return null; } - - // - // VARIOUS OTHER METHODS (COMMON TO SSLSocket) - // - - - /** - * Controls whether new connections may cause creation of new SSL - * sessions. - * - * As long as handshaking has not started, we can change - * whether we enable session creations. Otherwise, - * we will need to wait for the next handshake. - */ @Override - public synchronized void setEnableSessionCreation(boolean flag) { - enableSessionCreation = flag; - - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setEnableSessionCreation(enableSessionCreation); - } + public synchronized void closeInbound() throws SSLException { + conContext.closeInbound(); } - /** - * Returns true if new connections may cause creation of new SSL - * sessions. - */ @Override - public synchronized boolean getEnableSessionCreation() { - return enableSessionCreation; + public synchronized boolean isInboundDone() { + return conContext.isInboundDone(); } - - /** - * Sets the flag controlling whether a server mode engine - * *REQUIRES* SSL client authentication. - * - * As long as handshaking has not started, we can change - * whether client authentication is needed. Otherwise, - * we will need to wait for the next handshake. - */ @Override - public synchronized void setNeedClientAuth(boolean flag) { - doClientAuth = (flag ? - ClientAuthType.CLIENT_AUTH_REQUIRED : - ClientAuthType.CLIENT_AUTH_NONE); - - if ((handshaker != null) && - (handshaker instanceof ServerHandshaker) && - !handshaker.activated()) { - ((ServerHandshaker) handshaker).setClientAuth(doClientAuth); - } + public synchronized void closeOutbound() { + conContext.closeOutbound(); } @Override - public synchronized boolean getNeedClientAuth() { - return (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUIRED); + public synchronized boolean isOutboundDone() { + return conContext.isOutboundDone(); } - /** - * Sets the flag controlling whether a server mode engine - * *REQUESTS* SSL client authentication. - * - * As long as handshaking has not started, we can change - * whether client authentication is requested. Otherwise, - * we will need to wait for the next handshake. - */ @Override - public synchronized void setWantClientAuth(boolean flag) { - doClientAuth = (flag ? - ClientAuthType.CLIENT_AUTH_REQUESTED : - ClientAuthType.CLIENT_AUTH_NONE); - - if ((handshaker != null) && - (handshaker instanceof ServerHandshaker) && - !handshaker.activated()) { - ((ServerHandshaker) handshaker).setClientAuth(doClientAuth); - } + public String[] getSupportedCipherSuites() { + return CipherSuite.namesOf(sslContext.getSupportedCipherSuites()); } @Override - public synchronized boolean getWantClientAuth() { - return (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUESTED); + public synchronized String[] getEnabledCipherSuites() { + return CipherSuite.namesOf(conContext.sslConfig.enabledCipherSuites); } - - /** - * Sets the flag controlling whether the engine is in SSL - * client or server mode. Must be called before any SSL - * traffic has started. - */ @Override - @SuppressWarnings("fallthrough") - public synchronized void setUseClientMode(boolean flag) { - switch (connectionState) { + public synchronized void setEnabledCipherSuites(String[] suites) { + conContext.sslConfig.enabledCipherSuites = + CipherSuite.validValuesOf(suites); + } - case cs_START: - /* - * If we need to change the socket mode and the enabled - * protocols and cipher suites haven't specifically been - * set by the user, change them to the corresponding - * default ones. - */ - if (roleIsServer != (!flag)) { - if (sslContext.isDefaultProtocolList(enabledProtocols)) { - enabledProtocols = - sslContext.getDefaultProtocolList(!flag); - } + @Override + public String[] getSupportedProtocols() { + return ProtocolVersion.toStringArray( + sslContext.getSupportedProtocolVersions()); + } - if (sslContext.isDefaultCipherSuiteList(enabledCipherSuites)) { - enabledCipherSuites = - sslContext.getDefaultCipherSuiteList(!flag); - } - } + @Override + public synchronized String[] getEnabledProtocols() { + return ProtocolVersion.toStringArray( + conContext.sslConfig.enabledProtocols); + } - roleIsServer = !flag; - serverModeSet = true; - break; + @Override + public synchronized void setEnabledProtocols(String[] protocols) { + if (protocols == null) { + throw new IllegalArgumentException("Protocols cannot be null"); + } - case cs_HANDSHAKE: - /* - * If we have a handshaker, but haven't started - * SSL traffic, we can throw away our current - * handshaker, and start from scratch. Don't - * need to call doneConnect() again, we already - * have the streams. - */ - assert(handshaker != null); - if (!handshaker.activated()) { - /* - * If we need to change the socket mode and the enabled - * protocols and cipher suites haven't specifically been - * set by the user, change them to the corresponding - * default ones. - */ - if (roleIsServer != (!flag)) { - if (sslContext.isDefaultProtocolList(enabledProtocols)) { - enabledProtocols = - sslContext.getDefaultProtocolList(!flag); - } + conContext.sslConfig.enabledProtocols = + ProtocolVersion.namesOf(protocols); + } - if (sslContext.isDefaultCipherSuiteList( - enabledCipherSuites)) { - enabledCipherSuites = - sslContext.getDefaultCipherSuiteList(!flag); - } - } + @Override + public synchronized SSLSession getSession() { + return conContext.conSession; + } - roleIsServer = !flag; - connectionState = cs_START; - initHandshaker(); - break; - } + @Override + public synchronized SSLSession getHandshakeSession() { + return conContext.handshakeContext == null ? + null : conContext.handshakeContext.handshakeSession; + } - // If handshake has started, that's an error. Fall through... - - default: - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", setUseClientMode() invoked in state = " + - connectionState); - } + @Override + public synchronized SSLEngineResult.HandshakeStatus getHandshakeStatus() { + return conContext.getHandshakeStatus(); + } - /* - * We can let them continue if they catch this correctly, - * we don't need to shut this down. - */ - throw new IllegalArgumentException( - "Cannot change mode after SSL traffic has started"); - } + @Override + public synchronized void setUseClientMode(boolean mode) { + conContext.setUseClientMode(mode); } @Override public synchronized boolean getUseClientMode() { - return !roleIsServer; + return conContext.sslConfig.isClientMode; } - - /** - * Returns the names of the cipher suites which could be enabled for use - * on an SSL connection. Normally, only a subset of these will actually - * be enabled by default, since this list may include cipher suites which - * do not support the mutual authentication of servers and clients, or - * which do not protect data confidentiality. Servers may also need - * certain kinds of certificates to use certain cipher suites. - * - * @return an array of cipher suite names - */ @Override - public String[] getSupportedCipherSuites() { - return sslContext.getSupportedCipherSuiteList().toStringArray(); + public synchronized void setNeedClientAuth(boolean need) { + conContext.sslConfig.clientAuthType = + (need ? ClientAuthType.CLIENT_AUTH_REQUIRED : + ClientAuthType.CLIENT_AUTH_NONE); } - /** - * Controls which particular cipher suites are enabled for use on - * this connection. The cipher suites must have been listed by - * getCipherSuites() as being supported. Even if a suite has been - * enabled, it might never be used if no peer supports it or the - * requisite certificates (and private keys) are not available. - * - * @param suites Names of all the cipher suites to enable. - */ @Override - public synchronized void setEnabledCipherSuites(String[] suites) { - enabledCipherSuites = new CipherSuiteList(suites); - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setEnabledCipherSuites(enabledCipherSuites); - } + public synchronized boolean getNeedClientAuth() { + return (conContext.sslConfig.clientAuthType == + ClientAuthType.CLIENT_AUTH_REQUIRED); } - /** - * Returns the names of the SSL cipher suites which are currently enabled - * for use on this connection. When an SSL engine is first created, - * all enabled cipher suites <em>(a)</em> protect data confidentiality, - * by traffic encryption, and <em>(b)</em> can mutually authenticate - * both clients and servers. Thus, in some environments, this value - * might be empty. - * - * @return an array of cipher suite names - */ @Override - public synchronized String[] getEnabledCipherSuites() { - return enabledCipherSuites.toStringArray(); + public synchronized void setWantClientAuth(boolean want) { + conContext.sslConfig.clientAuthType = + (want ? ClientAuthType.CLIENT_AUTH_REQUESTED : + ClientAuthType.CLIENT_AUTH_NONE); } - - /** - * Returns the protocols that are supported by this implementation. - * A subset of the supported protocols may be enabled for this connection - * @return an array of protocol names. - */ @Override - public String[] getSupportedProtocols() { - return sslContext.getSuportedProtocolList().toStringArray(); + public synchronized boolean getWantClientAuth() { + return (conContext.sslConfig.clientAuthType == + ClientAuthType.CLIENT_AUTH_REQUESTED); } - /** - * Controls which protocols are enabled for use on - * this connection. The protocols must have been listed by - * getSupportedProtocols() as being supported. - * - * @param protocols protocols to enable. - * @exception IllegalArgumentException when one of the protocols - * named by the parameter is not supported. - */ @Override - public synchronized void setEnabledProtocols(String[] protocols) { - enabledProtocols = new ProtocolList(protocols); - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setEnabledProtocols(enabledProtocols); - } + public synchronized void setEnableSessionCreation(boolean flag) { + conContext.sslConfig.enableSessionCreation = flag; } @Override - public synchronized String[] getEnabledProtocols() { - return enabledProtocols.toStringArray(); + public synchronized boolean getEnableSessionCreation() { + return conContext.sslConfig.enableSessionCreation; } - /** - * Returns the SSLParameters in effect for this SSLEngine. - */ @Override public synchronized SSLParameters getSSLParameters() { - SSLParameters params = super.getSSLParameters(); - - // the super implementation does not handle the following parameters - params.setEndpointIdentificationAlgorithm(identificationProtocol); - params.setAlgorithmConstraints(algorithmConstraints); - params.setSNIMatchers(sniMatchers); - params.setServerNames(serverNames); - params.setUseCipherSuitesOrder(preferLocalCipherSuites); - params.setEnableRetransmissions(enableRetransmissions); - params.setMaximumPacketSize(maximumPacketSize); - params.setApplicationProtocols(applicationProtocols); - - return params; + return conContext.sslConfig.getSSLParameters(); } - /** - * Applies SSLParameters to this engine. - */ @Override public synchronized void setSSLParameters(SSLParameters params) { - super.setSSLParameters(params); - - // the super implementation does not handle the following parameters - identificationProtocol = params.getEndpointIdentificationAlgorithm(); - algorithmConstraints = params.getAlgorithmConstraints(); - preferLocalCipherSuites = params.getUseCipherSuitesOrder(); - enableRetransmissions = params.getEnableRetransmissions(); - maximumPacketSize = params.getMaximumPacketSize(); - - if (maximumPacketSize != 0) { - outputRecord.changePacketSize(maximumPacketSize); - } else { - // use the implicit maximum packet size. - maximumPacketSize = outputRecord.getMaxPacketSize(); - } - - List<SNIServerName> sniNames = params.getServerNames(); - if (sniNames != null) { - serverNames = sniNames; - } + conContext.sslConfig.setSSLParameters(params); - Collection<SNIMatcher> matchers = params.getSNIMatchers(); - if (matchers != null) { - sniMatchers = matchers; - } - applicationProtocols = params.getApplicationProtocols(); - - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setIdentificationProtocol(identificationProtocol); - handshaker.setAlgorithmConstraints(algorithmConstraints); - handshaker.setMaximumPacketSize(maximumPacketSize); - handshaker.setApplicationProtocols(applicationProtocols); - if (roleIsServer) { - handshaker.setSNIMatchers(sniMatchers); - handshaker.setUseCipherSuitesOrder(preferLocalCipherSuites); - } else { - handshaker.setSNIServerNames(serverNames); - } + if (conContext.sslConfig.maximumPacketSize != 0) { + conContext.outputRecord.changePacketSize( + conContext.sslConfig.maximumPacketSize); } } @Override public synchronized String getApplicationProtocol() { - return applicationProtocol; + return conContext.applicationProtocol; } @Override public synchronized String getHandshakeApplicationProtocol() { - if ((handshaker != null) && handshaker.started()) { - return handshaker.getHandshakeApplicationProtocol(); - } - return null; + return conContext.handshakeContext == null ? + null : conContext.handshakeContext.applicationProtocol; } @Override public synchronized void setHandshakeApplicationProtocolSelector( - BiFunction<SSLEngine, List<String>, String> selector) { - applicationProtocolSelector = selector; - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setApplicationProtocolSelectorSSLEngine(selector); - } + BiFunction<SSLEngine, List<String>, String> selector) { + conContext.sslConfig.engineAPSelector = selector; } @Override public synchronized BiFunction<SSLEngine, List<String>, String> - getHandshakeApplicationProtocolSelector() { - return this.applicationProtocolSelector; + getHandshakeApplicationProtocolSelector() { + return conContext.sslConfig.engineAPSelector; + } + + @Override + public boolean useDelegatedTask() { + return true; + } + + private synchronized void checkTaskThrown() throws SSLException { + HandshakeContext hc = conContext.handshakeContext; + if (hc != null && hc.delegatedThrown != null) { + try { + throw getTaskThrown(hc.delegatedThrown); + } finally { + hc.delegatedThrown = null; + } + } + + if (conContext.isBroken && conContext.closeReason != null) { + throw getTaskThrown(conContext.closeReason); + } + } + + private static SSLException getTaskThrown(Exception taskThrown) { + String msg = taskThrown.getMessage(); + + if (msg == null) { + msg = "Delegated task threw Exception or Error"; + } + + if (taskThrown instanceof RuntimeException) { + throw new RuntimeException(msg, taskThrown); + } else if (taskThrown instanceof SSLHandshakeException) { + return (SSLHandshakeException) + new SSLHandshakeException(msg).initCause(taskThrown); + } else if (taskThrown instanceof SSLKeyException) { + return (SSLKeyException) + new SSLKeyException(msg).initCause(taskThrown); + } else if (taskThrown instanceof SSLPeerUnverifiedException) { + return (SSLPeerUnverifiedException) + new SSLPeerUnverifiedException(msg).initCause(taskThrown); + } else if (taskThrown instanceof SSLProtocolException) { + return (SSLProtocolException) + new SSLProtocolException(msg).initCause(taskThrown); + } else if (taskThrown instanceof SSLException) { + return (SSLException)taskThrown; + } else { + return new SSLException(msg, taskThrown); + } } /** - * Returns a printable representation of this end of the connection. + * Implement a simple task delegator. */ - @Override - public String toString() { - StringBuilder retval = new StringBuilder(80); + private static class DelegatedTask implements Runnable { + private final SSLEngineImpl engine; + + DelegatedTask(SSLEngineImpl engineInstance) { + this.engine = engineInstance; + } - retval.append(Integer.toHexString(hashCode())); - retval.append("["); - retval.append("SSLEngine[hostname="); - String host = getPeerHost(); - retval.append((host == null) ? "null" : host); - retval.append(" port="); - retval.append(Integer.toString(getPeerPort())); - retval.append(" role=" + (roleIsServer ? "Server" : "Client")); - retval.append("] "); - retval.append(getSession().getCipherSuite()); - retval.append("]"); + @Override + public void run() { + synchronized (engine) { + HandshakeContext hc = engine.conContext.handshakeContext; + if (hc == null || hc.delegatedActions.isEmpty()) { + return; + } + + try { + AccessController.doPrivileged( + new DelegatedAction(hc), engine.conContext.acc); + } catch (PrivilegedActionException pae) { + // Get the handshake context again in case the + // handshaking has completed. + hc = engine.conContext.handshakeContext; + if (hc != null) { + hc.delegatedThrown = pae.getException(); + } else if (engine.conContext.closeReason != null) { + engine.conContext.closeReason = + getTaskThrown(pae.getException()); + } + } catch (RuntimeException rte) { + // Get the handshake context again in case the + // handshaking has completed. + hc = engine.conContext.handshakeContext; + if (hc != null) { + hc.delegatedThrown = rte; + } else if (engine.conContext.closeReason != null) { + engine.conContext.closeReason = rte; + } + } + + // Get the handshake context again in case the + // handshaking has completed. + hc = engine.conContext.handshakeContext; + if (hc != null) { + hc.taskDelegated = false; + } + } + } + + private static class DelegatedAction + implements PrivilegedExceptionAction<Void> { + final HandshakeContext context; + DelegatedAction(HandshakeContext context) { + this.context = context; + } + + @Override + public Void run() throws Exception { + while (!context.delegatedActions.isEmpty()) { + // Report back the task SSLException + if (context.delegatedThrown != null) { + Exception delegatedThrown = context.delegatedThrown; + context.delegatedThrown = null; + throw getTaskThrown(delegatedThrown); + } - return retval.toString(); + Map.Entry<Byte, ByteBuffer> me = + context.delegatedActions.poll(); + if (me != null) { + context.dispatch(me.getKey(), me.getValue()); + } + } + return null; + } + } } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLEngineInputRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,48 +25,48 @@ package sun.security.ssl; -import java.io.*; -import java.nio.*; - +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.util.ArrayList; import javax.crypto.BadPaddingException; - -import javax.net.ssl.*; - -import sun.security.util.HexDumpEncoder; - +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLProtocolException; +import sun.security.ssl.SSLCipher.SSLReadCipher; +import sun.security.ssl.KeyUpdate.KeyUpdateMessage; +import sun.security.ssl.KeyUpdate.KeyUpdateRequest; /** * {@code InputRecord} implementation for {@code SSLEngine}. */ final class SSLEngineInputRecord extends InputRecord implements SSLRecord { - // used by handshake hash computation for handshake fragment - private byte prevType = -1; - private int hsMsgOff = 0; - private int hsMsgLen = 0; - private boolean formatVerified = false; // SSLv2 ruled out? - SSLEngineInputRecord() { - this.readAuthenticator = MAC.TLS_NULL; + // Cache for incomplete handshake messages. + private ByteBuffer handshakeBuffer = null; + + SSLEngineInputRecord(HandshakeHash handshakeHash) { + super(handshakeHash, SSLReadCipher.nullTlsReadCipher()); } @Override int estimateFragmentSize(int packetSize) { - int macLen = 0; - if (readAuthenticator instanceof MAC) { - macLen = ((MAC)readAuthenticator).MAClen(); - } - if (packetSize > 0) { - return readCipher.estimateFragmentSize( - packetSize, macLen, headerSize); + return readCipher.estimateFragmentSize(packetSize, headerSize); } else { return Record.maxDataSize; } } @Override - int bytesInCompletePacket(ByteBuffer packet) throws SSLException { + int bytesInCompletePacket( + ByteBuffer[] srcs, int srcsOffset, int srcsLength) throws IOException { + + return bytesInCompletePacket(srcs[srcsOffset]); + } + + private int bytesInCompletePacket(ByteBuffer packet) throws SSLException { /* * SSLv2 length field is in bytes 0/1 * SSLv3/TLS length field is in bytes 3/4 @@ -83,19 +83,23 @@ /* * If we have already verified previous packets, we can * ignore the verifications steps, and jump right to the - * determination. Otherwise, try one last hueristic to + * determination. Otherwise, try one last heuristic to * see if it's SSL/TLS. */ if (formatVerified || - (byteZero == ct_handshake) || (byteZero == ct_alert)) { + (byteZero == ContentType.HANDSHAKE.id) || + (byteZero == ContentType.ALERT.id)) { /* * Last sanity check that it's not a wild record */ - ProtocolVersion recordVersion = ProtocolVersion.valueOf( - packet.get(pos + 1), packet.get(pos + 2)); - - // check the record version - checkRecordVersion(recordVersion, false); + byte majorVersion = packet.get(pos + 1); + byte minorVersion = packet.get(pos + 2); + if (!ProtocolVersion.isNegotiable( + majorVersion, minorVersion, false, false)) { + throw new SSLException("Unrecognized record version " + + ProtocolVersion.nameOf(majorVersion, minorVersion) + + " , plaintext connection?"); + } /* * Reasonably sure this is a V3, disable further checks. @@ -123,11 +127,14 @@ if (isShort && ((packet.get(pos + 2) == 1) || packet.get(pos + 2) == 4)) { - ProtocolVersion recordVersion = ProtocolVersion.valueOf( - packet.get(pos + 3), packet.get(pos + 4)); - - // check the record version - checkRecordVersion(recordVersion, true); + byte majorVersion = packet.get(pos + 3); + byte minorVersion = packet.get(pos + 4); + if (!ProtocolVersion.isNegotiable( + majorVersion, minorVersion, false, false)) { + throw new SSLException("Unrecognized record version " + + ProtocolVersion.nameOf(majorVersion, minorVersion) + + " , plaintext connection?"); + } /* * Client or Server Hello @@ -147,37 +154,29 @@ } @Override - void checkRecordVersion(ProtocolVersion recordVersion, - boolean allowSSL20Hello) throws SSLException { - - if (recordVersion.maybeDTLSProtocol()) { - throw new SSLException( - "Unrecognized record version " + recordVersion + - " , DTLS packet?"); - } + Plaintext[] decode(ByteBuffer[] srcs, int srcsOffset, + int srcsLength) throws IOException, BadPaddingException { + if (srcs == null || srcs.length == 0 || srcsLength == 0) { + return new Plaintext[0]; + } else if (srcsLength == 1) { + return decode(srcs[srcsOffset]); + } else { + ByteBuffer packet = extract(srcs, + srcsOffset, srcsLength, SSLRecord.headerSize); - // Check if the record version is too old. - if ((recordVersion.v < ProtocolVersion.MIN.v)) { - // if it's not SSLv2, we're out of here. - if (!allowSSL20Hello || - (recordVersion.v != ProtocolVersion.SSL20Hello.v)) { - throw new SSLException( - "Unsupported record version " + recordVersion); - } + return decode(packet); } } - @Override - Plaintext decode(ByteBuffer packet) + private Plaintext[] decode(ByteBuffer packet) throws IOException, BadPaddingException { if (isClosed) { return null; } - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw read]: length = " + packet.remaining(), packet); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw read", packet); } // The caller should have validated the record. @@ -191,7 +190,8 @@ */ int pos = packet.position(); byte byteZero = packet.get(pos); - if (byteZero != ct_handshake && byteZero != ct_alert) { + if (byteZero != ContentType.HANDSHAKE.id && + byteZero != ContentType.ALERT.id) { return handleUnknownRecord(packet); } } @@ -199,27 +199,24 @@ return decodeInputRecord(packet); } - private Plaintext decodeInputRecord(ByteBuffer packet) + private Plaintext[] decodeInputRecord(ByteBuffer packet) throws IOException, BadPaddingException { - // // The packet should be a complete record, or more. // - int srcPos = packet.position(); int srcLim = packet.limit(); byte contentType = packet.get(); // pos: 0 byte majorVersion = packet.get(); // pos: 1 byte minorVersion = packet.get(); // pos: 2 - int contentLen = ((packet.get() & 0xFF) << 8) + - (packet.get() & 0xFF); // pos: 3, 4 + int contentLen = Record.getInt16(packet); // pos: 3, 4 - if (debug != null && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", READ: " + - ProtocolVersion.valueOf(majorVersion, minorVersion) + - " " + Record.contentName(contentType) + ", length = " + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "READ: " + + ProtocolVersion.nameOf(majorVersion, minorVersion) + + " " + ContentType.nameOf(contentType) + ", length = " + contentLen); } @@ -233,106 +230,131 @@ } // - // check for handshake fragment - // - if ((contentType != ct_handshake) && (hsMsgOff != hsMsgLen)) { - throw new SSLProtocolException( - "Expected to get a handshake fragment"); - } - - // // Decrypt the fragment // int recLim = srcPos + SSLRecord.headerSize + contentLen; packet.limit(recLim); packet.position(srcPos + SSLRecord.headerSize); - ByteBuffer plaintext; + ByteBuffer fragment; try { - plaintext = - decrypt(readAuthenticator, readCipher, contentType, packet); + Plaintext plaintext = + readCipher.decrypt(contentType, packet, null); + fragment = plaintext.fragment; + contentType = plaintext.contentType; + } catch (BadPaddingException bpe) { + throw bpe; + } catch (GeneralSecurityException gse) { + throw (SSLProtocolException)(new SSLProtocolException( + "Unexpected exception")).initCause(gse); } finally { - // comsume a complete record + // consume a complete record packet.limit(srcLim); packet.position(recLim); } // - // handshake hashing + // check for handshake fragment // - if (contentType == ct_handshake) { - int pltPos = plaintext.position(); - int pltLim = plaintext.limit(); - int frgPos = pltPos; - for (int remains = plaintext.remaining(); remains > 0;) { - int howmuch; - byte handshakeType; - if (hsMsgOff < hsMsgLen) { - // a fragment of the handshake message - howmuch = Math.min((hsMsgLen - hsMsgOff), remains); - handshakeType = prevType; - - hsMsgOff += howmuch; - if (hsMsgOff == hsMsgLen) { - // Now is a complete handshake message. - hsMsgOff = 0; - hsMsgLen = 0; - } - } else { // hsMsgOff == hsMsgLen, a new handshake message - handshakeType = plaintext.get(); - int handshakeLen = ((plaintext.get() & 0xFF) << 16) | - ((plaintext.get() & 0xFF) << 8) | - (plaintext.get() & 0xFF); - plaintext.position(frgPos); - if (remains < (handshakeLen + 4)) { // 4: handshake header - // This handshake message is fragmented. - prevType = handshakeType; - hsMsgOff = remains - 4; // 4: handshake header - hsMsgLen = handshakeLen; - } + if (contentType != ContentType.HANDSHAKE.id && + handshakeBuffer != null && handshakeBuffer.hasRemaining()) { + throw new SSLProtocolException( + "Expecting a handshake fragment, but received " + + ContentType.nameOf(contentType)); + } - howmuch = Math.min(handshakeLen + 4, remains); - } + // + // parse handshake messages + // + if (contentType == ContentType.HANDSHAKE.id) { + ByteBuffer handshakeFrag = fragment; + if ((handshakeBuffer != null) && + (handshakeBuffer.remaining() != 0)) { + ByteBuffer bb = ByteBuffer.wrap(new byte[ + handshakeBuffer.remaining() + fragment.remaining()]); + bb.put(handshakeBuffer); + bb.put(fragment); + handshakeFrag = bb.rewind(); + handshakeBuffer = null; + } - plaintext.limit(frgPos + howmuch); + ArrayList<Plaintext> plaintexts = new ArrayList<>(5); + while (handshakeFrag.hasRemaining()) { + int remaining = handshakeFrag.remaining(); + if (remaining < handshakeHeaderSize) { + handshakeBuffer = ByteBuffer.wrap(new byte[remaining]); + handshakeBuffer.put(handshakeFrag); + handshakeBuffer.rewind(); + break; + } - if (handshakeType == HandshakeMessage.ht_hello_request) { - // omitted from handshake hash computation - } else if ((handshakeType != HandshakeMessage.ht_finished) && - (handshakeType != HandshakeMessage.ht_certificate_verify)) { - - if (handshakeHash == null) { - // used for cache only - handshakeHash = new HandshakeHash(false); + handshakeFrag.mark(); + // skip the first byte: handshake type + byte handshakeType = handshakeFrag.get(); + int handshakeBodyLen = Record.getInt24(handshakeFrag); + handshakeFrag.reset(); + int handshakeMessageLen = + handshakeHeaderSize + handshakeBodyLen; + if (remaining < handshakeMessageLen) { + handshakeBuffer = ByteBuffer.wrap(new byte[remaining]); + handshakeBuffer.put(handshakeFrag); + handshakeBuffer.rewind(); + break; + } if (remaining == handshakeMessageLen) { + if (handshakeHash.isHashable(handshakeType)) { + handshakeHash.receive(handshakeFrag); } - handshakeHash.update(plaintext); + + plaintexts.add( + new Plaintext(contentType, + majorVersion, minorVersion, -1, -1L, handshakeFrag) + ); + break; } else { - // Reserve until this handshake message has been processed. - if (handshakeHash == null) { - // used for cache only - handshakeHash = new HandshakeHash(false); + int fragPos = handshakeFrag.position(); + int fragLim = handshakeFrag.limit(); + int nextPos = fragPos + handshakeMessageLen; + handshakeFrag.limit(nextPos); + + if (handshakeHash.isHashable(handshakeType)) { + handshakeHash.receive(handshakeFrag); } - handshakeHash.reserve(plaintext); + + plaintexts.add( + new Plaintext(contentType, majorVersion, minorVersion, + -1, -1L, handshakeFrag.slice()) + ); + + handshakeFrag.position(nextPos); + handshakeFrag.limit(fragLim); } + } - plaintext.position(frgPos + howmuch); - plaintext.limit(pltLim); + return plaintexts.toArray(new Plaintext[0]); + } + + // KeyLimit check during application data. + // atKeyLimit() inactive when limits not checked, tc set when limits + // are active. - frgPos += howmuch; - remains -= howmuch; + if (readCipher.atKeyLimit()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("KeyUpdate: triggered, read side."); } - plaintext.position(pltPos); + PostHandshakeContext p = new PostHandshakeContext(tc); + KeyUpdate.handshakeProducer.produce(p, + new KeyUpdateMessage(p, KeyUpdateRequest.REQUESTED)); } - return new Plaintext(contentType, - majorVersion, minorVersion, -1, -1L, plaintext); - // recordEpoch, recordSeq, plaintext); + return new Plaintext[] { + new Plaintext(contentType, + majorVersion, minorVersion, -1, -1L, fragment) + }; } - private Plaintext handleUnknownRecord(ByteBuffer packet) + private Plaintext[] handleUnknownRecord(ByteBuffer packet) throws IOException, BadPaddingException { - // // The packet should be a complete record. // @@ -363,8 +385,8 @@ * error message, one that's treated as fatal by * clients (Otherwise we'll hang.) */ - if (debug != null && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( "Requested to negotiate unsupported SSLv2!"); } @@ -380,23 +402,20 @@ * V3 ClientHello message, and pass it up. */ packet.position(srcPos + 2); // exclude the header - - if (handshakeHash == null) { - // used for cache only - handshakeHash = new HandshakeHash(false); - } - handshakeHash.update(packet); + handshakeHash.receive(packet); packet.position(srcPos); ByteBuffer converted = convertToClientHello(packet); - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine( "[Converted] ClientHello", converted); } - return new Plaintext(ct_handshake, - majorVersion, minorVersion, -1, -1L, converted); + return new Plaintext[] { + new Plaintext(ContentType.HANDSHAKE.id, + majorVersion, minorVersion, -1, -1L, converted) + }; } else { if (((firstByte & 0x80) != 0) && (thirdByte == 4)) { throw new SSLException("SSL V2.0 servers are not supported."); @@ -405,5 +424,4 @@ throw new SSLException("Unsupported or unrecognized SSL message"); } } - } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLEngineOutputRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,14 @@ package sun.security.ssl; -import java.io.*; -import java.nio.*; -import java.util.*; - -import javax.net.ssl.SSLException; +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.LinkedList; import javax.net.ssl.SSLHandshakeException; -import sun.security.util.HexDumpEncoder; -import static sun.security.ssl.Ciphertext.RecordType; + +import sun.security.ssl.SSLCipher.SSLWriteCipher; +import sun.security.ssl.KeyUpdate.KeyUpdateMessage; +import sun.security.ssl.KeyUpdate.KeyUpdateRequest; /** * {@code OutputRecord} implementation for {@code SSLEngine}. @@ -40,23 +40,22 @@ final class SSLEngineOutputRecord extends OutputRecord implements SSLRecord { private HandshakeFragment fragmenter = null; - private LinkedList<RecordMemo> alertMemos = new LinkedList<>(); private boolean isTalkingToV2 = false; // SSLv2Hello private ByteBuffer v2ClientHello = null; // SSLv2Hello private boolean isCloseWaiting = false; - SSLEngineOutputRecord() { - this.writeAuthenticator = MAC.TLS_NULL; + SSLEngineOutputRecord(HandshakeHash handshakeHash) { + super(handshakeHash, SSLWriteCipher.nullTlsWriteCipher()); this.packetSize = SSLRecord.maxRecordSize; - this.protocolVersion = ProtocolVersion.DEFAULT_TLS; + this.protocolVersion = ProtocolVersion.NONE; } @Override public synchronized void close() throws IOException { if (!isClosed) { - if (alertMemos != null && !alertMemos.isEmpty()) { + if (fragmenter != null && fragmenter.hasAlert()) { isCloseWaiting = true; } else { super.close(); @@ -66,19 +65,11 @@ @Override void encodeAlert(byte level, byte description) throws IOException { - RecordMemo memo = new RecordMemo(); - - memo.contentType = Record.ct_alert; - memo.majorVersion = protocolVersion.major; - memo.minorVersion = protocolVersion.minor; - memo.encodeCipher = writeCipher; - memo.encodeAuthenticator = writeAuthenticator; - - memo.fragment = new byte[2]; - memo.fragment[0] = level; - memo.fragment[1] = description; + if (fragmenter == null) { + fragmenter = new HandshakeFragment(); + } - alertMemos.add(memo); + fragmenter.queueUpAlert(level, description); } @Override @@ -93,7 +84,7 @@ firstMessage = false; if ((helloVersion == ProtocolVersion.SSL20Hello) && - (source[offset] == HandshakeMessage.ht_client_hello) && + (source[offset] == SSLHandshake.CLIENT_HELLO.id) && // 5: recode header size (source[offset + 4 + 2 + 32] == 0)) { // V3 session ID is empty @@ -106,7 +97,7 @@ source, (offset + 4), (length - 4)); v2ClientHello.position(2); // exclude the header - handshakeHash.update(v2ClientHello); + handshakeHash.deliver(v2ClientHello); v2ClientHello.position(0); return; @@ -114,8 +105,8 @@ } byte handshakeType = source[offset]; - if (handshakeType != HandshakeMessage.ht_hello_request) { - handshakeHash.update(source, offset, length); + if (handshakeHash.isHashable(handshakeType)) { + handshakeHash.deliver(source, offset, length); } fragmenter.queueUpFragment(source, offset, length); @@ -135,22 +126,43 @@ } @Override - Ciphertext encode(ByteBuffer[] sources, int offset, int length, + Ciphertext encode( + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { + return encode(srcs, srcsOffset, srcsLength, dsts[0]); + } + + private Ciphertext encode(ByteBuffer[] sources, int offset, int length, ByteBuffer destination) throws IOException { - if (writeAuthenticator.seqNumOverflow()) { - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", sequence number extremely close to overflow " + + if (writeCipher.authenticator.seqNumOverflow()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine( + "sequence number extremely close to overflow " + "(2^64-1 packets). Closing connection."); } throw new SSLHandshakeException("sequence number overflow"); } - int macLen = 0; - if (writeAuthenticator instanceof MAC) { - macLen = ((MAC)writeAuthenticator).MAClen(); + // Don't process the incoming record until all of the + // buffered records get handled. + Ciphertext ct = acquireCiphertext(destination); + if (ct != null) { + return ct; + } + + if (sources == null || sources.length == 0) { + return null; + } + + int srcsRemains = 0; + for (int i = offset; i < offset + length; i++) { + srcsRemains += sources[i].remaining(); + } + + if (srcsRemains == 0) { + return null; } int dstLim = destination.limit(); @@ -170,7 +182,7 @@ if (packetLeftSize > 0) { fragLen = writeCipher.calculateFragmentSize( - packetLeftSize, macLen, headerSize); + packetLeftSize, headerSize); fragLen = Math.min(fragLen, Record.maxDataSize); } else { @@ -208,26 +220,24 @@ destination.limit(destination.position()); destination.position(dstContent); - if ((debug != null) && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + " " + - Record.contentName(Record.ct_application_data) + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "WRITE: " + protocolVersion + " " + + ContentType.APPLICATION_DATA.name + ", length = " + destination.remaining()); } // Encrypt the fragment and wrap up a record. - recordSN = encrypt(writeAuthenticator, writeCipher, - Record.ct_application_data, destination, + recordSN = encrypt(writeCipher, + ContentType.APPLICATION_DATA.id, destination, dstPos, dstLim, headerSize, - protocolVersion, false); + protocolVersion); - if ((debug != null) && Debug.isOn("packet")) { + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { ByteBuffer temporary = destination.duplicate(); temporary.limit(temporary.position()); temporary.position(dstPos); - Debug.printHex( - "[Raw write]: length = " + temporary.remaining(), - temporary); + SSLLogger.fine("Raw write", temporary); } packetLeftSize -= destination.position() - dstPos; @@ -238,103 +248,62 @@ if (isFirstAppOutputRecord) { isFirstAppOutputRecord = false; } + + // atKeyLimit() inactive when limits not checked, tc set when limits + // are active. + if (writeCipher.atKeyLimit()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("KeyUpdate: triggered, write side."); + } + + PostHandshakeContext p = new PostHandshakeContext(tc); + KeyUpdate.handshakeProducer.produce(p, + new KeyUpdateMessage(p, KeyUpdateRequest.REQUESTED)); + } } - return new Ciphertext(RecordType.RECORD_APPLICATION_DATA, recordSN); + return new Ciphertext(ContentType.APPLICATION_DATA.id, + SSLHandshake.NOT_APPLICABLE.id, recordSN); } - @Override - Ciphertext acquireCiphertext(ByteBuffer destination) throws IOException { + private Ciphertext acquireCiphertext(ByteBuffer destination) throws IOException { if (isTalkingToV2) { // SSLv2Hello // We don't support SSLv2. Send an SSLv2 error message // so that the connection can be closed gracefully. // // Please don't change the limit of the destination buffer. destination.put(SSLRecord.v2NoCipher); - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw write]: length = " + SSLRecord.v2NoCipher.length, - SSLRecord.v2NoCipher); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw write", SSLRecord.v2NoCipher); } isTalkingToV2 = false; - return new Ciphertext(RecordType.RECORD_ALERT, -1L); + return new Ciphertext(ContentType.ALERT.id, + SSLHandshake.NOT_APPLICABLE.id, -1L); } if (v2ClientHello != null) { // deliver the SSLv2 format ClientHello message // // Please don't change the limit of the destination buffer. - if (debug != null) { - if (Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + + if (SSLLogger.isOn) { + if (SSLLogger.isOn("record")) { + SSLLogger.fine(Thread.currentThread().getName() + ", WRITE: SSLv2 ClientHello message" + ", length = " + v2ClientHello.remaining()); } - if (Debug.isOn("packet")) { - Debug.printHex( - "[Raw write]: length = " + v2ClientHello.remaining(), - v2ClientHello); + if (SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw write", v2ClientHello); } } destination.put(v2ClientHello); v2ClientHello = null; - return new Ciphertext(RecordType.RECORD_CLIENT_HELLO, -1L); - } - - if (alertMemos != null && !alertMemos.isEmpty()) { - RecordMemo memo = alertMemos.pop(); - - int macLen = 0; - if (memo.encodeAuthenticator instanceof MAC) { - macLen = ((MAC)memo.encodeAuthenticator).MAClen(); - } - - int dstPos = destination.position(); - int dstLim = destination.limit(); - int dstContent = dstPos + headerSize + - writeCipher.getExplicitNonceSize(); - destination.position(dstContent); - - destination.put(memo.fragment); - - destination.limit(destination.position()); - destination.position(dstContent); - - if ((debug != null) && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + " " + - Record.contentName(Record.ct_alert) + - ", length = " + destination.remaining()); - } - - // Encrypt the fragment and wrap up a record. - long recordSN = encrypt(memo.encodeAuthenticator, memo.encodeCipher, - Record.ct_alert, destination, dstPos, dstLim, headerSize, - ProtocolVersion.valueOf(memo.majorVersion, - memo.minorVersion), false); - - if ((debug != null) && Debug.isOn("packet")) { - ByteBuffer temporary = destination.duplicate(); - temporary.limit(temporary.position()); - temporary.position(dstPos); - Debug.printHex( - "[Raw write]: length = " + temporary.remaining(), - temporary); - } - - // remain the limit unchanged - destination.limit(dstLim); - - if (isCloseWaiting && (memo.contentType == Record.ct_alert)) { - isCloseWaiting = true; - close(); - } - return new Ciphertext(RecordType.RECORD_ALERT, recordSN); + return new Ciphertext(ContentType.HANDSHAKE.id, + SSLHandshake.CLIENT_HELLO.id, -1L); } if (fragmenter != null) { @@ -347,8 +316,7 @@ @Override boolean isEmpty() { return (!isTalkingToV2) && (v2ClientHello == null) && - ((fragmenter == null) || fragmenter.isEmpty()) && - ((alertMemos == null) || alertMemos.isEmpty()); + ((fragmenter == null) || fragmenter.isEmpty()); } // buffered record fragment @@ -356,8 +324,7 @@ byte contentType; byte majorVersion; byte minorVersion; - CipherBox encodeCipher; - Authenticator encodeAuthenticator; + SSLWriteCipher encodeCipher; byte[] fragment; } @@ -372,14 +339,12 @@ void queueUpFragment(byte[] source, int offset, int length) throws IOException { - HandshakeMemo memo = new HandshakeMemo(); - memo.contentType = Record.ct_handshake; + memo.contentType = ContentType.HANDSHAKE.id; memo.majorVersion = protocolVersion.major; // kick start version? memo.minorVersion = protocolVersion.minor; memo.encodeCipher = writeCipher; - memo.encodeAuthenticator = writeAuthenticator; memo.handshakeType = source[offset]; memo.acquireOffset = 0; @@ -394,11 +359,10 @@ void queueUpChangeCipherSpec() { RecordMemo memo = new RecordMemo(); - memo.contentType = Record.ct_change_cipher_spec; + memo.contentType = ContentType.CHANGE_CIPHER_SPEC.id; memo.majorVersion = protocolVersion.major; memo.minorVersion = protocolVersion.minor; memo.encodeCipher = writeCipher; - memo.encodeAuthenticator = writeAuthenticator; memo.fragment = new byte[1]; memo.fragment[0] = 1; @@ -406,6 +370,21 @@ handshakeMemos.add(memo); } + void queueUpAlert(byte level, byte description) { + RecordMemo memo = new RecordMemo(); + + memo.contentType = ContentType.ALERT.id; + memo.majorVersion = protocolVersion.major; + memo.minorVersion = protocolVersion.minor; + memo.encodeCipher = writeCipher; + + memo.fragment = new byte[2]; + memo.fragment[0] = level; + memo.fragment[1] = description; + + handshakeMemos.add(memo); + } + Ciphertext acquireCiphertext(ByteBuffer dstBuf) throws IOException { if (isEmpty()) { return null; @@ -413,22 +392,17 @@ RecordMemo memo = handshakeMemos.getFirst(); HandshakeMemo hsMemo = null; - if (memo.contentType == Record.ct_handshake) { + if (memo.contentType == ContentType.HANDSHAKE.id) { hsMemo = (HandshakeMemo)memo; } - int macLen = 0; - if (memo.encodeAuthenticator instanceof MAC) { - macLen = ((MAC)memo.encodeAuthenticator).MAClen(); - } - // ChangeCipherSpec message is pretty small. Don't worry about // the fragmentation of ChangeCipherSpec record. int fragLen; if (packetSize > 0) { fragLen = Math.min(maxRecordSize, packetSize); fragLen = memo.encodeCipher.calculateFragmentSize( - fragLen, macLen, headerSize); + fragLen, headerSize); } else { fragLen = Record.maxDataSize; } @@ -474,11 +448,12 @@ !handshakeMemos.isEmpty()) { // look for the next buffered record fragment - RecordMemo reMemo = handshakeMemos.getFirst(); - if (reMemo.contentType == Record.ct_handshake) { - hsMemo = (HandshakeMemo)reMemo; + RecordMemo rm = handshakeMemos.getFirst(); + if (rm.contentType == ContentType.HANDSHAKE.id && + rm.encodeCipher == hsMemo.encodeCipher) { + hsMemo = (HandshakeMemo)rm; } else { - // not handshake message, break the loop + // not of the flight, break the loop break; } } @@ -486,8 +461,6 @@ remainingFragLen -= chipLen; } - - fragLen -= remainingFragLen; } else { fragLen = Math.min(fragLen, memo.fragment.length); dstBuf.put(memo.fragment, 0, fragLen); @@ -498,27 +471,26 @@ dstBuf.limit(dstBuf.position()); dstBuf.position(dstContent); - if ((debug != null) && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + " " + - Record.contentName(memo.contentType) + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "WRITE: " + protocolVersion + " " + + ContentType.nameOf(memo.contentType) + ", length = " + dstBuf.remaining()); } // Encrypt the fragment and wrap up a record. - long recordSN = encrypt(memo.encodeAuthenticator, memo.encodeCipher, + long recordSN = encrypt( + memo.encodeCipher, memo.contentType, dstBuf, dstPos, dstLim, headerSize, ProtocolVersion.valueOf(memo.majorVersion, - memo.minorVersion), false); + memo.minorVersion)); - if ((debug != null) && Debug.isOn("packet")) { + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { ByteBuffer temporary = dstBuf.duplicate(); temporary.limit(temporary.position()); temporary.position(dstPos); - Debug.printHex( - "[Raw write]: length = " + temporary.remaining(), - temporary); + SSLLogger.fine("Raw write", temporary); } // remain the limit unchanged @@ -526,17 +498,32 @@ // Reset the fragmentation offset. if (hsMemo != null) { - return new Ciphertext(RecordType.valueOf( - hsMemo.contentType, hsMemo.handshakeType), recordSN); + return new Ciphertext(hsMemo.contentType, + hsMemo.handshakeType, recordSN); } else { - return new Ciphertext( - RecordType.RECORD_CHANGE_CIPHER_SPEC, recordSN); + if (isCloseWaiting && + memo.contentType == ContentType.ALERT.id) { + close(); + } + + return new Ciphertext(memo.contentType, + SSLHandshake.NOT_APPLICABLE.id, recordSN); } } boolean isEmpty() { return handshakeMemos.isEmpty(); } + + boolean hasAlert() { + for (RecordMemo memo : handshakeMemos) { + if (memo.contentType == ContentType.ALERT.id) { + return true; + } + } + + return false; + } } /* diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,685 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.Locale; +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.util.HexDumpEncoder; + +enum SSLExtension implements SSLStringizer { + // Extensions defined in RFC 6066 + CH_SERVER_NAME (0x0000, "server_name", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_13, + ServerNameExtension.chNetworkProducer, + ServerNameExtension.chOnLoadConsumer, + null, + null, + null, + ServerNameExtension.chStringizer), + SH_SERVER_NAME (0x0000, "server_name", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + ServerNameExtension.shNetworkProducer, + ServerNameExtension.shOnLoadConsumer, + null, + null, + null, + ServerNameExtension.shStringizer), + EE_SERVER_NAME (0x0000, "server_name", + SSLHandshake.ENCRYPTED_EXTENSIONS, + ProtocolVersion.PROTOCOLS_OF_13, + ServerNameExtension.eeNetworkProducer, + ServerNameExtension.eeOnLoadConsumer, + null, + null, + null, + ServerNameExtension.shStringizer), + CH_MAX_FRAGMENT_LENGTH (0x0001, "max_fragment_length", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_13, + MaxFragExtension.chNetworkProducer, + MaxFragExtension.chOnLoadConsumer, + null, + null, + null, + MaxFragExtension.maxFragLenStringizer), + SH_MAX_FRAGMENT_LENGTH (0x0001, "max_fragment_length", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + MaxFragExtension.shNetworkProducer, + MaxFragExtension.shOnLoadConsumer, + null, + MaxFragExtension.shOnTradeConsumer, + null, + MaxFragExtension.maxFragLenStringizer), + EE_MAX_FRAGMENT_LENGTH (0x0001, "max_fragment_length", + SSLHandshake.ENCRYPTED_EXTENSIONS, + ProtocolVersion.PROTOCOLS_OF_13, + MaxFragExtension.eeNetworkProducer, + MaxFragExtension.eeOnLoadConsumer, + null, + MaxFragExtension.eeOnTradeConsumer, + null, + MaxFragExtension.maxFragLenStringizer), + CLIENT_CERTIFICATE_URL (0x0002, "client_certificate_url"), + TRUSTED_CA_KEYS (0x0003, "trusted_ca_keys"), + TRUNCATED_HMAC (0x0004, "truncated_hmac"), + + CH_STATUS_REQUEST (0x0005, "status_request", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_13, + CertStatusExtension.chNetworkProducer, + CertStatusExtension.chOnLoadConsumer, + null, + null, + null, + CertStatusExtension.certStatusReqStringizer), + SH_STATUS_REQUEST (0x0005, "status_request", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + CertStatusExtension.shNetworkProducer, + CertStatusExtension.shOnLoadConsumer, + null, + null, + null, + CertStatusExtension.certStatusReqStringizer), + + CR_STATUS_REQUEST (0x0005, "status_request"), + CT_STATUS_REQUEST (0x0005, "status_request", + SSLHandshake.CERTIFICATE, + ProtocolVersion.PROTOCOLS_OF_13, + CertStatusExtension.ctNetworkProducer, + CertStatusExtension.ctOnLoadConsumer, + null, + null, + null, + CertStatusExtension.certStatusRespStringizer), + // extensions defined in RFC 4681 + USER_MAPPING (0x0006, "user_mapping"), + + // extensions defined in RFC 5878 + CLIENT_AUTHZ (0x0007, "client_authz"), + SERVER_AUTHZ (0x0008, "server_authz"), + + // extensions defined in RFC 5081 + CERT_TYPE (0x0009, "cert_type"), + + // extensions defined in RFC 4492 (ECC) + CH_SUPPORTED_GROUPS (0x000A, "supported_groups", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_13, + SupportedGroupsExtension.chNetworkProducer, + SupportedGroupsExtension.chOnLoadConsumer, + null, + null, + null, + SupportedGroupsExtension.sgsStringizer), + EE_SUPPORTED_GROUPS (0x000A, "supported_groups", + SSLHandshake.ENCRYPTED_EXTENSIONS, + ProtocolVersion.PROTOCOLS_OF_13, + SupportedGroupsExtension.eeNetworkProducer, + SupportedGroupsExtension.eeOnLoadConsumer, + null, + null, + null, + SupportedGroupsExtension.sgsStringizer), + + CH_EC_POINT_FORMATS (0x000B, "ec_point_formats", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + ECPointFormatsExtension.chNetworkProducer, + ECPointFormatsExtension.chOnLoadConsumer, + null, + null, + null, + ECPointFormatsExtension.epfStringizer), + SH_EC_POINT_FORMATS (0x000B, "ec_point_formats", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + null, // not use of the producer + ECPointFormatsExtension.shOnLoadConsumer, + null, + null, + null, + ECPointFormatsExtension.epfStringizer), + + // extensions defined in RFC 5054 + SRP (0x000C, "srp"), + + // extensions defined in RFC 5246 + CH_SIGNATURE_ALGORITHMS (0x000D, "signature_algorithms", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_12_13, + SignatureAlgorithmsExtension.chNetworkProducer, + SignatureAlgorithmsExtension.chOnLoadConsumer, + SignatureAlgorithmsExtension.chOnLoadAbsence, + SignatureAlgorithmsExtension.chOnTradeConsumer, + SignatureAlgorithmsExtension.chOnTradeAbsence, + SignatureAlgorithmsExtension.ssStringizer), + CR_SIGNATURE_ALGORITHMS (0x000D, "signature_algorithms", + SSLHandshake.CERTIFICATE_REQUEST, + ProtocolVersion.PROTOCOLS_OF_13, + SignatureAlgorithmsExtension.crNetworkProducer, + SignatureAlgorithmsExtension.crOnLoadConsumer, + SignatureAlgorithmsExtension.crOnLoadAbsence, + SignatureAlgorithmsExtension.crOnTradeConsumer, + null, + SignatureAlgorithmsExtension.ssStringizer), + + CH_SIGNATURE_ALGORITHMS_CERT (0x0032, "signature_algorithms_cert", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_12_13, + CertSignAlgsExtension.chNetworkProducer, + CertSignAlgsExtension.chOnLoadConsumer, + null, + CertSignAlgsExtension.chOnTradeConsumer, + null, + CertSignAlgsExtension.ssStringizer), + CR_SIGNATURE_ALGORITHMS_CERT (0x0032, "signature_algorithms_cert", + SSLHandshake.CERTIFICATE_REQUEST, + ProtocolVersion.PROTOCOLS_OF_13, + CertSignAlgsExtension.crNetworkProducer, + CertSignAlgsExtension.crOnLoadConsumer, + null, + CertSignAlgsExtension.crOnTradeConsumer, + null, + CertSignAlgsExtension.ssStringizer), + + // extensions defined in RFC 5764 + USE_SRTP (0x000E, "use_srtp"), + + // extensions defined in RFC 6520 + HEARTBEAT (0x000E, "heartbeat"), + + // extension defined in RFC 7301 (ALPN) + CH_ALPN (0x0010, "application_layer_protocol_negotiation", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_13, + AlpnExtension.chNetworkProducer, + AlpnExtension.chOnLoadConsumer, + AlpnExtension.chOnLoadAbsence, + null, + null, + AlpnExtension.alpnStringizer), + SH_ALPN (0x0010, "application_layer_protocol_negotiation", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + AlpnExtension.shNetworkProducer, + AlpnExtension.shOnLoadConsumer, + AlpnExtension.shOnLoadAbsence, + null, + null, + AlpnExtension.alpnStringizer), + EE_ALPN (0x0010, "application_layer_protocol_negotiation", + SSLHandshake.ENCRYPTED_EXTENSIONS, + ProtocolVersion.PROTOCOLS_OF_13, + AlpnExtension.shNetworkProducer, + AlpnExtension.shOnLoadConsumer, + AlpnExtension.shOnLoadAbsence, + null, + null, + AlpnExtension.alpnStringizer), + + // extensions defined in RFC 6961 + CH_STATUS_REQUEST_V2 (0x0011, "status_request_v2", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + CertStatusExtension.chV2NetworkProducer, + CertStatusExtension.chV2OnLoadConsumer, + null, + null, + null, + CertStatusExtension.certStatusReqV2Stringizer), + SH_STATUS_REQUEST_V2 (0x0011, "status_request_v2", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + CertStatusExtension.shV2NetworkProducer, + CertStatusExtension.shV2OnLoadConsumer, + null, + null, + null, + CertStatusExtension.certStatusReqV2Stringizer), + + // extensions defined in RFC 6962 + SIGNED_CERT_TIMESTAMP (0x0012, "signed_certificate_timestamp"), + + // extensions defined in RFC 7250 + CLIENT_CERT_TYPE (0x0013, "padding"), + SERVER_CERT_TYPE (0x0014, "server_certificate_type"), + + // extensions defined in RFC 7685 + PADDING (0x0015, "client_certificate_type"), + + // extensions defined in RFC 7366 + ENCRYPT_THEN_MAC (0x0016, "encrypt_then_mac"), + + // extensions defined in RFC 7627 + CH_EXTENDED_MASTER_SECRET (0x0017, "extended_master_secret", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + ExtendedMasterSecretExtension.chNetworkProducer, + ExtendedMasterSecretExtension.chOnLoadConsumer, + ExtendedMasterSecretExtension.chOnLoadAbsence, + null, + null, + ExtendedMasterSecretExtension.emsStringizer), + SH_EXTENDED_MASTER_SECRET (0x0017, "extended_master_secret", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + ExtendedMasterSecretExtension.shNetworkProducer, + ExtendedMasterSecretExtension.shOnLoadConsumer, + ExtendedMasterSecretExtension.shOnLoadAbsence, + null, + null, + ExtendedMasterSecretExtension.emsStringizer), + + // extensions defined in RFC draft-ietf-tokbind-negotiation + TOKEN_BINDING (0x0018, "token_binding "), + + // extensions defined in RFC 7924 + CACHED_INFO (0x0019, "cached_info"), + + // extensions defined in RFC 4507/5077 + SESSION_TICKET (0x0023, "session_ticket"), + + // extensions defined in TLS 1.3 + CH_EARLY_DATA (0x002A, "early_data"), + EE_EARLY_DATA (0x002A, "early_data"), + NST_EARLY_DATA (0x002A, "early_data"), + + CH_SUPPORTED_VERSIONS (0x002B, "supported_versions", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_13, + SupportedVersionsExtension.chNetworkProducer, + SupportedVersionsExtension.chOnLoadConsumer, + null, + null, + null, + SupportedVersionsExtension.chStringizer), + SH_SUPPORTED_VERSIONS (0x002B, "supported_versions", + SSLHandshake.SERVER_HELLO, + // and HelloRetryRequest + ProtocolVersion.PROTOCOLS_OF_13, + SupportedVersionsExtension.shNetworkProducer, + SupportedVersionsExtension.shOnLoadConsumer, + null, + null, + null, + SupportedVersionsExtension.shStringizer), + HRR_SUPPORTED_VERSIONS (0x002B, "supported_versions", + SSLHandshake.HELLO_RETRY_REQUEST, + ProtocolVersion.PROTOCOLS_OF_13, + SupportedVersionsExtension.hrrNetworkProducer, + SupportedVersionsExtension.hrrOnLoadConsumer, + null, + null, + null, + SupportedVersionsExtension.hrrStringizer), + MH_SUPPORTED_VERSIONS (0x002B, "supported_versions", + SSLHandshake.MESSAGE_HASH, + ProtocolVersion.PROTOCOLS_OF_13, + SupportedVersionsExtension.hrrReproducer, + null, null, null, + null, + SupportedVersionsExtension.hrrStringizer), + + CH_COOKIE (0x002C, "cookie", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_OF_13, + CookieExtension.chNetworkProducer, + CookieExtension.chOnLoadConsumer, + null, + CookieExtension.chOnTradeConsumer, + null, + CookieExtension.cookieStringizer), + HRR_COOKIE (0x002C, "cookie", + SSLHandshake.HELLO_RETRY_REQUEST, + ProtocolVersion.PROTOCOLS_OF_13, + CookieExtension.hrrNetworkProducer, + CookieExtension.hrrOnLoadConsumer, + null, null, + null, + CookieExtension.cookieStringizer), + MH_COOKIE (0x002C, "cookie", + SSLHandshake.MESSAGE_HASH, + ProtocolVersion.PROTOCOLS_OF_13, + CookieExtension.hrrNetworkReproducer, + null, null, null, + null, + CookieExtension.cookieStringizer), + + PSK_KEY_EXCHANGE_MODES (0x002D, "psk_key_exchange_modes", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_OF_13, + PskKeyExchangeModesExtension.chNetworkProducer, + PskKeyExchangeModesExtension.chOnLoadConsumer, + PskKeyExchangeModesExtension.chOnLoadAbsence, + null, + PskKeyExchangeModesExtension.chOnTradeAbsence, + PskKeyExchangeModesExtension.pkemStringizer), + CERTIFICATE_AUTHORITIES (0x002F, "certificate_authorities"), + OID_FILTERS (0x0030, "oid_filters"), + POST_HANDSHAKE_AUTH (0x0030, "post_handshake_auth"), + + CH_KEY_SHARE (0x0033, "key_share", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_OF_13, + KeyShareExtension.chNetworkProducer, + KeyShareExtension.chOnLoadConsumer, + null, null, null, + KeyShareExtension.chStringizer), + SH_KEY_SHARE (0x0033, "key_share", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_OF_13, + KeyShareExtension.shNetworkProducer, + KeyShareExtension.shOnLoadConsumer, + KeyShareExtension.shOnLoadAbsence, + null, + null, + KeyShareExtension.shStringizer), + HRR_KEY_SHARE (0x0033, "key_share", + SSLHandshake.HELLO_RETRY_REQUEST, + ProtocolVersion.PROTOCOLS_OF_13, + KeyShareExtension.hrrNetworkProducer, + KeyShareExtension.hrrOnLoadConsumer, + null, null, null, + KeyShareExtension.hrrStringizer), + MH_KEY_SHARE (0x0033, "key_share", + SSLHandshake.MESSAGE_HASH, + ProtocolVersion.PROTOCOLS_OF_13, + KeyShareExtension.hrrNetworkReproducer, + null, null, null, null, + KeyShareExtension.hrrStringizer), + + // Extensions defined in RFC 5746 + CH_RENEGOTIATION_INFO (0xff01, "renegotiation_info", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + RenegoInfoExtension.chNetworkProducer, + RenegoInfoExtension.chOnLoadConsumer, + RenegoInfoExtension.chOnLoadAbsence, + null, + null, + RenegoInfoExtension.rniStringizer), + SH_RENEGOTIATION_INFO (0xff01, "renegotiation_info", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_TO_12, + RenegoInfoExtension.shNetworkProducer, + RenegoInfoExtension.shOnLoadConsumer, + RenegoInfoExtension.shOnLoadAbsence, + null, + null, + RenegoInfoExtension.rniStringizer), + + // TLS 1.3 PSK extension must be last + CH_PRE_SHARED_KEY (0x0029, "pre_shared_key", + SSLHandshake.CLIENT_HELLO, + ProtocolVersion.PROTOCOLS_OF_13, + PreSharedKeyExtension.chNetworkProducer, + PreSharedKeyExtension.chOnLoadConsumer, + PreSharedKeyExtension.chOnLoadAbsence, + PreSharedKeyExtension.chOnTradeConsumer, + null, + PreSharedKeyExtension.chStringizer), + SH_PRE_SHARED_KEY (0x0029, "pre_shared_key", + SSLHandshake.SERVER_HELLO, + ProtocolVersion.PROTOCOLS_OF_13, + PreSharedKeyExtension.shNetworkProducer, + PreSharedKeyExtension.shOnLoadConsumer, + PreSharedKeyExtension.shOnLoadAbsence, + null, null, + PreSharedKeyExtension.shStringizer); + + final int id; + final SSLHandshake handshakeType; + final String name; + final ProtocolVersion[] supportedProtocols; + final HandshakeProducer networkProducer; + final ExtensionConsumer onLoadConsumer; + final HandshakeAbsence onLoadAbsence; + final HandshakeConsumer onTradeConsumer; + final HandshakeAbsence onTradeAbsence; + final SSLStringizer stringizer; + + // known but unsupported extension + private SSLExtension(int id, String name) { + this.id = id; + this.handshakeType = SSLHandshake.NOT_APPLICABLE; + this.name = name; + this.supportedProtocols = new ProtocolVersion[0]; + this.networkProducer = null; + this.onLoadConsumer = null; + this.onLoadAbsence = null; + this.onTradeConsumer = null; + this.onTradeAbsence = null; + this.stringizer = null; + } + + // supported extension + private SSLExtension(int id, String name, SSLHandshake handshakeType, + ProtocolVersion[] supportedProtocols, + HandshakeProducer producer, + ExtensionConsumer onLoadConsumer, HandshakeAbsence onLoadAbsence, + HandshakeConsumer onTradeConsumer, HandshakeAbsence onTradeAbsence, + SSLStringizer stringize) { + this.id = id; + this.handshakeType = handshakeType; + this.name = name; + this.supportedProtocols = supportedProtocols; + this.networkProducer = producer; + this.onLoadConsumer = onLoadConsumer; + this.onLoadAbsence = onLoadAbsence; + this.onTradeConsumer = onTradeConsumer; + this.onTradeAbsence = onTradeAbsence; + this.stringizer = stringize; + } + + static SSLExtension valueOf(SSLHandshake handshakeType, int extensionType) { + for (SSLExtension ext : SSLExtension.values()) { + if (ext.id == extensionType && + ext.handshakeType == handshakeType) { + return ext; + } + } + + return null; + } + + static boolean isConsumable(int extensionType) { + for (SSLExtension ext : SSLExtension.values()) { + if (ext.id == extensionType && + ext.onLoadConsumer != null) { + return true; + } + } + + return false; + } + + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + if (networkProducer != null) { + return networkProducer.produce(context, message); + } else { + throw new UnsupportedOperationException( + "Not yet supported extension producing."); + } + } + + public void consumeOnLoad(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + if (onLoadConsumer != null) { + onLoadConsumer.consume(context, message, buffer); + } else { + throw new UnsupportedOperationException( + "Not yet supported extension loading."); + } + } + + public void consumeOnTrade(ConnectionContext context, + HandshakeMessage message) throws IOException { + if (onTradeConsumer != null) { + onTradeConsumer.consume(context, message); + } else { + throw new UnsupportedOperationException( + "Not yet supported extension processing."); + } + } + + void absentOnLoad(ConnectionContext context, + HandshakeMessage message) throws IOException { + if (onLoadAbsence != null) { + onLoadAbsence.absent(context, message); + } else { + throw new UnsupportedOperationException( + "Not yet supported extension absence processing."); + } + } + + void absentOnTrade(ConnectionContext context, + HandshakeMessage message) throws IOException { + if (onTradeAbsence != null) { + onTradeAbsence.absent(context, message); + } else { + throw new UnsupportedOperationException( + "Not yet supported extension absence processing."); + } + } + + public boolean isAvailable(ProtocolVersion protocolVersion) { + for (int i = 0; i < supportedProtocols.length; i++) { + if (supportedProtocols[i] == protocolVersion) { + return true; + } + } + + return false; + } + + @Override + public String toString() { + return name; + } + + @Override + public String toString(ByteBuffer byteBuffer) { + MessageFormat messageFormat = new MessageFormat( + "\"{0} ({1})\": '{'\n" + + "{2}\n" + + "'}'", + Locale.ENGLISH); + + String extData; + if (stringizer == null) { + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + String encoded = hexEncoder.encode(byteBuffer.duplicate()); + extData = encoded; + } else { + extData = stringizer.toString(byteBuffer); + } + + Object[] messageFields = { + this.name, + this.id, + Utilities.indent(extData) + }; + + return messageFormat.format(messageFields); + } + + ////////////////////////////////////////////////////// + // Nested extension, consumer and producer interfaces. + + static interface ExtensionConsumer { + void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException; + } + + /** + * A (transparent) specification of extension data. + * + * This interface contains no methods or constants. Its only purpose is to + * group all extension data. All extension data should implement this + * interface if the data is expected to handle in the following handshake + * processes. + */ + static interface SSLExtensionSpec { + // blank + } + + // Default enabled client extensions. + static final class ClientExtensions { + static final Collection<SSLExtension> defaults; + + static { + Collection<SSLExtension> extensions = new LinkedList<>(); + for (SSLExtension extension : SSLExtension.values()) { + if (extension.handshakeType != SSLHandshake.NOT_APPLICABLE) { + extensions.add(extension); + } + } + + // Switch off SNI extention? + boolean enableExtension = + Utilities.getBooleanProperty("jsse.enableSNIExtension", true); + if (!enableExtension) { + extensions.remove(CH_SERVER_NAME); + } + + // To switch off the max_fragment_length extension. + enableExtension = + Utilities.getBooleanProperty("jsse.enableMFLExtension", false); + if (!enableExtension) { + extensions.remove(CH_MAX_FRAGMENT_LENGTH); + } + + defaults = Collections.unmodifiableCollection(extensions); + } + } + + // Default enabled server extensions. + static final class ServerExtensions { + static final Collection<SSLExtension> defaults; + + static { + Collection<SSLExtension> extensions = new LinkedList<>(); + for (SSLExtension extension : SSLExtension.values()) { + if (extension.handshakeType != SSLHandshake.NOT_APPLICABLE) { + extensions.add(extension); + } + } + + defaults = Collections.unmodifiableCollection(extensions); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLExtensions.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,362 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.*; + +import sun.security.ssl.SSLHandshake.HandshakeMessage; +import sun.security.util.HexDumpEncoder; + +/** + * SSL/(D)TLS extensions in a handshake message. + */ +final class SSLExtensions { + private final HandshakeMessage handshakeMessage; + private Map<SSLExtension, byte[]> extMap = new LinkedHashMap<>(); + private int encodedLength; + + // Extension map for debug logging + private final Map<Integer, byte[]> logMap = + SSLLogger.isOn ? null : new LinkedHashMap<>(); + + SSLExtensions(HandshakeMessage handshakeMessage) { + this.handshakeMessage = handshakeMessage; + this.encodedLength = 2; // 2: the length of the extensions. + } + + SSLExtensions(HandshakeMessage hm, + ByteBuffer m, SSLExtension[] extensions) throws IOException { + this.handshakeMessage = hm; + + int len = Record.getInt16(m); + encodedLength = len + 2; // 2: the length of the extensions. + while (len > 0) { + int extId = Record.getInt16(m); + int extLen = Record.getInt16(m); + if (extLen > m.remaining()) { + hm.handshakeContext.conContext.fatal(Alert.ILLEGAL_PARAMETER, + "Error parsing extension (" + extId + + "): no sufficient data"); + } + + SSLHandshake handshakeType = hm.handshakeType(); + if (SSLExtension.isConsumable(extId) && + SSLExtension.valueOf(handshakeType, extId) == null) { + hm.handshakeContext.conContext.fatal( + Alert.UNSUPPORTED_EXTENSION, + "extension (" + extId + + ") should not be presented in " + handshakeType.name); + } + + boolean isSupported = false; + for (SSLExtension extension : extensions) { + if ((extension.id != extId) || + (extension.onLoadConsumer == null)) { + continue; + } + + if (extension.handshakeType != handshakeType) { + hm.handshakeContext.conContext.fatal( + Alert.UNSUPPORTED_EXTENSION, + "extension (" + extId + ") should not be " + + "presented in " + handshakeType.name); + } + + byte[] extData = new byte[extLen]; + m.get(extData); + extMap.put(extension, extData); + if (logMap != null) { + logMap.put(extId, extData); + } + + isSupported = true; + break; + } + + if (!isSupported) { + if (logMap != null) { + // cache the extension for debug logging + byte[] extData = new byte[extLen]; + m.get(extData); + logMap.put(extId, extData); + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unknown or unsupported extension", + toString(extId, extData)); + } + } else { + // ignore the extension + int pos = m.position() + extLen; + m.position(pos); + } + } + + len -= extLen + 4; + } + } + + byte[] get(SSLExtension ext) { + return extMap.get(ext); + } + + /** + * Consume the specified extensions. + */ + void consumeOnLoad(HandshakeContext context, + SSLExtension[] extensions) throws IOException { + for (SSLExtension extension : extensions) { + if (context.negotiatedProtocol != null && + !extension.isAvailable(context.negotiatedProtocol)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unsupported extension: " + extension.name); + } + continue; + } + + if (!extMap.containsKey(extension)) { + if (extension.onLoadAbsence != null) { + extension.absentOnLoad(context, handshakeMessage); + } else if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + extension.name); + } + continue; + } + + + if (extension.onLoadConsumer == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore unsupported extension: " + extension.name); + } + continue; + } + + ByteBuffer m = ByteBuffer.wrap(extMap.get(extension)); + extension.consumeOnLoad(context, handshakeMessage, m); + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Consumed extension: " + extension.name); + } + } + } + + /** + * Consider impact of the specified extensions. + */ + void consumeOnTrade(HandshakeContext context, + SSLExtension[] extensions) throws IOException { + for (SSLExtension extension : extensions) { + if (!extMap.containsKey(extension)) { + if (extension.onTradeAbsence != null) { + extension.absentOnTrade(context, handshakeMessage); + } else if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + extension.name); + } + continue; + } + + if (extension.onTradeConsumer == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore impact of unsupported extension: " + + extension.name); + } + continue; + } + + extension.consumeOnTrade(context, handshakeMessage); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Populated with extension: " + extension.name); + } + } + } + + /** + * Produce extension values for the specified extensions. + */ + void produce(HandshakeContext context, + SSLExtension[] extensions) throws IOException { + for (SSLExtension extension : extensions) { + if (extMap.containsKey(extension)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore, duplicated extension: " + + extension.name); + } + continue; + } + + if (extension.networkProducer == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore, no extension producer defined: " + + extension.name); + } + continue; + } + + byte[] encoded = extension.produce(context, handshakeMessage); + if (encoded != null) { + extMap.put(extension, encoded); + encodedLength += encoded.length + 4; // extension_type (2) + // extension_data length(2) + } else if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + // The extension is not available in the context. + SSLLogger.fine( + "Ignore, context unavailable extension: " + + extension.name); + } + } + } + + /** + * Produce extension values for the specified extensions, replacing if + * there is an existing extension value for a specified extension. + */ + void reproduce(HandshakeContext context, + SSLExtension[] extensions) throws IOException { + for (SSLExtension extension : extensions) { + if (extension.networkProducer == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore, no extension producer defined: " + + extension.name); + } + continue; + } + + byte[] encoded = extension.produce(context, handshakeMessage); + if (encoded != null) { + if (extMap.containsKey(extension)) { + byte[] old = extMap.replace(extension, encoded); + if (old != null) { + encodedLength -= old.length + 4; + } + encodedLength += encoded.length + 4; + } else { + extMap.put(extension, encoded); + encodedLength += encoded.length + 4; + // extension_type (2) + // extension_data length(2) + } + } else if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + // The extension is not available in the context. + SSLLogger.fine( + "Ignore, context unavailable extension: " + + extension.name); + } + } + } + + // Note that TLS 1.3 may use empty extensions. Please consider it while + // using this method. + int length() { + if (extMap.isEmpty()) { + return 0; + } else { + return encodedLength; + } + } + + // Note that TLS 1.3 may use empty extensions. Please consider it while + // using this method. + void send(HandshakeOutStream hos) throws IOException { + int extsLen = length(); + if (extsLen == 0) { + return; + } + hos.putInt16(extsLen - 2); + // extensions must be sent in the order they appear in the enum + for (SSLExtension ext : SSLExtension.values()) { + byte[] extData = extMap.get(ext); + if (extData != null) { + hos.putInt16(ext.id); + hos.putBytes16(extData); + } + } + } + + @Override + public String toString() { + if (extMap.isEmpty() && (logMap == null || logMap.isEmpty())) { + return "<no extension>"; + } else { + StringBuilder builder = new StringBuilder(512); + if (logMap != null) { + for (Map.Entry<Integer, byte[]> en : logMap.entrySet()) { + SSLExtension ext = SSLExtension.valueOf( + handshakeMessage.handshakeType(), en.getKey()); + if (builder.length() != 0) { + builder.append(",\n"); + } + if (ext != null) { + builder.append( + ext.toString(ByteBuffer.wrap(en.getValue()))); + } else { + builder.append(toString(en.getKey(), en.getValue())); + } + } + + return builder.toString(); + } else { + for (Map.Entry<SSLExtension, byte[]> en : extMap.entrySet()) { + if (builder.length() != 0) { + builder.append(",\n"); + } + builder.append( + en.getKey().toString(ByteBuffer.wrap(en.getValue()))); + } + + return builder.toString(); + } + } + } + + private static String toString(int extId, byte[] extData) { + MessageFormat messageFormat = new MessageFormat( + "\"unknown extension ({0})\": '{'\n" + + "{1}\n" + + "'}'", + Locale.ENGLISH); + + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + String encoded = hexEncoder.encodeBuffer(extData); + + Object[] messageFields = { + extId, + Utilities.indent(encoded) + }; + + return messageFormat.format(messageFields); + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLHandshakeBinding.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLHandshakeBinding.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLHandshakeBinding.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLHandshakeBinding.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.util.Map; + +interface SSLHandshakeBinding { + default SSLHandshake[] getRelatedHandshakers( + HandshakeContext handshakeContext) { + return new SSLHandshake[0]; + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + default Map.Entry<Byte, HandshakeProducer>[] getHandshakeProducers( + HandshakeContext handshakeContext) { + return (Map.Entry<Byte, HandshakeProducer>[])(new Map.Entry[0]); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + default Map.Entry<Byte, SSLConsumer>[] getHandshakeConsumers( + HandshakeContext handshakeContext) { + return (Map.Entry<Byte, SSLConsumer>[])(new Map.Entry[0]); + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLHandshake.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,550 @@ +/* + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.util.AbstractMap.SimpleImmutableEntry; +import java.util.Map; +import javax.net.ssl.SSLException; + +enum SSLHandshake implements SSLConsumer, HandshakeProducer { + @SuppressWarnings({"unchecked", "rawtypes"}) + HELLO_REQUEST ((byte)0x00, "hello_request", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + HelloRequest.handshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + HelloRequest.handshakeProducer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + CLIENT_HELLO ((byte)0x01, "client_hello", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + ClientHello.handshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + ClientHello.handshakeProducer, + ProtocolVersion.PROTOCOLS_TO_13 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + SERVER_HELLO ((byte)0x02, "server_hello", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + ServerHello.handshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + ServerHello.t12HandshakeProducer, + ProtocolVersion.PROTOCOLS_TO_12 + ), + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + ServerHello.t13HandshakeProducer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + HELLO_RETRY_REQUEST ((byte)0x02, "hello_retry_request", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + ServerHello.handshakeConsumer, // Use ServerHello consumer + ProtocolVersion.PROTOCOLS_TO_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + ServerHello.hrrHandshakeProducer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + HELLO_VERIFY_REQUEST ((byte)0x03, "hello_verify_request", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + HelloVerifyRequest.handshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + HelloVerifyRequest.handshakeProducer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + NEW_SESSION_TICKET ((byte)0x04, "new_session_ticket", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + NewSessionTicket.handshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + NewSessionTicket.handshakeProducer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + END_OF_EARLY_DATA ((byte)0x05, "end_of_early_data"), + + @SuppressWarnings({"unchecked", "rawtypes"}) + ENCRYPTED_EXTENSIONS ((byte)0x08, "encrypted_extensions", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + EncryptedExtensions.handshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + EncryptedExtensions.handshakeProducer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + CERTIFICATE ((byte)0x0B, "certificate", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateMessage.t12HandshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_12 + ), + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateMessage.t13HandshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateMessage.t12HandshakeProducer, + ProtocolVersion.PROTOCOLS_TO_12 + ), + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateMessage.t13HandshakeProducer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + SERVER_KEY_EXCHANGE ((byte)0x0C, "server_key_exchange", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + ServerKeyExchange.handshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + ServerKeyExchange.handshakeProducer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + CERTIFICATE_REQUEST ((byte)0x0D, "certificate_request", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateRequest.t10HandshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_11 + ), + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateRequest.t12HandshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_12 + ), + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateRequest.t13HandshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateRequest.t10HandshakeProducer, + ProtocolVersion.PROTOCOLS_TO_11 + ), + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateRequest.t12HandshakeProducer, + ProtocolVersion.PROTOCOLS_OF_12 + ), + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateRequest.t13HandshakeProducer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + SERVER_HELLO_DONE ((byte)0x0E, "server_hello_done", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + ServerHelloDone.handshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + ServerHelloDone.handshakeProducer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + CERTIFICATE_VERIFY ((byte)0x0F, "certificate_verify", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateVerify.s30HandshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_30 + ), + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateVerify.t10HandshakeConsumer, + ProtocolVersion.PROTOCOLS_10_11 + ), + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateVerify.t12HandshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_12 + ), + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateVerify.t13HandshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateVerify.s30HandshakeProducer, + ProtocolVersion.PROTOCOLS_OF_30 + ), + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateVerify.t10HandshakeProducer, + ProtocolVersion.PROTOCOLS_10_11 + ), + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateVerify.t12HandshakeProducer, + ProtocolVersion.PROTOCOLS_OF_12 + ), + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateVerify.t13HandshakeProducer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + CLIENT_KEY_EXCHANGE ((byte)0x10, "client_key_exchange", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + ClientKeyExchange.handshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + ClientKeyExchange.handshakeProducer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + })), + + @SuppressWarnings({"unchecked", "rawtypes"}) + FINISHED ((byte)0x14, "finished", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + Finished.t12HandshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_12 + ), + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + Finished.t13HandshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + Finished.t12HandshakeProducer, + ProtocolVersion.PROTOCOLS_TO_12 + ), + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + Finished.t13HandshakeProducer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + + CERTIFICATE_URL ((byte)0x15, "certificate_url"), + + @SuppressWarnings({"unchecked", "rawtypes"}) + CERTIFICATE_STATUS ((byte)0x16, "certificate_status", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + CertificateStatus.handshakeConsumer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + CertificateStatus.handshakeProducer, + ProtocolVersion.PROTOCOLS_TO_12 + ) + }), + (Map.Entry<HandshakeAbsence, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeAbsence, ProtocolVersion[]>( + CertificateStatus.handshakeAbsence, + ProtocolVersion.PROTOCOLS_TO_12 + ) + })), + + SUPPLEMENTAL_DATA ((byte)0x17, "supplemental_data"), + + @SuppressWarnings({"unchecked", "rawtypes"}) + KEY_UPDATE ((byte)0x18, "key_update", + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<SSLConsumer, ProtocolVersion[]>( + KeyUpdate.handshakeConsumer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + }), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])(new Map.Entry[] { + new SimpleImmutableEntry<HandshakeProducer, ProtocolVersion[]>( + KeyUpdate.handshakeProducer, + ProtocolVersion.PROTOCOLS_OF_13 + ) + })), + MESSAGE_HASH ((byte)0xFE, "message_hash"), + NOT_APPLICABLE ((byte)0xFF, "not_applicable"); + + final byte id; + final String name; + final Map.Entry<SSLConsumer, ProtocolVersion[]>[] handshakeConsumers; + final Map.Entry<HandshakeProducer, ProtocolVersion[]>[] handshakeProducers; + final Map.Entry<HandshakeAbsence, ProtocolVersion[]>[] handshakeAbsences; + + @SuppressWarnings({"unchecked", "rawtypes"}) + SSLHandshake(byte id, String name) { + this(id, name, + (Map.Entry<SSLConsumer, ProtocolVersion[]>[])( + new Map.Entry[0]), + (Map.Entry<HandshakeProducer, ProtocolVersion[]>[])( + new Map.Entry[0]), + (Map.Entry<HandshakeAbsence, ProtocolVersion[]>[])( + new Map.Entry[0])); + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + SSLHandshake(byte id, String name, + Map.Entry<SSLConsumer, ProtocolVersion[]>[] handshakeConsumers, + Map.Entry<HandshakeProducer, ProtocolVersion[]>[] handshakeProducers) { + this(id, name, handshakeConsumers, handshakeProducers, + (Map.Entry<HandshakeAbsence, ProtocolVersion[]>[])( + new Map.Entry[0])); + } + + SSLHandshake(byte id, String name, + Map.Entry<SSLConsumer, ProtocolVersion[]>[] handshakeConsumers, + Map.Entry<HandshakeProducer, ProtocolVersion[]>[] handshakeProducers, + Map.Entry<HandshakeAbsence, ProtocolVersion[]>[] handshakeAbsence) { + this.id = id; + this.name = name; + this.handshakeConsumers = handshakeConsumers; + this.handshakeProducers = handshakeProducers; + this.handshakeAbsences = handshakeAbsence; + } + + @Override + public void consume(ConnectionContext context, + ByteBuffer message) throws IOException { + SSLConsumer hc = getHandshakeConsumer(context); + if (hc != null) { + hc.consume(context, message); + } else { + throw new UnsupportedOperationException( + "Unsupported handshake consumer: " + this.name); + } + } + + private SSLConsumer getHandshakeConsumer(ConnectionContext context) { + if (handshakeConsumers.length == 0) { + return null; + } + + // The consuming happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + ProtocolVersion protocolVersion; + if ((hc.negotiatedProtocol == null) || + (hc.negotiatedProtocol == ProtocolVersion.NONE)) { + protocolVersion = hc.maximumActiveProtocol; + } else { + protocolVersion = hc.negotiatedProtocol; + } + + for (Map.Entry<SSLConsumer, + ProtocolVersion[]> phe : handshakeConsumers) { + for (ProtocolVersion pv : phe.getValue()) { + if (protocolVersion == pv) { + return phe.getKey(); + } + } + } + + return null; + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + HandshakeProducer hp = getHandshakeProducer(context); + if (hp != null) { + return hp.produce(context, message); + } else { + throw new UnsupportedOperationException( + "Unsupported handshake producer: " + this.name); + } + } + + private HandshakeProducer getHandshakeProducer( + ConnectionContext context) { + if (handshakeConsumers.length == 0) { + return null; + } + + // The consuming happens in handshake context only. + HandshakeContext hc = (HandshakeContext)context; + ProtocolVersion protocolVersion; + if ((hc.negotiatedProtocol == null) || + (hc.negotiatedProtocol == ProtocolVersion.NONE)) { + protocolVersion = hc.maximumActiveProtocol; + } else { + protocolVersion = hc.negotiatedProtocol; + } + + for (Map.Entry<HandshakeProducer, + ProtocolVersion[]> phe : handshakeProducers) { + for (ProtocolVersion pv : phe.getValue()) { + if (protocolVersion == pv) { + return phe.getKey(); + } + } + } + + return null; + } + + @Override + public String toString() { + return name; + } + + static String nameOf(byte id) { + // If two handshake message share the same handshake type, returns + // the first handshake message name. + // + // It is not a big issue at present as only ServerHello and + // HellRetryRequest share a handshake type. + for (SSLHandshake hs : SSLHandshake.values()) { + if (hs.id == id) { + return hs.name; + } + } + + return "UNKNOWN-HANDSHAKE-MESSAGE(" + id + ")"; + } + + static final void kickstart(HandshakeContext context) throws IOException { + if (context instanceof ClientHandshakeContext) { + // For initial handshaking, including session resumption, + // ClientHello message is used as the kickstart message. + // + // (D)TLS 1.2 and older protocols support renegotiation on existing + // connections. A ClientHello messages is used to kickstart the + // renegotiation. + // + // (D)TLS 1.3 forbids renegotiation. The post-handshake KeyUpdate + // message is used to update the sending cryptographic keys. + if (context.conContext.isNegotiated && + context.conContext.protocolVersion.useTLS13PlusSpec()) { + // Use KeyUpdate message for renegotiation. + KeyUpdate.kickstartProducer.produce(context); + } else { + // Using ClientHello message for the initial handshaking + // (including session resumption) or renegotiation. + // SSLHandshake.CLIENT_HELLO.produce(context); + ClientHello.kickstartProducer.produce(context); + } + } else { + // The server side can delivering kickstart message after the + // connection has established. + // + // (D)TLS 1.2 and older protocols use HelloRequest to begin a + // negotiation process anew. + // + // While (D)TLS 1.3 uses the post-handshake KeyUpdate message + // to update the sending cryptographic keys. + if (context.conContext.protocolVersion.useTLS13PlusSpec()) { + // Use KeyUpdate message for renegotiation. + KeyUpdate.kickstartProducer.produce(context); + } else { + // SSLHandshake.HELLO_REQUEST.produce(context); + HelloRequest.kickstartProducer.produce(context); + } + } + } + + /** + * A (transparent) specification of handshake message. + */ + static abstract class HandshakeMessage { + final HandshakeContext handshakeContext; + + HandshakeMessage(HandshakeContext handshakeContext) { + this.handshakeContext = handshakeContext; + } + + abstract SSLHandshake handshakeType(); + abstract int messageLength(); + abstract void send(HandshakeOutStream hos) throws IOException; + + void write(HandshakeOutStream hos) throws IOException { + int len = messageLength(); + if (len >= Record.OVERFLOW_OF_INT24) { + throw new SSLException("Handshake message is overflow" + + ", type = " + handshakeType() + ", len = " + len); + } + hos.write(handshakeType().id); + hos.putInt24(len); + send(hos); + hos.complete(); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyAgreementGenerator.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyAgreementGenerator.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyAgreementGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyAgreementGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; + +interface SSLKeyAgreementGenerator { + SSLKeyDerivation createKeyDerivation( + HandshakeContext context) throws IOException; +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyAgreement.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyAgreement.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyAgreement.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyAgreement.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +interface SSLKeyAgreement + extends SSLPossessionGenerator, SSLKeyAgreementGenerator, + SSLHandshakeBinding { + // blank +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyDerivationGenerator.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyDerivationGenerator.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyDerivationGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyDerivationGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import javax.crypto.SecretKey; + +interface SSLKeyDerivationGenerator { + SSLKeyDerivation createKeyDerivation(HandshakeContext context, + SecretKey secretKey) throws IOException; +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyDerivation.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyDerivation.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyDerivation.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyDerivation.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.security.spec.AlgorithmParameterSpec; +import javax.crypto.SecretKey; + +interface SSLKeyDerivation { + SecretKey deriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException; +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyExchange.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyExchange.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLKeyExchange.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLKeyExchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,596 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.util.AbstractMap.SimpleImmutableEntry; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; +import sun.security.ssl.DHKeyExchange.DHEPossession; +import sun.security.ssl.ECDHKeyExchange.ECDHEPossession; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.SupportedGroupsExtension.NamedGroupType; +import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; +import sun.security.ssl.X509Authentication.X509Possession; + +final class SSLKeyExchange implements SSLKeyAgreementGenerator, + SSLHandshakeBinding { + private final SSLAuthentication authentication; + private final SSLKeyAgreement keyAgreement; + + SSLKeyExchange(X509Authentication authentication, + SSLKeyAgreement keyAgreement) { + this.authentication = authentication; + this.keyAgreement = keyAgreement; + } + + SSLPossession[] createPossessions(HandshakeContext context) { + // authentication + SSLPossession authPossession = null; + if (authentication != null) { + authPossession = authentication.createPossession(context); + if (authPossession == null) { + return new SSLPossession[0]; + } else if (context instanceof ServerHandshakeContext) { + // The authentication information may be used further for + // key agreement parameters negotiation. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + shc.interimAuthn = authPossession; + } + } + + // key agreement + SSLPossession kaPossession; + if (keyAgreement == T12KeyAgreement.RSA_EXPORT) { + // a special case + X509Possession x509Possession = (X509Possession)authPossession; + if (JsseJce.getRSAKeyLength( + x509Possession.popCerts[0].getPublicKey()) > 512) { + kaPossession = keyAgreement.createPossession(context); + + if (kaPossession == null) { + return new SSLPossession[0]; + } else { + return authentication != null ? + new SSLPossession[] {authPossession, kaPossession} : + new SSLPossession[] {kaPossession}; + } + } else { + return authentication != null ? + new SSLPossession[] {authPossession} : + new SSLPossession[0]; + } + } else { + kaPossession = keyAgreement.createPossession(context); + if (kaPossession == null) { + // special cases + if (keyAgreement == T12KeyAgreement.RSA || + keyAgreement == T12KeyAgreement.ECDH) { + return authentication != null ? + new SSLPossession[] {authPossession} : + new SSLPossession[0]; + } else { + return new SSLPossession[0]; + } + } else { + return authentication != null ? + new SSLPossession[] {authPossession, kaPossession} : + new SSLPossession[] {kaPossession}; + } + } + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext handshakeContext) throws IOException { + return keyAgreement.createKeyDerivation(handshakeContext); + } + + @Override + public SSLHandshake[] getRelatedHandshakers( + HandshakeContext handshakeContext) { + SSLHandshake[] auHandshakes; + if (authentication != null) { + auHandshakes = + authentication.getRelatedHandshakers(handshakeContext); + } else { + auHandshakes = null; + } + + SSLHandshake[] kaHandshakes = + keyAgreement.getRelatedHandshakers(handshakeContext); + + if (auHandshakes == null || auHandshakes.length == 0) { + return kaHandshakes; + } else if (kaHandshakes == null || kaHandshakes.length == 0) { + return auHandshakes; + } else { + SSLHandshake[] producers = Arrays.copyOf( + auHandshakes, auHandshakes.length + kaHandshakes.length); + System.arraycopy(kaHandshakes, 0, + producers, auHandshakes.length, kaHandshakes.length); + return producers; + } + } + + @Override + public Map.Entry<Byte, HandshakeProducer>[] getHandshakeProducers( + HandshakeContext handshakeContext) { + Map.Entry<Byte, HandshakeProducer>[] auProducers; + if (authentication != null) { + auProducers = + authentication.getHandshakeProducers(handshakeContext); + } else { + auProducers = null; + } + + Map.Entry<Byte, HandshakeProducer>[] kaProducers = + keyAgreement.getHandshakeProducers(handshakeContext); + + if (auProducers == null || auProducers.length == 0) { + return kaProducers; + } else if (kaProducers == null || kaProducers.length == 0) { + return auProducers; + } else { + Map.Entry<Byte, HandshakeProducer>[] producers = Arrays.copyOf( + auProducers, auProducers.length + kaProducers.length); + System.arraycopy(kaProducers, 0, + producers, auProducers.length, kaProducers.length); + return producers; + } + } + + @Override + public Map.Entry<Byte, SSLConsumer>[] getHandshakeConsumers( + HandshakeContext handshakeContext) { + Map.Entry<Byte, SSLConsumer>[] auConsumers; + if (authentication != null) { + auConsumers = + authentication.getHandshakeConsumers(handshakeContext); + } else { + auConsumers = null; + } + + Map.Entry<Byte, SSLConsumer>[] kaConsumers = + keyAgreement.getHandshakeConsumers(handshakeContext); + + if (auConsumers == null || auConsumers.length == 0) { + return kaConsumers; + } else if (kaConsumers == null || kaConsumers.length == 0) { + return auConsumers; + } else { + Map.Entry<Byte, SSLConsumer>[] producers = Arrays.copyOf( + auConsumers, auConsumers.length + kaConsumers.length); + System.arraycopy(kaConsumers, 0, + producers, auConsumers.length, kaConsumers.length); + return producers; + } + } + + // SSL 3.0 - (D)TLS 1.2 + static SSLKeyExchange valueOf( + CipherSuite.KeyExchange keyExchange, + ProtocolVersion protocolVersion) { + if (keyExchange == null || protocolVersion == null) { + return null; + } + + switch (keyExchange) { + case K_RSA: + return SSLKeyExRSA.KE; + case K_RSA_EXPORT: + return SSLKeyExRSAExport.KE; + case K_DHE_DSS: + return SSLKeyExDHEDSS.KE; + case K_DHE_DSS_EXPORT: + return SSLKeyExDHEDSSExport.KE; + case K_DHE_RSA: + if (protocolVersion.useTLS12PlusSpec()) { // (D)TLS 1.2 + return SSLKeyExDHERSAOrPSS.KE; + } else { // SSL 3.0, TLS 1.0/1.1 + return SSLKeyExDHERSA.KE; + } + case K_DHE_RSA_EXPORT: + return SSLKeyExDHERSAExport.KE; + case K_DH_ANON: + return SSLKeyExDHANON.KE; + case K_DH_ANON_EXPORT: + return SSLKeyExDHANONExport.KE; + case K_ECDH_ECDSA: + return SSLKeyExECDHECDSA.KE; + case K_ECDH_RSA: + return SSLKeyExECDHRSA.KE; + case K_ECDHE_ECDSA: + return SSLKeyExECDHEECDSA.KE; + case K_ECDHE_RSA: + if (protocolVersion.useTLS12PlusSpec()) { // (D)TLS 1.2 + return SSLKeyExECDHERSAOrPSS.KE; + } else { // SSL 3.0, TLS 1.0/1.1 + return SSLKeyExECDHERSA.KE; + } + case K_ECDH_ANON: + return SSLKeyExECDHANON.KE; + } + + return null; + } + + // TLS 1.3 + static SSLKeyExchange valueOf(NamedGroup namedGroup) { + SSLKeyAgreement ka = T13KeyAgreement.valueOf(namedGroup); + if (ka != null) { + return new SSLKeyExchange( + null, T13KeyAgreement.valueOf(namedGroup)); + } + + return null; + } + + private static class SSLKeyExRSA { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.RSA, T12KeyAgreement.RSA); + } + + private static class SSLKeyExRSAExport { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.RSA, T12KeyAgreement.RSA_EXPORT); + } + + private static class SSLKeyExDHEDSS { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.DSA, T12KeyAgreement.DHE); + } + + private static class SSLKeyExDHEDSSExport { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.DSA, T12KeyAgreement.DHE_EXPORT); + } + + private static class SSLKeyExDHERSA { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.RSA, T12KeyAgreement.DHE); + } + + private static class SSLKeyExDHERSAOrPSS { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.RSA_OR_PSS, T12KeyAgreement.DHE); + } + + private static class SSLKeyExDHERSAExport { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.RSA, T12KeyAgreement.DHE_EXPORT); + } + + private static class SSLKeyExDHANON { + private static SSLKeyExchange KE = new SSLKeyExchange( + null, T12KeyAgreement.DHE); + } + + private static class SSLKeyExDHANONExport { + private static SSLKeyExchange KE = new SSLKeyExchange( + null, T12KeyAgreement.DHE_EXPORT); + } + + private static class SSLKeyExECDHECDSA { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.EC, T12KeyAgreement.ECDH); + } + + private static class SSLKeyExECDHRSA { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.EC, T12KeyAgreement.ECDH); + } + + private static class SSLKeyExECDHEECDSA { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.EC, T12KeyAgreement.ECDHE); + } + + private static class SSLKeyExECDHERSA { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.RSA, T12KeyAgreement.ECDHE); + } + + private static class SSLKeyExECDHERSAOrPSS { + private static SSLKeyExchange KE = new SSLKeyExchange( + X509Authentication.RSA_OR_PSS, T12KeyAgreement.ECDHE); + } + + private static class SSLKeyExECDHANON { + private static SSLKeyExchange KE = new SSLKeyExchange( + null, T12KeyAgreement.ECDHE); + } + + private enum T12KeyAgreement implements SSLKeyAgreement { + RSA ("rsa", null, + RSAKeyExchange.kaGenerator), + RSA_EXPORT ("rsa_export", RSAKeyExchange.poGenerator, + RSAKeyExchange.kaGenerator), + DHE ("dhe", DHKeyExchange.poGenerator, + DHKeyExchange.kaGenerator), + DHE_EXPORT ("dhe_export", DHKeyExchange.poExportableGenerator, + DHKeyExchange.kaGenerator), + ECDH ("ecdh", null, + ECDHKeyExchange.ecdhKAGenerator), + ECDHE ("ecdhe", ECDHKeyExchange.poGenerator, + ECDHKeyExchange.ecdheKAGenerator); + + final String name; + final SSLPossessionGenerator possessionGenerator; + final SSLKeyAgreementGenerator keyAgreementGenerator; + + T12KeyAgreement(String name, + SSLPossessionGenerator possessionGenerator, + SSLKeyAgreementGenerator keyAgreementGenerator) { + this.name = name; + this.possessionGenerator = possessionGenerator; + this.keyAgreementGenerator = keyAgreementGenerator; + } + + @Override + public SSLPossession createPossession(HandshakeContext context) { + if (possessionGenerator != null) { + return possessionGenerator.createPossession(context); + } + + return null; + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext context) throws IOException { + return keyAgreementGenerator.createKeyDerivation(context); + } + + @Override + public SSLHandshake[] getRelatedHandshakers( + HandshakeContext handshakeContext) { + if (!handshakeContext.negotiatedProtocol.useTLS13PlusSpec()) { + if (this.possessionGenerator != null) { + return new SSLHandshake[] { + SSLHandshake.SERVER_KEY_EXCHANGE + }; + } + } + + return new SSLHandshake[0]; + } + + @Override + @SuppressWarnings({"unchecked", "rawtypes"}) + public Map.Entry<Byte, HandshakeProducer>[] getHandshakeProducers( + HandshakeContext handshakeContext) { + if (handshakeContext.negotiatedProtocol.useTLS13PlusSpec()) { + return (Map.Entry<Byte, HandshakeProducer>[])(new Map.Entry[0]); + } + + if (handshakeContext.sslConfig.isClientMode) { + switch (this) { + case RSA: + case RSA_EXPORT: + return (Map.Entry<Byte, + HandshakeProducer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.CLIENT_KEY_EXCHANGE.id, + RSAClientKeyExchange.rsaHandshakeProducer + ) + }); + + case DHE: + case DHE_EXPORT: + return (Map.Entry<Byte, + HandshakeProducer>[])(new Map.Entry[] { + new SimpleImmutableEntry<Byte, HandshakeProducer>( + SSLHandshake.CLIENT_KEY_EXCHANGE.id, + DHClientKeyExchange.dhHandshakeProducer + ) + }); + + case ECDH: + return (Map.Entry<Byte, + HandshakeProducer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.CLIENT_KEY_EXCHANGE.id, + ECDHClientKeyExchange.ecdhHandshakeProducer + ) + }); + + case ECDHE: + return (Map.Entry<Byte, + HandshakeProducer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.CLIENT_KEY_EXCHANGE.id, + ECDHClientKeyExchange.ecdheHandshakeProducer + ) + }); + } + } else { + switch (this) { + case RSA_EXPORT: + return (Map.Entry<Byte, + HandshakeProducer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.SERVER_KEY_EXCHANGE.id, + RSAServerKeyExchange.rsaHandshakeProducer + ) + }); + + case DHE: + case DHE_EXPORT: + return (Map.Entry<Byte, + HandshakeProducer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.SERVER_KEY_EXCHANGE.id, + DHServerKeyExchange.dhHandshakeProducer + ) + }); + + case ECDHE: + return (Map.Entry<Byte, + HandshakeProducer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.SERVER_KEY_EXCHANGE.id, + ECDHServerKeyExchange.ecdheHandshakeProducer + ) + }); + } + } + + return (Map.Entry<Byte, HandshakeProducer>[])(new Map.Entry[0]); + } + + @Override + @SuppressWarnings({"unchecked", "rawtypes"}) + public Map.Entry<Byte, SSLConsumer>[] getHandshakeConsumers( + HandshakeContext handshakeContext) { + if (handshakeContext.negotiatedProtocol.useTLS13PlusSpec()) { + return (Map.Entry<Byte, SSLConsumer>[])(new Map.Entry[0]); + } + + if (handshakeContext.sslConfig.isClientMode) { + switch (this) { + case RSA_EXPORT: + return (Map.Entry<Byte, + SSLConsumer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.SERVER_KEY_EXCHANGE.id, + RSAServerKeyExchange.rsaHandshakeConsumer + ) + }); + + case DHE: + case DHE_EXPORT: + return (Map.Entry<Byte, + SSLConsumer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.SERVER_KEY_EXCHANGE.id, + DHServerKeyExchange.dhHandshakeConsumer + ) + }); + + case ECDHE: + return (Map.Entry<Byte, + SSLConsumer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.SERVER_KEY_EXCHANGE.id, + ECDHServerKeyExchange.ecdheHandshakeConsumer + ) + }); + } + } else { + switch (this) { + case RSA: + case RSA_EXPORT: + return (Map.Entry<Byte, + SSLConsumer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.CLIENT_KEY_EXCHANGE.id, + RSAClientKeyExchange.rsaHandshakeConsumer + ) + }); + + case DHE: + case DHE_EXPORT: + return (Map.Entry<Byte, + SSLConsumer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.CLIENT_KEY_EXCHANGE.id, + DHClientKeyExchange.dhHandshakeConsumer + ) + }); + + case ECDH: + return (Map.Entry<Byte, + SSLConsumer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.CLIENT_KEY_EXCHANGE.id, + ECDHClientKeyExchange.ecdhHandshakeConsumer + ) + }); + + case ECDHE: + return (Map.Entry<Byte, + SSLConsumer>[])(new Map.Entry[] { + new SimpleImmutableEntry<>( + SSLHandshake.CLIENT_KEY_EXCHANGE.id, + ECDHClientKeyExchange.ecdheHandshakeConsumer + ) + }); + } + } + + return (Map.Entry<Byte, SSLConsumer>[])(new Map.Entry[0]); + } + } + + private static final class T13KeyAgreement implements SSLKeyAgreement { + private final NamedGroup namedGroup; + static final Map<NamedGroup, T13KeyAgreement> + supportedKeyShares = new HashMap<>(); + + static { + for (NamedGroup namedGroup : + SupportedGroups.supportedNamedGroups) { + supportedKeyShares.put( + namedGroup, new T13KeyAgreement(namedGroup)); + } + } + + private T13KeyAgreement(NamedGroup namedGroup) { + this.namedGroup = namedGroup; + } + + static T13KeyAgreement valueOf(NamedGroup namedGroup) { + return supportedKeyShares.get(namedGroup); + } + + @Override + public SSLPossession createPossession(HandshakeContext hc) { + if (namedGroup.type == NamedGroupType.NAMED_GROUP_ECDHE) { + return new ECDHEPossession( + namedGroup, hc.sslContext.getSecureRandom()); + } else if (namedGroup.type == NamedGroupType.NAMED_GROUP_FFDHE) { + return new DHEPossession( + namedGroup, hc.sslContext.getSecureRandom()); + } + + return null; + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext hc) throws IOException { + if (namedGroup.type == NamedGroupType.NAMED_GROUP_ECDHE) { + return ECDHKeyExchange.ecdheKAGenerator.createKeyDerivation(hc); + } else if (namedGroup.type == NamedGroupType.NAMED_GROUP_FFDHE) { + return DHKeyExchange.kaGenerator.createKeyDerivation(hc); + } + + return null; + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLLogger.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLLogger.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLLogger.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLLogger.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,596 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.PrintStream; +import java.lang.System.Logger; +import java.lang.System.Logger.Level; +import java.nio.ByteBuffer; +import java.security.cert.Certificate; +import java.security.cert.Extension; +import java.security.cert.X509Certificate; +import java.text.MessageFormat; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.Locale; +import java.util.Map; +import java.util.ResourceBundle; +import sun.security.action.GetPropertyAction; +import sun.security.util.HexDumpEncoder; +import sun.security.x509.*; + +/** + * Implementation of SSL logger. + * + * If the system property "javax.net.debug" is not defined, the debug logging + * is turned off. If the system property "javax.net.debug" is defined as + * empty, the debug logger is specified by System.getLogger("javax.net.ssl"), + * and applications can customize and configure the logger or use external + * logging mechanisms. If the system property "javax.net.debug" is defined + * and non-empty, a private debug logger implemented in this class is used. + */ +public final class SSLLogger { + private static final System.Logger logger; + private static final String property; + public static final boolean isOn; + + static { + String p = GetPropertyAction.privilegedGetProperty("javax.net.debug"); + if (p != null) { + if (p.isEmpty()) { + property = ""; + logger = System.getLogger("javax.net.ssl"); + } else { + property = p.toLowerCase(Locale.ENGLISH); + if (property.equals("help")) { + help(); + } + + logger = new SSLConsoleLogger("javax.net.ssl", p); + } + isOn = true; + } else { + property = null; + logger = null; + isOn = false; + } + } + + private static void help() { + System.err.println(); + System.err.println("help print the help messages"); + System.err.println("expand expand debugging information"); + System.err.println(); + System.err.println("all turn on all debugging"); + System.err.println("ssl turn on ssl debugging"); + System.err.println(); + System.err.println("The following can be used with ssl:"); + System.err.println("\trecord enable per-record tracing"); + System.err.println("\thandshake print each handshake message"); + System.err.println("\tkeygen print key generation data"); + System.err.println("\tsession print session activity"); + System.err.println("\tdefaultctx print default SSL initialization"); + System.err.println("\tsslctx print SSLContext tracing"); + System.err.println("\tsessioncache print session cache tracing"); + System.err.println("\tkeymanager print key manager tracing"); + System.err.println("\ttrustmanager print trust manager tracing"); + System.err.println("\tpluggability print pluggability tracing"); + System.err.println(); + System.err.println("\thandshake debugging can be widened with:"); + System.err.println("\tdata hex dump of each handshake message"); + System.err.println("\tverbose verbose handshake message printing"); + System.err.println(); + System.err.println("\trecord debugging can be widened with:"); + System.err.println("\tplaintext hex dump of record plaintext"); + System.err.println("\tpacket print raw SSL/TLS packets"); + System.err.println(); + System.exit(0); + } + + /** + * Return true if the "javax.net.debug" property contains the + * debug check points, or System.Logger is used. + */ + public static boolean isOn(String checkPoints) { + if (property == null) { // debugging is turned off + return false; + } else if (property.isEmpty()) { // use System.Logger + return true; + } // use provider logger + + String[] options = checkPoints.split(","); + for (String option : options) { + option = option.trim(); + if (!SSLLogger.hasOption(option)) { + return false; + } + } + + return true; + } + + private static boolean hasOption(String option) { + option = option.toLowerCase(Locale.ENGLISH); + if (property.contains("all")) { + return true; + } else { + int offset = property.indexOf("ssl"); + if (offset != -1 && property.indexOf("sslctx", offset) != -1) { + // don't enable data and plaintext options by default + if (!(option.equals("data") + || option.equals("packet") + || option.equals("plaintext"))) { + return true; + } + } + } + + return property.contains(option); + } + + public static void severe(String msg, Object... params) { + SSLLogger.log(Level.ERROR, msg, params); + } + + public static void warning(String msg, Object... params) { + SSLLogger.log(Level.WARNING, msg, params); + } + + public static void info(String msg, Object... params) { + SSLLogger.log(Level.INFO, msg, params); + } + + public static void fine(String msg, Object... params) { + SSLLogger.log(Level.DEBUG, msg, params); + } + + public static void finer(String msg, Object... params) { + SSLLogger.log(Level.TRACE, msg, params); + } + + public static void finest(String msg, Object... params) { + SSLLogger.log(Level.ALL, msg, params); + } + + private static void log(Level level, String msg, Object... params) { + if (logger.isLoggable(level)) { + if (params == null || params.length == 0) { + logger.log(level, msg); + } else { + try { + String formatted = + SSLSimpleFormatter.formatParameters(params); + logger.log(level, msg, formatted); + } catch (Exception exp) { + // ignore it, just for debugging. + } + } + } + } + + static String toString(Object... params) { + try { + return SSLSimpleFormatter.formatParameters(params); + } catch (Exception exp) { + return "unexpected exception thrown: " + exp.getMessage(); + } + } + + private static class SSLConsoleLogger implements Logger { + private final String loggerName; + private final boolean useCompactFormat; + + SSLConsoleLogger(String loggerName, String options) { + this.loggerName = loggerName; + options = options.toLowerCase(Locale.ENGLISH); + this.useCompactFormat = !options.contains("expand"); + } + + @Override + public String getName() { + return loggerName; + } + + @Override + public boolean isLoggable(Level level) { + return (level != Level.OFF); + } + + @Override + public void log(Level level, + ResourceBundle rb, String message, Throwable thrwbl) { + if (isLoggable(level)) { + try { + String formatted = + SSLSimpleFormatter.format(this, level, message, thrwbl); + System.err.write(formatted.getBytes("UTF-8")); + } catch (Exception exp) { + // ignore it, just for debugging. + } + } + } + + @Override + public void log(Level level, + ResourceBundle rb, String message, Object... params) { + if (isLoggable(level)) { + try { + String formatted = + SSLSimpleFormatter.format(this, level, message, params); + System.err.write(formatted.getBytes("UTF-8")); + } catch (Exception exp) { + // ignore it, just for debugging. + } + } + } + } + + private static class SSLSimpleFormatter { + private static final ThreadLocal<SimpleDateFormat> dateFormat = + new ThreadLocal<SimpleDateFormat>() { + @Override protected SimpleDateFormat initialValue() { + return new SimpleDateFormat( + "yyyy-MM-dd kk:mm:ss.SSS z", Locale.ENGLISH); + } + }; + + private static final MessageFormat basicCertFormat = new MessageFormat( + "\"version\" : \"v{0}\",\n" + + "\"serial number\" : \"{1}\",\n" + + "\"signature algorithm\": \"{2}\",\n" + + "\"issuer\" : \"{3}\",\n" + + "\"not before\" : \"{4}\",\n" + + "\"not after\" : \"{5}\",\n" + + "\"subject\" : \"{6}\",\n" + + "\"subject public key\" : \"{7}\"\n", + Locale.ENGLISH); + + private static final MessageFormat extendedCertFormart = + new MessageFormat( + "\"version\" : \"v{0}\",\n" + + "\"serial number\" : \"{1}\",\n" + + "\"signature algorithm\": \"{2}\",\n" + + "\"issuer\" : \"{3}\",\n" + + "\"not before\" : \"{4}\",\n" + + "\"not after\" : \"{5}\",\n" + + "\"subject\" : \"{6}\",\n" + + "\"subject public key\" : \"{7}\",\n" + + "\"extensions\" : [\n" + + "{8}\n" + + "]\n", + Locale.ENGLISH); + + // + // private static MessageFormat certExtFormat = new MessageFormat( + // "{0} [{1}] '{'\n" + + // " critical: {2}\n" + + // " value: {3}\n" + + // "'}'", + // Locale.ENGLISH); + // + + private static final MessageFormat messageFormatNoParas = + new MessageFormat( + "'{'\n" + + " \"logger\" : \"{0}\",\n" + + " \"level\" : \"{1}\",\n" + + " \"thread id\" : \"{2}\",\n" + + " \"thread name\" : \"{3}\",\n" + + " \"time\" : \"{4}\",\n" + + " \"caller\" : \"{5}\",\n" + + " \"message\" : \"{6}\"\n" + + "'}'\n", + Locale.ENGLISH); + + private static final MessageFormat messageCompactFormatNoParas = + new MessageFormat( + "{0}|{1}|{2}|{3}|{4}|{5}|{6}\n", + Locale.ENGLISH); + + private static final MessageFormat messageFormatWithParas = + new MessageFormat( + "'{'\n" + + " \"logger\" : \"{0}\",\n" + + " \"level\" : \"{1}\",\n" + + " \"thread id\" : \"{2}\",\n" + + " \"thread name\" : \"{3}\",\n" + + " \"time\" : \"{4}\",\n" + + " \"caller\" : \"{5}\",\n" + + " \"message\" : \"{6}\",\n" + + " \"specifics\" : [\n" + + "{7}\n" + + " ]\n" + + "'}'\n", + Locale.ENGLISH); + + private static final MessageFormat messageCompactFormatWithParas = + new MessageFormat( + "{0}|{1}|{2}|{3}|{4}|{5}|{6} (\n" + + "{7}\n" + + ")\n", + Locale.ENGLISH); + + private static final MessageFormat keyObjectFormat = new MessageFormat( + "\"{0}\" : '{'\n" + + "{1}" + + "'}'\n", + Locale.ENGLISH); + + // INFO: [TH: 123450] 2011-08-20 23:12:32.3225 PDT + // log message + // log message + // ... + private static String format(SSLConsoleLogger logger, Level level, + String message, Object ... parameters) { + + if (parameters == null || parameters.length == 0) { + Object[] messageFields = { + logger.loggerName, + level.getName(), + Utilities.toHexString(Thread.currentThread().getId()), + Thread.currentThread().getName(), + dateFormat.get().format(new Date(System.currentTimeMillis())), + formatCaller(), + message + }; + + if (logger.useCompactFormat) { + return messageCompactFormatNoParas.format(messageFields); + } else { + return messageFormatNoParas.format(messageFields); + } + } + + Object[] messageFields = { + logger.loggerName, + level.getName(), + Utilities.toHexString(Thread.currentThread().getId()), + Thread.currentThread().getName(), + dateFormat.get().format(new Date(System.currentTimeMillis())), + formatCaller(), + message, + (logger.useCompactFormat ? + formatParameters(parameters) : + Utilities.indent(formatParameters(parameters))) + }; + + if (logger.useCompactFormat) { + return messageCompactFormatWithParas.format(messageFields); + } else { + return messageFormatWithParas.format(messageFields); + } + } + + private static String formatCaller() { + return StackWalker.getInstance().walk(s -> + s.dropWhile(f -> + f.getClassName().startsWith("sun.security.ssl.SSLLogger") || + f.getClassName().startsWith("java.lang.System")) + .map(f -> f.getFileName() + ":" + f.getLineNumber()) + .findFirst().orElse("unknown caller")); + } + + private static String formatParameters(Object ... parameters) { + StringBuilder builder = new StringBuilder(512); + boolean isFirst = true; + for (Object parameter : parameters) { + if (isFirst) { + isFirst = false; + } else { + builder.append(",\n"); + } + + if (parameter instanceof Throwable) { + builder.append(formatThrowable((Throwable)parameter)); + } else if (parameter instanceof Certificate) { + builder.append(formatCertificate((Certificate)parameter)); + } else if (parameter instanceof ByteArrayInputStream) { + builder.append(formatByteArrayInputStream( + (ByteArrayInputStream)parameter)); + } else if (parameter instanceof ByteBuffer) { + builder.append(formatByteBuffer((ByteBuffer)parameter)); + } else if (parameter instanceof byte[]) { + builder.append(formatByteArrayInputStream( + new ByteArrayInputStream((byte[])parameter))); + } else if (parameter instanceof Map.Entry) { + @SuppressWarnings("unchecked") + Map.Entry<String, ?> mapParameter = + (Map.Entry<String, ?>)parameter; + builder.append(formatMapEntry(mapParameter)); + } else { + builder.append(formatObject(parameter)); + } + } + + return builder.toString(); + } + + // "throwable": { + // ... + // } + private static String formatThrowable(Throwable throwable) { + StringBuilder builder = new StringBuilder(512); + ByteArrayOutputStream bytesOut = new ByteArrayOutputStream(); + try (PrintStream out = new PrintStream(bytesOut)) { + throwable.printStackTrace(out); + builder.append(Utilities.indent(bytesOut.toString())); + } + Object[] fields = { + "throwable", + builder.toString() + }; + + return keyObjectFormat.format(fields); + } + + // "certificate": { + // ... + // } + private static String formatCertificate(Certificate certificate) { + + if (!(certificate instanceof X509Certificate)) { + return Utilities.indent(certificate.toString()); + } + + StringBuilder builder = new StringBuilder(512); + try { + X509CertImpl x509 = + X509CertImpl.toImpl((X509Certificate)certificate); + X509CertInfo certInfo = + (X509CertInfo)x509.get(X509CertImpl.NAME + "." + + X509CertImpl.INFO); + CertificateExtensions certExts = (CertificateExtensions) + certInfo.get(X509CertInfo.EXTENSIONS); + if (certExts == null) { + Object[] certFields = { + x509.getVersion(), + Utilities.toHexString( + x509.getSerialNumber().toByteArray()), + x509.getSigAlgName(), + x509.getIssuerX500Principal().toString(), + dateFormat.get().format(x509.getNotBefore()), + dateFormat.get().format(x509.getNotAfter()), + x509.getSubjectX500Principal().toString(), + x509.getPublicKey().getAlgorithm() + }; + builder.append(Utilities.indent( + basicCertFormat.format(certFields))); + } else { + StringBuilder extBuilder = new StringBuilder(512); + boolean isFirst = true; + for (Extension certExt : certExts.getAllExtensions()) { + if (isFirst) { + isFirst = false; + } else { + extBuilder.append(",\n"); + } + extBuilder.append("{\n" + + Utilities.indent(certExt.toString()) + "\n}"); + } + Object[] certFields = { + x509.getVersion(), + Utilities.toHexString( + x509.getSerialNumber().toByteArray()), + x509.getSigAlgName(), + x509.getIssuerX500Principal().toString(), + dateFormat.get().format(x509.getNotBefore()), + dateFormat.get().format(x509.getNotAfter()), + x509.getSubjectX500Principal().toString(), + x509.getPublicKey().getAlgorithm(), + Utilities.indent(extBuilder.toString()) + }; + builder.append(Utilities.indent( + extendedCertFormart.format(certFields))); + } + } catch (Exception ce) { + // ignore the exception + } + + Object[] fields = { + "certificate", + builder.toString() + }; + + return Utilities.indent(keyObjectFormat.format(fields)); + } + + private static String formatByteArrayInputStream( + ByteArrayInputStream bytes) { + StringBuilder builder = new StringBuilder(512); + + try (ByteArrayOutputStream bytesOut = new ByteArrayOutputStream()) { + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + hexEncoder.encodeBuffer(bytes, bytesOut); + + builder.append(Utilities.indent(bytesOut.toString())); + } catch (IOException ioe) { + // ignore it, just for debugging. + } + + return builder.toString(); + } + + private static String formatByteBuffer(ByteBuffer byteBuffer) { + StringBuilder builder = new StringBuilder(512); + try (ByteArrayOutputStream bytesOut = new ByteArrayOutputStream()) { + HexDumpEncoder hexEncoder = new HexDumpEncoder(); + hexEncoder.encodeBuffer(byteBuffer.duplicate(), bytesOut); + builder.append(Utilities.indent(bytesOut.toString())); + } catch (IOException ioe) { + // ignore it, just for debugging. + } + + return builder.toString(); + } + + private static String formatMapEntry(Map.Entry<String, ?> entry) { + String key = entry.getKey(); + Object value = entry.getValue(); + + String formatted; + if (value instanceof String) { + // "key": "value" + formatted = "\"" + key + "\": \"" + (String)value + "\""; + } else if (value instanceof String[]) { + // "key": [ "string a", + // "string b", + // "string c" + // ] + StringBuilder builder = new StringBuilder(512); + String[] strings = (String[])value; + builder.append("\"" + key + "\": [\n"); + for (String string : strings) { + builder.append(" \"" + string + "\""); + if (string != strings[strings.length - 1]) { + builder.append(","); + } + builder.append("\n"); + } + builder.append(" ]"); + + formatted = builder.toString(); + } else if (value instanceof byte[]) { + formatted = "\"" + key + "\": \"" + + Utilities.toHexString((byte[])value) + "\""; + } else if (value instanceof Byte) { + formatted = "\"" + key + "\": \"" + + Utilities.toHexString((byte)value) + "\""; + } else { + formatted = "\"" + key + "\": " + + "\"" + value.toString() + "\""; + } + + return Utilities.indent(formatted); + } + + private static String formatObject(Object obj) { + return obj.toString(); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLMasterKeyDerivation.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLMasterKeyDerivation.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLMasterKeyDerivation.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLMasterKeyDerivation.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,164 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.security.InvalidAlgorithmParameterException; +import java.security.NoSuchAlgorithmException; +import java.security.ProviderException; +import java.security.spec.AlgorithmParameterSpec; +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; +import sun.security.internal.spec.TlsMasterSecretParameterSpec; +import sun.security.ssl.CipherSuite.HashAlg; +import static sun.security.ssl.CipherSuite.HashAlg.H_NONE; + +enum SSLMasterKeyDerivation implements SSLKeyDerivationGenerator { + SSL30 ("kdf_ssl30"), + TLS10 ("kdf_tls10"), + TLS12 ("kdf_tls12"); + + final String name; + + private SSLMasterKeyDerivation(String name) { + this.name = name; + } + + static SSLMasterKeyDerivation valueOf(ProtocolVersion protocolVersion) { + switch (protocolVersion) { + case SSL30: + return SSLMasterKeyDerivation.SSL30; + case TLS10: + case TLS11: + case DTLS10: + return SSLMasterKeyDerivation.TLS10; + case TLS12: + case DTLS12: + return SSLMasterKeyDerivation.TLS12; + default: + return null; + } + } + + @Override + public SSLKeyDerivation createKeyDerivation(HandshakeContext context, + SecretKey secretKey) throws IOException { + return new LegacyMasterKeyDerivation(context, secretKey); + } + + // Note, we may use different key derivation implementation in the future. + private static final + class LegacyMasterKeyDerivation implements SSLKeyDerivation { + + final HandshakeContext context; + final SecretKey preMasterSecret; + + LegacyMasterKeyDerivation( + HandshakeContext context, SecretKey preMasterSecret) { + this.context = context; + this.preMasterSecret = preMasterSecret; + } + + @Override + @SuppressWarnings("deprecation") + public SecretKey deriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + + CipherSuite cipherSuite = context.negotiatedCipherSuite; + ProtocolVersion protocolVersion = context.negotiatedProtocol; + + // What algs/params do we need to use? + String masterAlg; + HashAlg hashAlg; + + byte majorVersion = protocolVersion.major; + byte minorVersion = protocolVersion.minor; + if (protocolVersion.isDTLS) { + // Use TLS version number for DTLS key calculation + if (protocolVersion.id == ProtocolVersion.DTLS10.id) { + majorVersion = ProtocolVersion.TLS11.major; + minorVersion = ProtocolVersion.TLS11.minor; + + masterAlg = "SunTlsMasterSecret"; + hashAlg = H_NONE; + } else { // DTLS 1.2 + majorVersion = ProtocolVersion.TLS12.major; + minorVersion = ProtocolVersion.TLS12.minor; + + masterAlg = "SunTls12MasterSecret"; + hashAlg = cipherSuite.hashAlg; + } + } else { + if (protocolVersion.id >= ProtocolVersion.TLS12.id) { + masterAlg = "SunTls12MasterSecret"; + hashAlg = cipherSuite.hashAlg; + } else { + masterAlg = "SunTlsMasterSecret"; + hashAlg = H_NONE; + } + } + + TlsMasterSecretParameterSpec spec; + if (context.handshakeSession.useExtendedMasterSecret) { + // reset to use the extended master secret algorithm + masterAlg = "SunTlsExtendedMasterSecret"; + + // For the session hash, use the handshake messages up to and + // including the ClientKeyExchange message. + context.handshakeHash.utilize(); + byte[] sessionHash = context.handshakeHash.digest(); + spec = new TlsMasterSecretParameterSpec( + preMasterSecret, + (majorVersion & 0xFF), (minorVersion & 0xFF), + sessionHash, + hashAlg.name, hashAlg.hashLength, hashAlg.blockSize); + } else { + spec = new TlsMasterSecretParameterSpec( + preMasterSecret, + (majorVersion & 0xFF), (minorVersion & 0xFF), + context.clientHelloRandom.randomBytes, + context.serverHelloRandom.randomBytes, + hashAlg.name, hashAlg.hashLength, hashAlg.blockSize); + } + + try { + KeyGenerator kg = JsseJce.getKeyGenerator(masterAlg); + kg.init(spec); + return kg.generateKey(); + } catch (InvalidAlgorithmParameterException | + NoSuchAlgorithmException iae) { + // unlikely to happen, otherwise, must be a provider exception + // + // For RSA premaster secrets, do not signal a protocol error + // due to the Bleichenbacher attack. See comments further down. + if (SSLLogger.isOn && SSLLogger.isOn("handshake")) { + SSLLogger.fine("RSA master secret generation error.", iae); + } + throw new ProviderException(iae); + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLPossessionGenerator.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLPossessionGenerator.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLPossessionGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLPossessionGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +interface SSLPossessionGenerator { + SSLPossession createPossession(HandshakeContext handshakeContext); +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLPossession.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLPossession.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLPossession.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLPossession.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +interface SSLPossession { + default byte[] encode() { + return new byte[0]; + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLProducer.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLProducer.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLProducer.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLProducer.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; + +interface SSLProducer { + // return the encoded producing if it has not been dumped to the context + byte[] produce(ConnectionContext context) throws IOException; +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,7 +32,8 @@ */ interface SSLRecord extends Record { - static final int headerSize = 5; // SSLv3 record header + static final int headerSize = 5; // SSLv3 record header + static final int handshakeHeaderSize = 4; // SSLv3 handshake header /* * The size of the header plus the max IV length @@ -67,19 +68,6 @@ + maxMacSize; // MAC or AEAD tag /* - * For CBC protection in SSL3/TLS1, we break some plaintext into two - * packets. Max application data size for the second packet. - */ - static final int maxDataSizeMinusOneByteRecord = - maxDataSize // max data size - - ( // max one byte record size - headerPlusMaxIVSize // header + iv - + 1 // one byte data - + maxPadding // padding - + maxMacSize // MAC - ); - - /* * The maximum large record size. * * Some SSL/TLS implementations support large fragment upto 2^15 bytes, @@ -92,18 +80,6 @@ maxRecordSize // Max size with a conforming implementation + maxDataSize; // extra 2^14 bytes for large data packets. - - /* - * Maximum record size for alert and change cipher spec records. - * They only contain 2 and 1 bytes of data, respectively. - * Allocate a smaller array. - */ - static final int maxAlertRecordSize = - headerPlusMaxIVSize // header + iv - + 2 // alert - + maxPadding // padding - + maxMacSize; // MAC - /* * We may need to send this SSL v2 "No Cipher" message back, if we * are faced with an SSLv2 "hello" that's not saying "I talk v3". diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSecretDerivation.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSecretDerivation.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSecretDerivation.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSecretDerivation.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.security.spec.AlgorithmParameterSpec; +import javax.crypto.SecretKey; +import javax.net.ssl.SSLHandshakeException; +import sun.security.ssl.CipherSuite.HashAlg; + +final class SSLSecretDerivation implements SSLKeyDerivation { + private static final byte[] sha256EmptyDigest = new byte[] { + (byte)0xE3, (byte)0xB0, (byte)0xC4, (byte)0x42, + (byte)0x98, (byte)0xFC, (byte)0x1C, (byte)0x14, + (byte)0x9A, (byte)0xFB, (byte)0xF4, (byte)0xC8, + (byte)0x99, (byte)0x6F, (byte)0xB9, (byte)0x24, + (byte)0x27, (byte)0xAE, (byte)0x41, (byte)0xE4, + (byte)0x64, (byte)0x9B, (byte)0x93, (byte)0x4C, + (byte)0xA4, (byte)0x95, (byte)0x99, (byte)0x1B, + (byte)0x78, (byte)0x52, (byte)0xB8, (byte)0x55 + }; + + private static final byte[] sha384EmptyDigest = new byte[] { + (byte)0x38, (byte)0xB0, (byte)0x60, (byte)0xA7, + (byte)0x51, (byte)0xAC, (byte)0x96, (byte)0x38, + (byte)0x4C, (byte)0xD9, (byte)0x32, (byte)0x7E, + (byte)0xB1, (byte)0xB1, (byte)0xE3, (byte)0x6A, + (byte)0x21, (byte)0xFD, (byte)0xB7, (byte)0x11, + (byte)0x14, (byte)0xBE, (byte)0x07, (byte)0x43, + (byte)0x4C, (byte)0x0C, (byte)0xC7, (byte)0xBF, + (byte)0x63, (byte)0xF6, (byte)0xE1, (byte)0xDA, + (byte)0x27, (byte)0x4E, (byte)0xDE, (byte)0xBF, + (byte)0xE7, (byte)0x6F, (byte)0x65, (byte)0xFB, + (byte)0xD5, (byte)0x1A, (byte)0xD2, (byte)0xF1, + (byte)0x48, (byte)0x98, (byte)0xB9, (byte)0x5B + }; + + private final HandshakeContext context; + private final String hkdfAlg; + private final HashAlg hashAlg; + private final SecretKey secret; + private final byte[] transcriptHash; // handshake messages transcript hash + + SSLSecretDerivation( + HandshakeContext context, SecretKey secret) { + this.context = context; + this.secret = secret; + this.hashAlg = context.negotiatedCipherSuite.hashAlg; + this.hkdfAlg = + "HKDF-Expand/Hmac" + hashAlg.name.replace("-", ""); + context.handshakeHash.update(); + this.transcriptHash = context.handshakeHash.digest(); + } + + SSLSecretDerivation forContext(HandshakeContext context) { + return new SSLSecretDerivation(context, secret); + } + + @Override + public SecretKey deriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + SecretSchedule ks = SecretSchedule.valueOf(algorithm); + try { + byte[] expandContext; + if (ks == SecretSchedule.TlsSaltSecret) { + if (hashAlg == HashAlg.H_SHA256) { + expandContext = sha256EmptyDigest; + } else if (hashAlg == HashAlg.H_SHA384) { + expandContext = sha384EmptyDigest; + } else { + // unlikely, but please update if more hash algorithm + // get supported in the future. + throw new SSLHandshakeException( + "Unexpected unsupported hash algorithm: " + + algorithm); + } + } else { + expandContext = transcriptHash; + } + byte[] hkdfInfo = createHkdfInfo(ks.label, + expandContext, hashAlg.hashLength); + + HKDF hkdf = new HKDF(hashAlg.name); + return hkdf.expand(secret, hkdfInfo, hashAlg.hashLength, algorithm); + } catch (GeneralSecurityException gse) { + throw (SSLHandshakeException) new SSLHandshakeException( + "Could not generate secret").initCause(gse); + } + } + + public static byte[] createHkdfInfo( + byte[] label, byte[] context, int length) { + byte[] info = new byte[4 + label.length + context.length]; + ByteBuffer m = ByteBuffer.wrap(info); + try { + Record.putInt16(m, length); + Record.putBytes8(m, label); + Record.putBytes8(m, context); + } catch (IOException ioe) { + // unlikely + throw new RuntimeException("Unexpected exception", ioe); + } + + return info; + } + + private enum SecretSchedule { + // Note that we use enum name as the key/secret name. + TlsSaltSecret ("derived"), + TlsExtBinderKey ("ext binder"), + TlsResBinderKey ("res binder"), + TlsClientEarlyTrafficSecret ("c e traffic"), + TlsEarlyExporterMasterSecret ("e exp master"), + TlsClientHandshakeTrafficSecret ("c hs traffic"), + TlsServerHandshakeTrafficSecret ("s hs traffic"), + TlsClientAppTrafficSecret ("c ap traffic"), + TlsServerAppTrafficSecret ("s ap traffic"), + TlsExporterMasterSecret ("exp master"), + TlsResumptionMasterSecret ("res master"); + + private final byte[] label; + + private SecretSchedule(String label) { + this.label = ("tls13 " + label).getBytes(); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLServerSocketFactoryImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLServerSocketFactoryImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLServerSocketFactoryImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLServerSocketFactoryImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,6 @@ import java.io.IOException; import java.net.InetAddress; import java.net.ServerSocket; - import javax.net.ssl.SSLServerSocketFactory; /** @@ -36,11 +35,9 @@ * * @author David Brownell */ -final -public class SSLServerSocketFactoryImpl extends SSLServerSocketFactory -{ +public final class SSLServerSocketFactoryImpl extends SSLServerSocketFactory { private static final int DEFAULT_BACKLOG = 50; - private SSLContextImpl context; + private final SSLContextImpl context; /** @@ -55,8 +52,7 @@ /** * Called from SSLContextImpl's getSSLServerSocketFactory(). */ - SSLServerSocketFactoryImpl (SSLContextImpl context) - { + SSLServerSocketFactoryImpl(SSLContextImpl context) { this.context = context; } @@ -73,26 +69,22 @@ } @Override - public ServerSocket createServerSocket (int port) - throws IOException - { - return new SSLServerSocketImpl (port, DEFAULT_BACKLOG, context); + public ServerSocket createServerSocket(int port) throws IOException { + return new SSLServerSocketImpl(context, port, DEFAULT_BACKLOG); } @Override - public ServerSocket createServerSocket (int port, int backlog) - throws IOException - { - return new SSLServerSocketImpl (port, backlog, context); + public ServerSocket createServerSocket ( + int port, int backlog) throws IOException { + return new SSLServerSocketImpl(context, port, backlog); } @Override public ServerSocket - createServerSocket (int port, int backlog, InetAddress ifAddress) - throws IOException - { - return new SSLServerSocketImpl (port, backlog, ifAddress, context); + createServerSocket (int port, + int backlog, InetAddress ifAddress) throws IOException { + return new SSLServerSocketImpl(context, port, backlog, ifAddress); } /** @@ -104,7 +96,7 @@ */ @Override public String[] getDefaultCipherSuites() { - return context.getDefaultCipherSuiteList(true).toStringArray(); + return CipherSuite.namesOf(context.getDefaultCipherSuites(true)); } /** @@ -119,7 +111,6 @@ */ @Override public String[] getSupportedCipherSuites() { - return context.getSupportedCipherSuiteList().toStringArray(); + return CipherSuite.namesOf(context.getSupportedCipherSuites()); } - } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLServerSocketImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLServerSocketImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLServerSocketImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLServerSocketImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,22 +23,13 @@ * questions. */ - package sun.security.ssl; import java.io.IOException; import java.net.InetAddress; import java.net.Socket; - -import java.security.AlgorithmConstraints; - -import java.util.*; - -import javax.net.ssl.SSLException; -import javax.net.ssl.SSLServerSocket; import javax.net.ssl.SSLParameters; -import javax.net.ssl.SNIMatcher; - +import javax.net.ssl.SSLServerSocket; /** * This class provides a simple way for servers to support conventional @@ -62,301 +53,157 @@ * * @author David Brownell */ -final -class SSLServerSocketImpl extends SSLServerSocket -{ - private SSLContextImpl sslContext; - - /* Do newly accepted connections require clients to authenticate? */ - private ClientAuthType clientAuthType = ClientAuthType.CLIENT_AUTH_NONE; - - /* Do new connections created here use the "server" mode of SSL? */ - private boolean useServerMode = true; - - /* Can new connections created establish new sessions? */ - private boolean enableSessionCreation = true; - - /* what cipher suites to use by default */ - private CipherSuiteList enabledCipherSuites = null; - - /* which protocol to use by default */ - private ProtocolList enabledProtocols = null; - - // the endpoint identification protocol to use by default - private String identificationProtocol = null; - - // The cryptographic algorithm constraints - private AlgorithmConstraints algorithmConstraints = null; - - // The server name indication - Collection<SNIMatcher> sniMatchers = - Collections.<SNIMatcher>emptyList(); - - // Configured application protocol values - String[] applicationProtocols = new String[0]; - - /* - * Whether local cipher suites preference in server side should be - * honored during handshaking? - */ - private boolean preferLocalCipherSuites = false; - - /** - * Create an SSL server socket on a port, using a non-default - * authentication context and a specified connection backlog. - * - * @param port the port on which to listen - * @param backlog how many connections may be pending before - * the system should start rejecting new requests - * @param context authentication context for this server - */ - SSLServerSocketImpl(int port, int backlog, SSLContextImpl context) - throws IOException, SSLException - { - super(port, backlog); - initServer(context); - } +final class SSLServerSocketImpl extends SSLServerSocket { + private final SSLContextImpl sslContext; + private final SSLConfiguration sslConfig; + SSLServerSocketImpl(SSLContextImpl sslContext) throws IOException { - /** - * Create an SSL server socket on a port, using a specified - * authentication context and a specified backlog of connections - * as well as a particular specified network interface. This - * constructor is used on multihomed hosts, such as those used - * for firewalls or as routers, to control through which interface - * a network service is provided. - * - * @param port the port on which to listen - * @param backlog how many connections may be pending before - * the system should start rejecting new requests - * @param address the address of the network interface through - * which connections will be accepted - * @param context authentication context for this server - */ - SSLServerSocketImpl( - int port, - int backlog, - InetAddress address, - SSLContextImpl context) - throws IOException - { - super(port, backlog, address); - initServer(context); + super(); + this.sslContext = sslContext; + this.sslConfig = new SSLConfiguration(sslContext, false); + this.sslConfig.isClientMode = false; } + SSLServerSocketImpl(SSLContextImpl sslContext, + int port, int backlog) throws IOException { - /** - * Creates an unbound server socket. - */ - SSLServerSocketImpl(SSLContextImpl context) throws IOException { - super(); - initServer(context); + super(port, backlog); + this.sslContext = sslContext; + this.sslConfig = new SSLConfiguration(sslContext, false); + this.sslConfig.isClientMode = false; } + SSLServerSocketImpl(SSLContextImpl sslContext, + int port, int backlog, InetAddress address) throws IOException { - /** - * Initializes the server socket. - */ - private void initServer(SSLContextImpl context) throws SSLException { - if (context == null) { - throw new SSLException("No Authentication context given"); - } - sslContext = context; - enabledCipherSuites = sslContext.getDefaultCipherSuiteList(true); - enabledProtocols = sslContext.getDefaultProtocolList(true); + super(port, backlog, address); + this.sslContext = sslContext; + this.sslConfig = new SSLConfiguration(sslContext, false); + this.sslConfig.isClientMode = false; } - /** - * Returns the names of the cipher suites which could be enabled for use - * on an SSL connection. Normally, only a subset of these will actually - * be enabled by default, since this list may include cipher suites which - * do not support the mutual authentication of servers and clients, or - * which do not protect data confidentiality. Servers may also need - * certain kinds of certificates to use certain cipher suites. - * - * @return an array of cipher suite names - */ @Override - public String[] getSupportedCipherSuites() { - return sslContext.getSupportedCipherSuiteList().toStringArray(); + public synchronized String[] getEnabledCipherSuites() { + return CipherSuite.namesOf(sslConfig.enabledCipherSuites); } - /** - * Returns the list of cipher suites which are currently enabled - * for use by newly accepted connections. A null return indicates - * that the system defaults are in effect. - */ @Override - public synchronized String[] getEnabledCipherSuites() { - return enabledCipherSuites.toStringArray(); + public synchronized void setEnabledCipherSuites(String[] suites) { + sslConfig.enabledCipherSuites = + CipherSuite.validValuesOf(suites); } - /** - * Controls which particular SSL cipher suites are enabled for use - * by accepted connections. - * - * @param suites Names of all the cipher suites to enable; null - * means to accept system defaults. - */ @Override - public synchronized void setEnabledCipherSuites(String[] suites) { - enabledCipherSuites = new CipherSuiteList(suites); + public String[] getSupportedCipherSuites() { + return CipherSuite.namesOf(sslContext.getSupportedCipherSuites()); } @Override public String[] getSupportedProtocols() { - return sslContext.getSuportedProtocolList().toStringArray(); + return ProtocolVersion.toStringArray( + sslContext.getSupportedProtocolVersions()); } - /** - * Controls which protocols are enabled for use. - * The protocols must have been listed by - * getSupportedProtocols() as being supported. - * - * @param protocols protocols to enable. - * @exception IllegalArgumentException when one of the protocols - * named by the parameter is not supported. - */ @Override - public synchronized void setEnabledProtocols(String[] protocols) { - enabledProtocols = new ProtocolList(protocols); + public synchronized String[] getEnabledProtocols() { + return ProtocolVersion.toStringArray(sslConfig.enabledProtocols); } @Override - public synchronized String[] getEnabledProtocols() { - return enabledProtocols.toStringArray(); + public synchronized void setEnabledProtocols(String[] protocols) { + if (protocols == null) { + throw new IllegalArgumentException("Protocols cannot be null"); + } + + sslConfig.enabledProtocols = ProtocolVersion.namesOf(protocols); } - /** - * Controls whether the connections which are accepted must include - * client authentication. - */ @Override - public void setNeedClientAuth(boolean flag) { - clientAuthType = (flag ? ClientAuthType.CLIENT_AUTH_REQUIRED : - ClientAuthType.CLIENT_AUTH_NONE); + public synchronized void setNeedClientAuth(boolean need) { + sslConfig.clientAuthType = + (need ? ClientAuthType.CLIENT_AUTH_REQUIRED : + ClientAuthType.CLIENT_AUTH_NONE); } @Override - public boolean getNeedClientAuth() { - return (clientAuthType == ClientAuthType.CLIENT_AUTH_REQUIRED); + public synchronized boolean getNeedClientAuth() { + return (sslConfig.clientAuthType == + ClientAuthType.CLIENT_AUTH_REQUIRED); } - /** - * Controls whether the connections which are accepted should request - * client authentication. - */ @Override - public void setWantClientAuth(boolean flag) { - clientAuthType = (flag ? ClientAuthType.CLIENT_AUTH_REQUESTED : - ClientAuthType.CLIENT_AUTH_NONE); + public synchronized void setWantClientAuth(boolean want) { + sslConfig.clientAuthType = + (want ? ClientAuthType.CLIENT_AUTH_REQUESTED : + ClientAuthType.CLIENT_AUTH_NONE); } @Override - public boolean getWantClientAuth() { - return (clientAuthType == ClientAuthType.CLIENT_AUTH_REQUESTED); + public synchronized boolean getWantClientAuth() { + return (sslConfig.clientAuthType == + ClientAuthType.CLIENT_AUTH_REQUESTED); } - /** - * Makes the returned sockets act in SSL "client" mode, not the usual - * server mode. The canonical example of why this is needed is for - * FTP clients, which accept connections from servers and should be - * rejoining the already-negotiated SSL connection. - */ @Override - public void setUseClientMode(boolean flag) { + public synchronized void setUseClientMode(boolean useClientMode) { /* - * If we need to change the socket mode and the enabled - * protocols haven't specifically been set by the user, - * change them to the corresponding default ones. + * If we need to change the client mode and the enabled + * protocols and cipher suites haven't specifically been + * set by the user, change them to the corresponding + * default ones. */ - if (useServerMode != (!flag) && - sslContext.isDefaultProtocolList(enabledProtocols)) { - enabledProtocols = sslContext.getDefaultProtocolList(!flag); - } + if (sslConfig.isClientMode != useClientMode) { + if (sslContext.isDefaultProtocolVesions( + sslConfig.enabledProtocols)) { + sslConfig.enabledProtocols = + sslContext.getDefaultProtocolVersions(!useClientMode); + } + + if (sslContext.isDefaultCipherSuiteList( + sslConfig.enabledCipherSuites)) { + sslConfig.enabledCipherSuites = + sslContext.getDefaultCipherSuites(!useClientMode); + } - useServerMode = !flag; + sslConfig.isClientMode = useClientMode; + } } @Override - public boolean getUseClientMode() { - return !useServerMode; + public synchronized boolean getUseClientMode() { + return sslConfig.isClientMode; } - - /** - * Controls whether new connections may cause creation of new SSL - * sessions. - */ @Override - public void setEnableSessionCreation(boolean flag) { - enableSessionCreation = flag; + public synchronized void setEnableSessionCreation(boolean flag) { + sslConfig.enableSessionCreation = flag; } - /** - * Returns true if new connections may cause creation of new SSL - * sessions. - */ @Override - public boolean getEnableSessionCreation() { - return enableSessionCreation; + public synchronized boolean getEnableSessionCreation() { + return sslConfig.enableSessionCreation; } - /** - * Returns the SSLParameters in effect for newly accepted connections. - */ @Override public synchronized SSLParameters getSSLParameters() { - SSLParameters params = super.getSSLParameters(); - - // the super implementation does not handle the following parameters - params.setEndpointIdentificationAlgorithm(identificationProtocol); - params.setAlgorithmConstraints(algorithmConstraints); - params.setSNIMatchers(sniMatchers); - params.setUseCipherSuitesOrder(preferLocalCipherSuites); - params.setApplicationProtocols(applicationProtocols); - - return params; + return sslConfig.getSSLParameters(); } - /** - * Applies SSLParameters to newly accepted connections. - */ @Override public synchronized void setSSLParameters(SSLParameters params) { - super.setSSLParameters(params); - - // the super implementation does not handle the following parameters - identificationProtocol = params.getEndpointIdentificationAlgorithm(); - algorithmConstraints = params.getAlgorithmConstraints(); - preferLocalCipherSuites = params.getUseCipherSuitesOrder(); - Collection<SNIMatcher> matchers = params.getSNIMatchers(); - if (matchers != null) { - sniMatchers = params.getSNIMatchers(); - } - applicationProtocols = params.getApplicationProtocols(); + sslConfig.setSSLParameters(params); } - /** - * Accept a new SSL connection. This server identifies itself with - * information provided in the authentication context which was - * presented during construction. - */ @Override public Socket accept() throws IOException { - SSLSocketImpl s = new SSLSocketImpl(sslContext, useServerMode, - enabledCipherSuites, clientAuthType, enableSessionCreation, - enabledProtocols, identificationProtocol, algorithmConstraints, - sniMatchers, preferLocalCipherSuites, applicationProtocols); + SSLSocketImpl s = new SSLSocketImpl(sslContext, sslConfig); implAccept(s); s.doneConnect(); return s; } - /** - * Provides a brief description of this SSL socket. - */ @Override public String toString() { return "[SSL: "+ super.toString() + "]"; diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSessionContextImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,23 +23,21 @@ * questions. */ - package sun.security.ssl; +import java.util.ArrayList; +import java.util.Collections; import java.util.Enumeration; -import java.util.Vector; import java.util.Locale; - import javax.net.ssl.SSLSession; import javax.net.ssl.SSLSessionContext; - import sun.security.util.Cache; final class SSLSessionContextImpl implements SSLSessionContext { - private Cache<SessionId, SSLSessionImpl> sessionCache; + private final Cache<SessionId, SSLSessionImpl> sessionCache; // session cache, session id as key - private Cache<String, SSLSessionImpl> sessionHostPortCache; + private final Cache<String, SSLSessionImpl> sessionHostPortCache; // session cache, "host:port" as key private int cacheLimit; // the max cache size private int timeout; // timeout in seconds @@ -137,7 +135,6 @@ return cacheLimit; } - // package-private method, used ONLY by ServerHandshaker SSLSessionImpl get(byte[] id) { return (SSLSessionImpl)getSession(id); @@ -161,7 +158,7 @@ return null; } - private String getKey(String hostname, int port) { + private static String getKey(String hostname, int port) { return (hostname + ":" + String.valueOf(port)).toLowerCase(Locale.ENGLISH); } @@ -192,29 +189,30 @@ if (s != null) { sessionCache.remove(key); sessionHostPortCache.remove( - getKey(s.getPeerHost(), s.getPeerPort())); + getKey(s.getPeerHost(), s.getPeerPort())); } } - private int getDefaultCacheLimit() { - int cacheLimit = 0; + private static int getDefaultCacheLimit() { + int defaultCacheLimit = 0; try { - String s = java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction<String>() { - @Override - public String run() { - return System.getProperty( - "javax.net.ssl.sessionCacheSize"); - } - }); - cacheLimit = (s != null) ? Integer.valueOf(s).intValue() : 0; + String s = java.security.AccessController.doPrivileged( + new java.security.PrivilegedAction<String>() { + @Override + public String run() { + return System.getProperty( + "javax.net.ssl.sessionCacheSize"); + } + }); + defaultCacheLimit = (s != null) ? Integer.parseInt(s) : 0; } catch (Exception e) { + // swallow the exception } - return (cacheLimit > 0) ? cacheLimit : 0; + return (defaultCacheLimit > 0) ? defaultCacheLimit : 0; } - boolean isTimedout(SSLSession sess) { + private boolean isTimedout(SSLSession sess) { if (timeout == 0) { return false; } @@ -228,27 +226,26 @@ return false; } - final class SessionCacheVisitor + private final class SessionCacheVisitor implements Cache.CacheVisitor<SessionId, SSLSessionImpl> { - Vector<byte[]> ids = null; + ArrayList<byte[]> ids = null; // public void visit(java.util.Map<K,V> map) {} @Override public void visit(java.util.Map<SessionId, SSLSessionImpl> map) { - ids = new Vector<>(map.size()); + ids = new ArrayList<>(map.size()); for (SessionId key : map.keySet()) { SSLSessionImpl value = map.get(key); if (!isTimedout(value)) { - ids.addElement(key.getId()); + ids.add(key.getId()); } } } - public Enumeration<byte[]> getSessionIds() { - return ids != null ? ids.elements() : - new Vector<byte[]>().elements(); + Enumeration<byte[]> getSessionIds() { + return ids != null ? Collections.enumeration(ids) : + Collections.emptyEnumeration(); } } - } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSessionImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,36 +22,31 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ - - package sun.security.ssl; -import java.net.*; -import java.util.Enumeration; -import java.util.Hashtable; -import java.util.Vector; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.ArrayList; - +import java.math.BigInteger; +import java.net.InetAddress; import java.security.Principal; import java.security.PrivateKey; -import java.security.SecureRandom; -import java.security.cert.X509Certificate; import java.security.cert.CertificateEncodingException; - +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Queue; +import java.util.Collection; +import java.util.Collections; +import java.util.Enumeration; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentLinkedQueue; import javax.crypto.SecretKey; - -import javax.net.ssl.SSLSessionContext; -import javax.net.ssl.SSLSessionBindingListener; -import javax.net.ssl.SSLSessionBindingEvent; -import javax.net.ssl.SSLPeerUnverifiedException; -import javax.net.ssl.SSLPermission; import javax.net.ssl.ExtendedSSLSession; import javax.net.ssl.SNIServerName; - -import static sun.security.ssl.CipherSuite.KeyExchange.*; +import javax.net.ssl.SSLPeerUnverifiedException; +import javax.net.ssl.SSLPermission; +import javax.net.ssl.SSLSessionBindingEvent; +import javax.net.ssl.SSLSessionBindingListener; +import javax.net.ssl.SSLSessionContext; /** * Implements the SSL session interface, and exposes the session context @@ -78,9 +73,6 @@ */ static final SSLSessionImpl nullSession = new SSLSessionImpl(); - // compression methods - private static final byte compression_null = 0; - /* * The state of a single session, as described in section 7.1 * of the SSLv3 spec. @@ -88,35 +80,37 @@ private final ProtocolVersion protocolVersion; private final SessionId sessionId; private X509Certificate[] peerCerts; - private byte compressionMethod; private CipherSuite cipherSuite; private SecretKey masterSecret; - private final boolean useExtendedMasterSecret; + final boolean useExtendedMasterSecret; /* * Information not part of the SSLv3 protocol spec, but used * to support session management policies. */ - private final long creationTime = System.currentTimeMillis(); + private final long creationTime; private long lastUsedTime = 0; private final String host; private final int port; private SSLSessionContextImpl context; - private int sessionCount; private boolean invalidated; private X509Certificate[] localCerts; private PrivateKey localPrivateKey; - private String[] localSupportedSignAlgs; - private String[] peerSupportedSignAlgs; - private List<SNIServerName> requestedServerNames; + private final Collection<SignatureScheme> localSupportedSignAlgs; + private String[] peerSupportedSignAlgs; // for certificate + private boolean useDefaultPeerSignAlgs = false; private List<byte[]> statusResponses; + private SecretKey resumptionMasterSecret; + private SecretKey preSharedKey; + private byte[] pskIdentity; + private final long ticketCreationTime = System.currentTimeMillis(); + private int ticketAgeAdd; - private int negotiatedMaxFragLen; + private int negotiatedMaxFragLen = -1; private int maximumPacketSize; - // Principals for non-certificate based cipher suites - private Principal peerPrincipal; - private Principal localPrincipal; + private final Queue<SSLSessionImpl> childSessions = + new ConcurrentLinkedQueue<>(); /* * Is the session currently re-established with a session-resumption @@ -127,19 +121,16 @@ private boolean isSessionResumption = false; /* - * We count session creations, eventually for statistical data but - * also since counters make shorter debugging IDs than the big ones - * we use in the protocol for uniqueness-over-time. - */ - private static volatile int counter; - - /* * Use of session caches is globally enabled/disabled. */ private static boolean defaultRejoinable = true; - /* Class and subclass dynamic debugging support */ - private static final Debug debug = Debug.getInstance("ssl"); + // server name indication + final SNIServerName serverNameIndication; + private final List<SNIServerName> requestedServerNames; + + // Counter used to create unique nonces in NewSessionTicket + private BigInteger ticketNonceCounter = BigInteger.ONE; /* * Create a new non-rejoinable session, using the default (null) @@ -148,8 +139,16 @@ * first opened and before handshaking begins. */ private SSLSessionImpl() { - this(ProtocolVersion.NONE, CipherSuite.C_NULL, null, - new SessionId(false, null), null, -1, false); + this.protocolVersion = ProtocolVersion.NONE; + this.cipherSuite = CipherSuite.C_NULL; + this.sessionId = new SessionId(false, null); + this.host = null; + this.port = -1; + this.localSupportedSignAlgs = Collections.emptySet(); + this.serverNameIndication = null; + this.requestedServerNames = Collections.<SNIServerName>emptyList(); + this.useExtendedMasterSecret = false; + this.creationTime = System.currentTimeMillis(); } /* @@ -157,48 +156,82 @@ * be rejoinable if session caching is enabled; the constructor * is intended mostly for use by serves. */ - SSLSessionImpl(ProtocolVersion protocolVersion, CipherSuite cipherSuite, - Collection<SignatureAndHashAlgorithm> algorithms, - SecureRandom generator, String host, int port, - boolean useExtendedMasterSecret) { - this(protocolVersion, cipherSuite, algorithms, - new SessionId(defaultRejoinable, generator), host, port, - useExtendedMasterSecret); + SSLSessionImpl(HandshakeContext hc, CipherSuite cipherSuite) { + this(hc, cipherSuite, + new SessionId(defaultRejoinable, hc.sslContext.getSecureRandom())); } /* * Record a new session, using a given cipher spec and session ID. */ - SSLSessionImpl(ProtocolVersion protocolVersion, CipherSuite cipherSuite, - Collection<SignatureAndHashAlgorithm> algorithms, - SessionId id, String host, int port, - boolean useExtendedMasterSecret) { - this.protocolVersion = protocolVersion; - sessionId = id; - peerCerts = null; - compressionMethod = compression_null; + SSLSessionImpl(HandshakeContext hc, CipherSuite cipherSuite, SessionId id) { + this(hc, cipherSuite, id, System.currentTimeMillis()); + } + + /* + * Record a new session, using a given cipher spec, session ID, + * and creation time + */ + SSLSessionImpl(HandshakeContext hc, + CipherSuite cipherSuite, SessionId id, long creationTime) { + this.protocolVersion = hc.negotiatedProtocol; this.cipherSuite = cipherSuite; - masterSecret = null; - this.host = host; - this.port = port; - sessionCount = ++counter; - localSupportedSignAlgs = - SignatureAndHashAlgorithm.getAlgorithmNames(algorithms); - negotiatedMaxFragLen = -1; - statusResponses = null; - this.useExtendedMasterSecret = useExtendedMasterSecret; + this.sessionId = id; + this.host = hc.conContext.transport.getPeerHost(); + this.port = hc.conContext.transport.getPeerPort(); + this.localSupportedSignAlgs = hc.localSupportedSignAlgs == null ? + Collections.emptySet() : + Collections.unmodifiableCollection(hc.localSupportedSignAlgs); + this.serverNameIndication = hc.negotiatedServerName; + this.requestedServerNames = Collections.<SNIServerName>unmodifiableList( + hc.getRequestedServerNames()); + if (hc.sslConfig.isClientMode) { + this.useExtendedMasterSecret = + (hc.handshakeExtensions.get( + SSLExtension.CH_EXTENDED_MASTER_SECRET) != null) && + (hc.handshakeExtensions.get( + SSLExtension.SH_EXTENDED_MASTER_SECRET) != null); + } else { + this.useExtendedMasterSecret = + (hc.handshakeExtensions.get( + SSLExtension.CH_EXTENDED_MASTER_SECRET) != null) && + (!hc.negotiatedProtocol.useTLS13PlusSpec()); + } + this.creationTime = creationTime; - if (debug != null && Debug.isOn("session")) { - System.out.println("%% Initialized: " + this); + if (SSLLogger.isOn && SSLLogger.isOn("session")) { + SSLLogger.finest("Session initialized: " + this); } } void setMasterSecret(SecretKey secret) { - if (masterSecret == null) { - masterSecret = secret; - } else { - throw new RuntimeException("setMasterSecret() error"); - } + masterSecret = secret; + } + + void setResumptionMasterSecret(SecretKey secret) { + resumptionMasterSecret = secret; + } + + void setPreSharedKey(SecretKey key) { + preSharedKey = key; + } + + void addChild(SSLSessionImpl session) { + childSessions.add(session); + } + + void setTicketAgeAdd(int ticketAgeAdd) { + this.ticketAgeAdd = ticketAgeAdd; + } + + void setPskIdentity(byte[] pskIdentity) { + this.pskIdentity = pskIdentity; + } + + BigInteger incrTicketNonceCounter() { + BigInteger result = ticketNonceCounter; + ticketNonceCounter = ticketNonceCounter.add(BigInteger.valueOf(1)); + return result; } /** @@ -208,8 +241,39 @@ return masterSecret; } - boolean getUseExtendedMasterSecret() { - return useExtendedMasterSecret; + Optional<SecretKey> getResumptionMasterSecret() { + return Optional.ofNullable(resumptionMasterSecret); + } + + synchronized Optional<SecretKey> getPreSharedKey() { + return Optional.ofNullable(preSharedKey); + } + + synchronized Optional<SecretKey> consumePreSharedKey() { + Optional<SecretKey> result = Optional.ofNullable(preSharedKey); + preSharedKey = null; + return result; + } + + int getTicketAgeAdd() { + return ticketAgeAdd; + } + + /* + * Get the PSK identity. Take care not to use it in multiple connections. + */ + synchronized Optional<byte[]> getPskIdentity() { + return Optional.ofNullable(pskIdentity); + } + + /* PSK identities created from new_session_ticket messages should only + * be used once. This method will return the identity and then clear it + * so it cannot be used again. + */ + synchronized Optional<byte[]> consumePskIdentity() { + Optional<byte[]> result = Optional.ofNullable(pskIdentity); + pskIdentity = null; + return result; } void setPeerCertificates(X509Certificate[] peer) { @@ -227,13 +291,35 @@ } void setPeerSupportedSignatureAlgorithms( - Collection<SignatureAndHashAlgorithm> algorithms) { + Collection<SignatureScheme> signatureSchemes) { peerSupportedSignAlgs = - SignatureAndHashAlgorithm.getAlgorithmNames(algorithms); + SignatureScheme.getAlgorithmNames(signatureSchemes); } - void setRequestedServerNames(List<SNIServerName> requestedServerNames) { - this.requestedServerNames = new ArrayList<>(requestedServerNames); + // TLS 1.2 only + // + // Per RFC 5246, If the client supports only the default hash + // and signature algorithms, it MAY omit the + // signature_algorithms extension. If the client does not + // support the default algorithms, or supports other hash + // and signature algorithms (and it is willing to use them + // for verifying messages sent by the server, i.e., server + // certificates and server key exchange), it MUST send the + // signature_algorithms extension, listing the algorithms it + // is willing to accept. + void setUseDefaultPeerSignAlgs() { + useDefaultPeerSignAlgs = true; + peerSupportedSignAlgs = new String[] { + "SHA1withRSA", "SHA1withDSA", "SHA1withECDSA"}; + } + + // Returns the connection session. + SSLSessionImpl finish() { + if (useDefaultPeerSignAlgs) { + this.peerSupportedSignAlgs = new String[0]; + } + + return this; } /** @@ -250,22 +336,6 @@ } /** - * Set the peer principal. - */ - void setPeerPrincipal(Principal principal) { - if (peerPrincipal == null) { - peerPrincipal = principal; - } - } - - /** - * Set the local principal. - */ - void setLocalPrincipal(Principal principal) { - localPrincipal = principal; - } - - /** * Returns true iff this session may be resumed ... sessions are * usually resumable. Security policies may suggest otherwise, * for example sessions that haven't been used for a while (say, @@ -286,7 +356,7 @@ * Check if the authentication used when establishing this session * is still valid. Returns true if no authentication was used */ - boolean isLocalAuthenticationValid() { + private boolean isLocalAuthenticationValid() { if (localPrivateKey != null) { try { // if the private key is no longer valid, getAlgorithm() @@ -298,6 +368,7 @@ return false; } } + return true; } @@ -354,8 +425,8 @@ void setSuite(CipherSuite suite) { cipherSuite = suite; - if (debug != null && Debug.isOn("session")) { - System.out.println("%% Negotiating: " + this); + if (SSLLogger.isOn && SSLLogger.isOn("session")) { + SSLLogger.finest("Negotiating session: " + this); } } @@ -396,13 +467,6 @@ } /** - * Returns the compression technique used in this session - */ - byte getCompression() { - return compressionMethod; - } - - /** * Returns the hashcode for this session */ @Override @@ -410,7 +474,6 @@ return sessionId.hashCode(); } - /** * Returns true if sessions have same ids, false otherwise. */ @@ -435,8 +498,8 @@ * Return the cert chain presented by the peer in the * java.security.cert format. * Note: This method can be used only when using certificate-based - * cipher suites; using it with non-certificate-based cipher suites, - * such as Kerberos, will throw an SSLPeerUnverifiedException. + * cipher suites; using it with non-certificate-based cipher suites + * will throw an SSLPeerUnverifiedException. * * @return array of peer X.509 certs, with the peer's own cert * first in the chain, and with the "root" CA last. @@ -449,10 +512,6 @@ // change record of peer identity even by accident, much // less do it intentionally. // - if (ClientKeyExchangeService.find(cipherSuite.keyExchange.name) != null) { - throw new SSLPeerUnverifiedException("no certificates expected" - + " for " + cipherSuite.keyExchange + " cipher suites"); - } if (peerCerts == null) { throw new SSLPeerUnverifiedException("peer not authenticated"); } @@ -485,8 +544,8 @@ * Return the cert chain presented by the peer in the * javax.security.cert format. * Note: This method can be used only when using certificate-based - * cipher suites; using it with non-certificate-based cipher suites, - * such as Kerberos, will throw an SSLPeerUnverifiedException. + * cipher suites; using it with non-certificate-based cipher suites + * will throw an SSLPeerUnverifiedException. * * @return array of peer X.509 certs, with the peer's own cert * first in the chain, and with the "root" CA last. @@ -504,10 +563,6 @@ // change record of peer identity even by accident, much // less do it intentionally. // - if (ClientKeyExchangeService.find(cipherSuite.keyExchange.name) != null) { - throw new SSLPeerUnverifiedException("no certificates expected" - + " for " + cipherSuite.keyExchange + " cipher suites"); - } if (peerCerts == null) { throw new SSLPeerUnverifiedException("peer not authenticated"); } @@ -531,8 +586,8 @@ /** * Return the cert chain presented by the peer. * Note: This method can be used only when using certificate-based - * cipher suites; using it with non-certificate-based cipher suites, - * such as Kerberos, will throw an SSLPeerUnverifiedException. + * cipher suites; using it with non-certificate-based cipher suites + * will throw an SSLPeerUnverifiedException. * * @return array of peer X.509 certs, with the peer's own cert * first in the chain, and with the "root" CA last. @@ -544,10 +599,6 @@ * change record of peer identity even by accident, much * less do it intentionally. */ - if (ClientKeyExchangeService.find(cipherSuite.keyExchange.name) != null) { - throw new SSLPeerUnverifiedException("no certificates expected" - + " for " + cipherSuite.keyExchange + " cipher suites"); - } if (peerCerts != null) { return peerCerts.clone(); } else { @@ -584,8 +635,7 @@ * defining the session. * * @return the peer's principal. Returns an X500Principal of the - * end-entity certificate for X509-based cipher suites, and - * Principal for Kerberos cipher suites, etc. + * end-entity certificate for X509-based cipher suites. * * @throws SSLPeerUnverifiedException if the peer's identity has not * been verified @@ -594,13 +644,6 @@ public Principal getPeerPrincipal() throws SSLPeerUnverifiedException { - if (ClientKeyExchangeService.find(cipherSuite.keyExchange.name) != null) { - if (peerPrincipal == null) { - throw new SSLPeerUnverifiedException("peer not authenticated"); - } else { - return peerPrincipal; - } - } if (peerCerts == null) { throw new SSLPeerUnverifiedException("peer not authenticated"); } @@ -611,20 +654,22 @@ * Returns the principal that was sent to the peer during handshaking. * * @return the principal sent to the peer. Returns an X500Principal - * of the end-entity certificate for X509-based cipher suites, and - * Principal for Kerberos cipher suites, etc. If no principal was - * sent, then null is returned. + * of the end-entity certificate for X509-based cipher suites. + * If no principal was sent, then null is returned. */ @Override public Principal getLocalPrincipal() { - - if (ClientKeyExchangeService.find(cipherSuite.keyExchange.name) != null) { - return (localPrincipal == null ? null : localPrincipal); - } - return (localCerts == null ? null : + return ((localCerts == null || localCerts.length == 0) ? null : localCerts[0].getSubjectX500Principal()); } + /* + * Return the time the ticket for this session was created. + */ + public long getTicketCreationTime() { + return ticketCreationTime; + } + /** * Returns the time this session was created. */ @@ -695,14 +740,21 @@ if (this == nullSession) { return; } - invalidated = true; - if (debug != null && Debug.isOn("session")) { - System.out.println("%% Invalidated: " + this); - } + if (context != null) { context.remove(sessionId); context = null; } + if (invalidated) { + return; + } + invalidated = true; + if (SSLLogger.isOn && SSLLogger.isOn("session")) { + SSLLogger.finest("Invalidated session: " + this); + } + for (SSLSessionImpl child : childSessions) { + child.invalidate(); + } } /* @@ -710,7 +762,8 @@ * key and the calling security context. This is important since * sessions can be shared across different protection domains. */ - private Hashtable<SecureKey, Object> table = new Hashtable<>(); + private final ConcurrentHashMap<SecureKey, Object> boundValues = + new ConcurrentHashMap<>(); /** * Assigns a session value. Session change events are given if @@ -723,7 +776,7 @@ } SecureKey secureKey = new SecureKey(key); - Object oldValue = table.put(secureKey, value); + Object oldValue = boundValues.put(secureKey, value); if (oldValue instanceof SSLSessionBindingListener) { SSLSessionBindingEvent e; @@ -739,7 +792,6 @@ } } - /** * Returns the specified session value. */ @@ -750,7 +802,7 @@ } SecureKey secureKey = new SecureKey(key); - return table.get(secureKey); + return boundValues.get(secureKey); } @@ -765,7 +817,7 @@ } SecureKey secureKey = new SecureKey(key); - Object value = table.remove(secureKey); + Object value = boundValues.remove(secureKey); if (value instanceof SSLSessionBindingListener) { SSLSessionBindingEvent e; @@ -781,22 +833,17 @@ */ @Override public String[] getValueNames() { - Enumeration<SecureKey> e; - Vector<Object> v = new Vector<>(); - SecureKey key; + ArrayList<Object> v = new ArrayList<>(); Object securityCtx = SecureKey.getCurrentSecurityContext(); - - for (e = table.keys(); e.hasMoreElements(); ) { - key = e.nextElement(); - + for (Enumeration<SecureKey> e = boundValues.keys(); + e.hasMoreElements(); ) { + SecureKey key = e.nextElement(); if (securityCtx.equals(key.getSecurityContext())) { - v.addElement(key.getAppKey()); + v.add(key.getAppKey()); } } - String[] names = new String[v.size()]; - v.copyInto(names); - return names; + return v.toArray(new String[0]); } /** @@ -813,7 +860,8 @@ * to "true". */ private boolean acceptLargeFragments = - Debug.getBooleanProperty("jsse.SSLEngine.acceptLargeFragments", false); + Utilities.getBooleanProperty( + "jsse.SSLEngine.acceptLargeFragments", false); /** * Expand the buffer size of both SSL/TLS network packet and @@ -835,7 +883,7 @@ if (negotiatedMaxFragLen > 0) { packetSize = cipherSuite.calculatePacketSize( negotiatedMaxFragLen, protocolVersion, - protocolVersion.isDTLSProtocol()); + protocolVersion.isDTLS); } if (maximumPacketSize > 0) { @@ -847,7 +895,7 @@ return packetSize; } - if (protocolVersion.isDTLSProtocol()) { + if (protocolVersion.isDTLS) { return DTLSRecord.maxRecordSize; } else { return acceptLargeFragments ? @@ -867,7 +915,7 @@ if (maximumPacketSize > 0) { fragmentSize = cipherSuite.calculateFragSize( maximumPacketSize, protocolVersion, - protocolVersion.isDTLSProtocol()); + protocolVersion.isDTLS); } if (negotiatedMaxFragLen > 0) { @@ -879,7 +927,7 @@ return fragmentSize; } - if (protocolVersion.isDTLSProtocol()) { + if (protocolVersion.isDTLS) { return Record.maxDataSize; } else { int maxPacketSize = acceptLargeFragments ? @@ -922,16 +970,20 @@ } /** - * Gets an array of supported signature algorithms that the local side is - * willing to verify. + * Gets an array of supported signature algorithm names that the local + * side is willing to verify. */ @Override public String[] getLocalSupportedSignatureAlgorithms() { - if (localSupportedSignAlgs != null) { - return localSupportedSignAlgs.clone(); - } + return SignatureScheme.getAlgorithmNames(localSupportedSignAlgs); + } - return new String[0]; + /** + * Gets an array of supported signature schemes that the local side is + * willing to verify. + */ + public Collection<SignatureScheme> getLocalSupportedSignatureSchemes() { + return localSupportedSignAlgs; } /** @@ -953,33 +1005,24 @@ */ @Override public List<SNIServerName> getRequestedServerNames() { - if (requestedServerNames != null && !requestedServerNames.isEmpty()) { - return Collections.<SNIServerName>unmodifiableList( - requestedServerNames); - } - - return Collections.<SNIServerName>emptyList(); + return requestedServerNames; } /** Returns a string representation of this SSL session */ @Override public String toString() { - return "[Session-" + sessionCount - + ", " + getCipherSuite() - + "]"; + return "Session(" + creationTime + "|" + getCipherSuite() + ")"; } - } - /** * This "struct" class serves as a Hash Key that combines an * application-specific key and a security context. */ class SecureKey { - private static Object nullObject = new Object(); - private Object appKey; - private Object securityCtx; + private static final Object nullObject = new Object(); + private final Object appKey; + private final Object securityCtx; static Object getCurrentSecurityContext() { SecurityManager sm = System.getSecurityManager(); diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSocketFactoryImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ */ public final class SSLSocketFactoryImpl extends SSLSocketFactory { - private SSLContextImpl context; + private final SSLContextImpl context; /** * Constructor used to instantiate the default factory. This method is @@ -180,7 +180,7 @@ */ @Override public String[] getDefaultCipherSuites() { - return context.getDefaultCipherSuiteList(false).toStringArray(); + return CipherSuite.namesOf(context.getDefaultCipherSuites(false)); } /** @@ -193,6 +193,6 @@ */ @Override public String[] getSupportedCipherSuites() { - return context.getSupportedCipherSuiteList().toStringArray(); + return CipherSuite.namesOf(context.getSupportedCipherSuites()); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSocketImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,35 +23,41 @@ * questions. */ - package sun.security.ssl; -import java.io.*; -import java.nio.*; -import java.net.*; -import java.security.GeneralSecurityException; -import java.security.AccessController; -import java.security.AccessControlContext; -import java.security.PrivilegedAction; -import java.security.AlgorithmConstraints; -import java.util.*; -import java.util.concurrent.TimeUnit; -import java.util.concurrent.locks.ReentrantLock; +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.io.InterruptedIOException; +import java.io.OutputStream; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.net.SocketAddress; +import java.net.SocketException; +import java.net.UnknownHostException; +import java.nio.ByteBuffer; +import java.util.List; import java.util.function.BiFunction; - -import javax.crypto.BadPaddingException; -import javax.net.ssl.*; - +import javax.net.ssl.HandshakeCompletedListener; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLProtocolException; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocket; import jdk.internal.misc.JavaNetInetAddressAccess; import jdk.internal.misc.SharedSecrets; /** - * Implementation of an SSL socket. This is a normal connection type - * socket, implementing SSL over some lower level socket, such as TCP. - * Because it is layered over some lower level socket, it MUST override - * all default socket methods. - * - * <P> This API offers a non-traditional option for establishing SSL + * Implementation of an SSL socket. + * <P> + * This is a normal connection type socket, implementing SSL over some lower + * level socket, such as TCP. Because it is layered over some lower level + * socket, it MUST override all default socket methods. + * <P> + * This API offers a non-traditional option for establishing SSL * connections. You may first establish the connection directly, then pass * that connection to the SSL socket constructor with a flag saying which * role should be taken in the handshake protocol. (The two ends of the @@ -64,328 +70,19 @@ * * @author David Brownell */ -public final class SSLSocketImpl extends BaseSSLSocketImpl { - - /* - * ERROR HANDLING GUIDELINES - * (which exceptions to throw and catch and which not to throw and catch) - * - * . if there is an IOException (SocketException) when accessing the - * underlying Socket, pass it through - * - * . do not throw IOExceptions, throw SSLExceptions (or a subclass) - * - * . for internal errors (things that indicate a bug in JSSE or a - * grossly misconfigured J2RE), throw either an SSLException or - * a RuntimeException at your convenience. - * - * . handshaking code (Handshaker or HandshakeMessage) should generally - * pass through exceptions, but can handle them if they know what to - * do. - * - * . exception chaining should be used for all new code. If you happen - * to touch old code that does not use chaining, you should change it. - * - * . there is a top level exception handler that sits at all entry - * points from application code to SSLSocket read/write code. It - * makes sure that all errors are handled (see handleException()). - * - * . JSSE internal code should generally not call close(), call - * closeInternal(). - */ - - /* - * There's a state machine associated with each connection, which - * among other roles serves to negotiate session changes. - * - * - START with constructor, until the TCP connection's around. - * - HANDSHAKE picks session parameters before allowing traffic. - * There are many substates due to sequencing requirements - * for handshake messages. - * - DATA may be transmitted. - * - RENEGOTIATE state allows concurrent data and handshaking - * traffic ("same" substates as HANDSHAKE), and terminates - * in selection of new session (and connection) parameters - * - ERROR state immediately precedes abortive disconnect. - * - SENT_CLOSE sent a close_notify to the peer. For layered, - * non-autoclose socket, must now read close_notify - * from peer before closing the connection. For nonlayered or - * non-autoclose socket, close connection and go onto - * cs_CLOSED state. - * - CLOSED after sending close_notify alert, & socket is closed. - * SSL connection objects are not reused. - * - APP_CLOSED once the application calls close(). Then it behaves like - * a closed socket, e.g.. getInputStream() throws an Exception. - * - * State affects what SSL record types may legally be sent: - * - * - Handshake ... only in HANDSHAKE and RENEGOTIATE states - * - App Data ... only in DATA and RENEGOTIATE states - * - Alert ... in HANDSHAKE, DATA, RENEGOTIATE - * - * Re what may be received: same as what may be sent, except that - * HandshakeRequest handshaking messages can come from servers even - * in the application data state, to request entry to RENEGOTIATE. - * - * The state machine within HANDSHAKE and RENEGOTIATE states controls - * the pending session, not the connection state, until the change - * cipher spec and "Finished" handshake messages are processed and - * make the "new" session become the current one. - * - * NOTE: details of the SMs always need to be nailed down better. - * The text above illustrates the core ideas. - * - * +---->-------+------>--------->-------+ - * | | | - * <-----< ^ ^ <-----< v - *START>----->HANDSHAKE>----->DATA>----->RENEGOTIATE SENT_CLOSE - * v v v | | - * | | | | v - * +------------+---------------+ v ERROR - * | | | - * v | | - * ERROR>------>----->CLOSED<--------<----+-- + - * | - * v - * APP_CLOSED - * - * ALSO, note that the purpose of handshaking (renegotiation is - * included) is to assign a different, and perhaps new, session to - * the connection. The SSLv3 spec is a bit confusing on that new - * protocol feature. - */ - private static final int cs_START = 0; - private static final int cs_HANDSHAKE = 1; - private static final int cs_DATA = 2; - private static final int cs_RENEGOTIATE = 3; - private static final int cs_ERROR = 4; - private static final int cs_SENT_CLOSE = 5; - private static final int cs_CLOSED = 6; - private static final int cs_APP_CLOSED = 7; - - /* - * Drives the protocol state machine. - */ - private volatile int connectionState; - - /* - * Flag indicating if the next record we receive MUST be a Finished - * message. Temporarily set during the handshake to ensure that - * a change cipher spec message is followed by a finished message. - */ - private boolean expectingFinished; - - /* - * For improved diagnostics, we detail connection closure - * If the socket is closed (connectionState >= cs_ERROR), - * closeReason != null indicates if the socket was closed - * because of an error or because or normal shutdown. - */ - private SSLException closeReason; - - /* - * Per-connection private state that doesn't change when the - * session is changed. - */ - private ClientAuthType doClientAuth = - ClientAuthType.CLIENT_AUTH_NONE; - private boolean roleIsServer; - private boolean enableSessionCreation = true; - private String host; - private boolean autoClose = true; - private AccessControlContext acc; - - // The cipher suites enabled for use on this connection. - private CipherSuiteList enabledCipherSuites; - - // The endpoint identification protocol - private String identificationProtocol = null; - - // The cryptographic algorithm constraints - private AlgorithmConstraints algorithmConstraints = null; - - // The server name indication and matchers - List<SNIServerName> serverNames = - Collections.<SNIServerName>emptyList(); - Collection<SNIMatcher> sniMatchers = - Collections.<SNIMatcher>emptyList(); - - // Is the serverNames set to empty with SSLParameters.setServerNames()? - private boolean noSniExtension = false; - - // Is the sniMatchers set to empty with SSLParameters.setSNIMatchers()? - private boolean noSniMatcher = false; - - // Configured application protocol values - String[] applicationProtocols = new String[0]; - - // Negotiated application protocol value. - // - // The value under negotiation will be obtained from handshaker. - String applicationProtocol = null; - - // Callback function that selects the application protocol value during - // the SSL/TLS handshake. - BiFunction<SSLSocket, List<String>, String> applicationProtocolSelector; - - /* - * READ ME * READ ME * READ ME * READ ME * READ ME * READ ME * - * IMPORTANT STUFF TO UNDERSTANDING THE SYNCHRONIZATION ISSUES. - * READ ME * READ ME * READ ME * READ ME * READ ME * READ ME * - * - * There are several locks here. - * - * The primary lock is the per-instance lock used by - * synchronized(this) and the synchronized methods. It controls all - * access to things such as the connection state and variables which - * affect handshaking. If we are inside a synchronized method, we - * can access the state directly, otherwise, we must use the - * synchronized equivalents. - * - * The handshakeLock is used to ensure that only one thread performs - * the *complete initial* handshake. If someone is handshaking, any - * stray application or startHandshake() requests who find the - * connection state is cs_HANDSHAKE will stall on handshakeLock - * until handshaking is done. Once the handshake is done, we either - * succeeded or failed, but we can never go back to the cs_HANDSHAKE - * or cs_START state again. - * - * Note that the read/write() calls here in SSLSocketImpl are not - * obviously synchronized. In fact, it's very nonintuitive, and - * requires careful examination of code paths. Grab some coffee, - * and be careful with any code changes. - * - * There can be only three threads active at a time in the I/O - * subsection of this class. - * 1. startHandshake - * 2. AppInputStream - * 3. AppOutputStream - * One thread could call startHandshake(). - * AppInputStream/AppOutputStream read() and write() calls are each - * synchronized on 'this' in their respective classes, so only one - * app. thread will be doing a SSLSocketImpl.read() or .write()'s at - * a time. - * - * If handshaking is required (state cs_HANDSHAKE), and - * getConnectionState() for some/all threads returns cs_HANDSHAKE, - * only one can grab the handshakeLock, and the rest will stall - * either on getConnectionState(), or on the handshakeLock if they - * happen to successfully race through the getConnectionState(). - * - * If a writer is doing the initial handshaking, it must create a - * temporary reader to read the responses from the other side. As a - * side-effect, the writer's reader will have priority over any - * other reader. However, the writer's reader is not allowed to - * consume any application data. When handshakeLock is finally - * released, we either have a cs_DATA connection, or a - * cs_CLOSED/cs_ERROR socket. - * - * The writeLock is held while writing on a socket connection and - * also to protect the MAC and cipher for their direction. The - * writeLock is package private for Handshaker which holds it while - * writing the ChangeCipherSpec message. - * - * To avoid the problem of a thread trying to change operational - * modes on a socket while handshaking is going on, we synchronize - * on 'this'. If handshaking has not started yet, we tell the - * handshaker to change its mode. If handshaking has started, - * we simply store that request until the next pending session - * is created, at which time the new handshaker's state is set. - * - * The readLock is held during readRecord(), which is responsible - * for reading an SSLInputRecord, decrypting it, and processing it. - * The readLock ensures that these three steps are done atomically - * and that once started, no other thread can block on SSLInputRecord.read. - * This is necessary so that processing of close_notify alerts - * from the peer are handled properly. - */ - private final Object handshakeLock = new Object(); - final ReentrantLock writeLock = new ReentrantLock(); - private final Object readLock = new Object(); - - InputRecord inputRecord; - OutputRecord outputRecord; - - /* - * security parameters for secure renegotiation. - */ - private boolean secureRenegotiation; - private byte[] clientVerifyData; - private byte[] serverVerifyData; - - /* - * The authentication context holds all information used to establish - * who this end of the connection is (certificate chains, private keys, - * etc) and who is trusted (e.g. as CAs or websites). - */ - private SSLContextImpl sslContext; - - - /* - * This connection is one of (potentially) many associated with - * any given session. The output of the handshake protocol is a - * new session ... although all the protocol description talks - * about changing the cipher spec (and it does change), in fact - * that's incidental since it's done by changing everything that - * is associated with a session at the same time. (TLS/IETF may - * change that to add client authentication w/o new key exchg.) - */ - private Handshaker handshaker; - private SSLSessionImpl sess; - private volatile SSLSessionImpl handshakeSession; - - - /* - * If anyone wants to get notified about handshake completions, - * they'll show up on this list. - */ - private HashMap<HandshakeCompletedListener, AccessControlContext> - handshakeListeners; - - /* - * Reuse the same internal input/output streams. - */ - private InputStream sockInput; - private OutputStream sockOutput; - - - /* - * These input and output streams block their data in SSL records, - * and usually arrange integrity and privacy protection for those - * records. The guts of the SSL protocol are wrapped up in these - * streams, and in the handshaking that establishes the details of - * that integrity and privacy protection. - */ - private AppInputStream input; - private AppOutputStream output; - - /* - * The protocol versions enabled for use on this connection. - * - * Note: we support a pseudo protocol called SSLv2Hello which when - * set will result in an SSL v2 Hello being sent with SSL (version 3.0) - * or TLS (version 3.1, 3.2, etc.) version info. - */ - private ProtocolList enabledProtocols; - - /* - * The SSL version associated with this connection. - */ - private ProtocolVersion protocolVersion = ProtocolVersion.DEFAULT_TLS; +public final class SSLSocketImpl + extends BaseSSLSocketImpl implements SSLTransport { - /* Class and subclass dynamic debugging support */ - private static final Debug debug = Debug.getInstance("ssl"); + final SSLContextImpl sslContext; + final TransportContext conContext; - /* - * Whether local cipher suites preference in server side should be - * honored during handshaking? - */ - private boolean preferLocalCipherSuites = false; + private final AppInputStream appInput = new AppInputStream(); + private final AppOutputStream appOutput = new AppOutputStream(); - /* - * The maximum expected network packet size for SSL/TLS/DTLS records. - */ - private int maximumPacketSize = 0; + private String peerHost; + private boolean autoClose; + private boolean isConnected = false; + private boolean tlsIsClosed = false; /* * Is the local name service trustworthy? @@ -393,177 +90,127 @@ * If the local name service is not trustworthy, reverse host name * resolution should not be performed for endpoint identification. */ - static final boolean trustNameService = - Debug.getBooleanProperty("jdk.tls.trustNameService", false); - - // - // CONSTRUCTORS AND INITIALIZATION CODE - // + private static final boolean trustNameService = + Utilities.getBooleanProperty("jdk.tls.trustNameService", false); /** - * Constructs an SSL connection to a named host at a specified port, - * using the authentication context provided. This endpoint acts as - * the client, and may rejoin an existing SSL session if appropriate. + * Package-private constructor used to instantiate an unconnected + * socket. * - * @param context authentication context to use - * @param host name of the host with which to connect - * @param port number of the server's port + * This instance is meant to set handshake state to use "client mode". */ - SSLSocketImpl(SSLContextImpl context, String host, int port) - throws IOException, UnknownHostException { + SSLSocketImpl(SSLContextImpl sslContext) { super(); - this.host = host; - this.serverNames = - Utilities.addToSNIServerNameList(this.serverNames, this.host); - init(context, false); - SocketAddress socketAddress = - host != null ? new InetSocketAddress(host, port) : - new InetSocketAddress(InetAddress.getByName(null), port); - connect(socketAddress, 0); + this.sslContext = sslContext; + HandshakeHash handshakeHash = new HandshakeHash(); + this.conContext = new TransportContext(sslContext, this, + new SSLSocketInputRecord(handshakeHash), + new SSLSocketOutputRecord(handshakeHash), true); } - /** - * Constructs an SSL connection to a server at a specified address. - * and TCP port, using the authentication context provided. This - * endpoint acts as the client, and may rejoin an existing SSL session - * if appropriate. + * Package-private constructor used to instantiate a server socket. * - * @param context authentication context to use - * @param address the server's host - * @param port its port + * This instance is meant to set handshake state to use "server mode". */ - SSLSocketImpl(SSLContextImpl context, InetAddress host, int port) - throws IOException { + SSLSocketImpl(SSLContextImpl sslContext, SSLConfiguration sslConfig) { super(); - init(context, false); - SocketAddress socketAddress = new InetSocketAddress(host, port); - connect(socketAddress, 0); + this.sslContext = sslContext; + HandshakeHash handshakeHash = new HandshakeHash(); + this.conContext = new TransportContext(sslContext, this, sslConfig, + new SSLSocketInputRecord(handshakeHash), + new SSLSocketOutputRecord(handshakeHash)); } /** - * Constructs an SSL connection to a named host at a specified port, - * using the authentication context provided. This endpoint acts as - * the client, and may rejoin an existing SSL session if appropriate. + * Constructs an SSL connection to a named host at a specified + * port, using the authentication context provided. * - * @param context authentication context to use - * @param host name of the host with which to connect - * @param port number of the server's port - * @param localAddr the local address the socket is bound to - * @param localPort the local port the socket is bound to + * This endpoint acts as the client, and may rejoin an existing SSL session + * if appropriate. */ - SSLSocketImpl(SSLContextImpl context, String host, int port, - InetAddress localAddr, int localPort) - throws IOException, UnknownHostException { + SSLSocketImpl(SSLContextImpl sslContext, String peerHost, + int peerPort) throws IOException, UnknownHostException { super(); - this.host = host; - this.serverNames = - Utilities.addToSNIServerNameList(this.serverNames, this.host); - init(context, false); - bind(new InetSocketAddress(localAddr, localPort)); + this.sslContext = sslContext; + HandshakeHash handshakeHash = new HandshakeHash(); + this.conContext = new TransportContext(sslContext, this, + new SSLSocketInputRecord(handshakeHash), + new SSLSocketOutputRecord(handshakeHash), true); + this.peerHost = peerHost; SocketAddress socketAddress = - host != null ? new InetSocketAddress(host, port) : - new InetSocketAddress(InetAddress.getByName(null), port); + peerHost != null ? new InetSocketAddress(peerHost, peerPort) : + new InetSocketAddress(InetAddress.getByName(null), peerPort); connect(socketAddress, 0); } - /** - * Constructs an SSL connection to a server at a specified address. - * and TCP port, using the authentication context provided. This - * endpoint acts as the client, and may rejoin an existing SSL session - * if appropriate. + * Constructs an SSL connection to a server at a specified + * address, and TCP port, using the authentication context + * provided. * - * @param context authentication context to use - * @param address the server's host - * @param port its port - * @param localAddr the local address the socket is bound to - * @param localPort the local port the socket is bound to + * This endpoint acts as the client, and may rejoin an existing SSL + * session if appropriate. */ - SSLSocketImpl(SSLContextImpl context, InetAddress host, int port, - InetAddress localAddr, int localPort) - throws IOException { + SSLSocketImpl(SSLContextImpl sslContext, + InetAddress address, int peerPort) throws IOException { super(); - init(context, false); - bind(new InetSocketAddress(localAddr, localPort)); - SocketAddress socketAddress = new InetSocketAddress(host, port); + this.sslContext = sslContext; + HandshakeHash handshakeHash = new HandshakeHash(); + this.conContext = new TransportContext(sslContext, this, + new SSLSocketInputRecord(handshakeHash), + new SSLSocketOutputRecord(handshakeHash), true); + + SocketAddress socketAddress = new InetSocketAddress(address, peerPort); connect(socketAddress, 0); } - /* - * Package-private constructor used ONLY by SSLServerSocket. The - * java.net package accepts the TCP connection after this call is - * made. This just initializes handshake state to use "server mode", - * giving control over the use of SSL client authentication. + /** + * Constructs an SSL connection to a named host at a specified + * port, using the authentication context provided. + * + * This endpoint acts as the client, and may rejoin an existing SSL + * session if appropriate. */ - SSLSocketImpl(SSLContextImpl context, boolean serverMode, - CipherSuiteList suites, ClientAuthType clientAuth, - boolean sessionCreation, ProtocolList protocols, - String identificationProtocol, - AlgorithmConstraints algorithmConstraints, - Collection<SNIMatcher> sniMatchers, - boolean preferLocalCipherSuites, - String[] applicationProtocols) throws IOException { - + SSLSocketImpl(SSLContextImpl sslContext, + String peerHost, int peerPort, InetAddress localAddr, + int localPort) throws IOException, UnknownHostException { super(); - doClientAuth = clientAuth; - enableSessionCreation = sessionCreation; - this.identificationProtocol = identificationProtocol; - this.algorithmConstraints = algorithmConstraints; - this.sniMatchers = sniMatchers; - this.preferLocalCipherSuites = preferLocalCipherSuites; - this.applicationProtocols = applicationProtocols; - init(context, serverMode); + this.sslContext = sslContext; + HandshakeHash handshakeHash = new HandshakeHash(); + this.conContext = new TransportContext(sslContext, this, + new SSLSocketInputRecord(handshakeHash), + new SSLSocketOutputRecord(handshakeHash), true); + this.peerHost = peerHost; - /* - * Override what was picked out for us. - */ - enabledCipherSuites = suites; - enabledProtocols = protocols; + bind(new InetSocketAddress(localAddr, localPort)); + SocketAddress socketAddress = + peerHost != null ? new InetSocketAddress(peerHost, peerPort) : + new InetSocketAddress(InetAddress.getByName(null), peerPort); + connect(socketAddress, 0); } - /** - * Package-private constructor used to instantiate an unconnected - * socket. The java.net package will connect it, either when the - * connect() call is made by the application. This instance is - * meant to set handshake state to use "client mode". - */ - SSLSocketImpl(SSLContextImpl context) { + * Constructs an SSL connection to a server at a specified + * address, and TCP port, using the authentication context + * provided. + * + * This endpoint acts as the client, and may rejoin an existing SSL + * session if appropriate. + */ + SSLSocketImpl(SSLContextImpl sslContext, + InetAddress peerAddr, int peerPort, + InetAddress localAddr, int localPort) throws IOException { super(); - init(context, false); - } + this.sslContext = sslContext; + HandshakeHash handshakeHash = new HandshakeHash(); + this.conContext = new TransportContext(sslContext, this, + new SSLSocketInputRecord(handshakeHash), + new SSLSocketOutputRecord(handshakeHash), true); - - /** - * Layer SSL traffic over an existing connection, rather than creating - * a new connection. The existing connection may be used only for SSL - * traffic (using this SSLSocket) until the SSLSocket.close() call - * returns. However, if a protocol error is detected, that existing - * connection is automatically closed. - * - * <P> This particular constructor always uses the socket in the - * role of an SSL client. It may be useful in cases which start - * using SSL after some initial data transfers, for example in some - * SSL tunneling applications or as part of some kinds of application - * protocols which negotiate use of a SSL based security. - * - * @param sock the existing connection - * @param context the authentication context to use - */ - SSLSocketImpl(SSLContextImpl context, Socket sock, String host, - int port, boolean autoClose) throws IOException { - super(sock); - // We always layer over a connected socket - if (!sock.isConnected()) { - throw new SocketException("Underlying socket is not connected"); - } - this.host = host; - this.serverNames = - Utilities.addToSNIServerNameList(this.serverNames, this.host); - init(context, false); - this.autoClose = autoClose; - doneConnect(); + bind(new InetSocketAddress(localAddr, localPort)); + SocketAddress socketAddress = new InetSocketAddress(peerAddr, peerPort); + connect(socketAddress, 0); } /** @@ -572,7 +219,7 @@ * already been consumed/removed from the {@link Socket}'s * underlying {@link InputStream}. */ - SSLSocketImpl(SSLContextImpl context, Socket sock, + SSLSocketImpl(SSLContextImpl sslContext, Socket sock, InputStream consumed, boolean autoClose) throws IOException { super(sock, consumed); // We always layer over a connected socket @@ -580,70 +227,51 @@ throw new SocketException("Underlying socket is not connected"); } - // In server mode, it is not necessary to set host and serverNames. - // Otherwise, would require a reverse DNS lookup to get the hostname. - - init(context, true); + this.sslContext = sslContext; + HandshakeHash handshakeHash = new HandshakeHash(); + this.conContext = new TransportContext(sslContext, this, + new SSLSocketInputRecord(handshakeHash), + new SSLSocketOutputRecord(handshakeHash), false); this.autoClose = autoClose; doneConnect(); } /** - * Initializes the client socket. + * Layer SSL traffic over an existing connection, rather than + * creating a new connection. + * + * The existing connection may be used only for SSL traffic (using this + * SSLSocket) until the SSLSocket.close() call returns. However, if a + * protocol error is detected, that existing connection is automatically + * closed. + * <p> + * This particular constructor always uses the socket in the + * role of an SSL client. It may be useful in cases which start + * using SSL after some initial data transfers, for example in some + * SSL tunneling applications or as part of some kinds of application + * protocols which negotiate use of a SSL based security. */ - private void init(SSLContextImpl context, boolean isServer) { - sslContext = context; - sess = SSLSessionImpl.nullSession; - handshakeSession = null; - - /* - * role is as specified, state is START until after - * the low level connection's established. - */ - roleIsServer = isServer; - connectionState = cs_START; - - // initial security parameters for secure renegotiation - secureRenegotiation = false; - clientVerifyData = new byte[0]; - serverVerifyData = new byte[0]; - - enabledCipherSuites = - sslContext.getDefaultCipherSuiteList(roleIsServer); - enabledProtocols = - sslContext.getDefaultProtocolList(roleIsServer); - - inputRecord = new SSLSocketInputRecord();; - outputRecord = new SSLSocketOutputRecord(); - - maximumPacketSize = outputRecord.getMaxPacketSize(); - - // save the acc - acc = AccessController.getContext(); + SSLSocketImpl(SSLContextImpl sslContext, Socket sock, + String peerHost, int port, boolean autoClose) throws IOException { + super(sock); + // We always layer over a connected socket + if (!sock.isConnected()) { + throw new SocketException("Underlying socket is not connected"); + } - input = new AppInputStream(this); - output = new AppOutputStream(this); + this.sslContext = sslContext; + HandshakeHash handshakeHash = new HandshakeHash(); + this.conContext = new TransportContext(sslContext, this, + new SSLSocketInputRecord(handshakeHash), + new SSLSocketOutputRecord(handshakeHash), true); + this.peerHost = peerHost; + this.autoClose = autoClose; + doneConnect(); } - /** - * Connects this socket to the server with a specified timeout - * value. - * - * This method is either called on an unconnected SSLSocketImpl by the - * application, or it is called in the constructor of a regular - * SSLSocketImpl. If we are layering on top on another socket, then - * this method should not be called, because we assume that the - * underlying socket is already connected by the time it is passed to - * us. - * - * @param endpoint the <code>SocketAddress</code> - * @param timeout the timeout value to be used, 0 is no timeout - * @throws IOException if an error occurs during the connection - * @throws SocketTimeoutException if timeout expires before connecting - */ @Override - public void connect(SocketAddress endpoint, int timeout) - throws IOException { + public void connect(SocketAddress endpoint, + int timeout) throws IOException { if (isLayered()) { throw new SocketException("Already connected"); @@ -651,2093 +279,899 @@ if (!(endpoint instanceof InetSocketAddress)) { throw new SocketException( - "Cannot handle non-Inet socket addresses."); + "Cannot handle non-Inet socket addresses."); } super.connect(endpoint, timeout); - - if (host == null || host.length() == 0) { - useImplicitHost(false); - } - doneConnect(); } - /** - * Initialize the handshaker and socket streams. - * - * Called by connect, the layered constructor, and SSLServerSocket. - */ - void doneConnect() throws IOException { - /* - * Save the input and output streams. May be done only after - * java.net actually connects using the socket "self", else - * we get some pretty bizarre failure modes. - */ - sockInput = super.getInputStream(); - sockOutput = super.getOutputStream(); - - inputRecord.setDeliverStream(sockOutput); - outputRecord.setDeliverStream(sockOutput); + @Override + public String[] getSupportedCipherSuites() { + return CipherSuite.namesOf(sslContext.getSupportedCipherSuites()); + } - /* - * Move to handshaking state, with pending session initialized - * to defaults and the appropriate kind of handshaker set up. - */ - initHandshaker(); + @Override + public synchronized String[] getEnabledCipherSuites() { + return CipherSuite.namesOf(conContext.sslConfig.enabledCipherSuites); } - private synchronized int getConnectionState() { - return connectionState; + @Override + public synchronized void setEnabledCipherSuites(String[] suites) { + conContext.sslConfig.enabledCipherSuites = + CipherSuite.validValuesOf(suites); } - private synchronized void setConnectionState(int state) { - connectionState = state; + @Override + public String[] getSupportedProtocols() { + return ProtocolVersion.toStringArray( + sslContext.getSupportedProtocolVersions()); } - AccessControlContext getAcc() { - return acc; + @Override + public synchronized String[] getEnabledProtocols() { + return ProtocolVersion.toStringArray( + conContext.sslConfig.enabledProtocols); } - // - // READING AND WRITING RECORDS - // + @Override + public synchronized void setEnabledProtocols(String[] protocols) { + if (protocols == null) { + throw new IllegalArgumentException("Protocols cannot be null"); + } - /* - * Application data record output. - * - * Application data can't be sent until the first handshake establishes - * a session. - */ - void writeRecord(byte[] source, int offset, int length) throws IOException { - /* - * The loop is in case of HANDSHAKE --> ERROR transitions, etc - */ - // Don't bother to check the emptiness of source applicatoin data - // before the security connection established. - for (boolean readyForApp = false; !readyForApp;) { - /* - * Not all states support passing application data. We - * synchronize access to the connection state, so that - * synchronous handshakes can complete cleanly. - */ - switch (getConnectionState()) { + conContext.sslConfig.enabledProtocols = + ProtocolVersion.namesOf(protocols); + } - /* - * We've deferred the initial handshaking till just now, - * when presumably a thread's decided it's OK to block for - * longish periods of time for I/O purposes (as well as - * configured the cipher suites it wants to use). - */ - case cs_HANDSHAKE: - performInitialHandshake(); - break; + @Override + public synchronized SSLSession getSession() { + try { + // start handshaking, if failed, the connection will be closed. + ensureNegotiated(); + } catch (IOException ioe) { + if (SSLLogger.isOn && SSLLogger.isOn("handshake")) { + SSLLogger.severe("handshake failed", ioe); + } - case cs_DATA: - case cs_RENEGOTIATE: - readyForApp = true; - break; + return SSLSessionImpl.nullSession; + } - case cs_ERROR: - fatal(Alerts.alert_close_notify, - "error while writing to socket"); - break; // dummy - - case cs_SENT_CLOSE: - case cs_CLOSED: - case cs_APP_CLOSED: - // we should never get here (check in AppOutputStream) - // this is just a fallback - if (closeReason != null) { - throw closeReason; - } else { - throw new SocketException("Socket closed"); - } + return conContext.conSession; + } - /* - * Else something's goofy in this state machine's use. - */ - default: - throw new SSLProtocolException( - "State error, send app data"); - } + @Override + public synchronized SSLSession getHandshakeSession() { + if (conContext.handshakeContext != null) { + return conContext.handshakeContext.handshakeSession; } - // - // Don't bother to really write empty records. We went this - // far to drive the handshake machinery, for correctness; not - // writing empty records improves performance by cutting CPU - // time and network resource usage. However, some protocol - // implementations are fragile and don't like to see empty - // records, so this also increases robustness. - // - if (length > 0) { - IOException ioe = null; - byte description = 0; // 0: never used, make the compiler happy - writeLock.lock(); - try { - outputRecord.deliver(source, offset, length); - } catch (SSLHandshakeException she) { - // may be record sequence number overflow - description = Alerts.alert_handshake_failure; - ioe = she; - } catch (IOException e) { - description = Alerts.alert_unexpected_message; - ioe = e; - } finally { - writeLock.unlock(); - } + return null; + } - // Be care of deadlock. Please don't place the call to fatal() - // into the writeLock locked block. - if (ioe != null) { - fatal(description, ioe); - } + @Override + public synchronized void addHandshakeCompletedListener( + HandshakeCompletedListener listener) { + if (listener == null) { + throw new IllegalArgumentException("listener is null"); } - /* - * Check the sequence number state - * - * Note that in order to maintain the connection I/O - * properly, we check the sequence number after the last - * record writing process. As we request renegotiation - * or close the connection for wrapped sequence number - * when there is enough sequence number space left to - * handle a few more records, so the sequence number - * of the last record cannot be wrapped. - * - * Don't bother to kickstart the renegotiation when the - * local is asking for it. - */ - if ((connectionState == cs_DATA) && outputRecord.seqNumIsHuge()) { - /* - * Ask for renegotiation when need to renew sequence number. - * - * Don't bother to kickstart the renegotiation when the local is - * asking for it. - */ - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", request renegotiation " + - "to avoid sequence number overflow"); - } + conContext.sslConfig.addHandshakeCompletedListener(listener); + } - startHandshake(); + @Override + public synchronized void removeHandshakeCompletedListener( + HandshakeCompletedListener listener) { + if (listener == null) { + throw new IllegalArgumentException("listener is null"); } + + conContext.sslConfig.removeHandshakeCompletedListener(listener); } - /* - * Alert record output. - */ - void writeAlert(byte level, byte description) throws IOException { + @Override + public synchronized void startHandshake() throws IOException { + checkWrite(); + try { + conContext.kickstart(); - // If the record is a close notify alert, we need to honor - // socket option SO_LINGER. Note that we will try to send - // the close notify even if the SO_LINGER set to zero. - if ((description == Alerts.alert_close_notify) && getSoLinger() >= 0) { + // All initial handshaking goes through this operation until we + // have a valid SSL connection. + // + // Handle handshake messages only, need no application data. + if (!conContext.isNegotiated) { + readRecord(); + } + } catch (IOException ioe) { + conContext.fatal(Alert.HANDSHAKE_FAILURE, + "Couldn't kickstart handshaking", ioe); + } catch (Exception oe) { // including RuntimeException + handleException(oe); + } + } - // keep and clear the current thread interruption status. - boolean interrupted = Thread.interrupted(); - try { - if (writeLock.tryLock(getSoLinger(), TimeUnit.SECONDS)) { - try { - outputRecord.encodeAlert(level, description); - } finally { - writeLock.unlock(); - } - } else { - SSLException ssle = new SSLException( - "SO_LINGER timeout," + - " close_notify message cannot be sent."); - - - // For layered, non-autoclose sockets, we are not - // able to bring them into a usable state, so we - // treat it as fatal error. - if (isLayered() && !autoClose) { - // Note that the alert description is - // specified as -1, so no message will be send - // to peer anymore. - fatal((byte)(-1), ssle); - } else if ((debug != null) && Debug.isOn("ssl")) { - System.out.println( - Thread.currentThread().getName() + - ", received Exception: " + ssle); - } - - // RFC2246 requires that the session becomes - // unresumable if any connection is terminated - // without proper close_notify messages with - // level equal to warning. - // - // RFC4346 no longer requires that a session not be - // resumed if failure to properly close a connection. - // - // We choose to make the session unresumable if - // failed to send the close_notify message. - // - sess.invalidate(); - } - } catch (InterruptedException ie) { - // keep interrupted status - interrupted = true; - } - - // restore the interrupted status - if (interrupted) { - Thread.currentThread().interrupt(); - } - } else { - writeLock.lock(); - try { - outputRecord.encodeAlert(level, description); - } finally { - writeLock.unlock(); - } - } - - // Don't bother to check sequence number overlap here. If sequence - // number is huge, there should be enough sequence number space to - // request renegotiation in next application data read and write. - } - - - int bytesInCompletePacket() throws IOException { - if (getConnectionState() == cs_HANDSHAKE) { - performInitialHandshake(); - } - - synchronized (readLock) { - int state = getConnectionState(); - if ((state == cs_CLOSED) || - (state == cs_ERROR) || (state == cs_APP_CLOSED)) { - return -1; - } - - try { - return inputRecord.bytesInCompletePacket(sockInput); - } catch (EOFException eofe) { - boolean handshaking = (connectionState <= cs_HANDSHAKE); - boolean rethrow = requireCloseNotify || handshaking; - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", received EOFException: " - + (rethrow ? "error" : "ignored")); - } - - if (!rethrow) { - // treat as if we had received a close_notify - closeInternal(false); - } else { - SSLException e; - if (handshaking) { - e = new SSLHandshakeException( - "Remote host terminated the handshake"); - } else { - e = new SSLProtocolException( - "Remote host terminated the handshake"); - } - e.initCause(eofe); - throw e; - } - } - - return -1; - } - } - - // the caller have synchronized readLock - void expectingFinishFlight() { - inputRecord.expectingFinishFlight(); - } - - /* - * Read an application data record. - * - * Alerts and handshake messages are internally handled directly. - */ - int readRecord(ByteBuffer buffer) throws IOException { - if (getConnectionState() == cs_HANDSHAKE) { - performInitialHandshake(); - } - - return readRecord(buffer, true); - } - - /* - * Read a record, no application data input required. - * - * Alerts and handshake messages are internally handled directly. - */ - int readRecord(boolean needAppData) throws IOException { - return readRecord(null, needAppData); - } - - /* - * Clear the pipeline of records from the peer, optionally returning - * application data. Caller is responsible for knowing that it's - * possible to do this kind of clearing, if they don't want app - * data -- e.g. since it's the initial SSL handshake. - * - * Don't synchronize (this) during a blocking read() since it - * protects data which is accessed on the write side as well. - */ - private int readRecord(ByteBuffer buffer, boolean needAppData) - throws IOException { - int state; - - // readLock protects reading and processing of an SSLInputRecord. - // It keeps the reading from sockInput and processing of the record - // atomic so that no two threads can be blocked on the - // read from the same input stream at the same time. - // This is required for example when a reader thread is - // blocked on the read and another thread is trying to - // close the socket. For a non-autoclose, layered socket, - // the thread performing the close needs to read the close_notify. - // - // Use readLock instead of 'this' for locking because - // 'this' also protects data accessed during writing. - synchronized (readLock) { - /* - * Read and handle records ... return application data - * ONLY if it's needed. - */ - Plaintext plainText = null; - while (((state = getConnectionState()) != cs_CLOSED) && - (state != cs_ERROR) && (state != cs_APP_CLOSED)) { - - /* - * clean the buffer and check if it is too small, e.g. because - * the AppInputStream did not have the chance to see the - * current packet length but rather something like that of the - * handshake before. In that case we return 0 at this point to - * give the caller the chance to adjust the buffer. - */ - if (buffer != null) { - buffer.clear(); - - if (buffer.remaining() < - inputRecord.bytesInCompletePacket(sockInput)) { - return 0; - } - } - - /* - * Read a record ... maybe emitting an alert if we get a - * comprehensible but unsupported "hello" message during - * format checking (e.g. V2). - */ - try { - plainText = inputRecord.decode(sockInput, buffer); - } catch (BadPaddingException bpe) { - byte alertType = (state != cs_DATA) ? - Alerts.alert_handshake_failure : - Alerts.alert_bad_record_mac; - fatal(alertType, bpe.getMessage(), bpe); - } catch (SSLProtocolException spe) { - try { - fatal(Alerts.alert_unexpected_message, spe); - } catch (IOException x) { - // discard this exception, throw the original exception - } - throw spe; - } catch (SSLHandshakeException she) { - // may be record sequence number overflow - fatal(Alerts.alert_handshake_failure, she); - } catch (EOFException eof) { - boolean handshaking = (connectionState <= cs_HANDSHAKE); - boolean rethrow = requireCloseNotify || handshaking; - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", received EOFException: " - + (rethrow ? "error" : "ignored")); - } - if (rethrow) { - SSLException e; - if (handshaking) { - e = new SSLHandshakeException( - "Remote host terminated the handshake"); - } else { - e = new SSLProtocolException( - "Remote host terminated the connection"); - } - e.initCause(eof); - throw e; - } else { - // treat as if we had received a close_notify - closeInternal(false); - continue; - } - } - - // PlainText should never be null. Process input record. - int volume = processInputRecord(plainText, needAppData); - - if (plainText.contentType == Record.ct_application_data) { - return volume; - } - - if (plainText.contentType == Record.ct_handshake) { - if (!needAppData && connectionState == cs_DATA) { - return volume; - } // otherwise, need to read more for app data. - } - - // continue to read more net data - } // while - - // - // couldn't read, due to some kind of error - // - return -1; - } // readLock synchronization - } - - /* - * Process the plainText input record. - */ - private synchronized int processInputRecord( - Plaintext plainText, boolean needAppData) throws IOException { - - /* - * Process the record. - */ - int volume = 0; // no application data - switch (plainText.contentType) { - case Record.ct_handshake: - /* - * Handshake messages always go to a pending session - * handshaker ... if there isn't one, create one. This - * must work asynchronously, for renegotiation. - * - * NOTE that handshaking will either resume a session - * which was in the cache (and which might have other - * connections in it already), or else will start a new - * session (new keys exchanged) with just this connection - * in it. - */ - initHandshaker(); - if (!handshaker.activated()) { - // prior to handshaking, activate the handshake - if (connectionState == cs_RENEGOTIATE) { - // don't use SSLv2Hello when renegotiating - handshaker.activate(protocolVersion); - } else { - handshaker.activate(null); - } - } - - /* - * process the handshake record ... may contain just - * a partial handshake message or multiple messages. - * - * The handshaker state machine will ensure that it's - * a finished message. - */ - handshaker.processRecord(plainText.fragment, expectingFinished); - expectingFinished = false; - - if (handshaker.invalidated) { - handshaker = null; - inputRecord.setHandshakeHash(null); - outputRecord.setHandshakeHash(null); - - // if state is cs_RENEGOTIATE, revert it to cs_DATA - if (connectionState == cs_RENEGOTIATE) { - connectionState = cs_DATA; - } - } else if (handshaker.isDone()) { - // reset the parameters for secure renegotiation. - secureRenegotiation = - handshaker.isSecureRenegotiation(); - clientVerifyData = handshaker.getClientVerifyData(); - serverVerifyData = handshaker.getServerVerifyData(); - // set connection ALPN value - applicationProtocol = - handshaker.getHandshakeApplicationProtocol(); - - sess = handshaker.getSession(); - handshakeSession = null; - handshaker = null; - inputRecord.setHandshakeHash(null); - outputRecord.setHandshakeHash(null); - connectionState = cs_DATA; - - // - // Tell folk about handshake completion, but do - // it in a separate thread. - // - if (handshakeListeners != null) { - HandshakeCompletedEvent event = - new HandshakeCompletedEvent(this, sess); - - Thread thread = new Thread( - null, - new NotifyHandshake( - handshakeListeners.entrySet(), event), - "HandshakeCompletedNotify-Thread", - 0, - false); - thread.start(); - } - } - - break; - - case Record.ct_application_data: - if (connectionState != cs_DATA - && connectionState != cs_RENEGOTIATE - && connectionState != cs_SENT_CLOSE) { - throw new SSLProtocolException( - "Data received in non-data state: " + - connectionState); - } - if (expectingFinished) { - throw new SSLProtocolException - ("Expecting finished message, received data"); - } - if (!needAppData) { - throw new SSLException("Discarding app data"); - } - - volume = plainText.fragment.remaining(); - break; - - case Record.ct_alert: - recvAlert(plainText.fragment); - break; - - case Record.ct_change_cipher_spec: - if ((connectionState != cs_HANDSHAKE - && connectionState != cs_RENEGOTIATE)) { - // For the CCS message arriving in the wrong state - fatal(Alerts.alert_unexpected_message, - "illegal change cipher spec msg, conn state = " - + connectionState); - } else if (plainText.fragment.remaining() != 1 - || plainText.fragment.get() != 1) { - // For structural/content issues with the CCS - fatal(Alerts.alert_unexpected_message, - "Malformed change cipher spec msg"); - } - - // - // The first message after a change_cipher_spec - // record MUST be a "Finished" handshake record, - // else it's a protocol violation. We force this - // to be checked by a minor tweak to the state - // machine. - // - handshaker.receiveChangeCipherSpec(); - - CipherBox readCipher; - Authenticator readAuthenticator; - try { - readCipher = handshaker.newReadCipher(); - readAuthenticator = handshaker.newReadAuthenticator(); - } catch (GeneralSecurityException e) { - // can't happen - throw new SSLException("Algorithm missing: ", e); - } - inputRecord.changeReadCiphers(readAuthenticator, readCipher); - - // next message MUST be a finished message - expectingFinished = true; - - break; - - default: - // - // TLS requires that unrecognized records be ignored. - // - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", Received record type: " + plainText.contentType); - } - break; - } - - /* - * Check the sequence number state - * - * Note that in order to maintain the connection I/O - * properly, we check the sequence number after the last - * record reading process. As we request renegotiation - * or close the connection for wrapped sequence number - * when there is enough sequence number space left to - * handle a few more records, so the sequence number - * of the last record cannot be wrapped. - * - * Don't bother to kickstart the renegotiation when the - * local is asking for it. - */ - if ((connectionState == cs_DATA) && inputRecord.seqNumIsHuge()) { - /* - * Ask for renegotiation when need to renew sequence number. - * - * Don't bother to kickstart the renegotiation when the local is - * asking for it. - */ - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", request renegotiation " + - "to avoid sequence number overflow"); - } - - startHandshake(); - } - - return volume; - } - - - // - // HANDSHAKE RELATED CODE - // - - /** - * Return the AppInputStream. For use by Handshaker only. - */ - AppInputStream getAppInputStream() { - return input; - } - - /** - * Return the AppOutputStream. For use by Handshaker only. - */ - AppOutputStream getAppOutputStream() { - return output; - } - - /** - * Initialize the handshaker object. This means: - * - * . if a handshake is already in progress (state is cs_HANDSHAKE - * or cs_RENEGOTIATE), do nothing and return - * - * . if the socket is already closed, throw an Exception (internal error) - * - * . otherwise (cs_START or cs_DATA), create the appropriate handshaker - * object, and advance the connection state (to cs_HANDSHAKE or - * cs_RENEGOTIATE, respectively). - * - * This method is called right after a new socket is created, when - * starting renegotiation, or when changing client/ server mode of the - * socket. - */ - private void initHandshaker() { - switch (connectionState) { - - // - // Starting a new handshake. - // - case cs_START: - case cs_DATA: - break; - - // - // We're already in the middle of a handshake. - // - case cs_HANDSHAKE: - case cs_RENEGOTIATE: - return; - - // - // Anyone allowed to call this routine is required to - // do so ONLY if the connection state is reasonable... - // - default: - throw new IllegalStateException("Internal error"); - } - - // state is either cs_START or cs_DATA - if (connectionState == cs_START) { - connectionState = cs_HANDSHAKE; - } else { // cs_DATA - connectionState = cs_RENEGOTIATE; - } - - if (roleIsServer) { - handshaker = new ServerHandshaker(this, sslContext, - enabledProtocols, doClientAuth, - protocolVersion, connectionState == cs_HANDSHAKE, - secureRenegotiation, clientVerifyData, serverVerifyData); - handshaker.setSNIMatchers(sniMatchers); - handshaker.setUseCipherSuitesOrder(preferLocalCipherSuites); - } else { - handshaker = new ClientHandshaker(this, sslContext, - enabledProtocols, - protocolVersion, connectionState == cs_HANDSHAKE, - secureRenegotiation, clientVerifyData, serverVerifyData); - handshaker.setSNIServerNames(serverNames); - } - handshaker.setMaximumPacketSize(maximumPacketSize); - handshaker.setEnabledCipherSuites(enabledCipherSuites); - handshaker.setEnableSessionCreation(enableSessionCreation); - handshaker.setApplicationProtocols(applicationProtocols); - handshaker.setApplicationProtocolSelectorSSLSocket( - applicationProtocolSelector); - } - - /** - * Synchronously perform the initial handshake. - * - * If the handshake is already in progress, this method blocks until it - * is completed. If the initial handshake has already been completed, - * it returns immediately. - */ - private void performInitialHandshake() throws IOException { - // use handshakeLock and the state check to make sure only - // one thread performs the handshake - synchronized (handshakeLock) { - if (getConnectionState() == cs_HANDSHAKE) { - kickstartHandshake(); - - /* - * All initial handshaking goes through this operation - * until we have a valid SSL connection. - * - * Handle handshake messages only, need no application data. - */ - readRecord(false); - } - } + @Override + public synchronized void setUseClientMode(boolean mode) { + conContext.setUseClientMode(mode); } - /** - * Starts an SSL handshake on this connection. - */ @Override - public void startHandshake() throws IOException { - // start an ssl handshake that could be resumed from timeout exception - startHandshake(true); + public synchronized boolean getUseClientMode() { + return conContext.sslConfig.isClientMode; } - /** - * Starts an ssl handshake on this connection. - * - * @param resumable indicates the handshake process is resumable from a - * certain exception. If <code>resumable</code>, the socket will - * be reserved for exceptions like timeout; otherwise, the socket - * will be closed, no further communications could be done. - */ - private void startHandshake(boolean resumable) throws IOException { - checkWrite(); - try { - if (getConnectionState() == cs_HANDSHAKE) { - // do initial handshake - performInitialHandshake(); - } else { - // start renegotiation - kickstartHandshake(); - } - } catch (Exception e) { - // shutdown and rethrow (wrapped) exception as appropriate - handleException(e, resumable); - } + @Override + public synchronized void setNeedClientAuth(boolean need) { + conContext.sslConfig.clientAuthType = + (need ? ClientAuthType.CLIENT_AUTH_REQUIRED : + ClientAuthType.CLIENT_AUTH_NONE); } - /** - * Kickstart the handshake if it is not already in progress. - * This means: - * - * . if handshaking is already underway, do nothing and return - * - * . if the socket is not connected or already closed, throw an - * Exception. - * - * . otherwise, call initHandshake() to initialize the handshaker - * object and progress the state. Then, send the initial - * handshaking message if appropriate (always on clients and - * on servers when renegotiating). - */ - private synchronized void kickstartHandshake() throws IOException { - - switch (connectionState) { - - case cs_HANDSHAKE: - // handshaker already setup, proceed - break; - - case cs_DATA: - if (!secureRenegotiation && !Handshaker.allowUnsafeRenegotiation) { - throw new SSLHandshakeException( - "Insecure renegotiation is not allowed"); - } - - if (!secureRenegotiation) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println( - "Warning: Using insecure renegotiation"); - } - } - - // initialize the handshaker, move to cs_RENEGOTIATE - initHandshaker(); - break; - - case cs_RENEGOTIATE: - // handshaking already in progress, return - return; - - /* - * The only way to get a socket in the state is when - * you have an unconnected socket. - */ - case cs_START: - throw new SocketException( - "handshaking attempted on unconnected socket"); - - default: - throw new SocketException("connection is closed"); - } - - // - // Kickstart handshake state machine if we need to ... - // - // Note that handshaker.kickstart() writes the message - // to its HandshakeOutStream, which calls back into - // SSLSocketImpl.writeRecord() to send it. - // - if (!handshaker.activated()) { - // prior to handshaking, activate the handshake - if (connectionState == cs_RENEGOTIATE) { - // don't use SSLv2Hello when renegotiating - handshaker.activate(protocolVersion); - } else { - handshaker.activate(null); - } - - if (handshaker instanceof ClientHandshaker) { - // send client hello - handshaker.kickstart(); - } else { - if (connectionState == cs_HANDSHAKE) { - // initial handshake, no kickstart message to send - } else { - // we want to renegotiate, send hello request - handshaker.kickstart(); - } - } - } + @Override + public synchronized boolean getNeedClientAuth() { + return (conContext.sslConfig.clientAuthType == + ClientAuthType.CLIENT_AUTH_REQUIRED); } - // - // CLOSURE RELATED CALLS - // - - /** - * Return whether the socket has been explicitly closed by the application. - */ @Override - public boolean isClosed() { - return connectionState == cs_APP_CLOSED; + public synchronized void setWantClientAuth(boolean want) { + conContext.sslConfig.clientAuthType = + (want ? ClientAuthType.CLIENT_AUTH_REQUESTED : + ClientAuthType.CLIENT_AUTH_NONE); } - /** - * Return whether we have reached end-of-file. - * - * If the socket is not connected, has been shutdown because of an error - * or has been closed, throw an Exception. - */ - boolean checkEOF() throws IOException { - switch (getConnectionState()) { - case cs_START: - throw new SocketException("Socket is not connected"); - - case cs_HANDSHAKE: - case cs_DATA: - case cs_RENEGOTIATE: - case cs_SENT_CLOSE: - return false; - - case cs_APP_CLOSED: - throw new SocketException("Socket is closed"); - - case cs_ERROR: - case cs_CLOSED: - default: - // either closed because of error, or normal EOF - if (closeReason == null) { - return true; - } - IOException e = new SSLException - ("Connection has been shutdown: " + closeReason); - e.initCause(closeReason); - throw e; - - } + @Override + public synchronized boolean getWantClientAuth() { + return (conContext.sslConfig.clientAuthType == + ClientAuthType.CLIENT_AUTH_REQUESTED); } - /** - * Check if we can write data to this socket. If not, throw an IOException. - */ - void checkWrite() throws IOException { - if (checkEOF() || (getConnectionState() == cs_SENT_CLOSE)) { - // we are at EOF, write must throw Exception - throw new SocketException("Connection closed by remote host"); - } + @Override + public synchronized void setEnableSessionCreation(boolean flag) { + conContext.sslConfig.enableSessionCreation = flag; } - private void closeSocket() throws IOException { - - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", called closeSocket()"); - } - - super.close(); + @Override + public synchronized boolean getEnableSessionCreation() { + return conContext.sslConfig.enableSessionCreation; } - private void closeSocket(boolean selfInitiated) throws IOException { - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", called closeSocket(" + selfInitiated + ")"); - } - if (!isLayered() || autoClose) { - super.close(); - } else if (selfInitiated) { - // layered && non-autoclose - // read close_notify alert to clear input stream - waitForClose(false); - } + @Override + public synchronized boolean isClosed() { + return tlsIsClosed && conContext.isClosed(); } - /* - * Closing the connection is tricky ... we can't officially close the - * connection until we know the other end is ready to go away too, - * and if ever the connection gets aborted we must forget session - * state (it becomes invalid). - */ - - /** - * Closes the SSL connection. SSL includes an application level - * shutdown handshake; you should close SSL sockets explicitly - * rather than leaving it for finalization, so that your remote - * peer does not experience a protocol error. - */ @Override - public void close() throws IOException { - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", called close()"); - } - closeInternal(true); // caller is initiating close - - // Clearup the resources. + public synchronized void close() throws IOException { try { - synchronized (readLock) { - inputRecord.close(); - } - - writeLock.lock(); - try { - outputRecord.close(); - } finally { - writeLock.unlock(); - } + conContext.close(); } catch (IOException ioe) { - // ignore - } - - setConnectionState(cs_APP_CLOSED); - } - - /** - * Don't synchronize the whole method because waitForClose() - * (which calls readRecord()) might be called. - * - * @param selfInitiated Indicates which party initiated the close. - * If selfInitiated, this side is initiating a close; for layered and - * non-autoclose socket, wait for close_notify response. - * If !selfInitiated, peer sent close_notify; we reciprocate but - * no need to wait for response. - */ - private void closeInternal(boolean selfInitiated) throws IOException { - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", called closeInternal(" + selfInitiated + ")"); - } - - int state = getConnectionState(); - boolean closeSocketCalled = false; - Throwable cachedThrowable = null; - try { - switch (state) { - case cs_START: - // unconnected socket or handshaking has not been initialized - closeSocket(selfInitiated); - break; - - /* - * If we're closing down due to error, we already sent (or else - * received) the fatal alert ... no niceties, blow the connection - * away as quickly as possible (even if we didn't allocate the - * socket ourselves; it's unusable, regardless). - */ - case cs_ERROR: - closeSocket(); - break; - - /* - * Sometimes close() gets called more than once. - */ - case cs_CLOSED: - case cs_APP_CLOSED: - break; - - /* - * Otherwise we indicate clean termination. - */ - // case cs_HANDSHAKE: - // case cs_DATA: - // case cs_RENEGOTIATE: - // case cs_SENT_CLOSE: - default: - synchronized (this) { - if (((state = getConnectionState()) == cs_CLOSED) || - (state == cs_ERROR) || (state == cs_APP_CLOSED)) { - return; // connection was closed while we waited - } - if (state != cs_SENT_CLOSE) { - try { - warning(Alerts.alert_close_notify); - connectionState = cs_SENT_CLOSE; - } catch (Throwable th) { - // we need to ensure socket is closed out - // if we encounter any errors. - connectionState = cs_ERROR; - // cache this for later use - cachedThrowable = th; - closeSocketCalled = true; - closeSocket(selfInitiated); - } - } - } - // If state was cs_SENT_CLOSE before, we don't do the actual - // closing since it is already in progress. - if (state == cs_SENT_CLOSE) { - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", close invoked again; state = " + - getConnectionState()); - } - if (selfInitiated == false) { - // We were called because a close_notify message was - // received. This may be due to another thread calling - // read() or due to our call to waitForClose() below. - // In either case, just return. - return; - } - // Another thread explicitly called close(). We need to - // wait for the closing to complete before returning. - synchronized (this) { - while (connectionState < cs_CLOSED) { - try { - this.wait(); - } catch (InterruptedException e) { - // ignore - } - } - } - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", after primary close; state = " + - getConnectionState()); - } - return; - } - - if (!closeSocketCalled) { - closeSocketCalled = true; - closeSocket(selfInitiated); - } - - break; + // ignore the exception + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("connection context closure failed", ioe); } } finally { - synchronized (this) { - // Upon exit from this method, the state is always >= cs_CLOSED - connectionState = (connectionState == cs_APP_CLOSED) - ? cs_APP_CLOSED : cs_CLOSED; - // notify any threads waiting for the closing to finish - this.notifyAll(); - } - - if (cachedThrowable != null) { - /* - * Rethrow the error to the calling method - * The Throwable caught can only be an Error or RuntimeException - */ - if (cachedThrowable instanceof Error) { - throw (Error)cachedThrowable; - } else if (cachedThrowable instanceof RuntimeException) { - throw (RuntimeException)cachedThrowable; - } // Otherwise, unlikely - } + tlsIsClosed = true; } } - /** - * Reads a close_notify or a fatal alert from the input stream. - * Keep reading records until we get a close_notify or until - * the connection is otherwise closed. The close_notify or alert - * might be read by another reader, - * which will then process the close and set the connection state. - */ - void waitForClose(boolean rethrow) throws IOException { - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", waiting for close_notify or alert: state " - + getConnectionState()); + @Override + public synchronized InputStream getInputStream() throws IOException { + if (isClosed() || conContext.isInboundDone()) { + throw new SocketException("Socket or inbound is closed"); } - try { - int state; - - while (((state = getConnectionState()) != cs_CLOSED) && - (state != cs_ERROR) && (state != cs_APP_CLOSED)) { - - // Ask for app data and then throw it away - try { - readRecord(true); - } catch (SocketTimeoutException e) { - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println( - Thread.currentThread().getName() + - ", received Exception: " + e); - } - fatal((byte)(-1), "Did not receive close_notify from peer", e); - } - } - } catch (IOException e) { - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", Exception while waiting for close " +e); - } - if (rethrow) { - throw e; // pass exception up - } + if (!isConnected) { + throw new SocketException("Socket is not connected"); } - } - - // - // EXCEPTION AND ALERT HANDLING - // - /** - * Handle an exception. This method is called by top level exception - * handlers (in read(), write()) to make sure we always shutdown the - * connection correctly and do not pass runtime exception to the - * application. - */ - void handleException(Exception e) throws IOException { - handleException(e, true); + return appInput; } - /** - * Handle an exception. This method is called by top level exception - * handlers (in read(), write(), startHandshake()) to make sure we - * always shutdown the connection correctly and do not pass runtime - * exception to the application. - * - * This method never returns normally, it always throws an IOException. - * - * We first check if the socket has already been shutdown because of an - * error. If so, we just rethrow the exception. If the socket has not - * been shutdown, we sent a fatal alert and remember the exception. - * - * @param e the Exception - * @param resumable indicates the caller process is resumable from the - * exception. If <code>resumable</code>, the socket will be - * reserved for exceptions like timeout; otherwise, the socket - * will be closed, no further communications could be done. - */ - private synchronized void handleException(Exception e, boolean resumable) - throws IOException { - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", handling exception: " + e.toString()); - } - - // don't close the Socket in case of timeouts or interrupts if - // the process is resumable. - if (e instanceof InterruptedIOException && resumable) { - throw (IOException)e; - } - - // if we've already shutdown because of an error, - // there is nothing to do except rethrow the exception - if (closeReason != null) { - if (e instanceof IOException) { // includes SSLException - throw (IOException)e; - } else { - // this is odd, not an IOException. - // normally, this should not happen - // if closeReason has been already been set - throw Alerts.getSSLException(Alerts.alert_internal_error, e, - "Unexpected exception"); - } - } - - // need to perform error shutdown - boolean isSSLException = (e instanceof SSLException); - if ((!isSSLException) && (e instanceof IOException)) { - // IOException from the socket - // this means the TCP connection is already dead - // we call fatal just to set the error status - try { - fatal(Alerts.alert_unexpected_message, e); - } catch (IOException ee) { - // ignore (IOException wrapped in SSLException) - } - // rethrow original IOException - throw (IOException)e; - } - - // must be SSLException or RuntimeException - byte alertType; - if (isSSLException) { - if (e instanceof SSLHandshakeException) { - alertType = Alerts.alert_handshake_failure; - } else { - alertType = Alerts.alert_unexpected_message; - } - } else { - alertType = Alerts.alert_internal_error; + private synchronized void ensureNegotiated() throws IOException { + if (conContext.isNegotiated || + conContext.isClosed() || conContext.isBroken) { + return; } - fatal(alertType, e); - } - - /* - * Send a warning alert. - */ - void warning(byte description) { - sendAlert(Alerts.alert_warning, description); - } - - synchronized void fatal(byte description, String diagnostic) - throws IOException { - fatal(description, diagnostic, null); - } - synchronized void fatal(byte description, Throwable cause) - throws IOException { - fatal(description, null, cause); + startHandshake(); } - /* - * Send a fatal alert, and throw an exception so that callers will - * need to stand on their heads to accidentally continue processing. + /** + * InputStream for application data as returned by + * SSLSocket.getInputStream(). */ - synchronized void fatal(byte description, String diagnostic, - Throwable cause) throws IOException { + private class AppInputStream extends InputStream { + // One element array used to implement the single byte read() method + private final byte[] oneByte = new byte[1]; - // Be care of deadlock. Please don't synchronize readLock. - try { - inputRecord.close(); - } catch (IOException ioe) { - // ignore - } + // the temporary buffer used to read network + private ByteBuffer buffer; - sess.invalidate(); - if (handshakeSession != null) { - handshakeSession.invalidate(); - } + // Is application data available in the stream? + private boolean appDataIsAvailable; - int oldState = connectionState; - if (connectionState < cs_ERROR) { - connectionState = cs_ERROR; + AppInputStream() { + this.appDataIsAvailable = false; + this.buffer = ByteBuffer.allocate(4096); } - /* - * Has there been an error received yet? If not, remember it. - * By RFC 2246, we don't bother waiting for a response. - * Fatal errors require immediate shutdown. + /** + * Return the minimum number of bytes that can be read + * without blocking. */ - if (closeReason == null) { - /* - * Try to clear the kernel buffer to avoid TCP connection resets. - */ - if (oldState == cs_HANDSHAKE) { - sockInput.skip(sockInput.available()); + @Override + public int available() throws IOException { + // Currently not synchronized. + if ((!appDataIsAvailable) || checkEOF()) { + return 0; } - // If the description equals -1, the alert won't be sent to peer. - if (description != -1) { - sendAlert(Alerts.alert_fatal, description); - } - if (cause instanceof SSLException) { // only true if != null - closeReason = (SSLException)cause; - } else { - closeReason = - Alerts.getSSLException(description, cause, diagnostic); - } + return buffer.remaining(); } - /* - * Clean up our side. + /** + * Read a single byte, returning -1 on non-fault EOF status. */ - closeSocket(); + @Override + public synchronized int read() throws IOException { + int n = read(oneByte, 0, 1); + if (n <= 0) { // EOF + return -1; + } - // Be care of deadlock. Please don't synchronize writeLock. - try { - outputRecord.close(); - } catch (IOException ioe) { - // ignore + return oneByte[0] & 0xFF; } - throw closeReason; - } - - - /* - * Process an incoming alert ... caller must already have synchronized - * access to "this". - */ - private void recvAlert(ByteBuffer fragment) throws IOException { - byte level = fragment.get(); - byte description = fragment.get(); - - if (description == -1) { // check for short message - fatal(Alerts.alert_illegal_parameter, "Short alert message"); - } - - if (debug != null && (Debug.isOn("record") || - Debug.isOn("handshake"))) { - synchronized (System.out) { - System.out.print(Thread.currentThread().getName()); - System.out.print(", RECV " + protocolVersion + " ALERT: "); - if (level == Alerts.alert_fatal) { - System.out.print("fatal, "); - } else if (level == Alerts.alert_warning) { - System.out.print("warning, "); - } else { - System.out.print("<level " + (0x0ff & level) + ">, "); - } - System.out.println(Alerts.alertDescription(description)); + /** + * Reads up to {@code len} bytes of data from the input stream + * into an array of bytes. + * + * An attempt is made to read as many as {@code len} bytes, but a + * smaller number may be read. The number of bytes actually read + * is returned as an integer. + * + * If the layer above needs more data, it asks for more, so we + * are responsible only for blocking to fill at most one buffer, + * and returning "-1" on non-fault EOF status. + */ + @Override + public synchronized int read(byte[] b, int off, int len) + throws IOException { + if (b == null) { + throw new NullPointerException("the target buffer is null"); + } else if (off < 0 || len < 0 || len > b.length - off) { + throw new IndexOutOfBoundsException( + "buffer length: " + b.length + ", offset; " + off + + ", bytes to read:" + len); + } else if (len == 0) { + return 0; } - } - if (level == Alerts.alert_warning) { - if (description == Alerts.alert_close_notify) { - if (connectionState == cs_HANDSHAKE) { - fatal(Alerts.alert_unexpected_message, - "Received close_notify during handshake"); - } else { - closeInternal(false); // reply to close - } - } else { - - // - // The other legal warnings relate to certificates, - // e.g. no_certificate, bad_certificate, etc; these - // are important to the handshaking code, which can - // also handle illegal protocol alerts if needed. - // - if (handshaker != null) { - handshaker.handshakeAlert(description); - } - } - } else { // fatal or unknown level - String reason = "Received fatal alert: " - + Alerts.alertDescription(description); - if (closeReason == null) { - closeReason = Alerts.getSSLException(description, reason); + if (checkEOF()) { + return -1; } - fatal(Alerts.alert_unexpected_message, reason); - } - } - - - /* - * Emit alerts. Caller must have synchronized with "this". - */ - private void sendAlert(byte level, byte description) { - // the connectionState cannot be cs_START - if (connectionState >= cs_SENT_CLOSE) { - return; - } - - // For initial handshaking, don't send alert message to peer if - // handshaker has not started. - // - // Shall we send an fatal alter to terminate the connection gracefully? - if (connectionState <= cs_HANDSHAKE && - (handshaker == null || !handshaker.started() || - !handshaker.activated())) { - return; - } - boolean useDebug = debug != null && Debug.isOn("ssl"); - if (useDebug) { - synchronized (System.out) { - System.out.print(Thread.currentThread().getName()); - System.out.print(", SEND " + protocolVersion + " ALERT: "); - if (level == Alerts.alert_fatal) { - System.out.print("fatal, "); - } else if (level == Alerts.alert_warning) { - System.out.print("warning, "); - } else { - System.out.print("<level = " + (0x0ff & level) + ">, "); - } - System.out.println("description = " - + Alerts.alertDescription(description)); + // start handshaking if the connection has not been negotiated. + if (!conContext.isNegotiated && + !conContext.isClosed() && !conContext.isBroken) { + ensureNegotiated(); } - } - try { - writeAlert(level, description); - } catch (IOException e) { - if (useDebug) { - System.out.println(Thread.currentThread().getName() + - ", Exception sending alert: " + e); + // Read the available bytes at first. + int remains = available(); + if (remains > 0) { + int howmany = Math.min(remains, len); + buffer.get(b, off, howmany); + + return howmany; } - } - } - // - // VARIOUS OTHER METHODS - // + appDataIsAvailable = false; + int volume = 0; + try { + /* + * Read data if needed ... notice that the connection + * guarantees that handshake, alert, and change cipher spec + * data streams are handled as they arrive, so we never + * see them here. + */ + while (volume == 0) { + // Clear the buffer for a new record reading. + buffer.clear(); - // used by Handshaker - void changeWriteCiphers() throws IOException { - Authenticator writeAuthenticator; - CipherBox writeCipher; - try { - writeCipher = handshaker.newWriteCipher(); - writeAuthenticator = handshaker.newWriteAuthenticator(); - } catch (GeneralSecurityException e) { - // "can't happen" - throw new SSLException("Algorithm missing: ", e); - } - outputRecord.changeWriteCiphers(writeAuthenticator, writeCipher); - } + // grow the buffer if needed + int inLen = conContext.inputRecord.bytesInCompletePacket(); + if (inLen < 0) { // EOF + handleEOF(null); - /* - * Updates the SSL version associated with this connection. - * Called from Handshaker once it has determined the negotiated version. - */ - synchronized void setVersion(ProtocolVersion protocolVersion) { - this.protocolVersion = protocolVersion; - outputRecord.setVersion(protocolVersion); - } + // if no exception thrown + return -1; + } - // - // ONLY used by ClientHandshaker for the server hostname during handshaking - // - synchronized String getHost() { - // Note that the host may be null or empty for localhost. - if (host == null || host.length() == 0) { - useImplicitHost(true); - } + // Is this packet bigger than SSL/TLS normally allows? + if (inLen > SSLRecord.maxLargeRecordSize) { + throw new SSLProtocolException( + "Illegal packet size: " + inLen); + } - return host; - } + if (inLen > buffer.remaining()) { + buffer = ByteBuffer.allocate(inLen); + } - /* - * Try to set and use the implicit specified hostname - */ - private synchronized void useImplicitHost(boolean noSniUpdate) { + volume = readRecord(buffer); + buffer.flip(); + if (volume < 0) { // EOF + // treat like receiving a close_notify warning message. + conContext.isInputCloseNotified = true; + conContext.closeInbound(); + return -1; + } else if (volume > 0) { + appDataIsAvailable = true; + break; + } + } - // Note: If the local name service is not trustworthy, reverse - // host name resolution should not be performed for endpoint - // identification. Use the application original specified - // hostname or IP address instead. + // file the destination buffer + int howmany = Math.min(len, volume); + buffer.get(b, off, howmany); + return howmany; + } catch (Exception e) { // including RuntimeException + // shutdown and rethrow (wrapped) exception as appropriate + handleException(e); - // Get the original hostname via jdk.internal.misc.SharedSecrets - InetAddress inetAddress = getInetAddress(); - if (inetAddress == null) { // not connected - return; + // dummy for compiler + return -1; + } } - JavaNetInetAddressAccess jna = - SharedSecrets.getJavaNetInetAddressAccess(); - String originalHostname = jna.getOriginalHostName(inetAddress); - if ((originalHostname != null) && - (originalHostname.length() != 0)) { - - host = originalHostname; - if (!noSniUpdate && serverNames.isEmpty() && !noSniExtension) { - serverNames = - Utilities.addToSNIServerNameList(serverNames, host); - - if (!roleIsServer && - (handshaker != null) && !handshaker.activated()) { - handshaker.setSNIServerNames(serverNames); + /** + * Skip n bytes. + * + * This implementation is somewhat less efficient than possible, but + * not badly so (redundant copy). We reuse the read() code to keep + * things simpler. Note that SKIP_ARRAY is static and may garbled by + * concurrent use, but we are not interested in the data anyway. + */ + @Override + public synchronized long skip(long n) throws IOException { + // dummy array used to implement skip() + byte[] skipArray = new byte[256]; + + long skipped = 0; + while (n > 0) { + int len = (int)Math.min(n, skipArray.length); + int r = read(skipArray, 0, len); + if (r <= 0) { + break; } + n -= r; + skipped += r; } - return; + return skipped; } - // No explicitly specified hostname, no server name indication. - if (!trustNameService) { - // The local name service is not trustworthy, use IP address. - host = inetAddress.getHostAddress(); - } else { - // Use the underlying reverse host name resolution service. - host = getInetAddress().getHostName(); - } - } - - // ONLY used by HttpsClient to setup the URI specified hostname - // - // Please NOTE that this method MUST be called before calling to - // SSLSocket.setSSLParameters(). Otherwise, the {@code host} parameter - // may override SNIHostName in the customized server name indication. - public synchronized void setHost(String host) { - this.host = host; - this.serverNames = - Utilities.addToSNIServerNameList(this.serverNames, this.host); - - if (!roleIsServer && (handshaker != null) && !handshaker.activated()) { - handshaker.setSNIServerNames(serverNames); - } - } - - /** - * Gets an input stream to read from the peer on the other side. - * Data read from this stream was always integrity protected in - * transit, and will usually have been confidentiality protected. - */ - @Override - public synchronized InputStream getInputStream() throws IOException { - if (isClosed()) { - throw new SocketException("Socket is closed"); - } + @Override + public void close() throws IOException { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest("Closing input stream"); + } - /* - * Can't call isConnected() here, because the Handshakers - * do some initialization before we actually connect. - */ - if (connectionState == cs_START) { - throw new SocketException("Socket is not connected"); + conContext.closeInbound(); } - - return input; } - - /** - * Gets an output stream to write to the peer on the other side. - * Data written on this stream is always integrity protected, and - * will usually be confidentiality protected. - */ + @Override public synchronized OutputStream getOutputStream() throws IOException { - if (isClosed()) { - throw new SocketException("Socket is closed"); + if (isClosed() || conContext.isOutboundDone()) { + throw new SocketException("Socket or outbound is closed"); } - /* - * Can't call isConnected() here, because the Handshakers - * do some initialization before we actually connect. - */ - if (connectionState == cs_START) { + if (!isConnected) { throw new SocketException("Socket is not connected"); } - return output; + return appOutput; } + /** - * Returns the SSL Session in use by this connection. These can - * be long lived, and frequently correspond to an entire login session - * for some user. + * OutputStream for application data as returned by + * SSLSocket.getOutputStream(). */ - @Override - public SSLSession getSession() { - /* - * Force a synchronous handshake, if appropriate. - */ - if (getConnectionState() == cs_HANDSHAKE) { + private class AppOutputStream extends OutputStream { + // One element array used to implement the write(byte) method + private final byte[] oneByte = new byte[1]; + + @Override + public void write(int i) throws IOException { + oneByte[0] = (byte)i; + write(oneByte, 0, 1); + } + + @Override + public synchronized void write(byte[] b, + int off, int len) throws IOException { + if (b == null) { + throw new NullPointerException("the source buffer is null"); + } else if (off < 0 || len < 0 || len > b.length - off) { + throw new IndexOutOfBoundsException( + "buffer length: " + b.length + ", offset; " + off + + ", bytes to read:" + len); + } else if (len == 0) { + return; + } + + // start handshaking if the connection has not been negotiated. + if (!conContext.isNegotiated && + !conContext.isClosed() && !conContext.isBroken) { + ensureNegotiated(); + } + + // check if the Socket is invalid (error or closed) + checkWrite(); + + // Delegate the writing to the underlying socket. try { - // start handshaking, if failed, the connection will be closed. - startHandshake(false); - } catch (IOException e) { - // handshake failed. log and return a nullSession - if (debug != null && Debug.isOn("handshake")) { - System.out.println(Thread.currentThread().getName() + - ", IOException in getSession(): " + e); - } + writeRecord(b, off, len); + checkWrite(); + } catch (IOException ioe) { + // shutdown and rethrow (wrapped) exception as appropriate + handleException(ioe); } } - synchronized (this) { - return sess; + + @Override + public void close() throws IOException { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest("Closing output stream"); + } + + conContext.closeOutbound(); } } @Override - public synchronized SSLSession getHandshakeSession() { - return handshakeSession; - } - - synchronized void setHandshakeSession(SSLSessionImpl session) { - // update the fragment size, which may be negotiated during handshaking - inputRecord.changeFragmentSize(session.getNegotiatedMaxFragSize()); - outputRecord.changeFragmentSize(session.getNegotiatedMaxFragSize()); - - handshakeSession = session; + public synchronized SSLParameters getSSLParameters() { + return conContext.sslConfig.getSSLParameters(); } - /** - * Controls whether new connections may cause creation of new SSL - * sessions. - * - * As long as handshaking has not started, we can change - * whether we enable session creations. Otherwise, - * we will need to wait for the next handshake. - */ @Override - public synchronized void setEnableSessionCreation(boolean flag) { - enableSessionCreation = flag; + public synchronized void setSSLParameters(SSLParameters params) { + conContext.sslConfig.setSSLParameters(params); - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setEnableSessionCreation(enableSessionCreation); + if (conContext.sslConfig.maximumPacketSize != 0) { + conContext.outputRecord.changePacketSize( + conContext.sslConfig.maximumPacketSize); } } - /** - * Returns true if new connections may cause creation of new SSL - * sessions. - */ @Override - public synchronized boolean getEnableSessionCreation() { - return enableSessionCreation; + public synchronized String getApplicationProtocol() { + return conContext.applicationProtocol; } - - /** - * Sets the flag controlling whether a server mode socket - * *REQUIRES* SSL client authentication. - * - * As long as handshaking has not started, we can change - * whether client authentication is needed. Otherwise, - * we will need to wait for the next handshake. - */ @Override - public synchronized void setNeedClientAuth(boolean flag) { - doClientAuth = (flag ? ClientAuthType.CLIENT_AUTH_REQUIRED : - ClientAuthType.CLIENT_AUTH_NONE); - - if ((handshaker != null) && - (handshaker instanceof ServerHandshaker) && - !handshaker.activated()) { - ((ServerHandshaker) handshaker).setClientAuth(doClientAuth); + public synchronized String getHandshakeApplicationProtocol() { + if (conContext.handshakeContext != null) { + return conContext.handshakeContext.applicationProtocol; } - } - @Override - public synchronized boolean getNeedClientAuth() { - return (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUIRED); + return null; } - /** - * Sets the flag controlling whether a server mode socket - * *REQUESTS* SSL client authentication. - * - * As long as handshaking has not started, we can change - * whether client authentication is requested. Otherwise, - * we will need to wait for the next handshake. - */ @Override - public synchronized void setWantClientAuth(boolean flag) { - doClientAuth = (flag ? ClientAuthType.CLIENT_AUTH_REQUESTED : - ClientAuthType.CLIENT_AUTH_NONE); - - if ((handshaker != null) && - (handshaker instanceof ServerHandshaker) && - !handshaker.activated()) { - ((ServerHandshaker) handshaker).setClientAuth(doClientAuth); - } + public synchronized void setHandshakeApplicationProtocolSelector( + BiFunction<SSLSocket, List<String>, String> selector) { + conContext.sslConfig.socketAPSelector = selector; } @Override - public synchronized boolean getWantClientAuth() { - return (doClientAuth == ClientAuthType.CLIENT_AUTH_REQUESTED); + public synchronized BiFunction<SSLSocket, List<String>, String> + getHandshakeApplicationProtocolSelector() { + return conContext.sslConfig.socketAPSelector; } + private synchronized void writeRecord(byte[] source, + int offset, int length) throws IOException { + if (conContext.isOutboundDone()) { + throw new SocketException("Socket or outbound closed"); + } - /** - * Sets the flag controlling whether the socket is in SSL - * client or server mode. Must be called before any SSL - * traffic has started. - */ - @Override - @SuppressWarnings("fallthrough") - public synchronized void setUseClientMode(boolean flag) { - switch (connectionState) { + // + // Don't bother to really write empty records. We went this + // far to drive the handshake machinery, for correctness; not + // writing empty records improves performance by cutting CPU + // time and network resource usage. However, some protocol + // implementations are fragile and don't like to see empty + // records, so this also increases robustness. + // + if (length > 0) { + try { + conContext.outputRecord.deliver(source, offset, length); + } catch (SSLHandshakeException she) { + // may be record sequence number overflow + conContext.fatal(Alert.HANDSHAKE_FAILURE, she); + } catch (IOException e) { + conContext.fatal(Alert.UNEXPECTED_MESSAGE, e); + } + } - case cs_START: - /* - * If we need to change the socket mode and the enabled - * protocols and cipher suites haven't specifically been - * set by the user, change them to the corresponding - * default ones. - */ - if (roleIsServer != (!flag)) { - if (sslContext.isDefaultProtocolList(enabledProtocols)) { - enabledProtocols = - sslContext.getDefaultProtocolList(!flag); - } + // Is the sequence number is nearly overflow? + if (conContext.outputRecord.seqNumIsHuge()) { + tryKeyUpdate(); + } + } - if (sslContext.isDefaultCipherSuiteList(enabledCipherSuites)) { - enabledCipherSuites = - sslContext.getDefaultCipherSuiteList(!flag); + private synchronized int readRecord() throws IOException { + while (!conContext.isInboundDone()) { + try { + Plaintext plainText = decode(null); + if ((plainText.contentType == ContentType.HANDSHAKE.id) && + conContext.isNegotiated) { + return 0; + } + } catch (SSLException ssle) { + throw ssle; + } catch (IOException ioe) { + if (!(ioe instanceof SSLException)) { + throw new SSLException("readRecord", ioe); + } else { + throw ioe; } } + } - roleIsServer = !flag; - break; + return -1; + } - case cs_HANDSHAKE: + private synchronized int readRecord(ByteBuffer buffer) throws IOException { + while (!conContext.isInboundDone()) { /* - * If we have a handshaker, but haven't started - * SSL traffic, we can throw away our current - * handshaker, and start from scratch. Don't - * need to call doneConnect() again, we already - * have the streams. + * clean the buffer and check if it is too small, e.g. because + * the AppInputStream did not have the chance to see the + * current packet length but rather something like that of the + * handshake before. In that case we return 0 at this point to + * give the caller the chance to adjust the buffer. */ - assert(handshaker != null); - if (!handshaker.activated()) { - /* - * If we need to change the socket mode and the enabled - * protocols and cipher suites haven't specifically been - * set by the user, change them to the corresponding - * default ones. - */ - if (roleIsServer != (!flag)) { - if (sslContext.isDefaultProtocolList(enabledProtocols)) { - enabledProtocols = - sslContext.getDefaultProtocolList(!flag); - } + buffer.clear(); + int inLen = conContext.inputRecord.bytesInCompletePacket(); + if (inLen < 0) { // EOF + handleEOF(null); - if (sslContext.isDefaultCipherSuiteList( - enabledCipherSuites)) { - enabledCipherSuites = - sslContext.getDefaultCipherSuiteList(!flag); - } - } + // if no exception thrown + return -1; + } - roleIsServer = !flag; - connectionState = cs_START; - initHandshaker(); - break; - } - - // If handshake has started, that's an error. Fall through... - - default: - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", setUseClientMode() invoked in state = " + - connectionState); + if (buffer.remaining() < inLen) { + return 0; + } + + try { + Plaintext plainText = decode(buffer); + if (plainText.contentType == ContentType.APPLICATION_DATA.id) { + return buffer.position(); + } + } catch (SSLException ssle) { + throw ssle; + } catch (IOException ioe) { + if (!(ioe instanceof SSLException)) { + throw new SSLException("readRecord", ioe); + } else { + throw ioe; + } } - throw new IllegalArgumentException( - "Cannot change mode after SSL traffic has started"); } - } - @Override - public synchronized boolean getUseClientMode() { - return !roleIsServer; + // + // couldn't read, due to some kind of error + // + return -1; } + private Plaintext decode(ByteBuffer destination) throws IOException { + Plaintext plainText; + try { + if (destination == null) { + plainText = SSLTransport.decode(conContext, + null, 0, 0, null, 0, 0); + } else { + plainText = SSLTransport.decode(conContext, + null, 0, 0, new ByteBuffer[]{destination}, 0, 1); + } + } catch (EOFException eofe) { + // EOFException is special as it is related to close_notify. + plainText = handleEOF(eofe); + } + + // Is the sequence number is nearly overflow? + if (plainText != Plaintext.PLAINTEXT_NULL && + conContext.inputRecord.seqNumIsHuge()) { + tryKeyUpdate(); + } - /** - * Returns the names of the cipher suites which could be enabled for use - * on an SSL connection. Normally, only a subset of these will actually - * be enabled by default, since this list may include cipher suites which - * do not support the mutual authentication of servers and clients, or - * which do not protect data confidentiality. Servers may also need - * certain kinds of certificates to use certain cipher suites. - * - * @return an array of cipher suite names - */ - @Override - public String[] getSupportedCipherSuites() { - return sslContext.getSupportedCipherSuiteList().toStringArray(); + return plainText; } /** - * Controls which particular cipher suites are enabled for use on - * this connection. The cipher suites must have been listed by - * getCipherSuites() as being supported. Even if a suite has been - * enabled, it might never be used if no peer supports it or the - * requisite certificates (and private keys) are not available. + * Try renegotiation or key update for sequence number wrap. * - * @param suites Names of all the cipher suites to enable. + * Note that in order to maintain the handshake status properly, we check + * the sequence number after the last record reading/writing process. As + * we request renegotiation or close the connection for wrapped sequence + * number when there is enough sequence number space left to handle a few + * more records, so the sequence number of the last record cannot be + * wrapped. */ - @Override - public synchronized void setEnabledCipherSuites(String[] suites) { - enabledCipherSuites = new CipherSuiteList(suites); - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setEnabledCipherSuites(enabledCipherSuites); + private void tryKeyUpdate() throws IOException { + // Don't bother to kickstart the renegotiation or key update when the + // local is asking for it. + if ((conContext.handshakeContext == null) && + !conContext.isClosed() && !conContext.isBroken) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest("key update to wrap sequence number"); + } + conContext.keyUpdate(); } } - /** - * Returns the names of the SSL cipher suites which are currently enabled - * for use on this connection. When an SSL socket is first created, - * all enabled cipher suites <em>(a)</em> protect data confidentiality, - * by traffic encryption, and <em>(b)</em> can mutually authenticate - * both clients and servers. Thus, in some environments, this value - * might be empty. - * - * @return an array of cipher suite names - */ - @Override - public synchronized String[] getEnabledCipherSuites() { - return enabledCipherSuites.toStringArray(); + private void closeSocket(boolean selfInitiated) throws IOException { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("close the ssl connection " + + (selfInitiated ? "(initiative)" : "(passive)")); + } + + if (autoClose || !isLayered()) { + super.close(); + } else if (selfInitiated) { + // wait for close_notify alert to clear input stream. + waitForClose(); + } } + /** + * Wait for close_notify alert for a graceful closure. + * + * [RFC 5246] If the application protocol using TLS provides that any + * data may be carried over the underlying transport after the TLS + * connection is closed, the TLS implementation must receive the responding + * close_notify alert before indicating to the application layer that + * the TLS connection has ended. If the application protocol will not + * transfer any additional data, but will only close the underlying + * transport connection, then the implementation MAY choose to close the + * transport without waiting for the responding close_notify. + */ + private void waitForClose() throws IOException { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("wait for close_notify or alert"); + } - /** - * Returns the protocols that are supported by this implementation. - * A subset of the supported protocols may be enabled for this connection - * @return an array of protocol names. - */ - @Override - public String[] getSupportedProtocols() { - return sslContext.getSuportedProtocolList().toStringArray(); + while (!conContext.isInboundDone()) { + try { + Plaintext plainText = decode(null); + // discard and continue + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest( + "discard plaintext while waiting for close", plainText); + } + } catch (Exception e) { // including RuntimeException + handleException(e); + } + } } /** - * Controls which protocols are enabled for use on - * this connection. The protocols must have been listed by - * getSupportedProtocols() as being supported. + * Initialize the handshaker and socket streams. * - * @param protocols protocols to enable. - * @exception IllegalArgumentException when one of the protocols - * named by the parameter is not supported. + * Called by connect, the layered constructor, and SSLServerSocket. */ - @Override - public synchronized void setEnabledProtocols(String[] protocols) { - enabledProtocols = new ProtocolList(protocols); - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setEnabledProtocols(enabledProtocols); + synchronized void doneConnect() throws IOException { + // In server mode, it is not necessary to set host and serverNames. + // Otherwise, would require a reverse DNS lookup to get the hostname. + if ((peerHost == null) || (peerHost.length() == 0)) { + boolean useNameService = + trustNameService && conContext.sslConfig.isClientMode; + useImplicitHost(useNameService); + } else { + conContext.sslConfig.serverNames = + Utilities.addToSNIServerNameList( + conContext.sslConfig.serverNames, peerHost); } - } - @Override - public synchronized String[] getEnabledProtocols() { - return enabledProtocols.toStringArray(); + InputStream sockInput = super.getInputStream(); + conContext.inputRecord.setReceiverStream(sockInput); + + OutputStream sockOutput = super.getOutputStream(); + conContext.inputRecord.setDeliverStream(sockOutput); + conContext.outputRecord.setDeliverStream(sockOutput); + + this.isConnected = true; } - /** - * Assigns the socket timeout. - * @see java.net.Socket#setSoTimeout - */ - @Override - public void setSoTimeout(int timeout) throws SocketException { - if ((debug != null) && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", setSoTimeout(" + timeout + ") called"); + private void useImplicitHost(boolean useNameService) { + // Note: If the local name service is not trustworthy, reverse + // host name resolution should not be performed for endpoint + // identification. Use the application original specified + // hostname or IP address instead. + + // Get the original hostname via jdk.internal.misc.SharedSecrets + InetAddress inetAddress = getInetAddress(); + if (inetAddress == null) { // not connected + return; } - super.setSoTimeout(timeout); - } + JavaNetInetAddressAccess jna = + SharedSecrets.getJavaNetInetAddressAccess(); + String originalHostname = jna.getOriginalHostName(inetAddress); + if ((originalHostname != null) && + (originalHostname.length() != 0)) { - /** - * Registers an event listener to receive notifications that an - * SSL handshake has completed on this connection. - */ - @Override - public synchronized void addHandshakeCompletedListener( - HandshakeCompletedListener listener) { - if (listener == null) { - throw new IllegalArgumentException("listener is null"); + this.peerHost = originalHostname; + if (conContext.sslConfig.serverNames.isEmpty() && + !conContext.sslConfig.noSniExtension) { + conContext.sslConfig.serverNames = + Utilities.addToSNIServerNameList( + conContext.sslConfig.serverNames, peerHost); + } + + return; } - if (handshakeListeners == null) { - handshakeListeners = new - HashMap<HandshakeCompletedListener, AccessControlContext>(4); + + // No explicitly specified hostname, no server name indication. + if (!useNameService) { + // The local name service is not trustworthy, use IP address. + this.peerHost = inetAddress.getHostAddress(); + } else { + // Use the underlying reverse host name resolution service. + this.peerHost = getInetAddress().getHostName(); } - handshakeListeners.put(listener, AccessController.getContext()); } + // ONLY used by HttpsClient to setup the URI specified hostname + // + // Please NOTE that this method MUST be called before calling to + // SSLSocket.setSSLParameters(). Otherwise, the {@code host} parameter + // may override SNIHostName in the customized server name indication. + public synchronized void setHost(String host) { + this.peerHost = host; + this.conContext.sslConfig.serverNames = + Utilities.addToSNIServerNameList( + conContext.sslConfig.serverNames, host); + } /** - * Removes a previously registered handshake completion listener. + * Return whether we have reached end-of-file. + * + * If the socket is not connected, has been shutdown because of an error + * or has been closed, throw an Exception. */ - @Override - public synchronized void removeHandshakeCompletedListener( - HandshakeCompletedListener listener) { - if (handshakeListeners == null) { - throw new IllegalArgumentException("no listeners"); - } - if (handshakeListeners.remove(listener) == null) { - throw new IllegalArgumentException("listener not registered"); - } - if (handshakeListeners.isEmpty()) { - handshakeListeners = null; + synchronized boolean checkEOF() throws IOException { + if (conContext.isClosed()) { + return true; + } else if (conContext.isInputCloseNotified || conContext.isBroken) { + if (conContext.closeReason == null) { + return true; + } else { + throw new SSLException( + "Connection has been shutdown: " + conContext.closeReason, + conContext.closeReason); + } } + + return false; } /** - * Returns the SSLParameters in effect for this SSLSocket. + * Check if we can write data to this socket. */ - @Override - public synchronized SSLParameters getSSLParameters() { - SSLParameters params = super.getSSLParameters(); - - // the super implementation does not handle the following parameters - params.setEndpointIdentificationAlgorithm(identificationProtocol); - params.setAlgorithmConstraints(algorithmConstraints); - - if (sniMatchers.isEmpty() && !noSniMatcher) { - // 'null' indicates none has been set - params.setSNIMatchers(null); - } else { - params.setSNIMatchers(sniMatchers); + synchronized void checkWrite() throws IOException { + if (checkEOF() || conContext.isOutboundClosed()) { + // we are at EOF, write must throw Exception + throw new SocketException("Connection closed"); } - - if (serverNames.isEmpty() && !noSniExtension) { - // 'null' indicates none has been set - params.setServerNames(null); - } else { - params.setServerNames(serverNames); + if (!isConnected) { + throw new SocketException("Socket is not connected"); } - - params.setUseCipherSuitesOrder(preferLocalCipherSuites); - params.setMaximumPacketSize(maximumPacketSize); - params.setApplicationProtocols(applicationProtocols); - - // DTLS handshake retransmissions parameter does not apply here. - - return params; } /** - * Applies SSLParameters to this socket. + * Handle an exception. + * + * This method is called by top level exception handlers (in read(), + * write()) to make sure we always shutdown the connection correctly + * and do not pass runtime exception to the application. + * + * This method never returns normally, it always throws an IOException. */ - @Override - public synchronized void setSSLParameters(SSLParameters params) { - super.setSSLParameters(params); - - // the super implementation does not handle the following parameters - identificationProtocol = params.getEndpointIdentificationAlgorithm(); - algorithmConstraints = params.getAlgorithmConstraints(); - preferLocalCipherSuites = params.getUseCipherSuitesOrder(); - maximumPacketSize = params.getMaximumPacketSize(); - - // DTLS handshake retransmissions parameter does not apply here. - - if (maximumPacketSize != 0) { - outputRecord.changePacketSize(maximumPacketSize); - } else { - // use the implicit maximum packet size. - maximumPacketSize = outputRecord.getMaxPacketSize(); + private void handleException(Exception cause) throws IOException { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("handling exception", cause); } - List<SNIServerName> sniNames = params.getServerNames(); - if (sniNames != null) { - noSniExtension = sniNames.isEmpty(); - serverNames = sniNames; + // Don't close the Socket in case of timeouts or interrupts. + if (cause instanceof InterruptedIOException) { + throw (IOException)cause; } - Collection<SNIMatcher> matchers = params.getSNIMatchers(); - if (matchers != null) { - noSniMatcher = matchers.isEmpty(); - sniMatchers = matchers; + // need to perform error shutdown + boolean isSSLException = (cause instanceof SSLException); + Alert alert; + if (isSSLException) { + if (cause instanceof SSLHandshakeException) { + alert = Alert.HANDSHAKE_FAILURE; + } else { + alert = Alert.UNEXPECTED_MESSAGE; + } + } else { + if (cause instanceof IOException) { + alert = Alert.UNEXPECTED_MESSAGE; + } else { + // RuntimeException + alert = Alert.INTERNAL_ERROR; + } } + conContext.fatal(alert, cause); + } - applicationProtocols = params.getApplicationProtocols(); - - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setIdentificationProtocol(identificationProtocol); - handshaker.setAlgorithmConstraints(algorithmConstraints); - handshaker.setMaximumPacketSize(maximumPacketSize); - handshaker.setApplicationProtocols(applicationProtocols); - if (roleIsServer) { - handshaker.setSNIMatchers(sniMatchers); - handshaker.setUseCipherSuitesOrder(preferLocalCipherSuites); + private Plaintext handleEOF(EOFException eofe) throws IOException { + if (requireCloseNotify || conContext.handshakeContext != null) { + SSLException ssle; + if (conContext.handshakeContext != null) { + ssle = new SSLHandshakeException( + "Remote host terminated the handshake"); } else { - handshaker.setSNIServerNames(serverNames); + ssle = new SSLProtocolException( + "Remote host terminated the connection"); + } + + if (eofe != null) { + ssle.initCause(eofe); } + throw ssle; + } else { + // treat as if we had received a close_notify + conContext.isInputCloseNotified = true; + conContext.transport.shutdown(); + + return Plaintext.PLAINTEXT_NULL; } } - @Override - public synchronized String getApplicationProtocol() { - return applicationProtocol; - } @Override - public synchronized String getHandshakeApplicationProtocol() { - if ((handshaker != null) && handshaker.started()) { - return handshaker.getHandshakeApplicationProtocol(); - } - return null; + public String getPeerHost() { + return peerHost; } @Override - public synchronized void setHandshakeApplicationProtocolSelector( - BiFunction<SSLSocket, List<String>, String> selector) { - applicationProtocolSelector = selector; - if ((handshaker != null) && !handshaker.activated()) { - handshaker.setApplicationProtocolSelectorSSLSocket(selector); - } + public int getPeerPort() { + return getPort(); } @Override - public synchronized BiFunction<SSLSocket, List<String>, String> - getHandshakeApplicationProtocolSelector() { - return this.applicationProtocolSelector; + public boolean useDelegatedTask() { + return false; } - // - // We allocate a separate thread to deliver handshake completion - // events. This ensures that the notifications don't block the - // protocol state machine. - // - private static class NotifyHandshake implements Runnable { - - private Set<Map.Entry<HandshakeCompletedListener,AccessControlContext>> - targets; // who gets notified - private HandshakeCompletedEvent event; // the notification - - NotifyHandshake( - Set<Map.Entry<HandshakeCompletedListener,AccessControlContext>> - entrySet, HandshakeCompletedEvent e) { - - targets = new HashSet<>(entrySet); // clone the entry set - event = e; - } + @Override + public void shutdown() throws IOException { + if (!isClosed()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("close the underlying socket"); + } - @Override - public void run() { - // Don't need to synchronize, as it only runs in one thread. - for (Map.Entry<HandshakeCompletedListener,AccessControlContext> - entry : targets) { - - final HandshakeCompletedListener l = entry.getKey(); - AccessControlContext acc = entry.getValue(); - AccessController.doPrivileged(new PrivilegedAction<Void>() { - @Override - public Void run() { - l.handshakeCompleted(event); - return null; - } - }, acc); + try { + if (conContext.isInputCloseNotified) { + // Close the connection, no wait for more peer response. + closeSocket(false); + } else { + // Close the connection, may wait for peer close_notify. + closeSocket(true); + } + } finally { + tlsIsClosed = true; } } } - - /** - * Returns a printable representation of this end of the connection. - */ - @Override - public String toString() { - StringBuilder retval = new StringBuilder(80); - - retval.append(Integer.toHexString(hashCode())); - retval.append("["); - retval.append(sess.getCipherSuite()); - retval.append(": "); - - retval.append(super.toString()); - retval.append("]"); - - return retval.toString(); - } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,15 +25,21 @@ package sun.security.ssl; -import java.io.*; -import java.nio.*; - +import java.io.EOFException; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.util.ArrayList; import javax.crypto.BadPaddingException; - -import javax.net.ssl.*; - -import sun.security.util.HexDumpEncoder; - +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLProtocolException; + +import sun.security.ssl.SSLCipher.SSLReadCipher; +import sun.security.ssl.KeyUpdate.KeyUpdateMessage; +import sun.security.ssl.KeyUpdate.KeyUpdateRequest; /** * {@code InputRecord} implementation for {@code SSLSocket}. @@ -41,30 +47,34 @@ * @author David Brownell */ final class SSLSocketInputRecord extends InputRecord implements SSLRecord { - private OutputStream deliverStream = null; - private byte[] temporary = new byte[1024]; - - // used by handshake hash computation for handshake fragment - private byte prevType = -1; - private int hsMsgOff = 0; - private int hsMsgLen = 0; + private InputStream is = null; + private OutputStream os = null; + private final byte[] temporary = new byte[1024]; private boolean formatVerified = false; // SSLv2 ruled out? + // Cache for incomplete handshake messages. + private ByteBuffer handshakeBuffer = null; + private boolean hasHeader = false; // Had read the record header - SSLSocketInputRecord() { - this.readAuthenticator = MAC.TLS_NULL; + SSLSocketInputRecord(HandshakeHash handshakeHash) { + super(handshakeHash, SSLReadCipher.nullTlsReadCipher()); } @Override - int bytesInCompletePacket(InputStream is) throws IOException { - + int bytesInCompletePacket() throws IOException { if (!hasHeader) { // read exactly one record - int really = read(is, temporary, 0, headerSize); - if (really < 0) { - throw new EOFException("SSL peer shut down incorrectly"); + try { + int really = read(is, temporary, 0, headerSize); + if (really < 0) { + // EOF: peer shut down incorrectly + return -1; + } + } catch (EOFException eofe) { + // The caller will handle EOF. + return -1; } hasHeader = true; } @@ -75,19 +85,21 @@ /* * If we have already verified previous packets, we can * ignore the verifications steps, and jump right to the - * determination. Otherwise, try one last hueristic to + * determination. Otherwise, try one last heuristic to * see if it's SSL/TLS. */ if (formatVerified || - (byteZero == ct_handshake) || (byteZero == ct_alert)) { + (byteZero == ContentType.HANDSHAKE.id) || + (byteZero == ContentType.ALERT.id)) { /* * Last sanity check that it's not a wild record */ - ProtocolVersion recordVersion = - ProtocolVersion.valueOf(temporary[1], temporary[2]); - - // check the record version - checkRecordVersion(recordVersion, false); + if (!ProtocolVersion.isNegotiable( + temporary[1], temporary[2], false, false)) { + throw new SSLException("Unrecognized record version " + + ProtocolVersion.nameOf(temporary[1], temporary[2]) + + " , plaintext connection?"); + } /* * Reasonably sure this is a V3, disable further checks. @@ -112,11 +124,12 @@ boolean isShort = ((byteZero & 0x80) != 0); if (isShort && ((temporary[2] == 1) || (temporary[2] == 4))) { - ProtocolVersion recordVersion = - ProtocolVersion.valueOf(temporary[3], temporary[4]); - - // check the record version - checkRecordVersion(recordVersion, true); + if (!ProtocolVersion.isNegotiable( + temporary[3], temporary[4], false, false)) { + throw new SSLException("Unrecognized record version " + + ProtocolVersion.nameOf(temporary[3], temporary[4]) + + " , plaintext connection?"); + } /* * Client or Server Hello @@ -140,10 +153,10 @@ return len; } - // destination.position() is zero. + // Note that the input arguments are not used actually. @Override - Plaintext decode(InputStream is, ByteBuffer destination) - throws IOException, BadPaddingException { + Plaintext[] decode(ByteBuffer[] srcs, int srcsOffset, + int srcsLength) throws IOException, BadPaddingException { if (isClosed) { return null; @@ -167,36 +180,44 @@ * alert message. If it's not, it is either invalid or an * SSLv2 message. */ - if ((temporary[0] != ct_handshake) && - (temporary[0] != ct_alert)) { - - plaintext = handleUnknownRecord(is, temporary, destination); + if ((temporary[0] != ContentType.HANDSHAKE.id) && + (temporary[0] != ContentType.ALERT.id)) { + hasHeader = false; + return handleUnknownRecord(temporary); } } - if (plaintext == null) { - plaintext = decodeInputRecord(is, temporary, destination); - } - - // The record header should has comsumed. + // The record header should has consumed. hasHeader = false; + return decodeInputRecord(temporary); + } - return plaintext; + @Override + void setReceiverStream(InputStream inputStream) { + this.is = inputStream; } @Override void setDeliverStream(OutputStream outputStream) { - this.deliverStream = outputStream; + this.os = outputStream; } // Note that destination may be null - private Plaintext decodeInputRecord(InputStream is, byte[] header, - ByteBuffer destination) throws IOException, BadPaddingException { - - byte contentType = header[0]; - byte majorVersion = header[1]; - byte minorVersion = header[2]; - int contentLen = ((header[3] & 0xFF) << 8) + (header[4] & 0xFF); + private Plaintext[] decodeInputRecord( + byte[] header) throws IOException, BadPaddingException { + byte contentType = header[0]; // pos: 0 + byte majorVersion = header[1]; // pos: 1 + byte minorVersion = header[2]; // pos: 2 + int contentLen = ((header[3] & 0xFF) << 8) + + (header[4] & 0xFF); // pos: 3, 4 + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "READ: " + + ProtocolVersion.nameOf(majorVersion, minorVersion) + + " " + ContentType.nameOf(contentType) + ", length = " + + contentLen); + } // // Check for upper bound. @@ -210,10 +231,7 @@ // // Read a complete record. // - if (destination == null) { - destination = ByteBuffer.allocate(headerSize + contentLen); - } // Otherwise, the destination buffer should have enough room. - + ByteBuffer destination = ByteBuffer.allocate(headerSize + contentLen); int dstPos = destination.position(); destination.put(temporary, 0, headerSize); while (contentLen > 0) { @@ -229,100 +247,129 @@ destination.flip(); destination.position(dstPos + headerSize); - if (debug != null && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", READ: " + - ProtocolVersion.valueOf(majorVersion, minorVersion) + - " " + Record.contentName(contentType) + ", length = " + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "READ: " + + ProtocolVersion.nameOf(majorVersion, minorVersion) + + " " + ContentType.nameOf(contentType) + ", length = " + destination.remaining()); } // // Decrypt the fragment // - ByteBuffer plaintext = - decrypt(readAuthenticator, readCipher, contentType, destination); + ByteBuffer fragment; + try { + Plaintext plaintext = + readCipher.decrypt(contentType, destination, null); + fragment = plaintext.fragment; + contentType = plaintext.contentType; + } catch (BadPaddingException bpe) { + throw bpe; + } catch (GeneralSecurityException gse) { + throw (SSLProtocolException)(new SSLProtocolException( + "Unexpected exception")).initCause(gse); + } - if ((contentType != ct_handshake) && (hsMsgOff != hsMsgLen)) { + if (contentType != ContentType.HANDSHAKE.id && + handshakeBuffer != null && handshakeBuffer.hasRemaining()) { throw new SSLProtocolException( - "Expected to get a handshake fragment"); + "Expecting a handshake fragment, but received " + + ContentType.nameOf(contentType)); } // - // handshake hashing + // parse handshake messages // - if (contentType == ct_handshake) { - int pltPos = plaintext.position(); - int pltLim = plaintext.limit(); - int frgPos = pltPos; - for (int remains = plaintext.remaining(); remains > 0;) { - int howmuch; - byte handshakeType; - if (hsMsgOff < hsMsgLen) { - // a fragment of the handshake message - howmuch = Math.min((hsMsgLen - hsMsgOff), remains); - handshakeType = prevType; - - hsMsgOff += howmuch; - if (hsMsgOff == hsMsgLen) { - // Now is a complete handshake message. - hsMsgOff = 0; - hsMsgLen = 0; - } - } else { // hsMsgOff == hsMsgLen, a new handshake message - handshakeType = plaintext.get(); - int handshakeLen = ((plaintext.get() & 0xFF) << 16) | - ((plaintext.get() & 0xFF) << 8) | - (plaintext.get() & 0xFF); - plaintext.position(frgPos); - if (remains < (handshakeLen + 1)) { // 1: handshake type - // This handshake message is fragmented. - prevType = handshakeType; - hsMsgOff = remains - 4; // 4: handshake header - hsMsgLen = handshakeLen; - } - - howmuch = Math.min(handshakeLen + 4, remains); + if (contentType == ContentType.HANDSHAKE.id) { + ByteBuffer handshakeFrag = fragment; + if ((handshakeBuffer != null) && + (handshakeBuffer.remaining() != 0)) { + ByteBuffer bb = ByteBuffer.wrap(new byte[ + handshakeBuffer.remaining() + fragment.remaining()]); + bb.put(handshakeBuffer); + bb.put(fragment); + handshakeFrag = bb.rewind(); + handshakeBuffer = null; + } + + ArrayList<Plaintext> plaintexts = new ArrayList<>(5); + while (handshakeFrag.hasRemaining()) { + int remaining = handshakeFrag.remaining(); + if (remaining < handshakeHeaderSize) { + handshakeBuffer = ByteBuffer.wrap(new byte[remaining]); + handshakeBuffer.put(handshakeFrag); + handshakeBuffer.rewind(); + break; } - plaintext.limit(frgPos + howmuch); - - if (handshakeType == HandshakeMessage.ht_hello_request) { - // omitted from handshake hash computation - } else if ((handshakeType != HandshakeMessage.ht_finished) && - (handshakeType != HandshakeMessage.ht_certificate_verify)) { - - if (handshakeHash == null) { - // used for cache only - handshakeHash = new HandshakeHash(false); + handshakeFrag.mark(); + // skip the first byte: handshake type + byte handshakeType = handshakeFrag.get(); + int handshakeBodyLen = Record.getInt24(handshakeFrag); + handshakeFrag.reset(); + int handshakeMessageLen = + handshakeHeaderSize + handshakeBodyLen; + if (remaining < handshakeMessageLen) { + handshakeBuffer = ByteBuffer.wrap(new byte[remaining]); + handshakeBuffer.put(handshakeFrag); + handshakeBuffer.rewind(); + break; + } if (remaining == handshakeMessageLen) { + if (handshakeHash.isHashable(handshakeType)) { + handshakeHash.receive(handshakeFrag); } - handshakeHash.update(plaintext); + + plaintexts.add( + new Plaintext(contentType, + majorVersion, minorVersion, -1, -1L, handshakeFrag) + ); + break; } else { - // Reserve until this handshake message has been processed. - if (handshakeHash == null) { - // used for cache only - handshakeHash = new HandshakeHash(false); + int fragPos = handshakeFrag.position(); + int fragLim = handshakeFrag.limit(); + int nextPos = fragPos + handshakeMessageLen; + handshakeFrag.limit(nextPos); + + if (handshakeHash.isHashable(handshakeType)) { + handshakeHash.receive(handshakeFrag); } - handshakeHash.reserve(plaintext); + + plaintexts.add( + new Plaintext(contentType, majorVersion, minorVersion, + -1, -1L, handshakeFrag.slice()) + ); + + handshakeFrag.position(nextPos); + handshakeFrag.limit(fragLim); } + } - plaintext.position(frgPos + howmuch); - plaintext.limit(pltLim); + return plaintexts.toArray(new Plaintext[0]); + } - frgPos += howmuch; - remains -= howmuch; + // KeyLimit check during application data. + // atKeyLimit() inactive when limits not checked, tc set when limits + // are active. + + if (readCipher.atKeyLimit()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("KeyUpdate: triggered, read side."); } - plaintext.position(pltPos); + + PostHandshakeContext p = new PostHandshakeContext(tc); + KeyUpdate.handshakeProducer.produce(p, + new KeyUpdateMessage(p, KeyUpdateRequest.REQUESTED)); } - return new Plaintext(contentType, - majorVersion, minorVersion, -1, -1L, plaintext); - // recordEpoch, recordSeq, plaintext); + return new Plaintext[] { + new Plaintext(contentType, + majorVersion, minorVersion, -1, -1L, fragment) + }; } - private Plaintext handleUnknownRecord(InputStream is, byte[] header, - ByteBuffer destination) throws IOException, BadPaddingException { - + private Plaintext[] handleUnknownRecord( + byte[] header) throws IOException, BadPaddingException { byte firstByte = header[0]; byte thirdByte = header[2]; @@ -347,19 +394,16 @@ * error message, one that's treated as fatal by * clients (Otherwise we'll hang.) */ - deliverStream.write(SSLRecord.v2NoCipher); // SSLv2Hello + os.write(SSLRecord.v2NoCipher); // SSLv2Hello - if (debug != null) { - if (Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + + if (SSLLogger.isOn) { + if (SSLLogger.isOn("record")) { + SSLLogger.fine( "Requested to negotiate unsupported SSLv2!"); } - if (Debug.isOn("packet")) { - Debug.printHex( - "[Raw write]: length = " + - SSLRecord.v2NoCipher.length, - SSLRecord.v2NoCipher); + if (SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw write", SSLRecord.v2NoCipher); } } @@ -368,9 +412,7 @@ int msgLen = ((header[0] & 0x7F) << 8) | (header[1] & 0xFF); - if (destination == null) { - destination = ByteBuffer.allocate(headerSize + msgLen); - } + ByteBuffer destination = ByteBuffer.allocate(headerSize + msgLen); destination.put(temporary, 0, headerSize); msgLen -= 3; // had read 3 bytes of content as header while (msgLen > 0) { @@ -391,23 +433,20 @@ * V3 ClientHello message, and pass it up. */ destination.position(2); // exclude the header - - if (handshakeHash == null) { - // used for cache only - handshakeHash = new HandshakeHash(false); - } - handshakeHash.update(destination); + handshakeHash.receive(destination); destination.position(0); ByteBuffer converted = convertToClientHello(destination); - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine( "[Converted] ClientHello", converted); } - return new Plaintext(ct_handshake, - majorVersion, minorVersion, -1, -1L, converted); + return new Plaintext[] { + new Plaintext(ContentType.HANDSHAKE.id, + majorVersion, minorVersion, -1, -1L, converted) + }; } else { if (((firstByte & 0x80) != 0) && (thirdByte == 4)) { throw new SSLException("SSL V2.0 servers are not supported."); @@ -424,13 +463,15 @@ while (n < len) { int readLen = is.read(buffer, offset + n, len - n); if (readLen < 0) { + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw read: EOF"); + } return -1; } - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw read]: length = " + readLen, - buffer, offset + n, readLen); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + ByteBuffer bb = ByteBuffer.wrap(buffer, offset + n, readLen); + SSLLogger.fine("Raw read", bb); } n += readLen; diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLSocketOutputRecord.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,14 @@ package sun.security.ssl; -import java.io.*; -import java.nio.*; -import java.util.Arrays; - -import javax.net.ssl.SSLException; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.OutputStream; +import java.nio.ByteBuffer; import javax.net.ssl.SSLHandshakeException; -import sun.security.util.HexDumpEncoder; +import sun.security.ssl.KeyUpdate.KeyUpdateMessage; +import sun.security.ssl.KeyUpdate.KeyUpdateRequest; /** * {@code OutputRecord} implementation for {@code SSLSocket}. @@ -40,11 +40,16 @@ final class SSLSocketOutputRecord extends OutputRecord implements SSLRecord { private OutputStream deliverStream = null; - SSLSocketOutputRecord() { - this.writeAuthenticator = MAC.TLS_NULL; + SSLSocketOutputRecord(HandshakeHash handshakeHash) { + this(handshakeHash, null); + } + SSLSocketOutputRecord(HandshakeHash handshakeHash, + TransportContext tc) { + super(handshakeHash, SSLCipher.SSLWriteCipher.nullTlsWriteCipher()); + this.tc = tc; this.packetSize = SSLRecord.maxRecordSize; - this.protocolVersion = ProtocolVersion.DEFAULT_TLS; + this.protocolVersion = ProtocolVersion.NONE; } @Override @@ -55,25 +60,22 @@ write(level); write(description); - - if (debug != null && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + - " " + Record.contentName(Record.ct_alert) + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine("WRITE: " + protocolVersion + + " " + ContentType.ALERT.name + ", length = " + (count - headerSize)); } // Encrypt the fragment and wrap up a record. - encrypt(writeAuthenticator, writeCipher, - Record.ct_alert, headerSize); + encrypt(writeCipher, ContentType.ALERT.id, headerSize); // deliver this message deliverStream.write(buf, 0, count); // may throw IOException deliverStream.flush(); // may throw IOException - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw write]: length = " + count, buf, 0, count); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw write", + (new ByteArrayInputStream(buf, 0, count))); } // reset the internal buffer @@ -83,12 +85,11 @@ @Override void encodeHandshake(byte[] source, int offset, int length) throws IOException { - if (firstMessage) { firstMessage = false; if ((helloVersion == ProtocolVersion.SSL20Hello) && - (source[offset] == HandshakeMessage.ht_client_hello) && + (source[offset] == SSLHandshake.CLIENT_HELLO.id) && // 5: recode header size (source[offset + 4 + 2 + 32] == 0)) { // V3 session ID is empty @@ -101,12 +102,12 @@ byte[] record = v2ClientHello.array(); // array offset is zero int limit = v2ClientHello.limit(); - handshakeHash.update(record, 2, (limit - 2)); + handshakeHash.deliver(record, 2, (limit - 2)); - if (debug != null && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: SSLv2 ClientHello message" + - ", length = " + limit); + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "WRITE: SSLv2 ClientHello message" + + ", length = " + limit); } // deliver this message @@ -117,9 +118,9 @@ deliverStream.write(record, 0, limit); deliverStream.flush(); - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw write]: length = " + count, record, 0, limit); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw write", + (new ByteArrayInputStream(record, 0, limit))); } return; @@ -127,8 +128,8 @@ } byte handshakeType = source[0]; - if (handshakeType != HandshakeMessage.ht_hello_request) { - handshakeHash.update(source, offset, length); + if (handshakeHash.isHashable(handshakeType)) { + handshakeHash.deliver(source, offset, length); } int fragLimit = getFragLimit(); @@ -153,24 +154,23 @@ return; } - if (debug != null && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + - " " + Record.contentName(Record.ct_handshake) + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "WRITE: " + protocolVersion + + " " + ContentType.HANDSHAKE.name + ", length = " + (count - headerSize)); } // Encrypt the fragment and wrap up a record. - encrypt(writeAuthenticator, writeCipher, - Record.ct_handshake, headerSize); + encrypt(writeCipher, ContentType.HANDSHAKE.id, headerSize); // deliver this message deliverStream.write(buf, 0, count); // may throw IOException deliverStream.flush(); // may throw IOException - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw write]: length = " + count, buf, 0, count); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw write", + (new ByteArrayInputStream(buf, 0, count))); } // reset the offset @@ -190,24 +190,16 @@ write((byte)1); // byte 1: change_cipher_spec( - if (debug != null && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + - " " + Record.contentName(Record.ct_change_cipher_spec) + - ", length = " + (count - headerSize)); - } - // Encrypt the fragment and wrap up a record. - encrypt(writeAuthenticator, writeCipher, - Record.ct_change_cipher_spec, headerSize); + encrypt(writeCipher, ContentType.CHANGE_CIPHER_SPEC.id, headerSize); // deliver this message deliverStream.write(buf, 0, count); // may throw IOException // deliverStream.flush(); // flush in Finished - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw write]: length = " + count, buf, 0, count); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw write", + (new ByteArrayInputStream(buf, 0, count))); } // reset the internal buffer @@ -221,24 +213,23 @@ return; } - if (debug != null && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + - " " + Record.contentName(Record.ct_handshake) + + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "WRITE: " + protocolVersion + + " " + ContentType.HANDSHAKE.name + ", length = " + (count - headerSize)); } // Encrypt the fragment and wrap up a record. - encrypt(writeAuthenticator, writeCipher, - Record.ct_handshake, headerSize); + encrypt(writeCipher, ContentType.HANDSHAKE.id, headerSize); // deliver this message deliverStream.write(buf, 0, count); // may throw IOException deliverStream.flush(); // may throw IOException - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw write]: length = " + count, buf, 0, count); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw write", + (new ByteArrayInputStream(buf, 0, count))); } // reset the internal buffer @@ -247,11 +238,10 @@ @Override void deliver(byte[] source, int offset, int length) throws IOException { - - if (writeAuthenticator.seqNumOverflow()) { - if (debug != null && Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", sequence number extremely close to overflow " + + if (writeCipher.authenticator.seqNumOverflow()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine( + "sequence number extremely close to overflow " + "(2^64-1 packets). Closing connection."); } @@ -260,16 +250,11 @@ boolean isFirstRecordOfThePayload = true; for (int limit = (offset + length); offset < limit;) { - int macLen = 0; - if (writeAuthenticator instanceof MAC) { - macLen = ((MAC)writeAuthenticator).MAClen(); - } - int fragLen; if (packetSize > 0) { fragLen = Math.min(maxRecordSize, packetSize); - fragLen = writeCipher.calculateFragmentSize( - fragLen, macLen, headerSize); + fragLen = + writeCipher.calculateFragmentSize(fragLen, headerSize); fragLen = Math.min(fragLen, Record.maxDataSize); } else { @@ -292,24 +277,23 @@ count = position; write(source, offset, fragLen); - if (debug != null && Debug.isOn("record")) { - System.out.println(Thread.currentThread().getName() + - ", WRITE: " + protocolVersion + - " " + Record.contentName(Record.ct_application_data) + - ", length = " + (count - headerSize)); + if (SSLLogger.isOn && SSLLogger.isOn("record")) { + SSLLogger.fine( + "WRITE: " + protocolVersion + + " " + ContentType.APPLICATION_DATA.name + + ", length = " + (count - position)); } // Encrypt the fragment and wrap up a record. - encrypt(writeAuthenticator, writeCipher, - Record.ct_application_data, headerSize); + encrypt(writeCipher, ContentType.APPLICATION_DATA.id, headerSize); // deliver this message deliverStream.write(buf, 0, count); // may throw IOException deliverStream.flush(); // may throw IOException - if (debug != null && Debug.isOn("packet")) { - Debug.printHex( - "[Raw write]: length = " + count, buf, 0, count); + if (SSLLogger.isOn && SSLLogger.isOn("packet")) { + SSLLogger.fine("Raw write", + (new ByteArrayInputStream(buf, 0, count))); } // reset the internal buffer @@ -320,6 +304,18 @@ } offset += fragLen; + + // atKeyLimit() inactive when limits not checked, tc set when limits + // are active. + if (writeCipher.atKeyLimit()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("KeyUpdate: triggered, write side."); + } + + PostHandshakeContext p = new PostHandshakeContext(tc); + KeyUpdate.handshakeProducer.produce(p, + new KeyUpdateMessage(p, KeyUpdateRequest.REQUESTED)); + } } } @@ -358,16 +354,11 @@ } private int getFragLimit() { - int macLen = 0; - if (writeAuthenticator instanceof MAC) { - macLen = ((MAC)writeAuthenticator).MAClen(); - } - int fragLimit; if (packetSize > 0) { fragLimit = Math.min(maxRecordSize, packetSize); - fragLimit = writeCipher.calculateFragmentSize( - fragLimit, macLen, headerSize); + fragLimit = + writeCipher.calculateFragmentSize(fragLimit, headerSize); fragLimit = Math.min(fragLimit, Record.maxDataSize); } else { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLStringizer.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLStringizer.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLStringizer.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLStringizer.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.nio.ByteBuffer; + +/** + * Interface to decode a {@code ByteBuffer} into legible {@code String}. + */ +interface SSLStringizer { + /** + * Returns a legible string representation of a {@code ByteBuffer}. + * + * Note that the implementation MUST not change the internal status of + * the {@code buffer}. + */ + String toString(ByteBuffer buffer); +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLTrafficKeyDerivation.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLTrafficKeyDerivation.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLTrafficKeyDerivation.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLTrafficKeyDerivation.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.security.GeneralSecurityException; +import java.security.ProviderException; +import java.security.spec.AlgorithmParameterSpec; +import javax.crypto.KeyGenerator; +import javax.crypto.SecretKey; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import javax.net.ssl.SSLHandshakeException; +import sun.security.internal.spec.TlsKeyMaterialParameterSpec; +import sun.security.internal.spec.TlsKeyMaterialSpec; +import sun.security.ssl.CipherSuite.HashAlg; +import static sun.security.ssl.CipherSuite.HashAlg.H_NONE; + +enum SSLTrafficKeyDerivation implements SSLKeyDerivationGenerator { + SSL30 ("kdf_ssl30", new S30TrafficKeyDerivationGenerator()), + TLS10 ("kdf_tls10", new T10TrafficKeyDerivationGenerator()), + TLS12 ("kdf_tls12", new T12TrafficKeyDerivationGenerator()), + TLS13 ("kdf_tls13", new T13TrafficKeyDerivationGenerator()); + + final String name; + final SSLKeyDerivationGenerator keyDerivationGenerator; + + SSLTrafficKeyDerivation(String name, + SSLKeyDerivationGenerator keyDerivationGenerator) { + this.name = name; + this.keyDerivationGenerator = keyDerivationGenerator; + } + + static SSLTrafficKeyDerivation valueOf(ProtocolVersion protocolVersion) { + switch (protocolVersion) { + case SSL30: + return SSLTrafficKeyDerivation.SSL30; + case TLS10: + case TLS11: + case DTLS10: + return SSLTrafficKeyDerivation.TLS10; + case TLS12: + case DTLS12: + return SSLTrafficKeyDerivation.TLS12; + case TLS13: + return SSLTrafficKeyDerivation.TLS13; + } + + return null; + } + + @Override + public SSLKeyDerivation createKeyDerivation(HandshakeContext context, + SecretKey secretKey) throws IOException { + return keyDerivationGenerator.createKeyDerivation(context, secretKey); + } + + private static final class S30TrafficKeyDerivationGenerator + implements SSLKeyDerivationGenerator { + private S30TrafficKeyDerivationGenerator() { + // blank + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext context, SecretKey secretKey) throws IOException { + return new LegacyTrafficKeyDerivation(context, secretKey); + } + } + + private static final class T10TrafficKeyDerivationGenerator + implements SSLKeyDerivationGenerator { + private T10TrafficKeyDerivationGenerator() { + // blank + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext context, SecretKey secretKey) throws IOException { + return new LegacyTrafficKeyDerivation(context, secretKey); + } + } + + private static final class T12TrafficKeyDerivationGenerator + implements SSLKeyDerivationGenerator { + private T12TrafficKeyDerivationGenerator() { + // blank + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext context, SecretKey secretKey) throws IOException { + return new LegacyTrafficKeyDerivation(context, secretKey); + } + } + + private static final class T13TrafficKeyDerivationGenerator + implements SSLKeyDerivationGenerator { + private T13TrafficKeyDerivationGenerator() { + // blank + } + + @Override + public SSLKeyDerivation createKeyDerivation( + HandshakeContext context, + SecretKey secretKey) throws IOException { + return new T13TrafficKeyDerivation(context, secretKey); + } + } + + static final class T13TrafficKeyDerivation implements SSLKeyDerivation { + private final CipherSuite cs; + private final SecretKey secret; + + T13TrafficKeyDerivation( + HandshakeContext context, SecretKey secret) { + this.secret = secret; + this.cs = context.negotiatedCipherSuite; + } + + @Override + public SecretKey deriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + KeySchedule ks = KeySchedule.valueOf(algorithm); + try { + HKDF hkdf = new HKDF(cs.hashAlg.name); + byte[] hkdfInfo = + createHkdfInfo(ks.label, ks.getKeyLength(cs)); + return hkdf.expand(secret, hkdfInfo, + ks.getKeyLength(cs), + ks.getAlgorithm(cs, algorithm)); + } catch (GeneralSecurityException gse) { + throw (SSLHandshakeException)(new SSLHandshakeException( + "Could not generate secret").initCause(gse)); + } + } + + private static byte[] createHkdfInfo( + byte[] label, int length) throws IOException { + byte[] info = new byte[4 + label.length]; + ByteBuffer m = ByteBuffer.wrap(info); + try { + Record.putInt16(m, length); + Record.putBytes8(m, label); + Record.putInt8(m, 0x00); // zero-length context + } catch (IOException ioe) { + // unlikely + throw new RuntimeException("Unexpected exception", ioe); + } + + return info; + } + } + + private enum KeySchedule { + // Note that we use enum name as the key/ name. + TlsKey ("key", false), + TlsIv ("iv", true), + TlsUpdateNplus1 ("traffic upd", false); + + private final byte[] label; + private final boolean isIv; + + private KeySchedule(String label, boolean isIv) { + this.label = ("tls13 " + label).getBytes(); + this.isIv = isIv; + } + + int getKeyLength(CipherSuite cs) { + if (this == KeySchedule.TlsUpdateNplus1) + return cs.hashAlg.hashLength; + return isIv ? cs.bulkCipher.ivSize : cs.bulkCipher.keySize; + } + + String getAlgorithm(CipherSuite cs, String algorithm) { + return isIv ? algorithm : cs.bulkCipher.algorithm; + } + } + + @SuppressWarnings("deprecation") + static final class LegacyTrafficKeyDerivation implements SSLKeyDerivation { + private final HandshakeContext context; + private final SecretKey masterSecret; + private final TlsKeyMaterialSpec keyMaterialSpec; + + LegacyTrafficKeyDerivation( + HandshakeContext context, SecretKey masterSecret) { + this.context = context; + this.masterSecret = masterSecret; + + CipherSuite cipherSuite = context.negotiatedCipherSuite; + ProtocolVersion protocolVersion = context.negotiatedProtocol; + + /* + * For both the read and write sides of the protocol, we use the + * master to generate MAC secrets and cipher keying material. Block + * ciphers need initialization vectors, which we also generate. + * + * First we figure out how much keying material is needed. + */ + int hashSize = cipherSuite.macAlg.size; + boolean is_exportable = cipherSuite.exportable; + SSLCipher cipher = cipherSuite.bulkCipher; + int expandedKeySize = is_exportable ? cipher.expandedKeySize : 0; + + // Which algs/params do we need to use? + String keyMaterialAlg; + HashAlg hashAlg; + + byte majorVersion = protocolVersion.major; + byte minorVersion = protocolVersion.minor; + if (protocolVersion.isDTLS) { + // Use TLS version number for DTLS key calculation + if (protocolVersion.id == ProtocolVersion.DTLS10.id) { + majorVersion = ProtocolVersion.TLS11.major; + minorVersion = ProtocolVersion.TLS11.minor; + + keyMaterialAlg = "SunTlsKeyMaterial"; + hashAlg = H_NONE; + } else { // DTLS 1.2+ + majorVersion = ProtocolVersion.TLS12.major; + minorVersion = ProtocolVersion.TLS12.minor; + + keyMaterialAlg = "SunTls12KeyMaterial"; + hashAlg = cipherSuite.hashAlg; + } + } else { + if (protocolVersion.id >= ProtocolVersion.TLS12.id) { + keyMaterialAlg = "SunTls12KeyMaterial"; + hashAlg = cipherSuite.hashAlg; + } else { + keyMaterialAlg = "SunTlsKeyMaterial"; + hashAlg = H_NONE; + } + } + + // TLS v1.1+ and DTLS use an explicit IV in CBC cipher suites to + // protect against the CBC attacks. AEAD/GCM cipher suites in + // TLS v1.2 or later use a fixed IV as the implicit part of the + // partially implicit nonce technique described in RFC 5116. + int ivSize = cipher.ivSize; + if (cipher.cipherType == CipherType.AEAD_CIPHER) { + ivSize = cipher.fixedIvSize; + } else if ( + cipher.cipherType == CipherType.BLOCK_CIPHER && + protocolVersion.useTLS11PlusSpec()) { + ivSize = 0; + } + + TlsKeyMaterialParameterSpec spec = new TlsKeyMaterialParameterSpec( + masterSecret, (majorVersion & 0xFF), (minorVersion & 0xFF), + context.clientHelloRandom.randomBytes, + context.serverHelloRandom.randomBytes, + cipher.algorithm, cipher.keySize, expandedKeySize, + ivSize, hashSize, + hashAlg.name, hashAlg.hashLength, hashAlg.blockSize); + + try { + KeyGenerator kg = JsseJce.getKeyGenerator(keyMaterialAlg); + kg.init(spec); + + this.keyMaterialSpec = (TlsKeyMaterialSpec)kg.generateKey(); + } catch (GeneralSecurityException e) { + throw new ProviderException(e); + } + } + + SecretKey getTrafficKey(String algorithm) { + switch (algorithm) { + case "clientMacKey": + return keyMaterialSpec.getClientMacKey(); + case "serverMacKey": + return keyMaterialSpec.getServerMacKey(); + case "clientWriteKey": + return keyMaterialSpec.getClientCipherKey(); + case "serverWriteKey": + return keyMaterialSpec.getServerCipherKey(); + case "clientWriteIv": + IvParameterSpec cliIvSpec = keyMaterialSpec.getClientIv(); + return (cliIvSpec == null) ? null : + new SecretKeySpec(cliIvSpec.getIV(), "TlsIv"); + case "serverWriteIv": + IvParameterSpec srvIvSpec = keyMaterialSpec.getServerIv(); + return (srvIvSpec == null) ? null : + new SecretKeySpec(srvIvSpec.getIV(), "TlsIv"); + } + + return null; + } + + @Override + public SecretKey deriveKey(String algorithm, + AlgorithmParameterSpec params) throws IOException { + return getTrafficKey(algorithm); + } + } +} + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLTransport.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLTransport.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SSLTransport.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SSLTransport.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.EOFException; +import java.io.IOException; +import java.nio.ByteBuffer; +import javax.crypto.BadPaddingException; +import javax.net.ssl.SSLHandshakeException; + +/** + * Interface for SSL/(D)TLS transportation. + */ +interface SSLTransport { + + /** + * Returns the host name of the peer. + * + * @return the host name of the peer, or null if nothing is + * available. + */ + String getPeerHost(); + + /** + * Returns the port number of the peer. + * + * @return the port number of the peer, or -1 if nothing is + * available. + */ + int getPeerPort(); + + /** + * Shutdown the transport. + */ + default void shutdown() throws IOException { + // blank + } + + /** + * Return true if delegated tasks used for handshaking operations. + * + * @return true if delegated tasks used for handshaking operations. + */ + boolean useDelegatedTask(); + + /** + * Decodes an array of SSL/(D)TLS network source data into the + * destination application data buffers. + * + * For SSL/TLS connections, if no source data, the network data may be + * received from the underlying underlying SSL/TLS input stream. + * + * @param context the transportation context + * @param srcs an array of {@code ByteBuffers} containing the + * inbound network data + * @param srcsOffset The offset within the {@code srcs} buffer array + * of the first buffer from which bytes are to be + * retrieved; it must be non-negative and no larger + * than {@code srcs.length}. + * @param srcsLength The maximum number of {@code srcs} buffers to be + * accessed; it must be non-negative and no larger than + * {@code srcs.length} - {@code srcsOffset}. + * @param dsts an array of {@code ByteBuffers} to hold inbound + * application data + * @param dstsOffset The offset within the {@code dsts} buffer array + * of the first buffer from which bytes are to be + * placed; it must be non-negative and no larger + * than {@code dsts.length}. + * @param dstsLength The maximum number of {@code dsts} buffers to be + * accessed; it must be non-negative and no larger than + * {@code dsts.length} - {@code dstsOffset}. + * + * @return a {@code Plaintext} describing the result of + * the operation + * @throws IOException if a problem was encountered while receiving or + * decoding networking data + */ + static Plaintext decode(TransportContext context, + ByteBuffer[] srcs, int srcsOffset, int srcsLength, + ByteBuffer[] dsts, int dstsOffset, int dstsLength) throws IOException { + + Plaintext[] plaintexts = null; + try { + plaintexts = + context.inputRecord.decode(srcs, srcsOffset, srcsLength); + } catch (UnsupportedOperationException unsoe) { // SSLv2Hello + // Hack code to deliver SSLv2 error message for SSL/TLS connections. + if (!context.sslContext.isDTLS()) { + context.outputRecord.encodeV2NoCipher(); + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest("may be talking to SSLv2"); + } + } + + context.fatal(Alert.UNEXPECTED_MESSAGE, unsoe); + } catch (BadPaddingException bpe) { + /* + * The basic SSLv3 record protection involves (optional) + * encryption for privacy, and an integrity check ensuring + * data origin authentication. We do them both here, and + * throw a fatal alert if the integrity check fails. + */ + Alert alert = (context.handshakeContext != null) ? + Alert.HANDSHAKE_FAILURE : + Alert.BAD_RECORD_MAC; + context.fatal(alert, bpe); + } catch (SSLHandshakeException she) { + // may be record sequence number overflow + context.fatal(Alert.HANDSHAKE_FAILURE, she); + } catch (EOFException eofe) { + // rethrow EOFException, the call will handle it if neede. + throw eofe; + } catch (IOException ioe) { + context.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + } + + if (plaintexts == null || plaintexts.length == 0) { + // Connection closed or record should be discarded. + return Plaintext.PLAINTEXT_NULL; + } + + Plaintext finalPlaintext = Plaintext.PLAINTEXT_NULL; + for (Plaintext plainText : plaintexts) { + // plainText should never be null for TLS protocols + if (plainText == Plaintext.PLAINTEXT_NULL) { + // Only happens for DTLS protocols. + // + // Received a retransmitted flight, and need to retransmit the + // previous delivered handshake flight messages. + if (context.handshakeContext != null && + context.handshakeContext.sslConfig.enableRetransmissions && + context.sslContext.isDTLS()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,verbose")) { + SSLLogger.finest("retransmited handshake flight"); + } + + context.outputRecord.launchRetransmission(); + } // Otherwise, discard the retransmitted flight. + } else if (plainText != null && + plainText.contentType != ContentType.APPLICATION_DATA.id) { + context.dispatch(plainText); + } + + if (plainText == null) { + plainText = Plaintext.PLAINTEXT_NULL; + } else { + // File the destination buffers. + if (dsts != null && dstsLength > 0 && + plainText.contentType == ContentType.APPLICATION_DATA.id) { + + ByteBuffer fragment = plainText.fragment; + int remains = fragment.remaining(); + + // Should have enough room in the destination buffers. + int limit = dstsOffset + dstsLength; + for (int i = dstsOffset; + ((i < limit) && (remains > 0)); i++) { + + int amount = Math.min(dsts[i].remaining(), remains); + fragment.limit(fragment.position() + amount); + dsts[i].put(fragment); + remains -= amount; + + if (!dsts[i].hasRemaining()) { + dstsOffset++; + } + } + + if (remains > 0) { + context.fatal(Alert.INTERNAL_ERROR, + "no sufficient room in the destination buffers"); + } + } + } + + finalPlaintext = plainText; + } + + return finalPlaintext; + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/StatusRequest.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/StatusRequest.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/StatusRequest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/StatusRequest.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; - -/* - * RFC 6066 defines the TLS extension,"status_request" (type 0x5), - * which allows the client to request that the server perform OCSP - * on the client's behalf. - * - * This class is an interface for multiple types of StatusRequests - * (e.g. OCSPStatusRequest). - */ -interface StatusRequest { - - /** - * Obtain the length of the {@code StatusRequest} object in encoded form - * - * @return the length of the {@code StatusRequest} object in encoded form - */ - int length(); - - /** - * Place the encoded {@code StatusRequest} bytes into the - * {@code HandshakeOutputStream} - * - * @param s the target {@code HandshakeOutputStream} - * - * @throws IOException if any encoding error occurs - */ - void send(HandshakeOutStream s) throws IOException; -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/StatusRequestType.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/StatusRequestType.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/StatusRequestType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/StatusRequestType.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.util.ArrayList; -import java.util.List; - -final class StatusRequestType { - - final int id; - final String name; - static List<StatusRequestType> knownTypes = new ArrayList<>(4); - - private StatusRequestType(int id, String name) { - this.id = id; - this.name = name; - } - - static StatusRequestType get(int id) { - for (StatusRequestType ext : knownTypes) { - if (ext.id == id) { - return ext; - } - } - return new StatusRequestType(id, "type_" + id); - } - - private static StatusRequestType e(int id, String name) { - StatusRequestType ext = new StatusRequestType(id, name); - knownTypes.add(ext); - return ext; - } - - @Override - public String toString() { - return (name == null || name.isEmpty()) ? - String.format("Unknown (0x%04X", id) : name; - } - - // Status request types defined in RFC 6066 and 6961 - static final StatusRequestType OCSP = e(0x01, "ocsp"); - static final StatusRequestType OCSP_MULTI = e(0x02, "ocsp_multi"); -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/StatusResponseManager.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,18 +22,32 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ - package sun.security.ssl; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import java.security.AccessController; -import java.security.cert.X509Certificate; import java.security.cert.Extension; -import java.util.*; -import java.util.concurrent.*; - +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.Callable; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.Executors; +import java.util.concurrent.Future; +import java.util.concurrent.ScheduledThreadPoolExecutor; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; +import sun.security.action.GetBooleanAction; +import sun.security.action.GetIntegerAction; +import sun.security.action.GetPropertyAction; import sun.security.provider.certpath.CertId; import sun.security.provider.certpath.OCSP; import sun.security.provider.certpath.OCSPResponse; @@ -41,15 +55,13 @@ import sun.security.util.Cache; import sun.security.x509.PKIXExtensions; import sun.security.x509.SerialNumber; -import sun.security.action.GetBooleanAction; -import sun.security.action.GetIntegerAction; -import sun.security.action.GetPropertyAction; +import sun.security.ssl.X509Authentication.X509Possession; +import static sun.security.ssl.CertStatusExtension.*; final class StatusResponseManager { private static final int DEFAULT_CORE_THREADS = 8; private static final int DEFAULT_CACHE_SIZE = 256; - private static final int DEFAULT_CACHE_LIFETIME = 3600; // seconds - private static final Debug debug = Debug.getInstance("ssl"); + private static final int DEFAULT_CACHE_LIFETIME = 3600; // seconds private final ScheduledThreadPoolExecutor threadMgr; private final Cache<CertId, ResponseCacheEntry> responseCache; @@ -99,10 +111,12 @@ } }, new ThreadPoolExecutor.DiscardPolicy()); threadMgr.setExecuteExistingDelayedTasksAfterShutdownPolicy(false); - threadMgr.setContinueExistingPeriodicTasksAfterShutdownPolicy(false); + threadMgr.setContinueExistingPeriodicTasksAfterShutdownPolicy( + false); threadMgr.setKeepAliveTime(5000, TimeUnit.MILLISECONDS); threadMgr.allowCoreThreadTimeOut(true); - responseCache = Cache.newSoftMemoryCache(cacheCapacity, cacheLifetime); + responseCache = Cache.newSoftMemoryCache( + cacheCapacity, cacheLifetime); } /** @@ -147,8 +161,8 @@ * Get the ignore extensions setting. * * @return {@code true} if the {@code StatusResponseManager} will not - * pass OCSP Extensions in the TLS {@code status_request[_v2]} extensions, - * {@code false} if extensions will be passed (the default). + * pass OCSP Extensions in the TLS {@code status_request[_v2]} + * extensions, {@code false} if extensions will be passed (the default). */ boolean getIgnoreExtensions() { return ignoreExtensions; @@ -158,7 +172,9 @@ * Clear the status response cache */ void clear() { - debugLog("Clearing response cache"); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine("Clearing response cache"); + } responseCache.clear(); } @@ -172,16 +188,18 @@ } /** - * Obtain the URI use by the {@code StatusResponseManager} during lookups. + * Obtain the URI use by the {@code StatusResponseManager} during + * lookups. + * * This method takes into account not only the AIA extension from a * certificate to be checked, but also any default URI and possible * override settings for the response manager. * * @param cert the subject to get the responder URI from * - * @return a {@code URI} containing the address to the OCSP responder, or - * {@code null} if no AIA extension exists in the certificate and no - * default responder has been configured. + * @return a {@code URI} containing the address to the OCSP responder, + * or {@code null} if no AIA extension exists in the certificate + * and no default responder has been configured. * * @throws NullPointerException if {@code cert} is {@code null}. */ @@ -190,10 +208,16 @@ if (cert.getExtensionValue( PKIXExtensions.OCSPNoCheck_Id.toString()) != null) { - debugLog("OCSP NoCheck extension found. OCSP will be skipped"); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "OCSP NoCheck extension found. OCSP will be skipped"); + } return null; } else if (defaultResponder != null && respOverride) { - debugLog("Responder override: URI is " + defaultResponder); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Responder override: URI is " + defaultResponder); + } return defaultResponder; } else { URI certURI = OCSP.getResponderURI(cert); @@ -205,25 +229,29 @@ * Shutdown the thread pool */ void shutdown() { - debugLog("Shutting down " + threadMgr.getActiveCount() + - " active threads"); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine("Shutting down " + threadMgr.getActiveCount() + + " active threads"); + } threadMgr.shutdown(); } /** * Get a list of responses for a chain of certificates. - * This will find OCSP responses from the cache, or failing that, directly - * contact the OCSP responder. It is assumed that the certificates in - * the provided chain are in their proper order (from end-entity to - * trust anchor). + * + * This will find OCSP responses from the cache, or failing that, + * directly contact the OCSP responder. It is assumed that the + * certificates in the provided chain are in their proper order + * (from end-entity to trust anchor). * * @param type the type of request being made of the * {@code StatusResponseManager} - * @param request the {@code StatusRequest} from the status_request or - * status_request_v2 ClientHello extension. A value of {@code null} - * is interpreted as providing no responder IDs or extensions. - * @param chain an array of 2 or more certificates. Each certificate must - * be issued by the next certificate in the chain. + * @param request the {@code CertStatusRequest} from the + * status_request or status_request_v2 ClientHello extension. + * A value of {@code null} is interpreted as providing no + * responder IDs or extensions. + * @param chain an array of 2 or more certificates. Each certificate + * must be issued by the next certificate in the chain. * @param delay the number of time units to delay before returning * responses. * @param unit the unit of time applied to the {@code delay} parameter @@ -231,17 +259,20 @@ * @return an unmodifiable {@code Map} containing the certificate and * its usually * - * @throws SSLHandshakeException if an unsupported {@code StatusRequest} - * is provided. + * @throws SSLHandshakeException if an unsupported + * {@code CertStatusRequest} is provided. */ - Map<X509Certificate, byte[]> get(StatusRequestType type, - StatusRequest request, X509Certificate[] chain, long delay, + Map<X509Certificate, byte[]> get(CertStatusRequestType type, + CertStatusRequest request, X509Certificate[] chain, long delay, TimeUnit unit) { Map<X509Certificate, byte[]> responseMap = new HashMap<>(); List<OCSPFetchCall> requestList = new ArrayList<>(); - debugLog("Beginning check: Type = " + type + ", Chain length = " + + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Beginning check: Type = " + type + ", Chain length = " + chain.length); + } // It is assumed that the caller has ordered the certs in the chain // in the proper order (each certificate is issued by the next entry @@ -250,7 +281,7 @@ return Collections.emptyMap(); } - if (type == StatusRequestType.OCSP) { + if (type == CertStatusRequestType.OCSP) { try { // For type OCSP, we only check the end-entity certificate OCSPStatusRequest ocspReq = (OCSPStatusRequest)request; @@ -264,22 +295,26 @@ requestList.add(new OCSPFetchCall(sInfo, ocspReq)); } } catch (IOException exc) { - debugLog("Exception during CertId creation: " + exc); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Exception during CertId creation: ", exc); + } } - } else if (type == StatusRequestType.OCSP_MULTI) { + } else if (type == CertStatusRequestType.OCSP_MULTI) { // For type OCSP_MULTI, we check every cert in the chain that - // has a direct issuer at the next index. We won't have an issuer - // certificate for the last certificate in the chain and will - // not be able to create a CertId because of that. + // has a direct issuer at the next index. We won't have an + // issuer certificate for the last certificate in the chain + // and will not be able to create a CertId because of that. OCSPStatusRequest ocspReq = (OCSPStatusRequest)request; int ctr; for (ctr = 0; ctr < chain.length - 1; ctr++) { try { - // The cert at "ctr" is the subject cert, "ctr + 1" is the - // issuer certificate. + // The cert at "ctr" is the subject cert, "ctr + 1" + // is the issuer certificate. CertId cid = new CertId(chain[ctr + 1], - new SerialNumber(chain[ctr].getSerialNumber())); - ResponseCacheEntry cacheEntry = getFromCache(cid, ocspReq); + new SerialNumber(chain[ctr].getSerialNumber())); + ResponseCacheEntry cacheEntry = + getFromCache(cid, ocspReq); if (cacheEntry != null) { responseMap.put(chain[ctr], cacheEntry.ocspBytes); } else { @@ -287,17 +322,22 @@ requestList.add(new OCSPFetchCall(sInfo, ocspReq)); } } catch (IOException exc) { - debugLog("Exception during CertId creation: " + exc); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Exception during CertId creation: ", exc); + } } } } else { - debugLog("Unsupported status request type: " + type); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine("Unsupported status request type: " + type); + } } // If we were able to create one or more Fetches, go and run all // of them in separate threads. For all the threads that completed - // in the allotted time, put those status responses into the returned - // Map. + // in the allotted time, put those status responses into the + // returned Map. if (!requestList.isEmpty()) { try { // Set a bunch of threads to go do the fetching @@ -307,23 +347,31 @@ // Go through the Futures and from any non-cancelled task, // get the bytes and attach them to the responseMap. for (Future<StatusInfo> task : resultList) { - if (task.isDone()) { - if (!task.isCancelled()) { - StatusInfo info = task.get(); - if (info != null && info.responseData != null) { - responseMap.put(info.cert, - info.responseData.ocspBytes); - } else { - debugLog("Completed task had no response data"); - } - } else { - debugLog("Found cancelled task"); + if (!task.isDone()) { + continue; + } + + if (!task.isCancelled()) { + StatusInfo info = task.get(); + if (info != null && info.responseData != null) { + responseMap.put(info.cert, + info.responseData.ocspBytes); + } else if (SSLLogger.isOn && + SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Completed task had no response data"); + } + } else { + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine("Found cancelled task"); } } } } catch (InterruptedException | ExecutionException exc) { // Not sure what else to do here - debugLog("Exception when getting data: " + exc); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine("Exception when getting data: ", exc); + } } } @@ -345,9 +393,13 @@ OCSPStatusRequest ocspRequest) { // Determine if the nonce extension is present in the request. If // so, then do not attempt to retrieve the response from the cache. - for (Extension ext : ocspRequest.getExtensions()) { - if (ext.getId().equals(PKIXExtensions.OCSPNonce_Id.toString())) { - debugLog("Nonce extension found, skipping cache check"); + for (Extension ext : ocspRequest.extensions) { + if (ext.getId().equals( + PKIXExtensions.OCSPNonce_Id.toString())) { + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Nonce extension found, skipping cache check"); + } return null; } } @@ -359,12 +411,18 @@ // and do not return it as a cache hit. if (respEntry != null && respEntry.nextUpdate != null && respEntry.nextUpdate.before(new Date())) { - debugLog("nextUpdate threshold exceeded, purging from cache"); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "nextUpdate threshold exceeded, purging from cache"); + } respEntry = null; } - debugLog("Check cache for SN" + cid.getSerialNumber() + ": " + - (respEntry != null ? "HIT" : "MISS")); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Check cache for SN" + cid.getSerialNumber() + ": " + + (respEntry != null ? "HIT" : "MISS")); + } return respEntry; } @@ -398,20 +456,6 @@ } /** - * Log messages through the SSL Debug facility. - * - * @param message the message to be displayed - */ - static void debugLog(String message) { - if (debug != null && Debug.isOn("respmgr")) { - StringBuilder sb = new StringBuilder(); - sb.append("[").append(Thread.currentThread().getName()); - sb.append("] ").append(message); - System.out.println(sb.toString()); - } - } - - /** * Inner class used to group request and response data. */ class StatusInfo { @@ -426,7 +470,7 @@ * @param subjectCert the certificate to be checked for revocation * @param issuerCert the issuer of the {@code subjectCert} * - * @throws IOException if CertId creation from the certificates fails + * @throws IOException if CertId creation from the certificate fails */ StatusInfo(X509Certificate subjectCert, X509Certificate issuerCert) throws IOException { @@ -471,11 +515,14 @@ @Override public String toString() { StringBuilder sb = new StringBuilder("StatusInfo:"); - sb.append("\n\tCert: ").append(this.cert.getSubjectX500Principal()); + sb.append("\n\tCert: ").append( + this.cert.getSubjectX500Principal()); sb.append("\n\tSerial: ").append(this.cert.getSerialNumber()); sb.append("\n\tResponder: ").append(this.responder); - sb.append("\n\tResponse data: ").append(this.responseData != null ? - (this.responseData.ocspBytes.length + " bytes") : "<NULL>"); + sb.append("\n\tResponse data: ").append( + this.responseData != null ? + (this.responseData.ocspBytes.length + " bytes") : + "<NULL>"); return sb.toString(); } } @@ -483,7 +530,7 @@ /** * Static nested class used as the data kept in the response cache. */ - static class ResponseCacheEntry { + class ResponseCacheEntry { final OCSPResponse.ResponseStatus status; final byte[] ocspBytes; final Date nextUpdate; @@ -495,8 +542,8 @@ * * @param responseBytes the DER encoding for the OCSP response * - * @throws IOException if an {@code OCSPResponse} cannot be created from - * the encoded bytes. + * @throws IOException if an {@code OCSPResponse} cannot be + * created from the encoded bytes. */ ResponseCacheEntry(byte[] responseBytes, CertId cid) throws IOException { @@ -515,8 +562,9 @@ // Date is cloned. nextUpdate = singleResp.getNextUpdate(); } else { - throw new IOException("Unable to find SingleResponse for " + - "SN " + cid.getSerialNumber()); + throw new IOException( + "Unable to find SingleResponse for SN " + + cid.getSerialNumber()); } } else { nextUpdate = null; @@ -537,7 +585,8 @@ /** * A constructor that builds the OCSPFetchCall from the provided - * StatusInfo and information from the status_request[_v2] extension. + * StatusInfo and information from the status_request[_v2] + * extension. * * @param info the {@code StatusInfo} containing the subject * certificate, CertId, and other supplemental info. @@ -549,37 +598,54 @@ "Null StatusInfo not allowed"); ocspRequest = Objects.requireNonNull(request, "Null OCSPStatusRequest not allowed"); - extensions = ocspRequest.getExtensions(); - responderIds = ocspRequest.getResponderIds(); + extensions = ocspRequest.extensions; + responderIds = ocspRequest.responderIds; } /** * Get an OCSP response, either from the cache or from a responder. * - * @return The StatusInfo object passed into the {@code OCSPFetchCall} - * constructor, with the {@code responseData} field filled in with the - * response or {@code null} if no response can be obtained. + * @return The StatusInfo object passed into the + * {@code OCSPFetchCall} constructor, with the + * {@code responseData} field filled in with the response + * or {@code null} if no response can be obtained. */ @Override public StatusInfo call() { - debugLog("Starting fetch for SN " + statInfo.cid.getSerialNumber()); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Starting fetch for SN " + + statInfo.cid.getSerialNumber()); + } try { ResponseCacheEntry cacheEntry; List<Extension> extsToSend; if (statInfo.responder == null) { - // If we have no URI then there's nothing to do but return - debugLog("Null URI detected, OCSP fetch aborted."); + // If we have no URI then there's nothing to do + // but return. + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Null URI detected, OCSP fetch aborted"); + } return statInfo; } else { - debugLog("Attempting fetch from " + statInfo.responder); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Attempting fetch from " + statInfo.responder); + } } // If the StatusResponseManager has been configured to not - // forward extensions, then set extensions to an empty list. - // We will forward the extensions unless one of two conditions - // occur: (1) The jdk.tls.stapling.ignoreExtensions property is - // true or (2) There is a non-empty ResponderId list. + // forward extensions, then set extensions to an empty + // list. + // + // We will forward the extensions unless one of two + // conditions occur: + // (1) The jdk.tls.stapling.ignoreExtensions property is + // true, or + // (2) There is a non-empty ResponderId list. + // // ResponderId selection is a feature that will be // supported in the future. extsToSend = (ignoreExtensions || !responderIds.isEmpty()) ? @@ -595,8 +661,10 @@ statInfo.cid); // Get the response status and act on it appropriately - debugLog("OCSP Status: " + cacheEntry.status + + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine("OCSP Status: " + cacheEntry.status + " (" + respBytes.length + " bytes)"); + } if (cacheEntry.status == OCSPResponse.ResponseStatus.SUCCESSFUL) { // Set the response in the returned StatusInfo @@ -606,10 +674,15 @@ addToCache(statInfo.cid, cacheEntry); } } else { - debugLog("No data returned from OCSP Responder"); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "No data returned from OCSP Responder"); + } } } catch (IOException ioe) { - debugLog("Caught exception: " + ioe); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine("Caught exception: ", ioe); + } } return statInfo; @@ -626,22 +699,28 @@ // If no cache lifetime has been set on entries then // don't cache this response if there is no nextUpdate field if (entry.nextUpdate == null && cacheLifetime == 0) { - debugLog("Not caching this OCSP response"); + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine("Not caching this OCSP response"); + } } else { responseCache.put(certId, entry); - debugLog("Added response for SN " + certId.getSerialNumber() + + if (SSLLogger.isOn && SSLLogger.isOn("respmgr")) { + SSLLogger.fine( + "Added response for SN " + + certId.getSerialNumber() + " to cache"); + } } } /** * Determine the delay to use when scheduling the task that will * update the OCSP response. This is the shorter time between the - * cache lifetime and the nextUpdate. If no nextUpdate is present in - * the response, then only the cache lifetime is used. + * cache lifetime and the nextUpdate. If no nextUpdate is present + * in the response, then only the cache lifetime is used. * If cache timeouts are disabled (a zero value) and there's no - * nextUpdate, then the entry is not cached and no rescheduling will - * take place. + * nextUpdate, then the entry is not cached and no rescheduling + * will take place. * * @param nextUpdate a {@code Date} object corresponding to the * next update time from a SingleResponse. @@ -667,4 +746,218 @@ return delaySec; } } + + static final StaplingParameters processStapling( + ServerHandshakeContext shc) { + StaplingParameters params = null; + SSLExtension ext = null; + CertStatusRequestType type = null; + CertStatusRequest req = null; + Map<X509Certificate, byte[]> responses; + + // If this feature has not been enabled, then no more processing + // is necessary. Also we will only staple if we're doing a full + // handshake. + if (!shc.sslContext.isStaplingEnabled(false) || shc.isResumption) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("Staping disabled or is a resumed session"); + } + return null; + } + + // Check if the client has asserted the status_request[_v2] extension(s) + Map<SSLExtension, SSLExtension.SSLExtensionSpec> exts = + shc.handshakeExtensions; + CertStatusRequestSpec statReq = (CertStatusRequestSpec)exts.get( + SSLExtension.CH_STATUS_REQUEST); + CertStatusRequestV2Spec statReqV2 = (CertStatusRequestV2Spec) + exts.get(SSLExtension.CH_STATUS_REQUEST_V2); + + // Determine which type of stapling we are doing and assert the + // proper extension in the server hello. + // Favor status_request_v2 over status_request and ocsp_multi + // over ocsp. + // If multiple ocsp or ocsp_multi types exist, select the first + // instance of a given type. Also since we don't support ResponderId + // selection yet, only accept a request if the ResponderId field + // is empty. Finally, we'll only do this in (D)TLS 1.2 or earlier. + if (statReqV2 != null && !shc.negotiatedProtocol.useTLS13PlusSpec()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.fine("SH Processing status_request_v2 extension"); + } + // RFC 6961 stapling + ext = SSLExtension.CH_STATUS_REQUEST_V2; + int ocspIdx = -1; + int ocspMultiIdx = -1; + CertStatusRequest[] reqItems = statReqV2.certStatusRequests; + for (int pos = 0; (pos < reqItems.length && + (ocspIdx == -1 || ocspMultiIdx == -1)); pos++) { + CertStatusRequest item = reqItems[pos]; + CertStatusRequestType curType = + CertStatusRequestType.valueOf(item.statusType); + if (ocspIdx < 0 && curType == CertStatusRequestType.OCSP) { + OCSPStatusRequest ocspReq = (OCSPStatusRequest)item; + // We currently only accept empty responder ID lists + // but may support them in the future + if (ocspReq.responderIds.isEmpty()) { + ocspIdx = pos; + } + } else if (ocspMultiIdx < 0 && + curType == CertStatusRequestType.OCSP_MULTI) { + OCSPStatusRequest ocspReq = (OCSPStatusRequest)item; + // We currently only accept empty responder ID lists + // but may support them in the future + if (ocspReq.responderIds.isEmpty()) { + ocspMultiIdx = pos; + } + } + } + if (ocspMultiIdx >= 0) { + req = reqItems[ocspMultiIdx]; + type = CertStatusRequestType.valueOf(req.statusType); + } else if (ocspIdx >= 0) { + req = reqItems[ocspIdx]; + type = CertStatusRequestType.valueOf(req.statusType); + } else { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest("Warning: No suitable request " + + "found in the status_request_v2 extension."); + } + } + } + + // Only attempt to process a status_request extension if: + // * The status_request extension is set AND + // * either the status_request_v2 extension is not present OR + // * none of the underlying OCSPStatusRequest structures is + // suitable for stapling. + // If either of the latter two bullet items is true the ext, + // type and req variables should all be null. If any are null + // we will try processing an asserted status_request. + if ((statReq != null) && + (ext == null || type == null || req == null)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake,verbose")) { + SSLLogger.fine("SH Processing status_request extension"); + } + ext = SSLExtension.CH_STATUS_REQUEST; + type = CertStatusRequestType.valueOf( + statReq.statusRequest.statusType); + if (type == CertStatusRequestType.OCSP) { + // If the type is OCSP, then the request is guaranteed + // to be OCSPStatusRequest + OCSPStatusRequest ocspReq = + (OCSPStatusRequest)statReq.statusRequest; + if (ocspReq.responderIds.isEmpty()) { + req = ocspReq; + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest("Warning: No suitable request " + + "found in the status_request extension."); + } + } + } + } + + // If, after walking through the extensions we were unable to + // find a suitable StatusRequest, then stapling is disabled. + // The ext, type and req variables must have been set to continue. + if (type == null || req == null || ext == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine("No suitable status_request or " + + "status_request_v2, stapling is disabled"); + } + return null; + } + + // Get the cert chain since we'll need it for OCSP checking + X509Possession x509Possession = null; + for (SSLPossession possession : shc.handshakePossessions) { + if (possession instanceof X509Possession) { + x509Possession = (X509Possession)possession; + break; + } + } + + if (x509Possession == null) { // unlikely + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest("Warning: no X.509 certificates found. " + + "Stapling is disabled."); + } + return null; + } + + // Get the OCSP responses from the StatusResponseManager + X509Certificate[] certs = x509Possession.popCerts; + StatusResponseManager statRespMgr = + shc.sslContext.getStatusResponseManager(); + if (statRespMgr != null) { + // For the purposes of the fetch from the SRM, override the + // type when it is TLS 1.3 so it always gets responses for + // all certs it can. This should not change the type field + // in the StaplingParameters though. + CertStatusRequestType fetchType = + shc.negotiatedProtocol.useTLS13PlusSpec() ? + CertStatusRequestType.OCSP_MULTI : type; + responses = statRespMgr.get(fetchType, req, certs, + shc.statusRespTimeout, TimeUnit.MILLISECONDS); + if (!responses.isEmpty()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest("Response manager returned " + + responses.size() + " entries."); + } + // If this RFC 6066-style stapling (SSL cert only) then the + // response cannot be zero length + if (type == CertStatusRequestType.OCSP) { + byte[] respDER = responses.get(certs[0]); + if (respDER == null || respDER.length <= 0) { + if (SSLLogger.isOn && + SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest("Warning: Null or zero-length " + + "response found for leaf certificate. " + + "Stapling is disabled."); + } + return null; + } + } + params = new StaplingParameters(ext, type, req, responses); + } else { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest("Warning: no OCSP responses obtained. " + + "Stapling is disabled."); + } + } + } else { + // This should not happen, but if lazy initialization of the + // StatusResponseManager doesn't occur we should turn off stapling. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.finest("Warning: lazy initialization " + + "of the StatusResponseManager failed. " + + "Stapling is disabled."); + } + params = null; + } + + return params; + } + + /** + * Inner class used to hold stapling parameters needed by the handshaker + * when stapling is active. + */ + static final class StaplingParameters { + final SSLExtension statusRespExt; + final CertStatusRequestType statReqType; + final CertStatusRequest statReqData; + final Map<X509Certificate, byte[]> responseMap; + + StaplingParameters(SSLExtension ext, CertStatusRequestType type, + CertStatusRequest req, Map<X509Certificate, byte[]> responses) { + statusRespExt = ext; + statReqType = type; + statReqData = req; + responseMap = responses; + } + } } + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SunJSSE.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SunJSSE.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SunJSSE.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SunJSSE.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,6 @@ * questions. */ - package sun.security.ssl; import java.security.*; @@ -62,7 +61,7 @@ private static String info = "Sun JSSE provider" + "(PKCS12, SunX509/PKIX key/trust factories, " + - "SSLv3/TLSv1/TLSv1.1/TLSv1.2/DTLSv1.0/DTLSv1.2)"; + "SSLv3/TLSv1/TLSv1.1/TLSv1.2/TLSv1.3/DTLSv1.0/DTLSv1.2)"; private static String fipsInfo = "Sun JSSE provider (FIPS mode, crypto provider "; @@ -149,7 +148,7 @@ } private void registerAlgorithms(final boolean isfips) { - AccessController.doPrivileged(new PrivilegedAction<>() { + AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { doRegister(isfips); @@ -214,6 +213,8 @@ "sun.security.ssl.SSLContextImpl$TLS11Context"); put("SSLContext.TLSv1.2", "sun.security.ssl.SSLContextImpl$TLS12Context"); + put("SSLContext.TLSv1.3", + "sun.security.ssl.SSLContextImpl$TLS13Context"); put("SSLContext.TLS", "sun.security.ssl.SSLContextImpl$TLSContext"); if (isfips == false) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SunX509KeyManagerImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,13 +25,27 @@ package sun.security.ssl; -import javax.net.ssl.*; -import java.security.*; -import java.security.cert.*; -import java.security.cert.Certificate; -import java.util.*; import java.net.Socket; - +import java.security.Key; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.Principal; +import java.security.PrivateKey; +import java.security.UnrecoverableKeyException; +import java.security.cert.Certificate; +import java.security.cert.X509Certificate; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Set; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.X509ExtendedKeyManager; import javax.security.auth.x500.X500Principal; @@ -67,8 +81,6 @@ */ final class SunX509KeyManagerImpl extends X509ExtendedKeyManager { - private static final Debug debug = Debug.getInstance("ssl"); - private static final String[] STRING0 = new String[0]; /* @@ -148,14 +160,8 @@ X509Credentials cred = new X509Credentials((PrivateKey)key, (X509Certificate[])certs); credentialsMap.put(alias, cred); - if (debug != null && Debug.isOn("keymanager")) { - System.out.println("***"); - System.out.println("found key for : " + alias); - for (int i = 0; i < certs.length; i++) { - System.out.println("chain [" + i + "] = " - + certs[i]); - } - System.out.println("***"); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("found key for : " + alias, (Object[])certs); } } } @@ -382,8 +388,8 @@ if (issuers.length == 0) { // no issuer specified, match all aliases.add(alias); - if (debug != null && Debug.isOn("keymanager")) { - System.out.println("matching alias: " + alias); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("matching alias: " + alias); } } else { Set<X500Principal> certIssuers = @@ -391,8 +397,8 @@ for (int i = 0; i < x500Issuers.length; i++) { if (certIssuers.contains(issuers[i])) { aliases.add(alias); - if (debug != null && Debug.isOn("keymanager")) { - System.out.println("matching alias: " + alias); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("matching alias: " + alias); } break; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SupportedGroupsExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,466 +26,1012 @@ package sun.security.ssl; import java.io.IOException; -import java.security.spec.ECGenParameterSpec; -import java.security.spec.InvalidParameterSpecException; -import java.security.AlgorithmParameters; +import java.nio.ByteBuffer; +import java.security.AccessController; import java.security.AlgorithmConstraints; +import java.security.AlgorithmParameters; import java.security.CryptoPrimitive; -import java.security.AccessController; +import java.security.NoSuchAlgorithmException; import java.security.spec.AlgorithmParameterSpec; -import javax.crypto.spec.DHParameterSpec; +import java.security.spec.ECGenParameterSpec; +import java.security.spec.ECParameterSpec; +import java.security.spec.InvalidParameterSpecException; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; import java.util.EnumSet; import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; import java.util.Map; -import java.util.ArrayList; +import javax.crypto.spec.DHParameterSpec; import javax.net.ssl.SSLProtocolException; - import sun.security.action.GetPropertyAction; +import static sun.security.ssl.SSLExtension.CH_SUPPORTED_GROUPS; +import static sun.security.ssl.SSLExtension.EE_SUPPORTED_GROUPS; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; -// -// Note: Since RFC 7919, the extension's semantics are expanded from -// "Supported Elliptic Curves" to "Supported Groups". The enum datatype -// used in the extension has been renamed from NamedCurve to NamedGroup. -// Its semantics are likewise expanded from "named curve" to "named group". -// -final class SupportedGroupsExtension extends HelloExtension { - - /* Class and subclass dynamic debugging support */ - private static final Debug debug = Debug.getInstance("ssl"); - - private static final int ARBITRARY_PRIME = 0xff01; - private static final int ARBITRARY_CHAR2 = 0xff02; - - // cache to speed up the parameters construction - private static final Map<NamedGroup, - AlgorithmParameters> namedGroupParams = new HashMap<>(); - - // the supported named groups - private static final NamedGroup[] supportedNamedGroups; - - // the named group presented in the extension - private final int[] requestedNamedGroupIds; +/** + * Pack of the "supported_groups" extensions [RFC 4492/7919]. + */ +final class SupportedGroupsExtension { + static final HandshakeProducer chNetworkProducer = + new CHSupportedGroupsProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHSupportedGroupsConsumer(); + static final SSLStringizer sgsStringizer = + new SupportedGroupsStringizer(); + + static final HandshakeProducer eeNetworkProducer = + new EESupportedGroupsProducer(); + static final ExtensionConsumer eeOnLoadConsumer = + new EESupportedGroupsConsumer(); + + /** + * The "supported_groups" extension. + */ + static final class SupportedGroupsSpec implements SSLExtensionSpec { + final int[] namedGroupsIds; - static { - boolean requireFips = SunJSSE.isFIPS(); + private SupportedGroupsSpec(int[] namedGroupsIds) { + this.namedGroupsIds = namedGroupsIds; + } - // The value of the System Property defines a list of enabled named - // groups in preference order, separated with comma. For example: - // - // jdk.tls.namedGroups="secp521r1, secp256r1, ffdhe2048" - // - // If the System Property is not defined or the value is empty, the - // default groups and preferences will be used. - String property = AccessController.doPrivileged( - new GetPropertyAction("jdk.tls.namedGroups")); - if (property != null && property.length() != 0) { - // remove double quote marks from beginning/end of the property - if (property.length() > 1 && property.charAt(0) == '"' && - property.charAt(property.length() - 1) == '"') { - property = property.substring(1, property.length() - 1); + private SupportedGroupsSpec(List<NamedGroup> namedGroups) { + this.namedGroupsIds = new int[namedGroups.size()]; + int i = 0; + for (NamedGroup ng : namedGroups) { + namedGroupsIds[i++] = ng.id; } } - ArrayList<NamedGroup> groupList; - if (property != null && property.length() != 0) { // customized groups - String[] groups = property.split(","); - groupList = new ArrayList<>(groups.length); - for (String group : groups) { - group = group.trim(); - if (!group.isEmpty()) { - NamedGroup namedGroup = NamedGroup.nameOf(group); - if (namedGroup != null && - (!requireFips || namedGroup.isFips)) { - if (isAvailableGroup(namedGroup)) { - groupList.add(namedGroup); - } - } // ignore unknown groups - } + private SupportedGroupsSpec(ByteBuffer m) throws IOException { + if (m.remaining() < 2) { // 2: the length of the list + throw new SSLProtocolException( + "Invalid supported_groups extension: insufficient data"); + } + + byte[] ngs = Record.getBytes16(m); + if (m.hasRemaining()) { + throw new SSLProtocolException( + "Invalid supported_groups extension: unknown extra data"); + } + + if ((ngs == null) || (ngs.length == 0) || (ngs.length % 2 != 0)) { + throw new SSLProtocolException( + "Invalid supported_groups extension: incomplete data"); } - if (groupList.isEmpty() && JsseJce.isEcAvailable()) { - throw new IllegalArgumentException( - "System property jdk.tls.namedGroups(" + property + ") " + - "contains no supported elliptic curves"); - } - } else { // default groups - NamedGroup[] groups; - if (requireFips) { - groups = new NamedGroup[] { - // only NIST curves in FIPS mode - NamedGroup.SECP256_R1, - NamedGroup.SECP384_R1, - NamedGroup.SECP521_R1, - NamedGroup.SECT283_K1, - NamedGroup.SECT283_R1, - NamedGroup.SECT409_K1, - NamedGroup.SECT409_R1, - NamedGroup.SECT571_K1, - NamedGroup.SECT571_R1, - - // FFDHE 2048 - NamedGroup.FFDHE_2048, - NamedGroup.FFDHE_3072, - NamedGroup.FFDHE_4096, - NamedGroup.FFDHE_6144, - NamedGroup.FFDHE_8192, - }; + int[] ids = new int[ngs.length / 2]; + for (int i = 0, j = 0; i < ngs.length;) { + ids[j++] = ((ngs[i++] & 0xFF) << 8) | (ngs[i++] & 0xFF); + } + + this.namedGroupsIds = ids; + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"versions\": '['{0}']'", Locale.ENGLISH); + + if (namedGroupsIds == null || namedGroupsIds.length == 0) { + Object[] messageFields = { + "<no supported named group specified>" + }; + return messageFormat.format(messageFields); } else { - groups = new NamedGroup[] { - // NIST curves first - NamedGroup.SECP256_R1, - NamedGroup.SECP384_R1, - NamedGroup.SECP521_R1, - NamedGroup.SECT283_K1, - NamedGroup.SECT283_R1, - NamedGroup.SECT409_K1, - NamedGroup.SECT409_R1, - NamedGroup.SECT571_K1, - NamedGroup.SECT571_R1, - - // non-NIST curves - NamedGroup.SECP256_K1, - - // FFDHE 2048 - NamedGroup.FFDHE_2048, - NamedGroup.FFDHE_3072, - NamedGroup.FFDHE_4096, - NamedGroup.FFDHE_6144, - NamedGroup.FFDHE_8192, - }; - } - - groupList = new ArrayList<>(groups.length); - for (NamedGroup group : groups) { - if (isAvailableGroup(group)) { - groupList.add(group); + StringBuilder builder = new StringBuilder(512); + boolean isFirst = true; + for (int ngid : namedGroupsIds) { + if (isFirst) { + isFirst = false; + } else { + builder.append(", "); + } + + builder.append(NamedGroup.nameOf(ngid)); } + + Object[] messageFields = { + builder.toString() + }; + + return messageFormat.format(messageFields); } } + } - if (debug != null && groupList.isEmpty()) { - Debug.log( - "Initialized [jdk.tls.namedGroups|default] list contains " + - "no available elliptic curves. " + - (property != null ? "(" + property + ")" : "[Default]")); - } - - supportedNamedGroups = new NamedGroup[groupList.size()]; - int i = 0; - for (NamedGroup namedGroup : groupList) { - supportedNamedGroups[i++] = namedGroup; + private static final + class SupportedGroupsStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new SupportedGroupsSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } } } - // check whether the group is supported by the underlying providers - private static boolean isAvailableGroup(NamedGroup namedGroup) { - AlgorithmParameters params = null; - AlgorithmParameterSpec spec = null; - if ("EC".equals(namedGroup.algorithm)) { - if (namedGroup.oid != null) { - try { - params = JsseJce.getAlgorithmParameters("EC"); - spec = new ECGenParameterSpec(namedGroup.oid); - } catch (Exception e) { - return false; + static enum NamedGroupType { + NAMED_GROUP_ECDHE, // Elliptic Curve Groups (ECDHE) + NAMED_GROUP_FFDHE, // Finite Field Groups (DHE) + NAMED_GROUP_XDH, // Finite Field Groups (XDH) + NAMED_GROUP_ARBITRARY, // arbitrary prime and curves (ECDHE) + NAMED_GROUP_NONE; // Not predefined named group + + boolean isSupported(List<CipherSuite> cipherSuites) { + for (CipherSuite cs : cipherSuites) { + if (cs.keyExchange == null || cs.keyExchange.groupType == this) { + return true; } } - } else if ("DiffieHellman".equals(namedGroup.algorithm)) { - try { - params = JsseJce.getAlgorithmParameters("DiffieHellman"); - spec = getFFDHEDHParameterSpec(namedGroup); - } catch (Exception e) { - return false; - } + + return false; } + } - if ((params != null) && (spec != null)) { - try { - params.init(spec); - } catch (Exception e) { - return false; - } + static enum NamedGroup { + // Elliptic Curves (RFC 4492) + // + // See sun.security.util.CurveDB for the OIDs + // NIST K-163 + SECT163_K1 (0x0001, "sect163k1", "1.3.132.0.1", true, + ProtocolVersion.PROTOCOLS_TO_12), + SECT163_R1 (0x0002, "sect163r1", "1.3.132.0.2", false, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST B-163 + SECT163_R2 (0x0003, "sect163r2", "1.3.132.0.15", true, + ProtocolVersion.PROTOCOLS_TO_12), + SECT193_R1 (0x0004, "sect193r1", "1.3.132.0.24", false, + ProtocolVersion.PROTOCOLS_TO_12), + SECT193_R2 (0x0005, "sect193r2", "1.3.132.0.25", false, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST K-233 + SECT233_K1 (0x0006, "sect233k1", "1.3.132.0.26", true, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST B-233 + SECT233_R1 (0x0007, "sect233r1", "1.3.132.0.27", true, + ProtocolVersion.PROTOCOLS_TO_12), + SECT239_K1 (0x0008, "sect239k1", "1.3.132.0.3", false, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST K-283 + SECT283_K1 (0x0009, "sect283k1", "1.3.132.0.16", true, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST B-283 + SECT283_R1 (0x000A, "sect283r1", "1.3.132.0.17", true, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST K-409 + SECT409_K1 (0x000B, "sect409k1", "1.3.132.0.36", true, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST B-409 + SECT409_R1 (0x000C, "sect409r1", "1.3.132.0.37", true, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST K-571 + SECT571_K1 (0x000D, "sect571k1", "1.3.132.0.38", true, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST B-571 + SECT571_R1 (0x000E, "sect571r1", "1.3.132.0.39", true, + ProtocolVersion.PROTOCOLS_TO_12), + SECP160_K1 (0x000F, "secp160k1", "1.3.132.0.9", false, + ProtocolVersion.PROTOCOLS_TO_12), + SECP160_R1 (0x0010, "secp160r1", "1.3.132.0.8", false, + ProtocolVersion.PROTOCOLS_TO_12), + SECP160_R2 (0x0011, "secp160r2", "1.3.132.0.30", false, + ProtocolVersion.PROTOCOLS_TO_12), + SECP192_K1 (0x0012, "secp192k1", "1.3.132.0.31", false, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST P-192 + SECP192_R1 (0x0013, "secp192r1", "1.2.840.10045.3.1.1", true, + ProtocolVersion.PROTOCOLS_TO_12), + SECP224_K1 (0x0014, "secp224k1", "1.3.132.0.32", false, + ProtocolVersion.PROTOCOLS_TO_12), + // NIST P-224 + SECP224_R1 (0x0015, "secp224r1", "1.3.132.0.33", true, + ProtocolVersion.PROTOCOLS_TO_12), + SECP256_K1 (0x0016, "secp256k1", "1.3.132.0.10", false, + ProtocolVersion.PROTOCOLS_TO_12), + + // NIST P-256 + SECP256_R1 (0x0017, "secp256r1", "1.2.840.10045.3.1.7", true, + ProtocolVersion.PROTOCOLS_TO_13), + + // NIST P-384 + SECP384_R1 (0x0018, "secp384r1", "1.3.132.0.34", true, + ProtocolVersion.PROTOCOLS_TO_13), + + // NIST P-521 + SECP521_R1 (0x0019, "secp521r1", "1.3.132.0.35", true, + ProtocolVersion.PROTOCOLS_TO_13), + + // x25519 and x448 + X25519 (0x001D, "x25519", true, "x25519", + ProtocolVersion.PROTOCOLS_TO_13), + X448 (0x001E, "x448", true, "x448", + ProtocolVersion.PROTOCOLS_TO_13), + + // Finite Field Diffie-Hellman Ephemeral Parameters (RFC 7919) + FFDHE_2048 (0x0100, "ffdhe2048", true, + ProtocolVersion.PROTOCOLS_TO_13), + FFDHE_3072 (0x0101, "ffdhe3072", true, + ProtocolVersion.PROTOCOLS_TO_13), + FFDHE_4096 (0x0102, "ffdhe4096", true, + ProtocolVersion.PROTOCOLS_TO_13), + FFDHE_6144 (0x0103, "ffdhe6144", true, + ProtocolVersion.PROTOCOLS_TO_13), + FFDHE_8192 (0x0104, "ffdhe8192", true, + ProtocolVersion.PROTOCOLS_TO_13), - // cache the parameters - namedGroupParams.put(namedGroup, params); + // Elliptic Curves (RFC 4492) + // + // arbitrary prime and characteristic-2 curves + ARBITRARY_PRIME (0xFF01, "arbitrary_explicit_prime_curves", + ProtocolVersion.PROTOCOLS_TO_12), + ARBITRARY_CHAR2 (0xFF02, "arbitrary_explicit_char2_curves", + ProtocolVersion.PROTOCOLS_TO_12); + + final int id; // hash + signature + final NamedGroupType type; // group type + final String name; // literal name + final String oid; // object identifier of the named group + final String algorithm; // signature algorithm + final boolean isFips; // can be used in FIPS mode? + final ProtocolVersion[] supportedProtocols; + + // Constructor used for Elliptic Curve Groups (ECDHE) + private NamedGroup(int id, String name, String oid, boolean isFips, + ProtocolVersion[] supportedProtocols) { + this.id = id; + this.type = NamedGroupType.NAMED_GROUP_ECDHE; + this.name = name; + this.oid = oid; + this.algorithm = "EC"; + this.isFips = isFips; + this.supportedProtocols = supportedProtocols; + } + + // Constructor used for Elliptic Curve Groups (XDH) + private NamedGroup(int id, String name, + boolean isFips, String algorithm, + ProtocolVersion[] supportedProtocols) { + this.id = id; + this.type = NamedGroupType.NAMED_GROUP_XDH; + this.name = name; + this.oid = null; + this.algorithm = algorithm; + this.isFips = isFips; + this.supportedProtocols = supportedProtocols; + } + + // Constructor used for Finite Field Diffie-Hellman Groups (FFDHE) + private NamedGroup(int id, String name, boolean isFips, + ProtocolVersion[] supportedProtocols) { + this.id = id; + this.type = NamedGroupType.NAMED_GROUP_FFDHE; + this.name = name; + this.oid = null; + this.algorithm = "DiffieHellman"; + this.isFips = isFips; + this.supportedProtocols = supportedProtocols; + } + + // Constructor used for arbitrary prime and curves (ECDHE) + private NamedGroup(int id, String name, + ProtocolVersion[] supportedProtocols) { + this.id = id; + this.type = NamedGroupType.NAMED_GROUP_ARBITRARY; + this.name = name; + this.oid = null; + this.algorithm = "EC"; + this.isFips = false; + this.supportedProtocols = supportedProtocols; + } + + static NamedGroup valueOf(int id) { + for (NamedGroup group : NamedGroup.values()) { + if (group.id == id) { + return group; + } + } - return true; + return null; } - return false; - } + static NamedGroup valueOf(ECParameterSpec params) { + String oid = JsseJce.getNamedCurveOid(params); + if ((oid != null) && (!oid.isEmpty())) { + for (NamedGroup group : NamedGroup.values()) { + if ((group.type == NamedGroupType.NAMED_GROUP_ECDHE) && + oid.equals(group.oid)) { + return group; + } + } + } - private static DHParameterSpec getFFDHEDHParameterSpec( - NamedGroup namedGroup) { - DHParameterSpec spec = null; - switch (namedGroup) { - case FFDHE_2048: - spec = PredefinedDHParameterSpecs.ffdheParams.get(2048); - break; - case FFDHE_3072: - spec = PredefinedDHParameterSpecs.ffdheParams.get(3072); - break; - case FFDHE_4096: - spec = PredefinedDHParameterSpecs.ffdheParams.get(4096); - break; - case FFDHE_6144: - spec = PredefinedDHParameterSpecs.ffdheParams.get(6144); - break; - case FFDHE_8192: - spec = PredefinedDHParameterSpecs.ffdheParams.get(8192); + return null; } - return spec; - } + static NamedGroup valueOf(DHParameterSpec params) { + for (Map.Entry<NamedGroup, AlgorithmParameters> me : + SupportedGroups.namedGroupParams.entrySet()) { + NamedGroup ng = me.getKey(); + if (ng.type != NamedGroupType.NAMED_GROUP_FFDHE) { + continue; + } - private static DHParameterSpec getPredefinedDHParameterSpec( - NamedGroup namedGroup) { - DHParameterSpec spec = null; - switch (namedGroup) { - case FFDHE_2048: - spec = PredefinedDHParameterSpecs.definedParams.get(2048); - break; - case FFDHE_3072: - spec = PredefinedDHParameterSpecs.definedParams.get(3072); - break; - case FFDHE_4096: - spec = PredefinedDHParameterSpecs.definedParams.get(4096); - break; - case FFDHE_6144: - spec = PredefinedDHParameterSpecs.definedParams.get(6144); - break; - case FFDHE_8192: - spec = PredefinedDHParameterSpecs.definedParams.get(8192); - } + DHParameterSpec ngParams = null; + AlgorithmParameters aps = me.getValue(); + try { + ngParams = aps.getParameterSpec(DHParameterSpec.class); + } catch (InvalidParameterSpecException ipse) { + // should be unlikely + } - return spec; - } + if (ngParams == null) { + continue; + } - private SupportedGroupsExtension(int[] requestedNamedGroupIds) { - super(ExtensionType.EXT_SUPPORTED_GROUPS); + if (ngParams.getP().equals(params.getP()) && + ngParams.getG().equals(params.getG())) { + return ng; + } + } - this.requestedNamedGroupIds = requestedNamedGroupIds; - } + return null; + } - SupportedGroupsExtension(HandshakeInStream s, int len) throws IOException { - super(ExtensionType.EXT_SUPPORTED_GROUPS); + static NamedGroup nameOf(String name) { + for (NamedGroup group : NamedGroup.values()) { + if (group.name.equals(name)) { + return group; + } + } - int k = s.getInt16(); - if (((len & 1) != 0) || (k == 0) || (k + 2 != len)) { - throw new SSLProtocolException("Invalid " + type + " extension"); + return null; } - // Note: unknown named group will be ignored later. - requestedNamedGroupIds = new int[k >> 1]; - for (int i = 0; i < requestedNamedGroupIds.length; i++) { - requestedNamedGroupIds[i] = s.getInt16(); + static String nameOf(int id) { + for (NamedGroup group : NamedGroup.values()) { + if (group.id == id) { + return group.name; + } + } + + return "UNDEFINED-NAMED-GROUP(" + id + ")"; } - } - // Get a local preferred supported ECDHE group permitted by the constraints. - static NamedGroup getPreferredECGroup(AlgorithmConstraints constraints) { - for (NamedGroup namedGroup : supportedNamedGroups) { - if ((namedGroup.type == NamedGroupType.NAMED_GROUP_ECDHE) && - constraints.permits(EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), - namedGroup.algorithm, namedGroupParams.get(namedGroup))) { + boolean isAvailable(List<ProtocolVersion> protocolVersions) { + for (ProtocolVersion pv : supportedProtocols) { + if (protocolVersions.contains(pv)) { + return true; + } + } + return false; + } + + boolean isAvailable(ProtocolVersion protocolVersion) { + for (ProtocolVersion pv : supportedProtocols) { + if (protocolVersion == pv) { + return true; + } + } + return false; + } - return namedGroup; + boolean isSupported(List<CipherSuite> cipherSuites) { + for (CipherSuite cs : cipherSuites) { + boolean isMatch = isAvailable(cs.supportedProtocols); + if (isMatch && (cs.keyExchange == null || + cs.keyExchange.groupType == type)) { + return true; + } } + return false; } - return null; + // lazy loading of parameters + AlgorithmParameters getParameters() { + return SupportedGroups.namedGroupParams.get(this); + } + + AlgorithmParameterSpec getParameterSpec() { + if (this.type == NamedGroupType.NAMED_GROUP_ECDHE) { + return SupportedGroups.getECGenParamSpec(this); + } else if (this.type == NamedGroupType.NAMED_GROUP_FFDHE) { + return SupportedGroups.getDHParameterSpec(this); + } + + return null; + } } - // Is there any supported group permitted by the constraints? - static boolean isActivatable( - AlgorithmConstraints constraints, NamedGroupType type) { - - boolean hasFFDHEGroups = false; - for (NamedGroup namedGroup : supportedNamedGroups) { - if (namedGroup.type == type) { - if (constraints.permits( - EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), - namedGroup.algorithm, - namedGroupParams.get(namedGroup))) { + static class SupportedGroups { + // To switch off the supported_groups extension for DHE cipher suite. + static final boolean enableFFDHE = + Utilities.getBooleanProperty("jsse.enableFFDHE", true); + + // cache to speed up the parameters construction + static final Map<NamedGroup, + AlgorithmParameters> namedGroupParams = new HashMap<>(); + + // the supported named groups + static final NamedGroup[] supportedNamedGroups; + + static { + boolean requireFips = SunJSSE.isFIPS(); + + // The value of the System Property defines a list of enabled named + // groups in preference order, separated with comma. For example: + // + // jdk.tls.namedGroups="secp521r1, secp256r1, ffdhe2048" + // + // If the System Property is not defined or the value is empty, the + // default groups and preferences will be used. + String property = AccessController.doPrivileged( + new GetPropertyAction("jdk.tls.namedGroups")); + if (property != null && property.length() != 0) { + // remove double quote marks from beginning/end of the property + if (property.length() > 1 && property.charAt(0) == '"' && + property.charAt(property.length() - 1) == '"') { + property = property.substring(1, property.length() - 1); + } + } - return true; + ArrayList<NamedGroup> groupList; + if (property != null && property.length() != 0) { + String[] groups = property.split(","); + groupList = new ArrayList<>(groups.length); + for (String group : groups) { + group = group.trim(); + if (!group.isEmpty()) { + NamedGroup namedGroup = NamedGroup.nameOf(group); + if (namedGroup != null && + (!requireFips || namedGroup.isFips)) { + if (isAvailableGroup(namedGroup)) { + groupList.add(namedGroup); + } + } // ignore unknown groups + } } - if (!hasFFDHEGroups && - (type == NamedGroupType.NAMED_GROUP_FFDHE)) { + if (groupList.isEmpty()) { + throw new IllegalArgumentException( + "System property jdk.tls.namedGroups(" + + property + ") contains no supported named groups"); + } + } else { // default groups + NamedGroup[] groups; + if (requireFips) { + groups = new NamedGroup[] { + // only NIST curves in FIPS mode + NamedGroup.SECP256_R1, + NamedGroup.SECP384_R1, + NamedGroup.SECP521_R1, + NamedGroup.SECT283_K1, + NamedGroup.SECT283_R1, + NamedGroup.SECT409_K1, + NamedGroup.SECT409_R1, + NamedGroup.SECT571_K1, + NamedGroup.SECT571_R1, + + // FFDHE 2048 + NamedGroup.FFDHE_2048, + NamedGroup.FFDHE_3072, + NamedGroup.FFDHE_4096, + NamedGroup.FFDHE_6144, + NamedGroup.FFDHE_8192, + }; + } else { + groups = new NamedGroup[] { + // NIST curves first + NamedGroup.SECP256_R1, + NamedGroup.SECP384_R1, + NamedGroup.SECP521_R1, + NamedGroup.SECT283_K1, + NamedGroup.SECT283_R1, + NamedGroup.SECT409_K1, + NamedGroup.SECT409_R1, + NamedGroup.SECT571_K1, + NamedGroup.SECT571_R1, + + // non-NIST curves + NamedGroup.SECP256_K1, + + // FFDHE 2048 + NamedGroup.FFDHE_2048, + NamedGroup.FFDHE_3072, + NamedGroup.FFDHE_4096, + NamedGroup.FFDHE_6144, + NamedGroup.FFDHE_8192, + }; + } + + groupList = new ArrayList<>(groups.length); + for (NamedGroup group : groups) { + if (isAvailableGroup(group)) { + groupList.add(group); + } + } - hasFFDHEGroups = true; + if (groupList.isEmpty() && + SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("No default named groups"); } } - } - // For compatibility, if no FFDHE groups are defined, the non-FFDHE - // compatible mode (using DHE cipher suite without FFDHE extension) - // is allowed. - // - // Note that the constraints checking on DHE parameters will be - // performed during key exchanging in a handshake. - if (!hasFFDHEGroups && (type == NamedGroupType.NAMED_GROUP_FFDHE)) { - return true; + supportedNamedGroups = new NamedGroup[groupList.size()]; + int i = 0; + for (NamedGroup namedGroup : groupList) { + supportedNamedGroups[i++] = namedGroup; + } } - return false; - } + // check whether the group is supported by the underlying providers + private static boolean isAvailableGroup(NamedGroup namedGroup) { + AlgorithmParameters params = null; + AlgorithmParameterSpec spec = null; + if (namedGroup.type == NamedGroupType.NAMED_GROUP_ECDHE) { + if (namedGroup.oid != null) { + try { + params = JsseJce.getAlgorithmParameters("EC"); + spec = new ECGenParameterSpec(namedGroup.oid); + } catch (NoSuchAlgorithmException e) { + return false; + } + } + } else if (namedGroup.type == NamedGroupType.NAMED_GROUP_FFDHE) { + try { + params = JsseJce.getAlgorithmParameters("DiffieHellman"); + spec = getFFDHEDHParameterSpec(namedGroup); + } catch (NoSuchAlgorithmException e) { + return false; + } + } // Otherwise, unsupported. + + if ((params != null) && (spec != null)) { + try { + params.init(spec); + } catch (InvalidParameterSpecException e) { + return false; + } - // Create the default supported groups extension. - static SupportedGroupsExtension createExtension( - AlgorithmConstraints constraints, - CipherSuiteList cipherSuites, boolean enableFFDHE) { + // cache the parameters + namedGroupParams.put(namedGroup, params); - ArrayList<Integer> groupList = - new ArrayList<>(supportedNamedGroups.length); - for (NamedGroup namedGroup : supportedNamedGroups) { - if ((!enableFFDHE) && - (namedGroup.type == NamedGroupType.NAMED_GROUP_FFDHE)) { - continue; + return true; } - if (cipherSuites.contains(namedGroup.type) && - constraints.permits(EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), - namedGroup.algorithm, namedGroupParams.get(namedGroup))) { + return false; + } - groupList.add(namedGroup.id); + private static DHParameterSpec getFFDHEDHParameterSpec( + NamedGroup namedGroup) { + DHParameterSpec spec = null; + switch (namedGroup) { + case FFDHE_2048: + spec = PredefinedDHParameterSpecs.ffdheParams.get(2048); + break; + case FFDHE_3072: + spec = PredefinedDHParameterSpecs.ffdheParams.get(3072); + break; + case FFDHE_4096: + spec = PredefinedDHParameterSpecs.ffdheParams.get(4096); + break; + case FFDHE_6144: + spec = PredefinedDHParameterSpecs.ffdheParams.get(6144); + break; + case FFDHE_8192: + spec = PredefinedDHParameterSpecs.ffdheParams.get(8192); } + + return spec; } - if (!groupList.isEmpty()) { - int[] ids = new int[groupList.size()]; - int i = 0; - for (Integer id : groupList) { - ids[i++] = id; + private static DHParameterSpec getPredefinedDHParameterSpec( + NamedGroup namedGroup) { + DHParameterSpec spec = null; + switch (namedGroup) { + case FFDHE_2048: + spec = PredefinedDHParameterSpecs.definedParams.get(2048); + break; + case FFDHE_3072: + spec = PredefinedDHParameterSpecs.definedParams.get(3072); + break; + case FFDHE_4096: + spec = PredefinedDHParameterSpecs.definedParams.get(4096); + break; + case FFDHE_6144: + spec = PredefinedDHParameterSpecs.definedParams.get(6144); + break; + case FFDHE_8192: + spec = PredefinedDHParameterSpecs.definedParams.get(8192); } - return new SupportedGroupsExtension(ids); + return spec; } - return null; - } + static ECGenParameterSpec getECGenParamSpec(NamedGroup namedGroup) { + if (namedGroup.type != NamedGroupType.NAMED_GROUP_ECDHE) { + throw new RuntimeException( + "Not a named EC group: " + namedGroup); + } - // get the preferred activated named group - NamedGroup getPreferredGroup( - AlgorithmConstraints constraints, NamedGroupType type) { + AlgorithmParameters params = namedGroupParams.get(namedGroup); + try { + return params.getParameterSpec(ECGenParameterSpec.class); + } catch (InvalidParameterSpecException ipse) { + // should be unlikely + return new ECGenParameterSpec(namedGroup.oid); + } + } - for (int groupId : requestedNamedGroupIds) { - NamedGroup namedGroup = NamedGroup.valueOf(groupId); - if ((namedGroup != null) && (namedGroup.type == type) && - SupportedGroupsExtension.supports(namedGroup) && - constraints.permits(EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), - namedGroup.algorithm, namedGroupParams.get(namedGroup))) { + static DHParameterSpec getDHParameterSpec(NamedGroup namedGroup) { + if (namedGroup.type != NamedGroupType.NAMED_GROUP_FFDHE) { + throw new RuntimeException( + "Not a named DH group: " + namedGroup); + } - return namedGroup; + AlgorithmParameters params = namedGroupParams.get(namedGroup); + try { + return params.getParameterSpec(DHParameterSpec.class); + } catch (InvalidParameterSpecException ipse) { + // should be unlikely + return getPredefinedDHParameterSpec(namedGroup); } } - return null; - } + // Is there any supported group permitted by the constraints? + static boolean isActivatable( + AlgorithmConstraints constraints, NamedGroupType type) { + + boolean hasFFDHEGroups = false; + for (NamedGroup namedGroup : supportedNamedGroups) { + if (namedGroup.type == type) { + if (constraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + namedGroup.algorithm, + namedGroupParams.get(namedGroup))) { + + return true; + } + + if (!hasFFDHEGroups && + (type == NamedGroupType.NAMED_GROUP_FFDHE)) { + hasFFDHEGroups = true; + } + } + } - boolean hasFFDHEGroup() { - for (int groupId : requestedNamedGroupIds) { - /* - * [RFC 7919] Codepoints in the "Supported Groups Registry" - * with a high byte of 0x01 (that is, between 256 and 511, - * inclusive) are set aside for FFDHE groups. - */ - if ((groupId >= 256) && (groupId <= 511)) { - return true; + // For compatibility, if no FFDHE groups are defined, the non-FFDHE + // compatible mode (using DHE cipher suite without FFDHE extension) + // is allowed. + // + // Note that the constraints checking on DHE parameters will be + // performed during key exchanging in a handshake. + return !hasFFDHEGroups && type == NamedGroupType.NAMED_GROUP_FFDHE; + } + + // Is the named group permitted by the constraints? + static boolean isActivatable( + AlgorithmConstraints constraints, NamedGroup namedGroup) { + if (!isSupported(namedGroup)) { + return false; } + + return constraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + namedGroup.algorithm, + namedGroupParams.get(namedGroup)); } - return false; - } + // Is there any supported group permitted by the constraints? + static boolean isSupported(NamedGroup namedGroup) { + for (NamedGroup group : supportedNamedGroups) { + if (namedGroup.id == group.id) { + return true; + } + } - boolean contains(int index) { - for (int groupId : requestedNamedGroupIds) { - if (index == groupId) { - return true; + return false; + } + + static NamedGroup getPreferredGroup( + ProtocolVersion negotiatedProtocol, + AlgorithmConstraints constraints, NamedGroupType type, + List<NamedGroup> requestedNamedGroups) { + for (NamedGroup namedGroup : requestedNamedGroups) { + if ((namedGroup.type == type) && + namedGroup.isAvailable(negotiatedProtocol) && + constraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + namedGroup.algorithm, + namedGroupParams.get(namedGroup))) { + return namedGroup; + } } + + return null; } - return false; - } - @Override - int length() { - return 6 + (requestedNamedGroupIds.length << 1); - } + static NamedGroup getPreferredGroup( + ProtocolVersion negotiatedProtocol, + AlgorithmConstraints constraints, NamedGroupType type) { + for (NamedGroup namedGroup : supportedNamedGroups) { + if ((namedGroup.type == type) && + namedGroup.isAvailable(negotiatedProtocol) && + constraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + namedGroup.algorithm, + namedGroupParams.get(namedGroup))) { + return namedGroup; + } + } - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - int k = requestedNamedGroupIds.length << 1; - s.putInt16(k + 2); - s.putInt16(k); - for (int groupId : requestedNamedGroupIds) { - s.putInt16(groupId); + return null; } } - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("Extension " + type + ", group names: {"); - boolean first = true; - for (int groupId : requestedNamedGroupIds) { - if (first) { - first = false; - } else { - sb.append(", "); + /** + * Network data producer of a "supported_groups" extension in + * the ClientHello handshake message. + */ + private static final class CHSupportedGroupsProducer + extends SupportedGroups implements HandshakeProducer { + // Prevent instantiation of this class. + private CHSupportedGroupsProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(CH_SUPPORTED_GROUPS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable supported_groups extension"); + } + return null; } - // first check if it is a known named group, then try other cases. - NamedGroup namedGroup = NamedGroup.valueOf(groupId); - if (namedGroup != null) { - sb.append(namedGroup.name); - } else if (groupId == ARBITRARY_PRIME) { - sb.append("arbitrary_explicit_prime_curves"); - } else if (groupId == ARBITRARY_CHAR2) { - sb.append("arbitrary_explicit_char2_curves"); - } else { - sb.append("unknown named group " + groupId); + + // Produce the extension. + ArrayList<NamedGroup> namedGroups = + new ArrayList<>(SupportedGroups.supportedNamedGroups.length); + for (NamedGroup ng : SupportedGroups.supportedNamedGroups) { + if ((!SupportedGroups.enableFFDHE) && + (ng.type == NamedGroupType.NAMED_GROUP_FFDHE)) { + continue; + } + + if (ng.isAvailable(chc.activeProtocols) && + ng.isSupported(chc.activeCipherSuites) && + chc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + ng.algorithm, namedGroupParams.get(ng))) { + namedGroups.add(ng); + } else if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore inactive or disabled named group: " + ng.name); + } + } + + if (namedGroups.isEmpty()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("no available named group"); + } + + return null; + } + + int vectorLen = namedGroups.size() << 1; + byte[] extData = new byte[vectorLen + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, vectorLen); + for (NamedGroup namedGroup : namedGroups) { + Record.putInt16(m, namedGroup.id); } + + // Update the context. + chc.clientRequestedNamedGroups = + Collections.<NamedGroup>unmodifiableList(namedGroups); + chc.handshakeExtensions.put(CH_SUPPORTED_GROUPS, + new SupportedGroupsSpec(namedGroups)); + + return extData; } - sb.append("}"); - return sb.toString(); } - static boolean supports(NamedGroup namedGroup) { - for (NamedGroup group : supportedNamedGroups) { - if (namedGroup.id == group.id) { - return true; + /** + * Network data producer of a "supported_groups" extension in + * the ClientHello handshake message. + */ + private static final + class CHSupportedGroupsConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHSupportedGroupsConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(CH_SUPPORTED_GROUPS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable supported_groups extension"); + } + return; // ignore the extension } - } - return false; - } + // Parse the extension. + SupportedGroupsSpec spec; + try { + spec = new SupportedGroupsSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } - static ECGenParameterSpec getECGenParamSpec(NamedGroup namedGroup) { - if (namedGroup.type != NamedGroupType.NAMED_GROUP_ECDHE) { - throw new RuntimeException("Not a named EC group: " + namedGroup); - } + // Update the context. + List<NamedGroup> knownNamedGroups = new LinkedList<>(); + for (int id : spec.namedGroupsIds) { + NamedGroup ng = NamedGroup.valueOf(id); + if (ng != null) { + knownNamedGroups.add(ng); + } + } + + shc.clientRequestedNamedGroups = knownNamedGroups; + shc.handshakeExtensions.put(CH_SUPPORTED_GROUPS, spec); - AlgorithmParameters params = namedGroupParams.get(namedGroup); - try { - return params.getParameterSpec(ECGenParameterSpec.class); - } catch (InvalidParameterSpecException ipse) { - // should be unlikely - return new ECGenParameterSpec(namedGroup.oid); + // No impact on session resumption. } } - static DHParameterSpec getDHParameterSpec(NamedGroup namedGroup) { - if (namedGroup.type != NamedGroupType.NAMED_GROUP_FFDHE) { - throw new RuntimeException("Not a named DH group: " + namedGroup); + /** + * Network data producer of a "supported_groups" extension in + * the EncryptedExtensions handshake message. + */ + private static final class EESupportedGroupsProducer + extends SupportedGroups implements HandshakeProducer { + + // Prevent instantiation of this class. + private EESupportedGroupsProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(EE_SUPPORTED_GROUPS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable supported_groups extension"); + } + return null; + } + + // Produce the extension. + // + // Contains all groups the server supports, regardless of whether + // they are currently supported by the client. + ArrayList<NamedGroup> namedGroups = new ArrayList<>( + SupportedGroups.supportedNamedGroups.length); + for (NamedGroup ng : SupportedGroups.supportedNamedGroups) { + if ((!SupportedGroups.enableFFDHE) && + (ng.type == NamedGroupType.NAMED_GROUP_FFDHE)) { + continue; + } + + if (ng.isAvailable(shc.activeProtocols) && + ng.isSupported(shc.activeCipherSuites) && + shc.algorithmConstraints.permits( + EnumSet.of(CryptoPrimitive.KEY_AGREEMENT), + ng.algorithm, namedGroupParams.get(ng))) { + namedGroups.add(ng); + } else if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore inactive or disabled named group: " + ng.name); + } + } + + if (namedGroups.isEmpty()) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning("no available named group"); + } + + return null; + } + + int vectorLen = namedGroups.size() << 1; + byte[] extData = new byte[vectorLen + 2]; + ByteBuffer m = ByteBuffer.wrap(extData); + Record.putInt16(m, vectorLen); + for (NamedGroup namedGroup : namedGroups) { + Record.putInt16(m, namedGroup.id); + } + + // Update the context. + shc.conContext.serverRequestedNamedGroups = + Collections.<NamedGroup>unmodifiableList(namedGroups); + SupportedGroupsSpec spec = new SupportedGroupsSpec(namedGroups); + shc.handshakeExtensions.put(EE_SUPPORTED_GROUPS, spec); + + return extData; } + } + + private static final + class EESupportedGroupsConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private EESupportedGroupsConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(EE_SUPPORTED_GROUPS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable supported_groups extension"); + } + return; // ignore the extension + } + + // Parse the extension. + SupportedGroupsSpec spec; + try { + spec = new SupportedGroupsSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + List<NamedGroup> knownNamedGroups = + new ArrayList<>(spec.namedGroupsIds.length); + for (int id : spec.namedGroupsIds) { + NamedGroup ng = NamedGroup.valueOf(id); + if (ng != null) { + knownNamedGroups.add(ng); + } + } + + chc.conContext.serverRequestedNamedGroups = knownNamedGroups; + chc.handshakeExtensions.put(EE_SUPPORTED_GROUPS, spec); - AlgorithmParameters params = namedGroupParams.get(namedGroup); - try { - return params.getParameterSpec(DHParameterSpec.class); - } catch (InvalidParameterSpecException ipse) { - // should be unlikely - return getPredefinedDHParameterSpec(namedGroup); + // No impact on session resumption. } } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/SupportedVersionsExtension.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,511 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.nio.ByteBuffer; +import java.text.MessageFormat; +import java.util.Locale; +import javax.net.ssl.SSLProtocolException; +import static sun.security.ssl.SSLExtension.CH_SUPPORTED_VERSIONS; +import sun.security.ssl.SSLExtension.ExtensionConsumer; +import static sun.security.ssl.SSLExtension.HRR_SUPPORTED_VERSIONS; +import static sun.security.ssl.SSLExtension.SH_SUPPORTED_VERSIONS; +import sun.security.ssl.SSLExtension.SSLExtensionSpec; +import sun.security.ssl.SSLHandshake.HandshakeMessage; + +/** + * Pack of the "supported_versions" extensions. + */ +final class SupportedVersionsExtension { + static final HandshakeProducer chNetworkProducer = + new CHSupportedVersionsProducer(); + static final ExtensionConsumer chOnLoadConsumer = + new CHSupportedVersionsConsumer(); + static final SSLStringizer chStringizer = + new CHSupportedVersionsStringizer(); + + static final HandshakeProducer shNetworkProducer = + new SHSupportedVersionsProducer(); + static final ExtensionConsumer shOnLoadConsumer = + new SHSupportedVersionsConsumer(); + static final SSLStringizer shStringizer = + new SHSupportedVersionsStringizer(); + + static final HandshakeProducer hrrNetworkProducer = + new HRRSupportedVersionsProducer(); + static final ExtensionConsumer hrrOnLoadConsumer = + new HRRSupportedVersionsConsumer(); + static final HandshakeProducer hrrReproducer = + new HRRSupportedVersionsReproducer(); + static final SSLStringizer hrrStringizer = + new SHSupportedVersionsStringizer(); + /** + * The "supported_versions" extension in ClientHello. + */ + static final class CHSupportedVersionsSpec implements SSLExtensionSpec { + final int[] requestedProtocols; + + private CHSupportedVersionsSpec(int[] requestedProtocols) { + this.requestedProtocols = requestedProtocols; + } + + private CHSupportedVersionsSpec(ByteBuffer m) throws IOException { + if (m.remaining() < 3) { // 1: the length of the list + // +2: one version at least + throw new SSLProtocolException( + "Invalid supported_versions extension: insufficient data"); + } + + byte[] vbs = Record.getBytes8(m); // Get the version bytes. + if (m.hasRemaining()) { + throw new SSLProtocolException( + "Invalid supported_versions extension: unknown extra data"); + } + + if (vbs == null || vbs.length == 0 || (vbs.length & 0x01) != 0) { + throw new SSLProtocolException( + "Invalid supported_versions extension: incomplete data"); + } + + int[] protocols = new int[vbs.length >> 1]; + for (int i = 0, j = 0; i < vbs.length;) { + byte major = vbs[i++]; + byte minor = vbs[i++]; + protocols[j++] = ((major & 0xFF) << 8) | (minor & 0xFF); + } + + this.requestedProtocols = protocols; + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"versions\": '['{0}']'", Locale.ENGLISH); + + if (requestedProtocols == null || requestedProtocols.length == 0) { + Object[] messageFields = { + "<no supported version specified>" + }; + return messageFormat.format(messageFields); + } else { + StringBuilder builder = new StringBuilder(512); + boolean isFirst = true; + for (int pv : requestedProtocols) { + if (isFirst) { + isFirst = false; + } else { + builder.append(", "); + } + + builder.append(ProtocolVersion.nameOf(pv)); + } + + Object[] messageFields = { + builder.toString() + }; + + return messageFormat.format(messageFields); + } + } + } + + private static final + class CHSupportedVersionsStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new CHSupportedVersionsSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of a "supported_versions" extension in ClientHello. + */ + private static final + class CHSupportedVersionsProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private CHSupportedVersionsProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(CH_SUPPORTED_VERSIONS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + + CH_SUPPORTED_VERSIONS.name); + } + return null; + } + + // Produce the extension. + // + // The activated protocols are used as the supported versions. + int[] protocols = new int[chc.activeProtocols.size()]; + int verLen = protocols.length * 2; + byte[] extData = new byte[verLen + 1]; // 1: versions length + extData[0] = (byte)(verLen & 0xFF); + int i = 0, j = 1; + for (ProtocolVersion pv : chc.activeProtocols) { + protocols[i++] = pv.id; + extData[j++] = pv.major; + extData[j++] = pv.minor; + } + + // Update the context. + chc.handshakeExtensions.put(CH_SUPPORTED_VERSIONS, + new CHSupportedVersionsSpec(protocols)); + + return extData; + } + } + + /** + * Network data consumer of a "supported_versions" extension in ClientHello. + */ + private static final + class CHSupportedVersionsConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private CHSupportedVersionsConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(CH_SUPPORTED_VERSIONS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + + CH_SUPPORTED_VERSIONS.name); + } + return; // ignore the extension + } + + // Parse the extension. + CHSupportedVersionsSpec spec; + try { + spec = new CHSupportedVersionsSpec(buffer); + } catch (IOException ioe) { + shc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + shc.handshakeExtensions.put(CH_SUPPORTED_VERSIONS, spec); + + // No impact on session resumption. + // + // Note that the protocol version negotiation happens before the + // session resumption negotiation. And the session resumption + // negotiation depends on the negotiated protocol version. + } + } + + /** + * The "supported_versions" extension in ServerHello and HelloRetryRequest. + */ + static final class SHSupportedVersionsSpec implements SSLExtensionSpec { + final int selectedVersion; + + private SHSupportedVersionsSpec(ProtocolVersion selectedVersion) { + this.selectedVersion = selectedVersion.id; + } + + private SHSupportedVersionsSpec(ByteBuffer m) throws IOException { + if (m.remaining() != 2) { // 2: the selected version + throw new SSLProtocolException( + "Invalid supported_versions: insufficient data"); + } + + byte major = m.get(); + byte minor = m.get(); + this.selectedVersion = ((major & 0xFF) << 8) | (minor & 0xFF); + } + + @Override + public String toString() { + MessageFormat messageFormat = new MessageFormat( + "\"selected version\": '['{0}']'", Locale.ENGLISH); + + Object[] messageFields = { + ProtocolVersion.nameOf(selectedVersion) + }; + return messageFormat.format(messageFields); + } + } + + private static final + class SHSupportedVersionsStringizer implements SSLStringizer { + @Override + public String toString(ByteBuffer buffer) { + try { + return (new SHSupportedVersionsSpec(buffer)).toString(); + } catch (IOException ioe) { + // For debug logging only, so please swallow exceptions. + return ioe.getMessage(); + } + } + } + + /** + * Network data producer of a "supported_versions" extension in ServerHello. + */ + private static final + class SHSupportedVersionsProducer implements HandshakeProducer { + // Prevent instantiation of this class. + private SHSupportedVersionsProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // In response to supported_versions request only + CHSupportedVersionsSpec svs = (CHSupportedVersionsSpec) + shc.handshakeExtensions.get(CH_SUPPORTED_VERSIONS); + if (svs == null) { + // Unlikely, no key_share extension requested. + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.warning( + "Ignore unavailable supported_versions extension"); + } + return null; + } + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(SH_SUPPORTED_VERSIONS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + + SH_SUPPORTED_VERSIONS.name); + } + return null; + } + + // Produce the extension. + byte[] extData = new byte[2]; + extData[0] = shc.negotiatedProtocol.major; + extData[1] = shc.negotiatedProtocol.minor; + + // Update the context. + shc.handshakeExtensions.put(SH_SUPPORTED_VERSIONS, + new SHSupportedVersionsSpec(shc.negotiatedProtocol)); + + return extData; + } + } + + /** + * Network data consumer of a "supported_versions" extension in ServerHello. + */ + private static final + class SHSupportedVersionsConsumer implements ExtensionConsumer { + // Prevent instantiation of this class. + private SHSupportedVersionsConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(SH_SUPPORTED_VERSIONS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + + SH_SUPPORTED_VERSIONS.name); + } + return; // ignore the extension + } + + // Parse the extension. + SHSupportedVersionsSpec spec; + try { + spec = new SHSupportedVersionsSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + chc.handshakeExtensions.put(SH_SUPPORTED_VERSIONS, spec); + + // No impact on session resumption. + // + // Note that the protocol version negotiation happens before the + // session resumption negotiation. And the session resumption + // negotiation depends on the negotiated protocol version. + } + } + + /** + * Network data producer of a "supported_versions" extension in + * HelloRetryRequest. + */ + private static final + class HRRSupportedVersionsProducer implements HandshakeProducer { + + // Prevent instantiation of this class. + private HRRSupportedVersionsProducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(HRR_SUPPORTED_VERSIONS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + + HRR_SUPPORTED_VERSIONS.name); + } + return null; + } + + // Produce the extension. + byte[] extData = new byte[2]; + extData[0] = shc.negotiatedProtocol.major; + extData[1] = shc.negotiatedProtocol.minor; + + // Update the context. + shc.handshakeExtensions.put(HRR_SUPPORTED_VERSIONS, + new SHSupportedVersionsSpec(shc.negotiatedProtocol)); + + return extData; + } + } + + /** + * Network data consumer of a "supported_versions" extension in + * HelloRetryRequest. + */ + private static final + class HRRSupportedVersionsConsumer implements ExtensionConsumer { + + // Prevent instantiation of this class. + private HRRSupportedVersionsConsumer() { + // blank + } + + @Override + public void consume(ConnectionContext context, + HandshakeMessage message, ByteBuffer buffer) throws IOException { + + // The consuming happens in client side only. + ClientHandshakeContext chc = (ClientHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!chc.sslConfig.isAvailable(HRR_SUPPORTED_VERSIONS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "Ignore unavailable extension: " + + HRR_SUPPORTED_VERSIONS.name); + } + return; // ignore the extension + } + + // Parse the extension. + SHSupportedVersionsSpec spec; + try { + spec = new SHSupportedVersionsSpec(buffer); + } catch (IOException ioe) { + chc.conContext.fatal(Alert.UNEXPECTED_MESSAGE, ioe); + return; // fatal() always throws, make the compiler happy. + } + + // Update the context. + chc.handshakeExtensions.put(HRR_SUPPORTED_VERSIONS, spec); + + // No impact on session resumption. + // + // Note that the protocol version negotiation happens before the + // session resumption negotiation. And the session resumption + // negotiation depends on the negotiated protocol version. + } + } + + /** + * Network data producer of a "supported_versions" extension for stateless + * HelloRetryRequest reconstruction. + */ + private static final + class HRRSupportedVersionsReproducer implements HandshakeProducer { + // Prevent instantiation of this class. + private HRRSupportedVersionsReproducer() { + // blank + } + + @Override + public byte[] produce(ConnectionContext context, + HandshakeMessage message) throws IOException { + // The producing happens in server side only. + ServerHandshakeContext shc = (ServerHandshakeContext)context; + + // Is it a supported and enabled extension? + if (!shc.sslConfig.isAvailable(HRR_SUPPORTED_VERSIONS)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl,handshake")) { + SSLLogger.fine( + "[Reproduce] Ignore unavailable extension: " + + HRR_SUPPORTED_VERSIONS.name); + } + return null; + } + + // Produce the extension. + byte[] extData = new byte[2]; + extData[0] = shc.negotiatedProtocol.major; + extData[1] = shc.negotiatedProtocol.minor; + + return extData; + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/TransportContext.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/TransportContext.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/TransportContext.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/TransportContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,678 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.Closeable; +import java.io.IOException; +import java.security.AccessControlContext; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import javax.net.ssl.HandshakeCompletedEvent; +import javax.net.ssl.HandshakeCompletedListener; +import javax.net.ssl.SSLEngineResult.HandshakeStatus; +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLSocket; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; + +/** + * SSL/(D)TLS transportation context. + */ +class TransportContext implements ConnectionContext, Closeable { + final SSLTransport transport; + + // registered plaintext consumers + final Map<Byte, SSLConsumer> consumers; + final AccessControlContext acc; + + final SSLContextImpl sslContext; + final SSLConfiguration sslConfig; + final InputRecord inputRecord; + final OutputRecord outputRecord; + + // connection status + boolean isUnsureMode; + boolean isNegotiated = false; + boolean isBroken = false; + boolean isInputCloseNotified = false; + boolean isOutputCloseNotified = false; + Exception closeReason = null; + + // negotiated security parameters + SSLSessionImpl conSession; + ProtocolVersion protocolVersion; + String applicationProtocol= null; + + // handshake context + HandshakeContext handshakeContext = null; + + // connection reserved status for handshake. + boolean secureRenegotiation = false; + byte[] clientVerifyData; + byte[] serverVerifyData; + + // connection sensitive configuration + List<NamedGroup> serverRequestedNamedGroups; + + CipherSuite cipherSuite; + private static final byte[] emptyByteArray = new byte[0]; + + // Please never use the transport parameter other than storing a + // reference to this object. + // + // Called by SSLEngineImpl + TransportContext(SSLContextImpl sslContext, SSLTransport transport, + InputRecord inputRecord, OutputRecord outputRecord) { + this(sslContext, transport, new SSLConfiguration(sslContext, true), + inputRecord, outputRecord, true); + } + + // Please never use the transport parameter other than storing a + // reference to this object. + // + // Called by SSLSocketImpl + TransportContext(SSLContextImpl sslContext, SSLTransport transport, + InputRecord inputRecord, OutputRecord outputRecord, + boolean isClientMode) { + this(sslContext, transport, + new SSLConfiguration(sslContext, isClientMode), + inputRecord, outputRecord, false); + } + + // Please never use the transport parameter other than storing a + // reference to this object. + // + // Called by SSLSocketImpl with an existing SSLConfig + TransportContext(SSLContextImpl sslContext, SSLTransport transport, + SSLConfiguration sslConfig, + InputRecord inputRecord, OutputRecord outputRecord) { + this(sslContext, transport, (SSLConfiguration)sslConfig.clone(), + inputRecord, outputRecord, false); + } + + private TransportContext(SSLContextImpl sslContext, SSLTransport transport, + SSLConfiguration sslConfig, InputRecord inputRecord, + OutputRecord outputRecord, boolean isUnsureMode) { + this.transport = transport; + this.sslContext = sslContext; + this.inputRecord = inputRecord; + this.outputRecord = outputRecord; + this.sslConfig = sslConfig; + if (this.sslConfig.maximumPacketSize == 0) { + this.sslConfig.maximumPacketSize = outputRecord.getMaxPacketSize(); + } + this.isUnsureMode = isUnsureMode; + + // initial security parameters + this.conSession = SSLSessionImpl.nullSession; + this.protocolVersion = this.sslConfig.maximumProtocolVersion; + this.clientVerifyData = emptyByteArray; + this.serverVerifyData = emptyByteArray; + + this.acc = AccessController.getContext(); + this.consumers = new HashMap<>(); + } + + // Dispatch plaintext to a specific consumer. + void dispatch(Plaintext plaintext) throws IOException { + if (plaintext == null) { + return; + } + + ContentType ct = ContentType.valueOf(plaintext.contentType); + if (ct == null) { + fatal(Alert.UNEXPECTED_MESSAGE, + "Unknown content type: " + plaintext.contentType); + return; + } + + switch (ct) { + case HANDSHAKE: + byte type = HandshakeContext.getHandshakeType(this, + plaintext); + if (handshakeContext == null) { + if (type == SSLHandshake.KEY_UPDATE.id || + type == SSLHandshake.NEW_SESSION_TICKET.id) { + if (isNegotiated && + protocolVersion.useTLS13PlusSpec()) { + handshakeContext = new PostHandshakeContext(this); + } else { + fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected post-handshake message: " + + SSLHandshake.nameOf(type)); + } + } else { + handshakeContext = sslConfig.isClientMode ? + new ClientHandshakeContext(sslContext, this) : + new ServerHandshakeContext(sslContext, this); + outputRecord.initHandshaker(); + } + } + handshakeContext.dispatch(type, plaintext); + break; + case ALERT: + Alert.alertConsumer.consume(this, plaintext.fragment); + break; + default: + SSLConsumer consumer = consumers.get(plaintext.contentType); + if (consumer != null) { + consumer.consume(this, plaintext.fragment); + } else { + fatal(Alert.UNEXPECTED_MESSAGE, + "Unexpected content: " + plaintext.contentType); + } + } + } + + void kickstart() throws IOException { + if (isUnsureMode) { + throw new IllegalStateException("Client/Server mode not yet set."); + } + + if (outputRecord.isClosed() || inputRecord.isClosed() || isBroken) { + if (closeReason != null) { + throw new SSLException( + "Cannot kickstart, the connection is broken or closed", + closeReason); + } else { + throw new SSLException( + "Cannot kickstart, the connection is broken or closed"); + } + } + + // initialize the handshaker if necessary + if (handshakeContext == null) { + // TLS1.3 post-handshake + if (isNegotiated && protocolVersion.useTLS13PlusSpec()) { + handshakeContext = new PostHandshakeContext(this); + } else { + handshakeContext = sslConfig.isClientMode ? + new ClientHandshakeContext(sslContext, this) : + new ServerHandshakeContext(sslContext, this); + outputRecord.initHandshaker(); + } + } + + // kickstart the handshake if needed + // + // Need no kickstart message on server side unless the connection + // has been established. + if(isNegotiated || sslConfig.isClientMode) { + handshakeContext.kickstart(); + } + } + + void keyUpdate() throws IOException { + kickstart(); + } + + boolean isPostHandshakeContext() { + return handshakeContext != null && + (handshakeContext instanceof PostHandshakeContext); + } + + // Note: close_notify is delivered as a warning alert. + void warning(Alert alert) { + // For initial handshaking, don't send a warning alert message to peer + // if handshaker has not started. + if (isNegotiated || handshakeContext != null) { + try { + outputRecord.encodeAlert(Alert.Level.WARNING.level, alert.id); + } catch (IOException ioe) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning( + "Warning: failed to send warning alert " + alert, ioe); + } + } + } + } + + void fatal(Alert alert, + String diagnostic) throws SSLException { + fatal(alert, diagnostic, null); + } + + void fatal(Alert alert, Throwable cause) throws SSLException { + fatal(alert, null, cause); + } + + void fatal(Alert alert, + String diagnostic, Throwable cause) throws SSLException { + fatal(alert, diagnostic, false, cause); + } + + // Note: close_notify is not delivered via fatal() methods. + void fatal(Alert alert, String diagnostic, + boolean recvFatalAlert, Throwable cause) throws SSLException { + // If we've already shutdown because of an error, there is nothing we + // can do except rethrow the exception. + // + // Most exceptions seen here will be SSLExceptions. We may find the + // occasional Exception which hasn't been converted to a SSLException, + // so we'll do it here. + if (closeReason != null) { + if (cause == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning( + "Closed transport, general or untracked problem"); + } + throw alert.createSSLException( + "Closed transport, general or untracked problem"); + } + + if (cause instanceof SSLException) { + throw (SSLException)cause; + } else { // unlikely, but just in case. + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning( + "Closed transport, unexpected rethrowing", cause); + } + throw alert.createSSLException("Unexpected rethrowing", cause); + } + } + + // If we have no further information, make a general-purpose + // message for folks to see. We generally have one or the other. + if (diagnostic == null) { + if (cause == null) { + diagnostic = "General/Untracked problem"; + } else { + diagnostic = cause.getMessage(); + } + } + + if (cause == null) { + cause = alert.createSSLException(diagnostic); + } + + // shutdown the transport + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.severe("Fatal (" + alert + "): " + diagnostic, cause); + } + + // remember the close reason + if (cause instanceof SSLException) { + closeReason = (SSLException)cause; + } else { + // Including RuntimeException, but we'll throw those down below. + closeReason = alert.createSSLException(diagnostic, cause); + } + + // close inbound + try { + inputRecord.close(); + } catch (IOException ioe) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("Fatal: input record closure failed", ioe); + } + } + + // invalidate the session + if (conSession != null) { + conSession.invalidate(); + } + + if (handshakeContext != null && + handshakeContext.handshakeSession != null) { + handshakeContext.handshakeSession.invalidate(); + } + + // send fatal alert + // + // If we haven't even started handshaking yet, or we are the recipient + // of a fatal alert, no need to generate a fatal close alert. + if (!recvFatalAlert && !isOutboundDone() && !isBroken && + (isNegotiated || handshakeContext != null)) { + try { + outputRecord.encodeAlert(Alert.Level.FATAL.level, alert.id); + } catch (IOException ioe) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning( + "Fatal: failed to send fatal alert " + alert, ioe); + } + } + } + + // close outbound + try { + outputRecord.close(); + } catch (IOException ioe) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("Fatal: output record closure failed", ioe); + } + } + + // terminal handshake context + if (handshakeContext != null) { + handshakeContext = null; + } + + // terminal the transport + try { + transport.shutdown(); + } catch (IOException ioe) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("Fatal: transport closure failed", ioe); + } + } finally { + isBroken = true; + } + + if (closeReason instanceof SSLException) { + throw (SSLException)closeReason; + } else { + throw (RuntimeException)closeReason; + } + } + + void setUseClientMode(boolean useClientMode) { + // Once handshaking has begun, the mode can not be reset for the + // life of this engine. + if (handshakeContext != null || isNegotiated) { + throw new IllegalArgumentException( + "Cannot change mode after SSL traffic has started"); + } + + /* + * If we need to change the client mode and the enabled + * protocols and cipher suites haven't specifically been + * set by the user, change them to the corresponding + * default ones. + */ + if (sslConfig.isClientMode != useClientMode) { + if (sslContext.isDefaultProtocolVesions( + sslConfig.enabledProtocols)) { + sslConfig.enabledProtocols = + sslContext.getDefaultProtocolVersions(!useClientMode); + } + + if (sslContext.isDefaultCipherSuiteList( + sslConfig.enabledCipherSuites)) { + sslConfig.enabledCipherSuites = + sslContext.getDefaultCipherSuites(!useClientMode); + } + + sslConfig.isClientMode = useClientMode; + } + + isUnsureMode = false; + } + + // The OutputRecord is closed and not buffered output record. + boolean isOutboundDone() { + return outputRecord.isClosed() && outputRecord.isEmpty(); + } + + // The OutputRecord is closed, but buffered output record may be still + // waiting for delivery to the underlying connection. + boolean isOutboundClosed() { + return outputRecord.isClosed(); + } + + boolean isInboundDone() { + return inputRecord.isClosed(); + } + + boolean isClosed() { + return isOutboundClosed() && isInboundDone(); + } + + @Override + public void close() throws IOException { + if (!isOutboundDone()) { + closeOutbound(); + } + + if (!isInboundDone()) { + closeInbound(); + } + } + + void closeInbound() { + if (isInboundDone()) { + return; + } + + try { + if (isInputCloseNotified) { // passive close + passiveInboundClose(); + } else { // initiative close + initiateInboundClose(); + } + } catch (IOException ioe) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("inbound closure failed", ioe); + } + } + } + + void closeOutbound() { + if (isOutboundDone()) { + return; + } + + try { + initiateOutboundClose(); + } catch (IOException ioe) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning("outbound closure failed", ioe); + } + } + } + + // Close the connection passively. The closure could be kickoff by + // receiving a close_notify alert or reaching end_of_file of the socket. + private void passiveInboundClose() throws IOException { + if (!isInboundDone()) { + inputRecord.close(); + } + + // For TLS 1.2 and prior version, it is required to respond with + // a close_notify alert of its own and close down the connection + // immediately, discarding any pending writes. + if (!isOutboundDone() && !isOutputCloseNotified) { + try { + // send a close_notify alert + warning(Alert.CLOSE_NOTIFY); + } finally { + // any data received after a closure alert is ignored. + isOutputCloseNotified = true; + outputRecord.close(); + } + } + + transport.shutdown(); + } + + // Initiate a close by sending a close_notify alert. + private void initiateInboundClose() throws IOException { + // TLS 1.3 does not define how to initiate and close a TLS connection + // gracefully. We will always send a close_notify alert, and close + // the underlying transportation layer if needed. + if (!isInboundDone() && !isInputCloseNotified) { + try { + // send a close_notify alert + warning(Alert.CLOSE_NOTIFY); + } finally { + // any data received after a closure alert is ignored. + isInputCloseNotified = true; + inputRecord.close(); + } + } + + // For TLS 1.3, input closure is independent from output closure. Both + // parties need not wait to receive a "close_notify" alert before + // closing their read side of the connection. + // + // For TLS 1.2 and prior version, it is not required for the initiator + // of the close to wait for the responding close_notify alert before + // closing the read side of the connection. + try { + transport.shutdown(); + } finally { + if (!isOutboundDone()) { + outputRecord.close(); + } + } + } + + // Initiate a close by sending a close_notify alert. + private void initiateOutboundClose() throws IOException { + if (!isOutboundDone() && !isOutputCloseNotified) { + try { // close outputRecord + // send a close_notify alert + warning(Alert.CLOSE_NOTIFY); + } finally { + // any data received after a closure alert is ignored. + isOutputCloseNotified = true; + outputRecord.close(); + } + } + + // It is not required for the initiator of the close to wait for the + // responding close_notify alert before closing the read side of the + // connection. However, if the application protocol using TLS + // provides that any data may be carried over the underlying transport + // after the TLS connection is closed, the TLS implementation MUST + // receive a "close_notify" alert before indicating end-of-data to the + // application-layer. + try { + transport.shutdown(); + } finally { + if (!isInboundDone()) { + inputRecord.close(); + } + } + } + + // Note; HandshakeStatus.FINISHED status is retrieved in other places. + HandshakeStatus getHandshakeStatus() { + if (!outputRecord.isEmpty()) { + // If no handshaking, special case to wrap alters or + // post-handshake messages. + return HandshakeStatus.NEED_WRAP; + } else if (handshakeContext != null) { + if (!handshakeContext.delegatedActions.isEmpty()) { + return HandshakeStatus.NEED_TASK; + } else if (sslContext.isDTLS() && + !inputRecord.isEmpty()) { + return HandshakeStatus.NEED_UNWRAP_AGAIN; + } else { + return HandshakeStatus.NEED_UNWRAP; + } + } else if (isOutboundDone() && !isInboundDone()) { + /* + * Special case where we're closing, but + * still need the close_notify before we + * can officially be closed. + * + * Note isOutboundDone is taken care of by + * hasOutboundData() above. + */ + return HandshakeStatus.NEED_UNWRAP; + } + + return HandshakeStatus.NOT_HANDSHAKING; + } + + HandshakeStatus finishHandshake() { + if (protocolVersion.useTLS13PlusSpec()) { + outputRecord.tc = this; + inputRecord.tc = this; + cipherSuite = handshakeContext.negotiatedCipherSuite; + inputRecord.readCipher.baseSecret = handshakeContext.baseReadSecret; + outputRecord.writeCipher.baseSecret = handshakeContext.baseWriteSecret; + } + + handshakeContext = null; + outputRecord.handshakeHash.finish(); + inputRecord.finishHandshake(); + outputRecord.finishHandshake(); + isNegotiated = true; + + // Tell folk about handshake completion, but do it in a separate thread. + if (transport instanceof SSLSocket && + sslConfig.handshakeListeners != null && + !sslConfig.handshakeListeners.isEmpty()) { + HandshakeCompletedEvent hce = + new HandshakeCompletedEvent((SSLSocket)transport, conSession); + Thread thread = new Thread( + null, + new NotifyHandshake(sslConfig.handshakeListeners, hce), + "HandshakeCompletedNotify-Thread", + 0, + false); + thread.start(); + } + + return HandshakeStatus.FINISHED; + } + + HandshakeStatus finishPostHandshake() { + handshakeContext = null; + + // Note: May need trigger handshake completion even for post-handshake + // authentication in the future. + + return HandshakeStatus.FINISHED; + } + + // A separate thread is allocated to deliver handshake completion + // events. + private static class NotifyHandshake implements Runnable { + private final Set<Map.Entry<HandshakeCompletedListener, + AccessControlContext>> targets; // who gets notified + private final HandshakeCompletedEvent event; // the notification + + NotifyHandshake( + Map<HandshakeCompletedListener,AccessControlContext> listeners, + HandshakeCompletedEvent event) { + this.targets = new HashSet<>(listeners.entrySet()); // clone + this.event = event; + } + + @Override + public void run() { + // Don't need to synchronize, as it only runs in one thread. + for (Map.Entry<HandshakeCompletedListener, + AccessControlContext> entry : targets) { + final HandshakeCompletedListener listener = entry.getKey(); + AccessControlContext acc = entry.getValue(); + AccessController.doPrivileged(new PrivilegedAction<Void>() { + @Override + public Void run() { + listener.handshakeCompleted(event); + return null; + } + }, acc); + } + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/TrustManagerFactoryImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,18 +25,16 @@ package sun.security.ssl; -import java.util.*; import java.io.*; import java.security.*; import java.security.cert.*; +import java.util.*; import javax.net.ssl.*; - -import sun.security.validator.Validator; import sun.security.validator.TrustStoreUtil; +import sun.security.validator.Validator; abstract class TrustManagerFactoryImpl extends TrustManagerFactorySpi { - private static final Debug debug = Debug.getInstance("ssl"); private X509TrustManager trustManager = null; private boolean isInitialized = false; @@ -51,26 +49,26 @@ trustManager = getInstance(TrustStoreManager.getTrustedCerts()); } catch (SecurityException se) { // eat security exceptions but report other throwables - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println( - "SunX509: skip default keystore: " + se); + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine( + "SunX509: skip default keystore", se); } } catch (Error err) { - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println( - "SunX509: skip default keystore: " + err); + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine( + "SunX509: skip default keystore", err); } throw err; } catch (RuntimeException re) { - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println( - "SunX509: skip default keystore: " + re); + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine( + "SunX509: skip default keystor", re); } throw re; } catch (Exception e) { - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println( - "SunX509: skip default keystore: " + e); + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine( + "SunX509: skip default keystore", e); } throw new KeyStoreException( "problem accessing trust store", e); diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/TrustStoreManager.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,14 +25,11 @@ package sun.security.ssl; -import java.lang.ref.WeakReference; import java.io.*; -import java.util.*; - +import java.lang.ref.WeakReference; import java.security.*; import java.security.cert.*; -import java.security.cert.Certificate; - +import java.util.*; import sun.security.action.*; import sun.security.validator.TrustStoreUtil; @@ -41,7 +38,6 @@ * effectively. */ final class TrustStoreManager { - private static final Debug debug = Debug.getInstance("ssl"); // A singleton service to manage the default trusted KeyStores effectively. private static final TrustAnchorManager tam = new TrustAnchorManager(); @@ -112,8 +108,8 @@ this.storeFile = storeFile; this.lastModified = lastModified; - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println( + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine( "trustStore is: " + storeName + "\n" + "trustStore type is: " + storeType + "\n" + "trustStore provider is: " + storeProvider + "\n" + @@ -125,8 +121,10 @@ * Create an instance of TrustStoreDescriptor for the default * trusted KeyStore. */ + @SuppressWarnings("Convert2Lambda") static TrustStoreDescriptor createInstance() { - return AccessController.doPrivileged(new PrivilegedAction<>() { + return AccessController.doPrivileged( + new PrivilegedAction<TrustStoreDescriptor>() { @Override public TrustStoreDescriptor run() { @@ -158,11 +156,11 @@ } // Not break, the file is inaccessible. - if (debug != null && - Debug.isOn("trustmanager")) { - System.out.println( - "Inaccessible trust store: " + - storePropName); + if (SSLLogger.isOn && + SSLLogger.isOn("trustmanager")) { + SSLLogger.fine( + "Inaccessible trust store: " + + storePropName); } } } else { @@ -267,8 +265,8 @@ } // Reload a new key store. - if ((debug != null) && Debug.isOn("trustmanager")) { - System.out.println("Reload the trust store"); + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine("Reload the trust store"); } ks = loadKeyStore(descriptor); @@ -309,20 +307,20 @@ // Reload the trust store if needed. if (ks == null) { - if ((debug != null) && Debug.isOn("trustmanager")) { - System.out.println("Reload the trust store"); + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine("Reload the trust store"); } ks = loadKeyStore(descriptor); } // Reload trust certs from the key store. - if ((debug != null) && Debug.isOn("trustmanager")) { - System.out.println("Reload trust certs"); + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine("Reload trust certs"); } certs = loadTrustedCerts(ks); - if ((debug != null) && Debug.isOn("trustmanager")) { - System.out.println("Reloaded " + certs.size() + " trust certs"); + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine("Reloaded " + certs.size() + " trust certs"); } // Note that as ks is a local variable, it is not @@ -333,7 +331,7 @@ } /** - * Load the KeyStore as described in the specified descriptor. + * Load the the KeyStore as described in the specified descriptor. */ private static KeyStore loadKeyStore( TrustStoreDescriptor descriptor) throws Exception { @@ -341,8 +339,8 @@ descriptor.storeFile == null) { // No file available, no KeyStore available. - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println("No available key store"); + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine("No available key store"); } return null; @@ -367,8 +365,8 @@ ks.load(fis, password); } catch (FileNotFoundException fnfe) { // No file available, no KeyStore available. - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println( + if (SSLLogger.isOn && SSLLogger.isOn("trustmanager")) { + SSLLogger.fine( "Not available key store: " + descriptor.storeName); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/UnknownExtension.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/UnknownExtension.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/UnknownExtension.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/UnknownExtension.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2006, 2012, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; - -final class UnknownExtension extends HelloExtension { - - private final byte[] data; - - UnknownExtension(HandshakeInStream s, int len, ExtensionType type) - throws IOException { - super(type); - data = new byte[len]; - // s.read() does not handle 0-length arrays. - if (len != 0) { - s.read(data); - } - } - - @Override - int length() { - return 4 + data.length; - } - - @Override - void send(HandshakeOutStream s) throws IOException { - s.putInt16(type.id); - s.putBytes16(data); - } - - @Override - public String toString() { - return "Unsupported extension " + type + ", data: " + - Debug.toString(data); - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/UnknownStatusRequest.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/UnknownStatusRequest.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/UnknownStatusRequest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/UnknownStatusRequest.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; - -final class UnknownStatusRequest implements StatusRequest { - - private final byte[] data; - - UnknownStatusRequest(HandshakeInStream s, int len) throws IOException { - data = new byte[len]; - if (len > 0) { - s.read(data); - } - } - - UnknownStatusRequest(byte[] requestBytes) { - data = requestBytes; - } - - @Override - public int length() { - return data.length; - } - - @Override - public void send(HandshakeOutStream s) throws IOException { - // A raw write of the data - s.write(data); - } - - @Override - public String toString() { - return "Unsupported StatusRequest, data: " + - Debug.toString(data); - } -} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Utilities.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Utilities.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/Utilities.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/Utilities.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,18 +25,21 @@ package sun.security.ssl; -import javax.net.ssl.*; +import java.math.BigInteger; import java.util.*; +import java.util.regex.Pattern; +import javax.net.ssl.*; import sun.net.util.IPAddressUtil; +import sun.security.action.GetPropertyAction; /** * A utility class to share the static methods. */ final class Utilities { - /** - * hex digits - */ static final char[] hexDigits = "0123456789ABCDEF".toCharArray(); + private static final String indent = " "; + private static final Pattern lineBreakPatern = + Pattern.compile("\\r\\n|\\n|\\r"); /** * Puts {@code hostname} into the {@code serverNames} list. @@ -66,9 +69,9 @@ SNIServerName serverName = sniList.get(i); if (serverName.getType() == StandardConstants.SNI_HOST_NAME) { sniList.set(i, sniHostName); - if (Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", the previous server name in SNI (" + serverName + + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine( + "the previous server name in SNI (" + serverName + ") was replaced with (" + sniHostName + ")"); } reset = true; @@ -107,9 +110,8 @@ sniHostName = new SNIHostName(hostname); } catch (IllegalArgumentException iae) { // don't bother to handle illegal host_name - if (Debug.isOn("ssl")) { - System.out.println(Thread.currentThread().getName() + - ", \"" + hostname + "\" " + + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine(hostname + "\" " + "is not a legal HostName for server name indication"); } } @@ -117,4 +119,117 @@ return sniHostName; } + + /** + * Return the value of the boolean System property propName. + * + * Note use of privileged action. Do NOT make accessible to applications. + */ + static boolean getBooleanProperty(String propName, boolean defaultValue) { + // if set, require value of either true or false + String b = GetPropertyAction.privilegedGetProperty(propName); + if (b == null) { + return defaultValue; + } else if (b.equalsIgnoreCase("false")) { + return false; + } else if (b.equalsIgnoreCase("true")) { + return true; + } else { + throw new RuntimeException("Value of " + propName + + " must either be 'true' or 'false'"); + } + } + + static String indent(String source) { + return Utilities.indent(source, indent); + } + + static String indent(String source, String prefix) { + StringBuilder builder = new StringBuilder(); + if (source == null) { + builder.append("\n" + prefix + "<blank message>"); + } else { + String[] lines = lineBreakPatern.split(source); + boolean isFirst = true; + for (String line : lines) { + if (isFirst) { + isFirst = false; + } else { + builder.append("\n"); + } + builder.append(prefix).append(line); + } + } + + return builder.toString(); + } + + static String toHexString(byte b) { + return String.valueOf(hexDigits[(b >> 4) & 0x0F]) + + String.valueOf(hexDigits[b & 0x0F]); + } + + static String byte16HexString(int id) { + return "0x" + + hexDigits[(id >> 12) & 0x0F] + hexDigits[(id >> 8) & 0x0F] + + hexDigits[(id >> 4) & 0x0F] + hexDigits[id & 0x0F]; + } + + static String toHexString(byte[] bytes) { + if (bytes == null || bytes.length == 0) { + return ""; + } + + StringBuilder builder = new StringBuilder(bytes.length * 3); + boolean isFirst = true; + for (byte b : bytes) { + if (isFirst) { + isFirst = false; + } else { + builder.append(' '); + } + + builder.append(hexDigits[(b >> 4) & 0x0F]); + builder.append(hexDigits[b & 0x0F]); + } + return builder.toString(); + } + + static String toHexString(long lv) { + StringBuilder builder = new StringBuilder(128); + + boolean isFirst = true; + do { + if (isFirst) { + isFirst = false; + } else { + builder.append(' '); + } + + builder.append(hexDigits[(int)(lv & 0x0F)]); + lv >>>= 4; + builder.append(hexDigits[(int)(lv & 0x0F)]); + lv >>>= 4; + } while (lv != 0); + builder.reverse(); + + return builder.toString(); + } + + /** + * Utility method to convert a BigInteger to a byte array in unsigned + * format as needed in the handshake messages. BigInteger uses + * 2's complement format, i.e. it prepends an extra zero if the MSB + * is set. We remove that. + */ + static byte[] toByteArray(BigInteger bi) { + byte[] b = bi.toByteArray(); + if ((b.length > 1) && (b[0] == 0)) { + int n = b.length - 1; + byte[] newarray = new byte[n]; + System.arraycopy(b, 1, newarray, 0, n); + b = newarray; + } + return b; + } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/X509Authentication.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/X509Authentication.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/X509Authentication.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/X509Authentication.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,311 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.cert.X509Certificate; +import java.security.interfaces.ECPublicKey; +import java.security.spec.ECParameterSpec; +import java.util.AbstractMap.SimpleImmutableEntry; +import java.util.Map; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.X509ExtendedKeyManager; +import sun.security.ssl.SupportedGroupsExtension.NamedGroup; +import sun.security.ssl.SupportedGroupsExtension.SupportedGroups; + +enum X509Authentication implements SSLAuthentication { + // Require rsaEncryption public key + RSA ("RSA", new X509PossessionGenerator( + new String[]{"RSA"})), + + // Require RSASSA-PSS public key + RSASSA_PSS ("RSASSA-PSS", new X509PossessionGenerator( + new String[] {"RSASSA-PSS"})), + + // Require rsaEncryption or RSASSA-PSS public key + // + // Note that this is a specifical scheme for TLS 1.2. (EC)DHE_RSA cipher + // suites of TLS 1.2 can use either rsaEncryption or RSASSA-PSS public + // key for authentication and handshake. + RSA_OR_PSS ("RSA_OR_PSS", new X509PossessionGenerator( + new String[] {"RSA", "RSASSA-PSS"})), + + // Require DSA public key + DSA ("DSA", new X509PossessionGenerator( + new String[] {"DSA"})), + + // Require EC public key + EC ("EC", new X509PossessionGenerator( + new String[] {"EC"})); + + final String keyType; + final SSLPossessionGenerator possessionGenerator; + + X509Authentication(String keyType, + SSLPossessionGenerator possessionGenerator) { + this.keyType = keyType; + this.possessionGenerator = possessionGenerator; + } + + static X509Authentication valueOf(SignatureScheme signatureScheme) { + for (X509Authentication au: X509Authentication.values()) { + if (au.keyType.equals(signatureScheme.keyAlgorithm)) { + return au; + } + } + + return null; + } + + @Override + public SSLPossession createPossession(HandshakeContext handshakeContext) { + return possessionGenerator.createPossession(handshakeContext); + } + + @Override + public SSLHandshake[] getRelatedHandshakers( + HandshakeContext handshakeContext) { + if (!handshakeContext.negotiatedProtocol.useTLS13PlusSpec()) { + return new SSLHandshake[] { + SSLHandshake.CERTIFICATE, + SSLHandshake.CERTIFICATE_REQUEST + }; + } // Otherwise, TLS 1.3 does not use this method. + + return new SSLHandshake[0]; + } + + @SuppressWarnings({"unchecked", "rawtypes"}) + @Override + public Map.Entry<Byte, HandshakeProducer>[] getHandshakeProducers( + HandshakeContext handshakeContext) { + if (!handshakeContext.negotiatedProtocol.useTLS13PlusSpec()) { + return (Map.Entry<Byte, HandshakeProducer>[])(new Map.Entry[] { + new SimpleImmutableEntry<Byte, HandshakeProducer>( + SSLHandshake.CERTIFICATE.id, + SSLHandshake.CERTIFICATE + ) + }); + } // Otherwise, TLS 1.3 does not use this method. + + return (Map.Entry<Byte, HandshakeProducer>[])(new Map.Entry[0]); + } + + static final class X509Possession implements SSLPossession { + // Proof of possession of the private key corresponding to the public + // key for which a certificate is being provided for authentication. + final X509Certificate[] popCerts; + final PrivateKey popPrivateKey; + + X509Possession(PrivateKey popPrivateKey, + X509Certificate[] popCerts) { + this.popCerts = popCerts; + this.popPrivateKey = popPrivateKey; + } + } + + static final class X509Credentials implements SSLCredentials { + final X509Certificate[] popCerts; + final PublicKey popPublicKey; + + X509Credentials(PublicKey popPublicKey, X509Certificate[] popCerts) { + this.popCerts = popCerts; + this.popPublicKey = popPublicKey; + } + } + + private static final + class X509PossessionGenerator implements SSLPossessionGenerator { + private final String[] keyTypes; + + private X509PossessionGenerator(String[] keyTypes) { + this.keyTypes = keyTypes; + } + + @Override + public SSLPossession createPossession(HandshakeContext context) { + if (context.sslConfig.isClientMode) { + for (String keyType : keyTypes) { + SSLPossession poss = createClientPossession( + (ClientHandshakeContext)context, keyType); + if (poss != null) { + return poss; + } + } + } else { + for (String keyType : keyTypes) { + SSLPossession poss = createServerPossession( + (ServerHandshakeContext)context, keyType); + if (poss != null) { + return poss; + } + } + } + + return null; + } + + // Used by TLS 1.3 only. + private SSLPossession createClientPossession( + ClientHandshakeContext chc, String keyType) { + X509ExtendedKeyManager km = chc.sslContext.getX509KeyManager(); + String clientAlias = null; + if (chc.conContext.transport instanceof SSLSocketImpl) { + clientAlias = km.chooseClientAlias( + new String[] { keyType }, + null, (SSLSocket)chc.conContext.transport); + } else if (chc.conContext.transport instanceof SSLEngineImpl) { + clientAlias = km.chooseEngineClientAlias( + new String[] { keyType }, + null, (SSLEngine)chc.conContext.transport); + } + + if (clientAlias == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest("No X.509 cert selected for " + keyType); + } + return null; + } + + PrivateKey clientPrivateKey = km.getPrivateKey(clientAlias); + if (clientPrivateKey == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest( + clientAlias + " is not a private key entry"); + } + return null; + } + + X509Certificate[] clientCerts = km.getCertificateChain(clientAlias); + if ((clientCerts == null) || (clientCerts.length == 0)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest(clientAlias + + " is a private key entry with no cert chain stored"); + } + return null; + } + + PublicKey clientPublicKey = clientCerts[0].getPublicKey(); + if ((!clientPrivateKey.getAlgorithm().equals(keyType)) + || (!clientPublicKey.getAlgorithm().equals(keyType))) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine( + clientAlias + " private or public key is not of " + + keyType + " algorithm"); + } + return null; + } + + return new X509Possession(clientPrivateKey, clientCerts); + } + + private SSLPossession createServerPossession( + ServerHandshakeContext shc, String keyType) { + X509ExtendedKeyManager km = shc.sslContext.getX509KeyManager(); + String serverAlias = null; + if (shc.conContext.transport instanceof SSLSocketImpl) { + serverAlias = km.chooseServerAlias(keyType, + null, (SSLSocket)shc.conContext.transport); + } else if (shc.conContext.transport instanceof SSLEngineImpl) { + serverAlias = km.chooseEngineServerAlias(keyType, + null, (SSLEngine)shc.conContext.transport); + } + + if (serverAlias == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest("No X.509 cert selected for " + keyType); + } + return null; + } + + PrivateKey serverPrivateKey = km.getPrivateKey(serverAlias); + if (serverPrivateKey == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest( + serverAlias + " is not a private key entry"); + } + return null; + } + + X509Certificate[] serverCerts = km.getCertificateChain(serverAlias); + if ((serverCerts == null) || (serverCerts.length == 0)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.finest( + serverAlias + " is not a certificate entry"); + } + return null; + } + + PublicKey serverPublicKey = serverCerts[0].getPublicKey(); + if ((!serverPrivateKey.getAlgorithm().equals(keyType)) + || (!serverPublicKey.getAlgorithm().equals(keyType))) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine( + serverAlias + " private or public key is not of " + + keyType + " algorithm"); + } + return null; + } + + // For ECC certs, check whether we support the EC domain + // parameters. If the client sent a SupportedEllipticCurves + // ClientHello extension, check against that too. + if (keyType.equals("EC")) { + if (!(serverPublicKey instanceof ECPublicKey)) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning(serverAlias + + " public key is not an instance of ECPublicKey"); + } + return null; + } + + // For ECC certs, check whether we support the EC domain + // parameters. If the client sent a SupportedEllipticCurves + // ClientHello extension, check against that too. + ECParameterSpec params = + ((ECPublicKey)serverPublicKey).getParams(); + NamedGroup namedGroup = NamedGroup.valueOf(params); + if ((namedGroup == null) || + (!SupportedGroups.isSupported(namedGroup)) || + ((shc.clientRequestedNamedGroups != null) && + !shc.clientRequestedNamedGroups.contains(namedGroup))) { + + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.warning( + "Unsupported named group (" + namedGroup + + ") used in the " + serverAlias + " certificate"); + } + + return null; + } + } + + return new X509Possession(serverPrivateKey, serverCerts); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/X509KeyManagerImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,18 +26,21 @@ package sun.security.ssl; import java.lang.ref.*; -import java.util.*; -import static java.util.Locale.ENGLISH; -import java.util.concurrent.atomic.AtomicLong; import java.net.Socket; - -import java.security.*; -import java.security.KeyStore.*; -import java.security.cert.*; +import java.security.AlgorithmConstraints; +import java.security.KeyStore; +import java.security.KeyStore.Builder; +import java.security.KeyStore.Entry; +import java.security.KeyStore.PrivateKeyEntry; +import java.security.Principal; +import java.security.PrivateKey; +import java.security.cert.CertPathValidatorException; import java.security.cert.Certificate; - +import java.security.cert.CertificateException; +import java.security.cert.X509Certificate; +import java.util.*; +import java.util.concurrent.atomic.AtomicLong; import javax.net.ssl.*; - import sun.security.provider.certpath.AlgorithmChecker; import sun.security.validator.Validator; @@ -61,11 +64,6 @@ final class X509KeyManagerImpl extends X509ExtendedKeyManager implements X509KeyManager { - private static final Debug debug = Debug.getInstance("ssl"); - - private static final boolean useDebug = - (debug != null) && Debug.isOn("keymanager"); - // for unit testing only, set via privileged reflection private static Date verificationDate; @@ -189,9 +187,7 @@ SSLSession session = sslSocket.getHandshakeSession(); if (session != null) { - ProtocolVersion protocolVersion = - ProtocolVersion.valueOf(session.getProtocol()); - if (protocolVersion.useTLS12PlusSpec()) { + if (ProtocolVersion.useTLS12PlusSpec(session.getProtocol())) { String[] peerSupportedSignAlgs = null; if (session instanceof ExtendedSSLSession) { @@ -217,9 +213,7 @@ if (engine != null) { SSLSession session = engine.getHandshakeSession(); if (session != null) { - ProtocolVersion protocolVersion = - ProtocolVersion.valueOf(session.getProtocol()); - if (protocolVersion.useTLS12PlusSpec()) { + if (ProtocolVersion.useTLS12PlusSpec(session.getProtocol())) { String[] peerSupportedSignAlgs = null; if (session instanceof ExtendedSSLSession) { @@ -297,6 +291,7 @@ // In TLS 1.2, the signature algorithm has been obsoleted by the // supported_signature_algorithms, and the certificate type no longer // restricts the algorithm used to sign the certificate. + // // However, because we don't support certificate type checking other // than rsa_sign, dss_sign and ecdsa_sign, we don't have to check the // protocol version here. @@ -328,8 +323,10 @@ // Check the signature algorithm of the certificate itself. // Look for the "withRSA" in "SHA1withRSA", etc. X509Certificate issuer = (X509Certificate)chain[0]; - String sigAlgName = issuer.getSigAlgName().toUpperCase(ENGLISH); - String pattern = "WITH" + sigKeyAlgorithm.toUpperCase(ENGLISH); + String sigAlgName = + issuer.getSigAlgName().toUpperCase(Locale.ENGLISH); + String pattern = + "WITH" + sigKeyAlgorithm.toUpperCase(Locale.ENGLISH); return sigAlgName.contains(pattern); } } @@ -388,8 +385,8 @@ // if it's a perfect match, return immediately EntryStatus status = results.get(0); if (status.checkResult == CheckResult.OK) { - if (useDebug) { - debug.println("KeyMgr: choosing key: " + status); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("KeyMgr: choosing key: " + status); } return makeAlias(status); } @@ -403,16 +400,16 @@ } } if (allResults == null) { - if (useDebug) { - debug.println("KeyMgr: no matching key found"); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("KeyMgr: no matching key found"); } return null; } Collections.sort(allResults); - if (useDebug) { - debug.println("KeyMgr: no good matching key found, " - + "returning best match out of:"); - debug.println(allResults.toString()); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine( + "KeyMgr: no good matching key found, " + + "returning best match out of", allResults); } return makeAlias(allResults.get(0)); } @@ -439,7 +436,7 @@ null, null); if (results != null) { if (allResults == null) { - allResults = new ArrayList<EntryStatus>(); + allResults = new ArrayList<>(); } allResults.addAll(results); } @@ -448,14 +445,14 @@ } } if (allResults == null || allResults.isEmpty()) { - if (useDebug) { - debug.println("KeyMgr: no matching alias found"); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("KeyMgr: no matching alias found"); } return null; } Collections.sort(allResults); - if (useDebug) { - debug.println("KeyMgr: getting aliases: " + allResults); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("KeyMgr: getting aliases", allResults); } return toAliases(allResults); } @@ -544,9 +541,10 @@ return (bit < keyUsage.length) && keyUsage[bit]; } - // check if this certificate is appropriate for this type of use - // first check extensions, if they match, check expiration - // note: we may want to move this code into the sun.security.validator + // Check if this certificate is appropriate for this type of use + // first check extensions, if they match, check expiration. + // + // Note: we may want to move this code into the sun.security.validator // package CheckResult check(X509Certificate cert, Date date, List<SNIServerName> serverNames, String idAlgorithm) { @@ -570,20 +568,25 @@ boolean[] ku = cert.getKeyUsage(); if (ku != null) { String algorithm = cert.getPublicKey().getAlgorithm(); - boolean kuSignature = getBit(ku, 0); + boolean supportsDigitalSignature = getBit(ku, 0); switch (algorithm) { case "RSA": // require either signature bit // or if server also allow key encipherment bit - if (kuSignature == false) { - if ((this == CLIENT) || (getBit(ku, 2) == false)) { + if (!supportsDigitalSignature) { + if (this == CLIENT || getBit(ku, 2) == false) { return CheckResult.EXTENSION_MISMATCH; } } break; + case "RSASSA-PSS": + if (!supportsDigitalSignature && (this == SERVER)) { + return CheckResult.EXTENSION_MISMATCH; + } + break; case "DSA": // require signature bit - if (kuSignature == false) { + if (!supportsDigitalSignature) { return CheckResult.EXTENSION_MISMATCH; } break; @@ -595,7 +598,7 @@ break; case "EC": // require signature bit - if (kuSignature == false) { + if (!supportsDigitalSignature) { return CheckResult.EXTENSION_MISMATCH; } // For servers, also require key agreement. @@ -631,8 +634,9 @@ new SNIHostName(serverName.getEncoded()); } catch (IllegalArgumentException iae) { // unlikely to happen, just in case ... - if (useDebug) { - debug.println( + if (SSLLogger.isOn && + SSLLogger.isOn("keymanager")) { + SSLLogger.fine( "Illegal server name: " + serverName); } @@ -646,11 +650,12 @@ X509TrustManagerImpl.checkIdentity(hostname, cert, idAlgorithm); } catch (CertificateException e) { - if (useDebug) { - debug.println( - "Certificate identity does not match " + - "Server Name Inidication (SNI): " + - hostname); + if (SSLLogger.isOn && + SSLLogger.isOn("keymanager")) { + SSLLogger.fine( + "Certificate identity does not match " + + "Server Name Inidication (SNI): " + + hostname); } return CheckResult.INSENSITIVE; } @@ -724,7 +729,7 @@ for (Enumeration<String> e = ks.aliases(); e.hasMoreElements(); ) { String alias = e.nextElement(); // check if it is a key entry (private key or secret key) - if (ks.isKeyEntry(alias) == false) { + if (!ks.isKeyEntry(alias)) { continue; } @@ -757,8 +762,8 @@ j++; } if (keyIndex == -1) { - if (useDebug) { - debug.println("Ignoring alias " + alias + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("Ignore alias " + alias + ": key algorithm does not match"); } continue; @@ -774,9 +779,10 @@ } } if (found == false) { - if (useDebug) { - debug.println("Ignoring alias " + alias - + ": issuers do not match"); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine( + "Ignore alias " + alias + + ": issuers do not match"); } continue; } @@ -787,8 +793,8 @@ !conformsToAlgorithmConstraints(constraints, chain, checkType.getValidator())) { - if (useDebug) { - debug.println("Ignoring alias " + alias + + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("Ignore alias " + alias + ": certificate list does not conform to " + "algorithm constraints"); } @@ -813,7 +819,7 @@ return Collections.singletonList(status); } else { if (results == null) { - results = new ArrayList<EntryStatus>(); + results = new ArrayList<>(); } results.add(status); } @@ -825,14 +831,15 @@ AlgorithmConstraints constraints, Certificate[] chain, String variant) { - AlgorithmChecker checker = new AlgorithmChecker(constraints, null, variant); + AlgorithmChecker checker = + new AlgorithmChecker(constraints, null, variant); try { checker.init(false); } catch (CertPathValidatorException cpve) { // unlikely to happen - if (useDebug) { - debug.println( - "Cannot initialize algorithm constraints checker: " + cpve); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine( + "Cannot initialize algorithm constraints checker", cpve); } return false; @@ -845,9 +852,9 @@ // We don't care about the unresolved critical extensions. checker.check(cert, Collections.<String>emptySet()); } catch (CertPathValidatorException cpve) { - if (useDebug) { - debug.println("Certificate (" + cert + - ") does not conform to algorithm constraints: " + cpve); + if (SSLLogger.isOn && SSLLogger.isOn("keymanager")) { + SSLLogger.fine("Certificate does not conform to " + + "algorithm constraints", cert, cpve); } return false; @@ -856,5 +863,4 @@ return true; } - } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/ssl/X509TrustManagerImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,20 +23,16 @@ * questions. */ - package sun.security.ssl; import java.net.Socket; -import javax.net.ssl.SSLSession; - -import java.util.*; import java.security.*; import java.security.cert.*; +import java.util.*; import javax.net.ssl.*; - -import sun.security.validator.*; import sun.security.util.AnchorCertificates; import sun.security.util.HostnameChecker; +import sun.security.validator.*; /** * This class implements the SunJSSE X.509 trust manager using the internal @@ -67,8 +63,6 @@ // the different extension checks. They are initialized lazily on demand. private volatile Validator clientValidator, serverValidator; - private static final Debug debug = Debug.getInstance("ssl"); - X509TrustManagerImpl(String validatorType, Collection<X509Certificate> trustedCerts) { @@ -81,8 +75,9 @@ this.trustedCerts = trustedCerts; - if (debug != null && Debug.isOn("trustmanager")) { - showTrustedCerts(); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,trustmanager")) { + SSLLogger.fine("adding as trusted certificates", + (Object[])trustedCerts.toArray(new X509Certificate[0])); } } @@ -97,8 +92,9 @@ trustedCerts = v.getTrustedCertificates(); serverValidator = v; - if (debug != null && Debug.isOn("trustmanager")) { - showTrustedCerts(); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,trustmanager")) { + SSLLogger.fine("adding as trusted certificates", + (Object[])trustedCerts.toArray(new X509Certificate[0])); } } @@ -202,11 +198,10 @@ } // create the algorithm constraints - ProtocolVersion protocolVersion = - ProtocolVersion.valueOf(session.getProtocol()); boolean isExtSession = (session instanceof ExtendedSSLSession); - AlgorithmConstraints constraints = null; - if (protocolVersion.v >= ProtocolVersion.TLS12.v && isExtSession) { + AlgorithmConstraints constraints; + if (isExtSession && + ProtocolVersion.useTLS12PlusSpec(session.getProtocol())) { ExtendedSSLSession extSession = (ExtendedSSLSession)session; String[] localSupportedSignAlgs = extSession.getLocalSupportedSignatureAlgorithms(); @@ -228,8 +223,8 @@ // check if EE certificate chains to a public root CA (as // pre-installed in cacerts) - boolean chainsToPublicCA = - AnchorCertificates.contains(trustedChain[trustedChain.length-1]); + boolean chainsToPublicCA = AnchorCertificates.contains( + trustedChain[trustedChain.length-1]); // check endpoint identity String identityAlg = sslSocket.getSSLParameters(). @@ -242,9 +237,10 @@ trustedChain = validate(v, chain, Collections.emptyList(), null, isClient ? null : authType); } - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println("Found trusted certificate:"); - System.out.println(trustedChain[trustedChain.length - 1]); + + if (SSLLogger.isOn && SSLLogger.isOn("ssl,trustmanager")) { + SSLLogger.fine("Found trusted certificate", + trustedChain[trustedChain.length - 1]); } } @@ -260,11 +256,10 @@ } // create the algorithm constraints - ProtocolVersion protocolVersion = - ProtocolVersion.valueOf(session.getProtocol()); boolean isExtSession = (session instanceof ExtendedSSLSession); - AlgorithmConstraints constraints = null; - if (protocolVersion.v >= ProtocolVersion.TLS12.v && isExtSession) { + AlgorithmConstraints constraints; + if (isExtSession && + ProtocolVersion.useTLS12PlusSpec(session.getProtocol())) { ExtendedSSLSession extSession = (ExtendedSSLSession)session; String[] localSupportedSignAlgs = extSession.getLocalSupportedSignatureAlgorithms(); @@ -286,8 +281,8 @@ // check if EE certificate chains to a public root CA (as // pre-installed in cacerts) - boolean chainsToPublicCA = - AnchorCertificates.contains(trustedChain[trustedChain.length-1]); + boolean chainsToPublicCA = AnchorCertificates.contains( + trustedChain[trustedChain.length-1]); // check endpoint identity String identityAlg = engine.getSSLParameters(). @@ -300,27 +295,10 @@ trustedChain = validate(v, chain, Collections.emptyList(), null, isClient ? null : authType); } - if (debug != null && Debug.isOn("trustmanager")) { - System.out.println("Found trusted certificate:"); - System.out.println(trustedChain[trustedChain.length - 1]); - } - } - private void showTrustedCerts() { - for (X509Certificate cert : trustedCerts) { - System.out.println("adding as trusted cert:"); - System.out.println(" Subject: " - + cert.getSubjectX500Principal()); - System.out.println(" Issuer: " - + cert.getIssuerX500Principal()); - System.out.println(" Algorithm: " - + cert.getPublicKey().getAlgorithm() - + "; Serial number: 0x" - + cert.getSerialNumber().toString(16)); - System.out.println(" Valid from " - + cert.getNotBefore() + " until " - + cert.getNotAfter()); - System.out.println(); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,trustmanager")) { + SSLLogger.fine("Found trusted certificate", + trustedChain[trustedChain.length - 1]); } } @@ -364,8 +342,8 @@ hostname = new SNIHostName(sniName.getEncoded()); } catch (IllegalArgumentException iae) { // unlikely to happen, just in case ... - if ((debug != null) && Debug.isOn("trustmanager")) { - System.out.println("Illegal server name: " + sniName); + if (SSLLogger.isOn && SSLLogger.isOn("ssl,trustmanager")) { + SSLLogger.fine("Illegal server name: " + sniName); } } } @@ -491,3 +469,4 @@ } } } + diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/util/AnchorCertificates.java openjdk-11-11~24/src/java.base/share/classes/sun/security/util/AnchorCertificates.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/util/AnchorCertificates.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/util/AnchorCertificates.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,6 +36,7 @@ import java.util.HashSet; import java.util.Set; +import jdk.internal.util.StaticProperty; import sun.security.x509.X509CertImpl; /** @@ -52,7 +53,7 @@ AccessController.doPrivileged(new PrivilegedAction<Void>() { @Override public Void run() { - File f = new File(System.getProperty("java.home"), + File f = new File(StaticProperty.javaHome(), "lib/security/cacerts"); KeyStore cacerts; try { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/util/DomainName.java openjdk-11-11~24/src/java.base/share/classes/sun/security/util/DomainName.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/util/DomainName.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/util/DomainName.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,637 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.util; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.IOException; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.zip.ZipEntry; +import java.util.zip.ZipInputStream; + +import sun.security.ssl.SSLLogger; + +/** + * Allows public suffixes and registered domains to be determined from a + * string that represents a target domain name. A database of known + * registered suffixes is used to perform the determination. + * + * A public suffix is defined as the rightmost part of a domain name + * that is not owned by an individual registrant. Examples of + * public suffixes are: + * com + * edu + * co.uk + * k12.ak.us + * com.tw + * \u7db2\u8def.tw + * + * Public suffixes effectively denote registration authorities. + * + * A registered domain is a public suffix preceded by one domain label + * and a ".". Examples are: + * oracle.com + * mit.edu + * + * The internal database is derived from the information maintained at + * http://publicsuffix.org. The information is fixed for a particular + * JDK installation, but may be updated in future releases or updates. + * + * Because of the large number of top-level domains (TLDs) and public + * suffix rules, we only load the rules on demand -- from a Zip file + * containing an entry for each TLD. + * + * As each entry is loaded, its data is stored permanently in a cache. + * + * The containment hierarchy for the data is shown below: + * + * Rules --> contains all the rules for a particular TLD + * RuleSet --> contains all the rules that match 1 label + * RuleSet --> contains all the rules that match 2 labels + * RuleSet --> contains all the rules that match 3 labels + * : + * RuleSet --> contains all the rules that match N labels + * HashSet of rules, where each rule is an exception rule, a "normal" + * rule, a wildcard rule (rules that contain a wildcard prefix only), + * or a LinkedList of "other" rules + * + * The general matching algorithm tries to find a longest match. So, the + * search begins at the RuleSet with the most labels, and works backwards. + * + * Exceptions take priority over all other rules, and if a Rule contains + * any exceptions, then even if we find a "normal" match, we search all + * other RuleSets for exceptions. It is assumed that all other rules don't + * intersect/overlap. If this happens, a match will be returned, but not + * necessarily the expected one. For a further explanation of the rules, + * see http://publicsuffix.org/list/. + * + * The "other" rules are for the (possible future) case where wildcards + * are located in a rule any place other than the beginning. + */ + +class DomainName { + /** + * For efficiency, the set of rules for each TLD is kept + * in text files and only loaded if needed. + */ + private static final Map<String, Rules> cache = new ConcurrentHashMap<>(); + + private DomainName() {} + + /** + * Returns the registered domain of the specified domain. + * + * @param domain the domain name + * @return the registered domain, or null if not known or not registerable + * @throws NullPointerException if domain is null + */ + public static RegisteredDomain registeredDomain(String domain) { + Match match = getMatch(domain); + return (match != null) ? match.registeredDomain() : null; + } + + private static Match getMatch(String domain) { + if (domain == null) { + throw new NullPointerException(); + } + Rules rules = Rules.getRules(domain); + return rules == null ? null : rules.match(domain); + } + + /** + * A Rules object contains a list of rules for a particular TLD. + * + * Rules are stored in a linked list of RuleSet objects. The list is + * indexed according to the number of labels in the name (minus one) + * such that all rules with the same number of labels are stored + * in the same RuleSet. + * + * Doing this means we can find the longest match first, and also we + * can stop comparing as soon as we find a match. + */ + private static class Rules { + + private final LinkedList<RuleSet> ruleSets = new LinkedList<>(); + private final boolean hasExceptions; + + private Rules(InputStream is) throws IOException { + InputStreamReader isr = new InputStreamReader(is, "UTF-8"); + BufferedReader reader = new BufferedReader(isr); + boolean hasExceptions = false; + + String line; + int type = reader.read(); + while (type != -1 && (line = reader.readLine()) != null) { + int numLabels = RuleSet.numLabels(line); + if (numLabels != 0) { + RuleSet ruleset = getRuleSet(numLabels - 1); + ruleset.addRule(type, line); + hasExceptions |= ruleset.hasExceptions; + } + type = reader.read(); + } + this.hasExceptions = hasExceptions; + } + + static Rules getRules(String domain) { + String tld = getTopLevelDomain(domain); + if (tld.isEmpty()) { + return null; + } + return cache.computeIfAbsent(tld, k -> createRules(tld)); + } + + private static String getTopLevelDomain(String domain) { + int n = domain.lastIndexOf('.'); + if (n == -1) { + return domain; + } + return domain.substring(n + 1); + } + + private static Rules createRules(String tld) { + try (InputStream pubSuffixStream = getPubSuffixStream()) { + if (pubSuffixStream == null) { + return null; + } + return getRules(tld, new ZipInputStream(pubSuffixStream)); + } catch (IOException e) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine( + "cannot parse public suffix data for " + tld + + ": " + e.getMessage()); + } + return null; + } + } + + private static InputStream getPubSuffixStream() { + InputStream is = AccessController.doPrivileged( + new PrivilegedAction<>() { + @Override + public InputStream run() { + File f = new File(System.getProperty("java.home"), + "lib/security/public_suffix_list.dat"); + try { + return new FileInputStream(f); + } catch (FileNotFoundException e) { + return null; + } + } + } + ); + if (is == null) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl") && + SSLLogger.isOn("trustmanager")) { + SSLLogger.fine( + "lib/security/public_suffix_list.dat not found"); + } + } + return is; + } + + private static Rules getRules(String tld, + ZipInputStream zis) throws IOException { + boolean found = false; + ZipEntry ze = zis.getNextEntry(); + while (ze != null && !found) { + if (ze.getName().equals(tld)) { + found = true; + } else { + ze = zis.getNextEntry(); + } + } + if (!found) { + if (SSLLogger.isOn && SSLLogger.isOn("ssl")) { + SSLLogger.fine("Domain " + tld + " not found"); + } + return null; + } + return new Rules(zis); + } + + /** + * Return the requested RuleSet. If it hasn't been created yet, + * create it and any RuleSets leading up to it. + */ + private RuleSet getRuleSet(int index) { + if (index < ruleSets.size()) { + return ruleSets.get(index); + } + RuleSet r = null; + for (int i = ruleSets.size(); i <= index; i++) { + r = new RuleSet(i + 1); + ruleSets.add(r); + } + return r; + } + + /** + * Find a match for the target string. + */ + Match match(String domain) { + // Start at the end of the rules list, looking for longest match. + // After we find a normal match, we only look for exceptions. + Match possibleMatch = null; + + Iterator<RuleSet> it = ruleSets.descendingIterator(); + while (it.hasNext()) { + RuleSet ruleSet = it.next(); + Match match = ruleSet.match(domain); + if (match != null) { + if (match.type() == Rule.Type.EXCEPTION || !hasExceptions) { + return match; + } + if (possibleMatch == null) { + possibleMatch = match; + } + } + } + return possibleMatch; + } + + /** + * Represents a set of rules with the same number of labels + * and for a particular TLD. + * + * Examples: + * numLabels = 2 + * names: co.uk, ac.uk + * wildcards *.de (only "de" stored in HashSet) + * exceptions: !foo.de (stored as "foo.de") + */ + private static class RuleSet { + // the number of labels in this ruleset + private final int numLabels; + private final Set<Rule> rules = new HashSet<>(); + boolean hasExceptions = false; + private static final RegisteredDomain.Type[] AUTHS = + RegisteredDomain.Type.values(); + + RuleSet(int n) { + numLabels = n; + } + + void addRule(int auth, String rule) { + if (rule.startsWith("!")) { + rules.add(new Rule(rule.substring(1), Rule.Type.EXCEPTION, + AUTHS[auth])); + hasExceptions = true; + } else if (rule.startsWith("*.") && + rule.lastIndexOf('*') == 0) { + rules.add(new Rule(rule.substring(2), Rule.Type.WILDCARD, + AUTHS[auth])); + } else if (rule.indexOf('*') == -1) { + // a "normal" label + rules.add(new Rule(rule, Rule.Type.NORMAL, AUTHS[auth])); + } else { + // There is a wildcard in a non-leading label. This case + // doesn't currently exist, but we need to handle it anyway. + rules.add(new OtherRule(rule, AUTHS[auth], split(rule))); + } + } + + Match match(String domain) { + Match match = null; + for (Rule rule : rules) { + switch (rule.type) { + case NORMAL: + if (match == null) { + match = matchNormal(domain, rule); + } + break; + case WILDCARD: + if (match == null) { + match = matchWildcard(domain, rule); + } + break; + case OTHER: + if (match == null) { + match = matchOther(domain, rule); + } + break; + case EXCEPTION: + Match excMatch = matchException(domain, rule); + if (excMatch != null) { + return excMatch; + } + break; + } + } + return match; + } + + private static LinkedList<String> split(String rule) { + String[] labels = rule.split("\\."); + return new LinkedList<>(Arrays.asList(labels)); + } + + private static int numLabels(String rule) { + if (rule.equals("")) { + return 0; + } + int len = rule.length(); + int count = 0; + int index = 0; + while (index < len) { + int pos; + if ((pos = rule.indexOf('.', index)) == -1) { + return count + 1; + } + index = pos + 1; + count++; + } + return count; + } + + /** + * Check for a match with an explicit name rule or a wildcard rule + * (i.e., a non-exception rule). + */ + private Match matchNormal(String domain, Rule rule) { + int index = labels(domain, numLabels); + if (index == -1) { + return null; + } + + // Check for explicit names. + String substring = domain.substring(index); + if (rule.domain.equals(substring)) { + return new CommonMatch(domain, rule, index); + } + + return null; + } + + private Match matchWildcard(String domain, Rule rule) { + // Now check for wildcards. In this case, there is one fewer + // label than numLabels. + int index = labels(domain, numLabels - 1); + if (index > 0) { + String substring = domain.substring(index); + + if (rule.domain.equals(substring)) { + return new CommonMatch(domain, rule, + labels(domain, numLabels)); + } + } + + return null; + } + + /** + * Check for a match with an exception rule. + */ + private Match matchException(String domain, Rule rule) { + int index = labels(domain, numLabels); + if (index == -1) { + return null; + } + String substring = domain.substring(index); + + if (rule.domain.equals(substring)) { + return new CommonMatch(domain, rule, + labels(domain, numLabels - 1)); + } + + return null; + } + + /** + * A left-to-right comparison of labels. + * The simplest approach to doing match() would be to + * use a descending iterator giving a right-to-left comparison. + * But, it's more efficient to do left-to-right compares + * because the left most labels are the ones most likely to be + * different. We just have to figure out which label to start at. + */ + private Match matchOther(String domain, Rule rule) { + OtherRule otherRule = (OtherRule)rule; + LinkedList<String> target = split(domain); + + int diff = target.size() - numLabels; + if (diff < 0) { + return null; + } + + boolean found = true; + for (int i = 0; i < numLabels; i++) { + String ruleLabel = otherRule.labels.get(i); + String targetLabel = target.get(i + diff); + + if (ruleLabel.charAt(0) != '*' && + !ruleLabel.equalsIgnoreCase(targetLabel)) { + found = false; + break; + } + } + if (found) { + return new OtherMatch(rule, numLabels, target); + } + return null; + } + + /** + * Returns a substring (index) with the n right-most labels from s. + * Returns -1 if s does not have at least n labels, 0, if the + * substring is s. + */ + private static int labels(String s, int n) { + if (n < 1) { + return -1; + } + int index = s.length(); + for (int i = 0; i < n; i++) { + int next = s.lastIndexOf('.', index); + if (next == -1) { + if (i == n - 1) { + return 0; + } else { + return -1; + } + } + index = next - 1; + } + return index + 2; + } + } + } + + private static class Rule { + enum Type { EXCEPTION, NORMAL, OTHER, WILDCARD } + + String domain; + Type type; + RegisteredDomain.Type auth; + Rule(String domain, Type type, RegisteredDomain.Type auth) { + this.domain = domain; + this.type = type; + this.auth = auth; + } + } + + private static class OtherRule extends Rule { + List<String> labels; + OtherRule(String domain, RegisteredDomain.Type auth, + List<String> labels) { + super(domain, Type.OTHER, auth); + this.labels = labels; + } + } + + /** + * Represents a string's match with a rule in the public suffix list. + */ + private interface Match { + RegisteredDomain registeredDomain(); + Rule.Type type(); + } + + private static class RegisteredDomainImpl implements RegisteredDomain { + private final String name; + private final Type type; + private final String publicSuffix; + RegisteredDomainImpl(String name, Type type, String publicSuffix) { + this.name = name; + this.type = type; + this.publicSuffix = publicSuffix; + } + @Override + public String name() { + return name; + } + @Override + public Type type() { + return type; + } + @Override + public String publicSuffix() { + return publicSuffix; + } + } + + /** + * Represents a match against a standard rule in the public suffix list. + * A standard rule is an explicit name, a wildcard rule with a wildcard + * only in the leading label, or an exception rule. + */ + private static class CommonMatch implements Match { + private String domain; + private int publicSuffix; // index to + private int registeredDomain; // index to + private final Rule rule; + + CommonMatch(String domain, Rule rule, int publicSuffix) { + this.domain = domain; + this.publicSuffix = publicSuffix; + this.rule = rule; + // now locate the previous label + registeredDomain = domain.lastIndexOf('.', publicSuffix - 2); + if (registeredDomain == -1) { + registeredDomain = 0; + } else { + registeredDomain++; + } + } + + @Override + public RegisteredDomain registeredDomain() { + if (publicSuffix == 0) { + return null; + } + return new RegisteredDomainImpl(domain.substring(registeredDomain), + rule.auth, + domain.substring(publicSuffix)); + } + + @Override + public Rule.Type type() { + return rule.type; + } + } + + /** + * Represents a non-match with {@code NO_MATCH} or a match against + * a non-standard rule in the public suffix list. A non-standard rule + * is a wildcard rule that includes wildcards in a label other than + * the leading label. The public suffix list doesn't currently have + * such rules. + */ + private static class OtherMatch implements Match { + private final Rule rule; + private final int numLabels; + private final LinkedList<String> target; + + OtherMatch(Rule rule, int numLabels, LinkedList<String> target) { + this.rule = rule; + this.numLabels = numLabels; + this.target = target; + } + + @Override + public RegisteredDomain registeredDomain() { + int nlabels = numLabels + 1; + if (nlabels > target.size()) { + // special case when registered domain is same as pub suff + return null; + } + return new RegisteredDomainImpl(getSuffixes(nlabels), + rule.auth, getSuffixes(numLabels)); + } + + @Override + public Rule.Type type() { + return rule.type; + } + + private String getSuffixes(int n) { + Iterator<String> targetIter = target.descendingIterator(); + StringBuilder sb = new StringBuilder(); + while (n > 0 && targetIter.hasNext()) { + String s = targetIter.next(); + sb.insert(0, s); + if (n > 1) { + sb.insert(0, '.'); + } + n--; + } + return sb.toString(); + } + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/util/HostnameChecker.java openjdk-11-11~24/src/java.base/share/classes/sun/security/util/HostnameChecker.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/util/HostnameChecker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/util/HostnameChecker.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,7 @@ package sun.security.util; import java.io.IOException; +import java.net.IDN; import java.net.InetAddress; import java.net.UnknownHostException; import java.security.Principal; @@ -35,9 +36,8 @@ import javax.net.ssl.SNIHostName; import sun.net.util.IPAddressUtil; -import sun.security.ssl.ClientKeyExchangeService; -import sun.security.ssl.Debug; import sun.security.x509.X500Name; +import sun.security.ssl.SSLLogger; /** * Class to check hostnames against the names specified in a certificate as @@ -60,8 +60,6 @@ private static final int ALTNAME_DNS = 2; private static final int ALTNAME_IP = 7; - private static final Debug debug = Debug.getInstance("ssl"); - // the algorithm to follow to perform the check. Currently unused. private final byte checkType; @@ -107,26 +105,6 @@ } /** - * Perform the check for Kerberos. - */ - public static boolean match(String expectedName, Principal principal) { - String hostName = getServerName(principal); - return (expectedName.equalsIgnoreCase(hostName)); - } - - /** - * Return the Server name from Kerberos principal. - */ - public static String getServerName(Principal principal) { - ClientKeyExchangeService p = - ClientKeyExchangeService.find("KRB5"); - if (p == null) { - throw new AssertionError("Kerberos should have been available"); - } - return p.getServiceHostName(principal); - } - - /** * Test whether the given hostname looks like a literal IPv4 or IPv6 * address. The hostname does not need to be a fully qualified name. * @@ -284,6 +262,11 @@ */ private boolean isMatched(String name, String template, boolean chainsToPublicCA) { + + // Normalize to Unicode, because PSL is in Unicode. + name = IDN.toUnicode(IDN.toASCII(name)); + template = IDN.toUnicode(IDN.toASCII(template)); + if (hasIllegalWildcard(name, template, chainsToPublicCA)) { return false; } @@ -294,7 +277,7 @@ // the domain name template validity. // // Using the checking implemented in SNIHostName - SNIHostName sni = new SNIHostName(template.replace('*', 'x')); + new SNIHostName(template.replace('*', 'x')); } catch (IllegalArgumentException iae) { // It would be nice to add debug log if not matching. return false; @@ -316,9 +299,10 @@ boolean chainsToPublicCA) { // not ok if it is a single wildcard character or "*." if (template.equals("*") || template.equals("*.")) { - if (debug != null) { - debug.println("Certificate domain name has illegal single " + - "wildcard character: " + template); + if (SSLLogger.isOn) { + SSLLogger.fine( + "Certificate domain name has illegal single " + + "wildcard character: " + template); } return true; } @@ -335,9 +319,10 @@ // not ok if there is no dot after wildcard (ex: "*com") if (firstDotIndex == -1) { - if (debug != null) { - debug.println("Certificate domain name has illegal wildcard, " + - "no dot after wildcard character: " + template); + if (SSLLogger.isOn) { + SSLLogger.fine( + "Certificate domain name has illegal wildcard, " + + "no dot after wildcard character: " + template); } return true; } @@ -354,9 +339,10 @@ if (rd.isPresent()) { String wDomain = afterWildcard.substring(firstDotIndex + 1); if (rd.get().publicSuffix().equalsIgnoreCase(wDomain)) { - if (debug != null) { - debug.println("Certificate domain name has illegal " + - "wildcard for public suffix: " + template); + if (SSLLogger.isOn) { + SSLLogger.fine( + "Certificate domain name has illegal " + + "wildcard for public suffix: " + template); } return true; } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial1305.java openjdk-11-11~24/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial1305.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial1305.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial1305.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,13 +33,6 @@ /** * An IntegerFieldModuloP designed for use with the Poly1305 authenticator. * The representation uses 5 signed long values. - * - * In addition to the branch-free operations specified in the parent class, - * the following operations are branch-free: - * - * addModPowerTwo - * asByteArray - * */ public class IntegerPolynomial1305 extends IntegerPolynomial { @@ -51,17 +44,8 @@ private static final BigInteger MODULUS = TWO.pow(POWER).subtract(BigInteger.valueOf(SUBTRAHEND)); - private final long[] posModLimbs; - - private long[] setPosModLimbs() { - long[] result = new long[NUM_LIMBS]; - setLimbsValuePositive(MODULUS, result); - return result; - } - public IntegerPolynomial1305() { super(BITS_PER_LIMB, NUM_LIMBS, MODULUS); - posModLimbs = setPosModLimbs(); } protected void mult(long[] a, long[] b, long[] r) { @@ -181,12 +165,19 @@ } } - protected void modReduceIn(long[] limbs, int index, long x) { + private void modReduceIn(long[] limbs, int index, long x) { // this only works when BITS_PER_LIMB * NUM_LIMBS = POWER exactly long reducedValue = (x * SUBTRAHEND); limbs[index - NUM_LIMBS] += reducedValue; } + @Override + protected void finalCarryReduceLast(long[] limbs) { + long carry = limbs[numLimbs - 1] >> bitsPerLimb; + limbs[numLimbs - 1] -= carry << bitsPerLimb; + modReduceIn(limbs, numLimbs, carry); + } + protected final void modReduce(long[] limbs, int start, int end) { for (int i = start; i < end; i++) { @@ -220,82 +211,5 @@ carry(limbs); } - // Convert reduced limbs into a number between 0 and MODULUS-1 - private void finalReduce(long[] limbs) { - - addLimbs(limbs, posModLimbs, limbs); - // now all values are positive, so remaining operations will be unsigned - - // unsigned carry out of last position and reduce in to first position - long carry = limbs[NUM_LIMBS - 1] >> BITS_PER_LIMB; - limbs[NUM_LIMBS - 1] -= carry << BITS_PER_LIMB; - modReduceIn(limbs, NUM_LIMBS, carry); - - // unsigned carry on all positions - carry = 0; - for (int i = 0; i < NUM_LIMBS; i++) { - limbs[i] += carry; - carry = limbs[i] >> BITS_PER_LIMB; - limbs[i] -= carry << BITS_PER_LIMB; - } - // reduce final carry value back in - modReduceIn(limbs, NUM_LIMBS, carry); - // we only reduce back in a nonzero value if some value was carried out - // of the previous loop. So at least one remaining value is small. - - // One more carry is all that is necessary. Nothing will be carried out - // at the end - carry = 0; - for (int i = 0; i < NUM_LIMBS; i++) { - limbs[i] += carry; - carry = limbs[i] >> BITS_PER_LIMB; - limbs[i] -= carry << BITS_PER_LIMB; - } - - // limbs are positive and all less than 2^BITS_PER_LIMB - // but the value may be greater than the MODULUS. - // Subtract the max limb values only if all limbs end up non-negative - int smallerNonNegative = 1; - long[] smaller = new long[NUM_LIMBS]; - for (int i = NUM_LIMBS - 1; i >= 0; i--) { - smaller[i] = limbs[i] - posModLimbs[i]; - // expression on right is 1 if smaller[i] is nonnegative, - // 0 otherwise - smallerNonNegative *= (int) (smaller[i] >> 63) + 1; - } - conditionalSwap(smallerNonNegative, limbs, smaller); - - } - - @Override - protected void limbsToByteArray(long[] limbs, byte[] result) { - - long[] reducedLimbs = limbs.clone(); - finalReduce(reducedLimbs); - - decode(reducedLimbs, result, 0, result.length); - } - - @Override - protected void addLimbsModPowerTwo(long[] limbs, long[] other, - byte[] result) { - - long[] reducedOther = other.clone(); - long[] reducedLimbs = limbs.clone(); - finalReduce(reducedLimbs); - - addLimbs(reducedLimbs, reducedOther, reducedLimbs); - - // may carry out a value which can be ignored - long carry = 0; - for (int i = 0; i < NUM_LIMBS; i++) { - reducedLimbs[i] += carry; - carry = reducedLimbs[i] >> BITS_PER_LIMB; - reducedLimbs[i] -= carry << BITS_PER_LIMB; - } - - decode(reducedLimbs, result, 0, result.length); - } - } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial25519.java openjdk-11-11~24/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial25519.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial25519.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial25519.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,6 +27,11 @@ import java.math.BigInteger; +/** + * An IntegerFieldModuloP designed for use with the Curve25519. + * The representation uses 10 signed long values. + */ + public class IntegerPolynomial25519 extends IntegerPolynomial { private static final int POWER = 255; @@ -47,6 +52,14 @@ } @Override + protected void finalCarryReduceLast(long[] limbs) { + + long reducedValue = limbs[numLimbs - 1] >> RIGHT_BIT_OFFSET; + limbs[numLimbs - 1] -= reducedValue << RIGHT_BIT_OFFSET; + limbs[0] += reducedValue * SUBTRAHEND; + } + + @Override protected void mult(long[] a, long[] b, long[] r) { // Use grade-school multiplication into primitives to avoid the diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial448.java openjdk-11-11~24/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial448.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial448.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial448.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,6 +27,11 @@ import java.math.BigInteger; +/** + * An IntegerFieldModuloP designed for use with the Curve448. + * The representation uses 16 signed long values. + */ + public class IntegerPolynomial448 extends IntegerPolynomial { private static final int POWER = 448; @@ -40,6 +45,18 @@ super(BITS_PER_LIMB, NUM_LIMBS, MODULUS); } + private void modReduceIn(long[] limbs, int index, long x) { + limbs[index - NUM_LIMBS] += x; + limbs[index - NUM_LIMBS / 2] += x; + } + + @Override + protected void finalCarryReduceLast(long[] limbs) { + long carry = limbs[numLimbs - 1] >> bitsPerLimb; + limbs[numLimbs - 1] -= carry << bitsPerLimb; + modReduceIn(limbs, numLimbs, carry); + } + @Override protected void mult(long[] a, long[] b, long[] r) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial.java openjdk-11-11~24/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial.java 2018-07-25 15:36:46.000000000 +0000 @@ -54,6 +54,8 @@ * setDifference * setProduct * setSquare + * addModPowerTwo + * asByteArray * * All other operations may branch in some subclasses. * @@ -66,6 +68,7 @@ protected final int numLimbs; private final BigInteger modulus; protected final int bitsPerLimb; + private final long[] posModLimbs; // must work when a==r protected abstract void multByInt(long[] a, long b, long[] r); @@ -84,6 +87,14 @@ this.numLimbs = numLimbs; this.modulus = modulus; this.bitsPerLimb = bitsPerLimb; + + posModLimbs = setPosModLimbs(); + } + + private long[] setPosModLimbs() { + long[] result = new long[numLimbs]; + setLimbsValuePositive(modulus, result); + return result; } protected int getNumLimbs() { @@ -250,6 +261,58 @@ } } + protected abstract void finalCarryReduceLast(long[] limbs); + + // Convert reduced limbs into a number between 0 and MODULUS-1 + protected void finalReduce(long[] limbs) { + + // This method works by doing several full carry/reduce operations. + // Some representations have extra high bits, so the carry/reduce out + // of the high position is implementation-specific. The "unsigned" + // carry operation always carries some (negative) value out of a + // position occupied by a negative value. So after a number of + // passes, all negative values are removed. + + // The first pass may leave a negative value in the high position, but + // this only happens if something was carried out of the previous + // position. So the previous position must have a "small" value. The + // next full carry is guaranteed not to carry out of that position. + + for (int pass = 0; pass < 2; pass++) { + // unsigned carry out of last position and reduce in to + // first position + finalCarryReduceLast(limbs); + + // unsigned carry on all positions + long carry = 0; + for (int i = 0; i < numLimbs - 1; i++) { + limbs[i] += carry; + carry = limbs[i] >> bitsPerLimb; + limbs[i] -= carry << bitsPerLimb; + } + limbs[numLimbs - 1] += carry; + } + + // Limbs are positive and all less than 2^bitsPerLimb, and the + // high-order limb may be even smaller due to the representation- + // specific carry/reduce out of the high position. + // The value may still be greater than the modulus. + // Subtract the max limb values only if all limbs end up non-negative + // This only works if there is at most one position where posModLimbs + // is less than 2^bitsPerLimb - 1 (not counting the high-order limb, + // if it has extra bits that are cleared by finalCarryReduceLast). + int smallerNonNegative = 1; + long[] smaller = new long[numLimbs]; + for (int i = numLimbs - 1; i >= 0; i--) { + smaller[i] = limbs[i] - posModLimbs[i]; + // expression on right is 1 if smaller[i] is nonnegative, + // 0 otherwise + smallerNonNegative *= (int) (smaller[i] >> 63) + 1; + } + conditionalSwap(smallerNonNegative, limbs, smaller); + + } + // v must be final reduced. I.e. all limbs in [0, bitsPerLimb) // and value in [0, modulus) protected void decode(long[] v, byte[] dst, int offset, int length) { @@ -262,7 +325,10 @@ int dstIndex = i + offset; if (bitPos + 8 >= bitsPerLimb) { dst[dstIndex] = (byte) curLimbValue; - curLimbValue = v[nextLimbIndex++]; + curLimbValue = 0; + if (nextLimbIndex < v.length) { + curLimbValue = v[nextLimbIndex++]; + } int bitsAdded = bitsPerLimb - bitPos; int bitsLeft = 8 - bitsAdded; @@ -293,33 +359,33 @@ } } - private void bigIntToByteArray(BigInteger bi, byte[] result) { - byte[] biBytes = bi.toByteArray(); - // biBytes is backwards and possibly too big - // Copy the low-order bytes into result in reverse - int sourceIndex = biBytes.length - 1; - for (int i = 0; i < result.length; i++) { - if (sourceIndex >= 0) { - result[i] = biBytes[sourceIndex--]; - } - else { - result[i] = 0; - } - } - } - protected void limbsToByteArray(long[] limbs, byte[] result) { - bigIntToByteArray(evaluate(limbs), result); + long[] reducedLimbs = limbs.clone(); + finalReduce(reducedLimbs); + + decode(reducedLimbs, result, 0, result.length); } protected void addLimbsModPowerTwo(long[] limbs, long[] other, byte[] result) { - BigInteger bi1 = evaluate(limbs); - BigInteger bi2 = evaluate(other); - BigInteger biResult = bi1.add(bi2); - bigIntToByteArray(biResult, result); + long[] reducedOther = other.clone(); + long[] reducedLimbs = limbs.clone(); + finalReduce(reducedOther); + finalReduce(reducedLimbs); + + addLimbs(reducedLimbs, reducedOther, reducedLimbs); + + // may carry out a value which can be ignored + long carry = 0; + for (int i = 0; i < numLimbs; i++) { + reducedLimbs[i] += carry; + carry = reducedLimbs[i] >> bitsPerLimb; + reducedLimbs[i] -= carry << bitsPerLimb; + } + + decode(reducedLimbs, result, 0, result.length); } private abstract class Element implements IntegerModuloP { @@ -418,11 +484,11 @@ } public void addModPowerTwo(IntegerModuloP arg, byte[] result) { - if (!summand) { - throw new ArithmeticException("Not a valid summand"); - } Element other = (Element) arg; + if (!(summand && other.summand)) { + throw new ArithmeticException("Not a valid summand"); + } addLimbsModPowerTwo(limbs, other.limbs, result); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/util/RegisteredDomain.java openjdk-11-11~24/src/java.base/share/classes/sun/security/util/RegisteredDomain.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/util/RegisteredDomain.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/util/RegisteredDomain.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,20 +74,12 @@ * Returns an {@code Optional<RegisteredDomain>} representing the * registered part of the specified domain. * - * {@implNote} - * The default implementation is based on the legacy - * {@code sun.net.RegisteredDomain} class which is no longer maintained. - * It should be updated or replaced with an appropriate implementation. - * * @param domain the domain name * @return an {@code Optional<RegisteredDomain>}; the {@code Optional} is * empty if the domain is unknown or not registerable * @throws NullPointerException if domain is null */ public static Optional<RegisteredDomain> from(String domain) { - if (domain == null) { - throw new NullPointerException(); - } - return Optional.ofNullable(sun.net.RegisteredDomain.registeredDomain(domain)); + return Optional.ofNullable(DomainName.registeredDomain(domain)); } } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/util/UntrustedCertificates.java openjdk-11-11~24/src/java.base/share/classes/sun/security/util/UntrustedCertificates.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/util/UntrustedCertificates.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/util/UntrustedCertificates.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,12 +26,12 @@ import java.io.*; import java.security.AccessController; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; import java.security.PrivilegedAction; import java.security.cert.X509Certificate; import java.security.cert.CertificateException; import java.util.*; + +import jdk.internal.util.StaticProperty; import sun.security.x509.X509CertImpl; /** @@ -54,7 +54,7 @@ AccessController.doPrivileged(new PrivilegedAction<Void>() { @Override public Void run() { - File f = new File(System.getProperty("java.home"), + File f = new File(StaticProperty.javaHome(), "lib/security/blacklisted.certs"); try (FileInputStream fin = new FileInputStream(f)) { props.load(fin); diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/security/x509/AlgorithmId.java openjdk-11-11~24/src/java.base/share/classes/sun/security/x509/AlgorithmId.java --- openjdk-11-11~19/src/java.base/share/classes/sun/security/x509/AlgorithmId.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/security/x509/AlgorithmId.java 2018-07-25 15:36:46.000000000 +0000 @@ -1039,7 +1039,7 @@ * @return the default alg, might be null if unsupported */ public static String getDefaultSigAlgForKey(PrivateKey k) { - switch (k.getAlgorithm().toUpperCase(Locale.ROOT)) { + switch (k.getAlgorithm().toUpperCase(Locale.ENGLISH)) { case "EC": return ecStrength(KeyUtil.getKeySize(k)) + "withECDSA"; diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java openjdk-11-11~24/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java --- openjdk-11-11~19/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/util/calendar/ZoneInfoFile.java 2018-07-25 15:36:46.000000000 +0000 @@ -45,12 +45,11 @@ import java.util.List; import java.util.Locale; import java.util.Map; -import java.util.Map.Entry; -import java.util.Objects; -import java.util.Set; import java.util.SimpleTimeZone; import java.util.concurrent.ConcurrentHashMap; import java.util.zip.CRC32; + +import jdk.internal.util.StaticProperty; import sun.security.action.GetPropertyAction; /** @@ -252,7 +251,7 @@ AccessController.doPrivileged(new PrivilegedAction<Void>() { public Void run() { try { - String libDir = System.getProperty("java.home") + File.separator + "lib"; + String libDir = StaticProperty.javaHome() + File.separator + "lib"; try (DataInputStream dis = new DataInputStream( new BufferedInputStream(new FileInputStream( new File(libDir, "tzdb.dat"))))) { diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/util/cldr/CLDRCalendarNameProviderImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/util/cldr/CLDRCalendarNameProviderImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/util/cldr/CLDRCalendarNameProviderImpl.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/util/cldr/CLDRCalendarNameProviderImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.util.cldr; + +import static sun.util.locale.provider.LocaleProviderAdapter.Type; + +import java.util.Locale; +import java.util.Set; +import sun.util.locale.provider.AvailableLanguageTags; +import sun.util.locale.provider.CalendarNameProviderImpl; +import sun.util.locale.provider.LocaleProviderAdapter; + + +public class CLDRCalendarNameProviderImpl extends CalendarNameProviderImpl implements AvailableLanguageTags{ + + public CLDRCalendarNameProviderImpl(Type type, Set<String> langtags) { + super(type, langtags); + } + + @Override + public boolean isSupportedLocale(Locale locale) { + if (Locale.ROOT.equals(locale)) { + return true; + } + String calendarType = null; + if (locale.hasExtensions()) { + calendarType = locale.getUnicodeLocaleType("ca"); + locale = locale.stripExtensions(); + } + if (calendarType != null) { + switch (calendarType) { + case "buddhist": + case "japanese": + case "gregory": + case "islamic": + case "roc": + break; + default: + // Unknown calendar type + return false; + } + } + return LocaleProviderAdapter.forType(Type.CLDR).isSupportedProviderLocale(locale, langtags); + } +} diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java openjdk-11-11~24/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java --- openjdk-11-11~19/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/util/cldr/CLDRLocaleProviderAdapter.java 2018-07-25 15:36:46.000000000 +0000 @@ -45,6 +45,7 @@ import java.util.StringTokenizer; import java.util.concurrent.ConcurrentHashMap; import java.util.spi.CalendarDataProvider; +import java.util.spi.CalendarNameProvider; import java.util.spi.TimeZoneNameProvider; import sun.util.locale.provider.JRELocaleProviderAdapter; import sun.util.locale.provider.LocaleDataMetaInfo; @@ -133,6 +134,24 @@ } @Override + public CalendarNameProvider getCalendarNameProvider() { + if (calendarNameProvider == null) { + CalendarNameProvider provider = AccessController.doPrivileged( + (PrivilegedAction<CalendarNameProvider>) () + -> new CLDRCalendarNameProviderImpl( + getAdapterType(), + getLanguageTagSet("FormatData"))); + + synchronized (this) { + if (calendarNameProvider == null) { + calendarNameProvider = provider; + } + } + } + return calendarNameProvider; + } + + @Override public CollatorProvider getCollatorProvider() { return null; } @@ -166,7 +185,7 @@ return locs; } - private Locale applyAliases(Locale loc) { + private static Locale applyAliases(Locale loc) { if (langAliasesMap.isEmpty()) { langAliasesMap = baseMetaInfo.getLanguageAliasMap(); } @@ -264,19 +283,18 @@ } /** - * This method returns equivalent CLDR supported locale for zh-HK, - * no, no-NO locales so that COMPAT locales do not precede - * those locales during ResourceBundle search path. + * This method returns equivalent CLDR supported locale + * for no, no-NO locales so that COMPAT locales do not precede + * those locales during ResourceBundle search path, also if an alias exists for a locale, + * it returns equivalent locale, e.g for zh_HK it returns zh_Hant-HK. */ private static Locale getEquivalentLoc(Locale locale) { switch (locale.toString()) { - case "zh_HK": - return Locale.forLanguageTag("zh-Hant-HK"); case "no": case "no_NO": return Locale.forLanguageTag("nb"); } - return locale; + return applyAliases(locale); } @Override diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/util/cldr/CLDRTimeZoneNameProviderImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -130,7 +130,8 @@ // Fill in for the empty names. // English names are prefilled for performance. - if (locale.getLanguage() != "en") { + if (!locale.equals(Locale.ENGLISH) && + !locale.equals(Locale.US)) { for (int zoneIndex = 0; zoneIndex < ret.length; zoneIndex++) { deriveFallbackNames(ret[zoneIndex], locale); } diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java openjdk-11-11~24/src/java.base/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java --- openjdk-11-11~19/src/java.base/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/util/locale/provider/CalendarNameProviderImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,8 +42,8 @@ * @author Naoto Sato */ public class CalendarNameProviderImpl extends CalendarNameProvider implements AvailableLanguageTags { - private final LocaleProviderAdapter.Type type; - private final Set<String> langtags; + protected final LocaleProviderAdapter.Type type; + protected final Set<String> langtags; public CalendarNameProviderImpl(LocaleProviderAdapter.Type type, Set<String> langtags) { this.type = type; @@ -248,11 +248,8 @@ if (langtags.contains(locale.toLanguageTag())) { return true; } - if (type == LocaleProviderAdapter.Type.JRE) { - String oldname = locale.toString().replace('_', '-'); - return langtags.contains(oldname); - } - return false; + String oldname = locale.toString().replace('_', '-'); + return langtags.contains(oldname); } @Override diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java openjdk-11-11~24/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java --- openjdk-11-11~19/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/util/locale/provider/JRELocaleProviderAdapter.java 2018-07-25 15:36:46.000000000 +0000 @@ -131,7 +131,7 @@ private volatile LocaleNameProvider localeNameProvider; protected volatile TimeZoneNameProvider timeZoneNameProvider; protected volatile CalendarDataProvider calendarDataProvider; - private volatile CalendarNameProvider calendarNameProvider; + protected volatile CalendarNameProvider calendarNameProvider; private volatile CalendarProvider calendarProvider; private volatile JavaTimeDateTimePatternProvider javaTimeDateTimePatternProvider; diff -Nru openjdk-11-11~19/src/java.base/share/classes/sun/util/resources/BreakIteratorResourceBundle.java openjdk-11-11~24/src/java.base/share/classes/sun/util/resources/BreakIteratorResourceBundle.java --- openjdk-11-11~19/src/java.base/share/classes/sun/util/resources/BreakIteratorResourceBundle.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/classes/sun/util/resources/BreakIteratorResourceBundle.java 2018-07-25 15:36:46.000000000 +0000 @@ -69,7 +69,7 @@ if (!info.containsKey(key)) { return null; } - String path = getClass().getPackage().getName().replace('.', '/') + String path = getClass().getPackageName().replace('.', '/') + '/' + info.getString(key); byte[] data; try (InputStream is = getResourceAsStream(path)) { diff -Nru openjdk-11-11~19/src/java.base/share/conf/security/java.security openjdk-11-11~24/src/java.base/share/conf/security/java.security --- openjdk-11-11~19/src/java.base/share/conf/security/java.security 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/conf/security/java.security 2018-07-25 15:36:46.000000000 +0000 @@ -800,6 +800,40 @@ # FFFFFFFF FFFFFFFF, 2} # +# TLS key limits on symmetric cryptographic algorithms +# +# This security property sets limits on algorithms key usage in TLS 1.3. +# When the amount of data encrypted exceeds the algorithm value listed below, +# a KeyUpdate message will trigger a key change. This is for symmetric ciphers +# with TLS 1.3 only. +# +# The syntax for the property is described below: +# KeyLimits: +# " KeyLimit { , KeyLimit } " +# +# WeakKeyLimit: +# AlgorithmName Action Length +# +# AlgorithmName: +# A full algorithm transformation. +# +# Action: +# KeyUpdate +# +# Length: +# The amount of encrypted data in a session before the Action occurs +# This value may be an integer value in bytes, or as a power of two, 2^29. +# +# KeyUpdate: +# The TLS 1.3 KeyUpdate handshake process begins when the Length amount +# is fulfilled. +# +# Note: This property is currently used by OpenJDK's JSSE implementation. It +# is not guaranteed to be examined and used by other implementations. +# +jdk.tls.keyLimits=AES/GCM/NoPadding KeyUpdate 2^37 + +# # Cryptographic Jurisdiction Policy defaults # # Import and export control rules on cryptographic software vary from @@ -993,10 +1027,10 @@ # # An IOR type check filter, if configured, is used by an ORB during # an ORB::string_to_object invocation to check the veracity of the type encoded -# in the ior string. +# in the ior string. # # The filter pattern consists of a semi-colon separated list of class names. -# The configured list contains the binary class names of the IDL interface types +# The configured list contains the binary class names of the IDL interface types # corresponding to the IDL stub class to be instantiated. # As such, a filter specifies a list of IDL stub classes that will be # allowed by an ORB when an ORB::string_to_object is invoked. @@ -1025,3 +1059,24 @@ # and javax.crypto.spec.SecretKeySpec and rejects all the others. jceks.key.serialFilter = java.base/java.lang.Enum;java.base/java.security.KeyRep;\ java.base/java.security.KeyRep$Type;java.base/javax.crypto.spec.SecretKeySpec;!* + +# +# Enhanced exception message information +# +# By default, exception messages should not include potentially sensitive +# information such as file names, host names, or port numbers. This property +# accepts one or more comma separated values, each of which represents a +# category of enhanced exception message information to enable. Values are +# case-insensitive. Leading and trailing whitespaces, surrounding each value, +# are ignored. Unknown values are ignored. +# +# The categories are: +# +# hostInfo - IOExceptions thrown by java.net.Socket and the socket types in the +# java.nio.channels package will contain enhanced exception +# message information +# +# The property setting in this file can be overridden by a system property of +# the same name, with the same syntax and possible values. +# +#jdk.includeInExceptions=hostInfo diff -Nru openjdk-11-11~19/src/java.base/share/legal/cldr.md openjdk-11-11~24/src/java.base/share/legal/cldr.md --- openjdk-11-11~19/src/java.base/share/legal/cldr.md 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/legal/cldr.md 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,38 @@ -## Unicode Common Local Data Repository (CLDR) v29 +## Unicode Common Local Data Repository (CLDR) v33 ### CLDR License -<pre> -Copyright © 1991-2016 Unicode, Inc. All rights reserved. +``` -Distributed under the Terms of Use in -http://www.unicode.org/copyright.html. +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, +http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +Unicode Data Files do not include PDF online code charts under the +directory http://www.unicode.org/Public/. + +Software includes any source code published in the Unicode Standard +or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, +http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2018 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation @@ -15,28 +41,26 @@ without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that +or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies -of the Data Files or Software, +of the Data Files or Software, or (b) this copyright and permission notice appear in associated -documentation, and -(c) there is clear notice in each modified Data File or in the Software -as well as in the documentation associated with the Data File(s) or -Software that the data or software has been modified. +Documentation. -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in these Data Files or Software without prior written authorization of -the copyright holder. +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. -</pre> +``` diff -Nru openjdk-11-11~19/src/java.base/share/legal/icu.md openjdk-11-11~24/src/java.base/share/legal/icu.md --- openjdk-11-11~19/src/java.base/share/legal/icu.md 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/legal/icu.md 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,14 @@ -## International Components for Unicode (ICU4J) v56.1 +## International Components for Unicode (ICU4J) v60.2 ### ICU4J License -<pre> + +``` UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE Unicode Data Files include all data files under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/cldr/data/, +http://source.icu-project.org/repos/icu/, and http://www.unicode.org/utility/trac/browser/. Unicode Data Files do not include PDF online code charts under the @@ -15,7 +17,8 @@ Software includes any source code published in the Unicode Standard or under the directories http://www.unicode.org/Public/, http://www.unicode.org/reports/, -http://www.unicode.org/cldr/data/, http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/cldr/data/, +http://source.icu-project.org/repos/icu/, and http://www.unicode.org/utility/trac/browser/. NOTICE TO USER: Carefully read the following legal agreement. @@ -28,7 +31,7 @@ COPYRIGHT AND PERMISSION NOTICE -Copyright © 1991-2016 Unicode, Inc. All rights reserved. +Copyright © 1991-2018 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in http://www.unicode.org/copyright.html. Permission is hereby granted, free of charge, to any person obtaining @@ -60,4 +63,4 @@ use or other dealings in these Data Files or Software without prior written authorization of the copyright holder. -</pre> +``` diff -Nru openjdk-11-11~19/src/java.base/share/legal/public_suffix.md openjdk-11-11~24/src/java.base/share/legal/public_suffix.md --- openjdk-11-11~19/src/java.base/share/legal/public_suffix.md 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/legal/public_suffix.md 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,399 @@ +## Mozilla Public Suffix List + +### Public Suffix Notice +``` +You are receiving a copy of the Mozilla Public Suffix List in the following +file: <java-home>/lib/security/public_suffix_list.dat. The terms of the +Oracle license do NOT apply to this file; it is licensed under the +Mozilla Public License 2.0, separately from the Oracle programs you receive. +If you do not wish to use the Public Suffix List, you may remove the +<java-home>/lib/security/public_suffix_list.dat file. + +The Source Code of this file is available under the +Mozilla Public License, v. 2.0 and is located at +https://raw.githubusercontent.com/publicsuffix/list/2225db8d9f4a2a27ec697c883360632fa0c16261/public_suffix_list.dat. +If a copy of the MPL was not distributed with this file, you can obtain one +at https://mozilla.org/MPL/2.0/. + +Software distributed under the License is distributed on an "AS IS" basis, +WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +for the specific language governing rights and limitations under the License. +``` + +### MPL v2.0 +``` +Mozilla Public License Version 2.0 +================================== + +1. Definitions +-------------- + +1.1. "Contributor" + means each individual or legal entity that creates, contributes to + the creation of, or owns Covered Software. + +1.2. "Contributor Version" + means the combination of the Contributions of others (if any) used + by a Contributor and that particular Contributor's Contribution. + +1.3. "Contribution" + means Covered Software of a particular Contributor. + +1.4. "Covered Software" + means Source Code Form to which the initial Contributor has attached + the notice in Exhibit A, the Executable Form of such Source Code + Form, and Modifications of such Source Code Form, in each case + including portions thereof. + +1.5. "Incompatible With Secondary Licenses" + means + + (a) that the initial Contributor has attached the notice described + in Exhibit B to the Covered Software; or + + (b) that the Covered Software was made available under the terms of + version 1.1 or earlier of the License, but not also under the + terms of a Secondary License. + +1.6. "Executable Form" + means any form of the work other than Source Code Form. + +1.7. "Larger Work" + means a work that combines Covered Software with other material, in + a separate file or files, that is not Covered Software. + +1.8. "License" + means this document. + +1.9. "Licensable" + means having the right to grant, to the maximum extent possible, + whether at the time of the initial grant or subsequently, any and + all of the rights conveyed by this License. + +1.10. "Modifications" + means any of the following: + + (a) any file in Source Code Form that results from an addition to, + deletion from, or modification of the contents of Covered + Software; or + + (b) any new file in Source Code Form that contains any Covered + Software. + +1.11. "Patent Claims" of a Contributor + means any patent claim(s), including without limitation, method, + process, and apparatus claims, in any patent Licensable by such + Contributor that would be infringed, but for the grant of the + License, by the making, using, selling, offering for sale, having + made, import, or transfer of either its Contributions or its + Contributor Version. + +1.12. "Secondary License" + means either the GNU General Public License, Version 2.0, the GNU + Lesser General Public License, Version 2.1, the GNU Affero General + Public License, Version 3.0, or any later versions of those + licenses. + +1.13. "Source Code Form" + means the form of the work preferred for making modifications. + +1.14. "You" (or "Your") + means an individual or a legal entity exercising rights under this + License. For legal entities, "You" includes any entity that + controls, is controlled by, or is under common control with You. For + purposes of this definition, "control" means (a) the power, direct + or indirect, to cause the direction or management of such entity, + whether by contract or otherwise, or (b) ownership of more than + fifty percent (50%) of the outstanding shares or beneficial + ownership of such entity. + +2. License Grants and Conditions +-------------------------------- + +2.1. Grants + +Each Contributor hereby grants You a world-wide, royalty-free, +non-exclusive license: + +(a) under intellectual property rights (other than patent or trademark) + Licensable by such Contributor to use, reproduce, make available, + modify, display, perform, distribute, and otherwise exploit its + Contributions, either on an unmodified basis, with Modifications, or + as part of a Larger Work; and + +(b) under Patent Claims of such Contributor to make, use, sell, offer + for sale, have made, import, and otherwise transfer either its + Contributions or its Contributor Version. + +2.2. Effective Date + +The licenses granted in Section 2.1 with respect to any Contribution +become effective for each Contribution on the date the Contributor first +distributes such Contribution. + +2.3. Limitations on Grant Scope + +The licenses granted in this Section 2 are the only rights granted under +this License. No additional rights or licenses will be implied from the +distribution or licensing of Covered Software under this License. +Notwithstanding Section 2.1(b) above, no patent license is granted by a +Contributor: + +(a) for any code that a Contributor has removed from Covered Software; + or + +(b) for infringements caused by: (i) Your and any other third party's + modifications of Covered Software, or (ii) the combination of its + Contributions with other software (except as part of its Contributor + Version); or + +(c) under Patent Claims infringed by Covered Software in the absence of + its Contributions. + +This License does not grant any rights in the trademarks, service marks, +or logos of any Contributor (except as may be necessary to comply with +the notice requirements in Section 3.4). + +2.4. Subsequent Licenses + +No Contributor makes additional grants as a result of Your choice to +distribute the Covered Software under a subsequent version of this +License (see Section 10.2) or under the terms of a Secondary License (if +permitted under the terms of Section 3.3). + +2.5. Representation + +Each Contributor represents that the Contributor believes its +Contributions are its original creation(s) or it has sufficient rights +to grant the rights to its Contributions conveyed by this License. + +2.6. Fair Use + +This License is not intended to limit any rights You have under +applicable copyright doctrines of fair use, fair dealing, or other +equivalents. + +2.7. Conditions + +Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted +in Section 2.1. + +3. Responsibilities +------------------- + +3.1. Distribution of Source Form + +All distribution of Covered Software in Source Code Form, including any +Modifications that You create or to which You contribute, must be under +the terms of this License. You must inform recipients that the Source +Code Form of the Covered Software is governed by the terms of this +License, and how they can obtain a copy of this License. You may not +attempt to alter or restrict the recipients' rights in the Source Code +Form. + +3.2. Distribution of Executable Form + +If You distribute Covered Software in Executable Form then: + +(a) such Covered Software must also be made available in Source Code + Form, as described in Section 3.1, and You must inform recipients of + the Executable Form how they can obtain a copy of such Source Code + Form by reasonable means in a timely manner, at a charge no more + than the cost of distribution to the recipient; and + +(b) You may distribute such Executable Form under the terms of this + License, or sublicense it under different terms, provided that the + license for the Executable Form does not attempt to limit or alter + the recipients' rights in the Source Code Form under this License. + +3.3. Distribution of a Larger Work + +You may create and distribute a Larger Work under terms of Your choice, +provided that You also comply with the requirements of this License for +the Covered Software. If the Larger Work is a combination of Covered +Software with a work governed by one or more Secondary Licenses, and the +Covered Software is not Incompatible With Secondary Licenses, this +License permits You to additionally distribute such Covered Software +under the terms of such Secondary License(s), so that the recipient of +the Larger Work may, at their option, further distribute the Covered +Software under the terms of either this License or such Secondary +License(s). + +3.4. Notices + +You may not remove or alter the substance of any license notices +(including copyright notices, patent notices, disclaimers of warranty, +or limitations of liability) contained within the Source Code Form of +the Covered Software, except that You may alter any license notices to +the extent required to remedy known factual inaccuracies. + +3.5. Application of Additional Terms + +You may choose to offer, and to charge a fee for, warranty, support, +indemnity or liability obligations to one or more recipients of Covered +Software. However, You may do so only on Your own behalf, and not on +behalf of any Contributor. You must make it absolutely clear that any +such warranty, support, indemnity, or liability obligation is offered by +You alone, and You hereby agree to indemnify every Contributor for any +liability incurred by such Contributor as a result of warranty, support, +indemnity or liability terms You offer. You may include additional +disclaimers of warranty and limitations of liability specific to any +jurisdiction. + +4. Inability to Comply Due to Statute or Regulation +--------------------------------------------------- + +If it is impossible for You to comply with any of the terms of this +License with respect to some or all of the Covered Software due to +statute, judicial order, or regulation then You must: (a) comply with +the terms of this License to the maximum extent possible; and (b) +describe the limitations and the code they affect. Such description must +be placed in a text file included with all distributions of the Covered +Software under this License. Except to the extent prohibited by statute +or regulation, such description must be sufficiently detailed for a +recipient of ordinary skill to be able to understand it. + +5. Termination +-------------- + +5.1. The rights granted under this License will terminate automatically +if You fail to comply with any of its terms. However, if You become +compliant, then the rights granted under this License from a particular +Contributor are reinstated (a) provisionally, unless and until such +Contributor explicitly and finally terminates Your grants, and (b) on an +ongoing basis, if such Contributor fails to notify You of the +non-compliance by some reasonable means prior to 60 days after You have +come back into compliance. Moreover, Your grants from a particular +Contributor are reinstated on an ongoing basis if such Contributor +notifies You of the non-compliance by some reasonable means, this is the +first time You have received notice of non-compliance with this License +from such Contributor, and You become compliant prior to 30 days after +Your receipt of the notice. + +5.2. If You initiate litigation against any entity by asserting a patent +infringement claim (excluding declaratory judgment actions, +counter-claims, and cross-claims) alleging that a Contributor Version +directly or indirectly infringes any patent, then the rights granted to +You by any and all Contributors for the Covered Software under Section +2.1 of this License shall terminate. + +5.3. In the event of termination under Sections 5.1 or 5.2 above, all +end user license agreements (excluding distributors and resellers) which +have been validly granted by You or Your distributors under this License +prior to termination shall survive termination. + +************************************************************************ +* * +* 6. Disclaimer of Warranty * +* ------------------------- * +* * +* Covered Software is provided under this License on an "as is" * +* basis, without warranty of any kind, either expressed, implied, or * +* statutory, including, without limitation, warranties that the * +* Covered Software is free of defects, merchantable, fit for a * +* particular purpose or non-infringing. The entire risk as to the * +* quality and performance of the Covered Software is with You. * +* Should any Covered Software prove defective in any respect, You * +* (not any Contributor) assume the cost of any necessary servicing, * +* repair, or correction. This disclaimer of warranty constitutes an * +* essential part of this License. No use of any Covered Software is * +* authorized under this License except under this disclaimer. * +* * +************************************************************************ + +************************************************************************ +* * +* 7. Limitation of Liability * +* -------------------------- * +* * +* Under no circumstances and under no legal theory, whether tort * +* (including negligence), contract, or otherwise, shall any * +* Contributor, or anyone who distributes Covered Software as * +* permitted above, be liable to You for any direct, indirect, * +* special, incidental, or consequential damages of any character * +* including, without limitation, damages for lost profits, loss of * +* goodwill, work stoppage, computer failure or malfunction, or any * +* and all other commercial damages or losses, even if such party * +* shall have been informed of the possibility of such damages. This * +* limitation of liability shall not apply to liability for death or * +* personal injury resulting from such party's negligence to the * +* extent applicable law prohibits such limitation. Some * +* jurisdictions do not allow the exclusion or limitation of * +* incidental or consequential damages, so this exclusion and * +* limitation may not apply to You. * +* * +************************************************************************ + +8. Litigation +------------- + +Any litigation relating to this License may be brought only in the +courts of a jurisdiction where the defendant maintains its principal +place of business and such litigation shall be governed by laws of that +jurisdiction, without reference to its conflict-of-law provisions. +Nothing in this Section shall prevent a party's ability to bring +cross-claims or counter-claims. + +9. Miscellaneous +---------------- + +This License represents the complete agreement concerning the subject +matter hereof. If any provision of this License is held to be +unenforceable, such provision shall be reformed only to the extent +necessary to make it enforceable. Any law or regulation which provides +that the language of a contract shall be construed against the drafter +shall not be used to construe this License against a Contributor. + +10. Versions of the License +--------------------------- + +10.1. New Versions + +Mozilla Foundation is the license steward. Except as provided in Section +10.3, no one other than the license steward has the right to modify or +publish new versions of this License. Each version will be given a +distinguishing version number. + +10.2. Effect of New Versions + +You may distribute the Covered Software under the terms of the version +of the License under which You originally received the Covered Software, +or under the terms of any subsequent version published by the license +steward. + +10.3. Modified Versions + +If you create software not governed by this License, and you want to +create a new license for such software, you may create and use a +modified version of this License if you rename the license and remove +any references to the name of the license steward (except to note that +such modified license differs from this License). + +10.4. Distributing Source Code Form that is Incompatible With Secondary +Licenses + +If You choose to distribute Source Code Form that is Incompatible With +Secondary Licenses under the terms of this version of the License, the +notice described in Exhibit B of this License must be attached. + +Exhibit A - Source Code Form License Notice +------------------------------------------- + + This Source Code Form is subject to the terms of the Mozilla Public + License, v. 2.0. If a copy of the MPL was not distributed with this + file, You can obtain one at https://mozilla.org/MPL/2.0/. + +If it is not possible or desirable to put the notice in a particular +file, then You may include the notice in a location (such as a LICENSE +file in a relevant directory) where a recipient would be likely to look +for such a notice. + +You may add additional accurate notices of copyright ownership. + +Exhibit B - "Incompatible With Secondary Licenses" Notice +--------------------------------------------------------- + + This Source Code Form is "Incompatible With Secondary Licenses", as + defined by the Mozilla Public License, v. 2.0. + +``` diff -Nru openjdk-11-11~19/src/java.base/share/legal/unicode.md openjdk-11-11~24/src/java.base/share/legal/unicode.md --- openjdk-11-11~19/src/java.base/share/legal/unicode.md 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/legal/unicode.md 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,66 @@ +## The Unicode Standard, Unicode Character Database, Version 10.0.0 + +### Unicode Character Database + +``` + +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, +http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +Unicode Data Files do not include PDF online code charts under the +directory http://www.unicode.org/Public/. + +Software includes any source code published in the Unicode Standard +or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, +http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2018 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +``` Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/src/java.base/share/lib/security/cacerts and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/src/java.base/share/lib/security/cacerts differ diff -Nru openjdk-11-11~19/src/java.base/share/native/libjava/Class.c openjdk-11-11~24/src/java.base/share/native/libjava/Class.c --- openjdk-11-11~19/src/java.base/share/native/libjava/Class.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/native/libjava/Class.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1994, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,15 +65,17 @@ {"getDeclaredMethods0","(Z)[" MHD, (void *)&JVM_GetClassDeclaredMethods}, {"getDeclaredConstructors0","(Z)[" CTR, (void *)&JVM_GetClassDeclaredConstructors}, {"getProtectionDomain0", "()" PD, (void *)&JVM_GetProtectionDomain}, - {"getDeclaredClasses0", "()[" CLS, (void *)&JVM_GetDeclaredClasses}, + {"getDeclaredClasses0", "()[" CLS, (void *)&JVM_GetDeclaredClasses}, {"getDeclaringClass0", "()" CLS, (void *)&JVM_GetDeclaringClass}, {"getSimpleBinaryName0", "()" STR, (void *)&JVM_GetSimpleBinaryName}, {"getGenericSignature0", "()" STR, (void *)&JVM_GetClassSignature}, - {"getRawAnnotations", "()" BA, (void *)&JVM_GetClassAnnotations}, + {"getRawAnnotations", "()" BA, (void *)&JVM_GetClassAnnotations}, {"getConstantPool", "()" CPL, (void *)&JVM_GetClassConstantPool}, - {"desiredAssertionStatus0","("CLS")Z",(void *)&JVM_DesiredAssertionStatus}, + {"desiredAssertionStatus0","("CLS")Z", (void *)&JVM_DesiredAssertionStatus}, {"getEnclosingMethod0", "()[" OBJ, (void *)&JVM_GetEnclosingMethodInfo}, {"getRawTypeAnnotations", "()" BA, (void *)&JVM_GetClassTypeAnnotations}, + {"getNestHost0", "()" CLS, (void *)&JVM_GetNestHost}, + {"getNestMembers0", "()[" CLS, (void *)&JVM_GetNestMembers}, }; #undef OBJ diff -Nru openjdk-11-11~19/src/java.base/share/native/libjava/jni_util.h openjdk-11-11~24/src/java.base/share/native/libjava/jni_util.h --- openjdk-11-11~19/src/java.base/share/native/libjava/jni_util.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/native/libjava/jni_util.h 2018-07-25 15:36:46.000000000 +0000 @@ -297,6 +297,22 @@ } \ } while (0) \ +#define CHECK_NULL_THROW_NPE(env, x, msg) \ + do { \ + if ((x) == NULL) { \ + JNU_ThrowNullPointerException((env), (msg));\ + return; \ + } \ + } while(0) \ + +#define CHECK_NULL_THROW_NPE_RETURN(env, x, msg, z)\ + do { \ + if ((x) == NULL) { \ + JNU_ThrowNullPointerException((env), (msg));\ + return (z); \ + } \ + } while(0) \ + #define CHECK_NULL_RETURN(x, y) \ do { \ if ((x) == NULL) { \ diff -Nru openjdk-11-11~19/src/java.base/share/native/libjava/Reflection.c openjdk-11-11~24/src/java.base/share/native/libjava/Reflection.c --- openjdk-11-11~19/src/java.base/share/native/libjava/Reflection.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/native/libjava/Reflection.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,3 +38,9 @@ { return JVM_GetClassAccessFlags(env, cls); } + +JNIEXPORT jboolean JNICALL +Java_jdk_internal_reflect_Reflection_areNestMates(JNIEnv *env, jclass unused, jclass current, jclass member) +{ + return JVM_AreNestMates(env, current, member); +} diff -Nru openjdk-11-11~19/src/java.base/share/native/libjli/java.c openjdk-11-11~24/src/java.base/share/native/libjli/java.c --- openjdk-11-11~19/src/java.base/share/native/libjli/java.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/native/libjli/java.c 2018-07-25 15:36:46.000000000 +0000 @@ -441,14 +441,6 @@ LEAVE(); } - // validate modules on the module path, then exit - if (validateModules) { - jboolean okay = ValidateModules(env); - CHECK_EXCEPTION_LEAVE(1); - if (!okay) ret = 1; - LEAVE(); - } - if (printVersion || showVersion) { PrintJavaVersion(env, showVersion); CHECK_EXCEPTION_LEAVE(0); @@ -457,6 +449,11 @@ } } + // modules have been validated at startup so exit + if (validateModules) { + LEAVE(); + } + /* If the user specified neither a class name nor a JAR file */ if (printXUsage || printUsage || what == 0 || mode == LM_UNKNOWN) { PrintUsage(env, printXUsage); @@ -1955,20 +1952,6 @@ (*env)->CallStaticVoidMethod(env, cls, describeModuleID, joptString); } -/** - * Validate modules - */ -static jboolean -ValidateModules(JNIEnv *env) -{ - jmethodID validateModulesID; - jclass cls = GetLauncherHelperClass(env); - NULL_CHECK_RETURN_VALUE(cls, JNI_FALSE); - validateModulesID = (*env)->GetStaticMethodID(env, cls, "validateModules", "()Z"); - NULL_CHECK_RETURN_VALUE(cls, JNI_FALSE); - return (*env)->CallStaticBooleanMethod(env, cls, validateModulesID); -} - /* * Prints default usage or the Xusage message, see sun.launcher.LauncherHelper.java */ diff -Nru openjdk-11-11~19/src/java.base/share/native/libnet/net_util.c openjdk-11-11~24/src/java.base/share/native/libnet/net_util.c --- openjdk-11-11~19/src/java.base/share/native/libnet/net_util.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/native/libnet/net_util.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -171,32 +171,38 @@ void setInetAddress_addr(JNIEnv *env, jobject iaObj, int address) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE(env, holder, "InetAddress holder is null"); (*env)->SetIntField(env, holder, iac_addressID, address); } void setInetAddress_family(JNIEnv *env, jobject iaObj, int family) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE(env, holder, "InetAddress holder is null"); (*env)->SetIntField(env, holder, iac_familyID, family); } void setInetAddress_hostName(JNIEnv *env, jobject iaObj, jobject host) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE(env, holder, "InetAddress holder is null"); (*env)->SetObjectField(env, holder, iac_hostNameID, host); (*env)->SetObjectField(env, holder, iac_origHostNameID, host); } int getInetAddress_addr(JNIEnv *env, jobject iaObj) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE_RETURN(env, holder, "InetAddress holder is null", -1); return (*env)->GetIntField(env, holder, iac_addressID); } int getInetAddress_family(JNIEnv *env, jobject iaObj) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE_RETURN(env, holder, "InetAddress holder is null", -1); return (*env)->GetIntField(env, holder, iac_familyID); } jobject getInetAddress_hostName(JNIEnv *env, jobject iaObj) { jobject holder = (*env)->GetObjectField(env, iaObj, ia_holderID); + CHECK_NULL_THROW_NPE_RETURN(env, holder, "InetAddress holder is null", NULL); return (*env)->GetObjectField(env, holder, iac_hostNameID); } @@ -211,7 +217,9 @@ CHECK_NULL_RETURN(iaObj, NULL); address = NET_IPv4MappedToIPv4(caddr); setInetAddress_addr(env, iaObj, address); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); setInetAddress_family(env, iaObj, java_net_InetAddress_IPv4); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); } else { jboolean ret; iaObj = (*env)->NewObject(env, ia6_class, ia6_ctrID); @@ -220,6 +228,7 @@ if (ret == JNI_FALSE) return NULL; setInetAddress_family(env, iaObj, java_net_InetAddress_IPv6); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); setInet6Address_scopeid(env, iaObj, sa->sa6.sin6_scope_id); } *port = ntohs(sa->sa6.sin6_port); @@ -227,7 +236,9 @@ iaObj = (*env)->NewObject(env, ia4_class, ia4_ctrID); CHECK_NULL_RETURN(iaObj, NULL); setInetAddress_family(env, iaObj, java_net_InetAddress_IPv4); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); setInetAddress_addr(env, iaObj, ntohl(sa->sa4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); *port = ntohs(sa->sa4.sin_port); } return iaObj; @@ -238,6 +249,7 @@ { jint family = getInetAddress_family(env, iaObj) == java_net_InetAddress_IPv4 ? AF_INET : AF_INET6; + JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE); if (sa->sa.sa_family == AF_INET6) { jbyte *caddrNew = (jbyte *)&sa->sa6.sin6_addr; if (NET_IsIPv4Mapped(caddrNew)) { @@ -247,6 +259,7 @@ } addrNew = NET_IPv4MappedToIPv4(caddrNew); addrCur = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE); if (addrNew == addrCur) { return JNI_TRUE; } else { @@ -273,6 +286,7 @@ } addrNew = ntohl(sa->sa4.sin_addr.s_addr); addrCur = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, JNI_FALSE); if (addrNew == addrCur) { return JNI_TRUE; } else { diff -Nru openjdk-11-11~19/src/java.base/share/native/libzip/zip_util.c openjdk-11-11~24/src/java.base/share/native/libzip/zip_util.c --- openjdk-11-11~19/src/java.base/share/native/libzip/zip_util.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/share/native/libzip/zip_util.c 2018-07-25 15:36:46.000000000 +0000 @@ -739,13 +739,13 @@ jzfile *zip = NULL; /* Clear zip error message */ - if (pmsg != 0) { + if (pmsg != NULL) { *pmsg = NULL; } zip = ZIP_Get_From_Cache(name, pmsg, lastModified); - if (zip == NULL && *pmsg == NULL) { + if (zip == NULL && pmsg != NULL && *pmsg == NULL) { ZFILE zfd = ZFILE_Open(name, mode); zip = ZIP_Put_In_Cache(name, zfd, pmsg, lastModified); } diff -Nru openjdk-11-11~19/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java openjdk-11-11~24/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java --- openjdk-11-11~19/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/solaris/classes/sun/nio/fs/SolarisFileSystemProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,7 @@ import java.nio.file.attribute.*; import java.nio.file.spi.FileTypeDetector; import java.io.IOException; +import jdk.internal.util.StaticProperty; import sun.security.action.GetPropertyAction; /** @@ -84,8 +85,7 @@ @Override FileTypeDetector getFileTypeDetector() { - Path userMimeTypes = Path.of( - GetPropertyAction.privilegedGetProperty("user.home"), ".mime.types"); + Path userMimeTypes = Path.of(StaticProperty.userHome(), ".mime.types"); Path etcMimeTypes = Path.of("/etc/mime.types"); return chain(new MimeTypesFileTypeDetector(userMimeTypes), diff -Nru openjdk-11-11~19/src/java.base/unix/classes/java/io/UnixFileSystem.java openjdk-11-11~24/src/java.base/unix/classes/java/io/UnixFileSystem.java --- openjdk-11-11~19/src/java.base/unix/classes/java/io/UnixFileSystem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/classes/java/io/UnixFileSystem.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,8 @@ package java.io; import java.util.Properties; + +import jdk.internal.util.StaticProperty; import sun.security.action.GetPropertyAction; @@ -40,8 +42,8 @@ Properties props = GetPropertyAction.privilegedGetProperties(); slash = props.getProperty("file.separator").charAt(0); colon = props.getProperty("path.separator").charAt(0); - javaHome = props.getProperty("java.home"); - userDir = props.getProperty("user.dir"); + javaHome = StaticProperty.javaHome(); + userDir = StaticProperty.userDir(); } diff -Nru openjdk-11-11~19/src/java.base/unix/classes/java/lang/ProcessImpl.java openjdk-11-11~24/src/java.base/unix/classes/java/lang/ProcessImpl.java --- openjdk-11-11~19/src/java.base/unix/classes/java/lang/ProcessImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/classes/java/lang/ProcessImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -49,6 +49,7 @@ import java.util.Properties; import jdk.internal.misc.JavaIOFileDescriptorAccess; import jdk.internal.misc.SharedSecrets; +import jdk.internal.util.StaticProperty; import sun.security.action.GetPropertyAction; /** @@ -122,7 +123,7 @@ String helperPath() { Properties props = GetPropertyAction.privilegedGetProperties(); - return helperPath(props.getProperty("java.home"), + return helperPath(StaticProperty.javaHome(), props.getProperty("os.arch")); } diff -Nru openjdk-11-11~19/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java openjdk-11-11~24/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java --- openjdk-11-11~19/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/classes/sun/nio/ch/UnixAsynchronousSocketChannelImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,6 +32,7 @@ import java.io.IOException; import java.io.FileDescriptor; import sun.net.NetHooks; +import sun.net.util.SocketExceptions; import sun.security.action.GetPropertyAction; /** @@ -258,6 +259,10 @@ end(); } if (e != null) { + if (e instanceof IOException) { + var isa = (InetSocketAddress)pendingRemote; + e = SocketExceptions.of((IOException)e, isa); + } // close channel if connection cannot be established try { close(); @@ -350,6 +355,9 @@ // close channel if connect fails if (e != null) { + if (e instanceof IOException) { + e = SocketExceptions.of((IOException)e, isa); + } try { close(); } catch (Throwable suppressed) { diff -Nru openjdk-11-11~19/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java openjdk-11-11~24/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java --- openjdk-11-11~19/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/classes/sun/nio/fs/UnixFileStore.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,8 @@ package sun.nio.fs; +import jdk.internal.util.StaticProperty; + import java.nio.file.*; import java.nio.file.attribute.*; import java.nio.channels.*; @@ -259,7 +261,7 @@ private static Properties loadProperties() { Properties result = new Properties(); - String fstypes = System.getProperty("java.home") + "/lib/fstypes.properties"; + String fstypes = StaticProperty.javaHome() + "/lib/fstypes.properties"; Path file = Path.of(fstypes); try { try (ReadableByteChannel rbc = Files.newByteChannel(file)) { diff -Nru openjdk-11-11~19/src/java.base/unix/native/libjava/java_props_md.c openjdk-11-11~24/src/java.base/unix/native/libjava/java_props_md.c --- openjdk-11-11~19/src/java.base/unix/native/libjava/java_props_md.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/native/libjava/java_props_md.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -297,7 +297,23 @@ if (strcmp(p, "EUC-JP") == 0) { *std_encoding = "EUC-JP-LINUX"; } -#else +#endif + +#ifdef _AIX + if (strcmp(p, "big5") == 0) { + /* On AIX Traditional Chinese Big5 codeset is mapped to IBM-950 */ + *std_encoding = "IBM-950"; + } else if (strcmp(p, "IBM-943") == 0) { + /* + * On AIX, IBM-943 is mapped to IBM-943C in which symbol 'yen' and + * 'overline' are replaced with 'backslash' and 'tilde' from ASCII + * making first 96 code points same as ASCII. + */ + *std_encoding = "IBM-943C"; + } +#endif + +#ifdef __solaris__ if (strcmp(p,"eucJP") == 0) { /* For Solaris use customized vendor defined character * customized EUC-JP converter diff -Nru openjdk-11-11~19/src/java.base/unix/native/libnet/Inet4AddressImpl.c openjdk-11-11~24/src/java.base/unix/native/libnet/Inet4AddressImpl.c --- openjdk-11-11~19/src/java.base/unix/native/libnet/Inet4AddressImpl.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/native/libnet/Inet4AddressImpl.c 2018-07-25 15:36:46.000000000 +0000 @@ -193,7 +193,11 @@ } setInetAddress_addr(env, iaObj, ntohl(((struct sockaddr_in *) (iterator->ai_addr))->sin_addr.s_addr)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, i++, iaObj); iterator = iterator->ai_next; } diff -Nru openjdk-11-11~19/src/java.base/unix/native/libnet/Inet6AddressImpl.c openjdk-11-11~24/src/java.base/unix/native/libnet/Inet6AddressImpl.c --- openjdk-11-11~19/src/java.base/unix/native/libnet/Inet6AddressImpl.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/native/libnet/Inet6AddressImpl.c 2018-07-25 15:36:46.000000000 +0000 @@ -198,6 +198,8 @@ return NULL; } setInetAddress_hostName(env, o, name); + if ((*env)->ExceptionCheck(env)) + goto done; (*env)->SetObjectArrayElement(env, result, index, o); (*env)->DeleteLocalRef(env, o); } @@ -355,7 +357,11 @@ goto cleanupAndReturn; } setInetAddress_addr(env, iaObj, ntohl(((struct sockaddr_in*)iterator->ai_addr)->sin_addr.s_addr)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, (inetIndex | originalIndex), iaObj); inetIndex++; } else if (iterator->ai_family == AF_INET6) { @@ -376,6 +382,8 @@ setInet6Address_scopeid(env, iaObj, scope); } setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, (inet6Index | originalIndex), iaObj); inet6Index++; } diff -Nru openjdk-11-11~19/src/java.base/unix/native/libnet/net_util_md.c openjdk-11-11~24/src/java.base/unix/native/libnet/net_util_md.c --- openjdk-11-11~19/src/java.base/unix/native/libnet/net_util_md.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/native/libnet/net_util_md.c 2018-07-25 15:36:46.000000000 +0000 @@ -764,6 +764,7 @@ jboolean v4MappedAddress) { jint family = getInetAddress_family(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); memset((char *)sa, 0, sizeof(SOCKETADDRESS)); if (ipv6_available() && @@ -777,6 +778,7 @@ // convert to IPv4-mapped address memset((char *)caddr, 0, 16); address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); if (address == INADDR_ANY) { /* we would always prefer IPv6 wildcard address * caddr[10] = 0xff; @@ -871,6 +873,7 @@ return -1; } address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); sa->sa4.sin_port = htons(port); sa->sa4.sin_addr.s_addr = htonl(address); sa->sa4.sin_family = AF_INET; diff -Nru openjdk-11-11~19/src/java.base/unix/native/libnet/NetworkInterface.c openjdk-11-11~24/src/java.base/unix/native/libnet/NetworkInterface.c --- openjdk-11-11~19/src/java.base/unix/native/libnet/NetworkInterface.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/native/libnet/NetworkInterface.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -329,11 +329,11 @@ (JNIEnv *env, jclass cls, jobject iaObj) { netif *ifs, *curr; - int family = (getInetAddress_family(env, iaObj) == java_net_InetAddress_IPv4) ? - AF_INET : AF_INET6; jobject obj = NULL; jboolean match = JNI_FALSE; - + int family = (getInetAddress_family(env, iaObj) == java_net_InetAddress_IPv4) ? + AF_INET : AF_INET6; + JNU_CHECK_EXCEPTION_RETURN(env, NULL); ifs = enumInterfaces(env); if (ifs == NULL) { return NULL; @@ -351,7 +351,7 @@ int address1 = htonl( ((struct sockaddr_in *)addrP->addr)->sin_addr.s_addr); int address2 = getInetAddress_addr(env, iaObj); - + JNU_CHECK_EXCEPTION_RETURN(env, NULL); if (address1 == address2) { match = JNI_TRUE; break; @@ -698,6 +698,7 @@ if (iaObj) { setInetAddress_addr(env, iaObj, htonl( ((struct sockaddr_in*)addrP->addr)->sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); } else { return NULL; } @@ -710,6 +711,7 @@ if (ia2Obj) { setInetAddress_addr(env, ia2Obj, htonl( ((struct sockaddr_in*)addrP->brdcast)->sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); (*env)->SetObjectField(env, ibObj, ni_ib4broadcastID, ia2Obj); } else { return NULL; diff -Nru openjdk-11-11~19/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c openjdk-11-11~24/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c --- openjdk-11-11~19/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/unix/native/libnet/PlainDatagramSocketImpl.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -531,9 +531,12 @@ iaObj = NET_SockaddrToInetAddress(env, &rmtaddr, &port); family = getInetAddress_family(env, iaObj) == java_net_InetAddress_IPv4 ? AF_INET : AF_INET6; + JNU_CHECK_EXCEPTION_RETURN(env, -1); if (family == AF_INET) { /* this API can't handle IPV6 addresses */ int address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); setInetAddress_addr(env, addressObj, address); + JNU_CHECK_EXCEPTION_RETURN(env, -1); } return port; } @@ -1014,6 +1017,7 @@ struct in_addr in; jobjectArray addrArray; jsize len; + jint family; jobject addr; int i; @@ -1044,8 +1048,11 @@ in.s_addr = 0; for (i = 0; i < len; i++) { addr = (*env)->GetObjectArrayElement(env, addrArray, i); - if (getInetAddress_family(env, addr) == java_net_InetAddress_IPv4) { + family = getInetAddress_family(env, addr); + JNU_CHECK_EXCEPTION(env); + if (family == java_net_InetAddress_IPv4) { in.s_addr = htonl(getInetAddress_addr(env, addr)); + JNU_CHECK_EXCEPTION(env); break; } } @@ -1095,7 +1102,7 @@ struct in_addr in; in.s_addr = htonl( getInetAddress_addr(env, value) ); - + JNU_CHECK_EXCEPTION(env); if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, (const char*)&in, sizeof(in)) < 0) { JNU_ThrowByNameWithMessageAndLastError @@ -1458,6 +1465,7 @@ CHECK_NULL_RETURN(addr, NULL); setInetAddress_addr(env, addr, ntohl(in.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); /* * For IP_MULTICAST_IF return InetAddress @@ -1890,6 +1898,7 @@ jobject fdObj = (*env)->GetObjectField(env, this, pdsi_fdID); jint fd; + jint family; jint ipv6_join_leave; if (IS_NULL(fdObj)) { @@ -1910,7 +1919,9 @@ ipv6_join_leave = ipv6_available(); #ifdef __linux__ - if (getInetAddress_family(env, iaObj) == java_net_InetAddress_IPv4) { + family = getInetAddress_family(env, iaObj); + JNU_CHECK_EXCEPTION(env); + if (family == java_net_InetAddress_IPv4) { ipv6_join_leave = JNI_FALSE; } #endif @@ -1951,6 +1962,7 @@ } mname.imr_multiaddr.s_addr = htonl(getInetAddress_addr(env, iaObj)); + JNU_CHECK_EXCEPTION(env); mname.imr_address.s_addr = 0; mname.imr_ifindex = (*env)->GetIntField(env, niObj, ni_indexID); mname_len = sizeof(struct ip_mreqn); @@ -1969,11 +1981,14 @@ addr = (*env)->GetObjectArrayElement(env, addrArray, 0); mname.imr_multiaddr.s_addr = htonl(getInetAddress_addr(env, iaObj)); + JNU_CHECK_EXCEPTION(env); #ifdef __linux__ mname.imr_address.s_addr = htonl(getInetAddress_addr(env, addr)); + JNU_CHECK_EXCEPTION(env); mname.imr_ifindex = 0; #else mname.imr_interface.s_addr = htonl(getInetAddress_addr(env, addr)); + JNU_CHECK_EXCEPTION(env); #endif mname_len = sizeof(struct ip_mreq); } @@ -2009,6 +2024,7 @@ } mname.imr_multiaddr.s_addr = htonl(getInetAddress_addr(env, iaObj)); + JNU_CHECK_EXCEPTION(env); mname.imr_address.s_addr = 0 ; mname.imr_ifindex = index; mname_len = sizeof(struct ip_mreqn); @@ -2031,6 +2047,7 @@ mname.imr_interface.s_addr = in.s_addr; #endif mname.imr_multiaddr.s_addr = htonl(getInetAddress_addr(env, iaObj)); + JNU_CHECK_EXCEPTION(env); mname_len = sizeof(struct ip_mreq); } } @@ -2097,10 +2114,11 @@ jint address; family = getInetAddress_family(env, iaObj) == java_net_InetAddress_IPv4 ? AF_INET : AF_INET6; + JNU_CHECK_EXCEPTION(env); if (family == AF_INET) { /* will convert to IPv4-mapped address */ memset((char *) caddr, 0, 16); address = getInetAddress_addr(env, iaObj); - + JNU_CHECK_EXCEPTION(env); caddr[10] = 0xff; caddr[11] = 0xff; diff -Nru openjdk-11-11~19/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java openjdk-11-11~24/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java --- openjdk-11-11~19/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/classes/sun/nio/ch/WindowsAsynchronousSocketChannelImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,6 +35,7 @@ import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; import jdk.internal.misc.Unsafe; +import sun.net.util.SocketExceptions; /** * Windows implementation of AsynchronousSocketChannel using overlapped I/O. @@ -253,7 +254,8 @@ if (exc != null) { closeChannel(); - result.setFailure(toIOException(exc)); + exc = SocketExceptions.of(toIOException(exc), remote); + result.setFailure(exc); } Invoker.invoke(result); } @@ -278,7 +280,9 @@ // can't close channel while in begin/end block if (exc != null) { closeChannel(); - result.setFailure(toIOException(exc)); + IOException ee = toIOException(exc); + ee = SocketExceptions.of(ee, remote); + result.setFailure(ee); } if (canInvokeDirect) { @@ -293,11 +297,13 @@ */ @Override public void failed(int error, IOException x) { + x = SocketExceptions.of(x, remote); if (isOpen()) { closeChannel(); result.setFailure(x); } else { - result.setFailure(new AsynchronousCloseException()); + x = SocketExceptions.of(new AsynchronousCloseException(), remote); + result.setFailure(x); } Invoker.invoke(result); } diff -Nru openjdk-11-11~19/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java openjdk-11-11~24/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java --- openjdk-11-11~19/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/classes/sun/nio/fs/WindowsFileSystemProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,6 +34,7 @@ import java.util.*; import java.security.AccessController; import jdk.internal.misc.Unsafe; +import jdk.internal.util.StaticProperty; import sun.nio.ch.ThreadPool; import sun.security.util.SecurityConstants; @@ -46,11 +47,10 @@ { private static final Unsafe unsafe = Unsafe.getUnsafe(); - private static final String USER_DIR = "user.dir"; private final WindowsFileSystem theFileSystem; public WindowsFileSystemProvider() { - theFileSystem = new WindowsFileSystem(this, System.getProperty(USER_DIR)); + theFileSystem = new WindowsFileSystem(this, StaticProperty.userDir()); } @Override diff -Nru openjdk-11-11~19/src/java.base/windows/native/libjava/FileDescriptor_md.c openjdk-11-11~24/src/java.base/windows/native/libjava/FileDescriptor_md.c --- openjdk-11-11~19/src/java.base/windows/native/libjava/FileDescriptor_md.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/native/libjava/FileDescriptor_md.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -87,7 +87,7 @@ JNIEXPORT void JNICALL Java_java_io_FileCleanable_cleanupClose0(JNIEnv *env, jclass fdClass, jint unused, jlong handle) { if (handle != -1) { - if (CloseHandle((HANDLE)handle) == -1) { + if (!CloseHandle((HANDLE)handle)) { JNU_ThrowIOExceptionWithLastError(env, "close failed"); } } diff -Nru openjdk-11-11~19/src/java.base/windows/native/libjava/jni_util_md.c openjdk-11-11~24/src/java.base/windows/native/libjava/jni_util_md.c --- openjdk-11-11~19/src/java.base/windows/native/libjava/jni_util_md.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/native/libjava/jni_util_md.c 2018-07-25 15:36:46.000000000 +0000 @@ -75,73 +75,33 @@ } JNIEXPORT size_t JNICALL -getLastErrorString(char *utf8_jvmErrorMsg, size_t cbErrorMsg) -{ - size_t n = 0; - if (cbErrorMsg > 0) { - BOOLEAN noError = FALSE; - WCHAR *utf16_osErrorMsg = (WCHAR *)malloc(cbErrorMsg*sizeof(WCHAR)); - if (utf16_osErrorMsg == NULL) { - // OOM accident - strncpy(utf8_jvmErrorMsg, "Out of memory", cbErrorMsg); - // truncate if too long - utf8_jvmErrorMsg[cbErrorMsg - 1] = '\0'; - n = strlen(utf8_jvmErrorMsg); - } else { - DWORD errval = GetLastError(); - if (errval != 0) { - // WIN32 error - n = (size_t)FormatMessageW( - FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, - NULL, - errval, - 0, - utf16_osErrorMsg, - (DWORD)cbErrorMsg, - NULL); - if (n > 3) { - // Drop final '.', CR, LF - if (utf16_osErrorMsg[n - 1] == L'\n') --n; - if (utf16_osErrorMsg[n - 1] == L'\r') --n; - if (utf16_osErrorMsg[n - 1] == L'.') --n; - utf16_osErrorMsg[n] = L'\0'; - } - } else if (errno != 0) { - // C runtime error that has no corresponding WIN32 error code - int ret = _wcserror_s(utf16_osErrorMsg, cbErrorMsg, errno); - if (ret == 0) - n = wcslen(utf16_osErrorMsg); - } else - noError = TRUE; //OS has no error to report +getLastErrorString(char *buf, size_t len) { - if (!noError) { - if (n > 0) { - n = WideCharToMultiByte( - CP_UTF8, - 0, - utf16_osErrorMsg, - (int)n, - utf8_jvmErrorMsg, - (int)cbErrorMsg, - NULL, - NULL); + DWORD errval; - // no way to die - if (n > 0) - utf8_jvmErrorMsg[min(cbErrorMsg - 1, n)] = '\0'; - } - - if (n <= 0) { - strncpy(utf8_jvmErrorMsg, "Secondary error while OS message extraction", cbErrorMsg); - // truncate if too long - utf8_jvmErrorMsg[cbErrorMsg - 1] = '\0'; - n = strlen(utf8_jvmErrorMsg); - } - } - free(utf16_osErrorMsg); + if ((errval = GetLastError()) != 0) { + // DOS error + size_t n = (size_t)FormatMessage( + FORMAT_MESSAGE_FROM_SYSTEM|FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + errval, + 0, + buf, + (DWORD)len, + NULL); + if (n > 3) { + // Drop final '.', CR, LF + if (buf[n - 1] == '\n') n--; + if (buf[n - 1] == '\r') n--; + if (buf[n - 1] == '.') n--; + buf[n] = '\0'; } + return n; } - return n; + + // C runtime error that has no corresponding DOS error code + if (errno == 0 || len < 1) return 0; + return strerror_s(buf, len, errno); } JNIEXPORT int JNICALL diff -Nru openjdk-11-11~19/src/java.base/windows/native/libnet/Inet4AddressImpl.c openjdk-11-11~24/src/java.base/windows/native/libnet/Inet4AddressImpl.c --- openjdk-11-11~19/src/java.base/windows/native/libnet/Inet4AddressImpl.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/native/libnet/Inet4AddressImpl.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -146,7 +146,11 @@ } setInetAddress_addr(env, iaObj, ntohl(((struct sockaddr_in *) (iterator->ai_addr))->sin_addr.s_addr)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, i++, iaObj); iterator = iterator->ai_next; } diff -Nru openjdk-11-11~19/src/java.base/windows/native/libnet/Inet6AddressImpl.c openjdk-11-11~24/src/java.base/windows/native/libnet/Inet6AddressImpl.c --- openjdk-11-11~19/src/java.base/windows/native/libnet/Inet6AddressImpl.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/native/libnet/Inet6AddressImpl.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -187,7 +187,11 @@ goto cleanupAndReturn; } setInetAddress_addr(env, iaObj, ntohl(((struct sockaddr_in*)iterator->ai_addr)->sin_addr.s_addr)); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, (inetIndex | originalIndex), iaObj); inetIndex++; } else if (iterator->ai_family == AF_INET6) { @@ -208,6 +212,8 @@ setInet6Address_scopeid(env, iaObj, scope); } setInetAddress_hostName(env, iaObj, host); + if ((*env)->ExceptionCheck(env)) + goto cleanupAndReturn; (*env)->SetObjectArrayElement(env, ret, (inet6Index | originalIndex), iaObj); inet6Index++; } diff -Nru openjdk-11-11~19/src/java.base/windows/native/libnet/net_util_md.c openjdk-11-11~24/src/java.base/windows/native/libnet/net_util_md.c --- openjdk-11-11~19/src/java.base/windows/native/libnet/net_util_md.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/native/libnet/net_util_md.c 2018-07-25 15:36:46.000000000 +0000 @@ -794,6 +794,7 @@ jboolean v4MappedAddress) { jint family = getInetAddress_family(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); memset((char *)sa, 0, sizeof(SOCKETADDRESS)); if (ipv6_available() && @@ -808,6 +809,7 @@ // convert to IPv4-mapped address memset((char *)caddr, 0, 16); address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); if (address == INADDR_ANY) { /* we would always prefer IPv6 wildcard address * caddr[10] = 0xff; @@ -846,6 +848,7 @@ return -1; } address = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); sa->sa4.sin_port = htons((short)port); sa->sa4.sin_addr.s_addr = (u_long)htonl(address); sa->sa4.sin_family = AF_INET; diff -Nru openjdk-11-11~19/src/java.base/windows/native/libnet/NetworkInterface.c openjdk-11-11~24/src/java.base/windows/native/libnet/NetworkInterface.c --- openjdk-11-11~19/src/java.base/windows/native/libnet/NetworkInterface.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/native/libnet/NetworkInterface.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -586,6 +586,7 @@ /* default ctor will set family to AF_INET */ setInetAddress_addr(env, iaObj, ntohl(addrs->addr.sa4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); if (addrs->mask != -1) { ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID); if (ibObj == NULL) { @@ -599,6 +600,7 @@ return NULL; } setInetAddress_addr(env, ia2Obj, ntohl(addrs->brdcast.sa4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); (*env)->SetObjectField(env, ibObj, ni_ibbroadcastID, ia2Obj); (*env)->SetShortField(env, ibObj, ni_ibmaskID, addrs->mask); (*env)->SetObjectArrayElement(env, bindsArr, bind_index++, ibObj); @@ -754,8 +756,9 @@ (JNIEnv *env, jclass cls, jobject iaObj) { netif *ifList, *curr; - jint addr = getInetAddress_addr(env, iaObj); jobject netifObj = NULL; + jint addr = getInetAddress_addr(env, iaObj); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); // Retained for now to support IPv4 only stack, java.net.preferIPv4Stack if (ipv6_available()) { diff -Nru openjdk-11-11~19/src/java.base/windows/native/libnet/NetworkInterface_winXP.c openjdk-11-11~24/src/java.base/windows/native/libnet/NetworkInterface_winXP.c --- openjdk-11-11~19/src/java.base/windows/native/libnet/NetworkInterface_winXP.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/native/libnet/NetworkInterface_winXP.c 2018-07-25 15:36:46.000000000 +0000 @@ -75,14 +75,8 @@ DWORD ret, flags; IP_ADAPTER_ADDRESSES *adapterInfo; ULONG len; - char *error_msg_buf = NULL; - size_t error_msg_buf_size = - strlen("IP Helper Library GetAdaptersAddresses function failed" - " with error == ") + 10; - int _ret = 0; int try; - adapterInfo = (IP_ADAPTER_ADDRESSES *) malloc(BUFF_SIZE); if (adapterInfo == NULL) { JNU_ThrowByName(env, "java/lang/OutOfMemoryError", @@ -126,21 +120,16 @@ "IP Helper Library GetAdaptersAddresses function failed " "with ERROR_ADDRESS_NOT_ASSOCIATED"); } else { - error_msg_buf = (char *)malloc(error_msg_buf_size); - if (error_msg_buf != NULL) { - memset(error_msg_buf, 0, error_msg_buf_size); - _ret = _snprintf_s(error_msg_buf, error_msg_buf_size, - _TRUNCATE, "IP Helper Library GetAdaptersAddresses " - "function failed with error == %d", ret); - if (_ret != -1) { - JNU_ThrowByName(env, "java/lang/Error", error_msg_buf); - } else { - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failure"); - } + char error_msg_buf[100]; + int _sr; + _sr = _snprintf_s(error_msg_buf, sizeof(error_msg_buf), + _TRUNCATE, "IP Helper Library GetAdaptersAddresses " + "function failed with error == %d", ret); + if (_sr != -1) { + JNU_ThrowByName(env, "java/lang/Error", error_msg_buf); } else { JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failed"); + "IP Helper Library GetAdaptersAddresses function failure"); } } return -1; @@ -158,10 +147,6 @@ DWORD flags, val; IP_ADAPTER_ADDRESSES *adapterInfo, *ptr, *ret; ULONG len; - char *error_msg_buf = NULL; - size_t error_msg_buf_size = - strlen("IP Helper Library GetAdaptersAddresses function failed with error == ") + 10; - int _ret = 0; int try; adapterInfo = (IP_ADAPTER_ADDRESSES *) malloc(BUFF_SIZE); if (adapterInfo == NULL) { @@ -204,21 +189,16 @@ "IP Helper Library GetAdaptersAddresses function failed " "with ERROR_ADDRESS_NOT_ASSOCIATED"); } else { - error_msg_buf = (char *)malloc(error_msg_buf_size); - if (error_msg_buf != NULL) { - memset(error_msg_buf, 0, error_msg_buf_size); - _ret = _snprintf_s(error_msg_buf, error_msg_buf_size, - _TRUNCATE, "IP Helper Library GetAdaptersAddresses function failed " - "with error == %d", val); - if (_ret != -1) { - JNU_ThrowByName(env, "java/lang/Error", error_msg_buf); - } else { - JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failure"); - } + char error_msg_buf[100]; + int _sr; + _sr = _snprintf_s(error_msg_buf, sizeof(error_msg_buf), + _TRUNCATE, "IP Helper Library GetAdaptersAddresses function failed " + "with error == %d", val); + if (_sr != -1) { + JNU_ThrowByName(env, "java/lang/Error", error_msg_buf); } else { JNU_ThrowByName(env, "java/lang/Error", - "IP Helper Library GetAdaptersAddresses function failed"); + "IP Helper Library GetAdaptersAddresses function failure"); } } return NULL; @@ -604,7 +584,7 @@ /* default ctor will set family to AF_INET */ setInetAddress_addr(env, iaObj, ntohl(addrs->addr.sa4.sin_addr.s_addr)); - + JNU_CHECK_EXCEPTION_RETURN(env, NULL); ibObj = (*env)->NewObject(env, ni_ibcls, ni_ibctrID); if (ibObj == NULL) { free_netaddr(netaddrP); @@ -617,6 +597,7 @@ return NULL; } setInetAddress_addr(env, ia2Obj, ntohl(addrs->brdcast.sa4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, NULL); (*env)->SetObjectField(env, ibObj, ni_ibbroadcastID, ia2Obj); (*env)->SetShortField(env, ibObj, ni_ibmaskID, addrs->mask); (*env)->SetObjectArrayElement(env, bindsArr, bind_index++, ibObj); diff -Nru openjdk-11-11~19/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c openjdk-11-11~24/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c --- openjdk-11-11~19/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c 2018-07-25 15:36:46.000000000 +0000 @@ -219,16 +219,16 @@ jobject fd1Obj = (*env)->GetObjectField(env, this, pdsi_fd1ID); int ipv6_supported = ipv6_available(); int fd, fd1 = -1, lcladdrlen = 0; + jint family; SOCKETADDRESS lcladdr; - if (getInetAddress_family(env, addressObj) == java_net_InetAddress_IPv6 && - !ipv6_supported) - { + family = getInetAddress_family(env, addressObj); + JNU_CHECK_EXCEPTION(env); + if (family == java_net_InetAddress_IPv6 && !ipv6_supported) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Protocol family not supported"); return; } - if (IS_NULL(fdObj) || (ipv6_supported && IS_NULL(fd1Obj))) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "socket closed"); return; @@ -344,6 +344,7 @@ } family = getInetAddress_family(env, address); + JNU_CHECK_EXCEPTION(env); if (family == java_net_InetAddress_IPv6 && !ipv6_available()) { JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Protocol family not supported"); @@ -455,6 +456,7 @@ } family = getInetAddress_family(env, iaObj); + JNU_CHECK_EXCEPTION(env); if (family == java_net_InetAddress_IPv4) { fdObj = (*env)->GetObjectField(env, this, pdsi_fdID); } else { @@ -584,6 +586,7 @@ return -1; } else { address = getInetAddress_addr(env, addressObj); + JNU_CHECK_EXCEPTION_RETURN(env, -1); /* We only handle IPv4 for now. Will support IPv6 once its in the os */ family = AF_INET; } @@ -657,7 +660,9 @@ return 0; } setInetAddress_addr(env, addressObj, ntohl(remote_addr.sa4.sin_addr.s_addr)); + JNU_CHECK_EXCEPTION_RETURN(env, -1); setInetAddress_family(env, addressObj, java_net_InetAddress_IPv4); + JNU_CHECK_EXCEPTION_RETURN(env, -1); /* return port */ return ntohs(remote_addr.sa4.sin_port); @@ -1349,6 +1354,7 @@ int fam; addr = (*env)->GetObjectArrayElement(env, addrArray, i); fam = getInetAddress_family(env, addr); + JNU_CHECK_EXCEPTION_RETURN(env, -1); if (fam == family) { *iaddr = addr; return 0; @@ -1367,6 +1373,7 @@ } iaddr->s_addr = htonl(getInetAddress_addr(env, addr)); + JNU_CHECK_EXCEPTION_RETURN(env, -1); return 0; } @@ -1471,6 +1478,7 @@ struct in_addr in; in.s_addr = htonl(getInetAddress_addr(env, value)); + JNU_CHECK_EXCEPTION(env); if (setsockopt(fd, IPPROTO_IP, IP_MULTICAST_IF, (const char*)&in, sizeof(in)) < 0) { JNU_ThrowByNameWithMessageAndLastError @@ -1712,7 +1720,7 @@ CHECK_NULL_RETURN(addr, NULL); setInetAddress_addr(env, addr, ntohl(in.s_addr)); - + JNU_CHECK_EXCEPTION_RETURN(env, NULL); /* * For IP_MULTICAST_IF return InetAddress */ diff -Nru openjdk-11-11~19/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java openjdk-11-11~24/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java --- openjdk-11-11~19/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/macosx/classes/com/apple/eio/FileManager.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -364,11 +364,11 @@ * @since Java for Mac OS X 10.5 Update 6 - 1.6, 1.5 */ public static boolean moveToTrash(final File file) throws FileNotFoundException { - if (file == null || !file.exists()) throw new FileNotFoundException(); + if (file == null) throw new FileNotFoundException(); final String fileName = file.getAbsolutePath(); final SecurityManager security = System.getSecurityManager(); - if (security != null) security.checkWrite(fileName); + if (security != null) security.checkDelete(fileName); return _moveToTrash(fileName); } diff -Nru openjdk-11-11~19/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java openjdk-11-11~24/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java --- openjdk-11-11~19/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -3320,7 +3320,7 @@ } else if (name == "indexForNullComponent") { isRunsDirty = true; updateHtmlViews((Integer) e.getNewValue(), true); - } else if (name == "font") { + } else if (name == "font" || SwingUtilities2.isScaleChanged(e)) { calculatedBaseline = false; } } diff -Nru openjdk-11-11~19/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java openjdk-11-11~24/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java --- openjdk-11-11~19/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/macosx/classes/sun/lwawt/macosx/CPlatformWindow.java 2018-07-25 15:36:46.000000000 +0000 @@ -378,7 +378,7 @@ // Either java.awt.Frame or java.awt.Dialog can be resizable, however java.awt.Window is never resizable { - final boolean resizable = isFrame ? ((Frame)target).isResizable() : (isDialog ? ((Dialog)target).isResizable() : false); + final boolean resizable = isTargetResizable() && isNativelyFocusableWindow(); styleBits = SET(styleBits, RESIZABLE, resizable); if (!resizable) { styleBits = SET(styleBits, ZOOMABLE, false); @@ -482,6 +482,16 @@ return styleBits; } + private boolean isTargetResizable() { + if (target instanceof Frame) { + return ((Frame)target).isResizable(); + } else if (target instanceof Dialog) { + return ((Dialog)target).isResizable(); + } + + return false; + } + // this is the counter-point to -[CWindow _nativeSetStyleBit:] private void setStyleBits(final int mask, final boolean value) { execute(ptr -> nativeSetNSWindowStyleBits(ptr, mask, value ? mask : 0)); @@ -676,10 +686,9 @@ // Manage the extended state when showing if (visible) { /* Frame or Dialog should be set property WINDOW_FULLSCREENABLE to true if the - Frame or Dialog is resizable. + Frame or Dialog is resizable and focusable. **/ - final boolean resizable = (target instanceof Frame) ? ((Frame)target).isResizable() : - ((target instanceof Dialog) ? ((Dialog)target).isResizable() : false); + final boolean resizable = isTargetResizable() && isNativelyFocusableWindow(); if (resizable) { setCanFullscreen(true); } @@ -814,9 +823,10 @@ @Override public void setResizable(final boolean resizable) { - setCanFullscreen(resizable); - setStyleBits(RESIZABLE, resizable); - setStyleBits(ZOOMABLE, resizable); + final boolean windowResizable = resizable && isNativelyFocusableWindow(); + setCanFullscreen(windowResizable); + setStyleBits(RESIZABLE, windowResizable); + setStyleBits(ZOOMABLE, windowResizable); } @Override @@ -858,8 +868,8 @@ @Override public void updateFocusableWindowState() { - final boolean isFocusable = isNativelyFocusableWindow(); - setStyleBits(SHOULD_BECOME_KEY | SHOULD_BECOME_MAIN | RESIZABLE, isFocusable); // set bits at once + setStyleBits(SHOULD_BECOME_KEY | SHOULD_BECOME_MAIN | RESIZABLE, + (isNativelyFocusableWindow() && isTargetResizable())); } @Override diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/com/sun/awt/SecurityWarning.java openjdk-11-11~24/src/java.desktop/share/classes/com/sun/awt/SecurityWarning.java --- openjdk-11-11~19/src/java.desktop/share/classes/com/sun/awt/SecurityWarning.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/com/sun/awt/SecurityWarning.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,10 @@ * for limited use outside of the core platform. This API may change * drastically between update release, and it may even be * removed or be moved to some other packages or classes. + * + * @deprecated This class is deprecated, no replacement. */ +@Deprecated(since = "11", forRemoval = true) public final class SecurityWarning { /** diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java openjdk-11-11~24/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java --- openjdk-11-11~19/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java 2018-07-25 15:36:46.000000000 +0000 @@ -636,7 +636,9 @@ "Menu.submenuPopupOffsetX", -2, "Menu.submenuPopupOffsetY", 3, "Menu.shortcutKeys", new int[]{ - SwingUtilities2.getSystemMnemonicKeyMask(), metaMask + SwingUtilities2.getSystemMnemonicKeyMask(), metaMask, + SwingUtilities2.setAltGraphMask( + SwingUtilities2.getSystemMnemonicKeyMask()) }, "Menu.cancelMode", "hideMenuTree", diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java openjdk-11-11~24/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java --- openjdk-11-11~19/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/com/sun/media/sound/EventDispatcher.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -308,7 +308,12 @@ * called from auto-closing clips when their closed() method is called. */ void autoClosingClipClosed(AutoClosingClip clip) { - // nothing to do -- is removed from arraylist above + synchronized(autoClosingClips) { + int index = getAutoClosingClipIndex(clip); + if (index != -1) { + autoClosingClips.remove(index); + } + } } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java openjdk-11-11~24/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java --- openjdk-11-11~19/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/com/sun/media/sound/JavaSoundAudioClip.java 2018-07-25 15:36:46.000000000 +0000 @@ -173,29 +173,31 @@ if (DEBUG || Printer.debug) Printer.debug("JavaSoundAudioClip.startImpl(loop="+loop+")"); try { if (clip != null) { - if (!clip.isOpen()) { - if (DEBUG || Printer.trace)Printer.trace("JavaSoundAudioClip: clip.open()"); - clip.open(loadedAudioFormat, loadedAudio, 0, loadedAudioByteLength); - } else { - if (DEBUG || Printer.trace)Printer.trace("JavaSoundAudioClip: clip.flush()"); - clip.flush(); - if (loop != clipLooping) { - // need to stop in case the looped status changed - if (DEBUG || Printer.trace)Printer.trace("JavaSoundAudioClip: clip.stop()"); - clip.stop(); + // We need to disable autoclosing mechanism otherwise the clip + // can be closed after "!clip.isOpen()" check, because of + // previous inactivity. + clip.setAutoClosing(false); + try { + if (!clip.isOpen()) { + clip.open(loadedAudioFormat, loadedAudio, 0, + loadedAudioByteLength); + } else { + clip.flush(); + if (loop != clipLooping) { + // need to stop in case the looped status changed + clip.stop(); + } } + clip.setFramePosition(0); + if (loop) { + clip.loop(Clip.LOOP_CONTINUOUSLY); + } else { + clip.start(); + } + clipLooping = loop; + } finally { + clip.setAutoClosing(true); } - clip.setFramePosition(0); - if (loop) { - if (DEBUG || Printer.trace)Printer.trace("JavaSoundAudioClip: clip.loop()"); - clip.loop(Clip.LOOP_CONTINUOUSLY); - } else { - if (DEBUG || Printer.trace)Printer.trace("JavaSoundAudioClip: clip.start()"); - clip.start(); - } - clipLooping = loop; - if (DEBUG || Printer.debug)Printer.debug("Clip should be playing/looping"); - } else if (datapusher != null ) { datapusher.start(loop); if (DEBUG || Printer.debug)Printer.debug("Stream should be playing/looping"); diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/java/awt/Component.java openjdk-11-11~24/src/java.desktop/share/classes/java/awt/Component.java --- openjdk-11-11~19/src/java.desktop/share/classes/java/awt/Component.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/java/awt/Component.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1995, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,67 +22,98 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package java.awt; -import java.io.PrintStream; -import java.io.PrintWriter; -import java.util.Objects; -import java.util.Vector; -import java.util.Locale; -import java.util.EventListener; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import java.util.Collections; -import java.awt.peer.ComponentPeer; -import java.awt.peer.ContainerPeer; -import java.awt.peer.LightweightPeer; +import java.applet.Applet; +import java.awt.dnd.DropTarget; +import java.awt.event.ActionEvent; +import java.awt.event.AdjustmentEvent; +import java.awt.event.ComponentEvent; +import java.awt.event.ComponentListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.HierarchyBoundsListener; +import java.awt.event.HierarchyEvent; +import java.awt.event.HierarchyListener; +import java.awt.event.InputEvent; +import java.awt.event.InputMethodEvent; +import java.awt.event.InputMethodListener; +import java.awt.event.ItemEvent; +import java.awt.event.KeyEvent; +import java.awt.event.KeyListener; +import java.awt.event.MouseEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseMotionListener; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; +import java.awt.event.PaintEvent; +import java.awt.event.TextEvent; +import java.awt.im.InputContext; +import java.awt.im.InputMethodRequests; import java.awt.image.BufferStrategy; +import java.awt.image.ColorModel; import java.awt.image.ImageObserver; import java.awt.image.ImageProducer; -import java.awt.image.ColorModel; import java.awt.image.VolatileImage; -import java.awt.event.*; -import java.io.Serializable; -import java.io.ObjectOutputStream; -import java.io.ObjectInputStream; -import java.io.IOException; +import java.awt.peer.ComponentPeer; +import java.awt.peer.ContainerPeer; +import java.awt.peer.LightweightPeer; import java.beans.PropertyChangeListener; import java.beans.PropertyChangeSupport; import java.beans.Transient; -import java.awt.im.InputContext; -import java.awt.im.InputMethodRequests; -import java.awt.dnd.DropTarget; -import java.security.AccessController; +import java.io.IOException; +import java.io.ObjectInputStream; +import java.io.ObjectOutputStream; +import java.io.PrintStream; +import java.io.PrintWriter; +import java.io.Serializable; import java.security.AccessControlContext; -import javax.accessibility.*; -import java.applet.Applet; +import java.security.AccessController; +import java.util.Collections; +import java.util.EventListener; +import java.util.HashSet; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.Vector; + +import javax.accessibility.Accessible; +import javax.accessibility.AccessibleComponent; +import javax.accessibility.AccessibleContext; +import javax.accessibility.AccessibleRole; +import javax.accessibility.AccessibleSelection; +import javax.accessibility.AccessibleState; +import javax.accessibility.AccessibleStateSet; import javax.swing.JComponent; import javax.swing.JRootPane; -import sun.awt.ComponentFactory; -import sun.security.action.GetPropertyAction; -import sun.awt.AppContext; import sun.awt.AWTAccessor; +import sun.awt.AppContext; +import sun.awt.ComponentFactory; import sun.awt.ConstrainableGraphics; +import sun.awt.EmbeddedFrame; +import sun.awt.RequestFocusController; import sun.awt.SubRegionShowable; import sun.awt.SunToolkit; -import sun.awt.EmbeddedFrame; import sun.awt.dnd.SunDropTargetEvent; import sun.awt.im.CompositionArea; +import sun.awt.image.VSyncedBSManager; import sun.font.FontManager; import sun.font.FontManagerFactory; import sun.font.SunFontManager; import sun.java2d.SunGraphics2D; +import sun.java2d.SunGraphicsEnvironment; import sun.java2d.pipe.Region; -import sun.awt.image.VSyncedBSManager; import sun.java2d.pipe.hw.ExtendedBufferCapabilities; -import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.*; -import sun.awt.RequestFocusController; -import sun.java2d.SunGraphicsEnvironment; +import sun.security.action.GetPropertyAction; import sun.swing.SwingAccessor; import sun.util.logging.PlatformLogger; +import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_DEFAULT; +import static sun.java2d.pipe.hw.ExtendedBufferCapabilities.VSyncType.VSYNC_ON; + /** * A <em>component</em> is an object having a graphical representation * that can be displayed on the screen and that can interact with the @@ -1129,24 +1160,31 @@ } } - boolean updateGraphicsData(GraphicsConfiguration gc) { - checkTreeLock(); + final boolean updateGraphicsData(GraphicsConfiguration gc) { + GraphicsConfiguration oldConfig = graphicsConfig; + // First, update own graphics configuration + boolean ret = updateSelfGraphicsData(gc); + // Second, update children graphics configurations + ret |= updateChildGraphicsData(gc); + // Third, fire PropertyChange if needed + if (oldConfig != gc) { + /* + * If component is moved from one screen to another screen or shown + * for the first time graphicsConfiguration property is fired to + * enable the component to recalculate any rendering data, if needed + */ + firePropertyChange("graphicsConfiguration", oldConfig, gc); + } + return ret; + } + private boolean updateSelfGraphicsData(GraphicsConfiguration gc) { + checkTreeLock(); if (graphicsConfig == gc) { return false; } - GraphicsConfiguration oldConfig = graphicsConfig; graphicsConfig = gc; - /* - * If component is moved from one screen to another sceeen - * graphicsConfiguration property is fired to enable the component - * to recalculate any rendering data, if needed - */ - if (oldConfig != null && gc != null) { - firePropertyChange("graphicsConfiguration", oldConfig, gc); - } - ComponentPeer peer = this.peer; if (peer != null) { return peer.updateGraphicsData(gc); @@ -1154,6 +1192,10 @@ return false; } + boolean updateChildGraphicsData(GraphicsConfiguration gc) { + return false; + } + /** * Checks that this component's {@code GraphicsDevice} * {@code idString} matches the string argument. @@ -5945,7 +5987,8 @@ * {@code InputMethodRequests} instance. * If listener {@code l} is {@code null}, * no exception is thrown and no action is performed. - * <p>Refer to <a href="{@docRoot}/java/awt/doc-files/AWTThreadIssues.html#ListenersThreads" + * <p>Refer to + * <a href="{@docRoot}/java.desktop/java/awt/doc-files/AWTThreadIssues.html#ListenersThreads" * >AWT Threading Issues</a> for details on AWT's threading model. * * @param l the input method listener diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/java/awt/Container.java openjdk-11-11~24/src/java.desktop/share/classes/java/awt/Container.java --- openjdk-11-11~19/src/java.desktop/share/classes/java/awt/Container.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/java/awt/Container.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,7 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + package java.awt; import java.awt.dnd.DropTarget; @@ -1172,10 +1173,10 @@ } @Override - boolean updateGraphicsData(GraphicsConfiguration gc) { + final boolean updateChildGraphicsData(GraphicsConfiguration gc) { checkTreeLock(); - boolean ret = super.updateGraphicsData(gc); + boolean ret = false; for (Component comp : component) { if (comp != null) { diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/java/awt/Desktop.java openjdk-11-11~24/src/java.desktop/share/classes/java/awt/Desktop.java --- openjdk-11-11~19/src/java.desktop/share/classes/java/awt/Desktop.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/java/awt/Desktop.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,10 +40,12 @@ import java.io.File; import java.io.FilePermission; import java.io.IOException; -import java.net.MalformedURLException; import java.net.URI; import java.net.URISyntaxException; import java.net.URL; +import java.security.AccessController; +import java.security.PrivilegedAction; +import java.util.Objects; import javax.swing.JMenuBar; @@ -364,15 +366,11 @@ * @throws NullPointerException if file is null * @throws IllegalArgumentException if file doesn't exist */ - private static void checkFileValidation(File file){ - if (file == null) throw new NullPointerException("File must not be null"); - + private static void checkFileValidation(File file) { if (!file.exists()) { throw new IllegalArgumentException("The file: " + file.getPath() + " doesn't exist."); } - - file.canRead(); } /** @@ -426,6 +424,7 @@ * @see java.awt.AWTPermission */ public void open(File file) throws IOException { + file = new File(file.getPath()); checkAWTPermission(); checkExec(); checkActionSupport(Action.OPEN); @@ -457,6 +456,7 @@ * @see java.awt.AWTPermission */ public void edit(File file) throws IOException { + file = new File(file.getPath()); checkAWTPermission(); checkExec(); checkActionSupport(Action.EDIT); @@ -487,6 +487,7 @@ * allowed to create a subprocess */ public void print(File file) throws IOException { + file = new File(file.getPath()); checkExec(); SecurityManager sm = System.getSecurityManager(); if (sm != null) { @@ -505,13 +506,6 @@ * {@code URIs} of the specified type is invoked. The application * is determined from the protocol and path of the {@code URI}, as * defined by the {@code URI} class. - * <p> - * If the calling thread does not have the necessary permissions, - * and this is invoked from within an applet, - * {@code AppletContext.showDocument()} is used. Similarly, if the calling - * does not have the necessary permissions, and this is invoked from within - * a Java Web Started application, {@code BasicService.showDocument()} - * is used. * * @param uri the URI to be displayed in the user default browser * @throws NullPointerException if {@code uri} is {@code null} @@ -524,46 +518,16 @@ * denies the * {@code AWTPermission("showWindowWithoutWarningBanner")} * permission, or the calling thread is not allowed to create a - * subprocess; and not invoked from within an applet or Java Web Started - * application - * @throws IllegalArgumentException if the necessary permissions - * are not available and the URI can not be converted to a {@code URL} + * subprocess * @see java.net.URI * @see java.awt.AWTPermission - * @see java.applet.AppletContext */ public void browse(URI uri) throws IOException { - SecurityException securityException = null; - try { - checkAWTPermission(); - checkExec(); - } catch (SecurityException e) { - securityException = e; - } + checkAWTPermission(); + checkExec(); checkActionSupport(Action.BROWSE); - if (uri == null) { - throw new NullPointerException(); - } - if (securityException == null) { - peer.browse(uri); - return; - } - - // Calling thread doesn't have necessary privileges. - // Delegate to DesktopBrowse so that it can work in - // applet/webstart. - URL url = null; - try { - url = uri.toURL(); - } catch (MalformedURLException e) { - throw new IllegalArgumentException("Unable to convert URI to URL", e); - } - sun.awt.DesktopBrowse db = sun.awt.DesktopBrowse.getInstance(); - if (db == null) { - // Not in webstart/applet, throw the exception. - throw securityException; - } - db.browse(url); + Objects.requireNonNull(uri); + peer.browse(uri); } /** @@ -652,14 +616,6 @@ } } - private void checkDelete() throws SecurityException { - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new FilePermission("<<ALL FILES>>", - SecurityConstants.FILE_DELETE_ACTION)); - } - } - private void checkQuitPermission() { SecurityManager sm = System.getSecurityManager(); if (sm != null) { @@ -988,6 +944,8 @@ * @since 9 */ public void openHelpViewer() { + checkAWTPermission(); + checkExec(); checkEventsProcessingPermission(); checkActionSupport(Action.APP_HELP_VIEWER); peer.openHelpViewer(); @@ -1033,9 +991,15 @@ * @since 9 */ public void browseFileDirectory(File file) { - checkRead(); + file = new File(file.getPath()); + checkAWTPermission(); + checkExec(); checkActionSupport(Action.BROWSE_FILE_DIR); checkFileValidation(file); + File parentFile = file.getParentFile(); + if (parentFile == null || !parentFile.exists()) { + throw new IllegalArgumentException("Parent folder doesn't exist"); + } peer.browseFileDirectory(file); } @@ -1055,10 +1019,18 @@ * * @since 9 */ - public boolean moveToTrash(final File file) { - checkDelete(); + public boolean moveToTrash(File file) { + file = new File(file.getPath()); + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkDelete(file.getPath()); + } checkActionSupport(Action.MOVE_TO_TRASH); - checkFileValidation(file); + final File finalFile = file; + AccessController.doPrivileged((PrivilegedAction<?>) () -> { + checkFileValidation(finalFile); + return null; + }); return peer.moveToTrash(file); } } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/java/awt/Shape.java openjdk-11-11~24/src/java.desktop/share/classes/java/awt/Shape.java --- openjdk-11-11~19/src/java.desktop/share/classes/java/awt/Shape.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/java/awt/Shape.java 2018-07-25 15:36:46.000000000 +0000 @@ -90,7 +90,8 @@ * representation. * * <p> - * Note that the <a href="{@docRoot}/java/awt/Shape.html#def_insideness"> + * Note that the + * <a href="{@docRoot}/java.desktop/java/awt/Shape.html#def_insideness"> * definition of insideness</a> can lead to situations where points * on the defining outline of the {@code shape} may not be considered * contained in the returned {@code bounds} object, but only in cases @@ -135,7 +136,8 @@ * store the dimensions. * * <p> - * Note that the <a href="{@docRoot}/java/awt/Shape.html#def_insideness"> + * Note that the + * <a href="{@docRoot}/java.desktop/java/awt/Shape.html#def_insideness"> * definition of insideness</a> can lead to situations where points * on the defining outline of the {@code shape} may not be considered * contained in the returned {@code bounds} object, but only in cases @@ -169,7 +171,7 @@ /** * Tests if the specified coordinates are inside the boundary of the * {@code Shape}, as described by the - * <a href="{@docRoot}/java/awt/Shape.html#def_insideness"> + * <a href="{@docRoot}/java.desktop/java/awt/Shape.html#def_insideness"> * definition of insideness</a>. * @param x the specified X coordinate to be tested * @param y the specified Y coordinate to be tested @@ -183,7 +185,7 @@ /** * Tests if a specified {@link Point2D} is inside the boundary * of the {@code Shape}, as described by the - * <a href="{@docRoot}/java/awt/Shape.html#def_insideness"> + * <a href="{@docRoot}/java.desktop/java/awt/Shape.html#def_insideness"> * definition of insideness</a>. * @param p the specified {@code Point2D} to be tested * @return {@code true} if the specified {@code Point2D} is diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataNode.java openjdk-11-11~24/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataNode.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/imageio/metadata/IIOMetadataNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -198,9 +198,7 @@ /** * A class representing a node in a meta-data tree, which implements - * the <a - * href="../../../../api/org/w3c/dom/Element.html"> - * {@code org.w3c.dom.Element}</a> interface and additionally allows + * the {@link Element org.w3c.dom.Element} interface and additionally allows * for the storage of non-textual objects via the * {@code getUserObject} and {@code setUserObject} methods. * diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/InvalidMidiDataException.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/InvalidMidiDataException.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/InvalidMidiDataException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/InvalidMidiDataException.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,6 @@ * error detail message. */ public InvalidMidiDataException() { - super(); } @@ -59,8 +58,7 @@ * * @param message the string to display as an error detail message */ - public InvalidMidiDataException(String message) { - + public InvalidMidiDataException(final String message) { super(message); } } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/MetaMessage.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -199,9 +199,7 @@ public Object clone() { byte[] newData = new byte[length]; System.arraycopy(data, 0, newData, 0, newData.length); - - MetaMessage event = new MetaMessage(newData); - return event; + return new MetaMessage(newData); } // HELPER METHODS diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/ShortMessage.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/ShortMessage.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/ShortMessage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/ShortMessage.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -432,9 +432,7 @@ public Object clone() { byte[] newData = new byte[length]; System.arraycopy(data, 0, newData, 0, newData.length); - - ShortMessage msg = new ShortMessage(newData); - return msg; + return new ShortMessage(newData); } /** diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/spi/MidiDeviceProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,6 @@ package javax.sound.midi.spi; import java.util.Arrays; -import java.util.Objects; import javax.sound.midi.MidiDevice; @@ -50,8 +49,7 @@ * @throws NullPointerException if {@code info} is {@code null} */ public boolean isDeviceSupported(final MidiDevice.Info info) { - Objects.requireNonNull(info); - return Arrays.asList(getDeviceInfo()).contains(info); + return Arrays.stream(getDeviceInfo()).anyMatch(info::equals); } /** diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/spi/MidiFileWriter.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/spi/MidiFileWriter.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/spi/MidiFileWriter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/spi/MidiFileWriter.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; +import java.util.Arrays; import javax.sound.midi.Sequence; @@ -69,15 +70,9 @@ * @return {@code true} if the file type is supported, otherwise * {@code false} */ - public boolean isFileTypeSupported(int fileType) { - - int types[] = getMidiFileTypes(); - for(int i=0; i<types.length; i++) { - if( fileType == types[i] ) { - return true; - } - } - return false; + public boolean isFileTypeSupported(final int fileType) { + return Arrays.stream(getMidiFileTypes()) + .anyMatch(type -> fileType == type); } /** @@ -90,15 +85,10 @@ * otherwise {@code false} * @throws NullPointerException if {@code sequence} is {@code null} */ - public boolean isFileTypeSupported(int fileType, Sequence sequence) { - - int types[] = getMidiFileTypes( sequence ); - for(int i=0; i<types.length; i++) { - if( fileType == types[i] ) { - return true; - } - } - return false; + public boolean isFileTypeSupported(final int fileType, + final Sequence sequence) { + return Arrays.stream(getMidiFileTypes(sequence)) + .anyMatch(type -> fileType == type); } /** diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/midi/SysexMessage.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -240,7 +240,6 @@ public Object clone() { byte[] newData = new byte[length]; System.arraycopy(data, 0, newData, 0, newData.length); - SysexMessage event = new SysexMessage(newData); - return event; + return new SysexMessage(newData); } } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/AudioFormat.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -267,7 +267,6 @@ * @see Encoding#ALAW */ public Encoding getEncoding() { - return encoding; } @@ -288,7 +287,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public float getSampleRate() { - return sampleRate; } @@ -309,7 +307,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public int getSampleSizeInBits() { - return sampleSizeInBits; } @@ -326,7 +323,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public int getChannels() { - return channels; } @@ -345,7 +341,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public int getFrameSize() { - return frameSize; } @@ -365,7 +360,6 @@ * @see AudioSystem#NOT_SPECIFIED */ public float getFrameRate() { - return frameRate; } @@ -378,7 +372,6 @@ * {@code false} if little-endian */ public boolean isBigEndian() { - return bigEndian; } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/CompoundControl.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/CompoundControl.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/CompoundControl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/CompoundControl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,13 +57,7 @@ * @return the set of member controls */ public Control[] getMemberControls() { - Control[] localArray = new Control[controls.length]; - - for (int i = 0; i < controls.length; i++) { - localArray[i] = controls[i]; - } - - return localArray; + return controls.clone(); } /** diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/EnumControl.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/EnumControl.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/EnumControl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/EnumControl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -107,14 +107,7 @@ * @return the set of possible values */ public Object[] getValues() { - - Object[] localArray = new Object[values.length]; - - for (int i = 0; i < values.length; i++) { - localArray[i] = values[i]; - } - - return localArray; + return values.clone(); } /** @@ -164,7 +157,7 @@ * {@link EnumControl#getValues} on an enumerated control of type * {@code REVERB}.) */ - public static final Type REVERB = new Type("Reverb"); + public static final Type REVERB = new Type("Reverb"); /** * Constructs a new enumerated control type. diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/LineEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -100,7 +100,6 @@ * @return the line responsible for this event */ public final Line getLine() { - return (Line)getSource(); } @@ -111,7 +110,6 @@ * {@link Type#START}, or {@link Type#STOP}) */ public final Type getType() { - return type; } @@ -137,7 +135,6 @@ * which is a reasonable definition.... */ public final long getFramePosition() { - return position; } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileWriter.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileWriter.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileWriter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/spi/AudioFileWriter.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ import java.io.File; import java.io.IOException; import java.io.OutputStream; -import java.util.Objects; +import java.util.Arrays; import javax.sound.sampled.AudioInputStream; import javax.sound.sampled.AudioSystem; @@ -63,17 +63,8 @@ * {@code false} * @throws NullPointerException if {@code fileType} is {@code null} */ - public boolean isFileTypeSupported(Type fileType) { - Objects.requireNonNull(fileType); - - Type types[] = getAudioFileTypes(); - - for(int i=0; i<types.length; i++) { - if( fileType.equals( types[i] ) ) { - return true; - } - } - return false; + public boolean isFileTypeSupported(final Type fileType) { + return Arrays.stream(getAudioFileTypes()).anyMatch(fileType::equals); } /** @@ -99,16 +90,10 @@ * @throws NullPointerException if {@code fileType} or {@code stream} are * {@code null} */ - public boolean isFileTypeSupported(Type fileType, AudioInputStream stream) { - Objects.requireNonNull(fileType); - Type types[] = getAudioFileTypes( stream ); - - for(int i=0; i<types.length; i++) { - if( fileType.equals( types[i] ) ) { - return true; - } - } - return false; + public boolean isFileTypeSupported(final Type fileType, + final AudioInputStream stream) { + return Arrays.stream(getAudioFileTypes(stream)) + .anyMatch(fileType::equals); } /** diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/spi/FormatConversionProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ package javax.sound.sampled.spi; -import java.util.stream.Stream; +import java.util.Arrays; import javax.sound.sampled.AudioFormat; import javax.sound.sampled.AudioInputStream; @@ -82,7 +82,8 @@ * @throws NullPointerException if {@code sourceEncoding} is {@code null} */ public boolean isSourceEncodingSupported(final Encoding sourceEncoding) { - return Stream.of(getSourceEncodings()).anyMatch(sourceEncoding::equals); + return Arrays.stream(getSourceEncodings()) + .anyMatch(sourceEncoding::equals); } /** @@ -96,7 +97,8 @@ * @throws NullPointerException if {@code targetEncoding} is {@code null} */ public boolean isTargetEncodingSupported(final Encoding targetEncoding) { - return Stream.of(getTargetEncodings()).anyMatch(targetEncoding::equals); + return Arrays.stream(getTargetEncodings()) + .anyMatch(targetEncoding::equals); } /** @@ -123,7 +125,7 @@ */ public boolean isConversionSupported(final Encoding targetEncoding, final AudioFormat sourceFormat) { - return Stream.of(getTargetEncodings(sourceFormat)) + return Arrays.stream(getTargetEncodings(sourceFormat)) .anyMatch(targetEncoding::equals); } @@ -155,7 +157,7 @@ public boolean isConversionSupported(final AudioFormat targetFormat, final AudioFormat sourceFormat) { final Encoding targetEncoding = targetFormat.getEncoding(); - return Stream.of(getTargetFormats(targetEncoding, sourceFormat)) + return Arrays.stream(getTargetFormats(targetEncoding, sourceFormat)) .anyMatch(targetFormat::matches); } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/spi/MixerProvider.java openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/spi/MixerProvider.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/sound/sampled/spi/MixerProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/sound/sampled/spi/MixerProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,7 @@ package javax.sound.sampled.spi; -import java.util.Objects; +import java.util.Arrays; import javax.sound.sampled.Mixer; @@ -54,17 +54,8 @@ * @throws NullPointerException if {@code info} is {@code null} * @see #getMixerInfo() */ - public boolean isMixerSupported(Mixer.Info info) { - Objects.requireNonNull(info); - - Mixer.Info infos[] = getMixerInfo(); - - for(int i=0; i<infos.length; i++){ - if( info.equals( infos[i] ) ) { - return true; - } - } - return false; + public boolean isMixerSupported(final Mixer.Info info) { + return Arrays.stream(getMixerInfo()).anyMatch(info::equals); } /** diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/DefaultListCellRenderer.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,7 +35,7 @@ import java.io.Serializable; import sun.swing.DefaultLookup; - +import sun.swing.SwingUtilities2; /** * Renders an item in a list. @@ -259,9 +259,10 @@ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { // Strings get interned... if (propertyName == "text" - || ((propertyName == "font" || propertyName == "foreground") - && oldValue != newValue - && getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) { + || ((SwingUtilities2.isScaleChanged(propertyName, oldValue, newValue) + || propertyName == "font" || propertyName == "foreground") + && oldValue != newValue + && getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) { super.firePropertyChange(propertyName, oldValue, newValue); } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JButton.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JButton.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JButton.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JButton.java 2018-07-25 15:36:46.000000000 +0000 @@ -151,7 +151,7 @@ * @see UIDefaults#getUI */ @BeanProperty(bound = false, expert = true, description - = "A string that specifies the name of the L&F class.") + = "A string that specifies the name of the L&F class.") public String getUIClassID() { return uiClassID; } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JCheckBox.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JCheckBox.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JCheckBox.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JCheckBox.java 2018-07-25 15:36:46.000000000 +0000 @@ -235,7 +235,7 @@ * @see UIDefaults#getUI */ @BeanProperty(bound = false, expert = true, description - = "A string that specifies the name of the L&F class") + = "A string that specifies the name of the L&F class") public String getUIClassID() { return uiClassID; } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JFileChooser.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JFileChooser.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JFileChooser.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JFileChooser.java 2018-07-25 15:36:46.000000000 +0000 @@ -861,7 +861,7 @@ * @since 1.3 */ @BeanProperty(preferred = true, description - = "Sets whether the approve & cancel buttons are shown.") + = "Sets whether the approve & cancel buttons are shown.") public void setControlButtonsAreShown(boolean b) { if(controlsShown == b) { return; @@ -1838,7 +1838,7 @@ * @see UIDefaults#getUI */ @BeanProperty(bound = false, expert = true, description - = "A string that specifies the name of the L&F class.") + = "A string that specifies the name of the L&F class.") public String getUIClassID() { return uiClassID; } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JPanel.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JPanel.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JPanel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JPanel.java 2018-07-25 15:36:46.000000000 +0000 @@ -127,7 +127,7 @@ } /** - * Returns the look and feel (L&amp;F) object that renders this component. + * Returns the look and feel (L&F) object that renders this component. * * @return the PanelUI object that renders this component * @since 1.4 @@ -159,7 +159,7 @@ * @see UIDefaults#getUI */ @BeanProperty(bound = false, expert = true, description - = "A string that specifies the name of the L&F class.") + = "A string that specifies the name of the L&F class.") public String getUIClassID() { return uiClassID; } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JRadioButton.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JRadioButton.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JRadioButton.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JRadioButton.java 2018-07-25 15:36:46.000000000 +0000 @@ -201,7 +201,7 @@ * @see UIDefaults#getUI */ @BeanProperty(bound = false, expert = true, description - = "A string that specifies the name of the L&F class.") + = "A string that specifies the name of the L&F class.") public String getUIClassID() { return uiClassID; } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JSpinner.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JSpinner.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JSpinner.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JSpinner.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,6 +29,8 @@ import java.awt.event.*; import javax.swing.event.*; +import javax.swing.plaf.FontUIResource; +import javax.swing.plaf.UIResource; import javax.swing.text.*; import javax.swing.plaf.SpinnerUI; @@ -743,20 +745,32 @@ Object source = e.getSource(); String name = e.getPropertyName(); - if ((source instanceof JFormattedTextField) && "value".equals(name)) { - Object lastValue = spinner.getValue(); + if (source instanceof JFormattedTextField) { + if ("value".equals(name)) { + Object lastValue = spinner.getValue(); - // Try to set the new value - try { - spinner.setValue(getTextField().getValue()); - } catch (IllegalArgumentException iae) { - // SpinnerModel didn't like new value, reset + // Try to set the new value try { - ((JFormattedTextField)source).setValue(lastValue); - } catch (IllegalArgumentException iae2) { - // Still bogus, nothing else we can do, the - // SpinnerModel and JFormattedTextField are now out - // of sync. + spinner.setValue(getTextField().getValue()); + } catch (IllegalArgumentException iae) { + // SpinnerModel didn't like new value, reset + try { + ((JFormattedTextField)source).setValue(lastValue); + } catch (IllegalArgumentException iae2) { + // Still bogus, nothing else we can do, the + // SpinnerModel and JFormattedTextField are now out + // of sync. + } + } + } else if ("font".equals(name)) { + Object newfont = e.getNewValue(); + if (newfont instanceof UIResource) { + // The text field font must match the JSpinner font if + // the text field font was not set by the user + Font font = spinner.getFont(); + if (!newfont.equals(font)) { + getTextField().setFont(new FontUIResource(font)); + } } } } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JSplitPane.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JSplitPane.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JSplitPane.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JSplitPane.java 2018-07-25 15:36:46.000000000 +0000 @@ -377,7 +377,7 @@ * @return the <code>SplitPaneUI</code> object that renders this component */ @BeanProperty(bound = false, expert = true, description - = "The L&F object that renders this component.") + = "The L&F object that renders this component.") public SplitPaneUI getUI() { return (SplitPaneUI)ui; } @@ -404,7 +404,7 @@ * @see UIDefaults#getUI */ @BeanProperty(bound = false, expert = true, description - = "A string that specifies the name of the L&F class.") + = "A string that specifies the name of the L&F class.") public String getUIClassID() { return uiClassID; } @@ -824,7 +824,7 @@ * <code>null</code> */ @BeanProperty(bound = false, description - = "The minimum location of the divider from the L&F.") + = "The minimum location of the divider from the L&F.") public int getMinimumDividerLocation() { SplitPaneUI ui = getUI(); diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JToggleButton.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JToggleButton.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/JToggleButton.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/JToggleButton.java 2018-07-25 15:36:46.000000000 +0000 @@ -195,7 +195,7 @@ * @see UIDefaults#getUI */ @BeanProperty(bound = false, description - = "A string that specifies the name of the L&F class") + = "A string that specifies the name of the L&F class") public String getUIClassID() { return uiClassID; } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicButtonListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ package javax.swing.plaf.basic; import sun.swing.DefaultLookup; +import sun.swing.SwingUtilities2; import sun.swing.UIAction; import java.awt.*; import java.awt.event.*; @@ -74,9 +75,8 @@ else if(prop == AbstractButton.CONTENT_AREA_FILLED_CHANGED_PROPERTY) { checkOpacity((AbstractButton) e.getSource() ); } - else if(prop == AbstractButton.TEXT_CHANGED_PROPERTY || - "font" == prop || "foreground" == prop || - "ancestor" == prop || "graphicsConfiguration" == prop) { + else if(prop == AbstractButton.TEXT_CHANGED_PROPERTY || "font" == prop + || "foreground" == prop || SwingUtilities2.isScaleChanged(e)) { AbstractButton b = (AbstractButton) e.getSource(); BasicHTML.updateRenderer(b, b.getText()); } @@ -156,8 +156,17 @@ map.clear(); map.put(KeyStroke.getKeyStroke(m, BasicLookAndFeel.getFocusAcceleratorKeyMask(), false), "pressed"); + map.put(KeyStroke.getKeyStroke(m, SwingUtilities2.setAltGraphMask + (BasicLookAndFeel.getFocusAcceleratorKeyMask()), + false), + "pressed"); + map.put(KeyStroke.getKeyStroke(m, BasicLookAndFeel.getFocusAcceleratorKeyMask(), true), "released"); + map.put(KeyStroke.getKeyStroke(m, + SwingUtilities2.setAltGraphMask + (BasicLookAndFeel.getFocusAcceleratorKeyMask()), true), + "released"); map.put(KeyStroke.getKeyStroke(m, 0, true), "released"); } else { diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicComboBoxUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ import java.beans.PropertyChangeEvent; import sun.awt.AppContext; import sun.swing.DefaultLookup; +import sun.swing.SwingUtilities2; import sun.swing.UIAction; /** @@ -1809,6 +1810,10 @@ isMinimumSizeDirty = true; isDisplaySizeDirty = true; comboBox.validate(); + } else if (SwingUtilities2.isScaleChanged(e)) { + isMinimumSizeDirty = true; + isDisplaySizeDirty = true; + comboBox.validate(); } else if ( propertyName == JComponent.TOOL_TIP_TEXT_KEY ) { updateToolTipTextForChildren(); diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLabelUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,6 +36,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +import java.awt.event.InputEvent; import java.awt.event.KeyEvent; import java.awt.Component; import java.awt.Container; @@ -402,6 +403,10 @@ } inputMap.clear(); inputMap.put(KeyStroke.getKeyStroke(dka, BasicLookAndFeel.getFocusAcceleratorKeyMask(), false), "press"); + inputMap.put(KeyStroke.getKeyStroke(dka, + SwingUtilities2.setAltGraphMask ( + BasicLookAndFeel.getFocusAcceleratorKeyMask()), + false), "press"); } else { InputMap inputMap = SwingUtilities.getUIInputMap @@ -472,8 +477,8 @@ public void propertyChange(PropertyChangeEvent e) { String name = e.getPropertyName(); - if (name == "text" || "font" == name || "foreground" == name || - "ancestor" == name || "graphicsConfiguration" == name) { + if (name == "text" || "font" == name || "foreground" == name + || SwingUtilities2.isScaleChanged(e)) { // remove the old html view client property if one // existed, and install a new one if the text installed // into the JLabel is html source. @@ -520,6 +525,8 @@ int dka = label.getDisplayedMnemonic(); putOnRelease(inputMap, dka, BasicLookAndFeel .getFocusAcceleratorKeyMask()); + putOnRelease(inputMap, dka, SwingUtilities2.setAltGraphMask ( + BasicLookAndFeel.getFocusAcceleratorKeyMask())); // Need this when the sticky keys are enabled putOnRelease(inputMap, dka, 0); // Need this if ALT is released before the accelerator @@ -539,6 +546,9 @@ int dka = label.getDisplayedMnemonic(); removeOnRelease(inputMap, dka, BasicLookAndFeel .getFocusAcceleratorKeyMask()); + removeOnRelease(inputMap, dka, + SwingUtilities2.setAltGraphMask ( + BasicLookAndFeel.getFocusAcceleratorKeyMask())); removeOnRelease(inputMap, dka, 0); removeOnRelease(inputMap, KeyEvent.VK_ALT, 0); } @@ -555,6 +565,9 @@ } else { putOnRelease(inputMap, dka, BasicLookAndFeel .getFocusAcceleratorKeyMask()); + putOnRelease(inputMap, dka, + SwingUtilities2.setAltGraphMask ( + BasicLookAndFeel.getFocusAcceleratorKeyMask())); // Need this when the sticky keys are enabled putOnRelease(inputMap, dka, 0); } @@ -572,6 +585,9 @@ if (isCommand) { removeOnRelease(inputMap, dka, BasicLookAndFeel .getFocusAcceleratorKeyMask()); + removeOnRelease(inputMap, dka, + SwingUtilities2.setAltGraphMask ( + BasicLookAndFeel.getFocusAcceleratorKeyMask())); removeOnRelease(inputMap, dka, 0); } else { removeOnRelease(inputMap, KeyEvent.VK_ALT, 0); diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicListUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -2656,7 +2656,8 @@ updateLayoutStateNeeded |= cellRendererChanged; redrawList(); } - else if (propertyName == "font") { + else if (propertyName == "font" + || SwingUtilities2.isScaleChanged(e)) { updateLayoutStateNeeded |= fontChanged; redrawList(); } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java 2018-07-25 15:36:46.000000000 +0000 @@ -1093,7 +1093,9 @@ "Menu.submenuPopupOffsetX", 0, "Menu.submenuPopupOffsetY", 0, "Menu.shortcutKeys", new int[]{ - SwingUtilities2.getSystemMnemonicKeyMask() + SwingUtilities2.getSystemMnemonicKeyMask(), + SwingUtilities2.setAltGraphMask( + SwingUtilities2.getSystemMnemonicKeyMask()) }, "Menu.crossMenuMnemonic", Boolean.TRUE, // Menu.cancelMode affects the cancel menu action behaviour; diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuItemUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -434,6 +434,7 @@ return null; } + @SuppressWarnings("deprecation") void updateAcceleratorBinding() { KeyStroke accelerator = menuItem.getAccelerator(); InputMap windowInputMap = SwingUtilities.getUIInputMap( @@ -450,6 +451,45 @@ JComponent.WHEN_IN_FOCUSED_WINDOW, windowInputMap); } windowInputMap.put(accelerator, "doClick"); + + int modifiers = accelerator.getModifiers(); + if (((modifiers & InputEvent.ALT_DOWN_MASK) != 0) && + ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0)) { + //When both ALT and ALT_GRAPH are set, add the ALT only + // modifier keystroke which is used for left ALT key. + // Unsetting the ALT_GRAPH will do that as ALT is already set + modifiers &= ~InputEvent.ALT_GRAPH_DOWN_MASK; + modifiers &= ~InputEvent.ALT_GRAPH_MASK; + KeyStroke keyStroke = KeyStroke.getKeyStroke(accelerator.getKeyCode(), + modifiers, accelerator.isOnKeyRelease()); + windowInputMap.put(keyStroke, "doClick"); + } else if (((modifiers & InputEvent.ALT_DOWN_MASK) != 0) && ( + (modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) == 0)) { + //When only ALT modifier is set, add the ALT + ALT_GRAPH + // modifier keystroke which is used for right ALT key + modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK; + KeyStroke keyStroke = KeyStroke.getKeyStroke(accelerator.getKeyCode(), + modifiers, accelerator.isOnKeyRelease()); + windowInputMap.put(keyStroke, "doClick"); + } else if ((modifiers & InputEvent.ALT_GRAPH_DOWN_MASK) != 0) { + //When only ALT_GRAPH is set, remove the ALT_GRAPH only + // modifier and add the ALT and ALT+ALT_GRAPH modifiers + // keystroke which are used for left ALT key and right ALT + // respectively + modifiers &= ~InputEvent.ALT_GRAPH_DOWN_MASK; + modifiers &= ~InputEvent.ALT_GRAPH_MASK; + + modifiers |= InputEvent.ALT_DOWN_MASK; + KeyStroke keyStroke = KeyStroke.getKeyStroke(accelerator.getKeyCode(), + modifiers, accelerator.isOnKeyRelease()); + windowInputMap.put(keyStroke, "doClick"); + + //Add ALT+ALT_GRAPH modifier which is used for right ALT key + modifiers |= InputEvent.ALT_GRAPH_DOWN_MASK; + keyStroke = KeyStroke.getKeyStroke(accelerator.getKeyCode(), + modifiers, accelerator.isOnKeyRelease()); + windowInputMap.put(keyStroke, "doClick"); + } } } @@ -1105,9 +1145,8 @@ if (name == "labelFor" || name == "displayedMnemonic" || name == "accelerator") { updateAcceleratorBinding(); - } else if (name == "text" || "font" == name || - "foreground" == name || - "ancestor" == name || "graphicsConfiguration" == name) { + } else if (name == "text" || "font" == name || "foreground" == name + || SwingUtilities2.isScaleChanged(e)) { // remove the old html view client property if one // existed, and install a new one if the text installed // into the JLabel is html source. diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicMenuUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -129,7 +129,8 @@ int[] shortcutKeys = (int[])DefaultLookup.get(menuItem, this, "Menu.shortcutKeys"); if (shortcutKeys == null) { - shortcutKeys = new int[] {KeyEvent.ALT_MASK}; + shortcutKeys = new int[] {KeyEvent.ALT_MASK, + KeyEvent.ALT_MASK | KeyEvent.ALT_GRAPH_MASK}; } if (mnemonic == lastMnemonic) { return; diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSliderUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSliderUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSliderUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicSliderUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,7 @@ import javax.swing.event.*; import javax.swing.plaf.*; import sun.swing.DefaultLookup; +import sun.swing.SwingUtilities2; import sun.swing.UIAction; @@ -1829,6 +1830,7 @@ propertyName == "paintTicks" || propertyName == "paintTrack" || propertyName == "font" || + SwingUtilities2.isScaleChanged(e) || propertyName == "paintLabels" || propertyName == "Slider.paintThumbArrowShape") { checkedLabelBaselines = false; diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTabbedPaneUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -606,6 +606,10 @@ } mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, BasicLookAndFeel.getFocusAcceleratorKeyMask()), "setSelectedIndex"); + mnemonicInputMap.put(KeyStroke.getKeyStroke(mnemonic, + SwingUtilities2.setAltGraphMask( + BasicLookAndFeel.getFocusAcceleratorKeyMask())), + "setSelectedIndex"); mnemonicToIndexMap.put(Integer.valueOf(mnemonic), Integer.valueOf(index)); } @@ -4004,7 +4008,7 @@ } else if (name == "indexForNullComponent") { isRunsDirty = true; updateHtmlViews((Integer)e.getNewValue(), true); - } else if (name == "font") { + } else if (name == "font" || SwingUtilities2.isScaleChanged(e)) { calculatedBaseline = false; } } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTextUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,6 +42,8 @@ import javax.swing.plaf.synth.SynthUI; import sun.swing.DefaultLookup; import sun.awt.AppContext; +import sun.swing.SwingUtilities2; + import javax.swing.plaf.basic.DragRecognitionSupport.BeforeDrag; /** @@ -511,6 +513,10 @@ km.clear(); if (accelerator != '\0') { km.put(KeyStroke.getKeyStroke(accelerator, BasicLookAndFeel.getFocusAcceleratorKeyMask()), "requestFocus"); + km.put(KeyStroke.getKeyStroke(accelerator, + SwingUtilities2.setAltGraphMask( + BasicLookAndFeel.getFocusAcceleratorKeyMask())), + "requestFocus"); } } } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -260,9 +260,8 @@ PropertyChangeListener { public void propertyChange(PropertyChangeEvent e) { String name = e.getPropertyName(); - if (name.equals("tiptext") || "font".equals(name) || - "foreground".equals(name) || - "ancestor" == name || "graphicsConfiguration" == name) { + if (name.equals("tiptext") || "foreground".equals(name) + || "font".equals(name) || SwingUtilities2.isScaleChanged(e)) { // remove the old html view client property if one // existed, and install a new one if the text installed // into the JLabel is html source. diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/basic/BasicTreeUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -3843,7 +3843,8 @@ else if(changeName == JTree.SELECTION_MODEL_PROPERTY) { setSelectionModel(tree.getSelectionModel()); } - else if(changeName == "font") { + else if(changeName == "font" + || SwingUtilities2.isScaleChanged(event)) { completeEditing(); if(treeState != null) treeState.invalidateSizes(); diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/plaf/synth/SynthToolTipUI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,7 @@ import javax.swing.plaf.ComponentUI; import javax.swing.text.View; +import sun.swing.SwingUtilities2; /** * Provides the Synth L&F UI delegate for @@ -226,9 +227,8 @@ updateStyle((JToolTip)e.getSource()); } String name = e.getPropertyName(); - if (name.equals("tiptext") || "font".equals(name) || - "foreground".equals(name) || - "ancestor" == name || "graphicsConfiguration" == name) { + if (name.equals("tiptext") || SwingUtilities2.isScaleChanged(e) + || "foreground".equals(name) || "font".equals(name)) { // remove the old html view client property if one // existed, and install a new one if the text installed // into the JLabel is html source. diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/table/DefaultTableCellRenderer.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/table/DefaultTableCellRenderer.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/table/DefaultTableCellRenderer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/table/DefaultTableCellRenderer.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,7 @@ import java.io.Serializable; import sun.swing.DefaultLookup; - +import sun.swing.SwingUtilities2; /** * The standard class for rendering (displaying) individual cells @@ -345,11 +345,12 @@ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { // Strings get interned... if (propertyName=="text" - || propertyName == "labelFor" - || propertyName == "displayedMnemonic" - || ((propertyName == "font" || propertyName == "foreground") - && oldValue != newValue - && getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) { + || propertyName == "labelFor" + || propertyName == "displayedMnemonic" + || ((SwingUtilities2.isScaleChanged(propertyName, oldValue, newValue) + || propertyName == "font" || propertyName == "foreground") + && oldValue != newValue + && getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) { super.firePropertyChange(propertyName, oldValue, newValue); } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/text/html/ImageView.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,13 +24,41 @@ */ package javax.swing.text.html; -import java.awt.*; +import java.awt.Rectangle; +import java.awt.Image; +import java.awt.Container; +import java.awt.Color; +import java.awt.Shape; +import java.awt.Graphics; +import java.awt.Toolkit; + import java.awt.image.ImageObserver; -import java.net.*; +import java.net.URL; +import java.net.MalformedURLException; + import java.util.Dictionary; -import javax.swing.*; -import javax.swing.text.*; -import javax.swing.event.*; + +import javax.swing.GrayFilter; +import javax.swing.ImageIcon; +import javax.swing.Icon; +import javax.swing.UIManager; +import javax.swing.SwingUtilities; + +import javax.swing.text.JTextComponent; +import javax.swing.text.StyledDocument; +import javax.swing.text.View; +import javax.swing.text.AttributeSet; +import javax.swing.text.Element; +import javax.swing.text.ViewFactory; +import javax.swing.text.Position; +import javax.swing.text.Segment; +import javax.swing.text.Highlighter; +import javax.swing.text.LayeredHighlighter; +import javax.swing.text.AbstractDocument; +import javax.swing.text.Document; +import javax.swing.text.BadLocationException; + +import javax.swing.event.DocumentEvent; /** * View of an Image, intended to support the HTML <IMG> tag. @@ -744,12 +772,22 @@ // anything that might cause the image to be loaded, and thus the // ImageHandler to be called. newWidth = getIntAttr(HTML.Attribute.WIDTH, -1); + newHeight = getIntAttr(HTML.Attribute.HEIGHT, -1); + if (newWidth > 0) { newState |= WIDTH_FLAG; + if (newHeight <= 0) { + newHeight = newWidth; + newState |= HEIGHT_FLAG; + } } - newHeight = getIntAttr(HTML.Attribute.HEIGHT, -1); + if (newHeight > 0) { newState |= HEIGHT_FLAG; + if (newWidth <= 0) { + newWidth = newHeight; + newState |= WIDTH_FLAG; + } } if (newWidth <= 0) { diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java --- openjdk-11-11~19/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/javax/swing/tree/DefaultTreeCellRenderer.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,6 +43,7 @@ import javax.swing.UIManager; import javax.swing.border.EmptyBorder; import sun.swing.DefaultLookup; +import sun.swing.SwingUtilities2; /** * Displays an entry in a tree. @@ -690,9 +691,10 @@ protected void firePropertyChange(String propertyName, Object oldValue, Object newValue) { // Strings get interned... if (propertyName == "text" - || ((propertyName == "font" || propertyName == "foreground") - && oldValue != newValue - && getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) { + || ((SwingUtilities2.isScaleChanged(propertyName, oldValue, newValue) + || propertyName == "font" || propertyName == "foreground") + && oldValue != newValue + && getClientProperty(javax.swing.plaf.basic.BasicHTML.propertyKey) != null)) { super.firePropertyChange(propertyName, oldValue, newValue); } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/sun/awt/DesktopBrowse.java openjdk-11-11~24/src/java.desktop/share/classes/sun/awt/DesktopBrowse.java --- openjdk-11-11~19/src/java.desktop/share/classes/sun/awt/DesktopBrowse.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/sun/awt/DesktopBrowse.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.awt; - -import java.net.URL; - -public abstract class DesktopBrowse { - private static volatile DesktopBrowse mInstance; - - public static void setInstance(DesktopBrowse instance) { - if (mInstance != null) { - throw new IllegalStateException("DesktopBrowse instance has already been set."); - } - mInstance = instance; - } - - public static DesktopBrowse getInstance() { - return mInstance; - } - - - public abstract void browse(URL url); -} diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/sun/font/CharToGlyphMapper.java openjdk-11-11~24/src/java.desktop/share/classes/sun/font/CharToGlyphMapper.java --- openjdk-11-11~19/src/java.desktop/share/classes/sun/font/CharToGlyphMapper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/sun/font/CharToGlyphMapper.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,6 +36,10 @@ public static final int HI_SURROGATE_END = 0xDBFF; public static final int LO_SURROGATE_START = 0xDC00; public static final int LO_SURROGATE_END = 0xDFFF; + public static final int VS_START = 0xFE00; + public static final int VS_END = 0xFE0F; + public static final int VSS_START = 0xE0100; + public static final int VSS_END = 0xE01FF; public static final int UNINITIALIZED_GLYPH = -1; public static final int INVISIBLE_GLYPH_ID = 0xffff; @@ -77,6 +81,11 @@ return glyphs[0]; } + public int charToVariationGlyph(int unicode, int variationSelector) { + // Override this if variation selector is supported. + return charToGlyph(unicode); + } + public abstract int getNumGlyphs(); public abstract void charsToGlyphs(int count, @@ -88,4 +97,9 @@ public abstract void charsToGlyphs(int count, int[] unicodes, int[] glyphs); + public static boolean isVariationSelector(int charCode) { + return ((charCode >= VSS_START && charCode <= VSS_END) || + (charCode >= VS_START && charCode <= VS_END)); + } + } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/sun/font/CMap.java openjdk-11-11~24/src/java.desktop/share/classes/sun/font/CMap.java --- openjdk-11-11~19/src/java.desktop/share/classes/sun/font/CMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/sun/font/CMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -140,6 +140,7 @@ * Using this saves running character coverters repeatedly. */ char[] xlat; + UVS uvs = null; static CMap initialize(TrueTypeFont font) { @@ -149,6 +150,7 @@ int three0=0, three1=0, three2=0, three3=0, three4=0, three5=0, three6=0, three10=0; + int zero5 = 0; // for Unicode Variation Sequences boolean threeStar = false; ByteBuffer cmapBuffer = font.getTableBuffer(TrueTypeFont.cmapTag); @@ -173,6 +175,12 @@ case 6: three6 = offset; break; // Johab case 10: three10 = offset; break; // MS Unicode surrogates } + } else if (platformID == 0) { + encodingID = cmapBuffer.getShort(); + offset = cmapBuffer.getInt(); + if (encodingID == 5) { + zero5 = offset; + } } } @@ -262,6 +270,10 @@ */ cmap = createCMap(cmapBuffer, cmapBuffer.getInt(8), null); } + // For Unicode Variation Sequences + if (cmap != null && zero5 != 0) { + cmap.createUVS(cmapBuffer, zero5); + } return cmap; } @@ -424,6 +436,25 @@ } } + private void createUVS(ByteBuffer buffer, int offset) { + int subtableFormat = buffer.getChar(offset); + if (subtableFormat == 14) { + long subtableLength = buffer.getInt(offset + 2) & INTMASK; + if (offset + subtableLength > buffer.capacity()) { + if (FontUtilities.isLogging()) { + FontUtilities.getLogger() + .warning("Cmap UVS subtable overflows buffer."); + } + } + try { + this.uvs = new UVS(buffer, offset); + } catch (Throwable t) { + t.printStackTrace(); + } + } + return; + } + /* final char charVal(byte[] cmap, int index) { return (char)(((0xff & cmap[index]) << 8)+(0xff & cmap[index+1])); @@ -1059,4 +1090,87 @@ } return -1; } + + static class UVS { + int numSelectors; + int[] selector; + + //for Non-Default UVS Table + int[] numUVSMapping; + int[][] unicodeValue; + char[][] glyphID; + + UVS(ByteBuffer buffer, int offset) { + numSelectors = buffer.getInt(offset+6); + selector = new int[numSelectors]; + numUVSMapping = new int[numSelectors]; + unicodeValue = new int[numSelectors][]; + glyphID = new char[numSelectors][]; + + for (int i = 0; i < numSelectors; i++) { + buffer.position(offset + 10 + i * 11); + selector[i] = (buffer.get() & 0xff) << 16; //UINT24 + selector[i] += (buffer.get() & 0xff) << 8; + selector[i] += buffer.get() & 0xff; + + //skip Default UVS Table + + //for Non-Default UVS Table + int tableOffset = buffer.getInt(offset + 10 + i * 11 + 7); + if (tableOffset == 0) { + numUVSMapping[i] = 0; + } else if (tableOffset > 0) { + buffer.position(offset+tableOffset); + numUVSMapping[i] = buffer.getInt() & INTMASK; + unicodeValue[i] = new int[numUVSMapping[i]]; + glyphID[i] = new char[numUVSMapping[i]]; + + for (int j = 0; j < numUVSMapping[i]; j++) { + int temp = (buffer.get() & 0xff) << 16; //UINT24 + temp += (buffer.get() & 0xff) << 8; + temp += buffer.get() & 0xff; + unicodeValue[i][j] = temp; + glyphID[i][j] = buffer.getChar(); + } + } + } + } + + static final int VS_NOGLYPH = 0; + private int getGlyph(int charCode, int variationSelector) { + int targetSelector = -1; + for (int i = 0; i < numSelectors; i++) { + if (selector[i] == variationSelector) { + targetSelector = i; + break; + } + } + if (targetSelector == -1) { + return VS_NOGLYPH; + } + if (numUVSMapping[targetSelector] > 0) { + int index = java.util.Arrays.binarySearch( + unicodeValue[targetSelector], charCode); + if (index >= 0) { + return glyphID[targetSelector][index]; + } + } + return VS_NOGLYPH; + } + } + + char getVariationGlyph(int charCode, int variationSelector) { + char glyph = 0; + if (uvs == null) { + glyph = getGlyph(charCode); + } else { + int result = uvs.getGlyph(charCode, variationSelector); + if (result > 0) { + glyph = (char)(result & 0xFFFF); + } else { + glyph = getGlyph(charCode); + } + } + return glyph; + } } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/sun/font/CompositeGlyphMapper.java openjdk-11-11~24/src/java.desktop/share/classes/sun/font/CompositeGlyphMapper.java --- openjdk-11-11~19/src/java.desktop/share/classes/sun/font/CompositeGlyphMapper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/sun/font/CompositeGlyphMapper.java 2018-07-25 15:36:46.000000000 +0000 @@ -214,7 +214,8 @@ if (code < FontUtilities.MIN_LAYOUT_CHARCODE) { continue; } - else if (FontUtilities.isComplexCharCode(code)) { + else if (FontUtilities.isComplexCharCode(code) || + CharToGlyphMapper.isVariationSelector(code)) { return true; } else if (code >= 0x10000) { diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/sun/font/Font2D.java openjdk-11-11~24/src/java.desktop/share/classes/sun/font/Font2D.java --- openjdk-11-11~19/src/java.desktop/share/classes/sun/font/Font2D.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/sun/font/Font2D.java 2018-07-25 15:36:46.000000000 +0000 @@ -524,6 +524,10 @@ return getMapper().charToGlyph(wchar); } + public int charToVariationGlyph(int wchar, int variationSelector) { + return getMapper().charToVariationGlyph(wchar, variationSelector); + } + public int getMissingGlyphCode() { return getMapper().getMissingGlyphCode(); } diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java openjdk-11-11~24/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java --- openjdk-11-11~19/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/sun/font/TrueTypeGlyphMapper.java 2018-07-25 15:36:46.000000000 +0000 @@ -93,6 +93,32 @@ } } + private char getGlyphFromCMAP(int charCode, int variationSelector) { + if (variationSelector == 0) { + return getGlyphFromCMAP(charCode); + } + try { + char glyphCode = cmap.getVariationGlyph(charCode, + variationSelector); + if (glyphCode < numGlyphs || + glyphCode >= FileFontStrike.INVISIBLE_GLYPHS) { + return glyphCode; + } else { + if (FontUtilities.isLogging()) { + FontUtilities.getLogger().warning + (font + " out of range glyph id=" + + Integer.toHexString((int)glyphCode) + + " for char " + Integer.toHexString(charCode) + + " for vs " + Integer.toHexString(variationSelector)); + } + return (char)missingGlyph; + } + } catch (Exception e) { + handleBadCMAP(); + return (char) missingGlyph; + } + } + private void handleBadCMAP() { if (FontUtilities.isLogging()) { FontUtilities.getLogger().severe("Null Cmap for " + font + @@ -136,6 +162,18 @@ return glyph; } + @Override + public int charToVariationGlyph(int unicode, int variationSelector) { + if (needsJAremapping) { + unicode = remapJAIntChar(unicode); + } + int glyph = getGlyphFromCMAP(unicode, variationSelector); + if (font.checkUseNatives() && glyph < font.glyphToCharMap.length) { + font.glyphToCharMap[glyph] = (char)unicode; + } + return glyph; + } + public void charsToGlyphs(int count, int[] unicodes, int[] glyphs) { for (int i=0;i<count;i++) { if (needsJAremapping) { @@ -221,7 +259,8 @@ if (code < FontUtilities.MIN_LAYOUT_CHARCODE) { continue; } - else if (FontUtilities.isComplexCharCode(code)) { + else if (FontUtilities.isComplexCharCode(code) || + CharToGlyphMapper.isVariationSelector(code)) { return true; } else if (code >= 0x10000) { diff -Nru openjdk-11-11~19/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java openjdk-11-11~24/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java --- openjdk-11-11~19/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/classes/sun/swing/SwingUtilities2.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,47 +25,94 @@ package sun.swing; -import java.lang.reflect.*; -import java.awt.*; -import static java.awt.RenderingHints.*; -import java.awt.event.*; -import java.awt.font.*; -import java.awt.geom.Rectangle2D; +import java.awt.AWTEvent; +import java.awt.Color; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FocusTraversalPolicy; +import java.awt.Font; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.GraphicsConfiguration; +import java.awt.GraphicsEnvironment; +import java.awt.Point; +import java.awt.PrintGraphics; +import java.awt.Rectangle; +import java.awt.RenderingHints; +import java.awt.Shape; +import java.awt.Toolkit; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.event.MouseEvent; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; +import java.awt.font.LineBreakMeasurer; +import java.awt.font.TextAttribute; +import java.awt.font.TextHitInfo; +import java.awt.font.TextLayout; import java.awt.geom.AffineTransform; -import static java.awt.geom.AffineTransform.TYPE_FLIP; -import static java.awt.geom.AffineTransform.TYPE_MASK_SCALE; -import static java.awt.geom.AffineTransform.TYPE_TRANSLATION; +import java.awt.geom.Rectangle2D; import java.awt.print.PrinterGraphics; -import java.text.BreakIterator; -import java.text.CharacterIterator; +import java.beans.PropertyChangeEvent; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.lang.reflect.Modifier; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.text.AttributedCharacterIterator; import java.text.AttributedString; +import java.text.BreakIterator; +import java.text.CharacterIterator; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Objects; +import java.util.concurrent.Callable; +import java.util.concurrent.Future; +import java.util.concurrent.FutureTask; -import javax.swing.*; +import javax.swing.JComponent; +import javax.swing.JList; +import javax.swing.JTable; +import javax.swing.ListCellRenderer; +import javax.swing.ListSelectionModel; +import javax.swing.SwingUtilities; +import javax.swing.UIDefaults; +import javax.swing.UIManager; import javax.swing.event.TreeModelEvent; -import javax.swing.text.Highlighter; -import javax.swing.text.JTextComponent; -import javax.swing.text.DefaultHighlighter; -import javax.swing.text.DefaultCaret; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumnModel; +import javax.swing.text.DefaultCaret; +import javax.swing.text.DefaultHighlighter; +import javax.swing.text.Highlighter; +import javax.swing.text.JTextComponent; import javax.swing.tree.TreeModel; import javax.swing.tree.TreePath; -import sun.java2d.pipe.Region; -import sun.print.ProxyPrintGraphics; -import sun.awt.*; -import java.io.*; -import java.security.AccessController; -import java.security.PrivilegedAction; -import java.util.*; +import sun.awt.AWTAccessor; +import sun.awt.AWTPermissions; +import sun.awt.AppContext; +import sun.awt.SunToolkit; import sun.font.FontDesignMetrics; import sun.font.FontUtilities; import sun.java2d.SunGraphicsEnvironment; +import sun.print.ProxyPrintGraphics; -import java.util.concurrent.Callable; -import java.util.concurrent.Future; -import java.util.concurrent.FutureTask; +import static java.awt.RenderingHints.KEY_TEXT_ANTIALIASING; +import static java.awt.RenderingHints.KEY_TEXT_LCD_CONTRAST; +import static java.awt.RenderingHints.VALUE_FRACTIONALMETRICS_DEFAULT; +import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_DEFAULT; +import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HBGR; +import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB; +import static java.awt.RenderingHints.VALUE_TEXT_ANTIALIAS_OFF; +import static java.awt.geom.AffineTransform.TYPE_FLIP; +import static java.awt.geom.AffineTransform.TYPE_MASK_SCALE; +import static java.awt.geom.AffineTransform.TYPE_TRANSLATION; /** * A collection of utility methods for Swing. @@ -2139,6 +2186,15 @@ return -1; } + /** + * Sets the InputEvent.ALT_GRAPH mask on any modifier passed to the function + * @param modifier the modifier passed + * @return the modifier retiurned with ALT_GRAPH flag set + */ + public static int setAltGraphMask(int modifier) { + return (modifier | InputEvent.ALT_GRAPH_DOWN_MASK); + } + @SuppressWarnings("deprecation") public static int getSystemMnemonicKeyMask() { Toolkit toolkit = Toolkit.getDefaultToolkit(); @@ -2247,4 +2303,40 @@ public interface RepaintListener { void repaintPerformed(JComponent c, int x, int y, int w, int h); } + + /** + * Returns whether or not the scale used by {@code GraphicsConfiguration} + * was changed. + * + * @param ev a {@code PropertyChangeEvent} + * @return whether or not the scale was changed + * @since 11 + */ + public static boolean isScaleChanged(final PropertyChangeEvent ev) { + return isScaleChanged(ev.getPropertyName(), ev.getOldValue(), + ev.getNewValue()); + } + + /** + * Returns whether or not the scale used by {@code GraphicsConfiguration} + * was changed. + * + * @param name the name of the property + * @param oldValue the old value of the property + * @param newValue the new value of the property + * @return whether or not the scale was changed + * @since 11 + */ + public static boolean isScaleChanged(final String name, + final Object oldValue, + final Object newValue) { + if (oldValue == newValue || !"graphicsConfiguration".equals(name)) { + return false; + } + var newGC = (GraphicsConfiguration) oldValue; + var oldGC = (GraphicsConfiguration) newValue; + var newTx = newGC != null ? newGC.getDefaultTransform() : null; + var oldTx = oldGC != null ? oldGC.getDefaultTransform() : null; + return !Objects.equals(newTx, oldTx); + } } diff -Nru openjdk-11-11~19/src/java.desktop/share/legal/harfbuzz.md openjdk-11-11~24/src/java.desktop/share/legal/harfbuzz.md --- openjdk-11-11~19/src/java.desktop/share/legal/harfbuzz.md 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/legal/harfbuzz.md 2018-07-25 15:36:46.000000000 +0000 @@ -1,4 +1,4 @@ -## Harfbuzz v1.7.6 +## Harfbuzz v1.8.2 ### Harfbuzz License diff -Nru openjdk-11-11~19/src/java.desktop/share/native/common/font/sunfontids.h openjdk-11-11~24/src/java.desktop/share/native/common/font/sunfontids.h --- openjdk-11-11~19/src/java.desktop/share/native/common/font/sunfontids.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/common/font/sunfontids.h 2018-07-25 15:36:46.000000000 +0000 @@ -39,6 +39,7 @@ jmethodID getTableBytesMID; jmethodID canDisplayMID; jmethodID f2dCharToGlyphMID; + jmethodID f2dCharToVariationGlyphMID; /* sun/font/CharToGlyphMapper methods */ jmethodID charToGlyphMID; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-atomic-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -63,7 +63,6 @@ } typedef LONG hb_atomic_int_impl_t; -#define HB_ATOMIC_INT_IMPL_INIT(V) (V) #define hb_atomic_int_impl_add(AI, V) InterlockedExchangeAdd (&(AI), (V)) #define hb_atomic_ptr_impl_get(P) (_HBMemoryBarrier (), (void *) *(P)) @@ -73,7 +72,6 @@ #elif !defined(HB_NO_MT) && defined(HAVE_INTEL_ATOMIC_PRIMITIVES) typedef int hb_atomic_int_impl_t; -#define HB_ATOMIC_INT_IMPL_INIT(V) (V) #define hb_atomic_int_impl_add(AI, V) __sync_fetch_and_add (&(AI), (V)) #define hb_atomic_ptr_impl_get(P) (void *) (__sync_synchronize (), *(P)) @@ -86,7 +84,6 @@ #include <mbarrier.h> typedef unsigned int hb_atomic_int_impl_t; -#define HB_ATOMIC_INT_IMPL_INIT(V) (V) #define hb_atomic_int_impl_add(AI, V) ( ({__machine_rw_barrier ();}), atomic_add_int_nv (&(AI), (V)) - (V)) #define hb_atomic_ptr_impl_get(P) ( ({__machine_rw_barrier ();}), (void *) *(P)) @@ -104,7 +101,6 @@ typedef int32_t hb_atomic_int_impl_t; -#define HB_ATOMIC_INT_IMPL_INIT(V) (V) #define hb_atomic_int_impl_add(AI, V) (OSAtomicAdd32Barrier ((V), &(AI)) - (V)) #define hb_atomic_ptr_impl_get(P) (OSMemoryBarrier (), (void *) *(P)) @@ -138,7 +134,6 @@ } typedef int hb_atomic_int_impl_t; -#define HB_ATOMIC_INT_IMPL_INIT(V) (V) #define hb_atomic_int_impl_add(AI, V) _hb_fetch_and_add (&(AI), (V)) #define hb_atomic_ptr_impl_get(P) (__sync(), (void *) *(P)) @@ -149,7 +144,6 @@ #define HB_ATOMIC_INT_NIL 1 /* Warn that fallback implementation is in use. */ typedef volatile int hb_atomic_int_impl_t; -#define HB_ATOMIC_INT_IMPL_INIT(V) (V) #define hb_atomic_int_impl_add(AI, V) (((AI) += (V)) - (V)) #define hb_atomic_ptr_impl_get(P) ((void *) *(P)) @@ -159,7 +153,6 @@ #else /* HB_NO_MT */ typedef int hb_atomic_int_impl_t; -#define HB_ATOMIC_INT_IMPL_INIT(V) (V) #define hb_atomic_int_impl_add(AI, V) (((AI) += (V)) - (V)) #define hb_atomic_ptr_impl_get(P) ((void *) *(P)) @@ -169,7 +162,7 @@ #endif -#define HB_ATOMIC_INT_INIT(V) {HB_ATOMIC_INT_IMPL_INIT(V)} +#define HB_ATOMIC_INT_INIT(V) {V} struct hb_atomic_int_t { diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.cc 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,6 @@ /* * Copyright © 2009 Red Hat, Inc. + * Copyright © 2018 Ebrahim Byagowi * * This is part of HarfBuzz, a text shaping library. * @@ -31,8 +32,7 @@ #include "hb-private.hh" #include "hb-debug.hh" - -#include "hb-object-private.hh" +#include "hb-blob-private.hh" #ifdef HAVE_SYS_MMAN_H #ifdef HAVE_UNISTD_H @@ -43,35 +43,9 @@ #include <stdio.h> #include <errno.h> +#include <stdlib.h> -struct hb_blob_t { - hb_object_header_t header; - ASSERT_POD (); - - bool immutable; - - const char *data; - unsigned int length; - hb_memory_mode_t mode; - - void *user_data; - hb_destroy_func_t destroy; -}; - - -static bool _try_writable (hb_blob_t *blob); - -static void -_hb_blob_destroy_user_data (hb_blob_t *blob) -{ - if (blob->destroy) { - blob->destroy (blob->user_data); - blob->user_data = nullptr; - blob->destroy = nullptr; - } -} - /** * hb_blob_create: (skip) * @data: Pointer to blob data. @@ -114,7 +88,7 @@ if (blob->mode == HB_MEMORY_MODE_DUPLICATE) { blob->mode = HB_MEMORY_MODE_READONLY; - if (!_try_writable (blob)) { + if (!blob->try_make_writable ()) { hb_blob_destroy (blob); return hb_blob_get_empty (); } @@ -260,7 +234,7 @@ { if (!hb_object_destroy (blob)) return; - _hb_blob_destroy_user_data (blob); + blob->fini_shallow (); free (blob); } @@ -395,7 +369,7 @@ char * hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length) { - if (!_try_writable (blob)) { + if (!blob->try_make_writable ()) { if (length) *length = 0; @@ -409,8 +383,8 @@ } -static hb_bool_t -_try_make_writable_inplace_unix (hb_blob_t *blob) +bool +hb_blob_t::try_make_writable_inplace_unix (void) { #if defined(HAVE_SYS_MMAN_H) && defined(HAVE_MPROTECT) uintptr_t pagesize = -1, mask, length; @@ -425,25 +399,25 @@ #endif if ((uintptr_t) -1L == pagesize) { - DEBUG_MSG_FUNC (BLOB, blob, "failed to get pagesize: %s", strerror (errno)); + DEBUG_MSG_FUNC (BLOB, this, "failed to get pagesize: %s", strerror (errno)); return false; } - DEBUG_MSG_FUNC (BLOB, blob, "pagesize is %lu", (unsigned long) pagesize); + DEBUG_MSG_FUNC (BLOB, this, "pagesize is %lu", (unsigned long) pagesize); mask = ~(pagesize-1); - addr = (const char *) (((uintptr_t) blob->data) & mask); - length = (const char *) (((uintptr_t) blob->data + blob->length + pagesize-1) & mask) - addr; - DEBUG_MSG_FUNC (BLOB, blob, + addr = (const char *) (((uintptr_t) this->data) & mask); + length = (const char *) (((uintptr_t) this->data + this->length + pagesize-1) & mask) - addr; + DEBUG_MSG_FUNC (BLOB, this, "calling mprotect on [%p..%p] (%lu bytes)", addr, addr+length, (unsigned long) length); if (-1 == mprotect ((void *) addr, length, PROT_READ | PROT_WRITE)) { - DEBUG_MSG_FUNC (BLOB, blob, "mprotect failed: %s", strerror (errno)); + DEBUG_MSG_FUNC (BLOB, this, "mprotect failed: %s", strerror (errno)); return false; } - blob->mode = HB_MEMORY_MODE_WRITABLE; + this->mode = HB_MEMORY_MODE_WRITABLE; - DEBUG_MSG_FUNC (BLOB, blob, + DEBUG_MSG_FUNC (BLOB, this, "successfully made [%p..%p] (%lu bytes) writable\n", addr, addr+length, (unsigned long) length); return true; @@ -452,53 +426,211 @@ #endif } -static bool -_try_writable_inplace (hb_blob_t *blob) +bool +hb_blob_t::try_make_writable_inplace (void) { - DEBUG_MSG_FUNC (BLOB, blob, "making writable inplace\n"); + DEBUG_MSG_FUNC (BLOB, this, "making writable inplace\n"); - if (_try_make_writable_inplace_unix (blob)) + if (this->try_make_writable_inplace_unix ()) return true; - DEBUG_MSG_FUNC (BLOB, blob, "making writable -> FAILED\n"); + DEBUG_MSG_FUNC (BLOB, this, "making writable -> FAILED\n"); /* Failed to make writable inplace, mark that */ - blob->mode = HB_MEMORY_MODE_READONLY; + this->mode = HB_MEMORY_MODE_READONLY; return false; } -static bool -_try_writable (hb_blob_t *blob) +bool +hb_blob_t::try_make_writable (void) { - if (blob->immutable) + if (this->immutable) return false; - if (blob->mode == HB_MEMORY_MODE_WRITABLE) + if (this->mode == HB_MEMORY_MODE_WRITABLE) return true; - if (blob->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE && _try_writable_inplace (blob)) + if (this->mode == HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE && this->try_make_writable_inplace ()) return true; - if (blob->mode == HB_MEMORY_MODE_WRITABLE) + if (this->mode == HB_MEMORY_MODE_WRITABLE) return true; - DEBUG_MSG_FUNC (BLOB, blob, "current data is -> %p\n", blob->data); + DEBUG_MSG_FUNC (BLOB, this, "current data is -> %p\n", this->data); char *new_data; - new_data = (char *) malloc (blob->length); + new_data = (char *) malloc (this->length); if (unlikely (!new_data)) return false; - DEBUG_MSG_FUNC (BLOB, blob, "dupped successfully -> %p\n", blob->data); + DEBUG_MSG_FUNC (BLOB, this, "dupped successfully -> %p\n", this->data); - memcpy (new_data, blob->data, blob->length); - _hb_blob_destroy_user_data (blob); - blob->mode = HB_MEMORY_MODE_WRITABLE; - blob->data = new_data; - blob->user_data = new_data; - blob->destroy = free; + memcpy (new_data, this->data, this->length); + this->destroy_user_data (); + this->mode = HB_MEMORY_MODE_WRITABLE; + this->data = new_data; + this->user_data = new_data; + this->destroy = free; return true; } + +/* + * Mmap + */ + +#ifdef HAVE_MMAP +# include <sys/types.h> +# include <sys/stat.h> +# include <fcntl.h> +#endif + +#if defined(_WIN32) || defined(__CYGWIN__) +# include <windows.h> +#else +# ifndef _O_BINARY +# define _O_BINARY 0 +# endif +#endif + +#ifndef MAP_NORESERVE +# define MAP_NORESERVE 0 +#endif + +struct hb_mapped_file_t +{ + char *contents; + unsigned long length; +#if defined(_WIN32) || defined(__CYGWIN__) + HANDLE mapping; +#endif +}; + +static void +_hb_mapped_file_destroy (hb_mapped_file_t *file) +{ +#ifdef HAVE_MMAP + munmap (file->contents, file->length); +#elif defined(_WIN32) || defined(__CYGWIN__) + UnmapViewOfFile (file->contents); + CloseHandle (file->mapping); +#else + assert (0); // If we don't have mmap we shouldn't reach here +#endif + + free (file); +} + +/** + * hb_blob_create_from_file: + * @file_name: font filename. + * + * Returns: A hb_blob_t pointer with the content of the file + * + * Since: 1.7.7 + **/ +hb_blob_t * +hb_blob_create_from_file (const char *file_name) +{ + /* Adopted from glib's gmappedfile.c with Matthias Clasen and + Allison Lortie permission but changed a lot to suit our need. */ +#if defined(HAVE_MMAP) && !defined(HB_NO_MMAP) + hb_mapped_file_t *file = (hb_mapped_file_t *) calloc (1, sizeof (hb_mapped_file_t)); + if (unlikely (!file)) return hb_blob_get_empty (); + + int fd = open (file_name, O_RDONLY | _O_BINARY, 0); + if (unlikely (fd == -1)) goto fail_without_close; + + struct stat st; + if (unlikely (fstat (fd, &st) == -1)) goto fail; + + file->length = (unsigned long) st.st_size; + file->contents = (char *) mmap (nullptr, file->length, PROT_READ, + MAP_PRIVATE | MAP_NORESERVE, fd, 0); + + if (unlikely (file->contents == MAP_FAILED)) goto fail; + + close (fd); + + return hb_blob_create (file->contents, file->length, + HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE, (void *) file, + (hb_destroy_func_t) _hb_mapped_file_destroy); + +fail: + close (fd); +fail_without_close: + free (file); + +#elif (defined(_WIN32) || defined(__CYGWIN__)) && !defined(HB_NO_MMAP) + hb_mapped_file_t *file = (hb_mapped_file_t *) calloc (1, sizeof (hb_mapped_file_t)); + if (unlikely (!file)) return hb_blob_get_empty (); + + HANDLE fd = CreateFile (file_name, GENERIC_READ, FILE_SHARE_READ, nullptr, + OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL|FILE_FLAG_OVERLAPPED, + nullptr); + + if (unlikely (fd == INVALID_HANDLE_VALUE)) goto fail_without_close; + + file->length = (unsigned long) GetFileSize (fd, nullptr); + file->mapping = CreateFileMapping (fd, nullptr, PAGE_READONLY, 0, 0, nullptr); + if (unlikely (file->mapping == nullptr)) goto fail; + + file->contents = (char *) MapViewOfFile (file->mapping, FILE_MAP_READ, 0, 0, 0); + if (unlikely (file->contents == nullptr)) goto fail; + + CloseHandle (fd); + return hb_blob_create (file->contents, file->length, + HB_MEMORY_MODE_READONLY_MAY_MAKE_WRITABLE, (void *) file, + (hb_destroy_func_t) _hb_mapped_file_destroy); + +fail: + CloseHandle (fd); +fail_without_close: + free (file); + +#endif + + /* The following tries to read a file without knowing its size beforehand + It's used as a fallback for systems without mmap or to read from pipes */ + unsigned long len = 0, allocated = BUFSIZ * 16; + char *data = (char *) malloc (allocated); + if (unlikely (data == nullptr)) return hb_blob_get_empty (); + + FILE *fp = fopen (file_name, "rb"); + if (unlikely (fp == nullptr)) goto fread_fail_without_close; + + while (!feof (fp)) + { + if (allocated - len < BUFSIZ) + { + allocated *= 2; + /* Don't allocate and go more than ~536MB, our mmap reader still + can cover files like that but lets limit our fallback reader */ + if (unlikely (allocated > (2 << 28))) goto fread_fail; + char *new_data = (char *) realloc (data, allocated); + if (unlikely (new_data == nullptr)) goto fread_fail; + data = new_data; + } + + unsigned long addition = fread (data + len, 1, allocated - len, fp); + + int err = ferror (fp); +#ifdef EINTR // armcc doesn't have it + if (unlikely (err == EINTR)) continue; +#endif + if (unlikely (err)) goto fread_fail; + + len += addition; + } + + return hb_blob_create (data, len, HB_MEMORY_MODE_WRITABLE, data, + (hb_destroy_func_t) free); + +fread_fail: + fclose (fp); +fread_fail_without_close: + free (data); + return hb_blob_get_empty (); +} diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob.h 2018-07-25 15:36:46.000000000 +0000 @@ -123,6 +123,8 @@ HB_EXTERN char * hb_blob_get_data_writable (hb_blob_t *blob, unsigned int *length); +HB_EXTERN hb_blob_t * +hb_blob_create_from_file (const char *file_name); HB_END_DECLS diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob-private.hh 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-blob-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * Copyright © 2009 Red Hat, Inc. + * Copyright © 2018 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Red Hat Author(s): Behdad Esfahbod + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_BLOB_PRIVATE_HH +#define HB_BLOB_PRIVATE_HH + +#include "hb-private.hh" + +#include "hb-object-private.hh" + + +/* + * hb_blob_t + */ + +struct hb_blob_t +{ + inline void fini_shallow (void) + { + destroy_user_data (); + } + + inline void destroy_user_data (void) + { + if (destroy) + { + destroy (user_data); + user_data = nullptr; + destroy = nullptr; + } + } + + HB_INTERNAL bool try_make_writable (void); + HB_INTERNAL bool try_make_writable_inplace (void); + HB_INTERNAL bool try_make_writable_inplace_unix (void); + + inline void lock (void) + { + hb_blob_make_immutable (this); + } + + template <typename Type> + inline const Type* as (void) const + { + return unlikely (!data) ? &Null(Type) : reinterpret_cast<const Type *> (data); + } + + public: + hb_object_header_t header; + ASSERT_POD (); + + bool immutable; + + const char *data; + unsigned int length; + hb_memory_mode_t mode; + + void *user_data; + hb_destroy_func_t destroy; +}; + + +#endif /* HB_BLOB_PRIVATE_HH */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer.cc 2018-07-25 15:36:46.000000000 +0000 @@ -111,11 +111,11 @@ bool hb_buffer_t::enlarge (unsigned int size) { - if (unlikely (in_error)) + if (unlikely (!successful)) return false; if (unlikely (size > max_len)) { - in_error = true; + successful = false; return false; } @@ -139,7 +139,7 @@ done: if (unlikely (!new_pos || !new_info)) - in_error = true; + successful = false; if (likely (new_pos)) pos = new_pos; @@ -148,10 +148,10 @@ info = new_info; out_info = separate_out ? (hb_glyph_info_t *) pos : info; - if (likely (!in_error)) + if (likely (successful)) allocated = new_allocated; - return likely (!in_error); + return likely (successful); } bool @@ -234,7 +234,7 @@ scratch_flags = HB_BUFFER_SCRATCH_FLAG_DEFAULT; content_type = HB_BUFFER_CONTENT_TYPE_INVALID; - in_error = false; + successful = true; have_output = false; have_positions = false; @@ -324,7 +324,7 @@ void hb_buffer_t::swap_buffers (void) { - if (unlikely (in_error)) return; + if (unlikely (!successful)) return; assert (have_output); have_output = false; @@ -409,7 +409,7 @@ idx = i; return true; } - if (unlikely (in_error)) + if (unlikely (!successful)) return false; assert (i <= out_len + (len - idx)); @@ -687,6 +687,8 @@ /* If direction is set to INVALID, guess from script */ if (props.direction == HB_DIRECTION_INVALID) { props.direction = hb_script_get_horizontal_direction (props.script); + if (props.direction == HB_DIRECTION_INVALID) + props.direction = HB_DIRECTION_LTR; } /* If language is not set, use default language from locale */ @@ -754,7 +756,7 @@ HB_BUFFER_CONTENT_TYPE_INVALID, HB_SEGMENT_PROPERTIES_DEFAULT, - true, /* in_error */ + false, /* successful */ true, /* have_output */ true /* have_positions */ @@ -1269,7 +1271,7 @@ hb_bool_t hb_buffer_allocation_successful (hb_buffer_t *buffer) { - return !buffer->in_error; + return buffer->successful; } /** @@ -1489,6 +1491,8 @@ * Next, if buffer direction is not set (ie. is %HB_DIRECTION_INVALID), * it will be set to the natural horizontal direction of the * buffer script as returned by hb_script_get_horizontal_direction(). + * If hb_script_get_horizontal_direction() returns %HB_DIRECTION_INVALID, + * then %HB_DIRECTION_LTR is used. * * Finally, if buffer language is not set (ie. is %HB_LANGUAGE_INVALID), * it will be set to the process's default language as returned by @@ -1750,13 +1754,13 @@ if (buffer->len + (end - start) < buffer->len) /* Overflows. */ { - buffer->in_error = true; + buffer->successful = false; return; } unsigned int orig_len = buffer->len; hb_buffer_set_length (buffer, buffer->len + (end - start)); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return; memcpy (buffer->info + orig_len, source->info + start, (end - start) * sizeof (buffer->info[0])); diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-json.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-json.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-json.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-json.hh 2018-07-25 15:36:46.000000000 +0000 @@ -503,7 +503,7 @@ #line 43 "hb-buffer-deserialize-json.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -554,7 +554,7 @@ #line 43 "hb-buffer-deserialize-json.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -566,7 +566,7 @@ #line 43 "hb-buffer-deserialize-json.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -578,7 +578,7 @@ #line 43 "hb-buffer-deserialize-json.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -590,7 +590,7 @@ #line 43 "hb-buffer-deserialize-json.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -602,7 +602,7 @@ #line 43 "hb-buffer-deserialize-json.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -614,7 +614,7 @@ #line 43 "hb-buffer-deserialize-json.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-text.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-text.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-text.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-deserialize-text.hh 2018-07-25 15:36:46.000000000 +0000 @@ -422,7 +422,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -434,7 +434,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -446,7 +446,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -458,7 +458,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -470,7 +470,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -499,7 +499,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -511,7 +511,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -523,7 +523,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -535,7 +535,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; @@ -547,7 +547,7 @@ #line 43 "hb-buffer-deserialize-text.rl" { buffer->add_info (info); - if (buffer->in_error) + if (unlikely (!buffer->successful)) return false; buffer->pos[buffer->len - 1] = pos; *end_ptr = p; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-buffer-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -101,7 +101,7 @@ hb_buffer_content_type_t content_type; hb_segment_properties_t props; /* Script, language, direction */ - bool in_error; /* Allocation failed */ + bool successful; /* Allocations successful */ bool have_output; /* Whether we have an output buffer going on */ bool have_positions; /* Whether we have positions */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.cc 2018-07-25 15:36:46.000000000 +0000 @@ -225,7 +225,7 @@ inline hb_language_item_t & operator = (const char *s) { /* If a custom allocated is used calling strdup() pairs - badly with a call to the custom free() in finish() below. + badly with a call to the custom free() in fini() below. Therefore don't call strdup(), implement its behavior. */ size_t len = strlen(s) + 1; @@ -240,7 +240,7 @@ return *this; } - void finish (void) { free ((void *) lang); } + void fini (void) { free ((void *) lang); } }; @@ -252,11 +252,16 @@ static void free_langs (void) { - while (langs) { - hb_language_item_t *next = langs->next; - langs->finish (); - free (langs); - langs = next; +retry: + hb_language_item_t *first_lang = (hb_language_item_t *) hb_atomic_ptr_get (&langs); + if (!hb_atomic_ptr_cmpexch (&langs, first_lang, nullptr)) + goto retry; + + while (first_lang) { + hb_language_item_t *next = first_lang->next; + first_lang->fini (); + free (first_lang); + first_lang = next; } } #endif @@ -284,7 +289,7 @@ } if (!hb_atomic_ptr_cmpexch (&langs, first_lang, lang)) { - lang->finish (); + lang->fini (); free (lang); goto retry; } @@ -407,7 +412,7 @@ case HB_TAG('Q','a','a','i'): return HB_SCRIPT_INHERITED; case HB_TAG('Q','a','a','c'): return HB_SCRIPT_COPTIC; - /* Script variants from http://unicode.org/iso15924/ */ + /* Script variants from https://unicode.org/iso15924/ */ case HB_TAG('C','y','r','s'): return HB_SCRIPT_CYRILLIC; case HB_TAG('L','a','t','f'): return HB_SCRIPT_LATIN; case HB_TAG('L','a','t','g'): return HB_SCRIPT_LATIN; @@ -475,7 +480,7 @@ hb_direction_t hb_script_get_horizontal_direction (hb_script_t script) { - /* http://goo.gl/x9ilM */ + /* https://docs.google.com/spreadsheets/d/1Y90M0Ie3MUJ6UVCRDOypOtijlMDLNNyyLk36T6iMu0o */ switch ((hb_tag_t) script) { /* Unicode-1.1 additions */ @@ -530,7 +535,18 @@ /* Unicode-9.0 additions */ case HB_SCRIPT_ADLAM: + /* Unicode-11.0 additions */ + case HB_SCRIPT_HANIFI_ROHINGYA: + case HB_SCRIPT_OLD_SOGDIAN: + case HB_SCRIPT_SOGDIAN: + return HB_DIRECTION_RTL; + + + /* https://github.com/harfbuzz/harfbuzz/issues/1000 */ + case HB_SCRIPT_OLD_ITALIC: + + return HB_DIRECTION_INVALID; } return HB_DIRECTION_LTR; @@ -719,8 +735,14 @@ static void free_C_locale (void) { - if (C_locale) - HB_FREE_LOCALE (C_locale); +retry: + HB_LOCALE_T locale = (HB_LOCALE_T) hb_atomic_ptr_get (&C_locale); + + if (!hb_atomic_ptr_cmpexch (&C_locale, locale, nullptr)) + goto retry; + + if (locale) + HB_FREE_LOCALE (locale); } #endif diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-common.h 2018-07-25 15:36:46.000000000 +0000 @@ -49,6 +49,16 @@ # include <inttypes.h> #elif defined (_AIX) # include <sys/inttypes.h> +#elif defined (_MSC_VER) && _MSC_VER < 1600 +/* VS 2010 (_MSC_VER 1600) has stdint.h */ +typedef __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; #else # include <stdint.h> #endif @@ -142,8 +152,8 @@ /* hb_script_t */ -/* http://unicode.org/iso15924/ */ -/* http://goo.gl/x9ilM */ +/* https://unicode.org/iso15924/ */ +/* https://docs.google.com/spreadsheets/d/1Y90M0Ie3MUJ6UVCRDOypOtijlMDLNNyyLk36T6iMu0o */ /* Unicode Character Database property: Script (sc) */ typedef enum { @@ -315,6 +325,17 @@ /*10.0*/HB_SCRIPT_SOYOMBO = HB_TAG ('S','o','y','o'), /*10.0*/HB_SCRIPT_ZANABAZAR_SQUARE = HB_TAG ('Z','a','n','b'), + /* + * Since 1.8.0 + */ + /*11.0*/HB_SCRIPT_DOGRA = HB_TAG ('D','o','g','r'), + /*11.0*/HB_SCRIPT_GUNJALA_GONDI = HB_TAG ('G','o','n','g'), + /*11.0*/HB_SCRIPT_HANIFI_ROHINGYA = HB_TAG ('R','o','h','g'), + /*11.0*/HB_SCRIPT_MAKASAR = HB_TAG ('M','a','k','a'), + /*11.0*/HB_SCRIPT_MEDEFAIDRIN = HB_TAG ('M','e','d','f'), + /*11.0*/HB_SCRIPT_OLD_SOGDIAN = HB_TAG ('S','o','g','o'), + /*11.0*/HB_SCRIPT_SOGDIAN = HB_TAG ('S','o','g','d'), + /* No script set. */ HB_SCRIPT_INVALID = HB_TAG_NONE, @@ -323,7 +344,7 @@ * since technically enums are int, and indeed, hb_script_t ends up being signed. * See this thread for technicalities: * - * http://lists.freedesktop.org/archives/harfbuzz/2014-March/004150.html + * https://lists.freedesktop.org/archives/harfbuzz/2014-March/004150.html */ _HB_SCRIPT_MAX_VALUE = HB_TAG_MAX, /*< skip >*/ _HB_SCRIPT_MAX_VALUE_SIGNED = HB_TAG_MAX_SIGNED /*< skip >*/ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-coretext.cc 2018-07-25 15:36:46.000000000 +0000 @@ -168,6 +168,10 @@ if (CFStringHasPrefix (cg_postscript_name, CFSTR (".SFNSText")) || CFStringHasPrefix (cg_postscript_name, CFSTR (".SFNSDisplay"))) { +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1080 +# define kCTFontUIFontSystem kCTFontSystemFontType +# define kCTFontUIFontEmphasizedSystem kCTFontEmphasizedSystemFontType +#endif CTFontUIFontType font_type = kCTFontUIFontSystem; if (CFStringHasSuffix (cg_postscript_name, CFSTR ("-Bold"))) font_type = kCTFontUIFontEmphasizedSystem; @@ -206,7 +210,18 @@ return ct_font; } - CFURLRef original_url = (CFURLRef)CTFontCopyAttribute(ct_font, kCTFontURLAttribute); + CFURLRef original_url = nullptr; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + ATSFontRef atsFont; + FSRef fsref; + OSStatus status; + atsFont = CTFontGetPlatformFont (ct_font, NULL); + status = ATSFontGetFileReference (atsFont, &fsref); + if (status == noErr) + original_url = CFURLCreateFromFSRef (NULL, &fsref); +#else + original_url = (CFURLRef) CTFontCopyAttribute (ct_font, kCTFontURLAttribute); +#endif /* Create font copy with cascade list that has LastResort first; this speeds up CoreText * font fallback which we don't need anyway. */ @@ -225,7 +240,15 @@ * system locations that we cannot access from the sandboxed renderer * process in Blink. This can be detected by the new file URL location * that the newly found font points to. */ - CFURLRef new_url = (CFURLRef) CTFontCopyAttribute (new_ct_font, kCTFontURLAttribute); + CFURLRef new_url = nullptr; +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + atsFont = CTFontGetPlatformFont (new_ct_font, NULL); + status = ATSFontGetFileReference (atsFont, &fsref); + if (status == noErr) + new_url = CFURLCreateFromFSRef (NULL, &fsref); +#else + new_url = (CFURLRef) CTFontCopyAttribute (new_ct_font, kCTFontURLAttribute); +#endif // Keep reconfigured font if URL cannot be retrieved (seems to be the case // on Mac OS 10.12 Sierra), speculative fix for crbug.com/625606 if (!original_url || !new_url || CFEqual (original_url, new_url)) { @@ -618,8 +641,8 @@ buffer->merge_clusters (i - 1, i + 1); } - hb_auto_array_t<feature_record_t> feature_records; - hb_auto_array_t<range_record_t> range_records; + hb_auto_t<hb_vector_t<feature_record_t> > feature_records; + hb_auto_t<hb_vector_t<range_record_t> > range_records; /* * Set up features. @@ -628,7 +651,7 @@ if (num_features) { /* Sort features by start/end events. */ - hb_auto_array_t<feature_event_t> feature_events; + hb_auto_t<hb_vector_t<feature_event_t> > feature_events; for (unsigned int i = 0; i < num_features; i++) { const feature_mapping_t * mapping = (const feature_mapping_t *) bsearch (&features[i].tag, @@ -647,15 +670,11 @@ feature_event_t *event; event = feature_events.push (); - if (unlikely (!event)) - goto fail_features; event->index = features[i].start; event->start = true; event->feature = feature; event = feature_events.push (); - if (unlikely (!event)) - goto fail_features; event->index = features[i].end; event->start = false; event->feature = feature; @@ -669,15 +688,13 @@ feature.order = num_features + 1; feature_event_t *event = feature_events.push (); - if (unlikely (!event)) - goto fail_features; event->index = 0; /* This value does magic. */ event->start = false; event->feature = feature; } /* Scan events and save features for each range. */ - hb_auto_array_t<active_feature_t> active_features; + hb_auto_t<hb_vector_t<active_feature_t> > active_features; unsigned int last_index = 0; for (unsigned int i = 0; i < feature_events.len; i++) { @@ -687,8 +704,6 @@ { /* Save a snapshot of active features and the range. */ range_record_t *range = range_records.push (); - if (unlikely (!range)) - goto fail_features; if (active_features.len) { @@ -746,23 +761,16 @@ last_index = event->index; } - if (event->start) { - active_feature_t *feature = active_features.push (); - if (unlikely (!feature)) - goto fail_features; - *feature = event->feature; + if (event->start) + { + active_features.push (event->feature); } else { active_feature_t *feature = active_features.find (&event->feature); if (feature) - active_features.remove (feature - active_features.array); + active_features.remove (feature - active_features.arrayZ); } } } - else - { - fail_features: - num_features = 0; - } unsigned int scratch_size; hb_buffer_t::scratch_buffer_t *scratch = buffer->get_scratch_buffer (&scratch_size); @@ -944,6 +952,9 @@ int level = HB_DIRECTION_IS_FORWARD (buffer->props.direction) ? 0 : 1; CFNumberRef level_number = CFNumberCreate (kCFAllocatorDefault, kCFNumberIntType, &level); +#if MAC_OS_X_VERSION_MIN_REQUIRED < 1060 + extern const CFStringRef kCTTypesetterOptionForcedEmbeddingLevel; +#endif CFDictionaryRef options = CFDictionaryCreate (kCFAllocatorDefault, (const void **) &kCTTypesetterOptionForcedEmbeddingLevel, (const void **) &level_number, @@ -979,7 +990,7 @@ /* For right-to-left runs, CoreText returns the glyphs positioned such that * any trailing whitespace is to the left of (0,0). Adjust coordinate system * to fix for that. Test with any RTL string with trailing spaces. - * https://code.google.com/p/chromium/issues/detail?id=469028 + * https://crbug.com/469028 */ if (HB_DIRECTION_IS_BACKWARD (buffer->props.direction)) { @@ -1032,7 +1043,7 @@ * However, even that wouldn't work if we were passed in the CGFont to * construct a hb_face to begin with. * - * See: http://github.com/harfbuzz/harfbuzz/pull/36 + * See: https://github.com/harfbuzz/harfbuzz/pull/36 * * Also see: https://bugs.chromium.org/p/chromium/issues/detail?id=597098 */ @@ -1222,7 +1233,7 @@ * directions. As such, disable the assert... It wouldn't crash, but * cursoring will be off... * - * http://crbug.com/419769 + * https://crbug.com/419769 */ if (0) { diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-dsalgs.hh 2018-07-25 15:36:46.000000000 +0000 @@ -49,7 +49,7 @@ else return (void *) p; } - return NULL; + return nullptr; } diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.cc 2018-07-25 15:36:46.000000000 +0000 @@ -29,11 +29,35 @@ #include "hb-private.hh" #include "hb-face-private.hh" +#include "hb-blob-private.hh" #include "hb-open-file-private.hh" #include "hb-ot-head-table.hh" #include "hb-ot-maxp-table.hh" + +/** + * hb_face_count: Get number of faces on the blob + * @blob: + * + * + * + * Return value: Number of faces on the blob + * + * Since: 1.7.7 + **/ +unsigned int +hb_face_count (hb_blob_t *blob) +{ + if (unlikely (!blob)) + return 0; + + hb_blob_t *sanitized = OT::Sanitizer<OT::OpenTypeFontFile> ().sanitize (blob); + const OT::OpenTypeFontFile& ot = *sanitized->as<OT::OpenTypeFontFile> (); + + return ot.get_face_count (); +} + /* * hb_face_t */ @@ -134,7 +158,7 @@ if (tag == HB_TAG_NONE) return hb_blob_reference (data->blob); - const OT::OpenTypeFontFile &ot_file = *OT::Sanitizer<OT::OpenTypeFontFile>::lock_instance (data->blob); + const OT::OpenTypeFontFile &ot_file = *data->blob->as<OT::OpenTypeFontFile> (); const OT::OpenTypeFontFace &ot_face = ot_file.get_face (data->index); const OT::OpenTypeTable &table = ot_face.get_table_by_tag (tag); @@ -425,7 +449,7 @@ hb_face_t::load_upem (void) const { hb_blob_t *head_blob = OT::Sanitizer<OT::head>().sanitize (reference_table (HB_OT_TAG_head)); - const OT::head *head_table = OT::Sanitizer<OT::head>::lock_instance (head_blob); + const OT::head *head_table = head_blob->as<OT::head> (); upem = head_table->get_upem (); hb_blob_destroy (head_blob); } @@ -469,7 +493,7 @@ hb_face_t::load_num_glyphs (void) const { hb_blob_t *maxp_blob = OT::Sanitizer<OT::maxp>().sanitize (reference_table (HB_OT_TAG_maxp)); - const OT::maxp *maxp_table = OT::Sanitizer<OT::maxp>::lock_instance (maxp_blob); + const OT::maxp *maxp_table = maxp_blob->as<OT::maxp> (); num_glyphs = maxp_table->get_num_glyphs (); hb_blob_destroy (maxp_blob); } @@ -499,7 +523,7 @@ hb_face_for_data_closure_t *data = (hb_face_for_data_closure_t *) face->user_data; - const OT::OpenTypeFontFile &ot_file = *OT::Sanitizer<OT::OpenTypeFontFile>::lock_instance (data->blob); + const OT::OpenTypeFontFile &ot_file = *data->blob->as<OT::OpenTypeFontFile> (); const OT::OpenTypeFontFace &ot_face = ot_file.get_face (data->index); return ot_face.get_table_tags (start_offset, table_count, table_tags); diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-face.h 2018-07-25 15:36:46.000000000 +0000 @@ -37,6 +37,10 @@ HB_BEGIN_DECLS +HB_EXTERN unsigned int +hb_face_count (hb_blob_t *blob); + + /* * hb_face_t */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc 2018-07-25 15:36:46.000000000 +0000 @@ -127,7 +127,7 @@ static hb_position_t -hb_font_get_glyph_h_advance_nil (hb_font_t *font HB_UNUSED, +hb_font_get_glyph_h_advance_nil (hb_font_t *font, void *font_data HB_UNUSED, hb_codepoint_t glyph, void *user_data HB_UNUSED) @@ -144,7 +144,7 @@ } static hb_position_t -hb_font_get_glyph_v_advance_nil (hb_font_t *font HB_UNUSED, +hb_font_get_glyph_v_advance_nil (hb_font_t *font, void *font_data HB_UNUSED, hb_codepoint_t glyph, void *user_data HB_UNUSED) diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -83,7 +83,11 @@ HB_FONT_FUNCS_IMPLEMENT_CALLBACKS #undef HB_FONT_FUNC_IMPLEMENT } f; - void (*array[VAR]) (void); + void (*array[0 +#define HB_FONT_FUNC_IMPLEMENT(name) +1 + HB_FONT_FUNCS_IMPLEMENT_CALLBACKS +#undef HB_FONT_FUNC_IMPLEMENT + ]) (void); } get; }; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ft.cc 2018-07-25 15:36:46.000000000 +0000 @@ -119,7 +119,7 @@ if (font->immutable) return; - if (font->destroy != _hb_ft_font_destroy) + if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy) return; hb_ft_font_t *ft_font = (hb_ft_font_t *) font->user_data; @@ -139,7 +139,7 @@ int hb_ft_font_get_load_flags (hb_font_t *font) { - if (font->destroy != _hb_ft_font_destroy) + if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy) return 0; const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data; @@ -150,7 +150,7 @@ FT_Face hb_ft_font_get_face (hb_font_t *font) { - if (font->destroy != _hb_ft_font_destroy) + if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy) return nullptr; const hb_ft_font_t *ft_font = (const hb_ft_font_t *) font->user_data; @@ -177,7 +177,7 @@ /* For symbol-encoded OpenType fonts, we duplicate the * U+F000..F0FF range at U+0000..U+00FF. That's what * Windows seems to do, and that's hinted about at: - * http://www.microsoft.com/typography/otspec/recom.htm + * https://docs.microsoft.com/en-us/typography/opentype/spec/recom * under "Non-Standard (Symbol) Fonts". */ g = FT_Get_Char_Index (ft_font->ft_face, 0xF000u + unicode); if (!g) @@ -210,7 +210,7 @@ } static hb_position_t -hb_ft_get_glyph_h_advance (hb_font_t *font HB_UNUSED, +hb_ft_get_glyph_h_advance (hb_font_t *font, void *font_data, hb_codepoint_t glyph, void *user_data HB_UNUSED) @@ -228,7 +228,7 @@ } static hb_position_t -hb_ft_get_glyph_v_advance (hb_font_t *font HB_UNUSED, +hb_ft_get_glyph_v_advance (hb_font_t *font, void *font_data, hb_codepoint_t glyph, void *user_data HB_UNUSED) @@ -248,7 +248,7 @@ } static hb_bool_t -hb_ft_get_glyph_v_origin (hb_font_t *font HB_UNUSED, +hb_ft_get_glyph_v_origin (hb_font_t *font, void *font_data, hb_codepoint_t glyph, hb_position_t *x, @@ -292,7 +292,7 @@ } static hb_bool_t -hb_ft_get_glyph_extents (hb_font_t *font HB_UNUSED, +hb_ft_get_glyph_extents (hb_font_t *font, void *font_data, hb_codepoint_t glyph, hb_glyph_extents_t *extents, @@ -423,7 +423,12 @@ static void free_static_ft_funcs (void) { - hb_font_funcs_destroy (static_ft_funcs); +retry: + hb_font_funcs_t *ft_funcs = (hb_font_funcs_t *) hb_atomic_ptr_get (&static_ft_funcs); + if (!hb_atomic_ptr_cmpexch (&static_ft_funcs, ft_funcs, nullptr)) + goto retry; + + hb_font_funcs_destroy (ft_funcs); } #endif @@ -610,7 +615,7 @@ void hb_ft_font_changed (hb_font_t *font) { - if (font->destroy != _hb_ft_font_destroy) + if (font->destroy != (hb_destroy_func_t) _hb_ft_font_destroy) return; hb_ft_font_t *ft_font = (hb_ft_font_t *) font->user_data; @@ -685,7 +690,12 @@ static void free_ft_library (void) { - FT_Done_FreeType (ft_library); +retry: + FT_Library library = (FT_Library) hb_atomic_ptr_get (&ft_library); + if (!hb_atomic_ptr_cmpexch (&ft_library, library, nullptr)) + goto retry; + + FT_Done_FreeType (library); } #endif diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb.h 2018-07-25 15:36:46.000000000 +0000 @@ -38,6 +38,7 @@ #include "hb-deprecated.h" #include "hb-face.h" #include "hb-font.h" +#include "hb-map.h" #include "hb-set.h" #include "hb-shape.h" #include "hb-shape-plan.h" diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map.cc 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map.cc 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,261 @@ +/* + * Copyright © 2018 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-map-private.hh" + + +/* Public API */ + + +/** + * hb_map_create: (Xconstructor) + * + * Return value: (transfer full): + * + * Since: 1.7.7 + **/ +hb_map_t * +hb_map_create (void) +{ + hb_map_t *map; + + if (!(map = hb_object_create<hb_map_t> ())) + return hb_map_get_empty (); + + map->init_shallow (); + + return map; +} + +/** + * hb_map_get_empty: + * + * Return value: (transfer full): + * + * Since: 1.7.7 + **/ +hb_map_t * +hb_map_get_empty (void) +{ + return const_cast<hb_map_t *> (&Null(hb_map_t)); +} + +/** + * hb_map_reference: (skip) + * @map: a map. + * + * Return value: (transfer full): + * + * Since: 1.7.7 + **/ +hb_map_t * +hb_map_reference (hb_map_t *map) +{ + return hb_object_reference (map); +} + +/** + * hb_map_destroy: (skip) + * @map: a map. + * + * Since: 1.7.7 + **/ +void +hb_map_destroy (hb_map_t *map) +{ + if (!hb_object_destroy (map)) return; + + map->fini_shallow (); + + free (map); +} + +/** + * hb_map_set_user_data: (skip) + * @map: a map. + * @key: + * @data: + * @destroy: + * @replace: + * + * Return value: + * + * Since: 1.7.7 + **/ +hb_bool_t +hb_map_set_user_data (hb_map_t *map, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace) +{ + return hb_object_set_user_data (map, key, data, destroy, replace); +} + +/** + * hb_map_get_user_data: (skip) + * @map: a map. + * @key: + * + * Return value: (transfer none): + * + * Since: 1.7.7 + **/ +void * +hb_map_get_user_data (hb_map_t *map, + hb_user_data_key_t *key) +{ + return hb_object_get_user_data (map, key); +} + + +/** + * hb_map_allocation_successful: + * @map: a map. + * + * + * + * Return value: + * + * Since: 1.7.7 + **/ +hb_bool_t +hb_map_allocation_successful (const hb_map_t *map) +{ + return map->successful; +} + + +/** + * hb_map_set: + * @map: a map. + * @key: + * @value: + * + * + * + * Return value: + * + * Since: 1.7.7 + **/ +void +hb_map_set (hb_map_t *map, + hb_codepoint_t key, + hb_codepoint_t value) +{ + map->set (key, value); +} + +/** + * hb_map_get: + * @map: a map. + * @key: + * + * + * + * Since: 1.7.7 + **/ +hb_codepoint_t +hb_map_get (const hb_map_t *map, + hb_codepoint_t key) +{ + return map->get (key); +} + +/** + * hb_map_del: + * @map: a map. + * @codepoint: + * + * + * + * Since: 1.7.7 + **/ +void +hb_map_del (hb_map_t *map, + hb_codepoint_t key) +{ + map->del (key); +} + +/** + * hb_map_has: + * @map: a map. + * @codepoint: + * + * + * + * Since: 1.7.7 + **/ +hb_bool_t +hb_map_has (const hb_map_t *map, + hb_codepoint_t key) +{ + return map->has (key); +} + + +/** + * hb_map_clear: + * @map: a map. + * + * + * + * Since: 1.7.7 + **/ +void +hb_map_clear (hb_map_t *map) +{ + return map->clear (); +} + +/** + * hb_map_is_empty: + * @map: a map. + * + * + * + * Since: 1.7.7 + **/ +hb_bool_t +hb_map_is_empty (const hb_map_t *map) +{ + return map->is_empty (); +} + +/** + * hb_map_get_population: + * @map: a map. + * + * + * + * Since: 1.7.7 + **/ +unsigned int +hb_map_get_population (const hb_map_t *map) +{ + return map->get_population (); +} diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map.h 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map.h 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,104 @@ +/* + * Copyright © 2018 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_H_IN +#error "Include <hb.h> instead." +#endif + +#ifndef HB_MAP_H +#define HB_MAP_H + +#include "hb-common.h" + +HB_BEGIN_DECLS + + +/* + * Since: 1.7.7 + */ +#define HB_MAP_VALUE_INVALID ((hb_codepoint_t) -1) + +typedef struct hb_map_t hb_map_t; + + +HB_EXTERN hb_map_t * +hb_map_create (void); + +HB_EXTERN hb_map_t * +hb_map_get_empty (void); + +HB_EXTERN hb_map_t * +hb_map_reference (hb_map_t *map); + +HB_EXTERN void +hb_map_destroy (hb_map_t *map); + +HB_EXTERN hb_bool_t +hb_map_set_user_data (hb_map_t *map, + hb_user_data_key_t *key, + void * data, + hb_destroy_func_t destroy, + hb_bool_t replace); + +HB_EXTERN void * +hb_map_get_user_data (hb_map_t *map, + hb_user_data_key_t *key); + + +/* Returns false if allocation has failed before */ +HB_EXTERN hb_bool_t +hb_map_allocation_successful (const hb_map_t *map); + +HB_EXTERN void +hb_map_clear (hb_map_t *map); + +HB_EXTERN hb_bool_t +hb_map_is_empty (const hb_map_t *map); + +HB_EXTERN unsigned int +hb_map_get_population (const hb_map_t *map); + +HB_EXTERN void +hb_map_set (hb_map_t *map, + hb_codepoint_t key, + hb_codepoint_t value); + +HB_EXTERN hb_codepoint_t +hb_map_get (const hb_map_t *map, + hb_codepoint_t key); + +HB_EXTERN void +hb_map_del (hb_map_t *map, + hb_codepoint_t key); + +HB_EXTERN hb_bool_t +hb_map_has (const hb_map_t *map, + hb_codepoint_t key); + + +HB_END_DECLS + +#endif /* HB_MAP_H */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map-private.hh 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-map-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,255 @@ +/* + * Copyright © 2018 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#ifndef HB_MAP_PRIVATE_HH +#define HB_MAP_PRIVATE_HH + +#include "hb-private.hh" +#include "hb-object-private.hh" + + +template <typename T> +inline uint32_t Hash (const T &v) +{ + /* Knuth's multiplicative method: */ + return (uint32_t) v * 2654435761u; +} + + +/* + * hb_map_t + */ + +struct hb_map_t +{ + struct item_t + { + hb_codepoint_t key; + hb_codepoint_t value; + + inline bool is_unused (void) const { return key == INVALID; } + inline bool is_tombstone (void) const { return key != INVALID && value == INVALID; } + }; + + hb_object_header_t header; + bool successful; /* Allocations successful */ + unsigned int population; /* Not including tombstones. */ + unsigned int occupancy; /* Including tombstones. */ + unsigned int mask; + unsigned int prime; + item_t *items; + + inline void init_shallow (void) + { + successful = true; + population = occupancy = 0; + mask = 0; + prime = 0; + items = nullptr; + } + inline void init (void) + { + hb_object_init (this); + init_shallow (); + } + inline void fini_shallow (void) + { + free (items); + } + inline void fini (void) + { + hb_object_fini (this); + fini_shallow (); + } + + inline bool resize (void) + { + if (unlikely (!successful)) return false; + + unsigned int power = _hb_bit_storage (population * 2 + 8); + unsigned int new_size = 1u << power; + item_t *new_items = (item_t *) malloc ((size_t) new_size * sizeof (item_t)); + if (unlikely (!new_items)) + { + successful = false; + return false; + } + memset (new_items, 0xFF, (size_t) new_size * sizeof (item_t)); + + unsigned int old_size = mask + 1; + item_t *old_items = items; + + /* Switch to new, empty, array. */ + population = occupancy = 0; + mask = new_size - 1; + prime = prime_for (power); + items = new_items; + + /* Insert back old items. */ + if (old_items) + for (unsigned int i = 0; i < old_size; i++) + if (old_items[i].key != INVALID && old_items[i].value != INVALID) + set (old_items[i].key, old_items[i].value); + + free (old_items); + + return true; + } + + inline void set (hb_codepoint_t key, hb_codepoint_t value) + { + if (unlikely (!successful)) return; + if (unlikely (key == INVALID)) return; + if ((occupancy + occupancy / 2) >= mask && !resize ()) return; + unsigned int i = bucket_for (key); + + if (value == INVALID && items[i].key != key) + return; /* Trying to delete non-existent key. */ + + if (!items[i].is_unused ()) + { + occupancy--; + if (items[i].is_tombstone ()) + population--; + } + + items[i].key = key; + items[i].value = value; + + occupancy++; + if (!items[i].is_tombstone ()) + population++; + + } + inline hb_codepoint_t get (hb_codepoint_t key) const + { + if (unlikely (!items)) return INVALID; + unsigned int i = bucket_for (key); + return items[i].key == key ? items[i].value : INVALID; + } + + inline void del (hb_codepoint_t key) + { + set (key, INVALID); + } + inline bool has (hb_codepoint_t key) const + { + return get (key) != INVALID; + } + + inline hb_codepoint_t operator [] (unsigned int key) const + { return get (key); } + + static const hb_codepoint_t INVALID = HB_MAP_VALUE_INVALID; + + inline void clear (void) + { + memset (items, 0xFF, ((size_t) mask + 1) * sizeof (item_t)); + population = occupancy = 0; + } + + inline bool is_empty (void) const + { + return population != 0; + } + + inline unsigned int get_population () const + { + return population; + } + + protected: + + inline unsigned int bucket_for (hb_codepoint_t key) const + { + unsigned int i = Hash (key) % prime; + unsigned int step = 0; + unsigned int tombstone = INVALID; + while (!items[i].is_unused ()) + { + if (items[i].key == key) + return i; + if (tombstone == INVALID && items[i].is_tombstone ()) + tombstone = i; + i = (i + ++step) & mask; + } + return tombstone == INVALID ? i : tombstone; + } + + static inline unsigned int prime_for (unsigned int shift) + { + /* Following comment and table copied from glib. */ + /* Each table size has an associated prime modulo (the first prime + * lower than the table size) used to find the initial bucket. Probing + * then works modulo 2^n. The prime modulo is necessary to get a + * good distribution with poor hash functions. + */ + /* Not declaring static to make all kinds of compilers happy... */ + /*static*/ const unsigned int prime_mod [32] = + { + 1, /* For 1 << 0 */ + 2, + 3, + 7, + 13, + 31, + 61, + 127, + 251, + 509, + 1021, + 2039, + 4093, + 8191, + 16381, + 32749, + 65521, /* For 1 << 16 */ + 131071, + 262139, + 524287, + 1048573, + 2097143, + 4194301, + 8388593, + 16777213, + 33554393, + 67108859, + 134217689, + 268435399, + 536870909, + 1073741789, + 2147483647 /* For 1 << 31 */ + }; + + if (unlikely (shift >= ARRAY_LENGTH (prime_mod))) + return prime_mod[ARRAY_LENGTH (prime_mod) - 1]; + + return prime_mod[shift]; + } +}; + + +#endif /* HB_MAP_PRIVATE_HH */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-mutex-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-mutex-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-mutex-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-mutex-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -134,7 +134,7 @@ inline void init (void) { hb_mutex_impl_init (&m); } inline void lock (void) { hb_mutex_impl_lock (&m); } inline void unlock (void) { hb_mutex_impl_unlock (&m); } - inline void finish (void) { hb_mutex_impl_finish (&m); } + inline void fini (void) { hb_mutex_impl_finish (&m); } }; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-object-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-object-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-object-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-object-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -41,9 +41,9 @@ /* reference_count */ -#define HB_REFERENCE_COUNT_INERT_VALUE -1 +#define HB_REFERENCE_COUNT_INERT_VALUE 0 #define HB_REFERENCE_COUNT_POISON_VALUE -0x0000DEAD -#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT(HB_REFERENCE_COUNT_INERT_VALUE)} +#define HB_REFERENCE_COUNT_INIT {HB_ATOMIC_INT_INIT (HB_REFERENCE_COUNT_INERT_VALUE)} struct hb_reference_count_t { @@ -53,7 +53,7 @@ inline int get_unsafe (void) const { return ref_count.get_unsafe (); } inline int inc (void) { return ref_count.inc (); } inline int dec (void) { return ref_count.dec (); } - inline void finish (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_POISON_VALUE); } + inline void fini (void) { ref_count.set_unsafe (HB_REFERENCE_COUNT_POISON_VALUE); } inline bool is_inert (void) const { return ref_count.get_unsafe () == HB_REFERENCE_COUNT_INERT_VALUE; } inline bool is_valid (void) const { return ref_count.get_unsafe () > 0; } @@ -62,7 +62,6 @@ /* user_data */ -#define HB_USER_DATA_ARRAY_INIT {HB_MUTEX_INIT, HB_LOCKABLE_SET_INIT} struct hb_user_data_array_t { struct hb_user_data_item_t { @@ -73,7 +72,7 @@ inline bool operator == (hb_user_data_key_t *other_key) const { return key == other_key; } inline bool operator == (hb_user_data_item_t &other) const { return key == other.key; } - void finish (void) { if (destroy) destroy (data); } + void fini (void) { if (destroy) destroy (data); } }; hb_mutex_t lock; @@ -88,7 +87,7 @@ HB_INTERNAL void *get (hb_user_data_key_t *key); - inline void finish (void) { items.finish (lock); lock.finish (); } + inline void fini (void) { items.fini (lock); lock.fini (); } }; @@ -97,9 +96,9 @@ struct hb_object_header_t { hb_reference_count_t ref_count; - hb_user_data_array_t user_data; + hb_user_data_array_t *user_data; -#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INIT, HB_USER_DATA_ARRAY_INIT} +#define HB_OBJECT_HEADER_STATIC {HB_REFERENCE_COUNT_INIT, nullptr} private: ASSERT_POD (); @@ -133,7 +132,7 @@ static inline void hb_object_init (Type *obj) { obj->header.ref_count.init (1); - obj->header.user_data.init (); + obj->header.user_data = nullptr; } template <typename Type> static inline bool hb_object_is_inert (const Type *obj) @@ -165,11 +164,20 @@ if (obj->header.ref_count.dec () != 1) return false; - obj->header.ref_count.finish (); /* Do this before user_data */ - obj->header.user_data.finish (); + hb_object_fini (obj); return true; } template <typename Type> +static inline void hb_object_fini (Type *obj) +{ + obj->header.ref_count.fini (); /* Do this before user_data */ + if (obj->header.user_data) + { + obj->header.user_data->fini (); + free (obj->header.user_data); + } +} +template <typename Type> static inline bool hb_object_set_user_data (Type *obj, hb_user_data_key_t *key, void * data, @@ -179,17 +187,34 @@ if (unlikely (!obj || hb_object_is_inert (obj))) return false; assert (hb_object_is_valid (obj)); - return obj->header.user_data.set (key, data, destroy, replace); + +retry: + hb_user_data_array_t *user_data = (hb_user_data_array_t *) hb_atomic_ptr_get (&obj->header.user_data); + if (unlikely (!user_data)) + { + user_data = (hb_user_data_array_t *) calloc (sizeof (hb_user_data_array_t), 1); + if (unlikely (!user_data)) + return false; + user_data->init (); + if (unlikely (!hb_atomic_ptr_cmpexch (&obj->header.user_data, nullptr, user_data))) + { + user_data->fini (); + free (user_data); + goto retry; + } + } + + return user_data->set (key, data, destroy, replace); } template <typename Type> static inline void *hb_object_get_user_data (Type *obj, hb_user_data_key_t *key) { - if (unlikely (!obj || hb_object_is_inert (obj))) + if (unlikely (!obj || hb_object_is_inert (obj) || !obj->header.user_data)) return nullptr; assert (hb_object_is_valid (obj)); - return obj->header.user_data.get (key); + return obj->header.user_data->get (key); } diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-file-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-file-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-file-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-file-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -100,7 +100,7 @@ else *table_count = MIN<unsigned int> (*table_count, tables.len - start_offset); - const TableRecord *sub_tables = tables.array + start_offset; + const TableRecord *sub_tables = tables.arrayZ + start_offset; unsigned int count = *table_count; for (unsigned int i = 0; i < count; i++) table_tags[i] = sub_tables[i].tag; @@ -148,7 +148,7 @@ /* Write OffsetTables, alloc for and write actual table blobs. */ for (unsigned int i = 0; i < table_count; i++) { - TableRecord &rec = tables.array[i]; + TableRecord &rec = tables.arrayZ[i]; hb_blob_t *blob = blobs[i]; rec.tag.set (tags[i]); rec.length.set (hb_blob_get_length (blob)); @@ -188,7 +188,7 @@ checksum.set_for_data (this, dir_end - (const char *) this); for (unsigned int i = 0; i < table_count; i++) { - TableRecord &rec = tables.array[i]; + TableRecord &rec = tables.arrayZ[i]; checksum.set (checksum + rec.checkSum); } @@ -234,7 +234,7 @@ Tag ttcTag; /* TrueType Collection ID string: 'ttcf' */ FixedVersion<>version; /* Version of the TTC Header (1.0), * 0x00010000u */ - ArrayOf<LOffsetTo<OffsetTable>, HBUINT32> + LArrayOf<LOffsetTo<OffsetTable> > table; /* Array of offsets to the OffsetTable for each font * from the beginning of the file */ public: @@ -286,6 +286,197 @@ } u; }; +/* + * Mac Resource Fork + */ + +struct ResourceRefItem +{ + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + // actual data sanitization is done on ResourceForkHeader sanitizer + return_trace (likely (c->check_struct (this))); + } + + HBINT16 id; /* Resource ID, is really should be signed? */ + HBINT16 nameOffset; /* Offset from beginning of resource name list + * to resource name, minus means there is no */ + HBUINT8 attr; /* Resource attributes */ + HBUINT24 dataOffset; /* Offset from beginning of resource data to + * data for this resource */ + HBUINT32 reserved; /* Reserved for handle to resource */ + public: + DEFINE_SIZE_STATIC (12); +}; + +struct ResourceTypeItem +{ + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + // RefList sanitization is done on ResourceMap sanitizer + return_trace (likely (c->check_struct (this))); + } + + inline unsigned int get_resource_count () const + { + return numRes + 1; + } + + inline bool is_sfnt () const + { + return type == HB_TAG ('s','f','n','t'); + } + + inline const ResourceRefItem& get_ref_item (const void *base, + unsigned int i) const + { + return (base+refList)[i]; + } + + protected: + Tag type; /* Resource type */ + HBUINT16 numRes; /* Number of resource this type in map minus 1 */ + OffsetTo<UnsizedArrayOf<ResourceRefItem> > + refList; /* Offset from beginning of resource type list + * to reference list for this type */ + public: + DEFINE_SIZE_STATIC (8); +}; + +struct ResourceMap +{ + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) + return_trace (false); + for (unsigned int i = 0; i < get_types_count (); ++i) + { + const ResourceTypeItem& type = get_type (i); + if (unlikely (!type.sanitize (c))) + return_trace (false); + for (unsigned int j = 0; j < type.get_resource_count (); ++j) + if (unlikely (!get_ref_item (type, j).sanitize (c))) + return_trace (false); + } + return_trace (true); + } + + inline const ResourceTypeItem& get_type (unsigned int i) const + { + // Why offset from the second byte of the object? I'm not sure + return ((&reserved[2])+typeList)[i]; + } + + inline unsigned int get_types_count () const + { + return nTypes + 1; + } + + inline const ResourceRefItem &get_ref_item (const ResourceTypeItem &type, + unsigned int i) const + { + return type.get_ref_item (&(this+typeList), i); + } + + inline const PString& get_name (const ResourceRefItem &item, + unsigned int i) const + { + if (item.nameOffset == -1) + return Null (PString); + + return StructAtOffset<PString> (this, nameList + item.nameOffset); + } + + protected: + HBUINT8 reserved[16]; /* Reserved for copy of resource header */ + LOffsetTo<ResourceMap> + reserved1; /* Reserved for handle to next resource map */ + HBUINT16 reserved2; /* Reserved for file reference number */ + HBUINT16 attr; /* Resource fork attribute */ + OffsetTo<UnsizedArrayOf<ResourceTypeItem> > + typeList; /* Offset from beginning of map to + * resource type list */ + HBUINT16 nameList; /* Offset from beginning of map to + * resource name list */ + HBUINT16 nTypes; /* Number of types in the map minus 1 */ + public: + DEFINE_SIZE_STATIC (30); +}; + +struct ResourceForkHeader +{ + inline unsigned int get_face_count () const + { + const ResourceMap &resource_map = this+map; + for (unsigned int i = 0; i < resource_map.get_types_count (); ++i) + { + const ResourceTypeItem& type = resource_map.get_type (i); + if (type.is_sfnt ()) + return type.get_resource_count (); + } + return 0; + } + + inline const LArrayOf<HBUINT8>& get_data (const ResourceTypeItem& type, + unsigned int idx) const + { + const ResourceMap &resource_map = this+map; + unsigned int offset = dataOffset; + offset += resource_map.get_ref_item (type, idx).dataOffset; + return StructAtOffset<LArrayOf<HBUINT8> > (this, offset); + } + + inline const OpenTypeFontFace& get_face (unsigned int idx) const + { + const ResourceMap &resource_map = this+map; + for (unsigned int i = 0; i < resource_map.get_types_count (); ++i) + { + const ResourceTypeItem& type = resource_map.get_type (i); + if (type.is_sfnt () && idx < type.get_resource_count ()) + return (OpenTypeFontFace&) get_data (type, idx).arrayZ; + } + return Null (OpenTypeFontFace); + } + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + if (unlikely (!c->check_struct (this))) + return_trace (false); + + const ResourceMap &resource_map = this+map; + if (unlikely (!resource_map.sanitize (c))) + return_trace (false); + + for (unsigned int i = 0; i < resource_map.get_types_count (); ++i) + { + const ResourceTypeItem& type = resource_map.get_type (i); + for (unsigned int j = 0; j < type.get_resource_count (); ++j) + { + const LArrayOf<HBUINT8>& data = get_data (type, j); + if (unlikely (!(data.sanitize (c) && + ((OpenTypeFontFace&) data.arrayZ).sanitize (c)))) + return_trace (false); + } + } + + return_trace (true); + } + + protected: + HBUINT32 dataOffset; /* Offset from beginning of resource fork + * to resource data */ + LOffsetTo<ResourceMap> + map; /* Offset from beginning of resource fork + * to resource map */ + HBUINT32 dataLen; /* Length of resource data */ + HBUINT32 mapLen; /* Length of resource map */ + public: + DEFINE_SIZE_STATIC (16); +}; /* * OpenType Font File @@ -295,11 +486,14 @@ { static const hb_tag_t tableTag = HB_TAG ('_','_','_','_'); /* Sanitizer needs this. */ - static const hb_tag_t CFFTag = HB_TAG ('O','T','T','O'); /* OpenType with Postscript outlines */ - static const hb_tag_t TrueTypeTag = HB_TAG ( 0 , 1 , 0 , 0 ); /* OpenType with TrueType outlines */ - static const hb_tag_t TTCTag = HB_TAG ('t','t','c','f'); /* TrueType Collection */ - static const hb_tag_t TrueTag = HB_TAG ('t','r','u','e'); /* Obsolete Apple TrueType */ - static const hb_tag_t Typ1Tag = HB_TAG ('t','y','p','1'); /* Obsolete Apple Type1 font in SFNT container */ + enum { + CFFTag = HB_TAG ('O','T','T','O'), /* OpenType with Postscript outlines */ + TrueTypeTag = HB_TAG ( 0 , 1 , 0 , 0 ), /* OpenType with TrueType outlines */ + TTCTag = HB_TAG ('t','t','c','f'), /* TrueType Collection */ + DFontTag = HB_TAG ( 0 , 0 , 1 , 0 ), /* DFont Mac Resource Fork */ + TrueTag = HB_TAG ('t','r','u','e'), /* Obsolete Apple TrueType */ + Typ1Tag = HB_TAG ('t','y','p','1') /* Obsolete Apple Type1 font in SFNT container */ + }; inline hb_tag_t get_tag (void) const { return u.tag; } @@ -311,6 +505,7 @@ case Typ1Tag: case TrueTypeTag: return 1; case TTCTag: return u.ttcHeader.get_face_count (); +// case DFontTag: return u.rfHeader.get_face_count (); default: return 0; } } @@ -325,6 +520,7 @@ case Typ1Tag: case TrueTypeTag: return u.fontFace; case TTCTag: return u.ttcHeader.get_face (i); +// case DFontTag: return u.rfHeader.get_face (i); default: return Null(OpenTypeFontFace); } } @@ -351,6 +547,7 @@ case Typ1Tag: case TrueTypeTag: return_trace (u.fontFace.sanitize (c)); case TTCTag: return_trace (u.ttcHeader.sanitize (c)); +// case DFontTag: return_trace (u.rfHeader.sanitize (c)); default: return_trace (true); } } @@ -360,6 +557,7 @@ Tag tag; /* 4-byte identifier. */ OpenTypeFontFace fontFace; TTCHeader ttcHeader; + ResourceForkHeader rfHeader; } u; public: DEFINE_SIZE_UNION (4, tag); diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-type-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-type-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-type-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-open-type-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ #include "hb-private.hh" #include "hb-debug.hh" +#include "hb-blob-private.hh" #include "hb-face-private.hh" @@ -127,46 +128,6 @@ /* - * Null objects - */ - -/* Global nul-content Null pool. Enlarge as necessary. */ - -#define HB_NULL_POOL_SIZE 264 -static_assert (HB_NULL_POOL_SIZE % sizeof (void *) == 0, "Align HB_NULL_POOL_SIZE."); - -#ifdef HB_NO_VISIBILITY -static -#else -extern HB_INTERNAL -#endif -const void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] -#ifdef HB_NO_VISIBILITY -= {} -#endif -; - -/* Generic nul-content Null objects. */ -template <typename Type> -static inline const Type& Null (void) { - static_assert (sizeof (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE."); - return *CastP<Type> (_hb_NullPool); -} - -/* Specializaiton for arbitrary-content arbitrary-sized Null objects. */ -#define DEFINE_NULL_DATA(Type, data) \ -static const char _Null##Type[sizeof (Type) + 1] = data; /* +1 is for nul-termination in data */ \ -template <> \ -/*static*/ inline const Type& Null<Type> (void) { \ - return *CastP<Type> (_Null##Type); \ -} /* The following line really exists such that we end in a place needing semicolon */ \ -static_assert (Type::min_size + 1 <= sizeof (_Null##Type), "Null pool too small. Enlarge.") - -/* Accessor macro. */ -#define Null(Type) Null<Type>() - - -/* * Dispatch */ @@ -225,7 +186,7 @@ inline void start_processing (void) { this->start = hb_blob_get_data (this->blob, nullptr); - this->end = this->start + hb_blob_get_length (this->blob); + this->end = this->start + this->blob->length; assert (this->start <= this->end); /* Must not overflow. */ this->max_ops = MAX ((unsigned int) (this->end - this->start) * HB_SANITIZE_MAX_OPS_FACTOR, (unsigned) HB_SANITIZE_MAX_OPS_MIN); @@ -288,7 +249,7 @@ return likely (this->check_range (obj, obj->min_size)); } - inline bool may_edit (const void *base HB_UNUSED, unsigned int len HB_UNUSED) + inline bool may_edit (const void *base, unsigned int len) { if (this->edit_count >= HB_SANITIZE_MAX_EDITS) return false; @@ -368,7 +329,7 @@ unsigned int edit_count = c->edit_count; if (edit_count && !c->writable) { c->start = hb_blob_get_data_writable (blob, nullptr); - c->end = c->start + hb_blob_get_length (blob); + c->end = c->start + blob->length; if (c->start) { c->writable = true; @@ -383,19 +344,17 @@ DEBUG_MSG_FUNC (SANITIZE, c->start, sane ? "PASSED" : "FAILED"); if (sane) + { + blob->lock (); return blob; - else { + } + else + { hb_blob_destroy (blob); return hb_blob_get_empty (); } } - static const Type* lock_instance (hb_blob_t *blob) { - hb_blob_make_immutable (blob); - const char *base = hb_blob_get_data (blob, nullptr); - return unlikely (!base) ? &Null(Type) : CastP<Type> (base); - } - inline void set_num_glyphs (unsigned int num_glyphs) { c->num_glyphs = num_glyphs; } private: @@ -672,7 +631,7 @@ typedef IntType<int16_t, 2> HBINT16; /* 16-bit signed integer. */ typedef IntType<uint32_t, 4> HBUINT32; /* 32-bit unsigned integer. */ typedef IntType<int32_t, 4> HBINT32; /* 32-bit signed integer. */ -typedef IntType<uint32_t, 3> UINT24; /* 24-bit unsigned integer. */ +typedef IntType<uint32_t, 3> HBUINT24; /* 24-bit unsigned integer. */ /* 16-bit signed integer (HBINT16) that describes a quantity in FUnits. */ typedef HBINT16 FWORD; @@ -683,17 +642,19 @@ /* 16-bit signed fixed number with the low 14 bits of fraction (2.14). */ struct F2DOT14 : HBINT16 { - //inline float to_float (void) const { return ???; } - //inline void set_float (float f) { v.set (f * ???); } + // 16384 means 1<<14 + inline float to_float (void) const { return ((int32_t) v) / 16384.f; } + inline void set_float (float f) { v.set (round (f * 16384.f)); } public: DEFINE_SIZE_STATIC (2); }; /* 32-bit signed fixed-point number (16.16). */ -struct Fixed: HBINT32 +struct Fixed : HBINT32 { - inline float to_float (void) const { return ((int32_t) v) / 65536.0; } - inline void set_float (float f) { v.set (round (f * 65536.0)); } + // 65536 means 1<<16 + inline float to_float (void) const { return ((int32_t) v) / 65536.f; } + inline void set_float (float f) { v.set (round (f * 65536.f)); } public: DEFINE_SIZE_STATIC (4); }; @@ -724,16 +685,19 @@ public: DEFINE_SIZE_STATIC (4); }; -DEFINE_NULL_DATA (Tag, " "); +DEFINE_NULL_DATA (OT, Tag, " "); /* Glyph index number, same as uint16 (length = 16 bits) */ typedef HBUINT16 GlyphID; +/* Name-table index, same as uint16 (length = 16 bits) */ +typedef HBUINT16 NameID; + /* Script/language-system/feature index */ struct Index : HBUINT16 { static const unsigned int NOT_FOUND_INDEX = 0xFFFFu; }; -DEFINE_NULL_DATA (Index, "\xff\xff"); +DEFINE_NULL_DATA (OT, Index, "\xff\xff"); /* Offset, Null offset = 0 */ template <typename Type> @@ -815,6 +779,12 @@ { unsigned int offset = *this; if (unlikely (!offset)) return Null(Type); + return StructAtOffset<const Type> (base, offset); + } + inline Type& operator () (void *base) const + { + unsigned int offset = *this; + if (unlikely (!offset)) return Crap(Type); return StructAtOffset<Type> (base, offset); } @@ -862,6 +832,89 @@ * Array Types */ + +/* TODO Use it in ArrayOf, HeadlessArrayOf, and other places around the code base?? */ +template <typename Type> +struct UnsizedArrayOf +{ + inline const Type& operator [] (unsigned int i) const { return arrayZ[i]; } + inline Type& operator [] (unsigned int i) { return arrayZ[i]; } + + inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c, count))) return_trace (false); + + /* Note: for structs that do not reference other structs, + * we do not need to call their sanitize() as we already did + * a bound check on the aggregate array size. We just include + * a small unreachable expression to make sure the structs + * pointed to do have a simple sanitize(), ie. they do not + * reference other structs via offsets. + */ + (void) (false && arrayZ[0].sanitize (c)); + + return_trace (true); + } + inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c, count))) return_trace (false); + for (unsigned int i = 0; i < count; i++) + if (unlikely (!arrayZ[i].sanitize (c, base))) + return_trace (false); + return_trace (true); + } + template <typename T> + inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, const void *base, T user_data) const + { + TRACE_SANITIZE (this); + if (unlikely (!sanitize_shallow (c, count))) return_trace (false); + for (unsigned int i = 0; i < count; i++) + if (unlikely (!arrayZ[i].sanitize (c, base, user_data))) + return_trace (false); + return_trace (true); + } + + inline bool sanitize_shallow (hb_sanitize_context_t *c, unsigned int count) const + { + TRACE_SANITIZE (this); + return_trace (c->check_array (arrayZ, arrayZ[0].static_size, count)); + } + + public: + Type arrayZ[VAR]; + public: + DEFINE_SIZE_ARRAY (0, arrayZ); +}; + +/* Unsized array of offset's */ +template <typename Type, typename OffsetType> +struct UnsizedOffsetArrayOf : UnsizedArrayOf<OffsetTo<Type, OffsetType> > {}; + +/* Unsized array of offsets relative to the beginning of the array itself. */ +template <typename Type, typename OffsetType> +struct UnsizedOffsetListOf : UnsizedOffsetArrayOf<Type, OffsetType> +{ + inline const Type& operator [] (unsigned int i) const + { + return this+this->arrayZ[i]; + } + + inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const + { + TRACE_SANITIZE (this); + return_trace ((UnsizedOffsetArrayOf<Type, OffsetType>::sanitize (c, count, this))); + } + template <typename T> + inline bool sanitize (hb_sanitize_context_t *c, unsigned int count, T user_data) const + { + TRACE_SANITIZE (this); + return_trace ((UnsizedOffsetArrayOf<Type, OffsetType>::sanitize (c, count, this, user_data))); + } +}; + + /* An array with a number of elements. */ template <typename Type, typename LenType=HBUINT16> struct ArrayOf @@ -875,17 +928,18 @@ count -= start_offset; count = MIN (count, *pcount); *pcount = count; - return array + start_offset; + return arrayZ + start_offset; } inline const Type& operator [] (unsigned int i) const { if (unlikely (i >= len)) return Null(Type); - return array[i]; + return arrayZ[i]; } inline Type& operator [] (unsigned int i) { - return array[i]; + if (unlikely (i >= len)) return Crap(Type); + return arrayZ[i]; } inline unsigned int get_size (void) const { return len.static_size + len * Type::static_size; } @@ -907,7 +961,7 @@ TRACE_SERIALIZE (this); if (unlikely (!serialize (c, items_len))) return_trace (false); for (unsigned int i = 0; i < items_len; i++) - array[i] = items[i]; + arrayZ[i] = items[i]; items += items_len; return_trace (true); } @@ -924,7 +978,7 @@ * pointed to do have a simple sanitize(), ie. they do not * reference other structs via offsets. */ - (void) (false && array[0].sanitize (c)); + (void) (false && arrayZ[0].sanitize (c)); return_trace (true); } @@ -934,7 +988,7 @@ if (unlikely (!sanitize_shallow (c))) return_trace (false); unsigned int count = len; for (unsigned int i = 0; i < count; i++) - if (unlikely (!array[i].sanitize (c, base))) + if (unlikely (!arrayZ[i].sanitize (c, base))) return_trace (false); return_trace (true); } @@ -945,7 +999,7 @@ if (unlikely (!sanitize_shallow (c))) return_trace (false); unsigned int count = len; for (unsigned int i = 0; i < count; i++) - if (unlikely (!array[i].sanitize (c, base, user_data))) + if (unlikely (!arrayZ[i].sanitize (c, base, user_data))) return_trace (false); return_trace (true); } @@ -955,30 +1009,31 @@ { unsigned int count = len; for (unsigned int i = 0; i < count; i++) - if (!this->array[i].cmp (x)) + if (!this->arrayZ[i].cmp (x)) return i; return -1; } inline void qsort (void) { - ::qsort (array, len, sizeof (Type), Type::cmp); + ::qsort (arrayZ, len, sizeof (Type), Type::cmp); } private: inline bool sanitize_shallow (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (len.sanitize (c) && c->check_array (array, Type::static_size, len)); + return_trace (len.sanitize (c) && c->check_array (arrayZ, Type::static_size, len)); } public: LenType len; - Type array[VAR]; + Type arrayZ[VAR]; public: - DEFINE_SIZE_ARRAY (sizeof (LenType), array); + DEFINE_SIZE_ARRAY (sizeof (LenType), arrayZ); }; template <typename Type> struct LArrayOf : ArrayOf<Type, HBUINT32> {}; +typedef ArrayOf<HBUINT8, HBUINT8> PString; /* Array of Offset's */ template <typename Type, typename OffsetType=HBUINT16> @@ -991,7 +1046,12 @@ inline const Type& operator [] (unsigned int i) const { if (unlikely (i >= this->len)) return Null(Type); - return this+this->array[i]; + return this+this->arrayZ[i]; + } + inline const Type& operator [] (unsigned int i) + { + if (unlikely (i >= this->len)) return Crap(Type); + return this+this->arrayZ[i]; } inline bool sanitize (hb_sanitize_context_t *c) const @@ -1015,7 +1075,12 @@ inline const Type& operator [] (unsigned int i) const { if (unlikely (i >= len || !i)) return Null(Type); - return array[i-1]; + return arrayZ[i-1]; + } + inline Type& operator [] (unsigned int i) + { + if (unlikely (i >= len || !i)) return Crap(Type); + return arrayZ[i-1]; } inline unsigned int get_size (void) const { return len.static_size + (len ? len - 1 : 0) * Type::static_size; } @@ -1030,7 +1095,7 @@ if (unlikely (!items_len)) return_trace (true); if (unlikely (!c->extend (*this))) return_trace (false); for (unsigned int i = 0; i < items_len - 1; i++) - array[i] = items[i]; + arrayZ[i] = items[i]; items += items_len - 1; return_trace (true); } @@ -1047,7 +1112,7 @@ * pointed to do have a simple sanitize(), ie. they do not * reference other structs via offsets. */ - (void) (false && array[0].sanitize (c)); + (void) (false && arrayZ[0].sanitize (c)); return_trace (true); } @@ -1057,14 +1122,14 @@ { TRACE_SANITIZE (this); return_trace (len.sanitize (c) && - (!len || c->check_array (array, Type::static_size, len - 1))); + (!len || c->check_array (arrayZ, Type::static_size, len - 1))); } public: LenType len; - Type array[VAR]; + Type arrayZ[VAR]; public: - DEFINE_SIZE_ARRAY (sizeof (LenType), array); + DEFINE_SIZE_ARRAY (sizeof (LenType), arrayZ); }; @@ -1078,7 +1143,7 @@ inline int bsearch (const SearchType &x) const { /* Hand-coded bsearch here since this is in the hot inner loop. */ - const Type *arr = this->array; + const Type *arr = this->arrayZ; int min = 0, max = (int) this->len - 1; while (min <= max) { @@ -1113,18 +1178,18 @@ { len.set (v); assert (len == v); - entrySelectorZ.set (MAX (1u, _hb_bit_storage (v)) - 1); - searchRangeZ.set (16 * (1u << entrySelectorZ)); - rangeShiftZ.set (v * 16 > searchRangeZ - ? 16 * v - searchRangeZ - : 0); + entrySelector.set (MAX (1u, _hb_bit_storage (v)) - 1); + searchRange.set (16 * (1u << entrySelector)); + rangeShift.set (v * 16 > searchRange + ? 16 * v - searchRange + : 0); } protected: HBUINT16 len; - HBUINT16 searchRangeZ; - HBUINT16 entrySelectorZ; - HBUINT16 rangeShiftZ; + HBUINT16 searchRange; + HBUINT16 entrySelector; + HBUINT16 rangeShift; public: DEFINE_SIZE_STATIC (8); @@ -1136,7 +1201,7 @@ /* Lazy struct and blob loaders. */ -/* Logic is shared between hb_lazy_loader_t and hb_lazy_table_loader_t */ +/* Logic is shared between hb_lazy_loader_t and hb_table_lazy_loader_t */ template <typename T> struct hb_lazy_loader_t { @@ -1148,7 +1213,7 @@ inline void fini (void) { - if (instance && instance != &OT::Null(T)) + if (instance && instance != &Null(T)) { instance->fini(); free (instance); @@ -1163,12 +1228,12 @@ { p = (T *) calloc (1, sizeof (T)); if (unlikely (!p)) - p = const_cast<T *> (&OT::Null(T)); + p = const_cast<T *> (&Null(T)); else p->init (face); if (unlikely (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), nullptr, p))) { - if (p != &OT::Null(T)) + if (p != &Null(T)) p->fini (); goto retry; } @@ -1186,15 +1251,14 @@ T *instance; }; -/* Logic is shared between hb_lazy_loader_t and hb_lazy_table_loader_t */ +/* Logic is shared between hb_lazy_loader_t and hb_table_lazy_loader_t */ template <typename T> -struct hb_lazy_table_loader_t +struct hb_table_lazy_loader_t { inline void init (hb_face_t *face_) { face = face_; blob = nullptr; - instance = nullptr; } inline void fini (void) @@ -1205,19 +1269,18 @@ inline const T* get (void) const { retry: - T *p = (T *) hb_atomic_ptr_get (&instance); - if (unlikely (!p)) + hb_blob_t *blob_ = (hb_blob_t *) hb_atomic_ptr_get (&blob); + if (unlikely (!blob_)) { - hb_blob_t *blob_ = OT::Sanitizer<T>().sanitize (face->reference_table (T::tableTag)); - p = const_cast<T *>(OT::Sanitizer<T>::lock_instance (blob_)); - if (!hb_atomic_ptr_cmpexch (const_cast<T **>(&instance), nullptr, p)) + blob_ = OT::Sanitizer<T>().sanitize (face->reference_table (T::tableTag)); + if (!hb_atomic_ptr_cmpexch (&blob, nullptr, blob_)) { hb_blob_destroy (blob_); goto retry; } blob = blob_; } - return p; + return blob_->as<T> (); } inline const T* operator-> (void) const @@ -1225,10 +1288,9 @@ return get(); } + private: hb_face_t *face; mutable hb_blob_t *blob; - private: - mutable T *instance; }; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-cmap-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-cmap-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-cmap-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-cmap-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -28,18 +28,19 @@ #define HB_OT_CMAP_TABLE_HH #include "hb-open-type-private.hh" +#include "hb-set-private.hh" #include "hb-subset-plan.hh" -namespace OT { - - /* - * cmap -- Character To Glyph Index Mapping Table + * cmap -- Character to Glyph Index Mapping + * https://docs.microsoft.com/en-us/typography/opentype/spec/cmap */ - #define HB_OT_TAG_cmap HB_TAG('c','m','a','p') +namespace OT { + + struct CmapSubtableFormat0 { inline bool get_glyph (hb_codepoint_t codepoint, hb_codepoint_t *glyph) const @@ -59,8 +60,8 @@ protected: HBUINT16 format; /* Format number is set to 0. */ - HBUINT16 lengthZ; /* Byte length of this subtable. */ - HBUINT16 languageZ; /* Ignore. */ + HBUINT16 length; /* Byte length of this subtable. */ + HBUINT16 language; /* Ignore. */ HBUINT8 glyphIdArray[256];/* An array that maps character * code to glyph index values. */ public: @@ -69,6 +70,158 @@ struct CmapSubtableFormat4 { + struct segment_plan + { + HBUINT16 start_code; + HBUINT16 end_code; + bool use_delta; + }; + + bool serialize (hb_serialize_context_t *c, + const hb_subset_plan_t *plan, + const hb_vector_t<segment_plan> &segments) + { + TRACE_SERIALIZE (this); + + if (unlikely (!c->extend_min (*this))) return_trace (false); + + this->format.set (4); + this->length.set (get_sub_table_size (segments)); + + this->segCountX2.set (segments.len * 2); + this->entrySelector.set (MAX (1u, _hb_bit_storage (segments.len)) - 1); + this->searchRange.set (2 * (1u << this->entrySelector)); + this->rangeShift.set (segments.len * 2 > this->searchRange + ? 2 * segments.len - this->searchRange + : 0); + + HBUINT16 *end_count = c->allocate_size<HBUINT16> (HBUINT16::static_size * segments.len); + c->allocate_size<HBUINT16> (HBUINT16::static_size); // 2 bytes of padding. + HBUINT16 *start_count = c->allocate_size<HBUINT16> (HBUINT16::static_size * segments.len); + HBINT16 *id_delta = c->allocate_size<HBINT16> (HBUINT16::static_size * segments.len); + HBUINT16 *id_range_offset = c->allocate_size<HBUINT16> (HBUINT16::static_size * segments.len); + + if (id_range_offset == nullptr) + return_trace (false); + + for (unsigned int i = 0; i < segments.len; i++) + { + end_count[i].set (segments[i].end_code); + start_count[i].set (segments[i].start_code); + if (segments[i].use_delta) + { + hb_codepoint_t cp = segments[i].start_code; + hb_codepoint_t start_gid = 0; + if (unlikely (!plan->new_gid_for_codepoint (cp, &start_gid) && cp != 0xFFFF)) + return_trace (false); + id_delta[i].set (start_gid - segments[i].start_code); + } else { + id_delta[i].set (0); + unsigned int num_codepoints = segments[i].end_code - segments[i].start_code + 1; + HBUINT16 *glyph_id_array = c->allocate_size<HBUINT16> (HBUINT16::static_size * num_codepoints); + if (glyph_id_array == nullptr) + return_trace (false); + // From the cmap spec: + // + // id_range_offset[i]/2 + // + (cp - segments[i].start_code) + // + (id_range_offset + i) + // = + // glyph_id_array + (cp - segments[i].start_code) + // + // So, solve for id_range_offset[i]: + // + // id_range_offset[i] + // = + // 2 * (glyph_id_array - id_range_offset - i) + id_range_offset[i].set (2 * ( + glyph_id_array - id_range_offset - i)); + for (unsigned int j = 0; j < num_codepoints; j++) + { + hb_codepoint_t cp = segments[i].start_code + j; + hb_codepoint_t new_gid; + if (unlikely (!plan->new_gid_for_codepoint (cp, &new_gid))) + return_trace (false); + glyph_id_array[j].set (new_gid); + } + } + } + + return_trace (true); + } + + static inline size_t get_sub_table_size (const hb_vector_t<segment_plan> &segments) + { + size_t segment_size = 0; + for (unsigned int i = 0; i < segments.len; i++) + { + // Parallel array entries + segment_size += + 2 // end count + + 2 // start count + + 2 // delta + + 2; // range offset + + if (!segments[i].use_delta) + // Add bytes for the glyph index array entries for this segment. + segment_size += (segments[i].end_code - segments[i].start_code + 1) * 2; + } + + return min_size + + 2 // Padding + + segment_size; + } + + static inline bool create_sub_table_plan (const hb_subset_plan_t *plan, + hb_vector_t<segment_plan> *segments) + { + segment_plan *segment = nullptr; + hb_codepoint_t last_gid = 0; + + hb_codepoint_t cp = HB_SET_VALUE_INVALID; + while (plan->unicodes->next (&cp)) { + hb_codepoint_t new_gid; + if (unlikely (!plan->new_gid_for_codepoint (cp, &new_gid))) + { + DEBUG_MSG(SUBSET, nullptr, "Unable to find new gid for %04x", cp); + return false; + } + + if (cp > 0xFFFF) { + // We are now outside of unicode BMP, stop adding to this cmap. + break; + } + + if (!segment + || cp != segment->end_code + 1u) + { + segment = segments->push (); + segment->start_code.set (cp); + segment->end_code.set (cp); + segment->use_delta = true; + } else { + segment->end_code.set (cp); + if (last_gid + 1u != new_gid) + // gid's are not consecutive in this segment so delta + // cannot be used. + segment->use_delta = false; + } + + last_gid = new_gid; + } + + // There must be a final entry with end_code == 0xFFFF. Check if we need to add one. + if (segment == nullptr || segment->end_code != 0xFFFF) + { + segment = segments->push (); + segment->start_code.set (0xFFFF); + segment->end_code.set (0xFFFF); + segment->use_delta = true; + } + + return true; + } + struct accelerator_t { inline void init (const CmapSubtableFormat4 *subtable) @@ -127,6 +280,17 @@ return true; } + static inline void get_all_codepoints_func (const void *obj, hb_set_t *out) + { + const accelerator_t *thiz = (const accelerator_t *) obj; + for (unsigned int i = 0; i < thiz->segCount; i++) + { + if (thiz->startCount[i] != 0xFFFFu + || thiz->endCount[i] != 0xFFFFu) // Skip the last segment (0xFFFF) + hb_set_add_range (out, thiz->startCount[i], thiz->endCount[i]); + } + } + const HBUINT16 *endCount; const HBUINT16 *startCount; const HBUINT16 *idDelta; @@ -164,15 +328,17 @@ return_trace (16 + 4 * (unsigned int) segCountX2 <= length); } + + protected: HBUINT16 format; /* Format number is set to 4. */ HBUINT16 length; /* This is the length in bytes of the * subtable. */ - HBUINT16 languageZ; /* Ignore. */ + HBUINT16 language; /* Ignore. */ HBUINT16 segCountX2; /* 2 x segCount. */ - HBUINT16 searchRangeZ; /* 2 * (2**floor(log2(segCount))) */ - HBUINT16 entrySelectorZ; /* log2(searchRange/2) */ - HBUINT16 rangeShiftZ; /* 2 x segCount - searchRange */ + HBUINT16 searchRange; /* 2 * (2**floor(log2(segCount))) */ + HBUINT16 entrySelector; /* log2(searchRange/2) */ + HBUINT16 rangeShift; /* 2 x segCount - searchRange */ HBUINT16 values[VAR]; #if 0 @@ -193,6 +359,8 @@ { friend struct CmapSubtableFormat12; friend struct CmapSubtableFormat13; + template<typename U> + friend struct CmapSubtableLongSegmented; friend struct cmap; int cmp (hb_codepoint_t codepoint) const @@ -238,8 +406,8 @@ protected: UINT formatReserved; /* Subtable format and (maybe) padding. */ - UINT lengthZ; /* Byte length of this subtable. */ - UINT languageZ; /* Ignore. */ + UINT length; /* Byte length of this subtable. */ + UINT language; /* Ignore. */ UINT startCharCode; /* First character code covered. */ ArrayOf<GlyphID, UINT> glyphIdArray; /* Array of glyph index values for character @@ -265,6 +433,15 @@ return true; } + inline void get_all_codepoints (hb_set_t *out) const + { + for (unsigned int i = 0; i < this->groups.len; i++) { + hb_set_add_range (out, + this->groups[i].startCharCode, + this->groups[i].endCharCode); + } + } + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -272,20 +449,20 @@ } inline bool serialize (hb_serialize_context_t *c, - hb_prealloced_array_t<CmapSubtableLongGroup> &group_data) + const hb_vector_t<CmapSubtableLongGroup> &group_data) { TRACE_SERIALIZE (this); if (unlikely (!c->extend_min (*this))) return_trace (false); - Supplier<CmapSubtableLongGroup> supplier (group_data.array, group_data.len); + Supplier<CmapSubtableLongGroup> supplier (group_data.arrayZ, group_data.len); if (unlikely (!groups.serialize (c, supplier, group_data.len))) return_trace (false); return true; } protected: HBUINT16 format; /* Subtable format; set to 12. */ - HBUINT16 reservedZ; /* Reserved; set to 0. */ - HBUINT32 lengthZ; /* Byte length of this subtable. */ - HBUINT32 languageZ; /* Ignore. */ + HBUINT16 reserved; /* Reserved; set to 0. */ + HBUINT32 length; /* Byte length of this subtable. */ + HBUINT32 language; /* Ignore. */ SortedArrayOf<CmapSubtableLongGroup, HBUINT32> groups; /* Groupings. */ public: @@ -297,6 +474,69 @@ static inline hb_codepoint_t group_get_glyph (const CmapSubtableLongGroup &group, hb_codepoint_t u) { return group.glyphID + (u - group.startCharCode); } + + + bool serialize (hb_serialize_context_t *c, + const hb_vector_t<CmapSubtableLongGroup> &groups) + { + if (unlikely (!c->extend_min (*this))) return false; + + this->format.set (12); + this->reserved.set (0); + this->length.set (get_sub_table_size (groups)); + + return CmapSubtableLongSegmented<CmapSubtableFormat12>::serialize (c, groups); + } + + static inline size_t get_sub_table_size (const hb_vector_t<CmapSubtableLongGroup> &groups) + { + return 16 + 12 * groups.len; + } + + static inline bool create_sub_table_plan (const hb_subset_plan_t *plan, + hb_vector_t<CmapSubtableLongGroup> *groups) + { + CmapSubtableLongGroup *group = nullptr; + + hb_codepoint_t cp = HB_SET_VALUE_INVALID; + while (plan->unicodes->next (&cp)) { + hb_codepoint_t new_gid; + if (unlikely (!plan->new_gid_for_codepoint (cp, &new_gid))) + { + DEBUG_MSG(SUBSET, nullptr, "Unable to find new gid for %04x", cp); + return false; + } + + if (!group || !_is_gid_consecutive (group, cp, new_gid)) + { + group = groups->push (); + group->startCharCode.set (cp); + group->endCharCode.set (cp); + group->glyphID.set (new_gid); + } else + { + group->endCharCode.set (cp); + } + } + + DEBUG_MSG(SUBSET, nullptr, "cmap"); + for (unsigned int i = 0; i < groups->len; i++) { + CmapSubtableLongGroup& group = (*groups)[i]; + DEBUG_MSG(SUBSET, nullptr, " %d: U+%04X-U+%04X, gid %d-%d", i, (uint32_t) group.startCharCode, (uint32_t) group.endCharCode, (uint32_t) group.glyphID, (uint32_t) group.glyphID + ((uint32_t) group.endCharCode - (uint32_t) group.startCharCode)); + } + + return true; + } + + private: + static inline bool _is_gid_consecutive (CmapSubtableLongGroup *group, + hb_codepoint_t cp, + hb_codepoint_t new_gid) + { + return (cp - 1 == group->endCharCode) && + new_gid == group->glyphID + (cp - group->startCharCode); + } + }; struct CmapSubtableFormat13 : CmapSubtableLongSegmented<CmapSubtableFormat13> @@ -328,7 +568,7 @@ return_trace (c->check_struct (this)); } - UINT24 startUnicodeValue; /* First value in this range. */ + HBUINT24 startUnicodeValue; /* First value in this range. */ HBUINT8 additionalCount; /* Number of additional values in this * range. */ public: @@ -350,7 +590,7 @@ return_trace (c->check_struct (this)); } - UINT24 unicodeValue; /* Base Unicode value of the UVS */ + HBUINT24 unicodeValue; /* Base Unicode value of the UVS */ GlyphID glyphID; /* Glyph ID of the UVS */ public: DEFINE_SIZE_STATIC (5); @@ -392,7 +632,7 @@ nonDefaultUVS.sanitize (c, base)); } - UINT24 varSelector; /* Variation selector. */ + HBUINT24 varSelector; /* Variation selector. */ LOffsetTo<DefaultUVS> defaultUVS; /* Offset to Default UVS Table. May be 0. */ LOffsetTo<NonDefaultUVS> @@ -419,7 +659,7 @@ protected: HBUINT16 format; /* Format number is set to 14. */ - HBUINT32 lengthZ; /* Byte length of this subtable. */ + HBUINT32 length; /* Byte length of this subtable. */ SortedArrayOf<VariationSelectorRecord, HBUINT32> record; /* Variation selector records; sorted * in increasing order of `varSelector'. */ @@ -509,6 +749,33 @@ { static const hb_tag_t tableTag = HB_OT_TAG_cmap; + struct subset_plan { + subset_plan(void) + { + format4_segments.init(); + format12_groups.init(); + } + + ~subset_plan(void) + { + format4_segments.fini(); + format12_groups.fini(); + } + + inline size_t final_size() const + { + return 4 // header + + 8 * 3 // 3 EncodingRecord + + CmapSubtableFormat4::get_sub_table_size (this->format4_segments) + + CmapSubtableFormat12::get_sub_table_size (this->format12_groups); + } + + // Format 4 + hb_vector_t<CmapSubtableFormat4::segment_plan> format4_segments; + // Format 12 + hb_vector_t<CmapSubtableLongGroup> format12_groups; + }; + inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); @@ -517,41 +784,17 @@ encodingRecord.sanitize (c, this)); } - inline bool populate_groups (hb_subset_plan_t *plan, - hb_prealloced_array_t<CmapSubtableLongGroup> *groups) const + inline bool _create_plan (const hb_subset_plan_t *plan, + subset_plan *cmap_plan) const { - CmapSubtableLongGroup *group = nullptr; - for (unsigned int i = 0; i < plan->codepoints.len; i++) { - - hb_codepoint_t cp = plan->codepoints[i]; - if (!group || cp - 1 != group->endCharCode) - { - group = groups->push (); - group->startCharCode.set (cp); - group->endCharCode.set (cp); - hb_codepoint_t new_gid; - if (unlikely (!hb_subset_plan_new_gid_for_codepoint (plan, cp, &new_gid))) - { - DEBUG_MSG(SUBSET, nullptr, "Unable to find new gid for %04x", cp); - return false; - } - group->glyphID.set (new_gid); - } else - { - group->endCharCode.set (cp); - } - } - - DEBUG_MSG(SUBSET, nullptr, "cmap"); - for (unsigned int i = 0; i < groups->len; i++) { - CmapSubtableLongGroup& group = (*groups)[i]; - DEBUG_MSG(SUBSET, nullptr, " %d: U+%04X-U+%04X, gid %d-%d", i, (uint32_t) group.startCharCode, (uint32_t) group.endCharCode, (uint32_t) group.glyphID, (uint32_t) group.glyphID + ((uint32_t) group.endCharCode - (uint32_t) group.startCharCode)); - } + if (unlikely( !CmapSubtableFormat4::create_sub_table_plan (plan, &cmap_plan->format4_segments))) + return false; - return true; + return CmapSubtableFormat12::create_sub_table_plan (plan, &cmap_plan->format12_groups); } - inline bool _subset (hb_prealloced_array_t<CmapSubtableLongGroup> &groups, + inline bool _subset (const hb_subset_plan_t *plan, + const subset_plan &cmap_subset_plan, size_t dest_sz, void *dest) const { @@ -565,25 +808,46 @@ cmap->version.set (0); - if (unlikely (!cmap->encodingRecord.serialize (&c, /* numTables */ 1))) return false; - - EncodingRecord &rec = cmap->encodingRecord[0]; - rec.platformID.set (3); // Windows - rec.encodingID.set (10); // Unicode UCS-4 + if (unlikely (!cmap->encodingRecord.serialize (&c, /* numTables */ 3))) + return false; - /* capture offset to subtable */ - CmapSubtable &subtable = rec.subtable.serialize (&c, cmap); + // TODO(grieger): Convert the below to a for loop - subtable.u.format.set (12); + // Format 4, Plat 0 Encoding Record + EncodingRecord &format4_plat0_rec = cmap->encodingRecord[0]; + format4_plat0_rec.platformID.set (0); // Unicode + format4_plat0_rec.encodingID.set (3); + + // Format 4, Plat 3 Encoding Record + EncodingRecord &format4_plat3_rec = cmap->encodingRecord[1]; + format4_plat3_rec.platformID.set (3); // Windows + format4_plat3_rec.encodingID.set (1); // Unicode BMP + + // Format 12 Encoding Record + EncodingRecord &format12_rec = cmap->encodingRecord[2]; + format12_rec.platformID.set (3); // Windows + format12_rec.encodingID.set (10); // Unicode UCS-4 - CmapSubtableFormat12 &format12 = subtable.u.format12; - if (unlikely (!c.extend_min (format12))) return false; + // Write out format 4 sub table + { + CmapSubtable &subtable = format4_plat0_rec.subtable.serialize (&c, cmap); + format4_plat3_rec.subtable.set (format4_plat0_rec.subtable); + subtable.u.format.set (4); + + CmapSubtableFormat4 &format4 = subtable.u.format4; + if (unlikely (!format4.serialize (&c, plan, cmap_subset_plan.format4_segments))) + return false; + } - format12.format.set (12); - format12.reservedZ.set (0); - format12.lengthZ.set (16 + 12 * groups.len); + // Write out format 12 sub table. + { + CmapSubtable &subtable = format12_rec.subtable.serialize (&c, cmap); + subtable.u.format.set (12); - if (unlikely (!format12.serialize (&c, groups))) return false; + CmapSubtableFormat12 &format12 = subtable.u.format12; + if (unlikely (!format12.serialize (&c, cmap_subset_plan.format12_groups))) + return false; + } c.end_serialize (); @@ -592,24 +856,25 @@ inline bool subset (hb_subset_plan_t *plan) const { - hb_auto_array_t<CmapSubtableLongGroup> groups; + subset_plan cmap_subset_plan; - if (unlikely (!populate_groups (plan, &groups))) return false; + if (unlikely (!_create_plan (plan, &cmap_subset_plan))) + { + DEBUG_MSG(SUBSET, nullptr, "Failed to generate a cmap subsetting plan."); + return false; + } // We now know how big our blob needs to be - // TODO use APIs from the structs to get size? - size_t dest_sz = 4 // header - + 8 // 1 EncodingRecord - + 16 // Format 12 header - + 12 * groups.len; // SequentialMapGroup records + size_t dest_sz = cmap_subset_plan.final_size(); void *dest = malloc (dest_sz); if (unlikely (!dest)) { DEBUG_MSG(SUBSET, nullptr, "Unable to alloc %lu for cmap subset output", (unsigned long) dest_sz); return false; } - if (unlikely (!_subset (groups, dest_sz, dest))) + if (unlikely (!_subset (plan, cmap_subset_plan, dest_sz, dest))) { + DEBUG_MSG(SUBSET, nullptr, "Failed to perform subsetting of cmap."); free (dest); return false; } @@ -620,7 +885,7 @@ HB_MEMORY_MODE_READONLY, dest, free); - bool result = hb_subset_plan_add_table (plan, HB_OT_TAG_cmap, cmap_prime); + bool result = plan->add_table (HB_OT_TAG_cmap, cmap_prime); hb_blob_destroy (cmap_prime); return result; } @@ -630,7 +895,7 @@ inline void init (hb_face_t *face) { this->blob = OT::Sanitizer<OT::cmap>().sanitize (face->reference_table (HB_OT_TAG_cmap)); - const OT::cmap *cmap = OT::Sanitizer<OT::cmap>::lock_instance (this->blob); + const OT::cmap *cmap = this->blob->as<OT::cmap> (); const OT::CmapSubtable *subtable = nullptr; const OT::CmapSubtableFormat14 *subtable_uvs = nullptr; @@ -651,7 +916,7 @@ if (subtable) symbol = true; } /* Meh. */ - if (!subtable) subtable = &OT::Null(OT::CmapSubtable); + if (!subtable) subtable = &Null(OT::CmapSubtable); /* UVS subtable. */ if (!subtable_uvs) @@ -661,26 +926,36 @@ subtable_uvs = &st->u.format14; } /* Meh. */ - if (!subtable_uvs) subtable_uvs = &OT::Null(OT::CmapSubtableFormat14); + if (!subtable_uvs) subtable_uvs = &Null(OT::CmapSubtableFormat14); this->uvs_table = subtable_uvs; this->get_glyph_data = subtable; if (unlikely (symbol)) + { this->get_glyph_func = get_glyph_from_symbol<OT::CmapSubtable>; - else + this->get_all_codepoints_func = null_get_all_codepoints_func; + } else { switch (subtable->u.format) { /* Accelerate format 4 and format 12. */ - default: this->get_glyph_func = get_glyph_from<OT::CmapSubtable>; break; - case 12: this->get_glyph_func = get_glyph_from<OT::CmapSubtableFormat12>; break; + default: + this->get_glyph_func = get_glyph_from<OT::CmapSubtable>; + this->get_all_codepoints_func = null_get_all_codepoints_func; + break; + case 12: + this->get_glyph_func = get_glyph_from<OT::CmapSubtableFormat12>; + this->get_all_codepoints_func = get_all_codepoints_from<OT::CmapSubtableFormat12>; + break; case 4: { this->format4_accel.init (&subtable->u.format4); this->get_glyph_data = &this->format4_accel; this->get_glyph_func = this->format4_accel.get_glyph_func; + this->get_all_codepoints_func = this->format4_accel.get_all_codepoints_func; } break; } + } } inline void fini (void) @@ -710,10 +985,22 @@ return get_nominal_glyph (unicode, glyph); } + inline void get_all_codepoints (hb_set_t *out) const + { + this->get_all_codepoints_func (get_glyph_data, out); + } + protected: typedef bool (*hb_cmap_get_glyph_func_t) (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph); + typedef void (*hb_cmap_get_all_codepoints_func_t) (const void *obj, + hb_set_t *out); + + static inline void null_get_all_codepoints_func (const void *obj, hb_set_t *out) + { + // NOOP + } template <typename Type> static inline bool get_glyph_from (const void *obj, @@ -725,6 +1012,14 @@ } template <typename Type> + static inline void get_all_codepoints_from (const void *obj, + hb_set_t *out) + { + const Type *typed_obj = (const Type *) obj; + typed_obj->get_all_codepoints (out); + } + + template <typename Type> static inline bool get_glyph_from_symbol (const void *obj, hb_codepoint_t codepoint, hb_codepoint_t *glyph) @@ -738,7 +1033,7 @@ /* For symbol-encoded OpenType fonts, we duplicate the * U+F000..F0FF range at U+0000..U+00FF. That's what * Windows seems to do, and that's hinted about at: - * http://www.microsoft.com/typography/otspec/recom.htm + * https://docs.microsoft.com/en-us/typography/opentype/spec/recom * under "Non-Standard (Symbol) Fonts". */ return typed_obj->get_glyph (0xF000u + codepoint, glyph); } @@ -749,6 +1044,8 @@ private: hb_cmap_get_glyph_func_t get_glyph_func; const void *get_glyph_data; + hb_cmap_get_all_codepoints_func_t get_all_codepoints_func; + OT::CmapSubtableFormat4::accelerator_t format4_accel; const OT::CmapSubtableFormat14 *uvs_table; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-cbdt-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-cbdt-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-cbdt-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-cbdt-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,18 @@ #include "hb-open-type-private.hh" +/* + * CBLC -- Color Bitmap Location + * https://docs.microsoft.com/en-us/typography/opentype/spec/cblc + * https://docs.microsoft.com/en-us/typography/opentype/spec/eblc + * CBDT -- Color Bitmap Data + * https://docs.microsoft.com/en-us/typography/opentype/spec/cbdt + * https://docs.microsoft.com/en-us/typography/opentype/spec/ebdt + */ +#define HB_OT_TAG_CBLC HB_TAG('C','B','L','C') +#define HB_OT_TAG_CBDT HB_TAG('C','B','D','T') + + namespace OT { struct SmallGlyphMetrics @@ -47,21 +59,21 @@ extents->height = -height; } - HBUINT8 height; - HBUINT8 width; - HBINT8 bearingX; - HBINT8 bearingY; - HBUINT8 advance; - + HBUINT8 height; + HBUINT8 width; + HBINT8 bearingX; + HBINT8 bearingY; + HBUINT8 advance; + public: DEFINE_SIZE_STATIC(5); }; struct BigGlyphMetrics : SmallGlyphMetrics { - HBINT8 vertBearingX; - HBINT8 vertBearingY; - HBUINT8 vertAdvance; - + HBINT8 vertBearingX; + HBINT8 vertBearingY; + HBUINT8 vertAdvance; + public: DEFINE_SIZE_STATIC(8); }; @@ -73,19 +85,19 @@ return_trace (c->check_struct (this)); } - HBINT8 ascender; - HBINT8 decender; - HBUINT8 widthMax; - HBINT8 caretSlopeNumerator; - HBINT8 caretSlopeDenominator; - HBINT8 caretOffset; - HBINT8 minOriginSB; - HBINT8 minAdvanceSB; - HBINT8 maxBeforeBL; - HBINT8 minAfterBL; - HBINT8 padding1; - HBINT8 padding2; - + HBINT8 ascender; + HBINT8 decender; + HBUINT8 widthMax; + HBINT8 caretSlopeNumerator; + HBINT8 caretSlopeDenominator; + HBINT8 caretOffset; + HBINT8 minOriginSB; + HBINT8 minAdvanceSB; + HBINT8 maxBeforeBL; + HBINT8 minAfterBL; + HBINT8 padding1; + HBINT8 padding2; + public: DEFINE_SIZE_STATIC(12); }; @@ -102,10 +114,10 @@ return_trace (c->check_struct (this)); } - HBUINT16 indexFormat; - HBUINT16 imageFormat; - HBUINT32 imageDataOffset; - + HBUINT16 indexFormat; + HBUINT16 imageFormat; + HBUINT32 imageDataOffset; + public: DEFINE_SIZE_STATIC(8); }; @@ -131,9 +143,9 @@ return true; } - IndexSubtableHeader header; - Offset<OffsetType> offsetArrayZ[VAR]; - + IndexSubtableHeader header; + Offset<OffsetType> offsetArrayZ[VAR]; + public: DEFINE_SIZE_ARRAY(8, offsetArrayZ); }; @@ -214,15 +226,17 @@ offset, length, format); } - HBUINT16 firstGlyphIndex; - HBUINT16 lastGlyphIndex; - LOffsetTo<IndexSubtable> offsetToSubtable; - + GlyphID firstGlyphIndex; + GlyphID lastGlyphIndex; + LOffsetTo<IndexSubtable> offsetToSubtable; + public: DEFINE_SIZE_STATIC(8); }; struct IndexSubtableArray { + friend struct CBDT; + inline bool sanitize (hb_sanitize_context_t *c, unsigned int count) const { TRACE_SANITIZE (this); @@ -249,8 +263,7 @@ } protected: - IndexSubtableRecord indexSubtablesZ[VAR]; - + IndexSubtableRecord indexSubtablesZ[VAR]; public: DEFINE_SIZE_ARRAY(0, indexSubtablesZ); }; @@ -258,6 +271,7 @@ struct BitmapSizeTable { friend struct CBLC; + friend struct CBDT; inline bool sanitize (hb_sanitize_context_t *c, const void *base) const { @@ -275,19 +289,19 @@ } protected: - LOffsetTo<IndexSubtableArray> indexSubtableArrayOffset; - HBUINT32 indexTablesSize; - HBUINT32 numberOfIndexSubtables; - HBUINT32 colorRef; - SBitLineMetrics horizontal; - SBitLineMetrics vertical; - HBUINT16 startGlyphIndex; - HBUINT16 endGlyphIndex; - HBUINT8 ppemX; - HBUINT8 ppemY; - HBUINT8 bitDepth; - HBINT8 flags; - + LOffsetTo<IndexSubtableArray> + indexSubtableArrayOffset; + HBUINT32 indexTablesSize; + HBUINT32 numberOfIndexSubtables; + HBUINT32 colorRef; + SBitLineMetrics horizontal; + SBitLineMetrics vertical; + GlyphID startGlyphIndex; + GlyphID endGlyphIndex; + HBUINT8 ppemX; + HBUINT8 ppemY; + HBUINT8 bitDepth; + HBINT8 flags; public: DEFINE_SIZE_STATIC(48); }; @@ -299,19 +313,26 @@ struct GlyphBitmapDataFormat17 { - SmallGlyphMetrics glyphMetrics; - HBUINT32 dataLen; - HBUINT8 dataZ[VAR]; - - DEFINE_SIZE_ARRAY(9, dataZ); + SmallGlyphMetrics glyphMetrics; + LArrayOf<HBUINT8> data; + public: + DEFINE_SIZE_ARRAY(9, data); }; +struct GlyphBitmapDataFormat18 +{ + BigGlyphMetrics glyphMetrics; + LArrayOf<HBUINT8> data; + public: + DEFINE_SIZE_ARRAY(12, data); +}; -/* - * CBLC -- Color Bitmap Location Table - */ - -#define HB_OT_TAG_CBLC HB_TAG('C','B','L','C') +struct GlyphBitmapDataFormat19 +{ + LArrayOf<HBUINT8> data; + public: + DEFINE_SIZE_ARRAY(4, data); +}; struct CBLC { @@ -336,8 +357,8 @@ unsigned int count = sizeTables.len; for (uint32_t i = 0; i < count; ++i) { - unsigned int startGlyphIndex = sizeTables.array[i].startGlyphIndex; - unsigned int endGlyphIndex = sizeTables.array[i].endGlyphIndex; + unsigned int startGlyphIndex = sizeTables.arrayZ[i].startGlyphIndex; + unsigned int endGlyphIndex = sizeTables.arrayZ[i].endGlyphIndex; if (startGlyphIndex <= glyph && glyph <= endGlyphIndex) { *x_ppem = sizeTables[i].ppemX; @@ -352,16 +373,10 @@ protected: FixedVersion<> version; LArrayOf<BitmapSizeTable> sizeTables; - public: DEFINE_SIZE_ARRAY(8, sizeTables); }; -/* - * CBDT -- Color Bitmap Data Table - */ -#define HB_OT_TAG_CBDT HB_TAG('C','B','D','T') - struct CBDT { static const hb_tag_t tableTag = HB_OT_TAG_CBDT; @@ -388,8 +403,8 @@ cbdt = nullptr; return; /* Not a bitmap font. */ } - cblc = Sanitizer<CBLC>::lock_instance (cblc_blob); - cbdt = Sanitizer<CBDT>::lock_instance (cbdt_blob); + cblc = cblc_blob->as<CBLC> (); + cbdt = cbdt_blob->as<CBDT> (); } @@ -447,6 +462,59 @@ return true; } + inline void dump (void (*callback) (const uint8_t* data, unsigned int length, + unsigned int group, unsigned int gid)) const + { + if (!cblc) + return; // Not a color bitmap font. + + for (unsigned int i = 0; i < cblc->sizeTables.len; ++i) + { + const BitmapSizeTable &sizeTable = cblc->sizeTables[i]; + const IndexSubtableArray &subtable_array = cblc+sizeTable.indexSubtableArrayOffset; + for (unsigned int j = 0; j < sizeTable.numberOfIndexSubtables; ++j) + { + const IndexSubtableRecord &subtable_record = subtable_array.indexSubtablesZ[j]; + for (unsigned int gid = subtable_record.firstGlyphIndex; + gid <= subtable_record.lastGlyphIndex; ++gid) + { + unsigned int image_offset = 0, image_length = 0, image_format = 0; + + if (!subtable_record.get_image_data (gid, + &image_offset, &image_length, &image_format)) + continue; + + switch (image_format) + { + case 17: { + const GlyphBitmapDataFormat17& glyphFormat17 = + StructAtOffset<GlyphBitmapDataFormat17> (this->cbdt, image_offset); + callback ((const uint8_t *) &glyphFormat17.data.arrayZ, + glyphFormat17.data.len, i, gid); + } + break; + case 18: { + const GlyphBitmapDataFormat18& glyphFormat18 = + StructAtOffset<GlyphBitmapDataFormat18> (this->cbdt, image_offset); + callback ((const uint8_t *) &glyphFormat18.data.arrayZ, + glyphFormat18.data.len, i, gid); + } + break; + case 19: { + const GlyphBitmapDataFormat19& glyphFormat19 = + StructAtOffset<GlyphBitmapDataFormat19> (this->cbdt, image_offset); + callback ((const uint8_t *) &glyphFormat19.data.arrayZ, + glyphFormat19.data.len, i, gid); + } + break; + default: + continue; + } + } + } + } + } + private: hb_blob_t *cblc_blob; hb_blob_t *cbdt_blob; @@ -459,9 +527,8 @@ protected: - FixedVersion<>version; - HBUINT8 dataZ[VAR]; - + FixedVersion<> version; + HBUINT8 dataZ[VAR]; public: DEFINE_SIZE_ARRAY(4, dataZ); }; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-colr-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-colr-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-colr-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-colr-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -28,12 +28,12 @@ #include "hb-open-type-private.hh" /* - * Color Palette - * http://www.microsoft.com/typography/otspec/colr.htm + * COLR -- Color + * https://docs.microsoft.com/en-us/typography/opentype/spec/colr */ - #define HB_OT_TAG_COLR HB_TAG('C','O','L','R') + namespace OT { @@ -48,8 +48,8 @@ } protected: - GlyphID gID; /* Glyph ID of layer glyph */ - HBUINT16 paletteIndex; /* Index value to use with a selected color palette */ + GlyphID glyphid; /* Glyph ID of layer glyph */ + HBUINT16 colorIdx; /* Index value to use with a selected color palette */ public: DEFINE_SIZE_STATIC (4); }; @@ -61,17 +61,28 @@ inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - return_trace (c->check_struct (this)); + return_trace (likely (c->check_struct (this))); + } + + inline int cmp (hb_codepoint_t g) const { + return g < glyphid ? -1 : g > glyphid ? 1 : 0; } protected: - GlyphID gID; /* Glyph ID of reference glyph */ - HBUINT16 firstLayerIndex; /* Index to the layer record */ - HBUINT16 numLayers; /* Number of color layers associated with this glyph */ + GlyphID glyphid; /* Glyph ID of reference glyph */ + HBUINT16 firstLayerIdx; /* Index to the layer record */ + HBUINT16 numLayers; /* Number of color layers associated with this glyph */ public: DEFINE_SIZE_STATIC (6); }; +static int compare_bgr (const void *pa, const void *pb) +{ + const hb_codepoint_t *a = (const hb_codepoint_t *) pa; + const BaseGlyphRecord *b = (const BaseGlyphRecord *) pb; + return b->cmp (*a); +} + struct COLR { static const hb_tag_t tableTag = HB_OT_TAG_COLR; @@ -79,59 +90,50 @@ inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (!(c->check_struct (this) && - c->check_array ((const void*) &layerRecordsOffsetZ, sizeof (LayerRecord), numLayerRecords) && - c->check_array ((const void*) &baseGlyphRecordsZ, sizeof (BaseGlyphRecord), numBaseGlyphRecords))) - return_trace (false); - - const BaseGlyphRecord* base_glyph_records = &baseGlyphRecordsZ (this); - for (unsigned int i = 0; i < numBaseGlyphRecords; ++i) - if (base_glyph_records[i].firstLayerIndex + - base_glyph_records[i].numLayers > numLayerRecords) - return_trace (false); - - return_trace (true); + return_trace (likely (c->check_struct (this) && + (this+baseGlyphsZ).sanitize (c, numBaseGlyphs) && + (this+layersZ).sanitize (c, numLayers))); } - inline bool get_base_glyph_record ( - hb_codepoint_t glyph_id, unsigned int &first_layer, unsigned int &num_layers) const + inline bool get_base_glyph_record (hb_codepoint_t glyph_id, + unsigned int *first_layer /* OUT */, + unsigned int *num_layers /* OUT */) const { - const BaseGlyphRecord* base_glyph_records = &baseGlyphRecordsZ (this); - unsigned int min = 0, max = numBaseGlyphRecords - 1; - while (min <= max) - { - unsigned int mid = (min + max) / 2; - hb_codepoint_t gID = base_glyph_records[mid].gID; - if (gID > glyph_id) - max = mid - 1; - else if (gID < glyph_id) - min = mid + 1; - else - { - first_layer = base_glyph_records[mid].firstLayerIndex; - num_layers = base_glyph_records[mid].numLayers; - return true; - } - } - return false; + const BaseGlyphRecord* record; + record = (BaseGlyphRecord *) bsearch (&glyph_id, &(this+baseGlyphsZ), numBaseGlyphs, + sizeof (BaseGlyphRecord), compare_bgr); + if (unlikely (!record)) + return false; + + *first_layer = record->firstLayerIdx; + *num_layers = record->numLayers; + return true; } - inline void get_layer_record (int layer, - hb_codepoint_t &glyph_id, unsigned int &palette_index) const + inline bool get_layer_record (unsigned int record, + hb_codepoint_t *glyph_id /* OUT */, + unsigned int *palette_index /* OUT */) const { - const LayerRecord* records = &layerRecordsOffsetZ (this); - glyph_id = records[layer].gID; - palette_index = records[layer].paletteIndex; + if (unlikely (record >= numLayers)) + { + *glyph_id = 0; + *palette_index = 0xFFFF; + return false; + } + const LayerRecord &layer = (this+layersZ)[record]; + *glyph_id = layer.glyphid; + *palette_index = layer.colorIdx; + return true; } protected: - HBUINT16 version; /* Table version number */ - HBUINT16 numBaseGlyphRecords; /* Number of Base Glyph Records */ - LOffsetTo<BaseGlyphRecord> - baseGlyphRecordsZ; /* Offset to Base Glyph records. */ - LOffsetTo<LayerRecord> - layerRecordsOffsetZ; /* Offset to Layer Records */ - HBUINT16 numLayerRecords; /* Number of Layer Records */ + HBUINT16 version; /* Table version number */ + HBUINT16 numBaseGlyphs; /* Number of Base Glyph Records */ + LOffsetTo<UnsizedArrayOf<BaseGlyphRecord> > + baseGlyphsZ; /* Offset to Base Glyph records. */ + LOffsetTo<UnsizedArrayOf<LayerRecord> > + layersZ; /* Offset to Layer Records */ + HBUINT16 numLayers; /* Number of Layer Records */ public: DEFINE_SIZE_STATIC (14); }; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-cpal-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-cpal-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-cpal-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-cpal-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -79,12 +79,12 @@ /* - * Color Palette - * http://www.microsoft.com/typography/otspec/cpal.htm + * CPAL -- Color Palette + * https://docs.microsoft.com/en-us/typography/opentype/spec/cpal */ - #define HB_OT_TAG_CPAL HB_TAG('C','P','A','L') + namespace OT { @@ -92,35 +92,44 @@ { friend struct CPAL; - inline bool sanitize (hb_sanitize_context_t *c, unsigned int palettes) const + inline bool + sanitize (hb_sanitize_context_t *c, const void *base, unsigned int palettes) const { TRACE_SANITIZE (this); - return_trace ( - c->check_struct (this) && - c->check_array ((const void*) &paletteFlags, sizeof (HBUINT32), palettes) && - c->check_array ((const void*) &paletteLabel, sizeof (HBUINT16), palettes) && - c->check_array ((const void*) &paletteEntryLabel, sizeof (HBUINT16), palettes)); + return_trace (c->check_struct (this) && + (base+paletteFlagsZ).sanitize (c, palettes) && + (base+paletteLabelZ).sanitize (c, palettes) && + (base+paletteEntryLabelZ).sanitize (c, palettes)); } private: inline hb_ot_color_palette_flags_t get_palette_flags (const void *base, unsigned int palette) const { - const HBUINT32* flags = &paletteFlags (base); - return (hb_ot_color_palette_flags_t) (uint32_t) flags[palette]; + // range checked at the CPAL caller + return (hb_ot_color_palette_flags_t) (uint32_t) (base+paletteFlagsZ)[palette]; } inline unsigned int get_palette_name_id (const void *base, unsigned int palette) const { - const HBUINT16* name_ids = &paletteLabel (base); - return name_ids[palette]; + // range checked at the CPAL caller + return (base+paletteLabelZ)[palette]; } protected: - LOffsetTo<HBUINT32> paletteFlags; - LOffsetTo<HBUINT16> paletteLabel; - LOffsetTo<HBUINT16> paletteEntryLabel; + LOffsetTo<UnsizedArrayOf<HBUINT32> > + paletteFlagsZ; /* Offset from the beginning of CPAL table to + * the Palette Type Array. Set to 0 if no array + * is provided. */ + LOffsetTo<UnsizedArrayOf<HBUINT16> > + paletteLabelZ; /* Offset from the beginning of CPAL table to + * the Palette Labels Array. Set to 0 if no + * array is provided. */ + LOffsetTo<UnsizedArrayOf<HBUINT16> > + paletteEntryLabelZ; /* Offset from the beginning of CPAL table to + * the Palette Entry Label Array. Set to 0 + * if no array is provided. */ public: DEFINE_SIZE_STATIC (12); }; @@ -134,13 +143,14 @@ inline bool sanitize (hb_sanitize_context_t *c) const { TRACE_SANITIZE (this); - if (!(c->check_struct (this) && // This checks colorRecordIndicesX sanity also, see #get_size - c->check_array ((const void*) &colorRecordsZ, sizeof (BGRAColor), numColorRecords))) + if (unlikely (!(c->check_struct (this) && // it checks colorRecordIndices also + // see #get_size + (this+colorRecordsZ).sanitize (c, numColorRecords)))) return_trace (false); // Check for indices sanity so no need for doing it runtime for (unsigned int i = 0; i < numPalettes; ++i) - if (colorRecordIndicesX[i] + numPaletteEntries > numColorRecords) + if (unlikely (colorRecordIndicesZ[i] + numPaletteEntries > numColorRecords)) return_trace (false); // If version is zero, we are done here; otherwise we need to check tail also @@ -148,7 +158,7 @@ return_trace (true); const CPALV1Tail &v1 = StructAfter<CPALV1Tail> (*this); - return_trace (v1.sanitize (c, numPalettes)); + return_trace (likely (v1.sanitize (c, this, numPalettes))); } inline unsigned int get_size (void) const @@ -158,7 +168,7 @@ inline hb_ot_color_palette_flags_t get_palette_flags (unsigned int palette) const { - if (version == 0 || palette >= numPalettes) + if (unlikely (version == 0 || palette >= numPalettes)) return HB_OT_COLOR_PALETTE_FLAG_DEFAULT; const CPALV1Tail& cpal1 = StructAfter<CPALV1Tail> (*this); @@ -167,7 +177,7 @@ inline unsigned int get_palette_name_id (unsigned int palette) const { - if (version == 0 || palette >= numPalettes) + if (unlikely (version == 0 || palette >= numPalettes)) return 0xFFFF; const CPALV1Tail& cpal1 = StructAfter<CPALV1Tail> (*this); @@ -179,27 +189,33 @@ return numPalettes; } - inline hb_ot_color_t get_color_record_argb (unsigned int color_index, unsigned int palette) const + inline hb_ot_color_t + get_color_record_argb (unsigned int color_index, unsigned int palette) const { - if (color_index >= numPaletteEntries || palette >= numPalettes) + if (unlikely (color_index >= numPaletteEntries || palette >= numPalettes)) return 0; - const BGRAColor* records = &colorRecordsZ(this); // No need for more range check as it is already done on #sanitize - return records[colorRecordIndicesX[palette] + color_index]; + const UnsizedArrayOf<BGRAColor>& color_records = this+colorRecordsZ; + return color_records[colorRecordIndicesZ[palette] + color_index]; } protected: - HBUINT16 version; + HBUINT16 version; /* Table version number */ /* Version 0 */ - HBUINT16 numPaletteEntries; - HBUINT16 numPalettes; - HBUINT16 numColorRecords; - LOffsetTo<HBUINT32> colorRecordsZ; - HBUINT16 colorRecordIndicesX[VAR]; // VAR=numPalettes -/*CPALV1Tail v1[VAR];*/ + HBUINT16 numPaletteEntries; /* Number of palette entries in each palette. */ + HBUINT16 numPalettes; /* Number of palettes in the table. */ + HBUINT16 numColorRecords; /* Total number of color records, combined for + * all palettes. */ + LOffsetTo<UnsizedArrayOf<BGRAColor> > + colorRecordsZ; /* Offset from the beginning of CPAL table to + * the first ColorRecord. */ + UnsizedArrayOf<HBUINT16> + colorRecordIndicesZ; /* Index of each palette’s first color record in + * the combined color record array. */ +/*CPALV1Tail v1;*/ public: - DEFINE_SIZE_ARRAY (12, colorRecordIndicesX); + DEFINE_SIZE_ARRAY (12, colorRecordIndicesZ); }; } /* namespace OT */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-sbix-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-sbix-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-sbix-table.hh 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-sbix-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,153 @@ +/* + * Copyright © 2018 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_OT_COLOR_SBIX_TABLE_HH +#define HB_OT_COLOR_SBIX_TABLE_HH + +#include "hb-open-type-private.hh" + +/* + * sbix -- Standard Bitmap Graphics + * https://docs.microsoft.com/en-us/typography/opentype/spec/sbix + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6sbix.html + */ +#define HB_OT_TAG_sbix HB_TAG('s','b','i','x') + + +namespace OT { + + +struct SBIXGlyph +{ + HBINT16 xOffset; /* The horizontal (x-axis) offset from the left + * edge of the graphic to the glyph’s origin. + * That is, the x-coordinate of the point on the + * baseline at the left edge of the glyph. */ + HBINT16 yOffset; /* The vertical (y-axis) offset from the bottom + * edge of the graphic to the glyph’s origin. + * That is, the y-coordinate of the point on the + * baseline at the left edge of the glyph. */ + Tag graphicType; /* Indicates the format of the embedded graphic + * data: one of 'jpg ', 'png ' or 'tiff', or the + * special format 'dupe'. */ + UnsizedArrayOf<HBUINT8> + data; /* The actual embedded graphic data. The total + * length is inferred from sequential entries in + * the glyphDataOffsets array and the fixed size + * (8 bytes) of the preceding fields. */ + public: + DEFINE_SIZE_ARRAY (8, data); +}; + +struct SBIXStrike +{ + friend struct sbix; + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + imageOffsetsZ.sanitize_shallow (c, c->num_glyphs + 1)); + } + + protected: + HBUINT16 ppem; /* The PPEM size for which this strike was designed. */ + HBUINT16 resolution; /* The device pixel density (in PPI) for which this + * strike was designed. (E.g., 96 PPI, 192 PPI.) */ + UnsizedArrayOf<LOffsetTo<SBIXGlyph> > + imageOffsetsZ; /* Offset from the beginning of the strike data header + * to bitmap data for an individual glyph ID. */ + public: + DEFINE_SIZE_STATIC (8); +}; + +struct sbix +{ + static const hb_tag_t tableTag = HB_OT_TAG_sbix; + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && strikes.sanitize (c, this))); + } + + struct accelerator_t + { + inline void init (hb_face_t *face) + { + num_glyphs = hb_face_get_glyph_count (face); + + OT::Sanitizer<OT::sbix> sanitizer; + sanitizer.set_num_glyphs (num_glyphs); + sbix_blob = sanitizer.sanitize (face->reference_table (HB_OT_TAG_sbix)); + sbix_len = hb_blob_get_length (sbix_blob); + sbix_table = sbix_blob->as<OT::sbix> (); + + } + + inline void fini (void) + { + hb_blob_destroy (sbix_blob); + } + + inline void dump (void (*callback) (const uint8_t* data, unsigned int length, + unsigned int group, unsigned int gid)) const + { + for (unsigned group = 0; group < sbix_table->strikes.len; ++group) + { + const SBIXStrike &strike = sbix_table->strikes[group](sbix_table); + for (unsigned int glyph = 0; glyph < num_glyphs; ++glyph) + if (strike.imageOffsetsZ[glyph + 1] - strike.imageOffsetsZ[glyph] > 0) + { + const SBIXGlyph &sbixGlyph = strike.imageOffsetsZ[glyph]((const void *) &strike); + callback ((const uint8_t*) &sbixGlyph.data, + strike.imageOffsetsZ[glyph + 1] - strike.imageOffsetsZ[glyph] - 8, + group, glyph); + } + } + } + + private: + hb_blob_t *sbix_blob; + const sbix *sbix_table; + + unsigned int sbix_len; + unsigned int num_glyphs; + + }; + + protected: + HBUINT16 version; /* Table version number — set to 1 */ + HBUINT16 flags; /* Bit 0: Set to 1. Bit 1: Draw outlines. + * Bits 2 to 15: reserved (set to 0). */ + LArrayOf<LOffsetTo<SBIXStrike> > + strikes; /* Offsets from the beginning of the 'sbix' + * table to data for each individual bitmap strike. */ + public: + DEFINE_SIZE_ARRAY (8, strikes); +}; + +} /* namespace OT */ + +#endif /* HB_OT_COLOR_SBIX_TABLE_HH */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-svg-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-svg-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-svg-table.hh 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-color-svg-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,145 @@ +/* + * Copyright © 2018 Ebrahim Byagowi + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + */ + +#ifndef HB_OT_COLOR_SVG_TABLE_HH +#define HB_OT_COLOR_SVG_TABLE_HH + +#include "hb-open-type-private.hh" + +/* + * SVG -- SVG (Scalable Vector Graphics) + * https://docs.microsoft.com/en-us/typography/opentype/spec/svg + */ + +#define HB_OT_TAG_SVG HB_TAG('S','V','G',' ') + + +namespace OT { + + +struct SVGDocumentIndexEntry +{ + friend struct SVG; + + inline bool sanitize (hb_sanitize_context_t *c, const void* base) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + (base+svgDoc).sanitize (c, svgDocLength)); + } + + protected: + HBUINT16 startGlyphID; /* The first glyph ID in the range described by + * this index entry. */ + HBUINT16 endGlyphID; /* The last glyph ID in the range described by + * this index entry. Must be >= startGlyphID. */ + LOffsetTo<UnsizedArrayOf<HBUINT8> > + svgDoc; /* Offset from the beginning of the SVG Document Index + * to an SVG document. Must be non-zero. */ + HBUINT32 svgDocLength; /* Length of the SVG document. + * Must be non-zero. */ + public: + DEFINE_SIZE_STATIC (12); +}; + +struct SVGDocumentIndex +{ + friend struct SVG; + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (c->check_struct (this) && + entries.sanitize (c, this)); + } + + protected: + ArrayOf<SVGDocumentIndexEntry> + entries; /* Array of SVG Document Index Entries. */ + public: + DEFINE_SIZE_ARRAY (2, entries); +}; + +struct SVG +{ + static const hb_tag_t tableTag = HB_OT_TAG_SVG; + + inline bool sanitize (hb_sanitize_context_t *c) const + { + TRACE_SANITIZE (this); + return_trace (likely (c->check_struct (this) && + (this+svgDocIndex).sanitize (c))); + } + + struct accelerator_t + { + inline void init (hb_face_t *face) + { + OT::Sanitizer<OT::SVG> sanitizer; + svg_blob = sanitizer.sanitize (face->reference_table (HB_OT_TAG_SVG)); + svg_len = hb_blob_get_length (svg_blob); + svg = svg_blob->as<OT::SVG> (); + + } + + inline void fini (void) + { + hb_blob_destroy (svg_blob); + } + + inline void + dump (void (*callback) (const uint8_t* data, unsigned int length, + unsigned int start_glyph, unsigned int end_glyph)) const + { + const SVGDocumentIndex &index = svg+svg->svgDocIndex; + const ArrayOf<SVGDocumentIndexEntry> &entries = index.entries; + for (unsigned int i = 0; i < entries.len; ++i) + { + const SVGDocumentIndexEntry &entry = entries[i]; + callback ((const uint8_t*) &entry.svgDoc (&index), entry.svgDocLength, + entry.startGlyphID, entry.endGlyphID); + } + } + + private: + hb_blob_t *svg_blob; + const SVG *svg; + + unsigned int svg_len; + }; + + protected: + HBUINT16 version; /* Table version (starting at 0). */ + LOffsetTo<SVGDocumentIndex> + svgDocIndex; /* Offset (relative to the start of the SVG table) to the + * SVG Documents Index. Must be non-zero. */ + HBUINT32 reserved; /* Set to 0. */ + public: + DEFINE_SIZE_STATIC (10); +}; + +} /* namespace OT */ + + +#endif /* HB_OT_COLOR_SVG_TABLE_HH */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-font.cc 2018-07-25 15:36:46.000000000 +0000 @@ -143,7 +143,7 @@ } static hb_bool_t -hb_ot_get_glyph_extents (hb_font_t *font HB_UNUSED, +hb_ot_get_glyph_extents (hb_font_t *font, void *font_data, hb_codepoint_t glyph, hb_glyph_extents_t *extents, @@ -184,7 +184,7 @@ } static hb_bool_t -hb_ot_get_font_h_extents (hb_font_t *font HB_UNUSED, +hb_ot_get_font_h_extents (hb_font_t *font, void *font_data, hb_font_extents_t *metrics, void *user_data HB_UNUSED) @@ -198,7 +198,7 @@ } static hb_bool_t -hb_ot_get_font_v_extents (hb_font_t *font HB_UNUSED, +hb_ot_get_font_v_extents (hb_font_t *font, void *font_data, hb_font_extents_t *metrics, void *user_data HB_UNUSED) @@ -217,7 +217,12 @@ static void free_static_ot_funcs (void) { - hb_font_funcs_destroy (static_ot_funcs); +retry: + hb_font_funcs_t *ot_funcs = (hb_font_funcs_t *) hb_atomic_ptr_get (&static_ot_funcs); + if (!hb_atomic_ptr_cmpexch (&static_ot_funcs, ot_funcs, nullptr)) + goto retry; + + hb_font_funcs_destroy (ot_funcs); } #endif diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-glyf-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-glyf-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-glyf-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-glyf-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -38,8 +38,8 @@ /* * loca -- Index to Location + * https://docs.microsoft.com/en-us/typography/opentype/spec/loca */ - #define HB_OT_TAG_loca HB_TAG('l','o','c','a') @@ -56,15 +56,15 @@ } protected: - HBUINT8 dataX[VAR]; /* Location data. */ - DEFINE_SIZE_ARRAY (0, dataX); + HBUINT8 dataZ[VAR]; /* Location data. */ + DEFINE_SIZE_ARRAY (0, dataZ); }; /* * glyf -- TrueType Glyph Data + * https://docs.microsoft.com/en-us/typography/opentype/spec/glyf */ - #define HB_OT_TAG_glyf HB_TAG('g','l','y','f') @@ -88,9 +88,9 @@ bool success = true; bool use_short_loca = false; if (hb_subset_glyf_and_loca (plan, &use_short_loca, &glyf_prime, &loca_prime)) { - success = success && hb_subset_plan_add_table (plan, HB_OT_TAG_glyf, glyf_prime); - success = success && hb_subset_plan_add_table (plan, HB_OT_TAG_loca, loca_prime); - success = success && _add_head_and_set_loca_version (plan->source, use_short_loca, plan->dest); + success = success && plan->add_table (HB_OT_TAG_glyf, glyf_prime); + success = success && plan->add_table (HB_OT_TAG_loca, loca_prime); + success = success && _add_head_and_set_loca_version (plan, use_short_loca); } else { success = false; } @@ -101,9 +101,9 @@ } static bool - _add_head_and_set_loca_version (hb_face_t *source, bool use_short_loca, hb_face_t *dest) + _add_head_and_set_loca_version (hb_subset_plan_t *plan, bool use_short_loca) { - hb_blob_t *head_blob = OT::Sanitizer<OT::head>().sanitize (hb_face_reference_table (source, HB_OT_TAG_head)); + hb_blob_t *head_blob = OT::Sanitizer<OT::head>().sanitize (hb_face_reference_table (plan->source, HB_OT_TAG_head)); hb_blob_t *head_prime_blob = hb_blob_copy_writable_or_fail (head_blob); hb_blob_destroy (head_blob); @@ -112,7 +112,7 @@ OT::head *head_prime = (OT::head *) hb_blob_get_data_writable (head_prime_blob, nullptr); head_prime->indexToLocFormat.set (use_short_loca ? 0 : 1); - bool success = hb_subset_face_add_table (dest, HB_OT_TAG_head, head_prime_blob); + bool success = plan->add_table (HB_OT_TAG_head, head_prime_blob); hb_blob_destroy (head_prime_blob); return success; @@ -134,18 +134,20 @@ struct CompositeGlyphHeader { - static const uint16_t ARG_1_AND_2_ARE_WORDS = 0x0001; - static const uint16_t ARGS_ARE_XY_VALUES = 0x0002; - static const uint16_t ROUND_XY_TO_GRID = 0x0004; - static const uint16_t WE_HAVE_A_SCALE = 0x0008; - static const uint16_t MORE_COMPONENTS = 0x0020; - static const uint16_t WE_HAVE_AN_X_AND_Y_SCALE = 0x0040; - static const uint16_t WE_HAVE_A_TWO_BY_TWO = 0x0080; - static const uint16_t WE_HAVE_INSTRUCTIONS = 0x0100; - static const uint16_t USE_MY_METRICS = 0x0200; - static const uint16_t OVERLAP_COMPOUND = 0x0400; - static const uint16_t SCALED_COMPONENT_OFFSET = 0x0800; - static const uint16_t UNSCALED_COMPONENT_OFFSET = 0x1000; + enum composite_glyph_flag_t { + ARG_1_AND_2_ARE_WORDS = 0x0001, + ARGS_ARE_XY_VALUES = 0x0002, + ROUND_XY_TO_GRID = 0x0004, + WE_HAVE_A_SCALE = 0x0008, + MORE_COMPONENTS = 0x0020, + WE_HAVE_AN_X_AND_Y_SCALE = 0x0040, + WE_HAVE_A_TWO_BY_TWO = 0x0080, + WE_HAVE_INSTRUCTIONS = 0x0100, + USE_MY_METRICS = 0x0200, + OVERLAP_COMPOUND = 0x0400, + SCALED_COMPONENT_OFFSET = 0x0800, + UNSCALED_COMPONENT_OFFSET = 0x1000 + }; HBUINT16 flags; HBUINT16 glyphIndex; @@ -232,11 +234,13 @@ { inline void init (hb_face_t *face) { + memset (this, 0, sizeof (accelerator_t)); + hb_blob_t *head_blob = Sanitizer<head>().sanitize (face->reference_table (HB_OT_TAG_head)); - const head *head_table = Sanitizer<head>::lock_instance (head_blob); - if ((unsigned int) head_table->indexToLocFormat > 1 || head_table->glyphDataFormat != 0) + const head *head_table = head_blob->as<head> (); + if (head_table == &Null(head) || (unsigned int) head_table->indexToLocFormat > 1 || head_table->glyphDataFormat != 0) { - /* Unknown format. Leave num_glyphs=0, that takes care of disabling us. */ + /* head table is not present, or in an unknown format. Leave num_glyphs=0, that takes care of disabling us. */ hb_blob_destroy (head_blob); return; } @@ -244,9 +248,9 @@ hb_blob_destroy (head_blob); loca_blob = Sanitizer<loca>().sanitize (face->reference_table (HB_OT_TAG_loca)); - loca_table = Sanitizer<loca>::lock_instance (loca_blob); + loca_table = loca_blob->as<loca> (); glyf_blob = Sanitizer<glyf>().sanitize (face->reference_table (HB_OT_TAG_glyf)); - glyf_table = Sanitizer<glyf>::lock_instance (glyf_blob); + glyf_table = glyf_blob->as<glyf> (); num_glyphs = MAX (1u, hb_blob_get_length (loca_blob) / (short_offset ? 2 : 4)) - 1; glyf_len = hb_blob_get_length (glyf_blob); @@ -266,6 +270,9 @@ inline bool get_composite (hb_codepoint_t glyph, CompositeGlyphHeader::Iterator *composite /* OUT */) const { + if (this->glyf_table == &Null(glyf) || !num_glyphs) + return false; + unsigned int start_offset, end_offset; if (!get_offsets (glyph, &start_offset, &end_offset)) return false; /* glyph not found */ @@ -275,16 +282,18 @@ composite); } + enum simple_glyph_flag_t { + FLAG_X_SHORT = 0x02, + FLAG_Y_SHORT = 0x04, + FLAG_REPEAT = 0x08, + FLAG_X_SAME = 0x10, + FLAG_Y_SAME = 0x20 + }; + /* based on FontTools _g_l_y_f.py::trim */ inline bool remove_padding(unsigned int start_offset, unsigned int *end_offset) const { - static const int FLAG_X_SHORT = 0x02; - static const int FLAG_Y_SHORT = 0x04; - static const int FLAG_REPEAT = 0x08; - static const int FLAG_X_SAME = 0x10; - static const int FLAG_Y_SAME = 0x20; - if (*end_offset - start_offset < GlyphHeader::static_size) return true; @@ -368,13 +377,13 @@ if (short_offset) { - const HBUINT16 *offsets = (const HBUINT16 *) loca_table->dataX; + const HBUINT16 *offsets = (const HBUINT16 *) loca_table->dataZ; *start_offset = 2 * offsets[glyph]; *end_offset = 2 * offsets[glyph + 1]; } else { - const HBUINT32 *offsets = (const HBUINT32 *) loca_table->dataX; + const HBUINT32 *offsets = (const HBUINT32 *) loca_table->dataZ; *start_offset = offsets[glyph]; *end_offset = offsets[glyph + 1]; @@ -411,7 +420,7 @@ } while (composite_it.move_to_next()); if ( (uint16_t) last->flags & CompositeGlyphHeader::WE_HAVE_INSTRUCTIONS) - *instruction_start = ((char *) last - (char *) glyf_table->dataX) + last->get_size(); + *instruction_start = ((char *) last - (char *) glyf_table->dataZ) + last->get_size(); else *instruction_start = end_offset; *instruction_end = end_offset; @@ -424,9 +433,23 @@ else { unsigned int instruction_length_offset = start_offset + GlyphHeader::static_size + 2 * num_contours; + if (unlikely (instruction_length_offset + 2 > end_offset)) + { + DEBUG_MSG(SUBSET, nullptr, "Glyph size is too short, missing field instructionLength."); + return false; + } + const HBUINT16 &instruction_length = StructAtOffset<HBUINT16> (glyf_table, instruction_length_offset); - *instruction_start = instruction_length_offset + 2; - *instruction_end = *instruction_start + (uint16_t) instruction_length; + unsigned int start = instruction_length_offset + 2; + unsigned int end = start + (uint16_t) instruction_length; + if (unlikely (end > end_offset)) // Out of bounds of the current glyph + { + DEBUG_MSG(SUBSET, nullptr, "The instructions array overruns the glyph's boundaries."); + return false; + } + + *instruction_start = start; + *instruction_end = end; } return true; } @@ -462,9 +485,9 @@ }; protected: - HBUINT8 dataX[VAR]; /* Glyphs data. */ + HBUINT8 dataZ[VAR]; /* Glyphs data. */ - DEFINE_SIZE_ARRAY (0, dataX); + DEFINE_SIZE_ARRAY (0, dataZ); }; } /* namespace OT */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-head-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-head-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-head-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-head-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -31,16 +31,16 @@ #include "hb-open-type-private.hh" - -namespace OT { - - /* * head -- Font Header + * https://docs.microsoft.com/en-us/typography/opentype/spec/head */ - #define HB_OT_TAG_head HB_TAG('h','e','a','d') + +namespace OT { + + struct head { friend struct OffsetTable; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hhea-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hhea-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hhea-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hhea-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -29,18 +29,19 @@ #include "hb-open-type-private.hh" - -namespace OT { - - /* - * hhea -- The Horizontal Header Table - * vhea -- The Vertical Header Table + * hhea -- Horizontal Header + * https://docs.microsoft.com/en-us/typography/opentype/spec/hhea + * vhea -- Vertical Header + * https://docs.microsoft.com/en-us/typography/opentype/spec/vhea */ - #define HB_OT_TAG_hhea HB_TAG('h','h','e','a') #define HB_OT_TAG_vhea HB_TAG('v','h','e','a') + +namespace OT { + + template <typename T> struct _hea { diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hmtx-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hmtx-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hmtx-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-hmtx-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -31,20 +31,21 @@ #include "hb-ot-hhea-table.hh" #include "hb-ot-os2-table.hh" #include "hb-ot-var-hvar-table.hh" - - -namespace OT { - +#include "hb-subset-plan.hh" /* - * hmtx -- The Horizontal Metrics Table - * vmtx -- The Vertical Metrics Table + * hmtx -- Horizontal Metrics + * https://docs.microsoft.com/en-us/typography/opentype/spec/hmtx + * vmtx -- Vertical Metrics + * https://docs.microsoft.com/en-us/typography/opentype/spec/vmtx */ - #define HB_OT_TAG_hmtx HB_TAG('h','m','t','x') #define HB_OT_TAG_vmtx HB_TAG('v','m','t','x') +namespace OT { + + struct LongMetric { UFWORD advance; /* Advance width/height. */ @@ -80,7 +81,7 @@ H *table = (H *) hb_blob_get_data (dest_blob, &length); table->numberOfLongMetrics.set (num_hmetrics); - bool result = hb_subset_plan_add_table (plan, H::tableTag, dest_blob); + bool result = plan->add_table (H::tableTag, dest_blob); hb_blob_destroy (dest_blob); return result; @@ -93,7 +94,7 @@ /* All the trailing glyphs with the same advance can use one LongMetric * and just keep LSB */ - hb_prealloced_array_t<hb_codepoint_t> &gids = plan->gids_to_retain_sorted; + hb_vector_t<hb_codepoint_t> &gids = plan->glyphs; unsigned int num_advances = gids.len; unsigned int last_advance = _mtx.get_advance (gids[num_advances - 1]); while (num_advances > 1 @@ -118,6 +119,8 @@ LongMetric * old_metrics = (LongMetric *) source_table; FWORD *lsbs = (FWORD *) (old_metrics + _mtx.num_advances); char * dest_pos = (char *) dest; + + bool failed = false; for (unsigned int i = 0; i < gids.len; i++) { /* the last metric or the one for gids[i] */ @@ -138,6 +141,13 @@ } else { + if (gids[i] >= _mtx.num_metrics) + { + DEBUG_MSG(SUBSET, nullptr, "gid %d is >= number of source metrics %d", + gids[i], _mtx.num_metrics); + failed = true; + break; + } FWORD src_lsb = *(lsbs + gids[i] - _mtx.num_advances); if (i < num_advances) { @@ -157,7 +167,7 @@ _mtx.fini (); // Amend header num hmetrics - if (unlikely (!subset_update_header (plan, num_advances))) + if (failed || unlikely (!subset_update_header (plan, num_advances))) { free (dest); return false; @@ -168,7 +178,7 @@ HB_MEMORY_MODE_READONLY, dest, free); - bool success = hb_subset_plan_add_table (plan, T::tableTag, result); + bool success = plan->add_table (T::tableTag, result); hb_blob_destroy (result); return success; } @@ -186,7 +196,7 @@ if (T::os2Tag) { hb_blob_t *os2_blob = Sanitizer<os2> ().sanitize (face->reference_table (T::os2Tag)); - const os2 *os2_table = Sanitizer<os2>::lock_instance (os2_blob); + const os2 *os2_table = os2_blob->as<os2> (); #define USE_TYPO_METRICS (1u<<7) if (0 != (os2_table->fsSelection & USE_TYPO_METRICS)) { @@ -199,7 +209,7 @@ } hb_blob_t *_hea_blob = Sanitizer<H> ().sanitize (face->reference_table (H::tableTag)); - const H *_hea_table = Sanitizer<H>::lock_instance (_hea_blob); + const H *_hea_table = _hea_blob->as<H> (); num_advances = _hea_table->numberOfLongMetrics; if (!got_font_extents) { @@ -228,10 +238,10 @@ hb_blob_destroy (blob); blob = hb_blob_get_empty (); } - table = Sanitizer<hmtxvmtx>::lock_instance (blob); + table = blob->as<hmtxvmtx> (); var_blob = Sanitizer<HVARVVAR> ().sanitize (face->reference_table (T::variationsTag)); - var_table = Sanitizer<HVARVVAR>::lock_instance (var_blob); + var_table = var_blob->as<HVARVVAR> (); } inline void fini (void) diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-kern-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-kern-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-kern-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-kern-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -29,15 +29,17 @@ #include "hb-open-type-private.hh" -namespace OT { - - /* * kern -- Kerning + * https://docs.microsoft.com/en-us/typography/opentype/spec/kern + * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6kern.html */ - #define HB_OT_TAG_kern HB_TAG('k','e','r','n') + +namespace OT { + + struct hb_glyph_pair_t { hb_codepoint_t left; @@ -205,7 +207,7 @@ { TRACE_SANITIZE (this); return_trace (c->check_struct (thiz()) && - thiz()->length >= thiz()->min_size && + thiz()->length >= T::min_size && c->check_array (thiz(), 1, thiz()->length) && thiz()->subtable.sanitize (c, thiz()->format)); } @@ -361,8 +363,8 @@ inline void init (hb_face_t *face) { blob = Sanitizer<kern>().sanitize (face->reference_table (HB_OT_TAG_kern)); - table = Sanitizer<kern>::lock_instance (blob); - table_length = hb_blob_get_length (blob); + table = blob->as<kern> (); + table_length = blob->length; } inline void fini (void) { diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-base-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-base-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-base-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-base-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -36,7 +36,8 @@ #define NOT_INDEXED ((unsigned int) -1) /* - * BASE -- The BASE Table + * BASE -- Baseline + * https://docs.microsoft.com/en-us/typography/opentype/spec/base */ struct BaseCoordFormat1 diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.cc 2018-07-25 15:36:46.000000000 +0000 @@ -30,22 +30,21 @@ #include "hb-open-type-private.hh" #include "hb-ot-layout-private.hh" +#include "hb-ot-map-private.hh" -#include "hb-ot-layout-base-table.hh" #include "hb-ot-layout-gdef-table.hh" #include "hb-ot-layout-gsub-table.hh" #include "hb-ot-layout-gpos-table.hh" -#include "hb-ot-layout-jstf-table.hh" // Just so we compile it; unused otherwise. -#include "hb-ot-name-table.hh" // Just so we compile it; unused otherwise. + +// Just so we compile them; unused otherwise: +#include "hb-ot-layout-base-table.hh" +#include "hb-ot-layout-jstf-table.hh" #include "hb-ot-color-colr-table.hh" #include "hb-ot-color-cpal-table.hh" - -#include "hb-ot-map-private.hh" - - -#ifndef HB_NO_VISIBILITY -const void * const OT::_hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; -#endif +#include "hb-ot-color-sbix-table.hh" +#include "hb-ot-color-svg-table.hh" +#include "hb-ot-name-table.hh" +#include "hb-map-private.hh" hb_ot_layout_t * @@ -56,24 +55,17 @@ return nullptr; layout->gdef_blob = OT::Sanitizer<OT::GDEF>().sanitize (face->reference_table (HB_OT_TAG_GDEF)); - layout->gdef = OT::Sanitizer<OT::GDEF>::lock_instance (layout->gdef_blob); + layout->gdef = layout->gdef_blob->as<OT::GDEF> (); layout->gsub_blob = OT::Sanitizer<OT::GSUB>().sanitize (face->reference_table (HB_OT_TAG_GSUB)); - layout->gsub = OT::Sanitizer<OT::GSUB>::lock_instance (layout->gsub_blob); + layout->gsub = layout->gsub_blob->as<OT::GSUB> (); layout->gpos_blob = OT::Sanitizer<OT::GPOS>().sanitize (face->reference_table (HB_OT_TAG_GPOS)); - layout->gpos = OT::Sanitizer<OT::GPOS>::lock_instance (layout->gpos_blob); + layout->gpos = layout->gpos_blob->as<OT::GPOS> (); - layout->base.init (face); - layout->colr.init (face); - layout->cpal.init (face); layout->math.init (face); layout->fvar.init (face); layout->avar.init (face); - layout->ankr.init (face); - layout->kerx.init (face); - layout->morx.init (face); - layout->trak.init (face); { /* @@ -81,9 +73,9 @@ * See this thread for why we finally had to bend in and do this: * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.html */ - unsigned int gdef_len = hb_blob_get_length (layout->gdef_blob); - unsigned int gsub_len = hb_blob_get_length (layout->gsub_blob); - unsigned int gpos_len = hb_blob_get_length (layout->gpos_blob); + unsigned int gdef_len = layout->gdef_blob->length; + unsigned int gsub_len = layout->gsub_blob->length; + unsigned int gpos_len = layout->gpos_blob->length; if (0 /* sha1sum:c5ee92f0bca4bfb7d06c4d03e8cf9f9cf75d2e8a Windows 7? timesi.ttf */ || (442 == gdef_len && 42038 == gpos_len && 2874 == gsub_len) @@ -106,7 +98,7 @@ * https://lists.freedesktop.org/archives/harfbuzz/2016-February/005489.html */ if (3 == layout->gdef->get_glyph_class (5)) - layout->gdef = &OT::Null(OT::GDEF); + layout->gdef = &Null(OT::GDEF); } else if (0 /* sha1sum:96eda93f7d33e79962451c6c39a6b51ee893ce8c tahoma.ttf from Windows 8 */ @@ -178,7 +170,7 @@ * https://bugzilla.mozilla.org/show_bug.cgi?id=1279693 * https://bugzilla.mozilla.org/show_bug.cgi?id=1279875 */ - layout->gdef = &OT::Null(OT::GDEF); + layout->gdef = &Null(OT::GDEF); } } @@ -220,16 +212,9 @@ hb_blob_destroy (layout->gsub_blob); hb_blob_destroy (layout->gpos_blob); - layout->base.fini (); - layout->colr.fini (); - layout->cpal.fini (); layout->math.fini (); layout->fvar.fini (); layout->avar.fini (); - layout->ankr.fini (); - layout->kerx.fini (); - layout->morx.fini (); - layout->trak.fini (); free (layout); } @@ -237,7 +222,7 @@ // static inline const OT::BASE& // _get_base (hb_face_t *face) // { -// if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::BASE); +// if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::BASE); // hb_ot_layout_t * layout = hb_ot_layout_from_face (face); // return *(layout->base.get ()); // } @@ -245,19 +230,19 @@ static inline const OT::GDEF& _get_gdef (hb_face_t *face) { - if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::GDEF); + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GDEF); return *hb_ot_layout_from_face (face)->gdef; } static inline const OT::GSUB& _get_gsub (hb_face_t *face) { - if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::GSUB); + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GSUB); return *hb_ot_layout_from_face (face)->gsub; } static inline const OT::GPOS& _get_gpos (hb_face_t *face) { - if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::GPOS); + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::GPOS); return *hb_ot_layout_from_face (face)->gpos; } @@ -329,7 +314,7 @@ switch (table_tag) { case HB_OT_TAG_GSUB: return _get_gsub (face); case HB_OT_TAG_GPOS: return _get_gpos (face); - default: return OT::Null(OT::GSUBGPOS); + default: return Null(OT::GSUBGPOS); } } @@ -909,7 +894,7 @@ hb_bool_t hb_ot_layout_has_substitution (hb_face_t *face) { - return &_get_gsub (face) != &OT::Null(OT::GSUB); + return &_get_gsub (face) != &Null(OT::GSUB); } /** @@ -959,11 +944,46 @@ unsigned int lookup_index, hb_set_t *glyphs) { - OT::hb_closure_context_t c (face, glyphs); + hb_auto_t<hb_map_t> done_lookups; + OT::hb_closure_context_t c (face, glyphs, &done_lookups); const OT::SubstLookup& l = _get_gsub (face).get_lookup (lookup_index); - l.closure (&c); + l.closure (&c, lookup_index); +} + +/** + * hb_ot_layout_lookups_substitute_closure: + * + * Compute the transitive closure of glyphs needed for all of the + * provided lookups. + * + * Since: 1.8.1 + **/ +void +hb_ot_layout_lookups_substitute_closure (hb_face_t *face, + const hb_set_t *lookups, + hb_set_t *glyphs) +{ + hb_auto_t<hb_map_t> done_lookups; + OT::hb_closure_context_t c (face, glyphs, &done_lookups); + const OT::GSUB& gsub = _get_gsub (face); + + unsigned int glyphs_length; + do + { + glyphs_length = glyphs->get_population (); + if (lookups != nullptr) + { + for (hb_codepoint_t lookup_index = HB_SET_VALUE_INVALID; hb_set_next (lookups, &lookup_index);) + gsub.get_lookup (lookup_index).closure (&c, lookup_index); + } + else + { + for (unsigned int i = 0; i < gsub.get_lookup_count (); i++) + gsub.get_lookup (i).closure (&c, i); + } + } while (glyphs_length != glyphs->get_population ()); } /* @@ -973,7 +993,7 @@ hb_bool_t hb_ot_layout_has_positioning (hb_face_t *face) { - return &_get_gpos (face) != &OT::Null(OT::GPOS); + return &_get_gpos (face) != &Null(OT::GPOS); } void @@ -1107,7 +1127,7 @@ hb_apply_func_t apply_func; }; - typedef hb_auto_array_t<hb_applicable_t> array_t; + typedef hb_auto_t<hb_vector_t<hb_applicable_t> > array_t; /* Dispatch interface. */ inline const char *get_name (void) { return "GET_SUBTABLES"; } @@ -1115,8 +1135,7 @@ inline return_t dispatch (const T &obj) { hb_applicable_t *entry = array.push(); - if (likely (entry)) - entry->init (&obj, apply_to<T>); + entry->init (&obj, apply_to<T>); return HB_VOID; } static return_t default_return_value (void) { return HB_VOID; } @@ -1137,7 +1156,7 @@ { bool ret = false; hb_buffer_t *buffer = c->buffer; - while (buffer->idx < buffer->len && !buffer->in_error) + while (buffer->idx < buffer->len && buffer->successful) { bool applied = false; if (accel.may_have (buffer->cur().codepoint) && @@ -1309,5 +1328,5 @@ // hb_bool_t // hb_ot_base_has_data (hb_face_t *face) // { -// return &_get_base (face) != &OT::Null(OT::BASE); +// return &_get_base (face) != &Null(OT::BASE); // } diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-common-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-common-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-common-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-common-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -165,7 +165,7 @@ public: DEFINE_SIZE_STATIC (6); }; -DEFINE_NULL_DATA (RangeRecord, "\000\001"); +DEFINE_NULL_DATA (OT, RangeRecord, "\000\001"); struct IndexArray : ArrayOf<Index> @@ -225,7 +225,7 @@ public: DEFINE_SIZE_ARRAY (6, featureIndex); }; -DEFINE_NULL_DATA (LangSys, "\0\0\xFF\xFF"); +DEFINE_NULL_DATA (OT, LangSys, "\0\0\xFF\xFF"); struct Script @@ -270,7 +270,7 @@ typedef RecordListOf<Script> ScriptList; -/* http://www.microsoft.com/typography/otspec/features_pt.htm#size */ +/* https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */ struct FeatureParamsSize { inline bool sanitize (hb_sanitize_context_t *c) const @@ -292,7 +292,7 @@ * * The specification for this feature tag is in the "OpenType Layout Tag * Registry". You can see a copy of this at: - * http://partners.adobe.com/public/developer/opentype/index_tag8.html#size + * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#tag-size * * Here is one set of rules to determine if the 'size' feature is built * correctly, or as by the older versions of MakeOTF. You may be able to do @@ -382,7 +382,7 @@ DEFINE_SIZE_STATIC (10); }; -/* http://www.microsoft.com/typography/otspec/features_pt.htm#ssxx */ +/* https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#ssxx */ struct FeatureParamsStylisticSet { inline bool sanitize (hb_sanitize_context_t *c) const @@ -398,7 +398,7 @@ * added to the end of this Feature Parameters * table in the future. */ - HBUINT16 uiNameID; /* The 'name' table name ID that specifies a + NameID uiNameID; /* The 'name' table name ID that specifies a * string (or strings, for multiple languages) * for a user-interface label for this * feature. The values of uiLabelNameId and @@ -416,7 +416,7 @@ DEFINE_SIZE_STATIC (4); }; -/* http://www.microsoft.com/typography/otspec/features_ae.htm#cv01-cv99 */ +/* https://docs.microsoft.com/en-us/typography/opentype/spec/features_ae#cv01-cv99 */ struct FeatureParamsCharacterVariants { inline bool sanitize (hb_sanitize_context_t *c) const @@ -427,29 +427,29 @@ } HBUINT16 format; /* Format number is set to 0. */ - HBUINT16 featUILableNameID; /* The ‘name’ table name ID that + NameID featUILableNameID; /* The ‘name’ table name ID that * specifies a string (or strings, * for multiple languages) for a * user-interface label for this * feature. (May be nullptr.) */ - HBUINT16 featUITooltipTextNameID;/* The ‘name’ table name ID that + NameID featUITooltipTextNameID;/* The ‘name’ table name ID that * specifies a string (or strings, * for multiple languages) that an * application can use for tooltip * text for this feature. (May be * nullptr.) */ - HBUINT16 sampleTextNameID; /* The ‘name’ table name ID that + NameID sampleTextNameID; /* The ‘name’ table name ID that * specifies sample text that * illustrates the effect of this * feature. (May be nullptr.) */ HBUINT16 numNamedParameters; /* Number of named parameters. (May * be zero.) */ - HBUINT16 firstParamUILabelNameID;/* The first ‘name’ table name ID + NameID firstParamUILabelNameID;/* The first ‘name’ table name ID * used to specify strings for * user-interface labels for the * feature parameters. (Must be zero * if numParameters is zero.) */ - ArrayOf<UINT24> + ArrayOf<HBUINT24> characters; /* Array of the Unicode Scalar Value * of the characters for which this * feature provides glyph variants. @@ -716,7 +716,7 @@ template <typename set_t> inline bool add_coverage (set_t *glyphs) const { - return glyphs->add_sorted_array (glyphArray.array, glyphArray.len); + return glyphs->add_sorted_array (glyphArray.arrayZ, glyphArray.len); } public: @@ -832,7 +832,12 @@ c = &c_; coverage = 0; i = 0; - j = c->rangeRecord.len ? c_.rangeRecord[0].start : 0; + j = c->rangeRecord.len ? c->rangeRecord[0].start : 0; + if (unlikely (c->rangeRecord[0].start > c->rangeRecord[0].end)) + { + /* Broken table. Skip. */ + i = c->rangeRecord.len; + } } inline bool more (void) { return i < c->rangeRecord.len; } inline void next (void) @@ -842,7 +847,14 @@ i++; if (more ()) { + hb_codepoint_t old = j; j = c->rangeRecord[i].start; + if (unlikely (j <= old)) + { + /* Broken table. Skip. Important to avoid DoS. */ + i = c->rangeRecord.len; + return; + } coverage = c->rangeRecord[i].value; } return; @@ -855,7 +867,8 @@ private: const struct CoverageFormat2 *c; - unsigned int i, j, coverage; + unsigned int i, coverage; + hb_codepoint_t j; }; private: @@ -1272,7 +1285,7 @@ if (unlikely (region_index >= regionCount)) return 0.; - const VarRegionAxis *axes = axesZ + (region_index * axisCount); + const VarRegionAxis *axes = axesZ.arrayZ + (region_index * axisCount); float v = 1.; unsigned int count = axisCount; @@ -1280,7 +1293,7 @@ { int coord = i < coord_len ? coords[i] : 0; float factor = axes[i].evaluate (coord); - if (factor == 0.) + if (factor == 0.f) return 0.; v *= factor; } @@ -1291,14 +1304,14 @@ { TRACE_SANITIZE (this); return_trace (c->check_struct (this) && - c->check_array (axesZ, axesZ[0].static_size, - (unsigned int) axisCount * (unsigned int) regionCount)); + axesZ.sanitize (c, (unsigned int) axisCount * (unsigned int) regionCount)); } protected: HBUINT16 axisCount; HBUINT16 regionCount; - VarRegionAxis axesZ[VAR]; + UnsizedArrayOf<VarRegionAxis> + axesZ; public: DEFINE_SIZE_ARRAY (4, axesZ); }; @@ -1330,13 +1343,13 @@ const HBINT16 *scursor = reinterpret_cast<const HBINT16 *> (row); for (; i < scount; i++) { - float scalar = regions.evaluate (regionIndices.array[i], coords, coord_count); + float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count); delta += scalar * *scursor++; } const HBINT8 *bcursor = reinterpret_cast<const HBINT8 *> (scursor); for (; i < count; i++) { - float scalar = regions.evaluate (regionIndices.array[i], coords, coord_count); + float scalar = regions.evaluate (regionIndices.arrayZ[i], coords, coord_count); delta += scalar * *bcursor++; } @@ -1357,7 +1370,7 @@ HBUINT16 itemCount; HBUINT16 shortCount; ArrayOf<HBUINT16> regionIndices; - HBUINT8 bytesX[VAR]; + HBUINT8 bytesX[VAR]; public: DEFINE_SIZE_ARRAY2 (6, regionIndices, bytesX); }; @@ -1465,7 +1478,7 @@ { unsigned int count = conditions.len; for (unsigned int i = 0; i < count; i++) - if (!(this+conditions.array[i]).evaluate (coords, coord_len)) + if (!(this+conditions.arrayZ[i]).evaluate (coords, coord_len)) return false; return true; } @@ -1506,7 +1519,7 @@ unsigned int count = substitutions.len; for (unsigned int i = 0; i < count; i++) { - const FeatureTableSubstitutionRecord &record = substitutions.array[i]; + const FeatureTableSubstitutionRecord &record = substitutions.arrayZ[i]; if (record.featureIndex == feature_index) return &(this+record.feature); } @@ -1559,7 +1572,7 @@ unsigned int count = varRecords.len; for (unsigned int i = 0; i < count; i++) { - const FeatureVariationRecord &record = varRecords.array[i]; + const FeatureVariationRecord &record = varRecords.arrayZ[i]; if ((this+record.conditions).evaluate (coords, coord_len)) { *index = i; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gdef-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gdef-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gdef-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gdef-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -333,7 +333,8 @@ /* - * GDEF -- The Glyph Definition Table + * GDEF -- Glyph Definition + * https://docs.microsoft.com/en-us/typography/opentype/spec/gdef */ struct GDEF diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gpos-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gpos-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gpos-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gpos-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -262,7 +262,7 @@ hb_font_t *font = c->font; unsigned int x_ppem = font->x_ppem; unsigned int y_ppem = font->y_ppem; - hb_position_t cx, cy; + hb_position_t cx = 0, cy = 0; hb_bool_t ret; ret = (x_ppem || y_ppem) && @@ -1074,10 +1074,13 @@ if (!skippy_iter.prev ()) return_trace (false); /* We only want to attach to the first of a MultipleSubst sequence. * https://github.com/harfbuzz/harfbuzz/issues/740 - * Reject others. */ + * Reject others... + * ...but stop if we find a mark in the MultipleSubst sequence: + * https://github.com/harfbuzz/harfbuzz/issues/1020 */ if (!_hb_glyph_info_multiplied (&buffer->info[skippy_iter.idx]) || 0 == _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]) || (skippy_iter.idx == 0 || + _hb_glyph_info_is_mark (&buffer->info[skippy_iter.idx - 1]) || _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]) != _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx - 1]) || _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]) != @@ -1497,7 +1500,8 @@ typedef OffsetListOf<PosLookup> PosLookupList; /* - * GPOS -- The Glyph Positioning Table + * GPOS -- Glyph Positioning + * https://docs.microsoft.com/en-us/typography/opentype/spec/gpos */ struct GPOS : GSUBGPOS diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsubgpos-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsubgpos-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsubgpos-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsubgpos-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -32,6 +32,7 @@ #include "hb-private.hh" #include "hb-debug.hh" #include "hb-buffer-private.hh" +#include "hb-map-private.hh" #include "hb-ot-layout-gdef-table.hh" #include "hb-set-private.hh" @@ -59,6 +60,20 @@ return HB_VOID; } + bool should_visit_lookup (unsigned int lookup_index) + { + if (is_lookup_done (lookup_index)) + return false; + done_lookups->set (lookup_index, glyphs->get_population ()); + return true; + } + + bool is_lookup_done (unsigned int lookup_index) + { + // Have we visited this lookup with the current set of glyphs? + return done_lookups->get (lookup_index) == glyphs->get_population (); + } + hb_face_t *face; hb_set_t *glyphs; recurse_func_t recurse_func; @@ -67,14 +82,19 @@ hb_closure_context_t (hb_face_t *face_, hb_set_t *glyphs_, + hb_map_t *done_lookups_, unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) : face (face_), glyphs (glyphs_), recurse_func (nullptr), nesting_level_left (nesting_level_left_), - debug_depth (0) {} + debug_depth (0), + done_lookups (done_lookups_) {} void set_recurse_func (recurse_func_t func) { recurse_func = func; } + + private: + hb_map_t *done_lookups; }; @@ -855,7 +875,7 @@ for (unsigned int i = 1; i < count; i++) { - while (buffer->idx < match_positions[i] && !buffer->in_error) + while (buffer->idx < match_positions[i] && buffer->successful) { if (!is_mark_ligature) { unsigned int this_comp = _hb_glyph_info_get_lig_comp (&buffer->cur()); @@ -990,7 +1010,7 @@ match_positions[j] += delta; } - for (unsigned int i = 0; i < lookupCount && !buffer->in_error; i++) + for (unsigned int i = 0; i < lookupCount && buffer->successful; i++) { unsigned int idx = lookupRecord[i].sequenceIndex; if (idx >= count) @@ -1713,10 +1733,10 @@ const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input); const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead); chain_context_closure_lookup (c, - backtrack.len, backtrack.array, - input.len, input.array, - lookahead.len, lookahead.array, - lookup.len, lookup.array, + backtrack.len, backtrack.arrayZ, + input.len, input.arrayZ, + lookahead.len, lookahead.arrayZ, + lookup.len, lookup.arrayZ, lookup_context); } @@ -1727,10 +1747,10 @@ const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input); const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead); chain_context_collect_glyphs_lookup (c, - backtrack.len, backtrack.array, - input.len, input.array, - lookahead.len, lookahead.array, - lookup.len, lookup.array, + backtrack.len, backtrack.arrayZ, + input.len, input.arrayZ, + lookahead.len, lookahead.arrayZ, + lookup.len, lookup.arrayZ, lookup_context); } @@ -1741,10 +1761,10 @@ const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input); const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead); return_trace (chain_context_would_apply_lookup (c, - backtrack.len, backtrack.array, - input.len, input.array, - lookahead.len, lookahead.array, lookup.len, - lookup.array, lookup_context)); + backtrack.len, backtrack.arrayZ, + input.len, input.arrayZ, + lookahead.len, lookahead.arrayZ, lookup.len, + lookup.arrayZ, lookup_context)); } inline bool apply (hb_ot_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const @@ -1754,10 +1774,10 @@ const ArrayOf<HBUINT16> &lookahead = StructAfter<ArrayOf<HBUINT16> > (input); const ArrayOf<LookupRecord> &lookup = StructAfter<ArrayOf<LookupRecord> > (lookahead); return_trace (chain_context_apply_lookup (c, - backtrack.len, backtrack.array, - input.len, input.array, - lookahead.len, lookahead.array, lookup.len, - lookup.array, lookup_context)); + backtrack.len, backtrack.arrayZ, + input.len, input.arrayZ, + lookahead.len, lookahead.arrayZ, lookup.len, + lookup.arrayZ, lookup_context)); } inline bool sanitize (hb_sanitize_context_t *c) const @@ -2072,10 +2092,10 @@ {this, this, this} }; chain_context_closure_lookup (c, - backtrack.len, (const HBUINT16 *) backtrack.array, - input.len, (const HBUINT16 *) input.array + 1, - lookahead.len, (const HBUINT16 *) lookahead.array, - lookup.len, lookup.array, + backtrack.len, (const HBUINT16 *) backtrack.arrayZ, + input.len, (const HBUINT16 *) input.arrayZ + 1, + lookahead.len, (const HBUINT16 *) lookahead.arrayZ, + lookup.len, lookup.arrayZ, lookup_context); } @@ -2093,10 +2113,10 @@ {this, this, this} }; chain_context_collect_glyphs_lookup (c, - backtrack.len, (const HBUINT16 *) backtrack.array, - input.len, (const HBUINT16 *) input.array + 1, - lookahead.len, (const HBUINT16 *) lookahead.array, - lookup.len, lookup.array, + backtrack.len, (const HBUINT16 *) backtrack.arrayZ, + input.len, (const HBUINT16 *) input.arrayZ + 1, + lookahead.len, (const HBUINT16 *) lookahead.arrayZ, + lookup.len, lookup.arrayZ, lookup_context); } @@ -2112,10 +2132,10 @@ {this, this, this} }; return_trace (chain_context_would_apply_lookup (c, - backtrack.len, (const HBUINT16 *) backtrack.array, - input.len, (const HBUINT16 *) input.array + 1, - lookahead.len, (const HBUINT16 *) lookahead.array, - lookup.len, lookup.array, lookup_context)); + backtrack.len, (const HBUINT16 *) backtrack.arrayZ, + input.len, (const HBUINT16 *) input.arrayZ + 1, + lookahead.len, (const HBUINT16 *) lookahead.arrayZ, + lookup.len, lookup.arrayZ, lookup_context)); } inline const Coverage &get_coverage (void) const @@ -2139,10 +2159,10 @@ {this, this, this} }; return_trace (chain_context_apply_lookup (c, - backtrack.len, (const HBUINT16 *) backtrack.array, - input.len, (const HBUINT16 *) input.array + 1, - lookahead.len, (const HBUINT16 *) lookahead.array, - lookup.len, lookup.array, lookup_context)); + backtrack.len, (const HBUINT16 *) backtrack.arrayZ, + input.len, (const HBUINT16 *) input.arrayZ + 1, + lookahead.len, (const HBUINT16 *) lookahead.arrayZ, + lookup.len, lookup.arrayZ, lookup_context)); } inline bool sanitize (hb_sanitize_context_t *c) const diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsub-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsub-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsub-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-gsub-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -269,7 +269,7 @@ inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - c->output->add_array (substitute.array, substitute.len); + c->output->add_array (substitute.arrayZ, substitute.len); } inline bool apply (hb_ot_apply_context_t *c) const @@ -281,7 +281,7 @@ * as a "multiplied" substitution. */ if (unlikely (count == 1)) { - c->replace_glyph (substitute.array[0]); + c->replace_glyph (substitute.arrayZ[0]); return_trace (true); } /* Spec disallows this, but Uniscribe allows it. @@ -297,7 +297,7 @@ for (unsigned int i = 0; i < count; i++) { _hb_glyph_info_set_lig_props_for_component (&c->buffer->cur(), i); - c->output_glyph_for_component (substitute.array[i], klass); + c->output_glyph_for_component (substitute.arrayZ[i], klass); } c->buffer->skip_glyph (); @@ -480,7 +480,7 @@ if (unlikely (iter.get_coverage () >= count)) break; /* Work around malicious fonts. https://github.com/harfbuzz/harfbuzz/issues/363 */ const AlternateSet &alt_set = this+alternateSet[iter.get_coverage ()]; - c->output->add_array (alt_set.array, alt_set.len); + c->output->add_array (alt_set.arrayZ, alt_set.len); } } @@ -611,7 +611,7 @@ inline void collect_glyphs (hb_collect_glyphs_context_t *c) const { TRACE_COLLECT_GLYPHS (this); - c->input->add_array (component.array, component.len ? component.len - 1 : 0); + c->input->add_array (component.arrayZ, component.len ? component.len - 1 : 0); c->output->add (ligGlyph); } @@ -979,7 +979,7 @@ const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead); count = substitute.len; - c->output->add_array (substitute.array, substitute.len); + c->output->add_array (substitute.arrayZ, substitute.len); } inline const Coverage &get_coverage (void) const @@ -1007,11 +1007,11 @@ unsigned int start_index = 0, end_index = 0; if (match_backtrack (c, - backtrack.len, (HBUINT16 *) backtrack.array, + backtrack.len, (HBUINT16 *) backtrack.arrayZ, match_coverage, this, &start_index) && match_lookahead (c, - lookahead.len, (HBUINT16 *) lookahead.array, + lookahead.len, (HBUINT16 *) lookahead.arrayZ, match_coverage, this, 1, &end_index)) { @@ -1156,10 +1156,13 @@ return_trace (dispatch (c)); } - inline hb_closure_context_t::return_t closure (hb_closure_context_t *c) const + inline hb_closure_context_t::return_t closure (hb_closure_context_t *c, unsigned int this_index) const { TRACE_CLOSURE (this); - c->set_recurse_func (dispatch_recurse_func<hb_closure_context_t>); + if (!c->should_visit_lookup (this_index)) + return_trace (HB_VOID); + + c->set_recurse_func (dispatch_closure_recurse_func); return_trace (dispatch (c)); } @@ -1258,6 +1261,13 @@ template <typename context_t> static inline typename context_t::return_t dispatch_recurse_func (context_t *c, unsigned int lookup_index); + static inline hb_closure_context_t::return_t dispatch_closure_recurse_func (hb_closure_context_t *c, unsigned int lookup_index) + { + if (!c->should_visit_lookup (lookup_index)) + return HB_VOID; + return dispatch_recurse_func (c, lookup_index); + } + template <typename context_t> inline typename context_t::return_t dispatch (context_t *c) const { return Lookup::dispatch<SubstLookupSubTable> (c); } @@ -1287,7 +1297,8 @@ typedef OffsetListOf<SubstLookup> SubstLookupList; /* - * GSUB -- The Glyph Substitution Table + * GSUB -- Glyph Substitution + * https://docs.microsoft.com/en-us/typography/opentype/spec/gsub */ struct GSUB : GSUBGPOS diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout.h 2018-07-25 15:36:46.000000000 +0000 @@ -277,6 +277,12 @@ hb_set_t *glyphs /*TODO , hb_bool_t inclusive */); +HB_EXTERN void +hb_ot_layout_lookups_substitute_closure (hb_face_t *face, + const hb_set_t *lookups, + hb_set_t *glyphs); + + #ifdef HB_NOT_IMPLEMENTED /* Note: You better have GDEF when using this API, or marks won't do much. */ HB_EXTERN hb_bool_t @@ -307,7 +313,7 @@ #endif /* Optical 'size' feature info. Returns true if found. - * http://www.microsoft.com/typography/otspec/features_pt.htm#size */ + * https://docs.microsoft.com/en-us/typography/opentype/spec/features_pt#size */ HB_EXTERN hb_bool_t hb_ot_layout_get_size_params (hb_face_t *face, unsigned int *design_size, /* OUT. May be NULL */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-jstf-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-jstf-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-jstf-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-jstf-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -189,7 +189,8 @@ /* - * JSTF -- The Justification Table + * JSTF -- Justification + * https://docs.microsoft.com/en-us/typography/opentype/spec/jstf */ struct JSTF diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-layout-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -105,12 +105,12 @@ hb_ot_layout_position_start (hb_font_t *font, hb_buffer_t *buffer); -/* Should be called after all the position_lookup's are done, to finish advances. */ +/* Should be called after all the position_lookup's are done, to fini advances. */ HB_INTERNAL void hb_ot_layout_position_finish_advances (hb_font_t *font, hb_buffer_t *buffer); -/* Should be called after hb_ot_layout_position_finish_advances, to finish offsets. */ +/* Should be called after hb_ot_layout_position_finish_advances, to fini offsets. */ HB_INTERNAL void hb_ot_layout_position_finish_offsets (hb_font_t *font, hb_buffer_t *buffer); @@ -172,16 +172,10 @@ const struct OT::GPOS *gpos; /* TODO Move the following out of this struct. */ - OT::hb_lazy_table_loader_t<struct OT::BASE> base; - OT::hb_lazy_table_loader_t<struct OT::COLR> colr; - OT::hb_lazy_table_loader_t<struct OT::CPAL> cpal; - OT::hb_lazy_table_loader_t<struct OT::MATH> math; - OT::hb_lazy_table_loader_t<struct OT::fvar> fvar; - OT::hb_lazy_table_loader_t<struct OT::avar> avar; - OT::hb_lazy_table_loader_t<struct AAT::ankr> ankr; - OT::hb_lazy_table_loader_t<struct AAT::kerx> kerx; - OT::hb_lazy_table_loader_t<struct AAT::morx> morx; - OT::hb_lazy_table_loader_t<struct AAT::trak> trak; + OT::hb_table_lazy_loader_t<struct OT::BASE> base; + OT::hb_table_lazy_loader_t<struct OT::MATH> math; + OT::hb_table_lazy_loader_t<struct OT::fvar> fvar; + OT::hb_table_lazy_loader_t<struct OT::avar> avar; unsigned int gsub_lookup_count; unsigned int gpos_lookup_count; @@ -309,7 +303,7 @@ * processing on. */ /* Only Mn and Mc can have non-zero ccc: - * http://www.unicode.org/policies/stability_policy.html#Property_Value + * https://unicode.org/policies/stability_policy.html#Property_Value * """ * Canonical_Combining_Class, General_Category * All characters other than those with General_Category property values diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map.cc 2018-07-25 15:36:46.000000000 +0000 @@ -43,6 +43,10 @@ { memset (this, 0, sizeof (*this)); + feature_infos.init (); + for (unsigned int table_index = 0; table_index < 2; table_index++) + stages[table_index].init (); + face = face_; props = *props_; @@ -63,11 +67,17 @@ } } +hb_ot_map_builder_t::~hb_ot_map_builder_t (void) +{ + feature_infos.fini (); + for (unsigned int table_index = 0; table_index < 2; table_index++) + stages[table_index].fini (); +} + void hb_ot_map_builder_t::add_feature (hb_tag_t tag, unsigned int value, hb_ot_map_feature_flags_t flags) { feature_info_t *info = feature_infos.push(); - if (unlikely (!info)) return; if (unlikely (!tag)) return; info->tag = tag; info->seq = feature_infos.len; @@ -108,8 +118,6 @@ if (lookup_indices[i] >= table_lookup_count) continue; hb_ot_map_t::lookup_map_t *lookup = m.lookups[table_index].push (); - if (unlikely (!lookup)) - return; lookup->mask = mask; lookup->index = lookup_indices[i]; lookup->auto_zwnj = auto_zwnj; @@ -124,10 +132,8 @@ void hb_ot_map_builder_t::add_pause (unsigned int table_index, hb_ot_map_t::pause_func_t pause_func) { stage_info_t *s = stages[table_index].push (); - if (likely (s)) { - s->index = current_stage[table_index]; - s->pause_func = pause_func; - } + s->index = current_stage[table_index]; + s->pause_func = pause_func; current_stage[table_index]++; } @@ -164,9 +170,6 @@ &required_feature_tag[table_index]); } - if (!feature_infos.len) - return; - /* Sort features and merge duplicates */ { feature_infos.qsort (); @@ -241,8 +244,6 @@ hb_ot_map_t::feature_map_t *map = m.features.push (); - if (unlikely (!map)) - break; map->tag = info->tag; map->index[0] = feature_index[0]; @@ -324,10 +325,8 @@ if (stage_index < stages[table_index].len && stages[table_index][stage_index].index == stage) { hb_ot_map_t::stage_map_t *stage_map = m.stages[table_index].push (); - if (likely (stage_map)) { - stage_map->last_lookup = last_num_lookups; - stage_map->pause_func = stages[table_index][stage_index].pause_func; - } + stage_map->last_lookup = last_num_lookups; + stage_map->pause_func = stages[table_index][stage_index].pause_func; stage_index++; } diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-map-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -78,8 +78,26 @@ pause_func_t pause_func; }; + inline void init (void) + { + memset (this, 0, sizeof (*this)); - hb_ot_map_t (void) { memset (this, 0, sizeof (*this)); } + features.init (); + for (unsigned int table_index = 0; table_index < 2; table_index++) + { + lookups[table_index].init (); + stages[table_index].init (); + } + } + inline void fini (void) + { + features.fini (); + for (unsigned int table_index = 0; table_index < 2; table_index++) + { + lookups[table_index].fini (); + stages[table_index].fini (); + } + } inline hb_mask_t get_global_mask (void) const { return global_mask; } @@ -130,15 +148,6 @@ HB_INTERNAL void substitute (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; HB_INTERNAL void position (const struct hb_ot_shape_plan_t *plan, hb_font_t *font, hb_buffer_t *buffer) const; - inline void finish (void) { - features.finish (); - for (unsigned int table_index = 0; table_index < 2; table_index++) - { - lookups[table_index].finish (); - stages[table_index].finish (); - } - } - public: hb_tag_t chosen_script[2]; bool found_script[2]; @@ -147,9 +156,9 @@ hb_mask_t global_mask; - hb_prealloced_array_t<feature_map_t, 8> features; - hb_prealloced_array_t<lookup_map_t, 32> lookups[2]; /* GSUB/GPOS */ - hb_prealloced_array_t<stage_map_t, 4> stages[2]; /* GSUB/GPOS */ + hb_vector_t<feature_map_t, 8> features; + hb_vector_t<lookup_map_t, 32> lookups[2]; /* GSUB/GPOS */ + hb_vector_t<stage_map_t, 4> stages[2]; /* GSUB/GPOS */ }; enum hb_ot_map_feature_flags_t { @@ -172,6 +181,8 @@ HB_INTERNAL hb_ot_map_builder_t (hb_face_t *face_, const hb_segment_properties_t *props_); + HB_INTERNAL ~hb_ot_map_builder_t (void); + HB_INTERNAL void add_feature (hb_tag_t tag, unsigned int value, hb_ot_map_feature_flags_t flags); @@ -187,14 +198,6 @@ const int *coords, unsigned int num_coords); - inline void finish (void) { - feature_infos.finish (); - for (unsigned int table_index = 0; table_index < 2; table_index++) - { - stages[table_index].finish (); - } - } - private: HB_INTERNAL void add_lookups (hb_ot_map_t &m, @@ -241,8 +244,8 @@ private: unsigned int current_stage[2]; /* GSUB/GPOS */ - hb_prealloced_array_t<feature_info_t, 32> feature_infos; - hb_prealloced_array_t<stage_info_t, 8> stages[2]; /* GSUB/GPOS */ + hb_vector_t<feature_info_t, 32> feature_infos; + hb_vector_t<stage_info_t, 8> stages[2]; /* GSUB/GPOS */ }; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-maxp-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-maxp-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-maxp-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-maxp-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,8 @@ /* - * maxp -- The Maximum Profile Table + * maxp -- Maximum Profile + * https://docs.microsoft.com/en-us/typography/opentype/spec/maxp */ #define HB_OT_TAG_maxp HB_TAG('m','a','x','p') @@ -108,11 +109,11 @@ } OT::maxp *maxp_prime = (OT::maxp *) hb_blob_get_data (maxp_prime_blob, nullptr); - maxp_prime->set_num_glyphs (plan->gids_to_retain_sorted.len); + maxp_prime->set_num_glyphs (plan->glyphs.len); if (plan->drop_hints) drop_hint_fields (plan, maxp_prime); - bool result = hb_subset_plan_add_table(plan, HB_OT_TAG_maxp, maxp_prime_blob); + bool result = plan->add_table (HB_OT_TAG_maxp, maxp_prime_blob); hb_blob_destroy (maxp_prime_blob); return result; } diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-name-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-name-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-name-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-name-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,9 @@ /* - * name -- The Naming Table + * name -- Naming + * https://docs.microsoft.com/en-us/typography/opentype/spec/name */ - #define HB_OT_TAG_name HB_TAG('n','a','m','e') diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-os2-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-os2-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-os2-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-os2-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -29,14 +29,14 @@ #include "hb-open-type-private.hh" #include "hb-ot-os2-unicode-ranges.hh" +#include "hb-subset-plan.hh" namespace OT { /* * OS/2 and Windows Metrics - * http://www.microsoft.com/typography/otspec/os2.htm + * https://docs.microsoft.com/en-us/typography/opentype/spec/os2 */ - #define HB_OT_TAG_os2 HB_TAG('O','S','/','2') struct os2 @@ -63,26 +63,25 @@ } uint16_t min_cp, max_cp; - find_min_and_max_codepoint (plan->codepoints, &min_cp, &max_cp); + find_min_and_max_codepoint (plan->unicodes, &min_cp, &max_cp); os2_prime->usFirstCharIndex.set (min_cp); os2_prime->usLastCharIndex.set (max_cp); - _update_unicode_ranges (plan->codepoints, os2_prime->ulUnicodeRange); - bool result = hb_subset_plan_add_table(plan, HB_OT_TAG_os2, os2_prime_blob); + _update_unicode_ranges (plan->unicodes, os2_prime->ulUnicodeRange); + bool result = plan->add_table (HB_OT_TAG_os2, os2_prime_blob); hb_blob_destroy (os2_prime_blob); return result; } - inline void _update_unicode_ranges (const hb_prealloced_array_t<hb_codepoint_t> &codepoints, + inline void _update_unicode_ranges (const hb_set_t *codepoints, HBUINT32 ulUnicodeRange[4]) const { for (unsigned int i = 0; i < 4; i++) ulUnicodeRange[i].set (0); - for (unsigned int i = 0; i < codepoints.len; i++) - { - hb_codepoint_t cp = codepoints[i]; + hb_codepoint_t cp = HB_SET_VALUE_INVALID; + while (codepoints->next (&cp)) { unsigned int bit = hb_get_unicode_range_bit (cp); if (bit < 128) { @@ -101,28 +100,30 @@ } } - static inline void find_min_and_max_codepoint (const hb_prealloced_array_t<hb_codepoint_t> &codepoints, + static inline void find_min_and_max_codepoint (const hb_set_t *codepoints, uint16_t *min_cp, /* OUT */ uint16_t *max_cp /* OUT */) { - hb_codepoint_t min = -1, max = 0; - - for (unsigned int i = 0; i < codepoints.len; i++) - { - hb_codepoint_t cp = codepoints[i]; - if (cp < min) - min = cp; - if (cp > max) - max = cp; - } + *min_cp = codepoints->get_min (); + *max_cp = codepoints->get_max (); + } - if (min > 0xFFFF) - min = 0xFFFF; - if (max > 0xFFFF) - max = 0xFFFF; + enum font_page_t { + HEBREW_FONT_PAGE = 0xB100, // Hebrew Windows 3.1 font page + SIMP_ARABIC_FONT_PAGE = 0xB200, // Simplified Arabic Windows 3.1 font page + TRAD_ARABIC_FONT_PAGE = 0xB300, // Traditional Arabic Windows 3.1 font page + OEM_ARABIC_FONT_PAGE = 0xB400, // OEM Arabic Windows 3.1 font page + SIMP_FARSI_FONT_PAGE = 0xBA00, // Simplified Farsi Windows 3.1 font page + TRAD_FARSI_FONT_PAGE = 0xBB00, // Traditional Farsi Windows 3.1 font page + THAI_FONT_PAGE = 0xDE00 // Thai Windows 3.1 font page + }; - *min_cp = min; - *max_cp = max; + // https://github.com/Microsoft/Font-Validator/blob/520aaae/OTFontFileVal/val_OS2.cs#L644-L681 + inline font_page_t get_font_page () const + { + if (version != 0) + return (font_page_t) 0; + return (font_page_t) (fsSelection & 0xFF00); } public: diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-os2-unicode-ranges.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-os2-unicode-ranges.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-os2-unicode-ranges.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-os2-unicode-ranges.hh 2018-07-25 15:36:46.000000000 +0000 @@ -237,7 +237,7 @@ sizeof (os2UnicodeRangesSorted) / sizeof(Range), sizeof(Range), _compare_range, nullptr); - if (range != NULL) + if (range != nullptr) return range->bit; return -1; } diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-post-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-post-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-post-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-post-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,7 @@ #include "hb-open-type-private.hh" #include "hb-dsalgs.hh" +#include "hb-subset-plan.hh" #define HB_STRING_ARRAY_NAME format1_names #define HB_STRING_ARRAY_LIST "hb-ot-post-macroman.hh" @@ -38,16 +39,16 @@ #define NUM_FORMAT1_NAMES 258 -namespace OT { - - /* * post -- PostScript + * https://docs.microsoft.com/en-us/typography/opentype/spec/post */ - #define HB_OT_TAG_post HB_TAG('p','o','s','t') +namespace OT { + + struct postV2Tail { inline bool sanitize (hb_sanitize_context_t *c) const @@ -82,16 +83,39 @@ return_trace (true); } + inline bool subset (hb_subset_plan_t *plan) const + { + unsigned int post_prime_length; + hb_blob_t *post_blob = OT::Sanitizer<post>().sanitize (hb_face_reference_table (plan->source, HB_OT_TAG_post)); + hb_blob_t *post_prime_blob = hb_blob_create_sub_blob (post_blob, 0, post::static_size); + post *post_prime = (post *) hb_blob_get_data_writable (post_prime_blob, &post_prime_length); + hb_blob_destroy (post_blob); + + if (unlikely (!post_prime || post_prime_length != post::static_size)) + { + hb_blob_destroy (post_prime_blob); + DEBUG_MSG(SUBSET, nullptr, "Invalid source post table with length %d.", post_prime_length); + return false; + } + + post_prime->version.major.set (3); // Version 3 does not have any glyph names. + bool result = plan->add_table (HB_OT_TAG_post, post_prime_blob); + hb_blob_destroy (post_prime_blob); + + return result; + } + struct accelerator_t { inline void init (hb_face_t *face) { + index_to_offset.init (); + blob = Sanitizer<post>().sanitize (face->reference_table (HB_OT_TAG_post)); - const post *table = Sanitizer<post>::lock_instance (blob); - unsigned int table_length = hb_blob_get_length (blob); + const post *table = blob->as<post> (); + unsigned int table_length = blob->length; version = table->version.to_int (); - index_to_offset.init (); if (version != 0x00020000) return; @@ -102,23 +126,18 @@ const uint8_t *end = (uint8_t *) table + table_length; for (const uint8_t *data = pool; data < end && data + *data <= end; data += 1 + *data) - { - uint32_t *offset = index_to_offset.push (); - if (unlikely (!offset)) - break; - *offset = data - pool; - } + index_to_offset.push (data - pool); } inline void fini (void) { - index_to_offset.finish (); + index_to_offset.fini (); free (gids_sorted_by_name); } inline bool get_glyph_name (hb_codepoint_t glyph, char *buf, unsigned int buf_len) const { - hb_string_t s = find_glyph_name (glyph); + hb_bytes_t s = find_glyph_name (glyph); if (!s.len) return false; if (!buf_len) @@ -162,7 +181,7 @@ } } - hb_string_t st (name, len); + hb_bytes_t st (name, len); const uint16_t *gid = (const uint16_t *) hb_bsearch_r (&st, gids, count, sizeof (gids[0]), cmp_key, (void *) this); if (gid) { @@ -197,45 +216,45 @@ static inline int cmp_key (const void *pk, const void *po, void *arg) { const accelerator_t *thiz = (const accelerator_t *) arg; - const hb_string_t *key = (const hb_string_t *) pk; + const hb_bytes_t *key = (const hb_bytes_t *) pk; uint16_t o = * (const uint16_t *) po; return thiz->find_glyph_name (o).cmp (*key); } - inline hb_string_t find_glyph_name (hb_codepoint_t glyph) const + inline hb_bytes_t find_glyph_name (hb_codepoint_t glyph) const { if (version == 0x00010000) { if (glyph >= NUM_FORMAT1_NAMES) - return hb_string_t (); + return hb_bytes_t (); return format1_names (glyph); } if (version != 0x00020000 || glyph >= glyphNameIndex->len) - return hb_string_t (); + return hb_bytes_t (); - unsigned int index = glyphNameIndex->array[glyph]; + unsigned int index = glyphNameIndex->arrayZ[glyph]; if (index < NUM_FORMAT1_NAMES) return format1_names (index); index -= NUM_FORMAT1_NAMES; if (index >= index_to_offset.len) - return hb_string_t (); - unsigned int offset = index_to_offset.array[index]; + return hb_bytes_t (); + unsigned int offset = index_to_offset.arrayZ[index]; const uint8_t *data = pool + offset; unsigned int name_length = *data; data++; - return hb_string_t ((const char *) data, name_length); + return hb_bytes_t ((const char *) data, name_length); } private: hb_blob_t *blob; uint32_t version; const ArrayOf<HBUINT16> *glyphNameIndex; - hb_prealloced_array_t<uint32_t, 1> index_to_offset; + hb_vector_t<uint32_t, 1> index_to_offset; const uint8_t *pool; mutable uint16_t *gids_sorted_by_name; }; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape.cc 2018-07-25 15:36:46.000000000 +0000 @@ -180,6 +180,8 @@ if (unlikely (!plan)) return nullptr; + plan->init (); + hb_ot_shape_planner_t planner (shape_plan); planner.shaper = hb_ot_shape_complex_categorize (&planner); @@ -204,7 +206,7 @@ if (plan->shaper->data_destroy) plan->shaper->data_destroy (const_cast<void *> (plan->data)); - plan->finish (); + plan->fini (); free (plan); } @@ -268,7 +270,7 @@ info.cluster = buffer->cur().cluster; info.mask = buffer->cur().mask; buffer->output_info (info); - while (buffer->idx < buffer->len && !buffer->in_error) + while (buffer->idx < buffer->len && buffer->successful) buffer->next_glyph (); buffer->swap_buffers (); @@ -306,13 +308,16 @@ hb_ensure_native_direction (hb_buffer_t *buffer) { hb_direction_t direction = buffer->props.direction; + hb_direction_t horiz_dir = hb_script_get_horizontal_direction (buffer->props.script); /* TODO vertical: * The only BTT vertical script is Ogham, but it's not clear to me whether OpenType * Ogham fonts are supposed to be implemented BTT or not. Need to research that * first. */ - if ((HB_DIRECTION_IS_HORIZONTAL (direction) && direction != hb_script_get_horizontal_direction (buffer->props.script)) || - (HB_DIRECTION_IS_VERTICAL (direction) && direction != HB_DIRECTION_TTB)) + if ((HB_DIRECTION_IS_HORIZONTAL (direction) && + direction != horiz_dir && horiz_dir != HB_DIRECTION_INVALID) || + (HB_DIRECTION_IS_VERTICAL (direction) && + direction != HB_DIRECTION_TTB)) { /* Same loop as hb_form_clusters(). * Since form_clusters() merged clusters already, we don't merge. */ @@ -939,8 +944,6 @@ unsigned int num_features, hb_set_t *glyphs) { - hb_ot_shape_plan_t plan; - const char *shapers[] = {"ot", nullptr}; hb_shape_plan_t *shape_plan = hb_shape_plan_create_cached (font->face, &buffer->props, features, num_features, shapers); @@ -954,15 +957,7 @@ hb_set_t *lookups = hb_set_create (); hb_ot_shape_plan_collect_lookups (shape_plan, HB_OT_TAG_GSUB, lookups); - - /* And find transitive closure. */ - hb_set_t *copy = hb_set_create (); - do { - copy->set (glyphs); - for (hb_codepoint_t lookup_index = HB_SET_VALUE_INVALID; hb_set_next (lookups, &lookup_index);) - hb_ot_layout_lookup_substitute_closure (font->face, lookup_index, glyphs); - } while (!copy->is_equal (glyphs)); - hb_set_destroy (copy); + hb_ot_layout_lookups_substitute_closure (font->face, lookups, glyphs); hb_set_destroy (lookups); diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic.cc 2018-07-25 15:36:46.000000000 +0000 @@ -421,7 +421,7 @@ /* * Stretch feature: "stch". * See example here: - * https://www.microsoft.com/typography/OpenTypeDev/syriac/intro.htm + * https://docs.microsoft.com/en-us/typography/script-development/syriac * We implement this in a generic way, such that the Arabic subtending * marks can use it as well. */ @@ -611,7 +611,7 @@ HB_BUFFER_DEALLOCATE_VAR (buffer, arabic_shaping_action); } -/* http://www.unicode.org/reports/tr53/tr53-1.pdf */ +/* https://unicode.org/reports/tr53/tr53-1.pdf */ static hb_codepoint_t modifier_combining_marks[] = diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-arabic-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -6,10 +6,10 @@ * * on files with these headers: * - * # ArabicShaping-10.0.0.txt - * # Date: 2017-02-16, 00:00:00 GMT [RP, KW] - * # Blocks-10.0.0.txt - * # Date: 2017-04-12, 17:30:00 GMT [KW] + * # ArabicShaping-11.0.0.txt + * # Date: 2018-02-21, 14:50:00 GMT [KW, RP] + * # Blocks-11.0.0.txt + * # Date: 2017-10-16, 24:39:00 GMT [KW] * UnicodeData.txt does not have a header. */ @@ -45,7 +45,7 @@ /* Syriac */ - /* 0700 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,A,X,D,D,D,DR,DR,R,R,R,D,D,D,D,R,D, + /* 0700 */ X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,T,A,X,D,D,D,DR,DR,R,R,R,D,D,D,D,R,D, /* 0720 */ D,D,D,D,D,D,D,D,R,D,DR,D,R,D,D,DR,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X, /* 0740 */ X,X,X,X,X,X,X,X,X,X,X,X,X,R,D,D, @@ -91,7 +91,7 @@ /* 1800 */ U,D,X,X,C,X,X,X,U,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X, /* 1820 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D, /* 1840 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D, - /* 1860 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,X,X,X,X,X,X,X,X, + /* 1860 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,X,X,X,X,X,X,X, /* 1880 */ U,U,U,U,U,T,T,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D, /* 18A0 */ D,D,D,D,D,D,D,D,D,X,D, @@ -125,7 +125,28 @@ /* 10B80 */ D,R,D,R,R,R,D,D,D,R,D,D,R,D,R,R,D,R,X,X,X,X,X,X,X,X,X,X,X,X,X,X, /* 10BA0 */ X,X,X,X,X,X,X,X,X,R,R,R,R,D,D,U, -#define joining_offset_0x1e900u 1146 +#define joining_offset_0x10d00u 1146 + + /* Hanifi Rohingya */ + + /* 10D00 */ L,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D, + /* 10D20 */ D,D,R,D, + +#define joining_offset_0x10f30u 1182 + + /* Sogdian */ + + /* 10F20 */ D,D,D,R,D,D,D,D,D,D,D,D,D,D,D,D, + /* 10F40 */ D,D,D,D,D,U,X,X,X,X,X,X,X,X,X,X,X,D,D,D,R, + +#define joining_offset_0x110bdu 1219 + + /* Kaithi */ + + /* 110A0 */ U,X,X, + /* 110C0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,U, + +#define joining_offset_0x1e900u 1236 /* Adlam */ @@ -133,7 +154,7 @@ /* 1E920 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D, /* 1E940 */ D,D,D,D, -}; /* Table items: 1214; occupancy: 55% */ +}; /* Table items: 1304; occupancy: 56% */ static unsigned int @@ -160,6 +181,12 @@ case 0x10u: if (hb_in_range<hb_codepoint_t> (u, 0x10AC0u, 0x10AEFu)) return joining_table[u - 0x10AC0u + joining_offset_0x10ac0u]; if (hb_in_range<hb_codepoint_t> (u, 0x10B80u, 0x10BAFu)) return joining_table[u - 0x10B80u + joining_offset_0x10b80u]; + if (hb_in_range<hb_codepoint_t> (u, 0x10D00u, 0x10D23u)) return joining_table[u - 0x10D00u + joining_offset_0x10d00u]; + if (hb_in_range<hb_codepoint_t> (u, 0x10F30u, 0x10F54u)) return joining_table[u - 0x10F30u + joining_offset_0x10f30u]; + break; + + case 0x11u: + if (hb_in_range<hb_codepoint_t> (u, 0x110BDu, 0x110CDu)) return joining_table[u - 0x110BDu + joining_offset_0x110bdu]; break; case 0x1Eu: diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hangul.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hangul.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hangul.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-hangul.cc 2018-07-25 15:36:46.000000000 +0000 @@ -151,8 +151,8 @@ * - <V>: U+1160..11A7, U+D7B0..D7C7 * - <T>: U+11A8..11FF, U+D7CB..D7FB * - * - Only the <L,V> sequences for the 11xx ranges combine. - * - Only <LV,T> sequences for T in U+11A8..11C3 combine. + * - Only the <L,V> sequences for some of the U+11xx ranges combine. + * - Only <LV,T> sequences for some of the Ts in U+11xx range combine. * * Here is what we want to accomplish in this shaper: * @@ -188,7 +188,7 @@ */ unsigned int count = buffer->len; - for (buffer->idx = 0; buffer->idx < count && !buffer->in_error;) + for (buffer->idx = 0; buffer->idx < count && buffer->successful;) { hb_codepoint_t u = buffer->cur().codepoint; @@ -269,7 +269,7 @@ if (font->has_glyph (s)) { buffer->replace_glyphs (t ? 3 : 2, 1, &s); - if (unlikely (buffer->in_error)) + if (unlikely (!buffer->successful)) return; end = start + 1; continue; @@ -319,7 +319,7 @@ if (font->has_glyph (new_s)) { buffer->replace_glyphs (2, 1, &new_s); - if (unlikely (buffer->in_error)) + if (unlikely (!buffer->successful)) return; end = start + 1; continue; @@ -345,7 +345,7 @@ { unsigned int s_len = tindex ? 3 : 2; buffer->replace_glyphs (1, s_len, decomposed); - if (unlikely (buffer->in_error)) + if (unlikely (!buffer->successful)) return; /* We decomposed S: apply jamo features to the individual glyphs diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic.cc 2018-07-25 15:36:46.000000000 +0000 @@ -86,7 +86,7 @@ {HB_SCRIPT_KANNADA, true, 0x0CCDu,BASE_POS_LAST, REPH_POS_AFTER_POST, REPH_MODE_IMPLICIT, BLWF_MODE_POST_ONLY}, {HB_SCRIPT_MALAYALAM, true, 0x0D4Du,BASE_POS_LAST, REPH_POS_AFTER_MAIN, REPH_MODE_LOG_REPHA,BLWF_MODE_PRE_AND_POST}, {HB_SCRIPT_SINHALA, false,0x0DCAu,BASE_POS_LAST_SINHALA, - REPH_POS_AFTER_MAIN, REPH_MODE_EXPLICIT, BLWF_MODE_PRE_AND_POST}, + REPH_POS_AFTER_POST, REPH_MODE_EXPLICIT, BLWF_MODE_PRE_AND_POST}, }; @@ -435,7 +435,7 @@ /* Rules from: - * https://www.microsoft.com/typography/otfntdev/devanot/shaping.aspx */ + * https://docs.microsqoft.com/en-us/typography/script-development/devanagari */ static void initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, @@ -668,8 +668,9 @@ * * Reports suggest that in some scripts Uniscribe does this only if there * is *not* a Halant after last consonant already (eg. Kannada), while it - * does it unconditionally in other scripts (eg. Malayalam). We don't - * currently know about other scripts, so we single out Malayalam for now. + * does it unconditionally in other scripts (eg. Malayalam, Bengali). We + * don't currently know about other scripts, so we whitelist Malayalam and + * Bengali for now. * * Kannada test case: * U+0C9A,U+0CCD,U+0C9A,U+0CCD @@ -679,10 +680,16 @@ * Malayalam test case: * U+0D38,U+0D4D,U+0D31,U+0D4D,U+0D31,U+0D4D * With lohit-ttf-20121122/Lohit-Malayalam.ttf + * + * Bengali test case + * U+0998,U+09CD,U+09AF,U+09CD + * With Windows XP vrinda.ttf + * https://github.com/harfbuzz/harfbuzz/issues/1073 */ if (indic_plan->is_old_spec) { - bool disallow_double_halants = buffer->props.script != HB_SCRIPT_MALAYALAM; + bool disallow_double_halants = buffer->props.script != HB_SCRIPT_MALAYALAM && + buffer->props.script != HB_SCRIPT_BENGALI; for (unsigned int i = base + 1; i < end; i++) if (info[i].indic_category() == OT_H) { @@ -974,7 +981,7 @@ buffer->idx = 0; unsigned int last_syllable = 0; - while (buffer->idx < buffer->len && !buffer->in_error) + while (buffer->idx < buffer->len && buffer->successful) { unsigned int syllable = buffer->cur().syllable(); syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F); @@ -989,7 +996,7 @@ /* TODO Set glyph_props? */ /* Insert dottedcircle after possible Repha. */ - while (buffer->idx < buffer->len && !buffer->in_error && + while (buffer->idx < buffer->len && buffer->successful && last_syllable == buffer->cur().syllable() && buffer->cur().indic_category() == OT_Repha) buffer->next_glyph (); @@ -1470,6 +1477,9 @@ { /* Don't decompose these. */ case 0x0931u : return false; /* DEVANAGARI LETTER RRA */ + // https://github.com/harfbuzz/harfbuzz/issues/779 + case 0x09DCu : return false; /* BENGALI LETTER RRA */ + case 0x09DDu : return false; /* BENGALI LETTER RHA */ case 0x0B94u : return false; /* TAMIL LETTER AU */ @@ -1512,7 +1522,7 @@ * The Uniscribe behavior is now documented in the newly published Sinhala * spec in 2012: * - * http://www.microsoft.com/typography/OpenTypeDev/sinhala/intro.htm#shaping + * https://docs.microsoft.com/en-us/typography/script-development/sinhala#shaping */ const indic_shape_plan_t *indic_plan = (const indic_shape_plan_t *) c->plan->data; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-machine.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-machine.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-machine.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-machine.hh 2018-07-25 15:36:46.000000000 +0000 @@ -1129,7 +1129,7 @@ static void find_syllables (hb_buffer_t *buffer) { - unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED; + unsigned int p, pe, eof, ts HB_UNUSED, te, act; int cs; hb_glyph_info_t *info = buffer->info; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -42,7 +42,7 @@ #define INDIC_TABLE_ELEMENT_TYPE uint16_t /* Cateories used in the OpenType spec: - * https://www.microsoft.com/typography/otfntdev/devanot/shaping.aspx + * https://docs.microsoft.com/en-us/typography/script-development/devanagari */ /* Note: This enum is duplicated in the -machine.rl source file. * Not sure how to avoid duplication. */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-table.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-table.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-table.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-indic-table.cc 2018-07-25 15:36:46.000000000 +0000 @@ -6,62 +6,63 @@ * * on files with these headers: * - * # IndicSyllabicCategory-10.0.0.txt - * # Date: 2017-05-31, 01:07:00 GMT [KW, RP] - * # IndicPositionalCategory-10.0.0.txt - * # Date: 2017-05-31, 01:07:00 GMT [RP] - * # Blocks-10.0.0.txt - * # Date: 2017-04-12, 17:30:00 GMT [KW] + * # IndicSyllabicCategory-11.0.0.txt + * # Date: 2018-05-21, 18:33:00 GMT [KW, RP] + * # IndicPositionalCategory-11.0.0.txt + * # Date: 2018-02-05, 16:21:00 GMT [KW, RP] + * # Blocks-11.0.0.txt + * # Date: 2017-10-16, 24:39:00 GMT [KW] */ #include "hb-ot-shape-complex-indic-private.hh" -#define ISC_A INDIC_SYLLABIC_CATEGORY_AVAGRAHA /* 15 chars; Avagraha */ -#define ISC_Bi INDIC_SYLLABIC_CATEGORY_BINDU /* 80 chars; Bindu */ +#define ISC_A INDIC_SYLLABIC_CATEGORY_AVAGRAHA /* 16 chars; Avagraha */ +#define ISC_Bi INDIC_SYLLABIC_CATEGORY_BINDU /* 83 chars; Bindu */ #define ISC_BJN INDIC_SYLLABIC_CATEGORY_BRAHMI_JOINING_NUMBER /* 20 chars; Brahmi_Joining_Number */ -#define ISC_Ca INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK /* 57 chars; Cantillation_Mark */ -#define ISC_C INDIC_SYLLABIC_CATEGORY_CONSONANT /* 2024 chars; Consonant */ +#define ISC_Ca INDIC_SYLLABIC_CATEGORY_CANTILLATION_MARK /* 58 chars; Cantillation_Mark */ +#define ISC_C INDIC_SYLLABIC_CATEGORY_CONSONANT /* 2110 chars; Consonant */ #define ISC_CD INDIC_SYLLABIC_CATEGORY_CONSONANT_DEAD /* 10 chars; Consonant_Dead */ -#define ISC_CF INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL /* 68 chars; Consonant_Final */ +#define ISC_CF INDIC_SYLLABIC_CATEGORY_CONSONANT_FINAL /* 67 chars; Consonant_Final */ #define ISC_CHL INDIC_SYLLABIC_CATEGORY_CONSONANT_HEAD_LETTER /* 5 chars; Consonant_Head_Letter */ +#define ISC_CIP INDIC_SYLLABIC_CATEGORY_CONSONANT_INITIAL_POSTFIXED /* 1 chars; Consonant_Initial_Postfixed */ #define ISC_CK INDIC_SYLLABIC_CATEGORY_CONSONANT_KILLER /* 2 chars; Consonant_Killer */ -#define ISC_CM INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL /* 27 chars; Consonant_Medial */ -#define ISC_CP INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER /* 18 chars; Consonant_Placeholder */ +#define ISC_CM INDIC_SYLLABIC_CATEGORY_CONSONANT_MEDIAL /* 28 chars; Consonant_Medial */ +#define ISC_CP INDIC_SYLLABIC_CATEGORY_CONSONANT_PLACEHOLDER /* 21 chars; Consonant_Placeholder */ #define ISC_CPR INDIC_SYLLABIC_CATEGORY_CONSONANT_PRECEDING_REPHA /* 2 chars; Consonant_Preceding_Repha */ #define ISC_CPrf INDIC_SYLLABIC_CATEGORY_CONSONANT_PREFIXED /* 7 chars; Consonant_Prefixed */ #define ISC_CS INDIC_SYLLABIC_CATEGORY_CONSONANT_SUBJOINED /* 95 chars; Consonant_Subjoined */ -#define ISC_CSR INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA /* 5 chars; Consonant_Succeeding_Repha */ -#define ISC_CWS INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER /* 4 chars; Consonant_With_Stacker */ +#define ISC_CSR INDIC_SYLLABIC_CATEGORY_CONSONANT_SUCCEEDING_REPHA /* 4 chars; Consonant_Succeeding_Repha */ +#define ISC_CWS INDIC_SYLLABIC_CATEGORY_CONSONANT_WITH_STACKER /* 6 chars; Consonant_With_Stacker */ #define ISC_GM INDIC_SYLLABIC_CATEGORY_GEMINATION_MARK /* 3 chars; Gemination_Mark */ -#define ISC_IS INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER /* 10 chars; Invisible_Stacker */ +#define ISC_IS INDIC_SYLLABIC_CATEGORY_INVISIBLE_STACKER /* 11 chars; Invisible_Stacker */ #define ISC_ZWJ INDIC_SYLLABIC_CATEGORY_JOINER /* 1 chars; Joiner */ #define ISC_ML INDIC_SYLLABIC_CATEGORY_MODIFYING_LETTER /* 1 chars; Modifying_Letter */ #define ISC_ZWNJ INDIC_SYLLABIC_CATEGORY_NON_JOINER /* 1 chars; Non_Joiner */ -#define ISC_N INDIC_SYLLABIC_CATEGORY_NUKTA /* 28 chars; Nukta */ -#define ISC_Nd INDIC_SYLLABIC_CATEGORY_NUMBER /* 469 chars; Number */ +#define ISC_N INDIC_SYLLABIC_CATEGORY_NUKTA /* 30 chars; Nukta */ +#define ISC_Nd INDIC_SYLLABIC_CATEGORY_NUMBER /* 480 chars; Number */ #define ISC_NJ INDIC_SYLLABIC_CATEGORY_NUMBER_JOINER /* 1 chars; Number_Joiner */ #define ISC_x INDIC_SYLLABIC_CATEGORY_OTHER /* 1 chars; Other */ #define ISC_PK INDIC_SYLLABIC_CATEGORY_PURE_KILLER /* 21 chars; Pure_Killer */ #define ISC_RS INDIC_SYLLABIC_CATEGORY_REGISTER_SHIFTER /* 2 chars; Register_Shifter */ -#define ISC_SM INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER /* 22 chars; Syllable_Modifier */ +#define ISC_SM INDIC_SYLLABIC_CATEGORY_SYLLABLE_MODIFIER /* 25 chars; Syllable_Modifier */ #define ISC_TL INDIC_SYLLABIC_CATEGORY_TONE_LETTER /* 7 chars; Tone_Letter */ #define ISC_TM INDIC_SYLLABIC_CATEGORY_TONE_MARK /* 42 chars; Tone_Mark */ -#define ISC_V INDIC_SYLLABIC_CATEGORY_VIRAMA /* 24 chars; Virama */ -#define ISC_Vs INDIC_SYLLABIC_CATEGORY_VISARGA /* 34 chars; Visarga */ +#define ISC_V INDIC_SYLLABIC_CATEGORY_VIRAMA /* 25 chars; Virama */ +#define ISC_Vs INDIC_SYLLABIC_CATEGORY_VISARGA /* 36 chars; Visarga */ #define ISC_Vo INDIC_SYLLABIC_CATEGORY_VOWEL /* 30 chars; Vowel */ -#define ISC_M INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT /* 633 chars; Vowel_Dependent */ -#define ISC_VI INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT /* 443 chars; Vowel_Independent */ +#define ISC_M INDIC_SYLLABIC_CATEGORY_VOWEL_DEPENDENT /* 660 chars; Vowel_Dependent */ +#define ISC_VI INDIC_SYLLABIC_CATEGORY_VOWEL_INDEPENDENT /* 464 chars; Vowel_Independent */ -#define IMC_B INDIC_MATRA_CATEGORY_BOTTOM /* 330 chars; Bottom */ +#define IMC_B INDIC_MATRA_CATEGORY_BOTTOM /* 340 chars; Bottom */ #define IMC_BL INDIC_MATRA_CATEGORY_BOTTOM_AND_LEFT /* 1 chars; Bottom_And_Left */ #define IMC_BR INDIC_MATRA_CATEGORY_BOTTOM_AND_RIGHT /* 2 chars; Bottom_And_Right */ -#define IMC_L INDIC_MATRA_CATEGORY_LEFT /* 57 chars; Left */ +#define IMC_L INDIC_MATRA_CATEGORY_LEFT /* 59 chars; Left */ #define IMC_LR INDIC_MATRA_CATEGORY_LEFT_AND_RIGHT /* 21 chars; Left_And_Right */ #define IMC_x INDIC_MATRA_CATEGORY_NOT_APPLICABLE /* 1 chars; Not_Applicable */ #define IMC_O INDIC_MATRA_CATEGORY_OVERSTRUCK /* 10 chars; Overstruck */ -#define IMC_R INDIC_MATRA_CATEGORY_RIGHT /* 262 chars; Right */ -#define IMC_T INDIC_MATRA_CATEGORY_TOP /* 380 chars; Top */ +#define IMC_R INDIC_MATRA_CATEGORY_RIGHT /* 276 chars; Right */ +#define IMC_T INDIC_MATRA_CATEGORY_TOP /* 393 chars; Top */ #define IMC_TB INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM /* 10 chars; Top_And_Bottom */ #define IMC_TBR INDIC_MATRA_CATEGORY_TOP_AND_BOTTOM_AND_RIGHT /* 1 chars; Top_And_Bottom_And_Right */ #define IMC_TL INDIC_MATRA_CATEGORY_TOP_AND_LEFT /* 6 chars; Top_And_Left */ @@ -119,7 +120,7 @@ /* Bengali */ - /* 0980 */ _(x,x), _(Bi,T), _(Bi,R), _(Vs,R), _(x,x), _(VI,x), _(VI,x), _(VI,x), + /* 0980 */ _(CP,x), _(Bi,T), _(Bi,R), _(Vs,R), _(x,x), _(VI,x), _(VI,x), _(VI,x), /* 0988 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), _(x,x), _(VI,x), /* 0990 */ _(VI,x), _(x,x), _(x,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), /* 0998 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), @@ -134,7 +135,7 @@ /* 09E0 */ _(VI,x), _(VI,x), _(M,B), _(M,B), _(x,x), _(x,x), _(Nd,x), _(Nd,x), /* 09E8 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), /* 09F0 */ _(C,x), _(C,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), - /* 09F8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(Bi,x), _(x,x), _(x,x), _(x,x), + /* 09F8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(Bi,x), _(x,x), _(SM,T), _(x,x), /* Gurmukhi */ @@ -148,7 +149,7 @@ /* 0A38 */ _(C,x), _(C,x), _(x,x), _(x,x), _(N,B), _(x,x), _(M,R), _(M,L), /* 0A40 */ _(M,R), _(M,B), _(M,B), _(x,x), _(x,x), _(x,x), _(x,x), _(M,T), /* 0A48 */ _(M,T), _(x,x), _(x,x), _(M,T), _(M,T), _(V,B), _(x,x), _(x,x), - /* 0A50 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), + /* 0A50 */ _(x,x), _(Ca,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), /* 0A58 */ _(x,x), _(C,x), _(C,x), _(C,x), _(C,x), _(x,x), _(C,x), _(x,x), /* 0A60 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(Nd,x), _(Nd,x), /* 0A68 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), @@ -214,7 +215,7 @@ /* Telugu */ - /* 0C00 */ _(Bi,T), _(Bi,R), _(Bi,R), _(Vs,R), _(x,x), _(VI,x), _(VI,x), _(VI,x), + /* 0C00 */ _(Bi,T), _(Bi,R), _(Bi,R), _(Vs,R), _(Bi,T), _(VI,x), _(VI,x), _(VI,x), /* 0C08 */ _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(x,x), _(VI,x), _(VI,x), /* 0C10 */ _(VI,x), _(x,x), _(VI,x), _(VI,x), _(VI,x), _(C,x), _(C,x), _(C,x), /* 0C18 */ _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), @@ -301,7 +302,7 @@ /* 1030 */ _(M,B), _(M,L), _(M,T), _(M,T), _(M,T), _(M,T), _(Bi,T), _(TM,B), /* 1038 */ _(Vs,R), _(IS,x), _(PK,T), _(CM,R), _(CM,x), _(CM,B), _(CM,B), _(C,x), /* 1040 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), - /* 1048 */ _(Nd,x), _(Nd,x), _(x,x), _(x,x), _(x,x), _(x,x), _(CP,x), _(x,x), + /* 1048 */ _(Nd,x), _(Nd,x), _(x,x), _(CP,x), _(x,x), _(x,x), _(CP,x), _(x,x), /* 1050 */ _(C,x), _(C,x), _(VI,x), _(VI,x), _(VI,x), _(VI,x), _(M,R), _(M,R), /* 1058 */ _(M,B), _(M,B), _(C,x), _(C,x), _(C,x), _(C,x), _(CM,B), _(CM,B), /* 1060 */ _(CM,B), _(C,x), _(M,R), _(TM,R), _(TM,R), _(C,x), _(C,x), _(M,R), @@ -342,7 +343,7 @@ /* 1CD8 */ _(Ca,B), _(Ca,B), _(Ca,T), _(Ca,T), _(Ca,B), _(Ca,B), _(Ca,B), _(Ca,B), /* 1CE0 */ _(Ca,T), _(Ca,R), _(x,O), _(x,O), _(x,O), _(x,O), _(x,O), _(x,O), /* 1CE8 */ _(x,O), _(x,x), _(x,x), _(x,x), _(x,x), _(x,B), _(x,x), _(x,x), - /* 1CF0 */ _(x,x), _(x,x), _(Vs,x), _(Vs,x), _(Ca,T), _(x,x), _(x,x), _(Ca,R), + /* 1CF0 */ _(x,x), _(x,x), _(Vs,x), _(Vs,x), _(Ca,T),_(CWS,x),_(CWS,x), _(Ca,R), /* 1CF8 */ _(Ca,x), _(Ca,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), #define indic_offset_0x2008u 1656 @@ -370,8 +371,9 @@ /* A8E0 */ _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), /* A8E8 */ _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), _(Ca,T), /* A8F0 */ _(Ca,T), _(Ca,T), _(Bi,x), _(Bi,x), _(x,x), _(x,x), _(x,x), _(x,x), + /* A8F8 */ _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(x,x), _(VI,x), _(M,T), -#define indic_offset_0xa9e0u 1720 +#define indic_offset_0xa9e0u 1728 /* Myanmar Extended-B */ @@ -381,7 +383,7 @@ /* A9F0 */ _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), _(Nd,x), /* A9F8 */ _(Nd,x), _(Nd,x), _(C,x), _(C,x), _(C,x), _(C,x), _(C,x), _(x,x), -#define indic_offset_0xaa60u 1752 +#define indic_offset_0xaa60u 1760 /* Myanmar Extended-A */ @@ -391,7 +393,7 @@ /* AA70 */ _(x,x), _(C,x), _(C,x), _(C,x), _(CP,x), _(CP,x), _(CP,x), _(x,x), /* AA78 */ _(x,x), _(x,x), _(C,x), _(TM,R), _(TM,T), _(TM,R), _(C,x), _(C,x), -}; /* Table items: 1784; occupancy: 70% */ +}; /* Table items: 1792; occupancy: 70% */ INDIC_TABLE_ELEMENT_TYPE hb_indic_get_categories (hb_codepoint_t u) @@ -418,7 +420,7 @@ break; case 0xAu: - if (hb_in_range<hb_codepoint_t> (u, 0xA8E0u, 0xA8F7u)) return indic_table[u - 0xA8E0u + indic_offset_0xa8e0u]; + if (hb_in_range<hb_codepoint_t> (u, 0xA8E0u, 0xA8FFu)) return indic_table[u - 0xA8E0u + indic_offset_0xa8e0u]; if (hb_in_range<hb_codepoint_t> (u, 0xA9E0u, 0xA9FFu)) return indic_table[u - 0xA9E0u + indic_offset_0xa9e0u]; if (hb_in_range<hb_codepoint_t> (u, 0xAA60u, 0xAA7Fu)) return indic_table[u - 0xAA60u + indic_offset_0xaa60u]; break; @@ -430,7 +432,6 @@ } #undef _ - #undef ISC_A #undef ISC_Bi #undef ISC_BJN @@ -439,6 +440,7 @@ #undef ISC_CD #undef ISC_CF #undef ISC_CHL +#undef ISC_CIP #undef ISC_CK #undef ISC_CM #undef ISC_CP @@ -466,7 +468,6 @@ #undef ISC_Vo #undef ISC_M #undef ISC_VI - #undef IMC_B #undef IMC_BL #undef IMC_BR diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-khmer.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-khmer.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-khmer.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-khmer.cc 2018-07-25 15:36:46.000000000 +0000 @@ -275,7 +275,7 @@ /* Rules from: - * https://www.microsoft.com/typography/otfntdev/devanot/shaping.aspx */ + * https://docs.microsoft.com/en-us/typography/script-development/devanagari */ static void initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, @@ -317,7 +317,7 @@ if ((FLAG_UNSAFE (info[i].khmer_category()) & (JOINER_FLAGS | FLAG (OT_N) | FLAG (OT_RS) | MEDIAL_FLAGS | FLAG (OT_Coeng)))) { info[i].khmer_position() = last_pos; - if (unlikely (info[i].khmer_category() == OT_H && + if (unlikely (info[i].khmer_category() == OT_Coeng && info[i].khmer_position() == POS_PRE_M)) { /* @@ -372,22 +372,25 @@ break; } - /* Note! syllable() is a one-byte field. */ - for (unsigned int i = base; i < end; i++) - if (info[i].syllable() != 255) - { - unsigned int max = i; - unsigned int j = start + info[i].syllable(); - while (j != i) + if (unlikely (end - start >= 127)) + buffer->merge_clusters (start, end); + else + /* Note! syllable() is a one-byte field. */ + for (unsigned int i = base; i < end; i++) + if (info[i].syllable() != 255) { - max = MAX (max, j); - unsigned int next = start + info[j].syllable(); - info[j].syllable() = 255; /* So we don't process j later again. */ - j = next; + unsigned int max = i; + unsigned int j = start + info[i].syllable(); + while (j != i) + { + max = MAX (max, j); + unsigned int next = start + info[j].syllable(); + info[j].syllable() = 255; /* So we don't process j later again. */ + j = next; + } + if (i != max) + buffer->merge_clusters (i, max + 1); } - if (i != max) - buffer->merge_clusters (i, max + 1); - } /* Put syllable back in. */ for (unsigned int i = start; i < end; i++) @@ -485,7 +488,7 @@ buffer->idx = 0; unsigned int last_syllable = 0; - while (buffer->idx < buffer->len && !buffer->in_error) + while (buffer->idx < buffer->len && buffer->successful) { unsigned int syllable = buffer->cur().syllable(); syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F); @@ -500,7 +503,7 @@ /* TODO Set glyph_props? */ /* Insert dottedcircle after possible Repha. */ - while (buffer->idx < buffer->len && !buffer->in_error && + while (buffer->idx < buffer->len && buffer->successful && last_syllable == buffer->cur().syllable() && buffer->cur().khmer_category() == OT_Repha) buffer->next_glyph (); @@ -538,7 +541,7 @@ * and possibly multiple substitutions happened prior to this * phase, and that might have messed up our properties. Recover * from a particular case of that where we're fairly sure that a - * class of OT_H is desired but has been lost. */ + * class of OT_Coeng is desired but has been lost. */ if (khmer_plan->virama_glyph) { unsigned int virama_glyph = khmer_plan->virama_glyph; @@ -548,7 +551,7 @@ _hb_glyph_info_multiplied (&info[i])) { /* This will make sure that this glyph passes is_coeng() test. */ - info[i].khmer_category() = OT_H; + info[i].khmer_category() = OT_Coeng; _hb_glyph_info_clear_ligated_and_multiplied (&info[i]); } } diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-khmer-machine.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-khmer-machine.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-khmer-machine.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-khmer-machine.hh 2018-07-25 15:36:46.000000000 +0000 @@ -173,7 +173,7 @@ static void find_syllables (hb_buffer_t *buffer) { - unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED; + unsigned int p, pe, eof, ts HB_UNUSED, te, act HB_UNUSED; int cs; hb_glyph_info_t *info = buffer->info; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar.cc 2018-07-25 15:36:46.000000000 +0000 @@ -161,7 +161,7 @@ /* Rules from: - * http://www.microsoft.com/typography/OpenTypeDev/myanmar/intro.htm */ + * https://docs.microsoft.com/en-us/typography/script-development/myanmar */ static void initial_reordering_consonant_syllable (hb_buffer_t *buffer, @@ -312,7 +312,7 @@ buffer->idx = 0; unsigned int last_syllable = 0; - while (buffer->idx < buffer->len && !buffer->in_error) + while (buffer->idx < buffer->len && buffer->successful) { unsigned int syllable = buffer->cur().syllable(); syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F); diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-myanmar-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -68,7 +68,7 @@ indic_position_t pos = (indic_position_t) (type >> 8); /* Myanmar - * http://www.microsoft.com/typography/OpenTypeDev/myanmar/intro.htm#analyze + * https://docs.microsoft.com/en-us/typography/script-development/myanmar#analyze */ if (unlikely (hb_in_range<hb_codepoint_t> (u, 0xFE00u, 0xFE0Fu))) cat = (indic_category_t) OT_VS; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -205,6 +205,10 @@ /* Unicode-9.0 additions */ case HB_SCRIPT_ADLAM: + /* Unicode-11.0 additions */ + case HB_SCRIPT_HANIFI_ROHINGYA: + case HB_SCRIPT_SOGDIAN: + /* For Arabic script, use the Arabic shaper even if no OT script tag was found. * This is because we do fallback shaping for Arabic script (and not others). * But note that Arabic shaping is applicable only to horizontal layout; for @@ -380,6 +384,11 @@ case HB_SCRIPT_SOYOMBO: case HB_SCRIPT_ZANABAZAR_SQUARE: + /* Unicode-11.0 additions */ + case HB_SCRIPT_DOGRA: + case HB_SCRIPT_GUNJALA_GONDI: + case HB_SCRIPT_MAKASAR: + /* If the designer designed the font for the 'DFLT' script, * (or we ended up arbitrarily pick 'latn'), use the default shaper. * Otherwise, use the specific shaper. diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-thai.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-thai.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-thai.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-thai.cc 2018-07-25 15:36:46.000000000 +0000 @@ -260,7 +260,7 @@ { /* This function implements the shaping logic documented here: * - * http://linux.thai.net/~thep/th-otf/shaping.html + * https://linux.thai.net/~thep/th-otf/shaping.html * * The first shaping rule listed there is needed even if the font has Thai * OpenType tables. The rest do fallback positioning based on PUA codepoints. @@ -315,7 +315,7 @@ buffer->clear_output (); unsigned int count = buffer->len; - for (buffer->idx = 0; buffer->idx < count && !buffer->in_error;) + for (buffer->idx = 0; buffer->idx < count && buffer->successful;) { hb_codepoint_t u = buffer->cur().codepoint; if (likely (!IS_SARA_AM (u))) { @@ -327,7 +327,7 @@ hb_codepoint_t decomposed[2] = {hb_codepoint_t (NIKHAHIT_FROM_SARA_AM (u)), hb_codepoint_t (SARA_AA_FROM_SARA_AM (u))}; buffer->replace_glyphs (1, 2, decomposed); - if (unlikely (buffer->in_error)) + if (unlikely (!buffer->successful)) return; /* Make Nikhahit be recognized as a ccc=0 mark when zeroing widths. */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use.cc 2018-07-25 15:36:46.000000000 +0000 @@ -35,7 +35,7 @@ /* * Universal Shaping Engine. - * https://www.microsoft.com/typography/OpenTypeDev/USE/intro.htm + * https://docs.microsoft.com/en-us/typography/script-development/use */ static const hb_tag_t @@ -511,7 +511,7 @@ buffer->idx = 0; unsigned int last_syllable = 0; - while (buffer->idx < buffer->len && !buffer->in_error) + while (buffer->idx < buffer->len && buffer->successful) { unsigned int syllable = buffer->cur().syllable(); syllable_type_t syllable_type = (syllable_type_t) (syllable & 0x0F); @@ -526,7 +526,7 @@ /* TODO Set glyph_props? */ /* Insert dottedcircle after possible Repha. */ - while (buffer->idx < buffer->len && !buffer->in_error && + while (buffer->idx < buffer->len && buffer->successful && last_syllable == buffer->cur().syllable() && buffer->cur().use_category() == USE_R) buffer->next_glyph (); diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-machine.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-machine.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-machine.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-machine.hh 2018-07-25 15:36:46.000000000 +0000 @@ -331,7 +331,7 @@ static void find_syllables (hb_buffer_t *buffer) { - unsigned int p, pe, eof, ts HB_UNUSED, te HB_UNUSED, act HB_UNUSED; + unsigned int p, pe, eof, ts HB_UNUSED, te, act; int cs; hb_glyph_info_t *info = buffer->info; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -38,7 +38,7 @@ #define USE_TABLE_ELEMENT_TYPE uint8_t /* Cateories used in the Universal Shaping Engine spec: - * https://www.microsoft.com/typography/OpenTypeDev/USE/intro.htm + * https://docs.microsoft.com/en-us/typography/script-development/use */ /* Note: This enum is duplicated in the -machine.rl source file. * Not sure how to avoid duplication. */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-table.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-table.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-table.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-complex-use-table.cc 2018-07-25 15:36:46.000000000 +0000 @@ -6,12 +6,12 @@ * * on files with these headers: * - * # IndicSyllabicCategory-10.0.0.txt - * # Date: 2017-05-31, 01:07:00 GMT [KW, RP] - * # IndicPositionalCategory-10.0.0.txt - * # Date: 2017-05-31, 01:07:00 GMT [RP] - * # Blocks-10.0.0.txt - * # Date: 2017-04-12, 17:30:00 GMT [KW] + * # IndicSyllabicCategory-11.0.0.txt + * # Date: 2018-05-21, 18:33:00 GMT [KW, RP] + * # IndicPositionalCategory-11.0.0.txt + * # Date: 2018-02-05, 16:21:00 GMT [KW, RP] + * # Blocks-11.0.0.txt + * # Date: 2017-10-16, 24:39:00 GMT [KW] * UnicodeData.txt does not have a header. */ @@ -97,14 +97,14 @@ /* Bengali */ - /* 0980 */ O, VMAbv, VMPst, VMPst, O, B, B, B, B, B, B, B, B, O, O, B, + /* 0980 */ GB, VMAbv, VMPst, VMPst, O, B, B, B, B, B, B, B, B, O, O, B, /* 0990 */ B, O, O, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 09A0 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B, /* 09B0 */ B, O, B, O, O, O, B, B, B, B, O, O, CMBlw, B, VPst, VPre, /* 09C0 */ VPst, VBlw, VBlw, VBlw, VBlw, O, O, VPre, VPre, O, O, VPre, VPre, H, IND, O, /* 09D0 */ O, O, O, O, O, O, O, VPst, O, O, O, O, B, B, O, B, /* 09E0 */ B, B, VBlw, VBlw, O, O, B, B, B, B, B, B, B, B, B, B, - /* 09F0 */ B, B, O, O, O, O, O, O, O, O, O, O, B, O, O, O, + /* 09F0 */ B, B, O, O, O, O, O, O, O, O, O, O, B, O, FM, O, /* Gurmukhi */ @@ -113,7 +113,7 @@ /* 0A20 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B, /* 0A30 */ B, O, B, B, O, B, B, O, B, B, O, O, CMBlw, O, VPst, VPre, /* 0A40 */ VPst, VBlw, VBlw, O, O, O, O, VAbv, VAbv, O, O, VAbv, VAbv, H, O, O, - /* 0A50 */ O, O, O, O, O, O, O, O, O, B, B, B, B, O, B, O, + /* 0A50 */ O, VMBlw, O, O, O, O, O, O, O, B, B, B, B, O, B, O, /* 0A60 */ O, O, O, O, O, O, B, B, B, B, B, B, B, B, B, B, /* 0A70 */ VMAbv, CMAbv, GB, GB, O, MBlw, O, O, O, O, O, O, O, O, O, O, @@ -152,7 +152,7 @@ /* Telugu */ - /* 0C00 */ VMAbv, VMPst, VMPst, VMPst, O, B, B, B, B, B, B, B, B, O, B, B, + /* 0C00 */ VMAbv, VMPst, VMPst, VMPst, VMAbv, B, B, B, B, B, B, B, B, O, B, B, /* 0C10 */ B, O, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 0C20 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B, /* 0C30 */ B, B, B, B, B, B, B, B, B, B, O, O, O, B, VAbv, VAbv, @@ -203,7 +203,7 @@ /* 1010 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 1020 */ B, B, B, B, B, B, B, B, B, B, B, VPst, VPst, VAbv, VAbv, VBlw, /* 1030 */ VBlw, VPre, VAbv, VAbv, VAbv, VAbv, VMAbv, VMBlw, VMPst, H, VAbv, MPst, MPre, MBlw, MBlw, B, - /* 1040 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, GB, O, + /* 1040 */ B, B, B, B, B, B, B, B, B, B, O, GB, O, O, GB, O, /* 1050 */ B, B, B, B, B, B, VPst, VPst, VBlw, VBlw, B, B, B, B, MBlw, MBlw, /* 1060 */ MBlw, B, VPst, VMPst, VMPst, B, B, VPst, VPst, VMPst, VMPst, VMPst, VMPst, VMPst, B, B, /* 1070 */ B, VAbv, VAbv, VAbv, VAbv, B, B, B, B, B, B, B, B, B, B, B, @@ -330,7 +330,7 @@ /* 1CD0 */ VMAbv, VMAbv, VMAbv, O, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMAbv, VMAbv, VMBlw, VMBlw, VMBlw, VMBlw, /* 1CE0 */ VMAbv, VMPst, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, VMBlw, O, O, O, O, VMBlw, O, O, - /* 1CF0 */ O, O, VMPst, VMPst, VMAbv, O, O, VMPst, VMAbv, VMAbv, O, O, O, O, O, O, + /* 1CF0 */ O, O, VMPst, VMPst, VMAbv, CS, CS, VMPst, VMAbv, VMAbv, O, O, O, O, O, O, #define use_offset_0x1df8u 2560 @@ -396,7 +396,7 @@ /* Devanagari Extended */ /* A8E0 */ VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, - /* A8F0 */ VMAbv, VMAbv, B, B, O, O, O, O, O, O, O, O, O, O, O, O, + /* A8F0 */ VMAbv, VMAbv, B, B, O, O, O, O, O, O, O, O, O, O, B, VAbv, /* Kayah Li */ @@ -479,10 +479,10 @@ /* 10A00 */ B, VBlw, VBlw, VBlw, O, VAbv, VBlw, O, O, O, O, O, VBlw, VBlw, VMBlw, VMAbv, /* 10A10 */ B, B, B, B, O, B, B, B, O, B, B, B, B, B, B, B, /* 10A20 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, - /* 10A30 */ B, B, B, B, O, O, O, O, CMAbv, CMBlw, CMBlw, O, O, O, O, H, - /* 10A40 */ B, B, B, B, B, B, B, B, + /* 10A30 */ B, B, B, B, B, B, O, O, CMAbv, CMBlw, CMBlw, O, O, O, O, H, + /* 10A40 */ B, B, B, B, B, B, B, B, B, O, O, O, O, O, O, O, -#define use_offset_0x11000u 3552 +#define use_offset_0x11000u 3560 /* Brahmi */ @@ -503,7 +503,7 @@ /* 110A0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 110B0 */ VPst, VPre, VPst, VBlw, VBlw, VAbv, VAbv, VPst, VPst, H, CMBlw, O, O, O, O, O, -#define use_offset_0x11100u 3744 +#define use_offset_0x11100u 3752 /* Chakma */ @@ -512,7 +512,7 @@ /* 11110 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 11120 */ B, B, B, B, B, B, B, VAbv, VAbv, VAbv, VBlw, VBlw, VPre, VAbv, VAbv, VAbv, /* 11130 */ VAbv, VBlw, VBlw, H, VAbv, O, B, B, B, B, B, B, B, B, B, B, - /* 11140 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, + /* 11140 */ O, O, O, O, B, VPst, VPst, O, O, O, O, O, O, O, O, O, /* Mahajani */ @@ -526,7 +526,7 @@ /* 11190 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 111A0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 111B0 */ B, B, B, VPst, VPre, VPst, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VAbv, VAbv, VAbv, VAbv, - /* 111C0 */ H, B, R, R, O, O, O, O, O, O, CMBlw, VAbv, VBlw, O, O, O, + /* 111C0 */ H, B, R, R, O, O, O, O, O, FM, CMBlw, VAbv, VBlw, O, O, O, /* 111D0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O, /* Sinhala Archaic Numbers */ @@ -541,7 +541,7 @@ /* 11220 */ B, B, B, B, B, B, B, B, B, B, B, B, VPst, VPst, VPst, VBlw, /* 11230 */ VAbv, VAbv, VAbv, VAbv, VMAbv, H, CMAbv, CMAbv, O, O, O, O, O, O, VMAbv, O, -#define use_offset_0x11280u 4064 +#define use_offset_0x11280u 4072 /* Multani */ @@ -563,13 +563,13 @@ /* 11300 */ VMAbv, VMAbv, VMPst, VMPst, O, B, B, B, B, B, B, B, B, O, O, B, /* 11310 */ B, O, O, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 11320 */ B, B, B, B, B, B, B, B, B, O, B, B, B, B, B, B, - /* 11330 */ B, O, B, B, O, B, B, B, B, B, O, O, CMBlw, B, VPst, VPst, + /* 11330 */ B, O, B, B, O, B, B, B, B, B, O, CMBlw, CMBlw, B, VPst, VPst, /* 11340 */ VAbv, VPst, VPst, VPst, VPst, O, O, VPre, VPre, O, O, VPre, VPre, H, O, O, /* 11350 */ O, O, O, O, O, O, O, VPst, O, O, O, O, O, O, B, B, /* 11360 */ B, B, VPst, VPst, O, O, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, O, O, O, /* 11370 */ VMAbv, VMAbv, VMAbv, VMAbv, VMAbv, O, O, O, -#define use_offset_0x11400u 4312 +#define use_offset_0x11400u 4320 /* Newa */ @@ -579,7 +579,7 @@ /* 11420 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 11430 */ B, B, B, B, B, VPst, VPre, VPst, VBlw, VBlw, VBlw, VBlw, VBlw, VBlw, VAbv, VAbv, /* 11440 */ VPst, VPst, H, VMAbv, VMAbv, VMPst, CMBlw, B, O, O, O, O, O, O, O, O, - /* 11450 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O, + /* 11450 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, FM, O, /* 11460 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, /* 11470 */ O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, O, @@ -592,7 +592,7 @@ /* 114C0 */ VMAbv, VMPst, H, CMBlw, B, O, O, O, O, O, O, O, O, O, O, O, /* 114D0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O, -#define use_offset_0x11580u 4536 +#define use_offset_0x11580u 4544 /* Siddham */ @@ -631,11 +631,21 @@ /* Ahom */ /* 11700 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, - /* 11710 */ B, B, B, B, B, B, B, B, B, B, O, O, O, MBlw, MPre, MAbv, + /* 11710 */ B, B, B, B, B, B, B, B, B, B, B, O, O, MBlw, MPre, MAbv, /* 11720 */ VPst, VPst, VAbv, VAbv, VBlw, VBlw, VPre, VAbv, VBlw, VAbv, VAbv, VAbv, O, O, O, O, /* 11730 */ B, B, B, B, B, B, B, B, B, B, B, B, O, O, O, O, -#define use_offset_0x11a00u 4984 +#define use_offset_0x11800u 4992 + + + /* Dogra */ + + /* 11800 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, + /* 11810 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, + /* 11820 */ B, B, B, B, B, B, B, B, B, B, B, B, VPst, VPre, VPst, VBlw, + /* 11830 */ VBlw, VBlw, VBlw, VAbv, VAbv, VAbv, VAbv, VMAbv, VMPst, H, CMBlw, O, O, O, O, O, + +#define use_offset_0x11a00u 5056 /* Zanabazar Square */ @@ -652,9 +662,9 @@ /* 11A60 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 11A70 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, /* 11A80 */ B, B, B, B, O, O, R, R, R, R, FBlw, FBlw, FBlw, FBlw, FBlw, FBlw, - /* 11A90 */ FBlw, FBlw, FBlw, FBlw, FBlw, FBlw, VMAbv, VMPst, CMAbv, H, O, O, O, O, O, O, + /* 11A90 */ FBlw, FBlw, FBlw, FBlw, FBlw, FBlw, VMAbv, VMPst, CMAbv, H, O, O, O, B, O, O, -#define use_offset_0x11c00u 5144 +#define use_offset_0x11c00u 5216 /* Bhaiksuki */ @@ -675,7 +685,7 @@ /* 11CA0 */ SUB, SUB, SUB, SUB, SUB, SUB, SUB, SUB, O, SUB, SUB, SUB, SUB, SUB, SUB, SUB, /* 11CB0 */ VBlw, VPre, VBlw, VAbv, VPst, VMAbv, VMAbv, O, -#define use_offset_0x11d00u 5328 +#define use_offset_0x11d00u 5400 /* Masaram Gondi */ @@ -687,7 +697,23 @@ /* 11D40 */ VMAbv, VMAbv, CMBlw, VAbv, VBlw, H, R, MBlw, O, O, O, O, O, O, O, O, /* 11D50 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O, -}; /* Table items: 5424; occupancy: 73% */ + /* Gunjala Gondi */ + + /* 11D60 */ B, B, B, B, B, B, O, B, B, O, B, B, B, B, B, B, + /* 11D70 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, + /* 11D80 */ B, B, B, B, B, B, B, B, B, B, VPst, VPst, VPst, VPst, VPst, O, + /* 11D90 */ VAbv, VAbv, O, VPst, VPst, VMAbv, VMPst, H, O, O, O, O, O, O, O, O, + /* 11DA0 */ B, B, B, B, B, B, B, B, B, B, O, O, O, O, O, O, + +#define use_offset_0x11ee0u 5576 + + + /* Makasar */ + + /* 11EE0 */ B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, B, + /* 11EF0 */ B, B, GB, VAbv, VBlw, VPre, VPst, O, + +}; /* Table items: 5600; occupancy: 73% */ USE_TABLE_ELEMENT_TYPE hb_use_get_category (hb_codepoint_t u) @@ -727,7 +753,7 @@ break; case 0x10u: - if (hb_in_range<hb_codepoint_t> (u, 0x10A00u, 0x10A47u)) return use_table[u - 0x10A00u + use_offset_0x10a00u]; + if (hb_in_range<hb_codepoint_t> (u, 0x10A00u, 0x10A4Fu)) return use_table[u - 0x10A00u + use_offset_0x10a00u]; break; case 0x11u: @@ -736,9 +762,11 @@ if (hb_in_range<hb_codepoint_t> (u, 0x11280u, 0x11377u)) return use_table[u - 0x11280u + use_offset_0x11280u]; if (hb_in_range<hb_codepoint_t> (u, 0x11400u, 0x114DFu)) return use_table[u - 0x11400u + use_offset_0x11400u]; if (hb_in_range<hb_codepoint_t> (u, 0x11580u, 0x1173Fu)) return use_table[u - 0x11580u + use_offset_0x11580u]; + if (hb_in_range<hb_codepoint_t> (u, 0x11800u, 0x1183Fu)) return use_table[u - 0x11800u + use_offset_0x11800u]; if (hb_in_range<hb_codepoint_t> (u, 0x11A00u, 0x11A9Fu)) return use_table[u - 0x11A00u + use_offset_0x11a00u]; if (hb_in_range<hb_codepoint_t> (u, 0x11C00u, 0x11CB7u)) return use_table[u - 0x11C00u + use_offset_0x11c00u]; - if (hb_in_range<hb_codepoint_t> (u, 0x11D00u, 0x11D5Fu)) return use_table[u - 0x11D00u + use_offset_0x11d00u]; + if (hb_in_range<hb_codepoint_t> (u, 0x11D00u, 0x11DAFu)) return use_table[u - 0x11D00u + use_offset_0x11d00u]; + if (hb_in_range<hb_codepoint_t> (u, 0x11EE0u, 0x11EF7u)) return use_table[u - 0x11EE0u + use_offset_0x11ee0u]; break; default: diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-fallback.cc 2018-07-25 15:36:46.000000000 +0000 @@ -548,7 +548,7 @@ case t::SPACE_NARROW: /* Half-space? - * Unicode doc http://www.unicode.org/charts/PDF/U2000.pdf says ~1/4 or 1/5 of EM. + * Unicode doc https://unicode.org/charts/PDF/U2000.pdf says ~1/4 or 1/5 of EM. * However, in my testing, many fonts have their regular space being about that * size. To me, a percentage of the space width makes more sense. Half is as * good as any. */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-normalize.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-normalize.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-normalize.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-normalize.cc 2018-07-25 15:36:46.000000000 +0000 @@ -119,7 +119,7 @@ static inline unsigned int decompose (const hb_ot_shape_normalize_context_t *c, bool shortest, hb_codepoint_t ab) { - hb_codepoint_t a, b, a_glyph, b_glyph; + hb_codepoint_t a = 0, b = 0, a_glyph = 0, b_glyph = 0; hb_buffer_t * const buffer = c->buffer; hb_font_t * const font = c->font; @@ -164,7 +164,7 @@ { hb_buffer_t * const buffer = c->buffer; hb_codepoint_t u = buffer->cur().codepoint; - hb_codepoint_t glyph; + hb_codepoint_t glyph = 0; if (shortest && c->font->get_nominal_glyph (u, &glyph)) { @@ -218,7 +218,7 @@ /* TODO Currently if there's a variation-selector we give-up, it's just too hard. */ hb_buffer_t * const buffer = c->buffer; hb_font_t * const font = c->font; - for (; buffer->idx < end - 1 && !buffer->in_error;) { + for (; buffer->idx < end - 1 && buffer->successful;) { if (unlikely (buffer->unicode->is_variation_selector (buffer->cur(+1).codepoint))) { /* The next two lines are some ugly lines... But work. */ if (font->get_variation_glyph (buffer->cur().codepoint, buffer->cur(+1).codepoint, &buffer->cur().glyph_index())) @@ -254,13 +254,13 @@ decompose_multi_char_cluster (const hb_ot_shape_normalize_context_t *c, unsigned int end, bool short_circuit) { hb_buffer_t * const buffer = c->buffer; - for (unsigned int i = buffer->idx; i < end && !buffer->in_error; i++) + for (unsigned int i = buffer->idx; i < end && buffer->successful; i++) if (unlikely (buffer->unicode->is_variation_selector (buffer->info[i].codepoint))) { handle_variation_selector_cluster (c, end, short_circuit); return; } - while (buffer->idx < end && !buffer->in_error) + while (buffer->idx < end && buffer->successful) decompose_current_character (c, short_circuit); } @@ -320,7 +320,7 @@ buffer->clear_output (); count = buffer->len; - for (buffer->idx = 0; buffer->idx < count && !buffer->in_error;) + for (buffer->idx = 0; buffer->idx < count && buffer->successful;) { unsigned int end; for (end = buffer->idx + 1; end < count; end++) @@ -373,7 +373,7 @@ count = buffer->len; unsigned int starter = 0; buffer->next_glyph (); - while (buffer->idx < count && !buffer->in_error) + while (buffer->idx < count && buffer->successful) { hb_codepoint_t composed, glyph; if (/* We don't try to compose a non-mark character with it's preceding starter. @@ -396,7 +396,7 @@ { /* Composes. */ buffer->next_glyph (); /* Copy to out-buffer. */ - if (unlikely (buffer->in_error)) + if (unlikely (!buffer->successful)) return; buffer->merge_out_clusters (starter, buffer->out_len); buffer->out_len--; /* Remove the second composable. */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-shape-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -59,7 +59,14 @@ inline void substitute (hb_font_t *font, hb_buffer_t *buffer) const { map.substitute (this, font, buffer); } inline void position (hb_font_t *font, hb_buffer_t *buffer) const { map.position (this, font, buffer); } - void finish (void) { map.finish (); } + void init (void) + { + memset (this, 0, sizeof (*this)); + map.init (); + } + void fini (void) { + map.fini (); + } }; struct hb_ot_shape_planner_t @@ -75,7 +82,6 @@ props (master_plan->props), shaper (nullptr), map (face, &props) {} - ~hb_ot_shape_planner_t (void) { map.finish (); } inline void compile (hb_ot_shape_plan_t &plan, const int *coords, @@ -99,9 +105,7 @@ } private: - /* No copy. */ - hb_ot_shape_planner_t (const hb_ot_shape_planner_t &); - hb_ot_shape_planner_t &operator = (const hb_ot_shape_planner_t &); + HB_DISALLOW_COPY_AND_ASSIGN (hb_ot_shape_planner_t); }; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-tag.cc 2018-07-25 15:36:46.000000000 +0000 @@ -116,8 +116,7 @@ /* * Complete list at: - * https://www.microsoft.com/typography/otspec/scripttags.htm - * https://www.microsoft.com/typography/otspec160/scripttagsProposed.htm + * https://docs.microsoft.com/en-us/typography/opentype/spec/scripttags * * Most of the script tags are the same as the ISO 15924 tag but lowercased. * So we just do that, and handle the exceptional cases in a switch. @@ -159,7 +158,7 @@ /* * Complete list at: - * http://www.microsoft.com/typography/otspec/languagetags.htm + * https://docs.microsoft.com/en-us/typography/opentype/spec/languagetags * * Generated by intersecting the OpenType language tag list from * Draft OpenType 1.5 spec, with with the ISO 639-3 codes from @@ -176,7 +175,7 @@ * Updated as of 2015-05-06: OT1.7 on MS website has some newer * items that we don't have here, eg. Zazaki. This is the new * items in OpenType 1.7 (red items), most of which we have: - * http://www.microsoft.com/typography/otspec170/languagetags.htm + * https://docs.microsoft.com/en-us/typography/opentype/spec/languagetags */ static const LangTag ot_languages[] = { diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-avar-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-avar-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-avar-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-avar-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,14 @@ #include "hb-open-type-private.hh" +/* + * avar -- Axis Variations + * https://docs.microsoft.com/en-us/typography/opentype/spec/avar + */ + +#define HB_OT_TAG_avar HB_TAG('a','v','a','r') + + namespace OT { @@ -62,38 +70,32 @@ if (!len) return value; else /* len == 1*/ - return value - array[0].fromCoord + array[0].toCoord; + return value - arrayZ[0].fromCoord + arrayZ[0].toCoord; } - if (value <= array[0].fromCoord) - return value - array[0].fromCoord + array[0].toCoord; + if (value <= arrayZ[0].fromCoord) + return value - arrayZ[0].fromCoord + arrayZ[0].toCoord; unsigned int i; unsigned int count = len; - for (i = 1; i < count && value > array[i].fromCoord; i++) + for (i = 1; i < count && value > arrayZ[i].fromCoord; i++) ; - if (value >= array[i].fromCoord) - return value - array[i].fromCoord + array[i].toCoord; + if (value >= arrayZ[i].fromCoord) + return value - arrayZ[i].fromCoord + arrayZ[i].toCoord; - if (unlikely (array[i-1].fromCoord == array[i].fromCoord)) - return array[i-1].toCoord; + if (unlikely (arrayZ[i-1].fromCoord == arrayZ[i].fromCoord)) + return arrayZ[i-1].toCoord; - int denom = array[i].fromCoord - array[i-1].fromCoord; - return array[i-1].toCoord + - ((array[i].toCoord - array[i-1].toCoord) * - (value - array[i-1].fromCoord) + denom/2) / denom; + int denom = arrayZ[i].fromCoord - arrayZ[i-1].fromCoord; + return arrayZ[i-1].toCoord + + ((arrayZ[i].toCoord - arrayZ[i-1].toCoord) * + (value - arrayZ[i-1].fromCoord) + denom/2) / denom; } - DEFINE_SIZE_ARRAY (2, array); + DEFINE_SIZE_ARRAY (2, arrayZ); }; -/* - * avar — Axis Variations Table - */ - -#define HB_OT_TAG_avar HB_TAG('a','v','a','r') - struct avar { static const hb_tag_t tableTag = HB_OT_TAG_avar; @@ -106,7 +108,7 @@ c->check_struct (this)))) return_trace (false); - const SegmentMaps *map = &axisSegmentMapsZ; + const SegmentMaps *map = axisSegmentMapsZ; unsigned int count = axisCount; for (unsigned int i = 0; i < count; i++) { @@ -122,7 +124,7 @@ { unsigned int count = MIN<unsigned int> (coords_length, axisCount); - const SegmentMaps *map = &axisSegmentMapsZ; + const SegmentMaps *map = axisSegmentMapsZ; for (unsigned int i = 0; i < count; i++) { coords[i] = map->map (coords[i]); @@ -137,7 +139,7 @@ HBUINT16 axisCount; /* The number of variation axes in the font. This * must be the same number as axisCount in the * 'fvar' table. */ - SegmentMaps axisSegmentMapsZ; + SegmentMaps axisSegmentMapsZ[VAR]; public: DEFINE_SIZE_MIN (8); diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var.cc 2018-07-25 15:36:46.000000000 +0000 @@ -39,14 +39,14 @@ static inline const OT::fvar& _get_fvar (hb_face_t *face) { - if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::fvar); + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::fvar); hb_ot_layout_t * layout = hb_ot_layout_from_face (face); return *(layout->fvar.get ()); } static inline const OT::avar& _get_avar (hb_face_t *face) { - if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return OT::Null(OT::avar); + if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::avar); hb_ot_layout_t * layout = hb_ot_layout_from_face (face); return *(layout->avar.get ()); } @@ -65,7 +65,7 @@ hb_bool_t hb_ot_var_has_data (hb_face_t *face) { - return &_get_fvar (face) != &OT::Null(OT::fvar); + return &_get_fvar (face) != &Null(OT::fvar); } /** diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-fvar-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-fvar-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-fvar-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-fvar-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,14 @@ #include "hb-open-type-private.hh" +/* + * fvar -- Font Variations + * https://docs.microsoft.com/en-us/typography/opentype/spec/fvar + */ + +#define HB_OT_TAG_fvar HB_TAG('f','v','a','r') + + namespace OT { @@ -42,11 +50,11 @@ } protected: - HBUINT16 subfamilyNameID;/* The name ID for entries in the 'name' table + NameID subfamilyNameID;/* The name ID for entries in the 'name' table * that provide subfamily names for this instance. */ HBUINT16 reserved; /* Reserved for future use — set to 0. */ Fixed coordinates[VAR];/* The coordinates array for this instance. */ - //HBUINT16 postScriptNameIDX;/*Optional. The name ID for entries in the 'name' + //NameID postScriptNameIDX;/*Optional. The name ID for entries in the 'name' // * table that provide PostScript names for this // * instance. */ @@ -68,20 +76,13 @@ Fixed defaultValue; /* The default coordinate value for the axis. */ Fixed maxValue; /* The maximum coordinate value for the axis. */ HBUINT16 reserved; /* Reserved for future use — set to 0. */ - HBUINT16 axisNameID; /* The name ID for entries in the 'name' table that + NameID axisNameID; /* The name ID for entries in the 'name' table that * provide a display name for this axis. */ public: DEFINE_SIZE_STATIC (20); }; - -/* - * fvar — Font Variations Table - */ - -#define HB_OT_TAG_fvar HB_TAG('f','v','a','r') - struct fvar { static const hb_tag_t tableTag = HB_OT_TAG_fvar; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-hvar-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-hvar-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-hvar-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-hvar-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -89,10 +89,11 @@ /* - * HVAR -- The Horizontal Metrics Variations Table - * VVAR -- The Vertical Metrics Variations Table + * HVAR -- Horizontal Metrics Variations + * https://docs.microsoft.com/en-us/typography/opentype/spec/hvar + * VVAR -- Vertical Metrics Variations + * https://docs.microsoft.com/en-us/typography/opentype/spec/vvar */ - #define HB_OT_TAG_HVAR HB_TAG('H','V','A','R') #define HB_OT_TAG_VVAR HB_TAG('V','V','A','R') diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-mvar-table.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-mvar-table.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-mvar-table.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ot-var-mvar-table.hh 2018-07-25 15:36:46.000000000 +0000 @@ -51,9 +51,9 @@ /* - * MVAR -- Metrics Variations Table + * MVAR -- Metrics Variations + * https://docs.microsoft.com/en-us/typography/opentype/spec/mvar */ - #define HB_OT_TAG_MVAR HB_TAG('M','V','A','R') struct MVAR diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -51,7 +51,7 @@ #include <stdio.h> #include <stdarg.h> -#if defined(_MSC_VER) || defined(__MINGW32__) +#if (defined(_MSC_VER) && _MSC_VER >= 1500) || defined(__MINGW32__) #include <intrin.h> #endif @@ -90,6 +90,14 @@ HB_UNUSED typedef int HB_PASTE(static_assertion_failed_at_line_, __LINE__) [(e) ? 1 : -1] #endif // static_assert +#ifdef __GNUC__ +#if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 8)) +#define thread_local __thread +#endif +#else +#define thread_local +#endif + #endif // __cplusplus < 201103L #if (defined(__GNUC__) || defined(__clang__)) && defined(__OPTIMIZE__) @@ -221,16 +229,14 @@ # endif # elif defined(_MSC_VER) || defined(__MINGW32__) /* For MSVC: - * http://msdn.microsoft.com/en-ca/library/tze57ck3.aspx - * http://msdn.microsoft.com/en-ca/library/zk17ww08.aspx + * https://msdn.microsoft.com/en-us/library/tze57ck3.aspx + * https://msdn.microsoft.com/en-us/library/zk17ww08.aspx * mingw32 headers say atexit is safe to use in shared libraries. */ # define HB_USE_ATEXIT 1 -# elif defined(__ANDROID__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) -/* This was fixed in Android NKD r8 or r8b: - * https://code.google.com/p/android/issues/detail?id=6455 - * which introduced GCC 4.6: - * https://developer.android.com/tools/sdk/ndk/index.html +# elif defined(__ANDROID__) +/* This is available since Android NKD r8 or r8b: + * https://issuetracker.google.com/code/p/android/issues/detail?id=6455 */ # define HB_USE_ATEXIT 1 # elif defined(__APPLE__) @@ -241,6 +247,9 @@ # define HB_USE_ATEXIT 1 # endif #endif +#ifdef HB_NO_ATEXIT +# undef HB_USE_ATEXIT +#endif /* Basics */ @@ -314,7 +323,7 @@ -/* Misc */ +/* Tiny functions */ /* * Void! @@ -360,7 +369,7 @@ } assert (0); - return 0; + return 0; /* Shut up stupid compiler. */ } /* Returns the number of bits needed to store number */ @@ -381,7 +390,7 @@ return sizeof (unsigned long long) * 8 - __builtin_clzll (v); #endif -#if defined(_MSC_VER) || defined(__MINGW32__) +#if (defined(_MSC_VER) && _MSC_VER >= 1500) || defined(__MINGW32__) if (sizeof (T) <= sizeof (unsigned int)) { unsigned long where; @@ -415,7 +424,7 @@ if (sizeof (T) <= 8) { /* "bithacks" */ - const uint64_t b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000, 0xFFFFFFFF00000000}; + const uint64_t b[] = {0x2ULL, 0xCULL, 0xF0ULL, 0xFF00ULL, 0xFFFF0000ULL, 0xFFFFFFFF00000000ULL}; const unsigned int S[] = {1, 2, 4, 8, 16, 32}; unsigned int r = 0; for (int i = 5; i >= 0; i--) @@ -429,12 +438,12 @@ if (sizeof (T) == 16) { unsigned int shift = 64; - return (v >> shift) ? _hb_bit_storage<uint64_t> ((uint64_t) v >> shift) + shift : + return (v >> shift) ? _hb_bit_storage<uint64_t> ((uint64_t) (v >> shift)) + shift : _hb_bit_storage<uint64_t> ((uint64_t) v); } assert (0); - return 0; + return 0; /* Shut up stupid compiler. */ } /* Returns the number of zero bits in the least significant side of v */ @@ -455,7 +464,7 @@ return __builtin_ctzll (v); #endif -#if defined(_MSC_VER) || defined(__MINGW32__) +#if (defined(_MSC_VER) && _MSC_VER >= 1500) || defined(__MINGW32__) if (sizeof (T) <= sizeof (unsigned int)) { unsigned long where; @@ -491,12 +500,12 @@ unsigned int c = 64; v &= - (int64_t) (v); if (v) c--; - if (v & 0x00000000FFFFFFFF) c -= 32; - if (v & 0x0000FFFF0000FFFF) c -= 16; - if (v & 0x00FF00FF00FF00FF) c -= 8; - if (v & 0x0F0F0F0F0F0F0F0F) c -= 4; - if (v & 0x3333333333333333) c -= 2; - if (v & 0x5555555555555555) c -= 1; + if (v & 0x00000000FFFFFFFFULL) c -= 32; + if (v & 0x0000FFFF0000FFFFULL) c -= 16; + if (v & 0x00FF00FF00FF00FFULL) c -= 8; + if (v & 0x0F0F0F0F0F0F0F0FULL) c -= 4; + if (v & 0x3333333333333333ULL) c -= 2; + if (v & 0x5555555555555555ULL) c -= 1; return c; } if (sizeof (T) == 16) @@ -507,7 +516,7 @@ } assert (0); - return 0; + return 0; /* Shut up stupid compiler. */ } static inline bool @@ -524,39 +533,147 @@ +/* + * + * Utility types + * + */ + +#define HB_DISALLOW_COPY_AND_ASSIGN(TypeName) \ + TypeName(const TypeName&); \ + void operator=(const TypeName&) + +/* + * Static pools + */ + +/* Global nul-content Null pool. Enlarge as necessary. */ + +#define HB_NULL_POOL_SIZE 264 +static_assert (HB_NULL_POOL_SIZE % sizeof (void *) == 0, "Align HB_NULL_POOL_SIZE."); + +#ifdef HB_NO_VISIBILITY +static +#else +extern HB_INTERNAL +#endif +void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] +#ifdef HB_NO_VISIBILITY += {} +#endif +; +/* Generic nul-content Null objects. */ +template <typename Type> +static inline Type const & Null (void) { + static_assert (sizeof (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE."); + return *reinterpret_cast<Type const *> (_hb_NullPool); +} +#define Null(Type) Null<Type>() + +/* Specializaiton for arbitrary-content arbitrary-sized Null objects. */ +#define DEFINE_NULL_DATA(Namespace, Type, data) \ +} /* Close namespace. */ \ +static const char _Null##Type[sizeof (Namespace::Type) + 1] = data; /* +1 is for nul-termination in data */ \ +template <> \ +/*static*/ inline const Namespace::Type& Null<Namespace::Type> (void) { \ + return *reinterpret_cast<const Namespace::Type *> (_Null##Type); \ +} \ +namespace Namespace { \ +/* The following line really exists such that we end in a place needing semicolon */ \ +static_assert (Namespace::Type::min_size + 1 <= sizeof (_Null##Type), "Null pool too small. Enlarge.") + + +/* Global writable pool. Enlarge as necessary. */ + +/* To be fully correct, CrapPool must be thread_local. However, we do not rely on CrapPool + * for correct operation. It only exist to catch and divert program logic bugs instead of + * causing bad memory access. So, races there are not actually introducing incorrectness + * in the code. Has ~12kb binary size overhead to have it, also clang build fails with it. */ +#ifdef HB_NO_VISIBILITY +static +#else +extern HB_INTERNAL +#endif +/*thread_local*/ void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] +#ifdef HB_NO_VISIBILITY += {} +#endif +; +/* CRAP pool: Common Region for Access Protection. */ +template <typename Type> +static inline Type& Crap (void) { + static_assert (sizeof (Type) <= HB_NULL_POOL_SIZE, "Increase HB_NULL_POOL_SIZE."); + Type *obj = reinterpret_cast<Type *> (_hb_CrapPool); + *obj = Null(Type); + return *obj; +} +#define Crap(Type) Crap<Type>() + +template <typename Type> +struct CrapOrNull { + static inline Type & get (void) { return Crap(Type); } +}; +template <typename Type> +struct CrapOrNull<const Type> { + static inline Type const & get (void) { return Null(Type); } +}; +#define CrapOrNull(Type) CrapOrNull<Type>::get () + + + /* arrays and maps */ #define HB_PREALLOCED_ARRAY_INIT {0, 0, nullptr} -template <typename Type, unsigned int StaticSize=16> -struct hb_prealloced_array_t +template <typename Type, unsigned int StaticSize=8> +struct hb_vector_t { unsigned int len; unsigned int allocated; - Type *array; + bool successful; + Type *arrayZ; Type static_array[StaticSize]; void init (void) { len = 0; allocated = ARRAY_LENGTH (static_array); - array = static_array; + successful = true; + arrayZ = static_array; } - inline Type& operator [] (unsigned int i) { return array[i]; } - inline const Type& operator [] (unsigned int i) const { return array[i]; } + inline Type& operator [] (unsigned int i) + { + if (unlikely (i >= len)) + return Crap (Type); + return arrayZ[i]; + } + inline const Type& operator [] (unsigned int i) const + { + if (unlikely (i >= len)) + return Null(Type); + return arrayZ[i]; + } inline Type *push (void) { if (unlikely (!resize (len + 1))) - return nullptr; - - return &array[len - 1]; + return &Crap(Type); + return &arrayZ[len - 1]; + } + inline Type *push (const Type& v) + { + Type *p = push (); + *p = v; + return p; } /* Allocate for size but don't adjust len. */ - inline bool alloc(unsigned int size) + inline bool alloc (unsigned int size) { + if (unlikely (!successful)) + return false; + if (likely (size <= allocated)) return true; @@ -568,37 +685,47 @@ Type *new_array = nullptr; - if (array == static_array) { + if (arrayZ == static_array) + { new_array = (Type *) calloc (new_allocated, sizeof (Type)); if (new_array) - memcpy (new_array, array, len * sizeof (Type)); - } else { + memcpy (new_array, arrayZ, len * sizeof (Type)); + } + else + { bool overflows = (new_allocated < allocated) || _hb_unsigned_int_mul_overflows (new_allocated, sizeof (Type)); - if (likely (!overflows)) { - new_array = (Type *) realloc (array, new_allocated * sizeof (Type)); - } + if (likely (!overflows)) + new_array = (Type *) realloc (arrayZ, new_allocated * sizeof (Type)); } if (unlikely (!new_array)) + { + successful = false; return false; + } - array = new_array; + arrayZ = new_array; allocated = new_allocated; return true; } - inline bool resize (unsigned int size) + inline bool resize (int size_) { + unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; if (!alloc (size)) return false; + if (size > len) + memset (arrayZ + len, 0, (size - len) * sizeof (*arrayZ)); + len = size; return true; } inline void pop (void) { + if (!len) return; len--; } @@ -606,54 +733,55 @@ { if (unlikely (i >= len)) return; - memmove (static_cast<void *> (&array[i]), - static_cast<void *> (&array[i + 1]), + memmove (static_cast<void *> (&arrayZ[i]), + static_cast<void *> (&arrayZ[i + 1]), (len - i - 1) * sizeof (Type)); len--; } - inline void shrink (unsigned int l) + inline void shrink (int size_) { - if (l < len) - len = l; + unsigned int size = size_ < 0 ? 0u : (unsigned int) size_; + if (size < len) + len = size; } template <typename T> inline Type *find (T v) { for (unsigned int i = 0; i < len; i++) - if (array[i] == v) - return &array[i]; + if (arrayZ[i] == v) + return &arrayZ[i]; return nullptr; } template <typename T> inline const Type *find (T v) const { for (unsigned int i = 0; i < len; i++) - if (array[i] == v) - return &array[i]; + if (arrayZ[i] == v) + return &arrayZ[i]; return nullptr; } inline void qsort (int (*cmp)(const void*, const void*)) { - ::qsort (array, len, sizeof (Type), cmp); + ::qsort (arrayZ, len, sizeof (Type), cmp); } inline void qsort (void) { - ::qsort (array, len, sizeof (Type), Type::cmp); + ::qsort (arrayZ, len, sizeof (Type), Type::cmp); } inline void qsort (unsigned int start, unsigned int end) { - ::qsort (array + start, end - start, sizeof (Type), Type::cmp); + ::qsort (arrayZ + start, end - start, sizeof (Type), Type::cmp); } template <typename T> inline Type *lsearch (const T &x) { for (unsigned int i = 0; i < len; i++) - if (0 == this->array[i].cmp (&x)) - return &array[i]; + if (0 == this->arrayZ[i].cmp (&x)) + return &arrayZ[i]; return nullptr; } @@ -661,13 +789,13 @@ inline Type *bsearch (const T &x) { unsigned int i; - return bfind (x, &i) ? &array[i] : nullptr; + return bfind (x, &i) ? &arrayZ[i] : nullptr; } template <typename T> inline const Type *bsearch (const T &x) const { unsigned int i; - return bfind (x, &i) ? &array[i] : nullptr; + return bfind (x, &i) ? &arrayZ[i] : nullptr; } template <typename T> inline bool bfind (const T &x, unsigned int *i) const @@ -676,7 +804,7 @@ while (min <= max) { int mid = (min + max) / 2; - int c = this->array[mid].cmp (&x); + int c = this->arrayZ[mid].cmp (&x); if (c < 0) max = mid - 1; else if (c > 0) @@ -687,34 +815,39 @@ return true; } } - if (max < 0 || (max < (int) this->len && this->array[max].cmp (&x) > 0)) + if (max < 0 || (max < (int) this->len && this->arrayZ[max].cmp (&x) > 0)) max++; *i = max; return false; } - inline void finish (void) + inline void fini (void) { - if (array != static_array) - free (array); - array = nullptr; + if (arrayZ != static_array) + free (arrayZ); + arrayZ = nullptr; allocated = len = 0; } }; template <typename Type> -struct hb_auto_array_t : hb_prealloced_array_t <Type> +struct hb_auto_t : Type { - hb_auto_array_t (void) { hb_prealloced_array_t<Type>::init (); } - ~hb_auto_array_t (void) { hb_prealloced_array_t<Type>::finish (); } + hb_auto_t (void) { Type::init (); } + ~hb_auto_t (void) { Type::fini (); } + private: /* Hide */ + void init (void) {} + void fini (void) {} }; +template <typename Type> +struct hb_auto_array_t : hb_auto_t <hb_vector_t <Type> > {}; #define HB_LOCKABLE_SET_INIT {HB_PREALLOCED_ARRAY_INIT} template <typename item_t, typename lock_t> struct hb_lockable_set_t { - hb_prealloced_array_t <item_t, 1> items; + hb_vector_t <item_t, 1> items; inline void init (void) { items.init (); } @@ -728,16 +861,14 @@ item_t old = *item; *item = v; l.unlock (); - old.finish (); + old.fini (); } else { item = nullptr; l.unlock (); } } else { - item = items.push (); - if (likely (item)) - *item = v; + item = items.push (v); l.unlock (); } return item; @@ -753,7 +884,7 @@ *item = items[items.len - 1]; items.pop (); l.unlock (); - old.finish (); + old.fini (); } else { l.unlock (); } @@ -776,19 +907,17 @@ l.lock (); item_t *item = items.find (v); if (!item) { - item = items.push (); - if (likely (item)) - *item = v; + item = items.push (v); } l.unlock (); return item; } - inline void finish (lock_t &l) + inline void fini (lock_t &l) { if (!items.len) { /* No need for locking. */ - items.finish (); + items.fini (); return; } l.lock (); @@ -796,10 +925,10 @@ item_t old = items[items.len - 1]; items.pop (); l.unlock (); - old.finish (); + old.fini (); l.lock (); } - items.finish (); + items.fini (); l.unlock (); } @@ -826,7 +955,7 @@ * light-weight) to be enabled, then HB_DEBUG can be defined to disable * the costlier checks. */ #ifdef NDEBUG -#define HB_NDEBUG +#define HB_NDEBUG 1 #endif @@ -975,19 +1104,35 @@ template <typename T> static void process (T &o, const T &a, const T &b) { o = a ^ b; } }; + +/* Compiler-assisted vectorization. */ + +/* The `vector_size' attribute was introduced in gcc 3.1. */ +#if defined( __GNUC__ ) && ( __GNUC__ >= 4 ) +#define HB_VECTOR_SIZE 128 +#elif !defined(HB_VECTOR_SIZE) +#define HB_VECTOR_SIZE 0 +#endif + /* Type behaving similar to vectorized vars defined using __attribute__((vector_size(...))). */ template <typename elt_t, unsigned int byte_size> struct hb_vector_size_t { - elt_t& operator [] (unsigned int i) { return v[i]; } - const elt_t& operator [] (unsigned int i) const { return v[i]; } + elt_t& operator [] (unsigned int i) { return u.v[i]; } + const elt_t& operator [] (unsigned int i) const { return u.v[i]; } template <class Op> inline hb_vector_size_t process (const hb_vector_size_t &o) const { hb_vector_size_t r; - for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) - Op::process (r.v[i], v[i], o.v[i]); +#if HB_VECTOR_SIZE + if (HB_VECTOR_SIZE && 0 == (byte_size * 8) % HB_VECTOR_SIZE) + for (unsigned int i = 0; i < ARRAY_LENGTH (u.vec); i++) + Op::process (r.u.vec[i], u.vec[i], o.u.vec[i]); + else +#endif + for (unsigned int i = 0; i < ARRAY_LENGTH (u.v); i++) + Op::process (r.u.v[i], u.v[i], o.u.v[i]); return r; } inline hb_vector_size_t operator | (const hb_vector_size_t &o) const @@ -999,20 +1144,27 @@ inline hb_vector_size_t operator ~ () const { hb_vector_size_t r; - for (unsigned int i = 0; i < ARRAY_LENGTH (v); i++) - r.v[i] = ~v[i]; +#if HB_VECTOR_SIZE && 0 + if (HB_VECTOR_SIZE && 0 == (byte_size * 8) % HB_VECTOR_SIZE) + for (unsigned int i = 0; i < ARRAY_LENGTH (u.vec); i++) + r.u.vec[i] = ~u.vec[i]; + else +#endif + for (unsigned int i = 0; i < ARRAY_LENGTH (u.v); i++) + r.u.v[i] = ~u.v[i]; return r; } private: static_assert (byte_size / sizeof (elt_t) * sizeof (elt_t) == byte_size, ""); - elt_t v[byte_size / sizeof (elt_t)]; -}; - -/* The `vector_size' attribute was introduced in gcc 3.1. */ -#if defined( __GNUC__ ) && ( __GNUC__ >= 4 ) -#define HAVE_VECTOR_SIZE 1 + union { + elt_t v[byte_size / sizeof (elt_t)]; +#if HB_VECTOR_SIZE + typedef unsigned long vec_t __attribute__((vector_size (HB_VECTOR_SIZE / 8))); + vec_t vec[byte_size / sizeof (vec_t)]; #endif + } u; +}; /* Global runtime options. */ @@ -1049,12 +1201,12 @@ /* String type. */ -struct hb_string_t +struct hb_bytes_t { - inline hb_string_t (void) : bytes (nullptr), len (0) {} - inline hb_string_t (const char *bytes_, unsigned int len_) : bytes (bytes_), len (len_) {} + inline hb_bytes_t (void) : bytes (nullptr), len (0) {} + inline hb_bytes_t (const char *bytes_, unsigned int len_) : bytes (bytes_), len (len_) {} - inline int cmp (const hb_string_t &a) const + inline int cmp (const hb_bytes_t &a) const { if (len != a.len) return (int) a.len - (int) len; @@ -1063,8 +1215,8 @@ } static inline int cmp (const void *pa, const void *pb) { - hb_string_t *a = (hb_string_t *) pa; - hb_string_t *b = (hb_string_t *) pb; + hb_bytes_t *a = (hb_bytes_t *) pa; + hb_bytes_t *b = (hb_bytes_t *) pb; return b->cmp (*a); } @@ -1073,4 +1225,18 @@ }; +/* fallback for round() */ +#if !defined (HAVE_ROUND) && !defined (HAVE_DECL_ROUND) +static inline double +_hb_round (double x) +{ + if (x >= 0) + return floor (x + 0.5); + else + return ceil (x - 0.5); +} +#define round(x) _hb_round(x) +#endif + + #endif /* HB_PRIVATE_HH */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.cc 2018-07-25 15:36:46.000000000 +0000 @@ -45,18 +45,11 @@ if (!(set = hb_object_create<hb_set_t> ())) return hb_set_get_empty (); - set->init (); + set->init_shallow (); return set; } -static const hb_set_t _hb_set_nil = { - HB_OBJECT_HEADER_STATIC, - true, /* in_error */ - - {0} /* elts */ -}; - /** * hb_set_get_empty: * @@ -67,7 +60,7 @@ hb_set_t * hb_set_get_empty (void) { - return const_cast<hb_set_t *> (&_hb_set_nil); + return const_cast<hb_set_t *> (&Null(hb_set_t)); } /** @@ -95,7 +88,7 @@ { if (!hb_object_destroy (set)) return; - set->finish (); + set->fini_shallow (); free (set); } @@ -150,9 +143,9 @@ * Since: 0.9.2 **/ hb_bool_t -hb_set_allocation_successful (const hb_set_t *set HB_UNUSED) +hb_set_allocation_successful (const hb_set_t *set) { - return !set->in_error; + return set->successful; } /** @@ -274,11 +267,11 @@ /** * hb_set_is_equal: * @set: a set. - * @other: + * @other: other set. * * * - * Return value: + * Return value: %TRUE if the two sets are equal, %FALSE otherwise. * * Since: 0.9.7 **/ @@ -290,6 +283,24 @@ } /** + * hb_set_is_subset: + * @set: a set. + * @larger_set: other set. + * + * + * + * Return value: %TRUE if the @set is a subset of (or equal to) @larger_set, %FALSE otherwise. + * + * Since: 1.8.1 + **/ +hb_bool_t +hb_set_is_subset (const hb_set_t *set, + const hb_set_t *larger_set) +{ + return set->is_subset (larger_set); +} + +/** * hb_set_set: * @set: a set. * @other: diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set.h 2018-07-25 15:36:46.000000000 +0000 @@ -82,8 +82,6 @@ hb_set_has (const hb_set_t *set, hb_codepoint_t codepoint); -/* Right now limited to 16-bit integers. Eventually will do full codepoint range, sans -1 - * which we will use as a sentinel. */ HB_EXTERN void hb_set_add (hb_set_t *set, hb_codepoint_t codepoint); @@ -106,6 +104,10 @@ hb_set_is_equal (const hb_set_t *set, const hb_set_t *other); +HB_EXTERN hb_bool_t +hb_set_is_subset (const hb_set_t *set, + const hb_set_t *larger_set); + HB_EXTERN void hb_set_set (hb_set_t *set, const hb_set_t *other); diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-set-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -158,21 +158,13 @@ } typedef unsigned long long elt_t; - static const unsigned int PAGE_BITS = 1024; + static const unsigned int PAGE_BITS = 512; static_assert ((PAGE_BITS & ((PAGE_BITS) - 1)) == 0, ""); static inline unsigned int elt_get_min (const elt_t &elt) { return _hb_ctz (elt); } static inline unsigned int elt_get_max (const elt_t &elt) { return _hb_bit_storage (elt) - 1; } -#if 0 && HAVE_VECTOR_SIZE - /* The vectorized version does not work with clang as non-const - * elt() errs "non-const reference cannot bind to vector element". */ - typedef elt_t vector_t __attribute__((vector_size (PAGE_BITS / 8))); -#else typedef hb_vector_size_t<elt_t, PAGE_BITS / 8> vector_t; -#endif - - vector_t v; static const unsigned int ELT_BITS = sizeof (elt_t) * 8; static const unsigned int ELT_MASK = ELT_BITS - 1; @@ -183,34 +175,47 @@ elt_t &elt (hb_codepoint_t g) { return v[(g & MASK) / ELT_BITS]; } elt_t const &elt (hb_codepoint_t g) const { return v[(g & MASK) / ELT_BITS]; } elt_t mask (hb_codepoint_t g) const { return elt_t (1) << (g & ELT_MASK); } + + vector_t v; }; static_assert (page_t::PAGE_BITS == sizeof (page_t) * 8, ""); hb_object_header_t header; - ASSERT_POD (); - bool in_error; - hb_prealloced_array_t<page_map_t, 8> page_map; - hb_prealloced_array_t<page_t, 1> pages; + bool successful; /* Allocations successful */ + mutable unsigned int population; + hb_vector_t<page_map_t, 1> page_map; + hb_vector_t<page_t, 1> pages; - inline void init (void) + inline void init_shallow (void) { - in_error = false; + successful = true; + population = 0; page_map.init (); pages.init (); } - inline void finish (void) + inline void init (void) + { + hb_object_init (this); + init_shallow (); + } + inline void fini_shallow (void) + { + page_map.fini (); + pages.fini (); + } + inline void fini (void) { - page_map.finish (); - pages.finish (); + hb_object_fini (this); + fini_shallow (); } inline bool resize (unsigned int count) { - if (unlikely (in_error)) return false; + if (unlikely (!successful)) return false; if (!pages.resize (count) || !page_map.resize (count)) { pages.resize (page_map.len); - in_error = true; + successful = false; return false; } return true; @@ -219,7 +224,8 @@ inline void clear (void) { if (unlikely (hb_object_is_inert (this))) return; - in_error = false; + successful = true; + population = 0; page_map.resize (0); pages.resize (0); } @@ -231,17 +237,21 @@ return true; } + inline void dirty (void) { population = (unsigned int) -1; } + inline void add (hb_codepoint_t g) { - if (unlikely (in_error)) return; + if (unlikely (!successful)) return; if (unlikely (g == INVALID)) return; + dirty (); page_t *page = page_for_insert (g); if (unlikely (!page)) return; page->add (g); } inline bool add_range (hb_codepoint_t a, hb_codepoint_t b) { - if (unlikely (in_error)) return true; /* https://github.com/harfbuzz/harfbuzz/issues/657 */ + if (unlikely (!successful)) return true; /* https://github.com/harfbuzz/harfbuzz/issues/657 */ if (unlikely (a > b || a == INVALID || b == INVALID)) return false; + dirty (); unsigned int ma = get_major (a); unsigned int mb = get_major (b); if (ma == mb) @@ -269,8 +279,9 @@ template <typename T> inline void add_array (const T *array, unsigned int count, unsigned int stride=sizeof(T)) { - if (unlikely (in_error)) return; + if (unlikely (!successful)) return; if (!count) return; + dirty (); hb_codepoint_t g = *array; while (count) { @@ -294,8 +305,9 @@ template <typename T> inline bool add_sorted_array (const T *array, unsigned int count, unsigned int stride=sizeof(T)) { - if (unlikely (in_error)) return true; /* https://github.com/harfbuzz/harfbuzz/issues/657 */ + if (unlikely (!successful)) return true; /* https://github.com/harfbuzz/harfbuzz/issues/657 */ if (!count) return true; + dirty (); hb_codepoint_t g = *array; hb_codepoint_t last_g = g; while (count) @@ -321,16 +333,19 @@ inline void del (hb_codepoint_t g) { - if (unlikely (in_error)) return; + /* TODO perform op even if !successful. */ + if (unlikely (!successful)) return; page_t *p = page_for (g); if (!p) return; + dirty (); p->del (g); } inline void del_range (hb_codepoint_t a, hb_codepoint_t b) { + /* TODO perform op even if !successful. */ /* TODO Optimize, like add_range(). */ - if (unlikely (in_error)) return; + if (unlikely (!successful)) return; for (unsigned int i = a; i < b + 1; i++) del (i); } @@ -349,17 +364,20 @@ } inline void set (const hb_set_t *other) { - if (unlikely (in_error)) return; + if (unlikely (!successful)) return; unsigned int count = other->pages.len; if (!resize (count)) return; - - memcpy (pages.array, other->pages.array, count * sizeof (pages.array[0])); - memcpy (page_map.array, other->page_map.array, count * sizeof (page_map.array[0])); + population = other->population; + memcpy (pages.arrayZ, other->pages.arrayZ, count * sizeof (pages.arrayZ[0])); + memcpy (page_map.arrayZ, other->page_map.arrayZ, count * sizeof (page_map.arrayZ[0])); } inline bool is_equal (const hb_set_t *other) const { + if (get_population () != other->get_population ()) + return false; + unsigned int na = pages.len; unsigned int nb = other->pages.len; @@ -382,16 +400,31 @@ return true; } + inline bool is_subset (const hb_set_t *larger_set) const + { + if (get_population () > larger_set->get_population ()) + return false; + + hb_codepoint_t c = INVALID; + while (next (&c)) + if (!larger_set->has (c)) + return false; + + return true; + } + template <class Op> inline void process (const hb_set_t *other) { - if (unlikely (in_error)) return; + if (unlikely (!successful)) return; + + dirty (); unsigned int na = pages.len; unsigned int nb = other->pages.len; unsigned int next_page = na; - unsigned int count = 0; + unsigned int count = 0, newCount = 0; unsigned int a = 0, b = 0; for (; a < na && b < nb; ) { @@ -419,8 +452,10 @@ if (Op::passthru_right) count += nb - b; - if (!resize (count)) - return; + if (count > pages.len) + if (!resize (count)) + return; + newCount = count; /* Process in-place backward. */ a = na; @@ -473,6 +508,8 @@ page_at (count).v = other->page_at (b).v; } assert (!count); + if (pages.len > newCount) + resize (newCount); } inline void union_ (const hb_set_t *other) @@ -592,10 +629,15 @@ inline unsigned int get_population (void) const { + if (population != (unsigned int) -1) + return population; + unsigned int pop = 0; unsigned int count = pages.len; for (unsigned int i = 0; i < count; i++) pop += pages[i].get_population (); + + population = pop; return pop; } inline hb_codepoint_t get_min (void) const diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shape.cc 2018-07-25 15:36:46.000000000 +0000 @@ -51,7 +51,12 @@ static void free_static_shaper_list (void) { - free (static_shaper_list); +retry: + const char **shaper_list = (const char **) hb_atomic_ptr_get (&static_shaper_list); + if (!hb_atomic_ptr_cmpexch (&static_shaper_list, shaper_list, nullptr)) + goto retry; + + free (shaper_list); } #endif diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-shaper.cc 2018-07-25 15:36:46.000000000 +0000 @@ -44,8 +44,13 @@ static void free_static_shapers (void) { - if (unlikely (static_shapers != all_shapers)) - free ((void *) static_shapers); +retry: + hb_shaper_pair_t *shapers = (hb_shaper_pair_t *) hb_atomic_ptr_get (&static_shapers); + if (!hb_atomic_ptr_cmpexch (&static_shapers, shapers, nullptr)) + goto retry; + + if (unlikely (shapers != all_shapers)) + free ((void *) shapers); } #endif diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-static.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-static.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-static.cc 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-static.cc 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright © 2018 Google, Inc. + * + * This is part of HarfBuzz, a text shaping library. + * + * Permission is hereby granted, without written agreement and without + * license or royalty fees, to use, copy, modify, and distribute this + * software and its documentation for any purpose, provided that the + * above copyright notice and the following two paragraphs appear in + * all copies of this software. + * + * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR + * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES + * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN + * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH + * DAMAGE. + * + * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, + * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS + * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO + * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. + * + * Google Author(s): Behdad Esfahbod + */ + +#include "hb-private.hh" + +#ifndef HB_NO_VISIBILITY +void * const _hb_NullPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; +/*thread_local*/ void * _hb_CrapPool[HB_NULL_POOL_SIZE / sizeof (void *)] = {}; +#endif diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-string-array.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-string-array.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-string-array.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-string-array.hh 2018-07-25 15:36:46.000000000 +0000 @@ -42,7 +42,7 @@ struct { /* I like to avoid storing the nul-termination byte since we don't need it, * but C++ does not allow that. - * https://stackoverflow.com/questions/28433862/why-initializer-string-for-array-of-chars-is-too-long-compiles-fine-in-c-not + * https://stackoverflow.com/q/28433862 */ #define _S(s) char HB_PASTE (str, __LINE__)[sizeof (s)]; #include HB_STRING_ARRAY_LIST @@ -66,12 +66,12 @@ sizeof (HB_STRING_ARRAY_TYPE_NAME) }; -static inline hb_string_t +static inline hb_bytes_t HB_STRING_ARRAY_NAME (unsigned int i) { assert (i < ARRAY_LENGTH (HB_STRING_ARRAY_OFFS_NAME) - 1); - return hb_string_t (HB_STRING_ARRAY_POOL_NAME.str + HB_STRING_ARRAY_OFFS_NAME[i], - HB_STRING_ARRAY_OFFS_NAME[i + 1] - HB_STRING_ARRAY_OFFS_NAME[i] - 1); + return hb_bytes_t (HB_STRING_ARRAY_POOL_NAME.str + HB_STRING_ARRAY_OFFS_NAME[i], + HB_STRING_ARRAY_OFFS_NAME[i + 1] - HB_STRING_ARRAY_OFFS_NAME[i] - 1); } #undef HB_STRING_ARRAY_TYPE_NAME diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset.h 2018-07-25 15:36:46.000000000 +0000 @@ -71,13 +71,19 @@ HB_EXTERN hb_bool_t * hb_subset_input_drop_hints (hb_subset_input_t *subset_input); -/* hb_subset() */ +HB_EXTERN hb_bool_t * +hb_subset_input_drop_ot_layout (hb_subset_input_t *subset_input); +/* hb_subset() */ HB_EXTERN hb_face_t * hb_subset (hb_face_t *source, hb_subset_profile_t *profile, hb_subset_input_t *input); +/* hb_subset_get_all_codepoints */ +HB_EXTERN void +hb_subset_get_all_codepoints (hb_face_t *source, hb_set_t *out); + HB_END_DECLS #endif /* HB_SUBSET_H */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset-plan.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset-plan.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset-plan.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset-plan.hh 2018-07-25 15:36:46.000000000 +0000 @@ -30,31 +30,68 @@ #include "hb-private.hh" #include "hb-subset.h" +#include "hb-subset-private.hh" #include "hb-object-private.hh" +#include "hb-map-private.hh" -struct hb_subset_plan_t { +struct hb_subset_plan_t +{ hb_object_header_t header; ASSERT_POD (); hb_bool_t drop_hints; + hb_bool_t drop_ot_layout; - // TODO(Q1) actual map, drop this crap - // Look at me ma, I'm a poor mans map codepoint : new gid - // codepoints is sorted and aligned with gids_to_retain. - - // These first two lists provide a mapping from cp -> gid - // As a result it does not list the full set of glyphs to retain. - hb_prealloced_array_t<hb_codepoint_t> codepoints; - hb_prealloced_array_t<hb_codepoint_t> gids_to_retain; + // For each cp that we'd like to retain maps to the corresponding gid. + hb_set_t *unicodes; // This list contains the complete set of glyphs to retain and may contain // more glyphs then the lists above. - hb_prealloced_array_t<hb_codepoint_t> gids_to_retain_sorted; + hb_vector_t<hb_codepoint_t> glyphs; + + hb_map_t *codepoint_to_glyph; + hb_map_t *glyph_map; // Plan is only good for a specific source/dest so keep them with it hb_face_t *source; hb_face_t *dest; + + inline hb_bool_t + new_gid_for_codepoint (hb_codepoint_t codepoint, + hb_codepoint_t *new_gid) const + { + hb_codepoint_t old_gid = codepoint_to_glyph->get (codepoint); + if (old_gid == HB_MAP_VALUE_INVALID) + return false; + + return new_gid_for_old_gid (old_gid, new_gid); + } + + inline hb_bool_t + new_gid_for_old_gid (hb_codepoint_t old_gid, + hb_codepoint_t *new_gid) const + { + hb_codepoint_t gid = glyph_map->get (old_gid); + if (gid == HB_MAP_VALUE_INVALID) + return false; + + *new_gid = gid; + return true; + } + + inline hb_bool_t + add_table (hb_tag_t tag, + hb_blob_t *contents) + { + hb_blob_t *source_blob = source->reference_table (tag); + DEBUG_MSG(SUBSET, nullptr, "add table %c%c%c%c, dest %d bytes, source %d bytes", + HB_UNTAG(tag), + hb_blob_get_length (contents), + hb_blob_get_length (source_blob)); + hb_blob_destroy (source_blob); + return hb_subset_face_add_table(dest, tag, contents); + } }; typedef struct hb_subset_plan_t hb_subset_plan_t; @@ -64,21 +101,6 @@ hb_subset_profile_t *profile, hb_subset_input_t *input); -HB_INTERNAL hb_bool_t -hb_subset_plan_new_gid_for_old_id(hb_subset_plan_t *plan, - hb_codepoint_t old_gid, - hb_codepoint_t *new_gid /* OUT */); - -HB_INTERNAL hb_bool_t -hb_subset_plan_new_gid_for_codepoint(hb_subset_plan_t *plan, - hb_codepoint_t codepont, - hb_codepoint_t *new_gid /* OUT */); - -HB_INTERNAL hb_bool_t -hb_subset_plan_add_table(hb_subset_plan_t *plan, - hb_tag_t tag, - hb_blob_t *contents); - HB_INTERNAL void hb_subset_plan_destroy (hb_subset_plan_t *plan); diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-subset-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -44,6 +44,7 @@ hb_set_t *glyphs; hb_bool_t drop_hints; + hb_bool_t drop_ot_layout; /* TODO * * features diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn_db.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn_db.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn_db.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn_db.h 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,6 @@ /* this file was generated by makeunicodedata.py 3.2 */ -#define UNIDATA_VERSION "10.0.0" +#define UNIDATA_VERSION "11.0.0" /* a list of unique database records */ static const UCDRecord ucd_records[] = { {2, 0, 18, 5, 102, 39}, @@ -185,6 +185,7 @@ {21, 0, 18, 5, 65, 12}, {21, 0, 18, 5, 65, 8}, {21, 0, 18, 5, 65, 6}, + {23, 0, 3, 5, 65, 9}, {7, 0, 3, 5, 81, 12}, {12, 230, 13, 5, 81, 21}, {6, 0, 3, 5, 81, 12}, @@ -217,12 +218,14 @@ {26, 0, 0, 5, 10, 12}, {23, 0, 10, 5, 10, 9}, {21, 0, 0, 5, 10, 12}, + {12, 230, 13, 5, 10, 21}, {12, 0, 13, 5, 11, 21}, {10, 0, 0, 5, 11, 21}, {7, 0, 0, 5, 11, 12}, {12, 7, 13, 5, 11, 21}, {12, 9, 13, 5, 11, 21}, {13, 0, 0, 5, 11, 11}, + {21, 0, 0, 5, 11, 12}, {12, 0, 13, 5, 12, 21}, {10, 0, 0, 5, 12, 21}, {7, 0, 0, 5, 12, 12}, @@ -259,6 +262,7 @@ {7, 0, 0, 5, 16, 12}, {12, 0, 13, 5, 16, 21}, {10, 0, 0, 5, 16, 21}, + {21, 0, 0, 5, 16, 18}, {12, 7, 13, 5, 16, 21}, {12, 0, 0, 5, 16, 21}, {12, 9, 13, 5, 16, 21}, @@ -328,7 +332,7 @@ {12, 220, 13, 5, 22, 36}, {26, 0, 0, 5, 22, 36}, {9, 0, 0, 5, 23, 12}, - {7, 0, 0, 5, 23, 12}, + {5, 0, 0, 5, 23, 12}, {21, 0, 0, 5, 0, 12}, {6, 0, 0, 5, 23, 12}, {7, 0, 0, 2, 24, 25}, @@ -547,7 +551,6 @@ {21, 0, 18, 5, 54, 6}, {21, 0, 18, 5, 54, 17}, {15, 0, 18, 5, 54, 12}, - {5, 0, 0, 5, 23, 12}, {7, 0, 0, 5, 57, 12}, {6, 0, 0, 5, 57, 12}, {21, 0, 0, 5, 57, 17}, @@ -803,7 +806,17 @@ {9, 0, 3, 5, 130, 12}, {5, 0, 3, 5, 130, 12}, {15, 0, 3, 5, 130, 12}, + {7, 0, 4, 5, 144, 12}, + {12, 230, 13, 5, 144, 21}, + {13, 0, 11, 5, 144, 11}, {15, 0, 11, 5, 6, 12}, + {7, 0, 3, 5, 147, 12}, + {15, 0, 3, 5, 147, 12}, + {7, 0, 4, 5, 148, 12}, + {12, 220, 13, 5, 148, 21}, + {12, 230, 13, 5, 148, 21}, + {15, 0, 4, 5, 148, 12}, + {21, 0, 4, 5, 148, 12}, {10, 0, 0, 5, 93, 21}, {12, 0, 13, 5, 93, 21}, {7, 0, 0, 5, 93, 12}, @@ -861,6 +874,7 @@ {12, 0, 13, 5, 107, 21}, {10, 0, 0, 5, 107, 21}, {7, 0, 0, 5, 107, 12}, + {12, 7, 13, 5, 40, 21}, {12, 7, 13, 5, 107, 21}, {10, 9, 0, 5, 107, 21}, {12, 230, 13, 5, 107, 21}, @@ -872,6 +886,7 @@ {21, 0, 0, 5, 135, 17}, {21, 0, 0, 5, 135, 12}, {13, 0, 0, 5, 135, 11}, + {12, 230, 13, 5, 135, 21}, {7, 0, 0, 5, 124, 12}, {10, 0, 0, 5, 124, 21}, {12, 0, 13, 5, 124, 21}, @@ -910,6 +925,12 @@ {15, 0, 0, 5, 126, 36}, {21, 0, 0, 5, 126, 17}, {26, 0, 0, 5, 126, 36}, + {7, 0, 0, 5, 142, 12}, + {10, 0, 0, 5, 142, 21}, + {12, 0, 13, 5, 142, 21}, + {12, 9, 13, 5, 142, 21}, + {12, 7, 13, 5, 142, 21}, + {21, 0, 0, 5, 142, 12}, {9, 0, 0, 5, 125, 12}, {5, 0, 0, 5, 125, 12}, {13, 0, 0, 5, 125, 11}, @@ -917,8 +938,9 @@ {7, 0, 0, 5, 125, 12}, {7, 0, 0, 5, 141, 12}, {12, 0, 13, 5, 141, 21}, - {10, 0, 0, 5, 141, 21}, + {12, 0, 0, 5, 141, 21}, {12, 9, 13, 5, 141, 21}, + {10, 0, 0, 5, 141, 21}, {21, 0, 0, 5, 141, 18}, {21, 0, 0, 5, 141, 12}, {21, 0, 0, 5, 141, 17}, @@ -946,6 +968,15 @@ {12, 7, 13, 5, 138, 21}, {12, 9, 13, 5, 138, 21}, {13, 0, 0, 5, 138, 11}, + {7, 0, 0, 5, 143, 12}, + {10, 0, 0, 5, 143, 21}, + {12, 0, 13, 5, 143, 21}, + {12, 9, 13, 5, 143, 21}, + {13, 0, 0, 5, 143, 11}, + {7, 0, 0, 5, 145, 12}, + {12, 0, 13, 5, 145, 21}, + {10, 0, 0, 5, 145, 21}, + {21, 0, 0, 5, 145, 12}, {7, 0, 0, 5, 62, 12}, {14, 0, 0, 5, 62, 12}, {21, 0, 0, 5, 62, 17}, @@ -969,6 +1000,11 @@ {6, 0, 0, 5, 119, 12}, {13, 0, 0, 5, 119, 11}, {15, 0, 0, 5, 119, 12}, + {9, 0, 0, 5, 146, 12}, + {5, 0, 0, 5, 146, 12}, + {15, 0, 0, 5, 146, 12}, + {21, 0, 0, 5, 146, 17}, + {21, 0, 0, 5, 146, 12}, {7, 0, 0, 5, 98, 12}, {10, 0, 0, 5, 98, 21}, {12, 0, 13, 5, 98, 21}, @@ -1001,6 +1037,9 @@ {12, 7, 13, 5, 132, 21}, {13, 0, 3, 5, 132, 11}, {21, 0, 3, 5, 132, 0}, + {15, 0, 4, 5, 0, 12}, + {26, 0, 4, 5, 0, 10}, + {23, 0, 4, 5, 0, 10}, {2, 0, 18, 5, 102, 14}, {26, 0, 0, 2, 0, 29}, {26, 0, 0, 5, 0, 28}, @@ -1009,7 +1048,7 @@ {26, 0, 18, 5, 0, 5}, }; -#define BIDI_MIRROR_LEN 364 +#define BIDI_MIRROR_LEN 420 static const MirrorPair mirror_pairs[] = { {40, 41}, {41, 40}, @@ -1042,9 +1081,16 @@ {8716, 8713}, {8717, 8714}, {8725, 10741}, + {8735, 11262}, + {8736, 10659}, + {8737, 10651}, + {8738, 10656}, + {8740, 10990}, {8764, 8765}, {8765, 8764}, {8771, 8909}, + {8773, 8780}, + {8780, 8773}, {8786, 8787}, {8787, 8786}, {8788, 8789}, @@ -1106,6 +1152,7 @@ {8885, 8884}, {8886, 8887}, {8887, 8886}, + {8888, 10204}, {8905, 8906}, {8906, 8905}, {8907, 8908}, @@ -1179,6 +1226,7 @@ {10189, 10187}, {10197, 10198}, {10198, 10197}, + {10204, 8888}, {10205, 10206}, {10206, 10205}, {10210, 10211}, @@ -1217,6 +1265,19 @@ {10646, 10645}, {10647, 10648}, {10648, 10647}, + {10651, 8737}, + {10656, 8738}, + {10659, 8736}, + {10660, 10661}, + {10661, 10660}, + {10664, 10665}, + {10665, 10664}, + {10666, 10667}, + {10667, 10666}, + {10668, 10669}, + {10669, 10668}, + {10670, 10671}, + {10671, 10670}, {10680, 8856}, {10688, 10689}, {10689, 10688}, @@ -1232,6 +1293,8 @@ {10713, 10712}, {10714, 10715}, {10715, 10714}, + {10728, 10729}, + {10729, 10728}, {10741, 8725}, {10744, 10745}, {10745, 10744}, @@ -1249,6 +1312,8 @@ {10853, 10852}, {10873, 10874}, {10874, 10873}, + {10875, 10876}, + {10876, 10875}, {10877, 10878}, {10878, 10877}, {10879, 10880}, @@ -1257,8 +1322,18 @@ {10882, 10881}, {10883, 10884}, {10884, 10883}, + {10885, 10886}, + {10886, 10885}, + {10887, 10888}, + {10888, 10887}, + {10889, 10890}, + {10890, 10889}, {10891, 10892}, {10892, 10891}, + {10893, 10894}, + {10894, 10893}, + {10895, 10896}, + {10896, 10895}, {10897, 10898}, {10898, 10897}, {10899, 10900}, @@ -1271,6 +1346,10 @@ {10906, 10905}, {10907, 10908}, {10908, 10907}, + {10909, 10910}, + {10910, 10909}, + {10911, 10912}, + {10912, 10911}, {10913, 10914}, {10914, 10913}, {10918, 10919}, @@ -1283,8 +1362,16 @@ {10925, 10924}, {10927, 10928}, {10928, 10927}, + {10929, 10930}, + {10930, 10929}, {10931, 10932}, {10932, 10931}, + {10933, 10934}, + {10934, 10933}, + {10935, 10936}, + {10936, 10935}, + {10937, 10938}, + {10938, 10937}, {10939, 10940}, {10940, 10939}, {10941, 10942}, @@ -1297,6 +1384,12 @@ {10948, 10947}, {10949, 10950}, {10950, 10949}, + {10951, 10952}, + {10952, 10951}, + {10953, 10954}, + {10954, 10953}, + {10955, 10956}, + {10956, 10955}, {10957, 10958}, {10958, 10957}, {10959, 10960}, @@ -1313,10 +1406,12 @@ {10981, 8875}, {10988, 10989}, {10989, 10988}, + {10990, 8740}, {10999, 11000}, {11000, 10999}, {11001, 11002}, {11002, 11001}, + {11262, 8735}, {11778, 11779}, {11779, 11778}, {11780, 11781}, @@ -1910,6 +2005,13 @@ #define UCDN_SCRIPT_NUSHU 139 #define UCDN_SCRIPT_SOYOMBO 140 #define UCDN_SCRIPT_ZANABAZAR_SQUARE 141 +#define UCDN_SCRIPT_DOGRA 142 +#define UCDN_SCRIPT_GUNJALA_GONDI 143 +#define UCDN_SCRIPT_HANIFI_ROHINGYA 144 +#define UCDN_SCRIPT_MAKASAR 145 +#define UCDN_SCRIPT_MEDEFAIDRIN 146 +#define UCDN_SCRIPT_OLD_SOGDIAN 147 +#define UCDN_SCRIPT_SOGDIAN 148 #define UCDN_GENERAL_CATEGORY_CC 0 #define UCDN_GENERAL_CATEGORY_CF 1 @@ -1984,22 +2086,24 @@ 66, 67, 68, 69, 70, 71, 65, 66, 67, 68, 69, 70, 71, 65, 72, 73, 73, 73, 73, 73, 73, 73, 73, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 52, 75, 76, 77, 78, 79, - 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 94, 96, - 97, 98, 99, 100, 101, 102, 103, 104, 94, 105, 94, 106, 107, 94, 94, 108, - 108, 108, 109, 110, 111, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 112, - 112, 113, 114, 115, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 116, 117, 118, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 119, 119, 120, 121, 94, 94, 94, 122, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, 123, - 123, 123, 123, 123, 124, 123, 123, 125, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 126, 127, 128, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 129, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 130, 131, 132, 133, 134, 135, 136, 137, - 138, 138, 139, 94, 94, 94, 94, 94, 140, 94, 94, 94, 94, 94, 94, 94, 141, - 142, 94, 94, 94, 94, 143, 94, 144, 145, 146, 147, 148, 149, 150, 151, - 152, 153, 154, 154, 154, 154, 154, 155, 52, 52, 52, 52, 52, 52, 52, 52, + 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, + 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 106, 108, 109, 110, 106, + 111, 111, 111, 112, 113, 114, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 115, 115, 116, 117, 118, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 119, 120, 121, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 122, 122, 123, 124, 106, 106, 125, 126, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 128, 127, 127, 129, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 130, 131, 132, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 133, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 134, 135, 136, 137, 138, 139, + 140, 141, 142, 142, 143, 106, 106, 106, 106, 106, 144, 106, 106, 106, + 106, 106, 106, 106, 145, 146, 106, 106, 147, 106, 148, 106, 149, 150, + 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 160, 160, 160, 161, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, @@ -2008,187 +2112,232 @@ 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 156, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 157, 158, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, - 159, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, - 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 160, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 52, 52, 162, 161, 161, 161, 161, 163, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, 161, - 161, 161, 161, 163, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 164, 165, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, - 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 94, 74, 74, 74, 74, 74, + 52, 52, 52, 162, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 163, 164, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 165, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52, + 166, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 52, 52, + 168, 167, 167, 167, 167, 169, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 169, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 170, 171, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, + 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 106, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, @@ -2202,8 +2351,8 @@ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 166, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, + 172, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, @@ -2217,7 +2366,7 @@ 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, 74, - 74, 74, 166, + 74, 74, 74, 74, 172, }; static const unsigned short index1[] = { @@ -2230,391 +2379,405 @@ 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 97, 97, 97, 98, 98, 98, 98, 99, 100, 101, 101, 101, 101, 102, 103, 101, 101, 101, 101, 101, 101, 104, 105, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 106, 107, 107, 107, 108, 109, 110, 111, - 111, 111, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 121, - 121, 122, 123, 120, 124, 125, 126, 127, 128, 128, 128, 128, 129, 130, - 131, 132, 133, 134, 135, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 145, 145, - 146, 147, 148, 149, 128, 128, 128, 128, 128, 128, 150, 150, 150, 150, - 151, 152, 153, 120, 154, 155, 156, 156, 156, 157, 158, 159, 160, 160, - 161, 162, 163, 164, 165, 166, 167, 167, 167, 168, 145, 169, 120, 120, - 120, 120, 120, 120, 128, 128, 170, 171, 120, 120, 172, 126, 173, 174, - 175, 176, 177, 178, 178, 178, 178, 178, 178, 179, 180, 181, 182, 178, - 183, 184, 185, 178, 186, 187, 188, 189, 189, 190, 191, 192, 193, 194, - 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 204, 205, 206, 207, - 208, 209, 210, 211, 212, 213, 214, 120, 215, 216, 217, 218, 218, 219, - 220, 221, 222, 223, 224, 120, 225, 226, 227, 228, 229, 230, 231, 232, - 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 120, 243, 244, - 245, 246, 247, 244, 248, 249, 250, 251, 252, 120, 253, 254, 255, 256, - 257, 258, 259, 260, 260, 259, 260, 261, 262, 263, 264, 265, 266, 267, - 120, 268, 269, 270, 271, 272, 272, 271, 273, 274, 275, 276, 277, 278, - 279, 280, 281, 120, 282, 283, 284, 285, 285, 285, 285, 286, 287, 288, - 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 296, 296, 299, 300, - 297, 301, 302, 303, 304, 305, 306, 120, 307, 308, 308, 308, 308, 308, - 309, 310, 311, 312, 313, 314, 120, 120, 120, 120, 315, 316, 317, 318, - 319, 320, 321, 322, 323, 324, 325, 326, 120, 120, 120, 120, 327, 328, - 329, 330, 331, 332, 333, 334, 335, 336, 335, 335, 335, 337, 338, 339, - 340, 341, 342, 343, 342, 342, 342, 344, 345, 346, 347, 348, 120, 120, - 120, 120, 349, 349, 349, 349, 349, 350, 351, 352, 353, 354, 355, 356, - 357, 358, 359, 349, 360, 361, 353, 362, 363, 363, 363, 363, 364, 365, - 366, 366, 366, 366, 366, 367, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 368, 368, 369, 369, 369, 369, 369, 369, 369, 369, 369, 370, - 370, 370, 370, 370, 370, 370, 370, 370, 370, 370, 371, 371, 371, 371, - 371, 371, 371, 371, 371, 372, 373, 372, 371, 371, 371, 371, 371, 372, - 371, 371, 371, 371, 372, 373, 372, 371, 373, 371, 371, 371, 371, 371, - 371, 371, 372, 371, 371, 371, 371, 371, 371, 371, 371, 374, 375, 376, - 377, 378, 371, 371, 379, 380, 381, 381, 381, 381, 381, 381, 381, 381, - 381, 381, 382, 383, 384, 385, 385, 385, 385, 385, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, - 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 385, 386, 385, 385, - 387, 388, 388, 389, 390, 390, 390, 390, 390, 390, 390, 390, 390, 391, - 392, 393, 394, 395, 396, 120, 397, 397, 398, 120, 399, 399, 400, 120, - 401, 402, 403, 120, 404, 404, 404, 404, 404, 404, 405, 406, 407, 408, - 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 419, 419, 419, 419, - 420, 419, 419, 419, 419, 419, 419, 120, 421, 419, 419, 419, 419, 422, - 385, 385, 385, 385, 385, 385, 385, 385, 423, 120, 424, 424, 424, 425, - 426, 427, 428, 429, 430, 431, 432, 432, 432, 433, 434, 120, 435, 435, + 101, 101, 101, 101, 101, 101, 106, 107, 107, 107, 108, 109, 110, 110, + 110, 110, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 120, + 120, 121, 122, 119, 123, 124, 125, 126, 127, 127, 127, 127, 128, 129, + 130, 131, 132, 133, 134, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 144, 144, + 145, 146, 147, 148, 127, 127, 127, 127, 127, 127, 149, 149, 149, 149, + 150, 151, 152, 119, 153, 154, 155, 155, 155, 156, 157, 158, 159, 159, + 160, 161, 162, 163, 164, 165, 166, 166, 166, 167, 144, 168, 119, 119, + 119, 119, 119, 119, 127, 127, 169, 170, 119, 119, 171, 125, 172, 173, + 174, 175, 176, 177, 177, 177, 177, 177, 177, 178, 179, 180, 181, 177, + 182, 183, 184, 177, 185, 186, 187, 188, 188, 189, 190, 191, 192, 193, + 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 203, 204, 205, 206, + 207, 208, 209, 210, 211, 212, 213, 119, 214, 215, 216, 217, 217, 218, + 219, 220, 221, 222, 223, 119, 224, 225, 226, 227, 228, 229, 230, 231, + 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 119, 242, 243, + 244, 245, 246, 243, 247, 248, 249, 250, 251, 119, 252, 253, 254, 255, + 256, 257, 258, 259, 259, 258, 259, 260, 261, 262, 263, 264, 265, 266, + 119, 267, 268, 269, 270, 271, 271, 270, 272, 273, 274, 275, 276, 277, + 278, 279, 280, 119, 281, 282, 283, 284, 284, 284, 284, 285, 286, 287, + 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 295, 295, 298, 299, + 296, 300, 301, 302, 303, 304, 305, 119, 306, 307, 307, 307, 307, 307, + 308, 309, 310, 311, 312, 313, 119, 119, 119, 119, 314, 315, 316, 317, + 318, 319, 320, 321, 322, 323, 324, 325, 119, 119, 119, 119, 326, 327, + 328, 329, 330, 331, 332, 333, 334, 335, 334, 334, 334, 336, 337, 338, + 339, 340, 341, 342, 341, 341, 341, 343, 344, 345, 346, 347, 119, 119, + 119, 119, 348, 348, 348, 348, 348, 349, 350, 351, 352, 353, 354, 355, + 356, 357, 358, 348, 359, 360, 352, 361, 362, 362, 362, 362, 363, 364, + 365, 365, 365, 365, 365, 366, 367, 367, 367, 367, 367, 367, 367, 367, + 367, 367, 367, 367, 368, 368, 368, 368, 368, 368, 368, 368, 368, 369, + 369, 369, 369, 369, 369, 369, 369, 369, 369, 369, 370, 370, 370, 370, + 370, 370, 370, 370, 370, 371, 372, 371, 370, 370, 370, 370, 370, 371, + 370, 370, 370, 370, 371, 372, 371, 370, 372, 370, 370, 370, 370, 370, + 370, 370, 371, 370, 370, 370, 370, 370, 370, 370, 370, 373, 374, 375, + 376, 377, 370, 370, 378, 379, 380, 380, 380, 380, 380, 380, 380, 380, + 380, 380, 381, 382, 383, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, + 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 384, 385, 384, 384, + 386, 387, 387, 388, 389, 389, 389, 389, 389, 389, 389, 389, 389, 390, + 391, 392, 393, 394, 395, 119, 396, 396, 397, 119, 398, 398, 399, 119, + 400, 401, 402, 119, 403, 403, 403, 403, 403, 403, 404, 405, 406, 407, + 408, 409, 410, 411, 412, 413, 414, 415, 416, 417, 418, 418, 418, 418, + 419, 418, 418, 418, 418, 418, 418, 420, 421, 418, 418, 418, 418, 422, + 384, 384, 384, 384, 384, 384, 384, 384, 423, 119, 424, 424, 424, 425, + 426, 427, 428, 429, 430, 431, 432, 432, 432, 433, 434, 119, 435, 435, 435, 435, 435, 436, 435, 435, 435, 437, 438, 439, 440, 440, 440, 440, 441, 441, 442, 443, 444, 444, 444, 444, 444, 444, 445, 446, 447, 448, - 449, 450, 451, 452, 451, 452, 453, 454, 455, 456, 120, 120, 120, 120, - 120, 120, 120, 120, 457, 458, 458, 458, 458, 458, 459, 460, 461, 462, + 449, 450, 451, 452, 451, 452, 453, 454, 455, 456, 119, 119, 119, 119, + 119, 119, 119, 119, 457, 458, 458, 458, 458, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 470, 470, 470, 471, 472, 473, 474, 475, 475, 475, 475, 476, 477, 478, 479, 480, 480, 480, 480, 481, 482, - 483, 484, 485, 486, 487, 488, 489, 489, 489, 490, 100, 491, 120, 120, - 120, 120, 120, 120, 492, 120, 493, 494, 495, 496, 497, 498, 54, 54, 54, - 54, 499, 500, 56, 56, 56, 56, 56, 501, 502, 503, 54, 504, 54, 54, 54, - 505, 56, 56, 56, 506, 507, 508, 509, 510, 510, 510, 511, 512, 27, 27, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 513, 514, 27, - 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 515, 516, 517, 518, 515, 516, - 515, 516, 517, 518, 515, 519, 515, 516, 515, 517, 515, 520, 515, 520, - 515, 520, 521, 522, 523, 524, 525, 526, 515, 527, 528, 529, 530, 531, - 532, 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, - 546, 547, 56, 548, 549, 550, 551, 552, 553, 553, 554, 555, 556, 557, 558, - 120, 559, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, - 572, 571, 573, 574, 575, 576, 577, 578, 579, 580, 581, 580, 582, 583, - 580, 584, 580, 585, 586, 587, 588, 589, 590, 591, 592, 593, 594, 586, - 595, 596, 586, 597, 598, 586, 586, 598, 586, 599, 600, 599, 586, 586, - 601, 586, 586, 586, 586, 586, 602, 586, 586, 580, 603, 604, 605, 606, - 607, 608, 609, 609, 609, 609, 609, 609, 609, 609, 610, 580, 580, 611, - 612, 586, 586, 613, 580, 580, 580, 580, 585, 606, 614, 615, 580, 580, - 580, 580, 580, 616, 120, 120, 120, 580, 617, 120, 120, 618, 618, 618, - 618, 618, 619, 619, 620, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 622, 618, 623, 624, 624, 624, 624, 624, 624, 624, 624, 624, 625, 624, - 624, 624, 624, 626, 580, 624, 624, 627, 580, 628, 629, 630, 631, 632, - 633, 629, 580, 627, 634, 580, 635, 636, 637, 638, 639, 580, 580, 580, - 640, 641, 642, 643, 580, 644, 645, 580, 646, 580, 580, 647, 648, 649, - 650, 580, 651, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 580, - 580, 580, 662, 580, 663, 580, 664, 665, 666, 667, 668, 669, 618, 670, - 670, 671, 580, 580, 580, 662, 672, 673, 586, 586, 586, 674, 675, 586, - 586, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, 676, - 676, 676, 676, 676, 676, 586, 586, 586, 586, 586, 586, 586, 586, 586, - 586, 586, 586, 586, 586, 586, 586, 677, 678, 678, 679, 586, 586, 586, - 586, 586, 586, 586, 680, 586, 586, 586, 681, 586, 586, 586, 586, 586, - 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, - 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 580, - 580, 580, 682, 580, 580, 586, 586, 683, 684, 685, 629, 580, 580, 686, - 580, 580, 580, 687, 580, 580, 580, 580, 688, 580, 689, 617, 120, 120, - 690, 120, 120, 691, 691, 691, 691, 691, 692, 693, 693, 693, 693, 693, - 694, 695, 696, 697, 698, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, - 699, 700, 701, 702, 703, 703, 703, 703, 704, 705, 706, 706, 706, 706, - 706, 706, 706, 707, 708, 709, 371, 371, 373, 120, 373, 373, 373, 373, - 373, 373, 373, 373, 710, 710, 710, 710, 711, 712, 713, 714, 715, 716, - 717, 718, 719, 720, 120, 120, 120, 120, 120, 120, 721, 721, 721, 722, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 723, 120, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 724, 120, 120, 120, - 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 736, 737, 737, - 738, 737, 737, 737, 739, 740, 741, 742, 743, 744, 745, 745, 746, 745, - 745, 745, 747, 748, 749, 750, 751, 752, 752, 752, 752, 753, 754, 755, - 755, 755, 755, 755, 755, 755, 755, 755, 755, 756, 757, 758, 752, 752, - 752, 759, 725, 725, 725, 725, 726, 120, 760, 760, 761, 761, 761, 762, - 763, 764, 758, 758, 758, 765, 766, 767, 761, 761, 761, 768, 763, 764, - 758, 758, 758, 758, 769, 767, 758, 770, 771, 771, 771, 771, 771, 772, - 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, 771, 758, 758, 758, - 773, 774, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, 775, - 758, 758, 758, 773, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, + 483, 484, 485, 486, 487, 488, 489, 489, 489, 490, 100, 491, 362, 362, + 362, 362, 362, 492, 493, 119, 494, 495, 496, 497, 498, 499, 54, 54, 54, + 54, 500, 501, 56, 56, 56, 56, 56, 502, 503, 504, 54, 505, 54, 54, 54, + 506, 56, 56, 56, 507, 508, 509, 510, 511, 511, 511, 512, 513, 27, 27, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 514, 515, 27, + 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 516, 517, 518, 519, 516, 517, + 516, 517, 518, 519, 516, 520, 516, 517, 516, 518, 516, 521, 516, 521, + 516, 521, 522, 523, 524, 525, 526, 527, 516, 528, 529, 530, 531, 532, + 533, 534, 535, 536, 537, 538, 539, 540, 541, 542, 543, 544, 545, 546, + 547, 548, 56, 549, 550, 551, 552, 553, 554, 554, 555, 556, 557, 558, 559, + 119, 560, 561, 562, 563, 564, 565, 566, 567, 568, 569, 570, 571, 572, + 573, 572, 574, 575, 576, 577, 578, 579, 580, 581, 582, 581, 583, 584, + 581, 585, 581, 586, 587, 588, 589, 590, 591, 592, 593, 594, 595, 587, + 596, 597, 587, 598, 599, 587, 587, 599, 587, 600, 601, 600, 587, 587, + 602, 587, 587, 587, 587, 587, 603, 587, 587, 581, 604, 605, 606, 607, + 608, 609, 610, 610, 610, 610, 610, 610, 610, 610, 611, 581, 581, 612, + 613, 587, 587, 614, 581, 581, 581, 581, 586, 607, 615, 616, 581, 581, + 581, 581, 581, 617, 119, 119, 119, 581, 618, 119, 119, 619, 619, 619, + 619, 619, 620, 620, 621, 622, 622, 622, 622, 622, 622, 622, 622, 622, + 623, 619, 624, 625, 625, 625, 625, 625, 625, 625, 625, 625, 626, 625, + 625, 625, 625, 627, 581, 625, 625, 628, 581, 629, 630, 631, 632, 633, + 634, 630, 581, 628, 635, 581, 636, 637, 638, 639, 640, 581, 581, 581, + 641, 642, 643, 644, 581, 645, 646, 581, 647, 581, 581, 648, 649, 650, + 651, 581, 652, 653, 654, 655, 656, 657, 658, 659, 660, 661, 662, 581, + 581, 581, 663, 581, 664, 581, 665, 666, 667, 668, 669, 670, 619, 671, + 671, 672, 581, 581, 581, 663, 673, 674, 587, 587, 587, 675, 676, 587, + 587, 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, + 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, 677, + 677, 677, 677, 677, 677, 587, 587, 587, 587, 587, 587, 587, 587, 587, + 587, 587, 587, 587, 587, 587, 587, 678, 679, 679, 680, 587, 587, 587, + 587, 587, 587, 587, 681, 587, 587, 587, 682, 587, 587, 587, 587, 587, + 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, + 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 581, + 581, 581, 683, 581, 581, 587, 587, 684, 685, 686, 630, 581, 581, 687, + 581, 581, 581, 688, 581, 581, 581, 581, 581, 581, 689, 581, 581, 581, + 581, 581, 617, 690, 690, 690, 690, 690, 691, 692, 692, 692, 692, 692, + 693, 694, 695, 696, 697, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, 92, + 698, 699, 700, 701, 365, 365, 365, 365, 702, 703, 704, 704, 704, 704, + 704, 704, 704, 705, 706, 707, 370, 370, 372, 119, 372, 372, 372, 372, + 372, 372, 372, 372, 708, 708, 708, 708, 709, 710, 711, 712, 713, 714, + 715, 716, 717, 718, 119, 119, 119, 119, 119, 119, 719, 719, 719, 720, + 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 721, 119, 719, 719, + 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, + 719, 719, 719, 719, 719, 719, 719, 719, 719, 719, 722, 119, 119, 119, + 723, 724, 725, 726, 727, 728, 729, 730, 731, 732, 733, 734, 735, 735, + 736, 735, 735, 735, 737, 738, 739, 740, 741, 742, 743, 743, 744, 743, + 743, 743, 745, 746, 747, 748, 749, 750, 750, 750, 750, 750, 751, 752, + 752, 752, 752, 752, 752, 752, 752, 752, 752, 753, 754, 755, 750, 750, + 750, 756, 723, 723, 723, 723, 724, 119, 757, 757, 758, 758, 758, 759, + 760, 761, 755, 755, 755, 762, 763, 764, 758, 758, 758, 765, 760, 761, + 755, 755, 755, 755, 766, 764, 755, 767, 768, 768, 768, 768, 768, 769, + 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, 768, 755, 755, 755, + 770, 771, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 755, 772, + 755, 755, 755, 770, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 774, 775, 581, 581, 581, 581, 581, 581, 581, 581, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 775, 775, 776, 776, 777, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 777, 778, 580, 580, 580, 580, 580, 580, 580, 580, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 779, - 778, 778, 780, 780, 781, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 782, - 783, 783, 783, 783, 783, 783, 784, 120, 785, 785, 785, 785, 785, 786, - 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, - 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, - 787, 787, 787, 787, 787, 788, 787, 787, 789, 790, 120, 120, 101, 101, - 101, 101, 101, 791, 792, 793, 101, 101, 101, 794, 795, 795, 795, 795, - 795, 795, 795, 795, 796, 797, 798, 120, 64, 64, 799, 800, 801, 27, 802, - 27, 27, 27, 27, 27, 27, 27, 803, 804, 27, 805, 806, 27, 27, 807, 808, - 120, 120, 120, 120, 120, 120, 120, 809, 810, 811, 812, 813, 813, 814, - 815, 816, 817, 818, 818, 818, 818, 818, 818, 819, 120, 820, 821, 821, - 821, 821, 821, 822, 823, 824, 825, 826, 827, 828, 828, 829, 830, 831, - 832, 833, 833, 834, 835, 836, 836, 837, 838, 839, 840, 368, 368, 368, - 841, 842, 843, 843, 843, 843, 843, 844, 845, 846, 847, 848, 849, 850, - 349, 353, 851, 852, 852, 852, 852, 852, 853, 854, 120, 855, 856, 857, - 858, 349, 349, 859, 860, 861, 861, 861, 861, 861, 861, 862, 863, 864, - 120, 120, 865, 866, 867, 868, 120, 869, 869, 869, 120, 373, 373, 54, 54, - 54, 54, 54, 870, 871, 120, 872, 872, 872, 872, 872, 872, 872, 872, 872, - 872, 866, 866, 866, 866, 873, 874, 875, 876, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, - 878, 878, 877, 878, 878, 879, 878, 878, 878, 878, 878, 878, 877, 878, - 878, 879, 878, 878, 878, 877, 878, 878, 879, 878, 878, 878, 877, 878, - 878, 880, 120, 369, 369, 881, 882, 370, 370, 370, 370, 370, 883, 884, - 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, - 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, 884, - 884, 884, 884, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, - 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, - 885, 885, 885, 885, 885, 885, 885, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 777, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 886, 778, 778, 778, 778, 887, 120, 888, - 889, 121, 890, 891, 892, 893, 121, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 894, 895, 896, 120, 897, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 898, 120, - 120, 128, 128, 128, 128, 128, 128, 128, 128, 899, 128, 128, 128, 128, - 128, 128, 120, 120, 120, 120, 120, 128, 900, 901, 901, 902, 903, 904, - 905, 906, 907, 908, 909, 910, 911, 912, 913, 170, 128, 128, 128, 128, - 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 914, 915, - 916, 917, 918, 919, 920, 920, 921, 922, 923, 923, 924, 925, 926, 927, - 928, 928, 928, 928, 929, 930, 930, 930, 931, 932, 932, 932, 933, 934, - 935, 120, 936, 937, 938, 937, 937, 939, 937, 937, 940, 937, 941, 937, - 941, 120, 120, 120, 120, 937, 937, 937, 937, 937, 937, 937, 937, 937, - 937, 937, 937, 937, 937, 937, 942, 943, 944, 944, 944, 944, 944, 945, - 609, 946, 946, 946, 946, 946, 946, 947, 948, 949, 950, 580, 951, 952, - 120, 120, 120, 120, 120, 609, 609, 609, 609, 609, 953, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 954, - 954, 954, 955, 956, 956, 956, 956, 956, 956, 957, 120, 958, 959, 959, - 960, 961, 961, 961, 961, 962, 963, 964, 964, 965, 966, 967, 967, 967, - 967, 968, 969, 970, 970, 970, 971, 972, 972, 972, 972, 973, 972, 974, - 120, 120, 120, 120, 120, 975, 975, 975, 975, 975, 976, 976, 976, 976, - 976, 977, 977, 977, 977, 977, 977, 978, 978, 978, 979, 980, 981, 982, - 982, 982, 982, 983, 984, 984, 984, 984, 985, 986, 986, 986, 986, 986, - 120, 987, 987, 987, 987, 987, 987, 988, 989, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 990, - 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, - 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, 990, - 990, 990, 990, 990, 990, 990, 990, 990, 990, 991, 120, 990, 990, 992, - 120, 990, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 993, 994, 995, 995, 995, 995, 996, - 997, 998, 998, 999, 1000, 1001, 1001, 1002, 1003, 1004, 1004, 1004, 1005, - 1006, 1007, 120, 120, 120, 120, 120, 120, 1008, 1008, 1009, 1010, 1011, - 1011, 1012, 1013, 1014, 1014, 1014, 1015, 120, 120, 120, 120, 120, 120, - 120, 120, 1016, 1016, 1016, 1016, 1017, 1017, 1017, 1018, 1019, 1019, - 1020, 1019, 1019, 1019, 1019, 1019, 1021, 1022, 1023, 1024, 1025, 1025, - 1026, 1027, 1028, 120, 1029, 1030, 1031, 1031, 1031, 1032, 1033, 1033, - 1033, 1034, 120, 120, 120, 120, 1035, 1036, 1035, 1035, 1037, 1038, 1039, - 120, 1040, 1040, 1040, 1040, 1040, 1040, 1041, 1042, 1043, 1043, 1044, - 1045, 1046, 1046, 1047, 1048, 1049, 1049, 1050, 1051, 120, 1052, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 1053, 1053, 1053, 1053, - 1053, 1053, 1053, 1053, 1053, 1054, 120, 120, 120, 120, 120, 120, 1055, - 1055, 1055, 1055, 1055, 1055, 1056, 120, 1057, 1057, 1057, 1057, 1057, - 1057, 1058, 1059, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 1060, 1060, 1060, 1061, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1062, 1063, 1063, - 1063, 1063, 1063, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 120, - 1071, 1072, 1073, 1073, 1073, 1073, 1073, 1074, 1075, 1076, 120, 1077, - 1077, 1077, 1078, 1079, 1080, 1081, 1082, 1082, 1082, 1083, 1084, 1085, - 1086, 1087, 120, 1088, 1088, 1088, 1088, 1089, 120, 1090, 1091, 1091, - 1091, 1091, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, - 120, 1101, 1101, 1102, 1101, 1101, 1103, 1104, 1105, 120, 120, 120, 120, - 120, 120, 120, 120, 1106, 1107, 1108, 1109, 1108, 1110, 1111, 1111, 1111, - 1111, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1120, 1120, - 1121, 1122, 1123, 1124, 1125, 1126, 1127, 1128, 1129, 1129, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 1130, 1130, 1130, 1130, 1130, 1130, 1131, 1132, 1133, 1134, 1135, - 1136, 120, 120, 120, 120, 1137, 1137, 1137, 1137, 1137, 1137, 1138, 1139, - 1140, 120, 1141, 1142, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1143, 1143, 1143, 1143, - 1143, 1144, 1145, 1146, 1147, 1148, 1149, 1150, 120, 120, 120, 120, 1151, - 1151, 1151, 1151, 1151, 1151, 1152, 1153, 1154, 120, 1155, 1156, 1157, - 1158, 120, 120, 1159, 1159, 1159, 1159, 1159, 1160, 1161, 120, 1162, - 1163, 120, 120, 120, 120, 120, 120, 1164, 1164, 1164, 1165, 1166, 1167, - 1168, 1169, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 1170, 1170, 1170, 1170, 1171, 1171, 1171, 1171, 1172, - 1173, 1174, 1175, 1176, 1177, 1178, 1178, 1178, 1178, 1179, 1180, 1181, - 120, 1182, 1183, 1184, 1184, 1184, 1184, 1185, 1186, 1187, 1188, 1189, - 120, 120, 120, 1190, 1190, 1190, 1190, 1190, 1190, 1190, 1191, 1192, - 1193, 1192, 1192, 1192, 1194, 1195, 1196, 1197, 120, 1198, 1199, 1200, - 1201, 1202, 1203, 1203, 1203, 1204, 1205, 1205, 1206, 1207, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 1208, 1209, 1210, 1210, 1210, 1210, - 1211, 1212, 1213, 120, 1214, 1215, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 1216, - 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, - 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, - 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, - 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, - 1216, 1216, 1217, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, 1218, - 1218, 1218, 1219, 1220, 120, 1216, 1216, 1216, 1216, 1216, 1216, 1216, - 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, 1216, - 1216, 1216, 1216, 1216, 1216, 1221, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, - 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, - 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, - 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1223, 1222, 1222, - 1222, 1222, 1224, 1225, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, - 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, - 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1226, 1222, 1222, - 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1222, - 1222, 1222, 1222, 1222, 1222, 1222, 1222, 1227, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 1228, 1228, 1228, 1228, 1228, 1228, - 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, - 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, - 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, - 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, - 1228, 1228, 1228, 1229, 1228, 1228, 1228, 1228, 1228, 1228, 1228, 1228, - 1228, 1228, 1228, 1228, 1228, 1228, 1230, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, - 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, - 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, 795, - 1231, 1232, 1232, 1232, 1233, 1234, 1235, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 1236, 1236, 1236, 1237, 1238, 120, 1239, - 1239, 1239, 1239, 1239, 1239, 1240, 1241, 1242, 120, 1243, 1244, 1245, - 1239, 1239, 1246, 1239, 1239, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 1247, 1247, 1247, 1247, 1247, 1247, 1247, - 1247, 1248, 120, 1249, 1250, 1250, 1250, 1250, 1251, 120, 1252, 1253, - 1254, 120, 120, 120, 120, 120, 120, 120, 120, 1255, 120, 120, 120, 1256, - 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, - 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, - 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, - 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, - 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, - 1257, 120, 120, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, - 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, - 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1256, 1258, 120, 1259, - 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, 737, - 737, 737, 737, 737, 737, 737, 1260, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, - 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, - 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, - 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, 1261, - 1261, 1261, 1261, 1261, 1262, 1263, 1263, 1263, 1263, 1263, 1263, 1263, - 1263, 1263, 1263, 1263, 1263, 1263, 1264, 1263, 1265, 1263, 1266, 1263, - 1267, 1268, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 609, - 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, - 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, 609, - 609, 1269, 120, 609, 609, 609, 609, 1270, 1271, 609, 609, 609, 609, 609, - 609, 1272, 1273, 1274, 1275, 1276, 1277, 609, 609, 609, 1278, 609, 609, - 609, 609, 609, 609, 609, 1279, 120, 120, 949, 949, 949, 949, 949, 949, - 949, 949, 1280, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 580, 580, - 580, 580, 580, 580, 580, 580, 580, 580, 616, 120, 944, 944, 1281, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 1282, 1282, 1282, 1283, 1284, 1284, 1285, 1282, 1282, 1286, - 1287, 1284, 1284, 1282, 1282, 1282, 1283, 1284, 1284, 1288, 1289, 1290, - 1286, 1291, 1292, 1284, 1282, 1282, 1282, 1283, 1284, 1284, 1293, 1294, - 1295, 1296, 1284, 1284, 1284, 1297, 1298, 1299, 1300, 1284, 1284, 1285, - 1282, 1282, 1286, 1284, 1284, 1284, 1282, 1282, 1282, 1283, 1284, 1284, - 1285, 1282, 1282, 1286, 1284, 1284, 1284, 1282, 1282, 1282, 1283, 1284, - 1284, 1285, 1282, 1282, 1286, 1284, 1284, 1284, 1282, 1282, 1282, 1283, - 1284, 1284, 1301, 1282, 1282, 1282, 1302, 1284, 1284, 1303, 1304, 1282, - 1282, 1305, 1284, 1284, 1306, 1285, 1282, 1282, 1307, 1284, 1284, 1308, - 1309, 1282, 1282, 1310, 1284, 1284, 1284, 1311, 1282, 1282, 1282, 1302, - 1284, 1284, 1303, 1312, 1313, 1313, 1313, 1313, 1313, 1313, 1314, 1314, - 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, - 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, 1314, - 1314, 1314, 1314, 1314, 1314, 1314, 1315, 1315, 1315, 1315, 1315, 1315, - 1316, 1317, 1315, 1315, 1315, 1315, 1315, 1318, 1319, 1314, 1320, 1321, - 120, 1322, 1323, 1315, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 1324, 1325, 1325, 1326, 1327, 1328, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, - 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, 1329, - 1329, 1329, 1329, 1329, 1330, 1331, 1332, 120, 120, 120, 120, 120, 1333, - 1333, 1333, 1333, 1334, 1335, 1335, 1335, 1336, 1337, 1338, 1339, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 1340, 128, 128, 128, 1341, 1342, 1343, 1344, - 1345, 1346, 1341, 1347, 1341, 1343, 1343, 1348, 128, 1349, 128, 1350, - 1351, 1349, 128, 1350, 120, 120, 120, 120, 120, 120, 1352, 120, 1353, - 1354, 1354, 1354, 1354, 1355, 1354, 1354, 1354, 1354, 1354, 1354, 1354, - 1354, 1354, 1354, 1354, 1354, 1355, 1356, 1354, 1357, 1358, 1354, 1358, - 1359, 1358, 1354, 1354, 1354, 1360, 1356, 619, 1361, 621, 621, 621, 1362, - 621, 621, 621, 621, 621, 621, 621, 1363, 621, 621, 621, 1364, 1365, 1366, - 621, 1367, 1356, 1356, 1356, 1356, 1356, 1356, 1368, 1369, 1369, 1369, - 1370, 1356, 758, 758, 758, 758, 758, 1371, 758, 1372, 1373, 1356, 1374, - 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, - 1356, 1356, 1356, 1356, 1356, 1356, 1356, 725, 725, 725, 725, 1375, 1376, - 1377, 725, 725, 725, 725, 725, 725, 725, 725, 1378, 1379, 725, 1380, - 1381, 725, 725, 1382, 1383, 1384, 1385, 1380, 1354, 725, 725, 1386, 1387, - 725, 725, 725, 725, 725, 725, 725, 1388, 1389, 1390, 1391, 725, 1392, - 1393, 1390, 1394, 1395, 725, 725, 725, 1396, 1397, 1398, 725, 725, 725, - 725, 725, 725, 725, 725, 1399, 1400, 725, 1401, 642, 1402, 725, 1403, - 1404, 580, 1405, 725, 725, 725, 1354, 1406, 1407, 1354, 1354, 1408, 1354, - 1353, 1354, 1354, 1354, 1354, 1354, 1409, 1410, 1354, 1354, 1409, 1411, - 725, 725, 725, 725, 725, 725, 725, 725, 1412, 1413, 580, 580, 580, 580, - 1414, 1415, 725, 725, 725, 725, 1416, 725, 1417, 725, 1418, 1419, 1420, - 1356, 1354, 1421, 1422, 1423, 580, 580, 580, 580, 580, 580, 580, 580, - 580, 580, 580, 580, 580, 580, 1424, 1356, 580, 580, 580, 580, 580, 580, - 580, 580, 580, 580, 1425, 1356, 1356, 1356, 1356, 1356, 580, 1424, 580, - 580, 580, 580, 580, 580, 580, 1356, 580, 1426, 580, 580, 580, 580, 580, - 1356, 580, 580, 580, 1427, 1356, 1356, 1356, 1356, 1356, 1356, 1356, - 1356, 1356, 1356, 580, 1424, 725, 1428, 1429, 725, 1390, 1430, 725, 1431, - 725, 725, 725, 1432, 1356, 1356, 725, 725, 725, 1356, 1356, 1356, 1356, - 1356, 1423, 1356, 1433, 1434, 1435, 1356, 1356, 1356, 1356, 1356, 1356, - 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, - 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, - 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, - 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, - 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, 1356, - 1436, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 1437, - 778, 778, 778, 778, 778, 776, 776, 776, 776, 776, 776, 1438, 778, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 777, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 886, 778, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, - 776, 776, 776, 1439, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, - 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, - 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 776, 776, 776, - 777, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, - 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, - 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, - 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, - 778, 778, 778, 778, 1440, 1441, 120, 120, 120, 1442, 1442, 1442, 1442, - 1442, 1442, 1442, 1442, 1442, 1442, 1442, 1442, 120, 120, 120, 120, 120, - 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 120, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, - 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 901, 120, - 120, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, - 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, 885, - 885, 885, 885, 885, 1443, + 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 776, 778, + 779, 779, 779, 779, 779, 779, 780, 119, 781, 781, 781, 781, 781, 782, + 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, 783, + 783, 783, 783, 783, 783, 784, 783, 783, 785, 786, 119, 119, 101, 101, + 101, 101, 101, 787, 788, 789, 101, 101, 101, 790, 791, 791, 791, 791, + 791, 791, 791, 791, 792, 793, 794, 119, 64, 64, 795, 796, 797, 27, 798, + 27, 27, 27, 27, 27, 27, 27, 799, 800, 27, 801, 802, 27, 27, 803, 804, + 805, 119, 119, 119, 119, 119, 119, 806, 807, 808, 809, 810, 810, 811, + 812, 813, 814, 815, 815, 815, 815, 815, 815, 816, 119, 817, 818, 818, + 818, 818, 818, 819, 820, 821, 822, 823, 824, 825, 825, 826, 827, 828, + 829, 830, 830, 831, 832, 833, 833, 834, 835, 836, 837, 367, 367, 367, + 838, 839, 840, 840, 840, 840, 840, 841, 842, 843, 844, 845, 846, 847, + 348, 352, 848, 849, 849, 849, 849, 849, 850, 851, 119, 852, 853, 854, + 855, 348, 348, 856, 857, 858, 858, 858, 858, 858, 858, 859, 860, 861, + 119, 119, 862, 863, 864, 865, 119, 866, 866, 866, 119, 372, 372, 54, 54, + 54, 54, 54, 867, 868, 119, 869, 869, 869, 869, 869, 869, 869, 869, 869, + 869, 863, 863, 863, 863, 870, 871, 872, 873, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, + 875, 875, 874, 875, 875, 876, 875, 875, 875, 875, 875, 875, 874, 875, + 875, 876, 875, 875, 875, 874, 875, 875, 876, 875, 875, 875, 874, 875, + 875, 877, 119, 368, 368, 878, 879, 369, 369, 369, 369, 369, 880, 881, + 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, + 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, 881, + 881, 881, 881, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, + 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, + 882, 882, 882, 882, 882, 882, 882, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 774, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 883, 775, 775, 775, 775, 884, 119, 885, + 886, 120, 887, 888, 889, 890, 120, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 891, 892, 893, 119, 894, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 895, 119, + 119, 127, 127, 127, 127, 127, 127, 127, 127, 896, 127, 127, 127, 127, + 127, 127, 119, 119, 119, 119, 119, 127, 897, 898, 898, 899, 900, 901, + 902, 903, 904, 905, 906, 907, 908, 909, 910, 169, 127, 127, 127, 127, + 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 127, 911, 912, + 913, 914, 915, 916, 917, 917, 918, 919, 920, 920, 921, 922, 923, 924, + 925, 925, 925, 925, 926, 927, 927, 927, 928, 929, 929, 929, 930, 931, + 932, 119, 933, 934, 935, 934, 934, 936, 934, 934, 937, 934, 938, 934, + 938, 119, 119, 119, 119, 934, 934, 934, 934, 934, 934, 934, 934, 934, + 934, 934, 934, 934, 934, 934, 939, 940, 941, 941, 941, 941, 941, 942, + 610, 943, 943, 943, 943, 943, 943, 944, 945, 946, 947, 581, 948, 949, + 119, 119, 119, 119, 119, 610, 610, 610, 610, 610, 950, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 951, + 951, 951, 952, 953, 953, 953, 953, 953, 953, 954, 119, 955, 956, 956, + 957, 958, 958, 958, 958, 959, 960, 961, 961, 962, 963, 964, 964, 964, + 964, 965, 966, 967, 967, 967, 968, 969, 969, 969, 969, 970, 969, 971, + 119, 119, 119, 119, 119, 972, 972, 972, 972, 972, 973, 973, 973, 973, + 973, 974, 974, 974, 974, 974, 974, 975, 975, 975, 976, 977, 978, 979, + 979, 979, 979, 980, 981, 981, 981, 981, 982, 983, 983, 983, 983, 983, + 119, 984, 984, 984, 984, 984, 984, 985, 986, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 987, + 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, + 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, 987, + 987, 987, 987, 987, 987, 987, 987, 987, 987, 988, 119, 987, 987, 989, + 119, 987, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 990, 991, 992, 992, 992, 992, 993, + 994, 995, 995, 996, 997, 998, 998, 999, 1000, 1001, 1001, 1001, 1002, + 1003, 1004, 119, 119, 119, 119, 119, 119, 1005, 1005, 1006, 1007, 1008, + 1008, 1009, 1010, 1011, 1011, 1011, 1012, 119, 119, 119, 119, 119, 119, + 119, 119, 1013, 1013, 1013, 1013, 1014, 1014, 1014, 1015, 1016, 1016, + 1017, 1016, 1016, 1016, 1016, 1016, 1018, 1019, 1020, 1021, 1022, 1022, + 1023, 1024, 1025, 1026, 1027, 1028, 1029, 1029, 1029, 1030, 1031, 1031, + 1031, 1032, 119, 119, 119, 119, 1033, 1034, 1033, 1033, 1035, 1036, 1037, + 119, 1038, 1038, 1038, 1038, 1038, 1038, 1039, 1040, 1041, 1041, 1042, + 1043, 1044, 1044, 1045, 1046, 1047, 1047, 1048, 1049, 119, 1050, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 1051, 1051, 1051, 1051, + 1051, 1051, 1051, 1051, 1051, 1052, 119, 119, 119, 119, 119, 119, 1053, + 1053, 1053, 1053, 1053, 1053, 1054, 119, 1055, 1055, 1055, 1055, 1055, + 1055, 1056, 1057, 1058, 1058, 1058, 1058, 1059, 119, 1060, 1061, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 1062, 1062, 1062, 1063, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 1064, + 1064, 1064, 1065, 1066, 119, 1067, 1067, 1068, 1069, 1070, 1071, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 1072, 1073, 1073, 1073, 1073, 1073, 1073, 1074, + 1075, 1076, 1077, 1078, 1079, 1080, 119, 1081, 1082, 1083, 1083, 1083, + 1083, 1083, 1084, 1085, 1086, 1087, 1088, 1088, 1088, 1089, 1090, 1091, + 1092, 1093, 1093, 1093, 1094, 1095, 1096, 1097, 1098, 119, 1099, 1099, + 1099, 1099, 1100, 119, 1101, 1102, 1102, 1102, 1102, 1102, 1103, 1104, + 1105, 1106, 1107, 1108, 1109, 1110, 1111, 119, 1112, 1112, 1113, 1112, + 1112, 1114, 1115, 1116, 119, 119, 119, 119, 119, 119, 119, 119, 1117, + 1118, 1119, 1120, 1119, 1121, 1122, 1122, 1122, 1122, 1122, 1123, 1124, + 1125, 1126, 1127, 1128, 1129, 1130, 1131, 1131, 1132, 1133, 1134, 1135, + 1136, 1137, 1138, 1139, 1140, 1140, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 1141, 1141, 1141, 1141, + 1141, 1141, 1142, 1143, 1144, 1145, 1146, 1147, 119, 119, 119, 119, 1148, + 1148, 1148, 1148, 1148, 1148, 1149, 1150, 1151, 119, 1152, 1153, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 1154, 1154, 1154, 1154, 1154, 1155, 1156, 1157, + 1158, 1159, 1160, 1161, 119, 119, 119, 119, 1162, 1162, 1162, 1162, 1162, + 1162, 1163, 1164, 1165, 119, 1166, 1167, 1168, 1169, 119, 119, 1170, + 1170, 1170, 1170, 1170, 1171, 1172, 119, 1173, 1174, 119, 119, 119, 119, + 119, 119, 1175, 1175, 1175, 1176, 1177, 1178, 1179, 1180, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 1181, 1181, 1181, 1181, 1181, 1182, + 1183, 1184, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 1185, 1185, 1185, 1185, 1186, 1186, 1186, 1186, 1187, 1188, 1189, 1190, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 1191, 1192, 1193, 1193, 1193, 1193, 1194, 1195, 1196, + 119, 1197, 1198, 1199, 1199, 1199, 1199, 1200, 1201, 1202, 1203, 1204, + 119, 119, 119, 1205, 1205, 1205, 1205, 1205, 1205, 1205, 1206, 1207, + 1208, 1207, 1207, 1207, 1209, 1210, 1211, 1212, 119, 1213, 1214, 1215, + 1216, 1217, 1218, 1218, 1218, 1219, 1220, 1220, 1221, 1222, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 1223, 1224, 1225, 1225, 1225, 1225, + 1226, 1227, 1228, 119, 1229, 1230, 1231, 1232, 1233, 1233, 1233, 1234, + 1235, 1236, 1237, 1238, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 1239, 1239, 1240, 1241, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, + 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, + 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, + 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, + 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1243, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 1244, 1244, 1244, 1244, 1244, 1244, + 1244, 1244, 1244, 1244, 1244, 1244, 1244, 1245, 1246, 119, 1242, 1242, + 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, + 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1242, 1247, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 1248, 1248, 1248, 1248, 1248, + 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, + 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, + 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, + 1248, 1248, 1249, 1248, 1248, 1248, 1248, 1250, 1251, 1248, 1248, 1248, + 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, + 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, + 1248, 1248, 1252, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, + 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, 1248, + 1253, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 1254, + 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, + 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, + 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, + 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, + 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1255, 1254, 1254, 1254, + 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1254, 1256, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 791, 791, 791, 791, 791, + 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, + 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, + 791, 791, 791, 791, 791, 791, 1257, 1258, 1258, 1258, 1259, 1260, 1261, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 1262, 1262, + 1262, 1263, 1264, 119, 1265, 1265, 1265, 1265, 1265, 1265, 1266, 1267, + 1268, 119, 1269, 1270, 1271, 1265, 1265, 1272, 1265, 1265, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 1273, 1273, 1273, 1273, 1274, 1274, 1274, 1274, + 1275, 1275, 1276, 1277, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1278, 1279, 119, + 1280, 1281, 1281, 1281, 1281, 1282, 119, 1283, 1284, 1285, 119, 119, 119, + 119, 119, 119, 119, 119, 1286, 119, 119, 119, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1288, 119, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, 1287, + 1287, 1287, 1287, 1287, 1287, 1287, 1289, 119, 1290, 735, 735, 735, 735, + 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, + 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, 735, + 735, 735, 1291, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 1292, + 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, + 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, + 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, + 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, 1292, + 1293, 1294, 1294, 1294, 1294, 1294, 1294, 1294, 1294, 1294, 1294, 1294, + 1294, 1294, 1295, 1294, 1296, 1294, 1297, 1294, 1298, 1299, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 610, 610, 610, 610, 610, + 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, + 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 610, 1300, 119, 610, + 610, 610, 610, 1301, 1302, 610, 610, 610, 610, 610, 610, 1303, 1304, + 1305, 1306, 1307, 1308, 610, 610, 610, 1309, 610, 610, 610, 610, 610, + 610, 610, 1310, 119, 119, 946, 946, 946, 946, 946, 946, 946, 946, 1311, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 941, 941, 1312, 119, 581, 581, 581, 581, 581, + 581, 581, 581, 581, 581, 617, 119, 941, 941, 941, 1313, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 1314, + 1314, 1314, 1315, 1316, 1316, 1317, 1314, 1314, 1318, 1319, 1316, 1316, + 1314, 1314, 1314, 1315, 1316, 1316, 1320, 1321, 1322, 1318, 1323, 1324, + 1316, 1314, 1314, 1314, 1315, 1316, 1316, 1325, 1326, 1327, 1328, 1316, + 1316, 1316, 1329, 1330, 1331, 1332, 1316, 1316, 1317, 1314, 1314, 1318, + 1316, 1316, 1316, 1314, 1314, 1314, 1315, 1316, 1316, 1317, 1314, 1314, + 1318, 1316, 1316, 1316, 1314, 1314, 1314, 1315, 1316, 1316, 1317, 1314, + 1314, 1318, 1316, 1316, 1316, 1314, 1314, 1314, 1315, 1316, 1316, 1333, + 1314, 1314, 1314, 1334, 1316, 1316, 1335, 1336, 1314, 1314, 1337, 1316, + 1316, 1338, 1317, 1314, 1314, 1339, 1316, 1316, 1340, 1341, 1314, 1314, + 1342, 1316, 1316, 1316, 1343, 1314, 1314, 1314, 1334, 1316, 1316, 1335, + 1344, 1345, 1345, 1345, 1345, 1345, 1345, 1346, 1346, 1346, 1346, 1346, + 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, + 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, 1346, + 1346, 1346, 1346, 1347, 1347, 1347, 1347, 1347, 1347, 1348, 1349, 1347, + 1347, 1347, 1347, 1347, 1350, 1351, 1346, 1352, 1353, 119, 1354, 1355, + 1347, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 1356, 1357, 1357, + 1358, 1359, 1360, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, + 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, 1361, + 1361, 1362, 1363, 1364, 119, 119, 119, 119, 119, 1365, 1365, 1365, 1365, + 1366, 1367, 1367, 1367, 1368, 1369, 1370, 1371, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 1372, 1373, 1373, 1373, 1373, 1373, 1373, 1374, 1375, 119, 119, 119, + 119, 119, 119, 119, 119, 119, 1376, 127, 127, 127, 1377, 1378, 1379, + 1380, 1381, 1382, 1377, 1383, 1377, 1379, 1379, 1384, 127, 1385, 127, + 1386, 1387, 1385, 127, 1386, 119, 119, 119, 119, 119, 119, 1388, 119, + 1389, 1390, 1390, 1390, 1390, 1391, 1390, 1390, 1390, 1390, 1390, 1390, + 1390, 1390, 1390, 1390, 1390, 1390, 1391, 1392, 1390, 1393, 1394, 1390, + 1394, 1395, 1394, 1390, 1390, 1390, 1396, 1392, 620, 1397, 622, 622, 622, + 1398, 622, 622, 622, 622, 622, 622, 622, 1399, 622, 622, 622, 1400, 1401, + 1402, 622, 1403, 1392, 1392, 1392, 1392, 1392, 1392, 1404, 1405, 1405, + 1405, 1406, 1392, 755, 755, 755, 755, 755, 1407, 755, 1408, 1409, 1392, + 1410, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 723, 723, 723, 723, 1411, + 1412, 1413, 723, 723, 723, 723, 723, 723, 723, 723, 1414, 1415, 723, + 1416, 1417, 723, 723, 1418, 1419, 1420, 1421, 1416, 1390, 723, 723, 1422, + 1423, 723, 723, 723, 723, 723, 723, 723, 1424, 1425, 1426, 1427, 723, + 1428, 1429, 1426, 1430, 1431, 723, 723, 723, 1432, 1433, 1434, 723, 723, + 723, 723, 723, 723, 723, 723, 1435, 1436, 723, 1437, 643, 1438, 723, + 1439, 1440, 581, 1441, 723, 723, 723, 1390, 1442, 1443, 1390, 1390, 1444, + 1390, 1389, 1390, 1390, 1390, 1390, 1390, 1445, 1446, 1390, 1390, 1445, + 1447, 723, 723, 723, 723, 723, 723, 723, 723, 1448, 1449, 581, 581, 581, + 581, 1450, 1451, 723, 723, 723, 723, 1452, 723, 1453, 723, 1454, 1455, + 1456, 1392, 1390, 1457, 1458, 1459, 581, 581, 581, 581, 581, 581, 581, + 581, 581, 581, 581, 581, 581, 581, 1460, 1392, 581, 581, 581, 581, 581, + 581, 581, 581, 581, 581, 1461, 1462, 1392, 1392, 1392, 1392, 581, 1460, + 581, 581, 581, 581, 581, 581, 581, 1392, 581, 1463, 581, 581, 581, 581, + 581, 1392, 581, 581, 581, 1464, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, 581, 1460, 723, 1465, 1466, 723, 1426, 1467, 723, 723, + 723, 723, 723, 723, 1468, 1469, 723, 723, 723, 723, 1470, 1392, 1471, + 1472, 1470, 1392, 1473, 1474, 723, 723, 723, 723, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1390, 1396, 1392, 1392, + 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1392, + 1392, 1392, 1392, 1392, 1392, 1392, 1392, 1475, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 1476, 775, 775, 775, 775, 775, 773, + 773, 773, 773, 773, 773, 1477, 775, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 774, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 883, + 775, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, + 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 773, 1478, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 773, 773, 773, 774, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 1479, 1480, + 119, 119, 119, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, 1481, + 1481, 1481, 1481, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, 119, + 119, 119, 119, 119, 119, 898, 898, 898, 898, 898, 898, 898, 898, 898, + 898, 898, 898, 898, 898, 898, 898, 898, 898, 898, 898, 898, 898, 898, + 898, 898, 898, 898, 898, 898, 898, 119, 119, 882, 882, 882, 882, 882, + 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, + 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 1482, }; static const unsigned short index2[] = { @@ -2666,716 +2829,743 @@ 94, 95, 95, 96, 96, 95, 97, 97, 90, 93, 90, 93, 90, 93, 90, 90, 93, 90, 93, 90, 93, 90, 93, 90, 93, 90, 93, 90, 93, 93, 81, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 81, - 81, 99, 100, 100, 100, 100, 100, 100, 81, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 81, 102, 103, 81, 81, 104, - 104, 105, 81, 106, 107, 107, 107, 107, 106, 107, 107, 107, 108, 106, 107, - 107, 107, 107, 107, 107, 106, 106, 106, 106, 106, 106, 107, 107, 106, - 107, 107, 108, 109, 107, 110, 111, 112, 113, 114, 115, 116, 117, 118, - 119, 119, 120, 121, 122, 123, 124, 125, 126, 127, 125, 107, 106, 128, - 118, 81, 81, 81, 81, 81, 81, 81, 81, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 81, 81, 81, 81, 81, 129, 129, 129, 125, 125, 81, 81, - 81, 130, 130, 130, 130, 130, 131, 132, 132, 133, 134, 134, 135, 136, 137, - 138, 138, 139, 139, 139, 139, 139, 139, 139, 139, 140, 141, 142, 143, - 144, 81, 145, 143, 146, 146, 146, 146, 146, 146, 146, 146, 147, 146, 146, - 146, 146, 146, 146, 146, 146, 146, 146, 148, 149, 150, 151, 152, 153, - 154, 155, 96, 96, 156, 157, 139, 139, 139, 139, 139, 157, 139, 139, 157, - 158, 158, 158, 158, 158, 158, 158, 158, 158, 158, 134, 159, 159, 160, - 146, 146, 161, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, - 145, 146, 139, 139, 139, 139, 139, 139, 139, 131, 138, 139, 139, 139, - 139, 157, 139, 162, 162, 139, 139, 138, 157, 139, 139, 157, 146, 146, - 163, 163, 163, 163, 163, 163, 163, 163, 163, 163, 146, 146, 146, 164, - 164, 146, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, - 165, 165, 81, 166, 167, 168, 167, 167, 167, 167, 167, 167, 167, 167, 167, - 167, 167, 167, 167, 167, 169, 170, 169, 169, 170, 169, 169, 170, 170, - 170, 169, 170, 170, 169, 170, 169, 169, 169, 170, 169, 170, 169, 170, - 169, 170, 169, 169, 81, 81, 167, 167, 167, 171, 171, 171, 171, 171, 171, - 171, 171, 171, 171, 171, 171, 171, 171, 172, 172, 172, 172, 172, 172, - 172, 172, 172, 172, 172, 171, 81, 81, 81, 81, 81, 81, 173, 173, 173, 173, - 173, 173, 173, 173, 173, 173, 174, 174, 174, 174, 174, 174, 174, 174, - 174, 174, 174, 174, 174, 174, 174, 174, 174, 175, 175, 175, 175, 175, - 175, 175, 176, 175, 177, 177, 178, 179, 180, 181, 177, 81, 81, 81, 81, - 81, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, 182, - 183, 183, 183, 183, 184, 183, 183, 183, 183, 183, 183, 183, 183, 183, - 184, 183, 183, 183, 184, 183, 183, 183, 183, 183, 81, 81, 185, 185, 185, - 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 185, 81, 186, 186, - 186, 186, 186, 186, 186, 186, 186, 187, 187, 187, 81, 81, 188, 81, 167, - 167, 167, 81, 81, 81, 81, 81, 146, 146, 146, 146, 146, 81, 146, 146, 146, - 146, 146, 146, 146, 146, 81, 81, 81, 81, 81, 81, 139, 139, 139, 139, 139, - 139, 131, 157, 139, 139, 157, 139, 139, 157, 139, 139, 139, 157, 157, - 157, 189, 190, 191, 139, 139, 139, 157, 139, 139, 157, 157, 139, 139, - 139, 139, 139, 192, 192, 192, 193, 194, 194, 194, 194, 194, 194, 194, - 194, 194, 194, 194, 194, 194, 194, 192, 193, 195, 194, 193, 193, 193, - 192, 192, 192, 192, 192, 192, 192, 192, 193, 193, 193, 193, 196, 193, - 193, 194, 96, 156, 197, 197, 192, 192, 192, 194, 194, 192, 192, 198, 198, - 199, 199, 199, 199, 199, 199, 199, 199, 199, 199, 200, 201, 194, 194, - 194, 194, 194, 194, 202, 203, 204, 204, 81, 202, 202, 202, 202, 202, 202, - 202, 202, 81, 81, 202, 202, 81, 81, 202, 202, 202, 202, 202, 202, 202, - 202, 202, 202, 202, 202, 202, 202, 81, 202, 202, 202, 202, 202, 202, 202, - 81, 202, 81, 81, 81, 202, 202, 202, 202, 81, 81, 205, 202, 204, 204, 204, - 203, 203, 203, 203, 81, 81, 204, 204, 81, 81, 204, 204, 206, 202, 81, 81, - 81, 81, 81, 81, 81, 81, 204, 81, 81, 81, 81, 202, 202, 81, 202, 202, 202, - 203, 203, 81, 81, 207, 207, 207, 207, 207, 207, 207, 207, 207, 207, 202, - 202, 208, 208, 209, 209, 209, 209, 209, 210, 211, 212, 202, 213, 81, 81, - 81, 214, 214, 215, 81, 216, 216, 216, 216, 216, 216, 81, 81, 81, 81, 216, - 216, 81, 81, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, 216, - 216, 216, 81, 216, 216, 216, 216, 216, 216, 216, 81, 216, 216, 81, 216, - 216, 81, 216, 216, 81, 81, 217, 81, 215, 215, 215, 214, 214, 81, 81, 81, - 81, 214, 214, 81, 81, 214, 214, 218, 81, 81, 81, 214, 81, 81, 81, 81, 81, - 81, 81, 216, 216, 216, 216, 81, 216, 81, 81, 81, 81, 81, 81, 81, 219, - 219, 219, 219, 219, 219, 219, 219, 219, 219, 214, 214, 216, 216, 216, - 214, 81, 81, 81, 220, 220, 221, 81, 222, 222, 222, 222, 222, 222, 222, - 222, 222, 81, 222, 222, 222, 81, 222, 222, 222, 222, 222, 222, 222, 222, - 222, 222, 222, 222, 222, 222, 81, 222, 222, 222, 222, 222, 222, 222, 81, - 222, 222, 81, 222, 222, 222, 222, 222, 81, 81, 223, 222, 221, 221, 221, - 220, 220, 220, 220, 220, 81, 220, 220, 221, 81, 221, 221, 224, 81, 81, - 222, 81, 81, 81, 81, 81, 81, 81, 222, 222, 220, 220, 81, 81, 225, 225, - 225, 225, 225, 225, 225, 225, 225, 225, 226, 227, 81, 81, 81, 81, 81, 81, - 81, 222, 220, 220, 220, 220, 220, 220, 81, 228, 229, 229, 81, 230, 230, - 230, 230, 230, 230, 230, 230, 81, 81, 230, 230, 81, 81, 230, 230, 230, - 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 81, 230, 230, 230, - 230, 230, 230, 230, 81, 230, 230, 81, 230, 230, 230, 230, 230, 81, 81, - 231, 230, 229, 228, 229, 228, 228, 228, 228, 81, 81, 229, 229, 81, 81, - 229, 229, 232, 81, 81, 81, 81, 81, 81, 81, 81, 228, 229, 81, 81, 81, 81, - 230, 230, 81, 230, 230, 230, 228, 228, 81, 81, 233, 233, 233, 233, 233, - 233, 233, 233, 233, 233, 234, 230, 235, 235, 235, 235, 235, 235, 81, 81, - 236, 237, 81, 237, 237, 237, 237, 237, 237, 81, 81, 81, 237, 237, 237, - 81, 237, 237, 237, 237, 81, 81, 81, 237, 237, 81, 237, 81, 237, 237, 81, - 81, 81, 237, 237, 81, 81, 81, 237, 237, 237, 237, 237, 237, 237, 237, - 237, 237, 81, 81, 81, 81, 238, 238, 236, 238, 238, 81, 81, 81, 238, 238, - 238, 81, 238, 238, 238, 239, 81, 81, 237, 81, 81, 81, 81, 81, 81, 238, - 81, 81, 81, 81, 81, 81, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, - 241, 241, 241, 242, 242, 242, 242, 242, 242, 243, 242, 81, 81, 81, 81, - 81, 244, 245, 245, 245, 81, 246, 246, 246, 246, 246, 246, 246, 246, 81, - 246, 246, 246, 81, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, 246, - 246, 246, 246, 246, 246, 81, 81, 81, 246, 244, 244, 244, 245, 245, 245, - 245, 81, 244, 244, 244, 81, 244, 244, 244, 247, 81, 81, 81, 81, 81, 81, - 81, 248, 249, 81, 246, 246, 246, 81, 81, 81, 81, 81, 246, 246, 244, 244, - 81, 81, 250, 250, 250, 250, 250, 250, 250, 250, 250, 250, 251, 251, 251, - 251, 251, 251, 251, 252, 253, 254, 255, 255, 81, 253, 253, 253, 253, 253, - 253, 253, 253, 81, 253, 253, 253, 81, 253, 253, 253, 253, 253, 253, 253, - 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 81, 253, 253, 253, - 253, 253, 81, 81, 256, 253, 255, 257, 255, 255, 255, 255, 255, 81, 257, - 255, 255, 81, 255, 255, 254, 258, 81, 81, 81, 81, 81, 81, 81, 255, 255, - 81, 81, 81, 81, 81, 81, 81, 253, 81, 253, 253, 254, 254, 81, 81, 259, - 259, 259, 259, 259, 259, 259, 259, 259, 259, 81, 253, 253, 81, 81, 81, - 81, 81, 260, 260, 261, 261, 81, 262, 262, 262, 262, 262, 262, 262, 262, - 81, 262, 262, 262, 81, 262, 262, 262, 262, 262, 262, 262, 262, 262, 262, - 262, 262, 262, 262, 262, 262, 262, 263, 263, 262, 261, 261, 261, 260, - 260, 260, 260, 81, 261, 261, 261, 81, 261, 261, 261, 263, 262, 264, 81, - 81, 81, 81, 262, 262, 262, 261, 265, 265, 265, 265, 265, 265, 265, 262, - 262, 262, 260, 260, 81, 81, 266, 266, 266, 266, 266, 266, 266, 266, 266, - 266, 265, 265, 265, 265, 265, 265, 265, 265, 265, 267, 262, 262, 262, - 262, 262, 262, 81, 81, 268, 268, 81, 269, 269, 269, 269, 269, 269, 269, - 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 269, 81, 81, 81, 269, - 269, 269, 269, 269, 269, 269, 269, 81, 269, 269, 269, 269, 269, 269, 269, - 269, 269, 81, 269, 81, 81, 81, 81, 270, 81, 81, 81, 81, 268, 268, 268, - 271, 271, 271, 81, 271, 81, 268, 268, 268, 268, 268, 268, 268, 268, 81, - 81, 81, 81, 81, 81, 272, 272, 272, 272, 272, 272, 272, 272, 272, 272, 81, - 81, 268, 268, 273, 81, 81, 81, 81, 274, 274, 274, 274, 274, 274, 274, - 274, 274, 274, 274, 274, 274, 274, 274, 274, 275, 274, 274, 275, 275, - 275, 275, 276, 276, 277, 81, 81, 81, 81, 278, 274, 274, 274, 274, 274, - 274, 279, 275, 280, 280, 280, 280, 275, 275, 275, 281, 282, 282, 282, - 282, 282, 282, 282, 282, 282, 282, 283, 283, 81, 81, 81, 81, 81, 284, - 284, 81, 284, 81, 81, 284, 284, 81, 284, 81, 81, 284, 81, 81, 81, 81, 81, - 81, 284, 284, 284, 284, 81, 284, 284, 284, 284, 284, 284, 284, 81, 284, - 284, 284, 81, 284, 81, 284, 81, 81, 284, 284, 81, 284, 284, 284, 284, - 285, 284, 284, 285, 285, 285, 285, 286, 286, 81, 285, 285, 284, 81, 81, - 284, 284, 284, 284, 284, 81, 287, 81, 288, 288, 288, 288, 285, 285, 81, - 81, 289, 289, 289, 289, 289, 289, 289, 289, 289, 289, 81, 81, 284, 284, - 284, 284, 290, 291, 291, 291, 292, 293, 292, 292, 294, 292, 292, 295, - 294, 296, 296, 296, 296, 296, 294, 297, 296, 297, 297, 297, 298, 298, - 297, 297, 297, 297, 297, 297, 299, 299, 299, 299, 299, 299, 299, 299, - 299, 299, 300, 300, 300, 300, 300, 300, 300, 300, 300, 300, 301, 298, - 297, 298, 297, 302, 303, 304, 303, 304, 305, 305, 290, 290, 290, 290, - 290, 290, 290, 290, 81, 290, 290, 290, 290, 290, 290, 290, 290, 290, 290, - 290, 290, 81, 81, 81, 81, 306, 307, 308, 309, 308, 308, 308, 308, 308, - 307, 307, 307, 307, 308, 310, 307, 308, 311, 311, 312, 295, 311, 311, - 290, 290, 290, 290, 290, 308, 308, 308, 308, 308, 308, 308, 308, 308, - 308, 308, 81, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, 308, - 81, 301, 301, 297, 297, 297, 297, 297, 297, 298, 297, 297, 297, 297, 297, - 297, 81, 297, 297, 292, 292, 295, 292, 293, 313, 313, 313, 313, 294, 294, - 81, 81, 81, 81, 81, 314, 314, 314, 314, 314, 314, 314, 314, 314, 314, - 314, 315, 315, 316, 316, 316, 316, 315, 316, 316, 316, 316, 316, 317, - 315, 318, 318, 315, 315, 316, 316, 314, 319, 319, 319, 319, 319, 319, - 319, 319, 319, 319, 320, 320, 321, 321, 321, 321, 314, 314, 314, 314, - 314, 314, 315, 315, 316, 316, 314, 314, 314, 314, 316, 316, 316, 314, - 315, 315, 315, 314, 314, 315, 315, 315, 315, 315, 315, 315, 314, 314, - 314, 316, 316, 316, 316, 314, 314, 314, 314, 314, 316, 315, 315, 316, - 316, 315, 315, 315, 315, 315, 315, 322, 314, 315, 319, 319, 315, 315, - 315, 316, 323, 323, 324, 324, 324, 324, 324, 324, 324, 324, 324, 324, - 324, 324, 324, 324, 81, 324, 81, 81, 81, 81, 81, 324, 81, 81, 325, 325, - 325, 325, 325, 325, 325, 325, 325, 325, 325, 326, 327, 325, 325, 325, - 328, 328, 328, 328, 328, 328, 328, 328, 329, 329, 329, 329, 329, 329, - 329, 329, 330, 330, 330, 330, 330, 330, 330, 330, 331, 331, 331, 331, - 331, 331, 331, 331, 331, 81, 331, 331, 331, 331, 81, 81, 331, 331, 331, - 331, 331, 331, 331, 81, 331, 331, 331, 81, 81, 332, 332, 332, 333, 334, - 333, 333, 333, 333, 333, 333, 333, 335, 335, 335, 335, 335, 335, 335, - 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 335, 81, 81, - 81, 336, 336, 336, 336, 336, 336, 336, 336, 336, 336, 81, 81, 81, 81, 81, - 81, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, - 81, 81, 338, 338, 338, 338, 338, 338, 81, 81, 339, 340, 340, 340, 340, - 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, 340, - 340, 340, 341, 341, 340, 342, 343, 343, 343, 343, 343, 343, 343, 343, - 343, 343, 343, 343, 343, 343, 343, 343, 343, 343, 344, 345, 81, 81, 81, - 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 346, 198, 198, 198, - 347, 347, 347, 346, 346, 346, 346, 346, 346, 346, 346, 81, 81, 81, 81, - 81, 81, 81, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, 348, - 348, 81, 348, 348, 348, 348, 349, 349, 350, 81, 81, 81, 351, 351, 351, - 351, 351, 351, 351, 351, 351, 351, 352, 352, 353, 198, 198, 81, 354, 354, - 354, 354, 354, 354, 354, 354, 354, 354, 355, 355, 81, 81, 81, 81, 356, - 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 356, 81, 356, 356, - 356, 81, 357, 357, 81, 81, 81, 81, 358, 358, 358, 358, 358, 358, 358, - 358, 358, 358, 358, 358, 359, 359, 360, 359, 359, 359, 359, 359, 359, - 359, 360, 360, 360, 360, 360, 360, 360, 360, 359, 360, 360, 359, 359, - 359, 359, 359, 359, 359, 359, 359, 361, 359, 362, 362, 363, 364, 362, - 365, 362, 366, 358, 367, 81, 81, 368, 368, 368, 368, 368, 368, 368, 368, - 368, 368, 81, 81, 81, 81, 81, 81, 369, 369, 369, 369, 369, 369, 369, 369, - 369, 369, 81, 81, 81, 81, 81, 81, 370, 370, 371, 371, 372, 373, 374, 370, - 375, 375, 370, 376, 376, 376, 377, 81, 378, 378, 378, 378, 378, 378, 378, - 378, 378, 378, 81, 81, 81, 81, 81, 81, 379, 379, 379, 379, 379, 379, 379, - 379, 379, 379, 379, 380, 379, 379, 379, 379, 379, 379, 379, 379, 379, - 376, 376, 379, 379, 381, 379, 81, 81, 81, 81, 81, 340, 340, 340, 340, - 340, 340, 81, 81, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, - 382, 382, 382, 382, 81, 383, 383, 383, 384, 384, 384, 384, 383, 383, 384, - 384, 384, 81, 81, 81, 81, 384, 384, 383, 384, 384, 384, 384, 384, 384, - 385, 386, 387, 81, 81, 81, 81, 388, 81, 81, 81, 389, 389, 390, 390, 390, - 390, 390, 390, 390, 390, 390, 390, 391, 391, 391, 391, 391, 391, 391, - 391, 391, 391, 391, 391, 391, 391, 81, 81, 391, 391, 391, 391, 391, 81, - 81, 81, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 392, 81, - 81, 81, 81, 392, 392, 81, 81, 81, 81, 81, 81, 393, 393, 393, 393, 393, - 393, 393, 393, 393, 393, 394, 81, 81, 81, 395, 395, 396, 396, 396, 396, - 396, 396, 396, 396, 397, 397, 397, 397, 397, 397, 397, 397, 397, 397, - 397, 397, 397, 397, 397, 398, 399, 400, 400, 401, 81, 81, 402, 402, 403, - 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 403, 404, 405, - 404, 405, 405, 405, 405, 405, 405, 405, 81, 406, 404, 405, 404, 404, 405, - 405, 405, 405, 405, 405, 405, 405, 404, 404, 404, 404, 404, 404, 405, - 405, 407, 407, 407, 407, 407, 407, 407, 407, 81, 81, 408, 409, 409, 409, - 409, 409, 409, 409, 409, 409, 409, 81, 81, 81, 81, 81, 81, 410, 410, 410, - 410, 410, 410, 410, 411, 410, 410, 410, 410, 410, 410, 81, 81, 96, 96, - 96, 96, 96, 156, 156, 156, 156, 156, 156, 96, 96, 156, 412, 81, 413, 413, - 413, 413, 414, 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, 415, - 415, 415, 415, 415, 416, 414, 413, 413, 413, 413, 413, 414, 413, 414, - 414, 414, 414, 414, 413, 414, 417, 415, 415, 415, 415, 415, 415, 415, 81, - 81, 81, 81, 418, 418, 418, 418, 418, 418, 418, 418, 418, 418, 419, 419, - 420, 419, 419, 419, 419, 421, 421, 421, 421, 421, 421, 421, 421, 421, - 421, 422, 423, 422, 422, 422, 422, 422, 422, 422, 421, 421, 421, 421, - 421, 421, 421, 421, 421, 81, 81, 81, 424, 424, 425, 426, 426, 426, 426, - 426, 426, 426, 426, 426, 426, 426, 426, 426, 426, 425, 424, 424, 424, - 424, 425, 425, 424, 424, 427, 428, 424, 424, 426, 426, 429, 429, 429, - 429, 429, 429, 429, 429, 429, 429, 426, 426, 426, 426, 426, 426, 430, - 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 430, 431, - 432, 433, 433, 432, 432, 432, 433, 432, 433, 433, 433, 434, 434, 81, 81, - 81, 81, 81, 81, 81, 81, 435, 435, 435, 435, 436, 436, 436, 436, 436, 436, - 436, 436, 436, 436, 436, 436, 437, 437, 437, 437, 437, 437, 437, 437, - 438, 438, 438, 438, 438, 438, 438, 438, 437, 437, 438, 439, 81, 81, 81, - 440, 440, 440, 440, 440, 441, 441, 441, 441, 441, 441, 441, 441, 441, - 441, 81, 81, 81, 436, 436, 436, 442, 442, 442, 442, 442, 442, 442, 442, - 442, 442, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, 443, - 443, 443, 444, 444, 444, 444, 444, 444, 445, 445, 93, 81, 81, 81, 81, 81, - 81, 81, 446, 446, 446, 446, 446, 446, 446, 446, 96, 96, 96, 326, 447, - 156, 156, 156, 156, 156, 96, 96, 156, 156, 156, 156, 96, 448, 447, 447, - 447, 447, 447, 447, 447, 449, 449, 449, 449, 156, 449, 449, 449, 449, - 448, 448, 96, 449, 449, 448, 96, 96, 81, 81, 81, 81, 81, 81, 56, 56, 56, - 56, 56, 56, 79, 79, 79, 79, 79, 93, 59, 59, 59, 59, 59, 59, 59, 59, 59, - 82, 82, 82, 82, 82, 59, 59, 59, 59, 82, 82, 82, 82, 82, 56, 56, 56, 56, - 56, 450, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 59, 59, 59, 59, 59, 59, - 59, 59, 59, 59, 59, 59, 82, 96, 96, 156, 96, 96, 96, 96, 96, 96, 96, 156, - 96, 96, 451, 452, 156, 453, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, - 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 454, 455, 455, 156, 81, 96, 456, - 156, 96, 156, 52, 56, 52, 56, 52, 56, 56, 56, 56, 56, 56, 56, 56, 56, 52, - 56, 79, 79, 79, 79, 79, 79, 79, 79, 78, 78, 78, 78, 78, 78, 78, 78, 79, - 79, 79, 79, 79, 79, 81, 81, 78, 78, 78, 78, 78, 78, 81, 81, 81, 78, 81, - 78, 81, 78, 81, 78, 457, 457, 457, 457, 457, 457, 457, 457, 79, 79, 79, - 79, 79, 81, 79, 79, 78, 78, 78, 78, 457, 80, 79, 80, 80, 80, 79, 79, 79, - 81, 79, 79, 78, 78, 78, 78, 457, 80, 80, 80, 79, 79, 79, 79, 81, 81, 79, - 79, 78, 78, 78, 78, 81, 80, 80, 80, 78, 78, 78, 78, 78, 80, 80, 80, 81, - 81, 79, 79, 79, 81, 79, 79, 78, 78, 78, 78, 457, 458, 80, 81, 459, 459, - 459, 459, 459, 459, 459, 460, 459, 459, 459, 461, 462, 463, 464, 465, - 466, 467, 468, 466, 469, 470, 38, 84, 471, 472, 473, 42, 471, 472, 473, - 42, 38, 38, 474, 84, 475, 475, 475, 476, 477, 478, 479, 480, 481, 482, - 483, 33, 484, 485, 484, 484, 485, 486, 487, 487, 84, 42, 50, 38, 488, - 488, 474, 489, 489, 84, 84, 84, 490, 473, 491, 488, 488, 488, 84, 84, 84, - 84, 84, 84, 84, 84, 492, 84, 489, 84, 373, 84, 373, 373, 373, 373, 84, - 373, 373, 459, 493, 494, 494, 494, 494, 81, 495, 496, 497, 498, 499, 499, - 499, 499, 499, 499, 500, 59, 81, 81, 47, 500, 500, 500, 500, 500, 501, - 501, 492, 473, 491, 502, 500, 47, 47, 47, 47, 500, 500, 500, 500, 500, - 501, 501, 492, 473, 491, 81, 59, 59, 59, 59, 59, 81, 81, 81, 278, 278, - 278, 278, 278, 278, 278, 503, 278, 504, 278, 278, 36, 278, 278, 278, 278, - 278, 278, 278, 278, 278, 503, 278, 278, 278, 278, 503, 278, 278, 503, - 278, 505, 505, 505, 505, 505, 505, 505, 505, 96, 96, 447, 447, 96, 96, - 96, 96, 447, 447, 447, 96, 96, 412, 412, 412, 412, 96, 412, 412, 412, - 447, 447, 96, 156, 96, 447, 447, 156, 156, 156, 156, 96, 81, 81, 81, 81, - 81, 81, 81, 40, 40, 506, 507, 40, 508, 40, 506, 40, 507, 49, 506, 506, - 506, 49, 49, 506, 506, 506, 509, 40, 506, 510, 40, 492, 506, 506, 506, - 506, 506, 40, 40, 40, 508, 508, 40, 506, 40, 85, 40, 506, 40, 52, 511, - 506, 506, 512, 49, 506, 506, 52, 506, 49, 449, 449, 449, 449, 49, 40, 40, - 49, 49, 506, 506, 492, 492, 492, 492, 492, 506, 49, 49, 49, 49, 40, 492, - 40, 40, 56, 313, 513, 513, 513, 514, 51, 515, 513, 513, 513, 513, 513, - 51, 514, 514, 51, 513, 516, 516, 516, 516, 516, 516, 516, 516, 516, 516, - 516, 516, 517, 517, 517, 517, 516, 516, 517, 517, 517, 517, 517, 517, - 517, 517, 517, 52, 56, 517, 517, 517, 517, 51, 40, 40, 81, 81, 81, 81, - 54, 54, 54, 54, 54, 508, 508, 508, 508, 508, 492, 492, 40, 40, 40, 40, - 492, 40, 40, 492, 40, 40, 492, 40, 40, 40, 40, 40, 40, 40, 492, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 44, 44, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 40, 492, 492, 40, 40, 54, 40, 54, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 44, 40, 40, 40, 40, 492, 492, 492, 492, 492, 492, 492, 492, 492, - 492, 492, 492, 54, 492, 54, 54, 492, 492, 492, 54, 54, 492, 492, 54, 492, - 492, 492, 54, 492, 54, 518, 519, 492, 54, 492, 492, 492, 492, 54, 492, - 492, 54, 54, 54, 54, 492, 492, 54, 492, 54, 492, 54, 54, 54, 54, 54, 54, - 492, 54, 492, 492, 492, 492, 492, 54, 54, 54, 54, 492, 492, 492, 492, 54, - 54, 492, 492, 54, 492, 492, 492, 54, 492, 492, 492, 492, 492, 54, 492, - 492, 492, 492, 492, 54, 54, 492, 492, 54, 54, 54, 54, 492, 492, 54, 54, - 492, 492, 54, 54, 492, 492, 492, 492, 492, 54, 492, 492, 492, 54, 492, - 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 492, 54, 492, 492, - 492, 492, 492, 492, 492, 520, 473, 491, 473, 491, 40, 40, 40, 40, 40, 40, - 508, 40, 40, 40, 40, 40, 40, 40, 521, 521, 40, 40, 40, 40, 492, 492, 40, - 40, 40, 40, 40, 40, 40, 522, 523, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 40, - 492, 40, 40, 40, 40, 40, 40, 40, 40, 313, 40, 40, 40, 40, 40, 492, 492, - 492, 492, 492, 492, 492, 492, 492, 40, 40, 40, 40, 40, 524, 524, 524, - 524, 40, 40, 40, 521, 525, 525, 521, 40, 40, 40, 40, 40, 40, 40, 40, 40, - 40, 40, 81, 40, 40, 40, 81, 81, 81, 81, 81, 51, 51, 51, 51, 51, 51, 51, - 51, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 526, 526, 526, 526, - 526, 526, 526, 526, 526, 526, 526, 526, 526, 526, 515, 51, 51, 51, 51, - 51, 51, 51, 51, 51, 51, 51, 51, 514, 508, 508, 508, 508, 508, 508, 508, - 508, 508, 508, 508, 508, 40, 40, 40, 40, 508, 508, 508, 508, 527, 40, 40, - 40, 40, 40, 508, 508, 508, 508, 40, 40, 508, 508, 40, 508, 508, 508, 508, - 508, 508, 508, 40, 40, 40, 40, 40, 40, 40, 40, 508, 508, 40, 40, 508, 54, - 40, 40, 40, 40, 508, 508, 40, 40, 508, 54, 40, 40, 40, 40, 508, 508, 508, - 40, 40, 508, 40, 40, 508, 508, 40, 40, 40, 40, 40, 40, 40, 508, 492, 492, - 492, 492, 492, 528, 528, 492, 525, 525, 525, 525, 40, 508, 508, 40, 40, - 508, 40, 40, 40, 40, 508, 508, 40, 40, 40, 40, 521, 521, 527, 527, 525, - 40, 525, 525, 529, 530, 529, 525, 40, 525, 525, 525, 40, 40, 40, 40, 508, - 40, 508, 40, 40, 40, 40, 40, 524, 524, 524, 524, 524, 524, 524, 524, 524, - 524, 524, 524, 40, 40, 40, 40, 508, 508, 40, 508, 508, 508, 40, 508, 529, - 508, 508, 40, 508, 508, 40, 54, 40, 40, 40, 40, 40, 40, 40, 521, 40, 40, - 40, 524, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 508, 508, 40, 524, 40, - 40, 40, 40, 40, 40, 40, 40, 524, 524, 313, 40, 40, 40, 40, 40, 40, 40, - 40, 521, 521, 529, 525, 525, 525, 525, 521, 521, 529, 529, 529, 508, 508, - 508, 508, 529, 524, 529, 529, 529, 508, 529, 521, 508, 508, 508, 529, - 529, 508, 508, 529, 508, 508, 529, 529, 529, 40, 508, 40, 40, 40, 40, - 508, 508, 521, 508, 508, 508, 508, 508, 508, 529, 521, 521, 529, 521, - 508, 529, 529, 531, 521, 508, 508, 521, 529, 529, 525, 525, 525, 525, - 525, 524, 40, 40, 525, 525, 532, 532, 530, 530, 40, 40, 524, 40, 40, 40, - 40, 40, 40, 40, 40, 40, 40, 40, 40, 44, 40, 40, 40, 40, 40, 40, 524, 40, - 524, 40, 40, 40, 40, 524, 524, 524, 40, 533, 40, 40, 40, 534, 534, 534, - 534, 534, 534, 40, 535, 535, 525, 40, 40, 40, 473, 491, 473, 491, 473, - 491, 473, 491, 473, 491, 473, 491, 473, 491, 51, 51, 515, 515, 515, 515, - 515, 515, 515, 515, 515, 515, 515, 515, 40, 524, 524, 524, 40, 40, 40, - 40, 40, 40, 40, 524, 492, 492, 492, 492, 492, 473, 491, 492, 492, 492, - 492, 492, 492, 492, 16, 31, 16, 31, 16, 31, 16, 31, 473, 491, 536, 536, - 536, 536, 536, 536, 536, 536, 492, 492, 492, 473, 491, 16, 31, 473, 491, - 473, 491, 473, 491, 473, 491, 473, 491, 492, 492, 492, 492, 492, 492, - 492, 473, 491, 473, 491, 492, 492, 492, 492, 492, 492, 492, 492, 473, - 491, 492, 492, 40, 40, 40, 524, 524, 40, 40, 40, 492, 492, 492, 492, 492, - 40, 40, 492, 492, 492, 492, 492, 492, 40, 40, 40, 524, 40, 40, 40, 40, - 533, 508, 508, 40, 40, 40, 40, 81, 81, 40, 40, 40, 40, 40, 40, 40, 40, - 81, 81, 40, 40, 81, 81, 81, 40, 40, 40, 40, 81, 40, 40, 40, 40, 40, 40, - 81, 81, 81, 81, 40, 40, 40, 40, 537, 537, 537, 537, 537, 537, 537, 537, - 537, 537, 537, 537, 537, 537, 537, 81, 538, 538, 538, 538, 538, 538, 538, - 538, 538, 538, 538, 538, 538, 538, 538, 81, 52, 56, 52, 52, 52, 56, 56, - 52, 56, 52, 56, 52, 56, 52, 52, 52, 52, 56, 52, 56, 56, 52, 56, 56, 56, - 56, 56, 56, 59, 59, 52, 52, 87, 88, 87, 88, 88, 539, 539, 539, 539, 539, - 539, 87, 88, 87, 88, 540, 540, 540, 87, 88, 81, 81, 81, 81, 81, 541, 542, - 542, 542, 543, 541, 542, 544, 544, 544, 544, 544, 544, 544, 544, 544, - 544, 544, 544, 544, 544, 81, 544, 81, 81, 81, 81, 81, 544, 81, 81, 545, - 545, 545, 545, 545, 545, 545, 545, 81, 81, 81, 81, 81, 81, 81, 546, 547, - 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 548, 95, 95, 95, - 95, 95, 95, 95, 95, 549, 549, 42, 50, 42, 50, 549, 549, 549, 42, 50, 549, - 42, 50, 373, 373, 373, 373, 373, 373, 373, 373, 84, 468, 550, 373, 551, - 84, 42, 50, 84, 84, 42, 50, 473, 491, 473, 491, 473, 491, 473, 491, 373, - 373, 373, 373, 371, 60, 373, 373, 84, 373, 373, 84, 84, 84, 84, 84, 552, - 552, 373, 373, 373, 84, 468, 373, 473, 373, 373, 373, 373, 373, 373, 373, - 81, 81, 81, 81, 81, 81, 553, 553, 553, 553, 553, 553, 553, 553, 553, 553, - 81, 553, 553, 553, 553, 553, 553, 553, 553, 553, 81, 81, 81, 81, 553, - 553, 553, 553, 553, 553, 81, 81, 521, 521, 521, 521, 521, 521, 521, 521, - 521, 521, 521, 521, 81, 81, 81, 81, 554, 555, 555, 556, 521, 557, 558, - 559, 522, 523, 522, 523, 522, 523, 522, 523, 522, 523, 521, 521, 522, - 523, 522, 523, 522, 523, 522, 523, 560, 522, 523, 523, 521, 559, 559, - 559, 559, 559, 559, 559, 559, 559, 561, 562, 563, 564, 565, 565, 566, - 567, 567, 567, 567, 568, 521, 521, 559, 559, 559, 557, 569, 556, 521, - 525, 81, 570, 571, 570, 571, 570, 571, 570, 571, 570, 571, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 570, - 571, 571, 571, 571, 571, 571, 571, 570, 571, 570, 571, 570, 571, 571, - 571, 571, 571, 571, 570, 571, 571, 571, 571, 571, 571, 570, 570, 81, 81, - 572, 572, 573, 573, 574, 574, 571, 560, 575, 576, 575, 576, 575, 576, - 575, 576, 575, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, 576, - 576, 576, 576, 576, 576, 576, 575, 576, 576, 576, 576, 576, 576, 576, - 575, 576, 575, 576, 575, 576, 576, 576, 576, 576, 576, 575, 576, 576, - 576, 576, 576, 576, 575, 575, 576, 576, 576, 576, 577, 578, 579, 579, - 576, 81, 81, 81, 81, 81, 580, 580, 580, 580, 580, 580, 580, 580, 580, - 580, 580, 580, 580, 580, 580, 580, 580, 580, 81, 81, 581, 581, 581, 581, - 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, 581, - 581, 581, 581, 581, 81, 582, 582, 583, 583, 583, 583, 582, 582, 582, 582, - 582, 582, 582, 582, 582, 582, 580, 580, 580, 81, 81, 81, 81, 81, 575, - 575, 575, 575, 575, 575, 575, 575, 584, 584, 584, 584, 584, 584, 584, - 584, 584, 584, 584, 584, 584, 585, 585, 81, 583, 583, 583, 583, 583, 583, - 583, 583, 583, 583, 582, 582, 582, 582, 582, 582, 586, 586, 586, 586, - 586, 586, 586, 586, 521, 587, 587, 587, 587, 587, 587, 587, 587, 587, - 587, 587, 587, 587, 587, 587, 584, 584, 584, 584, 585, 585, 585, 582, - 582, 587, 587, 587, 587, 587, 587, 587, 582, 582, 582, 582, 521, 521, - 521, 521, 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, 588, - 588, 588, 588, 81, 582, 582, 582, 582, 582, 582, 582, 521, 521, 521, 521, - 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 582, 521, 521, 589, - 589, 589, 589, 589, 589, 589, 589, 589, 589, 589, 589, 589, 589, 590, - 590, 590, 590, 590, 590, 590, 590, 590, 590, 589, 589, 589, 590, 590, - 590, 590, 590, 591, 591, 591, 591, 591, 591, 591, 591, 591, 591, 591, - 591, 591, 592, 591, 591, 591, 591, 591, 591, 591, 81, 81, 81, 593, 593, - 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 593, 81, 594, - 594, 594, 594, 594, 594, 594, 594, 595, 595, 595, 595, 595, 595, 596, - 596, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 597, 598, - 599, 600, 599, 601, 601, 601, 601, 601, 601, 601, 601, 601, 601, 597, - 597, 81, 81, 81, 81, 90, 93, 90, 93, 90, 93, 602, 95, 97, 97, 97, 603, - 95, 95, 95, 95, 95, 95, 95, 95, 95, 95, 603, 604, 90, 93, 90, 93, 450, - 450, 95, 95, 605, 605, 605, 605, 605, 605, 605, 605, 605, 605, 605, 605, - 605, 605, 606, 606, 606, 606, 606, 606, 606, 606, 606, 606, 607, 607, - 608, 609, 609, 609, 609, 609, 62, 62, 62, 62, 62, 62, 62, 60, 60, 60, 60, - 60, 60, 60, 60, 60, 62, 62, 52, 56, 52, 56, 52, 56, 56, 56, 52, 56, 52, - 56, 52, 56, 59, 56, 56, 56, 56, 56, 56, 56, 56, 52, 56, 52, 56, 52, 52, - 56, 60, 610, 610, 52, 56, 52, 56, 57, 52, 56, 52, 56, 56, 56, 52, 56, 52, - 56, 52, 52, 52, 52, 52, 81, 52, 52, 52, 52, 52, 56, 52, 56, 81, 81, 81, - 81, 81, 81, 81, 57, 59, 59, 56, 57, 57, 57, 57, 57, 611, 611, 612, 611, - 611, 611, 613, 611, 611, 611, 611, 612, 611, 611, 611, 611, 611, 611, - 611, 611, 611, 611, 611, 611, 611, 611, 611, 614, 614, 612, 612, 614, - 615, 615, 615, 615, 81, 81, 81, 81, 616, 616, 616, 616, 616, 616, 313, - 313, 503, 512, 81, 81, 81, 81, 81, 81, 617, 617, 617, 617, 617, 617, 617, - 617, 617, 617, 617, 617, 618, 618, 619, 619, 620, 620, 621, 621, 621, - 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, 621, - 621, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, 620, - 620, 620, 620, 622, 623, 81, 81, 81, 81, 81, 81, 81, 81, 624, 624, 625, - 625, 625, 625, 625, 625, 625, 625, 625, 625, 81, 81, 81, 81, 81, 81, 197, - 197, 197, 197, 197, 197, 197, 197, 197, 197, 194, 194, 194, 194, 194, - 194, 200, 200, 200, 194, 626, 194, 81, 81, 627, 627, 627, 627, 627, 627, - 627, 627, 627, 627, 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, - 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, 629, 629, 629, 629, - 629, 630, 630, 630, 198, 631, 632, 632, 632, 632, 632, 632, 632, 632, - 632, 632, 632, 632, 632, 632, 632, 633, 633, 633, 633, 633, 633, 633, - 633, 633, 633, 633, 634, 635, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 636, 328, 328, 328, 328, 328, 81, 81, 81, 637, 637, 637, 638, 639, 639, - 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 639, 640, - 638, 638, 637, 637, 637, 637, 638, 638, 637, 638, 638, 638, 641, 642, - 642, 642, 642, 642, 642, 643, 643, 643, 642, 642, 642, 642, 81, 61, 644, - 644, 644, 644, 644, 644, 644, 644, 644, 644, 81, 81, 81, 81, 642, 642, - 314, 314, 314, 314, 314, 316, 645, 314, 319, 319, 314, 314, 314, 314, - 314, 81, 646, 646, 646, 646, 646, 646, 646, 646, 646, 647, 647, 647, 647, - 647, 647, 648, 648, 647, 647, 648, 648, 647, 647, 81, 646, 646, 646, 647, - 646, 646, 646, 646, 646, 646, 646, 646, 647, 648, 81, 81, 649, 649, 649, - 649, 649, 649, 649, 649, 649, 649, 81, 81, 650, 651, 651, 651, 645, 314, - 314, 314, 314, 314, 314, 323, 323, 323, 314, 315, 316, 315, 314, 314, - 652, 652, 652, 652, 652, 652, 652, 652, 653, 652, 653, 653, 654, 652, - 652, 653, 653, 652, 652, 652, 652, 652, 653, 653, 652, 653, 652, 81, 81, - 81, 81, 81, 81, 81, 81, 652, 652, 655, 656, 656, 657, 657, 657, 657, 657, - 657, 657, 657, 657, 657, 657, 658, 659, 659, 658, 658, 660, 660, 657, - 661, 661, 658, 662, 81, 81, 331, 331, 331, 331, 331, 331, 81, 56, 56, 56, - 610, 59, 59, 59, 59, 56, 56, 56, 56, 56, 79, 81, 81, 338, 338, 338, 338, - 338, 338, 338, 338, 657, 657, 657, 658, 658, 659, 658, 658, 659, 658, - 658, 660, 658, 662, 81, 81, 663, 663, 663, 663, 663, 663, 663, 663, 663, - 663, 81, 81, 81, 81, 81, 81, 664, 665, 665, 665, 665, 665, 665, 665, 665, - 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, 665, 664, 665, 665, - 665, 665, 665, 665, 665, 81, 81, 81, 81, 329, 329, 329, 329, 329, 329, - 329, 81, 81, 81, 81, 330, 330, 330, 330, 330, 330, 330, 330, 330, 81, 81, - 81, 81, 666, 666, 666, 666, 666, 666, 666, 666, 667, 667, 667, 667, 667, - 667, 667, 667, 589, 589, 590, 590, 590, 590, 590, 590, 56, 56, 56, 56, - 56, 56, 56, 81, 81, 81, 81, 101, 101, 101, 101, 101, 81, 81, 81, 81, 81, - 129, 668, 129, 129, 669, 129, 129, 129, 129, 129, 129, 129, 129, 129, - 129, 129, 129, 129, 81, 129, 129, 129, 129, 129, 81, 129, 81, 129, 129, - 81, 129, 129, 81, 129, 129, 146, 146, 670, 670, 670, 670, 670, 670, 670, - 670, 670, 670, 670, 670, 670, 670, 670, 670, 81, 81, 81, 81, 81, 81, 81, - 81, 81, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 491, 473, - 81, 81, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 135, 138, 81, - 81, 671, 671, 671, 671, 671, 671, 671, 671, 672, 555, 555, 672, 672, 673, - 673, 522, 523, 674, 81, 81, 81, 81, 81, 81, 96, 96, 96, 96, 96, 96, 96, - 156, 156, 156, 156, 156, 156, 156, 95, 95, 556, 566, 566, 675, 675, 522, - 523, 522, 523, 522, 523, 522, 523, 522, 523, 522, 523, 522, 523, 522, - 523, 556, 556, 522, 523, 556, 556, 556, 556, 675, 675, 675, 676, 556, - 676, 81, 577, 677, 673, 673, 566, 522, 523, 522, 523, 522, 523, 678, 556, - 556, 679, 680, 681, 681, 681, 81, 556, 682, 683, 556, 81, 81, 81, 81, - 146, 146, 146, 146, 146, 81, 81, 493, 81, 684, 685, 686, 687, 688, 685, - 685, 689, 690, 685, 691, 692, 693, 692, 694, 695, 695, 695, 695, 695, - 695, 695, 695, 695, 695, 696, 697, 698, 698, 698, 684, 685, 699, 699, - 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, 699, - 699, 699, 689, 685, 690, 700, 701, 700, 702, 702, 702, 702, 702, 702, - 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, 689, 698, - 690, 698, 689, 690, 703, 704, 705, 703, 706, 707, 708, 708, 708, 708, - 708, 708, 708, 708, 708, 709, 707, 707, 707, 707, 707, 707, 707, 707, - 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, 707, 710, - 710, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, 711, - 711, 711, 81, 81, 81, 711, 711, 711, 711, 711, 711, 81, 81, 711, 711, - 711, 81, 81, 81, 712, 687, 698, 700, 713, 687, 687, 81, 714, 715, 715, - 715, 715, 714, 714, 81, 81, 716, 716, 716, 717, 508, 81, 81, 718, 718, - 718, 718, 718, 718, 718, 718, 718, 718, 718, 718, 81, 718, 718, 718, 718, - 718, 718, 718, 718, 718, 718, 81, 718, 718, 718, 81, 718, 718, 81, 718, - 718, 718, 718, 718, 718, 718, 81, 81, 718, 718, 718, 81, 81, 81, 81, 81, - 198, 373, 198, 81, 81, 81, 81, 616, 616, 616, 616, 616, 616, 616, 616, - 616, 616, 616, 616, 616, 81, 81, 81, 313, 719, 719, 719, 719, 719, 719, - 719, 719, 719, 719, 719, 719, 719, 720, 720, 720, 720, 721, 721, 721, - 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, - 720, 720, 721, 722, 722, 81, 40, 40, 40, 40, 81, 81, 81, 81, 721, 81, 81, - 81, 81, 81, 81, 81, 313, 313, 313, 313, 313, 156, 81, 81, 723, 723, 723, - 723, 723, 723, 723, 723, 723, 723, 723, 723, 723, 81, 81, 81, 724, 724, - 724, 724, 724, 724, 724, 724, 724, 81, 81, 81, 81, 81, 81, 81, 156, 500, - 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, - 500, 500, 500, 500, 81, 81, 81, 81, 725, 725, 725, 725, 725, 725, 725, - 725, 726, 726, 726, 726, 81, 81, 81, 81, 81, 81, 81, 81, 81, 725, 725, - 725, 727, 727, 727, 727, 727, 727, 727, 727, 727, 728, 727, 727, 727, - 727, 727, 727, 727, 727, 728, 81, 81, 81, 81, 81, 729, 729, 729, 729, - 729, 729, 729, 729, 729, 729, 729, 729, 729, 729, 730, 730, 730, 730, - 730, 81, 81, 81, 81, 81, 731, 731, 731, 731, 731, 731, 731, 731, 731, - 731, 731, 731, 731, 731, 81, 732, 733, 733, 733, 733, 733, 733, 733, 733, - 733, 733, 733, 733, 81, 81, 81, 81, 734, 735, 735, 735, 735, 735, 81, 81, - 736, 736, 736, 736, 736, 736, 736, 736, 737, 737, 737, 737, 737, 737, - 737, 737, 738, 738, 738, 738, 738, 738, 738, 738, 739, 739, 739, 739, - 739, 739, 739, 739, 739, 739, 739, 739, 739, 739, 81, 81, 740, 740, 740, - 740, 740, 740, 740, 740, 740, 740, 81, 81, 81, 81, 81, 81, 741, 741, 741, - 741, 741, 741, 741, 741, 741, 741, 741, 741, 81, 81, 81, 81, 742, 742, - 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, 81, 81, 81, 81, 743, - 743, 743, 743, 743, 743, 743, 743, 744, 744, 744, 744, 744, 744, 744, - 744, 744, 744, 744, 744, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 745, - 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, 746, - 746, 81, 746, 746, 746, 746, 746, 746, 81, 81, 747, 747, 747, 747, 747, - 747, 81, 81, 747, 81, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, - 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 81, 747, 747, 81, 81, - 81, 747, 81, 81, 747, 748, 748, 748, 748, 748, 748, 748, 748, 748, 748, - 748, 748, 748, 748, 81, 749, 750, 750, 750, 750, 750, 750, 750, 750, 751, - 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, - 752, 752, 753, 753, 753, 753, 753, 753, 753, 754, 754, 754, 754, 754, - 754, 754, 754, 754, 754, 754, 754, 754, 754, 754, 81, 81, 81, 81, 81, 81, - 81, 81, 755, 755, 755, 755, 755, 755, 755, 755, 755, 756, 756, 756, 756, - 756, 756, 756, 756, 756, 756, 756, 81, 756, 756, 81, 81, 81, 81, 81, 757, - 757, 757, 757, 757, 758, 758, 758, 758, 758, 758, 758, 758, 758, 758, - 758, 758, 758, 758, 759, 759, 759, 759, 759, 759, 81, 81, 81, 760, 761, - 761, 761, 761, 761, 761, 761, 761, 761, 761, 81, 81, 81, 81, 81, 762, - 763, 763, 763, 763, 763, 763, 763, 763, 764, 764, 764, 764, 764, 764, - 764, 764, 81, 81, 81, 81, 765, 765, 764, 764, 765, 765, 765, 765, 765, - 765, 765, 765, 81, 81, 765, 765, 765, 765, 765, 765, 766, 767, 767, 767, - 81, 767, 767, 81, 81, 81, 81, 81, 767, 768, 767, 769, 766, 766, 766, 766, - 81, 766, 766, 766, 81, 766, 766, 766, 766, 766, 766, 766, 766, 766, 766, - 766, 766, 766, 766, 766, 766, 766, 766, 766, 81, 81, 81, 81, 769, 770, - 768, 81, 81, 81, 81, 771, 772, 772, 772, 772, 772, 772, 772, 772, 773, - 773, 773, 773, 773, 773, 773, 773, 774, 81, 81, 81, 81, 81, 81, 81, 775, - 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 775, 776, 776, - 777, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, - 779, 779, 779, 780, 780, 780, 780, 780, 780, 780, 780, 781, 780, 780, - 780, 780, 780, 780, 780, 780, 780, 780, 780, 780, 782, 783, 81, 81, 81, - 81, 784, 784, 784, 784, 784, 785, 785, 785, 785, 785, 785, 786, 81, 787, - 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 787, 81, 81, - 81, 788, 788, 788, 788, 788, 788, 788, 789, 789, 789, 789, 789, 789, 789, - 789, 789, 789, 789, 789, 789, 789, 81, 81, 790, 790, 790, 790, 790, 790, - 790, 790, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 791, 81, 81, - 81, 81, 81, 792, 792, 792, 792, 792, 792, 792, 792, 793, 793, 793, 793, - 793, 793, 793, 793, 793, 793, 81, 81, 81, 81, 81, 81, 81, 794, 794, 794, - 794, 81, 81, 81, 81, 795, 795, 795, 795, 795, 795, 795, 796, 796, 796, + 81, 99, 100, 100, 100, 100, 100, 100, 101, 101, 101, 101, 101, 101, 101, + 101, 101, 102, 103, 81, 81, 104, 104, 105, 81, 106, 107, 107, 107, 107, + 106, 107, 107, 107, 108, 106, 107, 107, 107, 107, 107, 107, 106, 106, + 106, 106, 106, 106, 107, 107, 106, 107, 107, 108, 109, 107, 110, 111, + 112, 113, 114, 115, 116, 117, 118, 119, 119, 120, 121, 122, 123, 124, + 125, 126, 127, 125, 107, 106, 128, 118, 81, 81, 81, 81, 81, 81, 81, 81, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 81, 81, 81, 81, + 129, 129, 129, 129, 125, 125, 81, 81, 81, 130, 130, 130, 130, 130, 131, + 132, 132, 133, 134, 134, 135, 136, 137, 138, 138, 139, 139, 139, 139, + 139, 139, 139, 139, 140, 141, 142, 143, 144, 81, 145, 143, 146, 146, 146, + 146, 146, 146, 146, 146, 147, 146, 146, 146, 146, 146, 146, 146, 146, + 146, 146, 148, 149, 150, 151, 152, 153, 154, 155, 96, 96, 156, 157, 139, + 139, 139, 139, 139, 157, 139, 139, 157, 158, 158, 158, 158, 158, 158, + 158, 158, 158, 158, 134, 159, 159, 160, 146, 146, 161, 146, 146, 146, + 146, 146, 146, 146, 146, 146, 146, 146, 145, 146, 139, 139, 139, 139, + 139, 139, 139, 131, 138, 139, 139, 139, 139, 157, 139, 162, 162, 139, + 139, 138, 157, 139, 139, 157, 146, 146, 163, 163, 163, 163, 163, 163, + 163, 163, 163, 163, 146, 146, 146, 164, 164, 146, 165, 165, 165, 165, + 165, 165, 165, 165, 165, 165, 165, 165, 165, 165, 81, 166, 167, 168, 167, + 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 167, 169, + 170, 169, 169, 170, 169, 169, 170, 170, 170, 169, 170, 170, 169, 170, + 169, 169, 169, 170, 169, 170, 169, 170, 169, 170, 169, 169, 81, 81, 167, + 167, 167, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, 171, + 171, 171, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 172, 171, 81, + 81, 81, 81, 81, 81, 173, 173, 173, 173, 173, 173, 173, 173, 173, 173, + 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, 174, + 174, 174, 174, 175, 175, 175, 175, 175, 175, 175, 176, 175, 177, 177, + 178, 179, 180, 181, 177, 81, 81, 176, 182, 182, 183, 183, 183, 183, 183, + 183, 183, 183, 183, 183, 183, 183, 183, 183, 184, 184, 184, 184, 185, + 184, 184, 184, 184, 184, 184, 184, 184, 184, 185, 184, 184, 184, 185, + 184, 184, 184, 184, 184, 81, 81, 186, 186, 186, 186, 186, 186, 186, 186, + 186, 186, 186, 186, 186, 186, 186, 81, 187, 187, 187, 187, 187, 187, 187, + 187, 187, 188, 188, 188, 81, 81, 189, 81, 167, 167, 167, 81, 81, 81, 81, + 81, 146, 146, 146, 146, 146, 81, 146, 146, 146, 146, 146, 146, 146, 146, + 81, 81, 81, 81, 81, 157, 139, 139, 139, 139, 139, 139, 131, 157, 139, + 139, 157, 139, 139, 157, 139, 139, 139, 157, 157, 157, 190, 191, 192, + 139, 139, 139, 157, 139, 139, 157, 157, 139, 139, 139, 139, 139, 193, + 193, 193, 194, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, 195, + 195, 195, 195, 193, 194, 196, 195, 194, 194, 194, 193, 193, 193, 193, + 193, 193, 193, 193, 194, 194, 194, 194, 197, 194, 194, 195, 96, 156, 198, + 198, 193, 193, 193, 195, 195, 193, 193, 199, 199, 200, 200, 200, 200, + 200, 200, 200, 200, 200, 200, 201, 202, 195, 195, 195, 195, 195, 195, + 203, 204, 205, 205, 81, 203, 203, 203, 203, 203, 203, 203, 203, 81, 81, + 203, 203, 81, 81, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, 203, + 203, 203, 203, 81, 203, 203, 203, 203, 203, 203, 203, 81, 203, 81, 81, + 81, 203, 203, 203, 203, 81, 81, 206, 203, 205, 205, 205, 204, 204, 204, + 204, 81, 81, 205, 205, 81, 81, 205, 205, 207, 203, 81, 81, 81, 81, 81, + 81, 81, 81, 205, 81, 81, 81, 81, 203, 203, 81, 203, 203, 203, 204, 204, + 81, 81, 208, 208, 208, 208, 208, 208, 208, 208, 208, 208, 203, 203, 209, + 209, 210, 210, 210, 210, 210, 211, 212, 213, 203, 214, 215, 81, 81, 216, + 216, 217, 81, 218, 218, 218, 218, 218, 218, 81, 81, 81, 81, 218, 218, 81, + 81, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, 218, + 81, 218, 218, 218, 218, 218, 218, 218, 81, 218, 218, 81, 218, 218, 81, + 218, 218, 81, 81, 219, 81, 217, 217, 217, 216, 216, 81, 81, 81, 81, 216, + 216, 81, 81, 216, 216, 220, 81, 81, 81, 216, 81, 81, 81, 81, 81, 81, 81, + 218, 218, 218, 218, 81, 218, 81, 81, 81, 81, 81, 81, 81, 221, 221, 221, + 221, 221, 221, 221, 221, 221, 221, 216, 216, 218, 218, 218, 216, 222, 81, + 81, 223, 223, 224, 81, 225, 225, 225, 225, 225, 225, 225, 225, 225, 81, + 225, 225, 225, 81, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, 225, + 225, 225, 225, 81, 225, 225, 225, 225, 225, 225, 225, 81, 225, 225, 81, + 225, 225, 225, 225, 225, 81, 81, 226, 225, 224, 224, 224, 223, 223, 223, + 223, 223, 81, 223, 223, 224, 81, 224, 224, 227, 81, 81, 225, 81, 81, 81, + 81, 81, 81, 81, 225, 225, 223, 223, 81, 81, 228, 228, 228, 228, 228, 228, + 228, 228, 228, 228, 229, 230, 81, 81, 81, 81, 81, 81, 81, 225, 223, 223, + 223, 223, 223, 223, 81, 231, 232, 232, 81, 233, 233, 233, 233, 233, 233, + 233, 233, 81, 81, 233, 233, 81, 81, 233, 233, 233, 233, 233, 233, 233, + 233, 233, 233, 233, 233, 233, 233, 81, 233, 233, 233, 233, 233, 233, 233, + 81, 233, 233, 81, 233, 233, 233, 233, 233, 81, 81, 234, 233, 232, 231, + 232, 231, 231, 231, 231, 81, 81, 232, 232, 81, 81, 232, 232, 235, 81, 81, + 81, 81, 81, 81, 81, 81, 231, 232, 81, 81, 81, 81, 233, 233, 81, 233, 233, + 233, 231, 231, 81, 81, 236, 236, 236, 236, 236, 236, 236, 236, 236, 236, + 237, 233, 238, 238, 238, 238, 238, 238, 81, 81, 239, 240, 81, 240, 240, + 240, 240, 240, 240, 81, 81, 81, 240, 240, 240, 81, 240, 240, 240, 240, + 81, 81, 81, 240, 240, 81, 240, 81, 240, 240, 81, 81, 81, 240, 240, 81, + 81, 81, 240, 240, 240, 240, 240, 240, 240, 240, 240, 240, 81, 81, 81, 81, + 241, 241, 239, 241, 241, 81, 81, 81, 241, 241, 241, 81, 241, 241, 241, + 242, 81, 81, 240, 81, 81, 81, 81, 81, 81, 241, 81, 81, 81, 81, 81, 81, + 243, 243, 243, 243, 243, 243, 243, 243, 243, 243, 244, 244, 244, 245, + 245, 245, 245, 245, 245, 246, 245, 81, 81, 81, 81, 81, 247, 248, 248, + 248, 247, 249, 249, 249, 249, 249, 249, 249, 249, 81, 249, 249, 249, 81, + 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, 249, + 249, 249, 81, 81, 81, 249, 247, 247, 247, 248, 248, 248, 248, 81, 247, + 247, 247, 81, 247, 247, 247, 250, 81, 81, 81, 81, 81, 81, 81, 251, 252, + 81, 249, 249, 249, 81, 81, 81, 81, 81, 249, 249, 247, 247, 81, 81, 253, + 253, 253, 253, 253, 253, 253, 253, 253, 253, 254, 254, 254, 254, 254, + 254, 254, 255, 256, 257, 258, 258, 259, 256, 256, 256, 256, 256, 256, + 256, 256, 81, 256, 256, 256, 81, 256, 256, 256, 256, 256, 256, 256, 256, + 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 81, 256, 256, 256, 256, + 256, 81, 81, 260, 256, 258, 261, 258, 258, 258, 258, 258, 81, 261, 258, + 258, 81, 258, 258, 257, 262, 81, 81, 81, 81, 81, 81, 81, 258, 258, 81, + 81, 81, 81, 81, 81, 81, 256, 81, 256, 256, 257, 257, 81, 81, 263, 263, + 263, 263, 263, 263, 263, 263, 263, 263, 81, 256, 256, 81, 81, 81, 81, 81, + 264, 264, 265, 265, 81, 266, 266, 266, 266, 266, 266, 266, 266, 81, 266, + 266, 266, 81, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, 266, + 266, 266, 266, 266, 266, 267, 267, 266, 265, 265, 265, 264, 264, 264, + 264, 81, 265, 265, 265, 81, 265, 265, 265, 267, 266, 268, 81, 81, 81, 81, + 266, 266, 266, 265, 269, 269, 269, 269, 269, 269, 269, 266, 266, 266, + 264, 264, 81, 81, 270, 270, 270, 270, 270, 270, 270, 270, 270, 270, 269, + 269, 269, 269, 269, 269, 269, 269, 269, 271, 266, 266, 266, 266, 266, + 266, 81, 81, 272, 272, 81, 273, 273, 273, 273, 273, 273, 273, 273, 273, + 273, 273, 273, 273, 273, 273, 273, 273, 273, 81, 81, 81, 273, 273, 273, + 273, 273, 273, 273, 273, 81, 273, 273, 273, 273, 273, 273, 273, 273, 273, + 81, 273, 81, 81, 81, 81, 274, 81, 81, 81, 81, 272, 272, 272, 275, 275, + 275, 81, 275, 81, 272, 272, 272, 272, 272, 272, 272, 272, 81, 81, 81, 81, + 81, 81, 276, 276, 276, 276, 276, 276, 276, 276, 276, 276, 81, 81, 272, + 272, 277, 81, 81, 81, 81, 278, 278, 278, 278, 278, 278, 278, 278, 278, + 278, 278, 278, 278, 278, 278, 278, 279, 278, 278, 279, 279, 279, 279, + 280, 280, 281, 81, 81, 81, 81, 282, 278, 278, 278, 278, 278, 278, 283, + 279, 284, 284, 284, 284, 279, 279, 279, 285, 286, 286, 286, 286, 286, + 286, 286, 286, 286, 286, 287, 287, 81, 81, 81, 81, 81, 288, 288, 81, 288, + 81, 81, 288, 288, 81, 288, 81, 81, 288, 81, 81, 81, 81, 81, 81, 288, 288, + 288, 288, 81, 288, 288, 288, 288, 288, 288, 288, 81, 288, 288, 288, 81, + 288, 81, 288, 81, 81, 288, 288, 81, 288, 288, 288, 288, 289, 288, 288, + 289, 289, 289, 289, 290, 290, 81, 289, 289, 288, 81, 81, 288, 288, 288, + 288, 288, 81, 291, 81, 292, 292, 292, 292, 289, 289, 81, 81, 293, 293, + 293, 293, 293, 293, 293, 293, 293, 293, 81, 81, 288, 288, 288, 288, 294, + 295, 295, 295, 296, 297, 296, 296, 298, 296, 296, 299, 298, 300, 300, + 300, 300, 300, 298, 301, 300, 301, 301, 301, 302, 302, 301, 301, 301, + 301, 301, 301, 303, 303, 303, 303, 303, 303, 303, 303, 303, 303, 304, + 304, 304, 304, 304, 304, 304, 304, 304, 304, 305, 302, 301, 302, 301, + 306, 307, 308, 307, 308, 309, 309, 294, 294, 294, 294, 294, 294, 294, + 294, 81, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 294, 81, + 81, 81, 81, 310, 311, 312, 313, 312, 312, 312, 312, 312, 311, 311, 311, + 311, 312, 314, 311, 312, 315, 315, 316, 299, 315, 315, 294, 294, 294, + 294, 294, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 81, 312, + 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 312, 81, 305, 305, 301, + 301, 301, 301, 301, 301, 302, 301, 301, 301, 301, 301, 301, 81, 301, 301, + 296, 296, 299, 296, 297, 317, 317, 317, 317, 298, 298, 81, 81, 81, 81, + 81, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 318, 319, 319, 320, + 320, 320, 320, 319, 320, 320, 320, 320, 320, 321, 319, 322, 322, 319, + 319, 320, 320, 318, 323, 323, 323, 323, 323, 323, 323, 323, 323, 323, + 324, 324, 325, 325, 325, 325, 318, 318, 318, 318, 318, 318, 319, 319, + 320, 320, 318, 318, 318, 318, 320, 320, 320, 318, 319, 319, 319, 318, + 318, 319, 319, 319, 319, 319, 319, 319, 318, 318, 318, 320, 320, 320, + 320, 318, 318, 318, 318, 318, 320, 319, 319, 320, 320, 319, 319, 319, + 319, 319, 319, 326, 318, 319, 323, 323, 319, 319, 319, 320, 327, 327, + 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 328, 81, + 328, 81, 81, 81, 81, 81, 328, 81, 81, 329, 329, 329, 329, 329, 329, 329, + 329, 329, 329, 329, 330, 331, 329, 329, 329, 332, 332, 332, 332, 332, + 332, 332, 332, 333, 333, 333, 333, 333, 333, 333, 333, 334, 334, 334, + 334, 334, 334, 334, 334, 335, 335, 335, 335, 335, 335, 335, 335, 335, 81, + 335, 335, 335, 335, 81, 81, 335, 335, 335, 335, 335, 335, 335, 81, 335, + 335, 335, 81, 81, 336, 336, 336, 337, 338, 337, 337, 337, 337, 337, 337, + 337, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, 339, + 339, 339, 339, 339, 339, 339, 339, 81, 81, 81, 340, 340, 340, 340, 340, + 340, 340, 340, 340, 340, 81, 81, 81, 81, 81, 81, 341, 341, 341, 341, 341, + 341, 341, 341, 341, 341, 341, 341, 341, 341, 81, 81, 342, 342, 342, 342, + 342, 342, 81, 81, 343, 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, + 344, 344, 344, 344, 344, 344, 344, 344, 344, 344, 345, 345, 344, 346, + 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, 347, + 347, 347, 347, 347, 348, 349, 81, 81, 81, 350, 350, 350, 350, 350, 350, + 350, 350, 350, 350, 350, 199, 199, 199, 351, 351, 351, 350, 350, 350, + 350, 350, 350, 350, 350, 81, 81, 81, 81, 81, 81, 81, 352, 352, 352, 352, + 352, 352, 352, 352, 352, 352, 352, 352, 352, 81, 352, 352, 352, 352, 353, + 353, 354, 81, 81, 81, 355, 355, 355, 355, 355, 355, 355, 355, 355, 355, + 356, 356, 357, 199, 199, 81, 358, 358, 358, 358, 358, 358, 358, 358, 358, + 358, 359, 359, 81, 81, 81, 81, 360, 360, 360, 360, 360, 360, 360, 360, + 360, 360, 360, 360, 360, 81, 360, 360, 360, 81, 361, 361, 81, 81, 81, 81, + 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 362, 363, 363, + 364, 363, 363, 363, 363, 363, 363, 363, 364, 364, 364, 364, 364, 364, + 364, 364, 363, 364, 364, 363, 363, 363, 363, 363, 363, 363, 363, 363, + 365, 363, 366, 366, 367, 368, 366, 369, 366, 370, 362, 371, 81, 81, 372, + 372, 372, 372, 372, 372, 372, 372, 372, 372, 81, 81, 81, 81, 81, 81, 373, + 373, 373, 373, 373, 373, 373, 373, 373, 373, 81, 81, 81, 81, 81, 81, 374, + 374, 375, 375, 376, 377, 378, 374, 379, 379, 374, 380, 380, 380, 381, 81, + 382, 382, 382, 382, 382, 382, 382, 382, 382, 382, 81, 81, 81, 81, 81, 81, + 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 383, 384, 383, 383, + 383, 383, 383, 81, 81, 81, 81, 81, 81, 81, 383, 383, 383, 383, 383, 380, + 380, 383, 383, 385, 383, 81, 81, 81, 81, 81, 344, 344, 344, 344, 344, + 344, 81, 81, 386, 386, 386, 386, 386, 386, 386, 386, 386, 386, 386, 386, + 386, 386, 386, 81, 387, 387, 387, 388, 388, 388, 388, 387, 387, 388, 388, + 388, 81, 81, 81, 81, 388, 388, 387, 388, 388, 388, 388, 388, 388, 389, + 390, 391, 81, 81, 81, 81, 392, 81, 81, 81, 393, 393, 394, 394, 394, 394, + 394, 394, 394, 394, 394, 394, 395, 395, 395, 395, 395, 395, 395, 395, + 395, 395, 395, 395, 395, 395, 81, 81, 395, 395, 395, 395, 395, 81, 81, + 81, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 396, 81, 81, + 81, 81, 396, 396, 81, 81, 81, 81, 81, 81, 397, 397, 397, 397, 397, 397, + 397, 397, 397, 397, 398, 81, 81, 81, 399, 399, 400, 400, 400, 400, 400, + 400, 400, 400, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, 401, + 401, 401, 401, 401, 402, 403, 404, 404, 405, 81, 81, 406, 406, 407, 407, + 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, 407, 408, 409, 408, + 409, 409, 409, 409, 409, 409, 409, 81, 410, 408, 409, 408, 408, 409, 409, + 409, 409, 409, 409, 409, 409, 408, 408, 408, 408, 408, 408, 409, 409, + 411, 411, 411, 411, 411, 411, 411, 411, 81, 81, 412, 413, 413, 413, 413, + 413, 413, 413, 413, 413, 413, 81, 81, 81, 81, 81, 81, 414, 414, 414, 414, + 414, 414, 414, 415, 414, 414, 414, 414, 414, 414, 81, 81, 96, 96, 96, 96, + 96, 156, 156, 156, 156, 156, 156, 96, 96, 156, 416, 81, 417, 417, 417, + 417, 418, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, 419, + 419, 419, 419, 420, 418, 417, 417, 417, 417, 417, 418, 417, 418, 418, + 418, 418, 418, 417, 418, 421, 419, 419, 419, 419, 419, 419, 419, 81, 81, + 81, 81, 422, 422, 422, 422, 422, 422, 422, 422, 422, 422, 423, 423, 424, + 423, 423, 423, 423, 425, 425, 425, 425, 425, 425, 425, 425, 425, 425, + 426, 427, 426, 426, 426, 426, 426, 426, 426, 425, 425, 425, 425, 425, + 425, 425, 425, 425, 81, 81, 81, 428, 428, 429, 430, 430, 430, 430, 430, + 430, 430, 430, 430, 430, 430, 430, 430, 430, 429, 428, 428, 428, 428, + 429, 429, 428, 428, 431, 432, 428, 428, 430, 430, 433, 433, 433, 433, + 433, 433, 433, 433, 433, 433, 430, 430, 430, 430, 430, 430, 434, 434, + 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 434, 435, 436, + 437, 437, 436, 436, 436, 437, 436, 437, 437, 437, 438, 438, 81, 81, 81, + 81, 81, 81, 81, 81, 439, 439, 439, 439, 440, 440, 440, 440, 440, 440, + 440, 440, 440, 440, 440, 440, 441, 441, 441, 441, 441, 441, 441, 441, + 442, 442, 442, 442, 442, 442, 442, 442, 441, 441, 442, 443, 81, 81, 81, + 444, 444, 444, 444, 444, 445, 445, 445, 445, 445, 445, 445, 445, 445, + 445, 81, 81, 81, 440, 440, 440, 446, 446, 446, 446, 446, 446, 446, 446, + 446, 446, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, 447, + 447, 447, 448, 448, 448, 448, 448, 448, 449, 449, 93, 81, 81, 81, 81, 81, + 81, 81, 328, 328, 328, 81, 81, 328, 328, 328, 450, 450, 450, 450, 450, + 450, 450, 450, 96, 96, 96, 330, 451, 156, 156, 156, 156, 156, 96, 96, + 156, 156, 156, 156, 96, 452, 451, 451, 451, 451, 451, 451, 451, 453, 453, + 453, 453, 156, 453, 453, 453, 453, 452, 452, 96, 453, 453, 452, 96, 96, + 81, 81, 81, 81, 81, 81, 56, 56, 56, 56, 56, 56, 79, 79, 79, 79, 79, 93, + 59, 59, 59, 59, 59, 59, 59, 59, 59, 82, 82, 82, 82, 82, 59, 59, 59, 59, + 82, 82, 82, 82, 82, 56, 56, 56, 56, 56, 454, 56, 56, 56, 56, 56, 56, 56, + 56, 56, 56, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 59, 82, 96, 96, + 156, 96, 96, 96, 96, 96, 96, 96, 156, 96, 96, 455, 456, 156, 457, 96, 96, + 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, + 96, 458, 459, 459, 156, 81, 96, 460, 156, 96, 156, 52, 56, 52, 56, 52, + 56, 56, 56, 56, 56, 56, 56, 56, 56, 52, 56, 79, 79, 79, 79, 79, 79, 79, + 79, 78, 78, 78, 78, 78, 78, 78, 78, 79, 79, 79, 79, 79, 79, 81, 81, 78, + 78, 78, 78, 78, 78, 81, 81, 81, 78, 81, 78, 81, 78, 81, 78, 461, 461, + 461, 461, 461, 461, 461, 461, 79, 79, 79, 79, 79, 81, 79, 79, 78, 78, 78, + 78, 461, 80, 79, 80, 80, 80, 79, 79, 79, 81, 79, 79, 78, 78, 78, 78, 461, + 80, 80, 80, 79, 79, 79, 79, 81, 81, 79, 79, 78, 78, 78, 78, 81, 80, 80, + 80, 78, 78, 78, 78, 78, 80, 80, 80, 81, 81, 79, 79, 79, 81, 79, 79, 78, + 78, 78, 78, 461, 462, 80, 81, 463, 463, 463, 463, 463, 463, 463, 464, + 463, 463, 463, 465, 466, 467, 468, 469, 470, 471, 472, 470, 473, 474, 38, + 84, 475, 476, 477, 42, 475, 476, 477, 42, 38, 38, 478, 84, 479, 479, 479, + 480, 481, 482, 483, 484, 485, 486, 487, 33, 488, 489, 488, 488, 489, 490, + 491, 491, 84, 42, 50, 38, 492, 492, 478, 493, 493, 84, 84, 84, 494, 477, + 495, 492, 492, 492, 84, 84, 84, 84, 84, 84, 84, 84, 496, 84, 493, 84, + 377, 84, 377, 377, 377, 377, 84, 377, 377, 463, 497, 498, 498, 498, 498, + 81, 499, 500, 501, 502, 503, 503, 503, 503, 503, 503, 504, 59, 81, 81, + 47, 504, 504, 504, 504, 504, 505, 505, 496, 477, 495, 506, 504, 47, 47, + 47, 47, 504, 504, 504, 504, 504, 505, 505, 496, 477, 495, 81, 59, 59, 59, + 59, 59, 81, 81, 81, 282, 282, 282, 282, 282, 282, 282, 507, 282, 508, + 282, 282, 36, 282, 282, 282, 282, 282, 282, 282, 282, 282, 507, 282, 282, + 282, 282, 507, 282, 282, 507, 282, 509, 509, 509, 509, 509, 509, 509, + 509, 96, 96, 451, 451, 96, 96, 96, 96, 451, 451, 451, 96, 96, 416, 416, + 416, 416, 96, 416, 416, 416, 451, 451, 96, 156, 96, 451, 451, 156, 156, + 156, 156, 96, 81, 81, 81, 81, 81, 81, 81, 40, 40, 510, 511, 40, 512, 40, + 510, 40, 511, 49, 510, 510, 510, 49, 49, 510, 510, 510, 513, 40, 510, + 514, 40, 496, 510, 510, 510, 510, 510, 40, 40, 40, 512, 512, 40, 510, 40, + 85, 40, 510, 40, 52, 515, 510, 510, 516, 49, 510, 510, 52, 510, 49, 453, + 453, 453, 453, 49, 40, 40, 49, 49, 510, 510, 496, 496, 496, 496, 496, + 510, 49, 49, 49, 49, 40, 496, 40, 40, 56, 317, 517, 517, 517, 518, 51, + 519, 517, 517, 517, 517, 517, 51, 518, 518, 51, 517, 520, 520, 520, 520, + 520, 520, 520, 520, 520, 520, 520, 520, 521, 521, 521, 521, 520, 520, + 521, 521, 521, 521, 521, 521, 521, 521, 521, 52, 56, 521, 521, 521, 521, + 51, 40, 40, 81, 81, 81, 81, 54, 54, 54, 54, 54, 512, 512, 512, 512, 512, + 496, 496, 40, 40, 40, 40, 496, 40, 40, 496, 40, 40, 496, 40, 40, 40, 40, + 40, 40, 40, 496, 40, 40, 40, 40, 40, 40, 40, 40, 40, 44, 44, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 40, 496, 496, 40, 40, 54, 40, 54, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 40, 44, 40, 40, 40, 40, 496, 496, 496, 496, + 496, 496, 496, 496, 496, 496, 496, 496, 54, 496, 54, 54, 496, 496, 496, + 54, 54, 496, 496, 54, 496, 496, 496, 54, 496, 54, 522, 523, 496, 54, 496, + 496, 496, 496, 54, 496, 496, 54, 54, 54, 54, 496, 496, 54, 496, 54, 496, + 54, 54, 54, 54, 54, 54, 496, 54, 496, 496, 496, 496, 496, 54, 54, 54, 54, + 496, 496, 496, 496, 54, 54, 496, 496, 54, 496, 496, 496, 54, 496, 496, + 496, 496, 496, 54, 496, 496, 496, 496, 496, 54, 54, 496, 496, 54, 54, 54, + 54, 496, 496, 54, 54, 496, 496, 54, 54, 496, 496, 496, 496, 496, 54, 496, + 496, 496, 54, 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, 496, + 496, 54, 496, 496, 496, 496, 496, 496, 496, 524, 477, 495, 477, 495, 40, + 40, 40, 40, 40, 40, 512, 40, 40, 40, 40, 40, 40, 40, 525, 525, 40, 40, + 40, 40, 496, 496, 40, 40, 40, 40, 40, 40, 40, 526, 527, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 317, 317, 317, 40, 496, 40, 40, 40, 40, 40, 40, 40, 40, 317, 40, 40, + 40, 40, 40, 496, 496, 496, 496, 496, 496, 496, 496, 496, 40, 40, 40, 40, + 40, 528, 528, 528, 528, 40, 40, 40, 525, 529, 529, 525, 40, 40, 40, 40, + 40, 40, 40, 40, 40, 40, 40, 81, 40, 40, 40, 81, 81, 81, 81, 81, 51, 51, + 51, 51, 51, 51, 51, 51, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, 47, + 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, + 519, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 518, 512, 512, 512, + 512, 512, 512, 512, 512, 512, 512, 512, 512, 40, 40, 40, 40, 512, 512, + 512, 512, 531, 40, 40, 40, 40, 40, 512, 512, 512, 512, 40, 40, 512, 512, + 40, 512, 512, 512, 512, 512, 512, 512, 40, 40, 40, 40, 40, 40, 40, 40, + 512, 512, 40, 40, 512, 54, 40, 40, 40, 40, 512, 512, 40, 40, 512, 54, 40, + 40, 40, 40, 512, 512, 512, 40, 40, 512, 40, 40, 512, 512, 40, 40, 40, 40, + 40, 40, 40, 512, 496, 496, 496, 496, 496, 532, 532, 496, 529, 529, 529, + 529, 40, 512, 512, 40, 40, 512, 40, 40, 40, 40, 512, 512, 40, 40, 40, 40, + 525, 525, 531, 531, 529, 40, 529, 529, 533, 534, 533, 529, 40, 529, 529, + 529, 40, 40, 40, 40, 512, 40, 512, 40, 40, 40, 40, 40, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 528, 40, 40, 40, 40, 512, 512, + 40, 512, 512, 512, 40, 512, 533, 512, 512, 40, 512, 512, 40, 54, 40, 40, + 40, 40, 40, 40, 40, 525, 40, 40, 40, 528, 40, 40, 40, 40, 40, 40, 40, 40, + 40, 40, 512, 512, 40, 528, 40, 40, 40, 40, 40, 40, 40, 40, 528, 528, 317, + 40, 40, 40, 40, 40, 40, 40, 40, 525, 525, 533, 529, 529, 529, 529, 525, + 525, 533, 533, 533, 512, 512, 512, 512, 533, 528, 533, 533, 533, 512, + 533, 525, 512, 512, 512, 533, 533, 512, 512, 533, 512, 512, 533, 533, + 533, 40, 512, 40, 40, 40, 40, 512, 512, 525, 512, 512, 512, 512, 512, + 512, 533, 525, 525, 533, 525, 512, 533, 533, 535, 525, 512, 512, 525, + 533, 533, 529, 529, 529, 529, 529, 528, 40, 40, 529, 529, 536, 536, 534, + 534, 40, 40, 528, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 44, 40, + 40, 40, 40, 40, 40, 528, 40, 528, 40, 40, 40, 40, 528, 528, 528, 40, 537, + 40, 40, 40, 538, 538, 538, 538, 538, 538, 40, 539, 539, 529, 40, 40, 40, + 477, 495, 477, 495, 477, 495, 477, 495, 477, 495, 477, 495, 477, 495, 51, + 51, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 519, 40, 528, + 528, 528, 40, 40, 40, 40, 40, 40, 40, 528, 496, 496, 496, 496, 496, 477, + 495, 496, 496, 496, 496, 496, 496, 496, 16, 31, 16, 31, 16, 31, 16, 31, + 477, 495, 540, 540, 540, 540, 540, 540, 540, 540, 496, 496, 496, 477, + 495, 16, 31, 477, 495, 477, 495, 477, 495, 477, 495, 477, 495, 496, 496, + 496, 496, 496, 496, 496, 477, 495, 477, 495, 496, 496, 496, 496, 496, + 496, 496, 496, 477, 495, 496, 496, 40, 40, 40, 528, 528, 40, 40, 40, 496, + 496, 496, 496, 496, 40, 40, 496, 496, 496, 496, 496, 496, 40, 40, 40, + 528, 40, 40, 40, 40, 537, 512, 512, 40, 40, 40, 40, 81, 81, 40, 40, 40, + 40, 40, 40, 40, 40, 81, 81, 40, 81, 40, 40, 40, 40, 40, 40, 541, 541, + 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 541, 81, 542, + 542, 542, 542, 542, 542, 542, 542, 542, 542, 542, 542, 542, 542, 542, 81, + 52, 56, 52, 52, 52, 56, 56, 52, 56, 52, 56, 52, 56, 52, 52, 52, 52, 56, + 52, 56, 56, 52, 56, 56, 56, 56, 56, 56, 59, 59, 52, 52, 87, 88, 87, 88, + 88, 543, 543, 543, 543, 543, 543, 87, 88, 87, 88, 544, 544, 544, 87, 88, + 81, 81, 81, 81, 81, 545, 546, 546, 546, 547, 545, 546, 329, 329, 329, + 329, 329, 329, 81, 329, 81, 81, 81, 81, 81, 329, 81, 81, 548, 548, 548, + 548, 548, 548, 548, 548, 81, 81, 81, 81, 81, 81, 81, 549, 550, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 551, 95, 95, 95, 95, 95, + 95, 95, 95, 552, 552, 42, 50, 42, 50, 552, 552, 552, 42, 50, 552, 42, 50, + 377, 377, 377, 377, 377, 377, 377, 377, 84, 472, 553, 377, 554, 84, 42, + 50, 84, 84, 42, 50, 477, 495, 477, 495, 477, 495, 477, 495, 377, 377, + 377, 377, 375, 60, 377, 377, 84, 377, 377, 84, 84, 84, 84, 84, 555, 555, + 377, 377, 377, 84, 472, 377, 477, 377, 377, 377, 377, 377, 377, 377, 377, + 84, 377, 84, 377, 81, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, + 81, 556, 556, 556, 556, 556, 556, 556, 556, 556, 81, 81, 81, 81, 556, + 556, 556, 556, 556, 556, 81, 81, 525, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 525, 525, 81, 81, 81, 81, 557, 558, 558, 559, 525, 560, 561, + 562, 526, 527, 526, 527, 526, 527, 526, 527, 526, 527, 525, 525, 526, + 527, 526, 527, 526, 527, 526, 527, 563, 526, 527, 527, 525, 562, 562, + 562, 562, 562, 562, 562, 562, 562, 564, 565, 566, 567, 568, 568, 569, + 570, 570, 570, 570, 571, 525, 525, 562, 562, 562, 560, 572, 559, 525, + 529, 81, 573, 574, 573, 574, 573, 574, 573, 574, 573, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, 574, 573, + 574, 574, 574, 574, 574, 574, 574, 573, 574, 573, 574, 573, 574, 574, + 574, 574, 574, 574, 573, 574, 574, 574, 574, 574, 574, 573, 573, 81, 81, + 575, 575, 576, 576, 577, 577, 574, 563, 578, 579, 578, 579, 578, 579, + 578, 579, 578, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, 579, + 579, 579, 579, 579, 579, 579, 578, 579, 579, 579, 579, 579, 579, 579, + 578, 579, 578, 579, 578, 579, 579, 579, 579, 579, 579, 578, 579, 579, + 579, 579, 579, 579, 578, 578, 579, 579, 579, 579, 580, 581, 582, 582, + 579, 81, 81, 81, 81, 81, 583, 583, 583, 583, 583, 583, 583, 583, 583, + 583, 583, 81, 584, 584, 584, 584, 584, 584, 584, 584, 584, 584, 584, 584, + 584, 584, 584, 584, 584, 584, 584, 584, 584, 584, 81, 585, 585, 586, 586, + 586, 586, 585, 585, 585, 585, 585, 585, 585, 585, 585, 585, 583, 583, + 583, 81, 81, 81, 81, 81, 578, 578, 578, 578, 578, 578, 578, 578, 587, + 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 587, 588, 588, 81, + 586, 586, 586, 586, 586, 586, 586, 586, 586, 586, 585, 585, 585, 585, + 585, 585, 589, 589, 589, 589, 589, 589, 589, 589, 525, 590, 590, 590, + 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 590, 587, 587, + 587, 587, 588, 588, 588, 585, 585, 590, 590, 590, 590, 590, 590, 590, + 585, 585, 585, 585, 525, 525, 525, 525, 591, 591, 591, 591, 591, 591, + 591, 591, 591, 591, 591, 591, 591, 591, 591, 81, 585, 585, 585, 585, 585, + 585, 585, 525, 525, 525, 525, 585, 585, 585, 585, 585, 585, 585, 585, + 585, 585, 585, 525, 525, 592, 592, 592, 592, 592, 592, 592, 592, 592, + 592, 592, 592, 592, 592, 593, 593, 593, 593, 593, 593, 593, 593, 593, + 593, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, 594, + 595, 594, 594, 594, 594, 594, 594, 594, 81, 81, 81, 596, 596, 596, 596, + 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 596, 81, 597, 597, 597, + 597, 597, 597, 597, 597, 598, 598, 598, 598, 598, 598, 599, 599, 600, + 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 600, 601, 602, 603, + 602, 604, 604, 604, 604, 604, 604, 604, 604, 604, 604, 600, 600, 81, 81, + 81, 81, 90, 93, 90, 93, 90, 93, 605, 95, 97, 97, 97, 606, 95, 95, 95, 95, + 95, 95, 95, 95, 95, 95, 606, 607, 90, 93, 90, 93, 454, 454, 95, 95, 608, + 608, 608, 608, 608, 608, 608, 608, 608, 608, 608, 608, 608, 608, 609, + 609, 609, 609, 609, 609, 609, 609, 609, 609, 610, 610, 611, 612, 612, + 612, 612, 612, 62, 62, 62, 62, 62, 62, 62, 60, 60, 60, 60, 60, 60, 60, + 60, 60, 62, 62, 52, 56, 52, 56, 52, 56, 56, 56, 52, 56, 52, 56, 52, 56, + 59, 56, 56, 56, 56, 56, 56, 56, 56, 52, 56, 52, 56, 52, 52, 56, 60, 613, + 613, 52, 56, 52, 56, 57, 52, 56, 52, 56, 56, 56, 52, 56, 52, 56, 52, 52, + 52, 52, 52, 56, 52, 52, 52, 52, 52, 56, 52, 56, 52, 56, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 57, 59, 59, 56, 57, 57, 57, 57, 57, + 614, 614, 615, 614, 614, 614, 616, 614, 614, 614, 614, 615, 614, 614, + 614, 614, 614, 614, 614, 614, 614, 614, 614, 614, 614, 614, 614, 617, + 617, 615, 615, 617, 618, 618, 618, 618, 81, 81, 81, 81, 619, 619, 619, + 619, 619, 619, 317, 317, 507, 516, 81, 81, 81, 81, 81, 81, 620, 620, 620, + 620, 620, 620, 620, 620, 620, 620, 620, 620, 621, 621, 622, 622, 623, + 623, 624, 624, 624, 624, 624, 624, 624, 624, 624, 624, 624, 624, 624, + 624, 624, 624, 624, 624, 623, 623, 623, 623, 623, 623, 623, 623, 623, + 623, 623, 623, 623, 623, 623, 623, 625, 626, 81, 81, 81, 81, 81, 81, 81, + 81, 627, 627, 628, 628, 628, 628, 628, 628, 628, 628, 628, 628, 81, 81, + 81, 81, 81, 81, 198, 198, 198, 198, 198, 198, 198, 198, 198, 198, 195, + 195, 195, 195, 195, 195, 201, 201, 201, 195, 629, 195, 195, 193, 630, + 630, 630, 630, 630, 630, 630, 630, 630, 630, 631, 631, 631, 631, 631, + 631, 631, 631, 631, 631, 631, 631, 631, 631, 631, 631, 631, 631, 631, + 631, 632, 632, 632, 632, 632, 633, 633, 633, 199, 634, 635, 635, 635, + 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 635, 636, 636, + 636, 636, 636, 636, 636, 636, 636, 636, 636, 637, 638, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 639, 332, 332, 332, 332, 332, 81, 81, 81, + 640, 640, 640, 641, 642, 642, 642, 642, 642, 642, 642, 642, 642, 642, + 642, 642, 642, 642, 642, 643, 641, 641, 640, 640, 640, 640, 641, 641, + 640, 641, 641, 641, 644, 645, 645, 645, 645, 645, 645, 646, 646, 646, + 645, 645, 645, 645, 81, 61, 647, 647, 647, 647, 647, 647, 647, 647, 647, + 647, 81, 81, 81, 81, 645, 645, 318, 318, 318, 318, 318, 320, 648, 318, + 323, 323, 318, 318, 318, 318, 318, 81, 649, 649, 649, 649, 649, 649, 649, + 649, 649, 650, 650, 650, 650, 650, 650, 651, 651, 650, 650, 651, 651, + 650, 650, 81, 649, 649, 649, 650, 649, 649, 649, 649, 649, 649, 649, 649, + 650, 651, 81, 81, 652, 652, 652, 652, 652, 652, 652, 652, 652, 652, 81, + 81, 653, 654, 654, 654, 648, 318, 318, 318, 318, 318, 318, 327, 327, 327, + 318, 319, 320, 319, 318, 318, 655, 655, 655, 655, 655, 655, 655, 655, + 656, 655, 656, 656, 657, 655, 655, 656, 656, 655, 655, 655, 655, 655, + 656, 656, 655, 656, 655, 81, 81, 81, 81, 81, 81, 81, 81, 655, 655, 658, + 659, 659, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 660, 661, + 662, 662, 661, 661, 663, 663, 660, 664, 664, 661, 665, 81, 81, 335, 335, + 335, 335, 335, 335, 81, 56, 56, 56, 613, 59, 59, 59, 59, 56, 56, 56, 56, + 56, 79, 81, 81, 342, 342, 342, 342, 342, 342, 342, 342, 660, 660, 660, + 661, 661, 662, 661, 661, 662, 661, 661, 663, 661, 665, 81, 81, 666, 666, + 666, 666, 666, 666, 666, 666, 666, 666, 81, 81, 81, 81, 81, 81, 667, 668, + 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, 668, + 668, 668, 668, 668, 667, 668, 668, 668, 668, 668, 668, 668, 81, 81, 81, + 81, 333, 333, 333, 333, 333, 333, 333, 81, 81, 81, 81, 334, 334, 334, + 334, 334, 334, 334, 334, 334, 81, 81, 81, 81, 669, 669, 669, 669, 669, + 669, 669, 669, 670, 670, 670, 670, 670, 670, 670, 670, 592, 592, 593, + 593, 593, 593, 593, 593, 56, 56, 56, 56, 56, 56, 56, 81, 81, 81, 81, 101, + 101, 101, 101, 101, 81, 81, 81, 81, 81, 129, 671, 129, 129, 672, 129, + 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 129, 81, 129, 129, + 129, 129, 129, 81, 129, 81, 129, 129, 81, 129, 129, 81, 129, 129, 146, + 146, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, 673, + 673, 673, 673, 81, 81, 81, 81, 81, 81, 81, 81, 81, 146, 146, 146, 146, + 146, 146, 146, 146, 146, 146, 146, 495, 477, 81, 81, 146, 146, 146, 146, + 146, 146, 146, 146, 146, 146, 135, 138, 81, 81, 674, 674, 674, 674, 674, + 674, 674, 674, 675, 558, 558, 675, 675, 676, 676, 526, 527, 677, 81, 81, + 81, 81, 81, 81, 96, 96, 96, 96, 96, 96, 96, 156, 156, 156, 156, 156, 156, + 156, 95, 95, 559, 569, 569, 678, 678, 526, 527, 526, 527, 526, 527, 526, + 527, 526, 527, 526, 527, 526, 527, 526, 527, 559, 559, 526, 527, 559, + 559, 559, 559, 678, 678, 678, 679, 559, 679, 81, 580, 680, 676, 676, 569, + 526, 527, 526, 527, 526, 527, 681, 559, 559, 682, 683, 684, 684, 684, 81, + 559, 685, 686, 559, 81, 81, 81, 81, 146, 146, 146, 146, 146, 81, 81, 497, + 81, 687, 688, 689, 690, 691, 688, 688, 692, 693, 688, 694, 695, 696, 695, + 697, 698, 698, 698, 698, 698, 698, 698, 698, 698, 698, 699, 700, 701, + 701, 701, 687, 688, 702, 702, 702, 702, 702, 702, 702, 702, 702, 702, + 702, 702, 702, 702, 702, 702, 702, 702, 692, 688, 693, 703, 704, 703, + 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, 705, + 705, 705, 705, 705, 692, 701, 693, 701, 692, 693, 706, 707, 708, 706, + 709, 710, 711, 711, 711, 711, 711, 711, 711, 711, 711, 712, 710, 710, + 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, 710, + 710, 710, 710, 710, 710, 713, 713, 714, 714, 714, 714, 714, 714, 714, + 714, 714, 714, 714, 714, 714, 714, 714, 81, 81, 81, 714, 714, 714, 714, + 714, 714, 81, 81, 714, 714, 714, 81, 81, 81, 715, 690, 701, 703, 716, + 690, 690, 81, 717, 718, 718, 718, 718, 717, 717, 81, 81, 719, 719, 719, + 720, 512, 81, 81, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, + 721, 81, 721, 721, 721, 721, 721, 721, 721, 721, 721, 721, 81, 721, 721, + 721, 81, 721, 721, 81, 721, 721, 721, 721, 721, 721, 721, 81, 81, 721, + 721, 721, 81, 81, 81, 81, 81, 199, 377, 199, 81, 81, 81, 81, 619, 619, + 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 619, 81, 81, 81, 317, + 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 722, 723, + 723, 723, 723, 724, 724, 724, 724, 724, 724, 724, 724, 724, 724, 724, + 724, 724, 724, 724, 724, 724, 723, 723, 724, 725, 725, 81, 40, 40, 40, + 40, 81, 81, 81, 81, 724, 81, 81, 81, 81, 81, 81, 81, 317, 317, 317, 317, + 317, 156, 81, 81, 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, 726, + 726, 726, 81, 81, 81, 727, 727, 727, 727, 727, 727, 727, 727, 727, 81, + 81, 81, 81, 81, 81, 81, 156, 504, 504, 504, 504, 504, 504, 504, 504, 504, + 504, 504, 504, 504, 504, 504, 504, 504, 504, 504, 81, 81, 81, 81, 728, + 728, 728, 728, 728, 728, 728, 728, 729, 729, 729, 729, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 728, 728, 728, 730, 730, 730, 730, 730, 730, 730, + 730, 730, 731, 730, 730, 730, 730, 730, 730, 730, 730, 731, 81, 81, 81, + 81, 81, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, 732, + 732, 733, 733, 733, 733, 733, 81, 81, 81, 81, 81, 734, 734, 734, 734, + 734, 734, 734, 734, 734, 734, 734, 734, 734, 734, 81, 735, 736, 736, 736, + 736, 736, 736, 736, 736, 736, 736, 736, 736, 81, 81, 81, 81, 737, 738, + 738, 738, 738, 738, 81, 81, 739, 739, 739, 739, 739, 739, 739, 739, 740, + 740, 740, 740, 740, 740, 740, 740, 741, 741, 741, 741, 741, 741, 741, + 741, 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, 742, + 742, 81, 81, 743, 743, 743, 743, 743, 743, 743, 743, 743, 743, 81, 81, + 81, 81, 81, 81, 744, 744, 744, 744, 744, 744, 744, 744, 744, 744, 744, + 744, 81, 81, 81, 81, 745, 745, 745, 745, 745, 745, 745, 745, 745, 745, + 745, 745, 81, 81, 81, 81, 746, 746, 746, 746, 746, 746, 746, 746, 747, + 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 747, 81, 81, 81, 81, + 81, 81, 81, 81, 81, 81, 81, 748, 749, 749, 749, 749, 749, 749, 749, 749, + 749, 749, 749, 749, 749, 749, 749, 81, 749, 749, 749, 749, 749, 749, 81, + 81, 750, 750, 750, 750, 750, 750, 81, 81, 750, 81, 750, 750, 750, 750, + 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, 750, + 750, 750, 81, 750, 750, 81, 81, 81, 750, 81, 81, 750, 751, 751, 751, 751, + 751, 751, 751, 751, 751, 751, 751, 751, 751, 751, 81, 752, 753, 753, 753, + 753, 753, 753, 753, 753, 754, 754, 754, 754, 754, 754, 754, 754, 754, + 754, 754, 754, 754, 754, 754, 755, 755, 756, 756, 756, 756, 756, 756, + 756, 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, 757, + 757, 757, 81, 81, 81, 81, 81, 81, 81, 81, 758, 758, 758, 758, 758, 758, + 758, 758, 758, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 759, 81, + 759, 759, 81, 81, 81, 81, 81, 760, 760, 760, 760, 760, 761, 761, 761, + 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 761, 762, 762, 762, + 762, 762, 762, 81, 81, 81, 763, 764, 764, 764, 764, 764, 764, 764, 764, + 764, 764, 81, 81, 81, 81, 81, 765, 766, 766, 766, 766, 766, 766, 766, + 766, 767, 767, 767, 767, 767, 767, 767, 767, 81, 81, 81, 81, 768, 768, + 767, 767, 768, 768, 768, 768, 768, 768, 768, 768, 81, 81, 768, 768, 768, + 768, 768, 768, 769, 770, 770, 770, 81, 770, 770, 81, 81, 81, 81, 81, 770, + 771, 770, 772, 769, 769, 769, 769, 81, 769, 769, 769, 81, 769, 769, 769, + 769, 769, 769, 769, 769, 769, 769, 769, 769, 769, 769, 769, 769, 769, + 769, 769, 769, 769, 81, 81, 772, 773, 771, 81, 81, 81, 81, 774, 775, 775, + 775, 775, 775, 775, 775, 775, 775, 81, 81, 81, 81, 81, 81, 81, 776, 776, + 776, 776, 776, 776, 776, 776, 777, 81, 81, 81, 81, 81, 81, 81, 778, 778, + 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 778, 779, 779, 780, + 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 781, 782, + 782, 782, 783, 783, 783, 783, 783, 783, 783, 783, 784, 783, 783, 783, + 783, 783, 783, 783, 783, 783, 783, 783, 783, 785, 786, 81, 81, 81, 81, + 787, 787, 787, 787, 787, 788, 788, 788, 788, 788, 788, 789, 81, 790, 790, + 790, 790, 790, 790, 790, 790, 790, 790, 790, 790, 790, 790, 81, 81, 81, + 791, 791, 791, 791, 791, 791, 791, 792, 792, 792, 792, 792, 792, 792, + 792, 792, 792, 792, 792, 792, 792, 81, 81, 793, 793, 793, 793, 793, 793, + 793, 793, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 794, 81, 81, + 81, 81, 81, 795, 795, 795, 795, 795, 795, 795, 795, 796, 796, 796, 796, 796, 796, 796, 796, 796, 796, 81, 81, 81, 81, 81, 81, 81, 797, 797, 797, - 797, 797, 797, 797, 797, 797, 797, 797, 81, 81, 81, 81, 81, 798, 798, - 798, 798, 798, 798, 798, 798, 798, 798, 798, 81, 81, 81, 81, 81, 81, 81, - 799, 799, 799, 799, 799, 799, 800, 800, 800, 800, 800, 800, 800, 800, - 800, 800, 800, 800, 800, 800, 800, 81, 801, 802, 801, 803, 803, 803, 803, - 803, 803, 803, 803, 803, 803, 803, 803, 803, 802, 802, 802, 802, 802, - 802, 802, 802, 802, 802, 802, 802, 802, 802, 804, 805, 805, 806, 806, - 806, 806, 806, 81, 81, 81, 81, 807, 807, 807, 807, 807, 807, 807, 807, - 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 807, 808, 808, - 808, 808, 808, 808, 808, 808, 808, 808, 81, 81, 81, 81, 81, 81, 81, 804, - 809, 809, 810, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, 811, - 811, 811, 810, 810, 810, 809, 809, 809, 809, 810, 810, 812, 813, 814, - 814, 815, 816, 816, 816, 816, 81, 81, 81, 81, 81, 81, 817, 817, 817, 817, - 817, 817, 817, 817, 817, 81, 81, 81, 81, 81, 81, 81, 818, 818, 818, 818, - 818, 818, 818, 818, 818, 818, 81, 81, 81, 81, 81, 81, 819, 819, 819, 820, + 797, 81, 81, 81, 81, 798, 798, 798, 798, 798, 798, 798, 799, 799, 799, + 799, 799, 799, 799, 799, 799, 81, 81, 81, 81, 81, 81, 81, 800, 800, 800, + 800, 800, 800, 800, 800, 800, 800, 800, 81, 81, 81, 81, 81, 801, 801, + 801, 801, 801, 801, 801, 801, 801, 801, 801, 81, 81, 81, 81, 81, 81, 81, + 802, 802, 802, 802, 802, 802, 803, 803, 803, 803, 803, 803, 803, 803, + 803, 803, 803, 803, 804, 804, 804, 804, 805, 805, 805, 805, 805, 805, + 805, 805, 805, 805, 81, 81, 81, 81, 81, 81, 806, 806, 806, 806, 806, 806, + 806, 806, 806, 806, 806, 806, 806, 806, 806, 81, 807, 807, 807, 807, 807, + 807, 807, 807, 807, 807, 807, 807, 807, 808, 808, 808, 808, 808, 808, + 808, 808, 808, 808, 807, 809, 809, 809, 809, 809, 809, 809, 809, 809, + 809, 809, 809, 809, 809, 810, 810, 811, 811, 811, 810, 811, 810, 810, + 810, 810, 812, 812, 812, 812, 813, 813, 813, 813, 813, 81, 81, 81, 81, + 81, 81, 814, 815, 814, 816, 816, 816, 816, 816, 816, 816, 816, 816, 816, + 816, 816, 816, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, 815, + 815, 815, 815, 817, 818, 818, 819, 819, 819, 819, 819, 81, 81, 81, 81, 820, 820, 820, 820, 820, 820, 820, 820, 820, 820, 820, 820, 820, 820, - 820, 820, 820, 820, 820, 821, 821, 821, 821, 821, 822, 821, 821, 821, - 821, 821, 821, 823, 823, 81, 824, 824, 824, 824, 824, 824, 824, 824, 824, - 824, 825, 825, 825, 825, 81, 81, 81, 81, 826, 826, 826, 826, 826, 826, - 826, 826, 826, 826, 826, 827, 828, 829, 826, 81, 830, 830, 831, 832, 832, - 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, 832, - 831, 831, 831, 830, 830, 830, 830, 830, 830, 830, 830, 830, 831, 833, - 832, 832, 832, 832, 834, 834, 835, 834, 835, 836, 830, 830, 835, 81, 81, - 837, 837, 837, 837, 837, 837, 837, 837, 837, 837, 832, 838, 832, 834, - 834, 834, 81, 839, 839, 839, 839, 839, 839, 839, 839, 839, 839, 839, 839, - 839, 839, 839, 839, 839, 839, 839, 839, 81, 81, 81, 840, 840, 840, 840, - 840, 840, 840, 840, 840, 840, 81, 840, 840, 840, 840, 840, 840, 840, 840, - 840, 841, 841, 841, 842, 842, 842, 841, 841, 842, 843, 844, 842, 845, - 845, 846, 845, 845, 846, 842, 81, 847, 847, 847, 847, 847, 847, 847, 81, - 847, 81, 847, 847, 847, 847, 81, 847, 847, 847, 847, 847, 847, 847, 847, - 847, 847, 847, 847, 847, 847, 847, 81, 847, 847, 848, 81, 81, 81, 81, 81, - 81, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, 849, - 849, 850, 851, 851, 851, 850, 850, 850, 850, 850, 850, 852, 853, 81, 81, - 81, 81, 81, 854, 854, 854, 854, 854, 854, 854, 854, 854, 854, 81, 81, 81, - 81, 81, 81, 855, 855, 856, 856, 81, 857, 857, 857, 857, 857, 857, 857, - 857, 81, 81, 857, 857, 81, 81, 857, 857, 857, 857, 857, 857, 857, 857, - 857, 857, 857, 857, 857, 857, 81, 857, 857, 857, 857, 857, 857, 857, 81, - 857, 857, 81, 857, 857, 857, 857, 857, 81, 81, 858, 857, 856, 856, 855, - 856, 856, 856, 856, 81, 81, 856, 856, 81, 81, 856, 856, 859, 81, 81, 857, - 81, 81, 81, 81, 81, 81, 856, 81, 81, 81, 81, 81, 857, 857, 857, 857, 857, - 856, 856, 81, 81, 860, 860, 860, 860, 860, 860, 860, 81, 81, 81, 861, - 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, 861, 862, 862, - 862, 863, 863, 863, 863, 863, 863, 863, 863, 862, 862, 864, 863, 863, - 862, 865, 861, 861, 861, 861, 866, 866, 866, 866, 867, 868, 868, 868, - 868, 868, 868, 868, 868, 868, 868, 81, 866, 81, 867, 81, 81, 869, 869, - 869, 869, 869, 869, 869, 869, 870, 870, 870, 871, 871, 871, 871, 871, - 871, 870, 871, 870, 870, 870, 870, 871, 871, 870, 872, 873, 869, 869, - 874, 869, 875, 875, 875, 875, 875, 875, 875, 875, 875, 875, 81, 81, 81, - 81, 81, 81, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, 876, - 876, 876, 876, 877, 877, 877, 878, 878, 878, 878, 81, 81, 877, 877, 877, - 877, 878, 878, 877, 879, 880, 881, 882, 882, 883, 883, 884, 884, 884, - 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, 882, - 882, 876, 876, 876, 876, 878, 878, 81, 81, 885, 885, 885, 885, 885, 885, - 885, 885, 886, 886, 886, 887, 887, 887, 887, 887, 887, 887, 887, 886, - 886, 887, 886, 888, 887, 889, 889, 890, 885, 81, 81, 81, 891, 891, 891, - 891, 891, 891, 891, 891, 891, 891, 81, 81, 81, 81, 81, 81, 892, 892, 892, - 892, 892, 892, 892, 892, 892, 892, 892, 892, 892, 81, 81, 81, 893, 893, - 893, 893, 893, 893, 893, 893, 893, 893, 893, 894, 895, 894, 895, 895, - 894, 894, 894, 894, 894, 894, 896, 897, 898, 898, 898, 898, 898, 898, - 898, 898, 898, 898, 81, 81, 81, 81, 81, 81, 899, 899, 899, 899, 899, 899, - 899, 899, 899, 899, 81, 81, 81, 900, 900, 900, 901, 901, 900, 900, 900, - 900, 901, 900, 900, 900, 900, 902, 81, 81, 81, 81, 903, 903, 903, 903, - 903, 903, 903, 903, 903, 903, 904, 904, 905, 905, 905, 906, 907, 907, - 907, 907, 907, 907, 907, 907, 908, 908, 908, 908, 908, 908, 908, 908, - 909, 909, 909, 909, 909, 909, 909, 909, 909, 909, 910, 910, 910, 910, - 910, 910, 910, 910, 910, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, - 911, 912, 913, 913, 913, 913, 913, 913, 914, 914, 913, 913, 912, 912, - 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, 912, - 913, 915, 913, 913, 913, 913, 914, 912, 913, 913, 913, 913, 916, 917, - 918, 918, 918, 918, 916, 917, 915, 919, 920, 920, 920, 920, 920, 920, - 921, 921, 920, 920, 920, 919, 919, 919, 919, 919, 919, 919, 919, 919, - 919, 919, 919, 919, 919, 919, 919, 81, 81, 919, 919, 919, 919, 920, 920, - 920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 920, 921, 920, 922, - 923, 923, 923, 81, 924, 924, 924, 923, 923, 81, 81, 81, 81, 81, 925, 925, - 925, 925, 925, 925, 925, 925, 925, 81, 81, 81, 81, 81, 81, 81, 926, 926, - 926, 926, 926, 926, 926, 926, 926, 81, 926, 926, 926, 926, 926, 926, 926, - 926, 926, 926, 926, 926, 926, 927, 928, 928, 928, 928, 928, 928, 928, 81, - 928, 928, 928, 928, 928, 928, 927, 929, 926, 930, 930, 930, 930, 930, 81, - 81, 931, 931, 931, 931, 931, 931, 931, 931, 931, 931, 932, 932, 932, 932, - 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, 932, - 932, 81, 81, 81, 933, 934, 935, 935, 935, 935, 935, 935, 935, 935, 935, - 935, 935, 935, 935, 935, 81, 81, 936, 936, 936, 936, 936, 936, 936, 936, - 936, 936, 936, 936, 936, 936, 81, 937, 936, 936, 936, 936, 936, 936, 936, - 937, 936, 936, 937, 936, 936, 81, 938, 938, 938, 938, 938, 938, 938, 81, - 938, 938, 81, 938, 938, 938, 938, 938, 938, 938, 938, 938, 938, 938, 938, - 938, 938, 939, 939, 939, 939, 939, 939, 81, 81, 81, 939, 81, 939, 939, - 81, 939, 939, 939, 940, 939, 941, 941, 938, 939, 942, 942, 942, 942, 942, - 942, 942, 942, 942, 942, 81, 81, 81, 81, 81, 81, 943, 943, 943, 943, 943, - 943, 943, 943, 943, 943, 81, 81, 81, 81, 81, 81, 944, 944, 944, 944, 944, - 944, 944, 944, 944, 944, 944, 944, 944, 944, 944, 81, 945, 945, 945, 945, - 945, 81, 81, 81, 943, 943, 943, 943, 81, 81, 81, 81, 946, 946, 946, 946, - 946, 946, 946, 946, 947, 947, 947, 948, 948, 948, 946, 946, 946, 946, - 948, 946, 946, 946, 947, 948, 947, 948, 946, 946, 946, 946, 946, 946, - 946, 947, 948, 948, 946, 946, 946, 946, 946, 946, 946, 946, 946, 946, - 946, 81, 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, 949, - 949, 950, 951, 949, 949, 949, 949, 949, 949, 949, 81, 605, 81, 81, 81, - 81, 81, 81, 81, 952, 952, 952, 952, 952, 952, 952, 952, 952, 952, 952, - 952, 952, 952, 952, 81, 953, 953, 953, 953, 953, 953, 953, 953, 953, 953, - 81, 81, 81, 81, 954, 954, 955, 955, 955, 955, 955, 955, 955, 955, 955, - 955, 955, 955, 955, 955, 81, 81, 956, 956, 956, 956, 956, 957, 81, 81, - 958, 958, 958, 958, 958, 958, 958, 958, 959, 959, 959, 959, 959, 959, - 959, 960, 960, 960, 961, 961, 962, 962, 962, 962, 963, 963, 963, 963, - 960, 962, 81, 81, 964, 964, 964, 964, 964, 964, 964, 964, 964, 964, 81, - 965, 965, 965, 965, 965, 965, 965, 81, 958, 958, 958, 958, 958, 81, 81, - 81, 81, 81, 958, 958, 958, 966, 966, 966, 966, 966, 966, 966, 966, 966, - 966, 966, 966, 966, 81, 81, 81, 966, 967, 967, 967, 967, 967, 967, 967, - 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, 967, - 967, 81, 81, 81, 81, 81, 81, 81, 81, 968, 968, 968, 968, 969, 969, 969, - 969, 969, 969, 969, 969, 969, 969, 969, 969, 969, 970, 971, 81, 81, 81, - 81, 81, 81, 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, 972, - 972, 81, 81, 81, 972, 972, 972, 81, 81, 81, 81, 81, 576, 571, 571, 571, - 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 571, 81, 973, 973, 973, - 973, 973, 973, 973, 973, 973, 973, 973, 973, 81, 81, 81, 81, 974, 974, - 974, 974, 974, 974, 974, 974, 974, 974, 974, 81, 81, 81, 81, 81, 974, - 974, 974, 974, 974, 81, 81, 81, 974, 81, 81, 81, 81, 81, 81, 81, 974, - 974, 81, 81, 975, 976, 977, 978, 499, 499, 499, 499, 81, 81, 81, 81, 313, - 313, 313, 313, 313, 313, 81, 81, 313, 313, 313, 313, 313, 313, 313, 81, - 81, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 313, 979, 979, - 447, 447, 447, 313, 313, 313, 980, 979, 979, 979, 979, 979, 499, 499, - 499, 499, 499, 499, 499, 499, 156, 156, 156, 156, 156, 156, 156, 156, - 313, 313, 96, 96, 96, 96, 96, 156, 156, 313, 313, 313, 313, 313, 313, 96, - 96, 96, 96, 313, 313, 313, 81, 81, 81, 81, 81, 81, 81, 721, 721, 981, - 981, 981, 721, 81, 81, 616, 616, 81, 81, 81, 81, 81, 81, 506, 506, 506, - 506, 506, 506, 506, 506, 506, 506, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 506, 506, 506, 506, 506, 506, 506, - 506, 506, 506, 49, 49, 49, 49, 49, 49, 49, 81, 49, 49, 49, 49, 49, 49, - 506, 81, 506, 506, 81, 81, 506, 81, 81, 506, 506, 81, 81, 506, 506, 506, - 506, 81, 506, 506, 49, 49, 81, 49, 81, 49, 49, 49, 49, 49, 49, 49, 81, - 49, 49, 49, 49, 49, 49, 49, 506, 506, 81, 506, 506, 506, 506, 81, 81, - 506, 506, 506, 506, 506, 506, 506, 506, 81, 506, 506, 506, 506, 506, 506, - 506, 81, 49, 49, 506, 506, 81, 506, 506, 506, 506, 81, 506, 506, 506, - 506, 506, 81, 506, 81, 81, 81, 506, 506, 506, 506, 506, 506, 506, 81, 49, - 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 81, 81, 506, 982, 49, 49, 49, - 49, 49, 49, 49, 49, 49, 492, 49, 49, 49, 49, 49, 49, 506, 506, 506, 506, - 506, 506, 506, 506, 506, 982, 49, 49, 49, 49, 49, 49, 49, 49, 49, 492, - 49, 49, 506, 506, 506, 506, 506, 982, 49, 49, 49, 49, 49, 49, 49, 49, 49, - 492, 49, 49, 49, 49, 49, 49, 506, 506, 506, 506, 506, 506, 506, 506, 506, - 982, 49, 492, 49, 49, 49, 49, 49, 49, 49, 49, 506, 49, 81, 81, 983, 983, - 983, 983, 983, 983, 983, 983, 983, 983, 984, 984, 984, 984, 984, 984, - 984, 984, 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, 985, - 985, 985, 985, 984, 984, 984, 984, 985, 985, 985, 985, 985, 985, 985, - 985, 985, 985, 984, 984, 984, 984, 984, 984, 984, 984, 985, 984, 984, - 984, 984, 984, 984, 985, 984, 984, 986, 986, 986, 986, 987, 81, 81, 81, - 81, 81, 81, 81, 985, 985, 985, 985, 985, 81, 985, 985, 985, 985, 985, - 985, 985, 988, 988, 988, 988, 988, 988, 988, 81, 988, 988, 988, 988, 988, - 988, 988, 988, 988, 81, 81, 988, 988, 988, 988, 988, 988, 988, 81, 988, - 988, 81, 988, 988, 988, 988, 988, 81, 81, 81, 81, 81, 989, 989, 989, 989, - 989, 989, 989, 989, 989, 989, 989, 989, 989, 81, 81, 990, 990, 990, 990, - 990, 990, 990, 990, 990, 991, 991, 991, 991, 991, 991, 991, 81, 992, 992, - 992, 992, 992, 992, 992, 992, 992, 992, 993, 993, 993, 993, 993, 993, - 993, 993, 993, 993, 993, 993, 993, 993, 993, 993, 993, 993, 994, 994, - 994, 994, 994, 994, 995, 81, 81, 81, 81, 81, 996, 996, 996, 996, 996, - 996, 996, 996, 996, 996, 81, 81, 81, 81, 997, 997, 146, 146, 146, 146, + 820, 820, 820, 820, 820, 820, 821, 821, 821, 821, 821, 821, 821, 821, + 821, 821, 81, 81, 81, 81, 81, 81, 81, 817, 822, 822, 823, 824, 824, 824, + 824, 824, 824, 824, 824, 824, 824, 824, 824, 824, 823, 823, 823, 822, + 822, 822, 822, 823, 823, 825, 826, 827, 827, 828, 829, 829, 829, 829, 81, + 81, 81, 81, 81, 81, 81, 81, 81, 81, 81, 828, 81, 81, 830, 830, 830, 830, + 830, 830, 830, 830, 830, 81, 81, 81, 81, 81, 81, 81, 831, 831, 831, 831, + 831, 831, 831, 831, 831, 831, 81, 81, 81, 81, 81, 81, 832, 832, 832, 833, + 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, 833, + 833, 833, 833, 833, 833, 834, 834, 834, 834, 834, 835, 834, 834, 834, + 834, 834, 834, 836, 836, 81, 837, 837, 837, 837, 837, 837, 837, 837, 837, + 837, 838, 838, 838, 838, 833, 835, 835, 81, 839, 839, 839, 839, 839, 839, + 839, 839, 839, 839, 839, 840, 841, 842, 839, 81, 843, 843, 844, 845, 845, + 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, 845, + 844, 844, 844, 843, 843, 843, 843, 843, 843, 843, 843, 843, 844, 846, + 845, 845, 845, 845, 847, 847, 848, 847, 843, 849, 843, 843, 848, 81, 81, + 850, 850, 850, 850, 850, 850, 850, 850, 850, 850, 845, 851, 845, 847, + 847, 847, 81, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, 852, + 852, 852, 852, 852, 852, 852, 852, 852, 81, 81, 81, 853, 853, 853, 853, + 853, 853, 853, 853, 853, 853, 81, 853, 853, 853, 853, 853, 853, 853, 853, + 853, 854, 854, 854, 855, 855, 855, 854, 854, 855, 856, 857, 855, 858, + 858, 859, 858, 858, 859, 855, 81, 860, 860, 860, 860, 860, 860, 860, 81, + 860, 81, 860, 860, 860, 860, 81, 860, 860, 860, 860, 860, 860, 860, 860, + 860, 860, 860, 860, 860, 860, 860, 81, 860, 860, 861, 81, 81, 81, 81, 81, + 81, 862, 862, 862, 862, 862, 862, 862, 862, 862, 862, 862, 862, 862, 862, + 862, 863, 864, 864, 864, 863, 863, 863, 863, 863, 863, 865, 866, 81, 81, + 81, 81, 81, 867, 867, 867, 867, 867, 867, 867, 867, 867, 867, 81, 81, 81, + 81, 81, 81, 868, 868, 869, 869, 81, 870, 870, 870, 870, 870, 870, 870, + 870, 81, 81, 870, 870, 81, 81, 870, 870, 870, 870, 870, 870, 870, 870, + 870, 870, 870, 870, 870, 870, 81, 870, 870, 870, 870, 870, 870, 870, 81, + 870, 870, 81, 870, 870, 870, 870, 870, 81, 871, 872, 870, 869, 869, 868, + 869, 869, 869, 869, 81, 81, 869, 869, 81, 81, 869, 869, 873, 81, 81, 870, + 81, 81, 81, 81, 81, 81, 869, 81, 81, 81, 81, 81, 870, 870, 870, 870, 870, + 869, 869, 81, 81, 874, 874, 874, 874, 874, 874, 874, 81, 81, 81, 875, + 875, 875, 875, 875, 875, 875, 875, 875, 875, 875, 875, 875, 876, 876, + 876, 877, 877, 877, 877, 877, 877, 877, 877, 876, 876, 878, 877, 877, + 876, 879, 875, 875, 875, 875, 880, 880, 880, 880, 881, 882, 882, 882, + 882, 882, 882, 882, 882, 882, 882, 81, 880, 81, 881, 883, 81, 884, 884, + 884, 884, 884, 884, 884, 884, 885, 885, 885, 886, 886, 886, 886, 886, + 886, 885, 886, 885, 885, 885, 885, 886, 886, 885, 887, 888, 884, 884, + 889, 884, 890, 890, 890, 890, 890, 890, 890, 890, 890, 890, 81, 81, 81, + 81, 81, 81, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, 891, + 891, 891, 891, 892, 892, 892, 893, 893, 893, 893, 81, 81, 892, 892, 892, + 892, 893, 893, 892, 894, 895, 896, 897, 897, 898, 898, 899, 899, 899, + 897, 897, 897, 897, 897, 897, 897, 897, 897, 897, 897, 897, 897, 897, + 897, 891, 891, 891, 891, 893, 893, 81, 81, 900, 900, 900, 900, 900, 900, + 900, 900, 901, 901, 901, 902, 902, 902, 902, 902, 902, 902, 902, 901, + 901, 902, 901, 903, 902, 904, 904, 905, 900, 81, 81, 81, 906, 906, 906, + 906, 906, 906, 906, 906, 906, 906, 81, 81, 81, 81, 81, 81, 907, 907, 907, + 907, 907, 907, 907, 907, 907, 907, 907, 907, 907, 81, 81, 81, 908, 908, + 908, 908, 908, 908, 908, 908, 908, 908, 908, 909, 910, 909, 910, 910, + 909, 909, 909, 909, 909, 909, 911, 912, 913, 913, 913, 913, 913, 913, + 913, 913, 913, 913, 81, 81, 81, 81, 81, 81, 914, 914, 914, 914, 914, 914, + 914, 914, 914, 914, 914, 81, 81, 915, 915, 915, 916, 916, 915, 915, 915, + 915, 916, 915, 915, 915, 915, 917, 81, 81, 81, 81, 918, 918, 918, 918, + 918, 918, 918, 918, 918, 918, 919, 919, 920, 920, 920, 921, 922, 922, + 922, 922, 922, 922, 922, 922, 922, 922, 922, 922, 923, 923, 923, 924, + 924, 924, 924, 924, 924, 924, 924, 924, 923, 925, 926, 927, 81, 81, 81, + 81, 928, 928, 928, 928, 928, 928, 928, 928, 929, 929, 929, 929, 929, 929, + 929, 929, 930, 930, 930, 930, 930, 930, 930, 930, 930, 930, 931, 931, + 931, 931, 931, 931, 931, 931, 931, 81, 81, 81, 81, 81, 81, 81, 81, 81, + 81, 81, 81, 932, 933, 934, 934, 934, 934, 934, 934, 935, 935, 934, 934, + 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, 933, + 933, 933, 934, 936, 934, 934, 934, 934, 937, 933, 934, 934, 934, 934, + 938, 939, 940, 940, 940, 940, 938, 939, 936, 941, 942, 942, 942, 942, + 942, 942, 943, 943, 942, 942, 942, 941, 941, 941, 941, 941, 941, 941, + 941, 941, 941, 941, 941, 941, 941, 941, 941, 81, 81, 941, 941, 941, 941, + 942, 942, 942, 942, 942, 942, 942, 942, 942, 942, 942, 942, 942, 943, + 942, 944, 945, 945, 945, 941, 946, 946, 946, 945, 945, 81, 81, 81, 81, + 81, 947, 947, 947, 947, 947, 947, 947, 947, 947, 81, 81, 81, 81, 81, 81, + 81, 948, 948, 948, 948, 948, 948, 948, 948, 948, 81, 948, 948, 948, 948, + 948, 948, 948, 948, 948, 948, 948, 948, 948, 949, 950, 950, 950, 950, + 950, 950, 950, 81, 950, 950, 950, 950, 950, 950, 949, 951, 948, 952, 952, + 952, 952, 952, 81, 81, 953, 953, 953, 953, 953, 953, 953, 953, 953, 953, + 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, 954, + 954, 954, 954, 954, 954, 81, 81, 81, 955, 956, 957, 957, 957, 957, 957, + 957, 957, 957, 957, 957, 957, 957, 957, 957, 81, 81, 958, 958, 958, 958, + 958, 958, 958, 958, 958, 958, 958, 958, 958, 958, 81, 959, 958, 958, 958, + 958, 958, 958, 958, 959, 958, 958, 959, 958, 958, 81, 960, 960, 960, 960, + 960, 960, 960, 81, 960, 960, 81, 960, 960, 960, 960, 960, 960, 960, 960, + 960, 960, 960, 960, 960, 960, 961, 961, 961, 961, 961, 961, 81, 81, 81, + 961, 81, 961, 961, 81, 961, 961, 961, 962, 961, 963, 963, 960, 961, 964, + 964, 964, 964, 964, 964, 964, 964, 964, 964, 81, 81, 81, 81, 81, 81, 965, + 965, 965, 965, 965, 965, 81, 965, 965, 81, 965, 965, 965, 965, 965, 965, + 965, 965, 965, 965, 965, 965, 965, 965, 965, 965, 966, 966, 966, 966, + 966, 81, 967, 967, 81, 966, 966, 967, 966, 968, 965, 81, 81, 81, 81, 81, + 81, 81, 969, 969, 969, 969, 969, 969, 969, 969, 969, 969, 81, 81, 81, 81, + 81, 81, 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, 970, 971, 971, + 972, 972, 973, 973, 81, 81, 81, 81, 81, 81, 81, 974, 974, 974, 974, 974, + 974, 974, 974, 974, 974, 81, 81, 81, 81, 81, 81, 975, 975, 975, 975, 975, + 975, 975, 975, 975, 975, 975, 975, 975, 975, 975, 81, 976, 976, 976, 976, + 976, 81, 81, 81, 974, 974, 974, 974, 81, 81, 81, 81, 977, 977, 977, 977, + 977, 977, 977, 977, 978, 978, 978, 979, 979, 979, 977, 977, 977, 977, + 979, 977, 977, 977, 978, 979, 978, 979, 977, 977, 977, 977, 977, 977, + 977, 978, 979, 979, 977, 977, 977, 977, 977, 977, 977, 977, 977, 977, + 977, 81, 980, 980, 980, 980, 980, 980, 980, 980, 980, 980, 980, 980, 980, + 980, 981, 982, 980, 980, 980, 980, 980, 980, 980, 81, 608, 81, 81, 81, + 81, 81, 81, 81, 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, 983, + 983, 983, 983, 983, 81, 984, 984, 984, 984, 984, 984, 984, 984, 984, 984, + 81, 81, 81, 81, 985, 985, 986, 986, 986, 986, 986, 986, 986, 986, 986, + 986, 986, 986, 986, 986, 81, 81, 987, 987, 987, 987, 987, 988, 81, 81, + 989, 989, 989, 989, 989, 989, 989, 989, 990, 990, 990, 990, 990, 990, + 990, 991, 991, 991, 992, 992, 993, 993, 993, 993, 994, 994, 994, 994, + 991, 993, 81, 81, 995, 995, 995, 995, 995, 995, 995, 995, 995, 995, 81, + 996, 996, 996, 996, 996, 996, 996, 81, 989, 989, 989, 989, 989, 81, 81, + 81, 81, 81, 989, 989, 989, 997, 997, 997, 997, 997, 997, 997, 997, 998, + 998, 998, 998, 998, 998, 998, 998, 999, 999, 999, 999, 999, 999, 999, + 999, 999, 999, 999, 999, 999, 999, 999, 1000, 1000, 1001, 1001, 81, 81, + 81, 81, 81, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, 1002, + 1002, 1002, 1002, 81, 81, 81, 1002, 1003, 1003, 1003, 1003, 1003, 1003, + 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, 1003, + 1003, 1003, 1003, 1003, 81, 81, 81, 81, 81, 81, 81, 81, 1004, 1004, 1004, + 1004, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, 1005, + 1005, 1005, 1006, 1007, 81, 81, 81, 81, 81, 81, 1008, 1008, 1008, 1008, + 1008, 1008, 1008, 1008, 1008, 1008, 81, 81, 81, 81, 81, 81, 1008, 1008, + 1008, 81, 81, 81, 81, 81, 579, 574, 574, 574, 574, 574, 574, 574, 574, + 574, 574, 574, 574, 574, 574, 81, 1009, 1009, 1009, 1009, 1009, 1009, + 1009, 1009, 1009, 1009, 1009, 1009, 81, 81, 81, 81, 1010, 1010, 1010, + 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 81, 81, 81, 81, 81, 1010, + 1010, 1010, 1010, 1010, 81, 81, 81, 1010, 81, 81, 81, 81, 81, 81, 81, + 1010, 1010, 81, 81, 1011, 1012, 1013, 1014, 503, 503, 503, 503, 81, 81, + 81, 81, 317, 317, 317, 317, 317, 317, 81, 81, 317, 317, 317, 317, 317, + 317, 317, 81, 81, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, 317, + 317, 1015, 1015, 451, 451, 451, 317, 317, 317, 1016, 1015, 1015, 1015, + 1015, 1015, 503, 503, 503, 503, 503, 503, 503, 503, 156, 156, 156, 156, + 156, 156, 156, 156, 317, 317, 96, 96, 96, 96, 96, 156, 156, 317, 317, + 317, 317, 317, 317, 96, 96, 96, 96, 317, 317, 317, 81, 81, 81, 81, 81, + 81, 81, 724, 724, 1017, 1017, 1017, 724, 81, 81, 619, 619, 619, 619, 81, + 81, 81, 81, 619, 81, 81, 81, 81, 81, 81, 81, 510, 510, 510, 510, 510, + 510, 510, 510, 510, 510, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 510, 510, 510, 510, 510, 510, 510, 510, 510, 510, + 49, 49, 49, 49, 49, 49, 49, 81, 49, 49, 49, 49, 49, 49, 510, 81, 510, + 510, 81, 81, 510, 81, 81, 510, 510, 81, 81, 510, 510, 510, 510, 81, 510, + 510, 49, 49, 81, 49, 81, 49, 49, 49, 49, 49, 49, 49, 81, 49, 49, 49, 49, + 49, 49, 49, 510, 510, 81, 510, 510, 510, 510, 81, 81, 510, 510, 510, 510, + 510, 510, 510, 510, 81, 510, 510, 510, 510, 510, 510, 510, 81, 49, 49, + 510, 510, 81, 510, 510, 510, 510, 81, 510, 510, 510, 510, 510, 81, 510, + 81, 81, 81, 510, 510, 510, 510, 510, 510, 510, 81, 49, 49, 49, 49, 49, + 49, 49, 49, 49, 49, 49, 49, 81, 81, 510, 1018, 49, 49, 49, 49, 49, 49, + 49, 49, 49, 496, 49, 49, 49, 49, 49, 49, 510, 510, 510, 510, 510, 510, + 510, 510, 510, 1018, 49, 49, 49, 49, 49, 49, 49, 49, 49, 496, 49, 49, + 510, 510, 510, 510, 510, 1018, 49, 49, 49, 49, 49, 49, 49, 49, 49, 496, + 49, 49, 49, 49, 49, 49, 510, 510, 510, 510, 510, 510, 510, 510, 510, + 1018, 49, 496, 49, 49, 49, 49, 49, 49, 49, 49, 510, 49, 81, 81, 1019, + 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1020, 1020, 1020, + 1020, 1020, 1020, 1020, 1020, 1021, 1021, 1021, 1021, 1021, 1021, 1021, + 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1020, 1020, 1020, 1020, + 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1020, 1020, + 1020, 1020, 1020, 1020, 1020, 1020, 1021, 1020, 1020, 1020, 1020, 1020, + 1020, 1021, 1020, 1020, 1022, 1022, 1022, 1022, 1023, 81, 81, 81, 81, 81, + 81, 81, 1021, 1021, 1021, 1021, 1021, 81, 1021, 1021, 1021, 1021, 1021, + 1021, 1021, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 81, 1024, 1024, + 1024, 1024, 1024, 1024, 1024, 1024, 1024, 81, 81, 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 81, 1024, 1024, 81, 1024, 1024, 1024, 1024, 1024, 81, + 81, 81, 81, 81, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, 1025, + 1025, 1025, 1025, 1025, 81, 81, 1026, 1026, 1026, 1026, 1026, 1026, 1026, + 1026, 1026, 1027, 1027, 1027, 1027, 1027, 1027, 1027, 81, 1028, 1028, + 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1028, 1029, 1029, 1029, 1029, + 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029, + 1029, 1029, 1030, 1030, 1030, 1030, 1030, 1030, 1031, 81, 81, 81, 81, 81, + 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 81, 81, 81, + 81, 1033, 1033, 81, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, + 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1034, 1035, 1034, + 1034, 1034, 1036, 1034, 1034, 1034, 1034, 81, 81, 81, 146, 146, 146, 146, 81, 146, 146, 146, 81, 146, 146, 81, 146, 81, 81, 146, 81, 146, 146, 146, 146, 146, 146, 146, 146, 146, 146, 81, 146, 146, 146, 146, 81, 146, 81, 146, 81, 81, 81, 81, 81, 81, 146, 81, 81, 81, 81, 146, 81, 146, 81, 146, 81, 146, 146, 146, 81, 146, 81, 146, 81, 146, 81, 146, 81, 146, 146, 146, 146, 81, 146, 81, 146, 146, 81, 146, 146, 146, 146, 146, 146, 146, 146, 146, 81, 81, 81, 81, 81, 146, 146, 146, 81, 146, 146, 146, 132, 132, 81, - 81, 81, 81, 81, 81, 525, 525, 525, 525, 521, 525, 525, 525, 525, 525, - 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 998, 998, 998, 998, - 998, 998, 998, 998, 998, 998, 998, 998, 525, 525, 525, 525, 525, 525, - 525, 998, 998, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, - 525, 525, 525, 521, 525, 525, 525, 525, 525, 525, 998, 998, 47, 47, 47, - 515, 515, 998, 998, 998, 526, 526, 526, 526, 526, 526, 313, 998, 526, - 526, 40, 40, 998, 998, 998, 998, 526, 526, 526, 526, 526, 526, 999, 526, - 526, 999, 999, 999, 999, 999, 999, 999, 999, 999, 999, 526, 526, 526, - 526, 526, 526, 526, 526, 526, 526, 998, 998, 998, 998, 998, 998, 998, - 998, 998, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, - 1001, 582, 582, 998, 998, 998, 998, 998, 582, 582, 582, 582, 998, 998, - 998, 998, 582, 998, 998, 998, 998, 998, 998, 998, 582, 582, 998, 998, - 998, 998, 998, 998, 521, 521, 521, 521, 521, 521, 998, 998, 521, 525, - 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 521, 521, 521, - 521, 521, 521, 521, 521, 521, 525, 521, 521, 521, 521, 521, 521, 525, - 521, 521, 521, 521, 521, 521, 521, 532, 521, 521, 521, 521, 521, 521, - 525, 525, 525, 525, 525, 525, 525, 525, 40, 40, 525, 525, 521, 521, 521, - 521, 521, 524, 524, 521, 521, 521, 521, 521, 524, 521, 521, 521, 521, - 521, 532, 532, 532, 521, 521, 532, 521, 521, 532, 530, 530, 525, 525, - 521, 521, 525, 525, 525, 521, 525, 525, 525, 521, 521, 521, 1002, 1002, - 1002, 1002, 1002, 521, 521, 521, 521, 521, 521, 521, 525, 521, 525, 532, - 532, 521, 521, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, - 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 532, - 532, 532, 532, 521, 521, 521, 521, 532, 521, 532, 521, 521, 521, 532, - 521, 521, 521, 521, 532, 532, 532, 521, 532, 532, 532, 524, 521, 524, - 521, 524, 521, 521, 521, 521, 521, 532, 521, 521, 521, 521, 524, 521, - 524, 524, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, 525, 525, - 521, 524, 524, 524, 524, 524, 524, 524, 521, 521, 521, 521, 521, 521, - 521, 521, 524, 524, 524, 524, 524, 524, 521, 521, 521, 521, 521, 524, - 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, 524, 40, 40, 40, 40, - 525, 521, 521, 521, 521, 525, 525, 525, 525, 525, 530, 530, 525, 525, - 525, 525, 532, 525, 525, 525, 525, 525, 530, 525, 525, 525, 525, 532, - 532, 525, 525, 525, 525, 525, 40, 40, 40, 40, 40, 40, 40, 40, 525, 525, - 525, 525, 40, 40, 525, 521, 521, 521, 521, 521, 521, 521, 521, 521, 521, - 532, 532, 532, 521, 521, 521, 532, 532, 532, 532, 532, 40, 40, 40, 40, - 40, 40, 534, 534, 534, 1003, 1003, 1003, 40, 40, 40, 40, 521, 521, 521, - 532, 521, 521, 521, 521, 521, 521, 521, 521, 532, 532, 532, 521, 532, - 521, 521, 521, 521, 521, 525, 525, 525, 525, 525, 525, 532, 525, 525, - 525, 521, 521, 521, 525, 525, 998, 998, 998, 525, 525, 525, 521, 521, - 998, 998, 998, 525, 525, 525, 525, 521, 521, 521, 521, 521, 998, 998, - 998, 998, 998, 998, 998, 40, 40, 40, 40, 998, 998, 998, 998, 40, 40, 40, - 40, 40, 998, 998, 998, 40, 40, 998, 998, 998, 998, 998, 998, 40, 40, 40, - 40, 40, 40, 998, 998, 532, 532, 532, 532, 532, 521, 532, 532, 521, 521, - 521, 521, 521, 521, 532, 521, 532, 532, 521, 521, 521, 532, 532, 998, - 521, 521, 521, 521, 521, 998, 998, 998, 521, 521, 521, 521, 998, 998, - 998, 998, 521, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, 532, - 532, 532, 521, 521, 521, 521, 521, 521, 521, 521, 521, 998, 998, 998, - 998, 998, 998, 998, 81, 81, 589, 589, 589, 589, 589, 589, 589, 590, 589, - 589, 589, 589, 589, 590, 590, 590, 589, 590, 590, 590, 590, 590, 590, - 590, 590, 590, 590, 590, 590, 590, 81, 81, 81, 499, 81, 81, 81, 81, 81, - 81, 499, 499, 499, 499, 499, 499, 499, 499, 667, 667, 667, 667, 667, 667, - 81, 81, + 81, 81, 81, 81, 81, 529, 529, 529, 529, 525, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, 1037, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 529, 529, 529, 529, 529, + 529, 529, 1037, 1037, 529, 529, 529, 529, 529, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 525, 529, 529, 529, 529, 529, 529, 1037, 1037, 47, + 47, 47, 519, 519, 1037, 1037, 1037, 530, 530, 530, 530, 530, 530, 317, + 40, 530, 530, 40, 40, 1037, 1037, 1037, 1037, 530, 530, 530, 530, 530, + 530, 1038, 530, 530, 1038, 1038, 1038, 1038, 1038, 1038, 1038, 1038, + 1038, 1038, 530, 530, 530, 530, 530, 530, 530, 530, 530, 530, 1037, 1037, + 1037, 1037, 1037, 1037, 1037, 1037, 1037, 1039, 1039, 1039, 1039, 1039, + 1039, 1039, 1039, 1039, 1039, 1040, 585, 585, 1037, 1037, 1037, 1037, + 1037, 585, 585, 585, 585, 1037, 1037, 1037, 1037, 585, 1037, 1037, 1037, + 1037, 1037, 1037, 1037, 585, 585, 1037, 1037, 1037, 1037, 1037, 1037, + 525, 525, 525, 525, 525, 525, 1037, 1037, 525, 529, 529, 529, 529, 529, + 529, 529, 529, 529, 529, 529, 529, 525, 525, 525, 525, 525, 525, 525, + 525, 525, 529, 525, 525, 525, 525, 525, 525, 529, 525, 525, 525, 525, + 525, 525, 525, 536, 525, 525, 525, 525, 525, 525, 529, 529, 529, 529, + 529, 529, 529, 529, 40, 40, 529, 529, 525, 525, 525, 525, 525, 528, 528, + 525, 525, 525, 525, 525, 528, 525, 525, 525, 525, 525, 536, 536, 536, + 525, 525, 536, 525, 525, 536, 534, 534, 529, 529, 525, 525, 529, 529, + 529, 525, 529, 529, 529, 525, 525, 525, 1041, 1041, 1041, 1041, 1041, + 525, 525, 525, 525, 525, 525, 525, 529, 525, 529, 536, 536, 525, 525, + 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, 525, 525, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 536, 536, 536, 536, + 525, 525, 525, 525, 536, 525, 536, 525, 525, 525, 536, 525, 525, 525, + 525, 536, 536, 536, 525, 536, 536, 536, 528, 525, 528, 525, 528, 525, + 525, 525, 525, 525, 536, 525, 525, 525, 525, 528, 525, 528, 528, 525, + 525, 525, 525, 525, 525, 525, 525, 525, 525, 529, 529, 525, 528, 528, + 528, 528, 528, 528, 528, 525, 525, 525, 525, 525, 525, 525, 525, 528, + 528, 528, 528, 528, 528, 525, 525, 525, 525, 525, 528, 528, 528, 528, + 528, 528, 528, 528, 528, 528, 528, 528, 40, 40, 40, 40, 529, 525, 525, + 525, 525, 529, 529, 529, 529, 529, 534, 534, 529, 529, 529, 529, 536, + 529, 529, 529, 529, 529, 534, 529, 529, 529, 529, 536, 536, 529, 529, + 529, 529, 529, 40, 40, 40, 40, 40, 40, 40, 40, 529, 529, 529, 529, 40, + 40, 529, 525, 525, 525, 525, 525, 525, 525, 525, 525, 525, 536, 536, 536, + 525, 525, 525, 536, 536, 536, 536, 536, 40, 40, 40, 40, 40, 40, 538, 538, + 538, 1042, 1042, 1042, 40, 40, 40, 40, 525, 525, 525, 536, 525, 525, 525, + 525, 525, 525, 525, 525, 536, 536, 536, 525, 536, 525, 525, 525, 525, + 525, 529, 529, 529, 529, 529, 529, 536, 529, 529, 529, 525, 525, 525, + 529, 529, 1037, 1037, 1037, 529, 529, 529, 525, 525, 1037, 1037, 1037, + 529, 529, 529, 529, 525, 525, 525, 525, 525, 525, 1037, 1037, 1037, 1037, + 1037, 1037, 40, 40, 40, 40, 1037, 1037, 1037, 1037, 40, 40, 40, 40, 40, + 529, 529, 529, 529, 1037, 1037, 1037, 1037, 1037, 1037, 1037, 40, 40, + 1037, 1037, 1037, 1037, 1037, 1037, 40, 40, 40, 40, 40, 40, 1037, 1037, + 536, 536, 536, 536, 536, 525, 536, 536, 525, 525, 525, 525, 525, 525, + 536, 525, 536, 536, 525, 525, 525, 536, 536, 1037, 525, 1037, 1037, 525, + 525, 525, 525, 1037, 1037, 1037, 525, 1037, 525, 525, 525, 525, 525, 525, + 525, 1037, 1037, 1037, 1037, 1037, 525, 525, 525, 525, 525, 536, 536, + 525, 536, 536, 1037, 1037, 1037, 1037, 1037, 1037, 525, 536, 536, 536, + 536, 536, 536, 536, 536, 536, 536, 536, 536, 536, 525, 525, 1037, 1037, + 1037, 1037, 1037, 1037, 81, 81, 592, 592, 592, 592, 592, 592, 592, 593, + 592, 592, 592, 592, 592, 593, 593, 593, 592, 593, 593, 593, 593, 593, + 593, 593, 593, 593, 593, 593, 593, 593, 81, 81, 81, 503, 81, 81, 81, 81, + 81, 81, 503, 503, 503, 503, 503, 503, 503, 503, 670, 670, 670, 670, 670, + 670, 81, 81, }; /* decomposition data */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn/ucdn.h 2018-07-25 15:36:46.000000000 +0000 @@ -42,6 +42,16 @@ # include <inttypes.h> #elif defined (_AIX) # include <sys/inttypes.h> +#elif defined (_MSC_VER) && _MSC_VER < 1600 +/* VS 2010 (_MSC_VER 1600) has stdint.h */ +typedef __int8 int8_t; +typedef unsigned __int8 uint8_t; +typedef __int16 int16_t; +typedef unsigned __int16 uint16_t; +typedef __int32 int32_t; +typedef unsigned __int32 uint32_t; +typedef __int64 int64_t; +typedef unsigned __int64 uint64_t; #else # include <stdint.h> #endif diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-ucdn.cc 2018-07-25 15:36:46.000000000 +0000 @@ -164,6 +164,13 @@ HB_SCRIPT_NUSHU, HB_SCRIPT_SOYOMBO, HB_SCRIPT_ZANABAZAR_SQUARE, + HB_SCRIPT_DOGRA, + HB_SCRIPT_GUNJALA_GONDI, + HB_SCRIPT_HANIFI_ROHINGYA, + HB_SCRIPT_MAKASAR, + HB_SCRIPT_MEDEFAIDRIN, + HB_SCRIPT_OLD_SOGDIAN, + HB_SCRIPT_SOGDIAN, }; static hb_unicode_combining_class_t @@ -237,7 +244,12 @@ static void free_static_ucdn_funcs (void) { - hb_unicode_funcs_destroy (static_ucdn_funcs); +retry: + hb_unicode_funcs_t *ucdn_funcs = (hb_unicode_funcs_t *) hb_atomic_ptr_get (&static_ucdn_funcs); + if (!hb_atomic_ptr_cmpexch (&static_ucdn_funcs, ucdn_funcs, nullptr)) + goto retry; + + hb_unicode_funcs_destroy (ucdn_funcs); } #endif diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.cc 2018-07-25 15:36:46.000000000 +0000 @@ -64,7 +64,7 @@ static hb_codepoint_t hb_unicode_mirroring_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED, - hb_codepoint_t unicode HB_UNUSED, + hb_codepoint_t unicode, void *user_data HB_UNUSED) { return unicode; diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode-private.hh openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode-private.hh --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode-private.hh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode-private.hh 2018-07-25 15:36:46.000000000 +0000 @@ -202,8 +202,8 @@ } /* Space estimates based on: - * http://www.unicode.org/charts/PDF/U2000.pdf - * https://www.microsoft.com/typography/developers/fdsspec/spaces.aspx + * https://unicode.org/charts/PDF/U2000.pdf + * https://docs.microsoft.com/en-us/typography/develop/character-design-standards/whitespace */ enum space_t { NOT_SPACE = 0, @@ -276,10 +276,10 @@ * We permute the "fixed-position" classes 10-26 into the order * described in the SBL Hebrew manual: * - * http://www.sbl-site.org/Fonts/SBLHebrewUserManual1.5x.pdf + * https://www.sbl-site.org/Fonts/SBLHebrewUserManual1.5x.pdf * * (as recommended by: - * http://forum.fontlab.com/archive-old-microsoft-volt-group/vista-and-diacritic-ordering-t6751.0.html) + * https://forum.fontlab.com/archive-old-microsoft-volt-group/vista-and-diacritic-ordering/msg22823/) * * More details here: * https://bugzilla.mozilla.org/show_bug.cgi?id=662055 @@ -306,8 +306,8 @@ * Arabic * * Modify to move Shadda (ccc=33) before other marks. See: - * http://unicode.org/faq/normalization.html#8 - * http://unicode.org/faq/normalization.html#9 + * https://unicode.org/faq/normalization.html#8 + * https://unicode.org/faq/normalization.html#9 */ #define HB_MODIFIED_COMBINING_CLASS_CCC27 28 /* fathatan */ #define HB_MODIFIED_COMBINING_CLASS_CCC28 29 /* dammatan */ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-version.h openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-version.h --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-version.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/harfbuzz/hb-version.h 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,10 @@ #define HB_VERSION_MAJOR 1 -#define HB_VERSION_MINOR 7 -#define HB_VERSION_MICRO 6 +#define HB_VERSION_MINOR 8 +#define HB_VERSION_MICRO 2 -#define HB_VERSION_STRING "1.7.6" +#define HB_VERSION_STRING "1.8.2" #define HB_VERSION_ATLEAST(major,minor,micro) \ ((major)*10000+(minor)*100+(micro) <= \ diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/hb-jdk-font.cc 2018-07-25 15:36:46.000000000 +0000 @@ -48,10 +48,18 @@ JDKFontInfo *jdkFontInfo = (JDKFontInfo*)font_data; JNIEnv* env = jdkFontInfo->env; jobject font2D = jdkFontInfo->font2D; - hb_codepoint_t u = (variation_selector==0) ? unicode : variation_selector; - - *glyph = (hb_codepoint_t) - env->CallIntMethod(font2D, sunFontIDs.f2dCharToGlyphMID, u); + if (variation_selector == 0) { + *glyph = (hb_codepoint_t)env->CallIntMethod( + font2D, sunFontIDs.f2dCharToGlyphMID, unicode); + } else { + *glyph = (hb_codepoint_t)env->CallIntMethod( + font2D, sunFontIDs.f2dCharToVariationGlyphMID, + unicode, variation_selector); + } + if (env->ExceptionOccurred()) + { + env->ExceptionClear(); + } if ((int)*glyph < 0) { *glyph = 0; } diff -Nru openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/sunFont.c openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/sunFont.c --- openjdk-11-11~19/src/java.desktop/share/native/libfontmanager/sunFont.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/share/native/libfontmanager/sunFont.c 2018-07-25 15:36:46.000000000 +0000 @@ -144,6 +144,8 @@ CHECK_NULL(tmpClass = (*env)->FindClass(env, "sun/font/Font2D")); CHECK_NULL(sunFontIDs.f2dCharToGlyphMID = (*env)->GetMethodID(env, tmpClass, "charToGlyph", "(I)I")); + CHECK_NULL(sunFontIDs.f2dCharToVariationGlyphMID = + (*env)->GetMethodID(env, tmpClass, "charToVariationGlyph", "(II)I")); CHECK_NULL(sunFontIDs.getMapperMID = (*env)->GetMethodID(env, tmpClass, "getMapper", "()Lsun/font/CharToGlyphMapper;")); diff -Nru openjdk-11-11~19/src/java.desktop/unix/classes/sun/awt/X11/XCustomCursor.java openjdk-11-11~24/src/java.desktop/unix/classes/sun/awt/X11/XCustomCursor.java --- openjdk-11-11~19/src/java.desktop/unix/classes/sun/awt/X11/XCustomCursor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/unix/classes/sun/awt/X11/XCustomCursor.java 2018-07-25 15:36:46.000000000 +0000 @@ -63,6 +63,10 @@ XlibWrapper.XQueryBestCursor(display,root_window, Math.abs(preferredWidth),Math.abs(preferredHeight),XlibWrapper.larg1,XlibWrapper.larg2); d = new Dimension(XlibWrapper.unsafe.getInt(XlibWrapper.larg1),XlibWrapper.unsafe.getInt(XlibWrapper.larg2)); + if (preferredWidth > 0 && preferredHeight > 0) { + d.width = Math.min(d.width, preferredWidth); + d.height = Math.min(d.height, preferredHeight); + } } finally { XToolkit.awtUnlock(); diff -Nru openjdk-11-11~19/src/java.desktop/unix/native/common/awt/CUPSfuncs.c openjdk-11-11~24/src/java.desktop/unix/native/common/awt/CUPSfuncs.c --- openjdk-11-11~19/src/java.desktop/unix/native/common/awt/CUPSfuncs.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/unix/native/common/awt/CUPSfuncs.c 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,16 @@ #include <dlfcn.h> #include <cups/cups.h> #include <cups/ppd.h> +/* + * CUPS #define's __attribute__(x) to be empty unless __GNUC__ is defined. + * However OpenJDK officially uses the SunStudio compiler on Solaris. + * We need to #undef this else it breaks use of this keyword used by JNIEXPORT. + * See: https://github.com/apple/cups/issues/5349 + */ +#ifdef __SUNPRO_C +#undef __attribute__ +#endif + //#define CUPS_DEBUG diff -Nru openjdk-11-11~19/src/java.desktop/unix/native/common/awt/fontpath.c openjdk-11-11~24/src/java.desktop/unix/native/common/awt/fontpath.c --- openjdk-11-11~19/src/java.desktop/unix/native/common/awt/fontpath.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/unix/native/common/awt/fontpath.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -265,7 +265,7 @@ } - newFontPath = SAFE_SIZE_ARRAY_ALLOC(malloc, totalDirCount, sizeof ( char **) ); + newFontPath = SAFE_SIZE_ARRAY_ALLOC(malloc, totalDirCount, sizeof(char *)); /* if it fails free things and get out */ if ( newFontPath == NULL ) { free ( ( void *) appendDirList ); diff -Nru openjdk-11-11~19/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c openjdk-11-11~24/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c --- openjdk-11-11~19/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -547,6 +547,7 @@ fp_g_path_get_dirname = dl_symbol("g_path_get_dirname"); + fp_gdk_threads_init = dl_symbol("gdk_threads_init"); fp_gdk_threads_enter = dl_symbol("gdk_threads_enter"); fp_gdk_threads_leave = dl_symbol("gdk_threads_leave"); @@ -626,10 +627,16 @@ AWT_LOCK(); handler = XSetErrorHandler(NULL); io_handler = XSetIOErrorHandler(NULL); + + //According the GTK documentation, gdk_threads_init() should be + //called before gtk_init() or gtk_init_check() + fp_gdk_threads_init(); result = (*fp_gtk_init_check)(NULL, NULL); + XSetErrorHandler(handler); XSetIOErrorHandler(io_handler); AWT_UNLOCK(); + /* Initialize widget array. */ for (i = 0; i < _GTK_WIDGET_TYPE_SIZE; i++) { diff -Nru openjdk-11-11~19/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java openjdk-11-11~24/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java --- openjdk-11-11~19/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolder2.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -170,7 +170,7 @@ } // Known Folder data - static class KnownFolderDefinition { + static final class KnownFolderDefinition { String guid; int category; String name; @@ -187,7 +187,10 @@ String ftidType; String path; String saveLocation; - static final List<KnownFolderDefinition> libraries = getLibraries(); + } + + static final class KnownLibraries { + static final List<KnownFolderDefinition> INSTANCE = getLibraries(); } static class FolderDisposer implements sun.java2d.DisposerRecord { @@ -625,7 +628,7 @@ // this is a temp fix until java.io starts support Libraries if( path != null && path.startsWith("::{") && path.toLowerCase().endsWith(".library-ms")) { - for (KnownFolderDefinition kf : KnownFolderDefinition.libraries) { + for (KnownFolderDefinition kf : KnownLibraries.INSTANCE) { if (path.toLowerCase().endsWith( "\\" + kf.relativePath.toLowerCase()) && path.toUpperCase().startsWith( diff -Nru openjdk-11-11~19/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java openjdk-11-11~24/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java --- openjdk-11-11~19/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/windows/classes/sun/print/PrintServiceLookupProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -53,8 +53,42 @@ private PrintService defaultPrintService; private String[] printers; /* excludes the default printer */ private PrintService[] printServices; /* includes the default printer */ + private static boolean pollServices = true; + private static final int DEFAULT_MINREFRESH = 240; // 4 minutes + private static int minRefreshTime = DEFAULT_MINREFRESH; static { + /* The system property "sun.java2d.print.polling" + * can be used to force the printing code to poll or not poll + * for PrintServices. + */ + String pollStr = java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction("sun.java2d.print.polling")); + + if (pollStr != null) { + if (pollStr.equalsIgnoreCase("false")) { + pollServices = false; + } + } + + /* The system property "sun.java2d.print.minRefreshTime" + * can be used to specify minimum refresh time (in seconds) + * for polling PrintServices. The default is 240. + */ + String refreshTimeStr = java.security.AccessController.doPrivileged( + new sun.security.action.GetPropertyAction( + "sun.java2d.print.minRefreshTime")); + + if (refreshTimeStr != null) { + try { + minRefreshTime = (Integer.valueOf(refreshTimeStr)).intValue(); + } catch (NumberFormatException e) { + } + if (minRefreshTime < DEFAULT_MINREFRESH) { + minRefreshTime = DEFAULT_MINREFRESH; + } + } + java.security.AccessController.doPrivileged( new java.security.PrivilegedAction<Void>() { public Void run() { @@ -96,11 +130,19 @@ if (osName != null && osName.startsWith("Windows 98")) { return; } - // start the printer listener thread + // start the local printer listener thread Thread thr = new Thread(null, new PrinterChangeListener(), "PrinterListener", 0, false); thr.setDaemon(true); thr.start(); + + if (pollServices) { + // start the remote printer listener thread + Thread remThr = new Thread(null, new RemotePrinterChangeListener(), + "RemotePrinterListener", 0, false); + remThr.setDaemon(true); + remThr.start(); + } } /* else condition ought to never happen! */ } @@ -316,7 +358,6 @@ } return defaultPrintService; } - class PrinterChangeListener implements Runnable { long chgObj; PrinterChangeListener() { @@ -343,9 +384,74 @@ } } + /* Windows provides *PrinterChangeNotification* functions that provides + information about printer status changes of the local printers but not + network printers. + Alternatively, Windows provides a way thro' which one can get the + network printer status changes by using WMI, RegistryKeyChange combination, + which is a slightly complex mechanism. + The Windows WMI offers an async and sync method to read thro' registry + via the WQL query. The async method is considered dangerous as it leaves + open a channel until we close it. But the async method has the advantage of + being notified of a change in registry by calling callback without polling for it. + The sync method uses the polling mechanism to notify. + RegistryValueChange cannot be used in combination with WMI to get registry + value change notification because of an error that may be generated because the + scope of the query would be too big to handle(at times). + Hence an alternative mechanism is choosen via the EnumPrinters by polling for the + count of printer status changes(add\remove) and based on it update the printers + list. + */ + class RemotePrinterChangeListener implements Runnable { + private String[] prevRemotePrinters; + + RemotePrinterChangeListener() { + prevRemotePrinters = getRemotePrintersNames(); + } + + boolean doCompare(String[] str1, String[] str2) { + if (str1.length != str2.length) { + return true; + } else { + for (int i = 0;i < str1.length;i++) { + for (int j = 0;j < str2.length;j++) { + if (!str1[i].equals(str2[j])) { + return true; + } + } + } + } + + return false; + } + + @Override + public void run() { + while (true) { + String[] currentRemotePrinters = getRemotePrintersNames(); + if (doCompare(prevRemotePrinters, currentRemotePrinters)) { + + // updated the printers data + // printers list now contains both local and network printer data + refreshServices(); + + // store the current data for next comparison + prevRemotePrinters = currentRemotePrinters; + } + + try { + Thread.sleep(minRefreshTime * 1000); + } catch (InterruptedException e) { + break; + } + } + } + } + private native String getDefaultPrinterName(); private native String[] getAllPrinterNames(); private native long notifyFirstPrinterChange(String printer); private native void notifyClosePrinterChange(long chgObj); private native int notifyPrinterChange(long chgObj); + private native String[] getRemotePrintersNames(); } diff -Nru openjdk-11-11~19/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp openjdk-11-11~24/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp --- openjdk-11-11~19/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/windows/native/libawt/windows/awt_Component.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -3537,15 +3537,10 @@ BOOL shiftIsDown = FALSE; if (modifiers) { shiftIsDown = modifiers & java_awt_event_InputEvent_SHIFT_DOWN_MASK; - BOOL altIsDown = modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK; + BOOL altIsDown = ((modifiers & java_awt_event_InputEvent_ALT_DOWN_MASK) || + (modifiers & java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK)); BOOL ctrlIsDown = modifiers & java_awt_event_InputEvent_CTRL_DOWN_MASK; - // Windows treats AltGr as Ctrl+Alt - if (modifiers & java_awt_event_InputEvent_ALT_GRAPH_DOWN_MASK) { - altIsDown = TRUE; - ctrlIsDown = TRUE; - } - if (shiftIsDown) { keyboardState[VK_SHIFT] |= KEY_STATE_DOWN; } diff -Nru openjdk-11-11~19/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp openjdk-11-11~24/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp --- openjdk-11-11~19/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/windows/native/libawt/windows/ShellFolder2.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1398,7 +1398,7 @@ DEFINE_FIELD_ID(field_defenitionFlags, cl, "defenitionFlags", "I"); DEFINE_FIELD_ID(field_ftidType, cl, "ftidType", "Ljava/lang/String;"); - jobjectArray result; + jobjectArray result = NULL; KNOWNFOLDERID* pFoldersIds = NULL; UINT count = 0; if (SUCCEEDED(pkfm->GetFolderIds(&pFoldersIds, &count))) { diff -Nru openjdk-11-11~19/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp openjdk-11-11~24/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp --- openjdk-11-11~19/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.desktop/windows/native/libawt/windows/WPrinterJob.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -232,6 +232,76 @@ } } +JNIEXPORT jobjectArray JNICALL +Java_sun_print_PrintServiceLookupProvider_getRemotePrintersNames(JNIEnv *env, + jobject peer) +{ + TRY; + + int remotePrintersCount = 0; + DWORD cbNeeded = 0; + DWORD cReturned = 0; + LPBYTE pPrinterEnum = NULL; + LPBYTE pNetworkPrinterLoc = NULL; + + jstring utf_str; + jclass clazz = env->FindClass("java/lang/String"); + if (clazz == NULL) { + return NULL; + } + jobjectArray nameArray; + + try { + ::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, + NULL, 4, NULL, 0, &cbNeeded, &cReturned); + pPrinterEnum = new BYTE[cbNeeded]; + pNetworkPrinterLoc = new BYTE[cbNeeded/sizeof(PRINTER_INFO_4)]; + ::EnumPrinters(PRINTER_ENUM_LOCAL | PRINTER_ENUM_CONNECTIONS, + NULL, 4, pPrinterEnum, cbNeeded, &cbNeeded, + &cReturned); + + if (cReturned > 0) { + for (DWORD i = 0; i < cReturned; i++) { + PRINTER_INFO_4 *info4 = (PRINTER_INFO_4 *) (pPrinterEnum + i * sizeof(PRINTER_INFO_4)); + + // Store the network printers indexes + if (info4->Attributes & PRINTER_ATTRIBUTE_NETWORK) { + pNetworkPrinterLoc[remotePrintersCount++] = i; + } + } + + // Allocate space only for the network type printers + nameArray = env->NewObjectArray(remotePrintersCount, clazz, NULL); + if (nameArray == NULL) { + throw std::bad_alloc(); + } + } else { + nameArray = NULL; + } + + // Loop thro' network printers list only + for (int i = 0; i < remotePrintersCount; i++) { + PRINTER_INFO_4 *info4 = (PRINTER_INFO_4 *) + (pPrinterEnum + pNetworkPrinterLoc[i] * sizeof(PRINTER_INFO_4)); + utf_str = JNU_NewStringPlatform(env, info4->pPrinterName); + if (utf_str == NULL) { + throw std::bad_alloc(); + } + env->SetObjectArrayElement(nameArray, i, utf_str); + env->DeleteLocalRef(utf_str); + } + } catch (std::bad_alloc&) { + delete [] pPrinterEnum; + delete [] pNetworkPrinterLoc; + throw; + } + + delete [] pPrinterEnum; + delete [] pNetworkPrinterLoc; + return nameArray; + + CATCH_BAD_ALLOC_RET(NULL); +} JNIEXPORT jfloatArray JNICALL Java_sun_print_Win32PrintService_getMediaPrintableArea(JNIEnv *env, diff -Nru openjdk-11-11~19/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java openjdk-11-11~24/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java --- openjdk-11-11~19/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.instrument/share/classes/java/lang/instrument/Instrumentation.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -219,10 +219,14 @@ * Instances of the retransformed class are not affected. * * <P> - * The retransformation may change method bodies, the constant pool and attributes. + * The retransformation may change method bodies, the constant pool and + * attributes (unless explicitly prohibited). * The retransformation must not add, remove or rename fields or methods, change the - * signatures of methods, or change inheritance. These restrictions maybe be - * lifted in future versions. The class file bytes are not checked, verified and installed + * signatures of methods, or change inheritance. + * The retransformation must not change the <code>NestHost</code> or + * <code>NestMembers</code> attributes. + * These restrictions may be lifted in future versions. + * The class file bytes are not checked, verified and installed * until after the transformations have been applied, if the resultant bytes are in * error this method will throw an exception. * @@ -306,10 +310,14 @@ * Instances of the redefined class are not affected. * * <P> - * The redefinition may change method bodies, the constant pool and attributes. + * The redefinition may change method bodies, the constant pool and attributes + * (unless explicitly prohibited). * The redefinition must not add, remove or rename fields or methods, change the - * signatures of methods, or change inheritance. These restrictions maybe be - * lifted in future versions. The class file bytes are not checked, verified and installed + * signatures of methods, or change inheritance. + * The redefinition must not change the <code>NestHost</code> or + * <code>NestMembers</code> attributes. + * These restrictions may be lifted in future versions. + * The class file bytes are not checked, verified and installed * until after the transformations have been applied, if the resultant bytes are in * error this method will throw an exception. * diff -Nru openjdk-11-11~19/src/java.instrument/share/native/libinstrument/JavaExceptions.c openjdk-11-11~24/src/java.instrument/share/native/libinstrument/JavaExceptions.c --- openjdk-11-11~19/src/java.instrument/share/native/libinstrument/JavaExceptions.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.instrument/share/native/libinstrument/JavaExceptions.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -214,6 +214,11 @@ message = "class redefinition failed: attempted to change the class modifiers"; break; + case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED: + throwableClassName = "java/lang/UnsupportedOperationException"; + message = "class redefinition failed: attempted to change the class NestHost or NestMembers attribute"; + break; + case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED: throwableClassName = "java/lang/UnsupportedOperationException"; message = "class redefinition failed: attempted to change method modifiers"; diff -Nru openjdk-11-11~19/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java openjdk-11-11~24/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java --- openjdk-11-11~19/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.naming/share/classes/com/sun/jndi/ldap/Connection.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,8 +44,11 @@ import java.lang.reflect.Method; import java.lang.reflect.InvocationTargetException; +import java.security.AccessController; +import java.security.PrivilegedAction; import java.util.Arrays; import javax.net.SocketFactory; +import javax.net.ssl.SSLParameters; /** * A thread that creates a connection to an LDAP server. @@ -158,7 +161,18 @@ int readTimeout; int connectTimeout; + private static final boolean IS_HOSTNAME_VERIFICATION_DISABLED + = hostnameVerificationDisabledValue(); + private static boolean hostnameVerificationDisabledValue() { + PrivilegedAction<String> act = () -> System.getProperty( + "com.sun.jndi.ldap.object.disableEndpointIdentification"); + String prop = AccessController.doPrivileged(act); + if (prop == null) { + return false; + } + return prop.isEmpty() ? true : Boolean.parseBoolean(prop); + } // true means v3; false means v2 // Called in LdapClient.authenticate() (which is synchronized) // when connection is "quiet" and not shared; no need to synchronize @@ -321,15 +335,20 @@ // the SSL handshake following socket connection as part of the timeout. // So explicitly set a socket read timeout, trigger the SSL handshake, // then reset the timeout. - if (connectTimeout > 0 && socket instanceof SSLSocket) { + if (socket instanceof SSLSocket) { SSLSocket sslSocket = (SSLSocket) socket; int socketTimeout = sslSocket.getSoTimeout(); - - sslSocket.setSoTimeout(connectTimeout); // reuse full timeout value + if (!IS_HOSTNAME_VERIFICATION_DISABLED) { + SSLParameters param = sslSocket.getSSLParameters(); + param.setEndpointIdentificationAlgorithm("LDAPS"); + sslSocket.setSSLParameters(param); + } + if (connectTimeout > 0) { + sslSocket.setSoTimeout(connectTimeout); // reuse full timeout value + } sslSocket.startHandshake(); sslSocket.setSoTimeout(socketTimeout); } - return socket; } diff -Nru openjdk-11-11~19/src/java.naming/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java openjdk-11-11~24/src/java.naming/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java --- openjdk-11-11~19/src/java.naming/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.naming/share/classes/com/sun/jndi/ldap/ext/StartTlsResponseImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -404,27 +404,16 @@ try { HostnameChecker checker = HostnameChecker.getInstance( HostnameChecker.TYPE_LDAP); - // Use ciphersuite to determine whether Kerberos is active. - if (session.getCipherSuite().startsWith("TLS_KRB5")) { - Principal principal = getPeerPrincipal(session); - if (!HostnameChecker.match(hostname, principal)) { - throw new SSLPeerUnverifiedException( - "hostname of the kerberos principal:" + principal + - " does not match the hostname:" + hostname); - } - } else { // X.509 - - // get the subject's certificate - certs = session.getPeerCertificates(); - X509Certificate peerCert; - if (certs[0] instanceof java.security.cert.X509Certificate) { - peerCert = (java.security.cert.X509Certificate) certs[0]; - } else { - throw new SSLPeerUnverifiedException( - "Received a non X509Certificate from the server"); - } - checker.match(hostname, peerCert); + // get the subject's certificate + certs = session.getPeerCertificates(); + X509Certificate peerCert; + if (certs[0] instanceof java.security.cert.X509Certificate) { + peerCert = (java.security.cert.X509Certificate) certs[0]; + } else { + throw new SSLPeerUnverifiedException( + "Received a non X509Certificate from the server"); } + checker.match(hostname, peerCert); // no exception means verification passed return true; diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/java/net/http/HttpResponse.java openjdk-11-11~24/src/java.net.http/share/classes/java/net/http/HttpResponse.java --- openjdk-11-11~19/src/java.net.http/share/classes/java/net/http/HttpResponse.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/java/net/http/HttpResponse.java 2018-07-25 15:36:46.000000000 +0000 @@ -1188,7 +1188,7 @@ /** * Returns a response subscriber which publishes the response body - * through a {@link Publisher Publisher<List<ByteBuffer>>}. + * through a {@code Publisher<List<ByteBuffer>>}. * * <p> The {@link HttpResponse} using this subscriber is available * immediately after the response headers have been read, without diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/AbstractAsyncSSLConnection.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/AbstractAsyncSSLConnection.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/AbstractAsyncSSLConnection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/AbstractAsyncSSLConnection.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,6 +27,7 @@ import java.net.InetSocketAddress; import java.util.Arrays; +import java.util.ArrayDeque; import java.util.List; import java.util.concurrent.CompletableFuture; import javax.net.ssl.SNIHostName; @@ -89,11 +90,30 @@ final SSLEngine getEngine() { return engine; } + private static boolean contains(String[] rr, String target) { + for (String s : rr) + if (target.equalsIgnoreCase(s)) + return true; + return false; + } + private static SSLParameters createSSLParameters(HttpClientImpl client, ServerName serverName, String[] alpn) { SSLParameters sslp = client.sslParameters(); SSLParameters sslParameters = Utils.copySSLParameters(sslp); + // filter out unwanted protocols, if h2 only + if (alpn != null && alpn.length != 0 && !contains(alpn, "http/1.1")) { + ArrayDeque<String> l = new ArrayDeque<>(); + for (String proto : sslParameters.getProtocols()) { + if (!proto.startsWith("SSL") && !proto.endsWith("v1.1") && !proto.endsWith("v1")) { + l.add(proto); + } + } + String[] a1 = l.toArray(new String[0]); + sslParameters.setProtocols(a1); + } + if (!disableHostnameVerification) sslParameters.setEndpointIdentificationAlgorithm("HTTPS"); if (alpn != null) { @@ -112,10 +132,12 @@ return sslParameters; } + private static SSLEngine createEngine(SSLContext context, String serverName, int port, SSLParameters sslParameters) { SSLEngine engine = context.createSSLEngine(serverName, port); engine.setUseClientMode(true); + engine.setSSLParameters(sslParameters); return engine; } diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLFlowDelegate.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,6 +33,9 @@ import javax.net.ssl.SSLEngineResult.Status; import javax.net.ssl.SSLException; import java.io.IOException; +import java.lang.ref.Reference; +import java.lang.ref.ReferenceQueue; +import java.lang.ref.WeakReference; import java.nio.ByteBuffer; import java.util.ArrayList; import java.util.Collections; @@ -93,6 +96,8 @@ // When handshake is in progress trying to wrap may produce no bytes. private static final ByteBuffer NOTHING = ByteBuffer.allocate(0); private static final String monProp = Utils.getProperty("jdk.internal.httpclient.monitorFlowDelegate"); + private static final boolean isMonitored = + monProp != null && (monProp.equals("") || monProp.equalsIgnoreCase("true")); final Executor exec; final Reader reader; @@ -100,6 +105,7 @@ final SSLEngine engine; final String tubeName; // hack final CompletableFuture<String> alpnCF; // completes on initial handshake + final Monitorable monitor = isMonitored ? this::monitor : null; // prevent GC until SSLFD is stopped volatile boolean close_notify_received; final CompletableFuture<Void> readerCF; final CompletableFuture<Void> writerCF; @@ -152,8 +158,7 @@ // Writer to the downWriter. connect(downReader, downWriter); - if (monProp != null && (monProp.equals("") || monProp.equalsIgnoreCase("true"))) - Monitor.add(this::monitor); + if (isMonitored) Monitor.add(monitor); } /** @@ -202,6 +207,7 @@ public String monitor() { StringBuilder sb = new StringBuilder(); sb.append("SSL: id ").append(id); + sb.append(" ").append(dbgString()); sb.append(" HS state: " + states(handshakeState)); sb.append(" Engine state: " + engine.getHandshakeStatus().toString()); if (stateList != null) { @@ -293,8 +299,10 @@ @Override public String toString() { - return "READER: " + super.toString() + " readBuf: " + readBuf.toString() - + " count: " + count.toString(); + return "READER: " + super.toString() + ", readBuf: " + readBuf.toString() + + ", count: " + count.toString() + ", scheduler: " + + (scheduler.isStopped() ? "stopped" : "running") + + ", status: " + lastUnwrapStatus; } private void reallocReadBuf() { @@ -335,6 +343,7 @@ } if (complete) { this.completing = complete; + minBytesRequired = 0; } } } @@ -395,13 +404,23 @@ // not enough data in the read buffer... // no need to try to unwrap again unless we get more bytes // than minBytesRequired = len in the read buffer. - minBytesRequired = len; synchronized (readBufferLock) { + minBytesRequired = len; // more bytes could already have been added... assert readBuf.remaining() >= len; // check if we have received some data, and if so // we can just re-spin the loop if (readBuf.remaining() > len) continue; + else if (this.completing) { + if (debug.on()) { + debugr.log("BUFFER_UNDERFLOW with EOF," + + " %d bytes non decrypted.", len); + } + // The channel won't send us any more data, and + // we are in underflow: we need to fail. + throw new IOException("BUFFER_UNDERFLOW with EOF, " + + len + " bytes non decrypted."); + } } // request more data and return. requestMore(); @@ -429,6 +448,7 @@ } catch (IOException ex) { errorCommon(ex); handleError(ex); + return; } if (handshaking && !complete) return; @@ -452,12 +472,13 @@ } } + private volatile Status lastUnwrapStatus; EngineResult unwrapBuffer(ByteBuffer src) throws IOException { ByteBuffer dst = getAppBuffer(); int len = src.remaining(); while (true) { SSLEngineResult sslResult = engine.unwrap(src, dst); - switch (sslResult.getStatus()) { + switch (lastUnwrapStatus = sslResult.getStatus()) { case BUFFER_OVERFLOW: // may happen if app size buffer was changed, or if // our 'adaptiveBufferSize' guess was too small for @@ -507,7 +528,9 @@ } public static class Monitor extends Thread { - final List<Monitorable> list; + final List<WeakReference<Monitorable>> list; + final List<FinalMonitorable> finalList; + final ReferenceQueue<Monitorable> queue = new ReferenceQueue<>(); static Monitor themon; static { @@ -515,19 +538,61 @@ themon.start(); // uncomment to enable Monitor } + // An instance used to temporarily store the + // last observable state of a monitorable object. + // When Monitor.remove(o) is called, we replace + // 'o' with a FinalMonitorable whose reference + // will be enqueued after the last observable state + // has been printed. + final class FinalMonitorable implements Monitorable { + final String finalState; + FinalMonitorable(Monitorable o) { + finalState = o.getInfo(); + finalList.add(this); + } + @Override + public String getInfo() { + finalList.remove(this); + return finalState; + } + } + Monitor() { super("Monitor"); setDaemon(true); list = Collections.synchronizedList(new LinkedList<>()); + finalList = new ArrayList<>(); // access is synchronized on list above } void addTarget(Monitorable o) { - list.add(o); + list.add(new WeakReference<>(o, queue)); + } + void removeTarget(Monitorable o) { + // It can take a long time for GC to clean up references. + // Calling Monitor.remove() early helps removing noise from the + // logs/ + synchronized (list) { + Iterator<WeakReference<Monitorable>> it = list.iterator(); + while (it.hasNext()) { + Monitorable m = it.next().get(); + if (m == null) it.remove(); + if (o == m) { + it.remove(); + break; + } + } + FinalMonitorable m = new FinalMonitorable(o); + addTarget(m); + Reference.reachabilityFence(m); + } } public static void add(Monitorable o) { themon.addTarget(o); } + public static void remove(Monitorable o) { + themon.removeTarget(o); + } @Override public void run() { @@ -536,7 +601,14 @@ while (true) { Thread.sleep(20 * 1000); synchronized (list) { - for (Monitorable o : list) { + Reference<? extends Monitorable> expired; + while ((expired = queue.poll()) != null) list.remove(expired); + for (WeakReference<Monitorable> ref : list) { + Monitorable o = ref.get(); + if (o == null) continue; + if (o instanceof FinalMonitorable) { + ref.enqueue(); + } System.out.println(o.getInfo()); System.out.println("-------------------------"); } @@ -733,6 +805,7 @@ // downstream. Otherwise, we send the writeBuffer downstream // and will allocate a new one next time. volatile ByteBuffer writeBuffer; + private volatile Status lastWrappedStatus; @SuppressWarnings("fallthrough") EngineResult wrapBuffers(ByteBuffer[] src) throws SSLException { long len = Utils.remaining(src); @@ -747,7 +820,7 @@ while (true) { SSLEngineResult sslResult = engine.wrap(src, dst); if (debugw.on()) debugw.log("SSLResult: " + sslResult); - switch (sslResult.getStatus()) { + switch (lastWrappedStatus = sslResult.getStatus()) { case BUFFER_OVERFLOW: // Shouldn't happen. We allocated buffer with packet size // get it again if net buffer size was changed @@ -815,8 +888,10 @@ @Override public String toString() { - return "WRITER: " + super.toString() + - " writeList size " + Integer.toString(writeList.size()); + return "WRITER: " + super.toString() + + ", writeList size: " + Integer.toString(writeList.size()) + + ", scheduler: " + (scheduler.isStopped() ? "stopped" : "running") + + ", status: " + lastWrappedStatus; //" writeList: " + writeList.toString(); } } @@ -839,6 +914,7 @@ stopped = true; reader.stop(); writer.stop(); + if (isMonitored) Monitor.remove(monitor); } private Void stopOnError(Throwable currentlyUnused) { @@ -953,6 +1029,10 @@ case NEED_UNWRAP_AGAIN: // do nothing else // receiving-side data will trigger unwrap + if (caller == WRITER) { + reader.schedule(); + return false; + } break; default: throw new InternalError("Unexpected handshake status:" diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLTube.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLTube.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLTube.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/common/SSLTube.java 2018-07-25 15:36:46.000000000 +0000 @@ -406,6 +406,21 @@ } } + private void complete(DelegateWrapper subscriberImpl, Throwable t) { + try { + if (t == null) subscriberImpl.onComplete(); + else subscriberImpl.onError(t); + if (debug.on()) { + debug.log("subscriber completed %s" + + ((t == null) ? "normally" : ("with error: " + t))); + } + } finally { + // Error or EOF while reading: + // cancel write side after completing read side + writeSubscription.cancel(); + } + } + private void onNewSubscription(DelegateWrapper subscriberImpl, Flow.Subscription subscription) { assert subscriberImpl != null; @@ -432,13 +447,13 @@ if (debug.on()) debug.log("onNewSubscription: subscriberImpl:%s, invoking onError:%s", subscriberImpl, failed); - subscriberImpl.onError(failed); + complete(subscriberImpl, failed); } else if (completed) { if (debug.on()) debug.log("onNewSubscription: subscriberImpl:%s, invoking onCompleted", subscriberImpl); finished = true; - subscriberImpl.onComplete(); + complete(subscriberImpl, null); } } @@ -463,7 +478,7 @@ subscriberImpl = subscribed; } if (subscriberImpl != null) { - subscriberImpl.onError(failed); + complete(subscriberImpl, failed); } else { if (debug.on()) debug.log("%s: delegate null, stored %s", this, failed); @@ -485,14 +500,22 @@ return !(hs == NOT_HANDSHAKING || hs == FINISHED); } - private boolean handshakeFailed() { + private String handshakeFailed() { // sslDelegate can be null if we reach here // during the initial handshake, as that happens // within the SSLFlowDelegate constructor. // In that case we will want to raise an exception. - return handshaking() + if (handshaking() && (sslDelegate == null - || !sslDelegate.closeNotifyReceived()); + || !sslDelegate.closeNotifyReceived())) { + return "Remote host terminated the handshake"; + } + // The initial handshake may not have been started yet. + // In which case - if we are completed before the initial handshake + // is started, we consider this a handshake failure as well. + if ("SSL_NULL_WITH_NULL_NULL".equals(engine.getSession().getCipherSuite())) + return "Remote host closed the channel"; + return null; } @Override @@ -503,17 +526,18 @@ subscriberImpl = subscribed; } - if (handshakeFailed()) { + String handshakeFailed = handshakeFailed(); + if (handshakeFailed != null) { if (debug.on()) - debug.log("handshake: %s, inbound done: %s outbound done: %s", + debug.log("handshake: %s, inbound done: %s, outbound done: %s: %s", engine.getHandshakeStatus(), engine.isInboundDone(), - engine.isOutboundDone()); - onErrorImpl(new SSLHandshakeException( - "Remote host terminated the handshake")); + engine.isOutboundDone(), + handshakeFailed); + onErrorImpl(new SSLHandshakeException(handshakeFailed)); } else if (subscriberImpl != null) { onCompleteReceived = finished = true; - subscriberImpl.onComplete(); + complete(subscriberImpl, null); } else { onCompleteReceived = true; } diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Exchange.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Exchange.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Exchange.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Exchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -316,7 +316,7 @@ proxyResponse.version, true); return MinimalFuture.completedFuture(syntheticResponse); } else if (t != null) { - if (debug.on()) debug.log("checkFor407: no response - %s", t); + if (debug.on()) debug.log("checkFor407: no response - %s", (Object)t); return MinimalFuture.failedFuture(t); } else { if (debug.on()) debug.log("checkFor407: all clear"); diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/frame/SettingsFrame.java 2018-07-25 15:36:46.000000000 +0000 @@ -161,14 +161,24 @@ } } - public static SettingsFrame getDefaultSettings() { + // The initial value is 4,096 octets. + public static final int DEFAULT_HEADER_TABLE_SIZE = 4 * K; + // The initial value is 1, which indicates that server push is permitted. + public static final int DEFAULT_ENABLE_PUSH = 1; + // Initially, there is no limit to this value. This limit is directional. + public static final int DEFAULT_MAX_CONCURRENT_STREAMS = Integer.MAX_VALUE; + // The initial value is 2^16-1 (65,535) octets. + public static final int DEFAULT_INITIAL_WINDOW_SIZE = 64 * K -1; + // The initial value is 2^14 (16,384) octets. + public static final int DEFAULT_MAX_FRAME_SIZE = 16 * K; + + public static SettingsFrame defaultRFCSettings() { SettingsFrame f = new SettingsFrame(); - // TODO: check these values - f.setParameter(ENABLE_PUSH, 1); - f.setParameter(HEADER_TABLE_SIZE, 4 * K); - f.setParameter(MAX_CONCURRENT_STREAMS, 100); - f.setParameter(INITIAL_WINDOW_SIZE, 64 * K - 1); - f.setParameter(MAX_FRAME_SIZE, 16 * K); + f.setParameter(ENABLE_PUSH, DEFAULT_ENABLE_PUSH); + f.setParameter(HEADER_TABLE_SIZE, DEFAULT_HEADER_TABLE_SIZE); + f.setParameter(MAX_CONCURRENT_STREAMS, DEFAULT_MAX_CONCURRENT_STREAMS); + f.setParameter(INITIAL_WINDOW_SIZE, DEFAULT_INITIAL_WINDOW_SIZE); + f.setParameter(MAX_FRAME_SIZE, DEFAULT_MAX_FRAME_SIZE); return f; } } diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Http1AsyncReceiver.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Http1AsyncReceiver.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Http1AsyncReceiver.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Http1AsyncReceiver.java 2018-07-25 15:36:46.000000000 +0000 @@ -386,8 +386,11 @@ // we have a flow List<ByteBuffer> upstream. Http1AsyncDelegateSubscription subscription = new Http1AsyncDelegateSubscription(scheduler, cancel, onSubscriptionError); - pending.onSubscribe(subscription); - this.delegate = delegate = pending; + try { + pending.onSubscribe(subscription); + } finally { + this.delegate = delegate = pending; + } final Object captured = delegate; if (debug.on()) debug.log("delegate is now " + captured @@ -485,10 +488,11 @@ error = ex; } } - final Throwable t = (recorded == null ? ex : recorded); - if (debug.on()) - debug.log("recorded " + t + "\n\t delegate: " + delegate - + "\t\t queue.isEmpty: " + queue.isEmpty(), ex); + + final Throwable t = (recorded == null ? ex : recorded); + if (debug.on()) + debug.log("recorded " + t + "\n\t delegate: " + delegate + + "\t\t queue.isEmpty: " + queue.isEmpty(), ex); if (Log.errors()) { Log.logError("HTTP/1 read subscriber recorded error: {0} - {1}", describe(), t); } diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Http1Exchange.java 2018-07-25 15:36:46.000000000 +0000 @@ -257,6 +257,14 @@ .thenCompose(unused -> { CompletableFuture<Void> cf = new MinimalFuture<>(); try { + asyncReceiver.whenFinished.whenComplete((r,t) -> { + if (t != null) { + if (debug.on()) + debug.log("asyncReceiver finished (failed=%s)", (Object)t); + if (!headersSentCF.isDone()) + headersSentCF.completeAsync(() -> this, executor); + } + }); connectFlows(connection); if (debug.on()) debug.log("requestAction.headers"); @@ -282,7 +290,8 @@ private void cancelIfFailed(Flow.Subscription s) { asyncReceiver.whenFinished.whenCompleteAsync((r,t) -> { - if (debug.on()) debug.log("asyncReceiver finished (failed=%s)", t); + if (debug.on()) + debug.log("asyncReceiver finished (failed=%s)", (Object)t); if (t != null) { s.cancel(); // Don't complete exceptionally here as 't' diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Http2Connection.java 2018-07-25 15:36:46.000000000 +0000 @@ -297,7 +297,7 @@ this.framesDecoder = new FramesDecoder(this::processFrame, clientSettings.getParameter(SettingsFrame.MAX_FRAME_SIZE)); // serverSettings will be updated by server - this.serverSettings = SettingsFrame.getDefaultSettings(); + this.serverSettings = SettingsFrame.defaultRFCSettings(); this.hpackOut = new Encoder(serverSettings.getParameter(HEADER_TABLE_SIZE)); this.hpackIn = new Decoder(clientSettings.getParameter(HEADER_TABLE_SIZE)); if (debugHpack.on()) { @@ -430,12 +430,12 @@ assert numReservedClientStreams >= 0; assert numReservedServerStreams >= 0; - if (clientInitiated && numReservedClientStreams >= getMaxConcurrentClientStreams()) { + if (clientInitiated &&numReservedClientStreams >= maxConcurrentClientInitiatedStreams()) { throw new IOException("too many concurrent streams"); } else if (clientInitiated) { numReservedClientStreams++; } - if (!clientInitiated && numReservedServerStreams >= getMaxConcurrentServerStreams()) { + if (!clientInitiated && numReservedServerStreams >= maxConcurrentServerInitiatedStreams()) { return false; } else if (!clientInitiated) { numReservedServerStreams++; @@ -580,11 +580,11 @@ return serverSettings.getParameter(INITIAL_WINDOW_SIZE); } - final int getMaxConcurrentClientStreams() { + final int maxConcurrentClientInitiatedStreams() { return serverSettings.getParameter(MAX_CONCURRENT_STREAMS); } - final int getMaxConcurrentServerStreams() { + final int maxConcurrentServerInitiatedStreams() { return clientSettings.getParameter(MAX_CONCURRENT_STREAMS); } @@ -673,7 +673,11 @@ client2.deleteConnection(this); List<Stream<?>> c = new LinkedList<>(streams.values()); for (Stream<?> s : c) { - s.connectionClosing(t); + try { + s.connectionClosing(t); + } catch (Throwable e) { + Log.logError("Failed to close stream {0}: {1}", s.streamid, e); + } } connection.close(); } @@ -738,6 +742,9 @@ } if (!(frame instanceof ResetFrame)) { + if (frame instanceof DataFrame) { + dropDataFrame((DataFrame)frame); + } if (isServerInitiatedStream(streamid)) { if (streamid < nextPushStream) { // trailing data on a cancelled push promise stream, @@ -776,6 +783,27 @@ } } + final void dropDataFrame(DataFrame df) { + if (closed) return; + if (debug.on()) { + debug.log("Dropping data frame for stream %d (%d payload bytes)", + df.streamid(), df.payloadLength()); + } + ensureWindowUpdated(df); + } + + final void ensureWindowUpdated(DataFrame df) { + try { + if (closed) return; + int length = df.payloadLength(); + if (length > 0) { + windowUpdater.update(length); + } + } catch(Throwable t) { + Log.logError("Unexpected exception while updating window: {0}", (Object)t); + } + } + private <T> void handlePushPromise(Stream<T> parent, PushPromiseFrame pp) throws IOException { @@ -984,7 +1012,6 @@ connection.channel().getLocalAddress(), connection.address()); SettingsFrame sf = new SettingsFrame(clientSettings); - int initialWindowSize = sf.getParameter(INITIAL_WINDOW_SIZE); ByteBuffer buf = framesEncoder.encodeConnectionPreface(PREFACE_BYTES, sf); Log.logFrames(sf, "OUT"); // send preface bytes and SettingsFrame together @@ -997,9 +1024,20 @@ Log.logTrace("Settings Frame sent"); // send a Window update for the receive buffer we are using - // minus the initial 64 K specified in protocol - final int len = windowUpdater.initialWindowSize - initialWindowSize; - if (len > 0) { + // minus the initial 64 K -1 specified in protocol: + // RFC 7540, Section 6.9.2: + // "[...] the connection flow-control window is set to the default + // initial window size until a WINDOW_UPDATE frame is received." + // + // Note that the default initial window size, not to be confused + // with the initial window size, is defined by RFC 7540 as + // 64K -1. + final int len = windowUpdater.initialWindowSize - DEFAULT_INITIAL_WINDOW_SIZE; + if (len != 0) { + if (Log.channel()) { + Log.logChannel("Sending initial connection window update frame: {0} ({1} - {2})", + len, windowUpdater.initialWindowSize, DEFAULT_INITIAL_WINDOW_SIZE); + } windowUpdater.sendWindowUpdate(len); } // there will be an ACK to the windows update - which should @@ -1132,6 +1170,7 @@ private Stream<?> registerNewStream(OutgoingHeaders<Stream<?>> oh) { Stream<?> stream = oh.getAttachment(); + assert stream.streamid == 0; int streamid = nextstreamid; nextstreamid += 2; stream.registerStream(streamid); diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/HttpClientImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -329,7 +329,18 @@ private static SSLParameters getDefaultParams(SSLContext ctx) { SSLParameters params = ctx.getSupportedSSLParameters(); - params.setProtocols(new String[]{"TLSv1.2"}); + String[] protocols = params.getProtocols(); + boolean found13 = false; + for (String proto : protocols) { + if (proto.equals("TLSv1.3")) { + found13 = true; + break; + } + } + if (found13) + params.setProtocols(new String[] {"TLSv1.3", "TLSv1.2"}); + else + params.setProtocols(new String[] {"TLSv1.2"}); return params; } diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/SocketTube.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/SocketTube.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/SocketTube.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/SocketTube.java 2018-07-25 15:36:46.000000000 +0000 @@ -360,7 +360,6 @@ } } catch (Throwable t) { signalError(t); - subscription.cancel(); } } @@ -424,6 +423,8 @@ } completed = true; readPublisher.signalError(error); + Flow.Subscription subscription = this.subscription; + if (subscription != null) subscription.cancel(); } // A repeatable WriteEvent which is paused after firing and can @@ -468,7 +469,11 @@ @Override public void cancel() { + if (cancelled) return; if (debug.on()) debug.log("write: cancel"); + if (Log.channel()) { + Log.logChannel("Cancelling write subscription"); + } dropSubscription(); upstreamSubscription.cancel(); } @@ -503,9 +508,7 @@ } catch (Throwable t) { if (debug.on()) debug.log("write: error while requesting more: " + t); - cancelled = true; signalError(t); - subscription.cancel(); } finally { debugState("leaving requestMore: "); } diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/Stream.java 2018-07-25 15:36:46.000000000 +0000 @@ -185,6 +185,7 @@ int size = Utils.remaining(dsts, Integer.MAX_VALUE); if (size == 0 && finished) { inputQ.remove(); + connection.ensureWindowUpdated(df); // must update connection window Log.logTrace("responseSubscriber.onComplete"); if (debug.on()) debug.log("incoming: onComplete"); sched.stop(); @@ -197,7 +198,12 @@ inputQ.remove(); Log.logTrace("responseSubscriber.onNext {0}", size); if (debug.on()) debug.log("incoming: onNext(%d)", size); - subscriber.onNext(dsts); + try { + subscriber.onNext(dsts); + } catch (Throwable t) { + connection.dropDataFrame(df); // must update connection window + throw t; + } if (consumed(df)) { Log.logTrace("responseSubscriber.onComplete"); if (debug.on()) debug.log("incoming: onComplete"); @@ -215,6 +221,8 @@ } } catch (Throwable throwable) { errorRef.compareAndSet(null, throwable); + } finally { + if (sched.isStopped()) drainInputQueue(); } Throwable t = errorRef.get(); @@ -223,20 +231,35 @@ try { if (!onCompleteCalled) { if (debug.on()) - debug.log("calling subscriber.onError: %s", (Object)t); + debug.log("calling subscriber.onError: %s", (Object) t); subscriber.onError(t); } else { if (debug.on()) - debug.log("already completed: dropping error %s", (Object)t); + debug.log("already completed: dropping error %s", (Object) t); } } catch (Throwable x) { - Log.logError("Subscriber::onError threw exception: {0}", (Object)t); + Log.logError("Subscriber::onError threw exception: {0}", (Object) t); } finally { cancelImpl(t); + drainInputQueue(); } } } + // must only be called from the scheduler schedule() loop. + // ensure that all received data frames are accounted for + // in the connection window flow control if the scheduler + // is stopped before all the data is consumed. + private void drainInputQueue() { + Http2Frame frame; + while ((frame = inputQ.poll()) != null) { + if (frame instanceof DataFrame) { + connection.dropDataFrame((DataFrame)frame); + } + } + } + + // Callback invoked after the Response BodySubscriber has consumed the // buffers contained in a DataFrame. // Returns true if END_STREAM is reached, false otherwise. @@ -245,15 +268,19 @@ // The entire DATA frame payload is included in flow control, // including the Pad Length and Padding fields if present int len = df.payloadLength(); + boolean endStream = df.getFlag(DataFrame.END_STREAM); + if (len == 0) return endStream; + connection.windowUpdater.update(len); - if (!df.getFlag(DataFrame.END_STREAM)) { + if (!endStream) { // Don't send window update on a stream which is // closed or half closed. windowUpdater.update(len); - return false; // more data coming } - return true; // end of stream + + // true: end of stream; false: more data coming + return endStream; } boolean deRegister() { @@ -500,8 +527,8 @@ { int amount = frame.getUpdate(); if (amount <= 0) { - Log.logTrace("Resetting stream: {0} %d, Window Update amount: %d\n", - streamid, streamid, amount); + Log.logTrace("Resetting stream: {0}, Window Update amount: {1}", + streamid, amount); connection.resetStream(streamid, ResetFrame.FLOW_CONTROL_ERROR); } else { assert streamid != 0; @@ -1126,7 +1153,7 @@ connection.resetStream(streamid, ResetFrame.CANCEL); } } - } catch (IOException ex) { + } catch (Throwable ex) { Log.logError(ex); } } @@ -1289,6 +1316,18 @@ int getStreamId() { return streamid; } + + @Override + String dbgString() { + String dbg = dbgString; + if (dbg != null) return dbg; + if (streamid == 0) { + return connection.dbgString() + ":WindowUpdateSender(stream: ?)"; + } else { + dbg = connection.dbgString() + ":WindowUpdateSender(stream: " + streamid + ")"; + return dbgString = dbg; + } + } } /** diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/WindowController.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/WindowController.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/WindowController.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/WindowController.java 2018-07-25 15:36:46.000000000 +0000 @@ -246,8 +246,9 @@ debug.log("WARNING: No entry found for streamid: %s. May be cancelled?", streamid); } else { - size += amount; - if (size < 0) + int prev = size; + size = prev + amount; + if (size < prev) return false; streams.put(streamid, size); if (debug.on()) @@ -314,17 +315,17 @@ } } -// /** Returns the Send Window size for the given stream. */ -// int streamWindowSize(int streamid) { -// controllerLock.lock(); -// try { -// Integer size = streams.get(streamid); -// if (size == null) -// throw new InternalError("Expected entry for streamid: " + streamid); -// return size; -// } finally { -// controllerLock.unlock(); -// } -// } + /** Returns the Send Window size for the given stream. */ + int streamWindowSize(int streamid) { + controllerLock.lock(); + try { + Integer size = streams.get(streamid); + if (size == null) + throw new InternalError("Expected entry for streamid: " + streamid); + return size; + } finally { + controllerLock.unlock(); + } + } } diff -Nru openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/WindowUpdateSender.java openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/WindowUpdateSender.java --- openjdk-11-11~19/src/java.net.http/share/classes/jdk/internal/net/http/WindowUpdateSender.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.net.http/share/classes/jdk/internal/net/http/WindowUpdateSender.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ package jdk.internal.net.http; +import jdk.internal.net.http.common.FlowTube; import jdk.internal.net.http.common.Logger; import jdk.internal.net.http.frame.SettingsFrame; import jdk.internal.net.http.frame.WindowUpdateFrame; @@ -66,8 +67,9 @@ abstract int getStreamId(); void update(int delta) { - if (debug.on()) debug.log("update: %d", delta); - if (received.addAndGet(delta) > limit) { + int rcv = received.addAndGet(delta); + if (debug.on()) debug.log("update: %d, received: %d, limit: %d", delta, rcv, limit); + if (rcv > limit) { synchronized (this) { int tosend = received.get(); if( tosend > limit) { @@ -83,8 +85,18 @@ connection.sendUnorderedFrame(new WindowUpdateFrame(getStreamId(), delta)); } + volatile String dbgString; String dbgString() { - return "WindowUpdateSender(stream: " + getStreamId() + ")"; + String dbg = dbgString; + if (dbg != null) return dbg; + FlowTube tube = connection.connection.getConnectionFlow(); + if (tube == null) { + return "WindowUpdateSender(stream: " + getStreamId() + ")"; + } else { + int streamId = getStreamId(); + dbg = connection.dbgString() + ":WindowUpdateSender(stream: " + streamId + ")"; + return streamId == 0 ? dbg : (dbgString = dbg); + } } } diff -Nru openjdk-11-11~19/src/java.rmi/share/classes/java/rmi/server/UnicastRemoteObject.java openjdk-11-11~24/src/java.rmi/share/classes/java/rmi/server/UnicastRemoteObject.java --- openjdk-11-11~19/src/java.rmi/share/classes/java/rmi/server/UnicastRemoteObject.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.rmi/share/classes/java/rmi/server/UnicastRemoteObject.java 2018-07-25 15:36:46.000000000 +0000 @@ -126,7 +126,7 @@ * <ul> * * <li>The proxy's class is defined according to the specifications for the - * <a href="{@docRoot}/java/lang/reflect/Proxy.html#membership"> + * <a href="{@docRoot}/java.base/java/lang/reflect/Proxy.html#membership"> * {@code Proxy} * </a> * class, using the class loader of the remote object's class. diff -Nru openjdk-11-11~19/src/java.security.jgss/share/classes/module-info.java openjdk-11-11~24/src/java.security.jgss/share/classes/module-info.java --- openjdk-11-11~19/src/java.security.jgss/share/classes/module-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.security.jgss/share/classes/module-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -55,7 +55,5 @@ provides java.security.Provider with sun.security.jgss.SunProvider; - provides sun.security.ssl.ClientKeyExchangeService with - sun.security.krb5.internal.ssl.Krb5KeyExchangeService; } diff -Nru openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/jgss/GSSCaller.java openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/jgss/GSSCaller.java --- openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/jgss/GSSCaller.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/jgss/GSSCaller.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,8 +34,6 @@ public static final GSSCaller CALLER_UNKNOWN = new GSSCaller("UNKNOWN"); public static final GSSCaller CALLER_INITIATE = new GSSCaller("INITIATE"); public static final GSSCaller CALLER_ACCEPT = new GSSCaller("ACCEPT"); - public static final GSSCaller CALLER_SSL_CLIENT = new GSSCaller("SSL_CLIENT"); - public static final GSSCaller CALLER_SSL_SERVER = new GSSCaller("SSL_SERVER"); private String name; GSSCaller(String s) { diff -Nru openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java --- openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/jgss/krb5/Krb5InitCredential.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -234,14 +234,12 @@ * @exception GSSException may be thrown */ public int getInitLifetime() throws GSSException { - int retVal = 0; Date d = getEndTime(); if (d == null) { return 0; } - retVal = (int)(d.getTime() - (new Date().getTime())); - - return retVal/1000; + long retVal = d.getTime() - System.currentTimeMillis(); + return (int)(retVal/1000); } /** diff -Nru openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/jgss/LoginConfigImpl.java openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/jgss/LoginConfigImpl.java --- openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/jgss/LoginConfigImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/jgss/LoginConfigImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,16 +109,6 @@ "com.sun.security.jgss.krb5.accept", "com.sun.security.jgss.accept", }; - } else if (caller == GSSCaller.CALLER_SSL_CLIENT) { - alts = new String[] { - "com.sun.security.jgss.krb5.initiate", - "com.sun.net.ssl.client", - }; - } else if (caller == GSSCaller.CALLER_SSL_SERVER) { - alts = new String[] { - "com.sun.security.jgss.krb5.accept", - "com.sun.net.ssl.server", - }; } else if (caller instanceof HttpCaller) { alts = new String[] { "com.sun.security.jgss.krb5.initiate", @@ -132,14 +122,12 @@ /* switch (caller) { case GSSUtil.CALLER_INITIATE: - case GSSUtil.CALLER_SSL_CLIENT: case GSSUtil.CALLER_HTTP_NEGOTIATE: alts = new String[] { "com.sun.security.jgss." + mechName + ".initiate", }; break; case GSSUtil.CALLER_ACCEPT: - case GSSUtil.CALLER_SSL_SERVER: alts = new String[] { "com.sun.security.jgss." + mechName + ".accept", }; @@ -207,7 +195,6 @@ } private static boolean isServerSide (GSSCaller caller) { - return GSSCaller.CALLER_ACCEPT == caller || - GSSCaller.CALLER_SSL_SERVER == caller; + return GSSCaller.CALLER_ACCEPT == caller; } } diff -Nru openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/krb5/EncryptedData.java openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/krb5/EncryptedData.java --- openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/krb5/EncryptedData.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/krb5/EncryptedData.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -103,7 +103,7 @@ return new_encryptedData; } - // Used in JSSE (com.sun.net.ssl.internal.KerberosPreMasterSecret) + // Used by test public EncryptedData( int new_eType, Integer new_kvno, @@ -126,8 +126,7 @@ } */ - // used in KrbApRep, KrbApReq, KrbAsReq, KrbCred, KrbPriv - // Used in JSSE (com.sun.net.ssl.internal.KerberosPreMasterSecret) + // used in KrbApRep, KrbApReq, KrbAsReq, KrbCred, KrbPriv public EncryptedData( EncryptionKey key, byte[] plaintext, diff -Nru openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/KerberosPreMasterSecret.java openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/KerberosPreMasterSecret.java --- openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/KerberosPreMasterSecret.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/KerberosPreMasterSecret.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,269 +0,0 @@ -/* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.krb5.internal.ssl; - -import java.io.*; -import java.security.*; -import java.util.Arrays; - -import javax.net.ssl.*; - -import sun.security.krb5.EncryptionKey; -import sun.security.krb5.EncryptedData; -import sun.security.krb5.KrbException; -import sun.security.krb5.internal.crypto.KeyUsage; - -import sun.security.ssl.Debug; -import sun.security.ssl.HandshakeInStream; -import sun.security.ssl.HandshakeMessage; -import sun.security.ssl.ProtocolVersion; - -/** - * This is the Kerberos premaster secret in the Kerberos client key - * exchange message (CLIENT --> SERVER); it holds the - * Kerberos-encrypted pre-master secret. The secret is encrypted using the - * Kerberos session key. The padding and size of the resulting message - * depends on the session key type, but the pre-master secret is - * always exactly 48 bytes. - * - */ -final class KerberosPreMasterSecret { - - private ProtocolVersion protocolVersion; // preMaster [0,1] - private byte[] preMaster; // 48 bytes - private byte[] encrypted; - - /** - * Constructor used by client to generate premaster secret. - * - * Client randomly creates a pre-master secret and encrypts it - * using the Kerberos session key; only the server can decrypt - * it, using the session key available in the service ticket. - * - * @param protocolVersion used to set preMaster[0,1] - * @param generator random number generator for generating premaster secret - * @param sessionKey Kerberos session key for encrypting premaster secret - */ - KerberosPreMasterSecret(ProtocolVersion protocolVersion, - SecureRandom generator, EncryptionKey sessionKey) throws IOException { - - if (sessionKey.getEType() == - EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD) { - throw new IOException( - "session keys with des3-cbc-hmac-sha1-kd encryption type " + - "are not supported for TLS Kerberos cipher suites"); - } - - this.protocolVersion = protocolVersion; - preMaster = generatePreMaster(generator, protocolVersion); - - // Encrypt premaster secret - try { - EncryptedData eData = new EncryptedData(sessionKey, preMaster, - KeyUsage.KU_UNKNOWN); - encrypted = eData.getBytes(); // not ASN.1 encoded. - - } catch (KrbException e) { - throw (SSLKeyException)new SSLKeyException - ("Kerberos premaster secret error").initCause(e); - } - } - - /* - * Constructor used by server to decrypt encrypted premaster secret. - * The protocol version in preMaster[0,1] must match either currentVersion - * or clientVersion, otherwise, the premaster secret is set to - * a random one to foil possible attack. - * - * @param currentVersion version of protocol being used - * @param clientVersion version requested by client - * @param generator random number generator used to generate - * bogus premaster secret if premaster secret verification fails - * @param input input stream from which to read the encrypted - * premaster secret - * @param sessionKey Kerberos session key to be used for decryption - */ - KerberosPreMasterSecret(ProtocolVersion currentVersion, - ProtocolVersion clientVersion, - SecureRandom generator, byte[] encrypted, - EncryptionKey sessionKey) throws IOException { - - if (HandshakeMessage.debug != null && Debug.isOn("handshake")) { - if (encrypted != null) { - Debug.println(System.out, - "encrypted premaster secret", encrypted); - } - } - - if (sessionKey.getEType() == - EncryptedData.ETYPE_DES3_CBC_HMAC_SHA1_KD) { - throw new IOException( - "session keys with des3-cbc-hmac-sha1-kd encryption type " + - "are not supported for TLS Kerberos cipher suites"); - } - - // Decrypt premaster secret - try { - EncryptedData data = new EncryptedData(sessionKey.getEType(), - null /* optional kvno */, encrypted); - - byte[] temp = data.decrypt(sessionKey, KeyUsage.KU_UNKNOWN); - if (HandshakeMessage.debug != null && Debug.isOn("handshake")) { - if (encrypted != null) { - Debug.println(System.out, - "decrypted premaster secret", temp); - } - } - - // Remove padding bytes after decryption. Only DES and DES3 have - // paddings and we don't support DES3 in TLS (see above) - - if (temp.length == 52 && - data.getEType() == EncryptedData.ETYPE_DES_CBC_CRC) { - // For des-cbc-crc, 4 paddings. Value can be 0x04 or 0x00. - if (paddingByteIs(temp, 52, (byte)4) || - paddingByteIs(temp, 52, (byte)0)) { - temp = Arrays.copyOf(temp, 48); - } - } else if (temp.length == 56 && - data.getEType() == EncryptedData.ETYPE_DES_CBC_MD5) { - // For des-cbc-md5, 8 paddings with 0x08, or no padding - if (paddingByteIs(temp, 56, (byte)8)) { - temp = Arrays.copyOf(temp, 48); - } - } - - preMaster = temp; - - protocolVersion = ProtocolVersion.valueOf(preMaster[0], - preMaster[1]); - if (HandshakeMessage.debug != null && Debug.isOn("handshake")) { - System.out.println("Kerberos PreMasterSecret version: " - + protocolVersion); - } - } catch (Exception e) { - // catch exception & process below - preMaster = null; - protocolVersion = currentVersion; - } - - // check if the premaster secret version is ok - // the specification says that it must be the maximum version supported - // by the client from its ClientHello message. However, many - // old implementations send the negotiated version, so accept both - // for SSL v3.0 and TLS v1.0. - // NOTE that we may be comparing two unsupported version numbers in - // the second case, which is why we cannot use object references - // equality in this special case - boolean versionMismatch = (protocolVersion.v != clientVersion.v); - - /* - * we never checked the client_version in server side - * for TLS v1.0 and SSL v3.0. For compatibility, we - * maintain this behavior. - */ - if (versionMismatch && (clientVersion.v <= 0x0301)) { - versionMismatch = (protocolVersion.v != currentVersion.v); - } - - /* - * Bogus decrypted ClientKeyExchange? If so, conjure a - * a random preMaster secret that will fail later during - * Finished message processing. This is a countermeasure against - * the "interactive RSA PKCS#1 encryption envelop attack" reported - * in June 1998. Preserving the executation path will - * mitigate timing attacks and force consistent error handling - * that will prevent an attacking client from differentiating - * different kinds of decrypted ClientKeyExchange bogosities. - */ - if ((preMaster == null) || (preMaster.length != 48) - || versionMismatch) { - if (HandshakeMessage.debug != null && Debug.isOn("handshake")) { - System.out.println("Kerberos PreMasterSecret error, " - + "generating random secret"); - if (preMaster != null) { - Debug.println(System.out, "Invalid secret", preMaster); - } - } - - /* - * Randomize the preMaster secret with the - * ClientHello.client_version, as will produce invalid master - * secret to prevent the attacks. - */ - preMaster = generatePreMaster(generator, clientVersion); - protocolVersion = clientVersion; - } - } - - /** - * Checks if all paddings of data are b - * @param data the block with padding - * @param len length of data, >= 48 - * @param b expected padding byte - */ - private static boolean paddingByteIs(byte[] data, int len, byte b) { - for (int i=48; i<len; i++) { - if (data[i] != b) return false; - } - return true; - } - - /* - * Used by server to generate premaster secret in case of - * problem decoding ticket. - * - * @param protocolVersion used for preMaster[0,1] - * @param generator random number generator to use for generating secret. - */ - KerberosPreMasterSecret(ProtocolVersion protocolVersion, - SecureRandom generator) { - - this.protocolVersion = protocolVersion; - preMaster = generatePreMaster(generator, protocolVersion); - } - - private static byte[] generatePreMaster(SecureRandom rand, - ProtocolVersion ver) { - - byte[] pm = new byte[48]; - rand.nextBytes(pm); - pm[0] = ver.major; - pm[1] = ver.minor; - - return pm; - } - - // Clone not needed; internal use only - byte[] getUnencrypted() { - return preMaster; - } - - // Clone not needed; internal use only - byte[] getEncrypted() { - return encrypted; - } -} diff -Nru openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/Krb5KeyExchangeService.java openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/Krb5KeyExchangeService.java --- openjdk-11-11~19/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/Krb5KeyExchangeService.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.security.jgss/share/classes/sun/security/krb5/internal/ssl/Krb5KeyExchangeService.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,563 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. Oracle designates this - * particular file as subject to the "Classpath" exception as provided - * by Oracle in the LICENSE file that accompanied this code. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.krb5.internal.ssl; - -import sun.security.ssl.ClientKeyExchange; -import sun.security.ssl.Debug; -import sun.security.ssl.ClientKeyExchangeService; -import sun.security.ssl.HandshakeOutStream; - -import sun.security.jgss.GSSCaller; -import sun.security.jgss.krb5.Krb5Util; -import sun.security.jgss.krb5.ServiceCreds; -import sun.security.krb5.EncryptedData; -import sun.security.krb5.EncryptionKey; -import sun.security.krb5.KrbException; -import sun.security.krb5.PrincipalName; -import sun.security.krb5.internal.EncTicketPart; -import sun.security.krb5.internal.Ticket; -import sun.security.krb5.internal.crypto.KeyUsage; -import sun.security.ssl.ProtocolVersion; - -import javax.crypto.SecretKey; -import javax.crypto.spec.SecretKeySpec; -import javax.security.auth.Subject; -import javax.security.auth.kerberos.KerberosKey; -import javax.security.auth.kerberos.KerberosPrincipal; -import javax.security.auth.kerberos.KerberosTicket; -import javax.security.auth.kerberos.KeyTab; -import javax.security.auth.kerberos.ServicePermission; -import java.io.IOException; -import java.io.PrintStream; -import java.net.InetAddress; -import java.security.AccessControlContext; -import java.security.AccessController; -import java.security.Principal; -import java.security.PrivilegedAction; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.security.SecureRandom; -import java.util.Set; - -/** - * The provider for TLS_KRB_ cipher suites. - * - * @since 9 - */ -public class Krb5KeyExchangeService implements ClientKeyExchangeService { - - public static final Debug debug = Debug.getInstance("ssl"); - - @Override - public String[] supported() { - return new String[] { "KRB5", "KRB5_EXPORT" }; - } - - @Override - public Object getServiceCreds(AccessControlContext acc) { - try { - ServiceCreds serviceCreds = AccessController.doPrivileged( - (PrivilegedExceptionAction<ServiceCreds>) - () -> Krb5Util.getServiceCreds( - GSSCaller.CALLER_SSL_SERVER, null, acc)); - if (serviceCreds == null) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Kerberos serviceCreds not available"); - } - return null; - } - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Using Kerberos creds"); - } - String serverPrincipal = serviceCreds.getName(); - if (serverPrincipal != null) { - // When service is bound, we check ASAP. Otherwise, - // will check after client request is received - // in in Kerberos ClientKeyExchange - SecurityManager sm = System.getSecurityManager(); - try { - if (sm != null) { - // Eliminate dependency on ServicePermission - sm.checkPermission(new ServicePermission( - serverPrincipal, "accept"), acc); - } - } catch (SecurityException se) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Permission to access Kerberos" - + " secret key denied"); - } - return null; - } - } - return serviceCreds; - } catch (PrivilegedActionException e) { - // Likely exception here is LoginException - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Attempt to obtain Kerberos key failed: " - + e.toString()); - } - return null; - } - } - - @Override - public String getServiceHostName(Principal principal) { - if (principal == null) { - return null; - } - String hostName = null; - try { - PrincipalName princName = - new PrincipalName(principal.getName(), - PrincipalName.KRB_NT_SRV_HST); - String[] nameParts = princName.getNameStrings(); - if (nameParts.length >= 2) { - hostName = nameParts[1]; - } - } catch (Exception e) { - // ignore - } - return hostName; - } - - - @Override - public boolean isRelated(boolean isClient, - AccessControlContext acc, Principal p) { - - if (p == null) return false; - try { - Subject subject = AccessController.doPrivileged( - (PrivilegedExceptionAction<Subject>) - () -> Krb5Util.getSubject( - isClient ? GSSCaller.CALLER_SSL_CLIENT - : GSSCaller.CALLER_SSL_SERVER, - acc)); - if (subject == null) { - if (debug != null && Debug.isOn("session")) { - System.out.println("Kerberos credentials are" + - " not present in the current Subject;" + - " check if " + - " javax.security.auth.useSubjectAsCreds" + - " system property has been set to false"); - } - return false; - } - Set<Principal> principals = - subject.getPrincipals(Principal.class); - if (principals.contains(p)) { - // bound to this principal - return true; - } else { - if (isClient) { - return false; - } else { - for (KeyTab pc : subject.getPrivateCredentials(KeyTab.class)) { - if (!pc.isBound()) { - return true; - } - } - return false; - } - } - } catch (PrivilegedActionException pae) { - if (debug != null && Debug.isOn("session")) { - System.out.println("Attempt to obtain" + - " subject failed! " + pae); - } - return false; - } - - } - - public ClientKeyExchange createClientExchange( - String serverName, AccessControlContext acc, - ProtocolVersion protocolVerson, SecureRandom rand) throws IOException { - return new ExchangerImpl(serverName, acc, protocolVerson, rand); - } - - public ClientKeyExchange createServerExchange( - ProtocolVersion protocolVersion, ProtocolVersion clientVersion, - SecureRandom rand, byte[] encodedTicket, byte[] encrypted, - AccessControlContext acc, Object serviceCreds) throws IOException { - return new ExchangerImpl(protocolVersion, clientVersion, rand, - encodedTicket, encrypted, acc, serviceCreds); - } - - static class ExchangerImpl extends ClientKeyExchange { - - final private KerberosPreMasterSecret preMaster; - final private byte[] encodedTicket; - final private KerberosPrincipal peerPrincipal; - final private KerberosPrincipal localPrincipal; - - @Override - public int messageLength() { - return encodedTicket.length + preMaster.getEncrypted().length + 6; - } - - @Override - public void send(HandshakeOutStream s) throws IOException { - s.putBytes16(encodedTicket); - s.putBytes16(null); - s.putBytes16(preMaster.getEncrypted()); - } - - @Override - public void print(PrintStream s) throws IOException { - s.println("*** ClientKeyExchange, Kerberos"); - - if (debug != null && Debug.isOn("verbose")) { - Debug.println(s, "Kerberos service ticket", encodedTicket); - Debug.println(s, "Random Secret", preMaster.getUnencrypted()); - Debug.println(s, "Encrypted random Secret", preMaster.getEncrypted()); - } - } - - ExchangerImpl(String serverName, AccessControlContext acc, - ProtocolVersion protocolVersion, SecureRandom rand) throws IOException { - - // Get service ticket - KerberosTicket ticket = getServiceTicket(serverName, acc); - encodedTicket = ticket.getEncoded(); - - // Record the Kerberos principals - peerPrincipal = ticket.getServer(); - localPrincipal = ticket.getClient(); - - // Optional authenticator, encrypted using session key, - // currently ignored - - // Generate premaster secret and encrypt it using session key - EncryptionKey sessionKey = new EncryptionKey( - ticket.getSessionKeyType(), - ticket.getSessionKey().getEncoded()); - - preMaster = new KerberosPreMasterSecret(protocolVersion, - rand, sessionKey); - } - - ExchangerImpl( - ProtocolVersion protocolVersion, ProtocolVersion clientVersion, SecureRandom rand, - byte[] encodedTicket, byte[] encrypted, - AccessControlContext acc, Object serviceCreds) throws IOException { - - // Read ticket - this.encodedTicket = encodedTicket; - - if (debug != null && Debug.isOn("verbose")) { - Debug.println(System.out, - "encoded Kerberos service ticket", encodedTicket); - } - - EncryptionKey sessionKey = null; - KerberosPrincipal tmpPeer = null; - KerberosPrincipal tmpLocal = null; - - try { - Ticket t = new Ticket(encodedTicket); - - EncryptedData encPart = t.encPart; - PrincipalName ticketSname = t.sname; - - final ServiceCreds creds = (ServiceCreds)serviceCreds; - final KerberosPrincipal princ = - new KerberosPrincipal(ticketSname.toString()); - - // For bound service, permission already checked at setup - if (creds.getName() == null) { - SecurityManager sm = System.getSecurityManager(); - try { - if (sm != null) { - // Eliminate dependency on ServicePermission - sm.checkPermission(new ServicePermission( - ticketSname.toString(), "accept"), acc); - } - } catch (SecurityException se) { - serviceCreds = null; - // Do not destroy keys. Will affect Subject - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Permission to access Kerberos" - + " secret key denied"); - se.printStackTrace(System.out); - } - throw new IOException("Kerberos service not allowedy"); - } - } - KerberosKey[] serverKeys = AccessController.doPrivileged( - new PrivilegedAction<KerberosKey[]>() { - @Override - public KerberosKey[] run() { - return creds.getKKeys(princ); - } - }); - if (serverKeys.length == 0) { - throw new IOException("Found no key for " + princ + - (creds.getName() == null ? "" : - (", this keytab is for " + creds.getName() + " only"))); - } - - /* - * permission to access and use the secret key of the Kerberized - * "host" service is done in ServerHandshaker.getKerberosKeys() - * to ensure server has the permission to use the secret key - * before promising the client - */ - - // See if we have the right key to decrypt the ticket to get - // the session key. - int encPartKeyType = encPart.getEType(); - Integer encPartKeyVersion = encPart.getKeyVersionNumber(); - KerberosKey dkey = null; - try { - dkey = findKey(encPartKeyType, encPartKeyVersion, serverKeys); - } catch (KrbException ke) { // a kvno mismatch - throw new IOException( - "Cannot find key matching version number", ke); - } - if (dkey == null) { - // %%% Should print string repr of etype - throw new IOException("Cannot find key of appropriate type" + - " to decrypt ticket - need etype " + encPartKeyType); - } - - EncryptionKey secretKey = new EncryptionKey( - encPartKeyType, - dkey.getEncoded()); - - // Decrypt encPart using server's secret key - byte[] bytes = encPart.decrypt(secretKey, KeyUsage.KU_TICKET); - - // Reset data stream after decryption, remove redundant bytes - byte[] temp = encPart.reset(bytes); - EncTicketPart encTicketPart = new EncTicketPart(temp); - - // Record the Kerberos Principals - tmpPeer = new KerberosPrincipal(encTicketPart.cname.getName()); - tmpLocal = new KerberosPrincipal(ticketSname.getName()); - - sessionKey = encTicketPart.key; - - if (debug != null && Debug.isOn("handshake")) { - System.out.println("server principal: " + ticketSname); - System.out.println("cname: " + encTicketPart.cname.toString()); - } - } catch (IOException e) { - throw e; - } catch (Exception e) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("KerberosWrapper error getting session key," - + " generating random secret (" + e.getMessage() + ")"); - } - sessionKey = null; - } - - //input.getBytes16(); // XXX Read and ignore authenticator - - if (sessionKey != null) { - preMaster = new KerberosPreMasterSecret(protocolVersion, - clientVersion, rand, encrypted, sessionKey); - } else { - // Generate bogus premaster secret - preMaster = new KerberosPreMasterSecret(clientVersion, rand); - } - - peerPrincipal = tmpPeer; - localPrincipal = tmpLocal; - } - - // Similar to sun.security.jgss.krb5.Krb5InitCredenetial/Krb5Context - private static KerberosTicket getServiceTicket(String serverName, - final AccessControlContext acc) throws IOException { - - if ("localhost".equals(serverName) || - "localhost.localdomain".equals(serverName)) { - - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Get the local hostname"); - } - String localHost = java.security.AccessController.doPrivileged( - new java.security.PrivilegedAction<String>() { - public String run() { - try { - return InetAddress.getLocalHost().getHostName(); - } catch (java.net.UnknownHostException e) { - if (debug != null && Debug.isOn("handshake")) { - System.out.println("Warning," - + " cannot get the local hostname: " - + e.getMessage()); - } - return null; - } - } - }); - if (localHost != null) { - serverName = localHost; - } - } - - // Resolve serverName (possibly in IP addr form) to Kerberos principal - // name for service with hostname - String serviceName = "host/" + serverName; - PrincipalName principal; - try { - principal = new PrincipalName(serviceName, - PrincipalName.KRB_NT_SRV_HST); - } catch (SecurityException se) { - throw se; - } catch (Exception e) { - IOException ioe = new IOException("Invalid service principal" + - " name: " + serviceName); - ioe.initCause(e); - throw ioe; - } - String realm = principal.getRealmAsString(); - - final String serverPrincipal = principal.toString(); - final String tgsPrincipal = "krbtgt/" + realm + "@" + realm; - final String clientPrincipal = null; // use default - - - // check permission to obtain a service ticket to initiate a - // context with the "host" service - SecurityManager sm = System.getSecurityManager(); - if (sm != null) { - sm.checkPermission(new ServicePermission(serverPrincipal, - "initiate"), acc); - } - - try { - KerberosTicket ticket = AccessController.doPrivileged( - new PrivilegedExceptionAction<KerberosTicket>() { - public KerberosTicket run() throws Exception { - return Krb5Util.getTicketFromSubjectAndTgs( - GSSCaller.CALLER_SSL_CLIENT, - clientPrincipal, serverPrincipal, - tgsPrincipal, acc); - }}); - - if (ticket == null) { - throw new IOException("Failed to find any kerberos service" + - " ticket for " + serverPrincipal); - } - return ticket; - } catch (PrivilegedActionException e) { - IOException ioe = new IOException( - "Attempt to obtain kerberos service ticket for " + - serverPrincipal + " failed!"); - ioe.initCause(e); - throw ioe; - } - } - - @Override - public SecretKey clientKeyExchange() { - byte[] secretBytes = preMaster.getUnencrypted(); - return new SecretKeySpec(secretBytes, "TlsPremasterSecret"); - } - - @Override - public Principal getPeerPrincipal() { - return peerPrincipal; - } - - @Override - public Principal getLocalPrincipal() { - return localPrincipal; - } - - /** - * Determines if a kvno matches another kvno. Used in the method - * findKey(etype, version, keys). Always returns true if either input - * is null or zero, in case any side does not have kvno info available. - * - * Note: zero is included because N/A is not a legal value for kvno - * in javax.security.auth.kerberos.KerberosKey. Therefore, the info - * that the kvno is N/A might be lost when converting between - * EncryptionKey and KerberosKey. - */ - private static boolean versionMatches(Integer v1, int v2) { - if (v1 == null || v1 == 0 || v2 == 0) { - return true; - } - return v1.equals(v2); - } - - private static KerberosKey findKey(int etype, Integer version, - KerberosKey[] keys) throws KrbException { - int ktype; - boolean etypeFound = false; - - // When no matched kvno is found, returns tke key of the same - // etype with the highest kvno - int kvno_found = 0; - KerberosKey key_found = null; - - for (int i = 0; i < keys.length; i++) { - ktype = keys[i].getKeyType(); - if (etype == ktype) { - int kv = keys[i].getVersionNumber(); - etypeFound = true; - if (versionMatches(version, kv)) { - return keys[i]; - } else if (kv > kvno_found) { - key_found = keys[i]; - kvno_found = kv; - } - } - } - // Key not found. - // %%% kludge to allow DES keys to be used for diff etypes - if ((etype == EncryptedData.ETYPE_DES_CBC_CRC || - etype == EncryptedData.ETYPE_DES_CBC_MD5)) { - for (int i = 0; i < keys.length; i++) { - ktype = keys[i].getKeyType(); - if (ktype == EncryptedData.ETYPE_DES_CBC_CRC || - ktype == EncryptedData.ETYPE_DES_CBC_MD5) { - int kv = keys[i].getVersionNumber(); - etypeFound = true; - if (versionMatches(version, kv)) { - return new KerberosKey(keys[i].getPrincipal(), - keys[i].getEncoded(), - etype, - kv); - } else if (kv > kvno_found) { - key_found = new KerberosKey(keys[i].getPrincipal(), - keys[i].getEncoded(), - etype, - kv); - kvno_found = kv; - } - } - } - } - if (etypeFound) { - return key_found; - } - return null; - } - } -} diff -Nru openjdk-11-11~19/src/java.smartcardio/share/native/libj2pcsc/pcsc.c openjdk-11-11~24/src/java.smartcardio/share/native/libj2pcsc/pcsc.c --- openjdk-11-11~19/src/java.smartcardio/share/native/libj2pcsc/pcsc.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.smartcardio/share/native/libj2pcsc/pcsc.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -192,7 +192,7 @@ } dprintf1("-size: %d\n", size); - if (size) { + if (size != 0) { mszReaders = malloc(size); if (mszReaders == NULL) { throwOutOfMemoryError(env, NULL); @@ -205,6 +205,8 @@ return NULL; } dprintf1("-String: %s\n", mszReaders); + } else { + return NULL; } result = pcsc_multi2jstring(env, mszReaders); diff -Nru openjdk-11-11~19/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages.java openjdk-11-11~24/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages.java --- openjdk-11-11~19/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/java.xml/share/classes/javax/xml/catalog/CatalogMessages.java 2018-07-25 15:36:46.000000000 +0000 @@ -53,7 +53,7 @@ public static final String ERR_CREATING_URI = "FailedCreatingURI"; public static final String ERR_OTHER = "OtherError"; - static final String bundleName = CatalogMessages.class.getPackage().getName() + ".CatalogMessages"; + static final String bundleName = CatalogMessages.class.getPackageName() + ".CatalogMessages"; static ResourceBundle resourceBundle; /** diff -Nru openjdk-11-11~19/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java openjdk-11-11~24/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java --- openjdk-11-11~19/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/collect/ClassSearch.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,6 +27,7 @@ import java.util.ArrayList; import java.util.List; +import java.util.function.BiConsumer; public final class ClassSearch { private final List<SourceProvider> providers = new ArrayList<>(); @@ -36,39 +37,53 @@ } public List<LoadedClass> search(List<SearchFor> search, SearchPath searchPath) { + return search(search, searchPath, (s, t) -> { throw new InternalError(s + " : " + t, t); } ); + } + + public List<LoadedClass> search(List<SearchFor> search, SearchPath searchPath, BiConsumer<String, Throwable> classLoadingErrorsHandler) { List<LoadedClass> loaded = new ArrayList<>(); List<ClassSource> sources = new ArrayList<>(); for (SearchFor entry : search) { - sources.add(findSource(entry, searchPath)); + sources.add(findSource(entry, searchPath, classLoadingErrorsHandler)); } for (ClassSource source : sources) { - source.eachClass((name, loader) -> loaded.add(loadClass(name, loader))); + if (source != null) { + source.eachClass((name, loader) -> { + LoadedClass x = loadClass(name, loader, classLoadingErrorsHandler); + if (x != null) { loaded.add(x); } + }); + } } return loaded; } - private static LoadedClass loadClass(String name, ClassLoader loader) { + private static LoadedClass loadClass(String name, ClassLoader loader, BiConsumer<String, Throwable> classLoadingErrorsHandler) { try { Class<?> clzz = loader.loadClass(name); return new LoadedClass(name, clzz); - } catch (ClassNotFoundException e) { - throw new InternalError("Failed to load with: " + loader, e); + } catch (Throwable e) { + classLoadingErrorsHandler.accept(name, e); + return null; } } - private ClassSource findSource(SearchFor searchFor, SearchPath searchPath) { + private ClassSource findSource(SearchFor searchFor, SearchPath searchPath, BiConsumer<String, Throwable> classLoadingErrorsHandler) { ClassSource found = null; for (SourceProvider provider : providers) { if (!searchFor.isUnknown() && !provider.supports(searchFor.getType())) { continue; } - - ClassSource source = provider.findSource(searchFor.getName(), searchPath); + ClassSource source = null; + try { + source = provider.findSource(searchFor.getName(), searchPath); + } catch (Throwable e) { + classLoadingErrorsHandler.accept(searchFor.getName(), e); + } if (source != null) { if (found != null) { throw new InternalError("Multiple possible sources: " + source + " and: " + found); @@ -78,7 +93,7 @@ } if (found == null) { - throw new InternalError("Failed to find " + searchFor.getType() + " file: " + searchFor.getName()); + classLoadingErrorsHandler.accept(searchFor.getName(), new InternalError("Failed to find " + searchFor.getType() + " file: " + searchFor.getName())); } return found; } diff -Nru openjdk-11-11~19/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java openjdk-11-11~24/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java --- openjdk-11-11~19/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Collector.java 2018-07-25 15:36:46.000000000 +0000 @@ -61,7 +61,7 @@ List<LoadedClass> foundClasses = null; try { - foundClasses = lookup.search(main.options.files, main.options.searchPath); + foundClasses = lookup.search(main.options.files, main.options.searchPath, this::handleLoadingError); } catch (InternalError e) { main.printer.reportError(e); return null; @@ -118,12 +118,7 @@ addMethods(aotClass, ctors, compilationRestrictions); total += ctors.length; } catch (Throwable e) { - // If we are running in JCK mode we ignore all exceptions. - if (main.options.ignoreClassLoadingErrors) { - main.printer.printError(c.getName() + ": " + e); - } else { - throw new InternalError(e); - } + handleLoadingError(c.getName(), e); } // Methods @@ -132,12 +127,7 @@ addMethods(aotClass, methods, compilationRestrictions); total += methods.length; } catch (Throwable e) { - // If we are running in JCK mode we ignore all exceptions. - if (main.options.ignoreClassLoadingErrors) { - main.printer.printError(c.getName() + ": " + e); - } else { - throw new InternalError(e); - } + handleLoadingError(c.getName(), e); } // Class initializer @@ -148,12 +138,7 @@ total++; } } catch (Throwable e) { - // If we are running in JCK mode we ignore all exceptions. - if (main.options.ignoreClassLoadingErrors) { - main.printer.printError(c.getName() + ": " + e); - } else { - throw new InternalError(e); - } + handleLoadingError(c.getName(), e); } // Found any methods to compile? Add the class. @@ -215,4 +200,11 @@ return compilationRestrictions; } + private void handleLoadingError(String name, Throwable t) { + if (main.options.ignoreClassLoadingErrors) { + main.printer.printError(name + ": " + t); + } else { + throw new InternalError(t); + } + } } diff -Nru openjdk-11-11~19/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java openjdk-11-11~24/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java --- openjdk-11-11~19/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.aot/share/classes/jdk.tools.jaotc/src/jdk/tools/jaotc/Main.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -44,7 +44,8 @@ import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.hotspot.HotSpotGraalCompilerFactory; import org.graalvm.compiler.hotspot.HotSpotGraalOptionValues; -import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider; +import org.graalvm.compiler.hotspot.HotSpotGraalRuntime; +import org.graalvm.compiler.hotspot.HotSpotGraalRuntime.HotSpotGC; import org.graalvm.compiler.hotspot.HotSpotHostBackend; import org.graalvm.compiler.hotspot.meta.HotSpotInvokeDynamicPlugin; import org.graalvm.compiler.java.GraphBuilderPhase; @@ -142,7 +143,7 @@ } graalOptions = new OptionValues(graalOptions, GeneratePIC, true, ImmutableCode, true); GraalJVMCICompiler graalCompiler = HotSpotGraalCompilerFactory.createCompiler("JAOTC", JVMCI.getRuntime(), graalOptions, CompilerConfigurationFactory.selectFactory(null, graalOptions)); - HotSpotGraalRuntimeProvider runtime = (HotSpotGraalRuntimeProvider) graalCompiler.getGraalRuntime(); + HotSpotGraalRuntime runtime = (HotSpotGraalRuntime) graalCompiler.getGraalRuntime(); HotSpotHostBackend backend = (HotSpotHostBackend) runtime.getCapability(RuntimeProvider.class).getHostBackend(); MetaAccessProvider metaAccess = backend.getProviders().getMetaAccess(); filters = new GraalFilters(metaAccess); @@ -181,7 +182,8 @@ System.gc(); } - BinaryContainer binaryContainer = new BinaryContainer(graalOptions, graalHotSpotVMConfig, graphBuilderConfig, JVM_VERSION); + int gc = runtime.getGarbageCollector().ordinal()+1; + BinaryContainer binaryContainer = new BinaryContainer(graalOptions, graalHotSpotVMConfig, graphBuilderConfig, gc, JVM_VERSION); DataBuilder dataBuilder = new DataBuilder(this, backend, classes, binaryContainer); try (DebugContext debug = DebugContext.create(graalOptions, new GraalDebugHandlersFactory(snippetReflection)); Activation a = debug.activate()) { diff -Nru openjdk-11-11~19/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java openjdk-11-11~24/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java --- openjdk-11-11~19/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.aot/share/classes/jdk.tools.jaotc.binformat/src/jdk/tools/jaotc/binformat/BinaryContainer.java 2018-07-25 15:36:46.000000000 +0000 @@ -146,6 +146,7 @@ {"SharedRuntime::exception_handler_for_return_address", "_aot_exception_handler_for_return_address"}, {"SharedRuntime::register_finalizer", "_aot_register_finalizer"}, {"SharedRuntime::OSR_migration_end", "_aot_OSR_migration_end"}, + {"SharedRuntime::enable_stack_reserved_zone", "_aot_enable_stack_reserved_zone"}, {"CompilerRuntime::resolve_dynamic_invoke", "_aot_resolve_dynamic_invoke"}, {"CompilerRuntime::resolve_string_by_symbol", "_aot_resolve_string_by_symbol"}, {"CompilerRuntime::resolve_klass_by_symbol", "_aot_resolve_klass_by_symbol"}, @@ -213,6 +214,7 @@ {"StubRoutines::_counterMode_AESCrypt", "_aot_stub_routines_counterMode_AESCrypt" }, {"StubRoutines::_ghash_processBlocks", "_aot_stub_routines_ghash_processBlocks" }, + {"StubRoutines::_base64_encodeBlock", "_aot_stub_routines_base64_encodeBlock" }, {"StubRoutines::_crc32c_table_addr", "_aot_stub_routines_crc32c_table_addr" }, {"StubRoutines::_updateBytesCRC32C", "_aot_stub_routines_updateBytesCRC32C" }, {"StubRoutines::_updateBytesAdler32", "_aot_stub_routines_updateBytesAdler32" }, @@ -270,7 +272,7 @@ * * @param graalOptions */ - public BinaryContainer(OptionValues graalOptions, GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig, String jvmVersion) { + public BinaryContainer(OptionValues graalOptions, GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig, int gc, String jvmVersion) { this.graalOptions = graalOptions; this.codeSegmentSize = graalHotSpotVMConfig.codeSegmentSize; @@ -314,16 +316,15 @@ addGlobalSymbols(); - recordConfiguration(graalHotSpotVMConfig, graphBuilderConfig); + recordConfiguration(graalHotSpotVMConfig, graphBuilderConfig, gc); } - private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig) { + private void recordConfiguration(GraalHotSpotVMConfig graalHotSpotVMConfig, GraphBuilderConfiguration graphBuilderConfig, int gc) { // @formatter:off boolean[] booleanFlags = { graalHotSpotVMConfig.cAssertions, // Debug VM graalHotSpotVMConfig.useCompressedOops, graalHotSpotVMConfig.useCompressedClassPointers, graalHotSpotVMConfig.compactFields, - graalHotSpotVMConfig.useG1GC, graalHotSpotVMConfig.useTLAB, graalHotSpotVMConfig.useBiasedLocking, TieredAOT.getValue(graalOptions), @@ -339,6 +340,7 @@ graalHotSpotVMConfig.fieldsAllocationStyle, 1 << graalHotSpotVMConfig.logMinObjAlignment(), graalHotSpotVMConfig.codeSegmentSize, + gc }; // @formatter:on diff -Nru openjdk-11-11~19/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c openjdk-11-11~24/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c --- openjdk-11-11~19/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.attach/windows/native/libattach/VirtualMachineImpl.c 2018-07-25 15:36:46.000000000 +0000 @@ -490,9 +490,11 @@ JNU_ThrowIOException(env, "Unable to enqueue operation: the target VM does not support attach mechanism"); break; - default : - JNU_ThrowInternalError(env, - "Remote thread failed for unknown reason"); + default : { + char errmsg[128]; + sprintf(errmsg, "Remote thread failed for unknown reason (%d)", exitCode); + JNU_ThrowInternalError(env, errmsg); + } } } } diff -Nru openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java --- openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Lower.java 2018-07-25 15:36:46.000000000 +0000 @@ -94,6 +94,7 @@ private final Name dollarCloseResource; private final Types types; private final boolean debugLower; + private final boolean disableProtectedAccessors; // experimental private final PkgInfo pkginfoOpt; protected Lower(Context context) { @@ -122,6 +123,7 @@ Options options = Options.instance(context); debugLower = options.isSet("debuglower"); pkginfoOpt = PkgInfo.get(options); + disableProtectedAccessors = options.isSet("disableProtectedAccessors"); } /** The currently enclosing class. @@ -1031,6 +1033,9 @@ /** Do we need an access method to reference private symbol? */ boolean needsPrivateAccess(Symbol sym) { + if (target.hasNestmateAccess()) { + return false; + } if ((sym.flags() & PRIVATE) == 0 || sym.owner == currentClass) { return false; } else if (sym.name == names.init && sym.owner.isLocal()) { @@ -1045,6 +1050,7 @@ /** Do we need an access method to reference symbol in other package? */ boolean needsProtectedAccess(Symbol sym, JCTree tree) { + if (disableProtectedAccessors) return false; if ((sym.flags() & PROTECTED) == 0 || sym.owner.owner == currentClass.owner || // fast special case sym.packge() == currentClass.packge()) diff -Nru openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java --- openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Modules.java 2018-07-25 15:36:46.000000000 +0000 @@ -81,6 +81,7 @@ import com.sun.tools.javac.code.Types; import com.sun.tools.javac.jvm.ClassWriter; import com.sun.tools.javac.jvm.JNIWriter; +import com.sun.tools.javac.jvm.Target; import com.sun.tools.javac.main.Option; import com.sun.tools.javac.resources.CompilerProperties.Errors; import com.sun.tools.javac.resources.CompilerProperties.Warnings; @@ -144,6 +145,7 @@ private final JavaFileManager fileManager; private final ModuleFinder moduleFinder; private final Source source; + private final Target target; private final boolean allowModules; private final boolean allowAccessIntoSystem; @@ -191,6 +193,7 @@ types = Types.instance(context); fileManager = context.get(JavaFileManager.class); source = Source.instance(context); + target = Target.instance(context); allowModules = Feature.MODULES.allowedInSource(source); Options options = Options.instance(context); @@ -1234,18 +1237,24 @@ Set<ModuleSymbol> enabledRoot = new LinkedHashSet<>(); if (rootModules.contains(syms.unnamedModule)) { - ModuleSymbol javaSE = syms.getModule(java_se); Predicate<ModuleSymbol> jdkModulePred; - - if (javaSE != null && (observable == null || observable.contains(javaSE))) { + if (target.allApiModulesAreRoots()) { jdkModulePred = sym -> { sym.complete(); - return !sym.name.startsWith(java_) - && sym.exports.stream().anyMatch(e -> e.modules == null); + return sym.exports.stream().anyMatch(e -> e.modules == null); }; - enabledRoot.add(javaSE); } else { - jdkModulePred = sym -> true; + ModuleSymbol javaSE = syms.getModule(java_se); + if (javaSE != null && (observable == null || observable.contains(javaSE))) { + jdkModulePred = sym -> { + sym.complete(); + return !sym.name.startsWith(java_) + && sym.exports.stream().anyMatch(e -> e.modules == null); + }; + enabledRoot.add(javaSE); + } else { + jdkModulePred = sym -> true; + } } Predicate<ModuleSymbol> noIncubatorPred = sym -> { @@ -1543,7 +1552,9 @@ } addExports.forEach((exportsFrom, exports) -> { - addVisiblePackages(msym, seen, exportsFrom, exports); + if (msym.readModules.contains(exportsFrom)) { + addVisiblePackages(msym, seen, exportsFrom, exports); + } }); } diff -Nru openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java --- openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ import java.util.Set; import java.util.HashSet; import java.util.LinkedHashSet; +import java.util.stream.Collectors; import javax.tools.JavaFileManager; import javax.tools.FileObject; @@ -1106,6 +1107,56 @@ endAttr(alenIdx); } + /** + * Write NestMembers attribute (if needed) + */ + int writeNestMembersIfNeeded(ClassSymbol csym) { + ListBuffer<Symbol> nested = new ListBuffer<>(); + listNested(csym, nested); + Set<Symbol> nestedUnique = new LinkedHashSet<>(nested); + if (csym.owner.kind == PCK && !nestedUnique.isEmpty()) { + int alenIdx = writeAttr(names.NestMembers); + databuf.appendChar(nestedUnique.size()); + for (Symbol s : nestedUnique) { + databuf.appendChar(pool.put(s)); + } + endAttr(alenIdx); + return 1; + } + return 0; + } + + /** + * Write NestHost attribute (if needed) + */ + int writeNestHostIfNeeded(ClassSymbol csym) { + if (csym.owner.kind != PCK) { + int alenIdx = writeAttr(names.NestHost); + databuf.appendChar(pool.put(csym.outermostClass())); + endAttr(alenIdx); + return 1; + } + return 0; + } + + private void listNested(Symbol sym, ListBuffer<Symbol> seen) { + if (sym.kind != TYP) return; + ClassSymbol csym = (ClassSymbol)sym; + if (csym.owner.kind != PCK) { + seen.add(csym); + } + if (csym.members() != null) { + for (Symbol s : sym.members().getSymbols()) { + listNested(s, seen); + } + } + if (csym.trans_local != null) { + for (Symbol s : csym.trans_local) { + listNested(s, seen); + } + } + } + /** Write "bootstrapMethods" attribute. */ void writeBootstrapMethods() { @@ -1835,6 +1886,13 @@ } poolbuf.appendChar(target.majorVersion); + if (c.owner.kind != MDL) { + if (target.hasNestmateAccess()) { + acount += writeNestMembersIfNeeded(c); + acount += writeNestHostIfNeeded(c); + } + } + writePool(c.pool); if (innerClasses != null) { diff -Nru openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java --- openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -126,6 +126,7 @@ genCrt = options.isSet(XJCOV); debugCode = options.isSet("debug.code"); allowBetterNullChecks = target.hasObjects(); + disableVirtualizedPrivateInvoke = options.isSet("disableVirtualizedPrivateInvoke"); pool = new Pool(types); // ignore cldc because we cannot have both stackmap formats @@ -140,6 +141,7 @@ private final boolean genCrt; private final boolean debugCode; private final boolean allowBetterNullChecks; + private boolean disableVirtualizedPrivateInvoke; /** Code buffer, set by genMethod. */ @@ -2064,10 +2066,17 @@ } else { items.makeThisItem().load(); sym = binaryQualifier(sym, env.enclClass.type); - result = items.makeMemberItem(sym, (sym.flags() & PRIVATE) != 0); + result = items.makeMemberItem(sym, nonVirtualForPrivateAccess(sym)); } } + //where + private boolean nonVirtualForPrivateAccess(Symbol sym) { + boolean useVirtual = target.hasVirtualPrivateInvoke() && + !disableVirtualizedPrivateInvoke; + return !useVirtual && ((sym.flags() & PRIVATE) != 0); + } + public void visitSelect(JCFieldAccess tree) { Symbol sym = tree.sym; @@ -2124,7 +2133,7 @@ } else { result = items. makeMemberItem(sym, - (sym.flags() & PRIVATE) != 0 || + nonVirtualForPrivateAccess(sym) || selectSuper || accessSuper); } } diff -Nru openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java --- openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Target.java 2018-07-25 15:36:46.000000000 +0000 @@ -160,4 +160,24 @@ public String multiReleaseValue() { return Integer.toString(this.ordinal() - Target.JDK1_1.ordinal() + 1); } + + /** All modules that export an API are roots when compiling code in the unnamed + * module and targeting 11 or newer. + */ + public boolean allApiModulesAreRoots() { + return compareTo(JDK1_11) >= 0; + } + + /** Does the target VM support nestmate access? + */ + public boolean hasNestmateAccess() { + return compareTo(JDK1_11) >= 0; + } + + /** Does the target VM support virtual private invocations? + */ + public boolean hasVirtualPrivateInvoke() { + return compareTo(JDK1_11) >= 0; + } + } diff -Nru openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java --- openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/model/JavacElements.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,11 @@ package com.sun.tools.javac.model; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashSet; import java.util.Map; +import java.util.Optional; import java.util.Set; import java.util.stream.Collectors; @@ -184,7 +186,9 @@ } private final Set<String> alreadyWarnedDuplicates = new HashSet<>(); + private final Map<Pair<String, String>, Optional<Symbol>> resultCache = new HashMap<>(); + @SuppressWarnings("unchecked") private <S extends Symbol> S unboundNameToSymbol(String methodName, String nameStr, Class<S> clazz) { @@ -192,44 +196,46 @@ return nameToSymbol(syms.noModule, nameStr, clazz); } - Set<S> found = new LinkedHashSet<>(); + return (S) resultCache.computeIfAbsent(Pair.of(methodName, nameStr), p -> { + Set<S> found = new LinkedHashSet<>(); - for (ModuleSymbol msym : modules.allModules()) { - S sym = nameToSymbol(msym, nameStr, clazz); + for (ModuleSymbol msym : modules.allModules()) { + S sym = nameToSymbol(msym, nameStr, clazz); - if (sym == null) - continue; + if (sym == null) + continue; - if (clazz == ClassSymbol.class) { - // Always include classes - found.add(sym); - } else if (clazz == PackageSymbol.class) { - // In module mode, ignore the "spurious" empty packages that "enclose" module-specific packages. - // For example, if a module contains classes or package info in package p.q.r, it will also appear - // to have additional packages p.q and p, even though these packages have no content other - // than the subpackage. We don't want those empty packages showing up in searches for p or p.q. - if (!sym.members().isEmpty() || ((PackageSymbol) sym).package_info != null) { + if (clazz == ClassSymbol.class) { + // Always include classes found.add(sym); + } else if (clazz == PackageSymbol.class) { + // In module mode, ignore the "spurious" empty packages that "enclose" module-specific packages. + // For example, if a module contains classes or package info in package p.q.r, it will also appear + // to have additional packages p.q and p, even though these packages have no content other + // than the subpackage. We don't want those empty packages showing up in searches for p or p.q. + if (!sym.members().isEmpty() || ((PackageSymbol) sym).package_info != null) { + found.add(sym); + } } } - } - if (found.size() == 1) { - return found.iterator().next(); - } else if (found.size() > 1) { - //more than one element found, produce a note: - if (alreadyWarnedDuplicates.add(methodName + ":" + nameStr)) { - String moduleNames = found.stream() - .map(s -> s.packge().modle) - .map(m -> m.toString()) - .collect(Collectors.joining(", ")); - log.note(Notes.MultipleElements(methodName, nameStr, moduleNames)); + if (found.size() == 1) { + return Optional.of(found.iterator().next()); + } else if (found.size() > 1) { + //more than one element found, produce a note: + if (alreadyWarnedDuplicates.add(methodName + ":" + nameStr)) { + String moduleNames = found.stream() + .map(s -> s.packge().modle) + .map(m -> m.toString()) + .collect(Collectors.joining(", ")); + log.note(Notes.MultipleElements(methodName, nameStr, moduleNames)); + } + return Optional.empty(); + } else { + //not found: + return Optional.empty(); } - return null; - } else { - //not found, or more than one element found: - return null; - } + }).orElse(null); } /** @@ -787,4 +793,8 @@ throw new IllegalArgumentException(o.toString()); return clazz.cast(o); } + + public void newRound() { + resultCache.clear(); + } } diff -Nru openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java --- openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java 2018-07-25 15:36:46.000000000 +0000 @@ -2784,7 +2784,7 @@ return variableDeclarators(modifiersOpt(), t, stats, true).toList(); } else if ((lastmode & TYPE) != 0 && token.kind == COLON) { log.error(DiagnosticFlag.SYNTAX, pos, Errors.BadInitializer("for-loop")); - return List.of((JCStatement)F.at(pos).VarDef(null, null, t, null)); + return List.of((JCStatement)F.at(pos).VarDef(modifiersOpt(), names.error, t, null)); } else { return moreStatementExpressions(pos, t, stats).toList(); } diff -Nru openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java --- openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java 2018-07-25 15:36:46.000000000 +0000 @@ -1179,7 +1179,9 @@ cs.reset(); cs.classfile = file; cs.completer = initialCompleter; - cs.owner.members().enter(cs); //XXX - OverwriteBetweenCompilations; syms.getClass is not sufficient anymore + if (cs.owner.kind == PCK) { + cs.owner.members().enter(cs); //XXX - OverwriteBetweenCompilations; syms.getClass is not sufficient anymore + } } list = list.prepend(cs); } @@ -1268,6 +1270,7 @@ modules.newRound(); types.newRound(); annotate.newRound(); + elementUtils.newRound(); boolean foundError = false; @@ -1282,7 +1285,9 @@ for (ClassSymbol cs : symtab.getAllClasses()) { if (cs.classfile != null || cs.kind == ERR) { cs.reset(); - cs.type = new ClassType(cs.type.getEnclosingType(), null, cs); + if (cs.kind == ERR) { + cs.type = new ClassType(cs.type.getEnclosingType(), null, cs); + } if (cs.isCompleted()) { cs.completer = initialCompleter; } diff -Nru openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java --- openjdk-11-11~19/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.compiler/share/classes/com/sun/tools/javac/util/Names.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1999, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -152,6 +152,8 @@ public final Name MethodParameters; public final Name Module; public final Name ModuleResolution; + public final Name NestHost; + public final Name NestMembers; public final Name RuntimeInvisibleAnnotations; public final Name RuntimeInvisibleParameterAnnotations; public final Name RuntimeInvisibleTypeAnnotations; @@ -315,6 +317,8 @@ MethodParameters = fromString("MethodParameters"); Module = fromString("Module"); ModuleResolution = fromString("ModuleResolution"); + NestHost = fromString("NestHost"); + NestMembers = fromString("NestMembers"); RuntimeInvisibleAnnotations = fromString("RuntimeInvisibleAnnotations"); RuntimeInvisibleParameterAnnotations = fromString("RuntimeInvisibleParameterAnnotations"); RuntimeInvisibleTypeAnnotations = fromString("RuntimeInvisibleTypeAnnotations"); diff -Nru openjdk-11-11~19/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java openjdk-11-11~24/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java --- openjdk-11-11~19/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/P11Signature.java 2018-07-25 15:36:46.000000000 +0000 @@ -507,6 +507,10 @@ if (len == 0) { return; } + // check for overflow + if (len + bytesProcessed < 0) { + throw new ProviderException("Processed bytes limits exceeded."); + } switch (type) { case T_UPDATE: try { diff -Nru openjdk-11-11~19/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Secmod.java openjdk-11-11~24/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Secmod.java --- openjdk-11-11~19/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Secmod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.cryptoki/share/classes/sun/security/pkcs11/Secmod.java 2018-07-25 15:36:46.000000000 +0000 @@ -197,7 +197,7 @@ if (configDir != null) { String configDirPath = null; - String sqlPrefix = "sql:/"; + String sqlPrefix = "sql:"; if (!configDir.startsWith(sqlPrefix)) { configDirPath = configDir; } else { diff -Nru openjdk-11-11~19/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.c openjdk-11-11~24/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.c --- openjdk-11-11~19/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.cryptoki/share/native/libj2pkcs11/j2secmod.c 2018-07-25 15:36:46.000000000 +0000 @@ -69,9 +69,14 @@ int res = 0; FPTR_Initialize initialize = (FPTR_Initialize)findFunction(env, jHandle, "NSS_Initialize"); + #ifdef SECMOD_DEBUG + FPTR_GetError getError = + (FPTR_GetError)findFunction(env, jHandle, "PORT_GetError"); + #endif // SECMOD_DEBUG unsigned int flags = 0x00; const char *configDir = NULL; const char *functionName = NULL; + const char *configFile = NULL; /* If we cannot initialize, exit now */ if (initialize == NULL) { @@ -97,13 +102,18 @@ flags = 0x20; // NSS_INIT_OPTIMIZESPACE flag } + configFile = "secmod.db"; + if (configDir != NULL && strncmp("sql:", configDir, 4U) == 0) { + configFile = "pkcs11.txt"; + } + /* * If the NSS_Init function is requested then call NSS_Initialize to * open the Cert, Key and Security Module databases, read only. */ if (strcmp("NSS_Init", functionName) == 0) { flags = flags | 0x01; // NSS_INIT_READONLY flag - res = initialize(configDir, "", "", "secmod.db", flags); + res = initialize(configDir, "", "", configFile, flags); /* * If the NSS_InitReadWrite function is requested then call @@ -111,7 +121,7 @@ * read/write. */ } else if (strcmp("NSS_InitReadWrite", functionName) == 0) { - res = initialize(configDir, "", "", "secmod.db", flags); + res = initialize(configDir, "", "", configFile, flags); /* * If the NSS_NoDB_Init function is requested then call @@ -137,6 +147,13 @@ (*env)->ReleaseStringUTFChars(env, jConfigDir, configDir); } dprintf1("-res: %d\n", res); + #ifdef SECMOD_DEBUG + if (res == -1) { + if (getError != NULL) { + dprintf1("-NSS error: %d\n", getError()); + } + } + #endif // SECMOD_DEBUG return (res == 0) ? JNI_TRUE : JNI_FALSE; } diff -Nru openjdk-11-11~19/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/j2secmod_md.h openjdk-11-11~24/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/j2secmod_md.h --- openjdk-11-11~19/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/j2secmod_md.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.cryptoki/unix/native/libj2pkcs11/j2secmod_md.h 2018-07-25 15:36:46.000000000 +0000 @@ -34,6 +34,10 @@ const char *certPrefix, const char *keyPrefix, const char *secmodName, unsigned int flags); +#ifdef SECMOD_DEBUG +typedef int (*FPTR_GetError)(void); +#endif //SECMOD_DEBUG + // in secmod.h //extern SECMODModule *SECMOD_LoadModule(char *moduleSpec,SECMODModule *parent, // PRBool recurse); diff -Nru openjdk-11-11~19/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java openjdk-11-11~24/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java --- openjdk-11-11~19/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.ec/share/classes/sun/security/ec/XDHKeyAgreement.java 2018-07-25 15:36:46.000000000 +0000 @@ -69,13 +69,15 @@ initImpl(key); - // the private key parameters must match params - XECParameters xecParams = XECParameters.get( - InvalidAlgorithmParameterException::new, params); - if (!xecParams.oidEquals(this.ops.getParameters())) { - throw new InvalidKeyException( - "Incorrect private key parameters" - ); + // the private key parameters must match params, if present + if (params != null) { + XECParameters xecParams = XECParameters.get( + InvalidAlgorithmParameterException::new, params); + if (!xecParams.oidEquals(this.ops.getParameters())) { + throw new InvalidKeyException( + "Incorrect private key parameters" + ); + } } } @@ -171,7 +173,9 @@ throw new IllegalStateException("Not initialized correctly"); } - return secret.clone(); + byte[] result = secret; + secret = null; + return result; } @Override @@ -189,7 +193,8 @@ } System.arraycopy(this.secret, 0, sharedSecret, offset, secretLen); - return secret.length; + secret = null; + return secretLen; } @Override diff -Nru openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecdecode.c openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecdecode.c --- openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecdecode.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecdecode.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * This library is free software; you can redistribute it and/or @@ -172,7 +172,8 @@ #endif if ((encodedParams->len != ANSI_X962_CURVE_OID_TOTAL_LEN) && - (encodedParams->len != SECG_CURVE_OID_TOTAL_LEN)) { + (encodedParams->len != SECG_CURVE_OID_TOTAL_LEN) && + (encodedParams->len != BRAINPOOL_CURVE_OID_TOTAL_LEN)) { PORT_SetError(SEC_ERROR_UNSUPPORTED_ELLIPTIC_CURVE); return SECFailure; }; @@ -565,6 +566,30 @@ params, kmflag) ); break; + case ECCurve_BrainpoolP256r1: + /* Populate params for brainpoolP256r1 */ + CHECK_SEC_OK( gf_populate_params(ECCurve_BrainpoolP256r1, ec_field_GFp, + params, kmflag) ); + break; + + case ECCurve_BrainpoolP320r1: + /* Populate params for brainpoolP320r1 */ + CHECK_SEC_OK( gf_populate_params(ECCurve_BrainpoolP320r1, ec_field_GFp, + params, kmflag) ); + break; + + case ECCurve_BrainpoolP384r1: + /* Populate params for brainpoolP384r1 */ + CHECK_SEC_OK( gf_populate_params(ECCurve_BrainpoolP384r1, ec_field_GFp, + params, kmflag) ); + break; + + case ECCurve_BrainpoolP512r1: + /* Populate params for brainpoolP512r1 */ + CHECK_SEC_OK( gf_populate_params(ECCurve_BrainpoolP512r1, ec_field_GFp, + params, kmflag) ); + break; + default: break; }; diff -Nru openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ec.h openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ec.h --- openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ec.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ec.h 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * This library is free software; you can redistribute it and/or @@ -47,5 +47,6 @@ #define ANSI_X962_CURVE_OID_TOTAL_LEN 10 #define SECG_CURVE_OID_TOTAL_LEN 7 +#define BRAINPOOL_CURVE_OID_TOTAL_LEN 11 #endif /* __ec_h_ */ diff -Nru openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecl-curve.h openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecl-curve.h --- openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecl-curve.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecl-curve.h 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * This library is free software; you can redistribute it and/or @@ -623,6 +623,46 @@ "0100000000000000000001CDC98AE0E2DE574ABF33", 1 }; +static const ECCurveParams ecCurve_BrainpoolP256r1 = { + "brainpoolP256r1", ECField_GFp, 256, + "A9FB57DBA1EEA9BC3E660A909D838D726E3BF623D52620282013481D1F6E5377", + "7D5A0975FC2C3057EEF67530417AFFE7FB8055C126DC5C6CE94A4B44F330B5D9", + "26DC5C6CE94A4B44F330B5D9BBD77CBF958416295CF7E1CE6BCCDC18FF8C07B6", + "8BD2AEB9CB7E57CB2C4B482FFC81B7AFB9DE27E1E3BD23C23A4453BD9ACE3262", + "547EF835C3DAC4FD97F8461A14611DC9C27745132DED8E545C1D54C72F046997", + "A9FB57DBA1EEA9BC3E660A909D838D718C397AA3B561A6F7901E0E82974856A7", 1 +}; + +static const ECCurveParams ecCurve_BrainpoolP320r1 = { + "brainpoolP320r1", ECField_GFp, 320, + "D35E472036BC4FB7E13C785ED201E065F98FCFA6F6F40DEF4F92B9EC7893EC28FCD412B1F1B32E27", + "3EE30B568FBAB0F883CCEBD46D3F3BB8A2A73513F5EB79DA66190EB085FFA9F492F375A97D860EB4", + "520883949DFDBC42D3AD198640688A6FE13F41349554B49ACC31DCCD884539816F5EB4AC8FB1F1A6", + "43BD7E9AFB53D8B85289BCC48EE5BFE6F20137D10A087EB6E7871E2A10A599C710AF8D0D39E20611", + "14FDD05545EC1CC8AB4093247F77275E0743FFED117182EAA9C77877AAAC6AC7D35245D1692E8EE1", + "D35E472036BC4FB7E13C785ED201E065F98FCFA5B68F12A32D482EC7EE8658E98691555B44C59311", 1 +}; + +static const ECCurveParams ecCurve_BrainpoolP384r1 = { + "brainpoolP384r1", ECField_GFp, 384, + "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B412B1DA197FB71123ACD3A729901D1A71874700133107EC53", + "7BC382C63D8C150C3C72080ACE05AFA0C2BEA28E4FB22787139165EFBA91F90F8AA5814A503AD4EB04A8C7DD22CE2826", + "04A8C7DD22CE28268B39B55416F0447C2FB77DE107DCD2A62E880EA53EEB62D57CB4390295DBC9943AB78696FA504C11", + "1D1C64F068CF45FFA2A63A81B7C13F6B8847A3E77EF14FE3DB7FCAFE0CBD10E8E826E03436D646AAEF87B2E247D4AF1E", + "8ABE1D7520F9C2A45CB1EB8E95CFD55262B70B29FEEC5864E19C054FF99129280E4646217791811142820341263C5315", + "8CB91E82A3386D280F5D6F7E50E641DF152F7109ED5456B31F166E6CAC0425A7CF3AB6AF6B7FC3103B883202E9046565", 1 +}; + +static const ECCurveParams ecCurve_BrainpoolP512r1 = { + "brainpoolP512r1", ECField_GFp, 512, + "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA703308717D4D9B009BC66842AECDA12AE6A380E62881FF2F2D82C68528AA6056583A48F3", + "7830A3318B603B89E2327145AC234CC594CBDD8D3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CA", + "3DF91610A83441CAEA9863BC2DED5D5AA8253AA10A2EF1C98B9AC8B57F1117A72BF2C7B9E7C1AC4D77FC94CADC083E67984050B75EBAE5DD2809BD638016F723", + "81AEE4BDD82ED9645A21322E9C4C6A9385ED9F70B5D916C1B43B62EEF4D0098EFF3B1F78E2D0D48D50D1687B93B97D5F7C6D5047406A5E688B352209BCB9F822", + "7DDE385D566332ECC0EABFA9CF7822FDF209F70024A57B1AA000C55B881F8111B2DCDE494A5F485E5BCA4BD88A2763AED1CA2B2FA8F0540678CD1E0F3AD80892", + "AADD9DB8DBE9C48B3FD4E6AE33C9FC07CB308DB3B3C9D20ED6639CCA70330870553E5C414CA92619418661197FAC10471DB1D381085DDADDB58796829CA90069", 1 +}; + /* mapping between ECCurveName enum and pointers to ECCurveParams */ static const ECCurveParams *ecCurve_map[] = { NULL, /* ECCurve_noName */ @@ -683,6 +723,10 @@ &ecCurve_WTLS_1, /* ECCurve_WTLS_1 */ &ecCurve_WTLS_8, /* ECCurve_WTLS_8 */ &ecCurve_WTLS_9, /* ECCurve_WTLS_9 */ + &ecCurve_BrainpoolP256r1, /* ECCurve_BrainpoolP256r1 */ + &ecCurve_BrainpoolP320r1, /* ECCurve_BrainpoolP320r1 */ + &ecCurve_BrainpoolP384r1, /* ECCurve_brainpoolP384r1 */ + &ecCurve_BrainpoolP512r1, /* ECCurve_brainpoolP512r1 */ NULL /* ECCurve_pastLastCurve */ }; diff -Nru openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecl-exp.h openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecl-exp.h --- openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecl-exp.h 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecl-exp.h 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * This library is free software; you can redistribute it and/or @@ -161,6 +161,12 @@ /* ECCurve_WTLS_11 == ECCurve_NIST_B233 */ /* ECCurve_WTLS_12 == ECCurve_NIST_P224 */ + /* ECC Brainpool prime curves in RFC 5639*/ + ECCurve_BrainpoolP256r1, + ECCurve_BrainpoolP320r1, + ECCurve_BrainpoolP384r1, + ECCurve_BrainpoolP512r1, + ECCurve_pastLastCurve } ECCurveName; diff -Nru openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecl_gf.c openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecl_gf.c --- openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecl_gf.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecl_gf.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * This library is free software; you can redistribute it and/or @@ -833,6 +833,7 @@ MP_ADD_CARRY(b1, r1, r1, borrow, borrow); MP_ADD_CARRY(b2, r2, r2, borrow, borrow); MP_ADD_CARRY(b3, r3, r3, borrow, borrow); + MP_ADD_CARRY(b4, r4, r4, borrow, borrow); } MP_CHECKOK(s_mp_pad(r, 5)); MP_DIGIT(r, 4) = r4; @@ -908,6 +909,7 @@ MP_ADD_CARRY(b2, r2, r2, borrow, borrow); MP_ADD_CARRY(b3, r3, r3, borrow, borrow); MP_ADD_CARRY(b4, r4, r4, borrow, borrow); + MP_ADD_CARRY(b5, r5, r5, borrow, borrow); } MP_CHECKOK(s_mp_pad(r, 6)); diff -Nru openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecl_mult.c openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecl_mult.c --- openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/ecl_mult.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/ecl_mult.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * This library is free software; you can redistribute it and/or @@ -80,12 +80,12 @@ group, timing)); } } else { + kt.flag = (mp_sign)0; if (group->meth->field_enc) { MP_CHECKOK(group->meth->field_enc(px, rx, group->meth)); MP_CHECKOK(group->meth->field_enc(py, ry, group->meth)); MP_CHECKOK(group->point_mul(&kt, rx, ry, rx, ry, group, timing)); } else { - kt.flag = (mp_sign)0; MP_CHECKOK(group->point_mul(&kt, px, py, rx, ry, group, timing)); } } diff -Nru openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/oid.c openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/oid.c --- openjdk-11-11~19/src/jdk.crypto.ec/share/native/libsunec/impl/oid.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.ec/share/native/libsunec/impl/oid.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * * This library is free software; you can redistribute it and/or @@ -63,6 +63,10 @@ #define ANSI_X962_GF2m_OID ANSI_X962_CURVE_OID, 0x00 #define ANSI_X962_GFp_OID ANSI_X962_CURVE_OID, 0x01 +#define TELETRUST_ALGO_OID 0x2b, 0x24, 0x03 +#define ECC_BRAINPOOL TELETRUST_ALGO_OID, 0x03, 0x02, 0x08 +#define ECC_BRAINPOOL_EC_V1 ECC_BRAINPOOL, 0x01, 0x01 + #define CONST_OID static const unsigned char /* ANSI X9.62 prime curve OIDs */ @@ -134,6 +138,22 @@ CONST_OID ansiX962c2pnb368w1[] = { ANSI_X962_GF2m_OID, 0x13 }; CONST_OID ansiX962c2tnb431r1[] = { ANSI_X962_GF2m_OID, 0x14 }; +/* TeleTrusT ECC Brainpool prime curve OIDs */ +CONST_OID brainpoolP160r1[] = { ECC_BRAINPOOL_EC_V1, 0x01 }; +CONST_OID brainpoolP160t1[] = { ECC_BRAINPOOL_EC_V1, 0x02 }; +CONST_OID brainpoolP192r1[] = { ECC_BRAINPOOL_EC_V1, 0x03 }; +CONST_OID brainpoolP192t1[] = { ECC_BRAINPOOL_EC_V1, 0x04 }; +CONST_OID brainpoolP224r1[] = { ECC_BRAINPOOL_EC_V1, 0x05 }; +CONST_OID brainpoolP224t1[] = { ECC_BRAINPOOL_EC_V1, 0x06 }; +CONST_OID brainpoolP256r1[] = { ECC_BRAINPOOL_EC_V1, 0x07 }; +CONST_OID brainpoolP256t1[] = { ECC_BRAINPOOL_EC_V1, 0x08 }; +CONST_OID brainpoolP320r1[] = { ECC_BRAINPOOL_EC_V1, 0x09 }; +CONST_OID brainpoolP320t1[] = { ECC_BRAINPOOL_EC_V1, 0x0a }; +CONST_OID brainpoolP384r1[] = { ECC_BRAINPOOL_EC_V1, 0x0b }; +CONST_OID brainpoolP384t1[] = { ECC_BRAINPOOL_EC_V1, 0x0c }; +CONST_OID brainpoolP512r1[] = { ECC_BRAINPOOL_EC_V1, 0x0d }; +CONST_OID brainpoolP512t1[] = { ECC_BRAINPOOL_EC_V1, 0x0e }; + #define OI(x) { siDEROID, (unsigned char *)x, sizeof x } #ifndef SECOID_NO_STRINGS #define OD(oid,tag,desc,mech,ext) { OI(oid), tag, desc, mech, ext } @@ -409,30 +429,98 @@ INVALID_CERT_EXTENSION ) }; +static SECOidData BRAINPOOL_oids[] = { + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + + /* RFC 5639 Brainpool named elliptic curves */ + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + OD( brainpoolP256r1, ECCurve_BrainpoolP256r1, + "brainpoolP256r1 domain parameter set", + CKM_INVALID_MECHANISM, + INVALID_CERT_EXTENSION ), + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + OD( brainpoolP320r1, ECCurve_BrainpoolP320r1, + "brainpoolP320r1 domain parameter set", + CKM_INVALID_MECHANISM, + INVALID_CERT_EXTENSION ), + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + OD( brainpoolP384r1, ECCurve_BrainpoolP384r1, + "brainpoolP384r1 domain parameter set", + CKM_INVALID_MECHANISM, + INVALID_CERT_EXTENSION ), + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, INVALID_CERT_EXTENSION }, + OD( brainpoolP512r1, ECCurve_BrainpoolP512r1, + "brainpoolP512r1 domain parameter set", + CKM_INVALID_MECHANISM, + INVALID_CERT_EXTENSION ), + { { siDEROID, NULL, 0 }, ECCurve_noName, + "Unknown OID", CKM_INVALID_MECHANISM, + INVALID_CERT_EXTENSION } +}; + +int +oideql(unsigned char *reqoid, unsigned char *foundoid, size_t reqlen, size_t foundlen) +{ + if (!reqoid || !foundoid) { + return 0; + } + + if (reqlen != foundlen) { + return 0; + } + + return memcmp(reqoid, foundoid, reqlen) == 0; +} + SECOidData * SECOID_FindOID(const SECItem *oid) { SECOidData *po; SECOidData *ret = NULL; + int reqlen = oid->len; - if (oid->len == 8) { + if (reqlen == 8) { if (oid->data[6] == 0x00) { - /* XXX bounds check */ - po = &ANSI_oids[oid->data[7]]; - if (memcmp(oid->data, po->oid.data, 8) == 0) - ret = po; + /* XXX bounds check */ + po = &ANSI_oids[oid->data[7]]; + if (oideql(oid->data, po->oid.data, reqlen, po->oid.len)) { + ret = po; + } } if (oid->data[6] == 0x01) { - /* XXX bounds check */ - po = &ANSI_prime_oids[oid->data[7]]; - if (memcmp(oid->data, po->oid.data, 8) == 0) - ret = po; + /* XXX bounds check */ + po = &ANSI_prime_oids[oid->data[7]]; + if (oideql(oid->data, po->oid.data, reqlen, po->oid.len)) { + ret = po; + } } - } else if (oid->len == 5) { + } else if (reqlen == 5) { /* XXX bounds check */ po = &SECG_oids[oid->data[4]]; - if (memcmp(oid->data, po->oid.data, 5) == 0) - ret = po; + if (oideql(oid->data, po->oid.data, reqlen, po->oid.len)) { + ret = po; + } + } else if (reqlen == 9) { + /* XXX bounds check */ + po = &BRAINPOOL_oids[oid->data[8]]; + if (oideql(oid->data, po->oid.data, reqlen, po->oid.len)) { + ret = po; + } } return(ret); } diff -Nru openjdk-11-11~19/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSASignature.java openjdk-11-11~24/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSASignature.java --- openjdk-11-11~19/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSASignature.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/RSASignature.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,9 @@ import java.security.*; import java.security.spec.AlgorithmParameterSpec; import java.math.BigInteger; +import java.security.spec.MGF1ParameterSpec; +import java.security.spec.PSSParameterSpec; +import java.util.Locale; import sun.security.rsa.RSAKeyFactory; @@ -45,6 +48,7 @@ * . "SHA512withRSA" * . "MD5withRSA" * . "MD2withRSA" + * . "RSASSA-PSS" * * NOTE: RSA keys must be at least 512 bits long. * @@ -59,19 +63,19 @@ abstract class RSASignature extends java.security.SignatureSpi { // message digest implementation we use - private final MessageDigest messageDigest; + protected MessageDigest messageDigest; // message digest name private String messageDigestAlgorithm; // flag indicating whether the digest has been reset - private boolean needsReset; + protected boolean needsReset; // the signing key - private Key privateKey = null; + protected Key privateKey = null; // the verification key - private Key publicKey = null; + protected Key publicKey = null; /** * Constructs a new RSASignature. Used by Raw subclass. @@ -125,7 +129,7 @@ @Override protected void engineUpdate(byte[] b, int off, int len) throws SignatureException { - if (offset + len > precomputedDigest.length) { + if (len > (precomputedDigest.length - offset)) { offset = RAW_RSA_MAX + 1; return; } @@ -140,7 +144,7 @@ if (len <= 0) { return; } - if (offset + len > precomputedDigest.length) { + if (len > (precomputedDigest.length - offset)) { offset = RAW_RSA_MAX + 1; return; } @@ -222,6 +226,253 @@ } } + public static final class PSS extends RSASignature { + + private PSSParameterSpec pssParams = null; + + // Workaround: Cannot import raw public key to CNG. This signature + // will be used for verification if key is not from MSCAPI. + private Signature fallbackSignature; + + @Override + protected void engineInitSign(PrivateKey key) throws InvalidKeyException { + super.engineInitSign(key); + fallbackSignature = null; + } + + @Override + protected void engineInitVerify(PublicKey key) throws InvalidKeyException { + // This signature accepts only RSAPublicKey + if ((key instanceof java.security.interfaces.RSAPublicKey) == false) { + throw new InvalidKeyException("Key type not supported"); + } + + this.privateKey = null; + + if (key instanceof sun.security.mscapi.RSAPublicKey) { + fallbackSignature = null; + publicKey = (sun.security.mscapi.RSAPublicKey) key; + } else { + if (fallbackSignature == null) { + try { + fallbackSignature = Signature.getInstance( + "RSASSA-PSS", "SunRsaSign"); + } catch (NoSuchAlgorithmException | NoSuchProviderException e) { + throw new InvalidKeyException("Invalid key", e); + } + } + fallbackSignature.initVerify(key); + if (pssParams != null) { + try { + fallbackSignature.setParameter(pssParams); + } catch (InvalidAlgorithmParameterException e) { + throw new InvalidKeyException("Invalid params", e); + } + } + publicKey = null; + } + resetDigest(); + } + + @Override + protected void engineUpdate(byte b) throws SignatureException { + ensureInit(); + if (fallbackSignature != null) { + fallbackSignature.update(b); + } else { + messageDigest.update(b); + } + needsReset = true; + } + + @Override + protected void engineUpdate(byte[] b, int off, int len) throws SignatureException { + ensureInit(); + if (fallbackSignature != null) { + fallbackSignature.update(b, off, len); + } else { + messageDigest.update(b, off, len); + } + needsReset = true; + } + + @Override + protected void engineUpdate(ByteBuffer input) { + try { + ensureInit(); + } catch (SignatureException se) { + // hack for working around API bug + throw new RuntimeException(se.getMessage()); + } + if (fallbackSignature != null) { + try { + fallbackSignature.update(input); + } catch (SignatureException se) { + // hack for working around API bug + throw new RuntimeException(se.getMessage()); + } + } else { + messageDigest.update(input); + } + needsReset = true; + } + + @Override + protected byte[] engineSign() throws SignatureException { + ensureInit(); + byte[] hash = getDigestValue(); + return signPssHash(hash, hash.length, + pssParams.getSaltLength(), + ((MGF1ParameterSpec) + pssParams.getMGFParameters()).getDigestAlgorithm(), + privateKey.getHCryptProvider(), privateKey.getHCryptKey()); + } + + @Override + protected boolean engineVerify(byte[] sigBytes) throws SignatureException { + ensureInit(); + if (fallbackSignature != null) { + needsReset = false; + return fallbackSignature.verify(sigBytes); + } else { + byte[] hash = getDigestValue(); + return verifyPssSignedHash( + hash, hash.length, + sigBytes, sigBytes.length, + pssParams.getSaltLength(), + ((MGF1ParameterSpec) + pssParams.getMGFParameters()).getDigestAlgorithm(), + publicKey.getHCryptProvider(), + publicKey.getHCryptKey() + ); + } + } + + @Override + protected void engineSetParameter(AlgorithmParameterSpec params) + throws InvalidAlgorithmParameterException { + if (needsReset) { + throw new ProviderException + ("Cannot set parameters during operations"); + } + this.pssParams = validateSigParams(params); + if (fallbackSignature != null) { + fallbackSignature.setParameter(params); + } + } + + @Override + protected AlgorithmParameters engineGetParameters() { + AlgorithmParameters ap = null; + if (this.pssParams != null) { + try { + ap = AlgorithmParameters.getInstance("RSASSA-PSS"); + ap.init(this.pssParams); + } catch (GeneralSecurityException gse) { + throw new ProviderException(gse.getMessage()); + } + } + return ap; + } + + private void ensureInit() throws SignatureException { + if (this.privateKey == null && this.publicKey == null + && fallbackSignature == null) { + throw new SignatureException("Missing key"); + } + if (this.pssParams == null) { + // Parameters are required for signature verification + throw new SignatureException + ("Parameters required for RSASSA-PSS signatures"); + } + if (fallbackSignature == null && messageDigest == null) { + // This could happen if initVerify(softKey), setParameter(), + // and initSign() were called. No messageDigest. Create it. + try { + messageDigest = MessageDigest + .getInstance(pssParams.getDigestAlgorithm()); + } catch (NoSuchAlgorithmException e) { + throw new SignatureException(e); + } + } + } + + /** + * Validate the specified Signature PSS parameters. + */ + private PSSParameterSpec validateSigParams(AlgorithmParameterSpec p) + throws InvalidAlgorithmParameterException { + + if (p == null) { + throw new InvalidAlgorithmParameterException + ("Parameters cannot be null"); + } + + if (!(p instanceof PSSParameterSpec)) { + throw new InvalidAlgorithmParameterException + ("parameters must be type PSSParameterSpec"); + } + + // no need to validate again if same as current signature parameters + PSSParameterSpec params = (PSSParameterSpec) p; + if (params == this.pssParams) return params; + + // now sanity check the parameter values + if (!(params.getMGFAlgorithm().equalsIgnoreCase("MGF1"))) { + throw new InvalidAlgorithmParameterException("Only supports MGF1"); + + } + + if (params.getTrailerField() != PSSParameterSpec.TRAILER_FIELD_BC) { + throw new InvalidAlgorithmParameterException + ("Only supports TrailerFieldBC(1)"); + } + + AlgorithmParameterSpec algSpec = params.getMGFParameters(); + if (!(algSpec instanceof MGF1ParameterSpec)) { + throw new InvalidAlgorithmParameterException + ("Only support MGF1ParameterSpec"); + } + + MGF1ParameterSpec mgfSpec = (MGF1ParameterSpec)algSpec; + + String msgHashAlg = params.getDigestAlgorithm() + .toLowerCase(Locale.ROOT).replaceAll("-", ""); + if (msgHashAlg.equals("sha")) { + msgHashAlg = "sha1"; + } + String mgf1HashAlg = mgfSpec.getDigestAlgorithm() + .toLowerCase(Locale.ROOT).replaceAll("-", ""); + if (mgf1HashAlg.equals("sha")) { + mgf1HashAlg = "sha1"; + } + + if (!mgf1HashAlg.equals(msgHashAlg)) { + throw new InvalidAlgorithmParameterException + ("MGF1 hash must be the same as message hash"); + } + + return params; + } + + /** + * Sign hash using CNG API with HCRYPTKEY. Used by RSASSA-PSS. + */ + private native static byte[] signPssHash(byte[] hash, + int hashSize, int saltLength, String hashAlgorithm, + long hCryptProv, long nCryptKey) + throws SignatureException; + + /** + * Verify a signed hash using CNG API with HCRYPTKEY. Used by RSASSA-PSS. + * This method is not used now. See {@link #fallbackSignature}. + */ + private native static boolean verifyPssSignedHash(byte[] hash, int hashSize, + byte[] signature, int signatureSize, + int saltLength, String hashAlgorithm, + long hCryptProv, long hKey) throws SignatureException; + } + // initialize for signing. See JCA doc @Override protected void engineInitVerify(PublicKey key) @@ -298,7 +549,9 @@ */ protected void resetDigest() { if (needsReset) { - messageDigest.reset(); + if (messageDigest != null) { + messageDigest.reset(); + } needsReset = false; } } diff -Nru openjdk-11-11~19/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java openjdk-11-11~24/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java --- openjdk-11-11~19/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -105,6 +105,8 @@ return new RSASignature.MD5(); } else if (algo.equals("MD2withRSA")) { return new RSASignature.MD2(); + } else if (algo.equals("RSASSA-PSS")) { + return new RSASignature.PSS(); } } else if (type.equals("KeyPairGenerator")) { if (algo.equals("RSA")) { @@ -178,6 +180,10 @@ new String[] { "1.2.840.113549.1.1.13", "OID.1.2.840.113549.1.1.13" }, attrs)); putService(new ProviderService(p, "Signature", + "RSASSA-PSS", "sun.security.mscapi.RSASignature$PSS", + new String[] { "1.2.840.113549.1.1.10", "OID.1.2.840.113549.1.1.10" }, + attrs)); + putService(new ProviderService(p, "Signature", "MD5withRSA", "sun.security.mscapi.RSASignature$MD5", null, attrs)); putService(new ProviderService(p, "Signature", diff -Nru openjdk-11-11~19/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp openjdk-11-11~24/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp --- openjdk-11-11~19/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -57,6 +57,18 @@ #define SIGNATURE_EXCEPTION "java/security/SignatureException" #define OUT_OF_MEMORY_ERROR "java/lang/OutOfMemoryError" +#define SS_CHECK(Status) \ + if (Status != ERROR_SUCCESS) { \ + ThrowException(env, SIGNATURE_EXCEPTION, Status); \ + __leave; \ + } + +//#define PP(fmt, ...) \ +// fprintf(stdout, "SSPI (%ld): ", __LINE__); \ +// fprintf(stdout, fmt, ##__VA_ARGS__); \ +// fprintf(stdout, "\n"); \ +// fflush(stdout) + extern "C" { /* @@ -64,6 +76,18 @@ */ DEF_STATIC_JNI_OnLoad +//void dump(LPSTR title, PBYTE data, DWORD len) +//{ +// printf("==== %s ====\n", title); +// for (DWORD i = 0; i < len; i++) { +// if (i != 0 && i % 16 == 0) { +// printf("\n"); +// } +// printf("%02X ", *(data + i) & 0xff); +// } +// printf("\n"); +//} + /* * Throws an arbitrary Java exception with the given message. */ @@ -146,6 +170,37 @@ return algId; } +/* + * Maps the name of a hash algorithm to a CNG Algorithm Identifier. + */ +LPCWSTR MapHashIdentifier(JNIEnv *env, jstring jHashAlgorithm) { + + const char* pszHashAlgorithm = NULL; + LPCWSTR id = NULL; + + if ((pszHashAlgorithm = env->GetStringUTFChars(jHashAlgorithm, NULL)) + == NULL) { + return id; + } + + if ((strcmp("SHA", pszHashAlgorithm) == 0) || + (strcmp("SHA1", pszHashAlgorithm) == 0) || + (strcmp("SHA-1", pszHashAlgorithm) == 0)) { + + id = BCRYPT_SHA1_ALGORITHM; + } else if (strcmp("SHA-256", pszHashAlgorithm) == 0) { + id = BCRYPT_SHA256_ALGORITHM; + } else if (strcmp("SHA-384", pszHashAlgorithm) == 0) { + id = BCRYPT_SHA384_ALGORITHM; + } else if (strcmp("SHA-512", pszHashAlgorithm) == 0) { + id = BCRYPT_SHA512_ALGORITHM; + } + + if (pszHashAlgorithm) + env->ReleaseStringUTFChars(jHashAlgorithm, pszHashAlgorithm); + + return id; +} /* * Returns a certificate chain context given a certificate context and key @@ -561,7 +616,6 @@ ::CryptReleaseContext((HCRYPTPROV) hCryptProv, NULL); } - /* * Class: sun_security_mscapi_RSASignature * Method: signHash @@ -693,6 +747,94 @@ } /* + * Class: sun_security_mscapi_RSASignature_PSS + * Method: signPssHash + * Signature: ([BIILjava/lang/String;JJ)[B + */ +JNIEXPORT jbyteArray JNICALL Java_sun_security_mscapi_RSASignature_00024PSS_signPssHash + (JNIEnv *env, jclass clazz, jbyteArray jHash, + jint jHashSize, jint saltLen, jstring jHashAlgorithm, jlong hCryptProv, + jlong hCryptKey) +{ + jbyteArray jSignedHash = NULL; + + jbyte* pHashBuffer = NULL; + jbyte* pSignedHashBuffer = NULL; + NCRYPT_KEY_HANDLE hk = NULL; + + __try + { + SS_CHECK(::NCryptTranslateHandle( + NULL, + &hk, + hCryptProv, + hCryptKey, + NULL, + 0)); + + // Copy hash from Java to native buffer + pHashBuffer = new (env) jbyte[jHashSize]; + if (pHashBuffer == NULL) { + __leave; + } + env->GetByteArrayRegion(jHash, 0, jHashSize, pHashBuffer); + + BCRYPT_PSS_PADDING_INFO pssInfo; + pssInfo.pszAlgId = MapHashIdentifier(env, jHashAlgorithm); + pssInfo.cbSalt = saltLen; + + if (pssInfo.pszAlgId == NULL) { + ThrowExceptionWithMessage(env, SIGNATURE_EXCEPTION, + "Unrecognised hash algorithm"); + __leave; + } + + DWORD dwBufLen = 0; + SS_CHECK(::NCryptSignHash( + hk, + &pssInfo, + (BYTE*)pHashBuffer, jHashSize, + NULL, 0, &dwBufLen, + BCRYPT_PAD_PSS + )); + + pSignedHashBuffer = new (env) jbyte[dwBufLen]; + if (pSignedHashBuffer == NULL) { + __leave; + } + + SS_CHECK(::NCryptSignHash( + hk, + &pssInfo, + (BYTE*)pHashBuffer, jHashSize, + (BYTE*)pSignedHashBuffer, dwBufLen, &dwBufLen, + BCRYPT_PAD_PSS + )); + + // Create new byte array + jbyteArray temp = env->NewByteArray(dwBufLen); + + // Copy data from native buffer + env->SetByteArrayRegion(temp, 0, dwBufLen, pSignedHashBuffer); + + jSignedHash = temp; + } + __finally + { + if (pSignedHashBuffer) + delete [] pSignedHashBuffer; + + if (pHashBuffer) + delete [] pHashBuffer; + + if (hk != NULL) + ::NCryptFreeObject(hk); + } + + return jSignedHash; +} + +/* * Class: sun_security_mscapi_RSASignature * Method: verifySignedHash * Signature: ([BIL/java/lang/String;[BIJJ)Z @@ -795,6 +937,85 @@ } return result; +} + +/* + * Class: sun_security_mscapi_RSASignature_PSS + * Method: verifyPssSignedHash + * Signature: ([BI[BIILjava/lang/String;JJ)Z + */ +JNIEXPORT jboolean JNICALL Java_sun_security_mscapi_RSASignature_00024PSS_verifyPssSignedHash + (JNIEnv *env, jclass clazz, + jbyteArray jHash, jint jHashSize, + jbyteArray jSignedHash, jint jSignedHashSize, + jint saltLen, jstring jHashAlgorithm, + jlong hCryptProv, jlong hKey) +{ + jbyte* pHashBuffer = NULL; + jbyte* pSignedHashBuffer = NULL; + jboolean result = JNI_FALSE; + NCRYPT_KEY_HANDLE hk = NULL; + + __try + { + SS_CHECK(::NCryptTranslateHandle( + NULL, + &hk, + hCryptProv, + hKey, + NULL, + 0)); + + // Copy hash and signedHash from Java to native buffer + pHashBuffer = new (env) jbyte[jHashSize]; + if (pHashBuffer == NULL) { + __leave; + } + env->GetByteArrayRegion(jHash, 0, jHashSize, pHashBuffer); + + pSignedHashBuffer = new (env) jbyte[jSignedHashSize]; + if (pSignedHashBuffer == NULL) { + __leave; + } + env->GetByteArrayRegion(jSignedHash, 0, jSignedHashSize, + pSignedHashBuffer); + + BCRYPT_PSS_PADDING_INFO pssInfo; + pssInfo.pszAlgId = MapHashIdentifier(env, jHashAlgorithm); + pssInfo.cbSalt = saltLen; + + if (pssInfo.pszAlgId == NULL) { + ThrowExceptionWithMessage(env, SIGNATURE_EXCEPTION, + "Unrecognised hash algorithm"); + __leave; + } + + // For RSA, the hash encryption algorithm is normally the same as the + // public key algorithm, so AT_SIGNATURE is used. + + // Verify the signature + if (::NCryptVerifySignature(hk, &pssInfo, + (BYTE *) pHashBuffer, jHashSize, + (BYTE *) pSignedHashBuffer, jSignedHashSize, + NCRYPT_PAD_PSS_FLAG) == ERROR_SUCCESS) + { + result = JNI_TRUE; + } + } + + __finally + { + if (pSignedHashBuffer) + delete [] pSignedHashBuffer; + + if (pHashBuffer) + delete [] pHashBuffer; + + if (hk != NULL) + ::NCryptFreeObject(hk); + } + + return result; } /* diff -Nru openjdk-11-11~19/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java openjdk-11-11~24/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java --- openjdk-11-11~19/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.crypto.ucrypto/solaris/classes/com/oracle/security/ucrypto/NativeRSASignature.java 2018-07-25 15:36:46.000000000 +0000 @@ -291,8 +291,9 @@ throws SignatureException { boolean doCancel = true; try { - if (outbuf == null || (offset < 0) || (outbuf.length < (offset + sigLength)) - || (len < sigLength)) { + if (outbuf == null || (offset < 0) || + ((outbuf.length - offset) < sigLength) || + (len < sigLength)) { throw new SignatureException("Invalid output buffer. offset: " + offset + ". len: " + len + ". sigLength: " + sigLength); } @@ -357,8 +358,9 @@ throws SignatureException { boolean doCancel = true; try { - if (sigBytes == null || (sigOfs < 0) || (sigBytes.length < (sigOfs + this.sigLength)) - || (sigLen != this.sigLength)) { + if (sigBytes == null || (sigOfs < 0) || + ((sigBytes.length - sigOfs) < this.sigLength) || + (sigLen != this.sigLength)) { throw new SignatureException("Invalid signature length: got " + sigLen + " but was expecting " + this.sigLength); } @@ -440,7 +442,7 @@ // returns 0 (success) or negative (ucrypto error occurred) private int update(byte[] in, int inOfs, int inLen) { - if (inOfs < 0 || inOfs + inLen > in.length) { + if (inOfs < 0 || inOfs > (in.length - inLen)) { throw new ArrayIndexOutOfBoundsException("inOfs :" + inOfs + ". inLen: " + inLen + ". in.length: " + in.length); } diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AbstractJavaLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AbstractJavaLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AbstractJavaLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AbstractJavaLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AccessibleMembersLookup.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AccessibleMembersLookup.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AccessibleMembersLookup.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/AccessibleMembersLookup.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ApplicableOverloadedMethods.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ApplicableOverloadedMethods.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ApplicableOverloadedMethods.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ApplicableOverloadedMethods.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanIntrospector.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanIntrospector.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanIntrospector.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanIntrospector.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeanLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeansLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeansLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeansLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/BeansLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CallerSensitiveDynamicMethod.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CallerSensitiveDynamicMethod.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CallerSensitiveDynamicMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CallerSensitiveDynamicMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CheckRestrictedPackage.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CheckRestrictedPackage.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CheckRestrictedPackage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/CheckRestrictedPackage.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassString.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassString.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassString.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/ClassString.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/DynamicMethod.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/DynamicMethod.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/DynamicMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/DynamicMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/DynamicMethodLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/DynamicMethodLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/DynamicMethodLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/DynamicMethodLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/FacetIntrospector.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/FacetIntrospector.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/FacetIntrospector.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/FacetIntrospector.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/GuardedInvocationComponent.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/GuardedInvocationComponent.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/GuardedInvocationComponent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/GuardedInvocationComponent.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/MaximallySpecific.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/MaximallySpecific.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/MaximallySpecific.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/MaximallySpecific.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedDynamicMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedMethod.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedMethod.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/OverloadedMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/package-info.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/package-info.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/SimpleDynamicMethod.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/SimpleDynamicMethod.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/SimpleDynamicMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/SimpleDynamicMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/SingleDynamicMethod.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/SingleDynamicMethod.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/SingleDynamicMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/SingleDynamicMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClassIntrospector.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClassIntrospector.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClassIntrospector.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClassIntrospector.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClass.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClass.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClass.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClassLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClassLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClassLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/beans/StaticClassLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.beans; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/CallSiteDescriptor.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/CallSiteDescriptor.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/CallSiteDescriptor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/CallSiteDescriptor.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/ClassMap.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/ClassMap.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/ClassMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/ClassMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/DynamicLinkerFactory.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/DynamicLinkerFactory.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/DynamicLinkerFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/DynamicLinkerFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/DynamicLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/DynamicLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/DynamicLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/DynamicLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/ConversionComparator.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/ConversionComparator.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/ConversionComparator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/ConversionComparator.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardedInvocation.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardedInvocation.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardedInvocation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardedInvocation.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardedInvocationTransformer.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardedInvocationTransformer.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardedInvocationTransformer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardedInvocationTransformer.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardingDynamicLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardingDynamicLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardingDynamicLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardingDynamicLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardingTypeConverterFactory.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardingTypeConverterFactory.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardingTypeConverterFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/GuardingTypeConverterFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/LinkerServices.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/LinkerServices.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/LinkerServices.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/LinkerServices.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/LinkRequest.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/LinkRequest.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/LinkRequest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/LinkRequest.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/MethodHandleTransformer.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/MethodHandleTransformer.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/MethodHandleTransformer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/MethodHandleTransformer.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2015 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/MethodTypeConversionStrategy.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/MethodTypeConversionStrategy.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/MethodTypeConversionStrategy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/MethodTypeConversionStrategy.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2014 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/package-info.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/package-info.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/CompositeGuardingDynamicLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/CompositeGuardingDynamicLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/CompositeGuardingDynamicLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/CompositeGuardingDynamicLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/CompositeTypeBasedGuardingDynamicLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/CompositeTypeBasedGuardingDynamicLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/CompositeTypeBasedGuardingDynamicLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/CompositeTypeBasedGuardingDynamicLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/DefaultInternalObjectFilter.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/DefaultInternalObjectFilter.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/DefaultInternalObjectFilter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/DefaultInternalObjectFilter.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2015 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Guards.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Guards.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Guards.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Guards.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Lookup.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Lookup.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Lookup.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/Lookup.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/package-info.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/package-info.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2015 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/SimpleLinkRequest.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/SimpleLinkRequest.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/SimpleLinkRequest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/SimpleLinkRequest.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/TypeUtilities.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/TypeUtilities.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/TypeUtilities.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/support/TypeUtilities.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/TypeBasedGuardingDynamicLinker.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/TypeBasedGuardingDynamicLinker.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/linker/TypeBasedGuardingDynamicLinker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/linker/TypeBasedGuardingDynamicLinker.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.linker; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/LinkerServicesImpl.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/LinkerServicesImpl.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/LinkerServicesImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/LinkerServicesImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/NamedOperation.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/NamedOperation.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/NamedOperation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/NamedOperation.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2015 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/Namespace.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/Namespace.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/Namespace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/Namespace.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2016 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/NamespaceOperation.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/NamespaceOperation.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/NamespaceOperation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/NamespaceOperation.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2016 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/NoSuchDynamicMethodException.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/NoSuchDynamicMethodException.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/NoSuchDynamicMethodException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/NoSuchDynamicMethodException.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/Operation.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/Operation.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/Operation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/Operation.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2015 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/package-info.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/package-info.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/RelinkableCallSite.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/RelinkableCallSite.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/RelinkableCallSite.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/RelinkableCallSite.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/StandardNamespace.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/StandardNamespace.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/StandardNamespace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/StandardNamespace.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2016 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/StandardOperation.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/StandardOperation.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/StandardOperation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/StandardOperation.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2015 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/support/AbstractRelinkableCallSite.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/support/AbstractRelinkableCallSite.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/support/AbstractRelinkableCallSite.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/support/AbstractRelinkableCallSite.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/support/ChainedCallSite.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/support/ChainedCallSite.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/support/ChainedCallSite.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/support/ChainedCallSite.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/support/package-info.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/support/package-info.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/support/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/support/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/support/SimpleRelinkableCallSite.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/support/SimpleRelinkableCallSite.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/support/SimpleRelinkableCallSite.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/support/SimpleRelinkableCallSite.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink.support; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/TypeConverterFactory.java openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/TypeConverterFactory.java --- openjdk-11-11~19/src/jdk.dynalink/share/classes/jdk/dynalink/TypeConverterFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/classes/jdk/dynalink/TypeConverterFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,52 +33,29 @@ /* Copyright 2009-2013 Attila Szegedi - Licensed under both the Apache License, Version 2.0 (the "Apache License") - and the BSD License (the "BSD License"), with licensee being free to - choose either of the two at their discretion. - - You may not use this file except in compliance with either the Apache - License or the BSD License. - - If you choose to use this file in compliance with the Apache License, the - following notice applies to you: - - You may obtain a copy of the Apache License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied. See the License for the specific language governing - permissions and limitations under the License. - - If you choose to use this file in compliance with the BSD License, the - following notice applies to you: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are - met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the copyright holder nor the names of - contributors may be used to endorse or promote products derived from - this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS - IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER - BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR - BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR - OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER + BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, + WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR + OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.dynalink/share/legal/dynalink.md openjdk-11-11~24/src/jdk.dynalink/share/legal/dynalink.md --- openjdk-11-11~19/src/jdk.dynalink/share/legal/dynalink.md 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.dynalink/share/legal/dynalink.md 2018-07-25 15:36:46.000000000 +0000 @@ -5,27 +5,28 @@ Copyright (c) 2009-2013, Attila Szegedi -All rights reserved.Redistribution and use in source and binary forms, with or -without modification, are permitted provided that the following conditions are +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: -* Redistributions of source code must retain the above copyright notice, -this list of conditions and the following disclaimer. -* Redistributions in binary form must reproduce the above copyright notice, -this list of conditions and the following disclaimer in the documentation -and/or other materials provided with the distribution. -* Neither the name of Attila Szegedi nor the names of its contributors may be -used to endorse or promote products derived from this software without -specific prior written permission. +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +* Neither the name of the copyright holder nor the names of + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF SUCH DAMAGE. +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS +IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED +TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL COPYRIGHT HOLDER +BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. </pre> diff -Nru openjdk-11-11~19/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m openjdk-11-11~24/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m --- openjdk-11-11~19/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.hotspot.agent/macosx/native/libsaproc/MacosxDebuggerLocal.m 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,6 +33,7 @@ #import <mach/mach_types.h> #import <sys/sysctl.h> #import <stdio.h> +#import <string.h> #import <stdarg.h> #import <stdlib.h> #import <strings.h> @@ -69,6 +70,63 @@ // indicator if thread id (lwpid_t) was set static bool _threads_filled = false; +// mach_exc_server defined in the generated mach_excServer.c +extern boolean_t mach_exc_server(mach_msg_header_t *input_msg_hdr, + mach_msg_header_t *output_msg_hdr); + +kern_return_t catch_mach_exception_raise( + mach_port_t exception_port, mach_port_t thread, + mach_port_t task, exception_type_t exception, + mach_exception_data_t code, + mach_msg_type_number_t code_cnt); + +kern_return_t catch_mach_exception_raise_state( + mach_port_t exception_port, exception_type_t exception, + const mach_exception_data_t code, mach_msg_type_number_t code_cnt, + int *flavor, const thread_state_t old_state, + mach_msg_type_number_t old_state_cnt, thread_state_t new_state, + mach_msg_type_number_t *new_state_cnt); + +kern_return_t catch_mach_exception_raise_state_identity( + mach_port_t exception_port, mach_port_t thread, mach_port_t task, + exception_type_t exception, mach_exception_data_t code, + mach_msg_type_number_t code_cnt, int *flavor, thread_state_t old_state, + mach_msg_type_number_t old_state_cnt, thread_state_t new_state, + mach_msg_type_number_t *new_state_cnt); + +static struct exception_saved_state { + exception_mask_t saved_masks[EXC_TYPES_COUNT]; + mach_port_t saved_ports[EXC_TYPES_COUNT]; + exception_behavior_t saved_behaviors[EXC_TYPES_COUNT]; + thread_state_flavor_t saved_flavors[EXC_TYPES_COUNT]; + mach_msg_type_number_t saved_exception_types_count; +} exception_saved_state; + +static mach_port_t tgt_exception_port; + +// Mirrors __Reply__mach_exception_raise_t generated in mach_excServer.c +static struct rep_msg { + mach_msg_header_t header; + NDR_record_t ndr; + kern_return_t ret_code; +} rep_msg; + +// Mirrors __Request__mach_exception_raise_t generated in mach_excServer.c +// with a large trailing pad to avoid MACH_MSG_RCV_TOO_LARGE +static struct exc_msg { + mach_msg_header_t header; + // start of the kernel processed data + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t thread; + mach_msg_port_descriptor_t task; + // end of the kernel processed data + NDR_record_t ndr; + exception_type_t exception; + mach_msg_type_number_t code_cnt; + mach_exception_data_t code; // an array of int64_t + char pad[512]; +} exc_msg; + static void putSymbolicator(JNIEnv *env, jobject this_obj, id symbolicator) { (*env)->SetLongField(env, this_obj, symbolicatorID, (jlong)(intptr_t)symbolicator); } @@ -91,9 +149,9 @@ #define CHECK_EXCEPTION if ((*env)->ExceptionOccurred(env)) { return;} #define THROW_NEW_DEBUGGER_EXCEPTION_(str, value) { throw_new_debugger_exception(env, str); return value; } #define THROW_NEW_DEBUGGER_EXCEPTION(str) { throw_new_debugger_exception(env, str); return;} -#define CHECK_EXCEPTION_CLEAR if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); } -#define CHECK_EXCEPTION_CLEAR_VOID if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); return; } -#define CHECK_EXCEPTION_CLEAR_(value) if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); return value; } +#define CHECK_EXCEPTION_CLEAR if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); } +#define CHECK_EXCEPTION_CLEAR_VOID if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); return; } +#define CHECK_EXCEPTION_CLEAR_(value) if ((*env)->ExceptionOccurred(env)) { (*env)->ExceptionClear(env); return value; } static void throw_new_debugger_exception(JNIEnv* env, const char* errMsg) { jclass exceptionClass = (*env)->FindClass(env, "sun/jvm/hotspot/debugger/DebuggerException"); @@ -129,7 +187,7 @@ * Method: init0 * Signature: ()V */ -JNIEXPORT void JNICALL +JNIEXPORT void JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_init0(JNIEnv *env, jclass cls) { symbolicatorID = (*env)->GetFieldID(env, cls, "symbolicator", "J"); CHECK_EXCEPTION; @@ -202,10 +260,10 @@ * Method: lookupByName0 * Signature: (Ljava/lang/String;Ljava/lang/String;)J */ -JNIEXPORT jlong JNICALL +JNIEXPORT jlong JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_lookupByName0( - JNIEnv *env, jobject this_obj, - jstring objectName, jstring symbolName) + JNIEnv *env, jobject this_obj, + jstring objectName, jstring symbolName) { struct ps_prochandle* ph = get_proc_handle(env, this_obj); if (ph != NULL && ph->core != NULL) { @@ -280,8 +338,8 @@ */ JNIEXPORT jbyteArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_readBytesFromProcess0( - JNIEnv *env, jobject this_obj, - jlong addr, jlong numBytes) + JNIEnv *env, jobject this_obj, + jlong addr, jlong numBytes) { print_debug("readBytesFromProcess called. addr = %llx numBytes = %lld\n", addr, numBytes); @@ -320,16 +378,16 @@ task_t gTask = getTask(env, this_obj); // Try to read each of the pages. for (i = 0; i < pageCount; i++) { - result = vm_read(gTask, alignedAddress + i*vm_page_size, vm_page_size, + result = vm_read(gTask, alignedAddress + i*vm_page_size, vm_page_size, &pages[i], &byteCount); - mapped[i] = (result == KERN_SUCCESS); + mapped[i] = (result == KERN_SUCCESS); // assume all failures are unmapped pages } print_debug("%ld pages\n", pageCount); - + remaining = numBytes; - + for (i = 0; i < pageCount; i++) { unsigned long len = vm_page_size; unsigned long start = 0; @@ -366,18 +424,18 @@ * integers to host all java threads' id, stack_start, stack_end as: * [uid0, stack_start0, stack_end0, uid1, stack_start1, stack_end1, ...] * - * The work cannot be done at init0 since Threads is not available yet(VM not initialized yet). + * The work cannot be done at init0 since Threads is not available yet(VM not initialized yet). * This function should be called only once if succeeded - */ + */ bool fill_java_threads(JNIEnv* env, jobject this_obj, struct ps_prochandle* ph) { int n = 0, i = 0, j; struct reg regs; - + jlongArray thrinfos = (*env)->CallObjectMethod(env, this_obj, getJavaThreadsInfo_ID); CHECK_EXCEPTION_(false); int len = (int)(*env)->GetArrayLength(env, thrinfos); uint64_t* cinfos = (uint64_t *)(*env)->GetLongArrayElements(env, thrinfos, NULL); - CHECK_EXCEPTION_(false); + CHECK_EXCEPTION_(false); n = get_num_threads(ph); print_debug("fill_java_threads called, num_of_thread = %d\n", n); for (i = 0; i < n; i++) { @@ -388,7 +446,7 @@ for (j = 0; j < len; j += 3) { lwpid_t uid = cinfos[j]; uint64_t beg = cinfos[j + 1]; - uint64_t end = cinfos[j + 2]; + uint64_t end = cinfos[j + 2]; if ((regs.r_rsp < end && regs.r_rsp >= beg) || (regs.r_rbp < end && regs.r_rbp >= beg)) { set_lwp_id(ph, i, uid); @@ -478,19 +536,19 @@ thread_t lookupThreadFromThreadId(task_t task, jlong thread_id) { print_debug("lookupThreadFromThreadId thread_id=0x%llx\n", thread_id); - + thread_array_t thread_list = NULL; mach_msg_type_number_t thread_list_count = 0; thread_t result_thread = 0; int i; - + // get the list of all the send rights kern_return_t result = task_threads(task, &thread_list, &thread_list_count); if (result != KERN_SUCCESS) { print_debug("task_threads returned 0x%x\n", result); return 0; } - + for(i = 0 ; i < thread_list_count; i++) { thread_identifier_info_data_t m_ident_info; mach_msg_type_number_t count = THREAD_IDENTIFIER_INFO_COUNT; @@ -501,7 +559,7 @@ print_debug("thread_info returned 0x%x\n", result); break; } - + // if this is the one we're looking for, return the send right if (thread_id == m_ident_info.thread_id) { @@ -509,10 +567,10 @@ break; } } - + vm_size_t thread_list_size = (vm_size_t) (thread_list_count * sizeof (thread_t)); vm_deallocate(mach_task_self(), (vm_address_t) thread_list, thread_list_count); - + return result_thread; } @@ -522,10 +580,10 @@ * Method: getThreadIntegerRegisterSet0 * Signature: (J)[J */ -JNIEXPORT jlongArray JNICALL +JNIEXPORT jlongArray JNICALL Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_getThreadIntegerRegisterSet0( - JNIEnv *env, jobject this_obj, - jlong thread_id) + JNIEnv *env, jobject this_obj, + jlong thread_id) { print_debug("getThreadRegisterSet0 called\n"); @@ -578,7 +636,7 @@ primitiveArray[REG_INDEX(RCX)] = state.__rcx; primitiveArray[REG_INDEX(RAX)] = state.__rax; primitiveArray[REG_INDEX(TRAPNO)] = 0; // trapno, not used - primitiveArray[REG_INDEX(ERR)] = 0; // err, not used + primitiveArray[REG_INDEX(ERR)] = 0; // err, not used primitiveArray[REG_INDEX(RIP)] = state.__rip; primitiveArray[REG_INDEX(CS)] = state.__cs; primitiveArray[REG_INDEX(RFL)] = state.__rflags; @@ -630,78 +688,96 @@ return (jint) usable_tid; } +// attach to a process/thread specified by "pid" +static bool ptrace_attach(pid_t pid) { + errno = 0; + ptrace(PT_ATTACHEXC, pid, 0, 0); -static bool ptrace_continue(pid_t pid, int signal) { - // pass the signal to the process so we don't swallow it - int res; - if ((res = ptrace(PT_CONTINUE, pid, (caddr_t)1, signal)) < 0) { - print_error("attach: ptrace(PT_CONTINUE, %d) failed with %d\n", pid, res); + if (errno != 0) { + print_error("ptrace_attach: ptrace(PT_ATTACHEXC,...) failed: %s", strerror(errno)); return false; } return true; } -// waits until the ATTACH has stopped the process -// by signal SIGSTOP -static bool ptrace_waitpid(pid_t pid) { - int ret; - int status; - while (true) { - // Wait for debuggee to stop. - ret = waitpid(pid, &status, 0); - if (ret >= 0) { - if (WIFSTOPPED(status)) { - // Any signal will stop the thread, make sure it is SIGSTOP. Otherwise SIGSTOP - // will still be pending and delivered when the process is DETACHED and the process - // will go to sleep. - if (WSTOPSIG(status) == SIGSTOP) { - // Debuggee stopped by SIGSTOP. - return true; - } - if (!ptrace_continue(pid, WSTOPSIG(status))) { - print_error("attach: Failed to correctly attach to VM. VM might HANG! [PTRACE_CONT failed, stopped by %d]\n", WSTOPSIG(status)); - return false; - } - } else { - print_error("attach: waitpid(): Child process exited/terminated (status = 0x%x)\n", status); - return false; - } - } else { - switch (errno) { - case EINTR: - continue; - break; - case ECHILD: - print_error("attach: waitpid() failed. Child process pid (%d) does not exist \n", pid); - break; - case EINVAL: - print_error("attach: waitpid() failed. Invalid options argument.\n"); - break; - default: - print_error("attach: waitpid() failed. Unexpected error %d\n",errno); - break; - } - return false; - } - } +kern_return_t catch_mach_exception_raise( + mach_port_t exception_port, mach_port_t thread_port, mach_port_t task_port, + exception_type_t exception_type, mach_exception_data_t codes, + mach_msg_type_number_t num_codes) { + + print_debug("catch_mach_exception_raise: Exception port = %d thread_port = %d " + "task port %d exc type = %d num_codes %d\n", + exception_port, thread_port, task_port, exception_type, num_codes); + + // This message should denote a Unix soft signal, with + // 1. the exception type = EXC_SOFTWARE + // 2. codes[0] (which is the code) = EXC_SOFT_SIGNAL + // 3. codes[1] (which is the sub-code) = SIGSTOP + if (!(exception_type == EXC_SOFTWARE && + codes[0] == EXC_SOFT_SIGNAL && + codes[num_codes -1] == SIGSTOP)) { + print_error("catch_mach_exception_raise: Message doesn't denote a Unix " + "soft signal. exception_type = %d, codes[0] = %d, " + "codes[num_codes -1] = %d, num_codes = %d\n", + exception_type, codes[0], codes[num_codes - 1], num_codes); + return MACH_RCV_INVALID_TYPE; + } + return KERN_SUCCESS; +} + +kern_return_t catch_mach_exception_raise_state( + mach_port_t exception_port, exception_type_t exception, const mach_exception_data_t code, + mach_msg_type_number_t code_cnt, int *flavor, const thread_state_t old_state, + mach_msg_type_number_t old_state_cnt, thread_state_t new_state, + mach_msg_type_number_t *new_state_cnt) { + return MACH_RCV_INVALID_TYPE; } -// attach to a process/thread specified by "pid" -static bool ptrace_attach(pid_t pid) { - int res; -#ifdef __clang__ -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" -#endif - if ((res = ptrace(PT_ATTACH, pid, 0, 0)) < 0) { - print_error("ptrace(PT_ATTACH, %d) failed with %d\n", pid, res); -#ifdef __clang__ -#pragma clang diagnostic pop -#endif + +kern_return_t catch_mach_exception_raise_state_identity( + mach_port_t exception_port, mach_port_t thread, mach_port_t task, + exception_type_t exception, mach_exception_data_t code, + mach_msg_type_number_t code_cnt, int *flavor, + thread_state_t old_state, mach_msg_type_number_t old_state_cnt, + thread_state_t new_state, mach_msg_type_number_t *new_state_cnt) { + return MACH_RCV_INVALID_TYPE; +} + +// wait to receive an exception message +static bool wait_for_exception() { + kern_return_t result; + + result = mach_msg(&exc_msg.header, + MACH_RCV_MSG, + 0, + sizeof(exc_msg), + tgt_exception_port, + MACH_MSG_TIMEOUT_NONE, + MACH_PORT_NULL); + + if (result != MACH_MSG_SUCCESS) { + print_error("attach: wait_for_exception: mach_msg() failed: '%s' (%d)\n", + mach_error_string(result), result); + return false; + } + + if (mach_exc_server(&exc_msg.header, &rep_msg.header) == false || + rep_msg.ret_code != KERN_SUCCESS) { + print_error("attach: wait_for_exception: mach_exc_server failure\n"); + if (rep_msg.ret_code != KERN_SUCCESS) { + print_error("catch_mach_exception_raise() failed '%s' (%d)\n", + mach_error_string(rep_msg.ret_code), rep_msg.ret_code); + } return false; - } else { - return ptrace_waitpid(pid); } + + print_debug("reply msg from mach_exc_server: (msg->{bits = %#x, size = %u, " + "remote_port = %#x, local_port = %#x, reserved = 0x%x, id = 0x%x},)", + rep_msg.header.msgh_bits, rep_msg.header.msgh_size, + rep_msg.header.msgh_remote_port, rep_msg.header.msgh_local_port, + rep_msg.header.msgh_reserved, rep_msg.header.msgh_id); + + return true; } /* @@ -719,18 +795,97 @@ kern_return_t result; task_t gTask = 0; + result = task_for_pid(mach_task_self(), jpid, &gTask); if (result != KERN_SUCCESS) { print_error("attach: task_for_pid(%d) failed: '%s' (%d)\n", (int)jpid, mach_error_string(result), result); - THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process. Could be caused by an incorrect pid or lack of privileges."); + THROW_NEW_DEBUGGER_EXCEPTION( + "Can't attach to the process. Could be caused by an incorrect pid or lack of privileges."); } putTask(env, this_obj, gTask); + // Allocate an exception port. + result = mach_port_allocate(mach_task_self(), + MACH_PORT_RIGHT_RECEIVE, + &tgt_exception_port); + if (result != KERN_SUCCESS) { + print_error("attach: mach_port_allocate() for tgt_exception_port failed: '%s' (%d)\n", + mach_error_string(result), result); + THROW_NEW_DEBUGGER_EXCEPTION( + "Can't attach to the process. Couldn't allocate an exception port."); + } + + // Enable the new exception port to send messages. + result = mach_port_insert_right (mach_task_self(), + tgt_exception_port, + tgt_exception_port, + MACH_MSG_TYPE_MAKE_SEND); + if (result != KERN_SUCCESS) { + print_error("attach: mach_port_insert_right() failed for port 0x%x: '%s' (%d)\n", + tgt_exception_port, mach_error_string(result), result); + THROW_NEW_DEBUGGER_EXCEPTION( + "Can't attach to the process. Couldn't add send privileges to the exception port."); + } + + // Save the existing original exception ports registered with the target + // process (for later restoration while detaching from the process). + result = task_get_exception_ports(gTask, + EXC_MASK_ALL, + exception_saved_state.saved_masks, + &exception_saved_state.saved_exception_types_count, + exception_saved_state.saved_ports, + exception_saved_state.saved_behaviors, + exception_saved_state.saved_flavors); + + if (result != KERN_SUCCESS) { + print_error("attach: task_get_exception_ports() failed: '%s' (%d)\n", + mach_error_string(result), result); + THROW_NEW_DEBUGGER_EXCEPTION( + "Can't attach to the process. Could not get the target exception ports."); + } + + // register the exception port to be used for all future exceptions with the + // target process. + result = task_set_exception_ports(gTask, + EXC_MASK_ALL, + tgt_exception_port, + EXCEPTION_DEFAULT | MACH_EXCEPTION_CODES, + THREAD_STATE_NONE); + + if (result != KERN_SUCCESS) { + print_error("attach: task_set_exception_ports() failed -- port 0x%x: '%s' (%d)\n", + tgt_exception_port, mach_error_string(result), result); + mach_port_deallocate(mach_task_self(), gTask); + mach_port_deallocate(mach_task_self(), tgt_exception_port); + THROW_NEW_DEBUGGER_EXCEPTION( + "Can't attach to the process. Could not register the exception port " + "with the target process."); + } + // use ptrace to stop the process // on os x, ptrace only needs to be called on the process, not the individual threads if (ptrace_attach(jpid) != true) { + print_error("attach: ptrace failure in attaching to %d\n", (int)jpid); mach_port_deallocate(mach_task_self(), gTask); - THROW_NEW_DEBUGGER_EXCEPTION("Can't attach to the process"); + mach_port_deallocate(mach_task_self(), tgt_exception_port); + THROW_NEW_DEBUGGER_EXCEPTION("Can't ptrace attach to the process"); + } + + if (wait_for_exception() != true) { + mach_port_deallocate(mach_task_self(), gTask); + mach_port_deallocate(mach_task_self(), tgt_exception_port); + THROW_NEW_DEBUGGER_EXCEPTION( + "Can't attach to the process. Issues with reception of the exception message."); + } + + // suspend all the threads in the task + result = task_suspend(gTask); + if (result != KERN_SUCCESS) { + print_error("attach: task_suspend() failed: '%s' (%d)\n", + mach_error_string(result), result); + mach_port_deallocate(mach_task_self(), gTask); + mach_port_deallocate(mach_task_self(), tgt_exception_port); + THROW_NEW_DEBUGGER_EXCEPTION("Can't attach. Unable to suspend all the threads in the task."); } id symbolicator = nil; @@ -745,13 +900,15 @@ putSymbolicator(env, this_obj, symbolicator); if (symbolicator == nil) { + mach_port_deallocate(mach_task_self(), gTask); + mach_port_deallocate(mach_task_self(), tgt_exception_port); THROW_NEW_DEBUGGER_EXCEPTION("Can't attach symbolicator to the process"); } JNF_COCOA_EXIT(env); } -/** For core file, +/** For core file, called from Java_sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal_attach0__Ljava_lang_String_2Ljava_lang_String_2 */ static void fillLoadObjects(JNIEnv* env, jobject this_obj, struct ps_prochandle* ph) { int n = 0, i = 0; @@ -811,6 +968,19 @@ fillLoadObjects(env, this_obj, ph); } +static void detach_cleanup(task_t gTask, JNIEnv *env, jobject this_obj, bool throw_exception) { + mach_port_deallocate(mach_task_self(), tgt_exception_port); + mach_port_deallocate(mach_task_self(), gTask); + + id symbolicator = getSymbolicator(env, this_obj); + if (symbolicator != nil) { + CFRelease(symbolicator); + } + if (throw_exception) { + THROW_NEW_DEBUGGER_EXCEPTION("Cannot detach."); + } +} + /* * Class: sun_jvm_hotspot_debugger_bsd_BsdDebuggerLocal * Method: detach0 @@ -827,26 +997,55 @@ return; } JNF_COCOA_ENTER(env); + task_t gTask = getTask(env, this_obj); + kern_return_t k_res = 0; + + // Restore the pre-saved original exception ports registered with the target process + for (uint32_t i = 0; i < exception_saved_state.saved_exception_types_count; ++i) { + k_res = task_set_exception_ports(gTask, + exception_saved_state.saved_masks[i], + exception_saved_state.saved_ports[i], + exception_saved_state.saved_behaviors[i], + exception_saved_state.saved_flavors[i]); + if (k_res != KERN_SUCCESS) { + print_error("detach: task_set_exception_ports failed with %d while " + "restoring the target exception ports.\n", k_res); + detach_cleanup(gTask, env, this_obj, true); + } + } // detach from the ptraced process causing it to resume execution int pid; - kern_return_t k_res; k_res = pid_for_task(gTask, &pid); if (k_res != KERN_SUCCESS) { print_error("detach: pid_for_task(%d) failed (%d)\n", pid, k_res); + detach_cleanup(gTask, env, this_obj, true); } else { - int res = ptrace(PT_DETACH, pid, 0, 0); - if (res < 0) { - print_error("detach: ptrace(PT_DETACH, %d) failed (%d)\n", pid, res); + errno = 0; + ptrace(PT_DETACH, pid, (caddr_t)1, 0); + if (errno != 0) { + print_error("detach: ptrace(PT_DETACH,...) failed: %s", strerror(errno)); + detach_cleanup(gTask, env, this_obj, true); } } - mach_port_deallocate(mach_task_self(), gTask); - id symbolicator = getSymbolicator(env, this_obj); - if (symbolicator != nil) { - CFRelease(symbolicator); + // reply to the previous exception message + k_res = mach_msg(&rep_msg.header, + MACH_SEND_MSG| MACH_SEND_INTERRUPT, + rep_msg.header.msgh_size, + 0, + MACH_PORT_NULL, + MACH_MSG_TIMEOUT_NONE, + MACH_PORT_NULL); + if (k_res != MACH_MSG_SUCCESS) { + print_error("detach: mach_msg() for replying to pending exceptions failed: '%s' (%d)\n", + mach_error_string(k_res), k_res); + detach_cleanup(gTask, env, this_obj, true); } + + detach_cleanup(gTask, env, this_obj, false); + JNF_COCOA_EXIT(env); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.aarch64/src/jdk/vm/ci/aarch64/AArch64Kind.java 2018-07-25 15:36:46.000000000 +0000 @@ -71,14 +71,17 @@ return scalar; } + @Override public int getSizeInBytes() { return size; } + @Override public int getVectorLength() { return vectorLength; } + @Override public Key getKey() { return key; } @@ -116,6 +119,7 @@ } } + @Override public char getTypeChar() { switch (this) { case BYTE: diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.amd64/src/jdk/vm/ci/amd64/AMD64Kind.java 2018-07-25 15:36:46.000000000 +0000 @@ -92,14 +92,17 @@ return scalar; } + @Override public int getSizeInBytes() { return size; } + @Override public int getVectorLength() { return vectorLength; } + @Override public Key getKey() { return key; } @@ -161,6 +164,7 @@ } } + @Override public char getTypeChar() { switch (this) { case BYTE: diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/CodeUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -371,6 +371,7 @@ public static class NumberedRefMapFormatter implements RefMapFormatter { + @Override public String formatStackSlot(int frameRefMapIndex) { return "s" + frameRefMapIndex; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterArray.java 2018-07-25 15:36:46.000000000 +0000 @@ -78,6 +78,7 @@ return registers.clone(); } + @Override public Iterator<Register> iterator() { return Arrays.asList(registers).iterator(); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.code/src/jdk/vm/ci/code/RegisterConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -75,11 +75,7 @@ /** * Gets the set of all registers that might be used by the register allocator. - * - * To get the set of registers the register allocator is allowed to use see - * {@link RegisterAllocationConfig#getAllocatableRegisters()} */ - @SuppressWarnings("javadoc") RegisterArray getAllocatableRegisters(); /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/InitTimer.java 2018-07-25 15:36:46.000000000 +0000 @@ -46,6 +46,7 @@ System.out.println("START: " + SPACES.substring(0, n * 2) + name); } + @Override @SuppressFBWarnings(value = "ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD", justification = "only the initializing thread accesses this field") public void close() { final long end = System.currentTimeMillis(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/NativeImageReinitialize.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/NativeImageReinitialize.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/NativeImageReinitialize.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.common/src/jdk/vm/ci/common/NativeImageReinitialize.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.common; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * Denotes a field that should have the default value for its type when building a native image. + */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.FIELD}) +public @interface NativeImageReinitialize { +} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/EmptyEventProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,45 +38,56 @@ } static class EmptyCompilationEvent implements CompilationEvent { + @Override public void commit() { throw shouldNotReachHere(); } + @Override public boolean shouldWrite() { // Events of this class should never been written. return false; } + @Override public void begin() { } + @Override public void end() { } + @Override public void setMethod(String method) { throw shouldNotReachHere(); } + @Override public void setCompileId(int compileId) { throw shouldNotReachHere(); } + @Override public void setCompileLevel(int compileLevel) { throw shouldNotReachHere(); } + @Override public void setSucceeded(boolean succeeded) { throw shouldNotReachHere(); } + @Override public void setIsOsr(boolean isOsr) { throw shouldNotReachHere(); } + @Override public void setCodeSize(int codeSize) { throw shouldNotReachHere(); } + @Override public void setInlinedBytes(int inlinedBytes) { throw shouldNotReachHere(); } @@ -88,19 +99,23 @@ } static class EmptyCompilerFailureEvent implements CompilerFailureEvent { + @Override public void commit() { throw shouldNotReachHere(); } + @Override public boolean shouldWrite() { // Events of this class should never been written. return false; } + @Override public void setCompileId(int compileId) { throw shouldNotReachHere(); } + @Override public void setMessage(String message) { throw shouldNotReachHere(); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCodeCacheProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,12 +41,12 @@ */ public class HotSpotCodeCacheProvider implements CodeCacheProvider { - protected final HotSpotJVMCIRuntimeProvider runtime; + protected final HotSpotJVMCIRuntime runtime; protected final HotSpotVMConfig config; protected final TargetDescription target; protected final RegisterConfig regConfig; - public HotSpotCodeCacheProvider(HotSpotJVMCIRuntimeProvider runtime, HotSpotVMConfig config, TargetDescription target, RegisterConfig regConfig) { + public HotSpotCodeCacheProvider(HotSpotJVMCIRuntime runtime, HotSpotVMConfig config, TargetDescription target, RegisterConfig regConfig) { this.runtime = runtime; this.config = config; this.target = target; @@ -95,10 +95,11 @@ } private InstalledCode logOrDump(InstalledCode installedCode, CompiledCode compiledCode) { - ((HotSpotJVMCIRuntime) runtime).notifyInstall(this, installedCode, compiledCode); + runtime.notifyInstall(this, installedCode, compiledCode); return installedCode; } + @Override public InstalledCode installCode(ResolvedJavaMethod method, CompiledCode compiledCode, InstalledCode installedCode, SpeculationLog log, boolean isDefault) { InstalledCode resultInstalledCode; if (installedCode == null) { @@ -136,6 +137,7 @@ return logOrDump(resultInstalledCode, compiledCode); } + @Override public void invalidateInstalledCode(InstalledCode installedCode) { runtime.getCompilerToVM().invalidateInstalledCode(installedCode); } @@ -152,14 +154,17 @@ return null; } + @Override public SpeculationLog createSpeculationLog() { return new HotSpotSpeculationLog(); } + @Override public long getMaxCallTargetOffset(long address) { return runtime.getCompilerToVM().getMaxCallTargetOffset(address); } + @Override public boolean shouldDebugNonSafepoints() { return runtime.getCompilerToVM().shouldDebugNonSafepoints(); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompilationRequestResult.java 2018-07-25 15:36:46.000000000 +0000 @@ -58,6 +58,7 @@ this.inlinedBytecodes = inlinedBytecodes; } + @Override public Object getFailure() { return failureMessage; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotCompressedNullConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,6 +36,7 @@ private HotSpotCompressedNullConstant() { } + @Override public JavaKind getJavaKind() { return JavaKind.Object; } @@ -50,10 +51,12 @@ return true; } + @Override public Constant compress() { throw new IllegalArgumentException(); } + @Override public Constant uncompress() { return NULL_POINTER; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,6 +38,9 @@ import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Signature; +import jdk.vm.ci.meta.UnresolvedJavaField; +import jdk.vm.ci.meta.UnresolvedJavaMethod; +import jdk.vm.ci.meta.UnresolvedJavaType; /** * Implementation of {@link ConstantPool} for HotSpot. @@ -567,7 +570,7 @@ private static JavaType getJavaType(final Object type) { if (type instanceof String) { String name = (String) type; - return HotSpotUnresolvedJavaType.create(runtime(), "L" + name + ";"); + return UnresolvedJavaType.create("L" + name + ";"); } else { return (JavaType) type; } @@ -585,12 +588,12 @@ HotSpotSignature signature = new HotSpotSignature(runtime(), getSignatureOf(index)); if (opcode == Bytecodes.INVOKEDYNAMIC) { HotSpotResolvedObjectType holder = HotSpotResolvedObjectTypeImpl.fromObjectClass(MethodHandle.class); - return new HotSpotMethodUnresolved(name, signature, holder); + return new UnresolvedJavaMethod(name, signature, holder); } else { final int klassIndex = getKlassRefIndexAt(index); final Object type = compilerToVM().lookupKlassInPool(this, klassIndex); JavaType holder = getJavaType(type); - return new HotSpotMethodUnresolved(name, signature, holder); + return new UnresolvedJavaMethod(name, signature, holder); } } } @@ -631,7 +634,7 @@ * If there was an exception resolving the field we give up and return an unresolved * field. */ - return new HotSpotUnresolvedField(holder, lookupUtf8(getNameRefIndexAt(nameAndTypeIndex)), type); + return new UnresolvedJavaField(holder, lookupUtf8(getNameRefIndexAt(nameAndTypeIndex)), type); } final int flags = info[0]; final int offset = info[1]; @@ -639,7 +642,7 @@ HotSpotResolvedJavaField result = resolvedHolder.createField(type, offset, flags, fieldIndex); return result; } else { - return new HotSpotUnresolvedField(holder, lookupUtf8(getNameRefIndexAt(nameAndTypeIndex)), type); + return new UnresolvedJavaField(holder, lookupUtf8(getNameRefIndexAt(nameAndTypeIndex)), type); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantReflectionProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,16 +40,17 @@ */ public class HotSpotConstantReflectionProvider implements ConstantReflectionProvider { - protected final HotSpotJVMCIRuntimeProvider runtime; + protected final HotSpotJVMCIRuntime runtime; protected final HotSpotMethodHandleAccessProvider methodHandleAccess; protected final HotSpotMemoryAccessProviderImpl memoryAccess; - public HotSpotConstantReflectionProvider(HotSpotJVMCIRuntimeProvider runtime) { + public HotSpotConstantReflectionProvider(HotSpotJVMCIRuntime runtime) { this.runtime = runtime; this.methodHandleAccess = new HotSpotMethodHandleAccessProvider(this); this.memoryAccess = new HotSpotMemoryAccessProviderImpl(runtime); } + @Override public MethodHandleAccessProvider getMethodHandleAccess() { return methodHandleAccess; } @@ -149,6 +150,7 @@ return JavaConstant.forBoxedPrimitive(((HotSpotObjectConstantImpl) source).object()); } + @Override public JavaConstant forString(String value) { return HotSpotObjectConstantImpl.forObject(value); } @@ -174,6 +176,7 @@ return null; } + @Override public JavaConstant readFieldValue(ResolvedJavaField field, JavaConstant receiver) { HotSpotResolvedJavaField hotspotField = (HotSpotResolvedJavaField) field; if (hotspotField.isStatic()) { @@ -184,7 +187,7 @@ } else { if (receiver.isNonNull()) { Object object = ((HotSpotObjectConstantImpl) receiver).object(); - if (hotspotField.isInObject(object)) { + if (hotspotField.isInObject(receiver)) { return memoryAccess.readFieldValue(hotspotField, object); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIBackendFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,7 @@ public interface HotSpotJVMCIBackendFactory { - JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host); + JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntime runtime, JVMCIBackend host); /** * Gets the CPU architecture of this backend. diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,6 +41,7 @@ */ private static class DummyCompilerFactory implements JVMCICompilerFactory, JVMCICompiler { + @Override public HotSpotCompilationRequestResult compileMethod(CompilationRequest request) { throw new JVMCIError("no JVMCI compiler selected"); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCICompilerFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,7 @@ */ package jdk.vm.ci.hotspot; +import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.runtime.JVMCICompilerFactory; /** @@ -29,18 +30,6 @@ */ public abstract class HotSpotJVMCICompilerFactory implements JVMCICompilerFactory { - /** - * Gets 0 or more prefixes identifying classes that should by compiled by C1 in simple mode - * (i.e., {@code CompLevel_simple}) when HotSpot is running with tiered compilation. The - * prefixes should be class or package names using "/" as the separator, e.g. "jdk/vm/ci". - * - * @return 0 or more Strings identifying packages that should by compiled by the first tier only - * or null if no redirection to C1 should be performed. - */ - public String[] getTrivialPrefixes() { - return null; - } - public enum CompilationLevelAdjustment { /** * No adjustment. @@ -78,7 +67,9 @@ * Potentially modifies the compilation level currently selected by the VM compilation policy * for a method. * - * @param declaringClass the class in which the method is declared + * @param declaringClass the class in which the method is declared. This value is either a + * {@code Class} instance or a {@code String} representing the + * {@link JavaType#toJavaName() name} of the class. * @param name the name of the method or {@code null} depending on the value that was returned * by {@link #getCompilationLevelAdjustment()} * @param signature the signature of the method or {@code null} depending on the value that was @@ -88,7 +79,8 @@ * @return the compilation level to use for the compilation being scheduled (must be a valid * {@code CompLevel} enum value) */ - public CompilationLevel adjustCompilationLevel(Class<?> declaringClass, String name, String signature, boolean isOsr, CompilationLevel level) { - throw new InternalError("Should not reach here"); + public CompilationLevel adjustCompilationLevel(Object declaringClass, String name, String signature, boolean isOsr, CompilationLevel level) { + throw new InternalError(getClass().getName() + " must override adjustCompilationLevel(...) since it returned a value other than " + CompilationLevel.class.getName() + "." + + CompilationLevel.None + " from getCompilationLevelAdjustment()"); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIMetaAccessContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -44,7 +44,7 @@ * longer used. * */ -public class HotSpotJVMCIMetaAccessContext { +class HotSpotJVMCIMetaAccessContext { /** * The set of currently live contexts used for tracking of live metadata. Examined from the VM @@ -207,6 +207,7 @@ return head; } + @Override public Iterator<T> iterator() { return new ChunkIterator<>(); } @@ -244,10 +245,12 @@ return result; } + @Override public boolean hasNext() { return next != null; } + @Override public V next() { V result = next; next = findNext(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntime.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,15 +27,20 @@ import java.io.IOException; import java.io.OutputStream; import java.io.PrintStream; +import java.lang.module.ModuleDescriptor.Requires; import java.util.Collections; import java.util.HashMap; +import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.ServiceLoader; +import java.util.Set; import java.util.TreeMap; +import java.util.function.Predicate; import jdk.internal.misc.VM; +import jdk.internal.misc.Unsafe; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.code.CompilationRequestResult; import jdk.vm.ci.code.CompiledCode; @@ -46,10 +51,12 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.vm.ci.meta.UnresolvedJavaType; import jdk.vm.ci.runtime.JVMCI; import jdk.vm.ci.runtime.JVMCIBackend; import jdk.vm.ci.runtime.JVMCICompiler; import jdk.vm.ci.runtime.JVMCICompilerFactory; +import jdk.vm.ci.runtime.JVMCIRuntime; import jdk.vm.ci.services.JVMCIServiceLocator; /** @@ -62,7 +69,7 @@ * {@link #runtime()}. This allows the initialization to funnel back through * {@link JVMCI#initialize()} without deadlocking. */ -public final class HotSpotJVMCIRuntime implements HotSpotJVMCIRuntimeProvider { +public final class HotSpotJVMCIRuntime implements JVMCIRuntime { @SuppressWarnings("try") static class DelayedInit { @@ -216,7 +223,7 @@ } } - public static HotSpotJVMCIBackendFactory findFactory(String architecture) { + static HotSpotJVMCIBackendFactory findFactory(String architecture) { for (HotSpotJVMCIBackendFactory factory : ServiceLoader.load(HotSpotJVMCIBackendFactory.class, ClassLoader.getSystemClassLoader())) { if (factory.getArchitecture().equalsIgnoreCase(architecture)) { return factory; @@ -265,12 +272,6 @@ return vmEventListeners; } - /** - * Stores the result of {@link HotSpotJVMCICompilerFactory#getTrivialPrefixes()} so that it can - * be read from the VM. - */ - @SuppressWarnings("unused") private final String[] trivialPrefixes; - @SuppressWarnings("try") private HotSpotJVMCIRuntime() { compilerToVm = new CompilerToVM(); @@ -296,7 +297,6 @@ compilerFactory = HotSpotJVMCICompilerConfig.getCompilerFactory(); if (compilerFactory instanceof HotSpotJVMCICompilerFactory) { hsCompilerFactory = (HotSpotJVMCICompilerFactory) compilerFactory; - trivialPrefixes = hsCompilerFactory.getTrivialPrefixes(); switch (hsCompilerFactory.getCompilationLevelAdjustment()) { case None: compilationLevelAdjustment = config.compLevelAdjustmentNone; @@ -313,7 +313,6 @@ } } else { hsCompilerFactory = null; - trivialPrefixes = null; compilationLevelAdjustment = config.compLevelAdjustmentNone; } @@ -336,7 +335,7 @@ return backend; } - public ResolvedJavaType fromClass(Class<?> javaClass) { + ResolvedJavaType fromClass(Class<?> javaClass) { return metaAccessContext.fromClass(javaClass); } @@ -352,6 +351,73 @@ return compilerToVm; } + // Non-volatile since multi-initialization is harmless + private Predicate<ResolvedJavaType> intrinsificationTrustPredicate; + + /** + * Gets a predicate that determines if a given type can be considered trusted for the purpose of + * intrinsifying methods it declares. + * + * @param compilerLeafClasses classes in the leaves of the module graph comprising the JVMCI + * compiler. + */ + public Predicate<ResolvedJavaType> getIntrinsificationTrustPredicate(Class<?>... compilerLeafClasses) { + if (intrinsificationTrustPredicate == null) { + intrinsificationTrustPredicate = new Predicate<ResolvedJavaType>() { + @Override + public boolean test(ResolvedJavaType type) { + if (type instanceof HotSpotResolvedJavaType) { + Class<?> mirror = getMirror((HotSpotResolvedJavaType) type); + Module module = mirror.getModule(); + return getTrustedModules().contains(module); + } else { + return false; + } + } + + private volatile Set<Module> trustedModules; + + private Set<Module> getTrustedModules() { + Set<Module> modules = trustedModules; + if (modules == null) { + modules = new HashSet<>(); + for (Class<?> compilerConfiguration : compilerLeafClasses) { + Module compilerConfigurationModule = compilerConfiguration.getModule(); + if (compilerConfigurationModule.getDescriptor().isAutomatic()) { + throw new IllegalArgumentException(String.format("The module '%s' defining the Graal compiler configuration class '%s' must not be an automatic module", + compilerConfigurationModule.getName(), compilerConfiguration.getClass().getName())); + } + modules.add(compilerConfigurationModule); + for (Requires require : compilerConfigurationModule.getDescriptor().requires()) { + for (Module module : compilerConfigurationModule.getLayer().modules()) { + if (module.getName().equals(require.name())) { + modules.add(module); + } + } + } + } + trustedModules = modules; + } + return modules; + } + }; + } + return intrinsificationTrustPredicate; + } + + /** + * Get the {@link Class} corresponding to {@code type}. + * + * @param type the type for which a {@link Class} is requested + * @return the original Java class corresponding to {@code type} or {@code null} if this runtime + * does not support mapping {@link ResolvedJavaType} instances to {@link Class} + * instances + */ + public Class<?> getMirror(ResolvedJavaType type) { + return ((HotSpotResolvedJavaType) type).mirror(); + } + + @Override public JVMCICompiler getCompiler() { if (compiler == null) { synchronized (this) { @@ -363,6 +429,19 @@ return compiler; } + /** + * Converts a name to a Java type. This method attempts to resolve {@code name} to a + * {@link ResolvedJavaType}. + * + * @param name a well formed Java type in {@linkplain JavaType#getName() internal} format + * @param accessingType the context of resolution which must be non-null + * @param resolve specifies whether resolution failure results in an unresolved type being + * return or a {@link LinkageError} being thrown + * @return a Java type for {@code name} which is guaranteed to be of type + * {@link ResolvedJavaType} if {@code resolve == true} + * @throws LinkageError if {@code resolve == true} and the resolution failed + * @throws NullPointerException if {@code accessingClass} is {@code null} + */ public JavaType lookupType(String name, HotSpotResolvedObjectType accessingType, boolean resolve) { Objects.requireNonNull(accessingType, "cannot resolve type without an accessing class"); // If the name represents a primitive type we can short-circuit the lookup. @@ -378,7 +457,7 @@ if (klass == null) { assert resolve == false; - return HotSpotUnresolvedJavaType.create(this, name); + return UnresolvedJavaType.create(name); } return klass; } catch (ClassNotFoundException e) { @@ -386,10 +465,12 @@ } } + @Override public JVMCIBackend getHostJVMCIBackend() { return hostBackend; } + @Override public <T extends Architecture> JVMCIBackend getJVMCIBackend(Class<T> arch) { assert arch != Architecture.class; return backends.get(arch); @@ -531,6 +612,9 @@ } } + /** + * Gets an output stream that writes to HotSpot's {@code tty} stream. + */ public OutputStream getLogStream() { return new OutputStream() { @@ -564,4 +648,118 @@ public long[] collectCounters() { return compilerToVm.collectCounters(); } + + /** + * The offset from the origin of an array to the first element. + * + * @return the offset in bytes + */ + public int getArrayBaseOffset(JavaKind kind) { + switch (kind) { + case Boolean: + return Unsafe.ARRAY_BOOLEAN_BASE_OFFSET; + case Byte: + return Unsafe.ARRAY_BYTE_BASE_OFFSET; + case Char: + return Unsafe.ARRAY_CHAR_BASE_OFFSET; + case Short: + return Unsafe.ARRAY_SHORT_BASE_OFFSET; + case Int: + return Unsafe.ARRAY_INT_BASE_OFFSET; + case Long: + return Unsafe.ARRAY_LONG_BASE_OFFSET; + case Float: + return Unsafe.ARRAY_FLOAT_BASE_OFFSET; + case Double: + return Unsafe.ARRAY_DOUBLE_BASE_OFFSET; + case Object: + return Unsafe.ARRAY_OBJECT_BASE_OFFSET; + default: + throw new JVMCIError("%s", kind); + } + + } + + /** + * The scale used for the index when accessing elements of an array of this kind. + * + * @return the scale in order to convert the index into a byte offset + */ + public int getArrayIndexScale(JavaKind kind) { + switch (kind) { + case Boolean: + return Unsafe.ARRAY_BOOLEAN_INDEX_SCALE; + case Byte: + return Unsafe.ARRAY_BYTE_INDEX_SCALE; + case Char: + return Unsafe.ARRAY_CHAR_INDEX_SCALE; + case Short: + return Unsafe.ARRAY_SHORT_INDEX_SCALE; + case Int: + return Unsafe.ARRAY_INT_INDEX_SCALE; + case Long: + return Unsafe.ARRAY_LONG_INDEX_SCALE; + case Float: + return Unsafe.ARRAY_FLOAT_INDEX_SCALE; + case Double: + return Unsafe.ARRAY_DOUBLE_INDEX_SCALE; + case Object: + return Unsafe.ARRAY_OBJECT_INDEX_SCALE; + default: + throw new JVMCIError("%s", kind); + + } + } + + /** + * Links each native method in {@code clazz} to an implementation in the JVMCI SVM library. + * <p> + * A use case for this is a JVMCI compiler implementation that offers an API to Java code + * executing in HotSpot to exercise functionality (mostly) in the JVMCI SVM library. For + * example: + * + * <pre> + * package com.jcompile; + * + * import java.lang.reflect.Method; + * + * public static class JCompile { + * static { + * HotSpotJVMCIRuntime.runtime().registerNativeMethods(JCompile.class); + * } + * public static boolean compile(Method method, String[] options) { + * // Convert to simpler data types for passing/serializing across native interface + * long metaspaceMethodHandle = getHandle(method); + * char[] opts = convertToCharArray(options); + * return compile(metaspaceMethodHandle, opts); + * } + * private static native boolean compile0(long metaspaceMethodHandle, char[] options); + * + * private static long getHandle(Method method) { ... } + * private static char[] convertToCharArray(String[] a) { ... } + * } + * </pre> + * + * The implementation of the native {@code JCompile.compile0} method would be in the SVM library + * that contains the bulk of the JVMCI compiler. The {@code JCompile.compile0} implementation + * will be exported as the following JNI-compliant symbol: + * + * <pre> + * Java_com_jcompile_JCompile_compile0 + * </pre> + * + * How the JVMCI compiler SVM library is built is outside the scope of this document. + * + * @see "https://docs.oracle.com/javase/10/docs/specs/jni/design.html#resolving-native-method-names" + * + * @throws NullPointerException if {@code clazz == null} + * @throws IllegalArgumentException if the current execution context is SVM or if {@code clazz} + * is {@link Class#isPrimitive()} + * @throws UnsatisfiedLinkError if the JVMCI SVM library is not available, a native method in + * {@code clazz} is already linked or the SVM JVMCI library does not contain a + * JNI-compliant symbol for a native method in {@code clazz} + */ + public void registerNativeMethods(Class<?> clazz) { + throw new UnsatisfiedLinkError("SVM library is not available"); + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotJVMCIRuntimeProvider.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.hotspot; - -import java.io.OutputStream; - -import jdk.internal.misc.Unsafe; -import jdk.vm.ci.common.JVMCIError; -import jdk.vm.ci.meta.JavaKind; -import jdk.vm.ci.meta.JavaType; -import jdk.vm.ci.meta.ResolvedJavaType; -import jdk.vm.ci.runtime.JVMCIRuntime; - -/** - * Configuration information for the HotSpot JVMCI runtime. - */ -public interface HotSpotJVMCIRuntimeProvider extends JVMCIRuntime { - - HotSpotVMConfigStore getConfigStore(); - - HotSpotVMConfig getConfig(); - - CompilerToVM getCompilerToVM(); - - /** - * Gets an output stream that writes to the HotSpot's {@code tty} stream. - */ - OutputStream getLogStream(); - - /** - * Converts a name to a Java type. This method attempts to resolve {@code name} to a - * {@link ResolvedJavaType}. - * - * @param name a well formed Java type in {@linkplain JavaType#getName() internal} format - * @param accessingType the context of resolution which must be non-null - * @param resolve specifies whether resolution failure results in an unresolved type being - * return or a {@link LinkageError} being thrown - * @return a Java type for {@code name} which is guaranteed to be of type - * {@link ResolvedJavaType} if {@code resolve == true} - * @throws LinkageError if {@code resolve == true} and the resolution failed - * @throws NullPointerException if {@code accessingClass} is {@code null} - */ - JavaType lookupType(String name, HotSpotResolvedObjectType accessingType, boolean resolve); - - /** - * Gets the JVMCI mirror for a {@link Class} object. - * - * @return the {@link ResolvedJavaType} corresponding to {@code javaClass} - */ - ResolvedJavaType fromClass(Class<?> clazz); - - /** - * The offset from the origin of an array to the first element. - * - * @return the offset in bytes - */ - static int getArrayBaseOffset(JavaKind kind) { - switch (kind) { - case Boolean: - return Unsafe.ARRAY_BOOLEAN_BASE_OFFSET; - case Byte: - return Unsafe.ARRAY_BYTE_BASE_OFFSET; - case Char: - return Unsafe.ARRAY_CHAR_BASE_OFFSET; - case Short: - return Unsafe.ARRAY_SHORT_BASE_OFFSET; - case Int: - return Unsafe.ARRAY_INT_BASE_OFFSET; - case Long: - return Unsafe.ARRAY_LONG_BASE_OFFSET; - case Float: - return Unsafe.ARRAY_FLOAT_BASE_OFFSET; - case Double: - return Unsafe.ARRAY_DOUBLE_BASE_OFFSET; - case Object: - return Unsafe.ARRAY_OBJECT_BASE_OFFSET; - default: - throw new JVMCIError("%s", kind); - } - } - - /** - * The scale used for the index when accessing elements of an array of this kind. - * - * @return the scale in order to convert the index into a byte offset - */ - static int getArrayIndexScale(JavaKind kind) { - switch (kind) { - case Boolean: - return Unsafe.ARRAY_BOOLEAN_INDEX_SCALE; - case Byte: - return Unsafe.ARRAY_BYTE_INDEX_SCALE; - case Char: - return Unsafe.ARRAY_CHAR_INDEX_SCALE; - case Short: - return Unsafe.ARRAY_SHORT_INDEX_SCALE; - case Int: - return Unsafe.ARRAY_INT_INDEX_SCALE; - case Long: - return Unsafe.ARRAY_LONG_INDEX_SCALE; - case Float: - return Unsafe.ARRAY_FLOAT_INDEX_SCALE; - case Double: - return Unsafe.ARRAY_DOUBLE_INDEX_SCALE; - case Object: - return Unsafe.ARRAY_OBJECT_INDEX_SCALE; - default: - throw new JVMCIError("%s", kind); - } - } -} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMemoryAccessProviderImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,8 +22,6 @@ */ package jdk.vm.ci.hotspot; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; import java.lang.reflect.Array; @@ -43,9 +41,9 @@ */ class HotSpotMemoryAccessProviderImpl implements HotSpotMemoryAccessProvider { - protected final HotSpotJVMCIRuntimeProvider runtime; + protected final HotSpotJVMCIRuntime runtime; - HotSpotMemoryAccessProviderImpl(HotSpotJVMCIRuntimeProvider runtime) { + HotSpotMemoryAccessProviderImpl(HotSpotJVMCIRuntime runtime) { this.runtime = runtime; } @@ -62,7 +60,7 @@ HotSpotObjectConstantImpl constant = (HotSpotObjectConstantImpl) base; HotSpotResolvedObjectType type = constant.getType(); Object object = constant.object(); - checkRead(kind, displacement, type, object); + checkRead(kind, displacement, type, object, runtime.getHostJVMCIBackend().getMetaAccess()); return object; } return null; @@ -74,12 +72,12 @@ */ private long oopSizeOffset; - private static int computeOopSizeOffset(HotSpotJVMCIRuntimeProvider runtime) { + private static int computeOopSizeOffset(HotSpotJVMCIRuntime runtime) { MetaAccessProvider metaAccess = runtime.getHostJVMCIBackend().getMetaAccess(); ResolvedJavaType staticType = metaAccess.lookupJavaType(Class.class); for (ResolvedJavaField f : staticType.getInstanceFields(false)) { if (f.getName().equals("oop_size")) { - int offset = ((HotSpotResolvedJavaField) f).offset(); + int offset = ((HotSpotResolvedJavaField) f).getOffset(); assert offset != 0 : "not expecting offset of java.lang.Class::oop_size to be 0"; return offset; } @@ -87,12 +85,12 @@ throw new JVMCIError("Could not find injected java.lang.Class::oop_size field"); } - private boolean checkRead(JavaKind kind, long displacement, HotSpotResolvedObjectType type, Object object) { + private boolean checkRead(JavaKind kind, long displacement, HotSpotResolvedObjectType type, Object object, MetaAccessProvider metaAccess) { if (type.isArray()) { ResolvedJavaType componentType = type.getComponentType(); JavaKind componentKind = componentType.getJavaKind(); - final int headerSize = getArrayBaseOffset(componentKind); - int sizeOfElement = getArrayIndexScale(componentKind); + final int headerSize = metaAccess.getArrayBaseOffset(componentKind); + int sizeOfElement = metaAccess.getArrayIndexScale(componentKind); int length = Array.getLength(object); long arrayEnd = headerSize + (sizeOfElement * length); boolean aligned = ((displacement - headerSize) % sizeOfElement) == 0; @@ -122,7 +120,6 @@ ResolvedJavaField field = type.findInstanceFieldWithOffset(displacement, JavaKind.Object); if (field == null && object instanceof Class) { // Read of a static field - MetaAccessProvider metaAccess = runtime.getHostJVMCIBackend().getMetaAccess(); HotSpotResolvedObjectTypeImpl staticFieldsHolder = (HotSpotResolvedObjectTypeImpl) metaAccess.lookupJavaType((Class<?>) object); field = staticFieldsHolder.findStaticFieldWithOffset(displacement, JavaKind.Object); } @@ -214,8 +211,9 @@ JavaConstant readFieldValue(HotSpotResolvedJavaField field, Object obj) { assert obj != null; assert !field.isStatic() || obj instanceof Class; - long displacement = field.offset(); - assert checkRead(field.getJavaKind(), displacement, (HotSpotResolvedObjectType) runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType(obj.getClass()), obj); + long displacement = field.getOffset(); + assert checkRead(field.getJavaKind(), displacement, (HotSpotResolvedObjectType) runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType(obj.getClass()), obj, + runtime.getHostJVMCIBackend().getMetaAccess()); if (field.getJavaKind() == JavaKind.Object) { Object o = UNSAFE.getObject(obj, displacement); return HotSpotObjectConstantImpl.forObject(o); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaAccessProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,8 +22,6 @@ */ package jdk.vm.ci.hotspot; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import static jdk.vm.ci.hotspot.HotSpotResolvedObjectTypeImpl.fromObjectClass; import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; @@ -44,6 +42,7 @@ import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Signature; +import jdk.vm.ci.meta.SpeculationLog; // JaCoCo Exclude @@ -52,12 +51,13 @@ */ public class HotSpotMetaAccessProvider implements MetaAccessProvider { - protected final HotSpotJVMCIRuntimeProvider runtime; + protected final HotSpotJVMCIRuntime runtime; - public HotSpotMetaAccessProvider(HotSpotJVMCIRuntimeProvider runtime) { + public HotSpotMetaAccessProvider(HotSpotJVMCIRuntime runtime) { this.runtime = runtime; } + @Override public ResolvedJavaType lookupJavaType(Class<?> clazz) { if (clazz == null) { throw new IllegalArgumentException("Class parameter was null"); @@ -65,6 +65,7 @@ return runtime.fromClass(clazz); } + @Override public HotSpotResolvedObjectType lookupJavaType(JavaConstant constant) { if (constant.isNull() || !(constant instanceof HotSpotObjectConstant)) { return null; @@ -72,14 +73,17 @@ return ((HotSpotObjectConstant) constant).getType(); } + @Override public Signature parseMethodDescriptor(String signature) { return new HotSpotSignature(runtime, signature); } + @Override public ResolvedJavaMethod lookupJavaMethod(Executable reflectionMethod) { return runtime.getCompilerToVM().asResolvedJavaMethod(Objects.requireNonNull(reflectionMethod)); } + @Override public ResolvedJavaField lookupJavaField(Field reflectionField) { Class<?> fieldHolder = reflectionField.getDeclaringClass(); @@ -87,14 +91,14 @@ if (Modifier.isStatic(reflectionField.getModifiers())) { final long offset = UNSAFE.staticFieldOffset(reflectionField); for (ResolvedJavaField field : holder.getStaticFields()) { - if (offset == ((HotSpotResolvedJavaField) field).offset()) { + if (offset == ((HotSpotResolvedJavaField) field).getOffset()) { return field; } } } else { final long offset = UNSAFE.objectFieldOffset(reflectionField); for (ResolvedJavaField field : holder.getInstanceFields(false)) { - if (offset == ((HotSpotResolvedJavaField) field).offset()) { + if (offset == ((HotSpotResolvedJavaField) field).getOffset()) { return field; } } @@ -120,6 +124,7 @@ return c; } + @Override public DeoptimizationReason decodeDeoptReason(JavaConstant constant) { HotSpotVMConfig config = runtime.getConfig(); int reasonValue = ((~constant.asInt()) >> config.deoptimizationReasonShift) & intMaskRight(config.deoptimizationReasonBits); @@ -127,6 +132,7 @@ return reason; } + @Override public DeoptimizationAction decodeDeoptAction(JavaConstant constant) { HotSpotVMConfig config = runtime.getConfig(); int actionValue = ((~constant.asInt()) >> config.deoptimizationActionShift) & intMaskRight(config.deoptimizationActionBits); @@ -134,11 +140,29 @@ return action; } + @Override public int decodeDebugId(JavaConstant constant) { HotSpotVMConfig config = runtime.getConfig(); return ((~constant.asInt()) >> config.deoptimizationDebugIdShift) & intMaskRight(config.deoptimizationDebugIdBits); } + @Override + public JavaConstant encodeSpeculation(SpeculationLog.Speculation speculation) { + if (speculation.getReason() instanceof SpeculationLog.NoSpeculationReason) { + return JavaConstant.LONG_0; + } + return ((HotSpotSpeculationLog.HotSpotSpeculation) speculation).getEncoding(); + } + + @Override + public SpeculationLog.Speculation decodeSpeculation(JavaConstant constant, SpeculationLog speculationLog) { + if (constant.equals(JavaConstant.LONG_0)) { + return SpeculationLog.NO_SPECULATION; + } + assert speculationLog != null : "Must have a speculation log"; + return speculationLog.lookupSpeculation(constant); + } + public int convertDeoptAction(DeoptimizationAction action) { HotSpotVMConfig config = runtime.getConfig(); switch (action) { @@ -311,4 +335,14 @@ int mask = ~(alignment - 1); return size & mask; } + + @Override + public int getArrayBaseOffset(JavaKind kind) { + return runtime.getArrayBaseOffset(kind); + } + + @Override + public int getArrayIndexScale(JavaKind kind) { + return runtime.getArrayIndexScale(kind); + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMetaspaceConstantImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -73,14 +73,17 @@ return toValueString(); } + @Override public boolean isDefaultForKind() { return false; } + @Override public boolean isCompressed() { return compressed; } + @Override public Constant compress() { assert !isCompressed(); HotSpotMetaspaceConstantImpl res = HotSpotMetaspaceConstantImpl.forMetaspaceObject(metaspaceObject, true); @@ -88,6 +91,7 @@ return res; } + @Override public Constant uncompress() { assert isCompressed(); HotSpotMetaspaceConstantImpl res = HotSpotMetaspaceConstantImpl.forMetaspaceObject(metaspaceObject, false); @@ -95,6 +99,7 @@ return res; } + @Override public HotSpotResolvedObjectType asResolvedJavaType() { if (metaspaceObject instanceof HotSpotResolvedObjectType) { return (HotSpotResolvedObjectType) metaspaceObject; @@ -102,6 +107,7 @@ return null; } + @Override public HotSpotResolvedJavaMethod asResolvedJavaMethod() { if (metaspaceObject instanceof HotSpotResolvedJavaMethod) { return (HotSpotResolvedJavaMethod) metaspaceObject; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodHandleAccessProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -167,6 +167,6 @@ Object object = ((HotSpotObjectConstantImpl) method).object(); /* Read the ResolvedJavaMethod from the injected field MemberName.method.vmtarget */ - return compilerToVM().getResolvedJavaMethod(object, LazyInitialization.vmtargetField.offset()); + return compilerToVM().getResolvedJavaMethod(object, LazyInitialization.vmtargetField.getOffset()); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -73,6 +73,7 @@ return format(fmt); } + @Override public void formatTo(Formatter formatter, int flags, int width, int precision) { String base = (flags & ALTERNATE) == ALTERNATE ? getName() : toString(); formatter.format(applyFormattingFlagsAndWidth(base, flags & ~ALTERNATE, width)); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotMethodUnresolved.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.hotspot; - -import jdk.vm.ci.meta.JavaMethod; -import jdk.vm.ci.meta.JavaType; -import jdk.vm.ci.meta.Signature; - -/** - * Implementation of {@link JavaMethod} for unresolved HotSpot methods. - */ -final class HotSpotMethodUnresolved extends HotSpotMethod { - - private final String name; - private final Signature signature; - protected JavaType holder; - - HotSpotMethodUnresolved(String name, Signature signature, JavaType holder) { - this.name = name; - this.holder = holder; - this.signature = signature; - } - - @Override - public String getName() { - return name; - } - - @Override - public Signature getSignature() { - return signature; - } - - @Override - public JavaType getDeclaringClass() { - return holder; - } - - @Override - public int hashCode() { - return super.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || !(obj instanceof HotSpotMethodUnresolved)) { - return false; - } - HotSpotMethodUnresolved that = (HotSpotMethodUnresolved) obj; - return this.name.equals(that.name) && this.signature.equals(that.signature) && this.holder.equals(that.holder); - } -} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstantImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -91,68 +91,52 @@ return object; } + @Override public boolean isCompressed() { return compressed; } + @Override public JavaConstant compress() { assert !compressed; return new HotSpotObjectConstantImpl(object, true); } + @Override public JavaConstant uncompress() { assert compressed; return new HotSpotObjectConstantImpl(object, false); } + @Override public HotSpotResolvedObjectType getType() { return fromObjectClass(object.getClass()); } - public JavaConstant getClassLoader() { - if (object instanceof Class) { - /* - * This is an intrinsic for getClassLoader0, which occurs after any security checks. We - * can't call that directly so just call getClassLoader. - */ - return HotSpotObjectConstantImpl.forObject(((Class<?>) object).getClassLoader()); - } - return null; - } - + @Override public int getIdentityHashCode() { return System.identityHashCode(object); } - public JavaConstant getComponentType() { - if (object instanceof Class) { - return HotSpotObjectConstantImpl.forObject(((Class<?>) object).getComponentType()); - } - return null; - } - - public JavaConstant getSuperclass() { - if (object instanceof Class) { - return HotSpotObjectConstantImpl.forObject(((Class<?>) object).getSuperclass()); - } - return null; - } - + @Override public JavaConstant getCallSiteTarget(Assumptions assumptions) { if (object instanceof CallSite) { CallSite callSite = (CallSite) object; MethodHandle target = callSite.getTarget(); + JavaConstant targetConstant = HotSpotObjectConstantImpl.forObject(target); if (!(callSite instanceof ConstantCallSite)) { if (assumptions == null) { return null; } - assumptions.record(new Assumptions.CallSiteTargetValue(callSite, target)); + assumptions.record(new Assumptions.CallSiteTargetValue(this, targetConstant)); } - return HotSpotObjectConstantImpl.forObject(target); + + return targetConstant; } return null; } + @Override @SuppressFBWarnings(value = "ES_COMPARING_STRINGS_WITH_EQ", justification = "reference equality is what we want") public boolean isInternedString() { if (object instanceof String) { @@ -162,6 +146,7 @@ return false; } + @Override public <T> T asObject(Class<T> type) { if (type.isInstance(object)) { return type.cast(object); @@ -169,6 +154,7 @@ return null; } + @Override public Object asObject(ResolvedJavaType type) { if (type.isInstance(this)) { return object; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotObjectConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,8 +36,10 @@ */ public interface HotSpotObjectConstant extends JavaConstant, HotSpotConstant, VMConstant { + @Override JavaConstant compress(); + @Override JavaConstant uncompress(); /** @@ -46,36 +48,12 @@ HotSpotResolvedObjectType getType(); /** - * Gets the result of {@link Class#getClassLoader()} for the {@link Class} object represented by - * this constant. - * - * @return {@code null} if this constant does not represent a {@link Class} object - */ - JavaConstant getClassLoader(); - - /** * Gets the {@linkplain System#identityHashCode(Object) identity} has code for the object * represented by this constant. */ int getIdentityHashCode(); /** - * Gets the result of {@link Class#getComponentType()} for the {@link Class} object represented - * by this constant. - * - * @return {@code null} if this constant does not represent a {@link Class} object - */ - JavaConstant getComponentType(); - - /** - * Gets the result of {@link Class#getSuperclass()} for the {@link Class} object represented by - * this constant. - * - * @return {@code null} if this constant does not represent a {@link Class} object - */ - JavaConstant getSuperclass(); - - /** * Gets the result of {@link CallSite#getTarget()} for the {@link CallSite} object represented * by this constant. * diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaFieldImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,8 +29,11 @@ import java.lang.reflect.Field; import jdk.internal.vm.annotation.Stable; + +import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.vm.ci.meta.UnresolvedJavaType; /** * Represents a field in a HotSpot type. @@ -95,10 +98,12 @@ * @return true iff this is a non-static field and its declaring class is assignable from * {@code object}'s class */ - public boolean isInObject(Object object) { + @Override + public boolean isInObject(JavaConstant constant) { if (isStatic()) { return false; } + Object object = ((HotSpotObjectConstantImpl) constant).object(); return getDeclaringClass().isAssignableFrom(HotSpotResolvedObjectTypeImpl.fromObjectClass(object.getClass())); } @@ -117,10 +122,10 @@ // Pull field into local variable to prevent a race causing // a ClassCastException below JavaType currentType = type; - if (currentType instanceof HotSpotUnresolvedJavaType) { + if (currentType instanceof UnresolvedJavaType) { // Don't allow unresolved types to hang around forever - HotSpotUnresolvedJavaType unresolvedType = (HotSpotUnresolvedJavaType) currentType; - ResolvedJavaType resolved = unresolvedType.reresolve(holder); + UnresolvedJavaType unresolvedType = (UnresolvedJavaType) currentType; + ResolvedJavaType resolved = unresolvedType.resolve(holder); if (resolved != null) { type = resolved; } @@ -128,7 +133,8 @@ return type; } - public int offset() { + @Override + public int getOffset() { return offset; } @@ -147,6 +153,7 @@ * * @return true if field has {@link Stable} annotation, false otherwise */ + @Override public boolean isStable() { return (config().jvmAccFieldStable & modifiers) != 0; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaField.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,7 @@ */ package jdk.vm.ci.hotspot; +import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.ResolvedJavaField; /** @@ -35,9 +36,7 @@ * @return true iff this is a non-static field and its declaring class is assignable from * {@code object}'s class */ - boolean isInObject(Object object); - - int offset(); + boolean isInObject(JavaConstant object); /** * Determines if this field should be treated as a constant. diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethodImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,24 +22,6 @@ */ package jdk.vm.ci.hotspot; -import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; -import static jdk.vm.ci.hotspot.HotSpotModifiers.BRIDGE; -import static jdk.vm.ci.hotspot.HotSpotModifiers.SYNTHETIC; -import static jdk.vm.ci.hotspot.HotSpotModifiers.VARARGS; -import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmMethodModifiers; -import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; -import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; - -import java.lang.annotation.Annotation; -import java.lang.reflect.Executable; -import java.lang.reflect.Method; -import java.lang.reflect.Modifier; -import java.lang.reflect.Type; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.Option; import jdk.vm.ci.meta.Constant; @@ -58,6 +40,24 @@ import jdk.vm.ci.meta.SpeculationLog; import jdk.vm.ci.meta.TriState; +import java.lang.annotation.Annotation; +import java.lang.reflect.Executable; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.Type; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; + +import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; +import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; +import static jdk.vm.ci.hotspot.HotSpotModifiers.BRIDGE; +import static jdk.vm.ci.hotspot.HotSpotModifiers.SYNTHETIC; +import static jdk.vm.ci.hotspot.HotSpotModifiers.VARARGS; +import static jdk.vm.ci.hotspot.HotSpotModifiers.jvmMethodModifiers; +import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; +import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; + /** * Implementation of {@link JavaMethod} for resolved HotSpot methods. */ @@ -203,6 +203,7 @@ return HotSpotMetaspaceConstantImpl.forMetaspaceObject(this, false); } + @Override public long getMetaspacePointer() { return metaspaceMethod; } @@ -295,6 +296,7 @@ * * @return true if CallerSensitive annotation present, false otherwise */ + @Override public boolean isCallerSensitive() { return (getFlags() & config().methodFlagsCallerSensitive) != 0; } @@ -304,6 +306,7 @@ * * @return true if ForceInline annotation present, false otherwise */ + @Override public boolean isForceInline() { return (getFlags() & config().methodFlagsForceInline) != 0; } @@ -313,6 +316,7 @@ * * @return true if ReservedStackAccess annotation present, false otherwise */ + @Override public boolean hasReservedStackAccess() { return (getFlags() & config().methodFlagsReservedStackAccess) != 0; } @@ -320,6 +324,7 @@ /** * Sets flags on {@code method} indicating that it should never be inlined or compiled by the VM. */ + @Override public void setNotInlinableOrCompilable() { compilerToVM().setNotInlinableOrCompilable(this); } @@ -330,6 +335,7 @@ * * @return true if special method ignored by security stack walks, false otherwise */ + @Override public boolean ignoredBySecurityStackWalk() { return compilerToVM().methodIsIgnoredBySecurityStackWalk(this); } @@ -384,6 +390,7 @@ return compilerToVM().getStackTraceElement(this, bci); } + @Override public ResolvedJavaMethod uniqueConcreteMethod(HotSpotResolvedObjectType receiver) { if (receiver.isInterface()) { // Cannot trust interfaces. Because of: @@ -423,6 +430,7 @@ * * @return true if this method has compiled code, false otherwise */ + @Override public boolean hasCompiledCode() { return getCompiledCode() != 0L; } @@ -431,6 +439,7 @@ * @param level * @return true if the currently installed code was generated at {@code level}. */ + @Override public boolean hasCompiledCodeAtLevel(int level) { long compiledCode = getCompiledCode(); if (compiledCode != 0) { @@ -521,6 +530,7 @@ return javaMethod == null ? null : javaMethod.getAnnotation(annotationClass); } + @Override public boolean isBridge() { return (BRIDGE & getModifiers()) != 0; } @@ -530,10 +540,12 @@ return (SYNTHETIC & getModifiers()) != 0; } + @Override public boolean isVarArgs() { return (VARARGS & getModifiers()) != 0; } + @Override public boolean isDefault() { // Copied from java.lang.Method.isDefault() int mask = Modifier.ABSTRACT | Modifier.PUBLIC | Modifier.STATIC; @@ -673,6 +685,7 @@ * * @return the offset of this method into the v-table */ + @Override public int vtableEntryOffset(ResolvedJavaType resolved) { if (!isInVirtualMethodTable(resolved)) { throw new JVMCIError("%s does not have a vtable entry in type %s", this, resolved); @@ -740,6 +753,7 @@ } }; + @Override public SpeculationLog getSpeculationLog() { Map<Long, SpeculationLog> map = SpeculationLogs.get(holder.mirror()); synchronized (map) { @@ -752,11 +766,13 @@ } } + @Override public int intrinsicId() { HotSpotVMConfig config = config(); return UNSAFE.getChar(metaspaceMethod + config.methodIntrinsicIdOffset); } + @Override public boolean isIntrinsicCandidate() { return (getFlags() & config().methodFlagsIntrinsicCandidate) != 0; } @@ -767,10 +783,12 @@ * @param entryBCI entry bci * @return compile id */ + @Override public int allocateCompileId(int entryBCI) { return compilerToVM().allocateCompileId(this, entryBCI); } + @Override public boolean hasCodeAtLevel(int entryBCI, int level) { if (entryBCI == config().invocationEntryBci) { return hasCompiledCodeAtLevel(level); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,6 +40,7 @@ */ boolean isCallerSensitive(); + @Override HotSpotResolvedObjectType getDeclaringClass(); /** @@ -84,6 +85,7 @@ */ boolean hasCompiledCodeAtLevel(int level); + @Override default boolean isDefault() { if (isConstructor()) { return false; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedJavaType.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,7 +30,7 @@ super(name); } - public abstract Class<?> mirror(); + abstract Class<?> mirror(); @Override public final boolean equals(Object obj) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectTypeImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -51,6 +51,8 @@ import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.vm.ci.meta.UnresolvedJavaField; +import jdk.vm.ci.meta.UnresolvedJavaType; /** * Implementation of {@link JavaType} for resolved non-primitive HotSpot classes. @@ -296,6 +298,7 @@ return compilerToVM().getImplementor(this); } + @Override public HotSpotResolvedObjectTypeImpl getSupertype() { if (isArray()) { ResolvedJavaType componentType = getComponentType(); @@ -355,6 +358,11 @@ } @Override + public boolean isEnum() { + return mirror().isEnum(); + } + + @Override public boolean isInitialized() { return isArray() ? true : getInitState() == config().instanceKlassStateFullyInitialized; } @@ -447,6 +455,7 @@ return compilerToVM().resolveMethod(this, hotSpotMethod, hotSpotCallerType); } + @Override public HotSpotConstantPool getConstantPool() { if (constantPool == null || !isArray() && UNSAFE.getAddress(getMetaspaceKlass() + config().instanceKlassConstantsOffset) != constantPool.getMetaspaceConstantPool()) { /* @@ -465,6 +474,7 @@ * allocated, then the returned value is negative (its absolute value gives the size). Must not * be called if this is an array or interface type. */ + @Override public int instanceSize() { assert !isArray(); assert !isInterface(); @@ -482,6 +492,7 @@ return needsSlowPath ? -size : size; } + @Override public int layoutHelper() { HotSpotVMConfig config = config(); return UNSAFE.getInt(getMetaspaceKlass() + config.klassLayoutHelperOffset); @@ -527,6 +538,7 @@ } } + @Override public int getVtableLength() { HotSpotVMConfig config = config(); if (isInterface() || isArray()) { @@ -752,7 +764,7 @@ // Make sure the result is sorted by offset. int j; - for (j = resultIndex - 1; j >= prependLength && result[j].offset() > offset; j--) { + for (j = resultIndex - 1; j >= prependLength && result[j].getOffset() > offset; j--) { result[j + 1] = result[j]; } result[j + 1] = resolvedJavaField; @@ -800,6 +812,7 @@ * {@linkplain HotSpotJVMCIRuntime#lookupType(String, HotSpotResolvedObjectType, boolean) * re-resolving} the type. */ + @Override public boolean isDefinitelyResolvedWithRespectTo(ResolvedJavaType accessingClass) { assert accessingClass != null; ResolvedJavaType elementType = getElementalType(); @@ -829,19 +842,23 @@ /** * Gets the metaspace Klass boxed in a {@link JavaConstant}. */ + @Override public Constant klass() { return HotSpotMetaspaceConstantImpl.forMetaspaceObject(this, false); } + @Override public boolean isPrimaryType() { return config().secondarySuperCacheOffset != superCheckOffset(); } + @Override public int superCheckOffset() { HotSpotVMConfig config = config(); return UNSAFE.getInt(getMetaspaceKlass() + config.superCheckOffsetOffset); } + @Override public long prototypeMarkWord() { HotSpotVMConfig config = config(); if (isArray()) { @@ -865,7 +882,7 @@ private static ResolvedJavaField findFieldWithOffset(long offset, JavaKind expectedEntryKind, ResolvedJavaField[] declaredFields) { for (ResolvedJavaField field : declaredFields) { HotSpotResolvedJavaField resolvedField = (HotSpotResolvedJavaField) field; - long resolvedFieldOffset = resolvedField.offset(); + long resolvedFieldOffset = resolvedField.getOffset(); // @formatter:off if (ByteOrder.nativeOrder() == ByteOrder.BIG_ENDIAN && expectedEntryKind.isPrimitive() && @@ -921,6 +938,7 @@ return result; } + @Override public ResolvedJavaMethod getClassInitializer() { if (!isArray()) { return compilerToVM().getClassInitializer(this); @@ -934,6 +952,30 @@ } @Override + public ResolvedJavaType lookupType(UnresolvedJavaType unresolvedJavaType, boolean resolve) { + JavaType javaType = HotSpotJVMCIRuntime.runtime().lookupType(unresolvedJavaType.getName(), this, resolve); + if (javaType instanceof ResolvedJavaType) { + return (ResolvedJavaType) javaType; + } + return null; + } + + @Override + public ResolvedJavaField resolveField(UnresolvedJavaField unresolvedJavaField, ResolvedJavaType accessingClass) { + for (ResolvedJavaField field : getInstanceFields(false)) { + if (field.getName().equals(unresolvedJavaField.getName())) { + return field; + } + } + for (ResolvedJavaField field : getStaticFields()) { + if (field.getName().equals(unresolvedJavaField.getName())) { + return field; + } + } + throw new InternalError(unresolvedJavaField.toString()); + } + + @Override public boolean isCloneableWithAllocation() { return (getAccessFlags() & config().jvmAccIsCloneableFast) != 0; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedObjectType.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,33 +36,32 @@ */ public interface HotSpotResolvedObjectType extends ResolvedJavaType { - /** - * Gets the JVMCI mirror for a {@link Class} object. - * - * @return the {@link HotSpotResolvedJavaType} corresponding to {@code javaClass} - */ - static HotSpotResolvedObjectType fromObjectClass(Class<?> javaClass) { - return HotSpotResolvedObjectTypeImpl.fromObjectClass(javaClass); - } - + @Override HotSpotResolvedObjectType getArrayClass(); + @Override ResolvedJavaType getComponentType(); + @Override AssumptionResult<ResolvedJavaType> findLeafConcreteSubtype(); + @Override HotSpotResolvedObjectType getSuperclass(); + @Override HotSpotResolvedObjectType[] getInterfaces(); HotSpotResolvedObjectType getSupertype(); + @Override HotSpotResolvedObjectType findLeastCommonAncestor(ResolvedJavaType otherType); + @Override default boolean isPrimitive() { return false; } + @Override default JavaKind getJavaKind() { return JavaKind.Object; } @@ -105,8 +104,10 @@ long getFingerprint(); + @Override HotSpotResolvedObjectType getEnclosingType(); + @Override ResolvedJavaMethod getClassInitializer(); boolean isAnonymous(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotResolvedPrimitiveType.java 2018-07-25 15:36:46.000000000 +0000 @@ -49,12 +49,12 @@ * * <p> * <b>NOTE</b>: Creating an instance of this class does not install the mirror for the - * {@link Class} type. Use {@link HotSpotJVMCIRuntimeProvider#fromClass(Class)} instead. + * {@link Class} type. Use {@link HotSpotJVMCIRuntime#fromClass(Class)} instead. * </p> * * @param kind the Kind to create the mirror for */ - public HotSpotResolvedPrimitiveType(JavaKind kind) { + HotSpotResolvedPrimitiveType(JavaKind kind) { super(String.valueOf(kind.getTypeChar())); this.kind = kind; assert mirror().isPrimitive() : mirror() + " not a primitive type"; @@ -74,6 +74,7 @@ return HotSpotResolvedObjectTypeImpl.fromObjectClass(javaArrayMirror); } + @Override public ResolvedJavaType getElementalType() { return this; } @@ -119,6 +120,11 @@ } @Override + public boolean isEnum() { + return false; + } + + @Override public boolean isPrimitive() { return true; } @@ -128,6 +134,7 @@ return true; } + @Override public boolean isLinked() { return true; } @@ -234,7 +241,7 @@ } @Override - public Class<?> mirror() { + Class<?> mirror() { return kind.toJavaClass(); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSentinelConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,9 @@ import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; -import jdk.vm.ci.meta.ValueKind; import jdk.vm.ci.meta.VMConstant; import jdk.vm.ci.meta.Value; +import jdk.vm.ci.meta.ValueKind; public final class HotSpotSentinelConstant extends Value implements JavaConstant, VMConstant { @@ -37,6 +37,7 @@ this.javaKind = javaKind; } + @Override public JavaKind getJavaKind() { return javaKind; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSignature.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,6 +30,7 @@ import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Signature; +import jdk.vm.ci.meta.UnresolvedJavaType; /** * Represents a method signature. @@ -41,9 +42,9 @@ private final String originalString; private ResolvedJavaType[] parameterTypes; private ResolvedJavaType returnTypeCache; - private final HotSpotJVMCIRuntimeProvider runtime; + private final HotSpotJVMCIRuntime runtime; - public HotSpotSignature(HotSpotJVMCIRuntimeProvider runtime, String signature) { + public HotSpotSignature(HotSpotJVMCIRuntime runtime, String signature) { this.runtime = runtime; if (signature.length() == 0) { throw new IllegalArgumentException("Signature cannot be empty"); @@ -69,7 +70,7 @@ } } - public HotSpotSignature(HotSpotJVMCIRuntimeProvider runtime, ResolvedJavaType returnType, ResolvedJavaType... parameterTypes) { + public HotSpotSignature(HotSpotJVMCIRuntime runtime, ResolvedJavaType returnType, ResolvedJavaType... parameterTypes) { this.runtime = runtime; this.parameterTypes = parameterTypes.clone(); this.returnTypeCache = returnType; @@ -142,12 +143,12 @@ return true; } - private static JavaType getUnresolvedOrPrimitiveType(HotSpotJVMCIRuntimeProvider runtime, String name) { + private static JavaType getUnresolvedOrPrimitiveType(HotSpotJVMCIRuntime runtime, String name) { if (name.length() == 1) { JavaKind kind = JavaKind.fromPrimitiveOrVoidTypeChar(name.charAt(0)); return runtime.getHostJVMCIBackend().getMetaAccess().lookupJavaType(kind.toJavaClass()); } - return HotSpotUnresolvedJavaType.create(runtime, name); + return UnresolvedJavaType.create(name); } @Override diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,34 +22,53 @@ */ package jdk.vm.ci.hotspot; -import java.util.Collection; +import java.util.HashMap; import java.util.HashSet; import java.util.Set; -import java.util.concurrent.ConcurrentLinkedQueue; +import java.util.Map; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.SpeculationLog; public class HotSpotSpeculationLog implements SpeculationLog { + public static final class HotSpotSpeculation extends Speculation { + private JavaConstant encoding; + + HotSpotSpeculation(SpeculationReason reason, JavaConstant encoding) { + super(reason); + this.encoding = encoding; + } + + public JavaConstant getEncoding() { + return encoding; + } + } /** Written by the C++ code that performs deoptimization. */ - private volatile Object lastFailed; + private volatile long lastFailed; /** All speculations that have caused a deoptimization. */ private Set<SpeculationReason> failedSpeculations; /** Strong references to all reasons embedded in the current nmethod. */ - private Collection<SpeculationReason> speculations; + private Map<Long, SpeculationReason> speculations; + + private long currentSpeculationID; @Override public synchronized void collectFailedSpeculations() { - if (lastFailed != null) { + if (lastFailed != 0) { if (failedSpeculations == null) { failedSpeculations = new HashSet<>(2); } - failedSpeculations.add((SpeculationReason) lastFailed); - lastFailed = null; - speculations = null; + if (speculations != null) { + SpeculationReason lastFailedSpeculation = speculations.get(lastFailed); + if (lastFailedSpeculation != null) { + failedSpeculations.add(lastFailedSpeculation); + } + lastFailed = 0; + speculations = null; + } } } @@ -62,26 +81,26 @@ } @Override - public JavaConstant speculate(SpeculationReason reason) { - assert maySpeculate(reason); - - /* - * Objects referenced from nmethods are weak references. We need a strong reference to the - * reason objects that are embedded in nmethods, so we add them to the speculations - * collection. - */ - synchronized (this) { - if (speculations == null) { - speculations = new ConcurrentLinkedQueue<>(); - } - speculations.add(reason); + public synchronized Speculation speculate(SpeculationReason reason) { + if (speculations == null) { + speculations = new HashMap<>(); } - - return HotSpotObjectConstantImpl.forObject(reason); + speculations.put(++currentSpeculationID, reason); + return new HotSpotSpeculation(reason, JavaConstant.forLong(currentSpeculationID)); } @Override public synchronized boolean hasSpeculations() { return speculations != null && !speculations.isEmpty(); } + + @Override + public synchronized Speculation lookupSpeculation(JavaConstant constant) { + if (constant.isDefaultForKind()) { + return NO_SPECULATION; + } + SpeculationReason reason = speculations.get(constant.asLong()); + assert reason != null : "Speculation should have been registered"; + return new HotSpotSpeculation(reason, constant); + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotStackIntrospection.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,9 +28,9 @@ public class HotSpotStackIntrospection implements StackIntrospection { - protected final HotSpotJVMCIRuntimeProvider runtime; + protected final HotSpotJVMCIRuntime runtime; - public HotSpotStackIntrospection(HotSpotJVMCIRuntimeProvider runtime) { + public HotSpotStackIntrospection(HotSpotJVMCIRuntime runtime) { this.runtime = runtime; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedField.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.hotspot; - -import jdk.vm.ci.meta.JavaField; -import jdk.vm.ci.meta.JavaType; - -/** - * A implementation of {@link JavaField} for an unresolved field. - */ -class HotSpotUnresolvedField implements JavaField { - - private final String name; - private final JavaType holder; - private final JavaType type; - - HotSpotUnresolvedField(JavaType holder, String name, JavaType type) { - this.name = name; - this.type = type; - this.holder = holder; - } - - public String getName() { - return name; - } - - public JavaType getType() { - return type; - } - - public JavaType getDeclaringClass() { - return holder; - } - - @Override - public int hashCode() { - return super.hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || !(obj instanceof HotSpotUnresolvedField)) { - return false; - } - HotSpotUnresolvedField that = (HotSpotUnresolvedField) obj; - return this.holder.equals(that.holder) && this.name.equals(that.name) && this.type.equals(that.type); - } - - /** - * Converts this compiler interface field to a string. - */ - @Override - public String toString() { - return format("HotSpotField<%H.%n %t, unresolved>"); - } -} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotUnresolvedJavaType.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package jdk.vm.ci.hotspot; - -import jdk.vm.ci.meta.JavaKind; -import jdk.vm.ci.meta.JavaType; -import jdk.vm.ci.meta.ResolvedJavaType; - -/** - * Implementation of {@link JavaType} for unresolved HotSpot classes. - */ -final class HotSpotUnresolvedJavaType extends HotSpotJavaType { - - private final HotSpotJVMCIRuntimeProvider runtime; - - private HotSpotUnresolvedJavaType(String name, HotSpotJVMCIRuntimeProvider runtime) { - super(name); - assert name.charAt(0) == '[' || name.charAt(name.length() - 1) == ';' : name; - this.runtime = runtime; - } - - /** - * Creates an unresolved type for a valid {@link JavaType#getName() type name}. - */ - static HotSpotUnresolvedJavaType create(HotSpotJVMCIRuntimeProvider runtime, String name) { - return new HotSpotUnresolvedJavaType(name, runtime); - } - - @Override - public JavaType getComponentType() { - assert getName().charAt(0) == '[' : "no array class" + getName(); - return new HotSpotUnresolvedJavaType(getName().substring(1), runtime); - } - - @Override - public JavaType getArrayClass() { - return new HotSpotUnresolvedJavaType('[' + getName(), runtime); - } - - @Override - public JavaKind getJavaKind() { - return JavaKind.Object; - } - - @Override - public int hashCode() { - return getName().hashCode(); - } - - @Override - public boolean equals(Object obj) { - if (this == obj) { - return true; - } - if (obj == null || !(obj instanceof HotSpotUnresolvedJavaType)) { - return false; - } - HotSpotUnresolvedJavaType that = (HotSpotUnresolvedJavaType) obj; - return this.getName().equals(that.getName()); - } - - @Override - public String toString() { - return "HotSpotType<" + getName() + ", unresolved>"; - } - - @Override - public ResolvedJavaType resolve(ResolvedJavaType accessingClass) { - return (ResolvedJavaType) runtime.lookupType(getName(), (HotSpotResolvedObjectType) accessingClass, true); - } - - /** - * Try to find a loaded version of this class. - * - * @param accessingClass - * @return the resolved class or null. - */ - ResolvedJavaType reresolve(HotSpotResolvedObjectType accessingClass) { - JavaType type = runtime.lookupType(getName(), accessingClass, false); - if (type instanceof ResolvedJavaType) { - return (ResolvedJavaType) type; - } - return null; - } -} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotVMConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -261,7 +261,7 @@ * @return the symbol at position id */ String symbolAt(int index) { - HotSpotJVMCIRuntimeProvider runtime = runtime(); + HotSpotJVMCIRuntime runtime = runtime(); assert vmSymbolsFirstSID <= index && index < vmSymbolsSIDLimit : "index " + index + " is out of bounds"; assert symbolPointerSize == Unsafe.ADDRESS_SIZE : "the following address read is broken"; int offset = index * symbolPointerSize; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/VMField.java 2018-07-25 15:36:46.000000000 +0000 @@ -63,20 +63,9 @@ } /** - * Creates a description of a non-static field. + * Creates a description of a field. */ - public VMField(String name, String type, long offset) { - this.name = name; - this.type = type; - this.offset = offset; - this.address = 0; - this.value = null; - } - - /** - * Creates a description of a static field. - */ - public VMField(String name, String type, long address, Long value) { + VMField(String name, String type, long address, Object value) { this.name = name; this.type = type; this.offset = 0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotJVMCIBackendFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,7 +35,7 @@ import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; import jdk.vm.ci.hotspot.HotSpotStackIntrospection; import jdk.vm.ci.meta.ConstantReflectionProvider; @@ -123,7 +123,7 @@ return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); } - protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { + protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntime runtime) { return new HotSpotConstantReflectionProvider(runtime); } @@ -131,11 +131,11 @@ return new AArch64HotSpotRegisterConfig(target, config.useCompressedOops); } - protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) { return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); } - protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntimeProvider runtime) { + protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntime runtime) { return new HotSpotMetaAccessProvider(runtime); } @@ -149,8 +149,9 @@ return "JVMCIBackend:" + getArchitecture(); } + @Override @SuppressWarnings("try") - public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntime runtime, JVMCIBackend host) { assert host == null; AArch64HotSpotVMConfig config = new AArch64HotSpotVMConfig(runtime.getConfigStore()); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.aarch64/src/jdk/vm/ci/hotspot/aarch64/AArch64HotSpotRegisterConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -178,6 +178,7 @@ return callerSaved; } + @Override public RegisterArray getCalleeSaveRegisters() { return null; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.amd64/src/jdk/vm/ci/hotspot/amd64/AMD64HotSpotJVMCIBackendFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,7 +35,7 @@ import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; import jdk.vm.ci.hotspot.HotSpotStackIntrospection; import jdk.vm.ci.meta.ConstantReflectionProvider; @@ -149,7 +149,7 @@ return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); } - protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntimeProvider runtime) { + protected HotSpotConstantReflectionProvider createConstantReflection(HotSpotJVMCIRuntime runtime) { return new HotSpotConstantReflectionProvider(runtime); } @@ -157,11 +157,11 @@ return new AMD64HotSpotRegisterConfig(target, config.useCompressedOops, config.windowsOs); } - protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) { return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); } - protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntimeProvider runtime) { + protected HotSpotMetaAccessProvider createMetaAccess(HotSpotJVMCIRuntime runtime) { return new HotSpotMetaAccessProvider(runtime); } @@ -175,8 +175,9 @@ return "JVMCIBackend:" + getArchitecture(); } + @Override @SuppressWarnings("try") - public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntime runtime, JVMCIBackend host) { assert host == null; AMD64HotSpotVMConfig config = new AMD64HotSpotVMConfig(runtime.getConfigStore()); TargetDescription target = createTarget(config); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot.sparc/src/jdk/vm/ci/hotspot/sparc/SPARCHotSpotJVMCIBackendFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,7 @@ import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; import jdk.vm.ci.hotspot.HotSpotJVMCIBackendFactory; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; import jdk.vm.ci.hotspot.HotSpotStackIntrospection; import jdk.vm.ci.runtime.JVMCIBackend; @@ -51,7 +51,7 @@ return new TargetDescription(arch, true, stackFrameAlignment, implicitNullCheckLimit, inlineObjects); } - protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntimeProvider runtime, TargetDescription target, RegisterConfig regConfig) { + protected HotSpotCodeCacheProvider createCodeCache(HotSpotJVMCIRuntime runtime, TargetDescription target, RegisterConfig regConfig) { return new HotSpotCodeCacheProvider(runtime, runtime.getConfig(), target, regConfig); } @@ -208,8 +208,9 @@ return "JVMCIBackend:" + getArchitecture(); } + @Override @SuppressWarnings("try") - public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntimeProvider runtime, JVMCIBackend host) { + public JVMCIBackend createJVMCIBackend(HotSpotJVMCIRuntime runtime, JVMCIBackend host) { assert host == null; SPARCHotSpotVMConfig config = new SPARCHotSpotVMConfig(runtime.getConfigStore()); TargetDescription target = createTarget(config); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/Assumptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,8 +22,6 @@ */ package jdk.vm.ci.meta; -import java.lang.invoke.CallSite; -import java.lang.invoke.MethodHandle; import java.util.Arrays; import java.util.HashSet; import java.util.Iterator; @@ -274,10 +272,10 @@ */ public static final class CallSiteTargetValue extends Assumption { - public final CallSite callSite; - public final MethodHandle methodHandle; + public final JavaConstant callSite; + public final JavaConstant methodHandle; - public CallSiteTargetValue(CallSite callSite, MethodHandle methodHandle) { + public CallSiteTargetValue(JavaConstant callSite, JavaConstant methodHandle) { this.callSite = callSite; this.methodHandle = methodHandle; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/DefaultProfilingInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -96,14 +96,17 @@ return "DefaultProfilingInfo<" + this.toString(null, "; ") + ">"; } + @Override public void setMature() { // Do nothing } + @Override public boolean setCompilerIRSize(Class<?> irType, int nodeCount) { return false; } + @Override public int getCompilerIRSize(Class<?> irType) { return -1; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -81,6 +81,7 @@ * * @return {@code true} if this constant is the default value for its kind */ + @Override boolean isDefaultForKind(); /** @@ -130,6 +131,7 @@ */ double asDouble(); + @Override default String toValueString() { if (getJavaKind() == JavaKind.Illegal) { return "illegal"; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/JavaKind.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,37 +33,37 @@ */ public enum JavaKind { /** The primitive boolean kind, represented as an int on the stack. */ - Boolean('Z', "boolean", 1, true, java.lang.Boolean.TYPE, java.lang.Boolean.class), + Boolean('Z', 4, "boolean", 1, true, java.lang.Boolean.TYPE, java.lang.Boolean.class), /** The primitive byte kind, represented as an int on the stack. */ - Byte('B', "byte", 1, true, java.lang.Byte.TYPE, java.lang.Byte.class), + Byte('B', 8, "byte", 1, true, java.lang.Byte.TYPE, java.lang.Byte.class), /** The primitive short kind, represented as an int on the stack. */ - Short('S', "short", 1, true, java.lang.Short.TYPE, java.lang.Short.class), + Short('S', 9, "short", 1, true, java.lang.Short.TYPE, java.lang.Short.class), /** The primitive char kind, represented as an int on the stack. */ - Char('C', "char", 1, true, java.lang.Character.TYPE, java.lang.Character.class), + Char('C', 5, "char", 1, true, java.lang.Character.TYPE, java.lang.Character.class), /** The primitive int kind, represented as an int on the stack. */ - Int('I', "int", 1, true, java.lang.Integer.TYPE, java.lang.Integer.class), + Int('I', 10, "int", 1, true, java.lang.Integer.TYPE, java.lang.Integer.class), /** The primitive float kind. */ - Float('F', "float", 1, false, java.lang.Float.TYPE, java.lang.Float.class), + Float('F', 6, "float", 1, false, java.lang.Float.TYPE, java.lang.Float.class), /** The primitive long kind. */ - Long('J', "long", 2, false, java.lang.Long.TYPE, java.lang.Long.class), + Long('J', 11, "long", 2, false, java.lang.Long.TYPE, java.lang.Long.class), /** The primitive double kind. */ - Double('D', "double", 2, false, java.lang.Double.TYPE, java.lang.Double.class), + Double('D', 7, "double", 2, false, java.lang.Double.TYPE, java.lang.Double.class), /** The Object kind, also used for arrays. */ - Object('A', "Object", 1, false, null, null), + Object('A', 12, "Object", 1, false, null, null), /** The void kind. */ - Void('V', "void", 0, false, java.lang.Void.TYPE, java.lang.Void.class), + Void('V', 14, "void", 0, false, java.lang.Void.TYPE, java.lang.Void.class), /** The non-type. */ - Illegal('-', "illegal", 0, false, null, null); + Illegal('-', 99, "illegal", 0, false, null, null); private final char typeChar; private final String javaName; @@ -71,14 +71,16 @@ private final Class<?> primitiveJavaClass; private final Class<?> boxedJavaClass; private final int slotCount; + private final int basicType; - JavaKind(char typeChar, String javaName, int slotCount, boolean isStackInt, Class<?> primitiveJavaClass, Class<?> boxedJavaClass) { + JavaKind(char typeChar, int basicType, String javaName, int slotCount, boolean isStackInt, Class<?> primitiveJavaClass, Class<?> boxedJavaClass) { this.typeChar = typeChar; this.javaName = javaName; this.slotCount = slotCount; this.isStackInt = isStackInt; this.primitiveJavaClass = primitiveJavaClass; this.boxedJavaClass = boxedJavaClass; + this.basicType = basicType; assert primitiveJavaClass == null || javaName.equals(primitiveJavaClass.getName()); } @@ -109,6 +111,13 @@ } /** + * Returns the JVM BasicType value for this type. + */ + public int getBasicType() { + return basicType; + } + + /** * Returns the name of this kind which will also be it Java programming language name if it is * {@linkplain #isPrimitive() primitive} or {@code void}. */ diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/MetaAccessProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,6 +27,8 @@ import java.lang.reflect.Field; import java.lang.reflect.Method; +import jdk.vm.ci.meta.SpeculationLog.Speculation; + /** * Provides access to the metadata of a class typically provided in a class file. */ @@ -100,9 +102,17 @@ */ JavaConstant encodeDeoptActionAndReason(DeoptimizationAction action, DeoptimizationReason reason, int debugId); + JavaConstant encodeSpeculation(Speculation speculation); + DeoptimizationReason decodeDeoptReason(JavaConstant constant); DeoptimizationAction decodeDeoptAction(JavaConstant constant); + Speculation decodeSpeculation(JavaConstant constant, SpeculationLog speculationLog); + int decodeDebugId(JavaConstant constant); + + int getArrayBaseOffset(JavaKind elementKind); + + int getArrayIndexScale(JavaKind elementKind); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaField.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,11 @@ * Only the {@linkplain Modifier#fieldModifiers() field flags} specified in the JVM * specification will be included in the returned mask. */ + @Override int getModifiers(); + int getOffset(); + default boolean isFinal() { return ModifiersProvider.super.isFinalFlagSet(); } @@ -58,5 +61,6 @@ * Returns the {@link ResolvedJavaType} object representing the class or interface that declares * this field. */ + @Override ResolvedJavaType getDeclaringClass(); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ import java.lang.annotation.Annotation; import java.lang.reflect.AnnotatedElement; import java.lang.reflect.Array; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.Type; @@ -60,6 +61,7 @@ * Returns the {@link ResolvedJavaType} object representing the class or interface that declares * this method. */ + @Override ResolvedJavaType getDeclaringClass(); /** @@ -273,14 +275,17 @@ return method.isVarArgs() && index == method.getSignature().getParameterCount(false) - 1; } + @Override public <T extends Annotation> T getAnnotation(Class<T> annotationClass) { return method.getParameterAnnotations(annotationClass)[index]; } + @Override public Annotation[] getAnnotations() { return method.getParameterAnnotations()[index]; } + @Override public Annotation[] getDeclaredAnnotations() { return getAnnotations(); } @@ -460,4 +465,15 @@ } SpeculationLog getSpeculationLog(); + + /** + * + * @param object + * @param args + * @throws InvocationTargetException + * @throws IllegalAccessException + */ + default JavaConstant invoke(JavaConstant object, JavaConstant... args) throws InvocationTargetException, IllegalAccessException { + throw new InternalError("unimplemented"); + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ResolvedJavaType.java 2018-07-25 15:36:46.000000000 +0000 @@ -52,6 +52,7 @@ * * @return {@code true} if this type is an interface */ + @Override boolean isInterface(); /** @@ -77,6 +78,13 @@ } /** + * Checks whether this type is an enum. + * + * @return {@code true} if this type is an enum + */ + boolean isEnum(); + + /** * Checks whether this type is initialized. If a type is initialized it implies that it was * {@link #isLinked() linked} and that the static initializer has run. * @@ -186,8 +194,10 @@ */ AssumptionResult<ResolvedJavaType> findLeafConcreteSubtype(); + @Override ResolvedJavaType getComponentType(); + @Override default ResolvedJavaType getElementalType() { ResolvedJavaType t = this; while (t.isArray()) { @@ -196,6 +206,7 @@ return t; } + @Override ResolvedJavaType getArrayClass(); /** @@ -328,4 +339,17 @@ * so they would to go through the normal {@link Object#clone} path. */ boolean isCloneableWithAllocation(); + + /** + * Lookup an unresolved type relative to an existing resolved type. + */ + @SuppressWarnings("unused") + default ResolvedJavaType lookupType(UnresolvedJavaType unresolvedJavaType, boolean resolve) { + return null; + } + + @SuppressWarnings("unused") + default ResolvedJavaField resolveField(UnresolvedJavaField unresolvedJavaField, ResolvedJavaType accessingClass) { + return null; + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/SpeculationLog.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,7 +31,6 @@ * failed speculations during deoptimization, since every VM has different needs there. */ public interface SpeculationLog { - /** * Marker interface for speculation objects that can be added to the speculation log. */ @@ -39,6 +38,31 @@ } /** + * Marker class that indicates that a speculation has no reason. + */ + final class NoSpeculationReason implements SpeculationReason { + } + + class Speculation { + private SpeculationReason reason; + + public Speculation(SpeculationReason reason) { + this.reason = reason; + } + + public SpeculationReason getReason() { + return reason; + } + + @Override + public String toString() { + return reason.toString(); + } + } + + Speculation NO_SPECULATION = new Speculation(new NoSpeculationReason()); + + /** * Must be called before compilation, i.e., before a compiler calls {@link #maySpeculate}. */ void collectFailedSpeculations(); @@ -50,12 +74,20 @@ boolean maySpeculate(SpeculationReason reason); /** - * Registers a speculation that was performed by the compiler. + * Registers a speculation performed by the compiler. The compiler must guard every call to this + * method for a specific reason with a call to {@link #maySpeculate(SpeculationReason)}. + * + * This API is subject to a benign race where a during the course of a compilation another + * thread might fail a speculation such that {@link #maySpeculate(SpeculationReason)} will + * return false but an earlier call returned true. This method will still return a working + * {@link Speculation} in that case but the compile will eventually be invalidated and the + * compile attempted again without the now invalid speculation. * - * @return A compiler constant encapsulating the provided reason. It is usually passed as an + * @param reason an object representing the reason for the speculation + * @return a compiler constant encapsulating the provided reason. It is usually passed as an * argument to the deoptimization function. */ - JavaConstant speculate(SpeculationReason reason); + Speculation speculate(SpeculationReason reason); /** * Returns if this log has speculations. @@ -63,4 +95,11 @@ * @return true if there are speculations, false otherwise */ boolean hasSpeculations(); + + /** + * Given a {@link JavaConstant} previously returned from + * {@link MetaAccessProvider#encodeSpeculation(Speculation)} return the original + * {@link Speculation} object. + */ + Speculation lookupSpeculation(JavaConstant constant); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaField.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaField.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaField.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaField.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.meta; + +/** + * A implementation of {@link JavaField} for an unresolved field. + */ +public final class UnresolvedJavaField implements JavaField { + + private final String name; + private final JavaType holder; + private final JavaType type; + + public UnresolvedJavaField(JavaType holder, String name, JavaType type) { + this.name = name; + this.type = type; + this.holder = holder; + } + + @Override + public String getName() { + return name; + } + + @Override + public JavaType getType() { + return type; + } + + @Override + public JavaType getDeclaringClass() { + return holder; + } + + @Override + public int hashCode() { + return super.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || !(obj instanceof UnresolvedJavaField)) { + return false; + } + UnresolvedJavaField that = (UnresolvedJavaField) obj; + return this.holder.equals(that.holder) && this.name.equals(that.name) && this.type.equals(that.type); + } + + /** + * Converts this compiler interface field to a string. + */ + @Override + public String toString() { + return format("UnresolvedJavaField<%H.%n %t>"); + } + + public ResolvedJavaField resolve(ResolvedJavaType accessingClass) { + ResolvedJavaType resolvedHolder = holder.resolve(accessingClass); + return resolvedHolder.resolveField(this, accessingClass); + } +} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaMethod.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaMethod.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaMethod.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.meta; + +/** + * Implementation of {@link JavaMethod} for unresolved HotSpot methods. + */ +public final class UnresolvedJavaMethod implements JavaMethod { + + private final String name; + private final Signature signature; + protected JavaType holder; + + public UnresolvedJavaMethod(String name, Signature signature, JavaType holder) { + this.name = name; + this.holder = holder; + this.signature = signature; + } + + @Override + public String getName() { + return name; + } + + @Override + public Signature getSignature() { + return signature; + } + + @Override + public JavaType getDeclaringClass() { + return holder; + } + + @Override + public int hashCode() { + return super.hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || !(obj instanceof UnresolvedJavaMethod)) { + return false; + } + UnresolvedJavaMethod that = (UnresolvedJavaMethod) obj; + return this.name.equals(that.name) && this.signature.equals(that.signature) && this.holder.equals(that.holder); + } +} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaType.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaType.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaType.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/UnresolvedJavaType.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.vm.ci.meta; + +/** + * Implementation of {@link JavaType} for unresolved HotSpot classes. + */ +public final class UnresolvedJavaType implements JavaType { + private final String name; + + @Override + public String getName() { + return name; + } + + private UnresolvedJavaType(String name) { + this.name = name; + assert name.length() == 1 && JavaKind.fromPrimitiveOrVoidTypeChar(name.charAt(0)) != null || name.charAt(0) == '[' || name.charAt(name.length() - 1) == ';' : name; + } + + /** + * Creates an unresolved type for a valid {@link JavaType#getName() type name}. + */ + public static UnresolvedJavaType create(String name) { + return new UnresolvedJavaType(name); + } + + @Override + public JavaType getComponentType() { + if (getName().charAt(0) == '[') { + return new UnresolvedJavaType(getName().substring(1)); + } + return null; + } + + @Override + public JavaType getArrayClass() { + return new UnresolvedJavaType('[' + getName()); + } + + @Override + public JavaKind getJavaKind() { + return JavaKind.Object; + } + + @Override + public int hashCode() { + return getName().hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (obj == null || !(obj instanceof UnresolvedJavaType)) { + return false; + } + UnresolvedJavaType that = (UnresolvedJavaType) obj; + return this.getName().equals(that.getName()); + } + + @Override + public String toString() { + return "UnresolvedJavaType<" + getName() + ">"; + } + + @Override + public ResolvedJavaType resolve(ResolvedJavaType accessingClass) { + return accessingClass.lookupType(this, true); + } +} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.meta/src/jdk/vm/ci/meta/ValueKind.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,18 +33,22 @@ private final EnumKey<IllegalKind> key = new EnumKey<>(this); + @Override public Key getKey() { return key; } + @Override public int getSizeInBytes() { return 0; } + @Override public int getVectorLength() { return 0; } + @Override public char getTypeChar() { return '-'; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.services/src/jdk/vm/ci/services/Services.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,6 +33,31 @@ // This class must be compilable and executable on JDK 8 since it's used in annotation // processors while building JDK 9 so use of API added in JDK 9 is made via reflection. + /** + * Guards code that should be run when building a native image but should be excluded from + * (being compiled into) the image. Such code must be directly guarded by an {@code if} + * statement on this field - the guard cannot be behind a method call. + */ + public static final boolean IS_BUILDING_NATIVE_IMAGE; + + /** + * Guards code that should only be run in native image. Such code must be directly guarded by an + * {@code if} statement on this field - the guard cannot be behind a method call. + * + * The value of this field seen during analysis and compilation of an SVM image must be + * {@code true}. + */ + public static final boolean IS_IN_NATIVE_IMAGE; + + static { + /* + * Prevents javac from constant folding use of this field. It is set to true in the SVM + * image via substitution during image building. + */ + IS_IN_NATIVE_IMAGE = false; + IS_BUILDING_NATIVE_IMAGE = false; + } + private Services() { } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java --- openjdk-11-11~19/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.sparc/src/jdk/vm/ci/sparc/SPARCKind.java 2018-07-25 15:36:46.000000000 +0000 @@ -65,6 +65,7 @@ return scalar; } + @Override public int getSizeInBytes() { return size; } @@ -73,10 +74,12 @@ return getSizeInBytes() * 8; } + @Override public int getVectorLength() { return vectorLength; } + @Override public Key getKey() { return key; } @@ -97,6 +100,7 @@ return !isInteger(); } + @Override public char getTypeChar() { switch (this) { case BYTE: diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicMapImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicMapImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicMapImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicMapImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicSet.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicSet.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicSet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/EconomicSet.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/Equivalence.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/Equivalence.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/Equivalence.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/Equivalence.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/MapCursor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/MapCursor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/MapCursor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/MapCursor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,4 +33,6 @@ * * @since 1.0 */ + + package jdk.internal.vm.compiler.collections; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/Pair.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/Pair.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/Pair.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/Pair.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections; import java.util.Objects; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableEconomicMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableEconomicMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableEconomicMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableEconomicMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableEconomicSet.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableEconomicSet.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableEconomicSet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableEconomicSet.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableMapCursor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableMapCursor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableMapCursor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections/src/jdk/internal/vm/compiler/collections/UnmodifiableMapCursor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapImplTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapImplTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapImplTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapImplTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections.test; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapLargeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapLargeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapLargeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapLargeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections.test; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicMapTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections.test; import java.util.LinkedHashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicSetTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicSetTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicSetTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EconomicSetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EquivalenceTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EquivalenceTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EquivalenceTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/EquivalenceTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections.test; import jdk.internal.vm.compiler.collections.Equivalence; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/PairTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/PairTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/PairTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.collections.test/src/jdk/internal/vm/compiler/collections/test/PairTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.collections.test; import jdk.internal.vm.compiler.collections.Pair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/ComparableWord.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/ComparableWord.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/ComparableWord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/ComparableWord.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordBoxFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordBoxFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordBoxFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordBoxFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word.impl; import jdk.internal.vm.compiler.word.WordBase; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordFactoryOpcode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordFactoryOpcode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordFactoryOpcode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordFactoryOpcode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word.impl; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordFactoryOperation.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordFactoryOperation.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordFactoryOperation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/impl/WordFactoryOperation.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word.impl; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/LocationIdentity.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/LocationIdentity.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/LocationIdentity.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/LocationIdentity.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word; // JaCoCo Exclude diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,4 +31,6 @@ * * @since 1.0 */ + + package jdk.internal.vm.compiler.word; \ No newline at end of file diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/PointerBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/PointerBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/PointerBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/PointerBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/Pointer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/Pointer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/Pointer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/Pointer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/SignedWord.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/SignedWord.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/SignedWord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/SignedWord.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/UnsignedWord.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/UnsignedWord.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/UnsignedWord.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/UnsignedWord.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/WordBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/WordBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/WordBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/WordBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/WordFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/WordFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/WordFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/jdk.internal.vm.compiler.word/src/jdk/internal/vm/compiler/word/WordFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package jdk.internal.vm.compiler.word; import jdk.internal.vm.compiler.word.impl.WordBoxFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/module-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/module-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/module-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/module-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,6 +32,7 @@ uses org.graalvm.compiler.code.DisassemblerProvider; uses org.graalvm.compiler.core.match.MatchStatementSet; + uses org.graalvm.compiler.debug.DebugHandlersFactory; uses org.graalvm.compiler.debug.TTYStreamProvider; uses org.graalvm.compiler.hotspot.CompilerConfigurationFactory; uses org.graalvm.compiler.hotspot.HotSpotBackendFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives/src/org/graalvm/compiler/api/directives/GraalDirectives.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.directives; // JaCoCo Exclude diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/BlackholeDirectiveTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.directives.test; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ControlFlowAnchorDirectiveTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.directives.test; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/DeoptimizeDirectiveTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.directives.test; import jdk.vm.ci.code.InstalledCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/IterationDirectiveTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.directives.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/OpaqueDirectiveTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.directives.test; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.directives.test/src/org/graalvm/compiler/api/directives/test/ProbabilityDirectiveTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.directives.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/ClassSubstitution.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.replacements; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Fold.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.replacements; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitution.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.replacements; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/MethodSubstitutionRegistry.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.replacements; import java.lang.reflect.Type; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/Snippet.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.replacements; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetReflectionProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.replacements; import java.util.Objects; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.replacements/src/org/graalvm/compiler/api/replacements/SnippetTemplateCache.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.replacements; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalJVMCICompiler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.runtime; import jdk.vm.ci.runtime.JVMCICompiler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.runtime/src/org/graalvm/compiler/api/runtime/GraalRuntime.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.runtime; import jdk.vm.ci.common.JVMCIError; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/GraalAPITest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.test; import static org.junit.Assert.assertNotNull; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.api.test/src/org/graalvm/compiler/api/test/Graal.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.api.test; import java.util.Formatter; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AbstractAddress.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/AsmOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm; public class AsmOptions { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Assembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Buffer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm; import org.graalvm.compiler.core.common.NumUtil; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm/src/org/graalvm/compiler/asm/Label.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Address.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.aarch64; import static jdk.vm.ci.aarch64.AArch64.zr; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64Assembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.aarch64; import static jdk.vm.ci.aarch64.AArch64.cpuRegisters; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64/src/org/graalvm/compiler/asm/aarch64/AArch64MacroAssembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.asm.aarch64; import static org.graalvm.compiler.asm.aarch64.AArch64Address.AddressingMode.BASE_REGISTER_ONLY; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/AArch64MacroAssemblerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.asm.aarch64.test; import static org.junit.Assert.assertArrayEquals; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.aarch64.test/src/org/graalvm/compiler/asm/aarch64/test/TestProtectedAssembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.asm.aarch64.test; import org.graalvm.compiler.asm.AbstractAddress; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Address.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.amd64; import jdk.vm.ci.code.Register; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64AsmOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.amd64; public class AMD64AsmOptions { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64Assembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.amd64; import static jdk.vm.ci.amd64.AMD64.CPU; @@ -813,6 +815,7 @@ public static final AMD64RMOp MOVSXD = new AMD64RMOp("MOVSXD", 0x63, OpAssertion.QwordAssertion); public static final AMD64RMOp MOVB = new AMD64RMOp("MOVB", 0x8A, OpAssertion.ByteAssertion); public static final AMD64RMOp MOV = new AMD64RMOp("MOV", 0x8B); + public static final AMD64RMOp CMP = new AMD64RMOp("CMP", 0x3B); // MOVD/MOVQ and MOVSS/MOVSD are the same opcode, just with different operand size prefix public static final AMD64RMOp MOVD = new AMD64RMOp("MOVD", 0x66, P_0F, 0x6E, OpAssertion.IntToFloatAssertion, CPUFeature.SSE2); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64InstructionAttr.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.amd64; import jdk.vm.ci.amd64.AMD64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64MacroAssembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.amd64; import static jdk.vm.ci.amd64.AMD64.rax; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64VectorAssembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64VectorAssembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64VectorAssembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AMD64VectorAssembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.amd64; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AVXKind.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AVXKind.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AVXKind.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64/src/org/graalvm/compiler/asm/amd64/AVXKind.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.amd64; import static org.graalvm.compiler.asm.amd64.AVXKind.AVXSize.DWORD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/BitOpsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.asm.amd64.test; import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64RMOp.LZCNT; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/IncrementDecrementMacroTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.amd64.test; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.amd64.test/src/org/graalvm/compiler/asm/amd64/test/SimpleAssemblerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.amd64.test; import static org.junit.Assume.assumeTrue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAddress.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.sparc; import static jdk.vm.ci.sparc.SPARC.STACK_BIAS; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCAssembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.CC.Icc; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCInstructionCounter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.sparc; import java.util.TreeMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc/src/org/graalvm/compiler/asm/sparc/SPARCMacroAssembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.Annul.NOT_ANNUL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/BitSpecTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.sparc.test; import static org.junit.Assert.assertEquals; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.sparc.test/src/org/graalvm/compiler/asm/sparc/test/SPARCAssemblerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.sparc.test; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.BPCC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.asm.test/src/org/graalvm/compiler/asm/test/AssemblerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.asm.test; import static org.graalvm.compiler.core.common.CompilationRequestIdentifier.asCompilationRequest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BridgeMethodUtils.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; import static org.graalvm.compiler.bytecode.Bytecodes.ATHROW; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeDisassembler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; import static org.graalvm.compiler.bytecode.Bytecodes.ALOAD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; import jdk.vm.ci.meta.ConstantPool; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeLookupSwitch.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; import jdk.vm.ci.meta.ResolvedJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytecodes.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; import static org.graalvm.compiler.bytecode.Bytecodes.Flags.ASSOCIATIVE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeStream.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeSwitch.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/BytecodeTableSwitch.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/Bytes.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; import jdk.vm.ci.meta.ConstantPool; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.bytecode/src/org/graalvm/compiler/bytecode/ResolvedJavaMethodBytecodeProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.bytecode; import jdk.vm.ci.meta.ResolvedJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/CompilationResult.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.code; import static java.util.Collections.emptyList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DataSection.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.code; import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/DisassemblerProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.code; import jdk.vm.ci.code.CodeCacheProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFileDisassemblerProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.code; import java.lang.invoke.MethodHandle; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/HexCodeFile.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.code; import java.io.ByteArrayOutputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceMapping.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.code; import static jdk.vm.ci.meta.MetaUtil.identityHashCodeString; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.code/src/org/graalvm/compiler/code/SourceStackTraceBailoutException.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.code; import org.graalvm.compiler.core.common.PermanentBailoutException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationPrinter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationPrinter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationPrinter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationPrinter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core; import static org.graalvm.compiler.core.GraalCompilerOptions.PrintCompilation; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationWrapper.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationWrapper.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationWrapper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilationWrapper.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core; import static org.graalvm.compiler.core.CompilationWrapper.ExceptionAction.ExitVM; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThreadFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core; import java.util.concurrent.ThreadFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/CompilerThread.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/BytecodeParserTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.gen; import jdk.vm.ci.meta.Value; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/DebugInfoBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.gen; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/InstructionPrinter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.gen; import static org.graalvm.compiler.core.gen.InstructionPrinter.InstructionLineColumn.BCI; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeLIRBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.gen; import static jdk.vm.ci.code.ValueUtil.asRegister; @@ -537,7 +539,7 @@ private void emitNullCheckBranch(IsNullNode node, LabelRef trueSuccessor, LabelRef falseSuccessor, double trueSuccessorProbability) { LIRKind kind = gen.getLIRKind(node.getValue().stamp(NodeView.DEFAULT)); - Value nullValue = gen.emitConstant(kind, JavaConstant.NULL_POINTER); + Value nullValue = gen.emitConstant(kind, node.nullConstant()); gen.emitCompareBranch(kind.getPlatformKind(), operand(node.getValue()), nullValue, Condition.EQ, false, trueSuccessor, falseSuccessor, trueSuccessorProbability); } @@ -567,7 +569,7 @@ if (node instanceof IsNullNode) { IsNullNode isNullNode = (IsNullNode) node; LIRKind kind = gen.getLIRKind(isNullNode.getValue().stamp(NodeView.DEFAULT)); - Value nullValue = gen.emitConstant(kind, JavaConstant.NULL_POINTER); + Value nullValue = gen.emitConstant(kind, isNullNode.nullConstant()); return gen.emitConditionalMove(kind.getPlatformKind(), operand(isNullNode.getValue()), nullValue, Condition.EQ, false, trueValue, falseValue); } else if (node instanceof CompareNode) { CompareNode compare = (CompareNode) node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/NodeMatchRules.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.gen; import org.graalvm.compiler.core.match.MatchableNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/gen/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,4 +24,6 @@ * This package contains the port of the LIRGenerator which translates HIR instructions to LIR * instructions for the backend. */ + + package org.graalvm.compiler.core.gen; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompiler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core; import java.util.Collection; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/GraalCompilerOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core; import org.graalvm.compiler.core.CompilationWrapper.ExceptionAction; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/LIRGenerationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchResult.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import jdk.vm.ci.meta.Value; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/ComplexMatchValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchableNodes.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import static org.graalvm.compiler.debug.DebugOptions.LogVerbose; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import org.graalvm.compiler.core.gen.NodeMatchRules; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchPattern.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import org.graalvm.compiler.debug.CounterKey; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRule.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRuleRegistry.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import static org.graalvm.compiler.debug.DebugOptions.LogVerbose; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchRules.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatement.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import static org.graalvm.compiler.debug.DebugOptions.LogVerbose; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/match/MatchStatementSet.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,4 +25,6 @@ * The top-level package in Graal containing the main compiler class * {@link org.graalvm.compiler.core.GraalCompiler}. */ + + package org.graalvm.compiler.core; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CommunityCompilerConfiguration.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CommunityCompilerConfiguration.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CommunityCompilerConfiguration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/CommunityCompilerConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.phases; import org.graalvm.compiler.lir.phases.AllocationPhase.AllocationContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyCompilerConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.phases; import org.graalvm.compiler.lir.phases.AllocationPhase.AllocationContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyHighTier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.phases; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyLowTier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.phases; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/EconomyMidTier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.phases; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/GraphChangeMonitoringPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.phases; import jdk.internal.vm.compiler.collections.EconomicSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/HighTier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.phases; import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; @@ -76,7 +78,7 @@ appendPhase(canonicalizer); if (NodeCounterPhase.Options.NodeCounters.getValue(options)) { - appendPhase(new NodeCounterPhase()); + appendPhase(new NodeCounterPhase(NodeCounterPhase.Stage.INIT)); } if (Options.Inline.getValue(options)) { @@ -84,6 +86,10 @@ appendPhase(new DeadCodeEliminationPhase(Optional)); } + if (NodeCounterPhase.Options.NodeCounters.getValue(options)) { + appendPhase(new NodeCounterPhase(NodeCounterPhase.Stage.EARLY)); + } + if (OptConvertDeoptsToGuards.getValue(options)) { appendPhase(new IncrementalCanonicalizerPhase<>(canonicalizer, new ConvertDeoptimizeToGuardPhase())); } @@ -118,6 +124,10 @@ appendPhase(new RemoveValueProxyPhase()); + if (NodeCounterPhase.Options.NodeCounters.getValue(options)) { + appendPhase(new NodeCounterPhase(NodeCounterPhase.Stage.LATE)); + } + appendPhase(new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.HIGH_TIER)); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/LowTier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.phases; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/phases/MidTier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.phases; import static org.graalvm.compiler.core.common.GraalOptions.ConditionalElimination; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core/src/org/graalvm/compiler/core/target/Backend.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.target; import java.util.ArrayList; @@ -41,7 +43,6 @@ import org.graalvm.compiler.lir.gen.LIRGenerationResult; import org.graalvm.compiler.lir.gen.LIRGeneratorTool; import org.graalvm.compiler.nodes.StructuredGraph; -import org.graalvm.compiler.nodes.GraphSpeculationLog; import org.graalvm.compiler.nodes.spi.NodeLIRBuilderTool; import org.graalvm.compiler.phases.tiers.SuitesProvider; import org.graalvm.compiler.phases.tiers.TargetProvider; @@ -210,7 +211,7 @@ try { preCodeInstallationTasks(tasks, compilationResult, predefinedInstalledCode); CompiledCode compiledCode = createCompiledCode(method, compilationRequest, compilationResult); - installedCode = getProviders().getCodeCache().installCode(method, compiledCode, predefinedInstalledCode, GraphSpeculationLog.unwrap(speculationLog), isDefault); + installedCode = getProviders().getCodeCache().installCode(method, compiledCode, predefinedInstalledCode, speculationLog, isDefault); assert predefinedInstalledCode == null || installedCode == predefinedInstalledCode; } catch (Throwable t) { failCodeInstallationTasks(tasks, t); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLoweringByUse.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLoweringByUse.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLoweringByUse.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressLoweringByUse.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ * questions. */ + + package org.graalvm.compiler.core.aarch64; import org.graalvm.compiler.asm.aarch64.AArch64Address; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64AddressNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.aarch64; import org.graalvm.compiler.asm.aarch64.AArch64Address; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ArithmeticLIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.aarch64; import static jdk.vm.ci.aarch64.AArch64.sp; @@ -134,24 +136,24 @@ @Override public Value emitDiv(Value a, Value b, LIRFrameState state) { - return emitBinary(LIRKind.combine(a, b), getOpCode(a, AArch64ArithmeticOp.DIV, AArch64ArithmeticOp.FDIV), false, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b)); + return emitBinary(LIRKind.combine(a, b), getOpCode(a, AArch64ArithmeticOp.DIV, AArch64ArithmeticOp.FDIV), false, asAllocatable(a), asAllocatable(b)); } @Override public Value emitRem(Value a, Value b, LIRFrameState state) { - return emitBinary(LIRKind.combine(a, b), getOpCode(a, AArch64ArithmeticOp.REM, AArch64ArithmeticOp.FREM), false, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b)); + return emitBinary(LIRKind.combine(a, b), getOpCode(a, AArch64ArithmeticOp.REM, AArch64ArithmeticOp.FREM), false, asAllocatable(a), asAllocatable(b)); } @Override public Value emitUDiv(Value a, Value b, LIRFrameState state) { assert isNumericInteger(a.getPlatformKind()); - return emitBinary(LIRKind.combine(a, b), AArch64ArithmeticOp.UDIV, false, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b)); + return emitBinary(LIRKind.combine(a, b), AArch64ArithmeticOp.UDIV, false, asAllocatable(a), asAllocatable(b)); } @Override public Value emitURem(Value a, Value b, LIRFrameState state) { assert isNumericInteger(a.getPlatformKind()); - return emitBinary(LIRKind.combine(a, b), AArch64ArithmeticOp.UREM, false, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b)); + return emitBinary(LIRKind.combine(a, b), AArch64ArithmeticOp.UREM, false, asAllocatable(a), asAllocatable(b)); } @Override @@ -195,7 +197,7 @@ PlatformKind resultPlatformKind = getFloatConvertResultKind(op); LIRKind resultLirKind = LIRKind.combine(inputVal).changeType(resultPlatformKind); Variable result = getLIRGen().newVariable(resultLirKind); - getLIRGen().append(new AArch64FloatConvertOp(op, result, getLIRGen().asAllocatable(inputVal))); + getLIRGen().append(new AArch64FloatConvertOp(op, result, asAllocatable(inputVal))); return result; } @@ -227,7 +229,7 @@ return inputVal; } Variable result = getLIRGen().newVariable(to); - getLIRGen().append(new AArch64ReinterpretOp(result, getLIRGen().asAllocatable(inputVal))); + getLIRGen().append(new AArch64ReinterpretOp(result, asAllocatable(inputVal))); return result; } @@ -273,7 +275,7 @@ return new ConstantValue(resultKind, JavaConstant.forLong((constant << shiftCount) >> shiftCount)); } Variable result = getLIRGen().newVariable(resultKind); - getLIRGen().append(new AArch64SignExtendOp(result, getLIRGen().asAllocatable(inputVal), fromBits, toBits)); + getLIRGen().append(new AArch64SignExtendOp(result, asAllocatable(inputVal), fromBits, toBits)); return result; } @@ -290,11 +292,11 @@ protected Variable emitBinary(ValueKind<?> resultKind, AArch64ArithmeticOp op, boolean commutative, Value a, Value b) { Variable result = getLIRGen().newVariable(resultKind); if (isValidBinaryConstant(op, a, b)) { - emitBinaryConst(result, op, getLIRGen().asAllocatable(a), asJavaConstant(b)); + emitBinaryConst(result, op, asAllocatable(a), asJavaConstant(b)); } else if (commutative && isValidBinaryConstant(op, b, a)) { - emitBinaryConst(result, op, getLIRGen().asAllocatable(b), asJavaConstant(a)); + emitBinaryConst(result, op, asAllocatable(b), asJavaConstant(a)); } else { - emitBinaryVar(result, op, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b)); + emitBinaryVar(result, op, asAllocatable(a), asAllocatable(b)); } return result; } @@ -397,26 +399,26 @@ @Override public Value emitBitScanReverse(Value value) { Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AArch64Kind.DWORD)); - getLIRGen().append(new AArch64BitManipulationOp(BSR, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AArch64BitManipulationOp(BSR, result, asAllocatable(value))); return result; } @Override public Value emitCountLeadingZeros(Value value) { Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AArch64Kind.DWORD)); - getLIRGen().append(new AArch64BitManipulationOp(CLZ, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AArch64BitManipulationOp(CLZ, result, asAllocatable(value))); return result; } @Override public Value emitCountTrailingZeros(Value value) { Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AArch64Kind.DWORD)); - getLIRGen().append(new AArch64BitManipulationOp(CTZ, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AArch64BitManipulationOp(CTZ, result, asAllocatable(value))); return result; } private Variable emitUnary(AArch64ArithmeticOp op, Value inputVal) { - AllocatableValue input = getLIRGen().asAllocatable(inputVal); + AllocatableValue input = asAllocatable(inputVal); Variable result = getLIRGen().newVariable(LIRKind.combine(input)); getLIRGen().append(new AArch64ArithmeticOp.UnaryOp(op, result, input)); return result; @@ -462,7 +464,7 @@ return; } } - AllocatableValue input = getLIRGen().asAllocatable(inputVal); + AllocatableValue input = asAllocatable(inputVal); getLIRGen().append(new StoreOp(kind, storeAddress, input, state)); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64FloatConvertOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.aarch64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.aarch64; import static org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64LIRKindTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.aarch64; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64MoveFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.aarch64; import static org.graalvm.compiler.lir.LIRValueUtil.asConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeLIRBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.aarch64; import org.graalvm.compiler.core.gen.NodeLIRBuilder; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64NodeMatchRules.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.aarch64; import org.graalvm.compiler.core.gen.NodeMatchRules; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ * questions. */ + + package org.graalvm.compiler.core.aarch64; import jdk.vm.ci.aarch64.AArch64Kind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadReplacementPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadReplacementPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadReplacementPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64ReadReplacementPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ * questions. */ + + package org.graalvm.compiler.core.aarch64; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesCreator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesCreator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesCreator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.aarch64/src/org/graalvm/compiler/core/aarch64/AArch64SuitesCreator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.aarch64; import java.util.ListIterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressLowering.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.amd64; import org.graalvm.compiler.asm.amd64.AMD64Address.Scale; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64AddressNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.amd64; import org.graalvm.compiler.asm.amd64.AMD64Address.Scale; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64ArithmeticLIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.amd64; import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.ADD; @@ -132,11 +134,13 @@ private static final RegisterValue RCX_I = AMD64.rcx.asValue(LIRKind.value(AMD64Kind.DWORD)); - public AMD64ArithmeticLIRGenerator(Maths maths) { + public AMD64ArithmeticLIRGenerator(AllocatableValue nullRegisterValue, Maths maths) { + this.nullRegisterValue = nullRegisterValue; this.maths = maths == null ? new Maths() { } : maths; } + private final AllocatableValue nullRegisterValue; private final Maths maths; /** @@ -168,7 +172,7 @@ @Override public Variable emitNegate(Value inputVal) { - AllocatableValue input = getLIRGen().asAllocatable(inputVal); + AllocatableValue input = asAllocatable(inputVal); Variable result = getLIRGen().newVariable(LIRKind.combine(input)); TargetDescription target = getLIRGen().target(); boolean isAvx = ((AMD64) target.arch).getFeatures().contains(CPUFeature.AVX); @@ -201,7 +205,7 @@ @Override public Variable emitNot(Value inputVal) { - AllocatableValue input = getLIRGen().asAllocatable(inputVal); + AllocatableValue input = asAllocatable(inputVal); Variable result = getLIRGen().newVariable(LIRKind.combine(input)); switch ((AMD64Kind) input.getPlatformKind()) { case DWORD: @@ -218,31 +222,31 @@ private Variable emitBinary(LIRKind resultKind, AMD64BinaryArithmetic op, OperandSize size, boolean commutative, Value a, Value b, boolean setFlags) { if (isJavaConstant(b)) { - return emitBinaryConst(resultKind, op, size, commutative, getLIRGen().asAllocatable(a), asConstantValue(b), setFlags); + return emitBinaryConst(resultKind, op, size, commutative, asAllocatable(a), asConstantValue(b), setFlags); } else if (commutative && isJavaConstant(a)) { - return emitBinaryConst(resultKind, op, size, commutative, getLIRGen().asAllocatable(b), asConstantValue(a), setFlags); + return emitBinaryConst(resultKind, op, size, commutative, asAllocatable(b), asConstantValue(a), setFlags); } else { - return emitBinaryVar(resultKind, op.getRMOpcode(size), size, commutative, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b)); + return emitBinaryVar(resultKind, op.getRMOpcode(size), size, commutative, asAllocatable(a), asAllocatable(b)); } } private Variable emitBinary(LIRKind resultKind, AMD64RMOp op, OperandSize size, boolean commutative, Value a, Value b) { if (isJavaConstant(b)) { - return emitBinaryConst(resultKind, op, size, getLIRGen().asAllocatable(a), asJavaConstant(b)); + return emitBinaryConst(resultKind, op, size, asAllocatable(a), asJavaConstant(b)); } else if (commutative && isJavaConstant(a)) { - return emitBinaryConst(resultKind, op, size, getLIRGen().asAllocatable(b), asJavaConstant(a)); + return emitBinaryConst(resultKind, op, size, asAllocatable(b), asJavaConstant(a)); } else { - return emitBinaryVar(resultKind, op, size, commutative, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b)); + return emitBinaryVar(resultKind, op, size, commutative, asAllocatable(a), asAllocatable(b)); } } private Variable emitBinary(LIRKind resultKind, AMD64RRMOp op, OperandSize size, boolean commutative, Value a, Value b) { if (isJavaConstant(b)) { - return emitBinaryConst(resultKind, op, size, getLIRGen().asAllocatable(a), asJavaConstant(b)); + return emitBinaryConst(resultKind, op, size, asAllocatable(a), asJavaConstant(b)); } else if (commutative && isJavaConstant(a)) { - return emitBinaryConst(resultKind, op, size, getLIRGen().asAllocatable(b), asJavaConstant(a)); + return emitBinaryConst(resultKind, op, size, asAllocatable(b), asJavaConstant(a)); } else { - return emitBinaryVar(resultKind, op, size, commutative, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b)); + return emitBinaryVar(resultKind, op, size, commutative, asAllocatable(a), asAllocatable(b)); } } @@ -263,7 +267,7 @@ getLIRGen().append(new AMD64Binary.ConstOp(op, size, result, a, constant)); return result; } else { - return emitBinaryVar(resultKind, op.getRMOpcode(size), size, commutative, a, getLIRGen().asAllocatable(b)); + return emitBinaryVar(resultKind, op.getRMOpcode(size), size, commutative, a, asAllocatable(b)); } } @@ -325,7 +329,7 @@ private Variable emitBaseOffsetLea(LIRKind resultKind, Value base, int offset, OperandSize size) { Variable result = getLIRGen().newVariable(resultKind); - AMD64AddressValue address = new AMD64AddressValue(resultKind, getLIRGen().asAllocatable(base), offset); + AMD64AddressValue address = new AMD64AddressValue(resultKind, asAllocatable(base), offset); getLIRGen().append(new AMD64Move.LeaOp(result, address, size)); return result; } @@ -409,17 +413,17 @@ getLIRGen().append(new AMD64Binary.RMIOp(op, size, ret, a, imm)); return ret; } else { - return emitBinaryVar(LIRKind.combine(a, b), AMD64RMOp.IMUL, size, true, a, getLIRGen().asAllocatable(b)); + return emitBinaryVar(LIRKind.combine(a, b), AMD64RMOp.IMUL, size, true, a, asAllocatable(b)); } } private Variable emitIMUL(OperandSize size, Value a, Value b) { if (isJavaConstant(b)) { - return emitIMULConst(size, getLIRGen().asAllocatable(a), asConstantValue(b)); + return emitIMULConst(size, asAllocatable(a), asConstantValue(b)); } else if (isJavaConstant(a)) { - return emitIMULConst(size, getLIRGen().asAllocatable(b), asConstantValue(a)); + return emitIMULConst(size, asAllocatable(b), asConstantValue(a)); } else { - return emitBinaryVar(LIRKind.combine(a, b), AMD64RMOp.IMUL, size, true, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b)); + return emitBinaryVar(LIRKind.combine(a, b), AMD64RMOp.IMUL, size, true, asAllocatable(a), asAllocatable(b)); } } @@ -457,7 +461,7 @@ } private Value emitMulHigh(AMD64MOp opcode, OperandSize size, Value a, Value b) { - AMD64MulDivOp mulHigh = getLIRGen().append(new AMD64MulDivOp(opcode, size, LIRKind.combine(a, b), moveToReg(AMD64.rax, a), getLIRGen().asAllocatable(b))); + AMD64MulDivOp mulHigh = getLIRGen().append(new AMD64MulDivOp(opcode, size, LIRKind.combine(a, b), moveToReg(AMD64.rax, a), asAllocatable(b))); return getLIRGen().emitMove(mulHigh.getHighResult()); } @@ -530,7 +534,7 @@ LIRKind kind = LIRKind.combine(a, b); AMD64SignExtendOp sx = getLIRGen().append(new AMD64SignExtendOp(size, kind, moveToReg(AMD64.rax, a))); - return getLIRGen().append(new AMD64MulDivOp(AMD64MOp.IDIV, size, kind, sx.getHighResult(), sx.getLowResult(), getLIRGen().asAllocatable(b), state)); + return getLIRGen().append(new AMD64MulDivOp(AMD64MOp.IDIV, size, kind, sx.getHighResult(), sx.getLowResult(), asAllocatable(b), state)); } private AMD64MulDivOp emitDIV(OperandSize size, Value a, Value b, LIRFrameState state) { @@ -539,7 +543,7 @@ RegisterValue rax = moveToReg(AMD64.rax, a); RegisterValue rdx = AMD64.rdx.asValue(kind); getLIRGen().append(new AMD64ClearRegisterOp(size, rdx)); - return getLIRGen().append(new AMD64MulDivOp(AMD64MOp.DIV, size, kind, rdx, rax, getLIRGen().asAllocatable(b), state)); + return getLIRGen().append(new AMD64MulDivOp(AMD64MOp.DIV, size, kind, rdx, rax, asAllocatable(b), state)); } public Value[] emitSignedDivRem(Value a, Value b, LIRFrameState state) { @@ -740,7 +744,7 @@ private Variable emitShift(AMD64Shift op, OperandSize size, Value a, Value b) { Variable result = getLIRGen().newVariable(LIRKind.combine(a, b).changeType(a.getPlatformKind())); - AllocatableValue input = getLIRGen().asAllocatable(a); + AllocatableValue input = asAllocatable(a); if (isJavaConstant(b)) { JavaConstant c = asJavaConstant(b); if (c.asLong() == 1) { @@ -819,13 +823,13 @@ private AllocatableValue emitConvertOp(LIRKind kind, AMD64RMOp op, OperandSize size, Value input) { Variable result = getLIRGen().newVariable(kind); - getLIRGen().append(new AMD64Unary.RMOp(op, size, result, getLIRGen().asAllocatable(input))); + getLIRGen().append(new AMD64Unary.RMOp(op, size, result, asAllocatable(input))); return result; } private AllocatableValue emitConvertOp(LIRKind kind, AMD64MROp op, OperandSize size, Value input) { Variable result = getLIRGen().newVariable(kind); - getLIRGen().append(new AMD64Unary.MROp(op, size, result, getLIRGen().asAllocatable(input))); + getLIRGen().append(new AMD64Unary.MROp(op, size, result, asAllocatable(input))); return result; } @@ -836,7 +840,7 @@ return inputVal; } - AllocatableValue input = getLIRGen().asAllocatable(inputVal); + AllocatableValue input = asAllocatable(inputVal); /* * Conversions between integer to floating point types require moves between CPU and FPU * registers. @@ -950,7 +954,7 @@ assert inputVal.getPlatformKind() == AMD64Kind.QWORD; Variable result = getLIRGen().newVariable(LIRKind.combine(inputVal)); long mask = CodeUtil.mask(fromBits); - getLIRGen().append(new AMD64Binary.DataTwoOp(AND.getRMOpcode(QWORD), QWORD, result, getLIRGen().asAllocatable(inputVal), JavaConstant.forLong(mask))); + getLIRGen().append(new AMD64Binary.DataTwoOp(AND.getRMOpcode(QWORD), QWORD, result, asAllocatable(inputVal), JavaConstant.forLong(mask))); return result; } else { LIRKind resultKind = LIRKind.combine(inputVal); @@ -983,7 +987,7 @@ } else { mask = JavaConstant.forInt((int) CodeUtil.mask(fromBits)); } - getLIRGen().append(new AMD64Binary.DataTwoOp(AND.getRMOpcode(DWORD), DWORD, result, getLIRGen().asAllocatable(inputVal), mask)); + getLIRGen().append(new AMD64Binary.DataTwoOp(AND.getRMOpcode(DWORD), DWORD, result, asAllocatable(inputVal), mask)); return result; } } @@ -993,9 +997,9 @@ Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD)); assert ((AMD64Kind) value.getPlatformKind()).isInteger(); if (value.getPlatformKind() == AMD64Kind.QWORD) { - getLIRGen().append(new AMD64Unary.RMOp(POPCNT, QWORD, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AMD64Unary.RMOp(POPCNT, QWORD, result, asAllocatable(value))); } else { - getLIRGen().append(new AMD64Unary.RMOp(POPCNT, DWORD, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AMD64Unary.RMOp(POPCNT, DWORD, result, asAllocatable(value))); } return result; } @@ -1003,7 +1007,7 @@ @Override public Variable emitBitScanForward(Value value) { Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD)); - getLIRGen().append(new AMD64Unary.RMOp(BSF, QWORD, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AMD64Unary.RMOp(BSF, QWORD, result, asAllocatable(value))); return result; } @@ -1012,9 +1016,9 @@ Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD)); assert ((AMD64Kind) value.getPlatformKind()).isInteger(); if (value.getPlatformKind() == AMD64Kind.QWORD) { - getLIRGen().append(new AMD64Unary.RMOp(BSR, QWORD, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AMD64Unary.RMOp(BSR, QWORD, result, asAllocatable(value))); } else { - getLIRGen().append(new AMD64Unary.RMOp(BSR, DWORD, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AMD64Unary.RMOp(BSR, DWORD, result, asAllocatable(value))); } return result; } @@ -1024,9 +1028,9 @@ Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD)); assert ((AMD64Kind) value.getPlatformKind()).isInteger(); if (value.getPlatformKind() == AMD64Kind.QWORD) { - getLIRGen().append(new AMD64Unary.RMOp(LZCNT, QWORD, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AMD64Unary.RMOp(LZCNT, QWORD, result, asAllocatable(value))); } else { - getLIRGen().append(new AMD64Unary.RMOp(LZCNT, DWORD, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AMD64Unary.RMOp(LZCNT, DWORD, result, asAllocatable(value))); } return result; } @@ -1036,9 +1040,9 @@ Variable result = getLIRGen().newVariable(LIRKind.combine(value).changeType(AMD64Kind.DWORD)); assert ((AMD64Kind) value.getPlatformKind()).isInteger(); if (value.getPlatformKind() == AMD64Kind.QWORD) { - getLIRGen().append(new AMD64Unary.RMOp(TZCNT, QWORD, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AMD64Unary.RMOp(TZCNT, QWORD, result, asAllocatable(value))); } else { - getLIRGen().append(new AMD64Unary.RMOp(TZCNT, DWORD, result, getLIRGen().asAllocatable(value))); + getLIRGen().append(new AMD64Unary.RMOp(TZCNT, DWORD, result, asAllocatable(value))); } return result; } @@ -1048,10 +1052,10 @@ Variable result = getLIRGen().newVariable(LIRKind.combine(input)); switch ((AMD64Kind) input.getPlatformKind()) { case SINGLE: - getLIRGen().append(new AMD64Binary.DataTwoOp(SSEOp.AND, PS, result, getLIRGen().asAllocatable(input), JavaConstant.forFloat(Float.intBitsToFloat(0x7FFFFFFF)), 16)); + getLIRGen().append(new AMD64Binary.DataTwoOp(SSEOp.AND, PS, result, asAllocatable(input), JavaConstant.forFloat(Float.intBitsToFloat(0x7FFFFFFF)), 16)); break; case DOUBLE: - getLIRGen().append(new AMD64Binary.DataTwoOp(SSEOp.AND, PD, result, getLIRGen().asAllocatable(input), JavaConstant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL)), 16)); + getLIRGen().append(new AMD64Binary.DataTwoOp(SSEOp.AND, PD, result, asAllocatable(input), JavaConstant.forDouble(Double.longBitsToDouble(0x7FFFFFFFFFFFFFFFL)), 16)); break; default: throw GraalError.shouldNotReachHere(); @@ -1064,10 +1068,10 @@ Variable result = getLIRGen().newVariable(LIRKind.combine(input)); switch ((AMD64Kind) input.getPlatformKind()) { case SINGLE: - getLIRGen().append(new AMD64Unary.RMOp(SSEOp.SQRT, SS, result, getLIRGen().asAllocatable(input))); + getLIRGen().append(new AMD64Unary.RMOp(SSEOp.SQRT, SS, result, asAllocatable(input))); break; case DOUBLE: - getLIRGen().append(new AMD64Unary.RMOp(SSEOp.SQRT, SD, result, getLIRGen().asAllocatable(input))); + getLIRGen().append(new AMD64Unary.RMOp(SSEOp.SQRT, SD, result, asAllocatable(input))); break; default: throw GraalError.shouldNotReachHere(); @@ -1082,7 +1086,7 @@ if (result == null) { result = gen.newVariable(LIRKind.combine(input)); AllocatableValue stackSlot = gen.getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD)); - gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), base10 ? LOG10 : LOG, result, gen.asAllocatable(input), stackSlot)); + gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), base10 ? LOG10 : LOG, result, asAllocatable(input), stackSlot)); } return result; } @@ -1094,7 +1098,7 @@ if (result == null) { result = gen.newVariable(LIRKind.combine(input)); AllocatableValue stackSlot = gen.getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD)); - gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), COS, result, gen.asAllocatable(input), stackSlot)); + gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), COS, result, asAllocatable(input), stackSlot)); } return result; } @@ -1106,7 +1110,7 @@ if (result == null) { result = gen.newVariable(LIRKind.combine(input)); AllocatableValue stackSlot = gen.getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD)); - gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), SIN, result, gen.asAllocatable(input), stackSlot)); + gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), SIN, result, asAllocatable(input), stackSlot)); } return result; } @@ -1118,7 +1122,7 @@ if (result == null) { result = gen.newVariable(LIRKind.combine(input)); AllocatableValue stackSlot = gen.getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD)); - gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), TAN, result, gen.asAllocatable(input), stackSlot)); + gen.append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), TAN, result, asAllocatable(input), stackSlot)); } return result; } @@ -1127,14 +1131,14 @@ public Value emitMathExp(Value input) { Variable result = getLIRGen().newVariable(LIRKind.combine(input)); AllocatableValue stackSlot = getLIRGen().getResult().getFrameMapBuilder().allocateSpillSlot(LIRKind.value(AMD64Kind.QWORD)); - getLIRGen().append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), EXP, result, getLIRGen().asAllocatable(input), stackSlot)); + getLIRGen().append(new AMD64MathIntrinsicUnaryOp(getAMD64LIRGen(), EXP, result, asAllocatable(input), stackSlot)); return result; } @Override public Value emitMathPow(Value input1, Value input2) { Variable result = getLIRGen().newVariable(LIRKind.combine(input1)); - getLIRGen().append(new AMD64MathIntrinsicBinaryOp(getAMD64LIRGen(), POW, result, getLIRGen().asAllocatable(input1), getLIRGen().asAllocatable(input2))); + getLIRGen().append(new AMD64MathIntrinsicBinaryOp(getAMD64LIRGen(), POW, result, asAllocatable(input1), asAllocatable(input2))); return result; } @@ -1233,7 +1237,7 @@ } // fallback: load, then store - emitStore(kind, address, getLIRGen().asAllocatable(value), state); + emitStore(kind, address, asAllocatable(value), state); } protected void emitStore(AMD64Kind kind, AMD64AddressValue address, AllocatableValue value, LIRFrameState state) { @@ -1268,10 +1272,15 @@ if (isConstantValue(input)) { emitStoreConst(kind, storeAddress, asConstantValue(input), state); } else { - emitStore(kind, storeAddress, getLIRGen().asAllocatable(input), state); + emitStore(kind, storeAddress, asAllocatable(input), state); } } + private boolean mustReplaceNullWithNullRegister(Constant nullConstant) { + /* Uncompressed null pointers only */ + return nullRegisterValue != null && JavaConstant.NULL_POINTER.equals(nullConstant); + } + @Override public void emitCompareOp(AMD64Kind cmpKind, Variable left, Value right) { OperandSize size; @@ -1289,10 +1298,10 @@ size = QWORD; break; case SINGLE: - getLIRGen().append(new AMD64BinaryConsumer.Op(SSEOp.UCOMIS, PS, left, getLIRGen().asAllocatable(right))); + getLIRGen().append(new AMD64BinaryConsumer.Op(SSEOp.UCOMIS, PS, left, asAllocatable(right))); return; case DOUBLE: - getLIRGen().append(new AMD64BinaryConsumer.Op(SSEOp.UCOMIS, PD, left, getLIRGen().asAllocatable(right))); + getLIRGen().append(new AMD64BinaryConsumer.Op(SSEOp.UCOMIS, PD, left, asAllocatable(right))); return; default: throw GraalError.shouldNotReachHere("unexpected kind: " + cmpKind); @@ -1301,7 +1310,11 @@ if (isConstantValue(right)) { Constant c = LIRValueUtil.asConstant(right); if (JavaConstant.isNull(c)) { - getLIRGen().append(new AMD64BinaryConsumer.Op(TEST, size, left, left)); + if (mustReplaceNullWithNullRegister(c)) { + getLIRGen().append(new AMD64BinaryConsumer.Op(AMD64RMOp.CMP, size, left, nullRegisterValue)); + } else { + getLIRGen().append(new AMD64BinaryConsumer.Op(TEST, size, left, left)); + } return; } else if (c instanceof VMConstant) { VMConstant vc = (VMConstant) c; @@ -1325,7 +1338,7 @@ } // fallback: load, then compare - getLIRGen().append(new AMD64BinaryConsumer.Op(CMP.getRMOpcode(size), size, left, getLIRGen().asAllocatable(right))); + getLIRGen().append(new AMD64BinaryConsumer.Op(CMP.getRMOpcode(size), size, left, asAllocatable(right))); } @Override @@ -1333,9 +1346,9 @@ Variable result = getLIRGen().newVariable(LIRKind.combine(value)); assert ((AMD64Kind) value.getPlatformKind()).isXMM(); if (value.getPlatformKind() == AMD64Kind.SINGLE) { - getLIRGen().append(new AMD64Binary.RMIOp(AMD64RMIOp.ROUNDSS, OperandSize.PD, result, getLIRGen().asAllocatable(value), mode.encoding)); + getLIRGen().append(new AMD64Binary.RMIOp(AMD64RMIOp.ROUNDSS, OperandSize.PD, result, asAllocatable(value), mode.encoding)); } else { - getLIRGen().append(new AMD64Binary.RMIOp(AMD64RMIOp.ROUNDSD, OperandSize.PD, result, getLIRGen().asAllocatable(value), mode.encoding)); + getLIRGen().append(new AMD64Binary.RMIOp(AMD64RMIOp.ROUNDSD, OperandSize.PD, result, asAllocatable(value), mode.encoding)); } return result; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64CompressAddressLowering.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64CompressAddressLowering.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64CompressAddressLowering.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64CompressAddressLowering.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.amd64; import jdk.vm.ci.code.Register; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.amd64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64LIRKindTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.amd64; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactoryBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.amd64; import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.QWORD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64MoveFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.amd64; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeLIRBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.amd64; import static org.graalvm.compiler.core.amd64.AMD64NodeLIRBuilder.Options.MitigateSpeculativeExecutionAttacks; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64NodeMatchRules.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.amd64; import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.ADD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesCreator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesCreator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesCreator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64/src/org/graalvm/compiler/core/amd64/AMD64SuitesCreator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.amd64; import org.graalvm.compiler.java.DefaultSuitesCreator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AddressLoweringTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AddressLoweringTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AddressLoweringTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AddressLoweringTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.amd64.test; import static org.junit.Assume.assumeTrue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/AMD64AllocatorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.amd64.test; import static org.graalvm.compiler.core.common.GraalOptions.TraceRA; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/ConstantStackMoveTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.amd64.test; import static org.junit.Assume.assumeTrue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/MatchRuleTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.amd64.test; import static org.junit.Assume.assumeTrue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.amd64.test/src/org/graalvm/compiler/core/amd64/test/StackStoreTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.amd64.test; import static org.junit.Assume.assumeTrue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/BiDirectionalTraceBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.alloc; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/ComputeBlockOrder.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.common.alloc; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/RegisterAllocationConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.alloc; import jdk.internal.vm.compiler.collections.EconomicMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/SingleBlockTraceBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.alloc; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceBuilderResult.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.alloc; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/Trace.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.alloc; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.alloc; public class TraceMap<T> { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/TraceStatisticsPrinter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.alloc; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/alloc/UniDirectionalTraceBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.alloc; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/CanonicalCondition.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/CanonicalCondition.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/CanonicalCondition.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/CanonicalCondition.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.calc; import jdk.vm.ci.meta.Constant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/Condition.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.calc; import org.graalvm.compiler.debug.GraalError; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvertCategory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvertCategory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvertCategory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvertCategory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.calc; public enum FloatConvertCategory { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/FloatConvert.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.calc; import org.graalvm.compiler.debug.GraalError; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/calc/UnsignedMath.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.calc; //JaCoCo Exclude diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CancellationBailoutException.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CancellationBailoutException.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CancellationBailoutException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CancellationBailoutException.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractBlockBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.cfg; public abstract class AbstractBlockBase<T extends AbstractBlockBase<T>> { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/AbstractControlFlowGraph.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.cfg; import java.util.Collection; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/BlockMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.cfg; public class BlockMap<T> { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/CFGVerifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.cfg; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/DominatorOptimizationProblem.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.cfg; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/Loop.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.common.cfg; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableCFG.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.cfg; import java.util.function.BiConsumer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PrintableDominatorOptimizationProblem.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.cfg; import java.util.function.BiConsumer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/cfg/PropertyConsumable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.cfg; import java.util.function.BiConsumer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationIdentifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; import jdk.vm.ci.code.CompilationRequest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompilationRequestIdentifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; import jdk.vm.ci.code.CompilationRequest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompressEncoding.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompressEncoding.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompressEncoding.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/CompressEncoding.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldIntrospection.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; public abstract class FieldIntrospection<T> { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/Fields.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; import static org.graalvm.compiler.core.common.UnsafeAccess.UNSAFE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/FieldsScanner.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; import static org.graalvm.compiler.core.common.UnsafeAccess.UNSAFE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalBailoutException.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalBailoutException.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalBailoutException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalBailoutException.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; import jdk.vm.ci.code.BailoutException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/GraalOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; import org.graalvm.compiler.options.Option; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/LIRKind.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/NumUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/NumUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/NumUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/NumUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; // JaCoCo Exclude diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/PermanentBailoutException.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/PermanentBailoutException.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/PermanentBailoutException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/PermanentBailoutException.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; public class PermanentBailoutException extends GraalBailoutException { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/RetryableBailoutException.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/RetryableBailoutException.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/RetryableBailoutException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/RetryableBailoutException.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; public class RetryableBailoutException extends GraalBailoutException { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ArrayOffsetProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ArrayOffsetProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ArrayOffsetProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ArrayOffsetProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.spi; import jdk.vm.ci.meta.JavaKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/CodeGenProviders.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.spi; import jdk.vm.ci.code.CodeCacheProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ConstantFieldProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.spi; import org.graalvm.compiler.options.OptionValues; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallDescriptor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.spi; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallLinkage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.spi; import jdk.vm.ci.code.CallingConvention; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/ForeignCallsProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.spi; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/JavaConstantFieldProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.spi; import org.graalvm.compiler.debug.GraalError; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/spi/LIRKindTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.spi; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/SuppressFBWarnings.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractObjectStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import java.util.AbstractList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/AbstractPointerStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import jdk.vm.ci.meta.Constant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticOpTable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import static jdk.vm.ci.meta.MetaUtil.getSimpleName; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ArithmeticStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import java.nio.ByteBuffer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/DataPointerConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import jdk.vm.ci.meta.Constant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/FloatStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import static org.graalvm.compiler.core.common.calc.FloatConvert.D2F; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IllegalStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/IntegerStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import static org.graalvm.compiler.core.common.calc.FloatConvert.I2D; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/ObjectStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/PrimitiveStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import jdk.vm.ci.meta.Constant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/RawPointerStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import static jdk.vm.ci.code.CodeUtil.signExtend; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/Stamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/StampPair.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/TypeReference.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import jdk.vm.ci.meta.Assumptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/type/VoidStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.type; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/UnsafeAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/BitMap2D.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; import java.util.BitSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/CompilationAlarm.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; import org.graalvm.compiler.debug.Assertions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/FrequencyEncoder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/IntList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ReversedList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ReversedList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ReversedList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/ReversedList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; import java.util.AbstractList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeConversion.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeReader.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/TypeWriter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeReader.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; import static org.graalvm.compiler.core.common.util.UnsafeAccess.UNSAFE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsafeArrayTypeWriter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; import static org.graalvm.compiler.core.common.util.TypeConversion.asS1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsignedLong.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsignedLong.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsignedLong.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/UnsignedLong.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; public final class UnsignedLong { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.common/src/org/graalvm/compiler/core/common/util/Util.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.common.util; import java.lang.reflect.AccessibleObject; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.match.processor/src/org/graalvm/compiler/core/match/processor/MatchProcessor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.match.processor; import java.io.FileWriter; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCAddressLowering.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.sparc; import org.graalvm.compiler.asm.sparc.SPARCAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCArithmeticLIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.Op3s.Add; @@ -113,7 +115,7 @@ @Override public Variable emitBitCount(Value operand) { Variable result = getLIRGen().newVariable(LIRKind.combine(operand).changeType(SPARCKind.WORD)); - AllocatableValue usedOperand = getLIRGen().asAllocatable(emitZeroExtend(operand)); + AllocatableValue usedOperand = asAllocatable(emitZeroExtend(operand)); getLIRGen().append(new SPARCOP3Op(Op3s.Popc, g0.asValue(), usedOperand, result)); return result; } @@ -121,7 +123,7 @@ @Override public Variable emitBitScanForward(Value operand) { Variable result = getLIRGen().newVariable(LIRKind.combine(operand).changeType(SPARCKind.WORD)); - getLIRGen().append(new SPARCBitManipulationOp(BSF, result, getLIRGen().asAllocatable(operand), getLIRGen())); + getLIRGen().append(new SPARCBitManipulationOp(BSF, result, asAllocatable(operand), getLIRGen())); return result; } @@ -129,9 +131,9 @@ public Variable emitBitScanReverse(Value operand) { Variable result = getLIRGen().newVariable(LIRKind.combine(operand).changeType(SPARCKind.WORD)); if (operand.getPlatformKind() == SPARCKind.XWORD) { - getLIRGen().append(new SPARCBitManipulationOp(LBSR, result, getLIRGen().asAllocatable(operand), getLIRGen())); + getLIRGen().append(new SPARCBitManipulationOp(LBSR, result, asAllocatable(operand), getLIRGen())); } else { - getLIRGen().append(new SPARCBitManipulationOp(IBSR, result, getLIRGen().asAllocatable(operand), getLIRGen())); + getLIRGen().append(new SPARCBitManipulationOp(IBSR, result, asAllocatable(operand), getLIRGen())); } return result; } @@ -151,7 +153,7 @@ default: throw GraalError.shouldNotReachHere("Input kind: " + kind); } - getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), getLIRGen().asAllocatable(inputValue), result)); + getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), asAllocatable(inputValue), result)); return result; } @@ -170,7 +172,7 @@ default: throw GraalError.shouldNotReachHere("Input kind: " + kind); } - getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), getLIRGen().asAllocatable(inputValue), result)); + getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), asAllocatable(inputValue), result)); return result; } @@ -191,7 +193,7 @@ private Variable emitUnary(Opfs opf, Value inputValue) { Variable result = getLIRGen().newVariable(LIRKind.combine(inputValue)); - getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), getLIRGen().asAllocatable(inputValue), result)); + getLIRGen().append(new SPARCOPFOp(opf, g0.asValue(), asAllocatable(inputValue), result)); return result; } @@ -207,7 +209,7 @@ private Variable emitBinary(ValueKind<?> resultKind, Opfs opf, Value a, Value b, LIRFrameState state) { Variable result = getLIRGen().newVariable(resultKind); - getLIRGen().append(new SPARCOPFOp(opf, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b), result, state)); + getLIRGen().append(new SPARCOPFOp(opf, asAllocatable(a), asAllocatable(b), result, state)); return result; } @@ -377,7 +379,7 @@ default: throw GraalError.shouldNotReachHere(); } - getLIRGen().append(new RemOp(opcode, result, getLIRGen().asAllocatable(a), getLIRGen().asAllocatable(b), scratch1, scratch2, state)); + getLIRGen().append(new RemOp(opcode, result, asAllocatable(a), asAllocatable(b), scratch1, scratch2, state)); return result; } @@ -467,7 +469,7 @@ @Override public Value emitFloatConvert(FloatConvert op, Value inputValue) { - AllocatableValue inputAllocatable = getLIRGen().asAllocatable(inputValue); + AllocatableValue inputAllocatable = asAllocatable(inputValue); AllocatableValue result; switch (op) { case D2F: @@ -598,7 +600,7 @@ } return new ConstantValue(resultKind, JavaConstant.forLong((constant << shiftCount) >> shiftCount)); } else { - AllocatableValue inputAllocatable = getLIRGen().asAllocatable(inputVal); + AllocatableValue inputAllocatable = asAllocatable(inputVal); Variable result = getLIRGen().newVariable(resultKind); if (fromBits == WORD.getSizeInBits() && toBits == XWORD.getSizeInBits()) { getLIRGen().append(new SPARCOP3Op(Sra, inputAllocatable, g0.asValue(LIRKind.value(WORD)), result)); @@ -623,7 +625,7 @@ return inputValue; } Variable result = getLIRGen().newVariable(LIRKind.combine(inputValue).changeType(toBits > WORD.getSizeInBits() ? XWORD : WORD)); - AllocatableValue inputAllocatable = getLIRGen().asAllocatable(inputValue); + AllocatableValue inputAllocatable = asAllocatable(inputValue); if (fromBits == 32) { getLIRGen().append(new SPARCOP3Op(Srl, inputAllocatable, g0.asValue(), result)); } else { @@ -637,7 +639,7 @@ public AllocatableValue emitReinterpret(LIRKind to, Value inputVal) { SPARCKind fromKind = (SPARCKind) inputVal.getPlatformKind(); SPARCKind toKind = (SPARCKind) to.getPlatformKind(); - AllocatableValue input = getLIRGen().asAllocatable(inputVal); + AllocatableValue input = asAllocatable(inputVal); Variable result = getLIRGen().newVariable(to); // These cases require a move between CPU and FPU registers: if (fromKind.isFloat() != toKind.isFloat()) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCImmediateAddressNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.sparc; import org.graalvm.compiler.asm.sparc.SPARCAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIndexedAddressNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.sparc; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCIntegerCompareCanonicalizationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.sparc; import org.graalvm.compiler.core.common.type.IntegerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.FMOVDCC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCLIRKindTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.sparc; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCMoveFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.sparc; import static org.graalvm.compiler.lir.LIRValueUtil.asConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeLIRBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.sparc; import org.graalvm.compiler.core.gen.NodeLIRBuilder; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCNodeMatchRules.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.sparc; import static jdk.vm.ci.sparc.SPARCKind.BYTE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesCreator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesCreator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesCreator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.sparc/src/org/graalvm/compiler/core/sparc/SPARCSuitesCreator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.sparc; import java.util.ListIterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/AllocSpy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static java.lang.Boolean.parseBoolean; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ArrayLengthProviderTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ArrayLengthProviderTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ArrayLengthProviderTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ArrayLengthProviderTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/AllocatorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.backend; import java.util.HashSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/backend/BackendTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.backend; import org.graalvm.compiler.core.GraalCompiler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BasePhaseBinaryGraphTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BasePhaseBinaryGraphTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BasePhaseBinaryGraphTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BasePhaseBinaryGraphTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingEliminationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.loop.DefaultLoopPolicies; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/BoxingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ByteBufferTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ByteBufferTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ByteBufferTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ByteBufferTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.nio.ByteBuffer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CanonicalizedConversionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CanonicalizedConversionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CanonicalizedConversionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CanonicalizedConversionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CheckGraalInvariants.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CommonedConstantsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.graph.test.matchers.NodeIterableIsEmpty.isNotEmpty; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest3.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CompareCanonicalizerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConcreteSubtypeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import jdk.vm.ci.meta.Assumptions.Assumption; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationMulTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest10.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest11.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest12.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest12.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest12.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest12.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest13.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest13.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest13.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest13.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest14.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest14.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest14.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest14.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.graph.iterators.NodeIterable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest15.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest15.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest15.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest15.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest3.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Ignore; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest4.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest5.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest6.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest7.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Ignore; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest8.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTest9.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalEliminationTestBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalNodeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalNodeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalNodeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionalNodeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConditionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.junit.Assert.assertEquals; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ConstantArrayReadFoldingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CopyOfVirtualizationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.test; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CountedLoopTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CustomizedBytecodePatternTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CustomizedBytecodePatternTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CustomizedBytecodePatternTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/CustomizedBytecodePatternTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.objectweb.asm.Opcodes; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DegeneratedLoopsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DeMorganCanonicalizationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DeMorganCanonicalizationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DeMorganCanonicalizationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DeMorganCanonicalizationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/CompiledMethodTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.deopt; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/MonitorDeoptTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.core.test.deopt; import jdk.vm.ci.code.InstalledCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/RethrowDeoptMaterializeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/RethrowDeoptMaterializeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/RethrowDeoptMaterializeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/RethrowDeoptMaterializeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.core.test.deopt; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SafepointRethrowDeoptTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.core.test.deopt; import java.util.concurrent.CountDownLatch; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/deopt/SynchronizedMethodDeoptimizationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.deopt; import org.junit.Assume; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DirectByteBufferTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DirectByteBufferTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DirectByteBufferTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DirectByteBufferTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.nio.ByteBuffer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DontReuseArgumentSpaceTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DumpPathTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DumpPathTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DumpPathTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/DumpPathTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.io.IOException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/CountUppercaseParallelTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/CountUppercaseParallelTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/CountUppercaseParallelTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/CountUppercaseParallelTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EAMergingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EarlyReadEliminationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EATestBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/EscapeAnalysisTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/NestedBoxingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import java.lang.ref.SoftReference; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTreesTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTreesTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTreesTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeAnalysisTreesTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import java.util.HashSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeUnsafeStoreTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeUnsafeStoreTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeUnsafeStoreTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PartialEscapeUnsafeStoreTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAAssertionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PEAReadEliminationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/PoorMansEATest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/TrufflePEATest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/TrufflePEATest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/TrufflePEATest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/TrufflePEATest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ea/UnsafeEATest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.ea; import java.nio.ByteBuffer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/EnumSwitchTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FinalizableSubclassTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.io.ByteArrayOutputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueConcreteMethodBugTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import jdk.vm.ci.meta.Assumptions.AssumptionResult; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FindUniqueDefaultMethodTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatingReadTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/FloatOptimizationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerAssumptionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.code.CompilationResult; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalCompilerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static java.lang.reflect.Modifier.isStatic; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalDebugHandlersFactoryTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalDebugHandlersFactoryTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalDebugHandlersFactoryTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraalDebugHandlersFactoryTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphEncoderTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.lang.reflect.Method; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphResetDebugTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphResetDebugTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphResetDebugTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphResetDebugTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import jdk.internal.vm.compiler.collections.EconomicMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GraphScheduleTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardedIntrinsicTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardPrioritiesTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardPrioritiesTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardPrioritiesTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/GuardPrioritiesTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.graph.test.matchers.NodeIterableCount.hasCount; @@ -47,6 +49,8 @@ import org.graalvm.compiler.phases.tiers.HighTierContext; import org.junit.Test; +import jdk.vm.ci.meta.SpeculationLog; + public class GuardPrioritiesTest extends GraphScheduleTest { private int[] array; private int size; @@ -71,9 +75,10 @@ Iterator<GuardNode> iterator = guards.iterator(); GuardNode g1 = iterator.next(); GuardNode g2 = iterator.next(); - assertTrue("There should be one guard with speculation, the other one without", g1.getSpeculation().isNull() ^ g2.getSpeculation().isNull()); - GuardNode withSpeculation = g1.getSpeculation().isNull() ? g2 : g1; - GuardNode withoutSpeculation = g1.getSpeculation().isNull() ? g1 : g2; + assertTrue("There should be one guard with speculation, the other one without", + (g1.getSpeculation().equals(SpeculationLog.NO_SPECULATION)) ^ (g2.getSpeculation().equals(SpeculationLog.NO_SPECULATION))); + GuardNode withSpeculation = g1.getSpeculation().equals(SpeculationLog.NO_SPECULATION) ? g2 : g1; + GuardNode withoutSpeculation = g1.getSpeculation().equals(SpeculationLog.NO_SPECULATION) ? g1 : g2; assertOrderedAfterSchedule(graph, SchedulePhase.SchedulingStrategy.EARLIEST_WITH_GUARD_ORDER, withSpeculation, withoutSpeculation); } @@ -109,9 +114,9 @@ new SchedulePhase(SchedulePhase.SchedulingStrategy.EARLIEST_WITH_GUARD_ORDER).apply(graph); for (GuardNode g1 : graph.getNodes(GuardNode.TYPE)) { for (GuardNode g2 : graph.getNodes(GuardNode.TYPE)) { - if (g1.getSpeculation().isNull() ^ g2.getSpeculation().isNull()) { - GuardNode withSpeculation = g1.getSpeculation().isNull() ? g2 : g1; - GuardNode withoutSpeculation = g1.getSpeculation().isNull() ? g1 : g2; + if (g1.getSpeculation().equals(SpeculationLog.NO_SPECULATION) ^ g2.getSpeculation().equals(SpeculationLog.NO_SPECULATION)) { + GuardNode withSpeculation = g1.getSpeculation().equals(SpeculationLog.NO_SPECULATION) ? g2 : g1; + GuardNode withoutSpeculation = g1.getSpeculation().equals(SpeculationLog.NO_SPECULATION) ? g1 : g2; if (withoutSpeculation.isNegated() && withoutSpeculation.getCondition() instanceof IsNullNode) { IsNullNode isNullNode = (IsNullNode) withoutSpeculation.getCondition(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashCodeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashMapGetTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashMapGetTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashMapGetTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/HashMapGetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import jdk.vm.ci.meta.ResolvedJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfCanonicalizerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IfReorderTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.io.Serializable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ImplicitNullCheckTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InfopointReasonTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.core.GraalCompiler.compileGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/InliningTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.inlining; import org.graalvm.compiler.core.common.GraalOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/NestedLoopEffectsPhaseComplexityTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.inlining; import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/PolymorphicInliningTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/PolymorphicInliningTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/PolymorphicInliningTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/inlining/PolymorphicInliningTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.inlining; import static org.graalvm.compiler.test.SubprocessUtil.getVMCommandLine; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InstalledCodeInvalidationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerEqualsCanonicalizerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/IntegerStampMulFoldTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InterfaceMethodHandleTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.lang.invoke.MethodHandle; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeExceptionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/InvokeHintsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LockEliminationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import jdk.vm.ci.meta.ResolvedJavaMethod; @@ -39,6 +41,7 @@ import org.graalvm.compiler.phases.common.inlining.InliningPhase; import org.graalvm.compiler.phases.tiers.HighTierContext; import org.graalvm.compiler.phases.tiers.PhaseContext; +import org.graalvm.compiler.virtual.phases.ea.PartialEscapePhase; public class LockEliminationTest extends GraalCompilerTest { @@ -67,7 +70,7 @@ public void testLock() { test("testSynchronizedSnippet", new A(), new A()); - StructuredGraph graph = getGraph("testSynchronizedSnippet"); + StructuredGraph graph = getGraph("testSynchronizedSnippet", false); new CanonicalizerPhase().apply(graph, new PhaseContext(getProviders())); new LockEliminationPhase().apply(graph); assertDeepEquals(1, graph.getNodes().filter(RawMonitorEnterNode.class).count()); @@ -85,7 +88,7 @@ public void testSynchronizedMethod() { test("testSynchronizedMethodSnippet", new A()); - StructuredGraph graph = getGraph("testSynchronizedMethodSnippet"); + StructuredGraph graph = getGraph("testSynchronizedMethodSnippet", false); new CanonicalizerPhase().apply(graph, new PhaseContext(getProviders())); new LockEliminationPhase().apply(graph); assertDeepEquals(1, graph.getNodes().filter(RawMonitorEnterNode.class).count()); @@ -102,7 +105,7 @@ @Test public void testUnrolledSync() { - StructuredGraph graph = getGraph("testUnrolledSyncSnippet"); + StructuredGraph graph = getGraph("testUnrolledSyncSnippet", false); CanonicalizerPhase canonicalizer = new CanonicalizerPhase(); canonicalizer.apply(graph, new PhaseContext(getProviders())); HighTierContext context = getDefaultHighTierContext(); @@ -112,17 +115,56 @@ assertDeepEquals(1, graph.getNodes().filter(MonitorExitNode.class).count()); } - private StructuredGraph getGraph(String snippet) { + private StructuredGraph getGraph(String snippet, boolean doEscapeAnalysis) { ResolvedJavaMethod method = getResolvedJavaMethod(snippet); StructuredGraph graph = parseEager(method, AllowAssumptions.YES); HighTierContext context = getDefaultHighTierContext(); - new CanonicalizerPhase().apply(graph, context); + CanonicalizerPhase canonicalizer = new CanonicalizerPhase(); + canonicalizer.apply(graph, context); new InliningPhase(new CanonicalizerPhase()).apply(graph, context); new CanonicalizerPhase().apply(graph, context); new DeadCodeEliminationPhase().apply(graph); + if (doEscapeAnalysis) { + new PartialEscapePhase(true, canonicalizer, graph.getOptions()).apply(graph, context); + } new LoweringPhase(new CanonicalizerPhase(), LoweringTool.StandardLoweringStage.HIGH_TIER).apply(graph, context); - new LockEliminationPhase().apply(graph); return graph; } + public void testEscapeAnalysisSnippet(A a) { + A newA = new A(); + synchronized (newA) { + synchronized (a) { + field1 = a.value; + } + } + /* + * Escape analysis removes the synchronization on newA. But lock elimination still must not + * combine the two synchronizations on the parameter a because they have a different lock + * depth. + */ + synchronized (a) { + field2 = a.value; + } + /* + * Lock elimination can combine these synchronizations, since they are both on parameter a + * with the same lock depth. + */ + synchronized (a) { + field1 = a.value; + } + } + + @Test + public void testEscapeAnalysis() { + StructuredGraph graph = getGraph("testEscapeAnalysisSnippet", true); + + assertDeepEquals(3, graph.getNodes().filter(RawMonitorEnterNode.class).count()); + assertDeepEquals(3, graph.getNodes().filter(MonitorExitNode.class).count()); + + new LockEliminationPhase().apply(graph); + + assertDeepEquals(2, graph.getNodes().filter(RawMonitorEnterNode.class).count()); + assertDeepEquals(2, graph.getNodes().filter(MonitorExitNode.class).count()); + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LongNodeChainTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import jdk.vm.ci.meta.JavaConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopFullUnrollTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopFullUnrollTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopFullUnrollTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopFullUnrollTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/LoopUnswitchTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MarkUnsafeAccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static java.nio.file.StandardOpenOption.READ; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryArithmeticTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import jdk.vm.ci.code.InstalledCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryGraphCanonicalizeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryGraphCanonicalizeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryGraphCanonicalizeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryGraphCanonicalizeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MemoryScheduleTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.core.common.GraalOptions.OptImplicitNullChecks; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MergeCanonicalizerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MethodHandleEagerResolution.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.lang.invoke.MethodHandle; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/MonitorGraphTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NarrowingReadTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NarrowingReadTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NarrowingReadTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NarrowingReadTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedArithmeticTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedArithmeticTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedArithmeticTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedArithmeticTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NestedLoopTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.core.common.cfg.Loop; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePosIteratorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/NodePropertiesTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OffHeapUnsafeAccessTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OffHeapUnsafeAccessTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OffHeapUnsafeAccessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OffHeapUnsafeAccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OnStackReplacementTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/OptionsVerifierTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static java.lang.String.format; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PhiCreationTests.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ProfilingInfoTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.io.Serializable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushNodesThroughPiTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/PushThroughIfTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReadAfterCheckCastTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReassociateAndCanonicalTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReentrantBlockIteratorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReferenceGetLoopTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.lang.ref.Reference; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReflectionOptionDescriptors.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReflectionOptionDescriptors.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReflectionOptionDescriptors.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReflectionOptionDescriptors.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.lang.annotation.RetentionPolicy; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReverseBytesIntoArrayRegressionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReverseBytesIntoArrayRegressionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReverseBytesIntoArrayRegressionTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ReverseBytesIntoArrayRegressionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,68 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +package org.graalvm.compiler.core.test; + +import java.util.Formatter; + +import org.junit.Test; + +/** + * @see "https://bugs.openjdk.java.net/browse/JDK-8204914" + */ +public class ReverseBytesIntoArrayRegressionTest extends GraalCompilerTest { + + private static String toHexBytes(byte[] arr) { + Formatter buf = new Formatter(); + for (int b : arr) { + buf.format("0x%x ", b & 0xff); + } + return buf.toString().trim(); + } + + @Override + protected void assertDeepEquals(Object expected, Object actual) { + if (expected instanceof byte[] && actual instanceof byte[]) { + super.assertDeepEquals(toHexBytes((byte[]) expected), toHexBytes((byte[]) actual)); + } + super.assertDeepEquals(expected, actual); + } + + @Test + public void test1() { + test("serialize", 1); + } + + protected static final short SERIAL_COOKIE = 12347; + + public static byte[] serialize(int size) { + int v = Integer.reverseBytes(SERIAL_COOKIE | ((size - 1) << 16)); + byte[] ba = new byte[4]; + ba[0] = (byte) ((v >>> 24) & 0xFF); + ba[1] = (byte) ((v >>> 16) & 0xFF); + ba[2] = (byte) ((v >>> 8) & 0xFF); + ba[3] = (byte) ((v >>> 0) & 0xFF); + return ba; + } +} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ScalarTypeSystemTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SchedulingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ShortCircuitNodeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SimpleCFGTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StableArrayReadFoldingTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StableArrayReadFoldingTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StableArrayReadFoldingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StableArrayReadFoldingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import jdk.vm.ci.amd64.AMD64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampCanonicalizerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampMemoryAccessTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampMemoryAccessTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampMemoryAccessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StampMemoryAccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StaticInterfaceFieldTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.core.test.GraalCompilerTest.getInitialOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/StraighteningTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordArrayStoreTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordArrayStoreTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordArrayStoreTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordArrayStoreTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordFieldStoreTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordFieldStoreTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordFieldStoreTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordFieldStoreTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordInputTest2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordInputTest2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordInputTest2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordInputTest2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordInputTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordInputTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordInputTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordInputTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordReturnTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordReturnTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordReturnTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordReturnTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordTestUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordTestUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordTestUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SubWordTestUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.debug.GraalError; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SwitchDyingLoopTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SwitchDyingLoopTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SwitchDyingLoopTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/SwitchDyingLoopTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.graph.test.matchers.NodeIterableCount.hasCount; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TrivialInliningExplosionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TrivialInliningExplosionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TrivialInliningExplosionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TrivialInliningExplosionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.core.common.CompilationIdentifier; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/GraalTutorial.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.tutorial; import java.lang.reflect.Method; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/InvokeGraal.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.tutorial; import static org.graalvm.compiler.core.common.CompilationRequestIdentifier.asCompilationRequest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysis.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.tutorial; import static org.graalvm.compiler.core.test.GraalCompilerTest.getInitialOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/tutorial/StaticAnalysisTests.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test.tutorial; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeSystemTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.io.BufferedInputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/TypeWriterTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnbalancedMonitorsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.java.GraphBuilderPhase; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UncheckedInterfaceProviderTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UncheckedInterfaceProviderTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UncheckedInterfaceProviderTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UncheckedInterfaceProviderTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.hamcrest.CoreMatchers.instanceOf; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeReadEliminationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeVirtualizationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeVirtualizationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeVirtualizationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsafeVirtualizationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsignedLongTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsignedLongTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsignedLongTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnsignedLongTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.graalvm.compiler.core.common.util.UnsignedLong; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnusedArray.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnusedArray.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnusedArray.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/UnusedArray.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.graph.test.matchers.NodeIterableIsEmpty.isEmpty; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyBailoutUsageTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.core.test.GraalCompilerTest.getInitialOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyDebugUsageTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.core.test.GraalCompilerTest.getInitialOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/VerifyVirtualizableTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import static org.graalvm.compiler.core.test.GraalCompilerTest.getInitialOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ZeroSignExtendTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ZeroSignExtendTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ZeroSignExtendTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.core.test/src/org/graalvm/compiler/core/test/ZeroSignExtendTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/AbstractKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/AbstractKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/AbstractKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/AbstractKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/AccumulatedKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/AccumulatedKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/AccumulatedKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/AccumulatedKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; abstract class AccumulatedKey extends AbstractKey { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Assertions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Assertions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Assertions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Assertions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import org.graalvm.compiler.options.Option; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CausableByCompilerAssert.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CausableByCompilerAssert.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CausableByCompilerAssert.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CausableByCompilerAssert.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; public interface CausableByCompilerAssert { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CloseableCounter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CloseableCounter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CloseableCounter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CloseableCounter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CounterKeyImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CounterKeyImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CounterKeyImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CounterKeyImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import jdk.internal.vm.compiler.collections.Pair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CounterKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CounterKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CounterKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CounterKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/CSVUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.PrintStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugCloseable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfigImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import static org.graalvm.compiler.debug.DebugContext.BASIC_LEVEL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.PrintStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import static java.util.FormattableFlags.LEFT_JUSTIFY; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.Closeable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugDumpScope.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; public class DebugDumpScope { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugFilter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHandlersFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHandlersFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHandlersFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugHandlersFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugMemUseTracker.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugOptions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugOptions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.IOException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DebugVerifyHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DiagnosticsOutputDirectory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DiagnosticsOutputDirectory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DiagnosticsOutputDirectory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/DiagnosticsOutputDirectory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GlobalMetrics.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GlobalMetrics.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GlobalMetrics.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GlobalMetrics.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.IOException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/GraalError.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/IgvDumpChannel.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/IgvDumpChannel.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/IgvDumpChannel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/IgvDumpChannel.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.IOException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Indent.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/JavaMethodContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import jdk.vm.ci.meta.JavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/KeyRegistry.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/KeyRegistry.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/KeyRegistry.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/KeyRegistry.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/LogStream.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.IOException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKeyImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKeyImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKeyImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKeyImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import static org.graalvm.compiler.debug.DebugCloseable.VOID_CLOSEABLE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MemUseTrackerKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import org.graalvm.compiler.serviceprovider.GraalServices; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MethodFilter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MetricKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MetricKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MetricKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/MetricKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.util.Comparator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/PathUtilities.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/PathUtilities.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/PathUtilities.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/PathUtilities.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/ScopeImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/ScopeImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/ScopeImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/ScopeImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.PrintStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimerKeyImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimerKeyImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimerKeyImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimerKeyImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import static org.graalvm.compiler.debug.DebugCloseable.VOID_CLOSEABLE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimerKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimerKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimerKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimerKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.util.concurrent.TimeUnit; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TimeSource.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import org.graalvm.compiler.serviceprovider.GraalServices; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTY.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.PrintStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/TTYStreamProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.PrintStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Versions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Versions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Versions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug/src/org/graalvm/compiler/debug/Versions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/CSVUtilTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug.test; import static org.junit.Assert.assertEquals; @@ -115,8 +117,8 @@ CSVUtil.Escape.println(new PrintStream(outputStream), format, toObjectArray(args)); // get the actual string String printedStream = new String(outputStream.toByteArray(), StandardCharsets.UTF_8); - // remove newline - assertEquals(expected, printedStream.substring(0, printedStream.length() - 1)); + // add newline to the expected string + assertEquals(expected + System.lineSeparator(), printedStream); } private static Object[] toObjectArray(String args) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugContextTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugContextTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugContextTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/DebugContextTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug.test; import static org.graalvm.compiler.debug.DebugContext.NO_DESCRIPTION; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/TimerKeyTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/TimerKeyTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/TimerKeyTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/TimerKeyTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug.test; import static org.graalvm.compiler.debug.DebugContext.DEFAULT_LOG_STREAM; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/VersionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/VersionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/VersionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.debug.test/src/org/graalvm/compiler/debug/test/VersionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,11 +20,15 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.debug.test; import java.io.File; import java.io.FileWriter; import java.io.IOException; +import java.net.URI; +import java.net.URISyntaxException; import java.nio.file.FileVisitResult; import java.nio.file.FileVisitor; import java.nio.file.Files; @@ -78,15 +82,15 @@ } @Test - public void emptyProperties() { - Path root = Paths.get("file:/"); + public void emptyProperties() throws URISyntaxException { + Path root = Paths.get(new URI("file:/")); Versions v = new Versions(root); assertEmpty(v.withVersions(null)); } @Test - public void emptyWithNullProperties() { - Path root = Paths.get("file:/"); + public void emptyWithNullProperties() throws URISyntaxException { + Path root = Paths.get(new URI("file:/")); Versions v = new Versions(root); assertEmpty(v.withVersions(null)); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/CachedGraph.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.function.Consumer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Edges.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.graph.Graph.isModificationCountsEnabled; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraalGraphError.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import org.graalvm.compiler.debug.GraalError; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Graph.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.core.common.GraalOptions.TrackNodeInsertion; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/GraphNodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InlineCacheGuardPosition.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InlineCacheGuardPosition.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InlineCacheGuardPosition.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InlineCacheGuardPosition.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.graph; import java.util.Objects; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/InputEdges.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.graph.Edges.Type.Inputs; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/IterableNodeType.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/FilteredNodeIterable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.iterators; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.iterators; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.iterators; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicate.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.iterators; import java.util.function.Predicate; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/NodePredicates.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.iterators; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/iterators/PredicatedProxyNodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.iterators; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeBitMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeClass.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.core.common.Fields.translateInto; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeFlood.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeIdAccessor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInputList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.graph.Edges.Type.Inputs; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeInterface.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; public interface NodeInterface { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Node.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.graph.Edges.Type.Inputs; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.AbstractList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSourcePosition.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.graph.NodeSourcePosition.Marker.None; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeStack.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; public final class NodeStack { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeSuccessorList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.graph.Edges.Type.Successors; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUnionFind.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.graph.Graph.isModificationCountsEnabled; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeUsageWithModCountIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.ConcurrentModificationException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/NodeWorkList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,4 +23,6 @@ /** * This package contains the Node base class and the Graph container class of the Graal IR. */ + + package org.graalvm.compiler.graph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/Position.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import org.graalvm.compiler.nodeinfo.InputType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SourceLanguagePosition.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SourceLanguagePosition.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SourceLanguagePosition.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SourceLanguagePosition.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.net.URI; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SourceLanguagePositionProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SourceLanguagePositionProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SourceLanguagePositionProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SourceLanguagePositionProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import jdk.vm.ci.meta.JavaConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Canonicalizable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.spi; import org.graalvm.compiler.graph.Graph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/CanonicalizerTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.spi; import jdk.vm.ci.meta.Assumptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/Simplifiable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.spi; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/spi/SimplifierTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.spi; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/SuccessorEdges.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import static org.graalvm.compiler.graph.Edges.Type.Successors; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/TypedGraphNodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/UnsafeAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph/src/org/graalvm/compiler/graph/VerificationError.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/graphio/GraphSnippetTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/graphio/GraphSnippetTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/graphio/GraphSnippetTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/graphio/GraphSnippetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test.graphio; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/graphio/NodeEncodingTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/graphio/NodeEncodingTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/graphio/NodeEncodingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/graphio/NodeEncodingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test.graphio; import java.io.ByteArrayOutputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/GraphTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/GraphTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/GraphTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/GraphTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test; import org.graalvm.compiler.api.test.Graal; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableContains.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test.matchers; import org.hamcrest.Description; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableCount.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test.matchers; import org.hamcrest.Description; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/matchers/NodeIterableIsEmpty.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test.matchers; import org.hamcrest.Description; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeBitMapTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeBitMapTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeBitMapTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeBitMapTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeMapTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeUsagesTests.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test; import static org.graalvm.compiler.graph.test.matchers.NodeIterableContains.contains; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/NodeValidationChecksTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TestNodeInterface.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test; public interface TestNodeInterface { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.graph.test/src/org/graalvm/compiler/graph/test/TypedNodeIteratorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.graph.test; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/AOTGraalHotSpotVMConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.core.common.CompressEncoding; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/BootstrapWatchDog.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static org.graalvm.compiler.hotspot.HotSpotGraalCompiler.fmt; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CommunityCompilerConfigurationFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CommunityCompilerConfigurationFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CommunityCompilerConfigurationFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CommunityCompilerConfigurationFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.core.phases.CommunityCompilerConfiguration; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationCounters.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static org.graalvm.compiler.hotspot.HotSpotGraalCompiler.fmt; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationStatistics.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static java.lang.Thread.currentThread; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationTask.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static org.graalvm.compiler.core.CompilationWrapper.ExceptionAction.Diagnose; @@ -56,7 +58,7 @@ import jdk.vm.ci.hotspot.HotSpotCompilationRequestResult; import jdk.vm.ci.hotspot.HotSpotInstalledCode; import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotNmethod; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCICompiler; @@ -77,7 +79,7 @@ } } - private final HotSpotJVMCIRuntimeProvider jvmciRuntime; + private final HotSpotJVMCIRuntime jvmciRuntime; private final HotSpotGraalCompiler compiler; private final HotSpotCompilationIdentifier compilationId; @@ -200,7 +202,7 @@ } - public CompilationTask(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalCompiler compiler, HotSpotCompilationRequest request, boolean useProfilingInfo, boolean installAsDefault, + public CompilationTask(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalCompiler compiler, HotSpotCompilationRequest request, boolean useProfilingInfo, boolean installAsDefault, OptionValues options) { this.jvmciRuntime = jvmciRuntime; this.compiler = compiler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilationWatchDog.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static org.graalvm.compiler.hotspot.HotSpotGraalCompiler.fmt; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerConfigurationFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.common.InitTimer.timer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/CompilerRuntimeHotSpotVMConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import jdk.vm.ci.hotspot.HotSpotVMConfigAccess; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/debug/BenchmarkCounters.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.debug; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/EconomyCompilerConfigurationFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.core.phases.EconomyCompilerConfiguration; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.api.replacements.Fold; @@ -28,6 +30,7 @@ import jdk.vm.ci.common.JVMCIError; import jdk.vm.ci.hotspot.HotSpotVMConfigAccess; import jdk.vm.ci.hotspot.HotSpotVMConfigStore; +import jdk.vm.ci.meta.MetaAccessProvider; /** * This is a source with different versions for various JDKs. @@ -50,6 +53,7 @@ * {@link GraalHotSpotVMConfig} parameter to a {@linkplain Fold foldable} method. */ public static final GraalHotSpotVMConfig INJECTED_VMCONFIG = null; + public static final MetaAccessProvider INJECTED_METAACCESS = null; public final String osName = getHostOSName(); public final String osArch = getHostArchitectureName(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,16 +20,21 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import java.lang.reflect.Field; import java.lang.reflect.Modifier; +import java.util.List; import org.graalvm.compiler.core.common.CompressEncoding; import org.graalvm.compiler.hotspot.nodes.GraalHotSpotVMConfigNode; import jdk.vm.ci.common.JVMCIError; +import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotVMConfigStore; +import jdk.vm.ci.meta.ResolvedJavaMethod; /** * Used to access native configuration details. @@ -313,6 +318,17 @@ public final int jvmciCountersThreadOffset = getFieldOffset("JavaThread::_jvmci_counters", Integer.class, "jlong*"); public final int javaThreadReservedStackActivationOffset = versioned.javaThreadReservedStackActivationOffset; + public boolean requiresReservedStackCheck(List<ResolvedJavaMethod> methods) { + if (enableStackReservedZoneAddress != 0 && methods != null) { + for (ResolvedJavaMethod method : methods) { + if (((HotSpotResolvedJavaMethod) method).hasReservedStackAccess()) { + return true; + } + } + } + return false; + } + /** * An invalid value for {@link #rtldDefault}. */ @@ -353,7 +369,7 @@ public final int pendingExceptionOffset = getFieldOffset("ThreadShadow::_pending_exception", Integer.class, "oop"); public final int pendingDeoptimizationOffset = getFieldOffset("JavaThread::_pending_deoptimization", Integer.class, "int"); - public final int pendingFailedSpeculationOffset = getFieldOffset("JavaThread::_pending_failed_speculation", Integer.class, "oop"); + public final int pendingFailedSpeculationOffset = getFieldOffset("JavaThread::_pending_failed_speculation", Integer.class, "long"); public final int pendingTransferToInterpreterOffset = getFieldOffset("JavaThread::_pending_transfer_to_interpreter", Integer.class, "bool"); private final int javaFrameAnchorLastJavaSpOffset = getFieldOffset("JavaFrameAnchor::_last_Java_sp", Integer.class, "intptr_t*"); @@ -559,6 +575,8 @@ public final boolean tlabStats = getFlag("TLABStats", Boolean.class); + public final boolean useFastTLABRefill = versioned.useFastTLABRefill; + // FIXME This is only temporary until the GC code is changed. public final boolean inlineContiguousAllocationSupported = getFieldValue("CompilerToVM::Data::_supports_inline_contig_alloc", Boolean.class); public final long heapEndAddress = getFieldValue("CompilerToVM::Data::_heap_end_addr", Long.class, "HeapWord**"); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigVersioned.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigVersioned.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigVersioned.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/GraalHotSpotVMConfigVersioned.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import jdk.vm.ci.hotspot.HotSpotVMConfigAccess; @@ -84,4 +86,7 @@ // JDK-8015774 final long codeCacheLowBound = getFieldValue("CodeCache::_low_bound", Long.class, "address"); final long codeCacheHighBound = getFieldValue("CodeCache::_high_bound", Long.class, "address"); + + // JDK-8205105 + boolean useFastTLABRefill = false; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackendFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,12 +20,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.phases.tiers.CompilerConfiguration; import jdk.vm.ci.code.Architecture; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; public interface HotSpotBackendFactory { @@ -42,5 +44,5 @@ */ Class<? extends Architecture> getArchitecture(); - HotSpotBackend createBackend(HotSpotGraalRuntimeProvider runtime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotBackend host); + HotSpotBackend createBackend(HotSpotGraalRuntimeProvider runtime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntime jvmciRuntime, HotSpotBackend host); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotBackend.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCodeCacheListener.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCodeCacheListener.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCodeCacheListener.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCodeCacheListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import jdk.vm.ci.code.CompiledCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompilationIdentifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.core.common.CompilationIdentifier; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCompiledCodeBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static org.graalvm.util.CollectionsUtil.anyMatch; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotCounterOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDataBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.hotspot.HotSpotCompressedNullConstant.COMPRESSED_NULL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotDebugInfoBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.code.BytecodeFrame.isPlaceholderBci; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkageImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotForeignCallLinkage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import jdk.vm.ci.meta.InvokeTarget; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompilerFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.common.InitTimer.timer; @@ -160,7 +162,13 @@ } @Override - public CompilationLevel adjustCompilationLevel(Class<?> declaringClass, String name, String signature, boolean isOsr, CompilationLevel level) { + public CompilationLevel adjustCompilationLevel(Object declaringClassObject, String name, String signature, boolean isOsr, CompilationLevel level) { + if (declaringClassObject instanceof String) { + // This must be SVM mode in which case only GraalCompileC1Only matters since Graal and + // JVMCI are already compiled. + return checkGraalCompileOnlyFilter((String) declaringClassObject, name, signature, level); + } + Class<?> declaringClass = (Class<?>) declaringClassObject; return adjustCompilationLevelInternal(declaringClass, name, signature, level); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalCompiler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static org.graalvm.compiler.core.common.GraalOptions.OptAssumptions; @@ -67,7 +69,7 @@ import jdk.vm.ci.code.CompilationRequestResult; import jdk.vm.ci.hotspot.HotSpotCompilationRequest; import jdk.vm.ci.hotspot.HotSpotCompilationRequestResult; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.meta.DefaultProfilingInfo; import jdk.vm.ci.meta.JavaMethod; import jdk.vm.ci.meta.ProfilingInfo; @@ -78,13 +80,13 @@ public class HotSpotGraalCompiler implements GraalJVMCICompiler { - private final HotSpotJVMCIRuntimeProvider jvmciRuntime; + private final HotSpotJVMCIRuntime jvmciRuntime; private final HotSpotGraalRuntimeProvider graalRuntime; private final CompilationCounters compilationCounters; private final BootstrapWatchDog bootstrapWatchDog; private List<DebugHandlersFactory> factories; - HotSpotGraalCompiler(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider graalRuntime, OptionValues options) { + HotSpotGraalCompiler(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider graalRuntime, OptionValues options) { this.jvmciRuntime = jvmciRuntime; this.graalRuntime = graalRuntime; // It is sufficient to have one compilation counter object per Graal compiler object. diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalJVMCIServiceLocator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.serviceprovider.ServiceProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalManagementRegistration.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalManagementRegistration.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalManagementRegistration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalManagementRegistration.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalOptionValues.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalOptionValues.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalOptionValues.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalOptionValues.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.common.InitTimer.timer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntime.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,14 +20,19 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.common.InitTimer.timer; import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; import static org.graalvm.compiler.core.common.GraalOptions.HotSpotPrintInlining; import static org.graalvm.compiler.debug.DebugContext.DEFAULT_LOG_STREAM; +import static org.graalvm.compiler.hotspot.HotSpotGraalRuntime.HotSpotGC.CMS; +import static org.graalvm.compiler.hotspot.HotSpotGraalRuntime.HotSpotGC.G1; +import static org.graalvm.compiler.hotspot.HotSpotGraalRuntime.HotSpotGC.Parallel; +import static org.graalvm.compiler.hotspot.HotSpotGraalRuntime.HotSpotGC.Serial; import java.util.ArrayList; import java.util.EnumMap; @@ -80,6 +85,7 @@ import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.hotspot.HotSpotVMConfigStore; import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.runtime.JVMCI; @@ -92,15 +98,15 @@ */ public final class HotSpotGraalRuntime implements HotSpotGraalRuntimeProvider { - private static boolean checkArrayIndexScaleInvariants() { - assert getArrayIndexScale(JavaKind.Byte) == 1; - assert getArrayIndexScale(JavaKind.Boolean) == 1; - assert getArrayIndexScale(JavaKind.Char) == 2; - assert getArrayIndexScale(JavaKind.Short) == 2; - assert getArrayIndexScale(JavaKind.Int) == 4; - assert getArrayIndexScale(JavaKind.Long) == 8; - assert getArrayIndexScale(JavaKind.Float) == 4; - assert getArrayIndexScale(JavaKind.Double) == 8; + private static boolean checkArrayIndexScaleInvariants(MetaAccessProvider metaAccess) { + assert metaAccess.getArrayIndexScale(JavaKind.Byte) == 1; + assert metaAccess.getArrayIndexScale(JavaKind.Boolean) == 1; + assert metaAccess.getArrayIndexScale(JavaKind.Char) == 2; + assert metaAccess.getArrayIndexScale(JavaKind.Short) == 2; + assert metaAccess.getArrayIndexScale(JavaKind.Int) == 4; + assert metaAccess.getArrayIndexScale(JavaKind.Long) == 8; + assert metaAccess.getArrayIndexScale(JavaKind.Float) == 4; + assert metaAccess.getArrayIndexScale(JavaKind.Double) == 8; return true; } @@ -109,6 +115,7 @@ private final HotSpotBackend hostBackend; private final GlobalMetrics metricValues = new GlobalMetrics(); private final List<SnippetCounter.Group> snippetCounterGroups; + private final HotSpotGC garbageCollector; private final EconomicMap<Class<? extends Architecture>, HotSpotBackend> backends = EconomicMap.create(Equivalence.IDENTITY); @@ -128,6 +135,40 @@ private final Map<ExceptionAction, Integer> compilationProblemsPerAction; /** + * Constants denoting the GC algorithms available in HotSpot. + */ + public enum HotSpotGC { + Serial("UseSerialGC"), + Parallel("UseParallelGC", "UseParallelOldGC", "UseParNewGC"), + CMS("UseConcMarkSweepGC"), + G1("UseG1GC"), + Epsilon("UseEpsilonGC"), + Z("UseZGC"); + + HotSpotGC(String... flags) { + this.flags = flags; + } + + private final String[] flags; + + public boolean isSelected(GraalHotSpotVMConfig config) { + for (String flag : flags) { + final boolean notPresent = false; + if (config.getFlag(flag, Boolean.class, notPresent)) { + return true; + } + } + return false; + } + + } + + /** + * Set of GCs supported by Graal. + */ + private static final HotSpotGC[] SUPPORTED_GCS = {Serial, Parallel, CMS, G1}; + + /** * @param nameQualifier a qualifier to be added to this runtime's {@linkplain #getName() name} * @param compilerConfigurationFactory factory for the compiler configuration * {@link CompilerConfigurationFactory#selectFactory(String, OptionValues)} @@ -146,11 +187,24 @@ } OptionValues options = optionsRef.get(); - if (config.useCMSGC) { - // Graal doesn't work with the CMS collector (e.g. GR-6777) - // and is deprecated (http://openjdk.java.net/jeps/291). - throw new GraalError("Graal does not support the CMS collector"); + HotSpotGC selected = null; + for (HotSpotGC gc : SUPPORTED_GCS) { + if (gc.isSelected(config)) { + selected = gc; + break; + } } + if (selected == null) { + for (HotSpotGC gc : HotSpotGC.values()) { + if (gc.isSelected(config)) { + selected = gc; + break; + } + } + String unsupportedGC = selected != null ? selected.name() : "<unknown>"; + throw new GraalError(unsupportedGC + " garbage collector is not supported by Graal"); + } + garbageCollector = selected; outputDirectory = new DiagnosticsOutputDirectory(options); compilationProblemsPerAction = new EnumMap<>(ExceptionAction.class); @@ -205,7 +259,7 @@ BenchmarkCounters.initialize(jvmciRuntime, options); - assert checkArrayIndexScaleInvariants(); + assert checkArrayIndexScaleInvariants(hostJvmciBackend.getMetaAccess()); runtimeStartTime = System.nanoTime(); bootstrapJVMCI = config.getFlag("BootstrapJVMCI", Boolean.class); @@ -234,7 +288,7 @@ if (compilable instanceof HotSpotResolvedJavaMethod) { HotSpotResolvedObjectType type = ((HotSpotResolvedJavaMethod) compilable).getDeclaringClass(); if (type instanceof HotSpotResolvedJavaType) { - Class<?> clazz = ((HotSpotResolvedJavaType) type).mirror(); + Class<?> clazz = runtime().getMirror(type); try { ClassLoader cl = clazz.getClassLoader(); if (cl != null) { @@ -287,6 +341,10 @@ return null; } + public HotSpotGC getGarbageCollector() { + return garbageCollector; + } + @Override public HotSpotBackend getHostBackend() { return hostBackend; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalRuntimeProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import java.util.Map; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotGraalVMEventListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotHostBackend.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.code.CodeUtil.K; @@ -48,6 +50,7 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.runtime.JVMCICompiler; +import org.graalvm.compiler.word.Word; /** * Common functionality of HotSpot host backends. @@ -64,6 +67,10 @@ */ public static final ForeignCallDescriptor UNCOMMON_TRAP_HANDLER = new ForeignCallDescriptor("uncommonTrapHandler", void.class); + public static final ForeignCallDescriptor ENABLE_STACK_RESERVED_ZONE = new ForeignCallDescriptor("enableStackReservedZoneEntry", void.class, Word.class); + + public static final ForeignCallDescriptor THROW_DELAYED_STACKOVERFLOW_ERROR = new ForeignCallDescriptor("throwDelayedStackoverflowError", void.class); + protected final GraalHotSpotVMConfig config; public HotSpotHostBackend(GraalHotSpotVMConfig config, HotSpotGraalRuntimeProvider runtime, HotSpotProviders providers) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotInstructionProfiling.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerationResult.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import jdk.internal.vm.compiler.collections.EconomicMap; @@ -44,6 +46,7 @@ */ private StackSlot deoptimizationRescueSlot; protected final Object stub; + private final boolean requiresReservedStackAccessCheck; private int maxInterpreterFrameSize; @@ -53,9 +56,11 @@ */ private EconomicMap<LIRFrameState, SaveRegistersOp> calleeSaveInfo = EconomicMap.create(Equivalence.IDENTITY_WITH_SYSTEM_HASHCODE); - public HotSpotLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, CallingConvention callingConvention, Object stub) { + public HotSpotLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, CallingConvention callingConvention, Object stub, + boolean requiresReservedStackAccessCheck) { super(compilationId, lir, frameMapBuilder, callingConvention); this.stub = stub; + this.requiresReservedStackAccessCheck = requiresReservedStackAccessCheck; } public EconomicMap<LIRFrameState, SaveRegistersOp> getCalleeSaveInfo() { @@ -81,4 +86,8 @@ public int getMaxInterpreterFrameSize() { return maxInterpreterFrameSize; } + + public boolean requiresReservedStackAccessCheck() { + return requiresReservedStackAccessCheck; + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotLockStack.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotNodeLIRBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.core.match.MatchableNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReferenceMapBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotReplacementsImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/HotSpotTTYStreamProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import static org.graalvm.compiler.hotspot.HotSpotGraalOptionValues.HOTSPOT_OPTIONS; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/IsGraalPredicate.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import jdk.vm.ci.hotspot.HotSpotJVMCICompilerFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/JVMCIVersionCheck.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import java.util.Formatter; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/HotSpotZapRegistersPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.lir; import static jdk.vm.ci.code.ValueUtil.isStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/VerifyMaxRegisterSizePhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/VerifyMaxRegisterSizePhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/VerifyMaxRegisterSizePhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/lir/VerifyMaxRegisterSizePhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.lir; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/AddressLoweringHotSpotSuitesProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/AddressLoweringHotSpotSuitesProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/AddressLoweringHotSpotSuitesProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/AddressLoweringHotSpotSuitesProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import java.util.ListIterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/DefaultHotSpotLoweringProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,9 +20,10 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; import static org.graalvm.compiler.core.common.GraalOptions.AlwaysInlineVTableStubs; import static org.graalvm.compiler.core.common.GraalOptions.InlineVTableStubs; import static org.graalvm.compiler.core.common.GraalOptions.OmitHotExceptionStacktrace; @@ -767,7 +768,7 @@ @Override public int fieldOffset(ResolvedJavaField f) { HotSpotResolvedJavaField field = (HotSpotResolvedJavaField) f; - return field.offset(); + return field.getOffset(); } @Override @@ -781,7 +782,7 @@ @Override public int arrayBaseOffset(JavaKind kind) { - return getArrayBaseOffset(kind); + return metaAccess.getArrayBaseOffset(kind); } @Override diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotAOTProfilingPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotClassInitializationPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import org.graalvm.compiler.core.common.type.ObjectStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantFieldProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import org.graalvm.compiler.core.common.spi.JavaConstantFieldProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotConstantLoadAction.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; public enum HotSpotConstantLoadAction { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotDisassemblerProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import org.graalvm.compiler.code.CompilationResult; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProviderImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.JavaCall; @@ -47,7 +49,7 @@ import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.CodeCacheProvider; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; @@ -63,7 +65,7 @@ public static final ForeignCallDescriptor TEST_DEOPTIMIZE_CALL_INT = new ForeignCallDescriptor("test_deoptimize_call_int", int.class, int.class); - protected final HotSpotJVMCIRuntimeProvider jvmciRuntime; + protected final HotSpotJVMCIRuntime jvmciRuntime; protected final HotSpotGraalRuntimeProvider runtime; protected final EconomicMap<ForeignCallDescriptor, HotSpotForeignCallLinkage> foreignCalls = EconomicMap.create(); @@ -71,7 +73,7 @@ protected final CodeCacheProvider codeCache; protected final WordTypes wordTypes; - public HotSpotForeignCallsProviderImpl(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, + public HotSpotForeignCallsProviderImpl(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, WordTypes wordTypes) { this.jvmciRuntime = jvmciRuntime; this.runtime = runtime; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotForeignCallsProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraalConstantFieldProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotGraphBuilderPlugins.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; @@ -174,7 +176,7 @@ registerBigIntegerPlugins(invocationPlugins, config, replacementBytecodeProvider); registerSHAPlugins(invocationPlugins, config, replacementBytecodeProvider); registerUnsafePlugins(invocationPlugins, replacementBytecodeProvider); - StandardGraphBuilderPlugins.registerInvocationPlugins(metaAccess, snippetReflection, invocationPlugins, replacementBytecodeProvider, true); + StandardGraphBuilderPlugins.registerInvocationPlugins(metaAccess, snippetReflection, invocationPlugins, replacementBytecodeProvider, true, false); registerArrayPlugins(invocationPlugins, replacementBytecodeProvider); for (NodeIntrinsicPluginFactory factory : GraalServices.load(NodeIntrinsicPluginFactory.class)) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotHostForeignCallsProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.NativeCall; @@ -64,6 +66,8 @@ import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.SAFEPOINT; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.STACK_INSPECTABLE_LEAF; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.DEOPTIMIZATION_HANDLER; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.ENABLE_STACK_RESERVED_ZONE; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.THROW_DELAYED_STACKOVERFLOW_ERROR; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; import static org.graalvm.compiler.hotspot.replacements.AssertionSnippets.ASSERTION_VM_MESSAGE_C; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.MARK_WORD_LOCATION; @@ -126,7 +130,6 @@ import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; @@ -141,7 +144,7 @@ public static final ForeignCallDescriptor NOTIFY = new ForeignCallDescriptor("object_notify", boolean.class, Object.class); public static final ForeignCallDescriptor NOTIFY_ALL = new ForeignCallDescriptor("object_notifyAll", boolean.class, Object.class); - public HotSpotHostForeignCallsProvider(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, + public HotSpotHostForeignCallsProvider(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, WordTypes wordTypes) { super(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes); } @@ -250,6 +253,12 @@ registerForeignCall(UNCOMMON_TRAP_HANDLER, c.uncommonTrapStub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(IC_MISS_HANDLER, c.inlineCacheMissStub, NativeCall, PRESERVES_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); + if (c.enableStackReservedZoneAddress != 0) { + assert c.throwDelayedStackOverflowErrorEntry != 0 : "both must exist"; + registerForeignCall(ENABLE_STACK_RESERVED_ZONE, c.enableStackReservedZoneAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); + registerForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR, c.throwDelayedStackOverflowErrorEntry, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); + } + registerForeignCall(JAVA_TIME_MILLIS, c.javaTimeMillisAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(JAVA_TIME_NANOS, c.javaTimeNanosAddress, NativeCall, DESTROYS_REGISTERS, LEAF_NOFP, REEXECUTABLE, NO_LOCATIONS); registerForeignCall(SIN.foreignCallDescriptor, c.arithmeticSinAddress, NativeCall, DESTROYS_REGISTERS, LEAF, REEXECUTABLE, NO_LOCATIONS); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvocationPlugins.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,9 +20,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; +import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; + import java.lang.reflect.Type; +import java.util.function.Predicate; import org.graalvm.compiler.core.common.GraalOptions; import org.graalvm.compiler.graph.Node; @@ -38,7 +43,6 @@ import org.graalvm.compiler.phases.tiers.CompilerConfiguration; import org.graalvm.compiler.replacements.nodes.MacroNode; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaType; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.ResolvedJavaType; @@ -47,11 +51,11 @@ */ final class HotSpotInvocationPlugins extends InvocationPlugins { private final GraalHotSpotVMConfig config; - private final IntrinsificationPredicate intrinsificationPredicate; + private final Predicate<ResolvedJavaType> intrinsificationPredicate; HotSpotInvocationPlugins(GraalHotSpotVMConfig config, CompilerConfiguration compilerConfiguration) { this.config = config; - intrinsificationPredicate = new IntrinsificationPredicate(compilerConfiguration); + this.intrinsificationPredicate = runtime().getIntrinsificationTrustPredicate(compilerConfiguration.getClass()); } @Override @@ -102,10 +106,6 @@ @Override public boolean canBeIntrinsified(ResolvedJavaType declaringClass) { - if (declaringClass instanceof HotSpotResolvedJavaType) { - HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) declaringClass; - return intrinsificationPredicate.apply(type.mirror()); - } - return false; + return intrinsificationPredicate.test(declaringClass); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvokeDynamicPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvokeDynamicPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvokeDynamicPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotInvokeDynamicPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import org.graalvm.compiler.bytecode.Bytecodes; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotLoweringProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import org.graalvm.compiler.debug.DebugHandlersFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotNodePlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProfilingPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import org.graalvm.compiler.hotspot.nodes.profiling.ProfileBranchNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotProviders.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegisters.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import jdk.vm.ci.code.Register; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotRegistersProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import jdk.vm.ci.code.Register; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSnippetReflectionProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,12 +20,15 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; -import jdk.vm.ci.hotspot.HotSpotResolvedJavaType; +import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; + import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; -import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.hotspot.HotSpotGraalRuntimeProvider; import org.graalvm.compiler.word.WordTypes; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; @@ -108,6 +111,6 @@ @Override public Class<?> originalClass(ResolvedJavaType type) { - return ((HotSpotResolvedJavaType) type).mirror(); + return runtime().getMirror(type); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotStampProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import org.graalvm.compiler.core.common.type.ObjectStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotSuitesProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotUnsafeSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotUnsafeSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotUnsafeSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotUnsafeSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import static org.graalvm.compiler.serviceprovider.GraalServices.Java8OrEarlier; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/HotSpotWordOperationPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import static org.graalvm.compiler.hotspot.word.HotSpotOperation.HotspotOpcode.POINTER_EQ; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/IntrinsificationPredicate.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/IntrinsificationPredicate.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/IntrinsificationPredicate.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/meta/IntrinsificationPredicate.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.meta; import java.lang.module.ModuleDescriptor.Requires; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/NodeCostDumpUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/NodeCostDumpUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/NodeCostDumpUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/NodeCostDumpUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AcquiredCASLockNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/AllocaNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/EncodedSymbolNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/InitializeKlassStubCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyFixedNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadConstantIndirectlyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersIndirectlyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/LoadMethodCountersNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveConstantStubCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveDynamicConstantNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveDynamicConstantNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveDynamicConstantNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveDynamicConstantNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveDynamicStubCall.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveDynamicStubCall.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveDynamicStubCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveDynamicStubCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/aot/ResolveMethodAndLoadCountersStubCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.aot; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ArrayRangeWriteBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/BeginLockScopeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ComputeObjectAddressNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentJavaThreadNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/CurrentLockNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizeCallerNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DeoptimizingStubCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/DimensionsNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.core.common.NumUtil.roundUp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/EndLockScopeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/FastAcquireBiasedLockNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePostWriteBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ArrayRangePreWriteBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PostWriteBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1PreWriteBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/G1ReferentFieldReadBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GetObjectAddressNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/GraalHotSpotVMConfigNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotCompressionNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotCompressionNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotCompressionNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotCompressionNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotDirectCallTargetNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/HotSpotIndirectCallTargetNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerInCallerNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/JumpToExceptionHandlerNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/LoadIndexedPointerNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/MonitorCounterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/ObjectWriteBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/PatchReturnAddressNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileBranchNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.profiling; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileInvokeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.profiling; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.profiling; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/ProfileWithNotificationNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.profiling; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/profiling/RandomSeedNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.nodes.profiling; import jdk.vm.ci.meta.Value; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialArrayRangeWriteBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/SerialWriteBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubForeignCallNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/StubStartNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotNarrowOopStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotNarrowOopStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotNarrowOopStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/HotSpotNarrowOopStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.type; import org.graalvm.compiler.core.common.CompressEncoding; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/KlassPointerStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.type; import java.util.Objects; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MetaspacePointerStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.type; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodCountersPointerStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.type; import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/type/MethodPointerStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes.type; import org.graalvm.compiler.core.common.type.AbstractPointerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/VMErrorNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import static org.graalvm.compiler.hotspot.HotSpotBackend.VM_ERROR; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/nodes/WriteBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.nodes; import org.graalvm.compiler.core.common.type.StampFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,4 +20,6 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/AheadOfTimeVerificationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.phases; import static org.graalvm.compiler.nodes.ConstantNode.getConstantNodes; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/AOTInliningPolicy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.phases.aot; import static org.graalvm.compiler.core.common.GraalOptions.InlineEverything; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/EliminateRedundantInitializationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.phases.aot; import static org.graalvm.util.CollectionsUtil.anyMatch; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/aot/ReplaceConstantNodesPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.phases.aot; import static org.graalvm.compiler.core.common.cfg.AbstractControlFlowGraph.strictlyDominates; @@ -73,44 +75,53 @@ import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.Constant; import jdk.vm.ci.meta.ConstantReflectionProvider; +import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaType; public class ReplaceConstantNodesPhase extends BasePhase<PhaseContext> { - private static final HashSet<Class<?>> builtIns = new HashSet<>(); private final boolean verifyFingerprints; - static { - builtIns.add(Boolean.class); + static Class<?> characterCacheClass = Character.class.getDeclaredClasses()[0]; + static Class<?> byteCacheClass = Byte.class.getDeclaredClasses()[0]; + static Class<?> shortCacheClass = Short.class.getDeclaredClasses()[0]; + static Class<?> integerCacheClass = Integer.class.getDeclaredClasses()[0]; + static Class<?> longCacheClass = Long.class.getDeclaredClasses()[0]; + + static class ClassInfo { + + private ResolvedJavaType stringType; + private final HashSet<ResolvedJavaType> builtIns = new HashSet<>(); + + ClassInfo(MetaAccessProvider metaAccessProvider) { + builtIns.add(metaAccessProvider.lookupJavaType(Boolean.class)); + + assert "java.lang.Character$CharacterCache".equals(characterCacheClass.getName()); + builtIns.add(metaAccessProvider.lookupJavaType(characterCacheClass)); - Class<?> characterCacheClass = Character.class.getDeclaredClasses()[0]; - assert "java.lang.Character$CharacterCache".equals(characterCacheClass.getName()); - builtIns.add(characterCacheClass); - - Class<?> byteCacheClass = Byte.class.getDeclaredClasses()[0]; - assert "java.lang.Byte$ByteCache".equals(byteCacheClass.getName()); - builtIns.add(byteCacheClass); - - Class<?> shortCacheClass = Short.class.getDeclaredClasses()[0]; - assert "java.lang.Short$ShortCache".equals(shortCacheClass.getName()); - builtIns.add(shortCacheClass); - - Class<?> integerCacheClass = Integer.class.getDeclaredClasses()[0]; - assert "java.lang.Integer$IntegerCache".equals(integerCacheClass.getName()); - builtIns.add(integerCacheClass); - - Class<?> longCacheClass = Long.class.getDeclaredClasses()[0]; - assert "java.lang.Long$LongCache".equals(longCacheClass.getName()); - builtIns.add(longCacheClass); + assert "java.lang.Byte$ByteCache".equals(byteCacheClass.getName()); + builtIns.add(metaAccessProvider.lookupJavaType(byteCacheClass)); + + assert "java.lang.Short$ShortCache".equals(shortCacheClass.getName()); + builtIns.add(metaAccessProvider.lookupJavaType(shortCacheClass)); + + assert "java.lang.Integer$IntegerCache".equals(integerCacheClass.getName()); + builtIns.add(metaAccessProvider.lookupJavaType(integerCacheClass)); + + assert "java.lang.Long$LongCache".equals(longCacheClass.getName()); + builtIns.add(metaAccessProvider.lookupJavaType(longCacheClass)); + + stringType = metaAccessProvider.lookupJavaType(String.class); + } } private static boolean isReplacementNode(Node n) { // @formatter:off return n instanceof LoadConstantIndirectlyNode || - n instanceof LoadConstantIndirectlyFixedNode || - n instanceof ResolveDynamicConstantNode || - n instanceof ResolveConstantNode || - n instanceof InitializeKlassNode; + n instanceof LoadConstantIndirectlyFixedNode || + n instanceof ResolveDynamicConstantNode || + n instanceof ResolveConstantNode || + n instanceof InitializeKlassNode; // @formatter:on } @@ -351,7 +362,7 @@ * @param node {@link ConstantNode} containing a {@link HotSpotResolvedJavaType} that needs * resolution. */ - private static void replaceWithResolution(StructuredGraph graph, FrameStateMapperClosure stateMapper, ConstantNode node) { + private static void replaceWithResolution(StructuredGraph graph, FrameStateMapperClosure stateMapper, ConstantNode node, ClassInfo classInfo) { HotSpotMetaspaceConstant metaspaceConstant = (HotSpotMetaspaceConstant) node.asConstant(); HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) metaspaceConstant.asResolvedJavaType(); ResolvedJavaType topMethodHolder = graph.method().getDeclaringClass(); @@ -368,7 +379,7 @@ replacement = graph.addOrUnique(new LoadConstantIndirectlyNode(node)); } else { FixedWithNextNode fixedReplacement; - if (builtIns.contains(type.mirror())) { + if (classInfo.builtIns.contains(type)) { // Special case of klass constants that come from {@link BoxingSnippets}. fixedReplacement = graph.add(new ResolveConstantNode(node, HotSpotConstantLoadAction.INITIALIZE)); } else { @@ -388,7 +399,7 @@ * @param node {@link ConstantNode} containing a {@link HotSpotResolvedJavaType} that needs * resolution. */ - private void handleHotSpotMetaspaceConstant(StructuredGraph graph, FrameStateMapperClosure stateMapper, ConstantNode node) { + private void handleHotSpotMetaspaceConstant(StructuredGraph graph, FrameStateMapperClosure stateMapper, ConstantNode node, ClassInfo classInfo) { HotSpotMetaspaceConstant metaspaceConstant = (HotSpotMetaspaceConstant) node.asConstant(); HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) metaspaceConstant.asResolvedJavaType(); @@ -399,7 +410,7 @@ assert !metaspaceConstant.isCompressed() : "No support for replacing compressed metaspace constants"; tryToReplaceWithExisting(graph, node); if (anyUsagesNeedReplacement(node)) { - replaceWithResolution(graph, stateMapper, node); + replaceWithResolution(graph, stateMapper, node, classInfo); } } else { throw new GraalError("Unsupported metaspace constant type: " + type); @@ -415,10 +426,10 @@ * @param node {@link ConstantNode} containing a {@link HotSpotObjectConstant} that needs * resolution. */ - private static void handleHotSpotObjectConstant(StructuredGraph graph, FrameStateMapperClosure stateMapper, ConstantNode node) { + private static void handleHotSpotObjectConstant(StructuredGraph graph, FrameStateMapperClosure stateMapper, ConstantNode node, ClassInfo classInfo) { HotSpotObjectConstant constant = (HotSpotObjectConstant) node.asJavaConstant(); HotSpotResolvedJavaType type = (HotSpotResolvedJavaType) constant.getType(); - if (type.mirror().equals(String.class)) { + if (type.equals(classInfo.stringType)) { assert !constant.isCompressed() : "No support for replacing compressed oop constants"; FixedWithNextNode replacement = graph.add(new ResolveConstantNode(node)); insertReplacement(graph, stateMapper, node, replacement); @@ -471,15 +482,15 @@ * @param graph * @param stateMapper */ - private void replaceKlassesAndObjects(StructuredGraph graph, FrameStateMapperClosure stateMapper) { + private void replaceKlassesAndObjects(StructuredGraph graph, FrameStateMapperClosure stateMapper, ClassInfo classInfo) { new SchedulePhase(SchedulingStrategy.LATEST_OUT_OF_LOOPS, true).apply(graph, false); for (ConstantNode node : getConstantNodes(graph)) { Constant constant = node.asConstant(); if (constant instanceof HotSpotMetaspaceConstant && anyUsagesNeedReplacement(node)) { - handleHotSpotMetaspaceConstant(graph, stateMapper, node); + handleHotSpotMetaspaceConstant(graph, stateMapper, node, classInfo); } else if (constant instanceof HotSpotObjectConstant && anyUsagesNeedReplacement(node)) { - handleHotSpotObjectConstant(graph, stateMapper, node); + handleHotSpotObjectConstant(graph, stateMapper, node, classInfo); } } } @@ -495,7 +506,7 @@ // Replace object and klass constants (including the ones added in the previous pass) with // resolution nodes. - replaceKlassesAndObjects(graph, stateMapper); + replaceKlassesAndObjects(graph, stateMapper, new ClassInfo(context.getMetaAccess())); } @Override diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/LoadJavaMirrorWithKlassPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.phases; import static org.graalvm.compiler.nodes.ConstantNode.getConstantNodes; @@ -114,7 +116,7 @@ if (oopEncoding != null) { stamp = HotSpotNarrowOopStamp.compressed((AbstractObjectStamp) stamp, oopEncoding); } - AddressNode address = graph.unique(new OffsetAddressNode(clazz, ConstantNode.forLong(typeField.offset(), graph))); + AddressNode address = graph.unique(new OffsetAddressNode(clazz, ConstantNode.forLong(typeField.getOffset(), graph))); ValueNode read = graph.unique(new FloatingReadNode(address, FINAL_LOCATION, null, stamp)); if (oopEncoding == null || ((HotSpotObjectConstant) constant).isCompressed()) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/OnStackReplacementPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.phases; import static jdk.vm.ci.meta.SpeculationLog.SpeculationReason; @@ -73,8 +75,8 @@ import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.SpeculationLog; import jdk.vm.ci.runtime.JVMCICompiler; public class OnStackReplacementPhase extends Phase { @@ -203,7 +205,7 @@ if (graph.getSpeculationLog().maySpeculate(reason) && osrLocal instanceof OSRLocalNode && value.getStackKind().equals(JavaKind.Object) && !narrowedStamp.isUnrestricted()) { // Add guard. LogicNode check = graph.addOrUniqueWithInputs(InstanceOfNode.createHelper((ObjectStamp) narrowedStamp, osrLocal, null, null)); - JavaConstant constant = graph.getSpeculationLog().speculate(reason); + SpeculationLog.Speculation constant = graph.getSpeculationLog().speculate(reason); FixedGuardNode guard = graph.add(new FixedGuardNode(check, DeoptimizationReason.OptimizedTypeCheckViolated, DeoptimizationAction.InvalidateRecompile, constant, false)); graph.addAfterFixed(osrStart, guard); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/profiling/FinalizeProfileNodesPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.phases.profiling; import static org.graalvm.compiler.hotspot.nodes.profiling.ProfileInvokeNode.getProfileInvokeNodes; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierAdditionPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.phases; import org.graalvm.compiler.debug.DebugCloseable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/phases/WriteBarrierVerificationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.phases; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOptionKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOptionKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOptionKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/PrintStreamOptionKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import java.io.FileNotFoundException; @@ -34,12 +36,11 @@ import org.graalvm.compiler.serviceprovider.GraalServices; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; /** * An option for a configurable file name that can also open a {@link PrintStream} on the file. If * no value is given for the option, the stream will output to HotSpot's - * {@link HotSpotJVMCIRuntimeProvider#getLogStream() log} stream + * {@link HotSpotJVMCIRuntime#getLogStream() log} stream */ public class PrintStreamOptionKey extends OptionKey<String> { @@ -63,9 +64,9 @@ } /** - * An output stream that redirects to {@link HotSpotJVMCIRuntimeProvider#getLogStream()}. The - * {@link HotSpotJVMCIRuntimeProvider#getLogStream()} value is only accessed the first time an - * IO operation is performed on the stream. This is required to break a deadlock in early JVMCI + * An output stream that redirects to {@link HotSpotJVMCIRuntime#getLogStream()}. The + * {@link HotSpotJVMCIRuntime#getLogStream()} value is only accessed the first time an IO + * operation is performed on the stream. This is required to break a deadlock in early JVMCI * initialization. */ static class DelayedOutputStream extends OutputStream { @@ -105,7 +106,7 @@ /** * Gets the print stream configured by this option. If no file is configured, the print stream - * will output to HotSpot's {@link HotSpotJVMCIRuntimeProvider#getLogStream() log} stream. + * will output to HotSpot's {@link HotSpotJVMCIRuntime#getLogStream() log} stream. */ public PrintStream getStream(OptionValues options) { String nameTemplate = getValue(options); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AESCryptSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,12 +20,15 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; import static org.graalvm.compiler.hotspot.HotSpotBackend.DECRYPT_BLOCK; import static org.graalvm.compiler.hotspot.HotSpotBackend.DECRYPT_BLOCK_WITH_ORIGINAL_KEY; import static org.graalvm.compiler.hotspot.HotSpotBackend.ENCRYPT_BLOCK; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getArrayBaseOffset; import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.VERY_SLOW_PATH_PROBABILITY; import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.probability; @@ -122,15 +125,15 @@ checkArgs(in, inOffset, out, outOffset); Object realReceiver = PiNode.piCastNonNull(rcvr, AESCryptClass); Object kObject = RawLoadNode.load(realReceiver, kOffset, JavaKind.Object, LocationIdentity.any()); - Pointer kAddr = Word.objectToTrackedPointer(kObject).add(getArrayBaseOffset(JavaKind.Int)); - Word inAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(in, getArrayBaseOffset(JavaKind.Byte) + inOffset)); - Word outAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(out, getArrayBaseOffset(JavaKind.Byte) + outOffset)); + Pointer kAddr = Word.objectToTrackedPointer(kObject).add(getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Int)); + Word inAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(in, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + inOffset)); + Word outAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(out, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + outOffset)); if (encrypt) { encryptBlockStub(ENCRYPT_BLOCK, inAddr, outAddr, kAddr); } else { if (withOriginalKey) { Object lastKeyObject = RawLoadNode.load(realReceiver, lastKeyOffset, JavaKind.Object, LocationIdentity.any()); - Pointer lastKeyAddr = Word.objectToTrackedPointer(lastKeyObject).add(getArrayBaseOffset(JavaKind.Byte)); + Pointer lastKeyAddr = Word.objectToTrackedPointer(lastKeyObject).add(getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte)); decryptBlockWithOriginalKeyStub(DECRYPT_BLOCK_WITH_ORIGINAL_KEY, inAddr, outAddr, kAddr, lastKeyAddr); } else { decryptBlockStub(DECRYPT_BLOCK, inAddr, outAddr, kAddr); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/aot/ResolveConstantSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements.aot; import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.VERY_SLOW_PATH_PROBABILITY; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyCallNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,13 +21,13 @@ * questions. */ //JaCoCo Exclude + + package org.graalvm.compiler.hotspot.replacements.arraycopy; import static org.graalvm.compiler.nodeinfo.InputType.Memory; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_UNKNOWN; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; import org.graalvm.compiler.core.common.type.Stamp; @@ -63,6 +63,7 @@ import jdk.vm.ci.code.CodeUtil; import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.PrimitiveConstant; @NodeInfo(allowedUsageTypes = {Memory}, cycles = CYCLES_UNKNOWN, size = SIZE_UNKNOWN) @@ -140,26 +141,26 @@ return elementKind; } - private ValueNode computeBase(ValueNode base, ValueNode pos) { + private ValueNode computeBase(LoweringTool tool, ValueNode base, ValueNode pos) { FixedWithNextNode basePtr = graph().add(new GetObjectAddressNode(base)); graph().addBeforeFixed(this, basePtr); Stamp wordStamp = StampFactory.forKind(runtime.getTarget().wordJavaKind); ValueNode wordPos = IntegerConvertNode.convert(pos, wordStamp, graph(), NodeView.DEFAULT); - int shift = CodeUtil.log2(getArrayIndexScale(elementKind)); + int shift = CodeUtil.log2(tool.getMetaAccess().getArrayIndexScale(elementKind)); ValueNode scaledIndex = graph().unique(new LeftShiftNode(wordPos, ConstantNode.forInt(shift, graph()))); - ValueNode offset = graph().unique(new AddNode(scaledIndex, ConstantNode.forIntegerStamp(wordStamp, getArrayBaseOffset(elementKind), graph()))); + ValueNode offset = graph().unique(new AddNode(scaledIndex, ConstantNode.forIntegerStamp(wordStamp, tool.getMetaAccess().getArrayBaseOffset(elementKind), graph()))); return graph().unique(new OffsetAddressNode(basePtr, offset)); } @Override public void lower(LoweringTool tool) { if (graph().getGuardsStage().areFrameStatesAtDeopts()) { - updateAlignedDisjoint(); + updateAlignedDisjoint(tool.getMetaAccess()); ForeignCallDescriptor desc = HotSpotHostForeignCallsProvider.lookupArraycopyDescriptor(elementKind, isAligned(), isDisjoint(), isUninitialized(), locationIdentity.equals(LocationIdentity.any())); StructuredGraph graph = graph(); - ValueNode srcAddr = computeBase(getSource(), getSourcePosition()); - ValueNode destAddr = computeBase(getDestination(), getDestinationPosition()); + ValueNode srcAddr = computeBase(tool, getSource(), getSourcePosition()); + ValueNode destAddr = computeBase(tool, getDestination(), getDestinationPosition()); ValueNode len = getLength(); if (len.stamp(NodeView.DEFAULT).getStackKind() != JavaKind.Long) { len = IntegerConvertNode.convert(len, StampFactory.forKind(JavaKind.Long), graph(), NodeView.DEFAULT); @@ -223,11 +224,11 @@ return uninitialized; } - boolean isHeapWordAligned(JavaConstant value, JavaKind kind) { - return (getArrayBaseOffset(kind) + (long) value.asInt() * getArrayIndexScale(kind)) % runtime.getVMConfig().heapWordSize == 0; + boolean isHeapWordAligned(MetaAccessProvider metaAccess, JavaConstant value, JavaKind kind) { + return (metaAccess.getArrayBaseOffset(kind) + (long) value.asInt() * metaAccess.getArrayIndexScale(kind)) % runtime.getVMConfig().heapWordSize == 0; } - public void updateAlignedDisjoint() { + public void updateAlignedDisjoint(MetaAccessProvider metaAccess) { JavaKind componentKind = elementKind; if (srcPos == destPos) { // Can treat as disjoint @@ -237,7 +238,7 @@ PrimitiveConstant constantDst = (PrimitiveConstant) destPos.stamp(NodeView.DEFAULT).asConstant(); if (constantSrc != null && constantDst != null) { if (!aligned) { - aligned = isHeapWordAligned(constantSrc, componentKind) && isHeapWordAligned(constantDst, componentKind); + aligned = isHeapWordAligned(metaAccess, constantSrc, componentKind) && isHeapWordAligned(metaAccess, constantDst, componentKind); } if (constantSrc.asInt() >= constantDst.asInt()) { // low to high copy so treat as disjoint diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements.arraycopy; import static jdk.internal.vm.compiler.word.LocationIdentity.any; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopySnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,14 +20,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements.arraycopy; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.KLASS_SUPER_CHECK_OFFSET_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.OBJ_ARRAY_KLASS_ELEMENT_KLASS_LOCATION; -import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayBaseOffset; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayClassElementOffset; -import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayIndexScale; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getArrayBaseOffset; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.loadHub; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readLayoutHelper; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.superCheckOffsetOffset; @@ -49,6 +51,7 @@ import org.graalvm.compiler.debug.GraalError; import org.graalvm.compiler.graph.Node; import org.graalvm.compiler.hotspot.meta.HotSpotProviders; +import org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil; import org.graalvm.compiler.hotspot.word.KlassPointer; import org.graalvm.compiler.nodes.CallTargetNode; import org.graalvm.compiler.nodes.DeoptimizeNode; @@ -177,8 +180,8 @@ } private static void unrolledArraycopyWork(Object nonNullSrc, int srcPos, Object nonNullDest, int destPos, int length, JavaKind elementKind) { - int scale = arrayIndexScale(elementKind); - int arrayBaseOffset = arrayBaseOffset(elementKind); + int scale = HotSpotReplacementsUtil.arrayIndexScale(INJECTED_METAACCESS, elementKind); + int arrayBaseOffset = getArrayBaseOffset(INJECTED_METAACCESS, elementKind); LocationIdentity arrayLocation = getArrayLocation(elementKind); long sourceOffset = arrayBaseOffset + (long) srcPos * scale; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyWithSlowPathNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyWithSlowPathNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyWithSlowPathNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/ArrayCopyWithSlowPathNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements.arraycopy; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/CheckcastArrayCopyCallNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,10 +21,10 @@ * questions. */ //JaCoCo Exclude + + package org.graalvm.compiler.hotspot.replacements.arraycopy; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_UNKNOWN; @@ -111,15 +111,16 @@ return uninit; } - private ValueNode computeBase(ValueNode base, ValueNode pos) { + private ValueNode computeBase(LoweringTool tool, ValueNode base, ValueNode pos) { FixedWithNextNode basePtr = graph().add(new GetObjectAddressNode(base)); graph().addBeforeFixed(this, basePtr); - int shift = CodeUtil.log2(getArrayIndexScale(JavaKind.Object)); + int shift = CodeUtil.log2(tool.getMetaAccess().getArrayIndexScale(JavaKind.Object)); ValueNode extendedPos = IntegerConvertNode.convert(pos, StampFactory.forKind(runtime.getTarget().wordJavaKind), graph(), NodeView.DEFAULT); ValueNode scaledIndex = graph().unique(new LeftShiftNode(extendedPos, ConstantNode.forInt(shift, graph()))); ValueNode offset = graph().unique( - new AddNode(scaledIndex, ConstantNode.forIntegerBits(PrimitiveStamp.getBits(scaledIndex.stamp(NodeView.DEFAULT)), getArrayBaseOffset(JavaKind.Object), graph()))); + new AddNode(scaledIndex, + ConstantNode.forIntegerBits(PrimitiveStamp.getBits(scaledIndex.stamp(NodeView.DEFAULT)), tool.getMetaAccess().getArrayBaseOffset(JavaKind.Object), graph()))); return graph().unique(new OffsetAddressNode(basePtr, offset)); } @@ -128,8 +129,8 @@ if (graph().getGuardsStage().areFrameStatesAtDeopts()) { ForeignCallDescriptor desc = HotSpotHostForeignCallsProvider.lookupCheckcastArraycopyDescriptor(isUninit()); StructuredGraph graph = graph(); - ValueNode srcAddr = computeBase(getSource(), getSourcePosition()); - ValueNode destAddr = computeBase(getDestination(), getDestinationPosition()); + ValueNode srcAddr = computeBase(tool, getSource(), getSourcePosition()); + ValueNode destAddr = computeBase(tool, getDestination(), getDestinationPosition()); ValueNode len = getLength(); if (len.stamp(NodeView.DEFAULT).getStackKind() != runtime.getTarget().wordJavaKind) { len = IntegerConvertNode.convert(len, StampFactory.forKind(runtime.getTarget().wordJavaKind), graph(), NodeView.DEFAULT); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/GenericArrayCopyCallNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/GenericArrayCopyCallNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/GenericArrayCopyCallNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/arraycopy/GenericArrayCopyCallNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ //JaCoCo Exclude + + package org.graalvm.compiler.hotspot.replacements.arraycopy; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/AssertionSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.replacements.SnippetTemplate.DEFAULT_REPLACER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/BigIntegerSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayStart; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CallSiteTargetNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CipherBlockChainingSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,13 +20,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; import static org.graalvm.compiler.hotspot.HotSpotBackend.DECRYPT; import static org.graalvm.compiler.hotspot.HotSpotBackend.DECRYPT_WITH_ORIGINAL_KEY; import static org.graalvm.compiler.hotspot.HotSpotBackend.ENCRYPT; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getArrayBaseOffset; import static org.graalvm.compiler.hotspot.replacements.UnsafeAccess.UNSAFE; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; import org.graalvm.compiler.api.replacements.ClassSubstitution; import org.graalvm.compiler.api.replacements.Fold; @@ -171,16 +174,16 @@ Object aesCipher = getAESCryptClass().cast(embeddedCipher); Object kObject = RawLoadNode.load(aesCipher, AESCryptSubstitutions.kOffset, JavaKind.Object, LocationIdentity.any()); Object rObject = RawLoadNode.load(realReceiver, rOffset, JavaKind.Object, LocationIdentity.any()); - Pointer kAddr = Word.objectToTrackedPointer(kObject).add(getArrayBaseOffset(JavaKind.Int)); - Pointer rAddr = Word.objectToTrackedPointer(rObject).add(getArrayBaseOffset(JavaKind.Byte)); - Word inAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(in, getArrayBaseOffset(JavaKind.Byte) + inOffset)); - Word outAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(out, getArrayBaseOffset(JavaKind.Byte) + outOffset)); + Pointer kAddr = Word.objectToTrackedPointer(kObject).add(getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Int)); + Pointer rAddr = Word.objectToTrackedPointer(rObject).add(getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte)); + Word inAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(in, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + inOffset)); + Word outAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(out, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + outOffset)); if (encrypt) { encryptAESCryptStub(ENCRYPT, inAddr, outAddr, kAddr, rAddr, inLength); } else { if (withOriginalKey) { Object lastKeyObject = RawLoadNode.load(aesCipher, AESCryptSubstitutions.lastKeyOffset, JavaKind.Object, LocationIdentity.any()); - Pointer lastKeyAddr = Word.objectToTrackedPointer(lastKeyObject).add(getArrayBaseOffset(JavaKind.Byte)); + Pointer lastKeyAddr = Word.objectToTrackedPointer(lastKeyObject).add(getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte)); decryptAESCryptWithOriginalKeyStub(DECRYPT_WITH_ORIGINAL_KEY, inAddr, outAddr, kAddr, rAddr, inLength, lastKeyAddr); } else { decryptAESCryptStub(DECRYPT, inAddr, outAddr, kAddr, rAddr, inLength); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ClassGetHubNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32CSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32CSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32CSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32CSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,9 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; -import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayBaseOffset; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getArrayBaseOffset; import org.graalvm.compiler.api.replacements.ClassSubstitution; import org.graalvm.compiler.api.replacements.MethodSubstitution; @@ -47,7 +50,7 @@ @MethodSubstitution static int updateBytes(int crc, byte[] b, int off, int end) { - Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(b, arrayBaseOffset(JavaKind.Byte) + off)); + Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(b, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + off)); return updateBytesCRC32(UPDATE_BYTES_CRC32C, crc, bufAddr, end - off); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/CRC32Substitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,9 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; -import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayBaseOffset; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getArrayBaseOffset; import java.util.zip.CRC32; @@ -80,7 +83,7 @@ */ @MethodSubstitution(optional = true) static int updateBytes(int crc, byte[] buf, int off, int len) { - Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, arrayBaseOffset(JavaKind.Byte) + off)); + Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + off)); return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len); } @@ -89,7 +92,7 @@ */ @MethodSubstitution(optional = true) static int updateBytes0(int crc, byte[] buf, int off, int len) { - Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, arrayBaseOffset(JavaKind.Byte) + off)); + Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + off)); return updateBytesCRC32(UPDATE_BYTES_CRC32, crc, bufAddr, len); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/EncodedSymbolConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import java.io.ByteArrayOutputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HashCodeSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotArraySubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotArraySubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotArraySubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotArraySubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotClassSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotSpotReplacementsUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,10 +20,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayIndexScale; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_METAACCESS; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; import static org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProviderImpl.VERIFY_OOP; import static org.graalvm.compiler.hotspot.replacements.UnsafeAccess.UNSAFE; @@ -65,12 +66,12 @@ import jdk.vm.ci.code.CodeUtil; import jdk.vm.ci.code.Register; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.Assumptions; import jdk.vm.ci.meta.Assumptions.AssumptionResult; import jdk.vm.ci.meta.JavaKind; +import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaType; //JaCoCo Exclude @@ -134,7 +135,7 @@ } } - public static HotSpotJVMCIRuntimeProvider runtime() { + public static HotSpotJVMCIRuntime runtime() { return HotSpotJVMCIRuntime.runtime(); } @@ -556,17 +557,17 @@ } @Fold - public static int arrayBaseOffset(JavaKind elementKind) { - return getArrayBaseOffset(elementKind); + public static int getArrayBaseOffset(@InjectedParameter MetaAccessProvider metaAccessProvider, JavaKind elementKind) { + return metaAccessProvider.getArrayBaseOffset(elementKind); } @Fold - public static int arrayIndexScale(JavaKind elementKind) { - return getArrayIndexScale(elementKind); + public static int arrayIndexScale(@InjectedParameter MetaAccessProvider metaAccessProvider, JavaKind elementKind) { + return metaAccessProvider.getArrayIndexScale(elementKind); } public static Word arrayStart(int[] a) { - return WordFactory.unsigned(ComputeObjectAddressNode.get(a, getArrayBaseOffset(JavaKind.Int))); + return WordFactory.unsigned(ComputeObjectAddressNode.get(a, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Int))); } /** @@ -1022,4 +1023,9 @@ public static final LocationIdentity METASPACE_ARRAY_LENGTH_LOCATION = NamedLocationIdentity.immutable("MetaspaceArrayLength"); public static final LocationIdentity SECONDARY_SUPERS_ELEMENT_LOCATION = NamedLocationIdentity.immutable("SecondarySupersElement"); + + @Fold + public static boolean useFastTLABRefill(@InjectedParameter GraalHotSpotVMConfig config) { + return config.useFastTLABRefill; + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HotspotSnippetsOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.ProfileContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/HubGetClassNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/IdentityHashCodeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/InstanceOfSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static jdk.vm.ci.meta.DeoptimizationAction.InvalidateReprofile; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/KlassLayoutHelperNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/LoadExceptionObjectSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProviderImpl.LOAD_AND_CLEAR_EXCEPTION; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/MonitorSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static jdk.vm.ci.code.MemoryBarriers.LOAD_STORE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/NewObjectSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,9 +20,10 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; import static org.graalvm.compiler.core.common.calc.UnsignedMath.belowThan; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; @@ -124,7 +125,6 @@ import jdk.vm.ci.code.MemoryBarriers; import jdk.vm.ci.code.Register; import jdk.vm.ci.code.TargetDescription; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; @@ -640,8 +640,8 @@ HotSpotResolvedObjectType arrayType = (HotSpotResolvedObjectType) elementType.getArrayClass(); JavaKind elementKind = elementType.getJavaKind(); ConstantNode hub = ConstantNode.forConstant(KlassPointerStamp.klassNonNull(), arrayType.klass(), providers.getMetaAccess(), graph); - final int headerSize = getArrayBaseOffset(elementKind); - int log2ElementSize = CodeUtil.log2(HotSpotJVMCIRuntimeProvider.getArrayIndexScale(elementKind)); + final int headerSize = tool.getMetaAccess().getArrayBaseOffset(elementKind); + int log2ElementSize = CodeUtil.log2(tool.getMetaAccess().getArrayIndexScale(elementKind)); OptionValues localOptions = graph.getOptions(); SnippetInfo snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import java.lang.reflect.Method; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectCloneSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import java.lang.reflect.Method; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ObjectSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProbabilisticProfileSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements.profiling; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/profiling/ProfileSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements.profiling; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionGetCallerClassNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ReflectionSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA2Substitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,9 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getArrayBaseOffset; import static org.graalvm.compiler.serviceprovider.GraalServices.Java8OrEarlier; import org.graalvm.compiler.api.replacements.ClassSubstitution; @@ -64,8 +67,8 @@ static void implCompress0(Object receiver, byte[] buf, int ofs) { Object realReceiver = PiNode.piCastNonNull(receiver, shaClass); Object state = RawLoadNode.load(realReceiver, stateOffset, JavaKind.Object, LocationIdentity.any()); - Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, getArrayBaseOffset(JavaKind.Byte) + ofs)); - Word stateAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(state, getArrayBaseOffset(JavaKind.Int))); + Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + ofs)); + Word stateAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(state, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Int))); HotSpotBackend.sha2ImplCompressStub(bufAddr, stateAddr); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHA5Substitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,9 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getArrayBaseOffset; import static org.graalvm.compiler.serviceprovider.GraalServices.Java8OrEarlier; import org.graalvm.compiler.api.replacements.ClassSubstitution; @@ -64,8 +67,8 @@ static void implCompress0(Object receiver, byte[] buf, int ofs) { Object realReceiver = PiNode.piCastNonNull(receiver, shaClass); Object state = RawLoadNode.load(realReceiver, stateOffset, JavaKind.Object, LocationIdentity.any()); - Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, getArrayBaseOffset(JavaKind.Byte) + ofs)); - Word stateAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(state, getArrayBaseOffset(JavaKind.Int))); + Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + ofs)); + Word stateAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(state, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Int))); HotSpotBackend.sha5ImplCompressStub(bufAddr, stateAddr); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/SHASubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,9 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; -import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider.getArrayBaseOffset; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getArrayBaseOffset; import static org.graalvm.compiler.serviceprovider.GraalServices.Java8OrEarlier; import org.graalvm.compiler.api.replacements.ClassSubstitution; @@ -64,8 +67,8 @@ static void implCompress0(Object receiver, byte[] buf, int ofs) { Object realReceiver = PiNode.piCastNonNull(receiver, shaClass); Object state = RawLoadNode.load(realReceiver, stateOffset, JavaKind.Object, LocationIdentity.any()); - Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, getArrayBaseOffset(JavaKind.Byte) + ofs)); - Word stateAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(state, getArrayBaseOffset(JavaKind.Int))); + Word bufAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(buf, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Byte) + ofs)); + Word stateAddr = WordFactory.unsigned(ComputeObjectAddressNode.get(state, getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Int))); HotSpotBackend.shaImplCompressStub(bufAddr, stateAddr); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/StringToBytesSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.replacements.UnsafeAccess.UNSAFE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/ThreadSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/TypeCheckSnippetUtils.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/UnsafeLoadSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.referentOffset; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/replacements/WriteBarrierSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,11 +20,13 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.replacements; import static jdk.vm.ci.code.MemoryBarriers.STORE_LOAD; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; -import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayIndexScale; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.cardTableShift; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.dirtyCardValue; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.g1CardQueueBufferOffset; @@ -326,7 +328,7 @@ Word bufferAddress = thread.readWord(g1SATBQueueBufferOffset(INJECTED_VMCONFIG)); Word indexAddress = thread.add(g1SATBQueueIndexOffset(INJECTED_VMCONFIG)); long indexValue = indexAddress.readWord(0).rawValue(); - final int scale = arrayIndexScale(JavaKind.Object); + final int scale = HotSpotReplacementsUtil.arrayIndexScale(INJECTED_METAACCESS, JavaKind.Object); long start = getPointerToFirstArrayElement(address, length, elementStride); for (int i = 0; i < length; i++) { @@ -599,15 +601,19 @@ * prematurely crash the VM and debug the stack trace of the faulty method. */ public static void validateObject(Object parent, Object child) { - if (verifyOops(INJECTED_VMCONFIG) && child != null && !validateOop(VALIDATE_OBJECT, parent, child)) { - log(true, "Verification ERROR, Parent: %p Child: %p\n", Word.objectToTrackedPointer(parent).rawValue(), Word.objectToTrackedPointer(child).rawValue()); - VMErrorNode.vmError("Verification ERROR, Parent: %p\n", Word.objectToTrackedPointer(parent).rawValue()); + if (verifyOops(INJECTED_VMCONFIG) && child != null) { + Word parentWord = Word.objectToTrackedPointer(parent); + Word childWord = Word.objectToTrackedPointer(child); + if (!validateOop(VALIDATE_OBJECT, parentWord, childWord)) { + log(true, "Verification ERROR, Parent: %p Child: %p\n", parentWord.rawValue(), childWord.rawValue()); + VMErrorNode.vmError("Verification ERROR, Parent: %p\n", parentWord.rawValue()); + } } } public static final ForeignCallDescriptor VALIDATE_OBJECT = new ForeignCallDescriptor("validate_object", boolean.class, Word.class, Word.class); @NodeIntrinsic(ForeignCallNode.class) - private static native boolean validateOop(@ConstantNodeParameter ForeignCallDescriptor descriptor, Object parent, Object object); + private static native boolean validateOop(@ConstantNodeParameter ForeignCallDescriptor descriptor, Word parent, Word object); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ArrayStoreExceptionStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import org.graalvm.compiler.api.replacements.Snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ClassCastExceptionStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import org.graalvm.compiler.api.replacements.Snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/CreateExceptionStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.NativeCall; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DivisionByZeroExceptionStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DivisionByZeroExceptionStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DivisionByZeroExceptionStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/DivisionByZeroExceptionStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import org.graalvm.compiler.api.replacements.Snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ExceptionHandlerStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/ForeignCallStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.JavaCall; @@ -57,7 +59,7 @@ import org.graalvm.compiler.word.WordTypes; import jdk.internal.vm.compiler.word.LocationIdentity; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotSignature; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaMethod; @@ -78,7 +80,7 @@ */ public class ForeignCallStub extends Stub { - private final HotSpotJVMCIRuntimeProvider jvmciRuntime; + private final HotSpotJVMCIRuntime jvmciRuntime; /** * The target of the call. @@ -103,7 +105,7 @@ * be re-executed. * @param killedLocations the memory locations killed by the stub call */ - public ForeignCallStub(OptionValues options, HotSpotJVMCIRuntimeProvider runtime, HotSpotProviders providers, long address, ForeignCallDescriptor descriptor, boolean prependThread, + public ForeignCallStub(OptionValues options, HotSpotJVMCIRuntime runtime, HotSpotProviders providers, long address, ForeignCallDescriptor descriptor, boolean prependThread, Transition transition, boolean reexecutable, LocationIdentity... killedLocations) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewArrayStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; @@ -35,6 +37,7 @@ import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readLayoutHelper; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.registerAsWord; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useCMSIncrementalMode; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useFastTLABRefill; import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH; import static org.graalvm.compiler.hotspot.replacements.NewObjectSnippets.formatArray; import static org.graalvm.compiler.hotspot.stubs.NewInstanceStub.refillAllocate; @@ -122,7 +125,8 @@ // check that array length is small enough for fast path. Word thread = registerAsWord(threadRegister); boolean inlineContiguousAllocationSupported = GraalHotSpotVMConfigNode.inlineContiguousAllocationSupported(); - if (inlineContiguousAllocationSupported && !useCMSIncrementalMode(INJECTED_VMCONFIG) && length >= 0 && length <= MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH) { + if (useFastTLABRefill(INJECTED_VMCONFIG) && inlineContiguousAllocationSupported && !useCMSIncrementalMode(INJECTED_VMCONFIG) && length >= 0 && + length <= MAX_ARRAY_FAST_PATH_ALLOCATION_LENGTH) { Word memory = refillAllocate(thread, intArrayHub, sizeInBytes, logging(options)); if (memory.notEqual(0)) { if (logging(options)) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NewInstanceStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,9 +20,12 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; +import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfigBase.INJECTED_METAACCESS; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.HEAP_END_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.HEAP_TOP_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.PROTOTYPE_MARK_WORD_LOCATION; @@ -32,13 +35,13 @@ import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.TLAB_SIZE_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.TLAB_SLOW_ALLOCATIONS_LOCATION; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.TLAB_THREAD_ALLOCATED_BYTES_LOCATION; -import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.arrayBaseOffset; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getAndClearObjectResult; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.getArrayBaseOffset; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.initializeTlab; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.isInstanceKlassFullyInitialized; -import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readLayoutHelper; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.log2WordSize; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.prototypeMarkWordOffset; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readLayoutHelper; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readTlabEnd; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readTlabStart; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.readTlabTop; @@ -54,6 +57,7 @@ import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.tlabSlowAllocationsOffset; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.tlabStats; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useCMSIncrementalMode; +import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useFastTLABRefill; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useG1GC; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.useTLAB; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.wordSize; @@ -148,7 +152,7 @@ */ Word thread = registerAsWord(threadRegister); boolean inlineContiguousAllocationSupported = GraalHotSpotVMConfigNode.inlineContiguousAllocationSupported(); - if (!forceSlowPath(options) && inlineContiguousAllocationSupported && !useCMSIncrementalMode(INJECTED_VMCONFIG)) { + if (useFastTLABRefill(INJECTED_VMCONFIG) && !forceSlowPath(options) && inlineContiguousAllocationSupported && !useCMSIncrementalMode(INJECTED_VMCONFIG)) { if (isInstanceKlassFullyInitialized(hub)) { int sizeInBytes = readLayoutHelper(hub); Word memory = refillAllocate(thread, intArrayHub, sizeInBytes, logging(options)); @@ -227,7 +231,7 @@ // if TLAB is currently allocated (top or end != null) then // fill [top, end + alignment_reserve) with array object if (top.notEqual(0)) { - int headerSize = arrayBaseOffset(JavaKind.Int); + int headerSize = getArrayBaseOffset(INJECTED_METAACCESS, JavaKind.Int); // just like the HotSpot assembler stubs, assumes that tlabFreeSpaceInInts fits in // an int int tlabFreeSpaceInInts = (int) tlabFreeSpaceInBytes >>> 2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/NullPointerExceptionStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import org.graalvm.compiler.api.replacements.Snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/OutOfBoundsExceptionStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static org.graalvm.compiler.hotspot.stubs.StubUtil.printNumber; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/SnippetStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext.CompilationContext.INLINE_AFTER_PARSING; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubCompilationIdentifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import java.util.concurrent.atomic.AtomicLong; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/Stub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static java.util.Collections.singletonList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import org.graalvm.compiler.options.Option; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/StubUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static jdk.vm.ci.meta.DeoptimizationReason.RuntimeConstraint; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/UnwindExceptionToCallerStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static org.graalvm.compiler.hotspot.GraalHotSpotVMConfig.INJECTED_VMCONFIG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/stubs/VerifyOopStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.stubs; import static org.graalvm.compiler.hotspot.stubs.StubUtil.verifyObject; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/WeakClassLoaderSet.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/WeakClassLoaderSet.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/WeakClassLoaderSet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/WeakClassLoaderSet.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot; import java.lang.ref.Reference; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotOperation.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.word; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/HotSpotWordTypes.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.word; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/KlassPointer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.word; import static org.graalvm.compiler.hotspot.word.HotSpotOperation.HotspotOpcode.POINTER_EQ; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MetaspacePointer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.word; import static org.graalvm.compiler.hotspot.word.HotSpotOperation.HotspotOpcode.FROM_POINTER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodCountersPointer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.word; import static org.graalvm.compiler.hotspot.word.HotSpotOperation.HotspotOpcode.POINTER_EQ; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/MethodPointer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.word; import static org.graalvm.compiler.hotspot.word.HotSpotOperation.HotspotOpcode.POINTER_EQ; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/word/PointerCastNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.word; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackendFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,15 +21,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.aarch64.AArch64.sp; import static jdk.vm.ci.common.InitTimer.timer; -import jdk.vm.ci.code.Architecture; -import jdk.vm.ci.code.Register; -import jdk.vm.ci.code.RegisterConfig; -import jdk.vm.ci.code.TargetDescription; +import java.util.ArrayList; +import java.util.List; + import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; import org.graalvm.compiler.bytecode.BytecodeProvider; import org.graalvm.compiler.core.aarch64.AArch64AddressLoweringByUse; @@ -69,18 +70,19 @@ import org.graalvm.compiler.word.WordTypes; import jdk.vm.ci.aarch64.AArch64; +import jdk.vm.ci.code.Architecture; +import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterConfig; +import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.common.InitTimer; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; import jdk.vm.ci.hotspot.aarch64.AArch64HotSpotRegisterConfig; import jdk.vm.ci.meta.Value; import jdk.vm.ci.runtime.JVMCIBackend; -import java.util.ArrayList; -import java.util.List; - @ServiceProvider(HotSpotBackendFactory.class) public class AArch64HotSpotBackendFactory implements HotSpotBackendFactory { @@ -96,7 +98,7 @@ @Override @SuppressWarnings("try") - public HotSpotBackend createBackend(HotSpotGraalRuntimeProvider graalRuntime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotBackend host) { + public HotSpotBackend createBackend(HotSpotGraalRuntimeProvider graalRuntime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntime jvmciRuntime, HotSpotBackend host) { assert host == null; JVMCIBackend jvmci = jvmciRuntime.getHostJVMCIBackend(); @@ -166,7 +168,7 @@ HotSpotReplacementsImpl replacements, HotSpotWordTypes wordTypes, HotSpotStampProvider stampProvider) { Plugins plugins = HotSpotGraphBuilderPlugins.create(compilerConfiguration, config, wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, lowerer, stampProvider, replacements); - AArch64GraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider()); + AArch64GraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), false); return plugins; } @@ -182,7 +184,7 @@ return new HotSpotReplacementsImpl(options, p, snippetReflection, bytecodeProvider, p.getCodeCache().getTarget()); } - protected HotSpotHostForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess, + protected HotSpotHostForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) { return new AArch64HotSpotForeignCallsProvider(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes, nativeABICallerSaveRegisters); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotBackend.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static java.lang.reflect.Modifier.isStatic; @@ -108,7 +110,7 @@ @Override public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, StructuredGraph graph, Object stub) { - return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub); + return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub, config.requiresReservedStackCheck(graph.getMethods())); } @Override @@ -232,7 +234,8 @@ HotSpotFrameContext frameContext = new HotSpotFrameContext(stub != null); DataBuilder dataBuilder = new HotSpotDataBuilder(getCodeCache().getTarget()); - CompilationResultBuilder crb = factory.createBuilder(getCodeCache(), getForeignCalls(), frameMap, masm, dataBuilder, frameContext, lir.getOptions(), lir.getDebug(), compilationResult); + CompilationResultBuilder crb = factory.createBuilder(getCodeCache(), getForeignCalls(), frameMap, masm, dataBuilder, frameContext, lir.getOptions(), lir.getDebug(), compilationResult, + Register.None); crb.setTotalFrameSize(frameMap.totalFrameSize()); crb.setMaxInterpreterFrameSize(gen.getMaxInterpreterFrameSize()); StackSlot deoptimizationRescueSlot = gen.getDeoptimizationRescueSlot(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotConstantRetrievalOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotConstantRetrievalOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotConstantRetrievalOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotConstantRetrievalOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallEpilogueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.aarch64.AArch64.zr; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotCRuntimeCallPrologueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeCallerOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; @@ -44,7 +46,7 @@ @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { - leaveFrame(crb, masm, /* emitSafepoint */false); + leaveFrame(crb, masm, /* emitSafepoint */false, false); AArch64Call.directJmp(crb, masm, crb.foreignCalls.lookupForeignCall(UNCOMMON_TRAP_HANDLER)); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDeoptimizeOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectStaticCallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.hotspot.aarch64.AArch64HotSpotRegisterConfig.inlineCacheRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotDirectVirtualCallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.hotspot.aarch64.AArch64HotSpotRegisterConfig.inlineCacheRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotEpilogueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,16 +20,33 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; +import static jdk.vm.ci.aarch64.AArch64.lr; +import static jdk.vm.ci.aarch64.AArch64.sp; +import static jdk.vm.ci.aarch64.AArch64.zr; +import static jdk.vm.ci.hotspot.aarch64.AArch64HotSpotRegisterConfig.fp; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.ENABLE_STACK_RESERVED_ZONE; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.THROW_DELAYED_STACKOVERFLOW_ERROR; + +import org.graalvm.compiler.asm.Label; +import org.graalvm.compiler.asm.aarch64.AArch64Address; +import org.graalvm.compiler.asm.aarch64.AArch64Assembler; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler.ScratchRegister; +import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProvider; import org.graalvm.compiler.lir.LIRInstructionClass; import org.graalvm.compiler.lir.aarch64.AArch64BlockEndOp; +import org.graalvm.compiler.lir.aarch64.AArch64Call; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; +import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterValue; /** * Superclass for operations that leave a method's frame. @@ -51,9 +68,31 @@ this.thread = null; // no safepoint } - protected void leaveFrame(CompilationResultBuilder crb, AArch64MacroAssembler masm, boolean emitSafepoint) { + protected void leaveFrame(CompilationResultBuilder crb, AArch64MacroAssembler masm, boolean emitSafepoint, boolean requiresReservedStackAccessCheck) { assert crb.frameContext != null : "We never elide frames in aarch64"; crb.frameContext.leave(crb); + if (requiresReservedStackAccessCheck) { + HotSpotForeignCallsProvider foreignCalls = (HotSpotForeignCallsProvider) crb.foreignCalls; + Label noReserved = new Label(); + try (ScratchRegister sc = masm.getScratchRegister()) { + Register scratch = sc.getRegister(); + masm.ldr(64, scratch, masm.makeAddress(thread, config.javaThreadReservedStackActivationOffset, 8)); + masm.subs(64, zr, sp, scratch); + } + masm.branchConditionally(AArch64Assembler.ConditionFlag.LO, noReserved); + ForeignCallLinkage enableStackReservedZone = foreignCalls.lookupForeignCall(ENABLE_STACK_RESERVED_ZONE); + CallingConvention cc = enableStackReservedZone.getOutgoingCallingConvention(); + assert cc.getArgumentCount() == 1; + Register arg0 = ((RegisterValue) cc.getArgument(0)).getRegister(); + masm.mov(64, arg0, thread); + try (ScratchRegister sc = masm.getScratchRegister()) { + masm.stp(64, fp, lr, AArch64Address.createPreIndexedImmediateAddress(sp, -2)); + AArch64Call.directCall(crb, masm, enableStackReservedZone, sc.getRegister(), null); + masm.ldp(64, fp, lr, AArch64Address.createPostIndexedImmediateAddress(sp, 2)); + } + AArch64Call.directJmp(crb, masm, foreignCalls.lookupForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR)); + masm.bind(noReserved); + } if (emitSafepoint) { try (ScratchRegister sc = masm.getScratchRegister()) { Register scratch = sc.getRegister(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotForeignCallsProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.aarch64.AArch64.r0; @@ -29,8 +31,8 @@ import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.JUMP_ADDRESS; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF; -import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32; import static org.graalvm.compiler.hotspot.replacements.CRC32CSubstitutions.UPDATE_BYTES_CRC32C; +import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32; import static jdk.internal.vm.compiler.word.LocationIdentity.any; import org.graalvm.compiler.core.common.LIRKind; @@ -47,7 +49,7 @@ import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.code.TargetDescription; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.Value; @@ -56,7 +58,7 @@ private final Value[] nativeABICallerSaveRegisters; - public AArch64HotSpotForeignCallsProvider(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, + public AArch64HotSpotForeignCallsProvider(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) { super(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes); this.nativeABICallerSaveRegisters = nativeABICallerSaveRegisters; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotJumpToExceptionHandlerInCallerOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,12 +20,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; -import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; import static jdk.vm.ci.aarch64.AArch64.sp; import static jdk.vm.ci.code.ValueUtil.asRegister; import static jdk.vm.ci.hotspot.aarch64.AArch64HotSpotRegisterConfig.fp; +import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; import org.graalvm.compiler.asm.Label; import org.graalvm.compiler.asm.aarch64.AArch64Address; @@ -67,7 +69,7 @@ @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { - leaveFrame(crb, masm, /* emitSafepoint */false); + leaveFrame(crb, masm, /* emitSafepoint */false, false); if (GraalServices.JAVA_SPECIFICATION_VERSION < 8) { // Restore sp from fp if the exception PC is a method handle call site. diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2018, Red Hat Inc. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -22,23 +22,24 @@ * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; import static org.graalvm.compiler.hotspot.HotSpotBackend.INITIALIZE_KLASS_BY_SYMBOL; +import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_DYNAMIC_INVOKE; import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_KLASS_BY_SYMBOL; import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_METHOD_BY_SYMBOL_AND_LOAD_COUNTERS; import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_STRING_BY_SYMBOL; -import static org.graalvm.compiler.hotspot.HotSpotBackend.RESOLVE_DYNAMIC_INVOKE; -import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.RESOLVE; import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.INITIALIZE; import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.LOAD_COUNTERS; +import static org.graalvm.compiler.hotspot.meta.HotSpotConstantLoadAction.RESOLVE; import static org.graalvm.compiler.lir.LIRValueUtil.asConstant; import static org.graalvm.compiler.lir.LIRValueUtil.isConstantValue; import java.util.function.Function; -import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant; import org.graalvm.compiler.asm.Label; import org.graalvm.compiler.asm.aarch64.AArch64Address.AddressingMode; import org.graalvm.compiler.asm.aarch64.AArch64Assembler.ConditionFlag; @@ -79,10 +80,10 @@ import org.graalvm.compiler.lir.aarch64.AArch64Move; import org.graalvm.compiler.lir.aarch64.AArch64Move.StoreOp; import org.graalvm.compiler.lir.aarch64.AArch64PrefetchOp; -import org.graalvm.compiler.lir.aarch64.AArch64SaveRegistersOp; import org.graalvm.compiler.lir.aarch64.AArch64RestoreRegistersOp; - +import org.graalvm.compiler.lir.aarch64.AArch64SaveRegistersOp; import org.graalvm.compiler.lir.gen.LIRGenerationResult; +import org.graalvm.compiler.options.OptionValues; import jdk.vm.ci.aarch64.AArch64; import jdk.vm.ci.aarch64.AArch64Kind; @@ -91,6 +92,7 @@ import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.hotspot.HotSpotCompressedNullConstant; +import jdk.vm.ci.hotspot.HotSpotMetaspaceConstant; import jdk.vm.ci.hotspot.HotSpotObjectConstant; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Constant; @@ -99,8 +101,8 @@ import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.PlatformKind; +import jdk.vm.ci.meta.SpeculationLog; import jdk.vm.ci.meta.Value; -import org.graalvm.compiler.options.OptionValues; /** * LIR generator specialized for AArch64 HotSpot. @@ -398,8 +400,8 @@ @Override public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) { Value actionAndReason = emitJavaConstant(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0)); - Value nullValue = emitConstant(LIRKind.reference(AArch64Kind.QWORD), JavaConstant.NULL_POINTER); - moveDeoptValuesToThread(actionAndReason, nullValue); + Value speculation = emitJavaConstant(getMetaAccess().encodeSpeculation(SpeculationLog.NO_SPECULATION)); + moveDeoptValuesToThread(actionAndReason, speculation); append(new AArch64HotSpotDeoptimizeCallerOp(config)); } @@ -499,7 +501,7 @@ emitMove(operand, input); } Register thread = getProviders().getRegisters().getThreadRegister(); - append(new AArch64HotSpotReturnOp(operand, getStub() != null, config, thread)); + append(new AArch64HotSpotReturnOp(operand, getStub() != null, config, thread, getResult().requiresReservedStackAccessCheck())); } @Override diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoadAddressOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoadAddressOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoadAddressOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoadAddressOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoadConfigValueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoadConfigValueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoadConfigValueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoadConfigValueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotLoweringProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMoveFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.hotspot.HotSpotCompressedNullConstant.COMPRESSED_NULL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotMove.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.aarch64.AArch64.zr; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotNodeLIRBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.aarch64.AArch64.lr; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotPatchReturnAddressOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotRegisterAllocationConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.aarch64.AArch64.r0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotReturnOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,12 +20,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; -import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; -import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; import static jdk.vm.ci.aarch64.AArch64.lr; import static jdk.vm.ci.code.ValueUtil.asRegister; +import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; +import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; @@ -46,9 +48,11 @@ @Use({REG, ILLEGAL}) private Value result; private final boolean isStub; + private final boolean requiresReservedStackAccessCheck; - public AArch64HotSpotReturnOp(Value result, boolean isStub, GraalHotSpotVMConfig config, Register thread) { + public AArch64HotSpotReturnOp(Value result, boolean isStub, GraalHotSpotVMConfig config, Register thread, boolean requiresReservedStackAccessCheck) { super(TYPE, config, thread); + this.requiresReservedStackAccessCheck = requiresReservedStackAccessCheck; assert validReturnValue(result); this.result = result; this.isStub = isStub; @@ -64,7 +68,7 @@ @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { final boolean emitSafepoint = !isStub; - leaveFrame(crb, masm, emitSafepoint); + leaveFrame(crb, masm, emitSafepoint, requiresReservedStackAccessCheck); masm.ret(lr); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotSafepointOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.aarch64.AArch64.zr; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotStrategySwitchOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64HotSpotUnwindOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,11 +20,13 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; -import static org.graalvm.compiler.hotspot.HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER; import static jdk.vm.ci.aarch64.AArch64.lr; import static jdk.vm.ci.code.ValueUtil.asRegister; +import static org.graalvm.compiler.hotspot.HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; @@ -55,7 +57,7 @@ @Override public void emitCode(CompilationResultBuilder crb, AArch64MacroAssembler masm) { - leaveFrame(crb, masm, /* emitSafepoint */false); + leaveFrame(crb, masm, /* emitSafepoint */false, false); ForeignCallLinkage linkage = crb.foreignCalls.lookupForeignCall(UNWIND_EXCEPTION_TO_CALLER); CallingConvention cc = linkage.getOutgoingCallingConvention(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.aarch64/src/org/graalvm/compiler/hotspot/aarch64/AArch64IndirectCallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64DeoptimizeOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotAddressLowering.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackendFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,10 +20,13 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.common.InitTimer.timer; import static org.graalvm.compiler.hotspot.HotSpotBackend.Options.GraalArithmeticStubs; + import java.util.ArrayList; import java.util.List; @@ -68,7 +71,7 @@ import jdk.vm.ci.common.InitTimer; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; import jdk.vm.ci.meta.Value; import jdk.vm.ci.runtime.JVMCIBackend; @@ -88,7 +91,7 @@ @Override @SuppressWarnings("try") - public HotSpotBackend createBackend(HotSpotGraalRuntimeProvider graalRuntime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotBackend host) { + public HotSpotBackend createBackend(HotSpotGraalRuntimeProvider graalRuntime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntime jvmciRuntime, HotSpotBackend host) { assert host == null; OptionValues options = graalRuntime.getOptions(); @@ -160,7 +163,7 @@ HotSpotSnippetReflectionProvider snippetReflection, HotSpotReplacementsImpl replacements, HotSpotWordTypes wordTypes, HotSpotStampProvider stampProvider) { Plugins plugins = HotSpotGraphBuilderPlugins.create(compilerConfiguration, config, wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, lowerer, stampProvider, replacements); - AMD64GraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), (AMD64) target.arch, GraalArithmeticStubs.getValue(options)); + AMD64GraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), (AMD64) target.arch, GraalArithmeticStubs.getValue(options), false); return plugins; } @@ -176,7 +179,7 @@ return new HotSpotReplacementsImpl(options, p, snippetReflection, bytecodeProvider, p.getCodeCache().getTarget()); } - protected AMD64HotSpotForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess, + protected AMD64HotSpotForeignCallsProvider createForeignCalls(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider runtime, HotSpotMetaAccessProvider metaAccess, HotSpotCodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) { return new AMD64HotSpotForeignCallsProvider(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes, nativeABICallerSaveRegisters); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotBackend.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.amd64.AMD64.r10; @@ -109,7 +111,7 @@ @Override public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, StructuredGraph graph, Object stub) { - return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub); + return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub, config.requiresReservedStackCheck(graph.getMethods())); } @Override @@ -223,7 +225,7 @@ Assembler masm = createAssembler(frameMap); HotSpotFrameContext frameContext = new HotSpotFrameContext(stub != null, omitFrame); DataBuilder dataBuilder = new HotSpotDataBuilder(getCodeCache().getTarget()); - CompilationResultBuilder crb = factory.createBuilder(getCodeCache(), getForeignCalls(), frameMap, masm, dataBuilder, frameContext, options, debug, compilationResult); + CompilationResultBuilder crb = factory.createBuilder(getCodeCache(), getForeignCalls(), frameMap, masm, dataBuilder, frameContext, options, debug, compilationResult, Register.None); crb.setTotalFrameSize(frameMap.totalFrameSize()); crb.setMaxInterpreterFrameSize(gen.getMaxInterpreterFrameSize()); StackSlot deoptimizationRescueSlot = gen.getDeoptimizationRescueSlot(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotConstantRetrievalOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCounterOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallEpilogueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import org.graalvm.compiler.asm.amd64.AMD64Address; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotCRuntimeCallPrologueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.amd64.AMD64.rsp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDeoptimizeCallerOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotDirectStaticCallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotspotDirectVirtualCallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueBlockEndOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotEpilogueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotForeignCallsProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.amd64.AMD64.rax; @@ -32,8 +34,8 @@ import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF_NOFP; -import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32; import static org.graalvm.compiler.hotspot.replacements.CRC32CSubstitutions.UPDATE_BYTES_CRC32C; +import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32; import static jdk.internal.vm.compiler.word.LocationIdentity.any; import org.graalvm.compiler.core.common.LIRKind; @@ -50,7 +52,7 @@ import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.code.TargetDescription; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.Value; @@ -67,7 +69,7 @@ private final Value[] nativeABICallerSaveRegisters; - public AMD64HotSpotForeignCallsProvider(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, + public AMD64HotSpotForeignCallsProvider(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) { super(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes); this.nativeABICallerSaveRegisters = nativeABICallerSaveRegisters; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotJumpToExceptionHandlerInCallerOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveCurrentStackFrameOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.amd64.AMD64.rdx; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLeaveDeoptimizedStackFrameOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.amd64.AMD64.rbp; @@ -100,6 +102,7 @@ import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.PlatformKind; import jdk.vm.ci.meta.PrimitiveConstant; +import jdk.vm.ci.meta.SpeculationLog; import jdk.vm.ci.meta.Value; /** @@ -115,7 +118,7 @@ } private AMD64HotSpotLIRGenerator(HotSpotProviders providers, GraalHotSpotVMConfig config, LIRGenerationResult lirGenRes, BackupSlotProvider backupSlotProvider) { - this(new AMD64HotSpotLIRKindTool(), new AMD64ArithmeticLIRGenerator(new AMD64HotSpotMaths()), new AMD64HotSpotMoveFactory(backupSlotProvider), providers, config, lirGenRes); + this(new AMD64HotSpotLIRKindTool(), new AMD64ArithmeticLIRGenerator(null, new AMD64HotSpotMaths()), new AMD64HotSpotMoveFactory(backupSlotProvider), providers, config, lirGenRes); } protected AMD64HotSpotLIRGenerator(LIRKindTool lirKindTool, AMD64ArithmeticLIRGenerator arithmeticLIRGen, MoveFactory moveFactory, HotSpotProviders providers, GraalHotSpotVMConfig config, @@ -265,7 +268,7 @@ pollOnReturnScratchRegister = findPollOnReturnScratchRegister(); } Register thread = getProviders().getRegisters().getThreadRegister(); - append(new AMD64HotSpotReturnOp(operand, getStub() != null, thread, pollOnReturnScratchRegister, config)); + append(new AMD64HotSpotReturnOp(operand, getStub() != null, thread, pollOnReturnScratchRegister, config, getResult().requiresReservedStackAccessCheck())); } @Override @@ -534,8 +537,8 @@ @Override public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) { Value actionAndReason = emitJavaConstant(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0)); - Value nullValue = emitConstant(LIRKind.reference(AMD64Kind.QWORD), JavaConstant.NULL_POINTER); - moveDeoptValuesToThread(actionAndReason, nullValue); + Value speculation = emitJavaConstant(getMetaAccess().encodeSpeculation(SpeculationLog.NO_SPECULATION)); + moveDeoptValuesToThread(actionAndReason, speculation); append(new AMD64HotSpotDeoptimizeCallerOp()); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLIRKindTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import org.graalvm.compiler.core.amd64.AMD64LIRKindTool; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadAddressOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoadConfigValueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotLoweringProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.hotspot.HotSpotBackend.Options.GraalArithmeticStubs; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMathIntrinsicOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMaths.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMaths.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMaths.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMaths.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.hotspot.HotSpotBackend.Options.GraalArithmeticStubs; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMoveFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import org.graalvm.compiler.core.amd64.AMD64MoveFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotMove.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotNodeLIRBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.amd64.AMD64.rbp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPatchReturnAddressOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotPushInterpreterFrameOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRegisterAllocationConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.amd64.AMD64.r10; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotRestoreRbpOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotReturnOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,20 +20,34 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; +import static jdk.vm.ci.amd64.AMD64.r15; +import static jdk.vm.ci.amd64.AMD64.rsp; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.ENABLE_STACK_RESERVED_ZONE; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.THROW_DELAYED_STACKOVERFLOW_ERROR; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; +import org.graalvm.compiler.asm.Label; +import org.graalvm.compiler.asm.amd64.AMD64Address; +import org.graalvm.compiler.asm.amd64.AMD64Assembler; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; +import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProvider; import org.graalvm.compiler.lir.LIRInstructionClass; import org.graalvm.compiler.lir.Opcode; +import org.graalvm.compiler.lir.amd64.AMD64Call; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; import org.graalvm.compiler.lir.gen.DiagnosticLIRGeneratorTool.ZapStackArgumentSpaceBeforeInstruction; import jdk.vm.ci.amd64.AMD64.CPUFeature; +import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.meta.Value; /** @@ -48,20 +62,47 @@ private final Register thread; private final Register scratchForSafepointOnReturn; private final GraalHotSpotVMConfig config; + private final boolean requiresReservedStackAccessCheck; - AMD64HotSpotReturnOp(Value value, boolean isStub, Register thread, Register scratchForSafepointOnReturn, GraalHotSpotVMConfig config) { + AMD64HotSpotReturnOp(Value value, boolean isStub, Register thread, Register scratchForSafepointOnReturn, GraalHotSpotVMConfig config, boolean requiresReservedStackAccessCheck) { super(TYPE); this.value = value; this.isStub = isStub; this.thread = thread; this.scratchForSafepointOnReturn = scratchForSafepointOnReturn; this.config = config; + this.requiresReservedStackAccessCheck = requiresReservedStackAccessCheck; } @Override public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { leaveFrameAndRestoreRbp(crb, masm); if (!isStub) { + if (requiresReservedStackAccessCheck) { + assert scratchForSafepointOnReturn != null; + HotSpotForeignCallsProvider foreignCalls = (HotSpotForeignCallsProvider) crb.foreignCalls; + + Label noReserved = new Label(); + masm.cmpptr(rsp, new AMD64Address(r15, config.javaThreadReservedStackActivationOffset)); + masm.jccb(AMD64Assembler.ConditionFlag.Below, noReserved); + // direct call to runtime without stub needs aligned stack + int stackAdjust = crb.target.stackAlignment - crb.target.wordSize; + if (stackAdjust > 0) { + masm.subq(rsp, stackAdjust); + } + ForeignCallLinkage enableStackReservedZone = foreignCalls.lookupForeignCall(ENABLE_STACK_RESERVED_ZONE); + CallingConvention cc = enableStackReservedZone.getOutgoingCallingConvention(); + assert cc.getArgumentCount() == 1; + Register arg0 = ((RegisterValue) cc.getArgument(0)).getRegister(); + masm.movq(arg0, thread); + AMD64Call.directCall(crb, masm, enableStackReservedZone, scratchForSafepointOnReturn, false, null); + if (stackAdjust > 0) { + masm.addq(rsp, stackAdjust); + } + AMD64Call.directJmp(crb, masm, foreignCalls.lookupForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR), scratchForSafepointOnReturn); + masm.bind(noReserved); + } + // Every non-stub compile method must have a poll before the return. AMD64HotSpotSafepointOp.emitCode(crb, masm, config, true, null, thread, scratchForSafepointOnReturn); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSafepointOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.core.common.NumUtil.isInt; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotStrategySwitchOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import org.graalvm.compiler.asm.amd64.AMD64Address; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesCreator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesCreator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesCreator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotSuitesCreator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import org.graalvm.compiler.core.amd64.AMD64SuitesCreator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64HotSpotUnwindOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.hotspot.HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64IndirectCallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64MathStub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static org.graalvm.compiler.hotspot.amd64.AMD64HotSpotForeignCallsProvider.ARITHMETIC_COS_STUB; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64/src/org/graalvm/compiler/hotspot/amd64/AMD64TailcallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/AMD64HotSpotFrameOmissionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64.test; import static jdk.vm.ci.amd64.AMD64.rax; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/ArrayAccessInLoopToAddressTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/ArrayAccessInLoopToAddressTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/ArrayAccessInLoopToAddressTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/ArrayAccessInLoopToAddressTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64.test; import jdk.vm.ci.hotspot.HotSpotSpeculationLog; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/CompressedNullCheckTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.amd64.test; import static org.graalvm.compiler.core.common.GraalOptions.OptImplicitNullChecks; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/DataPatchInConstantsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.amd64.test; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.amd64.test/src/org/graalvm/compiler/hotspot/amd64/test/StubAVXTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.amd64.test; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.lir.test/src/org/graalvm/compiler/hotspot/lir/test/ExceedMaxOopMapStackOffset.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.lir.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCDeoptimizeOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackendFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import java.util.HashSet; @@ -62,7 +64,7 @@ import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotMetaAccessProvider; import jdk.vm.ci.meta.Value; import jdk.vm.ci.runtime.JVMCIBackend; @@ -82,7 +84,7 @@ } @Override - public HotSpotBackend createBackend(HotSpotGraalRuntimeProvider runtime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotBackend host) { + public HotSpotBackend createBackend(HotSpotGraalRuntimeProvider runtime, CompilerConfiguration compilerConfiguration, HotSpotJVMCIRuntime jvmciRuntime, HotSpotBackend host) { assert host == null; GraalHotSpotVMConfig config = runtime.getVMConfig(); @@ -117,7 +119,7 @@ HotSpotSnippetReflectionProvider snippetReflection, HotSpotReplacementsImpl replacements, HotSpotWordTypes wordTypes) { Plugins plugins = HotSpotGraphBuilderPlugins.create(compilerConfiguration, config, wordTypes, metaAccess, constantReflection, snippetReflection, foreignCalls, lowerer, stampProvider, replacements); - SPARCGraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider()); + SPARCGraphBuilderPlugins.register(plugins, replacements.getDefaultReplacementBytecodeProvider(), false); return plugins; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotBackend.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.code.ValueUtil.asRegister; @@ -150,7 +152,7 @@ @Override public LIRGenerationResult newLIRGenerationResult(CompilationIdentifier compilationId, LIR lir, FrameMapBuilder frameMapBuilder, StructuredGraph graph, Object stub) { - return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub); + return new HotSpotLIRGenerationResult(compilationId, lir, frameMapBuilder, makeCallingConvention(graph, (Stub) stub), stub, config.requiresReservedStackCheck(graph.getMethods())); } @Override @@ -193,7 +195,9 @@ final int frameSize = crb.frameMap.totalFrameSize(); final int stackpoinerChange = -frameSize; SPARCMacroAssembler masm = (SPARCMacroAssembler) crb.asm; - emitStackOverflowCheck(crb); + if (!isStub) { + emitStackOverflowCheck(crb); + } if (SPARCAssembler.isSimm13(stackpoinerChange)) { masm.save(sp, stackpoinerChange, sp); @@ -241,7 +245,7 @@ OptionValues options = lir.getOptions(); DebugContext debug = lir.getDebug(); CompilationResultBuilder crb = factory.createBuilder(getProviders().getCodeCache(), getProviders().getForeignCalls(), frameMap, masm, dataBuilder, frameContext, options, debug, - compilationResult); + compilationResult, Register.None); crb.setTotalFrameSize(frameMap.totalFrameSize()); crb.setMaxInterpreterFrameSize(gen.getMaxInterpreterFrameSize()); StackSlot deoptimizationRescueSlot = gen.getDeoptimizationRescueSlot(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCounterOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.isSimm13; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallEpilogueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotCRuntimeCallPrologueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotDeoptimizeCallerOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.hotspot.HotSpotHostBackend.UNCOMMON_TRAP_HANDLER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectStaticCallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotspotDirectVirtualCallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.sparc.SPARC.g5; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotEpilogueOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import org.graalvm.compiler.lir.LIRInstructionClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotForeignCallsProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.hotspot.HotSpotCallingConventionType.NativeCall; @@ -33,8 +35,8 @@ import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.JUMP_ADDRESS; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.RegisterEffect.PRESERVES_REGISTERS; import static org.graalvm.compiler.hotspot.HotSpotForeignCallLinkage.Transition.LEAF_NOFP; -import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32; import static org.graalvm.compiler.hotspot.replacements.CRC32CSubstitutions.UPDATE_BYTES_CRC32C; +import static org.graalvm.compiler.hotspot.replacements.CRC32Substitutions.UPDATE_BYTES_CRC32; import static jdk.internal.vm.compiler.word.LocationIdentity.any; import org.graalvm.compiler.core.common.LIRKind; @@ -50,7 +52,7 @@ import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.code.TargetDescription; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.PlatformKind; @@ -60,7 +62,7 @@ private final Value[] nativeABICallerSaveRegisters; - public SPARCHotSpotForeignCallsProvider(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, + public SPARCHotSpotForeignCallsProvider(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalRuntimeProvider runtime, MetaAccessProvider metaAccess, CodeCacheProvider codeCache, WordTypes wordTypes, Value[] nativeABICallerSaveRegisters) { super(jvmciRuntime, runtime, metaAccess, codeCache, wordTypes); this.nativeABICallerSaveRegisters = nativeABICallerSaveRegisters; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerInCallerOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotJumpToExceptionHandlerOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveCurrentStackFrameOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.sparc.SPARC.i0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLeaveDeoptimizedStackFrameOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.sparc.SPARC.i0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.sparc.SPARCKind.WORD; @@ -79,6 +81,7 @@ import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.PlatformKind; +import jdk.vm.ci.meta.SpeculationLog; import jdk.vm.ci.meta.Value; import jdk.vm.ci.meta.ValueKind; import jdk.vm.ci.sparc.SPARC; @@ -191,7 +194,7 @@ emitMove(operand, input); } Register thread = getProviders().getRegisters().getThreadRegister(); - append(new SPARCHotSpotReturnOp(operand, getStub() != null, config, thread, getSafepointAddressValue())); + append(new SPARCHotSpotReturnOp(operand, getStub() != null, config, thread, getSafepointAddressValue(), getResult().requiresReservedStackAccessCheck())); } @Override @@ -230,8 +233,8 @@ @Override public void emitDeoptimizeCaller(DeoptimizationAction action, DeoptimizationReason reason) { Value actionAndReason = emitJavaConstant(getMetaAccess().encodeDeoptActionAndReason(action, reason, 0)); - Value nullValue = emitJavaConstant(JavaConstant.NULL_POINTER); - moveDeoptValuesToThread(actionAndReason, nullValue); + Value speculation = emitJavaConstant(getMetaAccess().encodeSpeculation(SpeculationLog.NO_SPECULATION)); + moveDeoptValuesToThread(actionAndReason, speculation); append(new SPARCHotSpotDeoptimizeCallerOp()); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotLoweringProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import org.graalvm.compiler.core.common.spi.ForeignCallsProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMoveFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.hotspot.HotSpotCompressedNullConstant.COMPRESSED_NULL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotMove.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.BPR; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotNodeLIRBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.sparc.SPARC.g5; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPatchReturnAddressOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotPushInterpreterFrameOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotRegisterAllocationConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.sparc.SPARC.d32; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotReturnOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,19 +20,33 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; +import static jdk.vm.ci.sparc.SPARC.sp; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.ENABLE_STACK_RESERVED_ZONE; +import static org.graalvm.compiler.hotspot.HotSpotHostBackend.THROW_DELAYED_STACKOVERFLOW_ERROR; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; +import org.graalvm.compiler.asm.Label; +import org.graalvm.compiler.asm.sparc.SPARCAddress; +import org.graalvm.compiler.asm.sparc.SPARCAssembler; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; +import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler.ScratchRegister; +import org.graalvm.compiler.core.common.spi.ForeignCallLinkage; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.graalvm.compiler.hotspot.meta.HotSpotForeignCallsProvider; import org.graalvm.compiler.lir.LIRInstructionClass; import org.graalvm.compiler.lir.Opcode; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; +import org.graalvm.compiler.lir.sparc.SPARCCall; import org.graalvm.compiler.lir.sparc.SPARCControlFlow.ReturnOp; +import jdk.vm.ci.code.CallingConvention; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.meta.Value; /** @@ -45,22 +59,42 @@ @Use({REG, ILLEGAL}) protected Value value; @Use({REG, ILLEGAL}) protected Value safepointPollAddress; + private final boolean requiresReservedStackAccessCheck; private final boolean isStub; private final GraalHotSpotVMConfig config; private final Register thread; - SPARCHotSpotReturnOp(Value value, boolean isStub, GraalHotSpotVMConfig config, Register thread, Value safepointPoll) { + SPARCHotSpotReturnOp(Value value, boolean isStub, GraalHotSpotVMConfig config, Register thread, Value safepointPoll, boolean requiresReservedStackAccessCheck) { super(TYPE, SIZE); this.value = value; this.isStub = isStub; this.config = config; this.thread = thread; this.safepointPollAddress = safepointPoll; + this.requiresReservedStackAccessCheck = requiresReservedStackAccessCheck; } @Override public void emitCode(CompilationResultBuilder crb, SPARCMacroAssembler masm) { if (!isStub) { + if (requiresReservedStackAccessCheck) { + try (ScratchRegister sc = masm.getScratchRegister()) { + HotSpotForeignCallsProvider foreignCalls = (HotSpotForeignCallsProvider) crb.foreignCalls; + Label noReserved = new Label(); + Register scratch = sc.getRegister(); + masm.ldx(new SPARCAddress(thread, config.javaThreadReservedStackActivationOffset), scratch); + masm.compareBranch(sp, scratch, SPARCAssembler.ConditionFlag.LessUnsigned, SPARCAssembler.CC.Xcc, noReserved, SPARCAssembler.BranchPredict.PREDICT_TAKEN, null); + ForeignCallLinkage enableStackReservedZone = foreignCalls.lookupForeignCall(ENABLE_STACK_RESERVED_ZONE); + CallingConvention cc = enableStackReservedZone.getOutgoingCallingConvention(); + assert cc.getArgumentCount() == 1; + Register arg0 = ((RegisterValue) cc.getArgument(0)).getRegister(); + masm.mov(thread, arg0); + SPARCCall.directCall(crb, masm, enableStackReservedZone, scratch, null); + masm.restoreWindow(); + SPARCCall.indirectJmp(crb, masm, scratch, foreignCalls.lookupForeignCall(THROW_DELAYED_STACKOVERFLOW_ERROR)); + masm.bind(noReserved); + } + } // Every non-stub compile method must have a poll before the return. SPARCHotSpotSafepointOp.emitCode(crb, masm, config, true, null, thread, safepointPollAddress); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotSafepointOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotStrategySwitchOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCHotSpotUnwindOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.hotspot.HotSpotBackend.UNWIND_EXCEPTION_TO_CALLER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc/src/org/graalvm/compiler/hotspot/sparc/SPARCIndirectCallOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.sparc.test/src/org/graalvm/compiler/core/sparc/test/SPARCAllocatorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.core.sparc.test; import static org.graalvm.compiler.core.common.GraalOptions.RegisterPressure; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/AheadOfTimeCompilationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import jdk.vm.ci.aarch64.AArch64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayCopyIntrinsificationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayNewInstanceTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayNewInstanceTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayNewInstanceTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ArrayNewInstanceTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CheckGraalIntrinsics.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.lang.reflect.Method; @@ -49,6 +51,7 @@ import org.graalvm.compiler.test.GraalTest; import org.junit.Test; +import jdk.vm.ci.aarch64.AArch64; import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.code.Architecture; import jdk.vm.ci.hotspot.HotSpotVMConfigStore; @@ -368,6 +371,7 @@ if (isJDK11OrHigher()) { // Relevant for Java flight recorder add(toBeInvestigated, + "java/util/Base64$Encoder.encodeBlock([BII[BIZ)V", "jdk/jfr/internal/JVM.getEventWriter()Ljava/lang/Object;"); } @@ -397,16 +401,19 @@ "sun/misc/Unsafe.getAndSetObject(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;"); if (isJDK9OrHigher()) { + if (!(arch instanceof AArch64)) { + add(toBeInvestigated, + "java/lang/StringLatin1.compareTo([B[B)I", + "java/lang/StringLatin1.compareToUTF16([B[B)I", + "java/lang/StringUTF16.compareTo([B[B)I", + "java/lang/StringUTF16.compareToLatin1([B[B)I", + "jdk/internal/misc/Unsafe.getAndAddInt(Ljava/lang/Object;JI)I", + "jdk/internal/misc/Unsafe.getAndAddLong(Ljava/lang/Object;JJ)J", + "jdk/internal/misc/Unsafe.getAndSetInt(Ljava/lang/Object;JI)I", + "jdk/internal/misc/Unsafe.getAndSetLong(Ljava/lang/Object;JJ)J", + "jdk/internal/misc/Unsafe.getAndSetObject(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;"); + } add(toBeInvestigated, - "java/lang/StringLatin1.compareTo([B[B)I", - "java/lang/StringLatin1.compareToUTF16([B[B)I", - "java/lang/StringUTF16.compareTo([B[B)I", - "java/lang/StringUTF16.compareToLatin1([B[B)I", - "jdk/internal/misc/Unsafe.getAndAddInt(Ljava/lang/Object;JI)I", - "jdk/internal/misc/Unsafe.getAndAddLong(Ljava/lang/Object;JJ)J", - "jdk/internal/misc/Unsafe.getAndSetInt(Ljava/lang/Object;JI)I", - "jdk/internal/misc/Unsafe.getAndSetLong(Ljava/lang/Object;JJ)J", - "jdk/internal/misc/Unsafe.getAndSetObject(Ljava/lang/Object;JLjava/lang/Object;)Ljava/lang/Object;", "jdk/internal/misc/Unsafe.getCharUnaligned(Ljava/lang/Object;J)C", "jdk/internal/misc/Unsafe.getIntUnaligned(Ljava/lang/Object;J)I", "jdk/internal/misc/Unsafe.getLongUnaligned(Ljava/lang/Object;J)J", diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ClassSubstitutionsTests.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompilationWrapperTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompilationWrapperTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompilationWrapperTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompilationWrapperTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.test.SubprocessUtil.getVMCommandLine; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorld.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorld.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorld.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorld.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static java.util.Collections.singletonList; @@ -94,7 +96,6 @@ import jdk.vm.ci.hotspot.HotSpotCompilationRequest; import jdk.vm.ci.hotspot.HotSpotInstalledCode; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.ConstantPool; @@ -139,7 +140,7 @@ return EconomicMap.create(); } - private final HotSpotJVMCIRuntimeProvider jvmciRuntime; + private final HotSpotJVMCIRuntime jvmciRuntime; private final HotSpotGraalCompiler compiler; @@ -197,7 +198,7 @@ * @param methodFilters * @param excludeMethodFilters */ - public CompileTheWorld(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalCompiler compiler, String files, int startAt, int stopAt, String methodFilters, String excludeMethodFilters, + public CompileTheWorld(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalCompiler compiler, String files, int startAt, int stopAt, String methodFilters, String excludeMethodFilters, boolean verbose, OptionValues initialOptions, EconomicMap<OptionKey<?>, Object> compilationOptions) { this.jvmciRuntime = jvmciRuntime; this.compiler = compiler; @@ -222,7 +223,7 @@ this.compilationOptions = compilationOptionsCopy; } - public CompileTheWorld(HotSpotJVMCIRuntimeProvider jvmciRuntime, HotSpotGraalCompiler compiler, OptionValues options) { + public CompileTheWorld(HotSpotJVMCIRuntime jvmciRuntime, HotSpotGraalCompiler compiler, OptionValues options) { this(jvmciRuntime, compiler, Options.Classpath.getValue(options), Options.StartAt.getValue(options), Options.StopAt.getValue(options), @@ -587,10 +588,11 @@ try { // Load and initialize class Class<?> javaClass = Class.forName(className, true, loader); + MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess(); // Pre-load all classes in the constant pool. try { - HotSpotResolvedObjectType objectType = HotSpotResolvedObjectType.fromObjectClass(javaClass); + HotSpotResolvedObjectType objectType = (HotSpotResolvedObjectType) metaAccess.lookupJavaType(javaClass); ConstantPool constantPool = objectType.getConstantPool(); for (int cpi = 1; cpi < constantPool.length(); cpi++) { constantPool.loadReferencedType(cpi, Bytecodes.LDC); @@ -604,7 +606,6 @@ } // Are we compiling this class? - MetaAccessProvider metaAccess = JVMCI.getRuntime().getHostJVMCIBackend().getMetaAccess(); if (classFileCounter >= startAt) { println("CompileTheWorld (%d) : %s", classFileCounter, className); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompileTheWorldTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.core.GraalCompilerOptions.CompilationBailoutAction; @@ -34,7 +36,6 @@ import org.junit.Test; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; /** * Tests {@link CompileTheWorld} functionality. @@ -46,7 +47,7 @@ ExceptionAction originalBailoutAction = CompilationBailoutAction.getValue(getInitialOptions()); ExceptionAction originalFailureAction = CompilationFailureAction.getValue(getInitialOptions()); // Compile a couple classes in rt.jar - HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime(); + HotSpotJVMCIRuntime runtime = HotSpotJVMCIRuntime.runtime(); System.setProperty("CompileTheWorld.LimitModules", "java.base"); OptionValues initialOptions = getInitialOptions(); EconomicMap<OptionKey<?>, Object> compilationOptions = CompileTheWorld.parseOptions("Inline=false"); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CompressedOopTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ConstantPoolSubstitutionsTests.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.test.JLModule.uncheckedAddExports; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32CSubstitutionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32CSubstitutionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32CSubstitutionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32CSubstitutionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.io.DataInputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/CRC32SubstitutionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.io.DataInputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/DataPatchTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.core.common.CompressEncoding; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/EliminateRedundantInitializationPhaseTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/EliminateRedundantInitializationPhaseTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/EliminateRedundantInitializationPhaseTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/EliminateRedundantInitializationPhaseTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ExplicitExceptionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ForeignCallDeoptimizeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRLockTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.lang.management.ManagementFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTestBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.util.Arrays; @@ -51,7 +53,6 @@ import jdk.vm.ci.hotspot.HotSpotCompilationRequest; import jdk.vm.ci.hotspot.HotSpotCompilationRequestResult; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaMethod; @@ -75,7 +76,7 @@ } protected static void compile(DebugContext debug, ResolvedJavaMethod method, int bci) { - HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime(); + HotSpotJVMCIRuntime runtime = HotSpotJVMCIRuntime.runtime(); long jvmciEnv = 0L; HotSpotCompilationRequest request = new HotSpotCompilationRequest((HotSpotResolvedJavaMethod) method, bci, jvmciEnv); HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) runtime.getCompiler(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/GraalOSRTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotCryptoSubstitutionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.io.ByteArrayOutputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalCompilerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.api.test.Graal; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalManagementTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalManagementTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalManagementTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotGraalManagementTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.hotspot.test.HotSpotGraalManagementTest.JunitShield.findAttributeInfo; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotInvokeDynamicPluginTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotInvokeDynamicPluginTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotInvokeDynamicPluginTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotInvokeDynamicPluginTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.util.function.IntPredicate; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotLazyInitializationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotLazyInitializationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotLazyInitializationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotLazyInitializationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMethodSubstitutionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.lang.invoke.ConstantCallSite; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotMonitorValueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.hamcrest.CoreMatchers.not; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNmethodTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotNodeSubstitutionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedJavaFieldTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static java.lang.reflect.Modifier.FINAL; @@ -34,15 +36,15 @@ import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import org.junit.Assert; -import org.junit.Test; import org.graalvm.compiler.core.common.util.Util; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.junit.Assert; +import org.junit.Test; import jdk.vm.ci.hotspot.HotSpotResolvedJavaField; -import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.ResolvedJavaField; +import jdk.vm.ci.meta.ResolvedJavaType; /** * Tests {@link HotSpotResolvedJavaField} functionality. @@ -91,7 +93,7 @@ @Test public void testModifiersForInternal() { for (Class<?> c : classesWithInternalFields) { - HotSpotResolvedObjectType type = HotSpotResolvedObjectType.fromObjectClass(c); + ResolvedJavaType type = getMetaAccess().lookupJavaType(c); for (ResolvedJavaField field : type.getInstanceFields(false)) { if (field.isInternal()) { Assert.assertEquals(0, ~jvmFieldModifiers() & field.getModifiers()); @@ -101,9 +103,9 @@ } /** - * Tests that {@code HotSpotResolvedObjectType#createField(String, JavaType, long, int)} always - * returns an {@linkplain ResolvedJavaField#equals(Object) equivalent} object for an internal - * field. + * Tests that {@code HotSpotResolvedObjectTypeImpl#createField(String, JavaType, long, int)} + * always returns an {@linkplain ResolvedJavaField#equals(Object) equivalent} object for an + * internal field. * * @throws InvocationTargetException * @throws IllegalArgumentException @@ -112,12 +114,12 @@ @Test public void testEquivalenceForInternalFields() throws IllegalAccessException, IllegalArgumentException, InvocationTargetException { for (Class<?> c : classesWithInternalFields) { - HotSpotResolvedObjectType type = HotSpotResolvedObjectType.fromObjectClass(c); + ResolvedJavaType type = getMetaAccess().lookupJavaType(c); for (ResolvedJavaField field : type.getInstanceFields(false)) { if (field.isInternal()) { HotSpotResolvedJavaField expected = (HotSpotResolvedJavaField) field; int index = indexField.getInt(expected); - ResolvedJavaField actual = (ResolvedJavaField) createFieldMethod.invoke(type, expected.getType(), expected.offset(), expected.getModifiers(), index); + ResolvedJavaField actual = (ResolvedJavaField) createFieldMethod.invoke(type, expected.getType(), expected.getOffset(), expected.getModifiers(), index); Assert.assertEquals(expected, actual); } } @@ -128,7 +130,7 @@ public void testIsInObject() { for (Field f : String.class.getDeclaredFields()) { HotSpotResolvedJavaField rf = (HotSpotResolvedJavaField) getMetaAccess().lookupJavaField(f); - Assert.assertEquals(rf.toString(), rf.isInObject("a string"), !rf.isStatic()); + Assert.assertEquals(rf.toString(), rf.isInObject(getConstantReflection().forString("a string")), !rf.isStatic()); } } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotResolvedObjectTypeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,13 +20,14 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package org.graalvm.compiler.hotspot.test; -import org.junit.Assert; -import org.junit.Test; + +package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.core.common.type.StampFactory; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; +import org.junit.Assert; +import org.junit.Test; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; @@ -42,13 +43,13 @@ @Test public void testGetSourceFileName() throws Throwable { - Assert.assertEquals("Object.java", HotSpotResolvedObjectType.fromObjectClass(Object.class).getSourceFileName()); - Assert.assertEquals("HotSpotResolvedObjectTypeTest.java", HotSpotResolvedObjectType.fromObjectClass(this.getClass()).getSourceFileName()); + Assert.assertEquals("Object.java", getMetaAccess().lookupJavaType(Object.class).getSourceFileName()); + Assert.assertEquals("HotSpotResolvedObjectTypeTest.java", getMetaAccess().lookupJavaType(this.getClass()).getSourceFileName()); } @Test public void testKlassLayoutHelper() { - Constant klass = HotSpotResolvedObjectType.fromObjectClass(this.getClass()).klass(); + Constant klass = ((HotSpotResolvedObjectType) getMetaAccess().lookupJavaType(this.getClass())).klass(); MemoryAccessProvider memoryAccess = getProviders().getConstantReflection().getMemoryAccessProvider(); GraalHotSpotVMConfig config = runtime().getVMConfig(); Constant c = StampFactory.forKind(JavaKind.Int).readConstant(memoryAccess, klass, config.klassLayoutHelperOffset); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotStackIntrospectionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotStackIntrospectionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotStackIntrospectionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotStackIntrospectionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.util.function.Function; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotStampMemoryAccessTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotStampMemoryAccessTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotStampMemoryAccessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotStampMemoryAccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.core.common.CompressEncoding; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotUnsafeSubstitutionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotUnsafeSubstitutionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotUnsafeSubstitutionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HotSpotUnsafeSubstitutionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.hotspot.meta.HotSpotUnsafeSubstitutions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HsErrLogTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HsErrLogTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HsErrLogTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/HsErrLogTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.test.SubprocessUtil.getVMCommandLine; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/InstalledCodeExecuteHelperTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static java.lang.reflect.Modifier.isStatic; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/JVMCIInfopointErrorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/LoadJavaMirrorWithKlassTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.util.Objects; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/MemoryUsageBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.debug.MemUseTrackerKey.getCurrentThreadAllocatedBytes; @@ -33,7 +35,6 @@ import jdk.vm.ci.hotspot.HotSpotCompilationRequest; import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod; import jdk.vm.ci.runtime.JVMCICompiler; @@ -133,7 +134,7 @@ long jvmciEnv = 0L; try (MemoryUsageCloseable c = label == null ? null : new MemoryUsageCloseable(label)) { - HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime(); + HotSpotJVMCIRuntime runtime = HotSpotJVMCIRuntime.runtime(); int entryBCI = JVMCICompiler.INVOCATION_ENTRY_BCI; HotSpotCompilationRequest request = new HotSpotCompilationRequest(method, entryBCI, jvmciEnv); CompilationTask task = new CompilationTask(runtime, (HotSpotGraalCompiler) runtime.getCompiler(), request, true, false, getInitialOptions()); @@ -151,7 +152,7 @@ long jvmciEnv = 0L; try (AllocSpy as = AllocSpy.open(methodName)) { - HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime(); + HotSpotJVMCIRuntime runtime = HotSpotJVMCIRuntime.runtime(); HotSpotCompilationRequest request = new HotSpotCompilationRequest(method, JVMCICompiler.INVOCATION_ENTRY_BCI, jvmciEnv); HotSpotGraalCompiler compiler = (HotSpotGraalCompiler) runtime.getCompiler(); OptionValues options = getInitialOptions(); @@ -181,7 +182,7 @@ compileAndTime("complex"); OptionValues options = CompileTheWorld.loadOptions(getInitialOptions()); if (CompileTheWorld.Options.Classpath.getValue(options) != CompileTheWorld.SUN_BOOT_CLASS_PATH) { - HotSpotJVMCIRuntimeProvider runtime = HotSpotJVMCIRuntime.runtime(); + HotSpotJVMCIRuntime runtime = HotSpotJVMCIRuntime.runtime(); CompileTheWorld ctw = new CompileTheWorld(runtime, (HotSpotGraalCompiler) runtime.getCompiler(), options); try { ctw.compile(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ObjectCloneTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ObjectCloneTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ObjectCloneTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ObjectCloneTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/OptionsInFileTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/OptionsInFileTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/OptionsInFileTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/OptionsInFileTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.debug.DebugOptions.Dump; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReplaceConstantNodesPhaseTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReplaceConstantNodesPhaseTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReplaceConstantNodesPhaseTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReplaceConstantNodesPhaseTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import org.graalvm.compiler.core.common.GraalOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReservedStackAccessTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReservedStackAccessTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReservedStackAccessTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/ReservedStackAccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,226 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +package org.graalvm.compiler.hotspot.test; + +import java.io.IOException; +import java.util.concurrent.locks.ReentrantLock; +import java.util.List; + +import org.graalvm.compiler.test.SubprocessUtil; +import org.graalvm.compiler.test.SubprocessUtil.Subprocess; + +import org.junit.Assume; +import org.junit.Before; +import org.junit.Test; + +public class ReservedStackAccessTest extends HotSpotGraalCompilerTest { + @Before + public void check() { + Assume.assumeTrue(runtime().getVMConfig().enableStackReservedZoneAddress != 0); + } + + public void stackAccessTest() { + Assume.assumeTrue(runtime().getVMConfig().enableStackReservedZoneAddress != 0); + + int passed = 0; + for (int i = 0; i < 1000; i++) { + // Each iteration has to be executed by a new thread. The test + // relies on the random size area pushed by the VM at the beginning + // of the stack of each Java thread it creates. + RunWithSOEContext r = new RunWithSOEContext(new ReentrantLockTest(), 256); + Thread thread = new Thread(r); + thread.start(); + try { + thread.join(); + assertTrue(r.result.equals("PASSED"), r.result); + ++passed; + } catch (InterruptedException ex) { + } + } + System.out.println("RESULT: " + (passed == 1000 ? "PASSED" : "FAILED")); + } + + public static void main(String[] args) { + new ReservedStackAccessTest().stackAccessTest(); + } + + @Test + public void run() throws IOException, InterruptedException { + Assume.assumeTrue(runtime().getVMConfig().enableStackReservedZoneAddress != 0); + List<String> vmArgs = SubprocessUtil.withoutDebuggerArguments(SubprocessUtil.getVMCommandLine()); + vmArgs.add("-XX:+UseJVMCICompiler"); + vmArgs.add("-Dgraal.Inline=false"); + vmArgs.add("-XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread"); + Subprocess proc = SubprocessUtil.java(vmArgs, ReservedStackAccessTest.class.getName()); + boolean passed = false; + for (String line : proc.output) { + if (line.equals("RESULT: PASSED")) { + passed = true; + } + } + if (!passed) { + for (String line : proc.output) { + System.err.println("" + line); + } + } + assertTrue(passed); + } + + static class ReentrantLockTest { + + private ReentrantLock[] lockArray; + // Frame sizes vary a lot between interpreted code and compiled code + // so the lock array has to be big enough to cover all cases. + // If test fails with message "Not conclusive test", try to increase + // LOCK_ARRAY_SIZE value + private static final int LOCK_ARRAY_SIZE = 8192; + private boolean stackOverflowErrorReceived; + StackOverflowError soe = null; + int index = -1; + + public void initialize() { + lockArray = new ReentrantLock[LOCK_ARRAY_SIZE]; + for (int i = 0; i < LOCK_ARRAY_SIZE; i++) { + lockArray[i] = new ReentrantLock(); + } + stackOverflowErrorReceived = false; + } + + public String getResult() { + if (!stackOverflowErrorReceived) { + return "ERROR: Not conclusive test: no StackOverflowError received"; + } + for (int i = 0; i < LOCK_ARRAY_SIZE; i++) { + if (lockArray[i].isLocked()) { + if (!lockArray[i].isHeldByCurrentThread()) { + StringBuilder s = new StringBuilder(); + s.append("FAILED: ReentrantLock "); + s.append(i); + s.append(" looks corrupted"); + return s.toString(); + } + } + } + return "PASSED"; + } + + public void run() { + try { + lockAndCall(0); + } catch (StackOverflowError e) { + soe = e; + stackOverflowErrorReceived = true; + } + } + + private void lockAndCall(int i) { + index = i; + if (i < LOCK_ARRAY_SIZE) { + lockArray[i].lock(); + lockAndCall(i + 1); + } + } + } + + static class RunWithSOEContext implements Runnable { + + int counter; + int deframe; + int decounter; + int setupSOEFrame; + int testStartFrame; + ReentrantLockTest test; + String result = "FAILED: no result"; + + RunWithSOEContext(ReentrantLockTest test, int deframe) { + this.test = test; + this.deframe = deframe; + } + + @Override + public void run() { + counter = 0; + decounter = deframe; + test.initialize(); + recursiveCall(); + System.out.println("Framework got StackOverflowError at frame = " + counter); + System.out.println("Test started execution at frame = " + (counter - deframe)); + result = test.getResult(); + } + + @SuppressWarnings("unused") + void recursiveCall() { + // Unused local variables to increase the frame size + long l1; + long l2; + long l3; + long l4; + long l5; + long l6; + long l7; + long l8; + long l9; + long l10; + long l11; + long l12; + long l13; + long l14; + long l15; + long l16; + long l17; + long l18; + long l19; + long l20; + long l21; + long l22; + long l23; + long l24; + long l25; + long l26; + long l27; + long l28; + long l30; + long l31; + long l32; + long l33; + long l34; + long l35; + long l36; + long l37; + counter++; + try { + recursiveCall(); + } catch (StackOverflowError e) { + } + decounter--; + if (decounter == 0) { + setupSOEFrame = counter; + testStartFrame = counter - deframe; + test.run(); + } + } + } + +} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestIntrinsicCompiles.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.core.common.CompilationIdentifier.INVALID_COMPILATION_ID; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/TestSHASubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.security.MessageDigest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierAdditionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import static org.graalvm.compiler.hotspot.replacements.HotSpotReplacementsUtil.config; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.test; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BciBlockMapping.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import static org.graalvm.compiler.bytecode.Bytecodes.AALOAD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParser.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import static java.lang.String.format; @@ -255,7 +257,8 @@ import static org.graalvm.compiler.java.BytecodeParserOptions.TraceParserPlugins; import static org.graalvm.compiler.java.BytecodeParserOptions.UseGuardedIntrinsics; import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.FAST_PATH_PROBABILITY; -import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.SLOW_PATH_PROBABILITY; +import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.LUDICROUSLY_FAST_PATH_PROBABILITY; +import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.LUDICROUSLY_SLOW_PATH_PROBABILITY; import static org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext.CompilationContext.INLINE_DURING_PARSING; import static org.graalvm.compiler.nodes.type.StampTool.isPointerNonNull; @@ -1379,7 +1382,7 @@ FixedNode trueSuccessor = passingOnTrue ? passingSuccessor : exception; FixedNode falseSuccessor = passingOnTrue ? exception : passingSuccessor; - append(new IfNode(condition, trueSuccessor, falseSuccessor, SLOW_PATH_PROBABILITY)); + append(new IfNode(condition, trueSuccessor, falseSuccessor, passingOnTrue ? LUDICROUSLY_FAST_PATH_PROBABILITY : LUDICROUSLY_SLOW_PATH_PROBABILITY)); lastInstr = passingSuccessor; exception.setStateAfter(createFrameState(bci(), exception)); @@ -1661,6 +1664,8 @@ if (initialInvokeKind == InvokeKind.Special && !targetMethod.isConstructor()) { emitCheckForInvokeSuperSpecial(args); + } else if (initialInvokeKind == InvokeKind.Interface && targetMethod.isPrivate()) { + emitCheckForDeclaringClassChange(targetMethod.getDeclaringClass(), args); } InlineInfo inlineInfo = null; @@ -1748,6 +1753,25 @@ } /** + * Checks that the class of the receiver of an {@link Bytecodes#INVOKEINTERFACE} invocation of a + * private method is assignable to the interface that declared the method. If not, then + * deoptimize so that the interpreter can throw an {@link IllegalAccessError}. + * + * This is a check not performed by the verifier and so must be performed at runtime. + * + * @param declaringClass interface declaring the callee + * @param args arguments to an {@link Bytecodes#INVOKEINTERFACE} call to a private method + * declared in a interface + */ + private void emitCheckForDeclaringClassChange(ResolvedJavaType declaringClass, ValueNode[] args) { + ValueNode receiver = args[0]; + TypeReference checkedType = TypeReference.createTrusted(graph.getAssumptions(), declaringClass); + LogicNode condition = genUnique(createInstanceOf(checkedType, receiver, null)); + FixedGuardNode fixedGuard = append(new FixedGuardNode(condition, ClassCastException, None, false)); + args[0] = append(PiNode.create(receiver, StampFactory.object(checkedType, true), fixedGuard)); + } + + /** * Checks that the class of the receiver of an {@link Bytecodes#INVOKESPECIAL} in a method * declared in an interface (i.e., a default method) is assignable to the interface. If not, * then deoptimize so that the interpreter can throw an {@link IllegalAccessError}. @@ -2677,7 +2701,9 @@ private <T extends ValueNode> void updateLastInstruction(T v) { if (v instanceof FixedNode) { FixedNode fixedNode = (FixedNode) v; - lastInstr.setNext(fixedNode); + if (lastInstr != null) { + lastInstr.setNext(fixedNode); + } if (fixedNode instanceof FixedWithNextNode) { FixedWithNextNode fixedWithNextNode = (FixedWithNextNode) fixedNode; assert fixedWithNextNode.next() == null : "cannot append instruction to instruction which isn't end"; @@ -3579,7 +3605,7 @@ @Override public void setStateAfter(StateSplit sideEffect) { - assert sideEffect.hasSideEffect(); + assert sideEffect.hasSideEffect() || sideEffect instanceof AbstractMergeNode; FrameState stateAfter = createFrameState(stream.nextBCI(), sideEffect); sideEffect.setStateAfter(stateAfter); } @@ -4581,9 +4607,9 @@ private double clampProbability(double probability) { if (!optimisticOpts.removeNeverExecutedCode(getOptions())) { if (probability == 0) { - return 0.0000001; + return LUDICROUSLY_SLOW_PATH_PROBABILITY; } else if (probability == 1) { - return 0.999999; + return LUDICROUSLY_FAST_PATH_PROBABILITY; } } return probability; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/BytecodeParserOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import org.graalvm.compiler.options.Option; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/ComputeLoopFrequenciesClosure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import static org.graalvm.compiler.nodes.cfg.ControlFlowGraph.multiplyProbabilities; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesCreator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesCreator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesCreator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/DefaultSuitesCreator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import org.graalvm.compiler.lir.phases.LIRSuites; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/FrameStateBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import static org.graalvm.compiler.bytecode.Bytecodes.DUP; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/GraphBuilderPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrNotSupportedBailout.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import org.graalvm.compiler.core.common.PermanentBailoutException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/JsrScope.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; public class JsrScope { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LargeLocalLiveness.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import java.util.BitSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/LocalLiveness.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import static org.graalvm.compiler.bytecode.Bytecodes.ALOAD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SmallLocalLiveness.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import org.graalvm.compiler.java.BciBlockMapping.BciBlock; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.java/src/org/graalvm/compiler/java/SuitesProviderBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.java; import org.graalvm.compiler.lir.phases.LIRSuites; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/ConstantPhiTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.backend; import static org.graalvm.compiler.api.directives.GraalDirectives.LIKELY_PROBABILITY; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/EmptyMethodTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.backend; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/backend/LargeConstantSectionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.backend; import static org.objectweb.asm.Opcodes.ACC_FINAL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload_1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aaload.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_0.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_1.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_aload_3.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_anewarray.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_areturn.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_arraylength.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_athrow.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_baload.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_bastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_caload.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_castore.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_checkcast03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2f.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2i02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_d2l03.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dadd.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_daload.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp05.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp06.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp07.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp08.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp09.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dcmp10.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ddiv.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dmul.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dneg.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_double_base.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_drem.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dreturn.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_dsub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2d.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2i02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_f2l02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fadd.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_faload.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp05.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp06.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp07.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp08.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp09.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fcmp10.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fdiv.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fload.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_float_base.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fmul.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fneg.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_frem.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_freturn.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_fsub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_b.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_c.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_d.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_f.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_i.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_l.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_o.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_s.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getfield_z.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_b.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_c.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_d.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_f.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_i.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_l.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_s.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_getstatic_z.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2b.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2c.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2d.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2f.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2l.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_i2s.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd3.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const0.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd_const3.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iadd.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iaload.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iand.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iconst.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv_overflow.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv_overflow.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv_overflow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_idiv_overflow.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq_3.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifeq.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge_3.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifge.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifgt.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmplt2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ificmpne2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifle.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iflt.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifne.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull_3.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnonnull.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull_3.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ifnull.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_1.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_3.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iinc_4.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_0.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1_1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_1.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iload_3.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_imul.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ineg.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_instanceof.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokeinterface.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokespecial.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokestatic.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_invokevirtual.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ior.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem3.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem4.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem4.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem4.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem4.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_irem.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ireturn.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ishr.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_isub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_iushr.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ixor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2d.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2f.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_l2i.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ladd.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_laload.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_land.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lcmp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_03.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_04.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_05.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldc_06.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv3.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv_overflow.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv_overflow.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv_overflow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_ldiv_overflow.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_0.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_1.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lload_3.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lmul.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lneg.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lookupswitch05.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lrem.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lreturn.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lshr.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lsub.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lushr.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_lxor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_monitorenter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_multianewarray04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_newarray.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_new.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putfield_04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_putstatic.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_saload.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_sastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch3.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch4.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_tableswitch.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/bytecode/BC_wide02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.bytecode; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload0.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aaload1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore0.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_aastore1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_anewarray.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_arraylength.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow0.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow2.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_athrow3.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_baload.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_bastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_caload.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_castore.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast3.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast4.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast5.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast6.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_checkcast.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_daload.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_dastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_faload.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_fastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield1.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_getfield.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iaload.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_iastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_idiv.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokespecial01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_invokevirtual02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_irem.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_laload.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_ldiv.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_lrem.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_monitorenter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_multianewarray.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_newarray.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_putfield.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_saload.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/BC_sastore.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Loop03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_1.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NASE_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_00.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_05.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_06.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_07.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_08.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_09.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_10.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_NPE_11.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_StackOverflowError_03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Two03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Catch_Unresolved.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Locals.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized04.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Except_Synchronized05.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Finally02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_AIOOBE_00.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_CCE_00.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_00.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/StackTrace_NPE_03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InCatch03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_InNested.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_NPE_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized04.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/Throw_Synchronized05.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.except; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/except/UntrustedInterfaces.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.except; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_allocate04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_array04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_control02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_convert01.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_count.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_dead01.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_demo01.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field01.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import jdk.vm.ci.meta.ResolvedJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field03.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import jdk.vm.ci.meta.ResolvedJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_field04.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_idea.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import java.util.Random; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline01.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_inline02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_invoke01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_life.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import java.util.Random; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest01.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_nest02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope01.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Ignore; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_scope02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_series.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotpath/HP_trees01.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.hotpath; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/NotOnDebug.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/NotOnDebug.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/NotOnDebug.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/NotOnDebug.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotspot; import org.junit.rules.DisableOnDebug; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6186134.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotspot; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6196102.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotspot; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6753639.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotspot; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6823354.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotspot; //@formatter:off diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6850611.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotspot; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test6959129.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotspot; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/hotspot/Test7005594.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.hotspot; //@formatter:off diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/CharacterBits.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Class_getName.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/DivideUnsigned.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import java.util.EnumMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/EnumMap02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import java.util.EnumMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/IntegerBits.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; @@ -159,4 +161,12 @@ runTest("test4", 0x00000001); } + public static int test5(int value) { + return Integer.reverseBytes((12345 | (value & 0xffff0000))) >>> 16; + } + + @Test + public void run22() { + runTest("test5", 1); + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/LongBits.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/ShortBits.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_currentTimeMillis02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_nanoTime02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/System_setOut.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import java.io.ByteArrayOutputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Thread_setName.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAccess01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/UnsafeAllocateInstance01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import java.util.AbstractList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/jdk/Unsafe_compareAndSwapNullCheck.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.jdk; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/JTTTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt; import java.util.Collections; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Boxed_TYPE_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Bridge_method01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_asSubclass01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_cast02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import java.net.URL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_forName05.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import java.net.URL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getComponentType01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getInterfaces01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import java.io.Serializable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getModifiers02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getName02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName01.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSimpleName02.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_getSuperClass01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isArray01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isAssignableFrom03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance04.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance05.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance06.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInstance07.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isInterface01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_isPrimitive01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Class_Literal01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ClassLoader_loadClass01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import java.net.URL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_conditional.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Double_toString.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Float_conditional.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greater03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_greaterEqual03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_less03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Int_lessEqual03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/JDK_ClassLoaders02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import java.net.URLClassLoader; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/LambdaEagerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import static org.graalvm.compiler.core.common.GraalOptions.InlineEverything; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greater03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_greaterEqual03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_less03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_lessEqual03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Long_reverseBytes02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_abs.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.graalvm.compiler.options.OptionValues; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_cos.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.graalvm.compiler.options.OptionValues; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exact.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_exp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.graalvm.compiler.options.OptionValues; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log10.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_log.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.graalvm.compiler.options.OptionValues; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_pow.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_round.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.graalvm.compiler.options.OptionValues; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_sqrt.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.graalvm.compiler.options.OptionValues; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Math_tan.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.graalvm.compiler.options.OptionValues; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_clone02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_equals01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_getClass01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_hashCode02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import java.time.DayOfWeek; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notify02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_notifyAll02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_toString02.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/Object_wait03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/ProcessEnvironment_init.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import java.util.Collections; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/StringCoding_Scale.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_intern03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/String_valueOf01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/System_identityHashCode01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/UnaryMath.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/UnaryMath.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/UnaryMath.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/lang/UnaryMath.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.lang; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/DegeneratedLoop.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop05.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop06.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop07.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop08.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09_2.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop09.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop11.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop12.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop13.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop14.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop15.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop16.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/Loop17.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopEscape.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ // Checkstyle: stop + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopInline.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopLastIndexOf.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopNewInstance.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import jdk.vm.ci.meta.ResolvedJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopParseLong.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhi.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopPhiResolutionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSpilling.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopSwitch01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/LoopUnroll.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/loop/SpillLoopPhiVariableAtDefinition.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.loop; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ArrayCompare02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BC_invokevirtual2.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigByteParams01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigDoubleParams02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigFloatParams02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigInterfaceParams01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigIntParams02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigLongParams02.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams01.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams02.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams03.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigMixedParams04.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,6 +23,8 @@ /* * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigObjectParams02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigParamsAlignment.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigShortParams01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/BigVirtualParams01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Bubblesort.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ConstantLoadTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Fibonacci.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/FloatingReads.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeInterface_04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/InvokeVirtual_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/Matrix01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/ReferenceMap01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/StrangeFrames.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/String_format02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_boolean01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_byte01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_char01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_double01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_float01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_int01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_long01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_short01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_String01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/micro/VarArgs_Unroll.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.micro; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ABCE_03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy05.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopy06.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayCopyGeneric.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ArrayLength01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_16.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_idiv_4.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_16.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_imul_4.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_16.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_ldiv_4.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_16.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lmul_4.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C16.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C24.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BC_lshr_C32.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BlockSkip01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/BoxingIdentity.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/CE_InstanceOf.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/CE_InstanceOf.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/CE_InstanceOf.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/CE_InstanceOf.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Cmov02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Conditional01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import java.util.Random; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import jdk.vm.ci.meta.ResolvedJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConditionalElimination02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ConvertCompare.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/DeadCode02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Cast01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Convert04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Double04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Float03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_InstanceOf01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Int02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Long02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Fold_Math01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/GuardMovement.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/GuardMovement.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/GuardMovement.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/GuardMovement.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InferStamp01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Inline02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InstanceOf.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InstanceOf.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InstanceOf.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/InstanceOf.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/List_reorder_bug.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LLE_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Logic0.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/LongToSomethingArray01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_byte03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_char03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Narrow_short03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NCE_FlowSensitive05.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import java.io.ByteArrayOutputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/NestedLoop_EA.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import java.util.ListIterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Phi03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/ReassociateConstants.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Convert01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Double01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Float01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Int04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_IntShift02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_Long04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Reduce_LongShift02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SchedulingBug_01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/SignExtendShort.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/Switch02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/TypeCastElem.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/UnsafeDeopt.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import java.nio.ByteBuffer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Cast02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Convert02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Double03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Field02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Float02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_InstanceOf03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Int03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Long03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/optimize/VN_Loop01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.optimize; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_get03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getBoolean01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getByte01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getChar01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getDouble01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getFloat01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getInt01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLength01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getLong01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_getShort01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance04.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance05.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_newInstance06.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_set03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setBoolean01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setByte01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setChar01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setDouble01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setFloat01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setInt01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setLong01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Array_setShort01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredField01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getDeclaredMethod01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getField02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_getMethod02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance06.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Class_newInstance07.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_get04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_getType01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Field_set03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_except01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.InvocationTargetException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.InvocationTargetException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.InvocationTargetException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_main03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.InvocationTargetException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Invoke_virtual01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import java.lang.reflect.InvocationTargetException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getParameterTypes01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/reflect/Method_getReturnType01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.reflect; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_contended01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitorenter02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Monitor_notowner01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait03.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.core.common.CancellationBailoutException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Object_wait04.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/SynchronizedLoopExit01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_currentThread01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_getState02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_holdsLock01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isAlive01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted02.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,8 @@ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted04.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_isInterrupted05.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join02.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,8 @@ * This test sleeps the thread that is joined to, which should ensure that the joining thread * actually does wait for completeion. */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_join03.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,8 @@ * This test sleeps the joining thread, which should enure that the joinee is * terminated by the time the join occurs. */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal01.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal02.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/ThreadLocal03.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_new02.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_setPriority01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_sleep01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.jtt/src/org/graalvm/compiler/jtt/threads/Thread_yield01.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ */ /* */ + + package org.graalvm.compiler.jtt.threads; import org.graalvm.compiler.jtt.JTTTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/AllocationStageVerifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc; import static org.graalvm.compiler.lir.LIRValueUtil.isVariable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Interval.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static org.graalvm.compiler.lir.LIRValueUtil.isStackSlotValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/IntervalWalker.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAllocationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAllocationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAllocationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAllocationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanAssignLocationsPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static jdk.vm.ci.code.ValueUtil.isIllegal; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanEliminateSpillMovePhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanIntervalDumper.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScan.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static jdk.vm.ci.code.CodeUtil.isEven; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanLifetimeAnalysisPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanOptimizeSpillPositionPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static org.graalvm.compiler.core.common.cfg.AbstractControlFlowGraph.commonDominator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanRegisterAllocationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import jdk.internal.vm.compiler.collections.Pair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanResolveDataFlowPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/LinearScanWalker.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static jdk.vm.ci.code.CodeUtil.isOdd; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/MoveResolver.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/OptimizingLinearScanWalker.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/Range.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/RegisterVerifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanEliminateSpillMovePhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra.ssa; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScan.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra.ssa; import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanLifetimeAnalysisPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra.ssa; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSALinearScanResolveDataFlowPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra.ssa; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/lsra/ssa/SSAMoveResolver.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.lsra.ssa; import static org.graalvm.compiler.lir.LIRValueUtil.asVirtualStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/OutOfRegistersException.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc; import org.graalvm.compiler.lir.BailoutAndRestartBackendException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/RegisterAllocationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/RegisterAllocationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/RegisterAllocationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/RegisterAllocationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc; import org.graalvm.compiler.lir.phases.AllocationPhase; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/SaveCalleeSaveRegisters.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/bu/BottomUpAllocator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.bu; import static jdk.vm.ci.code.ValueUtil.asAllocatableValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/DefaultTraceRegisterAllocationPolicy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/GlobalLivenessAnalysisPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/GlobalLivenessAnalysisPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/GlobalLivenessAnalysisPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/GlobalLivenessAnalysisPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import static org.graalvm.compiler.lir.LIRValueUtil.asVariable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/GlobalLivenessInfo.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/GlobalLivenessInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/GlobalLivenessInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/GlobalLivenessInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedInterval.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/FixedRange.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/IntervalHint.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import jdk.vm.ci.meta.AllocatableValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/RegisterVerifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceInterval.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAllocationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanAssignLocationsPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.ValueUtil.isIllegal; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanEliminateSpillMovePhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanLifetimeAnalysisPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.ValueUtil.asRegisterValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.CodeUtil.isEven; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanRegisterAllocationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanResolveDataFlowPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLinearScanWalker.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.CodeUtil.isOdd; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/lsra/TraceLocalMoveResolver.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace.lsra; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/ShadowedRegisterValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAllocationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAssertions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAssertions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAssertions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceAssertions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import org.graalvm.compiler.core.common.alloc.Trace; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceBuilderPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import static org.graalvm.compiler.lir.alloc.trace.TraceUtil.isTrivialTrace; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolutionPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import static jdk.vm.ci.code.ValueUtil.asRegisterValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceGlobalMoveResolver.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import static jdk.vm.ci.code.ValueUtil.asAllocatableValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceRegisterAllocationPolicy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TraceUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/alloc/trace/TrivialTraceAllocator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.alloc.trace; import static org.graalvm.compiler.lir.LIRValueUtil.asVariable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/ArrayDataPointerConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.asm; import java.nio.ByteBuffer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilderFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.asm; import org.graalvm.compiler.asm.Assembler; @@ -30,6 +32,7 @@ import org.graalvm.compiler.options.OptionValues; import jdk.vm.ci.code.CodeCacheProvider; +import jdk.vm.ci.code.Register; /** * Factory class for creating {@link CompilationResultBuilder}s. @@ -40,7 +43,7 @@ * Creates a new {@link CompilationResultBuilder}. */ CompilationResultBuilder createBuilder(CodeCacheProvider codeCache, ForeignCallsProvider foreignCalls, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, - OptionValues options, DebugContext debug, CompilationResult compilationResult); + OptionValues options, DebugContext debug, CompilationResult compilationResult, Register nullRegister); /** * The default factory creates a standard {@link CompilationResultBuilder}. @@ -49,8 +52,8 @@ @Override public CompilationResultBuilder createBuilder(CodeCacheProvider codeCache, ForeignCallsProvider foreignCalls, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, - FrameContext frameContext, OptionValues options, DebugContext debug, CompilationResult compilationResult) { - return new CompilationResultBuilder(codeCache, foreignCalls, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult); + FrameContext frameContext, OptionValues options, DebugContext debug, CompilationResult compilationResult, Register nullRegister) { + return new CompilationResultBuilder(codeCache, foreignCalls, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult, nullRegister); } }; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/CompilationResultBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.asm; import static jdk.vm.ci.code.ValueUtil.asStackSlot; @@ -60,6 +62,7 @@ import jdk.vm.ci.code.CodeCacheProvider; import jdk.vm.ci.code.DebugInfo; +import jdk.vm.ci.code.Register; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.code.site.ConstantReference; @@ -122,6 +125,7 @@ public final Assembler asm; public final DataBuilder dataBuilder; public final CompilationResult compilationResult; + public final Register nullRegister; public final TargetDescription target; public final CodeCacheProvider codeCache; public final ForeignCallsProvider foreignCalls; @@ -151,13 +155,17 @@ private Consumer<LIRInstruction> beforeOp; private Consumer<LIRInstruction> afterOp; + public final boolean mustReplaceWithNullRegister(JavaConstant nullConstant) { + return !nullRegister.equals(Register.None) && JavaConstant.NULL_POINTER.equals(nullConstant); + } + public CompilationResultBuilder(CodeCacheProvider codeCache, ForeignCallsProvider foreignCalls, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, - OptionValues options, DebugContext debug, CompilationResult compilationResult) { - this(codeCache, foreignCalls, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult, EconomicMap.create(Equivalence.DEFAULT)); + OptionValues options, DebugContext debug, CompilationResult compilationResult, Register nullRegister) { + this(codeCache, foreignCalls, frameMap, asm, dataBuilder, frameContext, options, debug, compilationResult, nullRegister, EconomicMap.create(Equivalence.DEFAULT)); } public CompilationResultBuilder(CodeCacheProvider codeCache, ForeignCallsProvider foreignCalls, FrameMap frameMap, Assembler asm, DataBuilder dataBuilder, FrameContext frameContext, - OptionValues options, DebugContext debug, CompilationResult compilationResult, EconomicMap<Constant, Data> dataCache) { + OptionValues options, DebugContext debug, CompilationResult compilationResult, Register nullRegister, EconomicMap<Constant, Data> dataCache) { this.target = codeCache.getTarget(); this.codeCache = codeCache; this.foreignCalls = foreignCalls; @@ -165,6 +173,7 @@ this.asm = asm; this.dataBuilder = dataBuilder; this.compilationResult = compilationResult; + this.nullRegister = nullRegister; this.frameContext = frameContext; this.options = options; this.debug = debug; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/DataBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.asm; import org.graalvm.compiler.code.DataSection.Data; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/asm/FrameContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.asm; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/BailoutAndRestartBackendException.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import org.graalvm.compiler.core.common.PermanentBailoutException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValueClass.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/CompositeValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ConstantValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import jdk.vm.ci.meta.Constant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantLoadOptimization.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.constopt; import static org.graalvm.compiler.lir.LIRValueUtil.isVariable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTreeAnalyzer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.constopt; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/ConstantTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.constopt; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/DefUseTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.constopt; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/UseEntry.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.constopt; import org.graalvm.compiler.core.common.cfg.AbstractBlockBase; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/constopt/VariableMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.constopt; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ControlFlowOptimizer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import static org.graalvm.compiler.lir.LIR.verifyBlocks; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/IntervalDumper.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.debug; import jdk.vm.ci.meta.Value; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/debug/LIRGenerationDebugContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.debug; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarker.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.dfa; import static jdk.vm.ci.code.ValueUtil.isIllegal; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/LocationMarkerPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.dfa; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/MarkBasePointersPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.dfa; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/RegStackValueSet.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.dfa; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/dfa/UniqueWorkList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.dfa; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/EdgeMoveOptimizer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.framemap; import static org.graalvm.compiler.lir.LIRValueUtil.isVirtualStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.framemap; import java.util.BitSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMapBuilderTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.framemap; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/FrameMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.framemap; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/ReferenceMapBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.framemap; import org.graalvm.compiler.lir.LIRFrameState; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/SimpleVirtualStackSlot.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.framemap; import org.graalvm.compiler.lir.VirtualStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/framemap/VirtualStackSlotRange.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.framemap; import java.util.BitSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/FullInfopointOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import org.graalvm.compiler.lir.asm.CompilationResultBuilder; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.gen; import org.graalvm.compiler.core.common.LIRKind; @@ -41,6 +43,10 @@ return lirGen; } + protected final AllocatableValue asAllocatable(Value value) { + return lirGen.asAllocatable(value); + } + public OptionValues getOptions() { return getLIRGen().getResult().getLIR().getOptions(); } @@ -82,7 +88,7 @@ if (bKind.isDerivedReference()) { resultKind = bKind; } else { - AllocatableValue allocatable = getLIRGen().asAllocatable(b); + AllocatableValue allocatable = asAllocatable(b); resultKind = bKind.makeDerivedReference(allocatable); b = allocatable; } @@ -90,7 +96,7 @@ if (aKind.isDerivedReference()) { resultKind = aKind; } else { - AllocatableValue allocatable = getLIRGen().asAllocatable(a); + AllocatableValue allocatable = asAllocatable(a); resultKind = aKind.makeDerivedReference(allocatable); a = allocatable; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/ArithmeticLIRGeneratorTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.gen; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/BlockValueMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.gen; import org.graalvm.compiler.core.common.cfg.AbstractBlockBase; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/DiagnosticLIRGeneratorTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.gen; import org.graalvm.compiler.lir.LIRInstruction; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerationResult.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.gen; import jdk.internal.vm.compiler.collections.EconomicMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.gen; import static jdk.vm.ci.code.ValueUtil.asAllocatableValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/LIRGeneratorTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.gen; import jdk.vm.ci.code.RegisterConfig; @@ -278,4 +280,11 @@ Value emitUncompress(Value pointer, CompressEncoding encoding, boolean nonNull); + default void emitConvertNullToZero(AllocatableValue result, Value input) { + emitMove(result, input); + } + + default void emitConvertZeroToNull(AllocatableValue result, Value input) { + emitMove(result, input); + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/PhiResolver.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.gen; import static jdk.vm.ci.code.ValueUtil.isIllegal; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/gen/VerifyingMoveFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.gen; import static org.graalvm.compiler.lir.LIRValueUtil.isJavaConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionStateProcedure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; @FunctionalInterface diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueConsumer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/InstructionValueProcedure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LabelRef.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import org.graalvm.compiler.asm.Label; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRFrameState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import static org.graalvm.compiler.lir.LIRValueUtil.isVirtualStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInsertionBuffer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstructionClass.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRInstruction.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import static jdk.vm.ci.code.ValueUtil.isStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRIntrospection.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.CONST; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIR.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRValueUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/LIRVerifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import static org.graalvm.compiler.lir.LIRValueUtil.asVariable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/NullCheckOptimizer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Opcode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/AllocationStage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import static org.graalvm.compiler.core.common.GraalOptions.TraceRA; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyAllocationStage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import static org.graalvm.compiler.core.common.GraalOptions.TraceRA; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPostAllocationOptimizationStage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import org.graalvm.compiler.lir.phases.PostAllocationOptimizationPhase.PostAllocationOptimizationContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/EconomyPreAllocationOptimizationStage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import org.graalvm.compiler.lir.phases.PreAllocationOptimizationPhase.PreAllocationOptimizationContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/GenericContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import java.util.regex.Pattern; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRPhaseSuite.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/LIRSuites.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import org.graalvm.compiler.lir.LIR; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import org.graalvm.compiler.lir.gen.DiagnosticLIRGeneratorTool; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PostAllocationOptimizationStage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import static org.graalvm.compiler.lir.phases.LIRPhase.Options.LIROptimization; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import org.graalvm.compiler.lir.gen.LIRGeneratorTool; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/phases/PreAllocationOptimizationStage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.phases; import org.graalvm.compiler.lir.alloc.SaveCalleeSaveRegisters; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MethodProfilingPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.profiling; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfiler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.profiling; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveProfilingPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.profiling; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/profiling/MoveType.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.profiling; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/RedundantMoveElimination.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.ssa; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ssa/SSAVerifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.lir.ssa; import static jdk.vm.ci.code.ValueUtil.isRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/FixPointIntervalBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.stackslotalloc; import static org.graalvm.compiler.lir.LIRValueUtil.asVirtualStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/LSStackSlotAllocator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.stackslotalloc; import static org.graalvm.compiler.debug.DebugContext.BASIC_LEVEL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/SimpleStackSlotAllocator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.stackslotalloc; import static org.graalvm.compiler.lir.LIRValueUtil.asVirtualStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackIntervalDumper.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.stackslotalloc; import org.graalvm.compiler.lir.VirtualStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackInterval.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.stackslotalloc; import org.graalvm.compiler.lir.VirtualStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/stackslotalloc/StackSlotAllocatorUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.stackslotalloc; import org.graalvm.compiler.debug.CounterKey; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StandardOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.CONST; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/StateProcedure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; @FunctionalInterface diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/SwitchStrategy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/GenericValueMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.util; import jdk.internal.vm.compiler.collections.EconomicMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/IndexedValueMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.util; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/RegisterMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.util; import java.util.function.BiConsumer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.util; import jdk.vm.ci.meta.Value; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/ValueSet.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.util; import jdk.vm.ci.meta.Value; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/util/VariableVirtualStackValueMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.util; import static org.graalvm.compiler.lir.LIRValueUtil.asVariable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueConsumer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/ValueProcedure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/Variable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import jdk.vm.ci.code.RegisterValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir/src/org/graalvm/compiler/lir/VirtualStackSlot.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir; import jdk.vm.ci.code.StackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AddressValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticLIRGeneratorTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import org.graalvm.compiler.lir.Variable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArithmeticOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArrayCompareToOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArrayCompareToOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArrayCompareToOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArrayCompareToOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static jdk.vm.ci.aarch64.AArch64.zr; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArrayEqualsOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArrayEqualsOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArrayEqualsOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ArrayEqualsOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static jdk.vm.ci.aarch64.AArch64.zr; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64AtomicMove.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static jdk.vm.ci.code.ValueUtil.asRegister; @@ -81,7 +83,7 @@ if (AArch64LIRFlagsVersioned.useLSE(masm.target.arch)) { Register expected = asRegister(expectedValue); masm.mov(size, result, expected); - masm.cas(size, expected, newVal, address, true /* acquire */, true /* release */); + masm.cas(size, result, newVal, address, true /* acquire */, true /* release */); AArch64Compare.gpCompare(masm, resultValue, expectedValue); } else { // We could avoid using a scratch register here, by reusing resultValue for the diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BitManipulationOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BlockEndOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.lir.aarch64; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64BreakpointOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ByteSwapOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ByteSwapOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ByteSwapOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ByteSwapOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Call.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64CCall.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64CCall.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64CCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64CCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Compare.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.CONST; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ControlFlow.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static jdk.vm.ci.code.ValueUtil.asAllocatableValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMapBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import org.graalvm.compiler.lir.framemap.FrameMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64FrameMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRFlagsVersioned.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRFlagsVersioned.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRFlagsVersioned.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRFlagsVersioned.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import jdk.vm.ci.aarch64.AArch64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64LIRInstruction.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Move.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.COMPOSITE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PauseOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import org.graalvm.compiler.asm.aarch64.AArch64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64PrefetchOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.COMPOSITE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64ReinterpretOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64RestoreRegistersOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64RestoreRegistersOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64RestoreRegistersOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64RestoreRegistersOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SaveRegistersOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SaveRegistersOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SaveRegistersOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SaveRegistersOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static jdk.vm.ci.code.ValueUtil.asStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64SignExtendOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Unary.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Unary.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Unary.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.aarch64/src/org/graalvm/compiler/lir/aarch64/AArch64Unary.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.aarch64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64AddressValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Arithmetic.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArithmeticLIRGeneratorTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import org.graalvm.compiler.lir.Variable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayCompareToOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayCompareToOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayCompareToOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayCompareToOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static jdk.vm.ci.amd64.AMD64.k7; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ArrayEqualsOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BinaryConsumer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.DWORD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Binary.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.COMPOSITE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BlockEndOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64BreakpointOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ByteSwapOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Call.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -20,14 +20,17 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; +import static jdk.vm.ci.code.ValueUtil.asRegister; +import static jdk.vm.ci.code.ValueUtil.isRegister; +import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK; import static org.graalvm.compiler.lir.LIRValueUtil.differentRegisters; -import static jdk.vm.ci.code.ValueUtil.asRegister; -import static jdk.vm.ci.code.ValueUtil.isRegister; import org.graalvm.compiler.asm.amd64.AMD64Assembler.ConditionFlag; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; @@ -193,7 +196,7 @@ } int before = masm.position(); int callPCOffset; - if (scratch != null) { + if (scratch != null && !GeneratePIC.getValue(crb.getOptions())) { // offset might not fit a 32-bit immediate, generate an // indirect call with a 64-bit immediate masm.movq(scratch, 0L); @@ -220,12 +223,27 @@ } } - public static void directJmp(CompilationResultBuilder crb, AMD64MacroAssembler masm, InvokeTarget target) { + public static int directJmp(CompilationResultBuilder crb, AMD64MacroAssembler masm, InvokeTarget target) { + return directJmp(crb, masm, target, null); + } + + public static int directJmp(CompilationResultBuilder crb, AMD64MacroAssembler masm, InvokeTarget target, Register scratch) { int before = masm.position(); - masm.jmp(0, true); + int callPCOffset; + if (scratch != null && !GeneratePIC.getValue(crb.getOptions())) { + // offset might not fit a 32-bit immediate, generate an + // indirect call with a 64-bit immediate + masm.movq(scratch, 0L); + callPCOffset = masm.position(); + masm.jmp(scratch); + } else { + callPCOffset = masm.position(); + masm.jmp(0, true); + } int after = masm.position(); crb.recordDirectCall(before, after, target, null); masm.ensureUniquePC(); + return callPCOffset; } public static void directConditionalJmp(CompilationResultBuilder crb, AMD64MacroAssembler masm, InvokeTarget target, ConditionFlag cond) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64CCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ClearRegisterOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64BinaryArithmetic.XOR; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ControlFlow.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMapBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import org.graalvm.compiler.lir.framemap.FrameMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64FrameMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static jdk.vm.ci.code.ValueUtil.asStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LFenceOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LFenceOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LFenceOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LFenceOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64LIRInstruction.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicBinaryOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MathIntrinsicUnaryOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Move.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static java.lang.Double.doubleToRawLongBits; @@ -28,6 +30,7 @@ import static jdk.vm.ci.code.ValueUtil.isRegister; import static jdk.vm.ci.code.ValueUtil.isStackSlot; import static org.graalvm.compiler.asm.amd64.AMD64Assembler.ConditionFlag.Equal; +import static org.graalvm.compiler.asm.amd64.AMD64Assembler.ConditionFlag.NotEqual; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.COMPOSITE; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.CONST; @@ -64,6 +67,7 @@ import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.amd64.AMD64Kind; import jdk.vm.ci.code.Register; +import jdk.vm.ci.code.RegisterValue; import jdk.vm.ci.code.StackSlot; import jdk.vm.ci.meta.AllocatableValue; import jdk.vm.ci.meta.Constant; @@ -690,7 +694,11 @@ // a CMP and a Jcc in which case the XOR will modify the condition // flags and interfere with the Jcc. if (input.isNull()) { - masm.movq(result, 0x0L); + if (crb.mustReplaceWithNullRegister(input)) { + masm.movq(result, crb.nullRegister); + } else { + masm.movq(result, 0x0L); + } } else if (crb.target.inlineObjects) { crb.recordInlineDataInCode(input); masm.movq(result, 0xDEADDEADDEADDEADL); @@ -743,6 +751,10 @@ break; case Object: if (input.isNull()) { + if (crb.mustReplaceWithNullRegister(input)) { + masm.movq(dest, crb.nullRegister); + return; + } imm = 0; } else { throw GraalError.shouldNotReachHere("Non-null object constants must be in register"); @@ -808,8 +820,12 @@ return result; } - protected final Register getBaseRegister() { - return asRegister(baseRegister); + protected final Register getResultRegister() { + return asRegister(result); + } + + protected final Register getBaseRegister(CompilationResultBuilder crb) { + return hasBase(crb.getOptions(), encoding) ? asRegister(baseRegister) : Register.None; } protected final int getShift() { @@ -828,7 +844,7 @@ this(TYPE, result, input, baseRegister, encoding, nonNull, lirKindTool); } - protected CompressPointerOp(LIRInstructionClass<? extends PointerCompressionOp> type, AllocatableValue result, Value input, + private CompressPointerOp(LIRInstructionClass<? extends PointerCompressionOp> type, AllocatableValue result, Value input, AllocatableValue baseRegister, CompressEncoding encoding, boolean nonNull, LIRKindTool lirKindTool) { super(type, result, input, baseRegister, encoding, nonNull, lirKindTool); @@ -838,9 +854,9 @@ public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { move(lirKindTool.getObjectKind(), crb, masm); - Register resReg = asRegister(getResult()); - if (hasBase(crb.getOptions(), encoding)) { - Register baseReg = getBaseRegister(); + final Register resReg = getResultRegister(); + final Register baseReg = getBaseRegister(crb); + if (!baseReg.equals(Register.None)) { if (!nonNull) { masm.testq(resReg, resReg); masm.cmovq(Equal, resReg, baseReg); @@ -862,39 +878,114 @@ this(TYPE, result, input, baseRegister, encoding, nonNull, lirKindTool); } - protected UncompressPointerOp(LIRInstructionClass<? extends PointerCompressionOp> type, AllocatableValue result, Value input, + private UncompressPointerOp(LIRInstructionClass<? extends PointerCompressionOp> type, AllocatableValue result, Value input, AllocatableValue baseRegister, CompressEncoding encoding, boolean nonNull, LIRKindTool lirKindTool) { - super(type, result, input, baseRegister, encoding, nonNull, lirKindTool); } @Override public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { + Register baseReg = getBaseRegister(crb); + if (nonNull && !baseReg.equals(Register.None) && getInput() instanceof RegisterValue) { + Register inputReg = ((RegisterValue) getInput()).getRegister(); + if (!inputReg.equals(getResultRegister())) { + masm.leaq(getResultRegister(), new AMD64Address(baseReg, inputReg, AMD64Address.Scale.fromShift(getShift()))); + return; + } + } move(lirKindTool.getNarrowOopKind(), crb, masm); - emitUncompressCode(masm, asRegister(getResult()), getShift(), hasBase(crb.getOptions(), encoding) ? getBaseRegister() : null, nonNull); + emitUncompressCode(masm, getResultRegister(), getShift(), baseReg, nonNull); } public static void emitUncompressCode(AMD64MacroAssembler masm, Register resReg, int shift, Register baseReg, boolean nonNull) { - if (shift != 0) { - masm.shlq(resReg, shift); - } + if (nonNull) { + if (!baseReg.equals(Register.None)) { + if (shift != 0) { + masm.leaq(resReg, new AMD64Address(baseReg, resReg, AMD64Address.Scale.fromShift(shift))); + } else { + masm.addq(resReg, baseReg); + } + } else if (shift != 0) { + masm.shlq(resReg, shift); + } + } else { + if (shift != 0) { + masm.shlq(resReg, shift); + } + + if (!baseReg.equals(Register.None)) { + if (shift == 0) { + // if encoding.shift != 0, the flags are already set by the shlq + masm.testq(resReg, resReg); + } - if (baseReg != null) { - if (nonNull) { + Label done = new Label(); + masm.jccb(Equal, done); masm.addq(resReg, baseReg); - return; + masm.bind(done); } + } + } + } - if (shift == 0) { - // if encoding.shift != 0, the flags are already set by the shlq - masm.testq(resReg, resReg); - } + private abstract static class ZeroNullConversionOp extends AMD64LIRInstruction { + @Def({REG, HINT}) protected AllocatableValue result; + @Use({REG}) protected AllocatableValue input; + + protected ZeroNullConversionOp(LIRInstructionClass<? extends ZeroNullConversionOp> type, AllocatableValue result, AllocatableValue input) { + super(type); + this.result = result; + this.input = input; + } + + @Override + public void emitCode(CompilationResultBuilder crb, AMD64MacroAssembler masm) { + Register nullRegister = crb.nullRegister; + if (!nullRegister.equals(Register.None)) { + emitConversion(asRegister(result), asRegister(input), nullRegister, masm); + } + } + + protected abstract void emitConversion(Register resultRegister, Register inputRegister, Register nullRegister, AMD64MacroAssembler masm); + } + + public static class ConvertNullToZeroOp extends ZeroNullConversionOp { + public static final LIRInstructionClass<ConvertNullToZeroOp> TYPE = LIRInstructionClass.create(ConvertNullToZeroOp.class); + public ConvertNullToZeroOp(AllocatableValue result, AllocatableValue input) { + super(TYPE, result, input); + } + + @Override + protected final void emitConversion(Register resultRegister, Register inputRegister, Register nullRegister, AMD64MacroAssembler masm) { + if (inputRegister.equals(resultRegister)) { + masm.subq(inputRegister, nullRegister); Label done = new Label(); masm.jccb(Equal, done); - masm.addq(resReg, baseReg); + masm.addq(inputRegister, nullRegister); masm.bind(done); + } else { + masm.subq(resultRegister, resultRegister); + masm.cmpq(inputRegister, nullRegister); + masm.cmovq(NotEqual, resultRegister, inputRegister); + } + } + } + + public static class ConvertZeroToNullOp extends ZeroNullConversionOp { + public static final LIRInstructionClass<ConvertZeroToNullOp> TYPE = LIRInstructionClass.create(ConvertZeroToNullOp.class); + + public ConvertZeroToNullOp(AllocatableValue result, AllocatableValue input) { + super(TYPE, result, input); + } + + @Override + protected final void emitConversion(Register resultRegister, Register inputRegister, Register nullRegister, AMD64MacroAssembler masm) { + if (!inputRegister.equals(resultRegister)) { + masm.movq(resultRegister, inputRegister); } + masm.testq(inputRegister, inputRegister); + masm.cmovq(Equal, resultRegister, nullRegister); } } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64MulDivOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.asm.amd64.AMD64Assembler.AMD64MOp.DIV; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PauseOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64PrefetchOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.COMPOSITE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ReadTimestampCounter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64RestoreRegistersOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.STACK; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SaveRegistersOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static jdk.vm.ci.code.ValueUtil.asStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ShiftOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.HINT; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64SignExtendOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.asm.amd64.AMD64Assembler.OperandSize.DWORD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringIndexOfOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringIndexOfOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringIndexOfOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64StringIndexOfOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static jdk.vm.ci.amd64.AMD64.rax; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64Unary.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.COMPOSITE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64VZeroUpper.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapRegistersOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import static org.graalvm.compiler.lir.amd64.AMD64SaveRegistersOp.prune; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/AMD64ZapStackOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/phases/StackMoveOptimizationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64.phases; import static org.graalvm.compiler.lir.phases.LIRPhase.Options.LIROptimization; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorBinary.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorBinary.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorBinary.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorBinary.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64.vector; import jdk.vm.ci.meta.AllocatableValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorClearOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorClearOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorClearOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorClearOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64.vector; import static org.graalvm.compiler.asm.amd64.AMD64VectorAssembler.VexRVMOp.VPXOR; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorCompareOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorCompareOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorCompareOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorCompareOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64.vector; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorLIRInstruction.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorLIRInstruction.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorLIRInstruction.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorLIRInstruction.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64.vector; import org.graalvm.compiler.asm.amd64.AMD64MacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorMove.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorMove.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorMove.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorMove.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64.vector; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorShuffle.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorShuffle.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorShuffle.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorShuffle.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64.vector; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorUnary.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorUnary.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorUnary.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.amd64/src/org/graalvm/compiler/lir/amd64/vector/AMD64VectorUnary.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.amd64.vector; import jdk.vm.ci.meta.AllocatableValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/ConstantStackCastTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.jtt; import static org.graalvm.compiler.lir.LIRValueUtil.asJavaConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.jtt; import static org.graalvm.compiler.lir.LIRValueUtil.isVariable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestSpecification.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.jtt; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/LIRTestTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.jtt; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/SPARCBranchBailoutTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.jtt; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackMoveTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.jtt; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackStoreLoadTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackStoreLoadTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackStoreLoadTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.jtt/src/org/graalvm/compiler/lir/jtt/StackStoreLoadTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.jtt; import org.junit.Before; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCAddressValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import org.graalvm.compiler.asm.sparc.SPARCAddress; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArithmetic.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.BPCC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCArrayEqualsOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBitManipulationOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBlockEndOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCBreakpointOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCByteSwapOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.ILLEGAL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCControlFlow.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCDelayedControlTransfer.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFloatCompareOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMapBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import org.graalvm.compiler.lir.framemap.FrameMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCFrameMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCImmediateAddressValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCIndexedAddressValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCJumpOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.BPCC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstruction.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import org.graalvm.compiler.core.common.NumUtil; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLIRInstructionMixin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; public interface SPARCLIRInstructionMixin { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCLoadConstantTableBaseOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.REG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCMove.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.MEMBAR_STORE_LOAD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOP3Op.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.asm.sparc.SPARCAssembler.isSimm13; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCOPFOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static jdk.vm.ci.code.ValueUtil.asRegister; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPauseOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCPrefetchOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.lir.sparc; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.COMPOSITE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCSaveRegistersOp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import static jdk.vm.ci.code.ValueUtil.asStackSlot; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.sparc/src/org/graalvm/compiler/lir/sparc/SPARCTailDelayedLIRInstruction.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.sparc; import org.graalvm.compiler.asm.sparc.SPARCMacroAssembler; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/alloc/trace/TraceGlobalMoveResolutionMappingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.test.alloc.trace; import static org.junit.Assert.assertEquals; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/CompositeValueReplacementTest1.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.test; import static org.graalvm.compiler.lir.LIRInstruction.OperandFlag.COMPOSITE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.lir.test/src/org/graalvm/compiler/lir/test/GenericValueMapTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.lir.test; import static org.junit.Assert.assertEquals; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/BasicInductionVariable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import static org.graalvm.compiler.loop.MathUtil.add; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/CountedLoopInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import static org.graalvm.compiler.loop.MathUtil.add; @@ -47,7 +49,7 @@ import jdk.vm.ci.code.CodeUtil; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.SpeculationLog; public class CountedLoopInfo { @@ -251,7 +253,7 @@ } assert graph.getGuardsStage().allowsFloatingGuards(); overflowGuard = graph.unique(new GuardNode(cond, AbstractBeginNode.prevBegin(loop.entryPoint()), DeoptimizationReason.LoopLimitCheck, DeoptimizationAction.InvalidateRecompile, true, - JavaConstant.NULL_POINTER, null)); // TODO gd: use speculation + SpeculationLog.NO_SPECULATION, null)); // TODO gd: use speculation loop.loopBegin().setOverflowGuard(overflowGuard); return overflowGuard; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DefaultLoopPolicies.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import static org.graalvm.compiler.core.common.GraalOptions.LoopMaxUnswitch; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedConvertedInductionVariable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedInductionVariable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedOffsetInductionVariable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import static org.graalvm.compiler.loop.MathUtil.add; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/DerivedScaledInductionVariable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import static org.graalvm.compiler.loop.MathUtil.mul; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/InductionVariable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopEx.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import java.util.Collection; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideBefore.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import org.graalvm.compiler.graph.NodeBitMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInsideFrom.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import org.graalvm.compiler.graph.NodeBitMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentInside.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragment.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopFragmentWhole.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import jdk.internal.vm.compiler.collections.EconomicSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopPolicies.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/LoopsData.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop/src/org/graalvm/compiler/loop/MathUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop; import org.graalvm.compiler.core.common.type.IntegerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ContextlessLoopPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.phases; import org.graalvm.compiler.loop.LoopPolicies; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopFullUnrollPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.phases; import org.graalvm.compiler.debug.CounterKey; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPartialUnrollPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPartialUnrollPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPartialUnrollPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPartialUnrollPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.phases; import org.graalvm.compiler.graph.Graph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPeelingPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.phases; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.phases; import org.graalvm.compiler.loop.LoopPolicies; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopSafepointEliminationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.phases; import org.graalvm.compiler.loop.LoopEx; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopTransformations.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.phases; import static org.graalvm.compiler.core.common.GraalOptions.MaximumDesiredSize; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/LoopUnswitchingPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.phases; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.phases/src/org/graalvm/compiler/loop/phases/ReassociateInvariantPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.phases; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopPartialUnrollTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopPartialUnrollTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopPartialUnrollTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopPartialUnrollTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.test; import java.util.ListIterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopsDataTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopsDataTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopsDataTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.loop.test/src/org/graalvm/compiler/loop/test/LoopsDataTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.loop.test; import static org.graalvm.compiler.core.common.util.ReversedList.reversed; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/ConditionalEliminationBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal; import org.graalvm.compiler.microbenchmarks.graal.util.GraalState; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/FrameStateAssigmentPhaseBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal; import java.util.StringTokenizer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraalBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal; import static org.graalvm.compiler.microbenchmarks.graal.GraalBenchmark.Defaults.FORKS; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/GraphCopyBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal; import org.openjdk.jmh.annotations.Benchmark; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/NodeBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/SchedulePhaseBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMHWhitebox.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMHWhitebox.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMHWhitebox.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/TestJMHWhitebox.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal; import org.graalvm.compiler.microbenchmarks.graal.util.GraalState; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/FrameStateAssignmentState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal.util; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal.util; import org.graalvm.compiler.api.test.Graal; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraalUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal.util; import java.lang.reflect.Method; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/GraphState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal.util; import static org.graalvm.compiler.microbenchmarks.graal.util.GraalUtil.getGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/MethodSpec.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal.util; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/NodesState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal.util; import static org.graalvm.compiler.microbenchmarks.graal.util.GraalUtil.getGraphFromMethodSpec; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/graal/util/ScheduleState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.graal.util; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/CompileTimeBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.lir; import org.openjdk.jmh.annotations.Benchmark; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/GraalCompilerState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.lir; import static org.graalvm.compiler.microbenchmarks.graal.util.GraalUtil.getGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/RegisterAllocationTimeBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.lir; import org.graalvm.compiler.lir.gen.LIRGenerationResult; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/ControlFlowGraphState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.lir.trace; import org.openjdk.jmh.annotations.Level; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceBuilderBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.lir.trace; import org.openjdk.jmh.annotations.Benchmark; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.microbenchmarks/src/org/graalvm/compiler/microbenchmarks/lir/trace/TraceLSRAIntervalBuildingBench.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.microbenchmarks.lir.trace; import org.graalvm.compiler.core.common.alloc.RegisterAllocationConfig; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/InputType.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodeinfo; public enum InputType { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeCycles.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodeinfo; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodeinfo; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/NodeSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodeinfo; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/StructuralInput.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodeinfo; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo/src/org/graalvm/compiler/nodeinfo/Verbosity.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodeinfo; public enum Verbosity { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/ElementException.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodeinfo.processor; import javax.lang.model.element.Element; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeProcessor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodeinfo.processor; import static java.util.Collections.reverse; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodeinfo.processor/src/org/graalvm/compiler/nodeinfo/processor/GraphNodeVerifier.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodeinfo.processor; import static javax.lang.model.element.Modifier.FINAL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractBeginNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractDeoptimizeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.State; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractEndNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractFixedGuardNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.StampFactory; @@ -36,7 +38,7 @@ import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.SpeculationLog.Speculation; @NodeInfo public abstract class AbstractFixedGuardNode extends DeoptimizingFixedWithNextNode implements Simplifiable, GuardingNode, DeoptimizingGuard { @@ -45,7 +47,7 @@ @Input(InputType.Condition) protected LogicNode condition; protected DeoptimizationReason reason; protected DeoptimizationAction action; - protected JavaConstant speculation; + protected Speculation speculation; protected boolean negated; protected NodeSourcePosition noDeoptSuccessorPosition; @@ -65,17 +67,18 @@ this.negated = negated; } - protected AbstractFixedGuardNode(NodeClass<? extends AbstractFixedGuardNode> c, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, JavaConstant speculation, + protected AbstractFixedGuardNode(NodeClass<? extends AbstractFixedGuardNode> c, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, Speculation speculation, boolean negated) { super(c, StampFactory.forVoid()); this.action = action; + assert speculation != null; this.speculation = speculation; this.negated = negated; this.condition = condition; this.reason = deoptReason; } - protected AbstractFixedGuardNode(NodeClass<? extends AbstractFixedGuardNode> c, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, JavaConstant speculation, + protected AbstractFixedGuardNode(NodeClass<? extends AbstractFixedGuardNode> c, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, Speculation speculation, boolean negated, NodeSourcePosition noDeoptSuccessorPosition) { this(c, condition, deoptReason, action, speculation, negated); this.noDeoptSuccessorPosition = noDeoptSuccessorPosition; @@ -92,7 +95,7 @@ } @Override - public JavaConstant getSpeculation() { + public Speculation getSpeculation() { return speculation; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractLocalNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractMergeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/AbstractStateSplit.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ArithmeticOperation.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.ArithmeticOpTable.Op; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BeginStateSplitNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BinaryOpLogicNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/BreakpointNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AbsNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AddNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.ArithmeticOpTable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/AndNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.ArithmeticOpTable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryArithmeticNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/BinaryNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/CompareNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConditionalNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ConvertNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.calc.CanonicalCondition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FixedBinaryNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatConvertNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatDivNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatDivNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatDivNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatDivNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_32; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatEqualsNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatingNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/FloatLessThanNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerBelowNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.NumUtil; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerConvertNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import java.io.Serializable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerDivRemNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_32; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerEqualsNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.calc.CanonicalCondition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLessThanNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.core.common.calc.CanonicalCondition.LT; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLowerThanNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLowerThanNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLowerThanNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerLowerThanNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static jdk.vm.ci.code.CodeUtil.mask; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IntegerTestNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/IsNullNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.AbstractPointerStamp; @@ -29,6 +31,7 @@ import org.graalvm.compiler.graph.spi.CanonicalizerTool; import org.graalvm.compiler.nodeinfo.NodeCycles; import org.graalvm.compiler.nodeinfo.NodeInfo; +import org.graalvm.compiler.nodes.CompressionNode; import org.graalvm.compiler.nodes.LogicConstantNode; import org.graalvm.compiler.nodes.LogicNode; import org.graalvm.compiler.nodes.NodeView; @@ -42,6 +45,7 @@ import org.graalvm.compiler.nodes.type.StampTool; import org.graalvm.compiler.nodes.util.GraphUtil; +import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.TriState; /** @@ -52,22 +56,27 @@ public static final NodeClass<IsNullNode> TYPE = NodeClass.create(IsNullNode.class); - public IsNullNode(ValueNode object) { + /* + * When linear pointer compression is enabled, compressed and uncompressed nulls differ. + */ + private final JavaConstant nullConstant; + + private IsNullNode(ValueNode object, JavaConstant nullConstant) { super(TYPE, object); + this.nullConstant = nullConstant; assert object != null; } - public static LogicNode create(ValueNode forValue) { - return canonicalized(null, forValue); + public IsNullNode(ValueNode object) { + this(object, JavaConstant.NULL_POINTER); } - public static LogicNode tryCanonicalize(ValueNode forValue) { - if (StampTool.isPointerAlwaysNull(forValue)) { - return LogicConstantNode.tautology(); - } else if (StampTool.isPointerNonNull(forValue)) { - return LogicConstantNode.contradiction(); - } - return null; + public JavaConstant nullConstant() { + return nullConstant; + } + + public static LogicNode create(ValueNode forValue) { + return canonicalized(null, forValue, JavaConstant.NULL_POINTER); } @Override @@ -84,31 +93,46 @@ @Override public ValueNode canonical(CanonicalizerTool tool, ValueNode forValue) { - return canonicalized(this, forValue); + return canonicalized(this, forValue, nullConstant); } - private static LogicNode canonicalized(IsNullNode isNullNode, ValueNode forValue) { - IsNullNode self = isNullNode; - LogicNode result = tryCanonicalize(forValue); - if (result != null) { - return result; - } - - if (forValue instanceof PiNode) { - return IsNullNode.create(GraphUtil.skipPi(forValue)); - } + private static LogicNode canonicalized(IsNullNode node, ValueNode forValue, JavaConstant forNullConstant) { + JavaConstant nullConstant = forNullConstant; + ValueNode value = forValue; + while (true) { + if (StampTool.isPointerAlwaysNull(value)) { + return LogicConstantNode.tautology(); + } else if (StampTool.isPointerNonNull(value)) { + return LogicConstantNode.contradiction(); + } - if (forValue instanceof ConvertNode) { - ConvertNode convertNode = (ConvertNode) forValue; - if (convertNode.mayNullCheckSkipConversion()) { - return IsNullNode.create(convertNode.getValue()); + if (value instanceof PiNode) { + value = GraphUtil.skipPi(value); + continue; } - } - if (self == null) { - self = new IsNullNode(GraphUtil.skipPi(forValue)); + if (value instanceof ConvertNode) { + ConvertNode convertNode = (ConvertNode) value; + if (convertNode.mayNullCheckSkipConversion()) { + value = convertNode.getValue(); + continue; + } + /* + * CompressionNode.mayNullCheckSkipConversion returns false when linear pointer + * compression is enabled. + */ + if (value instanceof CompressionNode) { + CompressionNode compressionNode = (CompressionNode) value; + nullConstant = compressionNode.nullConstant(); + value = compressionNode.getValue(); + continue; + } + } + /* + * If we are at original node, just return it. Otherwise create a new node. + */ + return (node != null && value == forValue) ? node : new IsNullNode(value, nullConstant); } - return self; } @Override diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/LeftShiftNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.ArithmeticOpTable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/MulNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowableArithmeticNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NarrowNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NegateNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NormalizeCompareNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/NotNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ObjectEqualsNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.calc.CanonicalCondition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/OrNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.ArithmeticOpTable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/PointerEqualsNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.calc.CanonicalCondition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ReinterpretNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RemNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_32; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/RightShiftNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.ArithmeticOpTable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ShiftNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedDivNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.IntegerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignedRemNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.IntegerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SignExtendNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SqrtNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_16; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/SubNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.ArithmeticOpTable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryArithmeticNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import java.io.Serializable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnaryNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnpackEndianHalfNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnpackEndianHalfNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnpackEndianHalfNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnpackEndianHalfNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import java.nio.ByteOrder; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedDivNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.IntegerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRemNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.IntegerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/UnsignedRightShiftNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.ArithmeticOpTable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/XorNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import org.graalvm.compiler.core.common.type.ArithmeticOpTable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/calc/ZeroExtendNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.calc; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CallTargetNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Extension; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Cancellable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Cancellable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Cancellable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Cancellable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.CancellationBailoutException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CanonicalizableLocation.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.graph.spi.CanonicalizerTool; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/Block.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.cfg; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/ControlFlowGraph.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.cfg; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/HIRLoop.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.cfg; import org.graalvm.compiler.core.common.cfg.Loop; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/cfg/LocationSet.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.cfg; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CompressionNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CompressionNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CompressionNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/CompressionNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; @@ -41,6 +43,7 @@ import org.graalvm.compiler.nodes.type.StampTool; import jdk.vm.ci.meta.Constant; +import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.Value; @@ -76,6 +79,10 @@ protected abstract Constant uncompress(Constant c); + public JavaConstant nullConstant() { + return JavaConstant.NULL_POINTER; + } + @Override public Constant convert(Constant c, ConstantReflectionProvider constantReflection) { switch (op) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConditionAnchorNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Condition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ConstantNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSinkNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ControlSplitNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BindToRegisterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/BlackholeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchored.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/ControlFlowAnchorNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/DynamicCounterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/OpaqueNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/SpillRegistersNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/StringToBytesNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/VerifyHeapNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/debug/WeakCounterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.debug; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.debug.DebugContext; @@ -33,9 +35,9 @@ import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.SpeculationLog; +import jdk.vm.ci.meta.SpeculationLog.Speculation; import jdk.vm.ci.meta.Value; @NodeInfo(shortName = "Deopt", nameTemplate = "Deopt {p#reason/s}") @@ -46,24 +48,24 @@ protected DeoptimizationAction action; protected DeoptimizationReason reason; protected int debugId; - protected final JavaConstant speculation; + protected final Speculation speculation; public DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason) { - this(action, reason, DEFAULT_DEBUG_ID, JavaConstant.NULL_POINTER, null); + this(action, reason, DEFAULT_DEBUG_ID, SpeculationLog.NO_SPECULATION, null); } - public DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason, JavaConstant speculation) { + public DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason, Speculation speculation) { this(action, reason, DEFAULT_DEBUG_ID, speculation, null); } - public DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason, int debugId, JavaConstant speculation, FrameState stateBefore) { + public DeoptimizeNode(DeoptimizationAction action, DeoptimizationReason reason, int debugId, Speculation speculation, FrameState stateBefore) { super(TYPE, stateBefore); assert action != null; assert reason != null; - assert speculation.getJavaKind() == JavaKind.Object; this.action = action; this.reason = reason; this.debugId = debugId; + assert speculation != null; this.speculation = speculation; } @@ -113,7 +115,7 @@ public void generate(NodeLIRBuilderTool gen) { LIRGeneratorTool tool = gen.getLIRGeneratorTool(); Value actionAndReason = tool.emitJavaConstant(tool.getMetaAccess().encodeDeoptActionAndReason(action, reason, getDebugId())); - Value speculationValue = tool.emitJavaConstant(speculation); + Value speculationValue = tool.emitJavaConstant(tool.getMetaAccess().encodeSpeculation(speculation)); gen.getLIRGeneratorTool().emitDeoptimize(actionAndReason, speculationValue, gen.state(this)); } @@ -124,11 +126,11 @@ @Override public ValueNode getSpeculation(MetaAccessProvider metaAccess) { - return ConstantNode.forConstant(speculation, metaAccess, graph()); + return ConstantNode.forConstant(metaAccess.encodeSpeculation(speculation), metaAccess, graph()); } @Override - public JavaConstant getSpeculation() { + public Speculation getSpeculation() { return speculation; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingFixedWithNextNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingGuard.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.graph.NodeSourcePosition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DeoptimizingNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.nodes.spi.NodeWithState; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DirectCallTargetNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicDeoptimizeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.graph.Node; @@ -81,7 +83,7 @@ JavaConstant constant = actionAndReason.asJavaConstant(); JavaConstant speculationConstant = speculation.asJavaConstant(); DeoptimizeNode newDeopt = new DeoptimizeNode(tool.getMetaAccess().decodeDeoptAction(constant), tool.getMetaAccess().decodeDeoptReason(constant), tool.getMetaAccess().decodeDebugId( - constant), speculationConstant, stateBefore()); + constant), tool.getMetaAccess().decodeSpeculation(speculationConstant, graph().getSpeculationLog()), stateBefore()); return newDeopt; } return this; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/DynamicPiNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EncodedGraph.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EndNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryMarkerNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/EntryProxyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/AnchoringNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.nodes.ValueNodeInterface; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWrite.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWrite.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWrite.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ArrayRangeWrite.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.graph.NodeInterface; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BoxNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BranchProbabilityNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; @@ -69,6 +71,15 @@ public static final double VERY_FAST_PATH_PROBABILITY = 0.999; public static final double VERY_SLOW_PATH_PROBABILITY = 1 - VERY_FAST_PATH_PROBABILITY; + /* + * This probability may seem excessive, but it makes a difference in long running loops. Lets + * say a loop is executed 100k times and it has a few null checks with probability 0.999. As + * these probabilities multiply for every loop iteration, the overall loop frequency will be + * calculated as approximately 30 while it should be 100k. + */ + public static final double LUDICROUSLY_FAST_PATH_PROBABILITY = 0.999999; + public static final double LUDICROUSLY_SLOW_PATH_PROBABILITY = 1 - LUDICROUSLY_FAST_PATH_PROBABILITY; + @Input ValueNode probability; @Input ValueNode condition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/BytecodeExceptionNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/FixedValueAnchorNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ForeignCallNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GetClassNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.nodes.ValueNodeInterface; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardedUnsafeLoadNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.InputType.Guard; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/GuardingNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.nodes.ValueNodeInterface; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/IntegerSwitchNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaReadNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/JavaWriteNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadArrayComponentHubNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadArrayComponentHubNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadArrayComponentHubNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadArrayComponentHubNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadHubNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/LoadMethodNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MembarNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorEnter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/MonitorExit.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.nodes.memory.MemoryCheckpoint; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/NullCheckNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.InputType.Guard; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLocalNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLockNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLockNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLockNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRLockNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRMonitorEnterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRMonitorEnterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRMonitorEnterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRMonitorEnterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/OSRStartNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/RawLoadNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/RawLoadNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/RawLoadNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/RawLoadNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/RawStoreNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/RawStoreNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/RawStoreNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/RawStoreNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.InputType.State; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StateSplitProxyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StateSplitProxyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StateSplitProxyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StateSplitProxyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/StoreHubNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/SwitchNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnboxNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeAccessNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeCopyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import org.graalvm.compiler.graph.Node.ConstantNodeParameter; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryLoadNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/UnsafeMemoryStoreNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/extended/ValueAnchorNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.extended; import static org.graalvm.compiler.nodeinfo.InputType.Anchor; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FieldLocationIdentity.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import jdk.vm.ci.meta.JavaKind.FormatWithToString; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedGuardNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,14 +20,15 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ -package org.graalvm.compiler.nodes; -import org.graalvm.compiler.debug.DebugCloseable; + +package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Guard; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_2; +import org.graalvm.compiler.debug.DebugCloseable; import org.graalvm.compiler.graph.IterableNodeType; import org.graalvm.compiler.graph.NodeClass; import org.graalvm.compiler.graph.NodeSourcePosition; @@ -38,29 +39,30 @@ import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.SpeculationLog; @NodeInfo(nameTemplate = "FixedGuard(!={p#negated}) {p#reason/s}", allowedUsageTypes = Guard, size = SIZE_2, cycles = CYCLES_2) public final class FixedGuardNode extends AbstractFixedGuardNode implements Lowerable, IterableNodeType { public static final NodeClass<FixedGuardNode> TYPE = NodeClass.create(FixedGuardNode.class); public FixedGuardNode(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action) { - this(condition, deoptReason, action, JavaConstant.NULL_POINTER, false); + this(condition, deoptReason, action, SpeculationLog.NO_SPECULATION, false); } public FixedGuardNode(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated) { - this(condition, deoptReason, action, JavaConstant.NULL_POINTER, negated); + this(condition, deoptReason, action, SpeculationLog.NO_SPECULATION, negated); } public FixedGuardNode(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, boolean negated, NodeSourcePosition noDeoptSuccessorPosition) { - this(condition, deoptReason, action, JavaConstant.NULL_POINTER, negated, noDeoptSuccessorPosition); + this(condition, deoptReason, action, SpeculationLog.NO_SPECULATION, negated, noDeoptSuccessorPosition); } - public FixedGuardNode(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, JavaConstant speculation, boolean negated) { + public FixedGuardNode(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, SpeculationLog.Speculation speculation, boolean negated) { super(TYPE, condition, deoptReason, action, speculation, negated); } - public FixedGuardNode(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, JavaConstant speculation, boolean negated, NodeSourcePosition noDeoptSuccessorPosition) { + public FixedGuardNode(LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, SpeculationLog.Speculation speculation, boolean negated, + NodeSourcePosition noDeoptSuccessorPosition) { super(TYPE, condition, deoptReason, action, speculation, negated, noDeoptSuccessorPosition); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNodeInterface.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; public interface FixedNodeInterface extends ValueNodeInterface { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FixedWithNextNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingAnchoredNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FloatingGuardedNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FrameState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static jdk.vm.ci.code.BytecodeFrame.getPlaceholderBciName; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/FullInfopointNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.State; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ClassInitializationPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.nodes.FrameState; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ForeignCallPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GeneratedInvocationPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import java.lang.annotation.Annotation; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import static jdk.vm.ci.meta.DeoptimizationAction.InvalidateReprofile; @@ -33,6 +35,7 @@ import org.graalvm.compiler.core.common.type.Stamp; import org.graalvm.compiler.core.common.type.StampFactory; import org.graalvm.compiler.core.common.type.StampPair; +import org.graalvm.compiler.nodes.AbstractMergeNode; import org.graalvm.compiler.nodes.CallTargetNode; import org.graalvm.compiler.nodes.CallTargetNode.InvokeKind; import org.graalvm.compiler.nodes.ConstantNode; @@ -87,14 +90,7 @@ assert !(value instanceof StateSplit) || ((StateSplit) value).stateAfter() != null; return value; } - T equivalentValue = append(value); - if (equivalentValue instanceof StateSplit) { - StateSplit stateSplit = (StateSplit) equivalentValue; - if (stateSplit.stateAfter() == null && stateSplit.hasSideEffect()) { - setStateAfter(stateSplit); - } - } - return equivalentValue; + return GraphBuilderContextUtil.setStateAfterIfNecessary(this, append(value)); } /** @@ -111,14 +107,7 @@ assert !(value instanceof StateSplit) || ((StateSplit) value).stateAfter() != null; return value; } - T equivalentValue = append(value); - if (equivalentValue instanceof StateSplit) { - StateSplit stateSplit = (StateSplit) equivalentValue; - if (stateSplit.stateAfter() == null && stateSplit.hasSideEffect()) { - setStateAfter(stateSplit); - } - } - return equivalentValue; + return GraphBuilderContextUtil.setStateAfterIfNecessary(this, append(value)); } default ValueNode addNonNullCast(ValueNode value) { @@ -145,13 +134,7 @@ default <T extends ValueNode> T addPush(JavaKind kind, T value) { T equivalentValue = value.graph() != null ? value : append(value); push(kind, equivalentValue); - if (equivalentValue instanceof StateSplit) { - StateSplit stateSplit = (StateSplit) equivalentValue; - if (stateSplit.stateAfter() == null && stateSplit.hasSideEffect()) { - setStateAfter(stateSplit); - } - } - return equivalentValue; + return GraphBuilderContextUtil.setStateAfterIfNecessary(this, equivalentValue); } /** @@ -337,3 +320,15 @@ } } } + +class GraphBuilderContextUtil { + static <T extends ValueNode> T setStateAfterIfNecessary(GraphBuilderContext b, T value) { + if (value instanceof StateSplit) { + StateSplit stateSplit = (StateSplit) value; + if (stateSplit.stateAfter() == null && (stateSplit.hasSideEffect() || stateSplit instanceof AbstractMergeNode)) { + b.setStateAfter(stateSplit); + } + } + return value; + } +} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/GraphBuilderTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InlineInvokePlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.bytecode.BytecodeProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/IntrinsicContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import static jdk.vm.ci.code.BytecodeFrame.AFTER_BCI; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import java.lang.invoke.MethodHandle; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvocationPlugins.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import static java.lang.String.format; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvokeDynamicPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvokeDynamicPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvokeDynamicPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/InvokeDynamicPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.nodes.FrameState; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/LoopExplosionPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import jdk.vm.ci.meta.ResolvedJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/MethodSubstitutionPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import static org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.resolveType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodeIntrinsicPluginFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/NodePlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.nodes.ValueNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ParameterPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/ProfilingPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.nodes.FrameState; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/graphbuilderconf/TypePlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.graphbuilderconf; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphDecoder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.debug.GraalError.shouldNotReachHere; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphEncoder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphSpeculationLog.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphSpeculationLog.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphSpeculationLog.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GraphSpeculationLog.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,123 +0,0 @@ -/* - * Copyright (c) 2018, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ -package org.graalvm.compiler.nodes; - -import jdk.internal.vm.compiler.collections.EconomicMap; - -import jdk.vm.ci.meta.JavaConstant; -import jdk.vm.ci.meta.SpeculationLog; - -/** - * A wrapper around a {@link SpeculationLog} instance. - * - * This should be used when the wrapped instance may be accessed by multiple threads. Due to races, - * such an instance can return true for a call to {@link SpeculationLog#maySpeculate} but still fail - * (i.e. raise an {@link IllegalArgumentException}) when {@link SpeculationLog#speculate} is called. - * - * A {@link GraphSpeculationLog} must only be used by a single thread and is typically closely - * coupled with a {@link StructuredGraph} (hence the name). - */ -public final class GraphSpeculationLog implements SpeculationLog { - - private final SpeculationLog log; - private final EconomicMap<SpeculationReason, JavaConstant> speculations; - - public GraphSpeculationLog(SpeculationLog log) { - this.log = log; - this.speculations = EconomicMap.create(); - } - - /** - * Unwraps {@code log} if it is a {@link GraphSpeculationLog}. - */ - public static SpeculationLog unwrap(SpeculationLog log) { - if (log instanceof GraphSpeculationLog) { - return ((GraphSpeculationLog) log).log; - } - return log; - } - - /** - * Determines if the compiler is allowed to speculate with {@code reason}. Note that a - * {@code true} return value guarantees that a subsequent call to - * {@link #speculate(SpeculationReason)} with an argument {@linkplain Object#equals(Object) - * equal} to {@code reason} will succeed. - */ - @Override - public boolean maySpeculate(SpeculationReason reason) { - JavaConstant speculation = speculations.get(reason); - if (speculation == null) { - if (log.maySpeculate(reason)) { - try { - speculation = log.speculate(reason); - speculations.put(reason, speculation); - } catch (IllegalArgumentException e) { - // The speculation was disabled by another thread in between - // the call to log.maySpeculate and log.speculate - speculation = null; - } - } - } - return speculation != null; - } - - @Override - public JavaConstant speculate(SpeculationReason reason) { - if (maySpeculate(reason)) { - JavaConstant speculation = speculations.get(reason); - assert speculation != null; - return speculation; - } - throw new IllegalArgumentException("Cannot make speculation with reason " + reason + " as it is known to fail"); - } - - @Override - public boolean equals(Object obj) { - if (obj instanceof GraphSpeculationLog) { - GraphSpeculationLog that = (GraphSpeculationLog) obj; - return this.log == that.log; - } - return false; - } - - @Override - public int hashCode() { - return log.hashCode(); - } - - @Override - public void collectFailedSpeculations() { - log.collectFailedSpeculations(); - } - - /** - * Returns if this log has speculations. - * - * @return true if {@link #maySpeculate(SpeculationReason)} has ever returned {@code true} for - * this object - */ - @Override - public boolean hasSpeculations() { - return !speculations.isEmpty(); - } -} diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardedValueNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Condition; @@ -41,7 +43,7 @@ import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.SpeculationLog.Speculation; /** * A guard is a node that deoptimizes based on a conditional expression. Guards are not attached to @@ -62,17 +64,17 @@ @Input(Condition) protected LogicNode condition; protected DeoptimizationReason reason; protected DeoptimizationAction action; - protected JavaConstant speculation; + protected Speculation speculation; protected boolean negated; protected NodeSourcePosition noDeoptSuccessorPosition; - public GuardNode(LogicNode condition, AnchoringNode anchor, DeoptimizationReason reason, DeoptimizationAction action, boolean negated, JavaConstant speculation, + public GuardNode(LogicNode condition, AnchoringNode anchor, DeoptimizationReason reason, DeoptimizationAction action, boolean negated, Speculation speculation, NodeSourcePosition noDeoptSuccessorPosition) { this(TYPE, condition, anchor, reason, action, negated, speculation, noDeoptSuccessorPosition); } protected GuardNode(NodeClass<? extends GuardNode> c, LogicNode condition, AnchoringNode anchor, DeoptimizationReason reason, DeoptimizationAction action, boolean negated, - JavaConstant speculation, NodeSourcePosition noDeoptSuccessorPosition) { + Speculation speculation, NodeSourcePosition noDeoptSuccessorPosition) { super(c, StampFactory.forVoid(), anchor); this.condition = condition; this.reason = reason; @@ -113,11 +115,11 @@ } @Override - public JavaConstant getSpeculation() { + public Speculation getSpeculation() { return speculation; } - public void setSpeculation(JavaConstant speculation) { + public void setSpeculation(Speculation speculation) { this.speculation = speculation; } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardPhiNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.StampFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/GuardProxyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.StampFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IfNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/IndirectCallTargetNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InliningLog.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InliningLog.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InliningLog.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InliningLog.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import jdk.vm.ci.meta.MetaUtil; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invokable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invokable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invokable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invokable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import jdk.vm.ci.meta.ResolvedJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/Invoke.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import jdk.vm.ci.meta.JavaKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/InvokeWithExceptionNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import jdk.vm.ci.meta.JavaKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractCompareAndSwapNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractCompareAndSwapNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractCompareAndSwapNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractCompareAndSwapNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewArrayNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AbstractNewObjectNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessArrayNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessFieldNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessIndexedNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AccessMonitorNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import org.graalvm.compiler.core.common.type.StampFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ArrayLengthNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndAddNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/AtomicReadAndWriteNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ClassIsAssignableFromNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_32; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewArrayNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ //JaCoCo Exclude + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/DynamicNewInstanceNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.core.common.GraalOptions.GeneratePIC; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ExceptionObjectNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import jdk.vm.ci.meta.JavaKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/FinalFieldBarrierNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static jdk.vm.ci.code.MemoryBarriers.LOAD_STORE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ForeignCallDescriptors.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfDynamicNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_32; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/InstanceOfNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.InputType.Anchor; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadExceptionObjectNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadFieldNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.graph.iterators.NodePredicates.isNotA; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoadIndexedNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LogicCompareAndSwapNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LogicCompareAndSwapNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LogicCompareAndSwapNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LogicCompareAndSwapNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/LoweredAtomicReadAndWriteNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MethodCallTargetNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorEnterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorExitNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/MonitorIdNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewArrayNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import java.util.Collections; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewInstanceNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import java.lang.ref.Reference; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/NewMultiArrayNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RawMonitorEnterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/RegisterFinalizerNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.InputType.State; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreFieldNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/StoreIndexedNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.InputType.State; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/TypeSwitchNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndExchangeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndExchangeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndExchangeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndExchangeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import jdk.vm.ci.meta.JavaKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndSwapNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndSwapNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndSwapNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/UnsafeCompareAndSwapNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ValueCompareAndSwapNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ValueCompareAndSwapNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ValueCompareAndSwapNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/java/ValueCompareAndSwapNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.java; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/KillingBeginNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicConstantNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNegationNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Condition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LogicNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Condition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopBeginNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.graph.iterators.NodePredicates.isNotA; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopEndNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoopExitNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/LoweredCallTargetNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractMemoryCheckpoint.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/AbstractWriteNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/Access.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.nodes.extended.GuardedNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/AddressNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory.address; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/address/OffsetAddressNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory.address; import org.graalvm.compiler.core.common.type.AbstractPointerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FixedAccessNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatableAccessNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingAccessNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/FloatingReadNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/HeapAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/LIRLowerableAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/LIRLowerableAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/LIRLowerableAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/LIRLowerableAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import jdk.internal.vm.compiler.word.LocationIdentity; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryAnchorNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryCheckpoint.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import jdk.internal.vm.compiler.word.LocationIdentity; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryMapNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import static org.graalvm.compiler.nodeinfo.InputType.Extension; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.nodes.ValueNodeInterface; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/MemoryPhiNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.core.common.type.StampFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/ReadNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/memory/WriteNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.memory; import org.graalvm.compiler.core.common.LIRKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/MergeNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NamedLocationIdentity.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import java.util.EnumMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NodeView.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NodeView.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NodeView.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/NodeView.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ParameterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PauseNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PhiNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiArrayNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PiNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/PrefetchAllocateNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ProxyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ReturnNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Extension; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SafepointNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ShortCircuitOrNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Condition; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SimplifyingGraphDecoder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Guard; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SnippetAnchorNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SnippetAnchorNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SnippetAnchorNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/SnippetAnchorNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Anchor; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArithmeticLIRLowerable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.lir.gen.ArithmeticLIRGeneratorTool; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ArrayLengthProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.nodes.ValueNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LimitedValueProxy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.nodes.ValueNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LIRLowerable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; public interface LIRLowerable { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Lowerable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.nodes.ValueNodeInterface; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.core.common.spi.ArrayOffsetProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/LoweringTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; @@ -33,8 +35,8 @@ import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.SpeculationLog.Speculation; public interface LoweringTool { @@ -52,7 +54,7 @@ GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action); - GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, JavaConstant speculation, boolean negated, + GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, Speculation speculation, boolean negated, NodeSourcePosition noDeoptSuccessorPosition); /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/MemoryProxy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.nodes.memory.MemoryNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeLIRBuilderTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import java.util.Collection; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeValueMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/NodeWithState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.graph.iterators.NodeIterable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Proxy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Replacements.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.api.replacements.MethodSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampInverter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampInverter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampInverter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampInverter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/StampProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.core.common.type.ObjectStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/UncheckedInterfaceProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/ValueProxy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import org.graalvm.compiler.nodes.extended.GuardingNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizableAllocation.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/Virtualizable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/spi/VirtualizerTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.spi; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StartNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StateSplit.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.nodes.spi.NodeWithState; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StaticDeoptimizingNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StaticDeoptimizingNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StaticDeoptimizingNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StaticDeoptimizingNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,13 +20,16 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.debug.GraalError; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.SpeculationLog; +import jdk.vm.ci.meta.SpeculationLog.Speculation; public interface StaticDeoptimizingNode extends ValueNodeInterface { @@ -38,7 +41,7 @@ void setAction(DeoptimizationAction action); - JavaConstant getSpeculation(); + Speculation getSpeculation(); /** * Describes how much information is gathered when deoptimization triggers. @@ -65,7 +68,8 @@ } default GuardPriority computePriority() { - if (getSpeculation() != null && getSpeculation().isNonNull()) { + assert getSpeculation() != null; + if (!getSpeculation().equals(SpeculationLog.NO_SPECULATION)) { return GuardNode.GuardPriority.Speculation; } switch (getAction()) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/StructuredGraph.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.graph.Graph.SourcePositionTracking.Default; @@ -379,11 +381,7 @@ this.entryBCI = entryBCI; this.assumptions = assumptions; this.methods = methods; - if (speculationLog != null && !(speculationLog instanceof GraphSpeculationLog)) { - this.speculationLog = new GraphSpeculationLog(speculationLog); - } else { - this.speculationLog = speculationLog; - } + this.speculationLog = speculationLog; this.useProfilingInfo = useProfilingInfo; this.trackNodeSourcePosition = trackNodeSourcePosition; assert trackNodeSourcePosition != null; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/NarrowOopStamp.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/NarrowOopStamp.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/NarrowOopStamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/NarrowOopStamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.type; import org.graalvm.compiler.core.common.CompressEncoding; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/type/StampTool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.type; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/TypeCheckHints.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnaryOpLogicNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/UnwindNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/ConstantFoldUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.util; import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/GraphUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.util; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/JavaConstantFormattable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/JavaConstantFormattable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/JavaConstantFormattable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/JavaConstantFormattable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.util; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/JavaConstantFormatter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/JavaConstantFormatter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/JavaConstantFormatter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/util/JavaConstantFormatter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.util; import jdk.vm.ci.meta.JavaConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeInterface.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.graph.NodeInterface; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import java.util.function.Predicate; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueNodeUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import static java.lang.Character.toLowerCase; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValuePhiNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import java.util.Map; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/ValueProxyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/AllocatedObjectNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.virtual; import static org.graalvm.compiler.nodeinfo.InputType.Extension; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/CommitAllocationNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.virtual; import static org.graalvm.compiler.nodeinfo.InputType.Association; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EnsureVirtualizedNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.virtual; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/EscapeObjectState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.virtual; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/LockState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.virtual; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualArrayNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.virtual; import java.nio.ByteOrder; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualBoxingNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.virtual; import org.graalvm.compiler.graph.NodeClass; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualInstanceNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.virtual; import org.graalvm.compiler.core.common.spi.ArrayOffsetProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/virtual/VirtualObjectNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.virtual; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes/src/org/graalvm/compiler/nodes/VirtualState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AbstractObjectStampTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AddNodeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AddNodeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AddNodeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/AddNodeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IfNodeCanonicalizationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/IntegerStampTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import static org.graalvm.compiler.core.test.GraalCompilerTest.getInitialOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopLivenessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/LoopPhiCanonicalizerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/NegateNodeCanonicalizationTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import static org.graalvm.compiler.core.test.GraalCompilerTest.getInitialOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampJoinTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import jdk.vm.ci.meta.JavaKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampMeetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import jdk.vm.ci.meta.JavaKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ObjectStampTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/PrimitiveStampBoundaryTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/PrimitiveStampBoundaryTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/PrimitiveStampBoundaryTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/PrimitiveStampBoundaryTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampDoubleToLongTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampFloatToIntTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampIntToFloatTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampLongToDoubleTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ReinterpretStampTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import org.graalvm.compiler.nodes.calc.ReinterpretNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/ShortCircuitOrNodeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import java.util.function.Function; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/StaticFieldAccessTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/StaticFieldAccessTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/StaticFieldAccessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/StaticFieldAccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import java.lang.reflect.Constructor; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/StructuredGraphTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/StructuredGraphTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/StructuredGraphTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.nodes.test/src/org/graalvm/compiler/nodes/test/StructuredGraphTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.nodes.test; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/EnumOptionKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/ModifiableOptionValues.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/ModifiableOptionValues.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/ModifiableOptionValues.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/ModifiableOptionValues.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; import java.util.concurrent.atomic.AtomicReference; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/NestedBooleanOptionKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionDescriptors.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/Option.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; import java.util.Formatter; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionsParser.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionType.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValues.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValues.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValues.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options/src/org/graalvm/compiler/options/OptionValues.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options; import java.io.PrintStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.processor/src/org/graalvm/compiler/options/processor/OptionProcessor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.options.processor; import java.io.BufferedReader; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionKeyTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionKeyTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionKeyTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/NestedBooleanOptionKeyTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,8 @@ * @run junit jdk.vm.ci.options.test.NestedBooleanOptionKeyTest */ + + package org.graalvm.compiler.options.test; import static org.graalvm.compiler.options.test.NestedBooleanOptionKeyTest.Options.Master0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionKey.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionKey.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionKey.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.options.test/src/org/graalvm/compiler/options/test/TestOptionKey.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,8 @@ * @run junit org.graalvm.compiler.options.test.TestOptionKey */ + + package org.graalvm.compiler.options.test; import static org.graalvm.compiler.options.OptionValues.asMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/BasePhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases; import java.util.regex.Pattern; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/ClassTypeSequence.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/ClassTypeSequence.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/ClassTypeSequence.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/ClassTypeSequence.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.phases; import jdk.vm.ci.meta.JavaKind; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/NodeCostUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.contract; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/PhaseSizeContract.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.contract; import org.graalvm.compiler.nodeinfo.NodeSize; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/VerifyNodeCosts.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/VerifyNodeCosts.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/VerifyNodeCosts.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/contract/VerifyNodeCosts.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.contract; import java.lang.reflect.Modifier; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/FixedNodeProbabilityCache.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import static org.graalvm.compiler.nodes.cfg.ControlFlowGraph.multiplyProbabilities; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/InferStamps.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import org.graalvm.compiler.core.common.type.ObjectStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/MergeableState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,4 +24,6 @@ /** * */ + + package org.graalvm.compiler.phases.graph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/PostOrderNodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantBlockIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ReentrantNodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScheduledNodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import java.util.ListIterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/ScopedPostOrderNodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/SinglePassNodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/graph/StatelessPostOrderNodeIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.graph; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/LazyName.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases; import org.graalvm.compiler.debug.DebugContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/OptimisticOptimizations.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,4 +27,6 @@ * Graal is intended to be used with multiple JVM's so makes no use of or reference to classes for a * specific JVM. */ + + package org.graalvm.compiler.phases; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/Phase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/PhaseSuite.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases; import java.util.ArrayList; @@ -87,7 +89,7 @@ * Returns a {@link ListIterator} at the position of the last phase in the suite. If the suite * has no phases then it will return an empty iterator. */ - private ListIterator<BasePhase<? super C>> findLastPhase() { + public ListIterator<BasePhase<? super C>> findLastPhase() { ListIterator<BasePhase<? super C>> it = phases.listIterator(); while (it.hasNext()) { it.next(); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/BlockClosure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.schedule; import org.graalvm.compiler.nodes.cfg.Block; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/MemoryScheduleVerification.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.schedule; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/schedule/SchedulePhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.schedule; import static jdk.internal.vm.compiler.collections.Equivalence.IDENTITY; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/CompilerConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.tiers; import org.graalvm.compiler.lir.phases.AllocationPhase.AllocationContext; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/HighTierContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.tiers; import org.graalvm.compiler.phases.OptimisticOptimizations; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/LowTierContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.tiers; import org.graalvm.compiler.phases.util.Providers; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/MidTierContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.tiers; import org.graalvm.compiler.phases.OptimisticOptimizations; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/PhaseContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.tiers; import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesCreator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.tiers; import org.graalvm.compiler.lir.phases.LIRSuites; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/Suites.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.tiers; import org.graalvm.compiler.lir.alloc.RegisterAllocationPhase; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/SuitesProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.tiers; import org.graalvm.compiler.lir.phases.LIRSuites; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/tiers/TargetProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.tiers; import jdk.vm.ci.code.TargetDescription; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/BlockWorkList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.util; import org.graalvm.compiler.nodes.AbstractMergeNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/GraphOrder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.util; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/MethodDebugValueName.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.util; import org.graalvm.compiler.phases.LazyName; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/Providers.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.util; import org.graalvm.compiler.core.common.spi.ArrayOffsetProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/ValueMergeUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/ValueMergeUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/ValueMergeUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/util/ValueMergeUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.util; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyBailoutUsage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.verify; import org.graalvm.compiler.core.common.PermanentBailoutException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyCallerSensitiveMethods.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.verify; import static org.graalvm.compiler.serviceprovider.GraalServices.Java8OrEarlier; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyDebugUsage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.verify; import static org.graalvm.compiler.debug.DebugContext.BASIC_LEVEL; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyGetOptionsUsage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyGetOptionsUsage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyGetOptionsUsage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyGetOptionsUsage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.verify; import java.lang.reflect.MalformedParametersException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyGraphAddUsage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyGraphAddUsage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyGraphAddUsage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyGraphAddUsage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.verify; import java.lang.reflect.Constructor; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyInstanceOfUsage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyInstanceOfUsage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyInstanceOfUsage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyInstanceOfUsage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.verify; import org.graalvm.compiler.lir.StandardOp.LoadConstantOp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUpdateUsages.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.verify; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyUsageWithEquals.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.verify; import org.graalvm.compiler.core.common.type.ObjectStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/verify/VerifyVirtualizableUsage.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.verify; import org.graalvm.compiler.core.common.type.ObjectStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases/src/org/graalvm/compiler/phases/VerifyPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AbstractInliningPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.phases.BasePhase; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringByUsePhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringByUsePhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringByUsePhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringByUsePhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/AddressLoweringPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/CanonicalizerPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.core.common.spi.ConstantFieldProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConditionalEliminationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConditionalEliminationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConditionalEliminationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConditionalEliminationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import static org.graalvm.compiler.nodes.StaticDeoptimizingNode.mergeActions; @@ -97,6 +99,7 @@ import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.JavaConstant; +import jdk.vm.ci.meta.SpeculationLog.Speculation; import jdk.vm.ci.meta.TriState; public class ConditionalEliminationPhase extends BasePhase<PhaseContext> { @@ -198,7 +201,7 @@ for (GuardNode guard : node.falseSuccessor().guards().snapshot()) { GuardNode otherGuard = trueGuards.get(guard.getCondition()); if (otherGuard != null && guard.isNegated() == otherGuard.isNegated()) { - JavaConstant speculation = otherGuard.getSpeculation(); + Speculation speculation = otherGuard.getSpeculation(); if (speculation == null) { speculation = guard.getSpeculation(); } else if (guard.getSpeculation() != null && guard.getSpeculation() != speculation) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ConvertDeoptimizeToGuardPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeadCodeEliminationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.debug.CounterKey; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/DeoptimizationGroupingPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import java.util.LinkedList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ExpandLogicPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.core.common.type.FloatStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FixReadsPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FixReadsPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FixReadsPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FixReadsPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import jdk.internal.vm.compiler.collections.EconomicMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FloatingReadPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import static org.graalvm.compiler.graph.Graph.NodeEvent.NODE_ADDED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/FrameStateAssignmentPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/GuardLoweringPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.core.common.cfg.Loop; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IncrementalCanonicalizerPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.graph.Graph.NodeEventScope; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AbstractInlineInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.info; import jdk.internal.vm.compiler.collections.EconomicSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/AssumptionInlineInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.info; import jdk.internal.vm.compiler.collections.EconomicSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/InlineableGraph.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.info.elem; import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Optional; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/elem/Inlineable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.info.elem; import org.graalvm.compiler.nodes.Invoke; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/ExactInlineInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.info; import jdk.internal.vm.compiler.collections.EconomicSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/InlineInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.info; import jdk.internal.vm.compiler.collections.EconomicSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/MultiTypeGuardInlineInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.info; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/info/TypeGuardInlineInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.info; import jdk.internal.vm.compiler.collections.EconomicSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining; import java.util.LinkedList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/InliningUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining; import static jdk.vm.ci.meta.DeoptimizationAction.InvalidateReprofile; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/AbstractInliningPolicy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.policy; import static org.graalvm.compiler.phases.common.inlining.InliningPhase.Options.AlwaysInlineIntrinsics; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/GreedyInliningPolicy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.policy; import static org.graalvm.compiler.core.common.GraalOptions.InlineEverything; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineEverythingPolicy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.policy; import static org.graalvm.compiler.core.common.GraalOptions.MaximumDesiredSize; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InlineMethodSubstitutionsPolicy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.policy; import org.graalvm.compiler.core.common.GraalOptions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/policy/InliningPolicy.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.policy; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolderExplorable.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.walker; import java.util.BitSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/CallsiteHolder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.walker; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/ComputeInliningRelevance.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.walker; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningData.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.walker; import static org.graalvm.compiler.core.common.GraalOptions.Intrinsify; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/InliningIterator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.walker; import java.util.ArrayDeque; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/inlining/walker/MethodInvocation.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.inlining.walker; import java.util.BitSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/IterativeConditionalEliminationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import static org.graalvm.compiler.graph.Graph.NodeEvent.NODE_ADDED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LazyValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import java.util.function.Supplier; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LockEliminationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,10 +20,13 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.nodes.FixedNode; import org.graalvm.compiler.nodes.StructuredGraph; +import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.extended.OSRMonitorEnterNode; import org.graalvm.compiler.nodes.java.AccessMonitorNode; import org.graalvm.compiler.nodes.java.MonitorEnterNode; @@ -44,7 +47,7 @@ // start assert !(next instanceof OSRMonitorEnterNode); AccessMonitorNode monitorEnterNode = (AccessMonitorNode) next; - if (GraphUtil.unproxify(monitorEnterNode.object()) == GraphUtil.unproxify(monitorExitNode.object())) { + if (isCompatibleLock(monitorEnterNode, monitorExitNode)) { /* * We've coarsened the lock so use the same monitor id for the whole region, * otherwise the monitor operations appear to be unrelated. @@ -60,4 +63,18 @@ } } } + + /** + * Check that the paired operations operate on the same object at the same lock depth. + */ + public static boolean isCompatibleLock(AccessMonitorNode lock1, AccessMonitorNode lock2) { + /* + * It is not always the case that sequential monitor operations on the same object have the + * same lock depth: Escape analysis can have removed a lock operation that was in between, + * leading to a mismatch in lock depth. + */ + ValueNode object1 = GraphUtil.unproxify(lock1.object()); + ValueNode object2 = GraphUtil.unproxify(lock2.object()); + return object1 == object2 && lock1.getMonitorId().getLockDepth() == lock2.getMonitorId().getLockDepth(); + } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoopSafepointInsertionPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import static org.graalvm.compiler.core.common.GraalOptions.GenLoopSafepoints; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/LoweringPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import static org.graalvm.compiler.core.common.GraalOptions.OptEliminateGuards; @@ -81,8 +83,9 @@ import jdk.vm.ci.meta.ConstantReflectionProvider; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.SpeculationLog; +import jdk.vm.ci.meta.SpeculationLog.Speculation; /** * Processes all {@link Lowerable} nodes to do their lowering. @@ -172,7 +175,7 @@ @Override public GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action) { - return createGuard(before, condition, deoptReason, action, JavaConstant.NULL_POINTER, false, null); + return createGuard(before, condition, deoptReason, action, SpeculationLog.NO_SPECULATION, false, null); } @Override @@ -181,7 +184,7 @@ } @Override - public GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, JavaConstant speculation, boolean negated, + public GuardingNode createGuard(FixedNode before, LogicNode condition, DeoptimizationReason deoptReason, DeoptimizationAction action, Speculation speculation, boolean negated, NodeSourcePosition noDeoptSucccessorPosition) { StructuredGraph graph = before.graph(); if (OptEliminateGuards.getValue(graph.getOptions())) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NodeCounterPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NodeCounterPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NodeCounterPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NodeCounterPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.debug.DebugContext; @@ -33,6 +35,18 @@ public class NodeCounterPhase extends BasePhase<PhaseContext> { + private Stage stage; + + public NodeCounterPhase(Stage stage) { + this.stage = stage; + } + + public enum Stage { + INIT, + EARLY, + LATE + } + public static class Options { // @formatter:off @Option(help = "Counts the number of instances of each node class.", type = OptionType.Debug) @@ -42,9 +56,11 @@ @Override protected void run(StructuredGraph graph, PhaseContext context) { + for (Node node : graph.getNodes()) { - DebugContext.counter("NodeCounter_%s", - node.getNodeClass().getClazz().getSimpleName()).increment(node.getDebug()); + String nodeName = node.getNodeClass().getClazz().getSimpleName(); + + DebugContext.counter("NodeCounter_%s_%s", this.stage, nodeName).increment(node.getDebug()); } } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/NonNullParametersPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.core.common.type.ObjectStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/ProfileCompiledMethodsPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PropagateDeoptimizeProbabilityPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PropagateDeoptimizeProbabilityPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PropagateDeoptimizeProbabilityPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/PropagateDeoptimizeProbabilityPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import jdk.internal.vm.compiler.collections.EconomicMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/RemoveValueProxyPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.nodes.FrameState; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/UseTrappingNullChecksPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import static org.graalvm.compiler.core.common.GraalOptions.OptImplicitNullChecks; @@ -57,8 +59,9 @@ import org.graalvm.compiler.phases.tiers.LowTierContext; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.MetaAccessProvider; +import jdk.vm.ci.meta.SpeculationLog; +import jdk.vm.ci.meta.SpeculationLog.Speculation; public class UseTrappingNullChecksPhase extends BasePhase<LowTierContext> { @@ -135,20 +138,25 @@ for (AbstractEndNode end : merge.cfgPredecessors().snapshot()) { ValueNode thisReason = reasons != null ? reasons.get(index) : reason; ValueNode thisSpeculation = speculations != null ? speculations.get(index++) : speculation; - if (!thisReason.isConstant() || !thisSpeculation.isConstant() || !thisSpeculation.asConstant().equals(JavaConstant.NULL_POINTER)) { + if (!thisReason.isConstant() || !thisSpeculation.isConstant()) { + continue; + } + Speculation speculationConstant = metaAccessProvider.decodeSpeculation(thisSpeculation.asJavaConstant(), deopt.graph().getSpeculationLog()); + if (!speculationConstant.equals(SpeculationLog.NO_SPECULATION)) { continue; } DeoptimizationReason deoptimizationReason = metaAccessProvider.decodeDeoptReason(thisReason.asJavaConstant()); - tryUseTrappingNullCheck(deopt, end.predecessor(), deoptimizationReason, null, implicitNullCheckLimit); + tryUseTrappingNullCheck(deopt, end.predecessor(), deoptimizationReason, SpeculationLog.NO_SPECULATION, implicitNullCheckLimit); } } } - private static void tryUseTrappingNullCheck(AbstractDeoptimizeNode deopt, Node predecessor, DeoptimizationReason deoptimizationReason, JavaConstant speculation, long implicitNullCheckLimit) { + private static void tryUseTrappingNullCheck(AbstractDeoptimizeNode deopt, Node predecessor, DeoptimizationReason deoptimizationReason, Speculation speculation, long implicitNullCheckLimit) { if (deoptimizationReason != DeoptimizationReason.NullCheckException && deoptimizationReason != DeoptimizationReason.UnreachedCode) { return; } - if (speculation != null && !speculation.equals(JavaConstant.NULL_POINTER)) { + assert speculation != null; + if (!speculation.equals(SpeculationLog.NO_SPECULATION)) { return; } if (predecessor instanceof AbstractMergeNode) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/util/HashSetNodeEventListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.util; import java.util.EnumSet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common/src/org/graalvm/compiler/phases/common/VerifyHeapAtReturnPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common; import org.graalvm.compiler.nodes.ReturnNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.phases.common.test/src/org/graalvm/compiler/phases/common/test/StampFactoryTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.phases.common.test; import java.lang.reflect.Method; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/BinaryGraphPrinter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.printer; import static org.graalvm.compiler.graph.Edges.Type.Inputs; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CanonicalStringGraphPrinter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.printer; import static org.graalvm.compiler.debug.DebugOptions.CanonicalGraphStringsCheckConstants; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.printer; import static java.lang.Character.toLowerCase; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CFGPrinterObserver.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.printer; import static org.graalvm.compiler.debug.DebugOptions.PrintCFG; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/CompilationPrinter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.printer; import java.io.Closeable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugHandlersFactory.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugHandlersFactory.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugHandlersFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraalDebugHandlersFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.printer; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinterDumpHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.printer; import static org.graalvm.compiler.debug.DebugConfig.asJavaMethod; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/GraphPrinter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.printer; import java.io.Closeable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.printer/src/org/graalvm/compiler/printer/NoDeadCodeVerifyHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.printer; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.processor/src/org/graalvm/compiler/processor/AbstractProcessor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.processor/src/org/graalvm/compiler/processor/AbstractProcessor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.processor/src/org/graalvm/compiler/processor/AbstractProcessor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.processor/src/org/graalvm/compiler/processor/AbstractProcessor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.processor; import java.io.IOException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.processor/src/org/graalvm/compiler/processor/SuppressFBWarnings.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.processor/src/org/graalvm/compiler/processor/SuppressFBWarnings.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.processor/src/org/graalvm/compiler/processor/SuppressFBWarnings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.processor/src/org/graalvm/compiler/processor/SuppressFBWarnings.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.processor; import java.lang.annotation.Retention; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraysSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ArraySubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/BoxingSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.core.common.GraalOptions.ImmutableCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/CachingPEGraphDecoder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext.CompilationContext.INLINE_AFTER_PARSING; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.classfile; import java.io.ByteArrayInputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileBytecodeProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.classfile; import java.io.DataInputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.classfile; import static org.graalvm.compiler.bytecode.Bytecodes.GETFIELD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/ClassfileConstantPool.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.classfile; import static org.graalvm.compiler.replacements.classfile.Classfile.skipFully; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/classfile/Classfile.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.classfile; import java.io.DataInputStream; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantBindingParameterPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantStringIndexOfSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantStringIndexOfSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantStringIndexOfSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ConstantStringIndexOfSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.replacements.SnippetTemplate.DEFAULT_REPLACER; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/DefaultJavaLoweringProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static jdk.vm.ci.code.MemoryBarriers.JMM_POST_VOLATILE_READ; @@ -143,12 +145,12 @@ import jdk.vm.ci.code.TargetDescription; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.MetaAccessProvider; import jdk.vm.ci.meta.ResolvedJavaField; import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; +import jdk.vm.ci.meta.SpeculationLog; /** * VM-independent lowerings for standard Java nodes. VM-specific methods are abstract and must be @@ -760,7 +762,7 @@ barrierType = fieldInitializationBarrier(entryKind); } } else { - address = createOffsetAddress(graph, newObject, arrayBaseOffset(entryKind) + i * arrayScalingFactor(entryKind)); + address = createOffsetAddress(graph, newObject, tool.getMetaAccess().getArrayBaseOffset(entryKind) + i * arrayScalingFactor(entryKind)); barrierType = arrayInitializationBarrier(entryKind); } if (address != null) { @@ -1094,7 +1096,7 @@ if (StampTool.isPointerNonNull(object)) { return null; } - return tool.createGuard(before, before.graph().unique(IsNullNode.create(object)), NullCheckException, InvalidateReprofile, JavaConstant.NULL_POINTER, true, null); + return tool.createGuard(before, before.graph().unique(IsNullNode.create(object)), NullCheckException, InvalidateReprofile, SpeculationLog.NO_SPECULATION, true, null); } protected ValueNode createNullCheckedValue(ValueNode object, FixedNode before, LoweringTool tool) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/GraphKit.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.nodes.graphbuilderconf.IntrinsicContext.CompilationContext.INLINE_AFTER_PARSING; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InlineDuringParsingPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.core.common.GraalOptions.TrivialInliningSize; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/InstanceOfSnippetsTemplates.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.nodes.calc.CompareNode.createCompareNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntegerSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/IntrinsicGraphBuilder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import org.graalvm.compiler.bytecode.Bytecode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/JavacBug.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Log.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,14 +20,19 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; +import static org.graalvm.compiler.replacements.nodes.CStringConstant.cstring; + import java.io.PrintStream; import org.graalvm.compiler.core.common.spi.ForeignCallDescriptor; import org.graalvm.compiler.graph.Node.ConstantNodeParameter; import org.graalvm.compiler.graph.Node.NodeIntrinsic; import org.graalvm.compiler.nodes.extended.ForeignCallNode; +import org.graalvm.compiler.word.Word; import jdk.vm.ci.meta.JavaKind; @@ -40,7 +45,7 @@ public static final ForeignCallDescriptor LOG_PRIMITIVE = new ForeignCallDescriptor("logPrimitive", void.class, int.class, long.class, boolean.class); public static final ForeignCallDescriptor LOG_OBJECT = new ForeignCallDescriptor("logObject", void.class, Object.class, boolean.class, boolean.class); - public static final ForeignCallDescriptor LOG_PRINTF = new ForeignCallDescriptor("logPrintf", void.class, String.class, long.class, long.class, long.class); + public static final ForeignCallDescriptor LOG_PRINTF = new ForeignCallDescriptor("logPrintf", void.class, Word.class, long.class, long.class, long.class); @NodeIntrinsic(ForeignCallNode.class) private static native void log(@ConstantNodeParameter ForeignCallDescriptor logObject, Object object, boolean asString, boolean newline); @@ -49,7 +54,7 @@ private static native void log(@ConstantNodeParameter ForeignCallDescriptor logPrimitive, int typeChar, long value, boolean newline); @NodeIntrinsic(ForeignCallNode.class) - private static native void printf(@ConstantNodeParameter ForeignCallDescriptor logPrintf, String format, long v1, long v2, long v3); + private static native void printf(@ConstantNodeParameter ForeignCallDescriptor logPrintf, Word format, long v1, long v2, long v3); public static void print(boolean value) { log(LOG_PRIMITIVE, JavaKind.Boolean.getTypeChar(), value ? 1L : 0L, false); @@ -83,15 +88,15 @@ * @param value the value associated with the conversion specifier */ public static void printf(String format, long value) { - printf(LOG_PRINTF, format, value, 0L, 0L); + printf(LOG_PRINTF, cstring(format), value, 0L, 0L); } public static void printf(String format, long v1, long v2) { - printf(LOG_PRINTF, format, v1, v2, 0L); + printf(LOG_PRINTF, cstring(format), v1, v2, 0L); } public static void printf(String format, long v1, long v2, long v3) { - printf(LOG_PRINTF, format, v1, v2, v3); + printf(LOG_PRINTF, cstring(format), v1, v2, v3); } public static void print(float value) { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/LongSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/MethodHandlePlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.core.common.GraalOptions.MaximumRecursiveInlining; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/NodeIntrinsificationProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import org.graalvm.compiler.api.replacements.SnippetReflectionProvider; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import static org.graalvm.compiler.core.common.type.IntegerStamp.addOverflowsNegatively; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerAddExactSplitNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import org.graalvm.compiler.core.common.type.IntegerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import org.graalvm.compiler.nodes.AbstractBeginNode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerExactArithmeticSplitNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulExactSplitNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_4; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerMulHighNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/IntegerSubExactSplitNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import org.graalvm.compiler.core.common.type.IntegerStamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/arithmetic/UnsignedMulHighNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes.arithmetic; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayCompareToNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayCompareToNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayCompareToNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayCompareToNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ArrayEqualsNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/AssertionNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicArrayCopyNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.InputType.Memory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BasicObjectCloneNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BinaryMathIntrinsicNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitCountNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanForwardNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/BitScanReverseNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/CStringConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import java.nio.ByteBuffer; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/DirectStoreNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ExplodeLoopNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/LoadSnippetVarargParameterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static jdk.vm.ci.code.BytecodeFrame.isPlaceholderBci; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MacroStateSplitNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/MethodHandleNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_UNKNOWN; @@ -60,7 +62,6 @@ import jdk.vm.ci.meta.Assumptions.AssumptionResult; import jdk.vm.ci.meta.DeoptimizationAction; import jdk.vm.ci.meta.DeoptimizationReason; -import jdk.vm.ci.meta.JavaConstant; import jdk.vm.ci.meta.JavaKind; import jdk.vm.ci.meta.JavaType; import jdk.vm.ci.meta.MethodHandleAccessProvider; @@ -68,6 +69,8 @@ import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.Signature; +import jdk.vm.ci.meta.SpeculationLog; +import jdk.vm.ci.meta.SpeculationLog.Speculation; /** * Node for invocation methods defined on the class {@link MethodHandle}. @@ -327,7 +330,7 @@ AnchoringNode guardAnchor = adder.getGuardAnchor(); DeoptimizationReason reason = DeoptimizationReason.ClassCastException; DeoptimizationAction action = DeoptimizationAction.InvalidateRecompile; - JavaConstant speculation = JavaConstant.NULL_POINTER; + Speculation speculation = SpeculationLog.NO_SPECULATION; GuardingNode guard; if (guardAnchor == null) { FixedGuardNode fixedGuard = adder.add(new FixedGuardNode(inst, reason, action, speculation, false)); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/PureFunctionMacroNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReadRegisterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ResolvedMethodHandleCallTargetNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import java.lang.invoke.MethodHandle; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/ReverseBytesNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; @@ -59,9 +61,9 @@ IntegerStamp valueStamp = (IntegerStamp) newStamp; if (getStackKind() == JavaKind.Int) { long mask = CodeUtil.mask(JavaKind.Int.getBitCount()); - return IntegerStamp.stampForMask(valueStamp.getBits(), Integer.reverse((int) valueStamp.downMask()) & mask, Integer.reverse((int) valueStamp.upMask()) & mask); + return IntegerStamp.stampForMask(valueStamp.getBits(), Integer.reverseBytes((int) valueStamp.downMask()) & mask, Integer.reverseBytes((int) valueStamp.upMask()) & mask); } else if (getStackKind() == JavaKind.Long) { - return IntegerStamp.stampForMask(valueStamp.getBits(), Long.reverse(valueStamp.downMask()), Long.reverse(valueStamp.upMask())); + return IntegerStamp.stampForMask(valueStamp.getBits(), Long.reverseBytes(valueStamp.downMask()), Long.reverseBytes(valueStamp.upMask())); } else { return stamp(NodeView.DEFAULT); } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/UnaryMathIntrinsicNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/VirtualizableInvokeMacroNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import org.graalvm.compiler.core.common.type.StampPair; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/nodes/WriteRegisterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.nodes; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/PEGraphDecoder.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import java.net.URI; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.core.common.GraalOptions.UseSnippetGraphCache; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/ReplacementsUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import org.graalvm.compiler.debug.Assertions; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounter.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetCounterNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetIntegerHistogram.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetIntegerHistogram.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetIntegerHistogram.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetIntegerHistogram.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetLowerableMemoryNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetLowerableMemoryNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetLowerableMemoryNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetLowerableMemoryNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/Snippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import org.graalvm.compiler.api.replacements.Snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/SnippetTemplate.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static java.util.FormattableFlags.ALTERNATE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StandardGraphBuilderPlugins.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static jdk.vm.ci.code.MemoryBarriers.JMM_POST_VOLATILE_READ; @@ -53,16 +55,23 @@ import org.graalvm.compiler.graph.NodeList; import org.graalvm.compiler.nodes.ConstantNode; import org.graalvm.compiler.nodes.DeoptimizeNode; +import org.graalvm.compiler.nodes.EndNode; import org.graalvm.compiler.nodes.FixedGuardNode; +import org.graalvm.compiler.nodes.FixedWithNextNode; +import org.graalvm.compiler.nodes.IfNode; import org.graalvm.compiler.nodes.LogicNode; +import org.graalvm.compiler.nodes.MergeNode; import org.graalvm.compiler.nodes.NodeView; +import org.graalvm.compiler.nodes.StateSplit; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.ValueNode; +import org.graalvm.compiler.nodes.ValuePhiNode; import org.graalvm.compiler.nodes.calc.AbsNode; import org.graalvm.compiler.nodes.calc.CompareNode; import org.graalvm.compiler.nodes.calc.ConditionalNode; import org.graalvm.compiler.nodes.calc.FloatEqualsNode; import org.graalvm.compiler.nodes.calc.IntegerEqualsNode; +import org.graalvm.compiler.nodes.calc.IsNullNode; import org.graalvm.compiler.nodes.calc.NarrowNode; import org.graalvm.compiler.nodes.calc.ReinterpretNode; import org.graalvm.compiler.nodes.calc.RightShiftNode; @@ -98,6 +107,7 @@ import org.graalvm.compiler.nodes.java.RegisterFinalizerNode; import org.graalvm.compiler.nodes.java.UnsafeCompareAndExchangeNode; import org.graalvm.compiler.nodes.java.UnsafeCompareAndSwapNode; +import org.graalvm.compiler.nodes.type.StampTool; import org.graalvm.compiler.nodes.util.GraphUtil; import org.graalvm.compiler.nodes.virtual.EnsureVirtualizedNode; import org.graalvm.compiler.replacements.nodes.ReverseBytesNode; @@ -117,6 +127,7 @@ import jdk.vm.ci.meta.ResolvedJavaMethod; import jdk.vm.ci.meta.ResolvedJavaType; import jdk.vm.ci.meta.SpeculationLog; +import jdk.vm.ci.meta.SpeculationLog.Speculation; import sun.misc.Unsafe; /** @@ -125,7 +136,7 @@ public class StandardGraphBuilderPlugins { public static void registerInvocationPlugins(MetaAccessProvider metaAccess, SnippetReflectionProvider snippetReflection, InvocationPlugins plugins, BytecodeProvider bytecodeProvider, - boolean allowDeoptimization) { + boolean allowDeoptimization, boolean explicitUnsafeNullChecks) { registerObjectPlugins(plugins); registerClassPlugins(plugins); registerMathPlugins(plugins, allowDeoptimization); @@ -139,7 +150,7 @@ registerDoublePlugins(plugins); registerArraysPlugins(plugins, bytecodeProvider); registerArrayPlugins(plugins, bytecodeProvider); - registerUnsafePlugins(plugins, bytecodeProvider); + registerUnsafePlugins(plugins, bytecodeProvider, explicitUnsafeNullChecks); registerEdgesPlugins(metaAccess, plugins); registerGraalDirectivesPlugins(plugins); registerBoxingPlugins(plugins); @@ -213,31 +224,30 @@ } private abstract static class UnsafeCompareAndUpdatePluginsRegistrar { - public void register(Registration r, String casPrefix, JavaKind[] compareAndSwapTypes) { + public void register(Registration r, String casPrefix, boolean explicitUnsafeNullChecks, JavaKind[] compareAndSwapTypes) { for (JavaKind kind : compareAndSwapTypes) { Class<?> javaClass = kind == JavaKind.Object ? Object.class : kind.toJavaClass(); - r.register5(casPrefix + kind.name(), Receiver.class, Object.class, long.class, javaClass, javaClass, new InvocationPlugin() { + r.register5(casPrefix + kind.name(), Receiver.class, Object.class, long.class, javaClass, javaClass, new UnsafeAccessPlugin(returnKind(kind), explicitUnsafeNullChecks) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode object, ValueNode offset, ValueNode expected, ValueNode x) { // Emits a null-check for the otherwise unused receiver unsafe.get(); - b.addPush(returnKind(kind), createNode(object, offset, expected, x, kind, LocationIdentity.any())); - b.getGraph().markUnsafeAccess(); + createUnsafeAccess(object, b, (obj, loc) -> UnsafeCompareAndUpdatePluginsRegistrar.this.createNode(obj, offset, expected, x, kind, loc)); return true; } }); } } - public abstract ValueNode createNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue, JavaKind kind, LocationIdentity identity); + public abstract FixedWithNextNode createNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue, JavaKind kind, LocationIdentity identity); public abstract JavaKind returnKind(JavaKind accessKind); } private static class UnsafeCompareAndSwapPluginsRegistrar extends UnsafeCompareAndUpdatePluginsRegistrar { @Override - public ValueNode createNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue, JavaKind kind, LocationIdentity identity) { - return new UnsafeCompareAndSwapNode(object, offset, expected, newValue, kind, LocationIdentity.any()); + public FixedWithNextNode createNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue, JavaKind kind, LocationIdentity identity) { + return new UnsafeCompareAndSwapNode(object, offset, expected, newValue, kind, identity); } @Override @@ -250,8 +260,8 @@ private static class UnsafeCompareAndExchangePluginsRegistrar extends UnsafeCompareAndUpdatePluginsRegistrar { @Override - public ValueNode createNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue, JavaKind kind, LocationIdentity identity) { - return new UnsafeCompareAndExchangeNode(object, offset, expected, newValue, kind, LocationIdentity.any()); + public FixedWithNextNode createNode(ValueNode object, ValueNode offset, ValueNode expected, ValueNode newValue, JavaKind kind, LocationIdentity identity) { + return new UnsafeCompareAndExchangeNode(object, offset, expected, newValue, kind, identity); } @Override @@ -266,31 +276,31 @@ private static UnsafeCompareAndExchangePluginsRegistrar unsafeCompareAndExchangePluginsRegistrar = new UnsafeCompareAndExchangePluginsRegistrar(); - public static void registerPlatformSpecificUnsafePlugins(InvocationPlugins plugins, BytecodeProvider bytecodeProvider, JavaKind[] supportedCasKinds) { - registerPlatformSpecificUnsafePlugins(supportedCasKinds, new Registration(plugins, Unsafe.class), true); + public static void registerPlatformSpecificUnsafePlugins(InvocationPlugins plugins, BytecodeProvider bytecodeProvider, boolean explicitUnsafeNullChecks, JavaKind[] supportedCasKinds) { + registerPlatformSpecificUnsafePlugins(supportedCasKinds, new Registration(plugins, Unsafe.class), true, explicitUnsafeNullChecks); if (!Java8OrEarlier) { - registerPlatformSpecificUnsafePlugins(supportedCasKinds, new Registration(plugins, "jdk.internal.misc.Unsafe", bytecodeProvider), false); + registerPlatformSpecificUnsafePlugins(supportedCasKinds, new Registration(plugins, "jdk.internal.misc.Unsafe", bytecodeProvider), false, explicitUnsafeNullChecks); } } - private static void registerPlatformSpecificUnsafePlugins(JavaKind[] supportedCasKinds, Registration r, boolean java8OrEarlier) { + private static void registerPlatformSpecificUnsafePlugins(JavaKind[] supportedCasKinds, Registration r, boolean java8OrEarlier, boolean explicitUnsafeNullChecks) { if (java8OrEarlier) { - unsafeCompareAndSwapPluginsRegistrar.register(r, "compareAndSwap", new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object}); + unsafeCompareAndSwapPluginsRegistrar.register(r, "compareAndSwap", explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object}); } else { - unsafeCompareAndSwapPluginsRegistrar.register(r, "compareAndSet", supportedCasKinds); - unsafeCompareAndExchangePluginsRegistrar.register(r, "compareAndExchange", supportedCasKinds); + unsafeCompareAndSwapPluginsRegistrar.register(r, "compareAndSet", explicitUnsafeNullChecks, supportedCasKinds); + unsafeCompareAndExchangePluginsRegistrar.register(r, "compareAndExchange", explicitUnsafeNullChecks, supportedCasKinds); } } - private static void registerUnsafePlugins(InvocationPlugins plugins, BytecodeProvider bytecodeProvider) { - registerUnsafePlugins(new Registration(plugins, Unsafe.class), true); + private static void registerUnsafePlugins(InvocationPlugins plugins, BytecodeProvider bytecodeProvider, boolean explicitUnsafeNullChecks) { + registerUnsafePlugins(new Registration(plugins, Unsafe.class), true, explicitUnsafeNullChecks); if (!Java8OrEarlier) { - registerUnsafePlugins(new Registration(plugins, "jdk.internal.misc.Unsafe", bytecodeProvider), false); + registerUnsafePlugins(new Registration(plugins, "jdk.internal.misc.Unsafe", bytecodeProvider), false, explicitUnsafeNullChecks); } } - private static void registerUnsafePlugins(Registration r, boolean java8OrEarlier) { + private static void registerUnsafePlugins(Registration r, boolean java8OrEarlier, boolean explicitUnsafeNullChecks) { for (JavaKind kind : JavaKind.values()) { if ((kind.isPrimitive() && kind != JavaKind.Void) || kind == JavaKind.Object) { Class<?> javaClass = kind == JavaKind.Object ? Object.class : kind.toJavaClass(); @@ -298,33 +308,33 @@ String getName = "get" + kindName; String putName = "put" + kindName; // Object-based accesses - r.register3(getName, Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind)); - r.register4(putName, Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind)); + r.register3(getName, Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind, explicitUnsafeNullChecks)); + r.register4(putName, Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, explicitUnsafeNullChecks)); // Volatile object-based accesses - r.register3(getName + "Volatile", Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind, AccessKind.VOLATILE)); - r.register4(putName + "Volatile", Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.VOLATILE)); + r.register3(getName + "Volatile", Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind, AccessKind.VOLATILE, explicitUnsafeNullChecks)); + r.register4(putName + "Volatile", Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.VOLATILE, explicitUnsafeNullChecks)); // Ordered object-based accesses if (java8OrEarlier) { if (kind == JavaKind.Int || kind == JavaKind.Long || kind == JavaKind.Object) { - r.register4("putOrdered" + kindName, Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.RELEASE_ACQUIRE)); + r.register4("putOrdered" + kindName, Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.RELEASE_ACQUIRE, explicitUnsafeNullChecks)); } } else { - r.register4("put" + kindName + "Release", Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.RELEASE_ACQUIRE)); - r.register3("get" + kindName + "Acquire", Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind, AccessKind.RELEASE_ACQUIRE)); - r.register4("put" + kindName + "Opaque", Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.OPAQUE)); - r.register3("get" + kindName + "Opaque", Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind, AccessKind.OPAQUE)); + r.register4("put" + kindName + "Release", Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.RELEASE_ACQUIRE, explicitUnsafeNullChecks)); + r.register3("get" + kindName + "Acquire", Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind, AccessKind.RELEASE_ACQUIRE, explicitUnsafeNullChecks)); + r.register4("put" + kindName + "Opaque", Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, AccessKind.OPAQUE, explicitUnsafeNullChecks)); + r.register3("get" + kindName + "Opaque", Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind, AccessKind.OPAQUE, explicitUnsafeNullChecks)); } if (kind != JavaKind.Boolean && kind != JavaKind.Object) { // Raw accesses to memory addresses - r.register2(getName, Receiver.class, long.class, new UnsafeGetPlugin(kind)); - r.register3(putName, Receiver.class, long.class, kind.toJavaClass(), new UnsafePutPlugin(kind)); + r.register2(getName, Receiver.class, long.class, new UnsafeGetPlugin(kind, explicitUnsafeNullChecks)); + r.register3(putName, Receiver.class, long.class, kind.toJavaClass(), new UnsafePutPlugin(kind, explicitUnsafeNullChecks)); } } } // Accesses to native memory addresses. - r.register2("getAddress", Receiver.class, long.class, new UnsafeGetPlugin(JavaKind.Long)); - r.register3("putAddress", Receiver.class, long.class, long.class, new UnsafePutPlugin(JavaKind.Long)); + r.register2("getAddress", Receiver.class, long.class, new UnsafeGetPlugin(JavaKind.Long, explicitUnsafeNullChecks)); + r.register3("putAddress", Receiver.class, long.class, long.class, new UnsafePutPlugin(JavaKind.Long, explicitUnsafeNullChecks)); r.register2("allocateInstance", Receiver.class, Class.class, new InvocationPlugin() { @@ -764,17 +774,90 @@ } } - public static class UnsafeGetPlugin implements InvocationPlugin { + /** + * Unsafe access relative to null object is an access to off-heap memory. As linear pointer + * compression uses non-zero null, here null object must be replaced with zero constant. + */ + public abstract static class UnsafeAccessPlugin implements InvocationPlugin { + @FunctionalInterface + public interface UnsafeNodeConstructor { + FixedWithNextNode create(ValueNode value, LocationIdentity location); + } + + protected final JavaKind unsafeAccessKind; + private final boolean explicitUnsafeNullChecks; + + public UnsafeAccessPlugin(JavaKind kind, boolean explicitUnsafeNullChecks) { + unsafeAccessKind = kind; + this.explicitUnsafeNullChecks = explicitUnsafeNullChecks; + } + + private static FixedWithNextNode createObjectAccessNode(ValueNode value, UnsafeNodeConstructor nodeConstructor) { + return nodeConstructor.create(value, LocationIdentity.ANY_LOCATION); + } + + private static FixedWithNextNode createMemoryAccessNode(StructuredGraph graph, UnsafeNodeConstructor nodeConstructor) { + return nodeConstructor.create(ConstantNode.forLong(0L, graph), OFF_HEAP_LOCATION); + } + + private static boolean isLoad(ValueNode node) { + return node.getStackKind() != JavaKind.Void; + } + + private void setResult(ValueNode node, GraphBuilderContext b) { + if (isLoad(node)) { + b.addPush(unsafeAccessKind, node); + } else { + b.add(node); + } + } + + protected final void createUnsafeAccess(ValueNode value, GraphBuilderContext b, UnsafeNodeConstructor nodeConstructor) { + StructuredGraph graph = b.getGraph(); + graph.markUnsafeAccess(); + /* For unsafe access object pointers can only be stored in the heap */ + if (unsafeAccessKind == JavaKind.Object) { + setResult(createObjectAccessNode(value, nodeConstructor), b); + } else if (StampTool.isPointerAlwaysNull(value)) { + setResult(createMemoryAccessNode(graph, nodeConstructor), b); + } else if (!explicitUnsafeNullChecks || StampTool.isPointerNonNull(value)) { + setResult(createObjectAccessNode(value, nodeConstructor), b); + } else { + FixedWithNextNode objectAccess = graph.add(createObjectAccessNode(value, nodeConstructor)); + FixedWithNextNode memoryAccess = graph.add(createMemoryAccessNode(graph, nodeConstructor)); + FixedWithNextNode[] accessNodes = new FixedWithNextNode[]{objectAccess, memoryAccess}; + + LogicNode condition = graph.addOrUniqueWithInputs(IsNullNode.create(value)); + b.add(new IfNode(condition, memoryAccess, objectAccess, 0.5)); + + MergeNode merge = b.append(new MergeNode()); + for (FixedWithNextNode node : accessNodes) { + EndNode endNode = graph.add(new EndNode()); + node.setNext(endNode); + if (node instanceof StateSplit) { + b.setStateAfter((StateSplit) node); + } + merge.addForwardEnd(endNode); + } + + if (isLoad(objectAccess)) { + ValuePhiNode phi = new ValuePhiNode(objectAccess.stamp(NodeView.DEFAULT), merge, accessNodes); + b.push(unsafeAccessKind, graph.addOrUnique(phi)); + } + b.setStateAfter(merge); + } + } + } - private final JavaKind returnKind; + public static class UnsafeGetPlugin extends UnsafeAccessPlugin { private final AccessKind accessKind; - public UnsafeGetPlugin(JavaKind returnKind) { - this(returnKind, AccessKind.PLAIN); + public UnsafeGetPlugin(JavaKind returnKind, boolean explicitUnsafeNullChecks) { + this(returnKind, AccessKind.PLAIN, explicitUnsafeNullChecks); } - public UnsafeGetPlugin(JavaKind returnKind, AccessKind accessKind) { - this.returnKind = returnKind; + public UnsafeGetPlugin(JavaKind kind, AccessKind accessKind, boolean explicitUnsafeNullChecks) { + super(kind, explicitUnsafeNullChecks); this.accessKind = accessKind; } @@ -782,7 +865,7 @@ public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode address) { // Emits a null-check for the otherwise unused receiver unsafe.get(); - b.addPush(returnKind, new UnsafeMemoryLoadNode(address, returnKind, OFF_HEAP_LOCATION)); + b.addPush(unsafeAccessKind, new UnsafeMemoryLoadNode(address, unsafeAccessKind, OFF_HEAP_LOCATION)); b.getGraph().markUnsafeAccess(); return true; } @@ -794,27 +877,23 @@ if (accessKind.emitBarriers) { b.add(new MembarNode(accessKind.preReadBarriers)); } - LocationIdentity locationIdentity = object.isNullConstant() ? OFF_HEAP_LOCATION : LocationIdentity.any(); - b.addPush(returnKind, new RawLoadNode(object, offset, returnKind, locationIdentity)); + createUnsafeAccess(object, b, (obj, loc) -> new RawLoadNode(obj, offset, unsafeAccessKind, loc)); if (accessKind.emitBarriers) { b.add(new MembarNode(accessKind.postReadBarriers)); } - b.getGraph().markUnsafeAccess(); return true; } } - public static class UnsafePutPlugin implements InvocationPlugin { - private final JavaKind kind; + public static class UnsafePutPlugin extends UnsafeAccessPlugin { private final AccessKind accessKind; - public UnsafePutPlugin(JavaKind kind) { - this(kind, AccessKind.PLAIN); + public UnsafePutPlugin(JavaKind kind, boolean explicitUnsafeNullChecks) { + this(kind, AccessKind.PLAIN, explicitUnsafeNullChecks); } - private UnsafePutPlugin(JavaKind kind, AccessKind accessKind) { - super(); - this.kind = kind; + private UnsafePutPlugin(JavaKind kind, AccessKind accessKind, boolean explicitUnsafeNullChecks) { + super(kind, explicitUnsafeNullChecks); this.accessKind = accessKind; } @@ -823,7 +902,7 @@ assert !accessKind.emitBarriers : "Barriers for address based Unsafe put is not supported."; // Emits a null-check for the otherwise unused receiver unsafe.get(); - b.add(new UnsafeMemoryStoreNode(address, value, kind, OFF_HEAP_LOCATION)); + b.add(new UnsafeMemoryStoreNode(address, value, unsafeAccessKind, OFF_HEAP_LOCATION)); b.getGraph().markUnsafeAccess(); return true; } @@ -835,12 +914,11 @@ if (accessKind.emitBarriers) { b.add(new MembarNode(accessKind.preWriteBarriers)); } - LocationIdentity locationIdentity = object.isNullConstant() ? OFF_HEAP_LOCATION : LocationIdentity.any(); - b.add(new RawStoreNode(object, offset, b.maskSubWordValue(value, kind), kind, locationIdentity)); + ValueNode maskedValue = b.maskSubWordValue(value, unsafeAccessKind); + createUnsafeAccess(object, b, (obj, loc) -> new RawStoreNode(obj, offset, maskedValue, unsafeAccessKind, loc)); if (accessKind.emitBarriers) { b.add(new MembarNode(accessKind.postWriteBarriers)); } - b.getGraph().markUnsafeAccess(); return true; } } @@ -904,11 +982,11 @@ GraalError.guarantee(b.getGraph().getSpeculationLog() != null, "A speculation log is need to use `deoptimizeAndInvalidateWithSpeculation`"); BytecodePosition pos = new BytecodePosition(null, b.getMethod(), b.bci()); DirectiveSpeculationReason reason = new DirectiveSpeculationReason(pos); - JavaConstant speculation; + Speculation speculation; if (b.getGraph().getSpeculationLog().maySpeculate(reason)) { speculation = b.getGraph().getSpeculationLog().speculate(reason); } else { - speculation = JavaConstant.defaultForKind(JavaKind.Object); + speculation = SpeculationLog.NO_SPECULATION; } b.add(new DeoptimizeNode(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.TransferToInterpreter, speculation)); return true; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringIndexOfNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringIndexOfNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringIndexOfNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringIndexOfNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_256; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/StringSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/UnsafeAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/UnsafeAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/UnsafeAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements/src/org/graalvm/compiler/replacements/UnsafeAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountLeadingZerosNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.aarch64; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountTrailingZerosNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountTrailingZerosNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountTrailingZerosNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64CountTrailingZerosNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.aarch64; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64FloatArithmeticSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.replacements.aarch64; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_IGNORED; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64GraphBuilderPlugins.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,8 +20,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.aarch64; +import static org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.registerPlatformSpecificUnsafePlugins; import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.COS; import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.EXP; import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.LOG; @@ -44,7 +47,6 @@ import org.graalvm.compiler.nodes.java.AtomicReadAndWriteNode; import org.graalvm.compiler.nodes.memory.address.AddressNode; import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; -import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins; import org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode; import org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode; import org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation; @@ -56,7 +58,7 @@ public class AArch64GraphBuilderPlugins { - public static void register(Plugins plugins, BytecodeProvider bytecodeProvider) { + public static void register(Plugins plugins, BytecodeProvider bytecodeProvider, boolean explicitUnsafeNullChecks) { InvocationPlugins invocationPlugins = plugins.getInvocationPlugins(); invocationPlugins.defer(new Runnable() { @Override @@ -69,7 +71,7 @@ registerUnsafePlugins(invocationPlugins, bytecodeProvider); // This is temporarily disabled until we implement correct emitting of the CAS // instructions of the proper width. - StandardGraphBuilderPlugins.registerPlatformSpecificUnsafePlugins(invocationPlugins, bytecodeProvider, + registerPlatformSpecificUnsafePlugins(invocationPlugins, bytecodeProvider, explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object}); } }); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerArithmeticSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,8 @@ * questions. */ + + package org.graalvm.compiler.replacements.aarch64; import org.graalvm.compiler.api.replacements.Snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64IntegerSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.aarch64; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64LongSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.aarch64; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64RoundNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64RoundNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64RoundNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64RoundNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.compiler.replacements.aarch64; import jdk.vm.ci.meta.JavaConstant; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64StringLatin1Substitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64StringLatin1Substitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64StringLatin1Substitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64StringLatin1Substitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.aarch64; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64StringUTF16Substitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64StringUTF16Substitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64StringUTF16Substitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.aarch64/src/org/graalvm/compiler/replacements/aarch64/AArch64StringUTF16Substitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.aarch64; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64ConvertSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import static org.graalvm.compiler.nodes.extended.BranchProbabilityNode.SLOW_PATH_PROBABILITY; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountLeadingZerosNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64CountTrailingZerosNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_2; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64FloatConvertNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_8; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64GraphBuilderPlugins.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,8 +20,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; +import static org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.registerPlatformSpecificUnsafePlugins; import static org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode.BinaryOperation.POW; import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.COS; import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.EXP; @@ -45,12 +48,11 @@ import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; import org.graalvm.compiler.nodes.java.AtomicReadAndAddNode; import org.graalvm.compiler.nodes.java.AtomicReadAndWriteNode; -import org.graalvm.compiler.nodes.memory.address.AddressNode; import org.graalvm.compiler.nodes.memory.address.OffsetAddressNode; import org.graalvm.compiler.replacements.ArraysSubstitutions; import org.graalvm.compiler.replacements.IntegerSubstitutions; import org.graalvm.compiler.replacements.LongSubstitutions; -import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins; +import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.UnsafeAccessPlugin; import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.UnsafeGetPlugin; import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.UnsafePutPlugin; import org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode; @@ -58,7 +60,6 @@ import org.graalvm.compiler.replacements.nodes.BitCountNode; import org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode; import org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation; -import jdk.internal.vm.compiler.word.LocationIdentity; import jdk.vm.ci.amd64.AMD64; import jdk.vm.ci.amd64.AMD64.CPUFeature; @@ -68,16 +69,16 @@ public class AMD64GraphBuilderPlugins { - public static void register(Plugins plugins, BytecodeProvider replacementsBytecodeProvider, AMD64 arch, boolean arithmeticStubs) { + public static void register(Plugins plugins, BytecodeProvider replacementsBytecodeProvider, AMD64 arch, boolean arithmeticStubs, boolean explicitUnsafeNullChecks) { InvocationPlugins invocationPlugins = plugins.getInvocationPlugins(); invocationPlugins.defer(new Runnable() { @Override public void run() { registerIntegerLongPlugins(invocationPlugins, IntegerSubstitutions.class, JavaKind.Int, arch, replacementsBytecodeProvider); registerIntegerLongPlugins(invocationPlugins, LongSubstitutions.class, JavaKind.Long, arch, replacementsBytecodeProvider); - StandardGraphBuilderPlugins.registerPlatformSpecificUnsafePlugins(invocationPlugins, replacementsBytecodeProvider, + registerPlatformSpecificUnsafePlugins(invocationPlugins, replacementsBytecodeProvider, explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object, JavaKind.Boolean, JavaKind.Byte, JavaKind.Short, JavaKind.Char, JavaKind.Float, JavaKind.Double}); - registerUnsafePlugins(invocationPlugins, replacementsBytecodeProvider); + registerUnsafePlugins(invocationPlugins, replacementsBytecodeProvider, explicitUnsafeNullChecks); registerStringPlugins(invocationPlugins, arch, replacementsBytecodeProvider); registerStringLatin1Plugins(invocationPlugins, replacementsBytecodeProvider); registerStringUTF16Plugins(invocationPlugins, replacementsBytecodeProvider); @@ -219,37 +220,34 @@ } } - private static void registerUnsafePlugins(InvocationPlugins plugins, BytecodeProvider replacementsBytecodeProvider) { - registerUnsafePlugins(new Registration(plugins, Unsafe.class), new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object}); + private static void registerUnsafePlugins(InvocationPlugins plugins, BytecodeProvider replacementsBytecodeProvider, boolean explicitUnsafeNullChecks) { + registerUnsafePlugins(new Registration(plugins, Unsafe.class), explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object}); if (!Java8OrEarlier) { - registerUnsafePlugins(new Registration(plugins, "jdk.internal.misc.Unsafe", replacementsBytecodeProvider), + registerUnsafePlugins(new Registration(plugins, "jdk.internal.misc.Unsafe", replacementsBytecodeProvider), explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Boolean, JavaKind.Byte, JavaKind.Char, JavaKind.Short, JavaKind.Int, JavaKind.Long, JavaKind.Object}); } } - private static void registerUnsafePlugins(Registration r, JavaKind[] unsafeJavaKinds) { + private static void registerUnsafePlugins(Registration r, boolean explicitUnsafeNullChecks, JavaKind[] unsafeJavaKinds) { for (JavaKind kind : unsafeJavaKinds) { Class<?> javaClass = kind == JavaKind.Object ? Object.class : kind.toJavaClass(); - r.register4("getAndSet" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new InvocationPlugin() { + r.register4("getAndSet" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new UnsafeAccessPlugin(kind, explicitUnsafeNullChecks) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode object, ValueNode offset, ValueNode value) { // Emits a null-check for the otherwise unused receiver unsafe.get(); - b.addPush(kind, new AtomicReadAndWriteNode(object, offset, value, kind, LocationIdentity.any())); - b.getGraph().markUnsafeAccess(); + createUnsafeAccess(object, b, (obj, loc) -> new AtomicReadAndWriteNode(obj, offset, value, kind, loc)); return true; } }); if (kind != JavaKind.Boolean && kind.isNumericInteger()) { - r.register4("getAndAdd" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new InvocationPlugin() { + r.register4("getAndAdd" + kind.name(), Receiver.class, Object.class, long.class, javaClass, new UnsafeAccessPlugin(kind, explicitUnsafeNullChecks) { @Override public boolean apply(GraphBuilderContext b, ResolvedJavaMethod targetMethod, Receiver unsafe, ValueNode object, ValueNode offset, ValueNode delta) { // Emits a null-check for the otherwise unused receiver unsafe.get(); - AddressNode address = b.add(new OffsetAddressNode(object, offset)); - b.addPush(kind, new AtomicReadAndAddNode(address, delta, kind, LocationIdentity.any())); - b.getGraph().markUnsafeAccess(); + createUnsafeAccess(object, b, (obj, loc) -> new AtomicReadAndAddNode(b.add(new OffsetAddressNode(obj, offset)), delta, kind, loc)); return true; } }); @@ -258,8 +256,8 @@ for (JavaKind kind : new JavaKind[]{JavaKind.Char, JavaKind.Short, JavaKind.Int, JavaKind.Long}) { Class<?> javaClass = kind.toJavaClass(); - r.registerOptional3("get" + kind.name() + "Unaligned", Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind)); - r.registerOptional4("put" + kind.name() + "Unaligned", Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind)); + r.registerOptional3("get" + kind.name() + "Unaligned", Receiver.class, Object.class, long.class, new UnsafeGetPlugin(kind, explicitUnsafeNullChecks)); + r.registerOptional4("put" + kind.name() + "Unaligned", Receiver.class, Object.class, long.class, javaClass, new UnsafePutPlugin(kind, explicitUnsafeNullChecks)); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64MathSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64RoundNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringIndexOfNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringIndexOfNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringIndexOfNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringIndexOfNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import static org.graalvm.compiler.nodeinfo.NodeSize.SIZE_64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringLatin1Substitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringLatin1Substitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringLatin1Substitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringLatin1Substitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringSubstitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringSubstitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringSubstitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringSubstitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringUTF16Substitutions.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringUTF16Substitutions.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringUTF16Substitutions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.amd64/src/org/graalvm/compiler/replacements/amd64/AMD64StringUTF16Substitutions.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.amd64; import org.graalvm.compiler.api.replacements.ClassSubstitution; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/UnsafeReplacementsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/UnsafeReplacementsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/UnsafeReplacementsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/UnsafeReplacementsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.jdk9; import jdk.vm.ci.aarch64.AArch64; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/VarHandleTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/VarHandleTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/VarHandleTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.jdk9.test/src/org/graalvm/compiler/replacements/jdk9/VarHandleTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.jdk9; import java.lang.invoke.MethodHandles; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/AnnotationHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/AnnotationHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/AnnotationHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/AnnotationHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import javax.lang.model.element.AnnotationMirror; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/APHotSpotSignature.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/APHotSpotSignature.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/APHotSpotSignature.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/APHotSpotSignature.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/ClassSubstitutionHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/ClassSubstitutionHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/ClassSubstitutionHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/ClassSubstitutionHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import static org.graalvm.compiler.processor.AbstractProcessor.getAnnotationValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/FoldHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/FoldHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/FoldHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/FoldHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import static org.graalvm.compiler.processor.AbstractProcessor.getSimpleName; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedFoldPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedFoldPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedFoldPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedFoldPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import static org.graalvm.compiler.replacements.processor.FoldHandler.FOLD_CLASS_NAME; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedNodeIntrinsicPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedNodeIntrinsicPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedNodeIntrinsicPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedNodeIntrinsicPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import static org.graalvm.compiler.replacements.processor.NodeIntrinsicHandler.CONSTANT_NODE_PARAMETER_CLASS_NAME; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/GeneratedPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import java.io.PrintWriter; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/InjectedDependencies.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/InjectedDependencies.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/InjectedDependencies.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/InjectedDependencies.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import static org.graalvm.compiler.processor.AbstractProcessor.getAnnotationValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/MethodSubstitutionHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/MethodSubstitutionHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/MethodSubstitutionHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/MethodSubstitutionHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import static org.graalvm.compiler.processor.AbstractProcessor.getAnnotationValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/NodeIntrinsicHandler.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/NodeIntrinsicHandler.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/NodeIntrinsicHandler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/NodeIntrinsicHandler.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import static org.graalvm.compiler.processor.AbstractProcessor.getAnnotationValue; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/PluginGenerator.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/PluginGenerator.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/PluginGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/PluginGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import java.io.IOException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/ReplacementsAnnotationProcessor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/ReplacementsAnnotationProcessor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/ReplacementsAnnotationProcessor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.processor/src/org/graalvm/compiler/replacements/processor/ReplacementsAnnotationProcessor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.processor; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.sparc/src/org/graalvm/compiler/replacements/sparc/SPARCGraphBuilderPlugins.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,8 +20,11 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.sparc; +import static org.graalvm.compiler.replacements.StandardGraphBuilderPlugins.registerPlatformSpecificUnsafePlugins; import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.COS; import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.EXP; import static org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode.UnaryOperation.LOG; @@ -38,7 +41,6 @@ import org.graalvm.compiler.nodes.graphbuilderconf.InvocationPlugins.Registration; import org.graalvm.compiler.replacements.IntegerSubstitutions; import org.graalvm.compiler.replacements.LongSubstitutions; -import org.graalvm.compiler.replacements.StandardGraphBuilderPlugins; import org.graalvm.compiler.replacements.nodes.BinaryMathIntrinsicNode; import org.graalvm.compiler.replacements.nodes.BitCountNode; import org.graalvm.compiler.replacements.nodes.UnaryMathIntrinsicNode; @@ -49,7 +51,7 @@ public class SPARCGraphBuilderPlugins { - public static void register(Plugins plugins, BytecodeProvider bytecodeProvider) { + public static void register(Plugins plugins, BytecodeProvider bytecodeProvider, boolean explicitUnsafeNullChecks) { InvocationPlugins invocationPlugins = plugins.getInvocationPlugins(); invocationPlugins.defer(new Runnable() { @Override @@ -59,7 +61,7 @@ registerMathPlugins(invocationPlugins); // This is temporarily disabled until we implement correct emitting of the CAS // instructions of the proper width. - StandardGraphBuilderPlugins.registerPlatformSpecificUnsafePlugins(invocationPlugins, bytecodeProvider, + registerPlatformSpecificUnsafePlugins(invocationPlugins, bytecodeProvider, explicitUnsafeNullChecks, new JavaKind[]{JavaKind.Int, JavaKind.Long, JavaKind.Object}); } }); diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArraysSubstitutionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ArrayStoreBytecodeExceptionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BitOpNodesTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.nodes.NodeView; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/BytecodeExceptionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ClassCastBytecodeExceptionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/ClassfileBytecodeProviderTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test.classfile; import static org.graalvm.compiler.bytecode.Bytecodes.ALOAD; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/classfile/RedefineIntrinsicTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test.classfile; import static org.graalvm.compiler.test.SubprocessUtil.getVMCommandLine; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledExceptionHandlerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.core.phases.HighTier; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/CompiledNullPointerExceptionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import static org.graalvm.compiler.nodes.graphbuilderconf.GraphBuilderConfiguration.BytecodeExceptionMode.CheckAll; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnExceptionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.Random; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnVolatileReadTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnVolatileReadTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnVolatileReadTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DeoptimizeOnVolatileReadTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DerivedOopTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.Objects; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/DynamicNewArrayTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/EdgesTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_0; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FloatArraysEqualsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FloatArraysEqualsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FloatArraysEqualsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FloatArraysEqualsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/FoldTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IndexOobBytecodeExceptionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfDynamicTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InstanceOfTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactFoldTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactFoldTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactFoldTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerExactFoldTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import static org.junit.Assert.assertNotNull; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/IntegerSubOverflowsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/InvokeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MethodSubstitutionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.lang.reflect.InvocationTargetException; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/MonitorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NestedExceptionHandlerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NestedExceptionHandlerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NestedExceptionHandlerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NestedExceptionHandlerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import static org.graalvm.compiler.core.common.GraalOptions.RemoveNeverExecutedCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewArrayTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewInstanceTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NewMultiArrayTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.lang.reflect.Array; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/NullBytecodeExceptionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ObjectAccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.api.replacements.Snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PEGraphDecoderTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import static org.graalvm.compiler.nodes.graphbuilderconf.InlineInvokePlugin.InlineInfo.createStandardInlineInfo; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.api.replacements.Snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/PointerTrackingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.api.directives.GraalDirectives; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsParseTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import static org.graalvm.compiler.java.BytecodeParserOptions.InlinePartialIntrinsicExitDuringParsing; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/ReplacementsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SnippetsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SnippetsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SnippetsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SnippetsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StandardMethodSubstitutionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompareToTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompareToTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompareToTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringCompareToTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringEqualsConstantTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringHashConstantTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.core.test.GraalCompilerTest; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfConstantTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfConstantTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfConstantTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfConstantTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringSubstitutionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.nodes.StructuredGraph; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SubstitutionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import static org.graalvm.compiler.nodeinfo.InputType.Guard; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SystemArrayCopyTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SystemArrayCopyTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SystemArrayCopyTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/SystemArrayCopyTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import jdk.vm.ci.code.InstalledCode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/TypeCheckTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.core.common.CompilationIdentifier; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeBooleanAccessTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeBooleanAccessTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeBooleanAccessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeBooleanAccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsafeSubstitutionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Assert; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedIntegerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnsignedMathTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/UnwindExceptionToCallerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.junit.Test; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/WordTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.replacements.test; import org.graalvm.compiler.api.replacements.Snippet; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.runtime/src/org/graalvm/compiler/runtime/RuntimeProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.runtime; import jdk.vm.ci.code.Architecture; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.serviceprovider; import static java.lang.Thread.currentThread; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/ServiceProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.serviceprovider; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider.processor/src/org/graalvm/compiler/serviceprovider/processor/ServiceProviderProcessor.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.serviceprovider.processor; import java.util.HashMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/AddExports.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/AddExports.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/AddExports.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/AddExports.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.test; import java.lang.annotation.ElementType; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/ExportingClassLoader.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.test; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/GraalTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.test; import static org.graalvm.compiler.debug.DebugContext.DEFAULT_LOG_STREAM; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/JLModule.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.test; import java.lang.reflect.AccessibleObject; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.test/src/org/graalvm/compiler/test/SubprocessUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.test; import java.io.BufferedReader; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/MaterializedObjectState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.nodes; import org.graalvm.compiler.graph.Node; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/nodes/VirtualObjectState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.nodes; import java.util.List; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EarlyReadEliminationPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import static org.graalvm.compiler.core.common.GraalOptions.EscapeAnalyzeOnly; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsBlockState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsClosure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/EffectsPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import static org.graalvm.compiler.phases.common.DeadCodeEliminationPhase.Optionality.Required; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/GraphEffectList.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ObjectState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeBlockState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapeClosure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PartialEscapePhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import static org.graalvm.compiler.core.common.GraalOptions.EscapeAnalysisIterations; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationBlockState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/PEReadEliminationClosure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import static org.graalvm.compiler.core.common.GraalOptions.ReadEliminationMaxLoopVisits; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationBlockState.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import java.util.Iterator; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/ReadEliminationClosure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import static org.graalvm.compiler.core.common.GraalOptions.ReadEliminationMaxLoopVisits; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualizerToolImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import static org.graalvm.compiler.core.common.GraalOptions.MaximumEscapeAnalysisArrayLength; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual/src/org/graalvm/compiler/virtual/phases/ea/VirtualUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.phases.ea; import static org.graalvm.compiler.core.common.GraalOptions.TraceEscapeAnalysis; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.virtual.bench/src/org/graalvm/compiler/virtual/bench/PartialEscapeBench.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.virtual.bench; import org.openjdk.jmh.annotations.Benchmark; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/BarrieredAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.word; import org.graalvm.compiler.word.Word.Opcode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/ObjectAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.word; import org.graalvm.compiler.word.Word.Opcode; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/UnsafeAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.word; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordCastNode.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordCastNode.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordCastNode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordCastNode.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.word; import static org.graalvm.compiler.nodeinfo.NodeCycles.CYCLES_1; @@ -27,6 +29,7 @@ import org.graalvm.compiler.core.common.LIRKind; import org.graalvm.compiler.core.common.type.AbstractPointerStamp; +import org.graalvm.compiler.core.common.type.IntegerStamp; import org.graalvm.compiler.core.common.type.ObjectStamp; import org.graalvm.compiler.core.common.type.Stamp; import org.graalvm.compiler.core.common.type.StampFactory; @@ -61,11 +64,11 @@ public static final NodeClass<WordCastNode> TYPE = NodeClass.create(WordCastNode.class); @Input ValueNode input; - public final boolean trackedPointer; + private final boolean trackedPointer; public static WordCastNode wordToObject(ValueNode input, JavaKind wordKind) { assert input.getStackKind() == wordKind; - return new WordCastNode(StampFactory.object(), input); + return new WordCastNode(objectStampFor(input), input); } public static WordCastNode wordToObjectNonNull(ValueNode input, JavaKind wordKind) { @@ -80,7 +83,7 @@ public static WordCastNode objectToTrackedPointer(ValueNode input, JavaKind wordKind) { assert input.stamp(NodeView.DEFAULT) instanceof ObjectStamp; - return new WordCastNode(StampFactory.forKind(wordKind), input, true); + return new WordCastNode(StampFactory.forKind(wordKind), input); } public static WordCastNode objectToUntrackedPointer(ValueNode input, JavaKind wordKind) { @@ -88,7 +91,7 @@ return new WordCastNode(StampFactory.forKind(wordKind), input, false); } - protected WordCastNode(Stamp stamp, ValueNode input) { + private WordCastNode(Stamp stamp, ValueNode input) { this(stamp, input, true); } @@ -102,6 +105,36 @@ return input; } + private static boolean isZeroConstant(ValueNode value) { + JavaConstant constant = value.asJavaConstant(); + return constant.getJavaKind().isNumericInteger() && constant.asLong() == 0; + } + + private static Stamp objectStampFor(ValueNode input) { + Stamp inputStamp = input.stamp(NodeView.DEFAULT); + if (inputStamp instanceof AbstractPointerStamp) { + AbstractPointerStamp pointerStamp = (AbstractPointerStamp) inputStamp; + if (pointerStamp.alwaysNull()) { + return StampFactory.alwaysNull(); + } else if (pointerStamp.nonNull()) { + return StampFactory.objectNonNull(); + } + } else if (inputStamp instanceof IntegerStamp && !((IntegerStamp) inputStamp).contains(0)) { + return StampFactory.objectNonNull(); + } else if (input.isConstant() && isZeroConstant(input)) { + return StampFactory.alwaysNull(); + } + return StampFactory.object(); + } + + @Override + public boolean inferStamp() { + if (stamp.equals(StampFactory.object())) { + return updateStamp(objectStampFor(input)); + } + return false; + } + @Override public Node canonical(CanonicalizerTool tool) { if (tool.allUsagesAvailable() && hasNoUsages()) { @@ -114,7 +147,7 @@ /* Null pointers are uncritical for GC, so they can be constant folded. */ if (input.asJavaConstant().isNull()) { return ConstantNode.forIntegerStamp(stamp(NodeView.DEFAULT), 0); - } else if (input.asJavaConstant().getJavaKind().isNumericInteger() && input.asJavaConstant().asLong() == 0) { + } else if (isZeroConstant(input)) { return ConstantNode.forConstant(stamp(NodeView.DEFAULT), JavaConstant.NULL_POINTER, tool.getMetaAccess()); } } @@ -137,7 +170,13 @@ generator.setResult(this, value); } else { AllocatableValue result = generator.getLIRGeneratorTool().newVariable(kind); - generator.getLIRGeneratorTool().emitMove(result, value); + if (stamp.equals(StampFactory.object())) { + generator.getLIRGeneratorTool().emitConvertZeroToNull(result, value); + } else if (!trackedPointer && !((ObjectStamp) input.stamp(NodeView.DEFAULT)).nonNull()) { + generator.getLIRGeneratorTool().emitConvertNullToZero(result, value); + } else { + generator.getLIRGeneratorTool().emitMove(result, value); + } generator.setResult(this, result); } } diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/Word.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.word; import static org.graalvm.compiler.word.UnsafeAccess.UNSAFE; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordOperationPlugin.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordOperationPlugin.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordOperationPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordOperationPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.word; import static org.graalvm.compiler.nodes.ConstantNode.forInt; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.word/src/org/graalvm/compiler/word/WordTypes.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.word; import org.graalvm.compiler.core.common.type.Stamp; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/DefaultGraphBlocks.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/DefaultGraphBlocks.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/DefaultGraphBlocks.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/DefaultGraphBlocks.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; import java.util.Collection; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/DefaultGraphTypes.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/DefaultGraphTypes.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/DefaultGraphTypes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/DefaultGraphTypes.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; final class DefaultGraphTypes implements GraphTypes { diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphBlocks.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphBlocks.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphBlocks.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphBlocks.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; import java.util.Collection; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphElements.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphElements.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphElements.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphElements.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphJavadocSnippets.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphJavadocSnippets.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphJavadocSnippets.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphJavadocSnippets.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,6 +21,8 @@ * questions. */ + + package org.graalvm.graphio; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphLocations.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphLocations.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphLocations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphLocations.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; import java.net.URI; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphOutput.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphOutput.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphOutput.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphOutput.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; import java.io.Closeable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphProtocol.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphProtocol.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphProtocol.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphProtocol.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; import java.io.Closeable; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphStructure.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphStructure.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphStructure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphStructure.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; import java.util.Collection; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphTypes.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphTypes.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphTypes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/GraphTypes.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; /** diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -82,4 +82,6 @@ * interfaces you pass into the builder. By combining these interfaces together you can get as rich, * colorful, source linked graphs as Graal compiler produces to describe its optimizations. */ + + package org.graalvm.graphio; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/ProtocolImpl.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/ProtocolImpl.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/ProtocolImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.graphio/src/org/graalvm/graphio/ProtocolImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.graphio; import java.io.File; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ArrayDuplicationBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import java.util.Arrays; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ArrayListBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ArrayListBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ArrayListBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ArrayListBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/BenchmarkBase.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/BenchmarkBase.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/BenchmarkBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/BenchmarkBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import org.openjdk.jmh.annotations.Fork; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/BoxingBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/BoxingBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/BoxingBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/BoxingBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import org.openjdk.jmh.annotations.Benchmark; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ConcurrentSkipListBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ConcurrentSkipListBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ConcurrentSkipListBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/ConcurrentSkipListBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import java.util.concurrent.ConcurrentSkipListMap; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/GuardedIntrinsicBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import org.openjdk.jmh.annotations.Benchmark; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/HashBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/HashBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/HashBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/HashBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import org.openjdk.jmh.annotations.Benchmark; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/MathFunctionBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/MathFunctionBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/MathFunctionBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/MathFunctionBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import java.util.Random; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,4 +24,6 @@ * This package contains micro benchmarks outside the org.graalvm.compiler namespace so that they * will be subject to Graal compilation even if {@code -Dgraal.CompileGraalWithC1Only=true}. */ + + package micro.benchmarks; \ No newline at end of file diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/SimpleSyncBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import org.openjdk.jmh.annotations.Benchmark; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/StringBenchmark.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/StringBenchmark.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/StringBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/StringBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import java.util.concurrent.TimeUnit; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/TestJMHBlackbox.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/TestJMHBlackbox.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/TestJMHBlackbox.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.micro.benchmarks/src/micro/benchmarks/TestJMHBlackbox.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package micro.benchmarks; import org.openjdk.jmh.annotations.Benchmark; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util/src/org/graalvm/util/CollectionsUtil.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util/src/org/graalvm/util/CollectionsUtil.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util/src/org/graalvm/util/CollectionsUtil.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util/src/org/graalvm/util/CollectionsUtil.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.util; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util/src/org/graalvm/util/ObjectSizeEstimate.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util/src/org/graalvm/util/ObjectSizeEstimate.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util/src/org/graalvm/util/ObjectSizeEstimate.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util/src/org/graalvm/util/ObjectSizeEstimate.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.util; import java.lang.reflect.Field; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionSizeTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionSizeTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionSizeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionSizeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.util.test; import static org.junit.Assert.assertEquals; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionUtilTest.java openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionUtilTest.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionUtilTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler/share/classes/org.graalvm.util.test/src/org/graalvm/util/test/CollectionUtilTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.util.test; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalManagement.java openjdk-11-11~24/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalManagement.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalManagement.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalManagement.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.management; import java.lang.management.ManagementFactory; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java openjdk-11-11~24/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/HotSpotGraalRuntimeMBean.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.management; import java.util.ArrayList; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/JMXServiceProvider.java openjdk-11-11~24/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/JMXServiceProvider.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/JMXServiceProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/JMXServiceProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -20,6 +20,8 @@ * or visit www.oracle.com if you need additional information or have any * questions. */ + + package org.graalvm.compiler.hotspot.management; import static java.lang.Thread.currentThread; diff -Nru openjdk-11-11~19/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/package-info.java openjdk-11-11~24/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/package-info.java --- openjdk-11-11~19/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/package-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.internal.vm.compiler.management/share/classes/org.graalvm.compiler.hotspot.management/src/org/graalvm/compiler/hotspot/management/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,4 +26,6 @@ * This cannot be used in JDK 10 where {@code jdk.internal.vm.compiler.management} is a * non-upgradeable module. */ + + package org.graalvm.compiler.hotspot.management; diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/Contents.java 2018-07-25 15:36:46.000000000 +0000 @@ -118,7 +118,6 @@ public final Content indexLabel; public final Content interfaceLabel; public final Content interfaces; - public final Content interfacesItalic; public final Content methodDetailLabel; public final Content methodLabel; public final Content methodSummary; @@ -157,9 +156,10 @@ public final Content properties; public final Content propertyLabel; public final Content propertyDetailsLabel; - public final Content propertySummary; + public final Content propertySummaryLabel; public final Content seeLabel; public final Content serializedForm; + public final Content servicesLabel; public final Content specifiedByLabel; public final Content subclassesLabel; public final Content subinterfacesLabel; @@ -245,7 +245,6 @@ indexLabel = getContent("doclet.Index"); interfaceLabel = getContent("doclet.Interface"); interfaces = getContent("doclet.Interfaces"); - interfacesItalic = getContent("doclet.Interfaces_Italic"); methodDetailLabel = getContent("doclet.Method_Detail"); methodSummary = getContent("doclet.Method_Summary"); methodLabel = getContent("doclet.Method"); @@ -284,9 +283,10 @@ properties = getContent("doclet.Properties"); propertyLabel = getContent("doclet.Property"); propertyDetailsLabel = getContent("doclet.Property_Detail"); - propertySummary = getContent("doclet.Property_Summary"); + propertySummaryLabel = getContent("doclet.Property_Summary"); seeLabel = getContent("doclet.See"); serializedForm = getContent("doclet.Serialized_Form"); + servicesLabel = getContent("doclet.Services"); specifiedByLabel = getContent("doclet.Specified_By"); subclassesLabel = getContent("doclet.Subclasses"); subinterfacesLabel = getContent("doclet.Subinterfaces"); diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java 2018-07-25 15:36:46.000000000 +0000 @@ -143,9 +143,13 @@ htmlTree = (configuration.allowTag(HtmlTag.SECTION)) ? HtmlTree.SECTION(overviewHeading) : HtmlTree.LI(HtmlStyle.blockList, overviewHeading); - Content overviewBody = contents.getContent("doclet.help.overview.body", - links.createLink(DocPaths.overviewSummary(configuration.frames), - resources.getText("doclet.Overview"))); + String overviewKey = configuration.showModules + ? "doclet.help.overview.modules.body" + : "doclet.help.overview.packages.body"; + Content overviewLink = links.createLink( + DocPaths.overviewSummary(configuration.frames), + resources.getText("doclet.Overview")); + Content overviewBody = contents.getContent(overviewKey, overviewLink); Content overviewPara = HtmlTree.P(overviewBody); htmlTree.addContent(overviewPara); if (configuration.allowTag(HtmlTag.SECTION)) { @@ -155,6 +159,29 @@ } } + // Module + if (configuration.showModules) { + Content moduleHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + contents.moduleLabel); + htmlTree = (configuration.allowTag(HtmlTag.SECTION)) + ? HtmlTree.SECTION(moduleHead) + : HtmlTree.LI(HtmlStyle.blockList, moduleHead); + Content moduleIntro = contents.getContent("doclet.help.module.intro"); + Content modulePara = HtmlTree.P(moduleIntro); + htmlTree.addContent(modulePara); + HtmlTree ulModule = new HtmlTree(HtmlTag.UL); + ulModule.addContent(HtmlTree.LI(contents.packagesLabel)); + ulModule.addContent(HtmlTree.LI(contents.modulesLabel)); + ulModule.addContent(HtmlTree.LI(contents.servicesLabel)); + htmlTree.addContent(ulModule); + if (configuration.allowTag(HtmlTag.SECTION)) { + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); + } else { + ul.addContent(htmlTree); + } + + } + // Package Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, contents.packageLabel); @@ -165,7 +192,7 @@ Content packagePara = HtmlTree.P(packageIntro); htmlTree.addContent(packagePara); HtmlTree ulPackage = new HtmlTree(HtmlTag.UL); - ulPackage.addContent(HtmlTree.LI(contents.interfacesItalic)); + ulPackage.addContent(HtmlTree.LI(contents.interfaces)); ulPackage.addContent(HtmlTree.LI(contents.classes)); ulPackage.addContent(HtmlTree.LI(contents.enums)); ulPackage.addContent(HtmlTree.LI(contents.exceptions)); @@ -195,14 +222,18 @@ ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.declaration"))); ul1.addContent(HtmlTree.LI(contents.getContent("doclet.help.class_interface.description"))); htmlTree.addContent(ul1); + htmlTree.addContent(new HtmlTree(HtmlTag.BR)); HtmlTree ul2 = new HtmlTree(HtmlTag.UL); ul2.addContent(HtmlTree.LI(contents.nestedClassSummary)); ul2.addContent(HtmlTree.LI(contents.fieldSummaryLabel)); + ul2.addContent(HtmlTree.LI(contents.propertySummaryLabel)); ul2.addContent(HtmlTree.LI(contents.constructorSummaryLabel)); ul2.addContent(HtmlTree.LI(contents.methodSummary)); htmlTree.addContent(ul2); + htmlTree.addContent(new HtmlTree(HtmlTag.BR)); HtmlTree ul3 = new HtmlTree(HtmlTag.UL); ul3.addContent(HtmlTree.LI(contents.fieldDetailsLabel)); + ul3.addContent(HtmlTree.LI(contents.propertyDetailsLabel)); ul3.addContent(HtmlTree.LI(contents.constructorDetailsLabel)); ul3.addContent(HtmlTree.LI(contents.methodDetailLabel)); htmlTree.addContent(ul3); @@ -342,21 +373,6 @@ } } - // Prev/Next - Content prevHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, - contents.getContent("doclet.help.prev_next.head")); - htmlTree = (configuration.allowTag(HtmlTag.SECTION)) - ? HtmlTree.SECTION(prevHead) - : HtmlTree.LI(HtmlStyle.blockList, prevHead); - Content prevBody = contents.getContent("doclet.help.prev_next.body"); - Content prevPara = HtmlTree.P(prevBody); - htmlTree.addContent(prevPara); - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); - } - // Frames if (configuration.frames) { Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, @@ -367,12 +383,12 @@ Content framesBody = contents.getContent("doclet.help.frames.body"); Content framePara = HtmlTree.P(framesBody); htmlTree.addContent(framePara); - } - if (configuration.allowTag(HtmlTag.SECTION)) { - ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); - } else { - ul.addContent(htmlTree); + if (configuration.allowTag(HtmlTag.SECTION)) { + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); + } else { + ul.addContent(htmlTree); + } } // All Classes @@ -424,10 +440,26 @@ ul.addContent(htmlTree); } + // Search + Content searchHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, + contents.getContent("doclet.help.search.head")); + htmlTree = (configuration.allowTag(HtmlTag.SECTION)) + ? HtmlTree.SECTION(searchHead) + : HtmlTree.LI(HtmlStyle.blockList, searchHead); + Content searchBody = contents.getContent("doclet.help.search.body"); + Content searchPara = HtmlTree.P(searchBody); + htmlTree.addContent(searchPara); + if (configuration.allowTag(HtmlTag.SECTION)) { + ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree)); + } else { + ul.addContent(htmlTree); + } + Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul); - Content line30 = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, + divContent.addContent(new HtmlTree(HtmlTag.HR)); + Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, contents.getContent("doclet.help.footnote")); - divContent.addContent(line30); + divContent.addContent(footnote); if (configuration.allowTag(HtmlTag.MAIN)) { mainTree.addContent(divContent); contentTree.addContent(mainTree); diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -232,15 +232,15 @@ */ public TypeElement currentTypeElement = null; // Set this TypeElement in the ClassWriter. - protected List<SearchIndexItem> memberSearchIndex = new ArrayList<>(); + protected SortedSet<SearchIndexItem> memberSearchIndex; - protected List<SearchIndexItem> moduleSearchIndex = new ArrayList<>(); + protected SortedSet<SearchIndexItem> moduleSearchIndex; - protected List<SearchIndexItem> packageSearchIndex = new ArrayList<>(); + protected SortedSet<SearchIndexItem> packageSearchIndex; - protected SortedSet<SearchIndexItem> tagSearchIndex = new TreeSet<>(makeSearchTagComparator()); + protected SortedSet<SearchIndexItem> tagSearchIndex; - protected List<SearchIndexItem> typeSearchIndex = new ArrayList<>(); + protected SortedSet<SearchIndexItem> typeSearchIndex; protected Map<Character,List<SearchIndexItem>> tagSearchIndexMap = new HashMap<>(); @@ -385,16 +385,6 @@ return htmlTag.allowTag(this.htmlVersion); } - public Comparator<SearchIndexItem> makeSearchTagComparator() { - return (SearchIndexItem sii1, SearchIndexItem sii2) -> { - int result = (sii1.getLabel()).compareTo(sii2.getLabel()); - if (result == 0) { - result = (sii1.getHolder()).compareTo(sii2.getHolder()); - } - return result; - }; - } - /** * Decide the page which will appear first in the right-hand frame. It will * be "overview-summary.html" if "-overview" option is used or no @@ -883,4 +873,14 @@ } return super.finishOptionSettings0(); } + + @Override + protected void initConfiguration(DocletEnvironment docEnv) { + super.initConfiguration(docEnv); + memberSearchIndex = new TreeSet<>(utils.makeGenericSearchIndexComparator()); + moduleSearchIndex = new TreeSet<>(utils.makeGenericSearchIndexComparator()); + packageSearchIndex = new TreeSet<>(utils.makeGenericSearchIndexComparator()); + tagSearchIndex = new TreeSet<>(utils.makeGenericSearchIndexComparator()); + typeSearchIndex = new TreeSet<>(utils.makeTypeSearchIndexComparator()); + } } diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/LinkFactoryImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,11 +25,13 @@ package jdk.javadoc.internal.doclets.formats.html; +import java.util.ArrayList; import java.util.List; import javax.lang.model.element.AnnotationMirror; import javax.lang.model.element.Element; import javax.lang.model.element.TypeElement; +import javax.lang.model.type.DeclaredType; import javax.lang.model.type.TypeMirror; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; @@ -131,6 +133,52 @@ * {@inheritDoc} */ @Override + protected Content getTypeParameterLinks(LinkInfo linkInfo, boolean isClassLabel){ + Content links = newContent(); + List<TypeMirror> vars = new ArrayList<>(); + TypeMirror ctype = linkInfo.type != null + ? utils.getComponentType(linkInfo.type) + : null; + if (linkInfo.executableElement != null) { + linkInfo.executableElement.getTypeParameters().stream().forEach((t) -> { + vars.add(t.asType()); + }); + } else if (linkInfo.type != null && utils.isDeclaredType(linkInfo.type)) { + ((DeclaredType)linkInfo.type).getTypeArguments().stream().forEach(vars::add); + } else if (ctype != null && utils.isDeclaredType(ctype)) { + ((DeclaredType)ctype).getTypeArguments().stream().forEach(vars::add); + } else if (linkInfo.typeElement != null) { + linkInfo.typeElement.getTypeParameters().stream().forEach((t) -> { + vars.add(t.asType()); + }); + } else { + // Nothing to document. + return links; + } + if (((linkInfo.includeTypeInClassLinkLabel && isClassLabel) + || (linkInfo.includeTypeAsSepLink && !isClassLabel)) && !vars.isEmpty()) { + links.addContent("<"); + boolean many = false; + for (TypeMirror t : vars) { + if (many) { + links.addContent(","); + links.addContent(Contents.ZERO_WIDTH_SPACE); + } + links.addContent(getTypeParameterLink(linkInfo, t)); + many = true; + } + links.addContent(">"); + } + return links; + } + + /** + * Returns a link to the given type parameter. + * + * @param linkInfo the information about the link to construct + * @param typeParam the type parameter to link to + * @return the link + */ protected Content getTypeParameterLink(LinkInfo linkInfo, TypeMirror typeParam) { LinkInfoImpl typeLinkInfo = new LinkInfoImpl(m_writer.configuration, ((LinkInfoImpl) linkInfo).getContext(), typeParam); diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java 2018-07-25 15:36:46.000000000 +0000 @@ -83,6 +83,7 @@ memberNameLabel, memberNameLink, memberSummary, + methodSignature, moduleLabelInPackage, moduleLabelInType, nameValue, diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -140,7 +140,8 @@ */ @Override public Content getSignature(ExecutableElement method) { - Content pre = new HtmlTree(HtmlTag.PRE); + HtmlTree pre = new HtmlTree(HtmlTag.PRE); + pre.setStyle(HtmlStyle.methodSignature); writer.addAnnotationInfo(method, pre); int annotationLength = pre.charCount(); addModifiers(method, pre); diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,7 +37,6 @@ import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; -import jdk.javadoc.internal.doclets.formats.html.markup.Navigation; import jdk.javadoc.internal.doclets.formats.html.markup.StringContent; import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter; @@ -206,7 +205,7 @@ @Override public void addSummaryLabel(Content memberTree) { Content label = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, - contents.propertySummary); + contents.propertySummaryLabel); memberTree.addContent(label); } diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/search.js 2018-07-25 15:36:46.000000000 +0000 @@ -24,7 +24,6 @@ */ var noResult = {l: "No results found"}; -var category = "category"; var catModules = "Modules"; var catPackages = "Packages"; var catTypes = "Types"; @@ -170,25 +169,7 @@ return e.l.substring(e.l.lastIndexOf(".") + 1); } - // Sort array items by short name (as opposed to fully qualified name). - // Additionally, sort by the nested type name, when present, - // as opposed to top level short name. - function sortAndConcatResults(a1, a2) { - var sortingKey; - var sortArray = function(e1, e2) { - var l = sortingKey(e1); - var m = sortingKey(e2); - if (l < m) - return -1; - if (l > m) - return 1; - return 0; - }; - sortingKey = function(e) { - return nestedName(e).toUpperCase(); - }; - a1.sort(sortArray); - a2.sort(sortArray); + function concatResults(a1, a2) { a1 = a1.concat(a2); a2.length = 0; return a1; @@ -197,85 +178,85 @@ if (moduleSearchIndex) { var mdleCount = 0; $.each(moduleSearchIndex, function(index, item) { - item[category] = catModules; + item.category = catModules; if (exactMatcher.test(item.l)) { - result.unshift(item); + result.push(item); mdleCount++; } else if (camelCaseMatcher.test(item.l)) { - result.unshift(item); + result.push(item); } else if (secondaryMatcher.test(item.l)) { secondaryresult.push(item); } }); displayCount = mdleCount; - result = sortAndConcatResults(result, secondaryresult); + result = concatResults(result, secondaryresult); } if (packageSearchIndex) { var pCount = 0; var pkg = ""; $.each(packageSearchIndex, function(index, item) { - item[category] = catPackages; + item.category = catPackages; pkg = (item.m) ? (item.m + "/" + item.l) : item.l; if (exactMatcher.test(item.l)) { - presult.unshift(item); + presult.push(item); pCount++; } else if (camelCaseMatcher.test(pkg)) { - presult.unshift(item); + presult.push(item); } else if (secondaryMatcher.test(pkg)) { secondaryresult.push(item); } }); - result = result.concat(sortAndConcatResults(presult, secondaryresult)); + result = result.concat(concatResults(presult, secondaryresult)); displayCount = (pCount > displayCount) ? pCount : displayCount; } if (typeSearchIndex) { var tCount = 0; $.each(typeSearchIndex, function(index, item) { - item[category] = catTypes; + item.category = catTypes; var s = nestedName(item); if (exactMatcher.test(s)) { - tresult.unshift(item); + tresult.push(item); tCount++; } else if (camelCaseMatcher.test(s)) { - tresult.unshift(item); + tresult.push(item); } else if (secondaryMatcher.test(item.p + "." + item.l)) { secondaryresult.push(item); } }); - result = result.concat(sortAndConcatResults(tresult, secondaryresult)); + result = result.concat(concatResults(tresult, secondaryresult)); displayCount = (tCount > displayCount) ? tCount : displayCount; } if (memberSearchIndex) { var mCount = 0; $.each(memberSearchIndex, function(index, item) { - item[category] = catMembers; + item.category = catMembers; var s = nestedName(item); if (exactMatcher.test(s)) { - mresult.unshift(item); + mresult.push(item); mCount++; } else if (camelCaseMatcher.test(s)) { - mresult.unshift(item); + mresult.push(item); } else if (secondaryMatcher.test(item.c + "." + item.l)) { secondaryresult.push(item); } }); - result = result.concat(sortAndConcatResults(mresult, secondaryresult)); + result = result.concat(concatResults(mresult, secondaryresult)); displayCount = (mCount > displayCount) ? mCount : displayCount; } if (tagSearchIndex) { var tgCount = 0; $.each(tagSearchIndex, function(index, item) { - item[category] = catSearchTags; + item.category = catSearchTags; if (exactMatcher.test(item.l)) { - tgresult.unshift(item); + tgresult.push(item); tgCount++; } else if (secondaryMatcher.test(item.l)) { secondaryresult.push(item); } }); - result = result.concat(sortAndConcatResults(tgresult, secondaryresult)); + result = result.concat(concatResults(tgresult, secondaryresult)); displayCount = (tgCount > displayCount) ? tgCount : displayCount; } displayCount = (displayCount > 500) ? displayCount : 500; diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/standard.properties 2018-07-25 15:36:46.000000000 +0000 @@ -92,7 +92,7 @@ doclet.Description_From_Interface=Description copied from interface: doclet.Description_From_Class=Description copied from class: doclet.No_Non_Deprecated_Classes_To_Document=No non-deprecated classes found to document. -doclet.Interfaces_Italic=Interfaces (italic) +doclet.Interfaces=Interfaces doclet.Enclosing_Class=Enclosing class: doclet.Enclosing_Interface=Enclosing interface: doclet.Window_Source_title=Source code @@ -103,20 +103,26 @@ doclet.help.intro=\ This API (Application Programming Interface) document has pages corresponding to the items in \ the navigation bar, described as follows. -doclet.help.overview.body=\ +doclet.help.overview.modules.body=\ + The {0} page is the front page of this API document and provides a list of all modules with a \ + summary for each. This page can also contain an overall description of the set of modules. +doclet.help.overview.packages.body=\ The {0} page is the front page of this API document and provides a list of all packages with a \ summary for each. This page can also contain an overall description of the set of packages. doclet.help.package.intro=\ Each package has a page that contains a list of its classes and interfaces, with a summary for \ - each. This page can contain six categories: + each. These pages may contain six categories: +doclet.help.module.intro=\ + Each module has a page that contains a list of its packages, dependencies on other modules, \ + and services, with a summary for each. These page may contain three categories: doclet.help.class_interface.head=\ - Class/Interface + Class or Interface doclet.help.class_interface.intro=\ Each class, interface, nested class and nested interface has its own separate page. Each of \ these pages has three sections consisting of a class/interface description, summary tables, \ and detailed member descriptions: doclet.help.class_interface.inheritance_diagram=\ - Class inheritance diagram + Class Inheritance Diagram doclet.help.class_interface.subclasses=\ Direct Subclasses doclet.help.class_interface.subinterfaces=\ @@ -124,9 +130,9 @@ doclet.help.class_interface.implementations=\ All Known Implementing Classes doclet.help.class_interface.declaration=\ - Class/interface declaration + Class or Interface Declaration doclet.help.class_interface.description=\ - Class/interface description + Class or Interface Description doclet.help.class_interface.summary=\ Each summary entry contains the first sentence from the detailed description for that item. \ The summary entries are alphabetical, while the detailed descriptions are in the order they \ @@ -136,7 +142,7 @@ doclet.help.use.body=\ Each documented package, class and interface has its own Use page. This page describes what \ packages, classes, methods, constructors and fields use any part of the given class or \ - package. Given a class or interface A, its Use page includes subclasses of A, fields declared \ + package. Given a class or interface A, its "Use" page includes subclasses of A, fields declared \ as A, methods that return A, and methods and constructors with parameters of type A. \ You can access this page by first going to the package, class or interface, then clicking on \ the "Use" link in the navigation bar. @@ -144,12 +150,12 @@ Tree (Class Hierarchy) doclet.help.tree.intro=\ There is a {0} page for all packages, plus a hierarchy for each package. Each hierarchy page \ - contains a list of classes and a list of interfaces. The classes are organized by inheritance \ - structure starting with {1}. The interfaces do not inherit from {1}. + contains a list of classes and a list of interfaces. Classes are organized by inheritance \ + structure starting with {1}. Interfaces do not inherit from {1}. doclet.help.tree.overview=\ When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages. doclet.help.tree.package=\ - When viewing a particular package, class or interface page, clicking "Tree" displays the \ + When viewing a particular package, class or interface page, clicking on "Tree" displays the \ hierarchy for only that package. doclet.help.deprecated.body=\ The {0} page lists all of the API that have been deprecated. A deprecated API is not \ @@ -158,12 +164,8 @@ doclet.help.index.head=\ Index doclet.help.index.body=\ - The {0} contains an alphabetic list of all classes, interfaces, constructors, methods, \ - and fields. -doclet.help.prev_next.head=\ - Prev/Next -doclet.help.prev_next.body=\ - These links take you to the next or previous class, interface, package, or related page. + The {0} contains an alphabetic index of all classes, interfaces, constructors, methods, \ + and fields, as well as lists of all packages and all classes. doclet.help.frames.head=\ Frames/No Frames doclet.help.frames.body=\ @@ -179,19 +181,23 @@ doclet.help.constants.body=\ The {0} page lists the static final fields and their values. doclet.help.footnote=\ - This help file applies to API documentation generated using the standard doclet. + This help file applies to API documentation generated by the standard doclet. doclet.help.enum.intro=\ Each enum has its own separate page with the following sections: doclet.help.enum.declaration=\ - Enum declaration + Enum Declaration doclet.help.enum.definition=\ - Enum description + Enum Description doclet.help.annotation_type.intro=\ Each annotation type has its own separate page with the following sections: doclet.help.annotation_type.declaration=\ - Annotation Type declaration + Annotation Type Declaration doclet.help.annotation_type.description=\ - Annotation Type description + Annotation Type Description +doclet.help.search.head=Search +doclet.help.search.body=You can search for definitions of modules, packages, types, fields, methods \ + and other terms defined in the API, using some or all of the name. "Camel-case" abbreviations \ + are supported: for example, "InpStr" will find "InputStream" and "InputStreamReader". doclet.ClassUse_Packages.that.use.0=Packages that use {0} doclet.ClassUse_Uses.of.0.in.1=Uses of {0} in {1} diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SearchIndexItem.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SearchIndexItem.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SearchIndexItem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SearchIndexItem.java 2018-07-25 15:36:46.000000000 +0000 @@ -139,4 +139,13 @@ } return item.toString(); } + + /** + * Get the part of the label after the last dot, or whole label if no dots. + * + * @return the simple name + */ + public String getSimpleName() { + return label.substring(label.lastIndexOf('.') + 1); + } } diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/doclets.properties 2018-07-25 15:36:46.000000000 +0000 @@ -75,6 +75,7 @@ doclet.See_Also=See Also: doclet.See=See: doclet.SerialData=Serial Data: +doclet.Services=Services doclet.Since=Since: doclet.Throws=Throws: doclet.Version=Version: @@ -117,7 +118,6 @@ doclet.Exceptions=Exceptions doclet.Errors=Errors doclet.Classes=Classes -doclet.Packages=Packages doclet.packages=packages doclet.modules=modules doclet.types=types diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css 2018-07-25 15:36:46.000000000 +0000 @@ -566,7 +566,6 @@ padding:8px 3px 3px 7px; } td.colFirst, th.colFirst { - white-space:nowrap; font-size:13px; } td.colSecond, th.colSecond, td.colLast, th.colConstructorName, th.colDeprecatedItemName, th.colLast { @@ -823,6 +822,9 @@ margin: -100px 0 0 100px; z-index: 1; } +.methodSignature { + white-space:normal; +} /* * Styles for user-provided tables. diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkFactory.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkFactory.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/links/LinkFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,6 @@ package jdk.javadoc.internal.doclets.toolkit.util.links; -import java.util.ArrayList; import java.util.List; import javax.lang.model.element.Element; @@ -218,13 +217,14 @@ protected abstract Content getClassLink(LinkInfo linkInfo); /** - * Returns a link to the given type parameter. + * Returns links to the type parameters. * * @param linkInfo the information about the link to construct - * @param typeParam the type parameter to link to - * @return the link + * @param isClassLabel true if this is a class label, or false if it is + * the type parameters portion of the link + * @return the links to the type parameters */ - protected abstract Content getTypeParameterLink(LinkInfo linkInfo, TypeMirror typeParam); + protected abstract Content getTypeParameterLinks(LinkInfo linkInfo, boolean isClassLabel); /** * Returns links to the type parameters. @@ -236,51 +236,5 @@ return getTypeParameterLinks(linkInfo, true); } - /** - * Returns links to the type parameters. - * - * @param linkInfo the information about the link to construct - * @param isClassLabel true if this is a class label, or false if it is - * the type parameters portion of the link - * @return the links to the type parameters - */ - public Content getTypeParameterLinks(LinkInfo linkInfo, boolean isClassLabel) { - Content links = newContent(); - List<TypeMirror> vars = new ArrayList<>(); - TypeMirror ctype = linkInfo.type != null - ? utils.getComponentType(linkInfo.type) - : null; - if (linkInfo.executableElement != null) { - linkInfo.executableElement.getTypeParameters().stream().forEach((t) -> { - vars.add(t.asType()); - }); - } else if (linkInfo.type != null && utils.isDeclaredType(linkInfo.type)) { - ((DeclaredType)linkInfo.type).getTypeArguments().stream().forEach(vars::add); - } else if (ctype != null && utils.isDeclaredType(ctype)) { - ((DeclaredType)ctype).getTypeArguments().stream().forEach(vars::add); - } else if (linkInfo.typeElement != null) { - linkInfo.typeElement.getTypeParameters().stream().forEach((t) -> { - vars.add(t.asType()); - }); - } else { - // Nothing to document. - return links; - } - if (((linkInfo.includeTypeInClassLinkLabel && isClassLabel) - || (linkInfo.includeTypeAsSepLink && !isClassLabel)) && !vars.isEmpty()) { - links.addContent("<"); - boolean many = false; - for (TypeMirror t : vars) { - if (many) { - links.addContent(","); - } - links.addContent(getTypeParameterLink(linkInfo, t)); - many = true; - } - links.addContent(">"); - } - return links; - } - public abstract Content getTypeAnnotationLinks(LinkInfo linkInfo); } diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java --- openjdk-11-11~19/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/Utils.java 2018-07-25 15:36:46.000000000 +0000 @@ -80,6 +80,7 @@ import com.sun.source.util.DocTrees; import com.sun.source.util.TreePath; import com.sun.tools.javac.model.JavacTypes; +import jdk.javadoc.internal.doclets.formats.html.SearchIndexItem; import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration; import jdk.javadoc.internal.doclets.toolkit.CommentUtils.DocCommentDuo; import jdk.javadoc.internal.doclets.toolkit.Messages; @@ -2079,6 +2080,48 @@ } } + /** + * Returns a Comparator for SearchIndexItems representing types. Items are + * compared by short name, or full string representation if names are equal. + * + * @return a Comparator + */ + public Comparator<SearchIndexItem> makeTypeSearchIndexComparator() { + return (SearchIndexItem sii1, SearchIndexItem sii2) -> { + int result = compareStrings(sii1.getSimpleName(), sii2.getSimpleName()); + if (result == 0) { + // TreeSet needs this to be consistent with equal so we do + // a plain comparison of string representations as fallback. + result = sii1.toString().compareTo(sii2.toString()); + } + return result; + }; + } + + private Comparator<SearchIndexItem> genericSearchIndexComparator = null; + /** + * Returns a Comparator for SearchIndexItems representing modules, packages, or members. + * Items are compared by label (member name plus signature for members, package name for + * packages, and module name for modules). If labels are equal then full string + * representation is compared. + * + * @return a Comparator + */ + public Comparator<SearchIndexItem> makeGenericSearchIndexComparator() { + if (genericSearchIndexComparator == null) { + genericSearchIndexComparator = (SearchIndexItem sii1, SearchIndexItem sii2) -> { + int result = compareStrings(sii1.getLabel(), sii2.getLabel()); + if (result == 0) { + // TreeSet needs this to be consistent with equal so we do + // a plain comparison of string representations as fallback. + result = sii1.toString().compareTo(sii2.toString()); + } + return result; + }; + } + return genericSearchIndexComparator; + } + public Iterable<TypeElement> getEnclosedTypeElements(PackageElement pkg) { List<TypeElement> out = getInterfaces(pkg); out.addAll(getClasses(pkg)); diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/legal/jquery.md openjdk-11-11~24/src/jdk.javadoc/share/legal/jquery.md --- openjdk-11-11~19/src/jdk.javadoc/share/legal/jquery.md 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/legal/jquery.md 2018-07-25 15:36:46.000000000 +0000 @@ -1,7 +1,7 @@ ## jQuery v3.3.1 ### jQuery License -<pre> +``` jQuery v 3.3.1 Copyright 2005, 2018 jQuery Foundation, Inc. and other contributors http://jquery.com/ @@ -70,4 +70,4 @@ ********************* -</pre> +``` diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/legal/jquery-migrate.md openjdk-11-11~24/src/jdk.javadoc/share/legal/jquery-migrate.md --- openjdk-11-11~19/src/jdk.javadoc/share/legal/jquery-migrate.md 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/legal/jquery-migrate.md 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,41 @@ +## jQuery Migrate v3.0.1 + +### jQuery Migrate License +``` +Copyright jQuery Foundation and other contributors, https://jquery.org/ + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/jquery/jquery-migrate + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +All files located in the node_modules and external directories are +externally maintained libraries used by this software which have their +own licenses; we recommend you read them, as their terms may differ from +the terms above. +``` diff -Nru openjdk-11-11~19/src/jdk.javadoc/share/legal/jqueryUI.md openjdk-11-11~24/src/jdk.javadoc/share/legal/jqueryUI.md --- openjdk-11-11~19/src/jdk.javadoc/share/legal/jqueryUI.md 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.javadoc/share/legal/jqueryUI.md 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,49 @@ +## jQuery UI v1.11.4 + +### jQuery UI License +``` +Copyright jQuery Foundation and other contributors, https://jquery.org/ + +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/jquery/jquery-ui + +The following license applies to all parts of this software except as +documented below: + +==== + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code contained within the demos directory. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +All files located in the node_modules and external directories are +externally maintained libraries used by this software which have their +own licenses; we recommend you read them, as their terms may differ from +the terms above. + +``` diff -Nru openjdk-11-11~19/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java openjdk-11-11~24/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java --- openjdk-11-11~19/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jcmd/share/classes/sun/tools/jstack/JStack.java 2018-07-25 15:36:46.000000000 +0000 @@ -48,6 +48,7 @@ checkForUnsupportedOptions(args); boolean locks = false; + boolean extended = false; // Parse the options (arguments starting with "-" ) int optionCount = 0; @@ -67,7 +68,11 @@ if (arg.equals("-l")) { locks = true; } else { - usage(1); + if (arg.equals("-e")) { + extended = true; + } else { + usage(1); + } } } optionCount++; @@ -81,12 +86,14 @@ // pass -l to thread dump operation to get extra lock info String pidArg = args[optionCount]; - String params[]; + String params[]= new String[] { "" }; + if (extended) { + params[0] += "-e "; + } if (locks) { - params = new String[] { "-l" }; - } else { - params = new String[0]; + params[0] += "-l"; } + ProcessArgumentMatcher ap = new ProcessArgumentMatcher(pidArg); Collection<String> pids = ap.getVirtualMachinePids(JStack.class); @@ -170,11 +177,12 @@ // print usage message private static void usage(int exit) { System.err.println("Usage:"); - System.err.println(" jstack [-l] <pid>"); + System.err.println(" jstack [-l][-e] <pid>"); System.err.println(" (to connect to running process)"); System.err.println(""); System.err.println("Options:"); System.err.println(" -l long listing. Prints additional information about locks"); + System.err.println(" -e extended listing. Prints additional information about threads"); System.err.println(" -? -h --help -help to print this help message"); System.exit(exit); } diff -Nru openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java --- openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/classfile/Attribute.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,6 +58,8 @@ public static final String ModulePackages = "ModulePackages"; public static final String ModuleResolution = "ModuleResolution"; public static final String ModuleTarget = "ModuleTarget"; + public static final String NestHost = "NestHost"; + public static final String NestMembers = "NestMembers"; public static final String RuntimeVisibleAnnotations = "RuntimeVisibleAnnotations"; public static final String RuntimeInvisibleAnnotations = "RuntimeInvisibleAnnotations"; public static final String RuntimeVisibleParameterAnnotations = "RuntimeVisibleParameterAnnotations"; @@ -130,6 +132,8 @@ standardAttributes.put(ModulePackages, ModulePackages_attribute.class); standardAttributes.put(ModuleResolution, ModuleResolution_attribute.class); standardAttributes.put(ModuleTarget, ModuleTarget_attribute.class); + standardAttributes.put(NestHost, NestHost_attribute.class); + standardAttributes.put(NestMembers, NestMembers_attribute.class); standardAttributes.put(RuntimeInvisibleAnnotations, RuntimeInvisibleAnnotations_attribute.class); standardAttributes.put(RuntimeInvisibleParameterAnnotations, RuntimeInvisibleParameterAnnotations_attribute.class); standardAttributes.put(RuntimeVisibleAnnotations, RuntimeVisibleAnnotations_attribute.class); @@ -193,6 +197,8 @@ R visitModulePackages(ModulePackages_attribute attr, P p); R visitModuleResolution(ModuleResolution_attribute attr, P p); R visitModuleTarget(ModuleTarget_attribute attr, P p); + R visitNestHost(NestHost_attribute attr, P p); + R visitNestMembers(NestMembers_attribute attr, P p); R visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, P p); R visitRuntimeInvisibleAnnotations(RuntimeInvisibleAnnotations_attribute attr, P p); R visitRuntimeVisibleParameterAnnotations(RuntimeVisibleParameterAnnotations_attribute attr, P p); diff -Nru openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java --- openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/classfile/ClassWriter.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -529,6 +529,12 @@ } @Override + public Void visitNestHost(NestHost_attribute attr, ClassOutputStream out) { + out.writeShort(attr.top_index); + return null; + } + + @Override public Void visitMethodParameters(MethodParameters_attribute attr, ClassOutputStream out) { out.writeByte(attr.method_parameter_table.length); for (MethodParameters_attribute.Entry e : attr.method_parameter_table) { @@ -626,6 +632,15 @@ return null; } + @Override + public Void visitNestMembers(NestMembers_attribute attr, ClassOutputStream out) { + out.writeShort(attr.members_indexes.length); + for (int i : attr.members_indexes) { + out.writeShort(i); + } + return null; + } + @Override public Void visitRuntimeInvisibleAnnotations(RuntimeInvisibleAnnotations_attribute attr, ClassOutputStream out) { annotationWriter.write(attr.annotations, out); diff -Nru openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/classfile/NestHost_attribute.java openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/classfile/NestHost_attribute.java --- openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/classfile/NestHost_attribute.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/classfile/NestHost_attribute.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.classfile; + +import com.sun.tools.classfile.ConstantPool.CONSTANT_Class_info; + +import java.io.IOException; + +/** + * <p><b>This is NOT part of any supported API. + * If you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice.</b> + */ +public class NestHost_attribute extends Attribute { + NestHost_attribute(ClassReader cr, int name_index, int length) throws IOException { + super(name_index, length); + top_index = cr.readUnsignedShort(); + } + + public NestHost_attribute(ConstantPool constant_pool, int signature_index) + throws ConstantPoolException { + this(constant_pool.getUTF8Index(Attribute.Signature), signature_index); + } + + public NestHost_attribute(int name_index, int top_index) { + super(name_index, 2); + this.top_index = top_index; + } + + public CONSTANT_Class_info getNestTop(ConstantPool constant_pool) throws ConstantPoolException { + return constant_pool.getClassInfo(top_index); + } + + public <R, D> R accept(Visitor<R, D> visitor, D data) { + return visitor.visitNestHost(this, data); + } + + public final int top_index; +} diff -Nru openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/classfile/NestMembers_attribute.java openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/classfile/NestMembers_attribute.java --- openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/classfile/NestMembers_attribute.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/classfile/NestMembers_attribute.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,70 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.tools.classfile; + +import com.sun.tools.classfile.ConstantPool.CONSTANT_Class_info; + +import java.io.IOException; +import java.util.stream.IntStream; + +/** + * <p><b>This is NOT part of any supported API. + * If you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice.</b> + */ +public class NestMembers_attribute extends Attribute { + NestMembers_attribute(ClassReader cr, int name_index, int length) throws IOException { + super(name_index, length); + int len = cr.readUnsignedShort(); + members_indexes = new int[len]; + for (int i = 0 ; i < len ; i++) { + members_indexes[i] = cr.readUnsignedShort(); + } + } + + public NestMembers_attribute(int name_index, int[] members_indexes) { + super(name_index, 2); + this.members_indexes = members_indexes; + } + + public CONSTANT_Class_info[] getChildren(ConstantPool constant_pool) throws ConstantPoolException { + return IntStream.of(members_indexes) + .mapToObj(i -> { + try { + return constant_pool.getClassInfo(i); + } catch (ConstantPoolException ex) { + throw new AssertionError(ex); + } + }).toArray(CONSTANT_Class_info[]::new); + } + + public <R, D> R accept(Visitor<R, D> visitor, D data) { + return visitor.visitNestMembers(this, data); + } + + public final int[] members_indexes; +} diff -Nru openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java --- openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/javap/AttributeWriter.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,6 +35,7 @@ import com.sun.tools.classfile.Code_attribute; import com.sun.tools.classfile.CompilationID_attribute; import com.sun.tools.classfile.ConstantPool; +import com.sun.tools.classfile.ConstantPool.CONSTANT_Class_info; import com.sun.tools.classfile.ConstantPoolException; import com.sun.tools.classfile.ConstantValue_attribute; import com.sun.tools.classfile.DefaultAttribute; @@ -53,6 +54,8 @@ import com.sun.tools.classfile.ModulePackages_attribute; import com.sun.tools.classfile.ModuleResolution_attribute; import com.sun.tools.classfile.ModuleTarget_attribute; +import com.sun.tools.classfile.NestHost_attribute; +import com.sun.tools.classfile.NestMembers_attribute; import com.sun.tools.classfile.RuntimeInvisibleAnnotations_attribute; import com.sun.tools.classfile.RuntimeInvisibleParameterAnnotations_attribute; import com.sun.tools.classfile.RuntimeInvisibleTypeAnnotations_attribute; @@ -397,6 +400,14 @@ return null; } + @Override + public Void visitNestHost(NestHost_attribute attr, Void aVoid) { + print("NestHost: "); + constantWriter.write(attr.top_index); + println(); + return null; + } + private String getJavaClassName(ModuleMainClass_attribute a) { try { return getJavaName(a.getMainClassName(constant_pool)); @@ -687,6 +698,22 @@ } @Override + public Void visitNestMembers(NestMembers_attribute attr, Void aVoid) { + println("NestMembers:"); + indent(+1); + try { + CONSTANT_Class_info[] children = attr.getChildren(constant_pool); + for (int i = 0; i < attr.members_indexes.length; i++) { + println(constantWriter.stringValue(children[i])); + } + indent(-1); + } catch (ConstantPoolException ex) { + throw new AssertionError(ex); + } + return null; + } + + @Override public Void visitRuntimeVisibleAnnotations(RuntimeVisibleAnnotations_attribute attr, Void ignore) { println("RuntimeVisibleAnnotations:"); indent(+1); diff -Nru openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java --- openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/LoadProc.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedSourceVersion; +import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.ExecutableElement; @@ -50,15 +51,12 @@ import javax.tools.Diagnostic; -import static javax.lang.model.SourceVersion.RELEASE_11; - /** * Annotation processor for the Deprecation Scanner tool. * Examines APIs for deprecated elements and records information * */ @SupportedAnnotationTypes("java.lang.Deprecated") -@SupportedSourceVersion(RELEASE_11) public class LoadProc extends AbstractProcessor { Elements elements; Messager messager; @@ -75,6 +73,11 @@ } @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { if (roundEnv.processingOver()) { return false; diff -Nru openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/TraverseProc.java openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/TraverseProc.java --- openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/TraverseProc.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/jdeprscan/TraverseProc.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,18 +41,16 @@ import javax.annotation.processing.SupportedAnnotationTypes; import javax.annotation.processing.SupportedSourceVersion; -import javax.lang.model.element.ModuleElement; -import javax.lang.model.element.TypeElement; -import javax.lang.model.util.Elements; - -import static javax.lang.model.SourceVersion.RELEASE_10; +import javax.lang.model.SourceVersion; import javax.lang.model.element.Element; import javax.lang.model.element.ElementKind; import javax.lang.model.element.Modifier; +import javax.lang.model.element.ModuleElement; import javax.lang.model.element.PackageElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.util.Elements; import javax.tools.Diagnostic; -@SupportedSourceVersion(RELEASE_10) @SupportedAnnotationTypes("*") public class TraverseProc extends AbstractProcessor { Elements elements; @@ -72,6 +70,11 @@ } @Override + public SourceVersion getSupportedSourceVersion() { + return SourceVersion.latest(); + } + + @Override public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) { if (roundEnv.processingOver()) { return false; diff -Nru openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java --- openjdk-11-11~19/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdeps/share/classes/com/sun/tools/jdeps/JdepsConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,6 +62,7 @@ import java.util.Set; import java.util.function.Function; import java.util.function.Supplier; +import java.util.stream.Collectors; import java.util.stream.Stream; public class JdepsConfiguration implements AutoCloseable { @@ -319,7 +320,6 @@ static class SystemModuleFinder implements ModuleFinder { private static final String JAVA_HOME = System.getProperty("java.home"); - private static final String JAVA_SE = "java.se"; private final FileSystem fileSystem; private final Path root; @@ -444,29 +444,15 @@ } public Set<String> defaultSystemRoots() { - Set<String> roots = new HashSet<>(); - boolean hasJava = false; - if (systemModules.containsKey(JAVA_SE)) { - // java.se is a system module - hasJava = true; - roots.add(JAVA_SE); - } - - for (ModuleReference mref : systemModules.values()) { - String mn = mref.descriptor().name(); - if (hasJava && mn.startsWith("java.")) - continue; - - // add as root if observable and exports at least one package - ModuleDescriptor descriptor = mref.descriptor(); - for (ModuleDescriptor.Exports e : descriptor.exports()) { - if (!e.isQualified()) { - roots.add(mn); - break; - } - } - } - return roots; + return systemModules.values().stream() + .map(ModuleReference::descriptor) + .filter(descriptor -> descriptor.exports() + .stream() + .filter(e -> !e.isQualified()) + .findAny() + .isPresent()) + .map(ModuleDescriptor::name) + .collect(Collectors.toSet()); } } diff -Nru openjdk-11-11~19/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java openjdk-11-11~24/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java --- openjdk-11-11~19/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdi/share/classes/com/sun/jdi/VirtualMachine.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -219,10 +219,11 @@ * this exception * <UL> * <LI>changing the schema (the fields) - * <LI>changing the hierarchy (subclasses, interfaces) + * <LI>changing the hierarchy (superclasses, interfaces) * <LI>deleting a method * <LI>changing class modifiers * <LI>changing method modifiers + * <LI>changing the {@code NestHost} or {@code NestMembers} class attributes * </UL> * </UL> * @@ -595,8 +596,9 @@ boolean canAddMethod(); /** - * Determines if the target VM supports unrestricted - * changes when performing class redefinition. + * Determines if the target VM supports + * changes when performing class redefinition that are + * otherwise restricted by {@link #redefineClasses}. * @see #redefineClasses * * @return <code>true</code> if the feature is supported, diff -Nru openjdk-11-11~19/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java openjdk-11-11~24/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java --- openjdk-11-11~19/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdi/share/classes/com/sun/tools/jdi/ReferenceTypeImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1153,7 +1153,7 @@ this.genericSignatureGotten = true; } - private static boolean isPrimitiveArray(String signature) { + private static boolean isOneDimensionalPrimitiveArray(String signature) { int i = signature.lastIndexOf('['); /* * TO DO: Centralize JNI signature knowledge. @@ -1162,7 +1162,7 @@ * jdk1.4/doc/guide/jpda/jdi/com/sun/jdi/doc-files/signature.html */ boolean isPA; - if (i < 0) { + if (i < 0 || signature.startsWith("[[")) { isPA = false; } else { char c = signature.charAt(i + 1); @@ -1186,7 +1186,7 @@ ClassLoaderReferenceImpl loader = (ClassLoaderReferenceImpl)classLoader(); if ((loader == null) || - (isPrimitiveArray(signature)) //Work around 4450091 + (isOneDimensionalPrimitiveArray(signature)) //Work around 4450091 ) { // Caller wants type of boot class field type = vm.findBootType(signature); diff -Nru openjdk-11-11~19/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java openjdk-11-11~24/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java --- openjdk-11-11~19/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -395,6 +395,9 @@ case JDWP.Error.METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED : throw new UnsupportedOperationException( "changes to method modifiers not implemented"); + case JDWP.Error.CLASS_ATTRIBUTE_CHANGE_NOT_IMPLEMENTED : + throw new UnsupportedOperationException( + "changes to class attribute not implemented"); case JDWP.Error.NAMES_DONT_MATCH : throw new NoClassDefFoundError( "class names do not match"); diff -Nru openjdk-11-11~19/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineManagerImpl.java openjdk-11-11~24/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineManagerImpl.java --- openjdk-11-11~19/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineManagerImpl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdi/share/classes/com/sun/tools/jdi/VirtualMachineManagerImpl.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ private final ThreadGroup mainGroupForJDI; private ResourceBundle messages = null; private int vmSequenceNumber = 0; - private static final int majorVersion = 9; + private static final int majorVersion = 11; private static final int minorVersion = 0; private static final Object lock = new Object(); diff -Nru openjdk-11-11~19/src/jdk.jdwp.agent/share/native/libjdwp/error_messages.c openjdk-11-11~24/src/jdk.jdwp.agent/share/native/libjdwp/error_messages.c --- openjdk-11-11~19/src/jdk.jdwp.agent/share/native/libjdwp/error_messages.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdwp.agent/share/native/libjdwp/error_messages.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -285,6 +285,7 @@ CASE_RETURN_JDWP_ERROR_TEXT(NAMES_DONT_MATCH) CASE_RETURN_JDWP_ERROR_TEXT(CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED) CASE_RETURN_JDWP_ERROR_TEXT(METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED) + CASE_RETURN_JDWP_ERROR_TEXT(CLASS_ATTRIBUTE_CHANGE_NOT_IMPLEMENTED) CASE_RETURN_JDWP_ERROR_TEXT(NOT_IMPLEMENTED) CASE_RETURN_JDWP_ERROR_TEXT(NULL_POINTER) CASE_RETURN_JDWP_ERROR_TEXT(ABSENT_INFORMATION) diff -Nru openjdk-11-11~19/src/jdk.jdwp.agent/share/native/libjdwp/transport.c openjdk-11-11~24/src/jdk.jdwp.agent/share/native/libjdwp/transport.c --- openjdk-11-11~19/src/jdk.jdwp.agent/share/native/libjdwp/transport.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdwp.agent/share/native/libjdwp/transport.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -211,7 +211,7 @@ JNI_FUNC_PTR(env,GetJavaVM)(env, &jvm); /* Try version 1.1 first, fallback to 1.0 on error */ - for (i = 0; i < sizeof(supported_versions); ++i) { + for (i = 0; i < sizeof(supported_versions)/sizeof(jint); ++i) { rc = (*onLoad)(jvm, &callback, supported_versions[i], &t); if (rc != JNI_EVERSION) { info->transportVersion = supported_versions[i]; diff -Nru openjdk-11-11~19/src/jdk.jdwp.agent/share/native/libjdwp/util.c openjdk-11-11~24/src/jdk.jdwp.agent/share/native/libjdwp/util.c --- openjdk-11-11~19/src/jdk.jdwp.agent/share/native/libjdwp/util.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdwp.agent/share/native/libjdwp/util.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1888,6 +1888,8 @@ return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_MODIFIERS_CHANGED; case JDWP_ERROR(METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED): return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED; + case JDWP_ERROR(CLASS_ATTRIBUTE_CHANGE_NOT_IMPLEMENTED): + return JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED; case JDWP_ERROR(NOT_IMPLEMENTED): return JVMTI_ERROR_NOT_AVAILABLE; case JDWP_ERROR(NULL_POINTER): @@ -2220,6 +2222,8 @@ return JDWP_ERROR(CLASS_MODIFIERS_CHANGE_NOT_IMPLEMENTED); case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_METHOD_MODIFIERS_CHANGED: return JDWP_ERROR(METHOD_MODIFIERS_CHANGE_NOT_IMPLEMENTED); + case JVMTI_ERROR_UNSUPPORTED_REDEFINITION_CLASS_ATTRIBUTE_CHANGED: + return JDWP_ERROR(CLASS_ATTRIBUTE_CHANGE_NOT_IMPLEMENTED); case AGENT_ERROR_NOT_CURRENT_FRAME: return JDWP_ERROR(NOT_CURRENT_FRAME); case AGENT_ERROR_INVALID_TAG: diff -Nru openjdk-11-11~19/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c openjdk-11-11~24/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c --- openjdk-11-11~19/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdwp.agent/share/native/libjdwp/VirtualMachineImpl.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,7 +35,7 @@ #include "FrameID.h" static char *versionName = "Java Debug Wire Protocol (Reference Implementation)"; -static int majorVersion = 9; /* JDWP major version */ +static int majorVersion = 11; /* JDWP major version */ static int minorVersion = 0; /* JDWP minor version */ static jboolean diff -Nru openjdk-11-11~19/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c openjdk-11-11~24/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c --- openjdk-11-11~19/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jdwp.agent/unix/native/libdt_socket/socket_md.c 2018-07-25 15:36:46.000000000 +0000 @@ -145,9 +145,15 @@ int dbgsysSocketClose(int fd) { int rv; + + /* AIX recommends to repeat the close call on EINTR */ +#if defined(_AIX) do { rv = close(fd); } while (rv == -1 && errno == EINTR); +#else + rv = close(fd); +#endif return rv; } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorder.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Map; import java.util.Objects; import jdk.jfr.internal.JVM; @@ -77,8 +76,8 @@ */ public List<Recording> getRecordings() { List<Recording> recs = new ArrayList<>(); - for (PlatformRecording internal : internal.getRecordings()) { - recs.add(internal.getRecording()); + for (PlatformRecording r : internal.getRecordings()) { + recs.add(r.getRecording()); } return Collections.unmodifiableList(recs); } @@ -112,7 +111,10 @@ * @return a snapshot of all available recording data, not {@code null} */ public Recording takeSnapshot() { - return internal.newSnapshot(); + Recording snapshot = new Recording(); + snapshot.setName("Snapshot"); + internal.fillWithRecordedData(snapshot.getInternal(), null); + return snapshot; } /** @@ -345,9 +347,7 @@ return initialized; } - // package private - PlatformRecording newInternalRecording(Map<String, String> settings) { - return internal.newRecording(settings); + PlatformRecorder getInternal() { + return internal; } - } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderPermission.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderPermission.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderPermission.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/FlightRecorderPermission.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ import java.util.Objects; import jdk.jfr.internal.PlatformEventType; +import jdk.jfr.internal.PlatformRecorder; import jdk.jfr.internal.PlatformRecording; import jdk.jfr.internal.PrivateAccess; import jdk.jfr.internal.Type; @@ -185,6 +186,11 @@ public boolean isUnsigned(ValueDescriptor v) { return v.isUnsigned(); } + + @Override + public PlatformRecorder getPlatformRecorder() { + return FlightRecorder.getFlightRecorder().getInternal(); + } } /** diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/AbstractDCmd.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,8 +27,10 @@ import java.io.IOException; import java.io.PrintWriter; import java.io.StringWriter; +import java.nio.file.Files; import java.nio.file.InvalidPathException; import java.nio.file.Path; +import java.nio.file.Paths; import java.time.Duration; import java.util.ArrayList; import java.util.Collections; @@ -37,6 +39,7 @@ import jdk.jfr.FlightRecorder; import jdk.jfr.Recording; +import jdk.jfr.internal.JVM; import jdk.jfr.internal.SecuritySupport; import jdk.jfr.internal.SecuritySupport.SafePath; import jdk.jfr.internal.Utils; @@ -63,15 +66,27 @@ return result.toString(); } - protected final SafePath resolvePath(String path, String errorMsg) throws DCmdException { - if (path == null) { - return null; + public String getPid() { + // Invoking ProcessHandle.current().pid() would require loading more + // classes during startup so instead JVM.getJVM().getPid() is used. + // The pid will not be exposed to running Java application, only when starting + // JFR from command line (-XX:StartFlightRecordin) or jcmd (JFR.start and JFR.check) + return JVM.getJVM().getPid(); + } + + protected final SafePath resolvePath(Recording recording, String filename) throws InvalidPathException { + if (filename == null) { + return makeGenerated(recording, Paths.get(".")); } - try { - return new SafePath(path); - } catch (InvalidPathException e) { - throw new DCmdException(e, errorMsg, ", invalid path \"" + path + "\"."); + Path path = Paths.get(filename); + if (Files.isDirectory(path)) { + return makeGenerated(recording, path); } + return new SafePath(path.toAbsolutePath().normalize()); + } + + private SafePath makeGenerated(Recording recording, Path directory) { + return new SafePath(directory.toAbsolutePath().resolve(Utils.makeFilename(recording)).normalize()); } protected final Recording findRecording(String name) throws DCmdException { @@ -83,10 +98,12 @@ } } - protected final void reportOperationComplete(String actionPrefix, Recording r, SafePath file) { + protected final void reportOperationComplete(String actionPrefix, String name, SafePath file) { print(actionPrefix); - print(" recording "); - print("\"" + r.getName() + "\""); + print(" recording"); + if (name != null) { + print(" \"" + name + "\""); + } if (file != null) { print(","); try { @@ -136,7 +153,7 @@ } protected final void printBytes(long bytes, String separation) { - print(Utils.formatBytes(bytes, separation)); + print(Utils.formatBytes(bytes, separation)); } protected final void printTimespan(Duration timespan, String separator) { diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdCheck.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,6 +36,9 @@ import jdk.jfr.EventType; import jdk.jfr.Recording; import jdk.jfr.SettingDescriptor; +import jdk.jfr.internal.LogLevel; +import jdk.jfr.internal.LogTag; +import jdk.jfr.internal.Logger; /** * JFR.check - invoked from native @@ -59,13 +62,17 @@ return getResult(); } - private void executeInternal(String recordingText, Boolean verbose) throws DCmdException { + private void executeInternal(String name, Boolean verbose) throws DCmdException { + if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdCheck: name=" + name + ", verbose=" + verbose); + } + if (verbose == null) { verbose = Boolean.FALSE; } - if (recordingText != null) { - printRecording(findRecording(recordingText), verbose); + if (name != null) { + printRecording(findRecording(name), verbose); return; } @@ -73,7 +80,7 @@ if (!verbose && recordings.isEmpty()) { println("No available recordings."); println(); - println("Use JFR.start to start a recording."); + println("Use jcmd " + getPid() + " JFR.start to start a recording."); return; } boolean first = true; diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdConfigure.java 2018-07-25 15:36:46.000000000 +0000 @@ -70,6 +70,19 @@ Boolean sampleThreads ) throws DCmdException { + if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdConfigure: repositorypath=" + repositoryPath + + ", dumppath=" + dumpPath + + ", stackdepth=" + stackDepth + + ", globalbuffercount=" + globalBufferCount + + ", globalbuffersize=" + globalBufferSize + + ", thread_buffer_size" + threadBufferSize + + ", memorysize" + memorySize + + ", maxchunksize=" + maxChunkSize + + ", samplethreads" + sampleThreads); + } + + boolean updated = false; if (repositoryPath != null) { try { diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdDump.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,10 +26,21 @@ import java.io.IOException; import java.nio.file.InvalidPathException; -import java.util.HashMap; -import java.util.Map; +import java.time.Duration; +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneId; +import java.time.ZonedDateTime; +import java.time.format.DateTimeParseException; +import jdk.jfr.FlightRecorder; import jdk.jfr.Recording; +import jdk.jfr.internal.LogLevel; +import jdk.jfr.internal.LogTag; +import jdk.jfr.internal.Logger; +import jdk.jfr.internal.PlatformRecorder; import jdk.jfr.internal.PlatformRecording; import jdk.jfr.internal.PrivateAccess; import jdk.jfr.internal.SecuritySupport.SafePath; @@ -40,41 +51,155 @@ * JFR.dump * */ -//Instantiated by native +// Instantiated by native final class DCmdDump extends AbstractDCmd { /** * Execute JFR.dump. * - * @param recordingText name or id of the recording to dump, or - * <code>null</code> + * @param name name or id of the recording to dump, or <code>null</code> to dump everything * - * @param textPath file path where recording should be written. + * @param filename file path where recording should be written, not null + * @param maxAge how far back in time to dump, may be null + * @param maxSize how far back in size to dump data from, may be null + * @param begin point in time to dump data from, may be null + * @param end point in time to dump data to, may be null + * @param pathToGcRoots if Java heap should be swept for reference chains * * @return result output * * @throws DCmdException if the dump could not be completed */ - public String execute(String recordingText, String textPath, Boolean pathToGcRoots) throws DCmdException { - if (textPath == null) { - throw new DCmdException("Failed to dump %s, missing filename.", recordingText); + public String execute(String name, String filename, Long maxAge, Long maxSize, String begin, String end, Boolean pathToGcRoots) throws DCmdException { + if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, + "Executing DCmdDump: name=" + name + + ", filename=" + filename + + ", maxage=" + maxAge + + ", maxsize=" + maxSize + + ", begin=" + begin + + ", end" + end + + ", path-to-gc-roots=" + pathToGcRoots); } - Recording recording = findRecording(recordingText); - try { - SafePath dumpFile = resolvePath(textPath, "Failed to dump %s"); - // create file for JVM - Utils.touch(dumpFile.toPath()); - PlatformRecording r = PrivateAccess.getInstance().getPlatformRecording(recording); - WriteableUserPath wup = new WriteableUserPath(dumpFile.toPath()); - Map<String, String> overlay = new HashMap<>(); - Utils.updateSettingPathToGcRoots(overlay, pathToGcRoots); + if (FlightRecorder.getFlightRecorder().getRecordings().isEmpty()) { + throw new DCmdException("No recordings to dump from. Use JFR.start to start a recording."); + } - r.copyTo(wup, "Dumped by user", overlay); - reportOperationComplete("Dumped", recording, dumpFile); - } catch (IOException | InvalidPathException e) { - throw new DCmdException("Failed to dump %s. Could not copy recording for dump. %s", recordingText, e.getMessage()); + if (maxAge != null) { + if (end != null || begin != null) { + throw new DCmdException("Dump failed, maxage can't be combined with begin or end."); + } + + if (maxAge < 0) { + throw new DCmdException("Dump failed, maxage can't be negative."); + } + if (maxAge == 0) { + maxAge = Long.MAX_VALUE / 2; // a high value that won't overflow + } + } + + if (maxSize!= null) { + if (maxSize < 0) { + throw new DCmdException("Dump failed, maxsize can't be negative."); + } + if (maxSize == 0) { + maxSize = Long.MAX_VALUE / 2; // a high value that won't overflow + } + } + + Instant beginTime = parseTime(begin, "begin"); + Instant endTime = parseTime(end, "end"); + + if (beginTime != null && endTime != null) { + if (endTime.isBefore(beginTime)) { + throw new DCmdException("Dump failed, begin must preceed end."); + } + } + + Duration duration = null; + if (maxAge != null) { + duration = Duration.ofNanos(maxAge); + beginTime = Instant.now().minus(duration); + } + Recording recording = null; + if (name != null) { + recording = findRecording(name); + } + PlatformRecorder recorder = PrivateAccess.getInstance().getPlatformRecorder(); + synchronized (recorder) { + dump(recorder, recording, name, filename, maxSize, pathToGcRoots, beginTime, endTime); } return getResult(); } + public void dump(PlatformRecorder recorder, Recording recording, String name, String filename, Long maxSize, Boolean pathToGcRoots, Instant beginTime, Instant endTime) throws DCmdException { + try (PlatformRecording r = newSnapShot(recorder, recording, pathToGcRoots)) { + r.filter(beginTime, endTime, maxSize); + if (r.getChunks().isEmpty()) { + throw new DCmdException("Dump failed. No data found in the specified interval."); + } + SafePath dumpFile = resolvePath(recording, filename); + + // Needed for JVM + Utils.touch(dumpFile.toPath()); + r.dumpStopped(new WriteableUserPath(dumpFile.toPath())); + reportOperationComplete("Dumped", name, dumpFile); + } catch (IOException | InvalidPathException e) { + throw new DCmdException("Dump failed. Could not copy recording data. %s", e.getMessage()); + } + } + + private Instant parseTime(String time, String parameter) throws DCmdException { + if (time == null) { + return null; + } + try { + return Instant.parse(time); + } catch (DateTimeParseException dtp) { + // fall through + } + try { + LocalDateTime ldt = LocalDateTime.parse(time); + return ZonedDateTime.of(ldt, ZoneId.systemDefault()).toInstant(); + } catch (DateTimeParseException dtp) { + // fall through + } + try { + LocalTime lt = LocalTime.parse(time); + LocalDate ld = LocalDate.now(); + Instant instant = ZonedDateTime.of(ld, lt, ZoneId.systemDefault()).toInstant(); + Instant now = Instant.now(); + if (instant.isAfter(now) && !instant.isBefore(now.plusSeconds(3600))) { + // User must have meant previous day + ld = ld.minusDays(1); + } + return ZonedDateTime.of(ld, lt, ZoneId.systemDefault()).toInstant(); + } catch (DateTimeParseException dtp) { + // fall through + } + + if (time.startsWith("-")) { + try { + long durationNanos = Utils.parseTimespan(time.substring(1)); + Duration duration = Duration.ofNanos(durationNanos); + return Instant.now().minus(duration); + } catch (NumberFormatException nfe) { + // fall through + } + } + throw new DCmdException("Dump failed, not a valid %s time.", parameter); + } + + private PlatformRecording newSnapShot(PlatformRecorder recorder, Recording recording, Boolean pathToGcRoots) throws DCmdException, IOException { + if (recording == null) { + // Operate on all recordings + PlatformRecording snapshot = recorder.newTemporaryRecording(); + recorder.fillWithRecordedData(snapshot, pathToGcRoots); + return snapshot; + } + + PlatformRecording pr = PrivateAccess.getInstance().getPlatformRecording(recording); + return pr.newSnapshotClone("Dumped by user", pathToGcRoots); + } + } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStart.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,19 +25,26 @@ package jdk.jfr.internal.dcmd; import java.io.IOException; +import java.nio.file.Files; import java.nio.file.InvalidPathException; +import java.nio.file.Path; import java.nio.file.Paths; import java.text.ParseException; import java.time.Duration; +import java.util.Arrays; import java.util.HashMap; import java.util.Map; import jdk.jfr.FlightRecorder; import jdk.jfr.Recording; import jdk.jfr.internal.JVM; +import jdk.jfr.internal.LogLevel; +import jdk.jfr.internal.LogTag; +import jdk.jfr.internal.Logger; +import jdk.jfr.internal.OldObjectSample; +import jdk.jfr.internal.PrivateAccess; import jdk.jfr.internal.SecuritySupport.SafePath; import jdk.jfr.internal.Type; -import jdk.jfr.internal.Utils; import jdk.jfr.internal.jfc.JFC; /** @@ -51,7 +58,7 @@ * Execute JFR.start. * * @param name optional name that can be used to identify recording. - * @param configurations names of settings files to use, i.e. "default" or + * @param settings names of settings files to use, i.e. "default" or * "default.jfc". * @param delay delay before recording is started, in nanoseconds. Must be * at least 1 second. @@ -73,7 +80,19 @@ * @throws DCmdException if recording could not be started */ @SuppressWarnings("resource") - public String execute(String name, String[] configurations, Long delay, Long duration, Boolean disk, String path, Long maxAge, Long maxSize, Boolean dumpOnExit, Boolean pathToGcRoots) throws DCmdException { + public String execute(String name, String[] settings, Long delay, Long duration, Boolean disk, String path, Long maxAge, Long maxSize, Boolean dumpOnExit, Boolean pathToGcRoots) throws DCmdException { + if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdStart: name=" + name + + ", settings=" + Arrays.asList(settings) + + ", delay=" + delay + + ", duration=" + duration + + ", disk=" + disk+ + ", filename=" + path + + ", maxage=" + maxAge + + ", maxsize=" + maxSize + + ", dumponexit =" + dumpOnExit + + ", path-to-gc-roots=" + pathToGcRoots); + } if (name != null) { try { Integer.parseInt(name); @@ -86,25 +105,23 @@ if (duration == null && Boolean.FALSE.equals(dumpOnExit) && path != null) { throw new DCmdException("Filename can only be set for a time bound recording or if dumponexit=true. Set duration/dumponexit or omit filename."); } - if (dumpOnExit == null && path != null) { - dumpOnExit = Boolean.TRUE; - } + Map<String, String> s = new HashMap<>(); - if (configurations == null || configurations.length == 0) { - configurations = new String[] { "default" }; + if (settings == null || settings.length == 0) { + settings = new String[] { "default" }; } - for (String configName : configurations) { + for (String configName : settings) { try { s.putAll(JFC.createKnown(configName).getSettings()); } catch (IOException | ParseException e) { - throw new DCmdException("Could not parse setting " + configurations[0], e); + throw new DCmdException("Could not parse setting " + settings[0], e); } } - Utils.updateSettingPathToGcRoots(s, pathToGcRoots); + OldObjectSample.updateSettingPathToGcRoots(s, pathToGcRoots); if (duration != null) { if (duration < 1000L * 1000L * 1000L) { @@ -133,10 +150,24 @@ recording.setToDisk(disk.booleanValue()); } recording.setSettings(s); + SafePath safePath = null; if (path != null) { try { - recording.setDestination(Paths.get(path)); + if (dumpOnExit == null) { + // default to dumponexit=true if user specified filename + dumpOnExit = Boolean.TRUE; + } + Path p = Paths.get(path); + if (Files.isDirectory(p) && Boolean.TRUE.equals(dumpOnExit)) { + // Decide destination filename at dump time + // Purposely avoid generating filename in Recording#setDestination due to + // security concerns + PrivateAccess.getInstance().getPlatformRecording(recording).setDumpOnExitDirectory(new SafePath(p)); + } else { + safePath = resolvePath(recording, path); + recording.setDestination(safePath.toPath()); + } } catch (IOException | InvalidPathException e) { recording.close(); throw new DCmdException("Could not start recording, not able to write to file %s. %s ", path, e.getMessage()); @@ -175,10 +206,10 @@ recording.setMaxSize(250*1024L*1024L); } - if (path != null && duration != null) { + if (safePath != null && duration != null) { println(" The result will be written to:"); println(); - printPath(new SafePath(path)); + printPath(safePath); } else { println(); println(); @@ -189,12 +220,13 @@ if (name != null) { recordingspecifier = "name=" + quoteIfNeeded(name); } - print("Use JFR." + cmd + " " + recordingspecifier + " " + fileOption + "to copy recording data to file."); + print("Use jcmd " + getPid() + " JFR." + cmd + " " + recordingspecifier + " " + fileOption + "to copy recording data to file."); println(); } return getResult(); } + // Instruments JDK-events on class load to reduce startup time private void initializeWithForcedInstrumentation(Map<String, String> settings) { if (!hasJDKEvents(settings)) { diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/dcmd/DCmdStop.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,13 +29,16 @@ import java.nio.file.Paths; import jdk.jfr.Recording; +import jdk.jfr.internal.LogLevel; +import jdk.jfr.internal.LogTag; +import jdk.jfr.internal.Logger; import jdk.jfr.internal.SecuritySupport.SafePath; /** * JFR.stop * */ -//Instantiated by native +// Instantiated by native final class DCmdStop extends AbstractDCmd { /** @@ -43,35 +46,42 @@ * * Requires that either <code>name or <code>id</code> is set. * - * @param recordingText name or id of the recording to stop. + * @param name name or id of the recording to stop. * - * @param textPath file path where data should be written after recording - * has been stopped, or <code>null</code> if recording shouldn't be - * written to disk. + * @param filename file path where data should be written after recording has + * been stopped, or <code>null</code> if recording shouldn't be written + * to disk. * @return result text * * @throws DCmdException if recording could not be stopped */ - public String execute(String recordingText, String textPath) throws DCmdException { + public String execute(String name, String filename) throws DCmdException { + if (LogTag.JFR_DCMD.shouldLog(LogLevel.DEBUG)) { + Logger.log(LogTag.JFR_DCMD, LogLevel.DEBUG, "Executing DCmdStart: name=" + name + ", filename=" + filename); + } + try { - SafePath path = resolvePath(textPath, "Failed to stop %s"); - Recording recording = findRecording(recordingText); - if (textPath != null) { + SafePath safePath = null; + Recording recording = findRecording(name); + if (filename != null) { try { - recording.setDestination(Paths.get(textPath)); - } catch (IOException e) { - throw new DCmdException("Failed to stop %s. Could not set destination for \"%s\" to file %s", recording.getName(), textPath, e.getMessage()); + // Ensure path is valid. Don't generate safePath if filename == null, as a user may + // want to stop recording without a dump + safePath = resolvePath(null, filename); + recording.setDestination(Paths.get(filename)); + } catch (IOException | InvalidPathException e) { + throw new DCmdException("Failed to stop %s. Could not set destination for \"%s\" to file %s", recording.getName(), filename, e.getMessage()); } } recording.stop(); - reportOperationComplete("Stopped", recording, path); + reportOperationComplete("Stopped", recording.getName(), safePath); recording.close(); return getResult(); } catch (InvalidPathException | DCmdException e) { - if (textPath != null) { - throw new DCmdException("Could not write recording \"%s\" to file. %s", recordingText, e.getMessage()); + if (filename != null) { + throw new DCmdException("Could not write recording \"%s\" to file. %s", name, e.getMessage()); } - throw new DCmdException(e, "Could not stop recording \"%s\".", recordingText, e.getMessage()); + throw new DCmdException(e, "Could not stop recording \"%s\".", name, e.getMessage()); } } } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/LogTag.java 2018-07-25 15:36:46.000000000 +0000 @@ -73,7 +73,12 @@ /** * Covers setting (for users of the JDK) */ - JFR_SETTING(9); + JFR_SETTING(9), + /** + * Covers usage of jcmd with JFR + */ + JFR_DCMD(10); + /* set from native side */ private volatile int tagSetLevel = 100; // prevent logging if JVM log system has not been initialized @@ -86,4 +91,8 @@ public boolean shouldLog(int level) { return level >= tagSetLevel; } + + public boolean shouldLog(LogLevel logLevel) { + return shouldLog(logLevel.level); + } } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/OldObjectSample.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/OldObjectSample.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/OldObjectSample.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/OldObjectSample.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,73 @@ +package jdk.jfr.internal; + +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jdk.jfr.Enabled; +import jdk.jfr.RecordingState; +import jdk.jfr.internal.settings.CutoffSetting; +import jdk.jfr.internal.test.WhiteBox; + +// The Old Object event could have been implemented as a periodic event, but +// due to chunk rotations and how settings are calculated when multiple recordings +// are running at the same time, it would lead to unacceptable overhead. +// +// Instead, the event is only emitted before a recording stops and +// if that recording has the event enabled. +// +// This requires special handling and the purpose of this class is to provide that +// +public final class OldObjectSample { + + private static final String EVENT_NAME = Type.EVENT_NAME_PREFIX + "OldObjectSample"; + private static final String OLD_OBJECT_CUTOFF = EVENT_NAME + "#" + Cutoff.NAME; + private static final String OLD_OBJECT_ENABLED = EVENT_NAME + "#" + Enabled.NAME; + + // Emit if old object is enabled in recoding with cutoff for that recording + public static void emit(PlatformRecording recording) { + if (isEnabled(recording)) { + long nanos = CutoffSetting.parseValueSafe(recording.getSettings().get(OLD_OBJECT_CUTOFF)); + long ticks = Utils.nanosToTicks(nanos); + JVM.getJVM().emitOldObjectSamples(ticks, WhiteBox.getWriteAllObjectSamples()); + } + } + + // Emit if old object is enabled for at least one recording, and use the largest + // cutoff for an enabled recoding + public static void emit(List<PlatformRecording> recordings, Boolean pathToGcRoots) { + boolean enabled = false; + long cutoffNanos = Boolean.TRUE.equals(pathToGcRoots) ? Long.MAX_VALUE : 0L; + for (PlatformRecording r : recordings) { + if (r.getState() == RecordingState.RUNNING) { + if (isEnabled(r)) { + enabled = true; + long c = CutoffSetting.parseValueSafe(r.getSettings().get(OLD_OBJECT_CUTOFF)); + cutoffNanos = Math.max(c, cutoffNanos); + } + } + } + if (enabled) { + long ticks = Utils.nanosToTicks(cutoffNanos); + JVM.getJVM().emitOldObjectSamples(ticks, WhiteBox.getWriteAllObjectSamples()); + } + } + + public static void updateSettingPathToGcRoots(Map<String, String> s, Boolean pathToGcRoots) { + if (pathToGcRoots != null) { + s.put(OLD_OBJECT_CUTOFF, pathToGcRoots ? "infinity" : "0 ns"); + } + } + + public static Map<String, String> createSettingsForSnapshot(PlatformRecording recording, Boolean pathToGcRoots) { + Map<String, String> settings = new HashMap<>(recording.getSettings()); + updateSettingPathToGcRoots(settings, pathToGcRoots); + return settings; + } + + private static boolean isEnabled(PlatformRecording r) { + Map<String, String> settings = r.getSettings(); + String s = settings.get(OLD_OBJECT_ENABLED); + return "true".equals(s); + } +} diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecorder.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,6 +38,7 @@ import java.time.Instant; import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -46,7 +47,6 @@ import java.util.TimerTask; import java.util.concurrent.CopyOnWriteArrayList; -import jdk.jfr.Enabled; import jdk.jfr.EventType; import jdk.jfr.FlightRecorder; import jdk.jfr.FlightRecorderListener; @@ -56,8 +56,6 @@ import jdk.jfr.events.ActiveSettingEvent; import jdk.jfr.internal.SecuritySupport.SecureRecorderListener; import jdk.jfr.internal.instrument.JDKEvents; -import jdk.jfr.internal.settings.CutoffSetting; -import jdk.jfr.internal.test.WhiteBox; public final class PlatformRecorder { @@ -111,7 +109,16 @@ return newRecording(settings, ++recordingCounter); } - public synchronized PlatformRecording newRecording(Map<String, String> settings, long id) { + // To be used internally when doing dumps. + // Caller must have recorder lock and close recording before releasing lock + public PlatformRecording newTemporaryRecording() { + if(!Thread.holdsLock(this)) { + throw new InternalError("Caller must have recorder lock"); + } + return newRecording(new HashMap<>(), 0); + } + + private synchronized PlatformRecording newRecording(Map<String, String> settings, long id) { PlatformRecording recording = new PlatformRecording(this, id); if (!settings.isEmpty()) { recording.setSettings(settings); @@ -249,7 +256,7 @@ RequestEngine.doChunkBegin(); } - synchronized void stop(PlatformRecording recording, WriteableUserPath alternativePath) { + synchronized void stop(PlatformRecording recording) { RecordingState state = recording.getState(); if (Utils.isAfter(state, RecordingState.RUNNING)) { @@ -270,7 +277,7 @@ } } } - emitOldObjectSamples(recording); + OldObjectSample.emit(recording); if (endPhysical) { RequestEngine.doChunkEnd(); @@ -282,7 +289,7 @@ } } else { // last memory - dumpMemoryToDestination(recording, alternativePath); + dumpMemoryToDestination(recording); } jvm.endRecording_(); disableEvents(); @@ -306,26 +313,13 @@ recording.setState(RecordingState.STOPPED); } - // Only dump event if the recording that is being stopped - // has OldObjectSample enabled + cutoff from recording, not global value - private void emitOldObjectSamples(PlatformRecording recording) { - Map<String, String> settings = recording.getSettings(); - String s = settings.get(Type.EVENT_NAME_PREFIX + "OldObjectSample#" + Enabled.NAME); - if ("true".equals(s)) { - long nanos = CutoffSetting.parseValueSafe(settings.get(Type.EVENT_NAME_PREFIX + "OldObjectSample#" + Cutoff.NAME)); - long ticks = Utils.nanosToTicks(nanos); - JVM.getJVM().emitOldObjectSamples(ticks, WhiteBox.getWriteAllObjectSamples()); - } - } - - private void dumpMemoryToDestination(PlatformRecording recording, WriteableUserPath alternativePath) { - WriteableUserPath dest = alternativePath != null ? alternativePath : recording.getDestination(); + private void dumpMemoryToDestination(PlatformRecording recording) { + WriteableUserPath dest = recording.getDestination(); if (dest != null) { MetadataRepository.getInstance().setOutput(dest.getText()); recording.clearDestination(); } } - private void disableEvents() { MetadataRepository.getInstance().disableEvents(); } @@ -504,47 +498,47 @@ return newRec; } - public synchronized Recording newSnapshot() { + public synchronized void fillWithRecordedData(PlatformRecording target, Boolean pathToGcRoots) { boolean running = false; boolean toDisk = false; + for (PlatformRecording r : recordings) { if (r.getState() == RecordingState.RUNNING) { running = true; + if (r.isToDisk()) { + toDisk = true; + } } - if (r.isToDisk()) { - toDisk = true; - } - } // If needed, flush data from memory if (running) { if (toDisk) { + OldObjectSample.emit(recordings, pathToGcRoots); rotateDisk(); } else { - try (Recording snapshot = new Recording()) { - PlatformRecording internal = PrivateAccess.getInstance().getPlatformRecording(snapshot); - internal.setShouldWriteActiveRecordingEvent(false); + try (PlatformRecording snapshot = newTemporaryRecording()) { + snapshot.setToDisk(true); + snapshot.setShouldWriteActiveRecordingEvent(false); snapshot.start(); - snapshot.stop(); - return makeRecordingWithDiskChunks(); + OldObjectSample.emit(recordings, pathToGcRoots); + snapshot.stop("Snapshot dump"); + fillWithDiskChunks(target); } + return; } } - return makeRecordingWithDiskChunks(); + fillWithDiskChunks(target); } - private Recording makeRecordingWithDiskChunks() { - Recording snapshot = new Recording(); - snapshot.setName("Snapshot"); - PlatformRecording internal = PrivateAccess.getInstance().getPlatformRecording(snapshot); + private void fillWithDiskChunks(PlatformRecording target) { for (RepositoryChunk c : makeChunkList(null, null)) { - internal.add(c); + target.add(c); } - internal.setState(RecordingState.STOPPED); + target.setState(RecordingState.STOPPED); Instant startTime = null; Instant endTime = null; - for (RepositoryChunk c : makeChunkList(null, null)) { + for (RepositoryChunk c : target.getChunks()) { if (startTime == null || c.getStartTime().isBefore(startTime)) { startTime = c.getStartTime(); } @@ -559,9 +553,8 @@ if (endTime == null) { endTime = now; } - internal.setStartTime(startTime); - internal.setStopTime(endTime); - internal.setInternalDuration(Duration.between(startTime, endTime)); - return snapshot; + target.setStartTime(startTime); + target.setStopTime(endTime); + target.setInternalDuration(Duration.between(startTime, endTime)); } } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/PlatformRecording.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,7 +41,6 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Date; -import java.util.HashMap; import java.util.LinkedHashMap; import java.util.LinkedList; import java.util.List; @@ -54,6 +53,7 @@ import jdk.jfr.FlightRecorderListener; import jdk.jfr.Recording; import jdk.jfr.RecordingState; +import jdk.jfr.internal.SecuritySupport.SafePath; public final class PlatformRecording implements AutoCloseable { @@ -70,6 +70,7 @@ private boolean toDisk = true; private String name; private boolean dumpOnExit; + private SafePath dumpOnExitDirectory = new SafePath("."); // Timestamp information private Instant stopTime; private Instant startTime; @@ -89,7 +90,7 @@ // when you call dump(Path) or setDdestination(Path), // but if no destination is set and dumponexit=true // the control context of the recording is taken when the - // Recording object is constructed. This works well for + // Recording object is constructed. This works well for // -XX:StartFlightRecording and JFR.dump this.noDestinationDumpOnExitAccessControlContext = AccessController.getContext(); this.id = id; @@ -114,45 +115,37 @@ Logger.log(LogTag.JFR, LogLevel.INFO, () -> { // Only print non-default values so it easy to see // which options were added - StringJoiner options = new StringJoiner(", "); - if (!toDisk) { - options.add("disk=false"); - } - if (maxAge != null) { - options.add("maxage=" + Utils.formatTimespan(maxAge, "")); - } - if (maxSize != 0) { - options.add("maxsize=" + Utils.formatBytes(maxSize, "")); - } - if (dumpOnExit) { - options.add("dumponexit=true"); - } - if (duration != null) { - options.add("duration=" + Utils.formatTimespan(duration, "")); - } - if (destination != null) { - options.add("filename=" + destination.getText()); - } - String optionText = options.toString(); - if (optionText.length() != 0) { - optionText = "{" + optionText + "}"; - } - return "Started recording \"" + getName() + "\" (" + getId() + ") " + optionText; - }); + StringJoiner options = new StringJoiner(", "); + if (!toDisk) { + options.add("disk=false"); + } + if (maxAge != null) { + options.add("maxage=" + Utils.formatTimespan(maxAge, "")); + } + if (maxSize != 0) { + options.add("maxsize=" + Utils.formatBytes(maxSize, "")); + } + if (dumpOnExit) { + options.add("dumponexit=true"); + } + if (duration != null) { + options.add("duration=" + Utils.formatTimespan(duration, "")); + } + if (destination != null) { + options.add("filename=" + destination.getText()); + } + String optionText = options.toString(); + if (optionText.length() != 0) { + optionText = "{" + optionText + "}"; + } + return "Started recording \"" + getName() + "\" (" + getId() + ") " + optionText; + }); newState = getState(); } notifyIfStateChanged(oldState, newState); } public boolean stop(String reason) { - return stop(reason, null); - } - - public boolean stop(String reason, WriteableUserPath alternativePath) { - return stop(reason, alternativePath, Collections.emptyMap()); - } - - boolean stop(String reason, WriteableUserPath alternativePath, Map<String, String> overlaySettings) { RecordingState oldState; RecordingState newState; synchronized (recorder) { @@ -161,23 +154,21 @@ stopTask.cancel(); stopTask = null; } - recorder.stop(this, alternativePath); + recorder.stop(this); String endText = reason == null ? "" : ". Reason \"" + reason + "\"."; - Logger.log(LogTag.JFR, LogLevel.INFO, "Stopped recording \"" + getName() + "\" (" + getId()+ ")" + endText); + Logger.log(LogTag.JFR, LogLevel.INFO, "Stopped recording \"" + getName() + "\" (" + getId() + ")" + endText); this.stopTime = Instant.now(); newState = getState(); } WriteableUserPath dest = getDestination(); - if (dest == null && alternativePath != null) { - dest = alternativePath; - } + if (dest != null) { try { - copyTo(dest, reason, overlaySettings); - Logger.log(LogTag.JFR, LogLevel.INFO, "Wrote recording \"" + getName() + "\" (" + getId()+ ") to " + dest.getText()); + dumpStopped(dest); + Logger.log(LogTag.JFR, LogLevel.INFO, "Wrote recording \"" + getName() + "\" (" + getId() + ") to " + dest.getText()); notifyIfStateChanged(newState, oldState); close(); // remove if copied out - } catch (IOException e) { + } catch(IOException e) { // throw e; // BUG8925030 } } else { @@ -195,7 +186,7 @@ setState(RecordingState.DELAYED); startTask = createStartTask(); recorder.getTimer().schedule(startTask, delay.toMillis()); - Logger.log(LogTag.JFR, LogLevel.INFO, "Scheduled recording \"" + getName() + "\" (" + getId()+ ") to start at " + now); + Logger.log(LogTag.JFR, LogLevel.INFO, "Scheduled recording \"" + getName() + "\" (" + getId() + ") to start at " + now); } } @@ -271,7 +262,6 @@ } } - public RecordingState getState() { synchronized (recorder) { return state; @@ -296,79 +286,67 @@ } chunks.clear(); setState(RecordingState.CLOSED); - Logger.log(LogTag.JFR, LogLevel.INFO, "Closed recording \"" + getName() + "\" (" + getId()+ ")"); + Logger.log(LogTag.JFR, LogLevel.INFO, "Closed recording \"" + getName() + "\" (" + getId() + ")"); } newState = getState(); } notifyIfStateChanged(newState, oldState); } - public void copyTo(WriteableUserPath path, String reason, Map<String, String> dumpSettings) throws IOException { - synchronized (recorder) { - RecordingState state = getState(); - if (state == RecordingState.CLOSED) { - throw new IOException("Recording \"" + name + "\" (id=" + id + ") has been closed, no contents to write"); - } - if (state == RecordingState.DELAYED || state == RecordingState.NEW) { - throw new IOException("Recording \"" + name + "\" (id=" + id + ") has not started, no contents to write"); - } - if (state == RecordingState.STOPPED) { - // have all we need, just write it - dumpToFile(path, reason, getId()); - return; - } - - // Recording is RUNNING, create a clone - try(PlatformRecording clone = recorder.newRecording(Collections.emptyMap(), 0)) { - clone.setShouldWriteActiveRecordingEvent(false); - clone.setName(getName()); - clone.setDestination(path); - clone.setToDisk(true); - // We purposely don't clone settings, since - // a union a == a - if (!isToDisk()) { - // force memory contents to disk - clone.start(); - } else { - // using existing chunks on disk - for (RepositoryChunk c : chunks) { - clone.add(c); - } - clone.setState(RecordingState.RUNNING); - clone.setStartTime(getStartTime()); - } - if (dumpSettings.isEmpty()) { - clone.setSettings(getSettings()); - clone.stop(reason); // dumps to destination path here - } else { - // Risk of violating lock order here, since - // clone.stop() will take recorder lock inside - // metadata lock, but OK if we already - // have recorder lock when we entered metadata lock - Thread.holdsLock(recorder); - synchronized(MetadataRepository.getInstance()) { - Thread.holdsLock(recorder); - Map<String, String> oldSettings = getSettings(); - Map<String, String> newSettings = new HashMap<>(oldSettings); - // replace with dump settings - newSettings.putAll(dumpSettings); - clone.setSettings(newSettings); - clone.stop(reason); - } - } + // To be used internally when doing dumps. + // Caller must have recorder lock and close recording before releasing lock + public PlatformRecording newSnapshotClone(String reason, Boolean pathToGcRoots) throws IOException { + if(!Thread.holdsLock(recorder)) { + throw new InternalError("Caller must have recorder lock"); + } + RecordingState state = getState(); + if (state == RecordingState.CLOSED) { + throw new IOException("Recording \"" + name + "\" (id=" + id + ") has been closed, no contents to write"); + } + if (state == RecordingState.DELAYED || state == RecordingState.NEW) { + throw new IOException("Recording \"" + name + "\" (id=" + id + ") has not started, no contents to write"); + } + if (state == RecordingState.STOPPED) { + PlatformRecording clone = recorder.newTemporaryRecording(); + for (RepositoryChunk r : chunks) { + clone.add(r); + } + return clone; + } + + // Recording is RUNNING, create a clone + PlatformRecording clone = recorder.newTemporaryRecording(); + clone.setShouldWriteActiveRecordingEvent(false); + clone.setName(getName()); + clone.setDestination(this.destination); + clone.setToDisk(true); + // We purposely don't clone settings here, since + // a union a == a + if (!isToDisk()) { + // force memory contents to disk + clone.start(); + } else { + // using existing chunks on disk + for (RepositoryChunk c : chunks) { + clone.add(c); + } + clone.setState(RecordingState.RUNNING); + clone.setStartTime(getStartTime()); + } + if (pathToGcRoots == null) { + clone.setSettings(getSettings()); // needed for old object sample + clone.stop(reason); // dumps to destination path here + } else { + // Risk of violating lock order here, since + // clone.stop() will take recorder lock inside + // metadata lock, but OK if we already + // have recorder lock when we entered metadata lock + synchronized (MetadataRepository.getInstance()) { + clone.setSettings(OldObjectSample.createSettingsForSnapshot(this, pathToGcRoots)); + clone.stop(reason); } - return; } - } - - private void dumpToFile(WriteableUserPath userPath, String reason, long id) throws IOException { - userPath.doPriviligedIO(() -> { - try (ChunksChannel cc = new ChunksChannel(chunks); FileChannel fc = FileChannel.open(userPath.getReal(), StandardOpenOption.WRITE, StandardOpenOption.APPEND)) { - cc.transferTo(fc); - fc.force(true); - } - return null; - }); + return clone; } public boolean isToDisk() { @@ -387,7 +365,7 @@ } } - public void setDestination(WriteableUserPath userSuppliedPath) throws IOException { + public void setDestination(WriteableUserPath userSuppliedPath) throws IOException { synchronized (recorder) { if (Utils.isState(getState(), RecordingState.STOPPED, RecordingState.CLOSED)) { throw new IllegalStateException("Destination can't be set on a recording that has been stopped/closed"); @@ -479,7 +457,7 @@ TreeMap<String, String> ordered = new TreeMap<>(settings); Logger.log(LogTag.JFR_SETTING, LogLevel.INFO, "New settings for recording \"" + getName() + "\" (" + getId() + ")"); for (Map.Entry<String, String> entry : ordered.entrySet()) { - String text = entry.getKey() + "=\"" + entry.getValue() + "\""; + String text = entry.getKey() + "=\"" + entry.getValue() + "\""; Logger.log(LogTag.JFR_SETTING, LogLevel.INFO, text); } } @@ -491,7 +469,6 @@ } } - private void notifyIfStateChanged(RecordingState newState, RecordingState oldState) { if (oldState == newState) { return; @@ -580,12 +557,12 @@ private void added(RepositoryChunk c) { c.use(); size += c.getSize(); - Logger.log(JFR, DEBUG, ()-> "Recording \"" + name + "\" (" + id + ") added chunk " + c.toString() + ", current size=" + size); + Logger.log(JFR, DEBUG, () -> "Recording \"" + name + "\" (" + id + ") added chunk " + c.toString() + ", current size=" + size); } private void removed(RepositoryChunk c) { size -= c.getSize(); - Logger.log(JFR, DEBUG, ()-> "Recording \"" + name + "\" (" + id + ") removed chunk " + c.toString() + ", current size=" + size); + Logger.log(JFR, DEBUG, () -> "Recording \"" + name + "\" (" + id + ") removed chunk " + c.toString() + ", current size=" + size); c.release(); } @@ -661,7 +638,7 @@ stop("End of duration reached"); } catch (Throwable t) { // Prevent malicious user to propagate exception callback in the wrong context - Logger.log(LogTag.JFR, LogLevel.ERROR, "Could not stop recording. " + t.getMessage()); + Logger.log(LogTag.JFR, LogLevel.ERROR, "Could not stop recording."); } } }; @@ -678,7 +655,7 @@ } void clearDestination() { - destination = null; + destination = null; } public AccessControlContext getNoDestinationDumpOnExitAccessControlContext() { @@ -686,10 +663,116 @@ } void setShouldWriteActiveRecordingEvent(boolean shouldWrite) { - this.shuoldWriteActiveRecordingEvent = shouldWrite; + this.shuoldWriteActiveRecordingEvent = shouldWrite; } boolean shouldWriteMetadataEvent() { return shuoldWriteActiveRecordingEvent; } + + // Dump running and stopped recordings + public void dump(WriteableUserPath writeableUserPath) throws IOException { + synchronized (recorder) { + try(PlatformRecording p = newSnapshotClone("Dumped by user", null)) { + p.dumpStopped(writeableUserPath); + } + } + } + + public void dumpStopped(WriteableUserPath userPath) throws IOException { + synchronized (recorder) { + userPath.doPriviligedIO(() -> { + try (ChunksChannel cc = new ChunksChannel(chunks); FileChannel fc = FileChannel.open(userPath.getReal(), StandardOpenOption.WRITE, StandardOpenOption.APPEND)) { + cc.transferTo(fc); + fc.force(true); + } + return null; + }); + } + } + + public void filter(Instant begin, Instant end, Long maxSize) { + synchronized (recorder) { + List<RepositoryChunk> result = removeAfter(end, removeBefore(begin, new ArrayList<>(chunks))); + if (maxSize != null) { + if (begin != null && end == null) { + result = reduceFromBeginning(maxSize, result); + } else { + result = reduceFromEnd(maxSize, result); + } + } + int size = 0; + for (RepositoryChunk r : result) { + size += r.getSize(); + r.use(); + } + this.size = size; + for (RepositoryChunk r : chunks) { + r.release(); + } + chunks.clear(); + chunks.addAll(result); + } + } + + private static List<RepositoryChunk> removeBefore(Instant time, List<RepositoryChunk> input) { + if (time == null) { + return input; + } + List<RepositoryChunk> result = new ArrayList<>(input.size()); + for (RepositoryChunk r : input) { + if (!r.getEndTime().isBefore(time)) { + result.add(r); + } + } + return result; + } + + private static List<RepositoryChunk> removeAfter(Instant time, List<RepositoryChunk> input) { + if (time == null) { + return input; + } + List<RepositoryChunk> result = new ArrayList<>(input.size()); + for (RepositoryChunk r : input) { + if (!r.getStartTime().isAfter(time)) { + result.add(r); + } + } + return result; + } + + private static List<RepositoryChunk> reduceFromBeginning(Long maxSize, List<RepositoryChunk> input) { + if (maxSize == null || input.isEmpty()) { + return input; + } + List<RepositoryChunk> result = new ArrayList<>(input.size()); + long total = 0; + for (RepositoryChunk r : input) { + total += r.getSize(); + if (total > maxSize) { + break; + } + result.add(r); + } + // always keep at least one chunk + if (result.isEmpty()) { + result.add(input.get(0)); + } + return result; + } + + private static List<RepositoryChunk> reduceFromEnd(Long maxSize, List<RepositoryChunk> input) { + Collections.reverse(input); + List<RepositoryChunk> result = reduceFromBeginning(maxSize, input); + Collections.reverse(result); + return result; + } + + public void setDumpOnExitDirectory(SafePath directory) { + this.dumpOnExitDirectory = directory; + } + + public SafePath getDumpOnExitDirectory() { + return this.dumpOnExitDirectory; + } } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/PrivateAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -92,4 +92,6 @@ public abstract void setAnnotations(SettingDescriptor s, List<AnnotationElement> a); public abstract boolean isUnsigned(ValueDescriptor v); + + public abstract PlatformRecorder getPlatformRecorder(); } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/Repository.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,7 +41,7 @@ private static final JVM jvm = JVM.getJVM(); private static final Repository instance = new Repository(); - static DateTimeFormatter REPO_DATE_FORMAT = DateTimeFormatter + public final static DateTimeFormatter REPO_DATE_FORMAT = DateTimeFormatter .ofPattern("yyyy_MM_dd_HH_mm_ss"); private final Set<SafePath> cleanupDirectories = new HashSet<>(); diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/ShutdownHook.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/ShutdownHook.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/ShutdownHook.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/ShutdownHook.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,12 +26,10 @@ package jdk.jfr.internal; import java.io.IOException; -import java.nio.file.Paths; import java.security.AccessControlContext; import java.security.AccessController; import java.security.PrivilegedActionException; import java.security.PrivilegedExceptionAction; -import java.time.LocalDateTime; import jdk.jfr.RecordingState; @@ -67,9 +65,10 @@ WriteableUserPath dest = recording.getDestination(); if (dest == null) { dest = makeDumpOnExitPath(recording); + recording.setDestination(dest); } if (dest != null) { - recording.stop("Dump on exit", dest); + recording.stop("Dump on exit"); } } catch (Exception e) { Logger.log(LogTag.JFR, LogLevel.DEBUG, () -> "Could not dump recording " + recording.getName() + " on exit."); @@ -78,23 +77,21 @@ private WriteableUserPath makeDumpOnExitPath(PlatformRecording recording) { try { - String pid = JVM.getJVM().getPid(); - String dfText = Repository.REPO_DATE_FORMAT.format(LocalDateTime.now()); - String name = "hotspot-" + "pid-" + pid + "-id-" + recording.getId() + "-" + dfText + ".jfr"; + String name = Utils.makeFilename(recording.getRecording()); AccessControlContext acc = recording.getNoDestinationDumpOnExitAccessControlContext(); return AccessController.doPrivileged(new PrivilegedExceptionAction<WriteableUserPath>() { @Override public WriteableUserPath run() throws Exception { - return new WriteableUserPath(Paths.get(".", name)); + return new WriteableUserPath(recording.getDumpOnExitDirectory().toPath().resolve(name)); } }, acc); } catch (PrivilegedActionException e) { Throwable t = e.getCause(); if (t instanceof SecurityException) { - Logger.log(LogTag.JFR, LogLevel.WARN, "Not allowed to create dump path for recording " + recording.getId() + " on exit. " + e.getMessage()); + Logger.log(LogTag.JFR, LogLevel.WARN, "Not allowed to create dump path for recording " + recording.getId() + " on exit."); } if (t instanceof IOException) { - Logger.log(LogTag.JFR, LogLevel.WARN, "Could not dump " + recording.getId() + " on exit. " + e.getMessage()); + Logger.log(LogTag.JFR, LogLevel.WARN, "Could not dump " + recording.getId() + " on exit."); } return null; } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/internal/Utils.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,6 +43,7 @@ import java.lang.reflect.Modifier; import java.nio.file.Path; import java.time.Duration; +import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -55,6 +56,7 @@ import jdk.internal.org.objectweb.asm.util.CheckClassAdapter; import jdk.jfr.Event; import jdk.jfr.FlightRecorderPermission; +import jdk.jfr.Recording; import jdk.jfr.RecordingState; import jdk.jfr.internal.handlers.EventHandler; import jdk.jfr.internal.settings.PeriodSetting; @@ -484,13 +486,6 @@ return Collections.unmodifiableList(list); } - public static void updateSettingPathToGcRoots(Map<String, String> settings, Boolean pathToGcRoots) { - if (pathToGcRoots != null) { - settings.put(Type.EVENT_NAME_PREFIX + "OldObjectSample#cutoff", pathToGcRoots ? "infinity" : "0 ns" ); - } - } - - public static String upgradeLegacyJDKEvent(String eventName) { if (eventName.length() <= LEGACY_EVENT_NAME_PREFIX.length()) { return eventName; @@ -503,4 +498,11 @@ } return eventName; } + + public static String makeFilename(Recording recording) { + String pid = JVM.getJVM().getPid(); + String date = Repository.REPO_DATE_FORMAT.format(LocalDateTime.now()); + String idText = recording == null ? "" : "-id-" + Long.toString(recording.getId()); + return "hotspot-" + "pid-" + pid + idText + "-" + date + ".jfr"; + } } diff -Nru openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/Recording.java openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/Recording.java --- openjdk-11-11~19/src/jdk.jfr/share/classes/jdk/jfr/Recording.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/classes/jdk/jfr/Recording.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,11 +31,11 @@ import java.nio.file.Path; import java.time.Duration; import java.time.Instant; -import java.util.Collections; import java.util.HashMap; import java.util.Map; import java.util.Objects; +import jdk.jfr.internal.PlatformRecorder; import jdk.jfr.internal.PlatformRecording; import jdk.jfr.internal.Type; import jdk.jfr.internal.Utils; @@ -93,11 +93,14 @@ private final PlatformRecording internal; - private Recording(PlatformRecording internal) { - this.internal = internal; - this.internal.setRecording(this); - if (internal.getRecording() != this) { - throw new InternalError("Internal recording not properly setup"); + public Recording(Map<String, String> settings) { + PlatformRecorder r = FlightRecorder.getFlightRecorder().getInternal(); + synchronized (r) { + this.internal = r.newRecording(settings); + this.internal.setRecording(this); + if (internal.getRecording() != this) { + throw new InternalError("Internal recording not properly setup"); + } } } @@ -115,8 +118,8 @@ * FlightRecorderPermission "accessFlightRecorder" is not set. */ public Recording() { - this(FlightRecorder.getFlightRecorder().newInternalRecording(new HashMap<String, String>())); - } + this(new HashMap<String, String>()); + } /** * Creates a recording with settings from a configuration. @@ -145,7 +148,7 @@ * @see Configuration */ public Recording(Configuration configuration) { - this(FlightRecorder.getFlightRecorder().newInternalRecording(configuration.getSettings())); + this(configuration.getSettings()); } /** @@ -370,7 +373,8 @@ */ public void dump(Path destination) throws IOException { Objects.requireNonNull(destination); - internal.copyTo(new WriteableUserPath(destination), "Dumped by user", Collections.emptyMap()); + internal.dump(new WriteableUserPath(destination)); + } /** diff -Nru openjdk-11-11~19/src/jdk.jfr/share/conf/jfr/default.jfc openjdk-11-11~24/src/jdk.jfr/share/conf/jfr/default.jfc --- openjdk-11-11~19/src/jdk.jfr/share/conf/jfr/default.jfc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/conf/jfr/default.jfc 2018-07-25 15:36:46.000000000 +0000 @@ -518,6 +518,11 @@ <setting name="period">endChunk</setting> </event> + <event name="jdk.NetworkUtilization"> + <setting name="enabled">true</setting> + <setting name="period">5 s</setting> + </event> + <event name="jdk.InitialEnvironmentVariable"> <setting name="enabled">true</setting> <setting name="period">beginChunk</setting> diff -Nru openjdk-11-11~19/src/jdk.jfr/share/conf/jfr/profile.jfc openjdk-11-11~24/src/jdk.jfr/share/conf/jfr/profile.jfc --- openjdk-11-11~19/src/jdk.jfr/share/conf/jfr/profile.jfc 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jfr/share/conf/jfr/profile.jfc 2018-07-25 15:36:46.000000000 +0000 @@ -518,6 +518,11 @@ <setting name="period">endChunk</setting> </event> + <event name="jdk.NetworkUtilization"> + <setting name="enabled">true</setting> + <setting name="period">5 s</setting> + </event> + <event name="jdk.InitialEnvironmentVariable"> <setting name="enabled">true</setting> <setting name="period">beginChunk</setting> diff -Nru openjdk-11-11~19/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java openjdk-11-11~24/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java --- openjdk-11-11~19/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/GenerateJLIClassesPlugin.java 2018-07-25 15:36:46.000000000 +0000 @@ -66,6 +66,7 @@ private static final String DMH_NEW_INVOKE_SPECIAL = "newInvokeSpecial"; private static final String DMH_INVOKE_INTERFACE = "invokeInterface"; private static final String DMH_INVOKE_STATIC_INIT = "invokeStaticInit"; + private static final String DMH_INVOKE_SPECIAL_IFC = "invokeSpecialIFC"; private static final String DELEGATING_HOLDER = "java/lang/invoke/DelegatingMethodHandle$Holder"; private static final String BASIC_FORMS_HOLDER = "java/lang/invoke/LambdaForm$Holder"; @@ -132,7 +133,15 @@ * @return the default invoker forms to generate. */ private static Set<String> defaultInvokers() { - return Set.of("LL_L", "LL_I", "LLLL_L", "LLLL_I", "LLIL_L", "LLIL_I", "L6_L"); + return Set.of("LL_L", "LL_I", "LLLL_L", "LLLL_I", "LLIL_L", "LLIL_I", + "L6_L"); + } + + /** + * @return the default call site forms to generate (linkToTargetMethod). + */ + private static Set<String> defaultCallSiteTypes() { + return Set.of("L5_L", "LIL3_L", "ILL_L"); } /** @@ -140,23 +149,27 @@ */ private static Map<String, Set<String>> defaultDMHMethods() { return Map.of( + DMH_INVOKE_INTERFACE, Set.of("LL_L", "L3_I", "L3_V"), DMH_INVOKE_VIRTUAL, Set.of("L_L", "LL_L", "LLI_I", "L3_V"), - DMH_INVOKE_SPECIAL, Set.of("LL_I", "LL_L", "LLF_L", "LLD_L", "L3_L", - "L4_L", "L5_L", "L6_L", "L7_L", "L8_L", "LLI_I", "LLI_L", - "LLIL_I", "LLII_I", "LLII_L", "L3I_L", "L3I_I", "LLILI_I", - "LLIIL_L", "LLIILL_L", "LLIILL_I", "LLIIL_I", "LLILIL_I", - "LLILILL_I", "LLILII_I", "LLI3_I", "LLI3L_I", "LLI3LL_I", - "LLI3_L", "LLI4_I"), + DMH_INVOKE_SPECIAL, Set.of("LL_I", "LL_L", "LLF_L", "LLD_L", + "L3_I", "L3_L", "L4_L", "L5_L", "L6_L", "L7_L", "L8_L", + "LLI_I", "LLI_L", "LLIL_I", "LLIL_L", "LLII_I", "LLII_L", + "L3I_L", "L3I_I", "L3ILL_L", "LLILI_I", "LLIIL_L", "LLIILL_L", + "LLIILL_I", "LLIIL_I", "LLILIL_I", "LLILILL_I", "LLILII_I", + "LLI3_I", "LLI3L_I", "LLI3LL_I", "LLI3_L", "LLI4_I"), DMH_INVOKE_STATIC, Set.of("LII_I", "LIL_I", "LILIL_I", "LILII_I", "L_I", "L_L", "L_V", "LD_L", "LF_L", "LI_I", "LII_L", "LLI_L", - "LL_V", "LL_L", "L3_L", "L4_L", "L5_L", "L6_L", "L7_L", - "L8_L", "L9_L", "L10_L", "L10I_L", "L10II_L", "L10IIL_L", - "L11_L", "L12_L", "L13_L", "L14_L", "L14I_L", "L14II_L"), - DMH_NEW_INVOKE_SPECIAL, Set.of("L_L", "LL_L") + "LL_I", "LLILL_L", "LLIL3_L", "LL_V", "LL_L", "L3_I", "L3_L", + "L3_V", "L4_I", "L4_L", "L5_L", "L6_L", "L7_L", "L8_L", "L9_L", + "L10_L", "L10I_L", "L10II_L", "L10IIL_L", "L11_L", "L12_L", + "L13_L", "L14_L", "L14I_L", "L14II_L"), + DMH_NEW_INVOKE_SPECIAL, Set.of("L_L", "LL_L"), + DMH_INVOKE_SPECIAL_IFC, Set.of("L5_I") ); } - // Map from DirectMethodHandle method type to internal ID + // Map from DirectMethodHandle method type to internal ID, matching values + // of the corresponding constants in java.lang.invoke.MethodTypeForm private static final Map<String, Integer> DMH_METHOD_TYPE_MAP = Map.of( DMH_INVOKE_VIRTUAL, 0, @@ -164,7 +177,8 @@ DMH_INVOKE_SPECIAL, 2, DMH_NEW_INVOKE_SPECIAL, 3, DMH_INVOKE_INTERFACE, 4, - DMH_INVOKE_STATIC_INIT, 5 + DMH_INVOKE_STATIC_INIT, 5, + DMH_INVOKE_SPECIAL_IFC, 20 ); @Override @@ -181,6 +195,8 @@ invokerTypes = defaultInvokers(); validateMethodTypes(invokerTypes); + callSiteTypes = defaultCallSiteTypes(); + dmhMethods = defaultDMHMethods(); for (Set<String> dmhMethodTypes : dmhMethods.values()) { validateMethodTypes(dmhMethodTypes); diff -Nru openjdk-11-11~19/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java openjdk-11-11~24/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java --- openjdk-11-11~19/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.jsobject/share/classes/netscape/javascript/JSObject.java 2018-07-25 15:36:46.000000000 +0000 @@ -151,7 +151,7 @@ * JavaScript engine or if applet is {@code null} * * @deprecated The Applet API is deprecated. See the - * <a href="{@docRoot}/java/applet/package-summary.html"> + * <a href="{@docRoot}/java.desktop/java/applet/package-summary.html"> * java.applet package documentation</a> for further information. */ diff -Nru openjdk-11-11~19/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java openjdk-11-11~24/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java --- openjdk-11-11~19/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.localedata/share/classes/sun/text/resources/ext/FormatData_ja.java 2018-07-25 15:36:46.000000000 +0000 @@ -91,7 +91,7 @@ "\u5927\u6b63", // Taisho "\u662d\u548c", // Showa "\u5e73\u6210", // Heisei - "\u65b0\u5143\u53f7", // NewEra + "\u5143\u53f7", // NewEra }; final String[] rocEras = { "\u6c11\u56fd\u524d", diff -Nru openjdk-11-11~19/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java openjdk-11-11~24/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java --- openjdk-11-11~19/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.localedata/share/classes/sun/text/resources/ext/JavaTimeSupplementary_ja.java 2018-07-25 15:36:46.000000000 +0000 @@ -154,7 +154,7 @@ "\u5927\u6b63", "\u662d\u548c", "\u5e73\u6210", - "\u65b0\u5143\u53f7", // NewEra + "\u5143\u53f7", // NewEra }; final String[] sharedJavaTimeShortEras = { diff -Nru openjdk-11-11~19/src/jdk.localedata/share/legal/cldr.md openjdk-11-11~24/src/jdk.localedata/share/legal/cldr.md --- openjdk-11-11~19/src/jdk.localedata/share/legal/cldr.md 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.localedata/share/legal/cldr.md 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,38 @@ -## Unicode Common Local Data Repository (CLDR) v29 +## Unicode Common Local Data Repository (CLDR) v33 ### CLDR License -<pre> -Copyright © 1991-2016 Unicode, Inc. All rights reserved. +``` -Distributed under the Terms of Use in -http://www.unicode.org/copyright.html. +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE +Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, +http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +Unicode Data Files do not include PDF online code charts under the +directory http://www.unicode.org/Public/. + +Software includes any source code published in the Unicode Standard +or under the directories +http://www.unicode.org/Public/, http://www.unicode.org/reports/, +http://www.unicode.org/cldr/data/, +http://source.icu-project.org/repos/icu/, and +http://www.unicode.org/utility/trac/browser/. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2018 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in http://www.unicode.org/copyright.html. Permission is hereby granted, free of charge, to any person obtaining a copy of the Unicode data files and any associated documentation @@ -15,28 +41,26 @@ without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, and/or sell copies of the Data Files or Software, and to permit persons to whom the Data Files -or Software are furnished to do so, provided that +or Software are furnished to do so, provided that either (a) this copyright and permission notice appear with all copies -of the Data Files or Software, +of the Data Files or Software, or (b) this copyright and permission notice appear in associated -documentation, and -(c) there is clear notice in each modified Data File or in the Software -as well as in the documentation associated with the Data File(s) or -Software that the data or software has been modified. +Documentation. -THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS -NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, -OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, -DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS -ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. - -Except as contained in this notice, the name of a copyright holder shall not -be used in advertising or otherwise to promote the sale, use or other dealings -in these Data Files or Software without prior written authorization of -the copyright holder. +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. -</pre> +``` diff -Nru openjdk-11-11~19/src/jdk.management.jfr/share/classes/jdk/management/jfr/MBeanUtils.java openjdk-11-11~24/src/jdk.management.jfr/share/classes/jdk/management/jfr/MBeanUtils.java --- openjdk-11-11~19/src/jdk.management.jfr/share/classes/jdk/management/jfr/MBeanUtils.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.management.jfr/share/classes/jdk/management/jfr/MBeanUtils.java 2018-07-25 15:36:46.000000000 +0000 @@ -122,7 +122,7 @@ } int size = Integer.parseInt(string); if (size <1) { - throw new IllegalArgumentException("Block size msut be at least 1 byte"); + throw new IllegalArgumentException("Block size must be at least 1 byte"); } return size; } diff -Nru openjdk-11-11~19/src/jdk.net/share/classes/jdk/nio/Channels.java openjdk-11-11~24/src/jdk.net/share/classes/jdk/nio/Channels.java --- openjdk-11-11~19/src/jdk.net/share/classes/jdk/nio/Channels.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.net/share/classes/jdk/nio/Channels.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.nio; + +import java.io.FileDescriptor; +import java.io.IOException; +import java.nio.channels.SelectableChannel; +import java.nio.channels.SelectionKey; +import java.nio.channels.spi.AbstractSelectableChannel; +import java.nio.channels.spi.SelectorProvider; +import java.util.Objects; + +import sun.nio.ch.IOUtil; +import sun.nio.ch.Net; +import sun.nio.ch.SelChImpl; +import sun.nio.ch.SelectionKeyImpl; +import sun.nio.ch.SelectorProviderImpl; + +/** + * Defines static methods to create {@link java.nio.channels.Channel channels}. + * + * <p> Unless otherwise specified, passing a {@code null} argument to any of the + * methods defined here will cause a {@code NullPointerException} to be thrown. + * + * @since 11 + */ + +public final class Channels { + private Channels() { } + + /** + * An object used to coordinate the closing of a selectable channel created + * by {@link Channels#readWriteSelectableChannel readWriteSelectableChannel}. + * + * @since 11 + */ + public interface SelectableChannelCloser { + + /** + * Closes a selectable channel. + * + * <p> This method is invoked by the channel's close method in order to + * perform the actual work of closing the channel. This method is only + * invoked if the channel has not yet been closed, and it is never + * invoked more than once by the channel's close implementation. + * + * <p> An implementation of this method must arrange for any other + * thread that is blocked in an I/O operation upon the channel to return + * immediately, either by throwing an exception or by returning normally. + * If the channel is {@link SelectableChannel#isRegistered registered} + * with one or more {@link java.nio.channels.Selector Selector}s then + * the file descriptor should not be released until the {@link + * #implReleaseChannel implReleaseChannel} method is invoked. </p> + * + * @param sc + * The selectable channel + * + * @throws IOException + * If an I/O error occurs while closing the file descriptor + * + * @see java.nio.channels.spi.AbstractInterruptibleChannel#implCloseChannel + */ + void implCloseChannel(SelectableChannel sc) throws IOException; + + /** + * Release the file descriptor and any resources for a selectable + * channel that closed while registered with one or more {@link + * java.nio.channels.Selector Selector}s. + * + * <p> This method is for cases where a channel is closed when + * {@link java.nio.channels.SelectableChannel#isRegistered registered} + * with one or more {@code Selector}s. A channel may remain registered + * for some time after it is closed. This method is invoked when the + * channel is eventually deregistered from the last {@code Selector} + * that it was registered with. It is invoked at most once. + * + * @apiNote This method is invoked while synchronized on the selector + * and its selected-key set. Great care must be taken to avoid deadlocks + * with other threads that also synchronize on these objects. + * + * @param sc + * The closed selectable channel + * + * @throws IOException + * If an I/O error occurs + * + * @see java.nio.channels.spi.AbstractSelector#deregister + */ + void implReleaseChannel(SelectableChannel sc) throws IOException; + } + + /** + * Creates a selectable channel to a file descriptor that supports an + * {@link SelectableChannel#validOps() operation-set} of + * {@link SelectionKey#OP_READ OP_READ} and + * {@link SelectionKey#OP_WRITE OP_WRITE}. The selectable channel will be + * created by the default {@link SelectorProvider}. + * + * <p> The given file descriptor is a socket or resource that can be + * multiplexed by a {@link java.nio.channels.Selector} for read and write + * readiness. Great care is required to coordinate direct use of the file + * descriptor with the use of the selectable channel. In particular, + * changing the blocking mode or closing the file descriptor without careful + * coordination will result in unspecified and unsafe side effects. The + * given {@link SelectableChannelCloser SelectableChannelCloser} is invoked to + * close the file descriptor and to coordinate the closing when the channel + * is registered with a {@code Selector}. </p> + * + * <p> If there is a security manager set then its + * {@link SecurityManager#checkRead(FileDescriptor) checkRead} and + * {@link SecurityManager#checkWrite(FileDescriptor) checkWrite} methods + * are invoked to check that the caller has permission to both read from and + * write to the file descriptor. </p> + * + * @implNote This method throws {@code UnsupportedOperationException} if + * the default {@code SelectorProvider} is not the JDK built-in implementation. + * + * @param fd + * The file descriptor + * @param closer + * The object to close the channel + * + * @return The selectable channel + * + * @throws IllegalArgumentException + * If the file descriptor is not {@link FileDescriptor#valid() valid} + * @throws SecurityException + * If denied by the security manager + */ + public static SelectableChannel readWriteSelectableChannel(FileDescriptor fd, + SelectableChannelCloser closer) { + Objects.requireNonNull(closer); + if (!fd.valid()) + throw new IllegalArgumentException("file descriptor is not valid"); + + SecurityManager sm = System.getSecurityManager(); + if (sm != null) { + sm.checkRead(fd); + sm.checkWrite(fd); + } + + SelectorProvider provider = SelectorProvider.provider(); + if (!(provider instanceof SelectorProviderImpl)) + throw new UnsupportedOperationException("custom SelectorProvider"); + + return new ReadWriteChannelImpl((SelectorProviderImpl)provider, fd, closer); + } + + private static final class ReadWriteChannelImpl + extends AbstractSelectableChannel implements SelChImpl + { + private final FileDescriptor fd; + private final int fdVal; + private final SelectableChannelCloser closer; + + ReadWriteChannelImpl(SelectorProviderImpl provider, + FileDescriptor fd, + SelectableChannelCloser closer) { + super(provider); + this.fd = fd; + this.fdVal = IOUtil.fdVal(fd); + this.closer = closer; + } + + @Override + public FileDescriptor getFD() { + return fd; + } + + @Override + public int getFDVal() { + return fdVal; + } + + @Override + public int validOps() { + return (SelectionKey.OP_READ | SelectionKey.OP_WRITE); + } + + private boolean translateReadyOps(int ops, + int initialOps, + SelectionKeyImpl ski) { + int intOps = ski.nioInterestOps(); + int oldOps = ski.nioReadyOps(); + int newOps = initialOps; + + if ((ops & (Net.POLLERR | Net.POLLHUP)) != 0) { + newOps = intOps; + ski.nioReadyOps(newOps); + return (newOps & ~oldOps) != 0; + } + + if (((ops & Net.POLLIN) != 0) && + ((intOps & SelectionKey.OP_READ) != 0)) + newOps |= SelectionKey.OP_READ; + + if (((ops & Net.POLLOUT) != 0) && + ((intOps & SelectionKey.OP_WRITE) != 0)) + newOps |= SelectionKey.OP_WRITE; + + ski.nioReadyOps(newOps); + return (newOps & ~oldOps) != 0; + } + + @Override + public boolean translateAndUpdateReadyOps(int ops, SelectionKeyImpl ski) { + return translateReadyOps(ops, ski.nioReadyOps(), ski); + } + + @Override + public boolean translateAndSetReadyOps(int ops, SelectionKeyImpl ski) { + return translateReadyOps(ops, 0, ski); + } + + @Override + public int translateInterestOps(int ops) { + int newOps = 0; + if ((ops & SelectionKey.OP_READ) != 0) + newOps |= Net.POLLIN; + if ((ops & SelectionKey.OP_WRITE) != 0) + newOps |= Net.POLLOUT; + return newOps; + } + + @Override + protected void implConfigureBlocking(boolean block) throws IOException { + IOUtil.configureBlocking(fd, block); + } + + @Override + protected void implCloseSelectableChannel() throws IOException { + closer.implCloseChannel(this); + } + + @Override + public void kill() throws IOException { + closer.implReleaseChannel(this); + } + } +} diff -Nru openjdk-11-11~19/src/jdk.net/share/classes/jdk/nio/package-info.java openjdk-11-11~24/src/jdk.net/share/classes/jdk/nio/package-info.java --- openjdk-11-11~19/src/jdk.net/share/classes/jdk/nio/package-info.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/src/jdk.net/share/classes/jdk/nio/package-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Defines JDK-specific {@link java.nio.channels.Channel channel} APIs. + * + * @since 11 + */ + +package jdk.nio; diff -Nru openjdk-11-11~19/src/jdk.net/share/classes/module-info.java openjdk-11-11~24/src/jdk.net/share/classes/module-info.java --- openjdk-11-11~19/src/jdk.net/share/classes/module-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.net/share/classes/module-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,5 +31,6 @@ */ module jdk.net { exports jdk.net; + exports jdk.nio; } diff -Nru openjdk-11-11~19/src/jdk.pack/share/native/common-unpack/unpack.cpp openjdk-11-11~24/src/jdk.pack/share/native/common-unpack/unpack.cpp --- openjdk-11-11~19/src/jdk.pack/share/native/common-unpack/unpack.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.pack/share/native/common-unpack/unpack.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -1799,6 +1799,7 @@ case 'B': case 'H': case 'I': case 'V': // unsigned_int case 'S': // signed_int --lp; // reparse + /* fall through */ case 'F': lp = parseIntLayout(lp, b, EK_INT); break; @@ -2680,6 +2681,9 @@ PRINTCR((1, "counted %d [redefined = %d predefined = %d] attributes of type %s.%s", count, isRedefined(idx), isPredefined(idx), ATTR_CONTEXT_NAME[attrc], lo->name)); + } else { + abort("layout_definition pointer must not be NULL"); + return; } bool hasCallables = lo->hasCallables(); band** bands = lo->bands(); @@ -3709,7 +3713,7 @@ case CONSTANT_Signature: if (value.b.ptr == null) return ref(0)->string(); - // else fall through: + /* fall through */ case CONSTANT_Utf8: buf = value.b; break; @@ -4216,6 +4220,7 @@ case _invokeinit_self_option: classRef = thisClass; break; case _invokeinit_super_option: classRef = superClass; break; default: assert(bc == _invokeinit_op+_invokeinit_new_option); + /* fall through */ case _invokeinit_new_option: classRef = newClass; break; } wp[-1] = origBC; // overwrite with origBC diff -Nru openjdk-11-11~19/src/jdk.pack/share/native/common-unpack/zip.cpp openjdk-11-11~24/src/jdk.pack/share/native/common-unpack/zip.cpp --- openjdk-11-11~19/src/jdk.pack/share/native/common-unpack/zip.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.pack/share/native/common-unpack/zip.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -579,8 +579,14 @@ fseek(u->infileptr, -TRAILER_LEN, SEEK_END); uint filecrc; uint filelen; - fread(&filecrc, sizeof(filecrc), 1, u->infileptr); - fread(&filelen, sizeof(filelen), 1, u->infileptr); + if (fread(&filecrc, sizeof(filecrc), 1, u->infileptr) != 1) { + fprintf(u->errstrm, "Error:reading CRC information on input file failed err=%d\n",errno); + exit(1); + } + if (fread(&filelen, sizeof(filelen), 1, u->infileptr) != 1) { + fprintf(u->errstrm, "Error:reading file length on input file failed err=%d\n",errno); + exit(1); + } filecrc = SWAP_INT(filecrc); filelen = SWAP_INT(filelen); if (u->gzin->gzcrc != filecrc || diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/linker/NashornLinkerExporter.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/linker/NashornLinkerExporter.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/linker/NashornLinkerExporter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/linker/NashornLinkerExporter.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,6 +42,7 @@ * can use the linkers exported by this provider to support tight integration * of Nashorn objects. */ +@Deprecated(since="11", forRemoval=true) public final class NashornLinkerExporter extends GuardingDynamicLinkerExporter { /** * The default constructor. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,8 +38,12 @@ * operations like obj[i], obj.foo, obj.func(), delete obj.foo will be delegated * to appropriate method call of this class. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public abstract class AbstractJSObject implements JSObject { /** * The default constructor. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ClassFilter.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ClassFilter.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ClassFilter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ClassFilter.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,8 +29,12 @@ * jsr-223 program embedding nashorn script can set ClassFilter instance * to be used when an engine instance is created. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public interface ClassFilter { /** * Should the Java class of the specified name be exposed to scripts? diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,8 +35,12 @@ * operations like obj[i], obj.foo, obj.func(), delete obj.foo will be delegated * to appropriate method call of this interface. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public interface JSObject { /** * Call this object as a JavaScript function. This is equivalent to diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornException.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornException.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornException.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,8 +42,12 @@ * interface. In these cases, user code will get an instance of this or * implementation defined subclass. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) @SuppressWarnings("serial") public abstract class NashornException extends RuntimeException { private static final long serialVersionUID = 1L; diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngineFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -46,8 +46,12 @@ * Programs executing in engines created using {@link #getScriptEngine(String[])} will have the passed arguments * accessible as a global variable named {@code "arguments"}. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class NashornScriptEngineFactory implements ScriptEngineFactory { @Override public String getEngineName() { diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/NashornScriptEngine.java 2018-07-25 15:36:46.000000000 +0000 @@ -67,8 +67,12 @@ * {@link Invocable} interfaces, allowing for efficient precompilation and repeated execution of scripts. * @see NashornScriptEngineFactory * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class NashornScriptEngine extends AbstractScriptEngine implements Compilable, Invocable { /** * Key used to associate Nashorn global object mirror with arbitrary Bindings instance. @@ -135,6 +139,10 @@ } }, CREATE_CONTEXT_ACC_CTXT); + if (!nashornContext.getEnv()._no_deprecation_warning) { + System.err.println("Warning: Nashorn engine is planned to be removed from a future JDK release"); + } + // cache this option that is used often this._global_per_engine = nashornContext.getEnv()._global_per_engine; diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptObjectMirror.java 2018-07-25 15:36:46.000000000 +0000 @@ -58,8 +58,12 @@ /** * Mirror object that wraps a given Nashorn Script object. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class ScriptObjectMirror extends AbstractJSObject implements Bindings { private static AccessControlContext getContextAccCtxt() { final Permissions perms = new Permissions(); diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptUtils.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptUtils.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptUtils.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/ScriptUtils.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,12 @@ /** * Utilities that are to be called from script code. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class ScriptUtils { private ScriptUtils() {} diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/URLReader.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,12 @@ * A Reader that reads from a URL. Used to make sure that the reader * reads content from given URL and can be trusted to do so. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 1.8u40 */ +@Deprecated(since="11", forRemoval=true) public final class URLReader extends Reader { // underlying URL private final URL url; diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayAccessTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * <em>expression</em> [ <em>index</em> ] * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ArrayAccessTree extends ExpressionTree { /** * Returns the array that is accessed. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ArrayLiteralTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,8 +30,12 @@ /** * Represents ECMAScript array literal expression. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ArrayLiteralTree extends ExpressionTree { /** * Returns the list of Array element expressions. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/AssignmentTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * <em>variable</em> = <em>expression</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface AssignmentTree extends ExpressionTree { /** * Returns the left hand side (LHS) of this assignment. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BinaryTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>leftOperand</em> <em>operator</em> <em>rightOperand</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface BinaryTree extends ExpressionTree { /** * Returns left hand side (LHS) of this binary expression. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BlockTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,12 @@ * { <em>statements</em> } * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface BlockTree extends StatementTree { /** * Returns the list of statements in this block. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/BreakTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,8 +35,12 @@ * break <em>label</em> ; * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface BreakTree extends GotoTree { /** * Label associated with this break statement. This is null diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CaseTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,8 +39,12 @@ * <em>statements</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface CaseTree extends Tree { /** * Case expression of this 'case' statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CatchTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>block</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface CatchTree extends Tree { /** * Returns the catch parameter identifier or parameter binding pattern of the exception caught. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassDeclarationTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassDeclarationTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassDeclarationTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassDeclarationTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,8 +29,12 @@ /** * A tree node that represents a <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions">class declaration</a>. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ClassDeclarationTree extends StatementTree { /** diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassExpressionTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassExpressionTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassExpressionTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ClassExpressionTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,8 +30,12 @@ /** * A tree node that represents a <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-class-definitions">class expression</a>. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ClassExpressionTree extends ExpressionTree { /** * Class identifier. Optional. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompilationUnitTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,8 +31,12 @@ * Represents the abstract syntax tree for compilation units (source * files) * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface CompilationUnitTree extends Tree { /** * Return the list of source elements in this compilation unit. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/CompoundAssignmentTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>variable</em> <em>operator</em> <em>expression</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface CompoundAssignmentTree extends ExpressionTree { /** * Returns the left hand side (LHS) of this assignment. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalExpressionTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * <em>condition</em> ? <em>trueExpression</em> : <em>falseExpression</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ConditionalExpressionTree extends ExpressionTree { /** * Returns the condition expression of this ternary expression. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ConditionalLoopTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,8 +28,12 @@ /** * A mixin for conditional "loop" statements. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ConditionalLoopTree extends LoopTree { /** * Returns the condition expression of this 'loop' statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ContinueTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * continue <em>label</em> ; * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ContinueTree extends GotoTree { /** * Label associated with this continue statement. This is null diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DebuggerTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,7 +33,11 @@ * <em>debugger;</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface DebuggerTree extends StatementTree { } diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Diagnostic.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,8 +40,12 @@ * <p>Line terminator is as defined in ECMAScript specification which is one * of { \u000A, \u000B, \u2028, \u2029 }. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface Diagnostic { /** @@ -55,7 +59,11 @@ * should imply any inherent semantic meaning to the message * of the diagnostic: for example, a tool might provide an * option to report all warnings as errors. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ + @Deprecated(since="11", forRemoval=true) enum Kind { /** * Problem which prevents the tool's normal completion. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DiagnosticListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,8 +28,12 @@ /** * Interface for receiving diagnostics from Nashorn parser. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) @FunctionalInterface public interface DiagnosticListener { /** diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/DoWhileLoopTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,8 +35,12 @@ * while ( <em>expression</em> ); * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface DoWhileLoopTree extends ConditionalLoopTree { /** * Returns the condition expression of this do-while statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/EmptyStatementTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,6 +33,10 @@ * ; * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface EmptyStatementTree extends StatementTree {} diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ErroneousTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,7 +28,11 @@ /** * A tree node to stand in for a malformed expression. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ErroneousTree extends ExpressionTree { } diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExportEntryTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExportEntryTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExportEntryTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExportEntryTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,7 +28,11 @@ /** * A Tree node for export entry in <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-modules">Module information</a>. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ +@Deprecated(since="11", forRemoval=true) public interface ExportEntryTree extends Tree { /** * Returns the entry's export name. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionStatementTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * <em>expression</em> ; * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ExpressionStatementTree extends StatementTree { /** * Returns the expression of this expression statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ExpressionTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,6 +29,10 @@ * A tree node used as the base class for the different types of * expressions. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ExpressionTree extends Tree {} diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForInLoopTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>statement</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ForInLoopTree extends LoopTree { /** * The for..in left hand side expression. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForLoopTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>statement</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ForLoopTree extends ConditionalLoopTree { /** * Returns the initializer expression of this 'for' statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ForOfLoopTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>statement</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ForOfLoopTree extends LoopTree { /** * The for..of left hand side expression. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionCallTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,12 @@ * this . <em>identifier</em> ( <em>arguments</em> ) * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface FunctionCallTree extends ExpressionTree { /** * Returns the function being called. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionDeclarationTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,8 +43,12 @@ * <em>body</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface FunctionDeclarationTree extends StatementTree { /** * Returns the name of the function being declared. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/FunctionExpressionTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,8 +41,12 @@ * <em>var</em> func = <em>(x) => x+1</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface FunctionExpressionTree extends ExpressionTree { /** * Returns the name of the function being declared. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/GotoTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,8 +31,12 @@ * type serves as a super interface for {@link BreakTree} and * {@link ContinueTree}. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface GotoTree extends StatementTree { /** * Label associated with this goto statement. This is null diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IdentifierTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * <em>name</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface IdentifierTree extends ExpressionTree { /** * Returns the name of this identifier. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/IfTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,8 +39,12 @@ * <em>elseStatement</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface IfTree extends StatementTree { /** * Returns the condition expression of this 'if' statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ImportEntryTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ImportEntryTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ImportEntryTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ImportEntryTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,7 +28,11 @@ /** * A Tree node for import entry of <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-modules">Module information</a>. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ +@Deprecated(since="11", forRemoval=true) public interface ImportEntryTree extends Tree { /** * Returns the entry's module request. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/InstanceOfTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * <em>expression</em> instanceof <em>type</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface InstanceOfTree extends ExpressionTree { /** * Returns the expression whose type is being checked. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LabeledStatementTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * <em>label</em> : <em>statement</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface LabeledStatementTree extends StatementTree { /** * Returns the label associated with this statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LineMap.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,8 +29,12 @@ * Provides methods to convert between character positions and line numbers * for a compilation unit. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface LineMap { /** * Find the line containing a position; a line termination diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LiteralTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>value</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface LiteralTree extends ExpressionTree { /** * Returns the value of this literal. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/LoopTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,8 +28,12 @@ /** * A mixin for "loop" statements. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface LoopTree extends StatementTree { /** * Returns the statement contained in this 'loop' statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/MemberSelectTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * <em>expression</em> . <em>identifier</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface MemberSelectTree extends ExpressionTree { /** * The object expression whose member is being selected. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ModuleTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ModuleTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ModuleTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ModuleTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,7 +28,11 @@ /** * A Tree node for <a href="http://www.ecma-international.org/ecma-262/6.0/#sec-modules">Module information</a>. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ +@Deprecated(since="11", forRemoval=true) public interface ModuleTree extends Tree { /** * Returns the list of import entries. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/NewTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,8 +35,12 @@ * new <em>identifier</em> ( <em>arguments</em> ) * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface NewTree extends ExpressionTree { /** * Returns the constructor expression of this 'new' expression. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ObjectLiteralTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,8 +30,12 @@ /** * Represents ECMAScript object literal expression. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ObjectLiteralTree extends ExpressionTree { /** * Returns the list of properties of this object literal. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ParenthesizedTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * ( <em>expression</em> ) * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ParenthesizedTree extends ExpressionTree { /** * Returns the expression within the parenthesis. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Parser.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,8 +36,12 @@ /** * Represents nashorn ECMAScript parser instance. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface Parser { /** * Parses the source file and returns compilation unit tree diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/PropertyTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,8 +28,12 @@ /** * To represent property setting in an object literal tree. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface PropertyTree extends Tree { /** * Returns the name of this property. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/RegExpLiteralTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,8 +28,12 @@ /** * Represents regular expression literal in the source code. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface RegExpLiteralTree extends ExpressionTree { /** * Regular expression pattern to match. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ReturnTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * return <em>expression</em>; * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ReturnTree extends StatementTree { /** * Returns the expression being returned. This is null if no value diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES5_1.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,12 +40,16 @@ * subclasses with {@link java.lang.Override @Override} will help * ensure that methods are overridden as intended. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @param <R> the return type of this visitor's methods. Use {@link * Void} for visitors that do not need to return results. * @param <P> the type of the additional parameter to this visitor's * methods. Use {@code Void} for visitors that do not need an * additional parameter. */ +@Deprecated(since="11", forRemoval=true) public class SimpleTreeVisitorES5_1<R, P> implements TreeVisitor<R, P> { @Override public R visitAssignment(final AssignmentTree node, final P r) { diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES6.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES6.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES6.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SimpleTreeVisitorES6.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,12 +42,16 @@ * subclasses with {@link java.lang.Override @Override} will help * ensure that methods are overridden as intended. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @param <R> the return type of this visitor's methods. Use {@link * Void} for visitors that do not need to return results. * @param <P> the type of the additional parameter to this visitor's * methods. Use {@code Void} for visitors that do not need an * additional parameter. */ +@Deprecated(since="11", forRemoval=true) public class SimpleTreeVisitorES6<R, P> extends SimpleTreeVisitorES5_1<R, P> { @Override public R visitCompilationUnit(final CompilationUnitTree node, final P r) { diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SpreadTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SpreadTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SpreadTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SpreadTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,7 +27,11 @@ /** * A tree node for spread operator in array elements, function call arguments. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ +@Deprecated(since="11", forRemoval=true) public interface SpreadTree extends ExpressionTree { /** * Returns the expression that is being spread. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/StatementTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,7 +29,11 @@ * A tree node used as the base class for the different kinds of * statements. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface StatementTree extends Tree { } diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/SwitchTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,12 @@ * } * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface SwitchTree extends StatementTree { /** * Returns the expression on which this statement switches. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TemplateLiteralTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TemplateLiteralTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TemplateLiteralTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TemplateLiteralTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,13 @@ * `This is a String with ${computed} values in it` * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 * */ +@Deprecated(since="11", forRemoval=true) public interface TemplateLiteralTree extends ExpressionTree { /** * Returns the list of expressions in this template string diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/ThrowTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * throw <em>expression</em>; * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface ThrowTree extends StatementTree { /** * Returns the expression being thrown. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/Tree.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,13 +31,21 @@ * <p><b>WARNING:</b> This interface and its sub-interfaces are * subject to change as the ECMAScript programming language evolves. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface Tree { /** * Enumerates all kinds of trees. + * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. */ + @Deprecated(since="11", forRemoval=true) public enum Kind { /** * Used for instances of {@link ArrayAccessTree}. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TreeVisitor.java 2018-07-25 15:36:46.000000000 +0000 @@ -45,6 +45,9 @@ default method bodies will be introduced which will call visitUnknown method as a fallback. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @param <R> the return type of this visitor's methods. Use {@link * Void} for visitors that do not need to return results. * @param <P> the type of the additional parameter to this visitor's @@ -53,6 +56,7 @@ * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface TreeVisitor<R,P> { /** * Visit assignment tree. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/TryTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,8 +39,12 @@ * <em>finallyBlock</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface TryTree extends StatementTree { /** * Returns the 'try' block of this 'try' statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnaryTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,8 +36,12 @@ * <em>expression</em> <em>operator</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface UnaryTree extends ExpressionTree { /** * Returns the expression operated by the unary operator. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/UnknownTreeException.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,8 +33,12 @@ * {@linkplain TreeVisitor tree visitor} to indicate that the * visitor was created for a prior version of the language. * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public class UnknownTreeException extends RuntimeException { private static final long serialVersionUID = 1L; diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/VariableTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>var</em> <em>binding_pattern</em> [ <em>initializer</em> ]; * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface VariableTree extends StatementTree { /** * Returns the binding of this declaration. This is an {@link IdentifierTree} diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WhileLoopTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>statement</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface WhileLoopTree extends ConditionalLoopTree { /** * The condition expression of this 'while' statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/WithTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,12 @@ * <em>statement</em> * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface WithTree extends StatementTree { /** * The scope object expression for this 'with' statement. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/YieldTree.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/YieldTree.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/YieldTree.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/tree/YieldTree.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,12 @@ * } * </pre> * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @since 9 */ +@Deprecated(since="11", forRemoval=true) public interface YieldTree extends ExpressionTree { /** * Returns the expression that is yielded. diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/resources/Options.properties 2018-07-25 15:36:46.000000000 +0000 @@ -223,6 +223,14 @@ type=Log \ } +nashorn.option.no.deprecation.warning = { \ + name="--no-deprecation-warning", \ + type=Boolean, \ + default=false, \ + desc="Do not show nashorn deprecation warning." \ +} + + nashorn.option.lazy.compilation = { \ name="--lazy-compilation", \ is_undocumented=true, \ diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptEnvironment.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptEnvironment.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptEnvironment.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptEnvironment.java 2018-07-25 15:36:46.000000000 +0000 @@ -108,6 +108,8 @@ /** Enable experimental ECMAScript 6 features. */ public final boolean _es6; + /** do not show deprecation warning for nashorn engine and jjs usage. */ + public final boolean _no_deprecation_warning; /** Number of times a dynamic call site has to be relinked before it is * considered unstable (and thus should be linked as if it were megamorphic). @@ -306,6 +308,7 @@ _strict = options.getBoolean("strict"); _version = options.getBoolean("version"); _verify_code = options.getBoolean("verify.code"); + _no_deprecation_warning = options.getBoolean("no.deprecation.warning"); final int configuredUrt = options.getInteger("unstable.relink.threshold"); // The default for this property is -1, so we can easily detect when diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/tools/Shell.java 2018-07-25 15:36:46.000000000 +0000 @@ -170,6 +170,9 @@ final Global global = context.createGlobal(); final ScriptEnvironment env = context.getEnv(); + if (!env._no_deprecation_warning) { + System.err.println("Warning: The jjs tool is planned to be removed from a future JDK release"); + } final List<String> files = env.getFiles(); if (files.isEmpty()) { return readEvalPrint(context, global); diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/module-info.java openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/module-info.java --- openjdk-11-11~19/src/jdk.scripting.nashorn/share/classes/module-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn/share/classes/module-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -135,10 +135,14 @@ * non-standard built-in objects: * {@code JSAdapter}, {@code JavaImporter}, {@code Packages} * + * @deprecated Nashorn JavaScript script engine and APIs, and the jjs tool + * are deprecated with the intent to remove them in a future release. + * * @provides javax.script.ScriptEngineFactory * @moduleGraph * @since 9 */ +@Deprecated(since="11", forRemoval=true) module jdk.scripting.nashorn { requires java.logging; requires jdk.dynalink; diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java openjdk-11-11~24/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java --- openjdk-11-11~19/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn.shell/share/classes/jdk/nashorn/tools/jjs/Main.java 2018-07-25 15:36:46.000000000 +0000 @@ -60,6 +60,7 @@ /** * Interactive command line Shell for Nashorn. */ +@Deprecated(since="11", forRemoval=true) public final class Main extends Shell { private Main() {} diff -Nru openjdk-11-11~19/src/jdk.scripting.nashorn.shell/share/classes/module-info.java openjdk-11-11~24/src/jdk.scripting.nashorn.shell/share/classes/module-info.java --- openjdk-11-11~19/src/jdk.scripting.nashorn.shell/share/classes/module-info.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.scripting.nashorn.shell/share/classes/module-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,6 +37,7 @@ * @moduleGraph * @since 9 */ +@Deprecated(since="11", forRemoval=true) module jdk.scripting.nashorn.shell { requires static java.compiler; requires jdk.internal.le; diff -Nru openjdk-11-11~19/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java openjdk-11-11~24/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java --- openjdk-11-11~19/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.security.auth/share/classes/com/sun/security/auth/UnixNumericGroupPrincipal.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ package com.sun.security.auth; import java.security.Principal; +import java.util.Objects; /** * This class implements the {@code Principal} interface @@ -195,6 +196,6 @@ * @return a hash code for this {@code UnixNumericGroupPrincipal}. */ public int hashCode() { - return toString().hashCode(); + return Objects.hash(name, isPrimaryGroup()); } } diff -Nru openjdk-11-11~19/src/jdk.security.auth/unix/native/libjaas/Unix.c openjdk-11-11~24/src/jdk.security.auth/unix/native/libjaas/Unix.c --- openjdk-11-11~19/src/jdk.security.auth/unix/native/libjaas/Unix.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/src/jdk.security.auth/unix/native/libjaas/Unix.c 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -64,6 +64,9 @@ jclass cls; numSuppGroups = getgroups(0, NULL); + if (numSuppGroups == -1) { + return; + } groups = (gid_t *)calloc(numSuppGroups, sizeof(gid_t)); if (groups == NULL) { jclass cls = (*env)->FindClass(env,"java/lang/OutOfMemoryError"); diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp openjdk-11-11~24/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/g1/test_g1HeapVerifier.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,8 @@ // Default is to verify everything. ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyAll)); - ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly)); - ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyInitialMark)); + ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal)); + ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyConcurrentStart)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup)); @@ -47,18 +47,18 @@ // Setting one will disable all other. G1Arguments::parse_verification_type("full"); ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyAll)); - ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly)); - ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyInitialMark)); + ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal)); + ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyConcurrentStart)); ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed)); ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark)); ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyCleanup)); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyFull)); // Verify case sensitivity. - G1Arguments::parse_verification_type("YOUNG-ONLY"); - ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly)); - G1Arguments::parse_verification_type("young-only"); - ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungOnly)); + G1Arguments::parse_verification_type("YOUNG-NORMAL"); + ASSERT_FALSE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal)); + G1Arguments::parse_verification_type("young-normal"); + ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyYoungNormal)); // Verify perfect match G1Arguments::parse_verification_type("mixedgc"); @@ -69,7 +69,7 @@ ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyMixed)); // Verify the last three - G1Arguments::parse_verification_type("initial-mark"); + G1Arguments::parse_verification_type("concurrent-start"); G1Arguments::parse_verification_type("remark"); G1Arguments::parse_verification_type("cleanup"); ASSERT_TRUE(G1HeapVerifier::should_verify(G1HeapVerifier::G1VerifyRemark)); diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/g1/test_heapRegion.cpp openjdk-11-11~24/test/hotspot/gtest/gc/g1/test_heapRegion.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/g1/test_heapRegion.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/g1/test_heapRegion.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,6 +27,9 @@ #include "gc/g1/g1ConcurrentMarkBitMap.inline.hpp" #include "gc/g1/heapRegion.inline.hpp" #include "gc/shared/referenceProcessor.hpp" +#include "runtime/interfaceSupport.inline.hpp" +#include "runtime/vm_operations.hpp" +#include "runtime/vmThread.hpp" #include "unittest.hpp" class VerifyAndCountMarkClosure : public StackObj { @@ -60,11 +63,12 @@ #define MARK_OFFSET_2 ( 99 * MinObjAlignment) #define MARK_OFFSET_3 (337 * MinObjAlignment) -TEST_OTHER_VM(HeapRegion, apply_to_marked_objects) { - if (!UseG1GC) { - return; - } +class VM_HeapRegionApplyToMarkedObjectsTest : public VM_GTestExecuteAtSafepoint { +public: + void doit(); +}; +void VM_HeapRegionApplyToMarkedObjectsTest::doit() { G1CollectedHeap* heap = G1CollectedHeap::heap(); // Using region 0 for testing. @@ -80,6 +84,8 @@ VerifyAndCountMarkClosure cl(bitmap); + HeapWord* old_top = region->top(); + // When top is equal to bottom the closure should not be // applied to any object because apply_to_marked_objects // will stop at HeapRegion::scan_limit which is equal to top. @@ -112,5 +118,19 @@ region->apply_to_marked_objects(bitmap, &cl); EXPECT_EQ(4, cl.count()); cl.reset(); + + region->set_top(old_top); } +TEST_VM(HeapRegion, apply_to_marked_object) { + if (!UseG1GC) { + return; + } + + // Run the test in our very own safepoint, because otherwise it + // modifies a region behind the back of a possibly using allocation + // or running GC. + VM_HeapRegionApplyToMarkedObjectsTest op; + ThreadInVMfromNative invm(JavaThread::current()); + VMThread::execute(&op); +} diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zAddress.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zAddress.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zAddress.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zAddress.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * 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" diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zArray.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zArray.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zArray.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zArray.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * 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" diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zBitField.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zBitField.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zBitField.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zBitField.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * 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" diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zBitMap.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zBitMap.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zBitMap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zBitMap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * 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" diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zForwardingTable.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zForwardingTable.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zForwardingTable.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zForwardingTable.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * 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" diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zList.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zList.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zList.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zList.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * 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" diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zLiveMap.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zLiveMap.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zLiveMap.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zLiveMap.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * 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" diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zPhysicalMemory.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zPhysicalMemory.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zPhysicalMemory.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zPhysicalMemory.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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" @@ -37,6 +55,9 @@ ZPhysicalMemoryManager pmem_manager(10 * SegmentSize, SegmentSize); + pmem_manager.try_ensure_unused_capacity(10 * SegmentSize); + EXPECT_EQ(pmem_manager.unused_capacity(), 10 * SegmentSize); + ZPhysicalMemory pmem = pmem_manager.alloc(8 * SegmentSize); EXPECT_EQ(pmem.nsegments(), 1u) << "wrong number of segments"; diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zUtils.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zUtils.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zUtils.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zUtils.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * 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" diff -Nru openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zVirtualMemory.cpp openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zVirtualMemory.cpp --- openjdk-11-11~19/test/hotspot/gtest/gc/z/test_zVirtualMemory.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/gc/z/test_zVirtualMemory.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,24 @@ /* * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. + * 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" diff -Nru openjdk-11-11~19/test/hotspot/gtest/jfr/test_networkUtilization.cpp openjdk-11-11~24/test/hotspot/gtest/jfr/test_networkUtilization.cpp --- openjdk-11-11~19/test/hotspot/gtest/jfr/test_networkUtilization.cpp 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/jfr/test_networkUtilization.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,366 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +#include "precompiled.hpp" + +// This test performs mocking of certain JVM functionality. This works by +// including the source file under test inside an anonymous namespace (which +// prevents linking conflicts) with the mocked symbols redefined. + +// The include list should mirror the one found in the included source file - +// with the ones that should pick up the mocks removed. Those should be included +// later after the mocks have been defined. + +#include "logging/log.hpp" +#include "jfr/jfrEvents.hpp" +#include "jfr/metadata/jfrSerializer.hpp" +#include "jfr/periodic/jfrOSInterface.hpp" +#include "jfr/utilities/jfrTime.hpp" +#include "jfr/utilities/jfrTypes.hpp" +#include "runtime/os_perf.hpp" +#include "utilities/globalDefinitions.hpp" +#include "utilities/growableArray.hpp" + +#include "unittest.hpp" + +#include <vector> +#include <list> +#include <map> + +namespace { + + class MockFastUnorderedElapsedCounterSource : public ::FastUnorderedElapsedCounterSource { + public: + static jlong current_ticks; + static Type now() { + return current_ticks; + } + static uint64_t nanoseconds(Type value) { + return value; + } + }; + + typedef TimeInstant<CounterRepresentation, MockFastUnorderedElapsedCounterSource> MockJfrTicks; + typedef TimeInterval<CounterRepresentation, MockFastUnorderedElapsedCounterSource> MockJfrTickspan; + + class MockJfrCheckpointWriter { + public: + traceid current; + std::map<traceid, std::string> ids; + + const JfrCheckpointContext context() const { + return JfrCheckpointContext(); + } + intptr_t reserve(size_t size) { + return 0; + } + void write_key(traceid id) { + current = id; + } + void write(const char* data) { + ids[current] = data; + } + void set_context(const JfrCheckpointContext ctx) { } + void write_count(u4 nof_entries, jlong offset) { } + }; + + class MockJfrSerializer { + public: + static MockJfrSerializer* current; + + static bool register_serializer(JfrTypeId id, bool require_safepoint, bool permit_cache, MockJfrSerializer* serializer) { + current = serializer; + return true; + } + + virtual void serialize(MockJfrCheckpointWriter& writer) = 0; + }; + + MockJfrSerializer* MockJfrSerializer::current; + + class MockEventNetworkUtilization : public ::EventNetworkUtilization + { + public: + std::string iface; + s8 readRate; + s8 writeRate; + static std::vector<MockEventNetworkUtilization> committed; + MockJfrCheckpointWriter writer; + + public: + MockEventNetworkUtilization(EventStartTime timing=TIMED) : + ::EventNetworkUtilization(timing) { + } + + void set_networkInterface(traceid new_value) { + MockJfrSerializer::current->serialize(writer); + iface = writer.ids[new_value]; + } + void set_readRate(s8 new_value) { + readRate = new_value; + } + void set_writeRate(s8 new_value) { + writeRate = new_value; + } + + void commit() { + committed.push_back(*this); + } + + void set_starttime(const MockJfrTicks& time) {} + + void set_endtime(const MockJfrTicks& time) {} + + static const MockEventNetworkUtilization& get_committed(const std::string& name) { + static MockEventNetworkUtilization placeholder; + for (std::vector<MockEventNetworkUtilization>::const_iterator i = committed.begin(); + i != committed.end(); + ++i) { + if (name == i->iface) { + return *i; + } + } + return placeholder; + } + }; + + std::vector<MockEventNetworkUtilization> MockEventNetworkUtilization::committed; + + jlong MockFastUnorderedElapsedCounterSource::current_ticks; + + struct MockNetworkInterface { + std::string name; + uint64_t bytes_in; + uint64_t bytes_out; + MockNetworkInterface(std::string name, uint64_t bytes_in, uint64_t bytes_out) + : name(name), + bytes_in(bytes_in), + bytes_out(bytes_out) { + + } + bool operator==(const MockNetworkInterface& rhs) const { + return name == rhs.name; + } + }; + + class NetworkInterface : public ::NetworkInterface { + public: + NetworkInterface(const char* name, uint64_t bytes_in, uint64_t bytes_out, NetworkInterface* next) + : ::NetworkInterface(name, bytes_in, bytes_out, next) { + } + NetworkInterface* next(void) const { + return reinterpret_cast<NetworkInterface*>(::NetworkInterface::next()); + } + }; + + class MockJfrOSInterface { + static std::list<MockNetworkInterface> _interfaces; + + public: + MockJfrOSInterface() { + } + static int network_utilization(NetworkInterface** network_interfaces) { + *network_interfaces = NULL; + for (std::list<MockNetworkInterface>::const_iterator i = _interfaces.begin(); + i != _interfaces.end(); + ++i) { + NetworkInterface* cur = new NetworkInterface(i->name.c_str(), i->bytes_in, i->bytes_out, *network_interfaces); + *network_interfaces = cur; + } + return OS_OK; + } + static MockNetworkInterface& add_interface(const std::string& name) { + MockNetworkInterface iface(name, 0, 0); + _interfaces.push_back(iface); + return _interfaces.back(); + } + static void remove_interface(const MockNetworkInterface& iface) { + _interfaces.remove(iface); + } + static void clear_interfaces() { + _interfaces.clear(); + } + }; + + std::list<MockNetworkInterface> MockJfrOSInterface::_interfaces; + +// Reincluding source files in the anonymous namespace unfortunately seems to +// behave strangely with precompiled headers (only when using gcc though) +#ifndef DONT_USE_PRECOMPILED_HEADER +#define DONT_USE_PRECOMPILED_HEADER +#endif + +#define EventNetworkUtilization MockEventNetworkUtilization +#define FastUnorderedElapsedCounterSource MockFastUnorderedElapsedCounterSource +#define JfrOSInterface MockJfrOSInterface +#define JfrSerializer MockJfrSerializer +#define JfrCheckpointWriter MockJfrCheckpointWriter +#define JfrTicks MockJfrTicks +#define JfrTickspan MockJfrTickspan + +#include "jfr/periodic/jfrNetworkUtilization.hpp" +#include "jfr/periodic/jfrNetworkUtilization.cpp" + +#undef EventNetworkUtilization +#undef FastUnorderedElapsedCounterSource +#undef JfrOSInterface +#undef JfrSerializer +#undef JfrCheckpointWriter +#undef JfrTicks +#undef JfrTickspan + +} // anonymous namespace + +class JfrTestNetworkUtilization : public ::testing::Test { +protected: + void SetUp() { + MockEventNetworkUtilization::committed.clear(); + MockJfrOSInterface::clear_interfaces(); + // Ensure that tests are separated in time + MockFastUnorderedElapsedCounterSource::current_ticks += 1 * NANOSECS_PER_SEC; + } + + void TearDown() { + JfrNetworkUtilization::destroy(); + } +}; + +TEST_VM_F(JfrTestNetworkUtilization, RequestFunctionBasic) { + + MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0"); + JfrNetworkUtilization::send_events(); + ASSERT_EQ(0u, MockEventNetworkUtilization::committed.size()); + + eth0.bytes_in += 10; + MockFastUnorderedElapsedCounterSource::current_ticks += 2 * NANOSECS_PER_SEC; + + JfrNetworkUtilization::send_events(); + ASSERT_EQ(1u, MockEventNetworkUtilization::committed.size()); + MockEventNetworkUtilization& e = MockEventNetworkUtilization::committed[0]; + EXPECT_EQ(5, e.readRate); + EXPECT_EQ(0, e.writeRate); + EXPECT_STREQ("eth0", e.iface.c_str()); +} + +TEST_VM_F(JfrTestNetworkUtilization, RequestFunctionMultiple) { + + MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0"); + MockNetworkInterface& eth1 = MockJfrOSInterface::add_interface("eth1"); + MockNetworkInterface& ppp0 = MockJfrOSInterface::add_interface("ppp0"); + JfrNetworkUtilization::send_events(); + ASSERT_EQ(0u, MockEventNetworkUtilization::committed.size()); + + eth0.bytes_in += 10; + eth1.bytes_in += 100; + ppp0.bytes_out += 50; + MockFastUnorderedElapsedCounterSource::current_ticks += 2 * NANOSECS_PER_SEC; + + JfrNetworkUtilization::send_events(); + ASSERT_EQ(3u, MockEventNetworkUtilization::committed.size()); + const MockEventNetworkUtilization& eth0_event = MockEventNetworkUtilization::get_committed("eth0"); + const MockEventNetworkUtilization& eth1_event = MockEventNetworkUtilization::get_committed("eth1"); + const MockEventNetworkUtilization& ppp0_event = MockEventNetworkUtilization::get_committed("ppp0"); + + EXPECT_EQ(5, eth0_event.readRate); + EXPECT_EQ(0, eth0_event.writeRate); + EXPECT_STREQ("eth0", eth0_event.iface.c_str()); + + EXPECT_EQ(50, eth1_event.readRate); + EXPECT_EQ(0, eth1_event.writeRate); + EXPECT_STREQ("eth1", eth1_event.iface.c_str()); + + EXPECT_EQ(0, ppp0_event.readRate); + EXPECT_EQ(25, ppp0_event.writeRate); + EXPECT_STREQ("ppp0", ppp0_event.iface.c_str()); +} + +TEST_VM_F(JfrTestNetworkUtilization, InterfaceRemoved) { + MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0"); + MockNetworkInterface& eth1 = MockJfrOSInterface::add_interface("eth1"); + JfrNetworkUtilization::send_events(); + ASSERT_EQ(0u, MockEventNetworkUtilization::committed.size()); + + eth0.bytes_in += 10; + eth1.bytes_in += 20; + MockFastUnorderedElapsedCounterSource::current_ticks += 2 * NANOSECS_PER_SEC; + + JfrNetworkUtilization::send_events(); + ASSERT_EQ(2u, MockEventNetworkUtilization::committed.size()); + const MockEventNetworkUtilization& eth0_event = MockEventNetworkUtilization::get_committed("eth0"); + const MockEventNetworkUtilization& eth1_event = MockEventNetworkUtilization::get_committed("eth1"); + + EXPECT_EQ(5, eth0_event.readRate); + EXPECT_EQ(0, eth0_event.writeRate); + EXPECT_STREQ("eth0", eth0_event.iface.c_str()); + + EXPECT_EQ(10, eth1_event.readRate); + EXPECT_EQ(0, eth1_event.writeRate); + EXPECT_STREQ("eth1", eth1_event.iface.c_str()); + + MockJfrOSInterface::remove_interface(eth0); + MockEventNetworkUtilization::committed.clear(); + + eth1.bytes_in += 10; + MockFastUnorderedElapsedCounterSource::current_ticks += 2 * NANOSECS_PER_SEC; + JfrNetworkUtilization::send_events(); + ASSERT_EQ(1u, MockEventNetworkUtilization::committed.size()); + const MockEventNetworkUtilization& eth1_event_v2 = MockEventNetworkUtilization::get_committed("eth1"); + + EXPECT_EQ(5, eth1_event_v2.readRate); + EXPECT_EQ(0, eth1_event_v2.writeRate); + EXPECT_STREQ("eth1", eth1_event_v2.iface.c_str()); +} + +TEST_VM_F(JfrTestNetworkUtilization, InterfaceReset) { + MockNetworkInterface& eth0 = MockJfrOSInterface::add_interface("eth0"); + JfrNetworkUtilization::send_events(); + ASSERT_EQ(0u, MockEventNetworkUtilization::committed.size()); + + eth0.bytes_in += 10; + MockFastUnorderedElapsedCounterSource::current_ticks += 2 * NANOSECS_PER_SEC; + + JfrNetworkUtilization::send_events(); + ASSERT_EQ(1u, MockEventNetworkUtilization::committed.size()); + const MockEventNetworkUtilization& event = MockEventNetworkUtilization::committed[0]; + EXPECT_EQ(5, event.readRate); + EXPECT_EQ(0, event.writeRate); + EXPECT_STREQ("eth0", event.iface.c_str()); + + eth0.bytes_in = 0; + MockFastUnorderedElapsedCounterSource::current_ticks += 2 * NANOSECS_PER_SEC; + MockEventNetworkUtilization::committed.clear(); + + JfrNetworkUtilization::send_events(); + ASSERT_EQ(0u, MockEventNetworkUtilization::committed.size()); + + eth0.bytes_in = 10; + MockFastUnorderedElapsedCounterSource::current_ticks += 2 * NANOSECS_PER_SEC; + + JfrNetworkUtilization::send_events(); + ASSERT_EQ(1u, MockEventNetworkUtilization::committed.size()); + const MockEventNetworkUtilization& event_v2 = MockEventNetworkUtilization::committed[0]; + EXPECT_EQ(5, event_v2.readRate); + EXPECT_EQ(0, event_v2.writeRate); + EXPECT_STREQ("eth0", event_v2.iface.c_str()); +} diff -Nru openjdk-11-11~19/test/hotspot/gtest/logging/logTestUtils.inline.hpp openjdk-11-11~24/test/hotspot/gtest/logging/logTestUtils.inline.hpp --- openjdk-11-11~19/test/hotspot/gtest/logging/logTestUtils.inline.hpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/logging/logTestUtils.inline.hpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -95,6 +95,7 @@ int buflen = 512; char* buf = NEW_RESOURCE_ARRAY(char, buflen); long pos = ftell(fp); + if (pos < 0) return NULL; char* ret = fgets(buf, buflen, fp); while (ret != NULL && buf[strlen(buf) - 1] != '\n' && !feof(fp)) { diff -Nru openjdk-11-11~19/test/hotspot/gtest/memory/test_metachunk.cpp openjdk-11-11~24/test/hotspot/gtest/memory/test_metachunk.cpp --- openjdk-11-11~19/test/hotspot/gtest/memory/test_metachunk.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/memory/test_metachunk.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,7 +60,7 @@ // Check sizes EXPECT_EQ(metachunk->size(), metachunk->word_size()); EXPECT_EQ(pointer_delta(metachunk->end(), metachunk->bottom(), - sizeof (MetaWord*)), + sizeof (MetaWord)), metachunk->word_size()); // Check usage diff -Nru openjdk-11-11~19/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp openjdk-11-11~24/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp --- openjdk-11-11~19/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/gtest/utilities/test_concurrentHashtable.cpp 2018-07-25 15:36:46.000000000 +0000 @@ -213,7 +213,7 @@ if (bdt.prepare(thr)) { while(bdt.do_task(thr, getinsert_bulkdelete_eval, getinsert_bulkdelete_del)) { bdt.pause(thr); - EXPECT_TRUE(bdt.cont(thr)) << "Uncontended continue should work."; + bdt.cont(thr); } bdt.done(thr); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_base.java openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_base.java --- openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_base.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_base.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary run CTW for all classes from javafx.base module - * - * @library /test/lib / /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage - * java.base/jdk.internal.misc - * java.base/jdk.internal.reflect - * @modules javafx.base - * - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:javafx.base - */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_controls.java openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_controls.java --- openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_controls.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_controls.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary run CTW for all classes from javafx.controls module - * - * @library /test/lib / /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage - * java.base/jdk.internal.misc - * java.base/jdk.internal.reflect - * @modules javafx.controls - * - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:javafx.controls - */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_fxml.java openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_fxml.java --- openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_fxml.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_fxml.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary run CTW for all classes from javafx.fxml module - * - * @library /test/lib / /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage - * java.base/jdk.internal.misc - * java.base/jdk.internal.reflect - * @modules javafx.fxml - * - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:javafx.fxml - */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_graphics.java openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_graphics.java --- openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_graphics.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_graphics.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary run CTW for all classes from javafx.graphics module - * - * @library /test/lib / /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage - * java.base/jdk.internal.misc - * java.base/jdk.internal.reflect - * @modules javafx.graphics - * - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:javafx.graphics - */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_media.java openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_media.java --- openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_media.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_media.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary run CTW for all classes from javafx.media module - * - * @library /test/lib / /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage - * java.base/jdk.internal.misc - * java.base/jdk.internal.reflect - * @modules javafx.media - * - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:javafx.media - */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_swing.java openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_swing.java --- openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_swing.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_swing.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary run CTW for all classes from javafx.swing module - * - * @library /test/lib / /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage - * java.base/jdk.internal.misc - * java.base/jdk.internal.reflect - * @modules javafx.swing - * - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:javafx.swing - */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_web.java openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_web.java --- openjdk-11-11~19/test/hotspot/jtreg/applications/ctw/modules/javafx_web.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/applications/ctw/modules/javafx_web.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @summary run CTW for all classes from javafx.web module - * - * @library /test/lib / /testlibrary/ctw/src - * @modules java.base/jdk.internal.jimage - * java.base/jdk.internal.misc - * java.base/jdk.internal.reflect - * @modules javafx.web - * - * @build sun.hotspot.WhiteBox - * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/timeout=7200 sun.hotspot.tools.ctw.CtwRunner modules:javafx.web - */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/aot/cli/jaotc/IgnoreErrorsTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/aot/cli/jaotc/IgnoreErrorsTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/aot/cli/jaotc/IgnoreErrorsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/aot/cli/jaotc/IgnoreErrorsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @requires vm.aot + * @library / /test/lib /testlibrary + * @compile IllegalClass.jasm + * @run driver compiler.aot.cli.jaotc.IgnoreErrorsTest + */ + +package compiler.aot.cli.jaotc; + +import java.io.File; +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.nio.file.StandardOpenOption; + +import jdk.test.lib.Asserts; +import jdk.test.lib.process.OutputAnalyzer; + +public class IgnoreErrorsTest { + public static void main(String[] args) { + try { + Files.write(Paths.get("Empty.class"), new byte[] { }, StandardOpenOption.CREATE_NEW); + } catch (IOException e) { + throw new Error("can't create empty class file", e); + } + File compiledLibrary = new File(JaotcTestHelper.DEFAULT_LIB_PATH); + OutputAnalyzer oa; + + System.out.println("Compiling empty class file w/o --ignore-errors"); + oa = JaotcTestHelper.compileLibrary( + "--class-name", "Empty", + "--class-name", "java.lang.Object"); + oa.shouldNotHaveExitValue(0); + Asserts.assertTrue(!compiledLibrary.exists(), "Compiled library file exists"); + + System.out.println("Compiling empty class file w/ --ignore-errors"); + oa = JaotcTestHelper.compileLibrary( + "--ignore-errors", + "--class-name", "Empty", + "--class-name", "java.lang.Object"); + oa.shouldHaveExitValue(0); + Asserts.assertTrue(compiledLibrary.exists(), "Compiled library file is missed"); + JaotcTestHelper.checkLibraryUsage("-version"); + compiledLibrary.delete(); + + System.out.println("Compiling illegal class file w/o --ignore-errors"); + oa = JaotcTestHelper.compileLibrary( + "--class-name", "IllegalClass", + "--class-name", "java.lang.Object"); + oa.shouldNotHaveExitValue(0); + Asserts.assertTrue(!compiledLibrary.exists(), "Compiled library file exists"); + + System.out.println("Compiling illegal class file w/ --ignore-errors"); + oa = JaotcTestHelper.compileLibrary( + "--ignore-errors", + "--class-name", "IllegalClass", + "--class-name", "java.lang.Object"); + oa.shouldHaveExitValue(0); + Asserts.assertTrue(compiledLibrary.exists(), "Compiled library file is missed"); + JaotcTestHelper.checkLibraryUsage("-version"); + compiledLibrary.delete(); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/aot/cli/jaotc/IllegalClass.jasm openjdk-11-11~24/test/hotspot/jtreg/compiler/aot/cli/jaotc/IllegalClass.jasm --- openjdk-11-11~19/test/hotspot/jtreg/compiler/aot/cli/jaotc/IllegalClass.jasm 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/aot/cli/jaotc/IllegalClass.jasm 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +super public class IllegalClass + extends java/lang/String + version 46:0 +{ } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt openjdk-11-11~24/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt --- openjdk-11-11~19/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/aot/scripts/java.base-list.txt 2018-07-25 15:36:46.000000000 +0000 @@ -33,4 +33,3 @@ # assert(referenceMask != -1) failed: must not be a derived reference type exclude com.sun.crypto.provider.AESWrapCipher.engineUnwrap([BLjava/lang/String;I)Ljava/security/Key; exclude sun.security.ssl.* -exclude sun.net.RegisteredDomain.<clinit>()V diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/arraycopy/ACasLoadsStoresBadMem.java openjdk-11-11~24/test/hotspot/jtreg/compiler/arraycopy/ACasLoadsStoresBadMem.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/arraycopy/ACasLoadsStoresBadMem.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/arraycopy/ACasLoadsStoresBadMem.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8200282 + * @summary arraycopy converted as a series of loads/stores uses wrong slice for loads + * + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement -XX:CompileCommand=dontinline,ACasLoadsStoresBadMem::not_inlined ACasLoadsStoresBadMem + * + */ + +public class ACasLoadsStoresBadMem { + public static void main(String[] args) { + int[] dst = new int[5]; + for (int i = 0; i < 20_000; i++) { + test1(dst, 1); + for (int j = 1; j < 5; j++) { + if (dst[j] != j) { + throw new RuntimeException("Bad copy "); + } + } + } + } + + private static void test1(int[] dst, int dstPos) { + int[] src = new int[4]; + not_inlined(); + src[0] = 1; + src[1] = 2; + src[2] = 3; + src[3] = 4; + System.arraycopy(src, 0, dst, dstPos, 4); + } + + private static void not_inlined() { + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileCAS.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2.aarch64; + +import java.lang.reflect.Field; +import jdk.internal.misc.Unsafe; + +class TestUnsafeVolatileCAS +{ + public volatile int f_int = 0; + public volatile Integer f_obj = Integer.valueOf(0); + + public static Unsafe unsafe = Unsafe.getUnsafe(); + public static Field f_int_field; + public static Field f_obj_field; + public static long f_int_off; + public static long f_obj_off; + + static { + try { + f_int_field = TestUnsafeVolatileCAS.class.getField("f_int"); + f_obj_field = TestUnsafeVolatileCAS.class.getField("f_obj"); + f_int_off = unsafe.objectFieldOffset(f_int_field); + f_obj_off = unsafe.objectFieldOffset(f_obj_field); + } catch (Exception e) { + System.out.println("reflection failed " + e); + e.printStackTrace(); + } + } + + public static void main(String[] args) + { + final TestUnsafeVolatileCAS t = new TestUnsafeVolatileCAS(); + for (int i = 0; i < 100_000; i++) { + t.f_int = -1; + t.testInt(-1, i); + if (t.f_int != i) { + throw new RuntimeException("bad result!"); + } + } + Integer minusOne = Integer.valueOf(-1); + for (int i = 0; i < 100_000; i++) { + t.f_obj = minusOne; + t.testObj(minusOne, Integer.valueOf(i)); + if (t.f_obj != i) { + throw new RuntimeException("bad result!"); + } + } + } + public void testInt(int x, int i) + { + unsafe.compareAndSetInt(this, f_int_off, x, i); + } + + public void testObj(Object x, Object o) + { + unsafe.compareAndSetObject(this, f_obj_off, x, o); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileLoad.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileLoad.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileLoad.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileLoad.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,56 @@ +package compiler.c2.aarch64; + +import java.lang.reflect.Field; +import jdk.internal.misc.Unsafe; + +class TestUnsafeVolatileLoad +{ + public volatile int f_int = 0; + public volatile Integer f_obj = Integer.valueOf(0); + + public static Unsafe unsafe = Unsafe.getUnsafe(); + public static Field f_int_field; + public static Field f_obj_field; + public static long f_int_off; + public static long f_obj_off; + + static { + try { + f_int_field = TestUnsafeVolatileLoad.class.getField("f_int"); + f_obj_field = TestUnsafeVolatileLoad.class.getField("f_obj"); + f_int_off = unsafe.objectFieldOffset(f_int_field); + f_obj_off = unsafe.objectFieldOffset(f_obj_field); + } catch (Exception e) { + System.out.println("reflection failed " + e); + e.printStackTrace(); + } + } + + public static void main(String[] args) + { + final TestUnsafeVolatileLoad t = new TestUnsafeVolatileLoad(); + for (int i = 0; i < 100_000; i++) { + t.f_int = i; + int r = t.testInt(); + if (r != i) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + t.f_obj = Integer.valueOf(i); + int r = t.testObj(); + if (r != i) { + throw new RuntimeException("bad result!"); + } + } + } + public int testInt() + { + return unsafe.getIntVolatile(this, f_int_off); + } + + public int testObj() + { + return ((Integer)unsafe.getObjectVolatile(this, f_obj_off)); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileStore.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileStore.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileStore.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestUnsafeVolatileStore.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2.aarch64; + +import java.lang.reflect.Field; +import jdk.internal.misc.Unsafe; + +class TestUnsafeVolatileStore +{ + public volatile int f_int = 0; + public volatile Integer f_obj = Integer.valueOf(0); + + public static Unsafe unsafe = Unsafe.getUnsafe(); + public static Field f_int_field; + public static Field f_obj_field; + public static long f_int_off; + public static long f_obj_off; + + static { + try { + f_int_field = TestUnsafeVolatileStore.class.getField("f_int"); + f_obj_field = TestUnsafeVolatileStore.class.getField("f_obj"); + f_int_off = unsafe.objectFieldOffset(f_int_field); + f_obj_off = unsafe.objectFieldOffset(f_obj_field); + } catch (Exception e) { + System.out.println("reflection failed " + e); + e.printStackTrace(); + } + } + + public static void main(String[] args) + { + final TestUnsafeVolatileStore t = new TestUnsafeVolatileStore(); + for (int i = 0; i < 100_000; i++) { + t.f_int = -1; + t.testInt(i); + if (t.f_int != i) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + t.f_obj = null; + t.testObj(Integer.valueOf(i)); + if (t.f_obj != i) { + throw new RuntimeException("bad result!"); + } + } + } + public void testInt(int i) + { + unsafe.putIntVolatile(this, f_int_off, i); + } + + public void testObj(Object o) + { + unsafe.putObjectVolatile(this, f_obj_off, o); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatileLoad.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatileLoad.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatileLoad.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatileLoad.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2.aarch64; + +class TestVolatileLoad +{ + public volatile int f_int = 0; + public volatile Integer f_obj = Integer.valueOf(0); + + public static void main(String[] args) + { + final TestVolatileLoad t = new TestVolatileLoad(); + for (int i = 0; i < 100_000; i++) { + t.f_int = i; + int r = t.testInt(); + if (r != i) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + t.f_obj = Integer.valueOf(i); + int r = t.testObj(); + if (r != i) { + throw new RuntimeException("bad result!"); + } + } + } + public int testInt() + { + return f_int; + } + + public int testObj() + { + return f_obj; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMSCondMark.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary C2 should use ldar, stlr and ldaxr+stlxr insns for volatile operations + * @library /test/lib / + * + * @modules java.base/jdk.internal.misc + * + * @requires os.arch=="aarch64" & vm.debug == true & + * vm.flavor == "server" & !vm.graal.enabled & + * vm.gc.ConcMarkSweep + * + * @build compiler.c2.aarch64.TestVolatiles + * compiler.c2.aarch64.TestVolatileLoad + * compiler.c2.aarch64.TestUnsafeVolatileLoad + * compiler.c2.aarch64.TestVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileCAS + * + * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark + * TestVolatileLoad CMSCondMark + * + * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark + * TestVolatileStore CMSCondMark + * + * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark + * TestUnsafeVolatileLoad CMSCondMark + * + * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark + * TestUnsafeVolatileStore CMSCondMark + * + * @run driver compiler.c2.aarch64.TestVolatilesCMSCondMark + * TestUnsafeVolatileCAS CMSCondMark + */ + +package compiler.c2.aarch64; + +public class TestVolatilesCMSCondMark { + public static void main(String args[]) throws Throwable + { + // delegate work to shared code + new TestVolatiles().runtest(args[0], args[1]); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesCMS.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary C2 should use ldar, stlr and ldaxr+stlxr insns for volatile operations + * @library /test/lib / + * + * @modules java.base/jdk.internal.misc + * + * @requires os.arch=="aarch64" & vm.debug == true & + * vm.flavor == "server" & !vm.graal.enabled & + * vm.gc.ConcMarkSweep + * + * @build compiler.c2.aarch64.TestVolatiles + * compiler.c2.aarch64.TestVolatileLoad + * compiler.c2.aarch64.TestUnsafeVolatileLoad + * compiler.c2.aarch64.TestVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileCAS + * + * @run driver compiler.c2.aarch64.TestVolatilesCMS + * TestVolatileLoad CMS + * + * @run driver compiler.c2.aarch64.TestVolatilesCMS + * TestVolatileStore CMS + * + * @run driver compiler.c2.aarch64.TestVolatilesCMS + * TestUnsafeVolatileLoad CMS + * + * @run driver compiler.c2.aarch64.TestVolatilesCMS + * TestUnsafeVolatileStore CMS + * + * @run driver compiler.c2.aarch64.TestVolatilesCMS + * TestUnsafeVolatileCAS CMS + */ + +package compiler.c2.aarch64; + +public class TestVolatilesCMS { + public static void main(String args[]) throws Throwable + { + // delegate work to shared code + new TestVolatiles().runtest(args[0], args[1]); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesG1.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary C2 should use ldar, stlr and ldaxr+stlxr insns for volatile operations + * @library /test/lib / + * + * @modules java.base/jdk.internal.misc + * + * @requires os.arch=="aarch64" & vm.debug == true & + * vm.flavor == "server" & !vm.graal.enabled & + * vm.gc.G1 + * + * @build compiler.c2.aarch64.TestVolatiles + * compiler.c2.aarch64.TestVolatileLoad + * compiler.c2.aarch64.TestUnsafeVolatileLoad + * compiler.c2.aarch64.TestVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileCAS + * + * @run driver compiler.c2.aarch64.TestVolatilesG1 + * TestVolatileLoad G1 + * + * @run driver compiler.c2.aarch64.TestVolatilesG1 + * TestVolatileStore G1 + * + * @run driver compiler.c2.aarch64.TestVolatilesG1 + * TestUnsafeVolatileLoad G1 + * + * @run driver compiler.c2.aarch64.TestVolatilesG1 + * TestUnsafeVolatileStore G1 + * + * @run driver compiler.c2.aarch64.TestVolatilesG1 + * TestUnsafeVolatileCAS G1 + */ + +package compiler.c2.aarch64; + +public class TestVolatilesG1 { + public static void main(String args[]) throws Throwable + { + // delegate work to shared code + new TestVolatiles().runtest(args[0], args[1]); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatiles.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,575 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * common code to run and validate tests of code generation for + * volatile ops on AArch64 + * + * incoming args are <testclass> <testtype> + * + * where <testclass> in {TestVolatileLoad, + * TestVolatileStore, + * TestUnsafeVolatileLoad, + * TestUnsafeVolatileStore, + * TestUnsafeVolatileCAS} + * and <testtype> in {G1, + * CMS, + * CMSCondMark, + * Serial, + * Parallel} + */ + + +package compiler.c2.aarch64; + +import java.util.List; +import java.util.Iterator; +import java.io.*; + +import jdk.test.lib.Asserts; +import jdk.test.lib.compiler.InMemoryJavaCompiler; +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +// runner class that spawns a new JVM to exercises a combination of +// volatile MemOp and GC. The ops are compiled with the dmb --> +// ldar/stlr transforms either enabled or disabled. this runner parses +// the PrintOptoAssembly output checking that the generated code is +// correct. + +public class TestVolatiles { + public void runtest(String classname, String testType) throws Throwable { + // n.b. clients omit the package name for the class + String fullclassname = "compiler.c2.aarch64." + classname; + // build up a command line for the spawned JVM + String[] procArgs; + int argcount; + // add one or two extra arguments according to test type + // i.e. GC type plus GC conifg + switch(testType) { + case "G1": + argcount = 8; + procArgs = new String[argcount]; + procArgs[argcount - 2] = "-XX:+UseG1GC"; + break; + case "Parallel": + argcount = 8; + procArgs = new String[argcount]; + procArgs[argcount - 2] = "-XX:+UseParallelGC"; + break; + case "Serial": + argcount = 8; + procArgs = new String[argcount]; + procArgs[argcount - 2] = "-XX:+UseSerialGC"; + break; + case "CMS": + argcount = 9 ; + procArgs = new String[argcount]; + procArgs[argcount - 3] = "-XX:+UseConcMarkSweepGC"; + procArgs[argcount - 2] = "-XX:-UseCondCardMark"; + break; + case "CMSCondMark": + argcount = 9 ; + procArgs = new String[argcount]; + procArgs[argcount - 3] = "-XX:+UseConcMarkSweepGC"; + procArgs[argcount - 2] = "-XX:+UseCondCardMark"; + break; + default: + throw new RuntimeException("unexpected test type " + testType); + } + + // fill in arguments common to all cases + + // the first round of test enables transform of barriers to + // use acquiring loads and releasing stores by setting arg + // zero appropriately. this arg is reset in the second run to + // disable the transform. + + procArgs[0] = "-XX:-UseBarriersForVolatile"; + + procArgs[1] = "-XX:-TieredCompilation"; + procArgs[2] = "-XX:+PrintOptoAssembly"; + procArgs[3] = "-XX:CompileCommand=compileonly," + fullclassname + "::" + "test*"; + procArgs[4] = "--add-exports"; + procArgs[5] = "java.base/jdk.internal.misc=ALL-UNNAMED"; + procArgs[argcount - 1] = fullclassname; + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(procArgs); + OutputAnalyzer output = new OutputAnalyzer(pb.start()); + + output.stderrShouldBeEmptyIgnoreVMWarnings(); + output.stdoutShouldNotBeEmpty(); + output.shouldHaveExitValue(0); + + // check the output for the correct asm sequence as + // appropriate to test class, test type and whether transform + // was applied + + checkoutput(output, classname, testType, false); + + // rerun the test class without the transform applied and + // check the alternative generation is as expected + + procArgs[0] = "-XX:+UseBarriersForVolatile"; + + pb = ProcessTools.createJavaProcessBuilder(procArgs); + output = new OutputAnalyzer(pb.start()); + + output.stderrShouldBeEmptyIgnoreVMWarnings(); + output.stdoutShouldNotBeEmpty(); + output.shouldHaveExitValue(0); + + // again check the output for the correct asm sequence + + checkoutput(output, classname, testType, true); + } + + // skip through output returning a line containing the desireed + // substring or null + private String skipTo(Iterator<String> iter, String substring) + { + while (iter.hasNext()) { + String nextLine = iter.next(); + if (nextLine.contains(substring)) { + return nextLine; + } + } + return null; + } + + // locate the start of compiler output for the desired method and + // then check that each expected instruction occurs in the output + // in the order supplied. throw an excpetion if not found. + // n.b. the spawned JVM's output is included in the exception + // message to make it easeir to identify what is missing. + + private void checkCompile(Iterator<String> iter, String methodname, String[] expected, OutputAnalyzer output) + { + // trace call to allow eyeball check of what we are checking against + System.out.println("checkCompile(" + methodname + ","); + String sepr = " { "; + for (String s : expected) { + System.out.print(sepr); + System.out.print(s); + sepr = ",\n "; + } + System.out.println(" })"); + + // look for the start of an opto assembly print block + String match = skipTo(iter, "{method}"); + if (match == null) { + throw new RuntimeException("Missing compiler output for " + methodname + "!\n\n" + output.getOutput()); + } + // check the compiled method name is right + match = skipTo(iter, "- name:"); + if (match == null) { + throw new RuntimeException("Missing compiled method name!\n\n" + output.getOutput()); + } + if (!match.contains(methodname)) { + throw new RuntimeException("Wrong method " + match + "!\n -- expecting " + methodname + "\n\n" + output.getOutput()); + } + // make sure we can match each expected term in order + for (String s : expected) { + match = skipTo(iter, s); + if (match == null) { + throw new RuntimeException("Missing expected output " + s + "!\n\n" + output.getOutput()); + } + } + } + + // check for expected asm output from a volatile load + + private void checkload(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable + { + Iterator<String> iter = output.asLines().listIterator(); + + // we shoud see this same sequence for normal or unsafe volatile load + // for both int and Object fields + + String[] matches; + + if (!useBarriersForVolatile) { + matches = new String[] { + "ldarw", + "membar_acquire (elided)", + "ret" + }; + } else { + matches = new String[] { + "ldrw", + "membar_acquire", + "dmb ish", + "ret" + }; + } + + checkCompile(iter, "testInt", matches, output); + + checkCompile(iter, "testObj", matches, output) ; + + } + + // check for expected asm output from a volatile store + + private void checkstore(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable + { + Iterator<String> iter = output.asLines().listIterator(); + + String[] matches; + + // non object stores are straightforward + if (!useBarriersForVolatile) { + // this is the sequence of instructions for all cases + matches = new String[] { + "membar_release (elided)", + "stlrw", + "membar_volatile (elided)", + "ret" + }; + } else { + // this is the alternative sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + "strw", + "membar_volatile", + "dmb ish", + "ret" + }; + } + + checkCompile(iter, "testInt", matches, output); + + // object stores will be as above except for when the GC + // introduces barriers for card marking + + if (!useBarriersForVolatile) { + switch (testType) { + default: + // this is the basic sequence of instructions + matches = new String[] { + "membar_release (elided)", + "stlrw", + "membar_volatile (elided)", + "ret" + }; + break; + case "G1": + // a card mark volatile barrier should be generated + // before the card mark strb + matches = new String[] { + "membar_release (elided)", + "stlrw", + "membar_volatile", + "dmb ish", + "strb", + "membar_volatile (elided)", + "ret" + }; + break; + case "CMSCondMark": + // a card mark volatile barrier should be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release (elided)", + "stlrw", + "membar_volatile", + "dmb ish", + "storestore (elided)", + "strb", + "membar_volatile (elided)", + "ret" + }; + break; + case "CMS": + // a volatile card mark membar should not be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be + // generated as "dmb ishst" + matches = new String[] { + "membar_release (elided)", + "stlrw", + "storestore", + "dmb ishst", + "strb", + "membar_volatile (elided)", + "ret" + }; + break; + } + } else { + switch (testType) { + default: + // this is the basic sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + "strw", + "membar_volatile", + "dmb ish", + "ret" + }; + break; + case "G1": + // a card mark volatile barrier should be generated + // before the card mark strb + matches = new String[] { + "membar_release", + "dmb ish", + "strw", + "membar_volatile", + "dmb ish", + "strb", + "membar_volatile", + "dmb ish", + "ret" + }; + break; + case "CMSCondMark": + // a card mark volatile barrier should be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release", + "dmb ish", + "strw", + "membar_volatile", + "dmb ish", + "storestore (elided)", + "strb", + "membar_volatile", + "dmb ish", + "ret" + }; + break; + case "CMS": + // a volatile card mark membar should not be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be generated + // as "dmb ishst" + matches = new String[] { + "membar_release", + "dmb ish", + "strw", + "storestore", + "dmb ishst", + "strb", + "membar_volatile", + "dmb ish", + "ret" + }; + break; + } + } + + checkCompile(iter, "testObj", matches, output); + } + + // check for expected asm output from a volatile cas + + private void checkcas(OutputAnalyzer output, String testType, boolean useBarriersForVolatile) throws Throwable + { + Iterator<String> iter = output.asLines().listIterator(); + + String[] matches; + + // non object stores are straightforward + if (!useBarriersForVolatile) { + // this is the sequence of instructions for all cases + matches = new String[] { + "membar_release (elided)", + "cmpxchgw_acq", + "membar_acquire (elided)", + "ret" + }; + } else { + // this is the alternative sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + "cmpxchgw", + "membar_acquire", + "dmb ish", + "ret" + }; + } + + checkCompile(iter, "testInt", matches, output); + + // object stores will be as above except for when the GC + // introduces barriers for card marking + + if (!useBarriersForVolatile) { + switch (testType) { + default: + // this is the basic sequence of instructions + matches = new String[] { + "membar_release (elided)", + "cmpxchgw_acq", + "strb", + "membar_acquire (elided)", + "ret" + }; + break; + case "G1": + // a card mark volatile barrier should be generated + // before the card mark strb + matches = new String[] { + "membar_release (elided)", + "cmpxchgw_acq", + "membar_volatile", + "dmb ish", + "strb", + "membar_acquire (elided)", + "ret" + }; + break; + case "CMSCondMark": + // a card mark volatile barrier should be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release (elided)", + "cmpxchgw_acq", + "membar_volatile", + "dmb ish", + "storestore (elided)", + "strb", + "membar_acquire (elided)", + "ret" + }; + break; + case "CMS": + // a volatile card mark membar should not be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release (elided)", + "cmpxchgw_acq", + "storestore", + "dmb ishst", + "strb", + "membar_acquire (elided)", + "ret" + }; + break; + } + } else { + switch (testType) { + default: + // this is the basic sequence of instructions + matches = new String[] { + "membar_release", + "dmb ish", + "cmpxchgw", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + case "G1": + // a card mark volatile barrier should be generated + // before the card mark strb + matches = new String[] { + "membar_release", + "dmb ish", + "cmpxchgw", + "membar_volatile", + "dmb ish", + "strb", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + case "CMSCondMark": + // a card mark volatile barrier should be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be elided + matches = new String[] { + "membar_release", + "dmb ish", + "cmpxchgw", + "membar_volatile", + "dmb ish", + "storestore (elided)", + "strb", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + case "CMS": + // a volatile card mark membar should not be generated + // before the card mark strb from the StoreCM and the + // storestore barrier from the StoreCM should be generated + // as "dmb ishst" + matches = new String[] { + "membar_release", + "dmb ish", + "cmpxchgw", + "storestore", + "dmb ishst", + "strb", + "membar_acquire", + "dmb ish", + "ret" + }; + break; + } + } + + checkCompile(iter, "testObj", matches, output); + } + + // perform a check appropriate to the classname + + private void checkoutput(OutputAnalyzer output, String classname, String testType, boolean useBarriersForVolatile) throws Throwable + { + // trace call to allow eyeball check of what is being checked + System.out.println("checkoutput(" + + classname + ", " + + testType + ", " + + useBarriersForVolatile + ")\n" + + output.getOutput()); + + switch (classname) { + case "TestVolatileLoad": + checkload(output, testType, useBarriersForVolatile); + break; + case "TestVolatileStore": + checkstore(output, testType, useBarriersForVolatile); + break; + case "TestUnsafeVolatileLoad": + checkload(output, testType, useBarriersForVolatile); + break; + case "TestUnsafeVolatileStore": + checkstore(output, testType, useBarriersForVolatile); + break; + case "TestUnsafeVolatileCAS": + checkcas(output, testType, useBarriersForVolatile); + break; + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesParallel.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary C2 should use ldar, stlr and ldaxr+stlxr insns for volatile operations + * @library /test/lib / + * + * @modules java.base/jdk.internal.misc + * + * @requires os.arch=="aarch64" & vm.debug == true & + * vm.flavor == "server" & !vm.graal.enabled & + * vm.gc.Parallel + * + * @build compiler.c2.aarch64.TestVolatiles + * compiler.c2.aarch64.TestVolatileLoad + * compiler.c2.aarch64.TestUnsafeVolatileLoad + * compiler.c2.aarch64.TestVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileCAS + * + * @run driver compiler.c2.aarch64.TestVolatilesParallel + * TestVolatileLoad Parallel + * + * @run driver compiler.c2.aarch64.TestVolatilesParallel + * TestVolatileStore Parallel + * + * @run driver compiler.c2.aarch64.TestVolatilesParallel + * TestUnsafeVolatileLoad Parallel + * + * @run driver compiler.c2.aarch64.TestVolatilesParallel + * TestUnsafeVolatileStore Parallel + * + * @run driver compiler.c2.aarch64.TestVolatilesParallel + * TestUnsafeVolatileCAS Parallel + */ + +package compiler.c2.aarch64; + +public class TestVolatilesParallel { + public static void main(String args[]) throws Throwable + { + // delegate work to shared code + new TestVolatiles().runtest(args[0], args[1]); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatilesSerial.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary C2 should use ldar, stlr and ldaxr+stlxr insns for volatile operations + * @library /test/lib / + * + * @modules java.base/jdk.internal.misc + * + * @requires os.arch=="aarch64" & vm.debug == true & + * vm.flavor == "server" & !vm.graal.enabled & + * vm.gc.Serial + * + * @build compiler.c2.aarch64.TestVolatiles + * compiler.c2.aarch64.TestVolatileLoad + * compiler.c2.aarch64.TestUnsafeVolatileLoad + * compiler.c2.aarch64.TestVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileStore + * compiler.c2.aarch64.TestUnsafeVolatileCAS + * + * @run driver compiler.c2.aarch64.TestVolatilesSerial + * TestVolatileLoad Serial + * + * @run driver compiler.c2.aarch64.TestVolatilesSerial + * TestVolatileStore Serial + * + * @run driver compiler.c2.aarch64.TestVolatilesSerial + * TestUnsafeVolatileLoad Serial + * + * @run driver compiler.c2.aarch64.TestVolatilesSerial + * TestUnsafeVolatileStore Serial + * + * @run driver compiler.c2.aarch64.TestVolatilesSerial + * TestUnsafeVolatileCAS Serial + */ + +package compiler.c2.aarch64; + +public class TestVolatilesSerial { + public static void main(String args[]) throws Throwable + { + // delegate work to shared code + new TestVolatiles().runtest(args[0], args[1]); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatileStore.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatileStore.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatileStore.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/aarch64/TestVolatileStore.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.c2.aarch64; + +class TestVolatileStore +{ + public volatile int f_int = 0; + public volatile Integer f_obj = Integer.valueOf(0); + + public static void main(String[] args) + { + final TestVolatileStore t = new TestVolatileStore(); + for (int i = 0; i < 100_000; i++) { + t.f_int = -1; + t.testInt(i); + if (t.f_int != i) { + throw new RuntimeException("bad result!"); + } + } + for (int i = 0; i < 100_000; i++) { + t.f_obj = null; + t.testObj(Integer.valueOf(i)); + if (t.f_obj != i) { + throw new RuntimeException("bad result!"); + } + } + } + public void testInt(int i) + { + f_int = i; + } + + public void testObj(Integer o) + { + f_obj = o; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/Test8062950.java openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/Test8062950.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/c2/Test8062950.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/c2/Test8062950.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,50 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8062950 + * @requires vm.flavor == "server" + * @key regression + * @library /test/lib + * @run driver compiler.c2.Test8062950 + */ + +package compiler.c2; + +import jdk.test.lib.process.ProcessTools; + +public class Test8062950 { + private static final String CLASSNAME = "DoesNotExist"; + public static void main(String[] args) throws Exception { + ProcessTools.executeTestJvm("-Xcomp", + "-XX:-TieredCompilation", + "-XX:-UseOptoBiasInlining", + CLASSNAME) + .shouldHaveExitValue(1) + .shouldContain("Error: Could not find or load main class " + CLASSNAME) + .shouldNotContain("A fatal error has been detected") + .shouldNotContain("Internal Error") + .shouldNotContain("HotSpot Virtual Machine Error"); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/ciReplay/SABase.java openjdk-11-11~24/test/hotspot/jtreg/compiler/ciReplay/SABase.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/ciReplay/SABase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/ciReplay/SABase.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,11 +40,6 @@ private static final String REPLAY_FILE_COPY = "replay_vm.txt"; public static void main(String args[]) throws Exception { - if (!Platform.shouldSAAttach()) { - System.out.println("SA attach not expected to work - test skipped."); - return; - } - checkSetLimits(); new SABase(args).runTest(/* needCoreDump = */ true, args); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/ciReplay/TestSAClient.java openjdk-11-11~24/test/hotspot/jtreg/compiler/ciReplay/TestSAClient.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/ciReplay/TestSAClient.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/ciReplay/TestSAClient.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8011675 * @library / /test/lib * @summary testing of ciReplay with using generated by SA replay.txt - * @requires vm.flightRecorder != true & vm.compMode != "Xint" & vm.debug == true & vm.flavor == "client" + * @requires vm.hasSAandCanAttach & vm.flightRecorder != true & vm.compMode != "Xint" & vm.debug == true & vm.flavor == "client" * @modules java.base/jdk.internal.misc * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/ciReplay/TestSAServer.java openjdk-11-11~24/test/hotspot/jtreg/compiler/ciReplay/TestSAServer.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/ciReplay/TestSAServer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/ciReplay/TestSAServer.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8011675 * @library / /test/lib * @summary testing of ciReplay with using generated by SA replay.txt - * @requires vm.flightRecorder != true & vm.compMode != "Xint" & vm.debug == true & vm.flavor == "server" + * @requires vm.hasSAandCanAttach & vm.flightRecorder != true & vm.compMode != "Xint" & vm.debug == true & vm.flavor == "server" * @modules java.base/jdk.internal.misc * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/debug/TraceIterativeGVN.java openjdk-11-11~24/test/hotspot/jtreg/compiler/debug/TraceIterativeGVN.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/debug/TraceIterativeGVN.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/debug/TraceIterativeGVN.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/dependencies/MonomorphicObjectCall/java.base/java/lang/Object.java openjdk-11-11~24/test/hotspot/jtreg/compiler/dependencies/MonomorphicObjectCall/java.base/java/lang/Object.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/dependencies/MonomorphicObjectCall/java.base/java/lang/Object.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/dependencies/MonomorphicObjectCall/java.base/java/lang/Object.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 1994, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1994, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/eliminateAutobox/UnsignedLoads.java openjdk-11-11~24/test/hotspot/jtreg/compiler/eliminateAutobox/UnsignedLoads.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/eliminateAutobox/UnsignedLoads.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/eliminateAutobox/UnsignedLoads.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/ApiDirectivesTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/ApiDirectivesTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/ApiDirectivesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/ApiDirectivesTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.api.directives.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/ApiTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/ApiTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/ApiTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/ApiTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.api.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/AsmAarch64Test.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/AsmAarch64Test.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/AsmAarch64Test.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/AsmAarch64Test.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.asm.aarch64.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/AsmAmd64Test.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/AsmAmd64Test.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/AsmAmd64Test.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/AsmAmd64Test.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.asm.amd64.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/AsmSparcTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/AsmSparcTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/AsmSparcTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/AsmSparcTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.asm.sparc.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/CollectionsTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/CollectionsTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/CollectionsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/CollectionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix jdk.internal.vm.compiler.collections.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/common/GraalUnitTestLauncher.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,271 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package compiler.graalunit.common; + +import java.io.File; +import java.io.IOException; +import java.util.*; +import java.nio.file.*; +import java.util.stream.Collectors; + +import jdk.test.lib.process.OutputAnalyzer; +import jdk.test.lib.process.ProcessTools; + +/* + * This is helper class used to run Graal unit tests. + * It accepts two arguments: + * -prefix TEST_PREFIX_TO_DEFINE_SET_OF_TESTS_TO_RUN (Ex: -prefix org.graalvm.compiler.api.test) + * -exclude EXCLUDED_TESTS_FILE_NAME + */ +public class GraalUnitTestLauncher { + + static final String MXTOOL_JARFILE = "com.oracle.mxtool.junit.jar"; + static final String GRAAL_UNITTESTS_JARFILE = "jdk.vm.compiler.tests.jar"; + + static final String[] GRAAL_EXTRA_JARS = {"junit-4.12.jar", "asm-5.0.4.jar", "asm-tree-5.0.4.jar", + "hamcrest-core-1.3.jar", "java-allocation-instrumenter.jar"}; + + static final String GENERATED_TESTCLASSES_FILENAME = "list.testclasses"; + + // Library dir used to find Graal specific jar files. + static String libsDir; + static { + libsDir = System.getProperty("graalunit.libs"); + if (libsDir == null || libsDir.isEmpty()) { + libsDir = System.getenv("TEST_IMAGE_GRAAL_DIR"); + } + + if (libsDir == null || libsDir.isEmpty()) + throw new RuntimeException("ERROR: Graal library directory is not specified, use -Dgraalunit.libs or TEST_IMAGE_GRAAL_DIR environment variable."); + + System.out.println("INFO: graal libs dir is '" + libsDir + "'"); + } + + /* + * Generates --add-exports <module>/<package>=<target-module> flags and + * returns them as array list. + * + * @param moduleName + * Name of the module to update export data + * + * @param targetModule + * Name of the module to whom to export + */ + static ArrayList<String> getModuleExports(String moduleName, String targetModule) { + ArrayList<String> exports = new ArrayList<String>(); + + Optional<Module> mod = ModuleLayer.boot().findModule(moduleName); + Set<String> packages; + if (mod.isPresent()) { + packages = mod.get().getPackages(); + + for (String pName : packages) { + exports.add("--add-exports"); + exports.add(moduleName + "/" + pName + "=" + targetModule); + } + } + + return exports; + } + + /* + * Return list of tests which match specified prefix + * + * @param testPrefix + * String prefix to select tests + */ + static ArrayList<String> getListOfTestsByPrefix(String testPrefix, Set<String> excludeTests) throws Exception { + ArrayList<String> classes = new ArrayList<String>(); + + final String testAnnotationName = "@Test"; + + // return empty list in case no selection prefix specified + if (testPrefix == null || testPrefix.isEmpty()) + return classes; + + // replace "." by "\." in test pattern + testPrefix = testPrefix.replaceAll("\\.", "\\\\.") + ".*"; + System.out.println("INFO: use following pattern to find tests: " + testPrefix); + + String graalUnitTestFilePath = String.join(File.separator, libsDir, GRAAL_UNITTESTS_JARFILE); + String classPath = String.join(File.pathSeparator, System.getProperty("java.class.path"), + String.join(File.separator, libsDir, MXTOOL_JARFILE)); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(false, + "-cp", classPath, + "com.oracle.mxtool.junit.FindClassesByAnnotatedMethods", graalUnitTestFilePath, testAnnotationName); + + System.out.println("INFO: run command " + String.join(" ", pb.command())); + + OutputAnalyzer out = new OutputAnalyzer(pb.start()); + int exitCode = out.getExitValue(); + if (exitCode != 0) { + throw new Exception("Failed to find tests, VM crashed with exit code " + exitCode); + } + + String outStr = out.getOutput().trim(); + System.out.println("INFO: command output: [" + outStr + "]"); + + String[] lines = outStr.split(" "); + Arrays.sort(lines); + + if (lines.length > 1) { // first line contains jar file name + for (int i = 1; i < lines.length; i++) { + String className = lines[i]; + + if (testPrefix.equals(".*") || className.matches(testPrefix)) { + // add the test only in case it is not in exclude list + if (excludeTests!= null && excludeTests.contains(className)) { + System.out.println("INFO: excluded test: " + className); + } else { + classes.add(className); + } + } + } + } + + return classes; + } + + /* + * Return set of excluded tests + * + * @param excludeFileName + * Name of the file to read excluded test list + */ + static Set loadExcludeList(String excludeFileName) { + Set<String> excludeTests; + + Path excludeFilePath = Paths.get(excludeFileName); + try { + excludeTests = Files.readAllLines(excludeFilePath).stream() + .filter(l -> !l.trim().isEmpty()) + .filter(l -> !l.trim().startsWith("#")) + .map(l -> l.split(" ")[0]) + .collect(Collectors.toSet()); + + } catch (IOException ioe) { + throw new Error("TESTBUG: failed to read " + excludeFilePath); + } + + return excludeTests; + } + + static String getUsageString() { + return "Usage: " + GraalUnitTestLauncher.class.getName() + " " + + "-prefix (org.graalvm.compiler.api.test) " + + "-exclude <ExcludedTestsFileName>" + System.lineSeparator(); + } + + public static void main(String... args) throws Exception { + + String testPrefix = null; + String excludeFileName = null; + + int i=0; + String arg, val; + while (i+1 < args.length) { + arg = args[i++]; + val = args[i++]; + + switch (arg) { + case "-prefix": + testPrefix = val; + break; + + case "-exclude": + excludeFileName = val; + break; + + default: + System.out.println("WARN: illegal option " + arg); + break; + } + } + + if (testPrefix == null) + throw new Error("TESTBUG: no tests to run specified." + System.lineSeparator() + getUsageString()); + + + Set<String> excludeTests = null; + if (excludeFileName != null) { + excludeTests = loadExcludeList(excludeFileName); + } + + // Find list of tests which match provided predicate and write into GENERATED_TESTCLASSES_FILENAME file + ArrayList<String> tests = getListOfTestsByPrefix(testPrefix, excludeTests); + if (tests.size() > 0) { + Files.write(Paths.get(GENERATED_TESTCLASSES_FILENAME), String.join(System.lineSeparator(), tests).getBytes()); + } else { + throw new Error("TESTBUG: no tests found for prefix " + testPrefix); + } + + ArrayList<String> javaFlags = new ArrayList<String>(); + + // add modules and exports + javaFlags.add("--add-modules"); + javaFlags.add("jdk.internal.vm.compiler,jdk.internal.vm.ci"); + javaFlags.add("--add-exports"); + javaFlags.add("java.base/jdk.internal.module=ALL-UNNAMED"); + javaFlags.addAll(getModuleExports("jdk.internal.vm.compiler", "ALL-UNNAMED")); + javaFlags.addAll(getModuleExports("jdk.internal.vm.ci", "ALL-UNNAMED,jdk.internal.vm.compiler")); + + + // add VM flags + javaFlags.add("-XX:+UnlockExperimentalVMOptions"); + javaFlags.add("-XX:+EnableJVMCI"); + javaFlags.add("-Djava.awt.headless=true"); + javaFlags.add("-esa"); + javaFlags.add("-ea"); + + + // generate class path + ArrayList<String> graalJars = new ArrayList<String>(Arrays.asList(GRAAL_EXTRA_JARS)); + graalJars.add(MXTOOL_JARFILE); + graalJars.add(GRAAL_UNITTESTS_JARFILE); + + String graalJarsCP = graalJars.stream() + .map(s -> String.join(File.separator, libsDir, s)) + .collect(Collectors.joining(File.pathSeparator)); + + javaFlags.add("-cp"); + javaFlags.add(String.join(File.pathSeparator, System.getProperty("java.class.path"), graalJarsCP)); + + // + javaFlags.add("com.oracle.mxtool.junit.MxJUnitWrapper"); + javaFlags.add("-JUnitVerbose"); + javaFlags.add("-JUnitEagerStackTrace"); + javaFlags.add("-JUnitEnableTiming"); + + javaFlags.add("@"+GENERATED_TESTCLASSES_FILENAME); + + ProcessBuilder javaPB = ProcessTools.createJavaProcessBuilder(true, + javaFlags.toArray(new String[javaFlags.size()])); + System.out.println("INFO: run command: " + String.join(" ", javaPB.command())); + + OutputAnalyzer outputAnalyzer = new OutputAnalyzer(javaPB.start()); + System.out.println("INFO: execution result: " + outputAnalyzer.getOutput()); + outputAnalyzer.shouldHaveExitValue(0); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/AnsiTerminalDecorator.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/AnsiTerminalDecorator.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/AnsiTerminalDecorator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/AnsiTerminalDecorator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import org.junit.runner.*; +import org.junit.runner.notification.*; + +/** + * Color support for JUnit test output using ANSI escapes codes. + */ +class AnsiTerminalDecorator extends MxRunListenerDecorator { + + /** Foreground black. */ + public static final String BLACK = "\u001b[30m"; + /** Foreground red. */ + public static final String RED = "\u001b[31m"; + /** Foreground green. */ + public static final String GREEN = "\u001b[32m"; + /** Foreground yellow. */ + public static final String YELLOW = "\u001b[33m"; + /** Foreground blue. */ + public static final String BLUE = "\u001b[34m"; + /** Foreground magenta. */ + public static final String MAGENTA = "\u001b[35m"; + /** Foreground cyan. */ + public static final String CYAN = "\u001b[36m"; + /** Foreground white. */ + public static final String WHITE = "\u001b[37m"; + + /** Foreground bold black. */ + public static final String BOLD_BLACK = "\u001b[30;1m"; + /** Foreground bold red. */ + public static final String BOLD_RED = "\u001b[31;1m"; + /** Foreground bold green. */ + public static final String BOLD_GREEN = "\u001b[32;1m"; + /** Foreground bold yellow. */ + public static final String BOLD_YELLOW = "\u001b[33;1m"; + /** Foreground bold blue. */ + public static final String BOLD_BLUE = "\u001b[34;1m"; + /** Foreground bold magenta. */ + public static final String BOLD_MAGENTA = "\u001b[35;1m"; + /** Foreground bold cyan. */ + public static final String BOLD_CYAN = "\u001b[36;1m"; + /** Foreground bold white. */ + public static final String BOLD_WHITE = "\u001b[37;1m"; + + /** Background black. */ + public static final String BG_BLACK = "\u001b[40m"; + /** Background red. */ + public static final String BG_RED = "\u001b[41m"; + /** Background green. */ + public static final String BG_GREEN = "\u001b[42m"; + /** Background yellow. */ + public static final String BG_YELLOW = "\u001b[43m"; + /** Background blue. */ + public static final String BG_BLUE = "\u001b[44m"; + /** Background magenta. */ + public static final String BG_MAGENTA = "\u001b[45m"; + /** Background cyan. */ + public static final String BG_CYAN = "\u001b[46m"; + /** Background white. */ + public static final String BG_WHITE = "\u001b[47m"; + + /** Reset. */ + public static final String RESET = "\u001b[0m"; + /** Underline. */ + public static final String UNDERLINED = "\u001b[4m"; + + AnsiTerminalDecorator(MxRunListener l) { + super(l); + } + + @Override + public void testSucceeded(Description description) { + getWriter().print(GREEN); + super.testSucceeded(description); + getWriter().print(RESET); + } + + @Override + public void testAssumptionFailure(Failure failure) { + getWriter().print(BLUE); + super.testAssumptionFailure(failure); + getWriter().print(RESET); + } + + @Override + public void testFailed(Failure failure) { + getWriter().print(RED); + super.testFailed(failure); + getWriter().print(RESET); + } + + @Override + public void testIgnored(Description description) { + getWriter().print(MAGENTA); + super.testIgnored(description); + getWriter().print(RESET); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/EagerStackTraceDecorator.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/EagerStackTraceDecorator.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/EagerStackTraceDecorator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/EagerStackTraceDecorator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import org.junit.runner.notification.*; + +class EagerStackTraceDecorator extends MxRunListenerDecorator { + + EagerStackTraceDecorator(MxRunListener l) { + super(l); + } + + @Override + public void testFailed(Failure failure) { + super.testFailed(failure); + getWriter().println(); + getWriter().println(failure.getTestHeader()); + getWriter().print(failure.getTrace()); + } + +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/FindClassesByAnnotatedMethods.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/FindClassesByAnnotatedMethods.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/FindClassesByAnnotatedMethods.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/FindClassesByAnnotatedMethods.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,341 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.BufferedInputStream; +import java.io.DataInputStream; +import java.io.IOException; +import java.util.Collection; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +/** + * Finds classes in given jar files that contain methods annotated by a given set of annotations. + */ +public class FindClassesByAnnotatedMethods { + + /** + * Finds classes in a given set of jar files that contain at least one method with an annotation + * from a given set of annotations. The qualified name and containing jar file (separated by a + * space) is written to {@link System#out} for each matching class. + * + * @param args jar file names, annotations and snippets patterns. Annotations are those starting + * with "@" and can be either qualified or unqualified annotation class names, + * snippets patterns are those starting with {@code "snippetsPattern:"} and the rest + * are jar file names + */ + public static void main(String... args) throws Throwable { + Set<String> qualifiedAnnotations = new HashSet<>(); + Set<String> unqualifiedAnnotations = new HashSet<>(); + for (String arg : args) { + if (isAnnotationArg(arg)) { + String annotation = arg.substring(1); + int lastDot = annotation.lastIndexOf('.'); + if (lastDot != -1) { + qualifiedAnnotations.add(annotation); + } else { + String unqualifed = annotation.substring(lastDot + 1); + unqualifiedAnnotations.add(unqualifed); + } + } + } + + for (String jarFilePath : args) { + if (isSnippetArg(jarFilePath) || isAnnotationArg(jarFilePath)) { + continue; + } + JarFile jarFile = new JarFile(jarFilePath); + Enumeration<JarEntry> e = jarFile.entries(); + int unsupportedClasses = 0; + System.out.print(jarFilePath); + while (e.hasMoreElements()) { + JarEntry je = e.nextElement(); + if (je.isDirectory() || !je.getName().endsWith(".class")) { + continue; + } + Set<String> methodAnnotationTypes = new HashSet<>(); + DataInputStream stream = new DataInputStream(new BufferedInputStream(jarFile.getInputStream(je), (int) je.getSize())); + boolean isSupported = true; + try { + readClassfile(stream, methodAnnotationTypes); + } catch (UnsupportedClassVersionError ucve) { + isSupported = false; + unsupportedClasses++; + } + String className = je.getName().substring(0, je.getName().length() - ".class".length()).replaceAll("/", "."); + if (!isSupported) { + System.out.print(" !" + className); + } + for (String annotationType : methodAnnotationTypes) { + if (!qualifiedAnnotations.isEmpty()) { + if (qualifiedAnnotations.contains(annotationType)) { + System.out.print(" " + className); + } + } + if (!unqualifiedAnnotations.isEmpty()) { + final int lastDot = annotationType.lastIndexOf('.'); + if (lastDot != -1) { + String simpleName = annotationType.substring(lastDot + 1); + int lastDollar = simpleName.lastIndexOf('$'); + if (lastDollar != -1) { + simpleName = simpleName.substring(lastDollar + 1); + } + if (unqualifiedAnnotations.contains(simpleName)) { + System.out.print(" " + className); + } + } + } + } + } + if (unsupportedClasses != 0) { + System.err.printf("Warning: %d classes in %s skipped as their class file version is not supported by %s%n", unsupportedClasses, jarFilePath, + FindClassesByAnnotatedMethods.class.getSimpleName()); + } + System.out.println(); + } + } + + private static boolean isAnnotationArg(String arg) { + return arg.charAt(0) == '@'; + } + + private static boolean isSnippetArg(String arg) { + return arg.startsWith("snippetsPattern:"); + } + + /* + * Small bytecode parser that extract annotations. + */ + private static final int MAJOR_VERSION_JAVA7 = 51; + private static final int MAJOR_VERSION_OFFSET = 44; + private static final byte CONSTANT_Utf8 = 1; + private static final byte CONSTANT_Integer = 3; + private static final byte CONSTANT_Float = 4; + private static final byte CONSTANT_Long = 5; + private static final byte CONSTANT_Double = 6; + private static final byte CONSTANT_Class = 7; + private static final byte CONSTANT_Fieldref = 9; + private static final byte CONSTANT_String = 8; + private static final byte CONSTANT_Methodref = 10; + private static final byte CONSTANT_InterfaceMethodref = 11; + private static final byte CONSTANT_NameAndType = 12; + private static final byte CONSTANT_MethodHandle = 15; + private static final byte CONSTANT_MethodType = 16; + private static final byte CONSTANT_Dynamic = 17; + private static final byte CONSTANT_InvokeDynamic = 18; + + private static void readClassfile(DataInputStream stream, Collection<String> methodAnnotationTypes) throws IOException { + // magic + int magic = stream.readInt(); + assert magic == 0xCAFEBABE; + + int minor = stream.readUnsignedShort(); + int major = stream.readUnsignedShort(); + if (major < MAJOR_VERSION_JAVA7) { + throw new UnsupportedClassVersionError("Unsupported class file version: " + major + "." + minor); + } + // Starting with JDK8, ignore a classfile that has a newer format than the current JDK. + String javaVersion = System.getProperties().get("java.specification.version").toString(); + int majorJavaVersion; + if (javaVersion.startsWith("1.")) { + javaVersion = javaVersion.substring(2); + majorJavaVersion = Integer.parseInt(javaVersion); + } else { + majorJavaVersion = Integer.parseInt(javaVersion); + } + if (major > MAJOR_VERSION_OFFSET + majorJavaVersion) { + throw new UnsupportedClassVersionError("Unsupported class file version: " + major + "." + minor); + } + + String[] cp = readConstantPool(stream, major, minor); + + // access_flags, this_class, super_class + stream.skipBytes(6); + + // interfaces + stream.skipBytes(stream.readUnsignedShort() * 2); + + // fields + skipFields(stream); + + // methods + readMethods(stream, cp, methodAnnotationTypes); + } + + private static void skipFully(DataInputStream stream, int n) throws IOException { + long skipped = 0; + do { + long s = stream.skip(n - skipped); + skipped += s; + if (s == 0 && skipped != n) { + // Check for EOF (i.e., truncated class file) + if (stream.read() == -1) { + throw new IOException("truncated stream"); + } + skipped++; + } + } while (skipped != n); + } + + private static String[] readConstantPool(DataInputStream stream, int major, int minor) throws IOException { + int count = stream.readUnsignedShort(); + String[] cp = new String[count]; + + int i = 1; + while (i < count) { + byte tag = stream.readByte(); + switch (tag) { + case CONSTANT_Class: + case CONSTANT_String: + case CONSTANT_MethodType: { + skipFully(stream, 2); + break; + } + case CONSTANT_InterfaceMethodref: + case CONSTANT_Methodref: + case CONSTANT_Fieldref: + case CONSTANT_NameAndType: + case CONSTANT_Float: + case CONSTANT_Integer: + case CONSTANT_Dynamic: + case CONSTANT_InvokeDynamic: { + skipFully(stream, 4); + break; + } + case CONSTANT_Long: + case CONSTANT_Double: { + skipFully(stream, 8); + break; + } + case CONSTANT_Utf8: { + cp[i] = stream.readUTF(); + break; + } + case CONSTANT_MethodHandle: { + skipFully(stream, 3); + break; + } + default: { + throw new InternalError(String.format("Invalid constant pool tag: " + tag + ". Maybe %s needs updating for changes introduced by class file version %d.%d?", + FindClassesByAnnotatedMethods.class, major, minor)); + } + } + if ((tag == CONSTANT_Double) || (tag == CONSTANT_Long)) { + i += 2; + } else { + i += 1; + } + } + return cp; + } + + private static void skipAttributes(DataInputStream stream) throws IOException { + int attributesCount; + attributesCount = stream.readUnsignedShort(); + for (int i = 0; i < attributesCount; i++) { + stream.skipBytes(2); // name_index + int attributeLength = stream.readInt(); + skipFully(stream, attributeLength); + } + } + + private static void readMethodAttributes(DataInputStream stream, String[] cp, Collection<String> methodAnnotationTypes) throws IOException { + int attributesCount; + attributesCount = stream.readUnsignedShort(); + for (int i = 0; i < attributesCount; i++) { + String attributeName = cp[stream.readUnsignedShort()]; + int attributeLength = stream.readInt(); + + if (attributeName.equals("RuntimeVisibleAnnotations")) { + int numAnnotations = stream.readUnsignedShort(); + for (int a = 0; a != numAnnotations; a++) { + readAnnotation(stream, cp, methodAnnotationTypes); + } + } else { + skipFully(stream, attributeLength); + } + } + } + + private static void readAnnotation(DataInputStream stream, String[] cp, Collection<String> methodAnnotationTypes) throws IOException { + int typeIndex = stream.readUnsignedShort(); + int pairs = stream.readUnsignedShort(); + String type = cp[typeIndex]; + String className = type.substring(1, type.length() - 1).replace('/', '.'); + methodAnnotationTypes.add(className); + readAnnotationElements(stream, cp, pairs, true, methodAnnotationTypes); + } + + private static void readAnnotationElements(DataInputStream stream, String[] cp, int pairs, boolean withElementName, Collection<String> methodAnnotationTypes) throws IOException { + for (int p = 0; p < pairs; p++) { + if (withElementName) { + skipFully(stream, 2); + } + int tag = stream.readByte(); + switch (tag) { + case 'B': + case 'C': + case 'D': + case 'F': + case 'I': + case 'J': + case 'S': + case 'Z': + case 's': + case 'c': + skipFully(stream, 2); + break; + case 'e': + skipFully(stream, 4); + break; + case '@': + readAnnotation(stream, cp, methodAnnotationTypes); + break; + case '[': { + int numValues = stream.readUnsignedShort(); + readAnnotationElements(stream, cp, numValues, false, methodAnnotationTypes); + break; + } + } + } + } + + private static void skipFields(DataInputStream stream) throws IOException { + int count = stream.readUnsignedShort(); + for (int i = 0; i < count; i++) { + stream.skipBytes(6); // access_flags, name_index, descriptor_index + skipAttributes(stream); + } + } + + private static void readMethods(DataInputStream stream, String[] cp, Collection<String> methodAnnotationTypes) throws IOException { + int count = stream.readUnsignedShort(); + for (int i = 0; i < count; i++) { + skipFully(stream, 6); // access_flags, name_index, descriptor_index + readMethodAttributes(stream, cp, methodAnnotationTypes); + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/GCAfterTestDecorator.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/GCAfterTestDecorator.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/GCAfterTestDecorator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/GCAfterTestDecorator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import org.junit.runner.*; + +class GCAfterTestDecorator extends MxRunListenerDecorator { + + GCAfterTestDecorator(MxRunListener l) { + super(l); + } + + @Override + public void testFinished(Description description) { + System.gc(); + super.testFinished(description); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/JLModule.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/JLModule.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/JLModule.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/JLModule.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.lang.reflect.Method; +import java.util.Arrays; +import java.util.Set; + +/** + * Facade for the {@code java.lang.Module} class introduced in JDK9 that allows tests to be + * developed against JDK8 but use module logic if deployed on JDK9. + */ +class JLModule { + + private final Object realModule; + + JLModule(Object module) { + this.realModule = module; + } + + private static final Class<?> moduleClass; + private static final Class<?> layerClass; + + private static final Method bootMethod; + private static final Method modulesMethod; + private static final Method getModuleMethod; + private static final Method getUnnamedModuleMethod; + private static final Method getNameMethod; + private static final Method getPackagesMethod; + private static final Method isExportedMethod; + private static final Method isExported2Method; + private static final Method addExportsMethod; + private static final Method addOpensMethod; + static { + try { + moduleClass = findModuleClass(); + Class<?> modulesClass = Class.forName("jdk.internal.module.Modules"); + layerClass = findModuleLayerClass(); + bootMethod = layerClass.getMethod("boot"); + modulesMethod = layerClass.getMethod("modules"); + getModuleMethod = Class.class.getMethod("getModule"); + getUnnamedModuleMethod = ClassLoader.class.getMethod("getUnnamedModule"); + getNameMethod = moduleClass.getMethod("getName"); + getPackagesMethod = moduleClass.getMethod("getPackages"); + isExportedMethod = moduleClass.getMethod("isExported", String.class); + isExported2Method = moduleClass.getMethod("isExported", String.class, moduleClass); + addExportsMethod = modulesClass.getDeclaredMethod("addExports", moduleClass, String.class, moduleClass); + addOpensMethod = getDeclaredMethodOptional(modulesClass, "addOpens", moduleClass, String.class, moduleClass); + } catch (Exception e) { + throw new AssertionError(e); + } + } + + // API change http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/afedee84773e. + protected static Class<?> findModuleClass() throws ClassNotFoundException { + try { + return Class.forName("java.lang.Module"); + } catch (ClassNotFoundException e) { + return Class.forName("java.lang.reflect.Module"); + } + } + + // API change http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/afedee84773e. + protected static Class<?> findModuleLayerClass() throws ClassNotFoundException { + try { + return Class.forName("java.lang.ModuleLayer"); + } catch (ClassNotFoundException e) { + return Class.forName("java.lang.reflect.Layer"); + } + } + + private static Method getDeclaredMethodOptional(Class<?> declaringClass, String name, Class<?>... parameterTypes) { + try { + return declaringClass.getDeclaredMethod(name, parameterTypes); + } catch (NoSuchMethodException e) { + return null; + } + } + + public static JLModule fromClass(Class<?> cls) { + try { + return new JLModule(getModuleMethod.invoke(cls)); + } catch (Exception e) { + throw new AssertionError(e); + } + } + + @SuppressWarnings("unchecked") + public static JLModule find(String name) { + try { + Object bootLayer = bootMethod.invoke(null); + Set<Object> modules = (Set<Object>) modulesMethod.invoke(bootLayer); + for (Object m : modules) { + JLModule module = new JLModule(m); + String mname = module.getName(); + if (mname.equals(name)) { + return module; + } + } + } catch (Exception e) { + throw new InternalError(e); + } + return null; + } + + public static JLModule getUnnamedModuleFor(ClassLoader cl) { + try { + return new JLModule(getUnnamedModuleMethod.invoke(cl)); + } catch (Exception e) { + throw new AssertionError(e); + } + } + + public String getName() { + try { + return (String) getNameMethod.invoke(realModule); + } catch (Exception e) { + throw new AssertionError(e); + } + } + + /** + * Exports all packages in this module to a given module. + */ + public void exportAllPackagesTo(JLModule module) { + if (this != module) { + for (String pkg : getPackages()) { + // Export all JVMCI packages dynamically instead + // of requiring a long list of -XaddExports + // options on the JVM command line. + if (!isExported(pkg, module)) { + addExports(pkg, module); + addOpens(pkg, module); + } + } + } + } + + @SuppressWarnings("unchecked") + public Iterable<String> getPackages() { + try { + // API change http://hg.openjdk.java.net/jdk9/dev/hotspot/rev/afedee84773e#l1.15 + Object res = getPackagesMethod.invoke(realModule); + if (res instanceof String[]) { + return Arrays.asList((String[]) res); + } + return (Set<String>) res; + } catch (Exception e) { + throw new AssertionError(e); + } + } + + public boolean isExported(String pn) { + try { + return (Boolean) isExportedMethod.invoke(realModule, pn); + } catch (Exception e) { + throw new AssertionError(e); + } + } + + public boolean isExported(String pn, JLModule other) { + try { + return (Boolean) isExported2Method.invoke(realModule, pn, other.realModule); + } catch (Exception e) { + throw new AssertionError(e); + } + } + + public void addExports(String pn, JLModule other) { + try { + addExportsMethod.invoke(null, realModule, pn, other.realModule); + } catch (Exception e) { + throw new AssertionError(e); + } + } + + public void addOpens(String pn, JLModule other) { + if (addOpensMethod != null) { + try { + addOpensMethod.invoke(null, realModule, pn, other.realModule); + } catch (Exception e) { + throw new AssertionError(e); + } + } + } + + @Override + public String toString() { + return realModule.toString(); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxJUnitRequest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxJUnitRequest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxJUnitRequest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxJUnitRequest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.lang.reflect.Modifier; +import java.util.ArrayList; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; +import org.junit.runner.Description; +import org.junit.runner.Request; +import org.junit.runner.notification.Failure; + +public final class MxJUnitRequest { + + private final Request request; + + final Set<Class<?>> classes; + final String methodName; + + final List<Failure> missingClasses; + + private MxJUnitRequest(Request request, Set<Class<?>> classes, String methodName, List<Failure> missingClasses) { + this.request = request; + this.classes = classes; + this.methodName = methodName; + this.missingClasses = missingClasses; + } + + public Request getRequest() { + return request; + } + + public static final class BuilderException extends Exception { + + private static final long serialVersionUID = 1L; + + private BuilderException(String msg) { + super(msg); + } + } + + public static class Builder { + + private final Set<Class<?>> classes = new LinkedHashSet<>(); + private String methodName = null; + private final List<Failure> missingClasses = new ArrayList<>(); + + protected Class<?> resolveClass(String name) throws ClassNotFoundException { + return Class.forName(name, false, Builder.class.getClassLoader()); + } + + public void addTestSpec(String arg) throws BuilderException { + String className; + /* + * Entries of the form class#method are handled specially. Only one can be specified on + * the command line as there's no obvious way to build a runner for multiple ones. + */ + if (methodName != null) { + throw new BuilderException("Only a single class and method can be specified: " + arg); + } else if (arg.contains("#")) { + String[] pair = arg.split("#"); + if (pair.length != 2) { + throw new BuilderException("Malformed class and method request: " + arg); + } else if (!classes.isEmpty()) { + throw new BuilderException("Only a single class and method can be specified: " + arg); + } else { + methodName = pair[1]; + className = pair[0]; + } + } else { + className = arg; + } + try { + Class<?> cls = resolveClass(className); + if ((cls.getModifiers() & Modifier.ABSTRACT) == 0) { + classes.add(cls); + } + } catch (ClassNotFoundException e) { + Description description = Description.createSuiteDescription(className); + Failure failure = new Failure(description, e); + missingClasses.add(failure); + } + } + + public MxJUnitRequest build() { + Request request; + if (methodName == null) { + request = Request.classes(classes.toArray(new Class<?>[0])); + } else { + request = Request.method(classes.iterator().next(), methodName); + } + return new MxJUnitRequest(request, classes, methodName, missingClasses); + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxJUnitWrapper.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxJUnitWrapper.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxJUnitWrapper.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxJUnitWrapper.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,484 @@ +/* + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.PrintStream; +import java.lang.annotation.Annotation; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.ServiceLoader; +import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import org.junit.internal.JUnitSystem; +import org.junit.internal.RealSystem; +import org.junit.runner.Description; +import org.junit.runner.JUnitCore; +import org.junit.runner.Request; +import org.junit.runner.Result; +import org.junit.runner.Runner; +import org.junit.runner.notification.Failure; +import org.junit.runner.notification.RunListener; +import org.junit.runner.notification.RunNotifier; +import org.junit.runners.ParentRunner; +import org.junit.runners.model.RunnerScheduler; + +import junit.runner.Version; + +public class MxJUnitWrapper { + + public static class MxJUnitConfig { + + public boolean verbose = false; + public boolean veryVerbose = false; + public boolean enableTiming = false; + public boolean failFast = false; + public boolean color = false; + public boolean eagerStackTrace = false; + public boolean gcAfterTest = false; + public boolean recordResults = false; + public int repeatCount = 1; + } + + private static class RepeatingRunner extends Runner { + + private final Runner parent; + private int repeat; + + RepeatingRunner(Runner parent, int repeat) { + this.parent = parent; + this.repeat = repeat; + } + + @Override + public Description getDescription() { + return parent.getDescription(); + } + + @Override + public void run(RunNotifier notifier) { + for (int i = 0; i < repeat; i++) { + parent.run(notifier); + } + } + + @Override + public int testCount() { + return super.testCount() * repeat; + } + } + + private static class RepeatingRequest extends Request { + + private final Request request; + private final int repeat; + + RepeatingRequest(Request request, int repeat) { + this.request = request; + this.repeat = repeat; + } + + @Override + public Runner getRunner() { + return new RepeatingRunner(request.getRunner(), repeat); + } + } + + /** + * Run the tests contained in the classes named in the <code>args</code>. A single test method + * can be specified by adding #method after the class name. Only a single test can be run in + * this way. If all tests run successfully, exit with a status of 0. Otherwise exit with a + * status of 1. Write feedback while tests are running and write stack traces for all failed + * tests after the tests all complete. + * + * @param args names of classes in which to find tests to run + */ + public static void main(String... args) { + JUnitSystem system = new RealSystem(); + JUnitCore junitCore = new JUnitCore(); + system.out().println("MxJUnitCore"); + system.out().println("JUnit version " + Version.id()); + + MxJUnitRequest.Builder builder = new MxJUnitRequest.Builder(); + MxJUnitConfig config = new MxJUnitConfig(); + + String[] expandedArgs = expandArgs(args); + int i = 0; + while (i < expandedArgs.length) { + String each = expandedArgs[i]; + if (each.charAt(0) == '-') { + // command line arguments + if (each.contentEquals("-JUnitVerbose")) { + config.verbose = true; + } else if (each.contentEquals("-JUnitVeryVerbose")) { + config.veryVerbose = true; + } else if (each.contentEquals("-JUnitFailFast")) { + config.failFast = true; + } else if (each.contentEquals("-JUnitEnableTiming")) { + config.enableTiming = true; + } else if (each.contentEquals("-JUnitColor")) { + config.color = true; + } else if (each.contentEquals("-JUnitEagerStackTrace")) { + config.eagerStackTrace = true; + } else if (each.contentEquals("-JUnitGCAfterTest")) { + config.gcAfterTest = true; + } else if (each.contentEquals("-JUnitRecordResults")) { + config.recordResults = true; + } else if (each.contentEquals("-JUnitRepeat")) { + if (i + 1 >= expandedArgs.length) { + system.out().println("Must include argument for -JUnitRepeat"); + System.exit(1); + } + try { + config.repeatCount = Integer.parseInt(expandedArgs[++i]); + } catch (NumberFormatException e) { + system.out().println("Expected integer argument for -JUnitRepeat. Found: " + expandedArgs[i]); + System.exit(1); + } + } else { + system.out().println("Unknown command line argument: " + each); + } + + } else { + + try { + builder.addTestSpec(each); + } catch (MxJUnitRequest.BuilderException ex) { + system.out().println(ex.getMessage()); + System.exit(1); + } + } + i++; + } + + MxJUnitRequest request = builder.build(); + + if (System.getProperty("java.specification.version").compareTo("1.9") >= 0) { + addExports(request.classes, system.out()); + } + + for (RunListener p : ServiceLoader.load(RunListener.class)) { + junitCore.addListener(p); + } + + Result result = runRequest(junitCore, system, config, request); + System.exit(result.wasSuccessful() ? 0 : 1); + } + + private static PrintStream openFile(JUnitSystem system, String name) { + File file = new File(name).getAbsoluteFile(); + try { + FileOutputStream fos = new FileOutputStream(file); + return new PrintStream(fos, true); + } catch (FileNotFoundException e) { + system.out().println("Could not open " + file + " for writing: " + e); + System.exit(1); + return null; + } + } + + public static Result runRequest(JUnitCore junitCore, JUnitSystem system, MxJUnitConfig config, MxJUnitRequest mxRequest) { + final TextRunListener textListener; + if (config.veryVerbose) { + textListener = new VerboseTextListener(system, mxRequest.classes.size(), VerboseTextListener.SHOW_ALL_TESTS); + } else if (config.verbose) { + textListener = new VerboseTextListener(system, mxRequest.classes.size()); + } else { + textListener = new TextRunListener(system); + } + TimingDecorator timings = config.enableTiming ? new TimingDecorator(textListener) : null; + MxRunListener mxListener = config.enableTiming ? timings : textListener; + + if (config.color) { + mxListener = new AnsiTerminalDecorator(mxListener); + } + if (config.eagerStackTrace) { + mxListener = new EagerStackTraceDecorator(mxListener); + } + if (config.gcAfterTest) { + mxListener = new GCAfterTestDecorator(mxListener); + } + if (config.recordResults) { + PrintStream passed = openFile(system, "passed.txt"); + PrintStream failed = openFile(system, "failed.txt"); + mxListener = new TestResultLoggerDecorator(passed, failed, mxListener); + } + + junitCore.addListener(TextRunListener.createRunListener(mxListener)); + + Request request = mxRequest.getRequest(); + if (mxRequest.methodName == null) { + if (config.failFast) { + Runner runner = request.getRunner(); + if (runner instanceof ParentRunner) { + ParentRunner<?> parentRunner = (ParentRunner<?>) runner; + parentRunner.setScheduler(new RunnerScheduler() { + public void schedule(Runnable childStatement) { + if (textListener.getLastFailure() == null) { + childStatement.run(); + } + } + + public void finished() { + } + }); + } else { + system.out().println("Unexpected Runner subclass " + runner.getClass().getName() + " - fail fast not supported"); + } + } + } else { + if (config.failFast) { + system.out().println("Single method selected - fail fast not supported"); + } + } + + if (config.repeatCount != 1) { + request = new RepeatingRequest(request, config.repeatCount); + } + + if (config.enableTiming) { + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + printTimings(timings); + } + }); + } + + Result result = junitCore.run(request); + for (Failure each : mxRequest.missingClasses) { + result.getFailures().add(each); + } + + return result; + } + + private static final Pattern MODULE_PACKAGE_RE = Pattern.compile("([^/]+)/(.+)"); + + private static class Timing<T> implements Comparable<Timing<T>> { + final T subject; + final long value; + + Timing(T subject, long value) { + this.subject = subject; + this.value = value; + } + + public int compareTo(Timing<T> o) { + if (this.value < o.value) { + return -1; + } + if (this.value > o.value) { + return 1; + } + return 0; + } + } + + // Should never need to customize so using a system property instead + // of a command line option for customization is fine. + private static final int TIMINGS_TO_PRINT = Integer.getInteger("mx.junit.timings_to_print", 10); + + private static void printTimings(TimingDecorator timings) { + if (TIMINGS_TO_PRINT != 0) { + List<Timing<Class<?>>> classTimes = new ArrayList<>(timings.classTimes.size()); + List<Timing<Description>> testTimes = new ArrayList<>(timings.testTimes.size()); + for (Map.Entry<Class<?>, Long> e : timings.classTimes.entrySet()) { + classTimes.add(new Timing<>(e.getKey(), e.getValue())); + } + for (Map.Entry<Description, Long> e : timings.testTimes.entrySet()) { + testTimes.add(new Timing<>(e.getKey(), e.getValue())); + } + classTimes.sort(Collections.reverseOrder()); + testTimes.sort(Collections.reverseOrder()); + + System.out.println(); + System.out.printf("%d longest running test classes:%n", TIMINGS_TO_PRINT); + for (int i = 0; i < TIMINGS_TO_PRINT && i < classTimes.size(); i++) { + Timing<Class<?>> timing = classTimes.get(i); + System.out.printf(" %,10d ms %s%n", timing.value, timing.subject.getName()); + } + System.out.printf("%d longest running tests:%n", TIMINGS_TO_PRINT); + for (int i = 0; i < TIMINGS_TO_PRINT && i < testTimes.size(); i++) { + Timing<Description> timing = testTimes.get(i); + System.out.printf(" %,10d ms %s%n", timing.value, timing.subject); + } + Object[] current = timings.getCurrentTestDuration(); + if (current != null) { + System.out.printf("Test %s not finished after %d ms%n", current[0], current[1]); + } + + } + } + + /** + * Adds the super types of {@code cls} to {@code supertypes}. + */ + private static void gatherSupertypes(Class<?> cls, Set<Class<?>> supertypes) { + if (!supertypes.contains(cls)) { + supertypes.add(cls); + Class<?> superclass = cls.getSuperclass(); + if (superclass != null) { + gatherSupertypes(superclass, supertypes); + } + for (Class<?> iface : cls.getInterfaces()) { + gatherSupertypes(iface, supertypes); + } + } + } + + /** + * Updates modules specified in {@code AddExport} annotations on {@code classes} to export + * concealed packages to the annotation classes' declaring modules. + */ + private static void addExports(Set<Class<?>> classes, PrintStream out) { + Set<Class<?>> types = new HashSet<>(); + for (Class<?> cls : classes) { + gatherSupertypes(cls, types); + } + for (Class<?> cls : types) { + Annotation[] annos = cls.getAnnotations(); + for (Annotation a : annos) { + Class<? extends Annotation> annotationType = a.annotationType(); + if (annotationType.getSimpleName().equals("AddExports")) { + Optional<String[]> value = getElement("value", String[].class, a); + if (value.isPresent()) { + for (String export : value.get()) { + Matcher m = MODULE_PACKAGE_RE.matcher(export); + if (m.matches()) { + String moduleName = m.group(1); + String packageName = m.group(2); + JLModule module = JLModule.find(moduleName); + if (module == null) { + out.printf("%s: Cannot find module named %s specified in \"AddExports\" annotation: %s%n", cls.getName(), moduleName, a); + } else { + if (packageName.equals("*")) { + module.exportAllPackagesTo(JLModule.fromClass(cls)); + } else { + module.addExports(packageName, JLModule.fromClass(cls)); + module.addOpens(packageName, JLModule.fromClass(cls)); + } + } + } else { + out.printf("%s: Ignoring \"AddExports\" annotation with value not matching <module>/<package> pattern: %s%n", cls.getName(), a); + } + } + } else { + out.printf("%s: Ignoring \"AddExports\" annotation without `String value` element: %s%n", cls.getName(), a); + } + } + } + } + } + + /** + * Gets the value of the element named {@code name} of type {@code type} from {@code annotation} + * if present. + * + * @return the requested element value wrapped in an {@link Optional} or + * {@link Optional#empty()} if {@code annotation} has no element named {@code name} + * @throws AssertionError if {@code annotation} has an element of the given name but whose type + * is not {@code type} or if there's some problem reading the value via reflection + */ + private static <T> Optional<T> getElement(String name, Class<T> type, Annotation annotation) { + Class<? extends Annotation> annotationType = annotation.annotationType(); + Method valueAccessor; + try { + valueAccessor = annotationType.getMethod(name); + if (!valueAccessor.getReturnType().equals(type)) { + throw new AssertionError(String.format("Element %s of %s is of type %s, not %s ", name, annotationType.getName(), valueAccessor.getReturnType().getName(), type.getName())); + } + } catch (NoSuchMethodException e) { + return Optional.empty(); + } + try { + return Optional.of(type.cast(valueAccessor.invoke(annotation))); + } catch (Exception e) { + throw new AssertionError(String.format("Could not read %s element from %s", name, annotation), e); + } + } + + /** + * Expand any arguments starting with @ and return the resulting argument array. + * + * @return the expanded argument array + */ + private static String[] expandArgs(String[] args) { + List<String> result = null; + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + if (arg.length() > 0 && arg.charAt(0) == '@') { + if (result == null) { + result = new ArrayList<>(); + for (int j = 0; j < i; j++) { + result.add(args[j]); + } + expandArg(arg.substring(1), result); + } + } else if (result != null) { + result.add(arg); + } + } + return result != null ? result.toArray(new String[0]) : args; + } + + /** + * Add each line from {@code filename} to the list {@code args}. + */ + private static void expandArg(String filename, List<String> args) { + BufferedReader br = null; + try { + br = new BufferedReader(new FileReader(filename)); + + String buf; + while ((buf = br.readLine()) != null) { + args.add(buf); + } + br.close(); + } catch (IOException ioe) { + ioe.printStackTrace(); + System.exit(2); + } finally { + try { + if (br != null) { + br.close(); + } + } catch (IOException ioe) { + ioe.printStackTrace(); + System.exit(3); + } + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxRunListenerDecorator.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxRunListenerDecorator.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxRunListenerDecorator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxRunListenerDecorator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.*; + +import org.junit.runner.*; +import org.junit.runner.notification.*; + +abstract class MxRunListenerDecorator implements MxRunListener { + + private final MxRunListener l; + + MxRunListenerDecorator(MxRunListener l) { + this.l = l; + } + + @Override + public void testRunStarted(Description description) { + l.testRunStarted(description); + } + + @Override + public void testRunFinished(Result result) { + l.testRunFinished(result); + } + + @Override + public void testAssumptionFailure(Failure failure) { + l.testAssumptionFailure(failure); + } + + @Override + public void testIgnored(Description description) { + l.testIgnored(description); + } + + @Override + public void testClassStarted(Class<?> clazz) { + l.testClassStarted(clazz); + } + + @Override + public void testClassFinished(Class<?> clazz, int numPassed, int numFailed) { + l.testClassFinished(clazz, numPassed, numFailed); + } + + @Override + public void testStarted(Description description) { + l.testStarted(description); + } + + @Override + public void testFinished(Description description) { + l.testFinished(description); + } + + @Override + public void testFailed(Failure failure) { + l.testFailed(failure); + } + + @Override + public void testSucceeded(Description description) { + l.testSucceeded(description); + } + + @Override + public PrintStream getWriter() { + return l.getWriter(); + } + + public void testClassFinishedDelimiter() { + l.testClassFinishedDelimiter(); + } + + public void testClassStartedDelimiter() { + l.testClassStartedDelimiter(); + } + + public void testStartedDelimiter() { + l.testStartedDelimiter(); + } + + public void testFinishedDelimiter() { + l.testFinishedDelimiter(); + } + + public boolean beVerbose() { + return l.beVerbose(); + } + +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxRunListener.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxRunListener.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxRunListener.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/MxRunListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.*; + +import org.junit.internal.*; +import org.junit.runner.*; +import org.junit.runner.notification.*; + +interface MxRunListener { + + /** + * Called before any tests have been run. + * + * @param description describes the tests to be run + */ + default void testRunStarted(Description description) { + } + + /** + * Called when all tests have finished. + * + * @param result the summary of the test run, including all the tests that failed + */ + default void testRunFinished(Result result) { + } + + /** + * Called when a test class is about to be started. + * + * @param clazz the test class + */ + default void testClassStarted(Class<?> clazz) { + } + + /** + * Called when all tests of a test class have finished. + * + * @param clazz the test class + * @param numPassed number of tests in {@code clazz} that passed + * @param numFailed number of tests in {@code clazz} that failed + */ + default void testClassFinished(Class<?> clazz, int numPassed, int numFailed) { + } + + /** + * Called when an atomic test is about to be started. This is also called for ignored tests. + * + * @param description the description of the test that is about to be run (generally a class and + * method name) + */ + default void testStarted(Description description) { + } + + /** + * Called when an atomic test has finished, whether the test succeeds, fails or is ignored. + * + * @param description the description of the test that just ran + */ + default void testFinished(Description description) { + } + + /** + * Called when an atomic test fails. + * + * @param failure describes the test that failed and the exception that was thrown + */ + default void testFailed(Failure failure) { + } + + /** + * Called when a test will not be run, generally because a test method is annotated with + * {@link org.junit.Ignore}. + * + * @param description describes the test that will not be run + */ + default void testIgnored(Description description) { + } + + /** + * Called when an atomic test succeeds. + * + * @param description describes the test that will not be run + */ + default void testSucceeded(Description description) { + } + + /** + * Called when an atomic test flags that it assumes a condition that is false. + * + * @param failure describes the test that failed and the {@link AssumptionViolatedException} + * that was thrown + */ + default void testAssumptionFailure(Failure failure) { + } + + /** + * Called after {@link #testClassFinished(Class, int, int)}. + */ + default void testClassFinishedDelimiter() { + } + + /** + * Called after {@link #testClassStarted(Class)}. + */ + default void testClassStartedDelimiter() { + } + + /** + * Called after {@link #testStarted(Description)}. + */ + default void testStartedDelimiter() { + } + + /** + * Called after {@link #testFailed(Failure)}. + */ + default void testFinishedDelimiter() { + } + + default boolean beVerbose() { + return false; + } + + PrintStream getWriter(); +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TestResultLoggerDecorator.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TestResultLoggerDecorator.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TestResultLoggerDecorator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TestResultLoggerDecorator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,56 @@ +/* + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.PrintStream; + +import org.junit.runner.Result; + +class TestResultLoggerDecorator extends MxRunListenerDecorator { + + private final PrintStream passed; + private final PrintStream failed; + + TestResultLoggerDecorator(PrintStream passed, PrintStream failed, MxRunListener l) { + super(l); + this.passed = passed; + this.failed = failed; + } + + @Override + public void testClassFinished(Class<?> clazz, int numPassed, int numFailed) { + super.testClassFinished(clazz, numPassed, numFailed); + if (numFailed != 0) { + failed.println(clazz.getName()); + } else { + passed.println(clazz.getName()); + } + } + + @Override + public void testRunFinished(Result result) { + super.testRunFinished(result); + passed.close(); + failed.close(); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TextRunListener.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TextRunListener.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TextRunListener.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TextRunListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.PrintStream; + +import org.junit.internal.JUnitSystem; +import org.junit.internal.TextListener; +import org.junit.runner.Description; +import org.junit.runner.Result; +import org.junit.runner.notification.Failure; +import org.junit.runner.notification.RunListener; + +class TextRunListener implements MxRunListener { + + private final PrintStream fWriter; + protected Failure lastFailure; + + TextRunListener(JUnitSystem system) { + this(system.out()); + } + + TextRunListener(PrintStream writer) { + fWriter = writer; + } + + public boolean beVerbose() { + return false; + } + + @Override + public PrintStream getWriter() { + return fWriter; + } + + public Failure getLastFailure() { + return lastFailure; + } + + @Override + public void testStarted(Description description) { + getWriter().print('.'); + } + + @Override + public void testFailed(Failure failure) { + getWriter().print('E'); + lastFailure = failure; + } + + @Override + public void testIgnored(Description description) { + getWriter().print('I'); + } + + public static RunListener createRunListener(MxRunListener l) { + return new TextListener(l.getWriter()) { + private Class<?> lastClass; + private int passedInLastClass; + private int failedInLastClass; + private boolean failed; + + @Override + public void testStarted(Description description) { + Class<?> currentClass = description.getTestClass(); + if (currentClass != lastClass) { + if (lastClass != null) { + l.testClassFinished(lastClass, passedInLastClass, failedInLastClass); + l.testClassFinishedDelimiter(); + } + lastClass = currentClass; + passedInLastClass = 0; + failedInLastClass = 0; + l.testClassStarted(currentClass); + l.testClassStartedDelimiter(); + } + failed = false; + l.testStarted(description); + l.testStartedDelimiter(); + } + + @Override + public void testFailure(Failure failure) { + failed = true; + failedInLastClass++; + l.testFailed(failure); + } + + @Override + public void testFinished(Description description) { + // we have to do this because there is no callback for successful tests + if (!failed) { + l.testSucceeded(description); + passedInLastClass++; + } + l.testFinished(description); + l.testFinishedDelimiter(); + } + + @Override + public void testIgnored(Description description) { + testStarted(description); + l.testIgnored(description); + l.testFinished(description); + l.testFinishedDelimiter(); + } + + @Override + public void testRunStarted(Description description) { + l.testRunStarted(description); + } + + @Override + public void testRunFinished(Result result) { + if (lastClass != null) { + l.testClassFinished(lastClass, passedInLastClass, failedInLastClass); + } + l.testRunFinished(result); + super.testRunFinished(result); + } + + @Override + public void testAssumptionFailure(Failure failure) { + l.testAssumptionFailure(failure); + } + }; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TimingDecorator.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TimingDecorator.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TimingDecorator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/TimingDecorator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,101 @@ +/* + * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.util.HashMap; +import java.util.Map; + +import org.junit.runner.Description; + +/** + * Timing support for JUnit test runs. + */ +class TimingDecorator extends MxRunListenerDecorator { + + private long startTime; + private long classStartTime; + private Description currentTest; + final Map<Class<?>, Long> classTimes; + final Map<Description, Long> testTimes; + + TimingDecorator(MxRunListener l) { + super(l); + this.classTimes = new HashMap<>(); + this.testTimes = new HashMap<>(); + } + + @Override + public void testClassStarted(Class<?> clazz) { + classStartTime = System.nanoTime(); + super.testClassStarted(clazz); + } + + @Override + public void testClassFinished(Class<?> clazz, int numPassed, int numFailed) { + long totalTime = System.nanoTime() - classStartTime; + super.testClassFinished(clazz, numPassed, numFailed); + if (beVerbose()) { + getWriter().print(' ' + valueToString(totalTime)); + } + classTimes.put(clazz, totalTime / 1_000_000); + } + + @Override + public void testStarted(Description description) { + currentTest = description; + startTime = System.nanoTime(); + super.testStarted(description); + } + + @Override + public void testFinished(Description description) { + long totalTime = System.nanoTime() - startTime; + super.testFinished(description); + if (beVerbose()) { + getWriter().print(" " + valueToString(totalTime)); + } + currentTest = null; + testTimes.put(description, totalTime / 1_000_000); + } + + private static String valueToString(long valueNS) { + long timeWholeMS = valueNS / 1_000_000; + long timeFractionMS = (valueNS / 100_000) % 10; + return String.format("%d.%d ms", timeWholeMS, timeFractionMS); + } + + /** + * Gets the test currently starting but not yet completed along with the number of milliseconds + * it has been executing. + * + * @return {@code null} if there is no test currently executing + */ + public Object[] getCurrentTestDuration() { + Description current = currentTest; + if (current != null) { + long timeMS = (System.nanoTime() - startTime) / 1_000_000; + return new Object[]{current, timeMS}; + } + return null; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/VerboseTextListener.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/VerboseTextListener.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/VerboseTextListener.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/com.oracle.mxtool.junit/com/oracle/mxtool/junit/VerboseTextListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package com.oracle.mxtool.junit; + +import java.io.*; + +import org.junit.internal.*; +import org.junit.runner.*; +import org.junit.runner.notification.*; + +class VerboseTextListener extends TextRunListener { + + private static final int DEFAULT_MAX_TEST_PER_CLASS = 50; + public static final int SHOW_ALL_TESTS = Integer.MAX_VALUE; + private final int classesCount; + private final int maxTestsPerClass; + private int currentClassNum; + private int currentTestNum; + + VerboseTextListener(JUnitSystem system, int classesCount) { + this(system.out(), classesCount, DEFAULT_MAX_TEST_PER_CLASS); + } + + VerboseTextListener(JUnitSystem system, int classesCount, int maxTests) { + this(system.out(), classesCount, maxTests); + } + + VerboseTextListener(PrintStream writer, int classesCount, int maxTests) { + super(writer); + maxTestsPerClass = maxTests; + this.classesCount = classesCount; + } + + @Override + public boolean beVerbose() { + return currentTestNum < maxTestsPerClass; + } + + @Override + public void testClassStarted(Class<?> clazz) { + ++currentClassNum; + getWriter().printf("%s started (%d of %d)", clazz.getName(), currentClassNum, classesCount); + currentTestNum = 0; + } + + @Override + public void testClassFinished(Class<?> clazz, int numPassed, int numFailed) { + getWriter().print(clazz.getName() + " finished"); + } + + @Override + public void testStarted(Description description) { + if (beVerbose()) { + getWriter().print(" " + description.getMethodName() + ": "); + currentTestNum++; + } else { + super.testStarted(description); + } + } + + @Override + public void testIgnored(Description description) { + if (beVerbose()) { + getWriter().print("Ignored"); + } else { + super.testIgnored(description); + } + } + + @Override + public void testSucceeded(Description description) { + if (beVerbose()) { + getWriter().print("Passed"); + } else { + super.testSucceeded(description); + } + } + + @Override + public void testAssumptionFailure(Failure failure) { + if (beVerbose()) { + getWriter().printf("(%s) ", failure.getMessage()); + } else { + super.testAssumptionFailure(failure); + } + } + + @Override + public void testFailed(Failure failure) { + getWriter().print("FAILED"); + lastFailure = failure; + } + + @Override + public void testClassFinishedDelimiter() { + getWriter().println(); + } + + @Override + public void testClassStartedDelimiter() { + getWriter().println(); + } + + @Override + public void testFinishedDelimiter() { + if (beVerbose()) { + getWriter().println(); + } else { + super.testFinishedDelimiter(); + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/CoreAmd64Test.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/CoreAmd64Test.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/CoreAmd64Test.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/CoreAmd64Test.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.core.amd64.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/CoreSparcTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/CoreSparcTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/CoreSparcTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/CoreSparcTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * @requires vm.simpleArch == "sparcv9" + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.core.sparc.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/CoreTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/CoreTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/CoreTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/CoreTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.core.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/DebugTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/DebugTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/DebugTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/DebugTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.debug.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/generateTests.sh openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/generateTests.sh --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/generateTests.sh 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/generateTests.sh 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,72 @@ +#!/bin/bash +# +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +while read -r fName pName requireInfo +do + fName="${fName}Test.java" + echo "Generate $fName for $pName ..." + + cat << EOF | sed 's/[[:blank:]]*$//' > $fName +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * $requireInfo + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix $pName -exclude ExcludeList.txt + */ +EOF + +done < TestPackages.txt + diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/GraphTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/GraphTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/GraphTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/GraphTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * @requires vm.graal.enabled + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.graph.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/HotspotAmd64Test.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/HotspotAmd64Test.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/HotspotAmd64Test.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/HotspotAmd64Test.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.hotspot.amd64.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/HotspotLirTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/HotspotLirTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/HotspotLirTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/HotspotLirTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.hotspot.lir.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/HotspotTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/HotspotTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/HotspotTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/HotspotTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.hotspot.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttBackendTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttBackendTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttBackendTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttBackendTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.backend -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttBytecodeTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttBytecodeTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttBytecodeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttBytecodeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.bytecode -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttExceptTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttExceptTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttExceptTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttExceptTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.except -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttHotpathTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttHotpathTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttHotpathTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttHotpathTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.hotpath -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttHotspotTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttHotspotTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttHotspotTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttHotspotTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.hotspot -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttJdkTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttJdkTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttJdkTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttJdkTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.jdk -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLangALTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLangALTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLangALTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLangALTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.[a-lA-L] -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLangMathALTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLangMathALTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLangMathALTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLangMathALTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.Math_[a-lA-L] -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLangMathMZTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLangMathMZTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLangMathMZTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLangMathMZTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.Math_[m-zM-Z] -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLangNZTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLangNZTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLangNZTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLangNZTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.lang.[n-zN-Z] -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLoopTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLoopTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttLoopTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttLoopTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.loop -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/Jtt.MicroTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/Jtt.MicroTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/Jtt.MicroTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/Jtt.MicroTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.micro -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttOptimizeTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttOptimizeTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttOptimizeTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttOptimizeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.optimize -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttReflectAETest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttReflectAETest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttReflectAETest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttReflectAETest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.reflect.[a-eA-E] -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttReflectFieldGetTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttReflectFieldGetTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttReflectFieldGetTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttReflectFieldGetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.reflect.Field_get -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttReflectFieldSetTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttReflectFieldSetTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttReflectFieldSetTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttReflectFieldSetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.reflect.Field_set -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttReflectGZTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttReflectGZTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttReflectGZTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttReflectGZTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.reflect.[g-zG-Z] -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttThreadsTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttThreadsTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/JttThreadsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/JttThreadsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.jtt.threads -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/LirJttTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/LirJttTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/LirJttTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/LirJttTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.lir.jtt -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/LoopTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/LoopTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/LoopTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/LoopTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.loop.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/NodesTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/NodesTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/NodesTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/NodesTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * @requires vm.graal.enabled + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.nodes.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/OptionsTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/OptionsTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/OptionsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/OptionsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.options.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/PhasesCommonTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/PhasesCommonTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/PhasesCommonTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/PhasesCommonTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.phases.common.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/README.md openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/README.md --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/README.md 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/README.md 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,36 @@ +This directory contains jtreg tests which are wrapper tests to execute Graal unit tests similar way they are run in Graal project. +The tests use compiler.graalunit.common.GraalUnitTestLauncher helper class to run Graal unit tests where the set of tests to execute +is specified by '-prefix' argument. GraalUnitTestLauncher launches ported com.oracle.mxtool.junit.MxJUnitWrapper to run Graal unit +tests as it is done by "mx unittest" command from Graal project. + +All compiler/graalunit/*.java tests were automatically generated by generateTests.sh script which reads +"testName -> testPrefix [requiresStatement]" mapping from TestPackages.txt file and generates corresponding <testName>Test.java +tests. The mapping takes into account tests execution time to avoid very long test runs. + +Graal unit tests depends on following external jar files: + asm-5.0.4.jar: + https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-5.0.4.jar + + asm-tree-5.0.4.jar: + https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/asm-tree-5.0.4.jar + + junit-4.12.jar: + https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/junit-4.12.jar + + hamcrest-core-1.3.jar: + https://lafo.ssw.uni-linz.ac.at/pub/graal-external-deps/hamcrest-core-1.3.jar + + java-allocation-instrumenter.jar: + https://lafo.ssw.uni-linz.ac.at/pub/java-allocation-instrumenter/java-allocation-instrumenter-8f0db117e64e.jar + +Before running the tests you need to download these jars from above locations in build/<platform>/images/test/hotspot/jtreg/graal/ +directory. Then you can pass it to jtreg as java option by using "-vmoptions:-Dgraalunit.libs=" or as environment variable +by using "-e:TEST_IMAGE_GRAAL_DIR=..." + +Example: +> jtreg -vt -jdk:<TESTED_JDK> -vmoptions:"-vmoptions:-Dgraalunit.libs=build/<platform>/images/test/hotspot/jtreg/graal" + compiler/graalunit/UtilTest.java + +To run Graal unit tests in Graal as JIT mode pass additional -vmoptions to jtreg: + -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI -XX:+TieredCompilation -XX:+UseJVMCICompiler -Djvmci.Compiler=graal + diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/ReplacementsTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/ReplacementsTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/ReplacementsTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/ReplacementsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.compiler.replacements.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/TestPackages.txt openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/TestPackages.txt --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/TestPackages.txt 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/TestPackages.txt 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,40 @@ +Collections jdk.internal.vm.compiler.collections.test +ApiDirectives org.graalvm.compiler.api.directives.test +Api org.graalvm.compiler.api.test +AsmAarch64 org.graalvm.compiler.asm.aarch64.test +AsmAmd64 org.graalvm.compiler.asm.amd64.test +AsmSparc org.graalvm.compiler.asm.sparc.test +CoreAmd64 org.graalvm.compiler.core.amd64.test +CoreSparc org.graalvm.compiler.core.sparc.test @requires vm.simpleArch == "sparcv9" +Core org.graalvm.compiler.core.test +Debug org.graalvm.compiler.debug.test +Graph org.graalvm.compiler.graph.test @requires vm.graal.enabled +HotspotAmd64 org.graalvm.compiler.hotspot.amd64.test +HotspotLir org.graalvm.compiler.hotspot.lir.test +Hotspot org.graalvm.compiler.hotspot.test +Loop org.graalvm.compiler.loop.test +Nodes org.graalvm.compiler.nodes.test @requires vm.graal.enabled +Options org.graalvm.compiler.options.test +PhasesCommon org.graalvm.compiler.phases.common.test +Replacements org.graalvm.compiler.replacements.test +Util org.graalvm.util.test +JttBackend org.graalvm.compiler.jtt.backend +JttBytecode org.graalvm.compiler.jtt.bytecode +JttExcept org.graalvm.compiler.jtt.except +JttHotpath org.graalvm.compiler.jtt.hotpath +JttHotspot org.graalvm.compiler.jtt.hotspot +JttJdk org.graalvm.compiler.jtt.jdk +JttLangAL org.graalvm.compiler.jtt.lang.[a-lA-L] +JttLangMathAL org.graalvm.compiler.jtt.lang.Math_[a-lA-L] +JttLangMathMZ org.graalvm.compiler.jtt.lang.Math_[m-zM-Z] +JttLangNZ org.graalvm.compiler.jtt.lang.[n-zN-Z] +JttLoop org.graalvm.compiler.jtt.loop +Jtt.Micro org.graalvm.compiler.jtt.micro +JttOptimize org.graalvm.compiler.jtt.optimize +JttReflectAE org.graalvm.compiler.jtt.reflect.[a-eA-E] +JttReflectFieldGet org.graalvm.compiler.jtt.reflect.Field_get +JttReflectFieldSet org.graalvm.compiler.jtt.reflect.Field_set +JttReflectGZ org.graalvm.compiler.jtt.reflect.[g-zG-Z] +JttThreads org.graalvm.compiler.jtt.threads +LirJtt org.graalvm.compiler.lir.jtt +Lir org.graalvm.compiler.lir.test \ No newline at end of file diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/UtilTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/UtilTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/graalunit/UtilTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/graalunit/UtilTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,38 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary + * @requires vm.opt.final.EnableJVMCI == true + * + * @modules jdk.internal.vm.compiler + * + * @library /test/lib /compiler/graalunit / + * + * @build compiler.graalunit.common.GraalUnitTestLauncher + * + * @run driver jdk.test.lib.FileInstaller ../../ProblemList-graal.txt ExcludeList.txt + * + * @run main/othervm compiler.graalunit.common.GraalUnitTestLauncher -prefix org.graalvm.util.test -exclude ExcludeList.txt + */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/baseEncode.txt openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/baseEncode.txt --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/baseEncode.txt 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/baseEncode.txt 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,183 @@ +VGhpcyB0ZXN0IGRhdGEgaXMgcGFydCBvZiByZmMyMDQ1IHdoaWNoIGluY2x1ZGVzIGFsbCBjaGFyYWN0ZXJzIGF+eiBBflosIDB+OSBhbmQgYWxsIHN5bWJvbHMs +SXQgaXMgdXNlZCB0byB0ZXN0IGphdmEudXRpbC5CYXNlNjQuRW5jb2RlciwgYW5kIHdpbGwgYmUgZW5jb2RlZCBieSBvcmcuYXBhY2hlLmNvbW1vbnMuY29kZWMuYmluYXJ5LkJhc2U2NC5qYXZh +dG8gdGVzdCBqYXZhLnV0aWwuQmFzZTY0LkRlY29kZXI7 + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAgICAgICAgIFtQYWdlIDFd +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + +ICAgVGhlc2UgZG9jdW1lbnRzIGFyZSByZXZpc2lvbnMgb2YgUkZDcyAxNTIxLCAxNTIyLCBhbmQgMTU5MCwgd2hpY2g= +ICAgdGhlbXNlbHZlcyB3ZXJlIHJldmlzaW9ucyBvZiBSRkNzIDEzNDEgYW5kIDEzNDIuICBBbiBhcHBlbmRpeCBpbiBSRkM= +ICAgMjA0OSBkZXNjcmliZXMgZGlmZmVyZW5jZXMgYW5kIGNoYW5nZXMgZnJvbSBwcmV2aW91cyB2ZXJzaW9ucy4= + +VGFibGUgb2YgQ29udGVudHM= + +ICAgMS4gSW50cm9kdWN0aW9uIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgIDM= +ICAgMi4gRGVmaW5pdGlvbnMsIENvbnZlbnRpb25zLCBhbmQgR2VuZXJpYyBCTkYgR3JhbW1hciAuLi4uICAgIDU= +ICAgMy4gTUlNRSBIZWFkZXIgRmllbGRzIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgIDg= +ICAgNC4gTUlNRS1WZXJzaW9uIEhlYWRlciBGaWVsZCAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgIDg= +ICAgNS4gQ29udGVudC1UeXBlIEhlYWRlciBGaWVsZCAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMTA= +ICAgNi4gQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZyBIZWFkZXIgRmllbGQgLi4uLi4uLi4uLi4uLi4uICAgMTQ= +ICAgNy4gQ29udGVudC1JRCBIZWFkZXIgRmllbGQgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjY= +ICAgOC4gQ29udGVudC1EZXNjcmlwdGlvbiBIZWFkZXIgRmllbGQgLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjc= +ICAgOS4gQWRkaXRpb25hbCBNSU1FIEhlYWRlciBGaWVsZHMgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjc= +ICAgMTAuIFN1bW1hcnkgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjc= +ICAgMTEuIFNlY3VyaXR5IENvbnNpZGVyYXRpb25zIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjc= +ICAgMTIuIEF1dGhvcnMnIEFkZHJlc3NlcyAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjg= +ICAgQS4gQ29sbGVjdGVkIEdyYW1tYXIgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjk= + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAgICAgICAgIFtQYWdlIDdd +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + +My4gIE1JTUUgSGVhZGVyIEZpZWxkcw== + +ICAgTUlNRSBkZWZpbmVzIGEgbnVtYmVyIG9mIG5ldyBSRkMgODIyIGhlYWRlciBmaWVsZHMgdGhhdCBhcmUgdXNlZCB0bw== +ICAgZGVzY3JpYmUgdGhlIGNvbnRlbnQgb2YgYSBNSU1FIGVudGl0eS4gIFRoZXNlIGhlYWRlciBmaWVsZHMgb2NjdXIgaW4= +ICAgYXQgbGVhc3QgdHdvIGNvbnRleHRzOg== + +ICAgICgxKSAgIEFzIHBhcnQgb2YgYSByZWd1bGFyIFJGQyA4MjIgbWVzc2FnZSBoZWFkZXIu + +ICAgICgyKSAgIEluIGEgTUlNRSBib2R5IHBhcnQgaGVhZGVyIHdpdGhpbiBhIG11bHRpcGFydA== +ICAgICAgICAgIGNvbnN0cnVjdC4= + +ICAgVGhlIGZvcm1hbCBkZWZpbml0aW9uIG9mIHRoZXNlIGhlYWRlciBmaWVsZHMgaXMgYXMgZm9sbG93czo= + +ICAgICBNSU1FLW1lc3NhZ2UtaGVhZGVycyA6PSBlbnRpdHktaGVhZGVycw== +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWVsZHM= +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJzaW9uIENSTEY= +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7IFRoZSBvcmRlcmluZyBvZiB0aGUgaGVhZGVy +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7IGZpZWxkcyBpbXBsaWVkIGJ5IHRoaXMgQk5G +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7IGRlZmluaXRpb24gc2hvdWxkIGJlIGlnbm9yZWQu + +ICAgICBNSU1FLXBhcnQtaGVhZGVycyA6PSBlbnRpdHktaGVhZGVycw== +ICAgICAgICAgICAgICAgICAgICAgICAgICBbIGZpZWxkcyBd +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IEFueSBmaWVsZCBub3QgYmVnaW5uaW5nIHdpdGg= +ICAgICAgICAgICAgICAgICAgICAgICAgICA7ICJjb250ZW50LSIgY2FuIGhhdmUgbm8gZGVmaW5lZA== +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IG1lYW5pbmcgYW5kIG1heSBiZSBpZ25vcmVkLg== +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IFRoZSBvcmRlcmluZyBvZiB0aGUgaGVhZGVy +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IGZpZWxkcyBpbXBsaWVkIGJ5IHRoaXMgQk5G +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IGRlZmluaXRpb24gc2hvdWxkIGJlIGlnbm9yZWQu + +ICAgVGhlIHN5bnRheCBvZiB0aGUgdmFyaW91cyBzcGVjaWZpYyBNSU1FIGhlYWRlciBmaWVsZHMgd2lsbCBiZQ== +ICAgZGVzY3JpYmVkIGluIHRoZSBmb2xsb3dpbmcgc2VjdGlvbnMu + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAgICAgICAgW1BhZ2UgMTFd +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + +NS4xLiAgU3ludGF4IG9mIHRoZSBDb250ZW50LVR5cGUgSGVhZGVyIEZpZWxk + +ICAgSW4gdGhlIEF1Z21lbnRlZCBCTkYgbm90YXRpb24gb2YgUkZDIDgyMiwgYSBDb250ZW50LVR5cGUgaGVhZGVyIGZpZWxk +ICAgdmFsdWUgaXMgZGVmaW5lZCBhcyBmb2xsb3dzOg== + +ICAgICBjb250ZW50IDo9ICJDb250ZW50LVR5cGUiICI6IiB0eXBlICIvIiBzdWJ0eXBl +ICAgICAgICAgICAgICAgICooIjsiIHBhcmFtZXRlcik= +ICAgICAgICAgICAgICAgIDsgTWF0Y2hpbmcgb2YgbWVkaWEgdHlwZSBhbmQgc3VidHlwZQ== +ICAgICAgICAgICAgICAgIDsgaXMgQUxXQVlTIGNhc2UtaW5zZW5zaXRpdmUu + +ICAgICB0eXBlIDo9IGRpc2NyZXRlLXR5cGUgLyBjb21wb3NpdGUtdHlwZQ== + +ICAgICBkaXNjcmV0ZS10eXBlIDo9ICJ0ZXh0IiAvICJpbWFnZSIgLyAiYXVkaW8iIC8gInZpZGVvIiAv +ICAgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbiIgLyBleHRlbnNpb24tdG9rZW4= + +ICAgICBjb21wb3NpdGUtdHlwZSA6PSAibWVzc2FnZSIgLyAibXVsdGlwYXJ0IiAvIGV4dGVuc2lvbi10b2tlbg== + +ICAgICBleHRlbnNpb24tdG9rZW4gOj0gaWV0Zi10b2tlbiAvIHgtdG9rZW4= + +ICAgICBpZXRmLXRva2VuIDo9IDxBbiBleHRlbnNpb24gdG9rZW4gZGVmaW5lZCBieSBh +ICAgICAgICAgICAgICAgICAgICBzdGFuZGFyZHMtdHJhY2sgUkZDIGFuZCByZWdpc3RlcmVk +ICAgICAgICAgICAgICAgICAgICB3aXRoIElBTkEuPg== + +ICAgICB4LXRva2VuIDo9IDxUaGUgdHdvIGNoYXJhY3RlcnMgIlgtIiBvciAieC0iIGZvbGxvd2VkLCB3aXRo +ICAgICAgICAgICAgICAgICBubyBpbnRlcnZlbmluZyB3aGl0ZSBzcGFjZSwgYnkgYW55IHRva2VuPg== + +ICAgICBzdWJ0eXBlIDo9IGV4dGVuc2lvbi10b2tlbiAvIGlhbmEtdG9rZW4= + +ICAgICBpYW5hLXRva2VuIDo9IDxBIHB1YmxpY2x5LWRlZmluZWQgZXh0ZW5zaW9uIHRva2VuLiBUb2tlbnM= +ICAgICAgICAgICAgICAgICAgICBvZiB0aGlzIGZvcm0gbXVzdCBiZSByZWdpc3RlcmVkIHdpdGggSUFOQQ== +ICAgICAgICAgICAgICAgICAgICBhcyBzcGVjaWZpZWQgaW4gUkZDIDIwNDguPg== + +ICAgICBwYXJhbWV0ZXIgOj0gYXR0cmlidXRlICI9IiB2YWx1ZQ== + +ICAgICBhdHRyaWJ1dGUgOj0gdG9rZW4= +ICAgICAgICAgICAgICAgICAgOyBNYXRjaGluZyBvZiBhdHRyaWJ1dGVz +ICAgICAgICAgICAgICAgICAgOyBpcyBBTFdBWVMgY2FzZS1pbnNlbnNpdGl2ZS4= + +ICAgICB2YWx1ZSA6PSB0b2tlbiAvIHF1b3RlZC1zdHJpbmc= + +ICAgICB0b2tlbiA6PSAxKjxhbnkgKFVTLUFTQ0lJKSBDSEFSIGV4Y2VwdCBTUEFDRSwgQ1RMcyw= +ICAgICAgICAgICAgICAgICBvciB0c3BlY2lhbHM+ + +ICAgICB0c3BlY2lhbHMgOj0gICIoIiAvICIpIiAvICI8IiAvICI+IiAvICJAIiAv +ICAgICAgICAgICAgICAgICAgICIsIiAvICI7IiAvICI6IiAvICJcIiAvIDwiPg== +ICAgICAgICAgICAgICAgICAgICIvIiAvICJbIiAvICJdIiAvICI/IiAvICI9Ig== +ICAgICAgICAgICAgICAgICAgIDsgTXVzdCBiZSBpbiBxdW90ZWQtc3RyaW5nLA== +ICAgICAgICAgICAgICAgICAgIDsgdG8gdXNlIHdpdGhpbiBwYXJhbWV0ZXIgdmFsdWVz + +ICAgICBkZXNjcmlwdGlvbiA6PSAiQ29udGVudC1EZXNjcmlwdGlvbiIgIjoiICp0ZXh0 + +ICAgICBlbmNvZGluZyA6PSAiQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZyIgIjoiIG1lY2hhbmlzbQ== + +ICAgICBlbnRpdHktaGVhZGVycyA6PSBbIGNvbnRlbnQgQ1JMRiBd +ICAgICAgICAgICAgICAgICAgICBbIGVuY29kaW5nIENSTEYgXQ== +ICAgICAgICAgICAgICAgICAgICBbIGlkIENSTEYgXQ== +ICAgICAgICAgICAgICAgICAgICBbIGRlc2NyaXB0aW9uIENSTEYgXQ== +ICAgICAgICAgICAgICAgICAgICAqKCBNSU1FLWV4dGVuc2lvbi1maWVsZCBDUkxGICk= + +ICAgICBoZXgtb2N0ZXQgOj0gIj0iIDIoRElHSVQgLyAiQSIgLyAiQiIgLyAiQyIgLyAiRCIgLyAiRSIgLyAiRiIp +ICAgICAgICAgICAgICAgOyBPY3RldCBtdXN0IGJlIHVzZWQgZm9yIGNoYXJhY3RlcnMgPiAxMjcsID0s +ICAgICAgICAgICAgICAgOyBTUEFDRXMgb3IgVEFCcyBhdCB0aGUgZW5kcyBvZiBsaW5lcywgYW5kIGlz +ICAgICAgICAgICAgICAgOyByZWNvbW1lbmRlZCBmb3IgYW55IGNoYXJhY3RlciBub3QgbGlzdGVkIGlu +ICAgICAgICAgICAgICAgOyBSRkMgMjA0OSBhcyAibWFpbC1zYWZlIi4= + +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + +ICAgICAgICAgIG11c3QgYmUgdXNlZC4gIEFuIGVxdWFsIHNpZ24gYXMgdGhlIGxhc3QgY2hhcmFjdGVyIG9uIGE= +ICAgICAgICAgIGVuY29kZWQgbGluZSBpbmRpY2F0ZXMgc3VjaCBhIG5vbi1zaWduaWZpY2FudCAoInNvZnQiKQ== +ICAgICAgICAgIGxpbmUgYnJlYWsgaW4gdGhlIGVuY29kZWQgdGV4dC4= + +ICAgVGh1cyBpZiB0aGUgInJhdyIgZm9ybSBvZiB0aGUgbGluZSBpcyBhIHNpbmdsZSB1bmVuY29kZWQgbGluZSB0aGF0 +ICAgc2F5czo= + +ICAgICBOb3cncyB0aGUgdGltZSBmb3IgYWxsIGZvbGsgdG8gY29tZSB0byB0aGUgYWlkIG9mIHRoZWlyIGNvdW50cnku + +ICAgVGhpcyBjYW4gYmUgcmVwcmVzZW50ZWQsIGluIHRoZSBRdW90ZWQtUHJpbnRhYmxlIGVuY29kaW5nLCBhczo= + +ICAgICBOb3cncyB0aGUgdGltZSA9 +ICAgICBmb3IgYWxsIGZvbGsgdG8gY29tZT0= +ICAgICAgdG8gdGhlIGFpZCBvZiB0aGVpciBjb3VudHJ5Lg== + +ICAgU2luY2UgdGhlIGh5cGhlbiBjaGFyYWN0ZXIgKCItIikgbWF5IGJlIHJlcHJlc2VudGVkIGFzIGl0c2VsZiBpbiB0aGU= +ICAgUXVvdGVkLVByaW50YWJsZSBlbmNvZGluZywgY2FyZSBtdXN0IGJlIHRha2VuLCB3aGVuIGVuY2Fwc3VsYXRpbmcgYQ== +ICAgcXVvdGVkLXByaW50YWJsZSBlbmNvZGVkIGJvZHkgaW5zaWRlIG9uZSBvciBtb3JlIG11bHRpcGFydCBlbnRpdGllcyw= +ICAgdG8gZW5zdXJlIHRoYXQgdGhlIGJvdW5kYXJ5IGRlbGltaXRlciBkb2VzIG5vdCBhcHBlYXIgYW55d2hlcmUgaW4gdGhl +ICAgZW5jb2RlZCBib2R5LiAgKEEgZ29vZCBzdHJhdGVneSBpcyB0byBjaG9vc2UgYSBib3VuZGFyeSB0aGF0IGluY2x1ZGVz +ICAgYSBjaGFyYWN0ZXIgc2VxdWVuY2Ugc3VjaCBhcyAiPV8iIHdoaWNoIGNhbiBuZXZlciBhcHBlYXIgaW4gYQ== +ICAgcXVvdGVkLXByaW50YWJsZSBib2R5LiAgU2VlIHRoZSBkZWZpbml0aW9uIG9mIG11bHRpcGFydCBtZXNzYWdlcyBpbg== +ICAgUkZDIDIwNDYuKQ== + +ICAgICAhIiMkQFtcXV5ge3x9fiU= + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAgICAgICAgW1BhZ2UgMjRd + +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + + +ICAgICAgICAgICAgICAgICAgICBUYWJsZSAxOiBUaGUgQmFzZTY0IEFscGhhYmV0 + +ICAgICBWYWx1ZSBFbmNvZGluZyAgVmFsdWUgRW5jb2RpbmcgIFZhbHVlIEVuY29kaW5nICBWYWx1ZSBFbmNvZGluZw== +ICAgICAgICAgMCBBICAgICAgICAgICAgMTcgUiAgICAgICAgICAgIDM0IGkgICAgICAgICAgICA1MSB6 +ICAgICAgICAgMSBCICAgICAgICAgICAgMTggUyAgICAgICAgICAgIDM1IGogICAgICAgICAgICA1MiAw +ICAgICAgICAgMiBDICAgICAgICAgICAgMTkgVCAgICAgICAgICAgIDM2IGsgICAgICAgICAgICA1MyAx +ICAgICAgICAgMyBEICAgICAgICAgICAgMjAgVSAgICAgICAgICAgIDM3IGwgICAgICAgICAgICA1NCAy +ICAgICAgICAgNCBFICAgICAgICAgICAgMjEgViAgICAgICAgICAgIDM4IG0gICAgICAgICAgICA1NSAz +ICAgICAgICAgNSBGICAgICAgICAgICAgMjIgVyAgICAgICAgICAgIDM5IG4gICAgICAgICAgICA1NiA0 +ICAgICAgICAgNiBHICAgICAgICAgICAgMjMgWCAgICAgICAgICAgIDQwIG8gICAgICAgICAgICA1NyA1 +ICAgICAgICAgNyBIICAgICAgICAgICAgMjQgWSAgICAgICAgICAgIDQxIHAgICAgICAgICAgICA1OCA2 +ICAgICAgICAgOCBJICAgICAgICAgICAgMjUgWiAgICAgICAgICAgIDQyIHEgICAgICAgICAgICA1OSA3 +ICAgICAgICAgOSBKICAgICAgICAgICAgMjYgYSAgICAgICAgICAgIDQzIHIgICAgICAgICAgICA2MCA4 +ICAgICAgICAxMCBLICAgICAgICAgICAgMjcgYiAgICAgICAgICAgIDQ0IHMgICAgICAgICAgICA2MSA5 +ICAgICAgICAxMSBMICAgICAgICAgICAgMjggYyAgICAgICAgICAgIDQ1IHQgICAgICAgICAgICA2MiAr +ICAgICAgICAxMiBNICAgICAgICAgICAgMjkgZCAgICAgICAgICAgIDQ2IHUgICAgICAgICAgICA2MyAv +ICAgICAgICAxMyBOICAgICAgICAgICAgMzAgZSAgICAgICAgICAgIDQ3IHY= +ICAgICAgICAxNCBPICAgICAgICAgICAgMzEgZiAgICAgICAgICAgIDQ4IHcgICAgICAgICAocGFkKSA9 +ICAgICAgICAxNSBQICAgICAgICAgICAgMzIgZyAgICAgICAgICAgIDQ5IHg= +ICAgICAgICAxNiBRICAgICAgICAgICAgMzMgaCAgICAgICAgICAgIDUwIHk= diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/mimeEncode.txt openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/mimeEncode.txt --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/mimeEncode.txt 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/mimeEncode.txt 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,391 @@ +VGhpcyB0ZXN0IGRhdGEgaXMgcGFydCBvZiByZmMyMDQ1IHdoaWNoIGluY2x1ZGVzIGFsbCBjaGFy +YWN0ZXJzIGF+eiBBflosIDB+OSBhbmQgYWxsIHN5bWJvbHMs + +SXQgaXMgdXNlZCB0byB0ZXN0IGphdmEudXRpbC5CYXNlNjQuRW5jb2RlciwgYW5kIHdpbGwgYmUg +ZW5jb2RlZCBieSBvcmcuYXBhY2hlLmNvbW1vbnMuY29kZWMuYmluYXJ5LkJhc2U2NC5qYXZh + +dG8gdGVzdCBqYXZhLnV0aWwuQmFzZTY0LkRlY29kZXI7 + + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAg +ICAgICAgIFtQYWdlIDFd + +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAg +ICBOb3ZlbWJlciAxOTk2 + + +ICAgVGhlc2UgZG9jdW1lbnRzIGFyZSByZXZpc2lvbnMgb2YgUkZDcyAxNTIxLCAxNTIyLCBhbmQg +MTU5MCwgd2hpY2g= + +ICAgdGhlbXNlbHZlcyB3ZXJlIHJldmlzaW9ucyBvZiBSRkNzIDEzNDEgYW5kIDEzNDIuICBBbiBh +cHBlbmRpeCBpbiBSRkM= + +ICAgMjA0OSBkZXNjcmliZXMgZGlmZmVyZW5jZXMgYW5kIGNoYW5nZXMgZnJvbSBwcmV2aW91cyB2 +ZXJzaW9ucy4= + + +VGFibGUgb2YgQ29udGVudHM= + + +ICAgMS4gSW50cm9kdWN0aW9uIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgIDM= + +ICAgMi4gRGVmaW5pdGlvbnMsIENvbnZlbnRpb25zLCBhbmQgR2VuZXJpYyBCTkYgR3JhbW1hciAu +Li4uICAgIDU= + +ICAgMy4gTUlNRSBIZWFkZXIgRmllbGRzIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgIDg= + +ICAgNC4gTUlNRS1WZXJzaW9uIEhlYWRlciBGaWVsZCAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgIDg= + +ICAgNS4gQ29udGVudC1UeXBlIEhlYWRlciBGaWVsZCAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgMTA= + +ICAgNi4gQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZyBIZWFkZXIgRmllbGQgLi4uLi4uLi4uLi4u +Li4uICAgMTQ= + +ICAgNy4gQ29udGVudC1JRCBIZWFkZXIgRmllbGQgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgMjY= + +ICAgOC4gQ29udGVudC1EZXNjcmlwdGlvbiBIZWFkZXIgRmllbGQgLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgMjc= + +ICAgOS4gQWRkaXRpb25hbCBNSU1FIEhlYWRlciBGaWVsZHMgLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgMjc= + +ICAgMTAuIFN1bW1hcnkgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgMjc= + +ICAgMTEuIFNlY3VyaXR5IENvbnNpZGVyYXRpb25zIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgMjc= + +ICAgMTIuIEF1dGhvcnMnIEFkZHJlc3NlcyAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgMjg= + +ICAgQS4gQ29sbGVjdGVkIEdyYW1tYXIgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4u +Li4uICAgMjk= + + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAg +ICAgICAgIFtQYWdlIDdd + +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAg +ICBOb3ZlbWJlciAxOTk2 + + +My4gIE1JTUUgSGVhZGVyIEZpZWxkcw== + + +ICAgTUlNRSBkZWZpbmVzIGEgbnVtYmVyIG9mIG5ldyBSRkMgODIyIGhlYWRlciBmaWVsZHMgdGhh +dCBhcmUgdXNlZCB0bw== + +ICAgZGVzY3JpYmUgdGhlIGNvbnRlbnQgb2YgYSBNSU1FIGVudGl0eS4gIFRoZXNlIGhlYWRlciBm +aWVsZHMgb2NjdXIgaW4= + +ICAgYXQgbGVhc3QgdHdvIGNvbnRleHRzOg== + + +ICAgICgxKSAgIEFzIHBhcnQgb2YgYSByZWd1bGFyIFJGQyA4MjIgbWVzc2FnZSBoZWFkZXIu + + +ICAgICgyKSAgIEluIGEgTUlNRSBib2R5IHBhcnQgaGVhZGVyIHdpdGhpbiBhIG11bHRpcGFydA== + +ICAgICAgICAgIGNvbnN0cnVjdC4= + + +ICAgVGhlIGZvcm1hbCBkZWZpbml0aW9uIG9mIHRoZXNlIGhlYWRlciBmaWVsZHMgaXMgYXMgZm9s +bG93czo= + + +ICAgICBNSU1FLW1lc3NhZ2UtaGVhZGVycyA6PSBlbnRpdHktaGVhZGVycw== + +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWVsZHM= + +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJzaW9uIENSTEY= + +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7IFRoZSBvcmRlcmluZyBvZiB0aGUgaGVhZGVy + +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7IGZpZWxkcyBpbXBsaWVkIGJ5IHRoaXMgQk5G + +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7IGRlZmluaXRpb24gc2hvdWxkIGJlIGlnbm9y +ZWQu + + +ICAgICBNSU1FLXBhcnQtaGVhZGVycyA6PSBlbnRpdHktaGVhZGVycw== + +ICAgICAgICAgICAgICAgICAgICAgICAgICBbIGZpZWxkcyBd + +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IEFueSBmaWVsZCBub3QgYmVnaW5uaW5nIHdpdGg= + +ICAgICAgICAgICAgICAgICAgICAgICAgICA7ICJjb250ZW50LSIgY2FuIGhhdmUgbm8gZGVmaW5l +ZA== + +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IG1lYW5pbmcgYW5kIG1heSBiZSBpZ25vcmVkLg== + +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IFRoZSBvcmRlcmluZyBvZiB0aGUgaGVhZGVy + +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IGZpZWxkcyBpbXBsaWVkIGJ5IHRoaXMgQk5G + +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IGRlZmluaXRpb24gc2hvdWxkIGJlIGlnbm9yZWQu + + +ICAgVGhlIHN5bnRheCBvZiB0aGUgdmFyaW91cyBzcGVjaWZpYyBNSU1FIGhlYWRlciBmaWVsZHMg +d2lsbCBiZQ== + +ICAgZGVzY3JpYmVkIGluIHRoZSBmb2xsb3dpbmcgc2VjdGlvbnMu + + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAg +ICAgICAgW1BhZ2UgMTFd + +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAg +ICBOb3ZlbWJlciAxOTk2 + + +NS4xLiAgU3ludGF4IG9mIHRoZSBDb250ZW50LVR5cGUgSGVhZGVyIEZpZWxk + + +ICAgSW4gdGhlIEF1Z21lbnRlZCBCTkYgbm90YXRpb24gb2YgUkZDIDgyMiwgYSBDb250ZW50LVR5 +cGUgaGVhZGVyIGZpZWxk + +ICAgdmFsdWUgaXMgZGVmaW5lZCBhcyBmb2xsb3dzOg== + + +ICAgICBjb250ZW50IDo9ICJDb250ZW50LVR5cGUiICI6IiB0eXBlICIvIiBzdWJ0eXBl + +ICAgICAgICAgICAgICAgICooIjsiIHBhcmFtZXRlcik= + +ICAgICAgICAgICAgICAgIDsgTWF0Y2hpbmcgb2YgbWVkaWEgdHlwZSBhbmQgc3VidHlwZQ== + +ICAgICAgICAgICAgICAgIDsgaXMgQUxXQVlTIGNhc2UtaW5zZW5zaXRpdmUu + + +ICAgICB0eXBlIDo9IGRpc2NyZXRlLXR5cGUgLyBjb21wb3NpdGUtdHlwZQ== + + +ICAgICBkaXNjcmV0ZS10eXBlIDo9ICJ0ZXh0IiAvICJpbWFnZSIgLyAiYXVkaW8iIC8gInZpZGVv +IiAv + +ICAgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbiIgLyBleHRlbnNpb24tdG9rZW4= + + +ICAgICBjb21wb3NpdGUtdHlwZSA6PSAibWVzc2FnZSIgLyAibXVsdGlwYXJ0IiAvIGV4dGVuc2lv +bi10b2tlbg== + + +ICAgICBleHRlbnNpb24tdG9rZW4gOj0gaWV0Zi10b2tlbiAvIHgtdG9rZW4= + + +ICAgICBpZXRmLXRva2VuIDo9IDxBbiBleHRlbnNpb24gdG9rZW4gZGVmaW5lZCBieSBh + +ICAgICAgICAgICAgICAgICAgICBzdGFuZGFyZHMtdHJhY2sgUkZDIGFuZCByZWdpc3RlcmVk + +ICAgICAgICAgICAgICAgICAgICB3aXRoIElBTkEuPg== + + +ICAgICB4LXRva2VuIDo9IDxUaGUgdHdvIGNoYXJhY3RlcnMgIlgtIiBvciAieC0iIGZvbGxvd2Vk +LCB3aXRo + +ICAgICAgICAgICAgICAgICBubyBpbnRlcnZlbmluZyB3aGl0ZSBzcGFjZSwgYnkgYW55IHRva2Vu +Pg== + + +ICAgICBzdWJ0eXBlIDo9IGV4dGVuc2lvbi10b2tlbiAvIGlhbmEtdG9rZW4= + + +ICAgICBpYW5hLXRva2VuIDo9IDxBIHB1YmxpY2x5LWRlZmluZWQgZXh0ZW5zaW9uIHRva2VuLiBU +b2tlbnM= + +ICAgICAgICAgICAgICAgICAgICBvZiB0aGlzIGZvcm0gbXVzdCBiZSByZWdpc3RlcmVkIHdpdGgg +SUFOQQ== + +ICAgICAgICAgICAgICAgICAgICBhcyBzcGVjaWZpZWQgaW4gUkZDIDIwNDguPg== + + +ICAgICBwYXJhbWV0ZXIgOj0gYXR0cmlidXRlICI9IiB2YWx1ZQ== + + +ICAgICBhdHRyaWJ1dGUgOj0gdG9rZW4= + +ICAgICAgICAgICAgICAgICAgOyBNYXRjaGluZyBvZiBhdHRyaWJ1dGVz + +ICAgICAgICAgICAgICAgICAgOyBpcyBBTFdBWVMgY2FzZS1pbnNlbnNpdGl2ZS4= + + +ICAgICB2YWx1ZSA6PSB0b2tlbiAvIHF1b3RlZC1zdHJpbmc= + + +ICAgICB0b2tlbiA6PSAxKjxhbnkgKFVTLUFTQ0lJKSBDSEFSIGV4Y2VwdCBTUEFDRSwgQ1RMcyw= + +ICAgICAgICAgICAgICAgICBvciB0c3BlY2lhbHM+ + + +ICAgICB0c3BlY2lhbHMgOj0gICIoIiAvICIpIiAvICI8IiAvICI+IiAvICJAIiAv + +ICAgICAgICAgICAgICAgICAgICIsIiAvICI7IiAvICI6IiAvICJcIiAvIDwiPg== + +ICAgICAgICAgICAgICAgICAgICIvIiAvICJbIiAvICJdIiAvICI/IiAvICI9Ig== + +ICAgICAgICAgICAgICAgICAgIDsgTXVzdCBiZSBpbiBxdW90ZWQtc3RyaW5nLA== + +ICAgICAgICAgICAgICAgICAgIDsgdG8gdXNlIHdpdGhpbiBwYXJhbWV0ZXIgdmFsdWVz + + +ICAgICBkZXNjcmlwdGlvbiA6PSAiQ29udGVudC1EZXNjcmlwdGlvbiIgIjoiICp0ZXh0 + + +ICAgICBlbmNvZGluZyA6PSAiQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZyIgIjoiIG1lY2hhbmlz +bQ== + + +ICAgICBlbnRpdHktaGVhZGVycyA6PSBbIGNvbnRlbnQgQ1JMRiBd + +ICAgICAgICAgICAgICAgICAgICBbIGVuY29kaW5nIENSTEYgXQ== + +ICAgICAgICAgICAgICAgICAgICBbIGlkIENSTEYgXQ== + +ICAgICAgICAgICAgICAgICAgICBbIGRlc2NyaXB0aW9uIENSTEYgXQ== + +ICAgICAgICAgICAgICAgICAgICAqKCBNSU1FLWV4dGVuc2lvbi1maWVsZCBDUkxGICk= + + +ICAgICBoZXgtb2N0ZXQgOj0gIj0iIDIoRElHSVQgLyAiQSIgLyAiQiIgLyAiQyIgLyAiRCIgLyAi +RSIgLyAiRiIp + +ICAgICAgICAgICAgICAgOyBPY3RldCBtdXN0IGJlIHVzZWQgZm9yIGNoYXJhY3RlcnMgPiAxMjcs +ID0s + +ICAgICAgICAgICAgICAgOyBTUEFDRXMgb3IgVEFCcyBhdCB0aGUgZW5kcyBvZiBsaW5lcywgYW5k +IGlz + +ICAgICAgICAgICAgICAgOyByZWNvbW1lbmRlZCBmb3IgYW55IGNoYXJhY3RlciBub3QgbGlzdGVk +IGlu + +ICAgICAgICAgICAgICAgOyBSRkMgMjA0OSBhcyAibWFpbC1zYWZlIi4= + + +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAg +ICBOb3ZlbWJlciAxOTk2 + + +ICAgICAgICAgIG11c3QgYmUgdXNlZC4gIEFuIGVxdWFsIHNpZ24gYXMgdGhlIGxhc3QgY2hhcmFj +dGVyIG9uIGE= + +ICAgICAgICAgIGVuY29kZWQgbGluZSBpbmRpY2F0ZXMgc3VjaCBhIG5vbi1zaWduaWZpY2FudCAo +InNvZnQiKQ== + +ICAgICAgICAgIGxpbmUgYnJlYWsgaW4gdGhlIGVuY29kZWQgdGV4dC4= + + +ICAgVGh1cyBpZiB0aGUgInJhdyIgZm9ybSBvZiB0aGUgbGluZSBpcyBhIHNpbmdsZSB1bmVuY29k +ZWQgbGluZSB0aGF0 + +ICAgc2F5czo= + + +ICAgICBOb3cncyB0aGUgdGltZSBmb3IgYWxsIGZvbGsgdG8gY29tZSB0byB0aGUgYWlkIG9mIHRo +ZWlyIGNvdW50cnku + + +ICAgVGhpcyBjYW4gYmUgcmVwcmVzZW50ZWQsIGluIHRoZSBRdW90ZWQtUHJpbnRhYmxlIGVuY29k +aW5nLCBhczo= + + +ICAgICBOb3cncyB0aGUgdGltZSA9 + +ICAgICBmb3IgYWxsIGZvbGsgdG8gY29tZT0= + +ICAgICAgdG8gdGhlIGFpZCBvZiB0aGVpciBjb3VudHJ5Lg== + + +ICAgU2luY2UgdGhlIGh5cGhlbiBjaGFyYWN0ZXIgKCItIikgbWF5IGJlIHJlcHJlc2VudGVkIGFz +IGl0c2VsZiBpbiB0aGU= + +ICAgUXVvdGVkLVByaW50YWJsZSBlbmNvZGluZywgY2FyZSBtdXN0IGJlIHRha2VuLCB3aGVuIGVu +Y2Fwc3VsYXRpbmcgYQ== + +ICAgcXVvdGVkLXByaW50YWJsZSBlbmNvZGVkIGJvZHkgaW5zaWRlIG9uZSBvciBtb3JlIG11bHRp +cGFydCBlbnRpdGllcyw= + +ICAgdG8gZW5zdXJlIHRoYXQgdGhlIGJvdW5kYXJ5IGRlbGltaXRlciBkb2VzIG5vdCBhcHBlYXIg +YW55d2hlcmUgaW4gdGhl + +ICAgZW5jb2RlZCBib2R5LiAgKEEgZ29vZCBzdHJhdGVneSBpcyB0byBjaG9vc2UgYSBib3VuZGFy +eSB0aGF0IGluY2x1ZGVz + +ICAgYSBjaGFyYWN0ZXIgc2VxdWVuY2Ugc3VjaCBhcyAiPV8iIHdoaWNoIGNhbiBuZXZlciBhcHBl +YXIgaW4gYQ== + +ICAgcXVvdGVkLXByaW50YWJsZSBib2R5LiAgU2VlIHRoZSBkZWZpbml0aW9uIG9mIG11bHRpcGFy +dCBtZXNzYWdlcyBpbg== + +ICAgUkZDIDIwNDYuKQ== + + +ICAgICAhIiMkQFtcXV5ge3x9fiU= + + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAg +ICAgICAgW1BhZ2UgMjRd + + +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAg +ICBOb3ZlbWJlciAxOTk2 + + + +ICAgICAgICAgICAgICAgICAgICBUYWJsZSAxOiBUaGUgQmFzZTY0IEFscGhhYmV0 + + +ICAgICBWYWx1ZSBFbmNvZGluZyAgVmFsdWUgRW5jb2RpbmcgIFZhbHVlIEVuY29kaW5nICBWYWx1 +ZSBFbmNvZGluZw== + +ICAgICAgICAgMCBBICAgICAgICAgICAgMTcgUiAgICAgICAgICAgIDM0IGkgICAgICAgICAgICA1 +MSB6 + +ICAgICAgICAgMSBCICAgICAgICAgICAgMTggUyAgICAgICAgICAgIDM1IGogICAgICAgICAgICA1 +MiAw + +ICAgICAgICAgMiBDICAgICAgICAgICAgMTkgVCAgICAgICAgICAgIDM2IGsgICAgICAgICAgICA1 +MyAx + +ICAgICAgICAgMyBEICAgICAgICAgICAgMjAgVSAgICAgICAgICAgIDM3IGwgICAgICAgICAgICA1 +NCAy + +ICAgICAgICAgNCBFICAgICAgICAgICAgMjEgViAgICAgICAgICAgIDM4IG0gICAgICAgICAgICA1 +NSAz + +ICAgICAgICAgNSBGICAgICAgICAgICAgMjIgVyAgICAgICAgICAgIDM5IG4gICAgICAgICAgICA1 +NiA0 + +ICAgICAgICAgNiBHICAgICAgICAgICAgMjMgWCAgICAgICAgICAgIDQwIG8gICAgICAgICAgICA1 +NyA1 + +ICAgICAgICAgNyBIICAgICAgICAgICAgMjQgWSAgICAgICAgICAgIDQxIHAgICAgICAgICAgICA1 +OCA2 + +ICAgICAgICAgOCBJICAgICAgICAgICAgMjUgWiAgICAgICAgICAgIDQyIHEgICAgICAgICAgICA1 +OSA3 + +ICAgICAgICAgOSBKICAgICAgICAgICAgMjYgYSAgICAgICAgICAgIDQzIHIgICAgICAgICAgICA2 +MCA4 + +ICAgICAgICAxMCBLICAgICAgICAgICAgMjcgYiAgICAgICAgICAgIDQ0IHMgICAgICAgICAgICA2 +MSA5 + +ICAgICAgICAxMSBMICAgICAgICAgICAgMjggYyAgICAgICAgICAgIDQ1IHQgICAgICAgICAgICA2 +MiAr + +ICAgICAgICAxMiBNICAgICAgICAgICAgMjkgZCAgICAgICAgICAgIDQ2IHUgICAgICAgICAgICA2 +MyAv + +ICAgICAgICAxMyBOICAgICAgICAgICAgMzAgZSAgICAgICAgICAgIDQ3IHY= + +ICAgICAgICAxNCBPICAgICAgICAgICAgMzEgZiAgICAgICAgICAgIDQ4IHcgICAgICAgICAocGFk +KSA9 + +ICAgICAgICAxNSBQICAgICAgICAgICAgMzIgZyAgICAgICAgICAgIDQ5IHg= + +ICAgICAgICAxNiBRICAgICAgICAgICAgMzMgaCAgICAgICAgICAgIDUwIHk= + diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/plain.txt openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/plain.txt --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/plain.txt 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/plain.txt 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,183 @@ +This test data is part of rfc2045 which includes all characters a~z A~Z, 0~9 and all symbols, +It is used to test java.util.Base64.Encoder, and will be encoded by org.apache.commons.codec.binary.Base64.java +to test java.util.Base64.Decoder; + +Freed & Borenstein Standards Track [Page 1] +RFC 2045 Internet Message Bodies November 1996 + + These documents are revisions of RFCs 1521, 1522, and 1590, which + themselves were revisions of RFCs 1341 and 1342. An appendix in RFC + 2049 describes differences and changes from previous versions. + +Table of Contents + + 1. Introduction ......................................... 3 + 2. Definitions, Conventions, and Generic BNF Grammar .... 5 + 3. MIME Header Fields ................................... 8 + 4. MIME-Version Header Field ............................ 8 + 5. Content-Type Header Field ............................ 10 + 6. Content-Transfer-Encoding Header Field ............... 14 + 7. Content-ID Header Field .............................. 26 + 8. Content-Description Header Field ..................... 27 + 9. Additional MIME Header Fields ........................ 27 + 10. Summary ............................................. 27 + 11. Security Considerations ............................. 27 + 12. Authors' Addresses .................................. 28 + A. Collected Grammar .................................... 29 + +Freed & Borenstein Standards Track [Page 7] +RFC 2045 Internet Message Bodies November 1996 + +3. MIME Header Fields + + MIME defines a number of new RFC 822 header fields that are used to + describe the content of a MIME entity. These header fields occur in + at least two contexts: + + (1) As part of a regular RFC 822 message header. + + (2) In a MIME body part header within a multipart + construct. + + The formal definition of these header fields is as follows: + + MIME-message-headers := entity-headers + fields + version CRLF + ; The ordering of the header + ; fields implied by this BNF + ; definition should be ignored. + + MIME-part-headers := entity-headers + [ fields ] + ; Any field not beginning with + ; "content-" can have no defined + ; meaning and may be ignored. + ; The ordering of the header + ; fields implied by this BNF + ; definition should be ignored. + + The syntax of the various specific MIME header fields will be + described in the following sections. + +Freed & Borenstein Standards Track [Page 11] +RFC 2045 Internet Message Bodies November 1996 + +5.1. Syntax of the Content-Type Header Field + + In the Augmented BNF notation of RFC 822, a Content-Type header field + value is defined as follows: + + content := "Content-Type" ":" type "/" subtype + *(";" parameter) + ; Matching of media type and subtype + ; is ALWAYS case-insensitive. + + type := discrete-type / composite-type + + discrete-type := "text" / "image" / "audio" / "video" / + "application" / extension-token + + composite-type := "message" / "multipart" / extension-token + + extension-token := ietf-token / x-token + + ietf-token := <An extension token defined by a + standards-track RFC and registered + with IANA.> + + x-token := <The two characters "X-" or "x-" followed, with + no intervening white space, by any token> + + subtype := extension-token / iana-token + + iana-token := <A publicly-defined extension token. Tokens + of this form must be registered with IANA + as specified in RFC 2048.> + + parameter := attribute "=" value + + attribute := token + ; Matching of attributes + ; is ALWAYS case-insensitive. + + value := token / quoted-string + + token := 1*<any (US-ASCII) CHAR except SPACE, CTLs, + or tspecials> + + tspecials := "(" / ")" / "<" / ">" / "@" / + "," / ";" / ":" / "\" / <"> + "/" / "[" / "]" / "?" / "=" + ; Must be in quoted-string, + ; to use within parameter values + + description := "Content-Description" ":" *text + + encoding := "Content-Transfer-Encoding" ":" mechanism + + entity-headers := [ content CRLF ] + [ encoding CRLF ] + [ id CRLF ] + [ description CRLF ] + *( MIME-extension-field CRLF ) + + hex-octet := "=" 2(DIGIT / "A" / "B" / "C" / "D" / "E" / "F") + ; Octet must be used for characters > 127, =, + ; SPACEs or TABs at the ends of lines, and is + ; recommended for any character not listed in + ; RFC 2049 as "mail-safe". + +RFC 2045 Internet Message Bodies November 1996 + + must be used. An equal sign as the last character on a + encoded line indicates such a non-significant ("soft") + line break in the encoded text. + + Thus if the "raw" form of the line is a single unencoded line that + says: + + Now's the time for all folk to come to the aid of their country. + + This can be represented, in the Quoted-Printable encoding, as: + + Now's the time = + for all folk to come= + to the aid of their country. + + Since the hyphen character ("-") may be represented as itself in the + Quoted-Printable encoding, care must be taken, when encapsulating a + quoted-printable encoded body inside one or more multipart entities, + to ensure that the boundary delimiter does not appear anywhere in the + encoded body. (A good strategy is to choose a boundary that includes + a character sequence such as "=_" which can never appear in a + quoted-printable body. See the definition of multipart messages in + RFC 2046.) + + !"#$@[\]^`{|}~% + +Freed & Borenstein Standards Track [Page 24] + +RFC 2045 Internet Message Bodies November 1996 + + + Table 1: The Base64 Alphabet + + Value Encoding Value Encoding Value Encoding Value Encoding + 0 A 17 R 34 i 51 z + 1 B 18 S 35 j 52 0 + 2 C 19 T 36 k 53 1 + 3 D 20 U 37 l 54 2 + 4 E 21 V 38 m 55 3 + 5 F 22 W 39 n 56 4 + 6 G 23 X 40 o 57 5 + 7 H 24 Y 41 p 58 6 + 8 I 25 Z 42 q 59 7 + 9 J 26 a 43 r 60 8 + 10 K 27 b 44 s 61 9 + 11 L 28 c 45 t 62 + + 12 M 29 d 46 u 63 / + 13 N 30 e 47 v + 14 O 31 f 48 w (pad) = + 15 P 32 g 49 x + 16 Q 33 h 50 y diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/TestBase64.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2018 Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @author Eric Wang <yiming.wang@oracle.com> + * @summary tests java.util.Base64 + * + * @run main/othervm/timeout=600 -Xbatch -DcheckOutput=true + * compiler.intrinsics.base64.TestBase64 + */ + +package compiler.intrinsics.base64; + +import java.io.BufferedReader; +import java.io.FileReader; +import java.nio.ByteBuffer; +import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.util.Base64; +import java.util.Base64.Decoder; +import java.util.Base64.Encoder; +import java.util.Objects; +import java.util.Random; + + +public class TestBase64 { + static boolean checkOutput = Boolean.getBoolean("checkOutput"); + + public static void main(String[] args) throws Exception { + int iters = (args.length > 0 ? Integer.valueOf(args[0]) : 1000000); + System.out.println(iters + " iterations"); + + test0(Base64Type.BASIC, Base64.getEncoder(), Base64.getDecoder(),"plain.txt", "baseEncode.txt", iters); + test0(Base64Type.URLSAFE, Base64.getUrlEncoder(), Base64.getUrlDecoder(),"plain.txt", "urlEncode.txt", iters); + test0(Base64Type.MIME, Base64.getMimeEncoder(), Base64.getMimeDecoder(),"plain.txt", "mimeEncode.txt", iters); + } + + public static void test0(Base64Type type, Encoder encoder, Decoder decoder, String srcFile, String encodedFile, int numIterations) throws Exception { + + String[] srcLns = Files.readAllLines(Paths.get(SRCDIR, srcFile), DEF_CHARSET) + .toArray(new String[0]); + String[] encodedLns = Files.readAllLines(Paths.get(SRCDIR, encodedFile), DEF_CHARSET) + .toArray(new String[0]); + + for (int i = 0; i < numIterations; i++) { + int lns = 0; + for (String srcStr : srcLns) { + String encodedStr = null; + if (type != Base64Type.MIME) { + encodedStr = encodedLns[lns++]; + } else { + while (lns < encodedLns.length) { + String s = encodedLns[lns++]; + if (s.length() == 0) + break; + if (encodedStr != null) { + encodedStr += DEFAULT_CRLF + s; + } else { + encodedStr = s; + } + } + if (encodedStr == null && srcStr.length() == 0) { + encodedStr = ""; + } + } + + byte[] srcArr = srcStr.getBytes(DEF_CHARSET); + byte[] encodedArr = encodedStr.getBytes(DEF_CHARSET); + + ByteBuffer srcBuf = ByteBuffer.wrap(srcArr); + ByteBuffer encodedBuf = ByteBuffer.wrap(encodedArr); + byte[] resArr = new byte[encodedArr.length]; + + // test int encode(byte[], byte[]) + int len = encoder.encode(srcArr, resArr); + assertEqual(len, encodedArr.length); + assertEqual(resArr, encodedArr); + + // test byte[] encode(byte[]) + resArr = encoder.encode(srcArr); + assertEqual(resArr, encodedArr); + + // test ByteBuffer encode(ByteBuffer) + int limit = srcBuf.limit(); + ByteBuffer resBuf = encoder.encode(srcBuf); + assertEqual(srcBuf.position(), limit); + assertEqual(srcBuf.limit(), limit); + assertEqual(resBuf, encodedBuf); + srcBuf.rewind(); // reset for next test + + // test String encodeToString(byte[]) + String resEncodeStr = encoder.encodeToString(srcArr); + assertEqual(resEncodeStr, encodedStr); + + // test int decode(byte[], byte[]) + resArr = new byte[srcArr.length]; + len = decoder.decode(encodedArr, resArr); + assertEqual(len, srcArr.length); + assertEqual(resArr, srcArr); + + // test byte[] decode(byte[]) + resArr = decoder.decode(encodedArr); + assertEqual(resArr, srcArr); + + // test ByteBuffer decode(ByteBuffer) + limit = encodedBuf.limit(); + resBuf = decoder.decode(encodedBuf); + assertEqual(encodedBuf.position(), limit); + assertEqual(encodedBuf.limit(), limit); + assertEqual(resBuf, srcBuf); + encodedBuf.rewind(); // reset for next test + + // test byte[] decode(String) + resArr = decoder.decode(encodedStr); + assertEqual(resArr, srcArr); + + } + } + } + + // helper + enum Base64Type { + BASIC, URLSAFE, MIME + } + + private static final String SRCDIR = System.getProperty("test.src", "compiler/intrinsics/base64/"); + private static final Charset DEF_CHARSET = StandardCharsets.US_ASCII; + private static final String DEF_EXCEPTION_MSG = + "Assertion failed! The result is not same as expected\n"; + private static final String DEFAULT_CRLF = "\r\n"; + + private static void assertEqual(Object result, Object expect) { + if (checkOutput) { + if (!Objects.deepEquals(result, expect)) { + String resultStr = result.toString(); + String expectStr = expect.toString(); + if (result instanceof byte[]) { + resultStr = new String((byte[]) result, DEF_CHARSET); + } + if (expect instanceof byte[]) { + expectStr = new String((byte[]) expect, DEF_CHARSET); + } + throw new RuntimeException(DEF_EXCEPTION_MSG + + " result: " + resultStr + " expected: " + expectStr); + } + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/urlEncode.txt openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/urlEncode.txt --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/base64/urlEncode.txt 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/base64/urlEncode.txt 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,183 @@ +VGhpcyB0ZXN0IGRhdGEgaXMgcGFydCBvZiByZmMyMDQ1IHdoaWNoIGluY2x1ZGVzIGFsbCBjaGFyYWN0ZXJzIGF-eiBBflosIDB-OSBhbmQgYWxsIHN5bWJvbHMs +SXQgaXMgdXNlZCB0byB0ZXN0IGphdmEudXRpbC5CYXNlNjQuRW5jb2RlciwgYW5kIHdpbGwgYmUgZW5jb2RlZCBieSBvcmcuYXBhY2hlLmNvbW1vbnMuY29kZWMuYmluYXJ5LkJhc2U2NC5qYXZh +dG8gdGVzdCBqYXZhLnV0aWwuQmFzZTY0LkRlY29kZXI7 + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAgICAgICAgIFtQYWdlIDFd +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + +ICAgVGhlc2UgZG9jdW1lbnRzIGFyZSByZXZpc2lvbnMgb2YgUkZDcyAxNTIxLCAxNTIyLCBhbmQgMTU5MCwgd2hpY2g= +ICAgdGhlbXNlbHZlcyB3ZXJlIHJldmlzaW9ucyBvZiBSRkNzIDEzNDEgYW5kIDEzNDIuICBBbiBhcHBlbmRpeCBpbiBSRkM= +ICAgMjA0OSBkZXNjcmliZXMgZGlmZmVyZW5jZXMgYW5kIGNoYW5nZXMgZnJvbSBwcmV2aW91cyB2ZXJzaW9ucy4= + +VGFibGUgb2YgQ29udGVudHM= + +ICAgMS4gSW50cm9kdWN0aW9uIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgIDM= +ICAgMi4gRGVmaW5pdGlvbnMsIENvbnZlbnRpb25zLCBhbmQgR2VuZXJpYyBCTkYgR3JhbW1hciAuLi4uICAgIDU= +ICAgMy4gTUlNRSBIZWFkZXIgRmllbGRzIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgIDg= +ICAgNC4gTUlNRS1WZXJzaW9uIEhlYWRlciBGaWVsZCAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgIDg= +ICAgNS4gQ29udGVudC1UeXBlIEhlYWRlciBGaWVsZCAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMTA= +ICAgNi4gQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZyBIZWFkZXIgRmllbGQgLi4uLi4uLi4uLi4uLi4uICAgMTQ= +ICAgNy4gQ29udGVudC1JRCBIZWFkZXIgRmllbGQgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjY= +ICAgOC4gQ29udGVudC1EZXNjcmlwdGlvbiBIZWFkZXIgRmllbGQgLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjc= +ICAgOS4gQWRkaXRpb25hbCBNSU1FIEhlYWRlciBGaWVsZHMgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjc= +ICAgMTAuIFN1bW1hcnkgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjc= +ICAgMTEuIFNlY3VyaXR5IENvbnNpZGVyYXRpb25zIC4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjc= +ICAgMTIuIEF1dGhvcnMnIEFkZHJlc3NlcyAuLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjg= +ICAgQS4gQ29sbGVjdGVkIEdyYW1tYXIgLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uLi4uICAgMjk= + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAgICAgICAgIFtQYWdlIDdd +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + +My4gIE1JTUUgSGVhZGVyIEZpZWxkcw== + +ICAgTUlNRSBkZWZpbmVzIGEgbnVtYmVyIG9mIG5ldyBSRkMgODIyIGhlYWRlciBmaWVsZHMgdGhhdCBhcmUgdXNlZCB0bw== +ICAgZGVzY3JpYmUgdGhlIGNvbnRlbnQgb2YgYSBNSU1FIGVudGl0eS4gIFRoZXNlIGhlYWRlciBmaWVsZHMgb2NjdXIgaW4= +ICAgYXQgbGVhc3QgdHdvIGNvbnRleHRzOg== + +ICAgICgxKSAgIEFzIHBhcnQgb2YgYSByZWd1bGFyIFJGQyA4MjIgbWVzc2FnZSBoZWFkZXIu + +ICAgICgyKSAgIEluIGEgTUlNRSBib2R5IHBhcnQgaGVhZGVyIHdpdGhpbiBhIG11bHRpcGFydA== +ICAgICAgICAgIGNvbnN0cnVjdC4= + +ICAgVGhlIGZvcm1hbCBkZWZpbml0aW9uIG9mIHRoZXNlIGhlYWRlciBmaWVsZHMgaXMgYXMgZm9sbG93czo= + +ICAgICBNSU1FLW1lc3NhZ2UtaGVhZGVycyA6PSBlbnRpdHktaGVhZGVycw== +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBmaWVsZHM= +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZXJzaW9uIENSTEY= +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7IFRoZSBvcmRlcmluZyBvZiB0aGUgaGVhZGVy +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7IGZpZWxkcyBpbXBsaWVkIGJ5IHRoaXMgQk5G +ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA7IGRlZmluaXRpb24gc2hvdWxkIGJlIGlnbm9yZWQu + +ICAgICBNSU1FLXBhcnQtaGVhZGVycyA6PSBlbnRpdHktaGVhZGVycw== +ICAgICAgICAgICAgICAgICAgICAgICAgICBbIGZpZWxkcyBd +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IEFueSBmaWVsZCBub3QgYmVnaW5uaW5nIHdpdGg= +ICAgICAgICAgICAgICAgICAgICAgICAgICA7ICJjb250ZW50LSIgY2FuIGhhdmUgbm8gZGVmaW5lZA== +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IG1lYW5pbmcgYW5kIG1heSBiZSBpZ25vcmVkLg== +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IFRoZSBvcmRlcmluZyBvZiB0aGUgaGVhZGVy +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IGZpZWxkcyBpbXBsaWVkIGJ5IHRoaXMgQk5G +ICAgICAgICAgICAgICAgICAgICAgICAgICA7IGRlZmluaXRpb24gc2hvdWxkIGJlIGlnbm9yZWQu + +ICAgVGhlIHN5bnRheCBvZiB0aGUgdmFyaW91cyBzcGVjaWZpYyBNSU1FIGhlYWRlciBmaWVsZHMgd2lsbCBiZQ== +ICAgZGVzY3JpYmVkIGluIHRoZSBmb2xsb3dpbmcgc2VjdGlvbnMu + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAgICAgICAgW1BhZ2UgMTFd +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + +NS4xLiAgU3ludGF4IG9mIHRoZSBDb250ZW50LVR5cGUgSGVhZGVyIEZpZWxk + +ICAgSW4gdGhlIEF1Z21lbnRlZCBCTkYgbm90YXRpb24gb2YgUkZDIDgyMiwgYSBDb250ZW50LVR5cGUgaGVhZGVyIGZpZWxk +ICAgdmFsdWUgaXMgZGVmaW5lZCBhcyBmb2xsb3dzOg== + +ICAgICBjb250ZW50IDo9ICJDb250ZW50LVR5cGUiICI6IiB0eXBlICIvIiBzdWJ0eXBl +ICAgICAgICAgICAgICAgICooIjsiIHBhcmFtZXRlcik= +ICAgICAgICAgICAgICAgIDsgTWF0Y2hpbmcgb2YgbWVkaWEgdHlwZSBhbmQgc3VidHlwZQ== +ICAgICAgICAgICAgICAgIDsgaXMgQUxXQVlTIGNhc2UtaW5zZW5zaXRpdmUu + +ICAgICB0eXBlIDo9IGRpc2NyZXRlLXR5cGUgLyBjb21wb3NpdGUtdHlwZQ== + +ICAgICBkaXNjcmV0ZS10eXBlIDo9ICJ0ZXh0IiAvICJpbWFnZSIgLyAiYXVkaW8iIC8gInZpZGVvIiAv +ICAgICAgICAgICAgICAgICAgICAgICJhcHBsaWNhdGlvbiIgLyBleHRlbnNpb24tdG9rZW4= + +ICAgICBjb21wb3NpdGUtdHlwZSA6PSAibWVzc2FnZSIgLyAibXVsdGlwYXJ0IiAvIGV4dGVuc2lvbi10b2tlbg== + +ICAgICBleHRlbnNpb24tdG9rZW4gOj0gaWV0Zi10b2tlbiAvIHgtdG9rZW4= + +ICAgICBpZXRmLXRva2VuIDo9IDxBbiBleHRlbnNpb24gdG9rZW4gZGVmaW5lZCBieSBh +ICAgICAgICAgICAgICAgICAgICBzdGFuZGFyZHMtdHJhY2sgUkZDIGFuZCByZWdpc3RlcmVk +ICAgICAgICAgICAgICAgICAgICB3aXRoIElBTkEuPg== + +ICAgICB4LXRva2VuIDo9IDxUaGUgdHdvIGNoYXJhY3RlcnMgIlgtIiBvciAieC0iIGZvbGxvd2VkLCB3aXRo +ICAgICAgICAgICAgICAgICBubyBpbnRlcnZlbmluZyB3aGl0ZSBzcGFjZSwgYnkgYW55IHRva2VuPg== + +ICAgICBzdWJ0eXBlIDo9IGV4dGVuc2lvbi10b2tlbiAvIGlhbmEtdG9rZW4= + +ICAgICBpYW5hLXRva2VuIDo9IDxBIHB1YmxpY2x5LWRlZmluZWQgZXh0ZW5zaW9uIHRva2VuLiBUb2tlbnM= +ICAgICAgICAgICAgICAgICAgICBvZiB0aGlzIGZvcm0gbXVzdCBiZSByZWdpc3RlcmVkIHdpdGggSUFOQQ== +ICAgICAgICAgICAgICAgICAgICBhcyBzcGVjaWZpZWQgaW4gUkZDIDIwNDguPg== + +ICAgICBwYXJhbWV0ZXIgOj0gYXR0cmlidXRlICI9IiB2YWx1ZQ== + +ICAgICBhdHRyaWJ1dGUgOj0gdG9rZW4= +ICAgICAgICAgICAgICAgICAgOyBNYXRjaGluZyBvZiBhdHRyaWJ1dGVz +ICAgICAgICAgICAgICAgICAgOyBpcyBBTFdBWVMgY2FzZS1pbnNlbnNpdGl2ZS4= + +ICAgICB2YWx1ZSA6PSB0b2tlbiAvIHF1b3RlZC1zdHJpbmc= + +ICAgICB0b2tlbiA6PSAxKjxhbnkgKFVTLUFTQ0lJKSBDSEFSIGV4Y2VwdCBTUEFDRSwgQ1RMcyw= +ICAgICAgICAgICAgICAgICBvciB0c3BlY2lhbHM- + +ICAgICB0c3BlY2lhbHMgOj0gICIoIiAvICIpIiAvICI8IiAvICI-IiAvICJAIiAv +ICAgICAgICAgICAgICAgICAgICIsIiAvICI7IiAvICI6IiAvICJcIiAvIDwiPg== +ICAgICAgICAgICAgICAgICAgICIvIiAvICJbIiAvICJdIiAvICI_IiAvICI9Ig== +ICAgICAgICAgICAgICAgICAgIDsgTXVzdCBiZSBpbiBxdW90ZWQtc3RyaW5nLA== +ICAgICAgICAgICAgICAgICAgIDsgdG8gdXNlIHdpdGhpbiBwYXJhbWV0ZXIgdmFsdWVz + +ICAgICBkZXNjcmlwdGlvbiA6PSAiQ29udGVudC1EZXNjcmlwdGlvbiIgIjoiICp0ZXh0 + +ICAgICBlbmNvZGluZyA6PSAiQ29udGVudC1UcmFuc2Zlci1FbmNvZGluZyIgIjoiIG1lY2hhbmlzbQ== + +ICAgICBlbnRpdHktaGVhZGVycyA6PSBbIGNvbnRlbnQgQ1JMRiBd +ICAgICAgICAgICAgICAgICAgICBbIGVuY29kaW5nIENSTEYgXQ== +ICAgICAgICAgICAgICAgICAgICBbIGlkIENSTEYgXQ== +ICAgICAgICAgICAgICAgICAgICBbIGRlc2NyaXB0aW9uIENSTEYgXQ== +ICAgICAgICAgICAgICAgICAgICAqKCBNSU1FLWV4dGVuc2lvbi1maWVsZCBDUkxGICk= + +ICAgICBoZXgtb2N0ZXQgOj0gIj0iIDIoRElHSVQgLyAiQSIgLyAiQiIgLyAiQyIgLyAiRCIgLyAiRSIgLyAiRiIp +ICAgICAgICAgICAgICAgOyBPY3RldCBtdXN0IGJlIHVzZWQgZm9yIGNoYXJhY3RlcnMgPiAxMjcsID0s +ICAgICAgICAgICAgICAgOyBTUEFDRXMgb3IgVEFCcyBhdCB0aGUgZW5kcyBvZiBsaW5lcywgYW5kIGlz +ICAgICAgICAgICAgICAgOyByZWNvbW1lbmRlZCBmb3IgYW55IGNoYXJhY3RlciBub3QgbGlzdGVkIGlu +ICAgICAgICAgICAgICAgOyBSRkMgMjA0OSBhcyAibWFpbC1zYWZlIi4= + +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + +ICAgICAgICAgIG11c3QgYmUgdXNlZC4gIEFuIGVxdWFsIHNpZ24gYXMgdGhlIGxhc3QgY2hhcmFjdGVyIG9uIGE= +ICAgICAgICAgIGVuY29kZWQgbGluZSBpbmRpY2F0ZXMgc3VjaCBhIG5vbi1zaWduaWZpY2FudCAoInNvZnQiKQ== +ICAgICAgICAgIGxpbmUgYnJlYWsgaW4gdGhlIGVuY29kZWQgdGV4dC4= + +ICAgVGh1cyBpZiB0aGUgInJhdyIgZm9ybSBvZiB0aGUgbGluZSBpcyBhIHNpbmdsZSB1bmVuY29kZWQgbGluZSB0aGF0 +ICAgc2F5czo= + +ICAgICBOb3cncyB0aGUgdGltZSBmb3IgYWxsIGZvbGsgdG8gY29tZSB0byB0aGUgYWlkIG9mIHRoZWlyIGNvdW50cnku + +ICAgVGhpcyBjYW4gYmUgcmVwcmVzZW50ZWQsIGluIHRoZSBRdW90ZWQtUHJpbnRhYmxlIGVuY29kaW5nLCBhczo= + +ICAgICBOb3cncyB0aGUgdGltZSA9 +ICAgICBmb3IgYWxsIGZvbGsgdG8gY29tZT0= +ICAgICAgdG8gdGhlIGFpZCBvZiB0aGVpciBjb3VudHJ5Lg== + +ICAgU2luY2UgdGhlIGh5cGhlbiBjaGFyYWN0ZXIgKCItIikgbWF5IGJlIHJlcHJlc2VudGVkIGFzIGl0c2VsZiBpbiB0aGU= +ICAgUXVvdGVkLVByaW50YWJsZSBlbmNvZGluZywgY2FyZSBtdXN0IGJlIHRha2VuLCB3aGVuIGVuY2Fwc3VsYXRpbmcgYQ== +ICAgcXVvdGVkLXByaW50YWJsZSBlbmNvZGVkIGJvZHkgaW5zaWRlIG9uZSBvciBtb3JlIG11bHRpcGFydCBlbnRpdGllcyw= +ICAgdG8gZW5zdXJlIHRoYXQgdGhlIGJvdW5kYXJ5IGRlbGltaXRlciBkb2VzIG5vdCBhcHBlYXIgYW55d2hlcmUgaW4gdGhl +ICAgZW5jb2RlZCBib2R5LiAgKEEgZ29vZCBzdHJhdGVneSBpcyB0byBjaG9vc2UgYSBib3VuZGFyeSB0aGF0IGluY2x1ZGVz +ICAgYSBjaGFyYWN0ZXIgc2VxdWVuY2Ugc3VjaCBhcyAiPV8iIHdoaWNoIGNhbiBuZXZlciBhcHBlYXIgaW4gYQ== +ICAgcXVvdGVkLXByaW50YWJsZSBib2R5LiAgU2VlIHRoZSBkZWZpbml0aW9uIG9mIG11bHRpcGFydCBtZXNzYWdlcyBpbg== +ICAgUkZDIDIwNDYuKQ== + +ICAgICAhIiMkQFtcXV5ge3x9fiU= + +RnJlZWQgJiBCb3JlbnN0ZWluICAgICAgICAgIFN0YW5kYXJkcyBUcmFjayAgICAgICAgICAgICAgICAgICAgW1BhZ2UgMjRd + +UkZDIDIwNDUgICAgICAgICAgICAgICAgSW50ZXJuZXQgTWVzc2FnZSBCb2RpZXMgICAgICAgICAgICBOb3ZlbWJlciAxOTk2 + + +ICAgICAgICAgICAgICAgICAgICBUYWJsZSAxOiBUaGUgQmFzZTY0IEFscGhhYmV0 + +ICAgICBWYWx1ZSBFbmNvZGluZyAgVmFsdWUgRW5jb2RpbmcgIFZhbHVlIEVuY29kaW5nICBWYWx1ZSBFbmNvZGluZw== +ICAgICAgICAgMCBBICAgICAgICAgICAgMTcgUiAgICAgICAgICAgIDM0IGkgICAgICAgICAgICA1MSB6 +ICAgICAgICAgMSBCICAgICAgICAgICAgMTggUyAgICAgICAgICAgIDM1IGogICAgICAgICAgICA1MiAw +ICAgICAgICAgMiBDICAgICAgICAgICAgMTkgVCAgICAgICAgICAgIDM2IGsgICAgICAgICAgICA1MyAx +ICAgICAgICAgMyBEICAgICAgICAgICAgMjAgVSAgICAgICAgICAgIDM3IGwgICAgICAgICAgICA1NCAy +ICAgICAgICAgNCBFICAgICAgICAgICAgMjEgViAgICAgICAgICAgIDM4IG0gICAgICAgICAgICA1NSAz +ICAgICAgICAgNSBGICAgICAgICAgICAgMjIgVyAgICAgICAgICAgIDM5IG4gICAgICAgICAgICA1NiA0 +ICAgICAgICAgNiBHICAgICAgICAgICAgMjMgWCAgICAgICAgICAgIDQwIG8gICAgICAgICAgICA1NyA1 +ICAgICAgICAgNyBIICAgICAgICAgICAgMjQgWSAgICAgICAgICAgIDQxIHAgICAgICAgICAgICA1OCA2 +ICAgICAgICAgOCBJICAgICAgICAgICAgMjUgWiAgICAgICAgICAgIDQyIHEgICAgICAgICAgICA1OSA3 +ICAgICAgICAgOSBKICAgICAgICAgICAgMjYgYSAgICAgICAgICAgIDQzIHIgICAgICAgICAgICA2MCA4 +ICAgICAgICAxMCBLICAgICAgICAgICAgMjcgYiAgICAgICAgICAgIDQ0IHMgICAgICAgICAgICA2MSA5 +ICAgICAgICAxMSBMICAgICAgICAgICAgMjggYyAgICAgICAgICAgIDQ1IHQgICAgICAgICAgICA2MiAr +ICAgICAgICAxMiBNICAgICAgICAgICAgMjkgZCAgICAgICAgICAgIDQ2IHUgICAgICAgICAgICA2MyAv +ICAgICAgICAxMyBOICAgICAgICAgICAgMzAgZSAgICAgICAgICAgIDQ3IHY= +ICAgICAgICAxNCBPICAgICAgICAgICAgMzEgZiAgICAgICAgICAgIDQ4IHcgICAgICAgICAocGFkKSA9 +ICAgICAgICAxNSBQICAgICAgICAgICAgMzIgZyAgICAgICAgICAgIDQ5IHg= +ICAgICAgICAxNiBRICAgICAgICAgICAgMzMgaCAgICAgICAgICAgIDUwIHk= diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/SHAOptionsBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -74,8 +74,8 @@ * instructions required by the option are not supported. */ public static String getWarningForUnsupportedCPU(String optionName) { - if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc() || - Platform.isX64() || Platform.isX86()) { + if (Platform.isAArch64() || Platform.isS390x() || Platform.isSparc() + || Platform.isX64() || Platform.isX86() || Platform.isPPC()) { switch (optionName) { case SHAOptionsBase.USE_SHA_OPTION: return SHAOptionsBase.SHA_INSTRUCTIONS_ARE_NOT_AVAILABLE; @@ -89,8 +89,8 @@ throw new Error("Unexpected option " + optionName); } } else { - throw new Error("Support for CPUs different fromn AARCH64, S390x, SPARC, and X86 " - + "is not implemented"); + throw new Error("Support for CPUs different from AARCH64, S390x," + + " SPARC, X86, and PPC is not implemented"); } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForOtherCPU.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,8 +31,8 @@ import jdk.test.lib.cli.predicate.OrPredicate; /** - * Generic test case for SHA-related options targeted to non-x86 and - * non-SPARC CPUs. + * Generic test case for SHA-related options targeted to any CPU except + * AArch64, S390x, SPARC and X86. */ public class GenericTestCaseForOtherCPU extends SHAOptionsBase.TestCase { @@ -43,7 +43,8 @@ new OrPredicate(Platform::isS390x, new OrPredicate(Platform::isSparc, new OrPredicate(Platform::isPPC, - new OrPredicate(Platform::isX64, Platform::isX86))))))); + new OrPredicate(Platform::isX64, + Platform::isX86))))))); } @Override diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/GenericTestCaseForSupportedCPU.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,10 +37,7 @@ public class GenericTestCaseForSupportedCPU extends SHAOptionsBase.TestCase { public GenericTestCaseForSupportedCPU(String optionName) { - super(optionName, - new AndPredicate( - new OrPredicate(Platform::isSparc, Platform::isAArch64), - SHAOptionsBase.getPredicateForOption(optionName))); + super(optionName, SHAOptionsBase.getPredicateForOption(optionName)); } @Override diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,25 +33,22 @@ import jdk.test.lib.cli.predicate.OrPredicate; /** - * Test case specific to UseSHA*Intrinsics options targeted to SPARC and AArch64 - * CPUs which don't support required instruction, but support other SHA-related + * Test case specific to UseSHA*Intrinsics options targeted to CPUs + * which don't support required instruction, but support other SHA-related * instructions. * - * For example, CPU support sha1 instruction, but don't support sha256 or + * For example, CPU supports sha1 instruction, but doesn't support sha256 or * sha512. */ public class UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU extends SHAOptionsBase.TestCase { public UseSHAIntrinsicsSpecificTestCaseForUnsupportedCPU( String optionName) { - // execute test case on SPARC CPU that support any sha* instructions, + // execute test case on CPU that supports any sha* instructions, // but does not support sha* instruction required by the tested option. super(optionName, new AndPredicate( - new OrPredicate(Platform::isSparc, Platform::isAArch64), - new AndPredicate( - IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE, - new NotPredicate(SHAOptionsBase.getPredicateForOption( - optionName))))); + IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE, + new NotPredicate(SHAOptionsBase.getPredicateForOption(optionName)))); } @Override protected void verifyWarnings() throws Throwable { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForSupportedCPU.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,15 +33,13 @@ import jdk.test.lib.cli.predicate.OrPredicate; /** - * UseSHA specific test case targeted to SPARC and AArch64 CPUs which - * support any sha* instruction. + * UseSHA specific test case targeted to CPUs which support any sha* instruction. */ public class UseSHASpecificTestCaseForSupportedCPU extends SHAOptionsBase.TestCase { public UseSHASpecificTestCaseForSupportedCPU(String optionName) { - super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate( - new OrPredicate(Platform::isSparc, Platform::isAArch64), - IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)); + super(SHAOptionsBase.USE_SHA_OPTION, + IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE); Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION, String.format("Test case should be used for '%s' option only.", diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/sha/cli/testcases/UseSHASpecificTestCaseForUnsupportedCPU.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,16 +34,14 @@ import jdk.test.lib.cli.predicate.OrPredicate; /** - * UseSHA specific test case targeted to SPARC and AArch64 CPUs which don't - * support all sha* instructions./ + * UseSHA specific test case targeted to CPUs which don't support all + * sha* instructions. */ public class UseSHASpecificTestCaseForUnsupportedCPU extends SHAOptionsBase.TestCase { public UseSHASpecificTestCaseForUnsupportedCPU(String optionName) { - super(SHAOptionsBase.USE_SHA_OPTION, new AndPredicate( - new OrPredicate(Platform::isSparc, Platform::isAArch64), - new NotPredicate( - IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE))); + super(SHAOptionsBase.USE_SHA_OPTION, new NotPredicate( + IntrinsicPredicates.ANY_SHA_INSTRUCTION_AVAILABLE)); Asserts.assertEQ(optionName, SHAOptionsBase.USE_SHA_OPTION, "Test case should be used for " + SHAOptionsBase.USE_SHA_OPTION diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/string/TestHasNegatives.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/string/TestHasNegatives.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/string/TestHasNegatives.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/string/TestHasNegatives.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/string/TestStringIntrinsicRangeChecks.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/intrinsics/string/TestStringUTF16IntrinsicRangeChecks.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jsr292/methodHandleExceptions/TestAMEnotNPE.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,8 +23,8 @@ /** * @test - * @bug 8025260 8016839 - * @summary Ensure that AbstractMethodError and IllegalAccessError are thrown appropriately, not NullPointerException + * @bug 8025260 8016839 8046171 + * @summary Ensure that correct exceptions are thrown, not NullPointerException * @modules java.base/jdk.internal.org.objectweb.asm * @library / . * @@ -34,6 +34,13 @@ * @run main/othervm -Xcomp compiler.jsr292.methodHandleExceptions.TestAMEnotNPE */ +// Since this test was written the specification for interface method selection has been +// revised (JEP 181 - Nestmates) so that private methods are never selected, as they never +// override any inherited method. So where a private method was previously selected +// and then resulted in IllegalAccessError, the private method is skipped and the invocation +// will either succeed or fail based on what other implementations are found in the inheritance +// hierarchy. This is explained for each test below. + package compiler.jsr292.methodHandleExceptions; import p.Dok; @@ -91,43 +98,41 @@ } } - try { - System.out.println("TRYING p.D.m PRIVATE interface-invoked as p.I.m, p.D extends p.F, p.F.m FINAL"); - tryAndCheckThrown(lt, bytesForDprivateSubWhat("p/F"), - "p.D extends p.F (p.F implements p.I, FINAL public m), private m", - IllegalAccessError.class, "pD_ext_pF"); - // We'll take either a VerifyError (pre 2013-11-30) - // or an IllegalAccessError (post 2013-11-22) - } catch (VerifyError ve) { - System.out.println("Saw expected VerifyError " + ve); - } + System.out.println("TRYING p.D.m PRIVATE interface-invoked as p.I.m, p.D extends p.F, p.F.m FINAL"); + System.out.println(" - should invoke p.F.m as private p.D.m is skipped for selection"); + tryAndCheckThrown(lt, bytesForDprivateSubWhat("p/F"), + "p.D extends p.F (p.F implements p.I, FINAL public m), private m", + null /* should succeed */, "pD_ext_pF"); System.out.println(); System.out.println("TRYING p.D.m PRIVATE interface-invoked as p.I.m, p.D extends p.E"); + System.out.println(" - should invoke p.E.m as private p.D.m is skipped for selection"); tryAndCheckThrown(lt, bytesForDprivateSubWhat("p/E"), - "p.D extends p.E (p.E implements p.I, public m), private m", - IllegalAccessError.class, "pD_ext_pE"); + "p.D extends p.E (p.E implements p.I, public m), private m", + null /* should succeed */, "pD_ext_pE"); System.out.println("TRYING p.D.m ABSTRACT interface-invoked as p.I.m"); tryAndCheckThrown(lt, bytesForD(), - "D extends abstract C, no m", - AbstractMethodError.class, "pD_ext_pC"); + "D extends abstract C, no m", + AbstractMethodError.class, "pD_ext_pC"); System.out.println("TRYING q.D.m PACKAGE interface-invoked as p.I.m"); tryAndCheckThrown(lt, "q.D", bytesForDsomeAccess("q/D", 0), - "q.D implements p.I, protected m", IllegalAccessError.class, - "qD_m_pp_imp_pI"); + "q.D implements p.I, protected m", + IllegalAccessError.class, "qD_m_pp_imp_pI"); // Note jar file name is used in the plural-arg case. System.out.println("TRYING p.D.m PRIVATE interface-invoked as p.I.m"); + System.out.println(" - should invoke p.I.m as private p.D.m is skipped for selection"); tryAndCheckThrown(lt, bytesForDsomeAccess("p/D", ACC_PRIVATE), - "p.D implements p.I, private m", - IllegalAccessError.class, "pD_m_pri_imp_pI"); + "p.D implements p.I, private m", + null /* should succeed */, "pD_m_pri_imp_pI"); // Plural-arg test. System.out.println("TRYING p.D.m PRIVATE MANY ARG interface-invoked as p.I.m"); + System.out.println(" - should invoke p.I.m as private p.D.m is skipped for selection"); tryAndCheckThrownMany(lt, bytesForDsomeAccess("p/D", ACC_PRIVATE), - "p.D implements p.I, private m", IllegalAccessError.class); + "p.D implements p.I, private m", null /* should succeed */); if (lt.size() > 0) { System.out.flush(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/common/patches/jdk.internal.vm.ci/jdk/vm/ci/hotspot/CompilerToVMHelper.java 2018-07-25 15:36:46.000000000 +0000 @@ -314,4 +314,8 @@ public static Class<?> getMirror(HotSpotResolvedObjectType type) { return ((HotSpotResolvedJavaType) type).mirror(); } + + public static HotSpotResolvedObjectType fromObjectClass(Class<?> theClass) { + return HotSpotResolvedObjectTypeImpl.fromObjectClass(theClass); + } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ConstantPoolTestCase.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,7 @@ import compiler.jvmci.compilerToVM.ConstantPoolTestsHelper.DummyClasses; import jdk.internal.reflect.ConstantPool; import jdk.internal.reflect.ConstantPool.Tag; +import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.meta.ResolvedJavaMethod; import sun.hotspot.WhiteBox; @@ -251,7 +252,7 @@ System.out.printf("Testing dummy %s with constant pool cached = %b%n", dummyClass.klass, isCPCached); - HotSpotResolvedObjectType holder = HotSpotResolvedObjectType.fromObjectClass(dummyClass.klass); + HotSpotResolvedObjectType holder = CompilerToVMHelper.fromObjectClass(dummyClass.klass); jdk.vm.ci.meta.ConstantPool constantPoolCTVM = holder.getConstantPool(); ConstantPool constantPoolSS = dummyClass.constantPoolSS; for (int i = 0; i < constantPoolSS.getSize(); i++) { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/compilerToVM/DisassembleCodeBlobTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,6 +41,7 @@ * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -XX:-BackgroundCompilation * compiler.jvmci.compilerToVM.DisassembleCodeBlobTest */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/compilerToVM/ExecuteInstalledCodeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ * @run main/othervm -Xbootclasspath/a:. * -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI * -XX:+UnlockExperimentalVMOptions -XX:+EnableJVMCI + * -XX:-BackgroundCompilation * compiler.jvmci.compilerToVM.ExecuteInstalledCodeTest */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/compilerToVM/GetResolvedJavaTypeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -114,7 +114,7 @@ @Override HotSpotResolvedObjectType getResolvedJavaType() { long ptr = getPtrToKlass(); - ConstantPool cpInst = HotSpotResolvedObjectType + ConstantPool cpInst = CompilerToVMHelper .fromObjectClass(TEST_CLASS) .getConstantPool(); try { @@ -133,7 +133,7 @@ @Override HotSpotResolvedObjectType getResolvedJavaType() { long ptr = getPtrToKlass(); - ConstantPool cpInst = HotSpotResolvedObjectType + ConstantPool cpInst = CompilerTovMHelper .fromObjectClass(TEST_CLASS) .getConstantPool(); try { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderData.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,8 +29,9 @@ import sun.hotspot.WhiteBox; import jdk.internal.misc.Unsafe; +import jdk.vm.ci.hotspot.CompilerToVMHelper; import jdk.vm.ci.hotspot.HotSpotConstantReflectionProvider; -import jdk.vm.ci.hotspot.HotSpotJVMCIRuntimeProvider; +import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime; import jdk.vm.ci.hotspot.HotSpotResolvedObjectType; import jdk.vm.ci.hotspot.HotSpotVMConfigAccess; import jdk.vm.ci.meta.Constant; @@ -63,9 +64,9 @@ @DataProvider(name = "positiveObject") public static Object[][] getPositiveObjectJavaKind() { - HotSpotJVMCIRuntimeProvider runtime = (HotSpotJVMCIRuntimeProvider) JVMCI.getRuntime(); + HotSpotJVMCIRuntime runtime = (HotSpotJVMCIRuntime) JVMCI.getRuntime(); int offset = new HotSpotVMConfigAccess(runtime.getConfigStore()).getFieldOffset("Klass::_java_mirror", Integer.class, "OopHandle"); - Constant wrappedKlassPointer = ((HotSpotResolvedObjectType) runtime.fromClass(TestClass.class)).klass(); + Constant wrappedKlassPointer = CompilerToVMHelper.fromObjectClass(TestClass.class).klass(); return new Object[][]{new Object[]{JavaKind.Object, wrappedKlassPointer, (long) offset, TEST_CLASS_CONSTANT, 0}}; } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/MemoryAccessProviderTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,13 +25,14 @@ * @test * @bug 8152341 * @requires vm.jvmci - * @library /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src + * @library /compiler/jvmci/common/patches /test/lib /compiler/jvmci/jdk.vm.ci.hotspot.test/src * @modules jdk.internal.vm.ci/jdk.vm.ci.meta * jdk.internal.vm.ci/jdk.vm.ci.common * jdk.internal.vm.ci/jdk.vm.ci.runtime * jdk.internal.vm.ci/jdk.vm.ci.hotspot * java.base/jdk.internal.misc * @build sun.hotspot.WhiteBox + * @build jdk.internal.vm.ci/jdk.vm.ci.hotspot.CompilerToVMHelper * @run driver ClassFileInstaller sun.hotspot.WhiteBox * sun.hotspot.WhiteBox$WhiteBoxPermission * @run testng/othervm -Xbootclasspath/a:. diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveConcreteMethodTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertNotNull; public class ResolvedJavaTypeResolveConcreteMethodTest { public final MetaAccessProvider metaAccess; @@ -62,6 +63,7 @@ } protected static class B extends A implements I { + @Override public void i() { } @@ -76,6 +78,7 @@ } protected static class C extends B { + @Override public void d() { } } @@ -117,8 +120,9 @@ ResolvedJavaType c = getType(C.class); ResolvedJavaMethod priv = getMethod(a, "priv"); - assertNull(a.resolveConcreteMethod(priv, c)); - assertNull(b.resolveConcreteMethod(priv, c)); + // nestmates have access to private methods + assertNotNull(a.resolveConcreteMethod(priv, c)); + assertNotNull(b.resolveConcreteMethod(priv, c)); } @Test diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/ResolvedJavaTypeResolveMethodTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,6 +39,7 @@ import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; +import static org.junit.Assert.assertNotNull; public class ResolvedJavaTypeResolveMethodTest { public final MetaAccessProvider metaAccess; @@ -62,6 +63,7 @@ } protected static class B extends A implements I { + @Override public void i() { } @@ -76,6 +78,7 @@ } protected static class C extends B { + @Override public void d() { } } @@ -117,8 +120,9 @@ ResolvedJavaType c = getType(C.class); ResolvedJavaMethod priv = getMethod(a, "priv"); - assertNull(a.resolveMethod(priv, c)); - assertNull(b.resolveMethod(priv, c)); + // nestmates have access to private methods + assertNotNull(a.resolveMethod(priv, c)); + assertNotNull(b.resolveMethod(priv, c)); } @Test diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaField.java 2018-07-25 15:36:46.000000000 +0000 @@ -110,6 +110,7 @@ // @formatter:off private static final String[] untestedApiMethods = { "getDeclaringClass", + "getOffset", "isInternal", "isFinal" }; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -476,6 +476,7 @@ "getParameterAnnotation", "getSpeculationLog", "isFinal", + "invoke", "$jacocoInit" }; // @formatter:on diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/jdk.vm.ci.runtime.test/src/jdk/vm/ci/runtime/test/TestResolvedJavaType.java 2018-07-25 15:36:46.000000000 +0000 @@ -124,6 +124,16 @@ } @Test + public void isEnumTest() { + for (Class<?> c : classes) { + ResolvedJavaType type = metaAccess.lookupJavaType(c); + boolean expected = c.isEnum(); + boolean actual = type.isEnum(); + assertEquals(expected, actual); + } + } + + @Test public void isInstanceClassTest() { for (Class<?> c : classes) { ResolvedJavaType type = metaAccess.lookupJavaType(c); @@ -971,16 +981,14 @@ "hasFinalizableSubclass", "hasFinalizer", "getSourceFileName", - "getClassFilePath", "isLocal", "isJavaLangObject", "isMember", "getElementalType", "getEnclosingType", - "$jacocoInit", - "isCpiSet", - "getCorrespondingCpi", - "setCorrespondingCpi" + "lookupType", + "resolveField", + "$jacocoInit" }; // @formatter:on diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/TestValidateModules.java openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/TestValidateModules.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/jvmci/TestValidateModules.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/jvmci/TestValidateModules.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,7 +37,8 @@ public static void main(String... args) throws Exception { ProcessTools.executeTestJava("-XX:+UnlockExperimentalVMOptions", "-XX:+EnableJVMCI", - "--validate-modules") + "--validate-modules", + "--list-modules") .outputTo(System.out) .errorTo(System.out) .stdoutShouldContain("java.base") diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/loopopts/CountedLoopPeelingProfilePredicates.java openjdk-11-11~24/test/hotspot/jtreg/compiler/loopopts/CountedLoopPeelingProfilePredicates.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/loopopts/CountedLoopPeelingProfilePredicates.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/loopopts/CountedLoopPeelingProfilePredicates.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8205515 + * @summary CountedLoopEndNode from peeled loop body is not candidate for profile loop predication + * + * @run main/othervm -XX:-TieredCompilation -XX:-BackgroundCompilation -XX:-UseOnStackReplacement CountedLoopPeelingProfilePredicates + * + */ + +import java.util.Arrays; + +public class CountedLoopPeelingProfilePredicates { + public static void main(String[] args) { + int stop = 2; + boolean[] flags1 = new boolean[stop]; + flags1[stop-1] = true; + boolean[] flags2 = new boolean[stop]; + flags2[0] = true; + boolean[] flags3 = new boolean[100]; + Arrays.fill(flags3, true); + flags3[0] = false; + + for (int i = 0; i < 20_000; i++) { + test_helper(stop, flags1, false); + test_helper(stop, flags2, false); + test_helper(stop, flags2, false); + } + for (int i = 0; i < 20_000; i++) { + test(stop, flags1, false, flags3, 1); + test(stop, flags2, false, flags3, 1); + test(stop, flags2, false, flags3, 1); + } + } + + + + private static void test(int stop, boolean[] flags1, boolean flag2, boolean[] flags3, int inc) { + for (int j = 0; j < 100; j+=inc) { + if (flags3[j]) { + test_helper(stop, flags1, flag2); + } + } + } + + private static void test_helper(int stop, boolean[] flags1, boolean flag2) { + for (int i = 0; i < stop; i++) { + if (flags1[i]) { + return; + } + if (flag2) { + } + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java openjdk-11-11~24/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/loopopts/IterationSplitPredicateInconsistency.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8193130 8203915 * @summary Bad graph when unrolled loop bounds conflicts with range checks + * @requires vm.flavor == "server" * * @run main/othervm IterationSplitPredicateInconsistency * @run main/othervm -XX:-UseLoopPredicate IterationSplitPredicateInconsistency diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java openjdk-11-11~24/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/loopopts/TestCMovSplitThruPhi.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8187822 * @summary C2 conditonal move optimization might create broken graph + * @requires vm.flavor == "server" * @run main/othervm -XX:-UseOnStackReplacement -XX:-BackgroundCompilation -XX:CompileCommand=dontinline,TestCMovSplitThruPhi::not_inlined -XX:CompileOnly=TestCMovSplitThruPhi::test -XX:-LoopUnswitching TestCMovSplitThruPhi * */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/loopopts/TestLimitLoadBelowLoopLimitCheck.java openjdk-11-11~24/test/hotspot/jtreg/compiler/loopopts/TestLimitLoadBelowLoopLimitCheck.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/loopopts/TestLimitLoadBelowLoopLimitCheck.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/loopopts/TestLimitLoadBelowLoopLimitCheck.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018, Red Hat, Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8202123 + * @summary C2 Crash in Node::in(unsigned int) const+0x14 + * + * @run main/othervm TestLimitLoadBelowLoopLimitCheck + * + */ + +public class TestLimitLoadBelowLoopLimitCheck { + public static int[] run(int[] arr) { + int max = 0; + for (int i : arr) { + if (i > max) { + max = i; + } + } + + int[] counts = new int[10]; + + int i = 0; + for (i = 0; i < counts.length; i += 1) { + for (int j = 0; j < counts[i]; j += 1) { + } + } + + while (i < max) { + for (int j = 0; j < counts[i]; j += 1) { + arr[0] = i; + } + } + + return arr; + } + + public static void main(String[] args) { + int[] arr = new int[1000 * 1000]; + + for (int i = 0; i < 100; i++) { + run(arr); + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java openjdk-11-11~24/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/loopstripmining/CheckLoopStripMiningIterShortLoop.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8196294 * @summary when loop strip is enabled, LoopStripMiningIterShortLoop should be not null + * @requires vm.flavor == "server" * @library /test/lib / * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java openjdk-11-11~24/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/patches/java.base/java/lang/Helper.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java openjdk-11-11~24/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/profiling/TestTypeProfiling.java 2018-07-25 15:36:46.000000000 +0000 @@ -117,22 +117,15 @@ } // should deoptimize for speculative type check + // Intepreter will also add actual type check trap information into MDO + // when it throw ClassCastException if (!deoptimize(method, src_obj)) { throw new RuntimeException(method.getName() + " is not deoptimized"); } // compile again - WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); - if (!WHITE_BOX.isMethodCompiled(method)) { - throw new RuntimeException(method.getName() + " is not recompiled"); - } - - // should deoptimize for actual type check - if (!deoptimize(method, src_obj)) { - throw new RuntimeException(method.getName() + " is not deoptimized (should deoptimize for actual type check)"); - } - - // compile once again + // c2 will generate throw instead of uncommon trap because + // actual type check trap information is present in MDO WHITE_BOX.enqueueMethodForCompilation(method, CompilerWhiteBoxTest.COMP_LEVEL_FULL_OPTIMIZATION); if (!WHITE_BOX.isMethodCompiled(method)) { throw new RuntimeException(method.getName() + " is not recompiled"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/rtm/locking/TestRTMAbortRatio.java openjdk-11-11~24/test/hotspot/jtreg/compiler/rtm/locking/TestRTMAbortRatio.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/rtm/locking/TestRTMAbortRatio.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/rtm/locking/TestRTMAbortRatio.java 2018-07-25 15:36:46.000000000 +0000 @@ -130,7 +130,7 @@ @Override public String[] getMethodsToCompileNames() { - return new String[] { getMethodWithLockName() }; + return new String[] { getMethodWithLockName(), "*.pageSize" }; } public void lock(boolean abort) { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/rtm/locking/TestRTMSpinLoopCount.java openjdk-11-11~24/test/hotspot/jtreg/compiler/rtm/locking/TestRTMSpinLoopCount.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/rtm/locking/TestRTMSpinLoopCount.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/rtm/locking/TestRTMSpinLoopCount.java 2018-07-25 15:36:46.000000000 +0000 @@ -47,6 +47,7 @@ import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.cli.CommandLineOptionTest; +import jdk.test.lib.Platform; import java.util.List; @@ -59,11 +60,18 @@ private static final int RTM_RETRY_COUNT = 1000; private static final boolean INFLATE_MONITOR = true; private static final long MAX_ABORTS = RTM_RETRY_COUNT + 1L; - private static final int[] SPIN_LOOP_COUNTS - = new int[] { 0, 100, 1_000, 10_000, 100_000 }; + private static int[] SPIN_LOOP_COUNTS; protected void runTestCases() throws Throwable { + + if (Platform.isPPC()) { + SPIN_LOOP_COUNTS = new int[] { 0, 10, 100, 1_000, 10_000 }; + } else { + SPIN_LOOP_COUNTS = new int[] { 0, 100, 1_000, 10_000, 100_000 }; + } + long[] aborts = new long[TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length]; + for (int i = 0; i < TestRTMSpinLoopCount.SPIN_LOOP_COUNTS.length; i++) { aborts[i] = getAbortsCountOnLockBusy( TestRTMSpinLoopCount.SPIN_LOOP_COUNTS[i]); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/rtm/locking/TestUseRTMXendForLockBusy.java openjdk-11-11~24/test/hotspot/jtreg/compiler/rtm/locking/TestUseRTMXendForLockBusy.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/rtm/locking/TestUseRTMXendForLockBusy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/rtm/locking/TestUseRTMXendForLockBusy.java 2018-07-25 15:36:46.000000000 +0000 @@ -76,7 +76,7 @@ OutputAnalyzer outputAnalyzer = RTMTestBase.executeRTMTest( test, CommandLineOptionTest.prepareBooleanFlag("UseRTMForStackLocks", - inflateMonitor), + !inflateMonitor), CommandLineOptionTest.prepareBooleanFlag( "UseRTMXendForLockBusy", useXend), diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/StableConfiguration.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/StableConfiguration.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/StableConfiguration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/StableConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableBoolean.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableBoolean.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableBoolean.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableBoolean.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableByte.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableByte.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableByte.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableByte.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableChar.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableChar.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableChar.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableChar.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableDouble.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableDouble.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableDouble.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableDouble.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableFloat.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableFloat.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableFloat.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableFloat.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableInt.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableInt.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableInt.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableInt.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableLong.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableLong.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableLong.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableLong.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableMemoryBarrier.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableMemoryBarrier.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableMemoryBarrier.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableMemoryBarrier.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableObject.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableObject.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableObject.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableObject.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableShort.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableShort.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableShort.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableShort.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableUByte.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableUByte.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableUByte.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableUByte.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableUShort.java openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableUShort.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/stable/TestStableUShort.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/stable/TestStableUShort.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java openjdk-11-11~24/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/unsafe/OpaqueAccesses.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/unsafe/UnsafeGetConstantField.java openjdk-11-11~24/test/hotspot/jtreg/compiler/unsafe/UnsafeGetConstantField.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/unsafe/UnsafeGetConstantField.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/unsafe/UnsafeGetConstantField.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java openjdk-11-11~24/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/unsafe/UnsafeGetStableArrayElement.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java openjdk-11-11~24/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java --- openjdk-11-11~19/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/compiler/vectorization/TestUnexpectedLoadOrdering.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,7 @@ * @test * @bug 8201367 * @summary RPO walk of counted loop block doesn't properly order loads + * @requires vm.flavor == "server" * * @run main/othervm -XX:-BackgroundCompilation -XX:-UseCountedLoopSafepoints TestUnexpectedLoadOrdering * diff -Nru openjdk-11-11~19/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java openjdk-11-11~24/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java --- openjdk-11-11~19/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/gc/class_unloading/TestG1ClassUnloadingHWM.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -74,14 +74,14 @@ OutputAnalyzer out = runWithoutG1ClassUnloading(); out.shouldMatch(".*Pause Full.*"); - out.shouldNotMatch(".*Pause Initial Mark.*"); + out.shouldNotMatch(".*Pause Young \\(Concurrent Start\\).*"); } public static void testWithG1ClassUnloading() throws Exception { // -XX:+ClassUnloadingWithConcurrentMark is used, so we expect a concurrent cycle instead of a full GC. OutputAnalyzer out = runWithG1ClassUnloading(); - out.shouldMatch(".*Pause Initial Mark.*"); + out.shouldMatch(".*Pause Young \\(Concurrent Start\\).*"); out.shouldNotMatch(".*Pause Full.*"); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/gc/g1/humongousObjects/objectGraphTest/GCTokens.java openjdk-11-11~24/test/hotspot/jtreg/gc/g1/humongousObjects/objectGraphTest/GCTokens.java --- openjdk-11-11~19/test/hotspot/jtreg/gc/g1/humongousObjects/objectGraphTest/GCTokens.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/gc/g1/humongousObjects/objectGraphTest/GCTokens.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,8 +31,8 @@ private GCTokens() { } - public static final String WB_INITIATED_YOUNG_GC = "Young (WhiteBox Initiated Young GC)"; - public static final String WB_INITIATED_MIXED_GC = "Pause Mixed (WhiteBox Initiated Young GC)"; + public static final String WB_INITIATED_YOUNG_GC = "Young (Normal) (WhiteBox Initiated Young GC)"; + public static final String WB_INITIATED_MIXED_GC = "Young (Mixed) (WhiteBox Initiated Young GC)"; public static final String WB_INITIATED_CMC = "WhiteBox Initiated Concurrent Mark"; public static final String FULL_GC = "Full (System.gc())"; public static final String FULL_GC_MEMORY_PRESSURE = "WhiteBox Initiated Full GC"; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java openjdk-11-11~24/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java --- openjdk-11-11~19/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/gc/g1/mixedgc/TestLogging.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -80,7 +80,7 @@ OutputAnalyzer output = spawnMixedGCProvoker(vmFlag); System.out.println(output.getStdout()); output.shouldHaveExitValue(0); - output.shouldContain("Pause Mixed (G1 Evacuation Pause)"); + output.shouldContain("Pause Young (Mixed) (G1 Evacuation Pause)"); } /** diff -Nru openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestHumongousAllocInitialMark.java openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestHumongousAllocInitialMark.java --- openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestHumongousAllocInitialMark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestHumongousAllocInitialMark.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,7 +52,7 @@ HumongousObjectAllocator.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Pause Initial Mark (G1 Humongous Allocation)"); + output.shouldContain("Pause Young (Concurrent Start) (G1 Humongous Allocation)"); output.shouldNotContain("Full GC"); output.shouldHaveExitValue(0); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java --- openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestHumongousAllocNearlyFullRegion.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,7 +51,7 @@ HumongousObjectAllocator.class.getName()); OutputAnalyzer output = new OutputAnalyzer(pb.start()); - output.shouldContain("Pause Initial Mark (G1 Humongous Allocation)"); + output.shouldContain("Pause Young (Concurrent Start) (G1 Humongous Allocation)"); output.shouldHaveExitValue(0); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestHumongousRemsetsMatch.java openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestHumongousRemsetsMatch.java --- openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestHumongousRemsetsMatch.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestHumongousRemsetsMatch.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test TestHumongousRemSetsMatch + * @bug 8205426 + * @summary Test to make sure that humongous object remset states are in sync + * @key gc + * @requires vm.gc.G1 + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -Xmx512M -Xms512M -Xmn10M -XX:ParallelGCThreads=2 -XX:-UseDynamicNumberOfGCThreads -XX:+UseG1GC -XX:+WhiteBoxAPI -XX:G1HeapRegionSize=1M -XX:+VerifyAfterGC -Xlog:gc,gc+remset+tracking=trace TestHumongousRemsetsMatch + */ + +import sun.hotspot.WhiteBox; + +public class TestHumongousRemsetsMatch { + + // G1 at the moment uses one thread every this amount of regions. + private static final int WorkerThreadBoundary = 384; + + private static final int ObjSizeInRegions = 17; + private static final int M = 1024 * 1024; + private static final int TypeArrayObjSize = ObjSizeInRegions * M / 4 /* sizeof(int) */ - 1024 /* > header size */; + + public static void main(String[] args) throws Exception { + WhiteBox wb = WhiteBox.getWhiteBox(); + + for (int j = 0; j < 3; j++) { + wb.fullGC(); // Start with a clean slate + + // It may happen that our 7-region sized humongous objects may just be "misaligned" + // so that they do not cross the region 384 boundary. Try to counter this by offsetting + // the humongous objects just a little. + Object alignmentFudge = new int[(j + 1) * M / 4 /* sizeof(int) */ - 1024]; + + // Fill the heap so that more than WorkerThreadBoundary regions are occupied with humongous objects + // and hopefully one of these objects crosses the region WorkerThreadBoundary boundary. + Object[] lotsOfHumongousObjects = new Object[(WorkerThreadBoundary / ObjSizeInRegions) + 3]; + + for (int i = 0; i < lotsOfHumongousObjects.length; i++) { + lotsOfHumongousObjects[i] = new int[TypeArrayObjSize]; + } + + wb.fullGC(); + + // Trigger a concurrent cycle and wait until the Remark pause + wb.g1StartConcMarkCycle(); + while (wb.g1InConcurrentMark()) { + Thread.sleep(200); + } + wb.youngGC(); // Trigger verification error. + + System.out.println(lotsOfHumongousObjects + " " + alignmentFudge); + } + } +} + diff -Nru openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java --- openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestStringDeduplicationTools.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -335,7 +335,7 @@ YoungGC, "-Xlog:gc,gc+stringdedup=trace"); output.shouldNotContain("Full GC"); - output.shouldContain("Pause Young (G1 Evacuation Pause)"); + output.shouldContain("Pause Young (Normal) (G1 Evacuation Pause)"); output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); output.shouldHaveExitValue(0); @@ -347,7 +347,7 @@ DefaultAgeThreshold, FullGC, "-Xlog:gc,gc+stringdedup=trace"); - output.shouldNotContain("Pause Young (G1 Evacuation Pause)"); + output.shouldNotContain("Pause Young (Normal) (G1 Evacuation Pause)"); output.shouldContain("Full GC"); output.shouldContain("Concurrent String Deduplication"); output.shouldContain("Deduplicated:"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java --- openjdk-11-11~19/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/gc/g1/TestVerifyGCType.java 2018-07-25 15:36:46.000000000 +0000 @@ -60,9 +60,10 @@ OutputAnalyzer output = testWithVerificationType(new String[0]); output.shouldHaveExitValue(0); - verifyCollection("Pause Young", true, false, true, output.getStdout()); - verifyCollection("Pause Initial Mark", true, false, true, output.getStdout()); - verifyCollection("Pause Mixed", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Normal)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Concurrent Start)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Mixed)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Prepare Mixed)", true, false, true, output.getStdout()); verifyCollection("Pause Remark", false, true, false, output.getStdout()); verifyCollection("Pause Cleanup", false, true, false, output.getStdout()); verifyCollection("Pause Full", true, true, true, output.getStdout()); @@ -72,12 +73,13 @@ OutputAnalyzer output; // Test with all explicitly enabled output = testWithVerificationType(new String[] { - "young-only", "initial-mark", "mixed", "remark", "cleanup", "full"}); + "young-normal", "concurrent-start", "mixed", "remark", "cleanup", "full"}); output.shouldHaveExitValue(0); - verifyCollection("Pause Young", true, false, true, output.getStdout()); - verifyCollection("Pause Initial Mark", true, false, true, output.getStdout()); - verifyCollection("Pause Mixed", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Normal)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Concurrent Start)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Mixed)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Prepare Mixed)", true, false, true, output.getStdout()); verifyCollection("Pause Remark", false, true, false, output.getStdout()); verifyCollection("Pause Cleanup", false, true, false, output.getStdout()); verifyCollection("Pause Full", true, true, true, output.getStdout()); @@ -89,9 +91,10 @@ output = testWithVerificationType(new String[] {"remark", "full"}); output.shouldHaveExitValue(0); - verifyCollection("Pause Young", false, false, false, output.getStdout()); - verifyCollection("Pause Initial Mark", false, false, false, output.getStdout()); - verifyCollection("Pause Mixed", false, false, false, output.getStdout()); + verifyCollection("Pause Young (Normal)", false, false, false, output.getStdout()); + verifyCollection("Pause Young (Concurrent Start)", false, false, false, output.getStdout()); + verifyCollection("Pause Young (Mixed)", false, false, false, output.getStdout()); + verifyCollection("Pause Young (Prepare Mixed)", false, false, false, output.getStdout()); verifyCollection("Pause Remark", false, true, false, output.getStdout()); verifyCollection("Pause Cleanup", false, false, false, output.getStdout()); verifyCollection("Pause Full", true, true, true, output.getStdout()); @@ -100,12 +103,13 @@ private static void testConcurrentMark() throws Exception { OutputAnalyzer output; // Test with full and remark - output = testWithVerificationType(new String[] {"initial-mark", "cleanup", "remark"}); + output = testWithVerificationType(new String[] {"concurrent-start", "cleanup", "remark"}); output.shouldHaveExitValue(0); - verifyCollection("Pause Young", false, false, false, output.getStdout()); - verifyCollection("Pause Initial Mark", true, false, true, output.getStdout()); - verifyCollection("Pause Mixed", false, false, false, output.getStdout()); + verifyCollection("Pause Young (Normal)", false, false, false, output.getStdout()); + verifyCollection("Pause Young (Concurrent Start)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Mixed)", false, false, false, output.getStdout()); + verifyCollection("Pause Young (Prepare Mixed)", false, false, false, output.getStdout()); verifyCollection("Pause Remark", false, true, false, output.getStdout()); verifyCollection("Pause Cleanup", false, true, false, output.getStdout()); verifyCollection("Pause Full", false, false, false, output.getStdout()); @@ -117,10 +121,11 @@ output = testWithVerificationType(new String[] {"old"}); output.shouldHaveExitValue(0); - output.shouldMatch("VerifyGCType: '.*' is unknown. Available types are: young-only, initial-mark, mixed, remark, cleanup and full"); - verifyCollection("Pause Young", true, false, true, output.getStdout()); - verifyCollection("Pause Initial Mark", true, false, true, output.getStdout()); - verifyCollection("Pause Mixed", true, false, true, output.getStdout()); + output.shouldMatch("VerifyGCType: '.*' is unknown. Available types are: young-normal, concurrent-start, mixed, remark, cleanup and full"); + verifyCollection("Pause Young (Normal)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Concurrent Start)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Mixed)", true, false, true, output.getStdout()); + verifyCollection("Pause Young (Prepare Mixed)", true, false, true, output.getStdout()); verifyCollection("Pause Remark", false, true, false, output.getStdout()); verifyCollection("Pause Cleanup", false, true, false, output.getStdout()); verifyCollection("Pause Full", true, true, true, output.getStdout()); @@ -229,21 +234,23 @@ // Allocate some memory that can be turned into garbage. Object[] used = alloc1M(); + wb.youngGC(); // young-normal + // Trigger the different GCs using the WhiteBox API. wb.fullGC(); // full // Memory have been promoted to old by full GC. Free // some memory to be reclaimed by concurrent cycle. partialFree(used); - wb.g1StartConcMarkCycle(); // initial-mark, remark and cleanup + wb.g1StartConcMarkCycle(); // concurrent-start, remark and cleanup // Sleep to make sure concurrent cycle is done while (wb.g1InConcurrentMark()) { Thread.sleep(1000); } - // Trigger two young GCs, first will be young-only, second will be mixed. - wb.youngGC(); // young-only + // Trigger two young GCs, first will be young-prepare-mixed, second will be mixed. + wb.youngGC(); // young-prepare-mixed wb.youngGC(); // mixed } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java openjdk-11-11~24/test/hotspot/jtreg/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java --- openjdk-11-11~19/test/hotspot/jtreg/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/gc/metaspace/CompressedClassSpaceSizeInJmapHeap.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,11 +21,11 @@ * questions. */ -/* +/** * @test CompressedClassSpaceSizeInJmapHeap * @bug 8004924 * @summary Checks that jmap -heap contains the flag CompressedClassSpaceSize - * @requires vm.opt.final.UseCompressedOops + * @requires vm.hasSAandCanAttach & vm.opt.final.UseCompressedOops * @library /test/lib * @modules java.base/jdk.internal.misc * java.management @@ -48,10 +48,6 @@ // Compressed Class Space is only available on 64-bit JVMs return; } - if (!Platform.shouldSAAttach()) { - System.out.println("SA attach not expected to work - test skipped."); - return; - } String pid = Long.toString(ProcessTools.getProcessId()); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/Makefile openjdk-11-11~24/test/hotspot/jtreg/Makefile --- openjdk-11-11~19/test/hotspot/jtreg/Makefile 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/Makefile 2018-07-25 15:36:46.000000000 +0000 @@ -4,9 +4,7 @@ # # 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. +# 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/ProblemList-cds-mode.txt openjdk-11-11~24/test/hotspot/jtreg/ProblemList-cds-mode.txt --- openjdk-11-11~19/test/hotspot/jtreg/ProblemList-cds-mode.txt 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/ProblemList-cds-mode.txt 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +# +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +############################################################################# +# +# Additional list of quarantined tests when CDS mode enabled. +# +############################################################################# + +serviceability/sa/TestInstanceKlassSize.java 8204308 generic-all +serviceability/sa/TestInstanceKlassSizeForInterface.java 8204308 generic-all diff -Nru openjdk-11-11~19/test/hotspot/jtreg/ProblemList-graal.txt openjdk-11-11~24/test/hotspot/jtreg/ProblemList-graal.txt --- openjdk-11-11~19/test/hotspot/jtreg/ProblemList-graal.txt 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/ProblemList-graal.txt 2018-07-25 15:36:46.000000000 +0000 @@ -67,8 +67,6 @@ gc/TestNUMAPageSize.java 8194949 generic-all -runtime/ReservedStack/ReservedStackTestCompiler.java 8181855 generic-all - serviceability/jvmti/GetModulesInfo/JvmtiGetAllModulesTest.java 8195156 generic-all compiler/compilercontrol/directives/LogTest.java 8181753 generic-all @@ -79,9 +77,30 @@ compiler/jvmci/compilerToVM/ReprofileTest.java 8201333 generic-all -compiler/tiered/TieredLevelsTest.java 8202124 generic-all -compiler/tiered/NonTieredLevelsTest.java 8202124 generic-all -compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java 8202124 generic-all +compiler/tiered/LevelTransitionTest.java 8202124 generic-all +compiler/tiered/TieredLevelsTest.java 8202124 generic-all +compiler/tiered/NonTieredLevelsTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/IncrementExactIntTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/NegateExactIntTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/AddExactLongTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/SubtractExactLongTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/AddExactIntTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/NegateExactLongTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/DecrementExactLongTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/DecrementExactIntTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/IncrementExactLongTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/SubtractExactIntTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/MultiplyExactLongTest.java 8202124 generic-all +compiler/intrinsics/mathexact/sanity/MultiplyExactIntTest.java 8202124 generic-all +compiler/whitebox/DeoptimizeAllTest.java 8202124 generic-all +compiler/whitebox/DeoptimizeFramesTest.java 8202124 generic-all +compiler/whitebox/DeoptimizeMethodTest.java 8202124 generic-all +compiler/whitebox/ForceNMethodSweepTest.java 8202124 generic-all +compiler/whitebox/GetNMethodTest.java 8202124 generic-all +compiler/whitebox/IsMethodCompilableTest.java 8202124 generic-all +compiler/whitebox/LockCompilationTest.java 8202124 generic-all +compiler/whitebox/SetDontInlineMethodTest.java 8202124 generic-all +compiler/whitebox/SetForceInlineMethodTest.java 8202124 generic-all compiler/jvmci/meta/StableFieldTest.java CODETOOLS-7902162 generic-all compiler/jvmci/jdk.vm.ci.hotspot.test/src/jdk/vm/ci/hotspot/test/HotSpotConstantReflectionProviderTest.java CODETOOLS-7902162 generic-all @@ -95,7 +114,6 @@ vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java 8191047 generic-all vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn009/forceEarlyReturn009.java 8191047 generic-all -vmTestbase/nsk/jdi/ReferenceType/instances/instances001/instances001.java 8195600 generic-all vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn007/TestDescription.java 8195600 generic-all vmTestbase/nsk/jdi/ArrayType/newInstance/newinstance001/TestDescription.java 8203174 generic-all @@ -105,14 +123,12 @@ vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/MonitorContendedEnteredRequest001/TestDescription.java 8203174 generic-all vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/MonitorContendedEnteredRequest002/TestDescription.java 8203174 generic-all vmTestbase/nsk/jdi/MonitorWaitedRequest/addClassExclusionFilter/TestDescription.java 8203174 generic-all -vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects001/referringObjects001.java 8203174 generic-all vmTestbase/nsk/jdi/ReferenceType/instances/instances002/instances002.java 8203174 generic-all vmTestbase/nsk/jdi/ReferenceType/instances/instances003/instances003.java 8203174 generic-all vmTestbase/nsk/jdi/stress/MonitorEvents/MonitorEvents002/TestDescription.java 8203174 generic-all vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java 8203174 generic-all vmTestbase/nsk/jdi/stress/serial/heapwalking002/TestDescription.java 8203174 generic-all vmTestbase/nsk/jdi/stress/serial/mixed002/TestDescription.java 8203174 generic-all -vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java 8203174 generic-all vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses026/TestDescription.java 8195627 generic-all vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses028/TestDescription.java 8195627 generic-all @@ -133,8 +149,6 @@ vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/TestDescription.java 8195674 generic-all vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn002/TestDescription.java 8195674 generic-all -vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java 8195630 generic-all - vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/TestDescription.java 8202342 generic-all vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t002/TestDescription.java 8204506 macosx-all @@ -151,3 +165,22 @@ compiler/stable/TestStableShort.java 8204347 generic-all compiler/stable/TestStableUByte.java 8204347 generic-all compiler/stable/TestStableUShort.java 8204347 generic-all + +# Graal unit tests +org.graalvm.compiler.core.test.CheckGraalInvariants 8205081 +org.graalvm.compiler.core.test.inlining.PolymorphicInliningTest 8205081 +org.graalvm.compiler.core.test.OptionsVerifierTest 8205081 +org.graalvm.compiler.core.test.ProfilingInfoTest 8205081 +org.graalvm.compiler.hotspot.test.CompilationWrapperTest 8205081 +org.graalvm.compiler.hotspot.test.HsErrLogTest 8205081 +org.graalvm.compiler.hotspot.test.OptionsInFileTest 8205081 +org.graalvm.compiler.hotspot.test.ReservedStackAccessTest 8205081 +org.graalvm.compiler.replacements.test.classfile.ClassfileBytecodeProviderTest 8205081 +org.graalvm.compiler.replacements.test.classfile.RedefineIntrinsicTest 8205081 + +org.graalvm.compiler.core.test.deopt.CompiledMethodTest 8202955 +org.graalvm.compiler.core.test.CountedLoopTest 8199885 +org.graalvm.compiler.debug.test.DebugContextTest 8203504 +org.graalvm.compiler.core.test.VerifyDebugUsageTest 8205078 + +org.graalvm.compiler.hotspot.test.GraalOSRTest 8206947 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/ProblemList.txt openjdk-11-11~24/test/hotspot/jtreg/ProblemList.txt --- openjdk-11-11~19/test/hotspot/jtreg/ProblemList.txt 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/ProblemList.txt 2018-07-25 15:36:46.000000000 +0000 @@ -49,7 +49,8 @@ compiler/tiered/LevelTransitionTest.java 8067651 generic-all compiler/types/correctness/CorrectnessTest.java 8066173 generic-all compiler/types/correctness/OffTest.java 8066173 generic-all -compiler/c2/Test8007294.java 8192992 generic-all + +compiler/c2/Test6852078.java 8194310 generic-all applications/ctw/modules/java_desktop.java 8189604 windows-all applications/ctw/modules/java_desktop_2.java 8189604,8204842 generic-all @@ -78,6 +79,7 @@ # :hotspot_serviceability +serviceability/sa/ClhsdbCDSCore.java 8207832 linux-x64 serviceability/sa/TestRevPtrsForInvokeDynamic.java 8191270 generic-all serviceability/sa/sadebugd/SADebugDTest.java 8163805 generic-all @@ -87,14 +89,6 @@ ############################################################################# -########################################################################### -# -# Java EE Module Removal -# - -compiler/c2/Test8007294.java 8194310 generic-all Java EE Module Removal -compiler/c2/Test6852078.java 8194310 generic-all Java EE Module Removal - ############################################################################# # :vmTestbase_* @@ -130,6 +124,7 @@ vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk001/TestDescription.java 8016181 generic-all vmTestbase/nsk/jvmti/FieldModification/fieldmod001/TestDescription.java 8016181 generic-all +vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java 8202896,8206076,8208074 generic-all vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted001/TestDescription.java 7013634 generic-all vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted003/TestDescription.java 6606767 generic-all vmTestbase/nsk/jvmti/ResourceExhausted/resexhausted004/TestDescription.java 7013634,6606767 generic-all @@ -152,8 +147,6 @@ vmTestbase/jit/escape/LockCoarsening/LockCoarsening001/TestDescription.java 8148743 generic-all vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java 8079666 generic-all -vmTestbase/vm/mlvm/indy/func/jdi/breakpointOtherStratum/Test.java 8199578 generic-all -vmTestbase/vm/mlvm/indy/func/jdi/breakpoint/Test.java 8199578 generic-all vmTestbase/vm/mlvm/indy/func/jvmti/redefineClassInBootstrap/TestDescription.java 8013267 generic-all vmTestbase/vm/mlvm/indy/stress/java/relinkMutableCallSite/Test.java 8079664 generic-all vmTestbase/vm/mlvm/indy/stress/java/relinkVolatileCallSite/Test.java 8079664 generic-all diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java openjdk-11-11~24/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/8176717/TestInheritFD.java 2018-07-25 15:36:46.000000000 +0000 @@ -45,6 +45,8 @@ * @test TestInheritFD * @bug 8176717 8176809 * @summary a new process should not inherit open file descriptors + * @comment On Aix lsof requires root privileges. + * @requires os.family != "aix" * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/CDSandJFR.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,10 +22,10 @@ * */ -/* +/** * @test * @summary Make sure CDS and JFR work together. - * @requires vm.cds + * @requires vm.hasJFR & vm.cds * @library /test/lib /test/hotspot/jtreg/runtime/appcds /test/hotspot/jtreg/runtime/appcds/test-classes test-classes * @modules jdk.jfr * @build Hello GetFlightRecorder @@ -74,5 +74,10 @@ TestCommon.checkExec(TestCommon.exec(appJar, "-XX:FlightRecorderOptions=retransform=false", "GetFlightRecorder")); + + // Test dumping with flight recorder enabled. + output = TestCommon.testDump(appJar, TestCommon.list(classes), + "-XX:StartFlightRecording=dumponexit=true"); + TestCommon.checkDump(output, "warning: JFR will be disabled during CDS dumping"); } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/CommandLineFlagCombo.java openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/CommandLineFlagCombo.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/CommandLineFlagCombo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/CommandLineFlagCombo.java 2018-07-25 15:36:46.000000000 +0000 @@ -68,22 +68,10 @@ if (skipTestCase(testEntry)) continue; - OutputAnalyzer dumpOutput; - - if (testEntry.equals("-XX:+FlightRecorder")) { - dumpOutput = TestCommon.dump(appJar, classList, "-XX:+UnlockCommercialFeatures", testEntry); - } else { - dumpOutput = TestCommon.dump(appJar, classList, testEntry); - } - + OutputAnalyzer dumpOutput = TestCommon.dump(appJar, classList, testEntry); TestCommon.checkDump(dumpOutput, "Loading classes to share"); - OutputAnalyzer execOutput; - if (testEntry.equals("-XX:+FlightRecorder")) { - execOutput = TestCommon.exec(appJar, "-XX:+UnlockCommercialFeatures", testEntry, "Hello"); - } else { - execOutput = TestCommon.exec(appJar, testEntry, "Hello"); - } + OutputAnalyzer execOutput = TestCommon.exec(appJar, testEntry, "Hello"); TestCommon.checkExec(execOutput, "Hello World"); } @@ -121,11 +109,6 @@ } } - if (!BuildHelper.isCommercialBuild() && testEntry.equals("-XX:+FlightRecorder")) - { - System.out.println("Test case not applicable on non-commercial builds"); - return true; - } if (Compiler.isGraalEnabled() && testEntry.equals("-XX:+UseConcMarkSweepGC")) { System.out.println("Graal does not support CMS"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasic.java openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasic.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasic.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,10 +24,21 @@ import sun.hotspot.WhiteBox; +// package access top-level class to avoid problem with RedefineClassHelper +// and nested types. +class RedefineBasic_B { + public static void okToCallBeforeRedefine() { + System.out.println("okToCallBeforeRedefine"); + } + public static void okToCallAfterRedefine() { + throw new RuntimeException("okToCallAfterRedefine is called before redefinition, test failed"); + } +} + public class RedefineBasic { public static String newB = - " class RedefineBasic$B { " + + " class RedefineBasic_B { " + " public static void okToCallBeforeRedefine() { " + " throw new RuntimeException(\"newB: okToCallBeforeRedefine is " + " called after redefinition, test failed\"); }" + @@ -36,23 +47,14 @@ " } "; - static class B { - public static void okToCallBeforeRedefine() { - System.out.println("okToCallBeforeRedefine"); - } - public static void okToCallAfterRedefine() { - throw new RuntimeException( - "okToCallAfterRedefine is called before redefinition, test failed"); - } - } - static class SubclassOfB extends B { + static class SubclassOfB extends RedefineBasic_B { public static void testAfterRedefine() { - B.okToCallAfterRedefine(); + RedefineBasic_B.okToCallAfterRedefine(); } } - class Subclass2OfB extends B { + class Subclass2OfB extends RedefineBasic_B { public void testAfterRedefine() { super.okToCallAfterRedefine(); } @@ -74,17 +76,17 @@ WhiteBox wb = WhiteBox.getWhiteBox(); verifyClassIsShared(wb, RedefineBasic.class); - verifyClassIsShared(wb, B.class); + verifyClassIsShared(wb, RedefineBasic_B.class); verifyClassIsShared(wb, SubclassOfB.class); verifyClassIsShared(wb, Subclass2OfB.class); // (1) Test case: verify that original B works as expected // and that redefined B is shared and works as expected, // with new behavior - B.okToCallBeforeRedefine(); - RedefineClassHelper.redefineClass(B.class, newB); - verifyClassIsShared(wb, B.class); - B.okToCallAfterRedefine(); + RedefineBasic_B.okToCallBeforeRedefine(); + RedefineClassHelper.redefineClass(RedefineBasic_B.class, newB); + verifyClassIsShared(wb, RedefineBasic_B.class); + RedefineBasic_B.okToCallAfterRedefine(); // Static subclass of the super: // 1. Make sure it is still shared diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasicTest.java openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasicTest.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasicTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineBasicTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,7 +43,7 @@ public class RedefineBasicTest { public static String sharedClasses[] = { "RedefineBasic", - "RedefineBasic$B", + "RedefineBasic_B", "RedefineBasic$SubclassOfB", "RedefineBasic$Subclass2OfB", "RedefineClassHelper", diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineRunningMethods_Shared.java openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineRunningMethods_Shared.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineRunningMethods_Shared.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/redefineClass/RedefineRunningMethods_Shared.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,7 +47,7 @@ "RedefineRunningMethods$1", "RedefineRunningMethods$2", "RedefineRunningMethods$3", - "RedefineRunningMethods$B", + "RedefineRunningMethods_B", "RedefineClassHelper", "jdk/test/lib/compiler/InMemoryJavaCompiler", "jdk/test/lib/compiler/InMemoryJavaCompiler$FileManagerWrapper", diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/sharedStrings/FlagCombo.java openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/sharedStrings/FlagCombo.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/sharedStrings/FlagCombo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/sharedStrings/FlagCombo.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,10 +22,10 @@ * */ -/* +/** * @test * @summary Test relevant combinations of command line flags with shared strings - * @requires vm.cds.archived.java.heap + * @requires vm.cds.archived.java.heap & vm.hasJFR * @library /test/lib /test/hotspot/jtreg/runtime/appcds * @modules java.base/jdk.internal.misc * @modules java.management @@ -34,7 +34,21 @@ * @run main FlagCombo */ +/** + * @test + * @summary Test relevant combinations of command line flags with shared strings + * @comment A special test excluding the case that requires JFR + * @requires vm.cds.archived.java.heap & !vm.hasJFR + * @library /test/lib /test/hotspot/jtreg/runtime/appcds + * @modules java.base/jdk.internal.misc + * @modules java.management + * jdk.jartool/sun.tools.jar + * @build HelloString + * @run main FlagCombo noJfr + */ + import jdk.test.lib.BuildHelper; +import jdk.test.lib.Platform; public class FlagCombo { public static void main(String[] args) throws Exception { @@ -45,8 +59,8 @@ SharedStringsUtils.runWithArchive("HelloString", "-XX:+UseG1GC"); - if (BuildHelper.isCommercialBuild()) { - SharedStringsUtils.runWithArchiveAuto("HelloString", "-XX:+UnlockCommercialFeatures", + if (args.length == 0) { + SharedStringsUtils.runWithArchiveAuto("HelloString", "-XX:StartFlightRecording=dumponexit=true"); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/sharedStrings/IncompatibleOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,6 +39,7 @@ */ import jdk.test.lib.Asserts; +import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; import sun.hotspot.code.Compiler; @@ -62,6 +63,9 @@ // Uncompressed OOPs testDump(1, "-XX:+UseG1GC", "-XX:-UseCompressedOops", COOPS_DUMP_WARNING, true); + if (Platform.isLinux() && Platform.isX64()) { + testDump(1, "-XX:+UnlockExperimentalVMOptions", "-XX:+UseZGC", COOPS_DUMP_WARNING, true); + } // incompatible GCs testDump(2, "-XX:+UseParallelGC", "", GC_WARNING, false); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/sharedStrings/SharedStringsStress.java 2018-07-25 15:36:46.000000000 +0000 @@ -55,11 +55,7 @@ out.close(); } - // Set NewSize to 8m due to dumping could fail in hs-tier6 testing with - // the vm options: -XX:+UnlockCommercialFeatures -XX:+UseDeterministicG1GC - // resulting in vm initialization error: - // "GC triggered before VM initialization completed. Try increasing NewSize, current value 1331K." - OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"), "-XX:NewSize=8m", + OutputAnalyzer dumpOutput = TestCommon.dump(appJar, TestCommon.list("HelloString"), "-XX:SharedArchiveConfigFile=" + sharedArchiveConfigFile); TestCommon.checkDump(dumpOutput); OutputAnalyzer execOutput = TestCommon.exec(appJar, "HelloString"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/TestWithProfiler.java openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/TestWithProfiler.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/appcds/TestWithProfiler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/appcds/TestWithProfiler.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,14 +22,14 @@ * */ -/* +/** * @test * @bug 8145221 * @summary After creating an AppCDS archive, run the test with the JFR profiler * enabled, and keep calling a method in the archive in a tight loop. * This is to test the safe handling of trampoline functions by the * profiler. - * @requires vm.cds + * @requires vm.hasJFR & vm.cds * @library /test/lib /test/hotspot/jtreg/runtime/appcds * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/ConstantPool/BadMethodHandles.java openjdk-11-11~24/test/hotspot/jtreg/runtime/ConstantPool/BadMethodHandles.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/ConstantPool/BadMethodHandles.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/ConstantPool/BadMethodHandles.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8087223 + * @bug 8087223 8195650 * @summary Adding constantTag to keep method call consistent with it. * @modules java.base/jdk.internal.org.objectweb.asm * java.base/jdk.internal.misc @@ -46,9 +46,9 @@ ClassWriter cw = new ClassWriter(0); cw.visit(52, ACC_PUBLIC | ACC_SUPER, "BadInterfaceMethodref", null, "java/lang/Object", null); Handle handle1 = - new Handle(Opcodes.H_INVOKEINTERFACE, "BadInterfaceMethodref", "m", "()V"); + new Handle(Opcodes.H_INVOKEINTERFACE, "BadInterfaceMethodref", "m", "()V", true); Handle handle2 = - new Handle(Opcodes.H_INVOKEINTERFACE, "BadInterfaceMethodref", "staticM", "()V"); + new Handle(Opcodes.H_INVOKEINTERFACE, "BadInterfaceMethodref", "staticM", "()V", true); { MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); @@ -137,9 +137,9 @@ ClassWriter cw = new ClassWriter(0); cw.visit(52, ACC_PUBLIC | ACC_SUPER, "BadMethodref", null, "java/lang/Object", new String[]{"IBad"}); Handle handle1 = - new Handle(Opcodes.H_INVOKEINTERFACE, "BadMethodref", "m", "()V"); + new Handle(Opcodes.H_INVOKEINTERFACE, "BadMethodref", "m", "()V", true); Handle handle2 = - new Handle(Opcodes.H_INVOKEINTERFACE, "BadMethodref", "staticM", "()V"); + new Handle(Opcodes.H_INVOKEINTERFACE, "BadMethodref", "staticM", "()V", true); { MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); @@ -176,6 +176,37 @@ cw.visitEnd(); return cw.toByteArray(); } + + static byte[] dumpInvokeBasic() { + ClassWriter cw = new ClassWriter(0); + cw.visit(52, ACC_PUBLIC | ACC_SUPER, "InvokeBasicref", null, "java/lang/Object", null); + Handle handle = + new Handle(Opcodes.H_INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invokeBasic", "([Ljava/lang/Object;)Ljava/lang/Object;", false); + + { + MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); + mv.visitCode(); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + + { + MethodVisitor mv = cw.visitMethod(ACC_PUBLIC | ACC_STATIC, "runInvokeBasicM", "()V", null, null); + mv.visitCode(); + mv.visitLdcInsn(handle); + mv.visitMethodInsn(INVOKEVIRTUAL, "java/lang/invoke/MethodHandle", "invoke", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(1, 1); + mv.visitEnd(); + } + + cw.visitEnd(); + return cw.toByteArray(); + } + static class CL extends ClassLoader { @Override protected Class<?> findClass(String name) throws ClassNotFoundException { @@ -184,6 +215,7 @@ case "BadInterfaceMethodref": classBytes = dumpBadInterfaceMethodref(); break; case "BadMethodref" : classBytes = dumpBadMethodref(); break; case "IBad" : classBytes = dumpIBad(); break; + case "InvokeBasicref" : classBytes = dumpInvokeBasic(); break; default : throw new ClassNotFoundException(name); } return defineClass(name, classBytes, 0, classBytes.length); @@ -200,6 +232,9 @@ try (FileOutputStream fos = new FileOutputStream("BadMethodref.class")) { fos.write(dumpBadMethodref()); } + try (FileOutputStream fos = new FileOutputStream("InvokeBasicref.class")) { + fos.write(dumpInvokeBasic()); + } Class<?> cls = (new CL()).loadClass("BadInterfaceMethodref"); String[] methods = {"runm", "runStaticM"}; @@ -249,5 +284,30 @@ throw new Exception("BadMethodRef Failed to catch IncompatibleClassChangeError"); } + System.out.println("Test InvokeBasicref:"); + cls = (new CL()).loadClass("InvokeBasicref"); + success = 0; + methods = new String[] {"runInvokeBasicM"}; + for (String name : methods) { + try { + System.out.printf("invoke %s: \n", name); + cls.getMethod(name).invoke(cls.newInstance()); + System.out.println("FAILED - ICCE should be thrown"); + } catch (Throwable e) { + e.printStackTrace(); + if (e instanceof InvocationTargetException && e.getCause() != null && + e.getCause() instanceof IncompatibleClassChangeError) { + System.out.println("PASSED - expected ICCE thrown"); + success++; + continue; + } else { + System.out.println("FAILED with wrong exception" + e); + throw e; + } + } + } + if (success != methods.length) { + throw new Exception("InvokeBasicref Failed to catch IncompatibleClassChangeError"); + } } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java openjdk-11-11~24/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/ElfDecoder/TestElfDirectRead.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,13 +25,38 @@ * @test * @bug 8193373 * @summary Test reading ELF info direct from underlaying file - * @requires (os.family == "linux") + * @requires (os.family == "linux") & (os.arch != "ppc64") * @modules java.base/jdk.internal.misc * @library /test/lib * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox - * sun.hotspot.WhiteBox$WhiteBoxPermission - * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -XX:NativeMemoryTracking=detail TestElfDirectRead + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + -XX:NativeMemoryTracking=detail TestElfDirectRead + */ + +// This test intentionally disables caching of Elf sections during symbol lookup +// with WhiteBox.disableElfSectionCache(). On platforms which do not use file +// descriptors instead of plain function pointers this slows down the lookup just a +// little bit, because all the symbols from an Elf file are still read consecutively +// after one 'fseek()' call. But on platforms with file descriptors like ppc64 +// big-endian, we get two 'fseek()' calls for each symbol read from the Elf file +// because reading the file descriptor table is nested inside the loop which reads +// the symbols. This really trashes the I/O system and considerable slows down the +// test, so we need an extra long timeout setting. + +/* + * @test + * @bug 8193373 + * @summary Test reading ELF info direct from underlaying file + * @requires (os.family == "linux") & (os.arch == "ppc64") + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @build sun.hotspot.WhiteBox + * @run driver ClassFileInstaller sun.hotspot.WhiteBox + * sun.hotspot.WhiteBox$WhiteBoxPermission + * @run main/othervm/timeout=600 -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI + -XX:NativeMemoryTracking=detail TestElfDirectRead */ import jdk.test.lib.process.ProcessTools; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE78_A.java openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE78_A.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE78_A.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE78_A.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018 by SAP AG, Walldorf, Germany. + * 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. + * + */ + +package test; + +public class IAE78_A { + + static Object f = new Object(); + + IAE78_A() { + // Nothing to do. + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE78_B.java openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE78_B.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE78_B.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE78_B.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018 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 + * 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. + * + */ + +package test; + +public class IAE78_B { + + public static void create() { + new IAE78_A(); + } + + public static void access() { + IAE78_A.f.hashCode(); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE_Loader1.java openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE_Loader1.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE_Loader1.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE_Loader1.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package test; + +import java.util.*; +import java.io.*; + +public class IAE_Loader1 extends ClassLoader { + + private final Set<String> names = new HashSet<>(); + + public IAE_Loader1(String name, String[] names) { + super(name, ClassLoader.getSystemClassLoader()); + for (String n : names) this.names.add(n); + } + + protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { + if (!names.contains(name)) { + return super.loadClass(name, resolve); + } + String filename = name.replace('.', '/') + ".class"; + Class<?> result = null; + try (InputStream data = getResourceAsStream(filename)) { + if (data == null) { + throw new ClassNotFoundException(); + } + try (ByteArrayOutputStream buffer = new ByteArrayOutputStream()) { + byte[] bytes = data.readAllBytes(); + result = defineClass(name, bytes, 0, bytes.length); + } + } catch (IOException e) { + throw new ClassNotFoundException("Error reading class file", e); + } + if (resolve) resolveClass(result); + return result; + } + +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE_Loader2.java openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE_Loader2.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE_Loader2.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IAE_Loader2.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,166 @@ +/* + * Copyright (c) 2018 by SAP AG, Walldorf, Germany. + * 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. + * + */ + +package test; + +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.security.SecureClassLoader; +import java.util.Arrays; +import java.util.HashSet; +import java.util.stream.Collectors; + +/** + * This is a class loader which can load the same classes as another class loader. + * <p> + * This is mainly useful for tests when you want to load a class, but do it with a class + * loader you can dispose. The clone loader just asks the loader to be cloned to get + * the bytecodes, but defines the class itself. + * <p> + * Additionally you can specify a set of classes the loader should not be able to load. + */ +public class IAE_Loader2 extends SecureClassLoader { + + /** + * The class loaded to clone. + */ + private final ClassLoader toClone; + + /** + * The strings we cannot load. + */ + private final HashSet<String> notLoadable; + + /** + * The strings we just delegate. + */ + private final HashSet<String> simpleDelegate; + + /** + * Creates a class loader which can load the same classes as the loader which + * loaded the <code>IAE_Loader2</code> class itself. + * <p> + * Only the classes which are loadable by the 'parent' loader are delegated to that + * loader (to make it possible mix classes). + * + * @param name the name of the class loader. + * @param parent the parent loader which is first asked to load a class. + * @param toClone the class loader to mimic. The clone class loader will be able to + * load the same classes as the 'toClone' loader. + * @param notLoadable The classes we should not be able to load via this loader. + * @param simpleDelegate The names of the classes for which we simply delegate. + */ + public IAE_Loader2(String name, ClassLoader parent, ClassLoader toClone, + String[] notLoadable, String[] simpleDelegate) { + super(name, parent); + + this.toClone = toClone; + this.notLoadable = Arrays.stream(notLoadable).collect(Collectors.toCollection(HashSet<String>::new)); + this.simpleDelegate = Arrays.stream(simpleDelegate).collect(Collectors.toCollection(HashSet<String>::new)); + } + + /** + * @see java.lang.ClassLoader#findClass(java.lang.String) + */ + @Override + protected Class<?> findClass(String name) throws ClassNotFoundException { + if (notLoadable.contains(name)) { + throw new ClassNotFoundException("The clone class loader explicitely " + + "didn't found the class"); + } + + if (simpleDelegate.contains(name)) { + return toClone.loadClass(name); + } + + // We just ask the wrapper class loader to find the resource for us + URL res = toClone.getResource(name.replace('.', '/') + ".class"); + + if (res == null) { + throw new ClassNotFoundException(name); + } + + try { + InputStream is = res.openStream(); + byte[] code = readStreamIntoBuffer(is, 8192); + is.close(); + return defineClass(name, code, 0, code.length); + } catch (IOException e) { + throw new ClassNotFoundException(name, e); + } + } + + /** + * Reads all data of a stream into a byte array. The method allocates as + * much memory as necessary to put the whole data into that byte + * array. The data is read in chunks of <code>chunkSize</code> + * chunks.<br><br> + * <b>Implementation Note: </b> The data is read in chunks of + * <code>chunkSize</code> bytes. The data is copied to the result + * array. The memory consumption at the end of the reading is + * <code>2 x [size of resulting array] + chunkSize</code>. + * + * @param is the stream to read the data from + * @param chunkSize the size of the chunks the data should be read in + * @return the <b>whole</b> data of the stream read into an byte array + * @throws IllegalArgumentException if chunkSize <= 0 + * @throws NullPointerException if is == null + * @throws IOException thrown if the provided stream encounters IO problems + */ + public static byte[] readStreamIntoBuffer(InputStream is, int chunkSize) + throws IOException { + + // Check preconditions. + if (chunkSize <= 0) { + throw new IllegalArgumentException("chunkSize <= 0"); + } + else if (is == null) { + throw new NullPointerException("is is null"); + } + + // Temporary buffer for read operations and result buffer. + byte[] tempBuffer = new byte[chunkSize]; + byte[] buffer = new byte[0]; + + int bytesRead = 0; // bytes actual read + int oldSize = 0; // size of the resulting buffer + + while ((bytesRead = is.read(tempBuffer)) > 0) { + + // Temporary reference to the buffer for the copy operation. + byte[] oldBuffer = buffer; + + // Create a new buffer with the size needed and copy data. + buffer = new byte[oldSize + bytesRead]; + System.arraycopy(oldBuffer, 0, buffer, 0, oldBuffer.length); + + // Copy the new data. + System.arraycopy(tempBuffer, 0, buffer, oldSize, bytesRead); + oldSize += bytesRead; + } + + return buffer; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IllegalAccessErrorTest.java openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IllegalAccessErrorTest.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IllegalAccessErrorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IllegalAccessError/IllegalAccessErrorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,405 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2018 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 + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/** + * @test + * @summary Test messages of IllegalAccessError. + * @modules java.base/java.lang:open + * java.base/jdk.internal.org.objectweb.asm + * @compile IAE_Loader1.java IAE_Loader2.java IAE78_A.java IAE78_B.java + * IllegalAccessErrorTest.java + * @run main/othervm -Xbootclasspath/a:. test.IllegalAccessErrorTest + */ + +// Put this test into a package so we see qualified class names in +// the error messages. Verify that classes are printed with '.' instead +// of '/'. +package test; + +import java.lang.reflect.*; +import java.lang.invoke.MethodHandles.Lookup; +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodHandles.Lookup.*; +import java.security.*; + +import jdk.internal.org.objectweb.asm.ClassWriter; +import jdk.internal.org.objectweb.asm.MethodVisitor; +import static jdk.internal.org.objectweb.asm.Opcodes.*; + +import test.*; + +abstract public class IllegalAccessErrorTest { + + // interface + private static String expectedErrorMessage1a_1 = + "class test.IAE1_B cannot access its superinterface test.IAE1_A " + + "(test.IAE1_B is in unnamed module of loader test.IAE_Loader1 @"; + private static String expectedErrorMessage1a_2 = + "; test.IAE1_A is in unnamed module of loader 'app')"; + private static String expectedErrorMessage1b_1 = + "class test.IAE1_B cannot access its superinterface test.IAE1_A " + + "(test.IAE1_B is in unnamed module of loader 'someCLName1' @"; + private static String expectedErrorMessage1b_2 = + "; test.IAE1_A is in unnamed module of loader 'app')"; + + // abstract class + private static String expectedErrorMessage2_1 = + "class test.IAE2_B cannot access its abstract superclass test.IAE2_A " + + "(test.IAE2_B is in unnamed module of loader 'someCLName2' @"; + private static String expectedErrorMessage2_2 = + "; test.IAE2_A is in unnamed module of loader 'app')"; + + // class + private static String expectedErrorMessage3_1 = + "class test.IAE3_B cannot access its superclass test.IAE3_A " + + "(test.IAE3_B is in unnamed module of loader 'someCLName3' @"; + private static String expectedErrorMessage3_2 = + "; test.IAE3_A is in unnamed module of loader 'app')"; + + public static void test123(String loaderName, + String expectedErrorMessage_1, + String expectedErrorMessage_2, + String testClass) throws Exception { + String[] classNames = { testClass }; + // Some classes under a new Loader. + ClassLoader l = new IAE_Loader1(loaderName, classNames); + + try { + l.loadClass(testClass); + throw new RuntimeException("Expected IllegalAccessError was not thrown."); + } catch (IllegalAccessError iae) { + String errorMsg = iae.getMessage(); + if (!(errorMsg.contains(expectedErrorMessage_1) && + errorMsg.contains(expectedErrorMessage_2))) { + System.out.println("Expected: " + expectedErrorMessage_1 + "@id " + expectedErrorMessage_2 +"\n" + + "but got: " + errorMsg); + throw new RuntimeException("Wrong error message of IllegalAccessError."); + } else { + System.out.println("Passed with message: " + errorMsg); + } + } + } + + // Generate a class file with the given class name. The class implements Runnable + // with a run method to invokestatic the given targetClass/targetMethod. + static byte[] iae4_generateRunner(String className, + String targetClass, + String targetMethod) throws Exception { + + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + + ClassWriter.COMPUTE_FRAMES); + cw.visit(V9, + ACC_PUBLIC + ACC_SUPER, + className.replace(".", "/"), + null, + "java/lang/Object", + new String[] { "java/lang/Runnable" }); + + // <init> + MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + + // run() + String tc = targetClass.replace(".", "/"); + mv = cw.visitMethod(ACC_PUBLIC, "run", "()V", null, null); + mv.visitMethodInsn(INVOKESTATIC, tc, targetMethod, "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + + cw.visitEnd(); + return cw.toByteArray(); + } + + // Private method that should raise IllegalAccessError when called. + private static void iae4_m() { } + + private static String expectedErrorMessage4 = + "class test.Runner4 tried to access private method test.IllegalAccessErrorTest.iae4_m()V " + + "(test.Runner4 and test.IllegalAccessErrorTest are in unnamed module of loader 'app')"; + + // Test according to java/lang/invoke/DefineClassTest.java + public static void test4_privateMethod() throws Exception { + final String THIS_PACKAGE = IllegalAccessErrorTest.class.getPackageName(); + final String THIS_CLASS = IllegalAccessErrorTest.class.getName(); + final String CLASS_NAME = THIS_PACKAGE + ".Runner4"; + Lookup lookup = lookup(); + + // private + byte[] classBytes = iae4_generateRunner(CLASS_NAME, THIS_CLASS, "iae4_m"); + Class<?> clazz = lookup.defineClass(classBytes); + Runnable r = (Runnable) clazz.getDeclaredConstructor().newInstance(); + try { + r.run(); + throw new RuntimeException("Expected IllegalAccessError was not thrown."); + } catch (IllegalAccessError exc) { + String errorMsg = exc.getMessage(); + if (!errorMsg.equals(expectedErrorMessage4)) { + System.out.println("Expected: " + expectedErrorMessage4 + "\n" + + "but got: " + errorMsg); + throw new RuntimeException("Wrong error message of IllegalAccessError."); + } + System.out.println("Passed with message: " + errorMsg); + } + } + + // Generate a class file with the given class name. The class implements Runnable + // with a run method to invokestatic the given targetClass/targetField. + static byte[] iae5_generateRunner(String className, + String targetClass, + String targetField) throws Exception { + + ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_MAXS + + ClassWriter.COMPUTE_FRAMES); + cw.visit(V9, + ACC_PUBLIC + ACC_SUPER, + className.replace(".", "/"), + null, + "java/lang/Object", + new String[] { "java/lang/Runnable" }); + + // <init> + MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", "()V", null, null); + mv.visitVarInsn(ALOAD, 0); + mv.visitMethodInsn(INVOKESPECIAL, "java/lang/Object", "<init>", "()V", false); + mv.visitInsn(RETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + + // run() + String tc = targetClass.replace(".", "/"); + mv = cw.visitMethod(ACC_PUBLIC, "run", "()V", null, null); + mv.visitFieldInsn(GETSTATIC, tc, targetField, "I"); + mv.visitInsn(RETURN); + mv.visitMaxs(0, 0); + mv.visitEnd(); + + cw.visitEnd(); + return cw.toByteArray(); + } + + // Private field that should raise IllegalAccessError when accessed. + private static int iae5_f = 77; + + private static String expectedErrorMessage5 = + "class test.Runner5 tried to access private field test.IllegalAccessErrorTest.iae5_f " + + "(test.Runner5 and test.IllegalAccessErrorTest are in unnamed module of loader 'app')"; + + // Test according to java/lang/invoke/DefineClassTest.java + public static void test5_privateField() throws Exception { + final String THIS_PACKAGE = IllegalAccessErrorTest.class.getPackageName(); + final String THIS_CLASS = IllegalAccessErrorTest.class.getName(); + final String CLASS_NAME = THIS_PACKAGE + ".Runner5"; + Lookup lookup = lookup(); + + // private + byte[] classBytes = iae5_generateRunner(CLASS_NAME, THIS_CLASS, "iae5_f"); + Class<?> clazz = lookup.defineClass(classBytes); + Runnable r = (Runnable) clazz.getDeclaredConstructor().newInstance(); + try { + r.run(); + throw new RuntimeException("Expected IllegalAccessError was not thrown."); + } catch (IllegalAccessError exc) { + String errorMsg = exc.getMessage(); + if (!errorMsg.equals(expectedErrorMessage5)) { + System.out.println("Expected: " + expectedErrorMessage5 + "\n" + + "but got: " + errorMsg); + throw new RuntimeException("Wrong error message of IllegalAccessError."); + } + System.out.println("Passed with message: " + errorMsg); + } + } + + private static String expectedErrorMessage6 = + "failed to access class test.IAE6_A from class test.IAE6_B " + + "(test.IAE6_A is in unnamed module of loader 'app'; test.IAE6_B is in unnamed module of loader 'test6_class_CL' @"; + + public static void test6_class() throws Exception { + ClassLoader base = IllegalAccessErrorTest.class.getClassLoader(); + IAE_Loader2 loader = new IAE_Loader2("test6_class_CL", base.getParent(), base, new String[0], + new String[] { IAE6_A.class.getName() }); + Class<?> cl = loader.loadClass(IAE6_B.class.getName()); + Method m = cl.getDeclaredMethod("create", new Class[0]); + m.setAccessible(true); + + try { + m.invoke(null, new Object[0]); + throw new RuntimeException("Expected IllegalAccessError was not thrown."); + } catch (InvocationTargetException e) { + IllegalAccessError iae = (IllegalAccessError) e.getCause(); + String errorMsg = iae.getMessage(); + if (!errorMsg.contains(expectedErrorMessage6)) { + System.out.println("Expected: " + expectedErrorMessage6 + "id)\n" + + "but got: " + errorMsg); + throw new RuntimeException("Wrong error message of IllegalAccessError."); + } + System.out.println("Passed with message: " + errorMsg); + } + } + + private static String expectedErrorMessage7_1 = + "class test.IAE78_B tried to access method test.IAE78_A.<init>()V " + + "(test.IAE78_B is in unnamed module of loader 'test7_method_CL' @"; + private static String expectedErrorMessage7_2 = + "; test.IAE78_A is in unnamed module of loader 'app')"; + + // Similar to test4. + public static void test7_method() throws Exception { + ClassLoader base = IllegalAccessErrorTest.class.getClassLoader(); + IAE_Loader2 loader = new IAE_Loader2("test7_method_CL", base.getParent(), base, new String[0], + new String[] {IAE78_A.class.getName()}); + Class<?> cl = loader.loadClass(IAE78_B.class.getName()); + Method m = cl.getDeclaredMethod("create", new Class[0]); + + try { + m.invoke(null, new Object[0]); + } catch (InvocationTargetException e) { + IllegalAccessError iae = (IllegalAccessError) e.getCause(); + String errorMsg = iae.getMessage(); + if (!(errorMsg.contains(expectedErrorMessage7_1) && + errorMsg.contains(expectedErrorMessage7_2))) { + System.out.println("Expected: " + expectedErrorMessage7_1 + "id" + expectedErrorMessage7_2 + "\n" + + "but got: " + errorMsg); + throw new RuntimeException("Wrong error message of IllegalAccessError."); + } + System.out.println("Passed with message: " + errorMsg); + } + } + + private static String expectedErrorMessage8_1 = + "class test.IAE78_B tried to access field test.IAE78_A.f " + + "(test.IAE78_B is in unnamed module of loader 'test8_field_CL' @"; + private static String expectedErrorMessage8_2 = + "; test.IAE78_A is in unnamed module of loader 'app')"; + + // Similar to test5. + public static void test8_field() throws Exception { + ClassLoader base = IllegalAccessErrorTest.class.getClassLoader(); + IAE_Loader2 loader = new IAE_Loader2("test8_field_CL", base.getParent(), base, new String[0], + new String[] { IAE78_A.class.getName() }); + Class<?> cl = loader.loadClass(IAE78_B.class.getName()); + Method m = cl.getDeclaredMethod("access", new Class[0]); + + try { + m.invoke(null, new Object[0]); + } + catch (InvocationTargetException e) { + IllegalAccessError iae = (IllegalAccessError) e.getCause(); + String errorMsg = iae.getMessage(); + if (!(errorMsg.contains(expectedErrorMessage8_1) && + errorMsg.contains(expectedErrorMessage8_2))) { + System.out.println("Expected: " + expectedErrorMessage8_1 + "id" + expectedErrorMessage8_2 + "\n" + + "but got: " + errorMsg); + throw new RuntimeException("Wrong error message of IllegalAccessError."); + } + System.out.println("Passed with message: " + errorMsg); + } + } + + public static void main(String[] args) throws Exception { + test123(null, expectedErrorMessage1a_1, expectedErrorMessage1a_2, "test.IAE1_B"); // interface + test123("someCLName1", expectedErrorMessage1b_1, expectedErrorMessage1b_2, "test.IAE1_B"); // interface + test123("someCLName2", expectedErrorMessage2_1, expectedErrorMessage2_2, "test.IAE2_B"); // abstract class + test123("someCLName3", expectedErrorMessage3_1, expectedErrorMessage3_2, "test.IAE3_B"); // class + test4_privateMethod(); + test5_privateField(); + test6_class(); + test7_method(); + test8_field(); + } +} + +// Class hierarchies for test1. +interface IAE1_A { + public IAE1_D gen(); +} + +class IAE1_B implements IAE1_A { + public IAE1_D gen() { + return null; + } +} + +abstract class IAE1_C { +} + +class IAE1_D extends IAE1_C { +} + + +// Class hierarchies for test2. +abstract class IAE2_A { + abstract public IAE2_D gen(); +} + +class IAE2_B extends IAE2_A { + public IAE2_D gen() { + return null; + } +} + +abstract class IAE2_C { +} + +class IAE2_D extends IAE2_C { +} + + +// Class hierarchies for test3. +class IAE3_A { + public IAE3_D gen() { + return null; + }; +} + +class IAE3_B extends IAE3_A { + public IAE3_D gen() { + return null; + } +} + +abstract class IAE3_C { +} + +class IAE3_D extends IAE3_C { +} + + +// Class hierarchies for test6. +class IAE6_A { + IAE6_A() { + // Nothing to do. + } +} + +class IAE6_B { + public static void create() { + new IAE6_A(); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IncompatibleClassChangeError/IncompatibleClassChangeErrorTest.java openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IncompatibleClassChangeError/IncompatibleClassChangeErrorTest.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/exceptionMsgs/IncompatibleClassChangeError/IncompatibleClassChangeErrorTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/exceptionMsgs/IncompatibleClassChangeError/IncompatibleClassChangeErrorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -212,7 +212,7 @@ } private static String expectedErrorMessage3 = - "Class test.ICC3_B can not implement test.ICC3_A, because it is not an interface"; + "class test.ICC3_B can not implement test.ICC3_A, because it is not an interface (test.ICC3_A is in unnamed module of loader 'app')"; public static void test3_implementsClass() throws Exception { try { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java openjdk-11-11~24/test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/jni/CalleeSavedRegisters/FPRegs.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,9 +21,13 @@ * questions. * */ -/* + +/** * @test * @bug 8067744 + * @comment Test uses custom launcher that starts VM in primordial thread. This is + * not possible on aix. + * @requires os.family != "aix" * @library /test/lib * @modules java.base/jdk.internal.misc * @run main/native FPRegs diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/jni/terminatedThread/libterminatedThread.c openjdk-11-11~24/test/hotspot/jtreg/runtime/jni/terminatedThread/libterminatedThread.c --- openjdk-11-11~19/test/hotspot/jtreg/runtime/jni/terminatedThread/libterminatedThread.c 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/jni/terminatedThread/libterminatedThread.c 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include <stdio.h> +#include <stdlib.h> + +#include <pthread.h> +#include <string.h> + +#include "jni.h" +#include "jni_util.h" + + +JavaVM* jvm; +jobject nativeThread; + +static void * thread_start(void* unused) { + JNIEnv *env; + jclass class_id; + jmethodID method_id; + int res; + + printf("Native thread is running and attaching as daemon ...\n"); + + res = (*jvm)->AttachCurrentThreadAsDaemon(jvm, (void **)&env, NULL); + if (res != JNI_OK) { + fprintf(stderr, "Test ERROR. Can't attach current thread: %d\n", res); + exit(1); + } + + class_id = (*env)->FindClass (env, "java/lang/Thread"); + if (class_id == NULL) { + fprintf(stderr, "Test ERROR. Can't load class Thread\n"); + exit(1); + } + + method_id = (*env)->GetStaticMethodID(env, class_id, "currentThread", + "()Ljava/lang/Thread;"); + if (method_id == NULL) { + fprintf(stderr, "Test ERROR. Can't find method currentThread\n"); + exit(1); + } + + nativeThread = (*env)->CallStaticObjectMethod(env, class_id, method_id, NULL); + + if ((*env)->ExceptionOccurred(env) != NULL) { + (*env)->ExceptionDescribe(env); + exit(1); + } + printf("Native thread terminating\n"); + + return NULL; +} + +JNIEXPORT jobject JNICALL +Java_TestTerminatedThread_createTerminatedThread +(JNIEnv *env, jclass cls) { + pthread_t thread; + int res = (*env)->GetJavaVM(env, &jvm); + if (res != JNI_OK) { + fprintf(stderr, "Test ERROR. Can't extract JavaVM: %d\n", res); + exit(1); + } + + if ((res = pthread_create(&thread, NULL, thread_start, NULL)) != 0) { + fprintf(stderr, "TEST ERROR: pthread_create failed: %s (%d)\n", strerror(res), res); + exit(1); + } + + if ((res = pthread_join(thread, NULL)) != 0) { + fprintf(stderr, "TEST ERROR: pthread_join failed: %s (%d)\n", strerror(res), res); + exit(1); + } + + return nativeThread; +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java openjdk-11-11~24/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/jni/terminatedThread/TestTerminatedThread.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.lang.management.*; + +/* + * @test + * @bug 8205878 8206954 + * @requires os.family != "windows" & os.family != "solaris" + * @summary Basic test of Thread and ThreadMXBean queries on a natively + * attached thread that has failed to detach before terminating. + * @comment The native code only supports POSIX so no windows testing; also + * we have to skip solaris as a terminating thread that fails to + * detach will hit an infinite loop due to TLS destructor issues - see + * comments in JDK-8156708 + * @run main/othervm/native TestTerminatedThread + */ + +public class TestTerminatedThread { + + static native Thread createTerminatedThread(); + + static { + System.loadLibrary("terminatedThread"); + } + + private static ThreadMXBean mbean = ManagementFactory.getThreadMXBean(); + + public static void main(String[] args) throws Throwable { + + Thread t = createTerminatedThread(); + + if (!t.isAlive()) + throw new Error("Thread is only supposed to terminate at native layer!"); + + // Now invoke the various functions on this thread to + // make sure the VM handles it okay. The focus is on + // functions with an underlying native OS implementation. + // Generally as long as we don't crash or throw unexpected + // exceptions then the test passes. In some cases we know exactly + // what a function should return and so can check that. + + System.out.println("Working with thread: " + t + + ", in state: " + t.getState()); + + System.out.println("Calling suspend ..."); + t.suspend(); + System.out.println("Calling resume ..."); + t.resume(); + System.out.println("Calling getStackTrace ..."); + StackTraceElement[] stack = t.getStackTrace(); + System.out.println(java.util.Arrays.toString(stack)); + if (stack.length != 0) + throw new Error("Terminated thread should have empty java stack trace"); + System.out.println("Calling setName(\"NewName\") ..."); + t.setName("NewName"); + System.out.println("Calling interrupt ..."); + t.interrupt(); + System.out.println("Calling stop ..."); + t.stop(); + + // Now the ThreadMXBean functions + + if (mbean.isThreadCpuTimeSupported() && + mbean.isThreadCpuTimeEnabled() ) { + System.out.println("Calling getThreadCpuTime ..."); + long t1 = mbean.getThreadCpuTime(t.getId()); + if (t1 != -1) { + throw new RuntimeException("Invalid ThreadCpuTime returned = " + + t1 + " expected = -1"); + } + System.out.println("Okay: getThreadCpuTime() reported -1 as expected"); + } else { + System.out.println("Skipping Thread CPU time test as it's not supported"); + } + + System.out.println("Calling getThreadUserTime ..."); + long t1 = mbean.getThreadUserTime(t.getId()); + if (t1 != -1) { + throw new RuntimeException("Invalid ThreadUserTime returned = " + + t1 + " expected = -1"); + } + System.out.println("Okay: getThreadUserTime() reported -1 as expected"); + + System.out.println("Calling getThreadInfo ..."); + ThreadInfo info = mbean.getThreadInfo(t.getId()); + System.out.println(info); + + System.out.println("Calling getThreadInfo with stack ..."); + info = mbean.getThreadInfo(t.getId(), Integer.MAX_VALUE); + System.out.println(info); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/CheckRead.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/CheckRead.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/CheckRead.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/CheckRead.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_CheckRead.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_CheckRead.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_CheckRead.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_CheckRead.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpQualOther.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpQualToM1.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_ExpUnqual.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_PkgNotExp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_Umod.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_Umod.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_Umod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_Umod.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/DiffCL_UmodUpkg.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExportAllUnnamed.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExportAllUnnamed.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExportAllUnnamed.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExportAllUnnamed.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualOther.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualOther.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualOther.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualOther.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualToM1.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualToM1.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualToM1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualToM1.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualToM1PrivateMethodIAE.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualToM1PrivateMethodIAE.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualToM1PrivateMethodIAE.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpQualToM1PrivateMethodIAE.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,120 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Test that if module m1x can read module m2x, AND package p2 in m2x is + * exported qualifiedly to m1x, then class p1.c1 in m1x can read p2.c2 in m2x. + * However, p1.c1 tries to access a private method within p2.c2, verify + * that the IAE message contains the correct loader and module names. + * @modules java.base/jdk.internal.misc + * @library /test/lib + * @compile p1/c1.jasm + * @compile p2/c2.jasm + * @compile myloaders/MySameClassLoader.java + * @run main/othervm -Xbootclasspath/a:. ExpQualToM1PrivateMethodIAE + */ + +import static jdk.test.lib.Asserts.*; + +import java.lang.module.Configuration; +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import myloaders.MySameClassLoader; + +public class ExpQualToM1PrivateMethodIAE { + + // Create a layer over the boot layer. + // Define modules within this layer to test access between + // publically defined classes within packages of those modules. + public void createLayerOnBoot() throws Throwable { + + // Define module: m1x + // Can read: java.base, m2x + // Packages: p1 + // Packages exported: p1 is exported unqualifiedly + ModuleDescriptor descriptor_m1x = + ModuleDescriptor.newModule("m1x") + .requires("java.base") + .requires("m2x") + .exports("p1") + .build(); + + // Define module: m2x + // Can read: java.base + // Packages: p2 + // Packages exported: p2 is exported qualifiedly to m1x + ModuleDescriptor descriptor_m2x = + ModuleDescriptor.newModule("m2x") + .requires("java.base") + .exports("p2", Set.of("m1x")) + .build(); + + // Set up a ModuleFinder containing all modules for this layer. + ModuleFinder finder = ModuleLibrary.of(descriptor_m1x, descriptor_m2x); + + // Resolves "m1x" + Configuration cf = ModuleLayer.boot() + .configuration() + .resolve(finder, ModuleFinder.of(), Set.of("m1x")); + + // map each module to the same class loader for this test + Map<String, ClassLoader> map = new HashMap<>(); + map.put("m1x", MySameClassLoader.loader1); + map.put("m2x", MySameClassLoader.loader1); + + // Create layer that contains m1x & m2x + ModuleLayer layer = ModuleLayer.boot().defineModules(cf, map::get); + + assertTrue(layer.findLoader("m1x") == MySameClassLoader.loader1); + assertTrue(layer.findLoader("m2x") == MySameClassLoader.loader1); + + // now use the same loader to load class p1.c1 + Class p1_c1_class = MySameClassLoader.loader1.loadClass("p1.c1"); + try { + p1_c1_class.newInstance(); + throw new RuntimeException("Test Failed, an IAE should be thrown since p2/c2's method2 is private"); + } catch (IllegalAccessError e) { + String message = e.getMessage(); + System.out.println(e.toString()); + // java.lang.IllegalAccessError: + // tried to access private method p2.c2.method2()V from class p1.c1 (p2.c2 is in module m2x of loader + // myloaders.MySameClassLoader @<id>; p1.c1 is in module m1x of loader myloaders.MySameClassLoader @<id>) + if (!message.contains("class p1.c1 tried to access private method p2.c2.method2()V " + + "(p1.c1 is in module m1x of loader myloaders.MySameClassLoader @") || + !message.contains("; p2.c2 is in module m2x of loader myloaders.MySameClassLoader @")) { + throw new RuntimeException("Test Failed, an IAE was thrown with the wrong message: " + e.toString()); + } + } catch (Throwable e) { + throw new RuntimeException("Test Failed, an IAE should be thrown since p2/c2's method2 is private"); + } + } + + public static void main(String args[]) throws Throwable { + ExpQualToM1PrivateMethodIAE test = new ExpQualToM1PrivateMethodIAE(); + test.createLayerOnBoot(); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpUnqual.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpUnqual.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpUnqual.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/ExpUnqual.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/p1/c1.jasm openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/p1/c1.jasm --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/p1/c1.jasm 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/p1/c1.jasm 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,41 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package p1; + +super public class c1 version 55:0 { + + public Method "<init>":"()V" + stack 2 locals 2 + { + aload_0; + invokespecial Method java/lang/Object."<init>":"()V"; + new class p2/c2; + dup; + invokespecial Method p2/c2."<init>":"()V"; + astore_1; + aload_1; + invokevirtual Method p2/c2.method2:"()V"; + return; + } +} // end Class c1 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/p2/c2.jasm openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/p2/c2.jasm --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/p2/c2.jasm 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/p2/c2.jasm 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,40 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package p2; + +super public class c2 version 55:0 { + public Method "<init>":"()V" + stack 1 locals 1 + { + aload_0; + invokespecial Method java/lang/Object."<init>":"()V"; + return; + } + + private Method method2:"()V" + stack 0 locals 1 + { + return; + } +} // end Class c2 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/PkgNotExp.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/PkgNotExp.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/PkgNotExp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/PkgNotExp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_ExpQualOther.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_ExpUnqual.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_PkgNotExp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_Umod.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_Umod.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_Umod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_Umod.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_UmodUpkg.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_UmodUpkg.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_UmodUpkg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodDiffCL_UmodUpkg.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_ExpQualOther.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_ExpQualOther.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_ExpQualOther.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_ExpQualOther.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_ExpUnqual.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_ExpUnqual.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_ExpUnqual.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_ExpUnqual.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_PkgNotExp.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_PkgNotExp.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_PkgNotExp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_PkgNotExp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_UmodUpkg.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_UmodUpkg.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_UmodUpkg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/Umod_UmodUpkg.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_ExpQualOther.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_NotExp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_Umod.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_Umod.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_Umod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkgDiffCL_Umod.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_ExpQualOther.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUPkg.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUPkg.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUPkg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUPkg.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_NotExp.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_NotExp.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_NotExp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_NotExp.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_Umod.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_Umod.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_Umod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/AccessCheck/UmodUpkg_Umod.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/CCE_module_msg.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/CCE_module_msg.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/CCE_module_msg.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/CCE_module_msg.java 2018-07-25 15:36:46.000000000 +0000 @@ -48,6 +48,7 @@ public static void main(String[] args) throws Throwable { // Should not display version invalidObjectToDerived(); + invalidOriginalInnerToDerived(); invalidTimeToDerived(); invalidHeadersToDerived(); // Should display version @@ -66,8 +67,25 @@ } throw new RuntimeException("ClassCastException wasn't thrown, test failed."); } catch (ClassCastException cce) { - System.out.println(cce.getMessage()); - if (!cce.getMessage().contains("java.base/java.lang.Object cannot be cast to Derived")) { + System.out.println(cce.toString()); + if (!cce.getMessage().contains("class java.lang.Object cannot be cast to class Derived (java.lang.Object is in module java.base of loader 'bootstrap'; Derived is in unnamed module of loader 'app')")) { + throw new RuntimeException("Wrong message: " + cce.getMessage()); + } + } + } + + public static void invalidOriginalInnerToDerived() { + OriginalInner instance = new OriginalInner(); + int left = 23; + int right = 42; + try { + for (int i = 0; i < 1; i += 1) { + left = ((Derived) (java.lang.Object)instance).method(left, right); + } + throw new RuntimeException("ClassCastException wasn't thrown, test failed."); + } catch (ClassCastException cce) { + System.out.println(cce.toString()); + if (!cce.getMessage().contains("class OriginalInner cannot be cast to class Derived (OriginalInner and Derived are in unnamed module of loader 'app')")) { throw new RuntimeException("Wrong message: " + cce.getMessage()); } } @@ -84,8 +102,8 @@ } throw new RuntimeException("ClassCastException wasn't thrown, test failed."); } catch (ClassCastException cce) { - System.out.println(cce.getMessage()); - if (!cce.getMessage().contains("java.sql/java.sql.Time cannot be cast to Derived")) { + System.out.println(cce.toString()); + if (!cce.getMessage().contains("class java.sql.Time cannot be cast to class Derived (java.sql.Time is in module java.sql of loader 'platform'; Derived is in unnamed module of loader 'app')")) { throw new RuntimeException("Wrong message: " + cce.getMessage()); } } @@ -102,8 +120,8 @@ } throw new RuntimeException("ClassCastException wasn't thrown, test failed."); } catch (ClassCastException cce) { - System.out.println(cce.getMessage()); - if (!cce.getMessage().contains("jdk.httpserver/com.sun.net.httpserver.Headers cannot be cast to Derived")) { + System.out.println(cce.toString()); + if (!cce.getMessage().contains("class com.sun.net.httpserver.Headers cannot be cast to class Derived (com.sun.net.httpserver.Headers is in module jdk.httpserver of loader 'platform'; Derived is in unnamed module of loader 'app')")) { throw new RuntimeException("Wrong message: " + cce.getMessage()); } } @@ -132,10 +150,9 @@ throw new RuntimeException("ClassCastException wasn't thrown, test failed."); } catch (ClassCastException cce) { String exception = cce.getMessage(); - System.out.println(exception); - if (exception.contains("module_two/p2.c2") || - !(exception.contains("module_two@") && - exception.contains("/p2.c2 cannot be cast to java.base/java.lang.String"))) { + System.out.println(cce.toString()); + if (!exception.contains("class p2.c2 cannot be cast to class java.lang.String (p2.c2 is in module module_two@") || + !exception.contains(" of loader 'app'; java.lang.String is in module java.base of loader 'bootstrap')")) { throw new RuntimeException("Wrong message: " + exception); } } @@ -160,14 +177,21 @@ throw new RuntimeException("ClassCastException wasn't thrown, test failed."); } catch (ClassCastException cce) { String exception = cce.getMessage(); - System.out.println(exception); - if (!exception.contains("MyClassLoader//p4.c4 cannot be cast to java.base/java.lang.String")) { + System.out.println(cce.toString()); + if (!exception.contains("class p4.c4 cannot be cast to class java.lang.String (p4.c4 is in unnamed module of loader 'MyClassLoader' @") || + !exception.contains("; java.lang.String is in module java.base of loader 'bootstrap')")) { throw new RuntimeException("Wrong message: " + exception); } } } } +class OriginalInner extends java.lang.Object { + public int method(int left, int right) { + return right; + } +} + class Derived extends java.lang.Object { public int method(int left, int right) { return right; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleNonBuiltinCLMain.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleSameCLMain.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleSameCLMain.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleSameCLMain.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleSameCLMain.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/modules/ModuleStress/ModuleStress.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,12 +1,10 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Source: NestmateAttributeHolder.java + +public class NestmateAttributeHolder { + public static class TwoNestHost { + } +} +*/ + +// NestHost attribute does not refer to a class + +class NestmateAttributeHolder$BadNestHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 "<init>"; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "NestmateAttributeHolder.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "NestmateAttributeHolder$BadNestHost"; // #13 + Utf8 "BadNestHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "NestmateAttributeHolder"; // #17 + } // Constant Pool + + 0x0021; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 2; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + 0x000A; // not a class index + } // end NestHost + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 9; + } + } // end InnerClasses + } // Attributes +} // end class NestmateAttributeHolder$BadNestHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestHostLength.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestHostLength.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestHostLength.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestHostLength.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Source: NestmateAttributeHolder.java + +public class NestmateAttributeHolder { + public static class BadNestHostLength { + } +} +*/ + +// Declare NestHost attribute as variable-length > 2 +class NestmateAttributeHolder$BadNestHostLength { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 "<init>"; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "NestmateAttributeHolder.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "NestmateAttributeHolder$BadNestHostLength"; // #13 + Utf8 "BadNestHostLength"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "NestmateAttributeHolder"; // #17 + } // Constant Pool + + 0x0021; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 2; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + [] { + #11 #11 #11 #11; + } + } // end NestHost + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 9; + } + } // end InnerClasses + } // Attributes +} // end class NestmateAttributeHolder$BadNestHostLength diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestMembersEntry.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestMembersEntry.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestMembersEntry.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestMembersEntry.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Source: NestmateAttributeHolder.java + +public class NestmateAttributeHolder { + public static class TwoNestHost { + } +} +*/ + +// NestMembers attribute refers to non-class entry + +class BadNestMembersEntry { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #14; // #1 + class #15; // #2 + class #16; // #3 + class #17; // #4 + Utf8 "TwoNestHost"; // #5 + Utf8 "InnerClasses"; // #6 + Utf8 "<init>"; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "BadNestMembersEntry.java"; // #12 + Utf8 "NestMembers"; // #13 + NameAndType #7 #8; // #14 + Utf8 "BadNestMembersEntry"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "BadNestMembersEntry$TwoNestHost"; // #17 + } // Constant Pool + + 0x0021; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 1; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestMembers + 0x00010009; // not a class index + } // end NestMembers + ; + Attr(#6) { // InnerClasses + [] { // InnerClasses + #4 #2 #5 9; + } + } // end InnerClasses + } // Attributes +} // end class BadNestMembersEntry diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestMembersLength.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestMembersLength.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestMembersLength.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/BadNestMembersLength.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Source: NestmateAttributeHolder.java + +public class NestmateAttributeHolder { + public static class TwoNestHost { + } +} +*/ + +// NestMembers attribute has wrong count for number of nestmates + +class BadNestMembersLength { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #14; // #1 + class #15; // #2 + class #16; // #3 + class #17; // #4 + Utf8 "TwoNestHost"; // #5 + Utf8 "InnerClasses"; // #6 + Utf8 "<init>"; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "BadNestMembersLength.java"; // #12 + Utf8 "NestMembers"; // #13 + NameAndType #7 #8; // #14 + Utf8 "BadNestMembersLength"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "BadNestMembersLength$TwoNestHost"; // #17 + } // Constant Pool + + 0x0021; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 1; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestMembers + 0x00000004; // bad length + } // end NestMembers + ; + Attr(#6) { // InnerClasses + [] { // InnerClasses + #4 #2 #5 9; + } + } // end InnerClasses + } // Attributes +} // end class BadNestMembersLength diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/ConflictingAttributesInNestHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/ConflictingAttributesInNestHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/ConflictingAttributesInNestHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/ConflictingAttributesInNestHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Source: NestmateAttributeHolder.java + +public class NestmateAttributeHolder { + public static class TwoNestHost { + } +} +*/ + +// Add NestHost attribute to nest-host class - conflicting attributes + +class ConflictingAttributesInNestHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #14; // #1 + class #15; // #2 + class #16; // #3 + class #17; // #4 + Utf8 "TwoNestHost"; // #5 + Utf8 "InnerClasses"; // #6 + Utf8 "<init>"; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "ConflictingAttributesInNestHost.java"; // #12 + Utf8 "NestMembers"; // #13 + NameAndType #7 #8; // #14 + Utf8 "ConflictingAttributesInNestHost"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "ConflictingAttributesInNestHost$TwoNestHost"; // #17 + Utf8 "NestHost"; // #18 + } // Constant Pool + + 0x0021; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 1; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestMembers + 0x00010004; + } // end NestMembers + ; + // conflict - can't be a member of a nest and have nest members + Attr(#18) { // NestHost + 0x0003; // #3 is Object + } // end NestHost + ; + Attr(#6) { // InnerClasses + [] { // InnerClasses + #4 #2 #5 9; + } + } // end InnerClasses + } // Attributes +} // end class ConflictingAttributesInNestHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/ConflictingAttributesInNestMember.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/ConflictingAttributesInNestMember.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/ConflictingAttributesInNestMember.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/ConflictingAttributesInNestMember.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Source: NestmateAttributeHolder.java + +public class NestmateAttributeHolder { + public static class TwoNestHost { + } +} +*/ + +class NestmateAttributeHolder$ConflictingAttributesInNestMember { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 "<init>"; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "NestmateAttributeHolder.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "NestmateAttributeHolder$ConflictingAttributesInNestMember"; // #13 + Utf8 "ConflictingAttributesInNestMember"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "NestmateAttributeHolder"; // #17 + Utf8 "NestMembers"; // #18 + } // Constant Pool + + 0x0021; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 2; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + 0x000B; + } // end NestHost + ; + // conflict: can't have nest members when you are a member of a nest + Attr(#18) { // NestMembers + 0x00010004; + } // end NestMembers + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 9; + } + } // end InnerClasses + } // Attributes +} // end class NestmateAttributeHolder$ConflictingAttributesInNestMember diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TestFinalMethodOverride.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TestFinalMethodOverride.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TestFinalMethodOverride.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TestFinalMethodOverride.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test nestmate checks are no longer used when check_final_method_override is executed during parsing + * @run main TestFinalMethodOverride + */ + +// The check_final_method_override function in ClassfileParser uses an +// accessability check to see if the subclass method overrides a same-named +// superclass method. This would result in a nestmate access check if the +// super class method is private, which in turn could lead to classloading +// and possibly exceptions and cause havoc in the classfile parsing process. +// To fix that we added a check for whether the super class method is private, +// and if so, we skip the override check as by definition you can't override +// a private method. +// +// This test simply sets up the case where a public subclass method has the +// same signature as a private superclass method - the case we now skip when +// doing check_final_method_override. The test should trivially complete +// normally. + +public class TestFinalMethodOverride { + + public static class Super { + private final void theMethod() {} + } + + public static class Inner extends Super { + // define our own theMethod + public void theMethod() {} + } + + public static void main(String[] args) { + Inner i = new Inner(); + } +} + diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TestNestmateAttributes.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TestNestmateAttributes.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TestNestmateAttributes.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TestNestmateAttributes.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,77 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test incorrect use of Nestmate related attributes + * @compile TwoNestHost.jcod + * TwoNestMembers.jcod + * ConflictingAttributesInNestHost.jcod + * ConflictingAttributesInNestMember.jcod + * BadNestMembersLength.jcod + * BadNestMembersEntry.jcod + * BadNestHost.jcod + * BadNestHostLength.jcod + * @run main TestNestmateAttributes + */ + +public class TestNestmateAttributes { + public static void main(String args[]) throws Throwable { + String[] badClasses = new String[] { + "NestmateAttributeHolder$TwoNestHost", + "NestmateAttributeHolder", + "ConflictingAttributesInNestHost", + "NestmateAttributeHolder$ConflictingAttributesInNestMember", + "BadNestMembersLength", + "BadNestMembersEntry", + "NestmateAttributeHolder$BadNestHost", + "NestmateAttributeHolder$BadNestHostLength", + }; + + String[] messages = new String[] { + "Multiple NestHost attributes in class file", + "Multiple NestMembers attributes in class file", + "Conflicting NestMembers and NestHost attributes", + "Conflicting NestHost and NestMembers attributes", + "Wrong NestMembers attribute length", + "Nest member class_info_index 9 has bad constant type", + "Nest-host class_info_index 10 has bad constant type", + "Wrong NestHost attribute length", + }; + + for (int i = 0; i < badClasses.length; i++ ) { + try { + Class c = Class.forName(badClasses[i]); + throw new Error("Missing ClassFormatError: " + messages[i]); + } + catch (ClassFormatError expected) { + if (!expected.getMessage().contains(messages[i])) + throw new Error("Wrong ClassFormatError message: \"" + + expected.getMessage() + "\" does not contain \"" + + messages[i] + "\""); + System.out.println("OK - got expected exception: " + expected); + } + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TwoNestHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TwoNestHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TwoNestHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TwoNestHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Source: NestmateAttributeHolder.java + +public class NestmateAttributeHolder { + public static class TwoNestHost { + } +} +*/ + +// Add second NestHost attribute - should fail parsing +class NestmateAttributeHolder$TwoNestHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 "<init>"; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "NestmateAttributeHolder.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "NestmateAttributeHolder$TwoNestHost"; // #13 + Utf8 "TwoNestHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "NestmateAttributeHolder"; // #17 + } // Constant Pool + + 0x0021; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 2; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + 0x000B; + } // end NestHost + ; + Attr(#10) { // NestHost + 0x000B; + } // end NestHost + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 9; + } + } // end InnerClasses + } // Attributes +} // end class NestmateAttributeHolder$TwoNestHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TwoNestMembers.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TwoNestMembers.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TwoNestMembers.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/classFileParsing/TwoNestMembers.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Source: NestmateAttributeHolder.java + +public class NestmateAttributeHolder { + public static class TwoNestHost { + } +} +*/ + +// Add second NestMembers attribute - should fail parsing + +class NestmateAttributeHolder { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #14; // #1 + class #15; // #2 + class #16; // #3 + class #17; // #4 + Utf8 "TwoNestHost"; // #5 + Utf8 "InnerClasses"; // #6 + Utf8 "<init>"; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "NestmateAttributeHolder.java"; // #12 + Utf8 "NestMembers"; // #13 + NameAndType #7 #8; // #14 + Utf8 "NestmateAttributeHolder"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "NestmateAttributeHolder$TwoNestHost"; // #17 + } // Constant Pool + + 0x0021; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 1; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestMembers + 0x00010004; + } // end NestMembers + ; + Attr(#13) { // NestMembers + 0x00010004; + } // end NestMembers + ; + Attr(#6) { // InnerClasses + [] { // InnerClasses + #4 #2 #5 9; + } + } // end InnerClasses + } // Attributes +} // end class NestmateAttributeHolder diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/legacy/TestPrivateLookup.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/legacy/TestPrivateLookup.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/legacy/TestPrivateLookup.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/legacy/TestPrivateLookup.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,108 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test that private Lookup works for both nestmate-enabled classes + * and legacy classes + * @compile TestPrivateLookup.java + * @run main TestPrivateLookup + * @compile -source 10 -target 10 TestPrivateLookup.java + * @run main TestPrivateLookup noNestmates + */ + +// Need the explicit first @compile above so that jtreg forces recompilation +// with latest version. Otherwise compile-on-demand sees the JDK 10 version +// and assumes it is up to date and then runs the test using that version - +// which fails. + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; + +public class TestPrivateLookup { + + static boolean compiledForNestmates; + + static class C { + static class D { + private void m() { } + } + + static void test() throws Throwable { + MethodType M_T = MethodType.methodType(void.class); + // Direct lookup from C + Lookup l = lookup(); + try { + MethodHandle mh = l.findVirtual(D.class, "m", M_T); + if (compiledForNestmates) { + System.out.println("Lookup of D.m from C succeeded as expected with nestmates"); + } + else { + throw new Error("Unexpected success when not compiled for nestmates!"); + } + } + catch (IllegalAccessException iae) { + if (!compiledForNestmates) { + System.out.println("Lookup of D.m from C failed as expected without nestmates"); + } + else { + throw new Error("Unexpected failure with nestmates", iae); + } + } + // switch lookup class to D + l = l.in(D.class); + try { + MethodHandle mh = l.findVirtual(D.class, "m", M_T); + System.out.println("Lookup of D.m from D succeeded as expected" + + " with" + (compiledForNestmates ? "" : "out") + + " nestmates"); + } + catch (IllegalAccessException iae) { + throw new Error("Lookup of D.m from D failed", iae); + } + } + } + + public static void main(String[] args) throws Throwable { + + // If there's no nesthost attribute A.getNestHost() == A + compiledForNestmates = C.D.class.getNestHost() == TestPrivateLookup.class; + // sanity check + boolean expectingNestmates = args.length == 0; + + if (compiledForNestmates && !expectingNestmates) { + throw new Error("Test is being run incorrectly: " + + "nestmates are being used but not expected"); + } + if (expectingNestmates && !compiledForNestmates) { + throw new Error("Test is being run incorrectly: " + + "nestmates are expected but not being used"); + } + System.out.println("Testing with" + (expectingNestmates ? "" : "out") + + " nestmates"); + + C.test(); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/libNestmatesJNI.c openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/libNestmatesJNI.c --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/libNestmatesJNI.c 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/libNestmatesJNI.c 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +#include <jni.h> + +// boolean flag for static versus non-static +#define STATIC 1 +#define NON_STATIC 0 + +// Helper methods to get class/method/field IDs + +static void getClassID(JNIEnv *env, + jstring defining_class_name, + jclass* clazz) { + const char* name = (*env)->GetStringUTFChars(env, defining_class_name, NULL); + if (name != NULL) { + *clazz = (*env)->FindClass(env, name); + (*env)->ReleaseStringUTFChars(env, defining_class_name, name); + } +} + +static void getClassAndMethodID(JNIEnv *env, + int is_static, + jstring defining_class_name, + jstring method_name, + const char* sig, + jmethodID* m_id, jclass* clazz) { + getClassID(env, defining_class_name, clazz); + if (*clazz != NULL) { + const char* name = (*env)->GetStringUTFChars(env, method_name, NULL); + if (name != NULL) { + if (is_static) { + *m_id = (*env)->GetStaticMethodID(env, *clazz, name, sig); + } else { + *m_id = (*env)->GetMethodID(env, *clazz, name, sig); + } + (*env)->ReleaseStringUTFChars(env, method_name, name); + } + } +} + +static void getClassAndFieldID(JNIEnv *env, + int is_static, + jstring defining_class_name, + jstring field_name, + const char* sig, + jfieldID* m_id, jclass* clazz) { + getClassID(env, defining_class_name, clazz); + if (*clazz != NULL) { + const char* name = (*env)->GetStringUTFChars(env, field_name, NULL); + if (name != NULL) { + if (is_static) { + *m_id = (*env)->GetStaticFieldID(env, *clazz, name, sig); + } else { + *m_id = (*env)->GetFieldID(env, *clazz, name, sig); + } + (*env)->ReleaseStringUTFChars(env, field_name, name); + } + } +} + +JNIEXPORT void JNICALL +Java_NestmatesJNI_callVoidVoid(JNIEnv *env, jclass unused, + jobject target, + jstring defining_class_name, + jstring method_name, + jboolean virtual) { + + // Lookup "void method_name()" in defining_class_name, and if it exists + // call target.method_name() using a virtual or non-virtual invocation + + jmethodID m_id = NULL; + jclass clazz = NULL; + getClassAndMethodID(env, NON_STATIC, defining_class_name, method_name, + "()V", &m_id, &clazz); + if (m_id != NULL && clazz != NULL) { + if (!virtual) { + (*env)->CallNonvirtualVoidMethod(env, target, clazz, m_id); + } else { + (*env)->CallVoidMethod(env, target, m_id); + } + } +} + +JNIEXPORT jobject JNICALL +Java_NestmatesJNI_callStringVoid(JNIEnv *env, jclass unused, + jobject target, + jstring defining_class_name, + jstring method_name, + jboolean virtual) { + + // Lookup "String method_name()" in defining_class_name, and if it exists + // call target.method_name() using a virtual or non-virtual invocation + + jmethodID m_id = NULL; + jclass clazz = NULL; + getClassAndMethodID(env, NON_STATIC, defining_class_name, method_name, + "()Ljava/lang/String;", &m_id, &clazz); + if (m_id != NULL && clazz != NULL) { + if (!virtual) { + return (*env)->CallNonvirtualObjectMethod(env, target, clazz, m_id); + } else { + return (*env)->CallObjectMethod(env, target, m_id); + } + } + return NULL; +} + +JNIEXPORT jobject JNICALL +Java_NestmatesJNI_newInstance0(JNIEnv *env, jclass unused, + jstring defining_class_name, + jstring method_name, + jstring sig, + jobject outerThis) { + + // Lookup the no-user-arg constructor in defining_class_name using sig, + // and use it to create an instance of the class, and return it. For + // inner classes we need an outerThis reference to pass to the constructor. + + jmethodID m_id = NULL; + jclass clazz = NULL; + const char* _sig = (*env)->GetStringUTFChars(env, sig, NULL); + getClassAndMethodID(env, NON_STATIC, defining_class_name, method_name, + _sig, &m_id, &clazz); + (*env)->ReleaseStringUTFChars(env, sig, _sig); + if (m_id != NULL && clazz != NULL) { + return (*env)->NewObject(env, clazz, m_id, outerThis); + } + return NULL; +} + +JNIEXPORT void JNICALL +Java_NestmatesJNI_callStaticVoidVoid(JNIEnv *env, jclass unused, + jstring defining_class_name, + jstring method_name) { + + // Lookup "static void method_name()" in defining_class_name, and if it exists + // invoke it. + + jmethodID m_id = NULL; + jclass clazz = NULL; + getClassAndMethodID(env, STATIC, defining_class_name, method_name, + "()V", &m_id, &clazz); + if (m_id != NULL && clazz != NULL) { + (*env)->CallStaticVoidMethod(env, clazz, m_id); + } +} + +JNIEXPORT jint JNICALL +Java_NestmatesJNI_getIntField(JNIEnv *env, jclass unused, + jobject target, + jstring defining_class_name, + jstring field_name) { + + // Lookup field field_name in defining_class_name, and if it exists + // return its value. + + jfieldID f_id = NULL; + jclass clazz = NULL; + getClassAndFieldID(env, NON_STATIC, defining_class_name, field_name, + "I", &f_id, &clazz); + if (f_id != NULL && clazz != NULL) { + return (*env)->GetIntField(env, target, f_id); + } + return -1; +} + +JNIEXPORT void JNICALL +Java_NestmatesJNI_setIntField(JNIEnv *env, jclass unused, + jobject target, + jstring defining_class_name, + jstring field_name, + jint newVal) { + + // Lookup field field_name in defining_class_name, and if it exists + // set it to newVal. + + jfieldID f_id = NULL; + jclass clazz = NULL; + getClassAndFieldID(env, NON_STATIC, defining_class_name, field_name, + "I", &f_id, &clazz); + if (f_id != NULL && clazz != NULL) { + (*env)->SetIntField(env, target, f_id, newVal); + } +} + +JNIEXPORT jint JNICALL +Java_NestmatesJNI_getStaticIntField(JNIEnv *env, jclass unused, + jstring defining_class_name, + jstring field_name) { + + // Lookup field field_name in defining_class_name, and if it exists + // return its value. + + jfieldID f_id = NULL; + jclass clazz = NULL; + getClassAndFieldID(env, STATIC, defining_class_name, field_name, + "I", &f_id, &clazz); + if (f_id != NULL && clazz != NULL) { + return (*env)->GetStaticIntField(env, clazz, f_id); + } + return -1; +} + +JNIEXPORT void JNICALL +Java_NestmatesJNI_setStaticIntField(JNIEnv *env, jclass unused, + jstring defining_class_name, + jstring field_name, + jint newVal) { + + // Lookup field field_name in defining_class_name, and if it exists + // set it to newVal. + + jfieldID f_id = NULL; + jclass clazz = NULL; + getClassAndFieldID(env, STATIC, defining_class_name, field_name, + "I", &f_id, &clazz); + if (f_id != NULL && clazz != NULL) { + (*env)->SetStaticIntField(env, clazz, f_id, newVal); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerMissingHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerMissingHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerMissingHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerMissingHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,396 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to non-existent class + +class TestNestmateMembership$CallerMissingHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Field #38 #39; // #1 + String #40; // #2 + Method #41 #42; // #3 + Method #9 #43; // #4 + Method #11 #43; // #5 + Method #16 #44; // #6 + String #45; // #7 + Field #15 #46; // #8 + class #47; // #9 + Method #9 #44; // #10 + class #50; // #11 + Method #11 #44; // #12 + Field #9 #52; // #13 + Field #11 #52; // #14 + class #53; // #15 + class #55; // #16 + Utf8 "msg"; // #17 + Utf8 "Ljava/lang/String;"; // #18 + Utf8 "f"; // #19 + Utf8 "I"; // #20 + Utf8 "m"; // #21 + Utf8 "()V"; // #22 + Utf8 "Code"; // #23 + Utf8 "LineNumberTable"; // #24 + Utf8 "invokeTarget"; // #25 + Utf8 "invokeTargetMissingHost"; // #26 + Utf8 "<init>"; // #27 + Utf8 "newTarget"; // #28 + Utf8 "newTargetMissingHost"; // #29 + Utf8 "getFieldTarget"; // #30 + Utf8 "getFieldTargetMissingHost"; // #31 + Utf8 "putFieldTarget"; // #32 + Utf8 "putFieldTargetMissingHost"; // #33 + Utf8 "SourceFile"; // #34 + Utf8 "TestNestmateMembership.java"; // #35 + Utf8 "NestHost"; // #36 + class #56; // #37 + class #57; // #38 + NameAndType #58 #59; // #39 + Utf8 "CallerMissingHost.m() - java version"; // #40 + class #60; // #41 + NameAndType #61 #62; // #42 + NameAndType #21 #22; // #43 + NameAndType #27 #22; // #44 + Utf8 "NoCallerMissingHost"; // #45 + NameAndType #17 #18; // #46 + Utf8 "TestNestmateMembership$Target"; // #47 + Utf8 "Target"; // #48 + Utf8 "InnerClasses"; // #49 + Utf8 "TestNestmateMembership$TargetMissingHost"; // #50 + Utf8 "TargetMissingHost"; // #51 + NameAndType #19 #20; // #52 + Utf8 "TestNestmateMembership$CallerMissingHost"; // #53 + Utf8 "CallerMissingHost"; // #54 + Utf8 "java/lang/Object"; // #55 + Utf8 "TestNestmateMembership"; // #56 + Utf8 "java/lang/System"; // #57 + Utf8 "out"; // #58 + Utf8 "Ljava/io/PrintStream;"; // #59 + Utf8 "java/io/PrintStream"; // #60 + Utf8 "println"; // #61 + Utf8 "(Ljava/lang/String;)V"; // #62 + class #45; // added - #63 + } // Constant Pool + + 0x0020; // access + #15;// this_cpx + #16;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x0000; // access + #17; // name_cpx + #18; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + ; + { // Member + 0x000A; // access + #19; // name_cpx + #20; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x000A; // access + #21; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200011202B60003; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 209; + 8 210; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #25; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80004B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 212; + 3 213; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #26; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80005B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 215; + 3 216; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #27; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB700062A1207B5; + 0x0008B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 220; + 4 204; + 10 220; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #28; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000959B7000A4B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 223; + 8 224; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #29; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000B59B7000C4B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 226; + 8 227; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #30; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000D3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 234; + 4 235; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #31; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000E3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 237; + 4 238; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #32; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000DB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 240; + 5 241; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #33; // name_cpx + #22; // sig_cpx + [] { // Attributes + Attr(#23) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000EB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#24) { // LineNumberTable + [] { // LineNumberTable + 0 243; + 5 244; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#34) { // SourceFile + #35; + } // end SourceFile + ; + Attr(#36) { // NestHost + 0x003F; // modified - #63 + } // end NestHost + ; + Attr(#49) { // InnerClasses + [] { // InnerClasses + #9 #37 #48 8; + #11 #37 #51 8; + #15 #37 #54 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$CallerMissingHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNoHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNoHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNoHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNoHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,374 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute deleted + +class TestNestmateMembership$CallerNoHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Field #34 #35; // #1 + String #36; // #2 + Method #37 #38; // #3 + Method #7 #39; // #4 + Method #9 #39; // #5 + Method #14 #40; // #6 + class #41; // #7 + Method #7 #40; // #8 + class #44; // #9 + Method #9 #40; // #10 + Field #7 #46; // #11 + Field #9 #46; // #12 + class #47; // #13 + class #49; // #14 + Utf8 "f"; // #15 + Utf8 "I"; // #16 + Utf8 "m"; // #17 + Utf8 "()V"; // #18 + Utf8 "Code"; // #19 + Utf8 "LineNumberTable"; // #20 + Utf8 "invokeTarget"; // #21 + Utf8 "invokeTargetNoHost"; // #22 + Utf8 "<init>"; // #23 + Utf8 "newTarget"; // #24 + Utf8 "newTargetNoHost"; // #25 + Utf8 "getFieldTarget"; // #26 + Utf8 "getFieldTargetNoHost"; // #27 + Utf8 "putFieldTarget"; // #28 + Utf8 "putFieldTargetNoHost"; // #29 + Utf8 "SourceFile"; // #30 + Utf8 "TestNestmateMembership.java"; // #31 + Utf8 "NestHost"; // #32 + class #50; // #33 + class #51; // #34 + NameAndType #52 #53; // #35 + Utf8 "CallerNoHost.m() - java version"; // #36 + class #54; // #37 + NameAndType #55 #56; // #38 + NameAndType #17 #18; // #39 + NameAndType #23 #18; // #40 + Utf8 "TestNestmateMembership$Target"; // #41 + Utf8 "Target"; // #42 + Utf8 "InnerClasses"; // #43 + Utf8 "TestNestmateMembership$TargetNoHost"; // #44 + Utf8 "TargetNoHost"; // #45 + NameAndType #15 #16; // #46 + Utf8 "TestNestmateMembership$CallerNoHost"; // #47 + Utf8 "CallerNoHost"; // #48 + Utf8 "java/lang/Object"; // #49 + Utf8 "TestNestmateMembership"; // #50 + Utf8 "java/lang/System"; // #51 + Utf8 "out"; // #52 + Utf8 "Ljava/io/PrintStream;"; // #53 + Utf8 "java/io/PrintStream"; // #54 + Utf8 "println"; // #55 + Utf8 "(Ljava/lang/String;)V"; // #56 + } // Constant Pool + + 0x0020; // access + #13;// this_cpx + #14;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x000A; // access + #15; // name_cpx + #16; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x000A; // access + #17; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200011202B60003; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 163; + 8 164; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #21; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80004B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 166; + 3 167; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #22; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80005B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 169; + 3 170; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #23; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70006B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 174; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #24; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000759B700084B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 177; + 8 178; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #25; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000959B7000A4B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 180; + 8 181; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #26; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000B3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 188; + 4 189; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #27; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000C3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 191; + 4 192; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #28; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 195; + 5 196; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #29; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000CB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 198; + 5 199; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#30) { // SourceFile + #31; + } // end SourceFile + ; + Attr(#43) { // InnerClasses + [] { // InnerClasses + #7 #33 #42 8; + #9 #33 #45 8; + #13 #33 #48 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$CallerNoHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNotInstanceHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNotInstanceHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNotInstanceHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNotInstanceHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,389 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to non-instance class + +class TestNestmateMembership$CallerNotInstanceHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Field #36 #37; // #1 + String #38; // #2 + Method #39 #40; // #3 + Method #7 #41; // #4 + Method #9 #41; // #5 + Method #14 #42; // #6 + class #43; // #7 + Method #7 #42; // #8 + class #46; // #9 + Method #9 #42; // #10 + Field #7 #48; // #11 + Field #9 #48; // #12 + class #49; // #13 + class #51; // #14 + Utf8 "oa"; // #15 + Utf8 "[LInvalidNestHost;"; // #16 + Utf8 "f"; // #17 + Utf8 "I"; // #18 + Utf8 "m"; // #19 + Utf8 "()V"; // #20 + Utf8 "Code"; // #21 + Utf8 "LineNumberTable"; // #22 + Utf8 "invokeTarget"; // #23 + Utf8 "invokeTargetNotInstanceHost"; // #24 + Utf8 "<init>"; // #25 + Utf8 "newTarget"; // #26 + Utf8 "newTargetNotInstanceHost"; // #27 + Utf8 "getFieldTarget"; // #28 + Utf8 "getFieldTargetNotInstanceHost"; // #29 + Utf8 "putFieldTarget"; // #30 + Utf8 "putFieldTargetNotInstanceHost"; // #31 + Utf8 "SourceFile"; // #32 + Utf8 "TestNestmateMembership.java"; // #33 + Utf8 "NestHost"; // #34 + class #52; // #35 + class #53; // #36 + NameAndType #54 #55; // #37 + Utf8 "CallerNotInstanceHost.m() - java version"; // #38 + class #56; // #39 + NameAndType #57 #58; // #40 + NameAndType #19 #20; // #41 + NameAndType #25 #20; // #42 + Utf8 "TestNestmateMembership$Target"; // #43 + Utf8 "Target"; // #44 + Utf8 "InnerClasses"; // #45 + Utf8 "TestNestmateMembership$TargetNotInstanceHost"; // #46 + Utf8 "TargetNotInstanceHost"; // #47 + NameAndType #17 #18; // #48 + Utf8 "TestNestmateMembership$CallerNotInstanceHost"; // #49 + Utf8 "CallerNotInstanceHost"; // #50 + Utf8 "java/lang/Object"; // #51 + Utf8 "TestNestmateMembership"; // #52 + Utf8 "java/lang/System"; // #53 + Utf8 "out"; // #54 + Utf8 "Ljava/io/PrintStream;"; // #55 + Utf8 "java/io/PrintStream"; // #56 + Utf8 "println"; // #57 + Utf8 "(Ljava/lang/String;)V"; // #58 + class #16; // Added - #59 + } // Constant Pool + + 0x0020; // access + #13;// this_cpx + #14;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x0000; // access + #15; // name_cpx + #16; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + ; + { // Member + 0x000A; // access + #17; // name_cpx + #18; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x000A; // access + #19; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200011202B60003; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 254; + 8 255; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #23; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80004B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 257; + 3 258; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #24; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80005B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 260; + 3 261; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #25; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70006B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 265; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #26; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000759B700084B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 268; + 8 269; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #27; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000959B7000A4B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 271; + 8 272; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #28; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000B3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 279; + 4 280; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #29; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000C3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 282; + 4 283; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #30; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 285; + 5 286; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #31; // name_cpx + #20; // sig_cpx + [] { // Attributes + Attr(#21) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000CB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#22) { // LineNumberTable + [] { // LineNumberTable + 0 288; + 5 289; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#32) { // SourceFile + #33; + } // end SourceFile + ; + Attr(#34) { // NestHost + 0x003B; // modified #59 + } // end NestHost + ; + Attr(#45) { // InnerClasses + [] { // InnerClasses + #7 #35 #44 8; + #9 #35 #47 8; + #13 #35 #50 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$CallerNotInstanceHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNotOurHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNotOurHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNotOurHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerNotOurHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,381 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to class with no nest + +class TestNestmateMembership$CallerNotOurHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Field #34 #35; // #1 + String #36; // #2 + Method #37 #38; // #3 + Method #7 #39; // #4 + Method #9 #39; // #5 + Method #14 #40; // #6 + class #41; // #7 + Method #7 #40; // #8 + class #44; // #9 + Method #9 #40; // #10 + Field #7 #46; // #11 + Field #9 #46; // #12 + class #47; // #13 + class #49; // #14 + Utf8 "f"; // #15 + Utf8 "I"; // #16 + Utf8 "m"; // #17 + Utf8 "()V"; // #18 + Utf8 "Code"; // #19 + Utf8 "LineNumberTable"; // #20 + Utf8 "invokeTarget"; // #21 + Utf8 "invokeTargetNotOurHost"; // #22 + Utf8 "<init>"; // #23 + Utf8 "newTarget"; // #24 + Utf8 "newTargetNotOurHost"; // #25 + Utf8 "getFieldTarget"; // #26 + Utf8 "getFieldTargetNotOurHost"; // #27 + Utf8 "putFieldTarget"; // #28 + Utf8 "putFieldTargetNotOurHost"; // #29 + Utf8 "SourceFile"; // #30 + Utf8 "TestNestmateMembership.java"; // #31 + Utf8 "NestHost"; // #32 + class #50; // #33 + class #51; // #34 + NameAndType #52 #53; // #35 + Utf8 "CallerNotOurHost.m() - java version"; // #36 + class #54; // #37 + NameAndType #55 #56; // #38 + NameAndType #17 #18; // #39 + NameAndType #23 #18; // #40 + Utf8 "TestNestmateMembership$Target"; // #41 + Utf8 "Target"; // #42 + Utf8 "InnerClasses"; // #43 + Utf8 "TestNestmateMembership$TargetNotOurHost"; // #44 + Utf8 "TargetNotOurHost"; // #45 + NameAndType #15 #16; // #46 + Utf8 "TestNestmateMembership$CallerNotOurHost"; // #47 + Utf8 "CallerNotOurHost"; // #48 + Utf8 "java/lang/Object"; // #49 + Utf8 "TestNestmateMembership"; // #50 + Utf8 "java/lang/System"; // #51 + Utf8 "out"; // #52 + Utf8 "Ljava/io/PrintStream;"; // #53 + Utf8 "java/io/PrintStream"; // #54 + Utf8 "println"; // #55 + Utf8 "(Ljava/lang/String;)V"; // #56 + // Added + Utf8 "InvalidNestHost"; // #57 + class #57; // #58 + } // Constant Pool + + 0x0020; // access + #13;// this_cpx + #14;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x000A; // access + #15; // name_cpx + #16; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x000A; // access + #17; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200011202B60003; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 297; + 8 298; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #21; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80004B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 300; + 3 301; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #22; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80005B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 303; + 3 304; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #23; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70006B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 308; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #24; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000759B700084B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 311; + 8 312; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #25; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000959B7000A4B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 314; + 8 315; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #26; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000B3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 322; + 4 323; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #27; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000C3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 325; + 4 326; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #28; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 328; + 5 329; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #29; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000CB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 331; + 5 332; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#30) { // SourceFile + #31; + } // end SourceFile + ; + Attr(#32) { // NestHost + 0x003A; // modified - #58 + } // end NestHost + ; + Attr(#43) { // InnerClasses + [] { // InnerClasses + #7 #33 #42 8; + #9 #33 #45 8; + #13 #33 #48 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$CallerNotOurHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerSelfHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerSelfHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/CallerSelfHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/CallerSelfHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,378 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// NestHost attribute refers to current class + +class TestNestmateMembership$CallerSelfHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Field #34 #35; // #1 + String #36; // #2 + Method #37 #38; // #3 + Method #7 #39; // #4 + Method #9 #39; // #5 + Method #14 #40; // #6 + class #41; // #7 + Method #7 #40; // #8 + class #44; // #9 + Method #9 #40; // #10 + Field #7 #46; // #11 + Field #9 #46; // #12 + class #47; // #13 + class #49; // #14 + Utf8 "f"; // #15 + Utf8 "I"; // #16 + Utf8 "m"; // #17 + Utf8 "()V"; // #18 + Utf8 "Code"; // #19 + Utf8 "LineNumberTable"; // #20 + Utf8 "invokeTarget"; // #21 + Utf8 "invokeTargetSelfHost"; // #22 + Utf8 "<init>"; // #23 + Utf8 "newTarget"; // #24 + Utf8 "newTargetSelfHost"; // #25 + Utf8 "getFieldTarget"; // #26 + Utf8 "getFieldTargetSelfHost"; // #27 + Utf8 "putFieldTarget"; // #28 + Utf8 "putFieldTargetSelfHost"; // #29 + Utf8 "SourceFile"; // #30 + Utf8 "TestNestmateMembership.java"; // #31 + Utf8 "NestHost"; // #32 + class #50; // #33 + class #51; // #34 + NameAndType #52 #53; // #35 + Utf8 "CallerSelfHost.m() - java version"; // #36 + class #54; // #37 + NameAndType #55 #56; // #38 + NameAndType #17 #18; // #39 + NameAndType #23 #18; // #40 + Utf8 "TestNestmateMembership$Target"; // #41 + Utf8 "Target"; // #42 + Utf8 "InnerClasses"; // #43 + Utf8 "TestNestmateMembership$TargetSelfHost"; // #44 + Utf8 "TargetSelfHost"; // #45 + NameAndType #15 #16; // #46 + Utf8 "TestNestmateMembership$CallerSelfHost"; // #47 + Utf8 "CallerSelfHost"; // #48 + Utf8 "java/lang/Object"; // #49 + Utf8 "TestNestmateMembership"; // #50 + Utf8 "java/lang/System"; // #51 + Utf8 "out"; // #52 + Utf8 "Ljava/io/PrintStream;"; // #53 + Utf8 "java/io/PrintStream"; // #54 + Utf8 "println"; // #55 + Utf8 "(Ljava/lang/String;)V"; // #56 + } // Constant Pool + + 0x0020; // access + #13;// this_cpx + #14;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x000A; // access + #15; // name_cpx + #16; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x000A; // access + #17; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200011202B60003; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 297; + 8 298; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #21; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80004B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 300; + 3 301; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #22; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80005B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 303; + 3 304; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #23; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70006B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 308; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #24; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000759B700084B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 311; + 8 312; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #25; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000959B7000A4B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 314; + 8 315; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #26; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000B3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 322; + 4 323; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #27; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB2000C3BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 325; + 4 326; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #28; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 328; + 5 329; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #29; // name_cpx + #18; // sig_cpx + [] { // Attributes + Attr(#19) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB3000CB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#20) { // LineNumberTable + [] { // LineNumberTable + 0 331; + 5 332; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#30) { // SourceFile + #31; + } // end SourceFile + ; + Attr(#32) { // NestHost + 0x000D; // modified - #13 + } // end NestHost + ; + Attr(#43) { // InnerClasses + [] { // InnerClasses + #7 #33 #42 8; + #9 #33 #45 8; + #13 #33 #48 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$CallerSelfHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/InvalidNestHost.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/InvalidNestHost.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/InvalidNestHost.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/InvalidNestHost.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Empty class to use as an invalid nest-host class, in the same package as + * the test classes. + */ +public class InvalidNestHost { +} + diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost2.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost2.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost2.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost2.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package P2; + +/* + * This is used to produce a jcod file in which we modify the + * NestHost attribute to claim that P2.PackagedNestHost.Member + * is a member of the nest of P1.PackagedNestHost. + */ +public class PackagedNestHost2 { + public static class Member { + // jcod file will change these to private + public Member() {} + public static int f; + public static void m() { + System.out.println("You should never see this!"); + } + + // Entry points for main test. + // These should fail at runtime as members will now be private + // and our nest-host won't resolve as it's in a different package. + + public static void doInvoke() { + P1.PackagedNestHost.Member.m(); + } + + public static void doConstruct() { + Object o = new P1.PackagedNestHost.Member(); + } + + public static void doGetField() { + int x = P1.PackagedNestHost.Member.f; + } + + public static void doPutField() { + P1.PackagedNestHost.Member.f = 42; + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost2Member.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost2Member.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost2Member.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost2Member.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,268 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute is modified to contain P1.PackagedNestHost +// Required members are declared private + +class P2/PackagedNestHost2$Member { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #10 #26; // #1 + Field #27 #28; // #2 + String #29; // #3 + Method #30 #31; // #4 + Method #6 #32; // #5 + class #34; // #6 + Method #6 #26; // #7 + Field #6 #37; // #8 + class #38; // #9 + class #39; // #10 + Utf8 "f"; // #11 + Utf8 "I"; // #12 + Utf8 "<init>"; // #13 + Utf8 "()V"; // #14 + Utf8 "Code"; // #15 + Utf8 "LineNumberTable"; // #16 + Utf8 "m"; // #17 + Utf8 "doInvoke"; // #18 + Utf8 "doConstruct"; // #19 + Utf8 "doGetField"; // #20 + Utf8 "doPutField"; // #21 + Utf8 "SourceFile"; // #22 + Utf8 "PackagedNestHost2.java"; // #23 + Utf8 "NestHost"; // #24 + class #40; // #25 + NameAndType #13 #14; // #26 + class #41; // #27 + NameAndType #42 #43; // #28 + Utf8 "You should never see this!"; // #29 + class #44; // #30 + NameAndType #45 #46; // #31 + NameAndType #17 #14; // #32 + class #47; // #33 + Utf8 "P1/PackagedNestHost$Member"; // #34 + Utf8 "Member"; // #35 + Utf8 "InnerClasses"; // #36 + NameAndType #11 #12; // #37 + Utf8 "P2/PackagedNestHost2$Member"; // #38 + Utf8 "java/lang/Object"; // #39 + Utf8 "P2/PackagedNestHost2"; // #40 + Utf8 "java/lang/System"; // #41 + Utf8 "out"; // #42 + Utf8 "Ljava/io/PrintStream;"; // #43 + Utf8 "java/io/PrintStream"; // #44 + Utf8 "println"; // #45 + Utf8 "(Ljava/lang/String;)V"; // #46 + Utf8 "P1/PackagedNestHost"; // #47 + } // Constant Pool + + 0x0021; // access + #9;// this_cpx + #10;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x000A; // access - modified + #11; // name_cpx + #12; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0002; // access - modified + #13; // name_cpx + #14; // sig_cpx + [] { // Attributes + Attr(#15) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#16) { // LineNumberTable + [] { // LineNumberTable + 0 34; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x000A; // access - modified + #17; // name_cpx + #14; // sig_cpx + [] { // Attributes + Attr(#15) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#16) { // LineNumberTable + [] { // LineNumberTable + 0 37; + 8 38; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #18; // name_cpx + #14; // sig_cpx + [] { // Attributes + Attr(#15) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80005B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#16) { // LineNumberTable + [] { // LineNumberTable + 0 45; + 3 46; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #19; // name_cpx + #14; // sig_cpx + [] { // Attributes + Attr(#15) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000659B700074B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#16) { // LineNumberTable + [] { // LineNumberTable + 0 49; + 8 50; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #20; // name_cpx + #14; // sig_cpx + [] { // Attributes + Attr(#15) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB200083BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#16) { // LineNumberTable + [] { // LineNumberTable + 0 53; + 4 54; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #21; // name_cpx + #14; // sig_cpx + [] { // Attributes + Attr(#15) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB30008B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#16) { // LineNumberTable + [] { // LineNumberTable + 0 57; + 5 58; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#22) { // SourceFile + #23; + } // end SourceFile + ; + Attr(#24) { // NestHost + 0x0021; // modified - #33 + } // end NestHost + ; + Attr(#36) { // InnerClasses + [] { // InnerClasses + #6 #33 #35 9; + #9 #25 #35 9; + } + } // end InnerClasses + } // Attributes +} // end class P2/PackagedNestHost2$Member diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package P1; + +/* + * This is used to produce a jcod file in which we modify the + * NestMembers attribute to claim that P2.PackagedNestHost.Member + * is a member of our nest. + */ +public class PackagedNestHost { + public static class Member { + // jcod file will change these to private + public Member() {} + public static int f; + public static void m() { + System.out.println("You should never see this!"); + } + } + + // Entry points for main test. + // These should fail at runtime as members will now be private + // and the nestmate access check should fail due to being in a + // different package. + + public static void doInvoke() { + P2.PackagedNestHost2.Member.m(); + } + + public static void doConstruct() { + Object o = new P2.PackagedNestHost2.Member(); + } + + public static void doGetField() { + int x = P2.PackagedNestHost2.Member.f; + } + + public static void doPutField() { + P2.PackagedNestHost2.Member.f = 42; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,220 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestMembers attribute is modified to contain P2.PackagedNestHost2.Member + +class P1/PackagedNestHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #7 #22; // #1 + Method #3 #23; // #2 + class #25; // #3 + Method #3 #22; // #4 + Field #3 #26; // #5 + class #27; // #6 + class #28; // #7 + class #29; // #8 + Utf8 "Member"; // #9 + Utf8 "InnerClasses"; // #10 + Utf8 "<init>"; // #11 + Utf8 "()V"; // #12 + Utf8 "Code"; // #13 + Utf8 "LineNumberTable"; // #14 + Utf8 "doInvoke"; // #15 + Utf8 "doConstruct"; // #16 + Utf8 "doGetField"; // #17 + Utf8 "doPutField"; // #18 + Utf8 "SourceFile"; // #19 + Utf8 "PackagedNestHost.java"; // #20 + Utf8 "NestMembers"; // #21 + NameAndType #11 #12; // #22 + NameAndType #30 #12; // #23 + class #31; // #24 + Utf8 "P2/PackagedNestHost2$Member"; // #25 + NameAndType #32 #33; // #26 + Utf8 "P1/PackagedNestHost"; // #27 + Utf8 "java/lang/Object"; // #28 + Utf8 "P1/PackagedNestHost$Member"; // #29 + Utf8 "m"; // #30 + Utf8 "P2/PackagedNestHost2"; // #31 + Utf8 "f"; // #32 + Utf8 "I"; // #33 + } // Constant Pool + + 0x0021; // access + #6;// this_cpx + #7;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #11; // name_cpx + #12; // sig_cpx + [] { // Attributes + Attr(#13) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#14) { // LineNumberTable + [] { // LineNumberTable + 0 31; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #15; // name_cpx + #12; // sig_cpx + [] { // Attributes + Attr(#13) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80002B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#14) { // LineNumberTable + [] { // LineNumberTable + 0 47; + 3 48; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #16; // name_cpx + #12; // sig_cpx + [] { // Attributes + Attr(#13) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xBB000359B700044B; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#14) { // LineNumberTable + [] { // LineNumberTable + 0 51; + 8 52; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #17; // name_cpx + #12; // sig_cpx + [] { // Attributes + Attr(#13) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0xB200053BB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#14) { // LineNumberTable + [] { // LineNumberTable + 0 55; + 4 56; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #18; // name_cpx + #12; // sig_cpx + [] { // Attributes + Attr(#13) { // Code + 1; // max_stack + 0; // max_locals + Bytes[]{ + 0x102AB30005B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#14) { // LineNumberTable + [] { // LineNumberTable + 0 59; + 5 60; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#19) { // SourceFile + #20; + } // end SourceFile + ; + Attr(#21) { // NestMembers + 0x00010003; // modified - #3 + } // end NestMembers + ; + Attr(#10) { // InnerClasses + [] { // InnerClasses + #8 #6 #9 9; + #3 #24 #9 9; + } + } // end InnerClasses + } // Attributes +} // end class P1/PackagedNestHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHostMember.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHostMember.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHostMember.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/PackagedNestHostMember.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,152 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// all members are declared private + +class P1/PackagedNestHost$Member { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #6 #18; // #1 + Field #19 #20; // #2 + String #21; // #3 + Method #22 #23; // #4 + class #24; // #5 + class #27; // #6 + Utf8 "f"; // #7 + Utf8 "I"; // #8 + Utf8 "<init>"; // #9 + Utf8 "()V"; // #10 + Utf8 "Code"; // #11 + Utf8 "LineNumberTable"; // #12 + Utf8 "m"; // #13 + Utf8 "SourceFile"; // #14 + Utf8 "PackagedNestHost.java"; // #15 + Utf8 "NestHost"; // #16 + class #28; // #17 + NameAndType #9 #10; // #18 + class #29; // #19 + NameAndType #30 #31; // #20 + Utf8 "You should never see this!"; // #21 + class #32; // #22 + NameAndType #33 #34; // #23 + Utf8 "P1/PackagedNestHost$Member"; // #24 + Utf8 "Member"; // #25 + Utf8 "InnerClasses"; // #26 + Utf8 "java/lang/Object"; // #27 + Utf8 "P1/PackagedNestHost"; // #28 + Utf8 "java/lang/System"; // #29 + Utf8 "out"; // #30 + Utf8 "Ljava/io/PrintStream;"; // #31 + Utf8 "java/io/PrintStream"; // #32 + Utf8 "println"; // #33 + Utf8 "(Ljava/lang/String;)V"; // #34 + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x000A; // access - modified + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0002; // access - modified + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#11) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#12) { // LineNumberTable + [] { // LineNumberTable + 0 34; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x000A; // access - modified + #13; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#11) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#12) { // LineNumberTable + [] { // LineNumberTable + 0 37; + 8 38; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#14) { // SourceFile + #15; + } // end SourceFile + ; + Attr(#16) { // NestHost + 0x0011; + } // end NestHost + ; + Attr(#26) { // InnerClasses + [] { // InnerClasses + #5 #17 #25 9; + } + } // end InnerClasses + } // Attributes +} // end class P1/PackagedNestHost$Member diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetMissingHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetMissingHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetMissingHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetMissingHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,170 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to non-existent class + +class TestNestmateMembership$TargetMissingHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #8 #22; // #1 + String #23; // #2 + Field #7 #24; // #3 + Field #25 #26; // #4 + String #27; // #5 + Method #28 #29; // #6 + class #30; // #7 + class #33; // #8 + Utf8 "msg"; // #9 + Utf8 "Ljava/lang/String;"; // #10 + Utf8 "f"; // #11 + Utf8 "I"; // #12 + Utf8 "<init>"; // #13 + Utf8 "()V"; // #14 + Utf8 "Code"; // #15 + Utf8 "LineNumberTable"; // #16 + Utf8 "m"; // #17 + Utf8 "SourceFile"; // #18 + Utf8 "TestNestmateMembership.java"; // #19 + Utf8 "NestHost"; // #20 + class #34; // #21 + NameAndType #13 #14; // #22 + Utf8 "NoTargetMissingHost"; // #23 + NameAndType #9 #10; // #24 + class #35; // #25 + NameAndType #36 #37; // #26 + Utf8 "TargetMissingHost.m() - java version"; // #27 + class #38; // #28 + NameAndType #39 #40; // #29 + Utf8 "TestNestmateMembership$TargetMissingHost"; // #30 + Utf8 "TargetMissingHost"; // #31 + Utf8 "InnerClasses"; // #32 + Utf8 "java/lang/Object"; // #33 + Utf8 "TestNestmateMembership"; // #34 + Utf8 "java/lang/System"; // #35 + Utf8 "out"; // #36 + Utf8 "Ljava/io/PrintStream;"; // #37 + Utf8 "java/io/PrintStream"; // #38 + Utf8 "println"; // #39 + Utf8 "(Ljava/lang/String;)V"; // #40 + class #23; // #41 - added + } // Constant Pool + + 0x0020; // access + #7;// this_cpx + #8;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x0000; // access + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + ; + { // Member + 0x000A; // access + #11; // name_cpx + #12; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0002; // access + #13; // name_cpx + #14; // sig_cpx + [] { // Attributes + Attr(#15) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB700012A1202B5; + 0x0003B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#16) { // LineNumberTable + [] { // LineNumberTable + 0 354; + 4 353; + 10 354; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x000A; // access + #17; // name_cpx + #14; // sig_cpx + [] { // Attributes + Attr(#15) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200041205B60006; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#16) { // LineNumberTable + [] { // LineNumberTable + 0 357; + 8 358; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#18) { // SourceFile + #19; + } // end SourceFile + ; + Attr(#20) { // NestHost + 0x0029; // modified #41 + } // end NestHost + ; + Attr(#32) { // InnerClasses + [] { // InnerClasses + #7 #21 #31 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$TargetMissingHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNoHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNoHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNoHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNoHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute deleted + +class TestNestmateMembership$TargetNoHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #6 #18; // #1 + Field #19 #20; // #2 + String #21; // #3 + Method #22 #23; // #4 + class #24; // #5 + class #27; // #6 + Utf8 "f"; // #7 + Utf8 "I"; // #8 + Utf8 "<init>"; // #9 + Utf8 "()V"; // #10 + Utf8 "Code"; // #11 + Utf8 "LineNumberTable"; // #12 + Utf8 "m"; // #13 + Utf8 "SourceFile"; // #14 + Utf8 "TestNestmateMembership.java"; // #15 + Utf8 "NestHost"; // #16 + class #28; // #17 + NameAndType #9 #10; // #18 + class #29; // #19 + NameAndType #30 #31; // #20 + Utf8 "TargetNoHost.m() - java version"; // #21 + class #32; // #22 + NameAndType #33 #34; // #23 + Utf8 "TestNestmateMembership$TargetNoHost"; // #24 + Utf8 "TargetNoHost"; // #25 + Utf8 "InnerClasses"; // #26 + Utf8 "java/lang/Object"; // #27 + Utf8 "TestNestmateMembership"; // #28 + Utf8 "java/lang/System"; // #29 + Utf8 "out"; // #30 + Utf8 "Ljava/io/PrintStream;"; // #31 + Utf8 "java/io/PrintStream"; // #32 + Utf8 "println"; // #33 + Utf8 "(Ljava/lang/String;)V"; // #34 + } // Constant Pool + + 0x0020; // access + #5;// this_cpx + #6;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x000A; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0002; // access + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#11) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#12) { // LineNumberTable + [] { // LineNumberTable + 0 345; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x000A; // access + #13; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#11) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#12) { // LineNumberTable + [] { // LineNumberTable + 0 348; + 8 349; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#14) { // SourceFile + #15; + } // end SourceFile + ; + Attr(#26) { // InnerClasses + [] { // InnerClasses + #5 #17 #25 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$TargetNoHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNotInstanceHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNotInstanceHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNotInstanceHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNotInstanceHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to non-instance class + +class TestNestmateMembership$TargetNotInstanceHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #6 #20; // #1 + Field #21 #22; // #2 + String #23; // #3 + Method #24 #25; // #4 + class #26; // #5 + class #29; // #6 + Utf8 "oa"; // #7 + Utf8 "[LInvalidNestHost;"; // #8 - modified + Utf8 "f"; // #9 + Utf8 "I"; // #10 + Utf8 "<init>"; // #11 + Utf8 "()V"; // #12 + Utf8 "Code"; // #13 + Utf8 "LineNumberTable"; // #14 + Utf8 "m"; // #15 + Utf8 "SourceFile"; // #16 + Utf8 "TestNestmateMembership.java"; // #17 + Utf8 "NestHost"; // #18 + class #30; // #19 + NameAndType #11 #12; // #20 + class #31; // #21 + NameAndType #32 #33; // #22 + Utf8 "TargetNotInstanceHost.m() - java version"; // #23 + class #34; // #24 + NameAndType #35 #36; // #25 + Utf8 "TestNestmateMembership$TargetNotInstanceHost"; // #26 + Utf8 "TargetNotInstanceHost"; // #27 + Utf8 "InnerClasses"; // #28 + Utf8 "java/lang/Object"; // #29 + Utf8 "TestNestmateMembership"; // #30 + Utf8 "java/lang/System"; // #31 + Utf8 "out"; // #32 + Utf8 "Ljava/io/PrintStream;"; // #33 + Utf8 "java/io/PrintStream"; // #34 + Utf8 "println"; // #35 + Utf8 "(Ljava/lang/String;)V"; // #36 + class #8; // #37 added + } // Constant Pool + + 0x0020; // access + #5;// this_cpx + #6;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x0000; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + ; + { // Member + 0x000A; // access + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0002; // access + #11; // name_cpx + #12; // sig_cpx + [] { // Attributes + Attr(#13) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#14) { // LineNumberTable + [] { // LineNumberTable + 0 363; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x000A; // access + #15; // name_cpx + #12; // sig_cpx + [] { // Attributes + Attr(#13) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#14) { // LineNumberTable + [] { // LineNumberTable + 0 366; + 8 367; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#16) { // SourceFile + #17; + } // end SourceFile + ; + Attr(#18) { // NestHost + 0x0025; // modified - #37 + } // end NestHost + ; + Attr(#28) { // InnerClasses + [] { // InnerClasses + #5 #19 #27 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$TargetNotInstanceHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNotOurHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNotOurHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNotOurHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetNotOurHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,155 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to class with no nest + +class TestNestmateMembership$TargetNotOurHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #6 #18; // #1 + Field #19 #20; // #2 + String #21; // #3 + Method #22 #23; // #4 + class #24; // #5 + class #27; // #6 + Utf8 "f"; // #7 + Utf8 "I"; // #8 + Utf8 "<init>"; // #9 + Utf8 "()V"; // #10 + Utf8 "Code"; // #11 + Utf8 "LineNumberTable"; // #12 + Utf8 "m"; // #13 + Utf8 "SourceFile"; // #14 + Utf8 "TestNestmateMembership.java"; // #15 + Utf8 "NestHost"; // #16 + class #28; // #17 + NameAndType #9 #10; // #18 + class #29; // #19 + NameAndType #30 #31; // #20 + Utf8 "TargetNotOurHost.m() - java version"; // #21 + class #32; // #22 + NameAndType #33 #34; // #23 + Utf8 "TestNestmateMembership$TargetNotOurHost"; // #24 + Utf8 "TargetNotOurHost"; // #25 + Utf8 "InnerClasses"; // #26 + Utf8 "java/lang/Object"; // #27 + Utf8 "TestNestmateMembership"; // #28 + Utf8 "java/lang/System"; // #29 + Utf8 "out"; // #30 + Utf8 "Ljava/io/PrintStream;"; // #31 + Utf8 "java/io/PrintStream"; // #32 + Utf8 "println"; // #33 + Utf8 "(Ljava/lang/String;)V"; // #34 + // Added + Utf8 "InvalidNestHost"; // #35 + class #35; // #36 + } // Constant Pool + + 0x0020; // access + #5;// this_cpx + #6;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x000A; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0002; // access + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#11) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#12) { // LineNumberTable + [] { // LineNumberTable + 0 371; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x000A; // access + #13; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#11) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#12) { // LineNumberTable + [] { // LineNumberTable + 0 374; + 8 375; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#14) { // SourceFile + #15; + } // end SourceFile + ; + Attr(#16) { // NestHost + 0x0024; // modified - #36 + } // end NestHost + ; + Attr(#26) { // InnerClasses + [] { // InnerClasses + #5 #17 #25 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$TargetNotOurHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetSelfHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetSelfHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TargetSelfHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TargetSelfHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,154 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// NestHost attribute refers to current class + +class TestNestmateMembership$TargetSelfHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #6 #18; // #1 + Field #19 #20; // #2 + String #21; // #3 + Method #22 #23; // #4 + class #24; // #5 + class #27; // #6 + Utf8 "f"; // #7 + Utf8 "I"; // #8 + Utf8 "<init>"; // #9 + Utf8 "()V"; // #10 + Utf8 "Code"; // #11 + Utf8 "LineNumberTable"; // #12 + Utf8 "m"; // #13 + Utf8 "SourceFile"; // #14 + Utf8 "TestNestmateMembership.java"; // #15 + Utf8 "NestHost"; // #16 + class #28; // #17 + NameAndType #9 #10; // #18 + class #29; // #19 + NameAndType #30 #31; // #20 + Utf8 "TargetSelfHost.m() - java version"; // #21 + class #32; // #22 + NameAndType #33 #34; // #23 + Utf8 "TestNestmateMembership$TargetSelfHost"; // #24 + Utf8 "TargetSelfHost"; // #25 + Utf8 "InnerClasses"; // #26 + Utf8 "java/lang/Object"; // #27 + Utf8 "TestNestmateMembership"; // #28 + Utf8 "java/lang/System"; // #29 + Utf8 "out"; // #30 + Utf8 "Ljava/io/PrintStream;"; // #31 + Utf8 "java/io/PrintStream"; // #32 + Utf8 "println"; // #33 + Utf8 "(Ljava/lang/String;)V"; // #34 + // Added + class #24; // #35 + } // Constant Pool + + 0x0020; // access + #5;// this_cpx + #6;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x000A; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0002; // access + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#11) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#12) { // LineNumberTable + [] { // LineNumberTable + 0 371; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x000A; // access + #13; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#11) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#12) { // LineNumberTable + [] { // LineNumberTable + 0 374; + 8 375; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#14) { // SourceFile + #15; + } // end SourceFile + ; + Attr(#16) { // NestHost + 0x0023; // modified - #35 + } // end NestHost + ; + Attr(#26) { // InnerClasses + [] { // InnerClasses + #5 #17 #25 8; + } + } // end InnerClasses + } // Attributes +} // end class TestNestmateMembership$TargetSelfHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TestNestmateMembership.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TestNestmateMembership.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/membership/TestNestmateMembership.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/membership/TestNestmateMembership.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1775 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test the various rules for nest members and nest-hosts by + * triggering nestmate access checks on all possible paths + * @compile TestNestmateMembership.java + * PackagedNestHost.java + * PackagedNestHost2.java + * InvalidNestHost.java + * + * @compile TargetNoHost.jcod + * CallerNoHost.jcod + * TargetSelfHost.jcod + * CallerSelfHost.jcod + * TargetMissingHost.jcod + * CallerMissingHost.jcod + * TargetNotInstanceHost.jcod + * CallerNotInstanceHost.jcod + * TargetNotOurHost.jcod + * CallerNotOurHost.jcod + * PackagedNestHost.jcod + * PackagedNestHost2Member.jcod + * PackagedNestHostMember.jcod + * + * @run main/othervm TestNestmateMembership method + * @run main/othervm TestNestmateMembership constructor + * @run main/othervm TestNestmateMembership getField + * @run main/othervm TestNestmateMembership putField + * @run main/othervm -Xcomp TestNestmateMembership getField + */ + +// We test all the "illegal" relationships between a nest member and its nest-host +// except for the case where the name of the nest-member matches the name listed +// in the nest-host, but resolves to a different class. There doesn't seem to +// be a way to construct that scenario. +// For each nested class below there is a corresponding .jcod file which breaks one +// of the rules regarding nest membership. For the package related tests we have +// additional PackageNestHost*.java sources.[1] +// +// Note that all the .java files must be compiled in the same step, while all +// .jcod files must be compiled in a later step. + +// We test all the different nestmate access check paths: method invocation, constructor +// invocations, field get and field put. The test is invoked four times with each using +// a different test mode. Plus an extra Xcomp run for field access to hit ciField path. +// +// As access checking requires resolution and validation of the nest-host of +// both the caller class and the target class, we must check that all +// combinations of good/bad caller/target are checked for each of the +// possible errors: +// - no nest-host attribute +// - nest-host refers to self +// - nest-host class can not be found +// - nest-host class is not an instance class (but is in same package) +// - class is not a member of nest-host's nest (but is in same package) +// - class and nest-host are in different packages +// +// To provide coverage for reflection and MethodHandle paths through +// JVM_AreNestmates, we add reflection/MH accesses to a subset of the tests. +// We only need to test one case (for Caller.xxx) as all cases use the same path; further +// we don't need to test all failure cases, as all exceptions are equivalent in that regard, +// but for good measure we test the four basic error situations (eliding the different +// package test for simplicity). +// +// [1] In earlier versions the package-test was the final check done in nest membership +// validation, so we needed actual test classes in different packages that claimed +// membership. The final spec requires the package test to be done first, so it can +// be trivially tested by using Object as the nest-host. But we leave the explicit +// package tests as they are, and adjust the other tests so that a "bad host" is +// always in the same package. + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; + +public class TestNestmateMembership { + + static final MethodType VOID_T = MethodType.methodType(void.class); + + static class Caller { + + private Caller() {} + + private static void m() { + System.out.println("Caller.m()"); + } + + // direct static method invocations + + public static void invokeTarget() { + Target.m(); + } + public static void invokeTargetNoHost() { + TargetNoHost.m(); + } + public static void invokeTargetSelfHost() { + TargetSelfHost.m(); + } + public static void invokeTargetMissingHost() { + TargetMissingHost.m(); + } + public static void invokeTargetNotInstanceHost() { + TargetNotInstanceHost.m(); + } + public static void invokeTargetNotOurHost() { + TargetNotOurHost.m(); + } + + // reflective static method invocations + + public static void invokeTargetNoHostReflectively() throws Throwable { + TargetNoHost.class.getDeclaredMethod("m", new Class<?>[0]).invoke(null, new Object[0]); + } + public static void invokeTargetSelfHostReflectively() throws Throwable { + TargetSelfHost.class.getDeclaredMethod("m", new Class<?>[0]).invoke(null, new Object[0]); + } + public static void invokeTargetMissingHostReflectively() throws Throwable { + TargetMissingHost.class.getDeclaredMethod("m", new Class<?>[0]).invoke(null, new Object[0]); + } + public static void invokeTargetNotInstanceHostReflectively() throws Throwable { + TargetNotInstanceHost.class.getDeclaredMethod("m", new Class<?>[0]).invoke(null, new Object[0]); + } + public static void invokeTargetNotOurHostReflectively() throws Throwable { + TargetNotOurHost.class.getDeclaredMethod("m", new Class<?>[0]).invoke(null, new Object[0]); + } + + // MethodHandle static method lookup (no invoke as the lookup should fail) + + public static void invokeTargetNoHostMH() throws Throwable { + MethodHandle mh = lookup().findStatic(TargetNoHost.class, "m", VOID_T); + } + public static void invokeTargetSelfHostMH() throws Throwable { + MethodHandle mh = lookup().findStatic(TargetSelfHost.class, "m", VOID_T); + } + public static void invokeTargetMissingHostMH() throws Throwable { + MethodHandle mh = lookup().findStatic(TargetMissingHost.class, "m", VOID_T); + } + public static void invokeTargetNotInstanceHostMH() throws Throwable { + MethodHandle mh = lookup().findStatic(TargetNotInstanceHost.class, "m", VOID_T); + } + public static void invokeTargetNotOurHostMH() throws Throwable { + MethodHandle mh = lookup().findStatic(TargetNotOurHost.class, "m", VOID_T); + } + + + // direct constructor invocations + + public static void newTarget() { + Object o = new Target(); + } + public static void newTargetNoHost() { + Object o = new TargetNoHost(); + } + public static void newTargetSelfHost() { + Object o = new TargetSelfHost(); + } + public static void newTargetMissingHost() { + Object o = new TargetMissingHost(); + } + public static void newTargetNotInstanceHost() { + Object o = new TargetNotInstanceHost(); + } + public static void newTargetNotOurHost() { + Object o = new TargetNotOurHost(); + } + + // reflective constructor invocations + + public static void newTargetNoHostReflectively() throws Throwable { + Object o = TargetNoHost.class.getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + public static void newTargetSelfHostReflectively() throws Throwable { + Object o = TargetSelfHost.class.getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + public static void newTargetMissingHostReflectively() throws Throwable { + Object o = TargetMissingHost.class.getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + public static void newTargetNotInstanceHostReflectively() throws Throwable { + Object o = TargetNotInstanceHost.class.getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + public static void newTargetNotOurHostReflectively() throws Throwable { + Object o = TargetNotOurHost.class.getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + + // MethodHandle constructor lookup (no invoke as the lookup should fail) + + public static void newTargetNoHostMH() throws Throwable { + MethodHandle mh = lookup().findConstructor(TargetNoHost.class, VOID_T); + } + public static void newTargetSelfHostMH() throws Throwable { + MethodHandle mh = lookup().findConstructor(TargetSelfHost.class, VOID_T); + } + public static void newTargetMissingHostMH() throws Throwable { + MethodHandle mh = lookup().findConstructor(TargetMissingHost.class, VOID_T); + } + public static void newTargetNotInstanceHostMH() throws Throwable { + MethodHandle mh = lookup().findConstructor(TargetNotInstanceHost.class, VOID_T); + } + public static void newTargetNotOurHostMH() throws Throwable { + MethodHandle mh = lookup().findConstructor(TargetNotOurHost.class, VOID_T); + } + + private static int f; + + // direct field accesses + + public static void getFieldTarget() { + int x = Target.f; + } + public static void getFieldTargetNoHost() { + int x = TargetNoHost.f; + } + public static void getFieldTargetSelfHost() { + int x = TargetSelfHost.f; + } + public static void getFieldTargetMissingHost() { + int x = TargetMissingHost.f; + } + public static void getFieldTargetNotInstanceHost() { + int x = TargetNotInstanceHost.f; + } + public static void getFieldTargetNotOurHost() { + int x = TargetNotOurHost.f; + } + + public static void putFieldTarget() { + Target.f = 42; + } + public static void putFieldTargetNoHost() { + TargetNoHost.f = 42; + } + public static void putFieldTargetSelfHost() { + TargetSelfHost.f = 42; + } + public static void putFieldTargetMissingHost() { + TargetMissingHost.f = 42; + } + public static void putFieldTargetNotInstanceHost() { + TargetNotInstanceHost.f = 42; + } + public static void putFieldTargetNotOurHost() { + TargetNotOurHost.f = 42; + } + + // reflective field accesses + + public static void getFieldTargetNoHostReflectively() throws Throwable { + int x = TargetNoHost.class.getDeclaredField("f").getInt(null); + } + public static void getFieldTargetSelfHostReflectively() throws Throwable { + int x = TargetSelfHost.class.getDeclaredField("f").getInt(null); + } + public static void getFieldTargetMissingHostReflectively() throws Throwable { + int x = TargetMissingHost.class.getDeclaredField("f").getInt(null); + } + public static void getFieldTargetNotInstanceHostReflectively() throws Throwable { + int x = TargetNotInstanceHost.class.getDeclaredField("f").getInt(null); + } + public static void getFieldTargetNotOurHostReflectively() throws Throwable { + int x = TargetNotOurHost.class.getDeclaredField("f").getInt(null); + } + + public static void putFieldTargetNoHostReflectively() throws Throwable { + TargetNoHost.class.getDeclaredField("f").setInt(null, 42); + } + public static void putFieldTargetSelfHostReflectively() throws Throwable { + TargetSelfHost.class.getDeclaredField("f").setInt(null, 42); + } + public static void putFieldTargetMissingHostReflectively() throws Throwable { + TargetMissingHost.class.getDeclaredField("f").setInt(null, 42); + } + public static void putFieldTargetNotInstanceHostReflectively() throws Throwable { + TargetNotInstanceHost.class.getDeclaredField("f").setInt(null, 42); + } + public static void putFieldTargetNotOurHostReflectively() throws Throwable { + TargetNotOurHost.class.getDeclaredField("f").setInt(null, 42); + } + + // MethodHandle field lookup (no access as the lookup will fail) + + public static void getFieldTargetNoHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticGetter(TargetNoHost.class, "f", int.class); + } + public static void getFieldTargetSelfHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticGetter(TargetSelfHost.class, "f", int.class); + } + public static void getFieldTargetMissingHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticGetter(TargetMissingHost.class, "f", int.class); + } + public static void getFieldTargetNotInstanceHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticGetter(TargetNotInstanceHost.class, "f", int.class); + } + public static void getFieldTargetNotOurHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticGetter(TargetNotOurHost.class, "f", int.class); + } + + public static void putFieldTargetNoHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticSetter(TargetNoHost.class, "f", int.class); + } + public static void putFieldTargetSelfHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticSetter(TargetSelfHost.class, "f", int.class); + } + public static void putFieldTargetMissingHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticSetter(TargetMissingHost.class, "f", int.class); + } + public static void putFieldTargetNotInstanceHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticSetter(TargetNotInstanceHost.class, "f", int.class); + } + public static void putFieldTargetNotOurHostMH() throws Throwable { + MethodHandle mh = lookup().findStaticSetter(TargetNotOurHost.class, "f", int.class); + } + + } + + static class CallerNoHost { + + // method invocations + + private static void m() { + System.out.println("CallerNoHost.m() - java version"); + } + public static void invokeTarget() { + Target.m(); + } + public static void invokeTargetNoHost() { + TargetNoHost.m(); + } + + // constructor invocations + + private CallerNoHost() {} + + public static void newTarget() { + Object o = new Target(); + } + public static void newTargetNoHost() { + Object o = new TargetNoHost(); + } + + // field accesses + + private static int f; + + public static void getFieldTarget() { + int x = Target.f; + } + public static void getFieldTargetNoHost() { + int x = TargetNoHost.f; + } + + public static void putFieldTarget() { + Target.f = 42; + } + public static void putFieldTargetNoHost() { + TargetNoHost.f = 42; + } + + } + + static class CallerSelfHost { + + // method invocations + + private static void m() { + System.out.println("CallerSelfHost.m() - java version"); + } + public static void invokeTarget() { + Target.m(); + } + public static void invokeTargetSelfHost() { + TargetSelfHost.m(); + } + + // constructor invocations + + private CallerSelfHost() {} + + public static void newTarget() { + Object o = new Target(); + } + public static void newTargetSelfHost() { + Object o = new TargetSelfHost(); + } + + // field accesses + + private static int f; + + public static void getFieldTarget() { + int x = Target.f; + } + public static void getFieldTargetSelfHost() { + int x = TargetSelfHost.f; + } + + public static void putFieldTarget() { + Target.f = 42; + } + public static void putFieldTargetSelfHost() { + TargetSelfHost.f = 42; + } + + } + + static class CallerMissingHost { + String msg = "NoCallerMissingHost"; // for cp entry + + // method invocations + + private static void m() { + System.out.println("CallerMissingHost.m() - java version"); + } + public static void invokeTarget() { + Target.m(); + } + public static void invokeTargetMissingHost() { + TargetMissingHost.m(); + } + + // constructor invocations + + private CallerMissingHost() {} + + public static void newTarget() { + Object o = new Target(); + } + public static void newTargetMissingHost() { + Object o = new TargetMissingHost(); + } + + // field accesses + + private static int f; + + public static void getFieldTarget() { + int x = Target.f; + } + public static void getFieldTargetMissingHost() { + int x = TargetMissingHost.f; + } + public static void putFieldTarget() { + Target.f = 42; + } + public static void putFieldTargetMissingHost() { + TargetMissingHost.f = 42; + } + + } + + static class CallerNotInstanceHost { + Object[] oa; // create CP entry to use in jcod change + + // method invocations + + private static void m() { + System.out.println("CallerNotInstanceHost.m() - java version"); + } + public static void invokeTarget() { + Target.m(); + } + public static void invokeTargetNotInstanceHost() { + TargetNotInstanceHost.m(); + } + + // constructor invocations + + private CallerNotInstanceHost() {} + + public static void newTarget() { + Object o = new Target(); + } + public static void newTargetNotInstanceHost() { + Object o = new TargetNotInstanceHost(); + } + + // field accesses + + private static int f; + + public static void getFieldTarget() { + int x = Target.f; + } + public static void getFieldTargetNotInstanceHost() { + int x = TargetNotInstanceHost.f; + } + public static void putFieldTarget() { + Target.f = 42; + } + public static void putFieldTargetNotInstanceHost() { + TargetNotInstanceHost.f = 42; + } + } + + static class CallerNotOurHost { + + // method invocations + + private static void m() { + System.out.println("CallerNotOurHost.m() - java version"); + } + public static void invokeTarget() { + Target.m(); + } + public static void invokeTargetNotOurHost() { + TargetNotOurHost.m(); + } + + // constructor invocations + + private CallerNotOurHost() {} + + public static void newTarget() { + Object o = new Target(); + } + public static void newTargetNotOurHost() { + Object o = new TargetNotOurHost(); + } + + // field accesses + + private static int f; + + public static void getFieldTarget() { + int x = Target.f; + } + public static void getFieldTargetNotOurHost() { + int x = TargetNotOurHost.f; + } + public static void putFieldTarget() { + Target.f = 42; + } + public static void putFieldTargetNotOurHost() { + TargetNotOurHost.f = 42; + } + + } + + static class Target { + private Target() {} + private static int f; + private static void m() { + System.out.println("Target.m()"); + } + } + + static class TargetNoHost { + private TargetNoHost() {} + private static int f; + private static void m() { + System.out.println("TargetNoHost.m() - java version"); + } + } + + static class TargetSelfHost { + private TargetSelfHost() {} + private static int f; + private static void m() { + System.out.println("TargetSelfHost.m() - java version"); + } + } + + static class TargetMissingHost { + String msg = "NoTargetMissingHost"; // for cp entry + private TargetMissingHost() {} + private static int f; + private static void m() { + System.out.println("TargetMissingHost.m() - java version"); + } + } + + static class TargetNotInstanceHost { + Object[] oa; // create CP entry to use in jcod change + private TargetNotInstanceHost() {} + private static int f; + private static void m() { + System.out.println("TargetNotInstanceHost.m() - java version"); + } + } + + static class TargetNotOurHost { + private TargetNotOurHost() {} + private static int f; + private static void m() { + System.out.println("TargetNotOurHost.m() - java version"); + } + } + + public static void main(String[] args) throws Throwable { + if (args.length < 1) { + throw new Error("Test mode argument must be one of: method, constructor, getField or putField"); + } + switch(args[0]) { + case "method": + System.out.println("TESTING METHOD INVOCATIONS:"); + test_GoodInvoke(); + test_NoHostInvoke(); + test_SelfHostInvoke(); + test_MissingHostInvoke(); + test_NotInstanceHostInvoke(); + test_NotOurHostInvoke(); + test_WrongPackageHostInvoke(); + break; + case "constructor": + System.out.println("TESTING CONSTRUCTOR INVOCATIONS:"); + test_GoodConstruct(); + test_NoHostConstruct(); + test_SelfHostConstruct(); + test_MissingHostConstruct(); + test_NotInstanceHostConstruct(); + test_NotOurHostConstruct(); + test_WrongPackageHostConstruct(); + break; + case "getField": + System.out.println("TESTING GETFIELD INVOCATIONS:"); + test_GoodGetField(); + test_NoHostGetField(); + test_SelfHostGetField(); + test_MissingHostGetField(); + test_NotInstanceHostGetField(); + test_NotOurHostGetField(); + test_WrongPackageHostGetField(); + break; + case "putField": + System.out.println("TESTING PUTFIELD INVOCATIONS:"); + test_GoodPutField(); + test_NoHostPutField(); + test_SelfHostPutField(); + test_MissingHostPutField(); + test_NotInstanceHostPutField(); + test_NotOurHostPutField(); + test_WrongPackageHostPutField(); + break; + default: + throw new Error("Uknown mode: " + args[0] + + ". Must be one of: method, constructor, getField or putField"); + } + } + + static void test_GoodInvoke(){ + try { + Caller.invokeTarget(); + } + catch (Exception e) { + throw new Error("Unexpected exception on good invocation " + e); + } + } + + static void test_NoHostInvoke() throws Throwable { + System.out.println("Testing for missing nest-host attribute"); + String msg = "class TestNestmateMembership$Caller tried to access " + + "private method TestNestmateMembership$TargetNoHost.m()V"; + try { + Caller.invokeTargetNoHost(); + throw new Error("Missing IllegalAccessError: " + msg); + } + catch (IllegalAccessError expected) { + check_expected(expected, msg); + } + msg = "TestNestmateMembership$Caller cannot access a member of class " + + "TestNestmateMembership$TargetNoHost with modifiers \"private static\""; + try { + Caller.invokeTargetNoHostReflectively(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + msg = "no such method: TestNestmateMembership$TargetNoHost.m()void/invokeStatic"; + try { + Caller.invokeTargetNoHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "class TestNestmateMembership$CallerNoHost tried to access " + + "private method TestNestmateMembership$Target.m()V"; + try { + CallerNoHost.invokeTarget(); + throw new Error("Missing IllegalAccessError: " + msg); + } + catch (IllegalAccessError expected) { + check_expected(expected, msg); + } + msg = "class TestNestmateMembership$CallerNoHost tried to access private " + + "method TestNestmateMembership$TargetNoHost.m()V"; + try { + CallerNoHost.invokeTargetNoHost(); + throw new Error("Missing IllegalAccessError: " + msg); + } + catch (IllegalAccessError expected) { + check_expected(expected, msg); + } + } + + static void test_SelfHostInvoke() throws Throwable { + System.out.println("Testing for class that lists itself as nest-host"); + String msg = "Type TestNestmateMembership$TargetSelfHost is not a nest member" + + " of TestNestmateMembership$TargetSelfHost: current type is not listed as a nest member"; + try { + Caller.invokeTargetSelfHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.invokeTargetSelfHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "no such method: TestNestmateMembership$TargetSelfHost.m()void/invokeStatic"; + try { + Caller.invokeTargetSelfHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerSelfHost is not a nest member" + + " of TestNestmateMembership$CallerSelfHost: current type is not listed as a nest member"; + try { + CallerSelfHost.invokeTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerSelfHost is not a nest member" + + " of TestNestmateMembership$CallerSelfHost: current type is not listed as a nest member"; + try { + CallerSelfHost.invokeTargetSelfHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_MissingHostInvoke() throws Throwable { + System.out.println("Testing for nest-host class that does not exist"); + String msg = "Unable to load nest-host class (NoTargetMissingHost) of " + + "TestNestmateMembership$TargetMissingHost"; + String cause_msg = "NoTargetMissingHost"; + try { + Caller.invokeTargetMissingHost(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + try { + Caller.invokeTargetMissingHostReflectively(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + msg = "no such method: TestNestmateMembership$TargetMissingHost.m()void/invokeStatic"; + try { + Caller.invokeTargetMissingHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + msg = "no such method: TestNestmateMembership$TargetMissingHost.m()void/invokeStatic"; + try { + Caller.invokeTargetMissingHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "Unable to load nest-host class (NoCallerMissingHost) of " + + "TestNestmateMembership$CallerMissingHost"; + cause_msg = "NoCallerMissingHost"; + try { + CallerMissingHost.invokeTarget(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + msg = "Unable to load nest-host class (NoCallerMissingHost) of "+ + "TestNestmateMembership$CallerMissingHost"; + cause_msg = "NoCallerMissingHost"; + try { + CallerMissingHost.invokeTargetMissingHost(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + } + + static void test_NotInstanceHostInvoke() throws Throwable { + System.out.println("Testing for nest-host class that is not an instance class"); + String msg = "Type TestNestmateMembership$TargetNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + Caller.invokeTargetNotInstanceHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.invokeTargetNotInstanceHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "no such method: TestNestmateMembership$TargetNotInstanceHost.m()void/invokeStatic"; + try { + Caller.invokeTargetNotInstanceHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + CallerNotInstanceHost.invokeTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + CallerNotInstanceHost.invokeTargetNotInstanceHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_NotOurHostInvoke() throws Throwable { + System.out.println("Testing for nest-host class that does not list us in its nest"); + String msg = "Type TestNestmateMembership$TargetNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + Caller.invokeTargetNotOurHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.invokeTargetNotOurHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "no such method: TestNestmateMembership$TargetNotOurHost.m()void/invokeStatic"; + try { + Caller.invokeTargetNotOurHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + CallerNotOurHost.invokeTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + CallerNotOurHost.invokeTargetNotOurHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_WrongPackageHostInvoke() { + System.out.println("Testing for nest-host and nest-member in different packages"); + String msg = "Type P2.PackagedNestHost2$Member is not a nest member of " + + "P1.PackagedNestHost: types are in different packages"; + try { + P1.PackagedNestHost.doInvoke(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + P2.PackagedNestHost2.Member.doInvoke(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + // constructor tests + + static void test_GoodConstruct(){ + try { + Caller.newTarget(); + } + catch (Exception e) { + throw new Error("Unexpected exception on good construction: " + e); + } + } + + static void test_NoHostConstruct() throws Throwable { + System.out.println("Testing for missing nest-host attribute"); + String msg = "class TestNestmateMembership$Caller tried to access private " + + "method TestNestmateMembership$TargetNoHost.<init>()V"; + try { + Caller.newTargetNoHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "class TestNestmateMembership$Caller cannot access a member of class " + + "TestNestmateMembership$TargetNoHost with modifiers \"private\""; + try { + Caller.newTargetNoHostReflectively(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + msg = "no such constructor: TestNestmateMembership$TargetNoHost.<init>()void/newInvokeSpecial"; + try { + Caller.newTargetNoHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "class TestNestmateMembership$CallerNoHost tried to access private " + + "method TestNestmateMembership$Target.<init>()V"; + try { + CallerNoHost.newTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "class TestNestmateMembership$CallerNoHost tried to access private " + + "method TestNestmateMembership$TargetNoHost.<init>()V"; + try { + CallerNoHost.newTargetNoHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_SelfHostConstruct() throws Throwable { + System.out.println("Testing for class that lists itself as nest-host"); + String msg = "Type TestNestmateMembership$TargetSelfHost is not a nest member" + + " of TestNestmateMembership$TargetSelfHost: current type is not listed as a nest member"; + try { + Caller.newTargetSelfHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.newTargetSelfHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "no such constructor: TestNestmateMembership$TargetSelfHost.<init>()void/newInvokeSpecial"; + try { + Caller.newTargetSelfHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerSelfHost is not a nest member" + + " of TestNestmateMembership$CallerSelfHost: current type is not listed as a nest member"; + try { + CallerSelfHost.newTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerSelfHost is not a nest member" + + " of TestNestmateMembership$CallerSelfHost: current type is not listed as a nest member"; + try { + CallerSelfHost.newTargetSelfHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_MissingHostConstruct() throws Throwable { + System.out.println("Testing for nest-host class that does not exist"); + String msg = "Unable to load nest-host class (NoTargetMissingHost) of " + + "TestNestmateMembership$TargetMissingHost"; + String cause_msg = "NoTargetMissingHost"; + try { + Caller.newTargetMissingHost(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + try { + Caller.newTargetMissingHostReflectively(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + msg = "no such constructor: TestNestmateMembership$TargetMissingHost.<init>()void/newInvokeSpecial"; + try { + Caller.newTargetMissingHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "Unable to load nest-host class (NoCallerMissingHost) of " + + "TestNestmateMembership$CallerMissingHost"; + cause_msg = "NoCallerMissingHost"; + try { + CallerMissingHost.newTarget(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + msg = "Unable to load nest-host class (NoCallerMissingHost) of "+ + "TestNestmateMembership$CallerMissingHost"; + cause_msg = "NoCallerMissingHost"; + try { + CallerMissingHost.newTargetMissingHost(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + } + + static void test_NotInstanceHostConstruct() throws Throwable { + System.out.println("Testing for nest-host class that is not an instance class"); + String msg = "Type TestNestmateMembership$TargetNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + Caller.newTargetNotInstanceHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.newTargetNotInstanceHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "no such constructor: TestNestmateMembership$TargetNotInstanceHost.<init>()void/newInvokeSpecial"; + try { + Caller.newTargetNotInstanceHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + CallerNotInstanceHost.newTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + CallerNotInstanceHost.newTargetNotInstanceHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_NotOurHostConstruct() throws Throwable { + System.out.println("Testing for nest-host class that does not list us in its nest"); + String msg = "Type TestNestmateMembership$TargetNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + Caller.newTargetNotOurHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.newTargetNotOurHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "no such constructor: TestNestmateMembership$TargetNotOurHost.<init>()void/newInvokeSpecial"; + try { + Caller.newTargetNotOurHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + CallerNotOurHost.newTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + CallerNotOurHost.newTargetNotOurHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_WrongPackageHostConstruct() { + System.out.println("Testing for nest-host and nest-member in different packages"); + String msg = "Type P2.PackagedNestHost2$Member is not a nest member of " + + "P1.PackagedNestHost: types are in different packages"; + try { + P1.PackagedNestHost.doConstruct(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + P2.PackagedNestHost2.Member.doConstruct(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + // field tests + + static void test_GoodGetField(){ + try { + Caller.getFieldTarget(); + } + catch (Exception e) { + throw new Error("Unexpected exception on good field access: " + e); + } + } + + static void test_NoHostGetField() throws Throwable { + System.out.println("Testing for missing nest-host attribute"); + String msg = "class TestNestmateMembership$Caller tried to access private " + + "field TestNestmateMembership$TargetNoHost.f"; + try { + Caller.getFieldTargetNoHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "class TestNestmateMembership$Caller cannot access a member of class " + + "TestNestmateMembership$TargetNoHost with modifiers \"private static\""; + try { + Caller.getFieldTargetNoHostReflectively(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + msg = "member is private: TestNestmateMembership$TargetNoHost.f/int/getStatic"; + try { + Caller.getFieldTargetNoHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "class TestNestmateMembership$CallerNoHost tried to access private " + + "field TestNestmateMembership$Target.f"; + try { + CallerNoHost.getFieldTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "class TestNestmateMembership$CallerNoHost tried to access private " + + "field TestNestmateMembership$TargetNoHost.f"; + try { + CallerNoHost.getFieldTargetNoHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_SelfHostGetField() throws Throwable { + System.out.println("Testing for class that lists itself as nest-host"); + String msg = "Type TestNestmateMembership$TargetSelfHost is not a nest member" + + " of TestNestmateMembership$TargetSelfHost: current type is not listed as a nest member"; + try { + Caller.getFieldTargetSelfHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.getFieldTargetSelfHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.getFieldTargetSelfHostMH(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerSelfHost is not a nest member" + + " of TestNestmateMembership$CallerSelfHost: current type is not listed as a nest member"; + try { + CallerSelfHost.getFieldTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerSelfHost is not a nest member" + + " of TestNestmateMembership$CallerSelfHost: current type is not listed as a nest member"; + try { + CallerSelfHost.getFieldTargetSelfHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_MissingHostGetField() throws Throwable { + System.out.println("Testing for nest-host class that does not exist"); + String msg = "Unable to load nest-host class (NoTargetMissingHost) of " + + "TestNestmateMembership$TargetMissingHost"; + String cause_msg = "NoTargetMissingHost"; + try { + Caller.getFieldTargetMissingHost(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + try { + Caller.getFieldTargetMissingHostReflectively(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + try { + Caller.getFieldTargetMissingHostMH(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + + msg = "Unable to load nest-host class (NoCallerMissingHost) of " + + "TestNestmateMembership$CallerMissingHost"; + cause_msg = "NoCallerMissingHost"; + try { + CallerMissingHost.getFieldTarget(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + msg = "Unable to load nest-host class (NoCallerMissingHost) of "+ + "TestNestmateMembership$CallerMissingHost"; + cause_msg = "NoCallerMissingHost"; + try { + CallerMissingHost.getFieldTargetMissingHost(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + } + + static void test_NotInstanceHostGetField() throws Throwable { + System.out.println("Testing for nest-host class that is not an instance class"); + String msg = "Type TestNestmateMembership$TargetNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + Caller.getFieldTargetNotInstanceHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.getFieldTargetNotInstanceHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.getFieldTargetNotInstanceHostMH(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + CallerNotInstanceHost.getFieldTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + CallerNotInstanceHost.getFieldTargetNotInstanceHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_NotOurHostGetField() throws Throwable { + System.out.println("Testing for nest-host class that does not list us in its nest"); + String msg = "Type TestNestmateMembership$TargetNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + Caller.getFieldTargetNotOurHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.getFieldTargetNotOurHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.getFieldTargetNotOurHostMH(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + CallerNotOurHost.getFieldTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + CallerNotOurHost.getFieldTargetNotOurHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_WrongPackageHostGetField() { + System.out.println("Testing for nest-host and nest-member in different packages"); + String msg = "Type P2.PackagedNestHost2$Member is not a nest member of " + + "P1.PackagedNestHost: types are in different packages"; + try { + P1.PackagedNestHost.doGetField(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + P2.PackagedNestHost2.Member.doGetField(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_GoodPutField(){ + try { + Caller.putFieldTarget(); + } + catch (Exception e) { + throw new Error("Unexpected exception on good field access: " + e); + } + } + + static void test_NoHostPutField() throws Throwable { + System.out.println("Testing for missing nest-host attribute"); + String msg = "class TestNestmateMembership$Caller tried to access private " + + "field TestNestmateMembership$TargetNoHost.f"; + try { + Caller.putFieldTargetNoHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "class TestNestmateMembership$Caller cannot access a member of class " + + "TestNestmateMembership$TargetNoHost with modifiers \"private static\""; + try { + Caller.putFieldTargetNoHostReflectively(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + msg = "member is private: TestNestmateMembership$TargetNoHost.f/int/putStatic"; + try { + Caller.putFieldTargetNoHostMH(); + throw new Error("Missing IllegalAccessException: " + msg); + } + catch (IllegalAccessException expected) { + check_expected(expected, msg); + } + + msg = "class TestNestmateMembership$CallerNoHost tried to access private " + + "field TestNestmateMembership$Target.f"; + try { + CallerNoHost.putFieldTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "class TestNestmateMembership$CallerNoHost tried to access private " + + "field TestNestmateMembership$TargetNoHost.f"; + try { + CallerNoHost.putFieldTargetNoHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_SelfHostPutField() throws Throwable { + System.out.println("Testing for class that lists itself as nest-host"); + String msg = "Type TestNestmateMembership$TargetSelfHost is not a nest member" + + " of TestNestmateMembership$TargetSelfHost: current type is not listed as a nest member"; + try { + Caller.putFieldTargetSelfHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.putFieldTargetSelfHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.putFieldTargetSelfHostMH(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerSelfHost is not a nest member" + + " of TestNestmateMembership$CallerSelfHost: current type is not listed as a nest member"; + try { + CallerSelfHost.putFieldTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerSelfHost is not a nest member" + + " of TestNestmateMembership$CallerSelfHost: current type is not listed as a nest member"; + try { + CallerSelfHost.putFieldTargetSelfHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_MissingHostPutField() throws Throwable { + System.out.println("Testing for nest-host class that does not exist"); + String msg = "Unable to load nest-host class (NoTargetMissingHost) of " + + "TestNestmateMembership$TargetMissingHost"; + String cause_msg = "NoTargetMissingHost"; + try { + Caller.putFieldTargetMissingHost(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + try { + Caller.putFieldTargetMissingHostReflectively(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + try { + Caller.putFieldTargetMissingHostMH(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + + msg = "Unable to load nest-host class (NoCallerMissingHost) of " + + "TestNestmateMembership$CallerMissingHost"; + cause_msg = "NoCallerMissingHost"; + try { + CallerMissingHost.putFieldTarget(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + msg = "Unable to load nest-host class (NoCallerMissingHost) of "+ + "TestNestmateMembership$CallerMissingHost"; + cause_msg = "NoCallerMissingHost"; + try { + CallerMissingHost.putFieldTargetMissingHost(); + throw new Error("Missing NoClassDefFoundError: " + msg); + } + catch (NoClassDefFoundError expected) { + check_expected(expected, msg, cause_msg); + } + } + + static void test_NotInstanceHostPutField() throws Throwable { + System.out.println("Testing for nest-host class that is not an instance class"); + String msg = "Type TestNestmateMembership$TargetNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + Caller.putFieldTargetNotInstanceHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.putFieldTargetNotInstanceHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.putFieldTargetNotInstanceHostMH(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + CallerNotInstanceHost.putFieldTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerNotInstanceHost is not a "+ + "nest member of [LInvalidNestHost;: current type is not listed as a nest member"; + try { + CallerNotInstanceHost.putFieldTargetNotInstanceHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_NotOurHostPutField() throws Throwable { + System.out.println("Testing for nest-host class that does not list us in its nest"); + String msg = "Type TestNestmateMembership$TargetNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + Caller.putFieldTargetNotOurHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.putFieldTargetNotOurHostReflectively(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + Caller.putFieldTargetNotOurHostMH(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + + msg = "Type TestNestmateMembership$CallerNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + CallerNotOurHost.putFieldTarget(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + msg = "Type TestNestmateMembership$CallerNotOurHost is not a nest member" + + " of InvalidNestHost: current type is not listed as a nest member"; + try { + CallerNotOurHost.putFieldTargetNotOurHost(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + static void test_WrongPackageHostPutField() { + System.out.println("Testing for nest-host and nest-member in different packages"); + String msg = "Type P2.PackagedNestHost2$Member is not a nest member of " + + "P1.PackagedNestHost: types are in different packages"; + try { + P1.PackagedNestHost.doPutField(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + try { + P2.PackagedNestHost2.Member.doPutField(); + throw new Error("Missing IncompatibleClassChangeError: " + msg); + } + catch (IncompatibleClassChangeError expected) { + check_expected(expected, msg); + } + } + + // utilities + + static void check_expected(Throwable expected, String msg) { + if (!expected.getMessage().contains(msg)) { + throw new Error("Wrong " + expected.getClass().getSimpleName() +": \"" + + expected.getMessage() + "\" does not contain \"" + + msg + "\""); + } + System.out.println("OK - got expected exception: " + expected); + } + + static void check_expected(Throwable expected, String msg, String cause_msg) { + if (!expected.getMessage().contains(msg)) { + throw new Error("Wrong " + expected.getClass().getSimpleName() +": \"" + + expected.getMessage() + "\" does not contain \"" + + msg + "\""); + } + Throwable cause = expected.getCause(); + if (cause instanceof NoClassDefFoundError) { + if (!cause.getMessage().contains(cause_msg)) { + throw new Error(expected.getClass().getSimpleName() + + " has wrong cause " + cause.getClass().getSimpleName() +": \"" + + cause.getMessage() + "\" does not contain \"" + + cause_msg + "\""); + } + } + else throw new Error(expected.getClass().getSimpleName() + + " has wrong cause " + cause.getClass().getSimpleName()); + + System.out.println("OK - got expected exception: " + expected + + " with cause " + cause); + } + +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PA_I.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PA_I.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PA_I.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PA_I.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,140 @@ + +// rename m -> bad_m; real_m -> m + +class TestInterfaceMethodSelection$PA_I { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #5 #18; // #1 + String #19; // #2 + String #20; // #3 + class #21; // #4 + class #24; // #5 + class #25; // #6 + Utf8 "<init>"; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "m"; // #11 MODIFIED + Utf8 "()Ljava/lang/String;"; // #12 + Utf8 "bad_m"; // #13 MODIFIED + Utf8 "SourceFile"; // #14 + Utf8 "TestInterfaceMethodSelection.java"; // #15 + Utf8 "NestHost"; // #16 + class #27; // #17 + NameAndType #7 #8; // #18 + Utf8 "PA_I::m"; // #19 + Utf8 "Should not see this"; // #20 + Utf8 "TestInterfaceMethodSelection$PA_I"; // #21 + Utf8 "PA_I"; // #22 + Utf8 "InnerClasses"; // #23 + Utf8 "java/lang/Object"; // #24 + Utf8 "TestInterfaceMethodSelection$I"; // #25 + Utf8 "I"; // #26 + Utf8 "TestInterfaceMethodSelection"; // #27 + } // Constant Pool + + 0x0020; // access + #4;// this_cpx + #5;// super_cpx + + [] { // Interfaces + #6; + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 113; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #11; // name_cpx + #12; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1202B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 114; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0001; // access + #13; // name_cpx + #12; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1203B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 115; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#14) { // SourceFile + #15; + } // end SourceFile + ; + Attr(#16) { // NestHost + 0x0011; + } // end NestHost + ; + Attr(#23) { // InnerClasses + [] { // InnerClasses + #4 #17 #22 8; + #6 #17 #26 1544; + } + } // end InnerClasses + } // Attributes +} // end class TestInterfaceMethodSelection$PA_I diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A_I.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A_I.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A_I.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A_I.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,109 @@ +// m() is declared private + +class TestInterfaceMethodSelection$PB_A_I { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #4 #15; // #1 + String #16; // #2 + class #17; // #3 + class #20; // #4 + Utf8 "<init>"; // #5 + Utf8 "()V"; // #6 + Utf8 "Code"; // #7 + Utf8 "LineNumberTable"; // #8 + Utf8 "m"; // #9 + Utf8 "()Ljava/lang/String;"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "TestInterfaceMethodSelection.java"; // #12 + Utf8 "NestHost"; // #13 + class #22; // #14 + NameAndType #5 #6; // #15 + Utf8 "PB_A_I::m"; // #16 + Utf8 "TestInterfaceMethodSelection$PB_A_I"; // #17 + Utf8 "PB_A_I"; // #18 + Utf8 "InnerClasses"; // #19 + Utf8 "TestInterfaceMethodSelection$A_I"; // #20 + Utf8 "A_I"; // #21 + Utf8 "TestInterfaceMethodSelection"; // #22 + } // Constant Pool + + 0x0020; // access + #3;// this_cpx + #4;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #5; // name_cpx + #6; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 125; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access - modified + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1202B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 126; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestHost + 0x000E; + } // end NestHost + ; + Attr(#19) { // InnerClasses + [] { // InnerClasses + #3 #14 #18 8; + #4 #14 #21 8; + } + } // end InnerClasses + } // Attributes +} // end class TestInterfaceMethodSelection$PB_A_I diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// m() is declared private + +class TestMethodSelection$PB_A { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #4 #15; // #1 + String #16; // #2 + class #17; // #3 + class #20; // #4 + Utf8 "<init>"; // #5 + Utf8 "()V"; // #6 + Utf8 "Code"; // #7 + Utf8 "LineNumberTable"; // #8 + Utf8 "m"; // #9 + Utf8 "()Ljava/lang/String;"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "TestMethodSelection.java"; // #12 + Utf8 "NestHost"; // #13 + class #22; // #14 + NameAndType #5 #6; // #15 + Utf8 "PB_A::m"; // #16 + Utf8 "TestMethodSelection$PB_A"; // #17 + Utf8 "PB_A"; // #18 + Utf8 "InnerClasses"; // #19 + Utf8 "TestMethodSelection$A"; // #20 + Utf8 "A"; // #21 + Utf8 "TestMethodSelection"; // #22 + } // Constant Pool + + 0x0021; // access + #3;// this_cpx + #4;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #5; // name_cpx + #6; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 119; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access - modified + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1202B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 120; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestHost + 0x000E; + } // end NestHost + ; + Attr(#19) { // InnerClasses + [] { // InnerClasses + #3 #14 #18 9; + #4 #14 #21 9; + } + } // end InnerClasses + } // Attributes +} // end class TestMethodSelection$PB_A diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A_PI.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A_PI.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A_PI.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_A_PI.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,108 @@ +// m() is declared private + +class TestInterfaceMethodSelection$PB_A_PI { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #4 #15; // #1 + String #16; // #2 + class #17; // #3 + class #19; // #4 + Utf8 "<init>"; // #5 + Utf8 "()V"; // #6 + Utf8 "Code"; // #7 + Utf8 "LineNumberTable"; // #8 + Utf8 "m"; // #9 + Utf8 "()Ljava/lang/String;"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "TestInterfaceMethodSelection.java"; // #12 + Utf8 "NestHost"; // #13 + class #21; // #14 + NameAndType #5 #6; // #15 + Utf8 "PB_A_PI"; // #16 + Utf8 "TestInterfaceMethodSelection$PB_A_PI"; // #17 + Utf8 "InnerClasses"; // #18 + Utf8 "TestInterfaceMethodSelection$A_PI"; // #19 + Utf8 "A_PI"; // #20 + Utf8 "TestInterfaceMethodSelection"; // #21 + } // Constant Pool + + 0x0020; // access + #3;// this_cpx + #4;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #5; // name_cpx + #6; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 140; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access - modified + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1202B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 141; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestHost + 0x000E; + } // end NestHost + ; + Attr(#18) { // InnerClasses + [] { // InnerClasses + #3 #14 #16 8; + #4 #14 #20 8; + } + } // end InnerClasses + } // Attributes +} // end class TestInterfaceMethodSelection$PB_A_PI diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_PA_I.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_PA_I.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_PA_I.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PB_PA_I.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,135 @@ +// rename m -> bad_m; real_m -> m + +class TestInterfaceMethodSelection$PB_PA_I { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #5 #17; // #1 + String #18; // #2 + String #19; // #3 + class #20; // #4 + class #22; // #5 + Utf8 "<init>"; // #6 + Utf8 "()V"; // #7 + Utf8 "Code"; // #8 + Utf8 "LineNumberTable"; // #9 + Utf8 "bad_m"; // #10 - modified + Utf8 "()Ljava/lang/String;"; // #11 + Utf8 "m"; // #12 - modified + Utf8 "SourceFile"; // #13 + Utf8 "TestInterfaceMethodSelection.java"; // #14 + Utf8 "NestHost"; // #15 + class #24; // #16 + NameAndType #6 #7; // #17 + Utf8 "Should not see this"; // #18 + Utf8 "PB_PA_I"; // #19 + Utf8 "TestInterfaceMethodSelection$PB_PA_I"; // #20 + Utf8 "InnerClasses"; // #21 + Utf8 "TestInterfaceMethodSelection$PA_I"; // #22 + Utf8 "PA_I"; // #23 + Utf8 "TestInterfaceMethodSelection"; // #24 + } // Constant Pool + + 0x0020; // access + #4;// this_cpx + #5;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #6; // name_cpx + #7; // sig_cpx + [] { // Attributes + Attr(#8) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#9) { // LineNumberTable + [] { // LineNumberTable + 0 132; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0001; // access + #10; // name_cpx + #11; // sig_cpx + [] { // Attributes + Attr(#8) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1202B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#9) { // LineNumberTable + [] { // LineNumberTable + 0 133; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #12; // name_cpx + #11; // sig_cpx + [] { // Attributes + Attr(#8) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1203B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#9) { // LineNumberTable + [] { // LineNumberTable + 0 134; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#13) { // SourceFile + #14; + } // end SourceFile + ; + Attr(#15) { // NestHost + 0x0010; + } // end NestHost + ; + Attr(#21) { // InnerClasses + [] { // InnerClasses + #4 #16 #19 8; + #5 #16 #23 8; + } + } // end InnerClasses + } // Attributes +} // end class TestInterfaceMethodSelection$PB_PA_I diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_B_A.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_B_A.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_B_A.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_B_A.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// m() is declared private + +class TestMethodSelection$PC_B_A { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #4 #15; // #1 + String #16; // #2 + class #17; // #3 + class #20; // #4 + Utf8 "<init>"; // #5 + Utf8 "()V"; // #6 + Utf8 "Code"; // #7 + Utf8 "LineNumberTable"; // #8 + Utf8 "m"; // #9 + Utf8 "()Ljava/lang/String;"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "TestMethodSelection.java"; // #12 + Utf8 "NestHost"; // #13 + class #22; // #14 + NameAndType #5 #6; // #15 + Utf8 "PC_B_A::m"; // #16 + Utf8 "TestMethodSelection$PC_B_A"; // #17 + Utf8 "PC_B_A"; // #18 + Utf8 "InnerClasses"; // #19 + Utf8 "TestMethodSelection$B_A"; // #20 + Utf8 "B_A"; // #21 + Utf8 "TestMethodSelection"; // #22 + } // Constant Pool + + 0x0021; // access + #3;// this_cpx + #4;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #5; // name_cpx + #6; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 130; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access - modified + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1202B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 131; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestHost + 0x000E; + } // end NestHost + ; + Attr(#19) { // InnerClasses + [] { // InnerClasses + #3 #14 #18 9; + #4 #14 #21 9; + } + } // end InnerClasses + } // Attributes +} // end class TestMethodSelection$PC_B_A diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_B_PA.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_B_PA.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_B_PA.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_B_PA.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// m() is declared private + +class TestMethodSelection$PC_B_PA { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #4 #15; // #1 + String #16; // #2 + class #17; // #3 + class #20; // #4 + Utf8 "<init>"; // #5 + Utf8 "()V"; // #6 + Utf8 "Code"; // #7 + Utf8 "LineNumberTable"; // #8 + Utf8 "m"; // #9 + Utf8 "()Ljava/lang/String;"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "TestMethodSelection.java"; // #12 + Utf8 "NestHost"; // #13 + class #22; // #14 + NameAndType #5 #6; // #15 + Utf8 "PC_B_PA::m"; // #16 + Utf8 "TestMethodSelection$PC_B_PA"; // #17 + Utf8 "PC_B_PA"; // #18 + Utf8 "InnerClasses"; // #19 + Utf8 "TestMethodSelection$B_PA"; // #20 + Utf8 "B_PA"; // #21 + Utf8 "TestMethodSelection"; // #22 + } // Constant Pool + + 0x0021; // access + #3;// this_cpx + #4;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #5; // name_cpx + #6; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 144; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access - modified + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1202B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 145; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestHost + 0x000E; + } // end NestHost + ; + Attr(#19) { // InnerClasses + [] { // InnerClasses + #3 #14 #18 9; + #4 #14 #21 9; + } + } // end InnerClasses + } // Attributes +} // end class TestMethodSelection$PC_B_PA diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_PB_A.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_PB_A.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_PB_A.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/PC_PB_A.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,132 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// m() is declared private + +class TestMethodSelection$PC_PB_A { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #4 #15; // #1 + String #16; // #2 + class #17; // #3 + class #20; // #4 + Utf8 "<init>"; // #5 + Utf8 "()V"; // #6 + Utf8 "Code"; // #7 + Utf8 "LineNumberTable"; // #8 + Utf8 "m"; // #9 + Utf8 "()Ljava/lang/String;"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "TestMethodSelection.java"; // #12 + Utf8 "NestHost"; // #13 + class #22; // #14 + NameAndType #5 #6; // #15 + Utf8 "PC_PB_A::m"; // #16 + Utf8 "TestMethodSelection$PC_PB_A"; // #17 + Utf8 "PC_PB_A"; // #18 + Utf8 "InnerClasses"; // #19 + Utf8 "TestMethodSelection$PB_A"; // #20 + Utf8 "PB_A"; // #21 + Utf8 "TestMethodSelection"; // #22 + } // Constant Pool + + 0x0021; // access + #3;// this_cpx + #4;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #5; // name_cpx + #6; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 137; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access - modified + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#7) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1202B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#8) { // LineNumberTable + [] { // LineNumberTable + 0 138; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestHost + 0x000E; + } // end NestHost + ; + Attr(#19) { // InnerClasses + [] { // InnerClasses + #3 #14 #18 9; + #4 #14 #21 9; + } + } // end InnerClasses + } // Attributes +} // end class TestMethodSelection$PC_PB_A diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/TestInterfaceMethodSelection.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/TestInterfaceMethodSelection.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/TestInterfaceMethodSelection.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/TestInterfaceMethodSelection.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test interface method selection process for private/public nestmate invocation + * @compile TestInterfaceMethodSelection.java + * @compile PA_I.jcod \ + * PB_A_I.jcod \ + * PB_A_PI.jcod \ + * PB_PA_I.jcod + * @run main TestInterfaceMethodSelection + * @run main/othervm -Dsun.reflect.noInflation=true TestInterfaceMethodSelection + */ + +// The first run will use NativeMethodAccessor and due to the limited number +// of calls we will not reach the inflation threshold. +// The second run disables inflation so we will use the GeneratedMethodAccessor +// instead. In this way both sets of Reflection classes are tested. + +/* +We are setting up a basic test structure as follows: + +interface I { + ?? String m() [ return "I::m"; // private case] +} +class A implements I { + ?? String m() { return "A::m"; } +} +class B extends A { + ?? String m() { return "B::m"; } +} + +where the access modifier of m() is either public or private in all combinations. +The only cases of interest here are private and non-private, so we use public for +the non-private case. Obviously for an interface, only the private case defines +a method body for m() - we're not testing default methods here (but they would be +invoked in the cases where we get AME). + +We then have a test function: + +void test(I target, String expected) { + check(target.m() == expected); +} + +where the call to target.m() is expressed as an invokeinterface I::m on target. We +then pass either an A instance or a B instance and check the expected method +is invoked. In all cases the resolved method is I::m, so we are effectively +testing the method selection rules. We are not testing resolution here. + +The expected behaviour is as follows (where P means m() is private and - means +m() is public). + +Target I.m A.m B.m Result Reason +------------------------------------------ + A P P n/a I.m [1] + A P - n/a I.m [1] + A - P n/a AME [2] + A - - n/a A.m [3] + B P P P I.m [1] + B P P - I.m [1] + B P - P I.m [1] + B P - - I.m [1] + B - P P AME [2] + B - P - B.m [3] + B - - P A.m [4] + B - - - B.m [3] + +[1] Resolved method is private => selected method == resolved method +[2] private A.m/B.m doesn't override abstract public I.m => AbstractMethodError +[3] Normal overriding: most specific method selected +[4] private B.m doesn't override public A.m/I.m so is ignored => A.m selected + +To allow us to do this in source code we encode the inheritance hierarchy in the +class name, and we use plain I (for example) when m() is public and PI when m() +is private. So class B_A_I defines a public m() and inherits public m() from +both A and I. While PB_PA_PI defines a private m() and also has private m() +defined in its superclass PA and implemented interface PI. + +For cases where the subclass makes a public method private we can't write this +directly in Java source code so we have to have jcod versions that change +the access modifier to private, but we also need to switch between having a +method implementation or not, so add fake_m() and then rename in the jcod file. +The affected cases are: + +- PA_I +- PB_A_I +- PB_PA_I +- PB_A_PI + +We test direct invocation from Java source, MethodHandle invocation and core +reflection invocation. For MH and reflection we look for the method in "I" to +maintain the same resolution process as in the direct case. +*/ + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; +import java.lang.reflect.InvocationTargetException; + +public class TestInterfaceMethodSelection { + + static final MethodType M_T = MethodType.methodType(String.class); + + static interface I { + public String m(); + } + static interface PI { + private String m() { return "PI::m"; } + } + + static class A_I implements I { + public String m() { return "A_I::m"; } + } + static class A_PI implements PI { + public String m() { return "A_PI::m"; } + } + // jcod version will edit method names + static class PA_I implements I { + private String real_m() { return "PA_I::m"; } + public String m() { return "Should not see this"; } + } + static class PA_PI implements PI { + private String m() { return "PA_PI::m"; } + } + + static class B_A_I extends A_I { + public String m() { return "B_A_I::m"; } + } + // jcod version will rewrite this to have private m() + static class PB_A_I extends A_I { + public String m() { return "PB_A_I::m"; } + } + static class B_PA_I extends PA_I { + public String m() { return "B_PA_I::m"; } + } + // jcod version will edit method names + static class PB_PA_I extends PA_I { + public String m() { return "Should not see this"; } + private String real_m() { return "PB_PA_I"; } + } + static class B_A_PI extends A_PI { + public String m() { return "B_A_PI::m"; } + } + // jcod version will rewrite this to have private m() + static class PB_A_PI extends A_PI { + public String m() { return "PB_A_PI"; } + } + static class B_PA_PI extends PA_PI { + public String m() { return "B_PA_PI::m"; } + } + static class PB_PA_PI extends PA_PI { + private String m() { return "PB_PA_PI::m"; } + } + + // Need a test function for each of the "I" interfaces + + static void doInvoke(I target, String expected) throws Throwable { + // Direct + check(target.m(), expected); + // MethodHandle + MethodHandle mh = lookup().findVirtual(I.class, "m", M_T); + check((String)mh.invoke(target), expected); + // Reflection + check((String)I.class.getDeclaredMethod("m", new Class<?>[0]). + invoke(target, new Object[0]), expected); + } + static void doInvoke(PI target, String expected) throws Throwable { + // Direct + check(target.m(), expected); + // MethodHandle + MethodHandle mh = lookup().findVirtual(PI.class, "m", M_T); + check((String)mh.invoke(target), expected); + // Reflection + check((String)PI.class.getDeclaredMethod("m", new Class<?>[0]). + invoke(target, new Object[0]), expected); + } + + static void badInvoke(I target) { + badDirectInvoke(target); + badMHInvoke(target); + badReflectInvoke(target); + } + + static void badDirectInvoke(I target) { + try { + target.m(); + throw new Error("Unexpected success directly invoking " + + target.getClass().getSimpleName() + + ".m() - expected AbstractMethodError"); + } + catch (AbstractMethodError expected) { + } + catch (Throwable t) { + throw new Error("Unexpected exception directly invoking " + + target.getClass().getSimpleName() + + ".m() - expected AbstractMethodError got: " + t); + } + } + + static void badMHInvoke(I target) { + try { + lookup().findVirtual(I.class, "m", M_T).invoke(target); + throw new Error("Unexpected success for MH invoke of" + + target.getClass().getSimpleName() + + ".m() - expected AbstractMethodError"); + } + catch (AbstractMethodError expected) { + } + catch (Throwable t) { + throw new Error("Unexpected exception for MH invoke of " + + target.getClass().getSimpleName() + + ".m() - expected AbstractMethodError got: " + t); + } + } + + static void badReflectInvoke(I target) { + try { + I.class.getDeclaredMethod("m", new Class<?>[0]). + invoke(target, new Object[0]); + throw new Error("Unexpected success for Method invoke of" + + target.getClass().getSimpleName() + + ".m() - expected AbstractMethodError"); + } + catch (InvocationTargetException expected) { + Throwable t = expected.getCause(); + if (!(t instanceof AbstractMethodError)) { + throw new Error("Unexpected exception for Method invoke of " + + target.getClass().getSimpleName() + + ".m() - expected AbstractMethodError got: " + t); + + } + } + catch (Throwable t) { + throw new Error("Unexpected exception for Method invoke of " + + target.getClass().getSimpleName() + + ".m() - expected AbstractMethodError got: " + t); + } + } + + static void check(String actual, String expected) { + if (!actual.equals(expected)) { + throw new Error("Selection error: expected " + expected + + " but got " + actual); + } + } + + public static void main(String[] args) throws Throwable { + // First pass a suitable "A" instance + doInvoke(new PA_PI(), "PI::m"); + doInvoke(new A_PI(), "PI::m"); + badInvoke(new PA_I()); + doInvoke(new A_I(), "A_I::m"); + // Now a "B" instance + doInvoke(new PB_PA_PI(), "PI::m"); + doInvoke(new B_PA_PI(), "PI::m"); + doInvoke(new PB_A_PI(), "PI::m"); + doInvoke(new B_A_PI(), "PI::m"); + badInvoke(new PB_PA_I()); + doInvoke(new B_PA_I(), "B_PA_I::m"); + doInvoke(new PB_A_I(), "A_I::m"); + doInvoke(new B_A_I(), "B_A_I::m"); + } +} + + + + diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/TestMethodSelection.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/TestMethodSelection.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/methodSelection/TestMethodSelection.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/methodSelection/TestMethodSelection.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,242 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test method selection process for private/public nestmate invocation + * @compile TestMethodSelection.java + * @compile PB_A.jcod \ + * PC_B_A.jcod \ + * PC_B_PA.jcod \ + * PC_PB_A.jcod + * @run main/othervm TestMethodSelection + * @run main/othervm -Dsun.reflect.noInflation=true TestMethodSelection + */ + +// The first run will use NativeMethodAccessor and due to the limited number +// of calls we will not reach the inflation threshold. +// The second run disables inflation so we will use the GeneratedMethodAccessor +// instead. In this way both sets of Reflection classes are tested. + +/* +We are setting up a basic test structure as follows: + +class A { + ?? String m() { return "A::m"; } +} +class B extends A { + ?? String m() { return "B::m"; } +} +class C extends B { + ?? String m() { return "C::m"; } +} + +where the access modifier of m() is either public or private in all combinations. +The only cases of interest here are private and non-private, so we use public for +the non-private case. + +We then have a test function: + +void test(B target, String expected) { + check(target.m() == expected); +} + +where the call to target.m() is expressed as an invokevirtual B::m on target. We +then pass either a B instance or a C instance and check that the expected method +is invoked. In all cases the resolved method is B::m, so we are effectively +testing the method selection rules. We are not testing resolution here. + +The expected behaviour is as follows (where P means m() is private and - means +m() is public). + +Target A.m B.m C.m Result Reason +------------------------------------------ + B P P n/a B.m [1] + B P - n/a B.m [2] + B - P n/a B.m [1] + B - - n/a B.m [2] + C P P P B.m [1] + C P P - B.m [1] + C P - P B.m [3] + C P - - C.m [2] + c - P P B.m [1] + C - P - B.m [1] + C - - P B.m [3] + C - - - C.m [2] + +[1] Resolved method is private => selected method == resolved method +[2] target-type.m() can override B.m => selected method == target-type.m() +[3] private C.m does not override resolved public method B.m, but + C has a superclass B, with B.m that (trivially) overrides resolved B.m + => selected method = B.m + +To allow us to do this in source code we encode the inheritance hierarchy in the +class name, and we use plain A (for example) when m() is public and PA when m() +is private. So class C_B_A defines a public m() and inherits public m() from +both B and A. While PC_PB_PA defines a private m() and also has private m() +defined in its superclasses PB and PA. + +For cases where the subclass makes a public method private we can't write this +directly in Java source code so we have to have jcod versions that change +the access modifier to private. This occurs for: + +- PC_B_A +- PB_A +- PC_B_PA +- PC_PB_A + +We test direct invocation from Java source, MethodHandle invocation and core +reflection invocation. For MH and reflection we look for the method in "B" to +maintain the same resolution process as in the direct case. +*/ + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; +import java.lang.reflect.InvocationTargetException; + +public class TestMethodSelection { + + static final MethodType M_T = MethodType.methodType(String.class); + + static class A { + public String m() { return "A::m"; } + } + static class PA { + private String m() { return "PA::m"; } + } + + static class B_A extends A { + public String m() { return "B_A::m"; } + } + static class B_PA extends PA { + public String m() { return "B_PA::m"; } + } + // jcod version will rewrite this to have private m() + static class PB_A extends A { + public String m() { return "PB_A::m"; } + } + static class PB_PA extends PA { + private String m() { return "PB_PA::m"; } + } + + static class C_B_A extends B_A { + public String m() { return "C_B_A::m"; } + } + // jcod version will rewrite this to have private m() + static class PC_B_A extends B_A { + public String m() { return "PC_B_A"; } + } + static class C_PB_A extends PB_A { + public String m() { return "C_PB_A::m"; } + } + // jcod version will rewrite this to have private m() + static class PC_PB_A extends PB_A { + public String m() { return "PC_PB_A"; } + } + static class C_B_PA extends B_PA { + public String m() { return "C_B_PA::m"; } + } + // jcod version will rewrite this to have private m() + static class PC_B_PA extends B_PA { + public String m() { return "PC_B_PA"; } + } + static class C_PB_PA extends PB_PA { + public String m() { return "C_PB_PA::m"; } + } + static class PC_PB_PA extends PB_PA { + private String m() { return "PC_PB_PA::m"; } + } + + // Need a test function for each of the "B" classes + + static void doInvoke(B_A target, String expected) throws Throwable { + // Direct + check(target.m(), expected); + // MethodHandle + MethodHandle mh = lookup().findVirtual(B_A.class, "m", M_T); + check((String)mh.invoke(target), expected); + // Reflection + check((String)B_A.class.getDeclaredMethod("m", new Class<?>[0]). + invoke(target, new Object[0]), expected); + } + static void doInvoke(B_PA target, String expected) throws Throwable { + // Direct + check(target.m(), expected); + // MethodHandle + MethodHandle mh = lookup().findVirtual(B_PA.class, "m", M_T); + check((String)mh.invoke(target), expected); + // Reflection + check((String)B_PA.class.getDeclaredMethod("m", new Class<?>[0]). + invoke(target, new Object[0]), expected); + } + static void doInvoke(PB_A target, String expected) throws Throwable { + // Direct + check(target.m(), expected); + // MethodHandle + MethodHandle mh = lookup().findVirtual(PB_A.class, "m", M_T); + check((String)mh.invoke(target), expected); + // Reflection + check((String)PB_A.class.getDeclaredMethod("m", new Class<?>[0]). + invoke(target, new Object[0]), expected); + } + static void doInvoke(PB_PA target, String expected) throws Throwable { + // Direct + check(target.m(), expected); + // MethodHandle + MethodHandle mh = lookup().findVirtual(PB_PA.class, "m", M_T); + check((String)mh.invoke(target), expected); + // Reflection + check((String)PB_PA.class.getDeclaredMethod("m", new Class<?>[0]). + invoke(target, new Object[0]), expected); + } + + static void check(String actual, String expected) { + if (!actual.equals(expected)) { + throw new Error("Selection error: expected " + expected + + " but got " + actual); + } + } + + public static void main(String[] args) throws Throwable { + // First pass a suitable "B" instance + doInvoke(new PB_PA(), "PB_PA::m"); + doInvoke(new B_PA(), "B_PA::m"); + doInvoke(new PB_A(), "PB_A::m"); + doInvoke(new B_A(), "B_A::m"); + // Now a "C" instance + doInvoke(new PC_PB_PA(), "PB_PA::m"); + doInvoke(new C_PB_PA(), "PB_PA::m"); + doInvoke(new PC_B_PA(), "B_PA::m"); + doInvoke(new C_B_PA(), "C_B_PA::m"); + doInvoke(new PC_PB_A(), "PB_A::m"); + doInvoke(new C_PB_A(), "PB_A::m"); + doInvoke(new PC_B_A(), "B_A::m"); + doInvoke(new C_B_A(), "C_B_A::m"); + } +} + + + + diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/NestmatesJNI.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/NestmatesJNI.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/NestmatesJNI.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/NestmatesJNI.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * Utility class for invoking methods and constructors and accessing fields + * via JNI. + */ +public class NestmatesJNI { + + static { + System.loadLibrary("NestmatesJNI"); + } + + public static native void callVoidVoid(Object target, String definingClassName, String methodName, boolean virtual); + + public static native String callStringVoid(Object target, String definingClassName, String methodName, boolean virtual); + + public static native void callStaticVoidVoid(String definingClassName, String methodName); + + public static Object newInstance(String definingClassName, String sig, Object outerThis) { + return newInstance0(definingClassName, "<init>", sig, outerThis); + } + + private static native Object newInstance0(String definingClassName, String method_name, String sig, Object outerThis); + + public static native int getIntField(Object target, String definingClassName, String fieldName); + + public static native void setIntField(Object target, String definingClassName, String fieldName, int newVal); + + public static native int getStaticIntField(String definingClassName, String fieldName); + + public static native void setStaticIntField(String definingClassName, String fieldName, int newVal); + +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/ExternalSub.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/ExternalSub.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/ExternalSub.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/ExternalSub.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Generated from: ExternalSub.java + + Super constructor call is changed from the public NestedA(int) + constructor to the private NestedA() constructor. +*/ + +class ExternalSub { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #10; // #1 + class #11; // #2 + class #13; // #3 + Utf8 "<init>"; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "TestConstructorHierarchy.java"; // #9 + NameAndType #4 #5; // #10 - modified #16 to #5 + Utf8 "ExternalSub"; // #11 + class #17; // #12 + Utf8 "TestConstructorHierarchy$NestedA"; // #13 + Utf8 "NestedA"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "(I)V"; // #16 + Utf8 "TestConstructorHierarchy"; // #17 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001 // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack - modified from 2 + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 84; +// 5 85; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #3 #12 #14 8; + } + } // end InnerClasses + } // Attributes +} // end class ExternalSub diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/ExternalSuper.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/ExternalSuper.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/ExternalSuper.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/ExternalSuper.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +/* Generated from: ExternalSuper.java + + Constructor access level is changed to private. +*/ + +class ExternalSuper { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #10; // #1 + class #11; // #2 + class #12; // #3 + Utf8 "<init>"; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "TestConstructorHierarchy.java"; // #9 + NameAndType #4 #5; // #10 + Utf8 "ExternalSuper"; // #11 + Utf8 "java/lang/Object"; // #12 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0002; // access - modified to private + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 78; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + } // Attributes +} // end class ExternalSuper diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestConstructorHierarchy.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestConstructorHierarchy.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestConstructorHierarchy.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestConstructorHierarchy.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,96 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private constructors in the hierarchy that are + * outside the nest + * @compile TestConstructorHierarchy.java + * @compile ExternalSuper.jcod + * ExternalSub.jcod + * @run main TestConstructorHierarchy + */ + +public class TestConstructorHierarchy { + + static class NestedA extends ExternalSuper { + private NestedA() {} + protected NestedA(int i) {} // for compile-time only + } + + // Access to private members of classes outside the nest is + // not permitted. These tests should throw IllegalAccessError + // at runtime. To allow them to compile the classes below are + // defined with public members. We then replace those class files + // with jcod variants that make the member private again. + + public static void main(String[] args) throws Throwable { + try { + new ExternalSuper(); + throw new Error("Unexpected construction of ExternalSuper"); + } + catch (IllegalAccessError iae) { + if (iae.getMessage().contains("class TestConstructorHierarchy tried to access private method ExternalSuper.<init>()V")) { + System.out.println("Got expected exception constructing ExternalSuper: " + iae); + } + else throw new Error("Unexpected IllegalAccessError: " + iae); + } + try { + new NestedA(); + throw new Error("Unexpected construction of NestedA and supers"); + } + catch (IllegalAccessError iae) { + if (iae.getMessage().contains("class TestConstructorHierarchy$NestedA tried to access private method ExternalSuper.<init>()V")) { + System.out.println("Got expected exception constructing NestedA: " + iae); + } + else throw new Error("Unexpected IllegalAccessError: " + iae); + } + try { + new ExternalSub(); + throw new Error("Unexpected construction of ExternalSub"); + } + catch (IllegalAccessError iae) { + if (iae.getMessage().contains("class ExternalSub tried to access private method TestConstructorHierarchy$NestedA.<init>()V")) { + System.out.println("Got expected exception constructing ExternalSub: " + iae); + } + else throw new Error("Unexpected IllegalAccessError: " + iae); + } + } +} + +// Classes that are not part of the nest. +// Being non-public allows us to declare them in this file. +// The constructor is public to allow this file to compile, but +// the jcod files change it back to private. + +class ExternalSuper { + public ExternalSuper() { } +} + + +class ExternalSub extends TestConstructorHierarchy.NestedA { + public ExternalSub() { + super(0); // this is changed to super() in jcod file + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestInvokeSpecial.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestInvokeSpecial.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestInvokeSpecial.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestInvokeSpecial.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private constructors between nestmates and nest-host + * using different flavours of named nested types that will + * generate invokespecial for the calls. The -Xcomp run is a special + * regression test for a compiler assertion that would fire when + * "loading" a nest-host class. + * @run main TestInvokeSpecial + * @run main/othervm -Xcomp TestInvokeSpecial + */ + +public class TestInvokeSpecial { + + // All constructors are private to ensure nestmate access checks apply + + // All doConstruct methods are public so they don't involve invoke_special + + private TestInvokeSpecial() {} + + // The various nestmates + + static interface StaticIface { + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + default void doConstruct(TestInvokeSpecial o) { + Object obj = new TestInvokeSpecial(); + } + default void doConstruct(InnerNested o) { + Object obj = new TestInvokeSpecial().new InnerNested(); + } + default void doConstruct(StaticNested o) { + Object obj = new StaticNested(); + } + default void doConstruct(StaticIface o) { + Object obj = new StaticIface() {}; + } + } + + static class StaticNested { + + private StaticNested() {} + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + public void doConstruct(TestInvokeSpecial o) { + Object obj = new TestInvokeSpecial(); + } + public void doConstruct(InnerNested o) { + Object obj = new TestInvokeSpecial().new InnerNested(); + } + public void doConstruct(StaticNested o) { + Object obj = new StaticNested(); + } + public void doConstruct(StaticIface o) { + Object obj = new StaticIface() {}; + } + } + + class InnerNested { + + private InnerNested() {} + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + public void doConstruct(TestInvokeSpecial o) { + Object obj = new TestInvokeSpecial(); + } + public void doConstruct(InnerNested o) { + Object obj = new TestInvokeSpecial().new InnerNested(); + } + public void doConstruct(StaticNested o) { + Object obj = new StaticNested(); + } + public void doConstruct(StaticIface o) { + Object obj = new StaticIface() {}; + } + } + + public static void main(String[] args) { + // These initial constructions test nest-host access + TestInvokeSpecial o = new TestInvokeSpecial(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + s.doConstruct(o); + s.doConstruct(i); + s.doConstruct(s); + s.doConstruct(intf); + + i.doConstruct(o); + i.doConstruct(i); + i.doConstruct(s); + i.doConstruct(intf); + + intf.doConstruct(o); + intf.doConstruct(i); + intf.doConstruct(s); + intf.doConstruct(intf); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestJNI.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestJNI.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestJNI.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestJNI.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test JNI access to private constructors between nestmates and nest-host + * using different flavours of named nested types using core reflection + * @compile ../NestmatesJNI.java + * @run main/othervm/native TestJNI + * @run main/othervm/native -Xcheck:jni TestJNI + */ +public class TestJNI { + + // Unlike reflection, the calling context is not relevant to JNI + // calls, but we keep the same structure as the reflection tests. + + + // All constructors are private to ensure nestmate access checks apply + + // All doConstruct methods are public so they don't involve nestmate access + + private TestJNI() {} + + // The various nestmates + + // Note: No constructor on interfaces so no StaticIface variants + + static interface StaticIface { + + // Methods that will access private constructors of nestmates. + + default void doConstruct(TestJNI o) throws Throwable { + Object obj = newInstance(o.getClass()); + } + default void doConstruct(TestJNI outerThis, InnerNested o) throws Throwable { + Object obj = newInstance(o.getClass(), outerThis); + } + default void doConstruct(StaticNested o) throws Throwable { + Object obj = newInstance(o.getClass()); + } + } + + static class StaticNested { + + private StaticNested() {} + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + public void doConstruct(TestJNI o) throws Throwable { + Object obj = newInstance(o.getClass()); + } + public void doConstruct(TestJNI outerThis, InnerNested o) throws Throwable { + Object obj = newInstance(o.getClass(), outerThis); + } + public void doConstruct(StaticNested o) throws Throwable { + Object obj = newInstance(o.getClass()); + } + } + + class InnerNested { + + private InnerNested() {} + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + public void doConstruct(TestJNI o) throws Throwable { + Object obj = newInstance(o.getClass()); + } + public void doConstruct(TestJNI outerThis, InnerNested o) throws Throwable { + Object obj = newInstance(o.getClass(), outerThis); + } + public void doConstruct(StaticNested o) throws Throwable { + Object obj = newInstance(o.getClass()); + } + } + + public static void main(String[] args) throws Throwable { + // These initial constructions test nest-host access to members + + TestJNI o = newInstance(TestJNI.class); + StaticNested s = (StaticNested) newInstance(StaticNested.class); + InnerNested i = (InnerNested) newInstance(InnerNested.class, o); + + // We need a StaticIface instance to call doConstruct on + StaticIface intf = new StaticIface() {}; + + s.doConstruct(o); + s.doConstruct(o, i); + s.doConstruct(s); + + i.doConstruct(o); + i.doConstruct(o, i); + i.doConstruct(s); + + intf.doConstruct(o); + intf.doConstruct(o, i); + intf.doConstruct(s); + } + + static <T> T newInstance(Class<T> klass) { + return newInstance(klass, null); + } + + static <T> T newInstance(Class<T> klass, Object outerThis) { + String sig = (outerThis == null) ? + "()V" : + "(L" + outerThis.getClass().getName() + ";)V"; + String definingClass = klass.getName(); + String desc = " Invocation of constructor " + definingClass + sig; + try { + T ret = (T) NestmatesJNI.newInstance(definingClass, sig, outerThis); + System.out.println(desc + " - passed"); + return ret; + } + catch (Throwable t) { + throw new Error(desc + ": Unexpected exception: " + t, t); + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestMethodHandles.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestMethodHandles.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestMethodHandles.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestMethodHandles.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private constructors between nestmates and nest-host + * using different flavours of named nested types using MethodHandles + * @run main TestMethodHandles + */ + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; + +public class TestMethodHandles { + + static final MethodType NOARG_T = MethodType.methodType(void.class); + static final MethodType INNER_T = MethodType.methodType(void.class, TestMethodHandles.class); + + // All constructors are private to ensure nestmate access checks apply + + // All doConstruct methods are public so they don't involve invoke_special + + private TestMethodHandles() {} + + // The various nestmates + + // Note: No constructor on interfaces so no StaticIface variants + + static interface StaticIface { + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + default void doConstruct(TestMethodHandles o) throws Throwable { + MethodHandle mh = + lookup().findConstructor(TestMethodHandles.class, NOARG_T); + TestMethodHandles obj = (TestMethodHandles) mh.invoke(); + obj = (TestMethodHandles) mh.invokeExact(); + } + default void doConstruct(TestMethodHandles outer, InnerNested o) throws Throwable { + MethodHandle mh = + lookup().findConstructor(InnerNested.class, INNER_T); + InnerNested obj = (InnerNested) mh.invoke(outer); + obj = (InnerNested) mh.invokeExact(outer); + } + default void doConstruct(StaticNested o) throws Throwable { + MethodHandle mh = + lookup().findConstructor(StaticNested.class, NOARG_T); + StaticNested obj = (StaticNested) mh.invoke(); + obj = (StaticNested) mh.invokeExact(); + } + } + + static class StaticNested { + + private StaticNested() {} + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + public void doConstruct(TestMethodHandles o) throws Throwable { + MethodHandle mh = + lookup().findConstructor(TestMethodHandles.class, NOARG_T); + TestMethodHandles obj = (TestMethodHandles) mh.invoke(); + obj = (TestMethodHandles) mh.invokeExact(); + } + public void doConstruct(TestMethodHandles outer, InnerNested o) throws Throwable { + MethodHandle mh = + lookup().findConstructor(InnerNested.class, INNER_T); + InnerNested obj = (InnerNested) mh.invoke(outer); + obj = (InnerNested) mh.invokeExact(outer); + } + public void doConstruct(StaticNested o) throws Throwable { + MethodHandle mh = + lookup().findConstructor(StaticNested.class, NOARG_T); + StaticNested obj = (StaticNested) mh.invoke(); + obj = (StaticNested) mh.invokeExact(); + } + } + + class InnerNested { + + private InnerNested() {} + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + public void doConstruct(TestMethodHandles o) throws Throwable { + MethodHandle mh = + lookup().findConstructor(TestMethodHandles.class, NOARG_T); + TestMethodHandles obj = (TestMethodHandles) mh.invoke(); + obj = (TestMethodHandles) mh.invokeExact(); + } + public void doConstruct(TestMethodHandles outer, InnerNested o) throws Throwable { + MethodHandle mh = + lookup().findConstructor(InnerNested.class, INNER_T); + InnerNested obj = (InnerNested) mh.invoke(outer); + obj = (InnerNested) mh.invokeExact(outer); + } + public void doConstruct(StaticNested o) throws Throwable { + MethodHandle mh = + lookup().findConstructor(StaticNested.class, NOARG_T); + StaticNested obj = (StaticNested) mh.invoke(); + obj = (StaticNested) mh.invokeExact(); + } + } + + public static void main(String[] args) throws Throwable { + // These initial constructions test nest-host access + MethodHandle mh = + lookup().findConstructor(TestMethodHandles.class, NOARG_T); + TestMethodHandles o = (TestMethodHandles) mh.invoke(); + o = (TestMethodHandles) mh.invokeExact(); + + mh = lookup().findConstructor(StaticNested.class, NOARG_T); + StaticNested s = (StaticNested) mh.invoke(); + s = (StaticNested) mh.invokeExact(); + + mh = lookup().findConstructor(InnerNested.class, INNER_T); + InnerNested i = (InnerNested) mh.invoke(o); + i = (InnerNested) mh.invokeExact(o); + + StaticIface intf = new StaticIface() {}; + + s.doConstruct(o); + s.doConstruct(o, i); + s.doConstruct(s); + + i.doConstruct(o); + i.doConstruct(o, i); + i.doConstruct(s); + + intf.doConstruct(o); + intf.doConstruct(o, i); + intf.doConstruct(s); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestReflection.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestReflection.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestReflection.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateConstructors/TestReflection.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,122 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private constructors between nestmates and nest-host + * using different flavours of named nested types using core reflection + * @run main TestReflection + * @run main/othervm -Dsun.reflect.noInflation=true TestReflection + */ + +// The first run will use NativeConstructorAccessor and due to the limited +// number of calls we will not reach the inflation threshold. +// The second run disables inflation so we will use the +// GeneratedConstructorAccessor instead. +// In this way both sets of Reflection classes are tested. + +public class TestReflection { + + // All constructors are private to ensure nestmate access checks apply + + // All doConstruct methods are public so they don't involve invoke_special + + private TestReflection() {} + + // The various nestmates + + // Note: No constructor on interfaces so no StaticIface variants + + static interface StaticIface { + + // Methods that will access private constructors of nestmates. + + default void doConstruct(TestReflection o) throws Throwable { + Object obj = o.getClass().getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + default void doConstruct(TestReflection tr, InnerNested o) throws Throwable { + Object obj = InnerNested.class.getDeclaredConstructor(new Class<?>[] {TestReflection.class}).newInstance(new Object[] { tr }); + } + default void doConstruct(StaticNested o) throws Throwable { + Object obj = o.getClass().getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + } + + static class StaticNested { + + private StaticNested() {} + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + public void doConstruct(TestReflection o) throws Throwable { + Object obj = o.getClass().getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + public void doConstruct(TestReflection tr, InnerNested o) throws Throwable { + Object obj = InnerNested.class.getDeclaredConstructor(new Class<?>[] {TestReflection.class}).newInstance(new Object[] { tr }); + } + public void doConstruct(StaticNested o) throws Throwable { + Object obj = o.getClass().getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + } + + class InnerNested { + + private InnerNested() {} + + // Methods that will access private constructors of nestmates. + // The arg is a dummy for overloading purposes + + public void doConstruct(TestReflection o) throws Throwable { + Object obj = o.getClass().getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + public void doConstruct(TestReflection tr, InnerNested o) throws Throwable { + Object obj = InnerNested.class.getDeclaredConstructor(new Class<?>[] {TestReflection.class}).newInstance(new Object[] { tr }); + } + public void doConstruct(StaticNested o) throws Throwable { + Object obj = o.getClass().getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + } + } + + public static void main(String[] args) throws Throwable { + // These initial constructions test nest-host access + TestReflection o = TestReflection.class.getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + StaticNested s = StaticNested.class.getDeclaredConstructor(new Class<?>[0]).newInstance(new Object[0]); + InnerNested i = InnerNested.class.getDeclaredConstructor(new Class<?>[] {TestReflection.class}).newInstance(new Object[] { o }); + + StaticIface intf = new StaticIface() {}; + + s.doConstruct(o); + s.doConstruct(o, i); + s.doConstruct(s); + + i.doConstruct(o); + i.doConstruct(o, i); + i.doConstruct(s); + + intf.doConstruct(o); + intf.doConstruct(o, i); + intf.doConstruct(s); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestJNI.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestJNI.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestJNI.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestJNI.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,156 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test JNI access to private fields between nestmates and nest-host + * using different flavours of named nested types + * @compile ../NestmatesJNI.java + * @run main/othervm/native TestJNI + * @run main/othervm/native -Xcheck:jni TestJNI + */ +public class TestJNI { + + // Private field of nest-host for nestmates to access + private int priv_field; + + static final String FIELD = "priv_field"; + + // public constructor so we aren't relying on private access + public TestJNI() {} + + // Methods that will access private fields of nestmates + + // NOTE: No StaticIface variants as interfaces can't have instance fields + + void access_priv(TestJNI o) { + this.priv_field = getAndInc(o, o.getClass(), FIELD); + } + void access_priv(InnerNested o) { + this.priv_field = getAndInc(o, o.getClass(), FIELD); + } + void access_priv(StaticNested o) { + this.priv_field = getAndInc(o, o.getClass(), FIELD); + } + + // The various nestmates + + static interface StaticIface { + + // Methods that will access private fields of nestmates + + default void access_priv(TestJNI o) { + int priv_field = getAndInc(o, o.getClass(), FIELD); + } + default void access_priv(InnerNested o) { + int priv_field = getAndInc(o, o.getClass(), FIELD); + } + default void access_priv(StaticNested o) { + int priv_field = getAndInc(o, o.getClass(), FIELD); + } + } + + static class StaticNested { + + private int priv_field; + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private fields of nestmates + + void access_priv(TestJNI o) { + this.priv_field = getAndInc(o, o.getClass(), FIELD); + } + void access_priv(InnerNested o) { + this.priv_field = getAndInc(o, o.getClass(), FIELD); + } + void access_priv(StaticNested o) { + this.priv_field = getAndInc(o, o.getClass(), FIELD); + } + } + + class InnerNested { + + private int priv_field; + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestJNI o) { + this.priv_field = getAndInc(o, o.getClass(), FIELD); + } + void access_priv(InnerNested o) { + this.priv_field = getAndInc(o, o.getClass(), FIELD); + } + void access_priv(StaticNested o) { + this.priv_field = getAndInc(o, o.getClass(), FIELD); + } + } + + public static void main(String[] args) { + TestJNI o = new TestJNI(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestJNI()); + o.access_priv(i); + o.access_priv(s); + + s.access_priv(o); + s.access_priv(i); + s.access_priv(new StaticNested()); + + i.access_priv(o); + i.access_priv(o.new InnerNested()); + i.access_priv(s); + + intf.access_priv(o); + intf.access_priv(i); + intf.access_priv(s); + } + + static int getAndInc(Object target, Class<?> klass, String field) { + String definingClass = klass.getName(); + String desc = "Access to field " + + definingClass + "." + field + " on instance of class " + + target.getClass().getName(); + int first, second; + try { + first = NestmatesJNI.getIntField(target, definingClass, field); + NestmatesJNI.setIntField(target, definingClass, field, (first + 1)); + second = NestmatesJNI.getIntField(target, definingClass, field); + } + catch (Throwable t) { + throw new Error(desc + ": Unexpected exception: " + t, t); + } + if (second != first + 1) { + throw new Error(desc + ": wrong field values: first=" + first + + ", second=" + second + " (should equal first+1)"); + } + System.out.println(desc + " - passed"); + return first; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestMethodHandles.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestMethodHandles.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestMethodHandles.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestMethodHandles.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,276 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private fields between nestmates and nest-host + * using different flavours of named nested types using MethodHandles + * @run main TestMethodHandles + */ + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; + +public class TestMethodHandles { + + // Private field of nest-host for nestmates to access + private int priv_field; + + // public constructor so we aren't relying on private access + public TestMethodHandles() {} + + // Methods that will access private fields of nestmates + + // NOTE: No StaticIface variants as interfaces can't have instance fields + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + this.priv_field = (int) mh.invoke(o); + this.priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, new StaticNested()); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, new StaticNested()); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + void access_priv(InnerNested o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + this.priv_field = (int) mh.invoke(o); + this.priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, this); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, this); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + this.priv_field = (int) mh.invoke(o); + this.priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, this); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, this); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + + // The various nestmates + + static interface StaticIface { + + // Methods that will access private fields of nestmates + + default void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + int priv_field = (int) mh.invoke(o); + priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, this); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, this); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + default void access_priv(InnerNested o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + int priv_field = (int) mh.invoke(o); + priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, this); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, this); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + default void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + int priv_field = (int) mh.invoke(o); + priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, this); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, this); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + } + + static class StaticNested { + + private int priv_field; + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private fields of nestmates + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + this.priv_field = (int) mh.invoke(o); + this.priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, this); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, this); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + void access_priv(InnerNested o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + this.priv_field = (int) mh.invoke(o); + this.priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, this); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, this); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + this.priv_field = (int) mh.invoke(o); + this.priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, new TestMethodHandles()); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, new TestMethodHandles()); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + } + + class InnerNested { + + private int priv_field; + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + this.priv_field = (int) mh.invoke(o); + this.priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, this); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, this); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + void access_priv(InnerNested o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + this.priv_field = (int) mh.invoke(o); + this.priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, new StaticNested()); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, new StaticNested()); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findGetter(o.getClass(), "priv_field", int.class); + this.priv_field = (int) mh.invoke(o); + this.priv_field = (int) mh.invokeExact(o); + checkBadInvokeG(mh, this); // wrong nestmate + checkBadInvokeG(mh, mh); // completely wrong type + + mh = lookup().findSetter(o.getClass(), "priv_field", int.class); + mh.invoke(o, 2); + mh.invokeExact(o, 3); + checkBadInvokeS(mh, this); // wrong nestmate + checkBadInvokeS(mh, mh); // completely wrong type + } + } + + static void checkBadInvokeG(MethodHandle mh, Object o) throws Throwable { + try { + int x = (int) mh.invoke(o); + throw new Error("Invoke on MethodHandle " + mh + " with receiver " + + o + "should have failed with ClassCastException!"); + } + catch (ClassCastException expected) { + System.out.println("invoke got expected exception: " + expected); + } + } + + static void checkBadInvokeS(MethodHandle mh, Object o) throws Throwable { + try { + mh.invoke(o, 42); + throw new Error("Invoke on MethodHandle " + mh + " with receiver " + + o + "should have failed with ClassCastException!"); + } + catch (ClassCastException expected) { + System.out.println("invoke got expected exception: " + expected); + } + } + + public static void main(String[] args) throws Throwable { + TestMethodHandles o = new TestMethodHandles(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestMethodHandles()); + o.access_priv(i); + o.access_priv(s); + + s.access_priv(o); + s.access_priv(i); + s.access_priv(new StaticNested()); + + i.access_priv(o); + i.access_priv(o.new InnerNested()); + i.access_priv(s); + + intf.access_priv(o); + intf.access_priv(i); + intf.access_priv(s); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestPrivateField.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestPrivateField.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestPrivateField.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestPrivateField.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private fields between nestmates and nest-host + * using different flavours of named nested types + * @run main TestPrivateField + */ + +public class TestPrivateField { + + // Private field of nest-host for nestmates to access + private int priv_field; + + // public constructor so we aren't relying on private access + public TestPrivateField() {} + + // Methods that will access private fields of nestmates + + // NOTE: No StaticIface variants as interfaces can't have instance fields + + void access_priv(TestPrivateField o) { + this.priv_field = o.priv_field++; + } + void access_priv(InnerNested o) { + this.priv_field = o.priv_field++; + } + void access_priv(StaticNested o) { + this.priv_field = o.priv_field++; + } + + // The various nestmates + + static interface StaticIface { + + // Methods that will access private fields of nestmates + + default void access_priv(TestPrivateField o) { + int priv_field = o.priv_field++; + } + default void access_priv(InnerNested o) { + int priv_field = o.priv_field++; + } + default void access_priv(StaticNested o) { + int priv_field = o.priv_field++; + } + } + + static class StaticNested { + + private int priv_field; + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private fields of nestmates + + void access_priv(TestPrivateField o) { + this.priv_field = o.priv_field++; + } + void access_priv(InnerNested o) { + this.priv_field = o.priv_field++; + } + void access_priv(StaticNested o) { + this.priv_field = o.priv_field++; + } + } + + class InnerNested { + + private int priv_field; + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestPrivateField o) { + this.priv_field = o.priv_field++; + } + void access_priv(InnerNested o) { + this.priv_field = o.priv_field++; + } + void access_priv(StaticNested o) { + this.priv_field = o.priv_field++; + } + } + + public static void main(String[] args) { + TestPrivateField o = new TestPrivateField(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestPrivateField()); + o.access_priv(i); + o.access_priv(s); + + s.access_priv(o); + s.access_priv(i); + s.access_priv(new StaticNested()); + + i.access_priv(o); + i.access_priv(o.new InnerNested()); + i.access_priv(s); + + intf.access_priv(o); + intf.access_priv(i); + intf.access_priv(s); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestReflection.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestReflection.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestReflection.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateFields/TestReflection.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,157 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private fields between nestmates and nest-host + * using different flavours of named nested types using core reflection + * @run main TestReflection + */ + +import java.lang.reflect.Field; + +public class TestReflection { + + // Private field of nest-host for nestmates to access + private int priv_field; + + // public constructor so we aren't relying on private access + public TestReflection() {} + + // Methods that will access private fields of nestmates + + // NOTE: No StaticIface variants as interfaces can't have instance fields + + void access_priv(TestReflection o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + this.priv_field = f.getInt(o); + f.setInt(o, 2); + } + void access_priv(InnerNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + this.priv_field = f.getInt(o); + f.setInt(o, 2); + } + void access_priv(StaticNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + this.priv_field = f.getInt(o); + f.setInt(o, 2); + } + + // The various nestmates + + static interface StaticIface { + + // Methods that will access private fields of nestmates + + default void access_priv(TestReflection o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + int priv_field = f.getInt(o); + f.setInt(o, 2); + } + default void access_priv(InnerNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + int priv_field = f.getInt(o); + f.setInt(o, 2); + } + default void access_priv(StaticNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + int priv_field = f.getInt(o); + f.setInt(o, 2); + } + } + + static class StaticNested { + + private int priv_field; + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private fields of nestmates + + void access_priv(TestReflection o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + this.priv_field = f.getInt(o); + f.setInt(o, 2); + } + void access_priv(InnerNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + this.priv_field = f.getInt(o); + f.setInt(o, 2); + } + void access_priv(StaticNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + this.priv_field = f.getInt(o); + f.setInt(o, 2); + } + } + + class InnerNested { + + private int priv_field; + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestReflection o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + this.priv_field = f.getInt(o); + f.setInt(o, 2); + } + void access_priv(InnerNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + this.priv_field = f.getInt(o); + f.setInt(o, 2); + } + void access_priv(StaticNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + this.priv_field = f.getInt(o); + f.setInt(o, 2); + } + } + + public static void main(String[] args) throws Throwable { + TestReflection o = new TestReflection(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestReflection()); + o.access_priv(i); + o.access_priv(s); + + s.access_priv(o); + s.access_priv(i); + s.access_priv(new StaticNested()); + + i.access_priv(o); + i.access_priv(o.new InnerNested()); + i.access_priv(s); + + intf.access_priv(o); + intf.access_priv(i); + intf.access_priv(s); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/ExternalSub.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/ExternalSub.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/ExternalSub.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/ExternalSub.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// Generated from the source in TestInvokeHierarchy.java +// with priv_invoke access modifier changed to private + +class ExternalSub { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #4 #16; // #1 + class #17; // #2 + String #18; // #3 + class #20; // #4 + Utf8 "ID"; // #5 + Utf8 "Ljava/lang/String;"; // #6 + Utf8 "ConstantValue"; // #7 + Utf8 "<init>"; // #8 + Utf8 "()V"; // #9 + Utf8 "Code"; // #10 + Utf8 "LineNumberTable"; // #11 + Utf8 "priv_invoke"; // #12 + Utf8 "()Ljava/lang/String;"; // #13 + Utf8 "SourceFile"; // #14 + Utf8 "TestInvokeHierarchy.java"; // #15 + NameAndType #8 #9; // #16 + Utf8 "ExternalSub"; // #17 + Utf8 "ExternalSub::priv_invoke"; // #18 + class #23; // #19 + Utf8 "TestInvokeHierarchy$NestedC"; // #20 + Utf8 "NestedC"; // #21 + Utf8 "InnerClasses"; // #22 + Utf8 "TestInvokeHierarchy"; // #23 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #4;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x0018; // access + #5; // name_cpx + #6; // sig_cpx + [] { // Attributes + Attr(#7) { // ConstantValue + #3; + } // end ConstantValue + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0000; // access + #8; // name_cpx + #9; // sig_cpx + [] { // Attributes + Attr(#10) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#11) { // LineNumberTable + [] { // LineNumberTable + 0 129; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access - private + #12; // name_cpx + #13; // sig_cpx + [] { // Attributes + Attr(#10) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1203B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#11) { // LineNumberTable + [] { // LineNumberTable + 0 132; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#14) { // SourceFile + #15; + } // end SourceFile + ; + Attr(#22) { // InnerClasses + [] { // InnerClasses + #4 #19 #21 8; + } + } // end InnerClasses + } // Attributes +} // end class ExternalSub diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/ExternalSuper.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/ExternalSuper.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/ExternalSuper.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/ExternalSuper.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// Generated from the source in TestInvokeHierarchy.java +// with priv_invoke access modifier changed to private + +class ExternalSuper { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #4 #16; // #1 + class #17; // #2 + String #18; // #3 + class #19; // #4 + Utf8 "ID"; // #5 + Utf8 "Ljava/lang/String;"; // #6 + Utf8 "ConstantValue"; // #7 + Utf8 "<init>"; // #8 + Utf8 "()V"; // #9 + Utf8 "Code"; // #10 + Utf8 "LineNumberTable"; // #11 + Utf8 "priv_invoke_s"; // #12 + Utf8 "()Ljava/lang/String;"; // #13 + Utf8 "SourceFile"; // #14 + Utf8 "TestInvokeHierarchy.java"; // #15 + NameAndType #8 #9; // #16 + Utf8 "ExternalSuper"; // #17 + Utf8 "ExternalSuper::priv_invoke_s"; // #18 + Utf8 "java/lang/Object"; // #19 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #4;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x0018; // access + #5; // name_cpx + #6; // sig_cpx + [] { // Attributes + Attr(#7) { // ConstantValue + #3; + } // end ConstantValue + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0000; // access + #8; // name_cpx + #9; // sig_cpx + [] { // Attributes + Attr(#10) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#11) { // LineNumberTable + [] { // LineNumberTable + 0 119; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access - private + #12; // name_cpx + #13; // sig_cpx + [] { // Attributes + Attr(#10) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x1203B0; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#11) { // LineNumberTable + [] { // LineNumberTable + 0 124; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#14) { // SourceFile + #15; + } // end SourceFile + } // Attributes +} // end class ExternalSuper diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingMethod.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingMethod.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingMethod.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingMethod.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,144 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// Generated from the source in TestInvokeErrors.java +// with priv_invoke renamed to not_priv_invoke so it isn't found + +class TestInvokeErrors$MissingMethod { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #6 #16; // #1 + Field #17 #18; // #2 + String #19; // #3 + Method #20 #21; // #4 + class #22; // #5 + class #25; // #6 + Utf8 "<init>"; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "not_priv_invoke"; // #11 - renamed + Utf8 "SourceFile"; // #12 + Utf8 "TestInvokeErrors.java"; // #13 + Utf8 "NestHost"; // #14 + class #26; // #15 + NameAndType #7 #8; // #16 + class #27; // #17 + NameAndType #28 #29; // #18 + Utf8 "MissingMethod::priv_invoke"; // #19 + class #30; // #20 + NameAndType #31 #32; // #21 + Utf8 "TestInvokeErrors$MissingMethod"; // #22 + Utf8 "MissingMethod"; // #23 + Utf8 "InnerClasses"; // #24 + Utf8 "java/lang/Object"; // #25 + Utf8 "TestInvokeErrors"; // #26 + Utf8 "java/lang/System"; // #27 + Utf8 "out"; // #28 + Utf8 "Ljava/io/PrintStream;"; // #29 + Utf8 "java/io/PrintStream"; // #30 + Utf8 "println"; // #31 + Utf8 "(Ljava/lang/String;)V"; // #32 + } // Constant Pool + + 0x0020; // access + #5;// this_cpx + #6;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 35; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #11; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 38; + 8 39; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#12) { // SourceFile + #13; + } // end SourceFile + ; + Attr(#14) { // NestHost + 0x000F; + } // end NestHost + ; + Attr(#24) { // InnerClasses + [] { // InnerClasses + #5 #15 #23 8; + } + } // end InnerClasses + } // Attributes +} // end class TestInvokeErrors$MissingMethod diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingMethodWithSuper.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingMethodWithSuper.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingMethodWithSuper.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingMethodWithSuper.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// Generated from the source in TestInvokeErrors.java +// with priv_invoke renamed to not_priv_invoke so it isn't found + +class TestInvokeErrors$MissingMethodWithSuper { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #6 #16; // #1 + Field #17 #18; // #2 + String #19; // #3 + Method #20 #21; // #4 + class #22; // #5 + class #25; // #6 + Utf8 "<init>"; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "not_priv_invoke"; // #11 - rename + Utf8 "SourceFile"; // #12 + Utf8 "TestInvokeErrors.java"; // #13 + Utf8 "NestHost"; // #14 + class #27; // #15 + NameAndType #7 #8; // #16 + class #28; // #17 + NameAndType #29 #30; // #18 + Utf8 "MissingMethodWithSuper::priv_invoke"; // #19 + class #31; // #20 + NameAndType #32 #33; // #21 + Utf8 "TestInvokeErrors$MissingMethodWithSuper"; // #22 + Utf8 "MissingMethodWithSuper"; // #23 + Utf8 "InnerClasses"; // #24 + Utf8 "TestInvokeErrors$Nested"; // #25 + Utf8 "Nested"; // #26 + Utf8 "TestInvokeErrors"; // #27 + Utf8 "java/lang/System"; // #28 + Utf8 "out"; // #29 + Utf8 "Ljava/io/PrintStream;"; // #30 + Utf8 "java/io/PrintStream"; // #31 + Utf8 "println"; // #32 + Utf8 "(Ljava/lang/String;)V"; // #33 + } // Constant Pool + + 0x0020; // access + #5;// this_cpx + #6;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 49; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #11; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 52; + 8 53; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#12) { // SourceFile + #13; + } // end SourceFile + ; + Attr(#14) { // NestHost + 0x000F; + } // end NestHost + ; + Attr(#24) { // InnerClasses + [] { // InnerClasses + #5 #15 #23 8; + #6 #15 #26 8; + } + } // end InnerClasses + } // Attributes +} // end class TestInvokeErrors$MissingMethodWithSuper diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingNestHost.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingNestHost.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingNestHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/MissingNestHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,146 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// Generated from the source in TestInvokeErrors.java +// with NestHost referring to non-existent class: NoSuchClass + +class TestInvokeErrors$MissingNestHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #6 #16; // #1 + Field #17 #18; // #2 + String #19; // #3 + Method #20 #21; // #4 + class #22; // #5 + class #25; // #6 + Utf8 "<init>"; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "priv_invoke"; // #11 + Utf8 "SourceFile"; // #12 + Utf8 "TestInvokeErrors.java"; // #13 + Utf8 "NestHost"; // #14 + class #26; // #15 + NameAndType #7 #8; // #16 + class #27; // #17 + NameAndType #28 #29; // #18 + Utf8 "MissingNestHost::priv_invoke"; // #19 + class #30; // #20 + NameAndType #31 #32; // #21 + Utf8 "TestInvokeErrors$MissingNestHost"; // #22 + Utf8 "MissingNestHost"; // #23 + Utf8 "InnerClasses"; // #24 + Utf8 "java/lang/Object"; // #25 + Utf8 "TestInvokeErrors"; // #26 + Utf8 "java/lang/System"; // #27 + Utf8 "out"; // #28 + Utf8 "Ljava/io/PrintStream;"; // #29 + Utf8 "java/io/PrintStream"; // #30 + Utf8 "println"; // #31 + Utf8 "(Ljava/lang/String;)V"; // #32 + Utf8 "NoSuchClass"; // #33 - added + class #33; // #34 - added + } // Constant Pool + + 0x0020; // access + #5;// this_cpx + #6;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 57; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0002; // access + #11; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 2; // max_stack + 1; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 60; + 8 61; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#12) { // SourceFile + #13; + } // end SourceFile + ; + Attr(#14) { // NestHost + 0x0022; // Modified: class #34 -> NoSuchClass + } // end NestHost + ; + Attr(#24) { // InnerClasses + [] { // InnerClasses + #5 #15 #23 8; + } + } // end InnerClasses + } // Attributes +} // end class TestInvokeErrors$MissingNestHost diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeErrors.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Setup nestmate calls to private methods then use + * modified jcod classes to introduce errors. Test with + * and without verification enabled + * @compile TestInvokeErrors.java + * @compile MissingMethod.jcod + * MissingMethodWithSuper.jcod + * MissingNestHost.jcod + * @run main TestInvokeErrors true + * @run main/othervm -Xverify:none TestInvokeErrors false + */ + +public class TestInvokeErrors { + + static class Nested { + private void priv_invoke() { + System.out.println("Nested::priv_invoke"); + } + } + + static class MissingMethod { + // jcod version will rename this method to not_priv_invoke + private void priv_invoke() { + System.out.println("MissingMethod::priv_invoke"); + } + } + + static class MissingMethodWithSuper extends Nested { + // jcod version will rename this method to not_priv_invoke + private void priv_invoke() { + System.out.println("MissingMethodWithSuper::priv_invoke"); + } + } + + static class MissingNestHost { + // jcod version will change NestHost to a non-existent class + private void priv_invoke() { + System.out.println("MissingNestHost::priv_invoke"); + } + } + + // Helper class adds a level of indirection to avoid the main class + // failing verification if these tests are written directly in main. + // That can only happen if using invokespecial for nestmate invocation. + static class Helper { + static void doTest() { + try { + MissingNestHost m = new MissingNestHost(); + m.priv_invoke(); + throw new Error("Unexpected success invoking MissingNestHost.priv_invoke"); + } + catch (NoClassDefFoundError ncdfe) { + System.out.println("Got expected exception:" + ncdfe); + } + } + } + + public static void main(String[] args) throws Throwable { + // some errors change depending on whether they are caught by the + // verifier first + boolean verifying = Boolean.parseBoolean(args[0]); + System.out.println("Verification is " + + (verifying ? "enabled" : "disabled")); + + try { + MissingMethod m = new MissingMethod(); + m.priv_invoke(); + throw new Error("Unexpected success invoking MissingMethod.priv_invoke"); + } + catch (NoSuchMethodError nsme) { + System.out.println("Got expected exception:" + nsme); + } + + try { + MissingMethodWithSuper m = new MissingMethodWithSuper(); + m.priv_invoke(); + throw new Error("Unexpected success invoking MissingMethodWithSuper.priv_invoke"); + } + catch (NoSuchMethodError nsme) { + System.out.println("Got expected exception:" + nsme); + } + + // Verification of Helper will trigger the nestmate access check failure + try { + Helper.doTest(); + } + catch (NoClassDefFoundError ncdfe) { + if (verifying) + System.out.println("Got expected exception:" + ncdfe); + else + throw new Error("Unexpected error loading Helper class with verification disabled"); + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeHierarchy.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeHierarchy.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeHierarchy.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvokeHierarchy.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private methods between nestmates where there + * is an inheritance hierarchy and we invoke private methods that + * exist in specific classes in the hierarchy. + * @compile TestInvokeHierarchy.java + * @compile ExternalSuper.jcod ExternalSub.jcod + * @run main TestInvokeHierarchy + */ + +public class TestInvokeHierarchy { + + static class NestedA extends ExternalSuper { + static final String ID = "NestedA::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) throws Throwable { + verifyEquals(a.priv_invoke(), NestedA.ID); + } + } + + static class NestedB extends NestedA { + static final String ID = "NestedB::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) throws Throwable { + verifyEquals(a.priv_invoke(), NestedA.ID); + } + } + + static class NestedC extends NestedB { + static final String ID = "NestedC::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) throws Throwable { + verifyEquals(a.priv_invoke(), NestedA.ID); + } + } + + static void checkA(NestedA a) throws Throwable { + verifyEquals(a.priv_invoke(), NestedA.ID); + } + + static void checkB(NestedB b) throws Throwable { + verifyEquals(b.priv_invoke(), NestedB.ID); + } + + static void checkC(NestedC c) throws Throwable { + verifyEquals(c.priv_invoke(), NestedC.ID); + } + + + // Access to private members of classes outside the nest is + // not permitted. These tests should throw IllegalAccessError + // at runtime. To allow them to compile the classes below are + // defined with public members. We then replace those class files + // with jcod variants that make the member private again. + + static void checkExternalSuper(ExternalSuper s) throws Throwable { + try { + String str = s.priv_invoke_s(); + throw new Error("Unexpected access to ExternalSuper.priv_invoke_s"); + } + catch (IllegalAccessError iae) { + System.out.println("Got expected exception accessing ExternalSuper.priv_invoke_s:" + iae); + } + } + + static void checkExternalSub(ExternalSub s) throws Throwable { + try { + String str = s.priv_invoke(); + throw new Error("Unexpected access to ExternalSub.priv_invoke"); + } + catch (IllegalAccessError iae) { + System.out.println("Got expected exception accessing ExternalSub.priv_invoke:" + iae); + } + } + + static void verifyEquals(String actual, String expected) { + if (!actual.equals(expected)) { + throw new Error("Expected " + expected + " but got " + actual); + } + System.out.println("Check passed for " + expected); + } + + public static void main(String[] args) throws Throwable { + NestedA a = new NestedA(); + NestedB b = new NestedB(); + NestedC c = new NestedC(); + ExternalSub sub = new ExternalSub(); + ExternalSuper sup = new ExternalSuper(); + + checkExternalSuper(sup); + checkExternalSuper(a); + checkExternalSuper(b); + checkExternalSuper(c); + checkExternalSuper(sub); + + checkA(a); + checkA(b); + checkA(c); + checkA(sub); + + NestedA.checkA(a); + NestedA.checkA(b); + NestedA.checkA(c); + NestedA.checkA(sub); + + NestedB.checkA(a); + NestedB.checkA(b); + NestedB.checkA(c); + NestedB.checkA(sub); + + NestedC.checkA(a); + NestedC.checkA(b); + NestedC.checkA(c); + NestedC.checkA(sub); + + checkB(b); + checkB(c); + checkB(sub); + + checkC(c); + checkC(sub); + + checkExternalSub(sub); + } +} + +// Classes that are not part of the nest. +// Being non-public allows us to declare them in this file. +// The priv_invoke* member is public to allow this file to compile, but +// the jcod files change it back to private. + +class ExternalSuper { + static final String ID = "ExternalSuper::priv_invoke_s"; + // Can't call this priv_invoke as subclasses make it less accessible + // which is not allowed. + public String priv_invoke_s() { + return ID; + } +} + + +class ExternalSub extends TestInvokeHierarchy.NestedC { + static final String ID = "ExternalSub::priv_invoke"; + public String priv_invoke() { + return ID; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvoke.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvoke.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvoke.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestInvoke.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private methods between nestmates and nest-host + * using different flavours of named nested types + * @run main TestInvoke + */ + +public class TestInvoke { + + // Private method of nest-host for nestmates to access + private void priv_invoke() { + System.out.println("TestInvoke::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public TestInvoke() {} + + // Methods that will access private methods of nestmates + + void access_priv(TestInvoke o) { + o.priv_invoke(); + } + void access_priv(InnerNested o) { + o.priv_invoke(); + } + void access_priv(StaticNested o) { + o.priv_invoke(); + } + void access_priv(StaticIface o) { + o.priv_invoke(); + } + + // The various nestmates + + static interface StaticIface { + + private void priv_invoke() { + System.out.println("StaticIface::priv_invoke"); + } + + // Methods that will access private methods of nestmates + + default void access_priv(TestInvoke o) { + o.priv_invoke(); + } + default void access_priv(InnerNested o) { + o.priv_invoke(); + } + default void access_priv(StaticNested o) { + o.priv_invoke(); + } + default void access_priv(StaticIface o) { + o.priv_invoke(); + } + } + + static class StaticNested { + + private void priv_invoke() { + System.out.println("StaticNested::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private methods of nestmates + + void access_priv(TestInvoke o) { + o.priv_invoke(); + } + void access_priv(InnerNested o) { + o.priv_invoke(); + } + void access_priv(StaticNested o) { + o.priv_invoke(); + } + void access_priv(StaticIface o) { + o.priv_invoke(); + } + } + + class InnerNested { + + private void priv_invoke() { + System.out.println("InnerNested::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv() { + TestInvoke.this.priv_invoke(); // check this$0 access + } + void access_priv(TestInvoke o) { + o.priv_invoke(); + } + void access_priv(InnerNested o) { + o.priv_invoke(); + } + void access_priv(StaticNested o) { + o.priv_invoke(); + } + void access_priv(StaticIface o) { + o.priv_invoke(); + } + } + + public static void main(String[] args) { + TestInvoke o = new TestInvoke(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestInvoke()); + o.access_priv(i); + o.access_priv(s); + o.access_priv(intf); + + s.access_priv(o); + s.access_priv(i); + s.access_priv(new StaticNested()); + s.access_priv(intf); + + i.access_priv(); + i.access_priv(o); + i.access_priv(o.new InnerNested()); + i.access_priv(s); + i.access_priv(intf); + + intf.access_priv(o); + intf.access_priv(i); + intf.access_priv(s); + intf.access_priv(new StaticIface(){}); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestJNIHierarchy.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestJNIHierarchy.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestJNIHierarchy.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestJNIHierarchy.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,237 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private methods between nestmates where there + * is an inheritance hierarchy and we invoke private methods that + * exist in specific classes in the hierarchy. + * @compile ../NestmatesJNI.java + * @run main/othervm/native TestJNIHierarchy + * @run main/othervm/native -Xcheck:jni TestJNIHierarchy + */ + +public class TestJNIHierarchy { + + // Unlike reflection, the calling context is not relevant to JNI + // calls, but we keep the same structure as the reflection tests. + + static final String METHOD = "priv_invoke"; + + static class NestedA extends ExternalSuper { + static final String ID = "NestedA::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) { + String res = NestmatesJNI.callStringVoid(a, + NestedA.class.getName(), + METHOD, + true); + verifyEquals(res, NestedA.ID); + res = NestmatesJNI.callStringVoid(a, + NestedA.class.getName(), + METHOD, + false); + verifyEquals(res, NestedA.ID); + } + } + + static class NestedB extends NestedA { + static final String ID = "NestedB::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) { + String res = NestmatesJNI.callStringVoid(a, + NestedA.class.getName(), + METHOD, + true); + verifyEquals(res, NestedA.ID); + + res = NestmatesJNI.callStringVoid(a, + NestedA.class.getName(), + METHOD, + false); + verifyEquals(res, NestedA.ID); + } + } + + static class NestedC extends NestedB { + static final String ID = "NestedC::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) { + String res = NestmatesJNI.callStringVoid(a, + NestedA.class.getName(), + METHOD, + true); + verifyEquals(res, NestedA.ID); + } + } + + static void checkA(NestedA a) { + String res = NestmatesJNI.callStringVoid(a, + NestedA.class.getName(), + METHOD, + true); + verifyEquals(res, NestedA.ID); + + res = NestmatesJNI.callStringVoid(a, + NestedA.class.getName(), + METHOD, + false); + verifyEquals(res, NestedA.ID); + } + + static void checkB(NestedB b) { + String res = NestmatesJNI.callStringVoid(b, + NestedB.class.getName(), + METHOD, + true); + verifyEquals(res, NestedB.ID); + + res = NestmatesJNI.callStringVoid(b, + NestedB.class.getName(), + METHOD, + false); + verifyEquals(res, NestedB.ID); + + } + + static void checkC(NestedC c) { + String res = NestmatesJNI.callStringVoid(c, + NestedC.class.getName(), + METHOD, + true); + verifyEquals(res, NestedC.ID); + + res = NestmatesJNI.callStringVoid(c, + NestedC.class.getName(), + METHOD, + false); + verifyEquals(res, NestedC.ID); + } + + + // Access to private members of classes outside the nest is + // not permitted in general, but JNI ignores all access checks. + + static void checkExternalSuper(ExternalSuper s) { + String res = NestmatesJNI.callStringVoid(s, + ExternalSuper.class.getName(), + METHOD, + true); + verifyEquals(res, ExternalSuper.ID); + + res = NestmatesJNI.callStringVoid(s, + ExternalSuper.class.getName(), + METHOD, + false); + verifyEquals(res, ExternalSuper.ID); + } + + static void checkExternalSub(ExternalSub s) { + String res = NestmatesJNI.callStringVoid(s, + ExternalSub.class.getName(), + METHOD, + true); + verifyEquals(res, ExternalSub.ID); + + res = NestmatesJNI.callStringVoid(s, + ExternalSub.class.getName(), + METHOD, + false); + verifyEquals(res, ExternalSub.ID); + } + + static void verifyEquals(String actual, String expected) { + if (!actual.equals(expected)) { + throw new Error("Expected " + expected + " but got " + actual); + } + System.out.println("Check passed for " + expected); + } + + public static void main(String[] args) { + NestedA a = new NestedA(); + NestedB b = new NestedB(); + NestedC c = new NestedC(); + ExternalSub sub = new ExternalSub(); + ExternalSuper sup = new ExternalSuper(); + + checkExternalSuper(sup); + checkExternalSuper(a); + checkExternalSuper(b); + checkExternalSuper(c); + checkExternalSuper(sub); + + checkA(a); + checkA(b); + checkA(c); + checkA(sub); + + NestedA.checkA(a); + NestedA.checkA(b); + NestedA.checkA(c); + NestedA.checkA(sub); + + NestedB.checkA(a); + NestedB.checkA(b); + NestedB.checkA(c); + NestedB.checkA(sub); + + NestedC.checkA(a); + NestedC.checkA(b); + NestedC.checkA(c); + NestedC.checkA(sub); + + checkB(b); + checkB(c); + checkB(sub); + + checkC(c); + checkC(sub); + + checkExternalSub(sub); + } +} + +// Classes that are not part of the nest. +// Being non-public allows us to declare them in this file. + +class ExternalSuper { + static final String ID = "ExternalSuper::priv_invoke"; + private String priv_invoke() { + return ID; + } +} + + +class ExternalSub extends TestJNIHierarchy.NestedC { + static final String ID = "ExternalSub::priv_invoke"; + private String priv_invoke() { + return ID; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestJNI.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestJNI.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestJNI.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestJNI.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,197 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test JNI access to private methods between nestmates and nest-host + * using different flavours of named nested types + * @compile ../NestmatesJNI.java + * @run main/othervm/native TestJNI + * @run main/othervm/native -Xcheck:jni TestJNI + */ +public class TestJNI { + + // Unlike reflection, the calling context is not relevant to JNI + // calls, but we keep the same structure as the reflection tests. + + static final String METHOD = "priv_invoke"; + + // Private method of nest-host for nestmates to access + private void priv_invoke() { + System.out.println("TestJNI::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public TestJNI() {} + + // Methods that will access private methods of nestmates + + void access_priv(TestJNI o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + void access_priv(InnerNested o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + void access_priv(StaticNested o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + void access_priv(StaticIface o) { + // Can't use o.getClass() as the method is not in that class + doCall(o, StaticIface.class, METHOD, true); + doCall(o, StaticIface.class, METHOD, false); + } + + // The various nestmates + + static interface StaticIface { + + private void priv_invoke() { + System.out.println("StaticIface::priv_invoke"); + } + + // Methods that will access private methods of nestmates + + default void access_priv(TestJNI o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + default void access_priv(InnerNested o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + default void access_priv(StaticNested o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + default void access_priv(StaticIface o) { + // Can't use o.getClass() as the method is not in that class + doCall(o, StaticIface.class, METHOD, true); + doCall(o, StaticIface.class, METHOD, false); + } + } + + static class StaticNested { + + private void priv_invoke() { + System.out.println("StaticNested::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private methods of nestmates + + void access_priv(TestJNI o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + void access_priv(InnerNested o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + void access_priv(StaticNested o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + void access_priv(StaticIface o) { + // Can't use o.getClass() as the method is not in that class + doCall(o, StaticIface.class, METHOD, true); + doCall(o, StaticIface.class, METHOD, false); + } + } + + class InnerNested { + + private void priv_invoke() { + System.out.println("InnerNested::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestJNI o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + void access_priv(InnerNested o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + void access_priv(StaticNested o) { + doCall(o, o.getClass(), METHOD, true); + doCall(o, o.getClass(), METHOD, false); + } + void access_priv(StaticIface o) { + // Can't use o.getClass() as the method is not in that class + doCall(o, StaticIface.class, METHOD, true); + doCall(o, StaticIface.class, METHOD, false); + } + } + + public static void main(String[] args) { + TestJNI o = new TestJNI(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestJNI()); + o.access_priv(i); + o.access_priv(s); + o.access_priv(intf); + + s.access_priv(o); + s.access_priv(i); + s.access_priv(new StaticNested()); + s.access_priv(intf); + + i.access_priv(o); + i.access_priv(o.new InnerNested()); + i.access_priv(s); + i.access_priv(intf); + + intf.access_priv(o); + intf.access_priv(i); + intf.access_priv(s); + intf.access_priv(new StaticIface(){}); + } + + + static void doCall(Object target, Class<?> klass, String method, + boolean virtual) { + String definingClass = klass.getName(); + String desc = (virtual ? "Virtual" : "Nonvirtual") + " Invocation of " + + definingClass + "." + method + " on instance of class " + + target.getClass().getName(); + try { + NestmatesJNI.callVoidVoid(target, definingClass, method, virtual); + System.out.println(desc + " - passed"); + } + catch (Throwable t) { + throw new Error(desc + ": Unexpected exception: " + t, t); + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestMethodHandlesHierarchy.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestMethodHandlesHierarchy.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestMethodHandlesHierarchy.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestMethodHandlesHierarchy.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private methods between nestmates where there + * is an inheritance hierarchy and we invoke private methods that + * exist in specific classes in the hierarchy. + * @run main TestMethodHandlesHierarchy + */ + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; + +public class TestMethodHandlesHierarchy { + + static final MethodType M_T = MethodType.methodType(String.class); + + static class NestedA extends ExternalSuper { + static final String ID = "NestedA::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) throws Throwable { + MethodHandle mh = + lookup().findSpecial(NestedA.class, "priv_invoke", + M_T, NestedA.class); + verifyEquals((String)mh.invoke(a), NestedA.ID); + verifyEquals((String)mh.invokeExact(a), NestedA.ID); + + mh = lookup().findVirtual(NestedA.class, "priv_invoke", M_T); + verifyEquals((String)mh.invoke(a), NestedA.ID); + verifyEquals((String)mh.invokeExact(a), NestedA.ID); + } + } + + static class NestedB extends NestedA { + static final String ID = "NestedB::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) throws Throwable { + MethodHandle mh = + lookup().findVirtual(NestedA.class, "priv_invoke", M_T); + verifyEquals((String)mh.invoke(a), NestedA.ID); + verifyEquals((String)mh.invokeExact(a), NestedA.ID); + } + } + + static class NestedC extends NestedB { + static final String ID = "NestedC::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) throws Throwable { + MethodHandle mh = + lookup().findVirtual(NestedA.class, "priv_invoke", M_T); + verifyEquals((String)mh.invoke(a), NestedA.ID); + verifyEquals((String)mh.invokeExact(a), NestedA.ID); + } + } + + static void checkA(NestedA a) throws Throwable { + MethodHandle mh = + lookup().findVirtual(NestedA.class, "priv_invoke", M_T); + verifyEquals((String)mh.invoke(a), NestedA.ID); + verifyEquals((String)mh.invokeExact(a), NestedA.ID); + } + + static void checkB(NestedB b) throws Throwable { + MethodHandle mh = + lookup().findVirtual(NestedB.class, "priv_invoke", M_T); + verifyEquals((String)mh.invoke(b), NestedB.ID); + verifyEquals((String)mh.invokeExact(b), NestedB.ID); + } + + static void checkC(NestedC c) throws Throwable { + MethodHandle mh = + lookup().findVirtual(NestedC.class, "priv_invoke", M_T); + verifyEquals((String)mh.invoke(c), NestedC.ID); + verifyEquals((String)mh.invokeExact(c), NestedC.ID); + } + + + // Access to private members of classes outside the nest is + // not permitted. These tests should throw IllegalAccessException + // at runtime. + + static void checkExternalSuper(ExternalSuper s) throws Throwable { + try { + lookup().findVirtual(ExternalSuper.class, "priv_invoke", M_T); + throw new Error("Unexpected access to ExternalSuper.priv_invoke"); + } + catch (IllegalAccessException iae) { + System.out.println("Got expected exception accessing ExternalSuper.priv_invoke:" + iae); + } + } + + static void checkExternalSub(ExternalSub s) throws Throwable { + try { + lookup().findVirtual(ExternalSub.class, "priv_invoke", M_T); + throw new Error("Unexpected access to ExternalSub.priv_invoke"); + } + catch (IllegalAccessException iae) { + System.out.println("Got expected exception accessing ExternalSub.priv_invoke:" + iae); + } + } + + static void verifyEquals(String actual, String expected) { + if (!actual.equals(expected)) { + throw new Error("Expected " + expected + " but got " + actual); + } + System.out.println("Check passed for " + expected); + } + + public static void main(String[] args) throws Throwable { + NestedA a = new NestedA(); + NestedB b = new NestedB(); + NestedC c = new NestedC(); + ExternalSub sub = new ExternalSub(); + ExternalSuper sup = new ExternalSuper(); + + checkExternalSuper(sup); + checkExternalSuper(a); + checkExternalSuper(b); + checkExternalSuper(c); + checkExternalSuper(sub); + + checkA(a); + checkA(b); + checkA(c); + checkA(sub); + + NestedA.checkA(a); + NestedA.checkA(b); + NestedA.checkA(c); + NestedA.checkA(sub); + + NestedB.checkA(a); + NestedB.checkA(b); + NestedB.checkA(c); + NestedB.checkA(sub); + + NestedC.checkA(a); + NestedC.checkA(b); + NestedC.checkA(c); + NestedC.checkA(sub); + + checkB(b); + checkB(c); + checkB(sub); + + checkC(c); + checkC(sub); + + checkExternalSub(sub); + } +} + +// Classes that are not part of the nest. +// Being non-public allows us to declare them in this file. + +class ExternalSuper { + static final String ID = "ExternalSuper::priv_invoke"; + private String priv_invoke() { + return ID; + } +} + + +class ExternalSub extends TestMethodHandlesHierarchy.NestedC { + static final String ID = "ExternalSub::priv_invoke"; + private String priv_invoke() { + return ID; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestMethodHandles.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestMethodHandles.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestMethodHandles.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestMethodHandles.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private methods between nestmates and nest-host + * using different flavours of named nested types using MethodHandles + * @run main TestMethodHandles + */ + + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; + +public class TestMethodHandles { + + static final MethodType M_T = MethodType.methodType(void.class); + + // Private method of nest-host for nestmates to access + private void priv_invoke() { + System.out.println("TestMethodHandles::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public TestMethodHandles() {} + + // Methods that will access private methods of nestmates + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, new StaticNested()); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + // findSpecial also works when this and o are the same class + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, new StaticNested()); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + } + void access_priv(InnerNested o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + void access_priv(StaticIface o) throws Throwable { + MethodHandle mh = lookup().findVirtual(StaticIface.class, "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(StaticIface.class, "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + + // The various nestmates + + static interface StaticIface { + + private void priv_invoke() { + System.out.println("StaticIface::priv_invoke"); + } + + // Methods that will access private methods of nestmates + + default void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = + lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + default void access_priv(InnerNested o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + default void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + default void access_priv(StaticIface o) throws Throwable { + MethodHandle mh = lookup().findVirtual(StaticIface.class, "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, new StaticNested()); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + // findSpecial also works when this and o are the same interface + mh = lookup().findSpecial(StaticIface.class, "priv_invoke", M_T, StaticIface.class); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, new StaticNested()); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + } + } + + static class StaticNested { + + private void priv_invoke() { + System.out.println("StaticNested::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private methods of nestmates + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + void access_priv(InnerNested o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, new TestMethodHandles()); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + // findSpecial also works when this and o are the same class + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, new TestMethodHandles()); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + } + void access_priv(StaticIface o) throws Throwable { + MethodHandle mh = lookup().findVirtual(StaticIface.class, "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(StaticIface.class, "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + } + + class InnerNested { + + private void priv_invoke() { + System.out.println("InnerNested::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + void access_priv(InnerNested o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, new StaticNested()); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + // findSpecial also works when this and o are the same class + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, new StaticNested()); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findVirtual(o.getClass(), "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(o.getClass(), "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + void access_priv(StaticIface o) throws Throwable { + MethodHandle mh = lookup().findVirtual(StaticIface.class, "priv_invoke", M_T); + mh.invoke(o); + mh.invokeExact(o); + checkBadInvoke(mh, this); // wrong nestmate + checkBadInvoke(mh, mh); // completely wrong type + try { + mh = lookup().findSpecial(StaticIface.class, "priv_invoke", M_T, this.getClass()); + throw new Error("findSpecial() succeeded unexpectedly"); + } + catch (IllegalAccessException expected) {} + } + } + + static void checkBadInvoke(MethodHandle mh, Object o) throws Throwable { + try { + mh.invoke(o); + throw new Error("Invoke on MethodHandle " + mh + " with receiver " + + o + "should have failed with ClassCastException!"); + } + catch (ClassCastException expected) { + System.out.println("invoke got expected exception: " + expected); + } + } + + public static void main(String[] args) throws Throwable { + TestMethodHandles o = new TestMethodHandles(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestMethodHandles()); + o.access_priv(i); + o.access_priv(s); + o.access_priv(intf); + + s.access_priv(o); + s.access_priv(i); + s.access_priv(new StaticNested()); + s.access_priv(intf); + + i.access_priv(o); + i.access_priv(o.new InnerNested()); + i.access_priv(s); + i.access_priv(intf); + + intf.access_priv(o); + intf.access_priv(i); + intf.access_priv(s); + intf.access_priv(new StaticIface(){}); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestReflectionHierarchy.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestReflectionHierarchy.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestReflectionHierarchy.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestReflectionHierarchy.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private methods between nestmates where there + * is an inheritance hierarchy and we invoke private methods that + * exist in specific classes in the hierarchy. + * @run main TestReflectionHierarchy + * @run main/othervm -Dsun.reflect.noInflation=true TestReflectionHierarchy + */ + +// The first run will use NativeMethodAccessor and due to the limited number +// of calls we will not reach the inflation threshold. +// The second run disables inflation so we will use the GeneratedMethodAccessor +// instead. In this way both sets of Reflection classes are tested. + + +public class TestReflectionHierarchy { + + static class NestedA extends ExternalSuper { + static final String ID = "NestedA::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) throws Throwable { + verifyEquals((String)NestedA.class. + getDeclaredMethod("priv_invoke", + new Class<?>[0]). + invoke(a, new Object[0]), + NestedA.ID); + } + } + + static class NestedB extends NestedA { + static final String ID = "NestedB::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) throws Throwable { + verifyEquals((String)NestedA.class. + getDeclaredMethod("priv_invoke", + new Class<?>[0]). + invoke(a, new Object[0]), + NestedA.ID); + } + } + + static class NestedC extends NestedB { + static final String ID = "NestedC::priv_invoke"; + private String priv_invoke() { + return ID; + } + static void checkA(NestedA a) throws Throwable { + verifyEquals((String)NestedA.class. + getDeclaredMethod("priv_invoke", + new Class<?>[0]). + invoke(a, new Object[0]), + NestedA.ID); + } + } + + static void checkA(NestedA a) throws Throwable { + verifyEquals((String)NestedA.class. + getDeclaredMethod("priv_invoke", + new Class<?>[0]). + invoke(a, new Object[0]), + NestedA.ID); + } + + static void checkB(NestedB b) throws Throwable { + verifyEquals((String)NestedB.class. + getDeclaredMethod("priv_invoke", + new Class<?>[0]). + invoke(b, new Object[0]), + NestedB.ID); + } + + static void checkC(NestedC c) throws Throwable { + verifyEquals((String)NestedC.class. + getDeclaredMethod("priv_invoke", + new Class<?>[0]). + invoke(c, new Object[0]), + NestedC.ID); + } + + + // Access to private members of classes outside the nest is + // not permitted. These tests should throw IllegalAccessException + // at runtime. + + static void checkExternalSuper(ExternalSuper s) throws Throwable { + try { + ExternalSuper.class. + getDeclaredMethod("priv_invoke", new Class<?>[0]). + invoke(s, new Object[0]); + throw new Error("Unexpected access to ExternalSuper.priv_invoke"); + } + catch (IllegalAccessException iae) { + System.out.println("Got expected exception accessing ExternalSuper.priv_invoke:" + iae); + } + } + + static void checkExternalSub(ExternalSub s) throws Throwable { + try { + ExternalSub.class. + getDeclaredMethod("priv_invoke", new Class<?>[0]). + invoke(s, new Object[0]); + throw new Error("Unexpected access to ExternalSub.priv_invoke"); + } + catch (IllegalAccessException iae) { + System.out.println("Got expected exception accessing ExternalSub.priv_invoke:" + iae); + } + } + + static void verifyEquals(String actual, String expected) { + if (!actual.equals(expected)) { + throw new Error("Expected " + expected + " but got " + actual); + } + System.out.println("Check passed for " + expected); + } + + public static void main(String[] args) throws Throwable { + NestedA a = new NestedA(); + NestedB b = new NestedB(); + NestedC c = new NestedC(); + ExternalSub sub = new ExternalSub(); + ExternalSuper sup = new ExternalSuper(); + + checkExternalSuper(sup); + checkExternalSuper(a); + checkExternalSuper(b); + checkExternalSuper(c); + checkExternalSuper(sub); + + checkA(a); + checkA(b); + checkA(c); + checkA(sub); + + NestedA.checkA(a); + NestedA.checkA(b); + NestedA.checkA(c); + NestedA.checkA(sub); + + NestedB.checkA(a); + NestedB.checkA(b); + NestedB.checkA(c); + NestedB.checkA(sub); + + NestedC.checkA(a); + NestedC.checkA(b); + NestedC.checkA(c); + NestedC.checkA(sub); + + checkB(b); + checkB(c); + checkB(sub); + + checkC(c); + checkC(sub); + + checkExternalSub(sub); + } +} + +// Classes that are not part of the nest. +// Being non-public allows us to declare them in this file. + +class ExternalSuper { + static final String ID = "ExternalSuper::priv_invoke"; + private String priv_invoke() { + return ID; + } +} + + +class ExternalSub extends TestReflectionHierarchy.NestedC { + static final String ID = "ExternalSub::priv_invoke"; + private String priv_invoke() { + return ID; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestReflection.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestReflection.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestReflection.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateMethods/TestReflection.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private methods between nestmates and nest-host + * using different flavours of named nested types using core reflection + * @run main TestReflection + * @run main/othervm -Dsun.reflect.noInflation=true TestReflection + */ + +// The first run will use NativeMethodAccessor and due to the limited number +// of calls we will not reach the inflation threshold. +// The second run disables inflation so we will use the GeneratedMethodAccessor +// instead. In this way both sets of Reflection classes are tested. + +public class TestReflection { + + // Private method of nest-host for nestmates to access + private void priv_invoke() { + System.out.println("TestReflection::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public TestReflection() {} + + // Methods that will access private methods of nestmates + + void access_priv(TestReflection o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + void access_priv(InnerNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + void access_priv(StaticNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + void access_priv(StaticIface o) throws Throwable { + // Can't use o.getClass() as the method is not in that class + StaticIface.class.getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + + // The various nestmates + + static interface StaticIface { + + private void priv_invoke() { + System.out.println("StaticIface::priv_invoke"); + } + + // Methods that will access private methods of nestmates + + default void access_priv(TestReflection o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + default void access_priv(InnerNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + default void access_priv(StaticNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + default void access_priv(StaticIface o) throws Throwable { + // Can't use o.getClass() as the method is not in that class + StaticIface.class.getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + } + + static class StaticNested { + + private void priv_invoke() { + System.out.println("StaticNested::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private methods of nestmates + + void access_priv(TestReflection o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + void access_priv(InnerNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + void access_priv(StaticNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + void access_priv(StaticIface o) throws Throwable { + // Can't use o.getClass() as the method is not in that class + StaticIface.class.getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + } + + class InnerNested { + + private void priv_invoke() { + System.out.println("InnerNested::priv_invoke"); + } + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestReflection o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + void access_priv(InnerNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + void access_priv(StaticNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + void access_priv(StaticIface o) throws Throwable { + // Can't use o.getClass() as the method is not in that class + StaticIface.class.getDeclaredMethod("priv_invoke", new Class<?>[0]).invoke(o, new Object[0]); + } + } + + public static void main(String[] args) throws Throwable { + TestReflection o = new TestReflection(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestReflection()); + o.access_priv(i); + o.access_priv(s); + o.access_priv(intf); + + s.access_priv(o); + s.access_priv(i); + s.access_priv(new StaticNested()); + s.access_priv(intf); + + i.access_priv(o); + i.access_priv(o.new InnerNested()); + i.access_priv(s); + i.access_priv(intf); + + intf.access_priv(o); + intf.access_priv(i); + intf.access_priv(s); + intf.access_priv(new StaticIface(){}); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestJNI.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestJNI.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestJNI.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestJNI.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,138 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test JNI access to private static fields between nestmates and nest-host + * using different flavours of named nested types + * @compile ../NestmatesJNI.java + * @run main/othervm/native TestJNI + * @run main/othervm/native -Xcheck:jni TestJNI + */ +public class TestJNI { + + // Private field of nest-host for nestmates to access + private static int priv_field; + + static final String FIELD = "priv_field"; + + // public constructor so we aren't relying on private access + public TestJNI() {} + + // Methods that will access private static fields of nestmates + + // NOTE: No InnerNested calls in this test because non-static nested types + // can't have static fields. Also no StaticIface calls as static interface + // fields must be public (and final) + + void access_priv(TestJNI o) { + priv_field = getAndInc(o.getClass(), FIELD); + } + void access_priv(StaticNested o) { + priv_field = getAndInc(o.getClass(), FIELD); + } + + // The various nestmates + + static interface StaticIface { + + // Methods that will access private static fields of nestmates + + default void access_priv(TestJNI o) { + int priv_field = getAndInc(o.getClass(), FIELD); + } + default void access_priv(StaticNested o) { + int priv_field = getAndInc(o.getClass(), FIELD); + } + } + + static class StaticNested { + + private static int priv_field; + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private static fields of nestmates + + void access_priv(TestJNI o) { + priv_field = getAndInc(o.getClass(), FIELD); + } + void access_priv(StaticNested o) { + priv_field = getAndInc(o.getClass(), FIELD); + } + } + + class InnerNested { + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestJNI o) { + int priv_field = getAndInc(o.getClass(), FIELD); + } + void access_priv(StaticNested o) { + int priv_field = getAndInc(o.getClass(), FIELD); + } + } + + public static void main(String[] args) { + TestJNI o = new TestJNI(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestJNI()); + o.access_priv(s); + + s.access_priv(o); + s.access_priv(new StaticNested()); + + i.access_priv(o); + i.access_priv(s); + + intf.access_priv(o); + intf.access_priv(s); + } + + static int getAndInc(Class<?> klass, String field) { + String definingClass = klass.getName(); + String desc = "Access to static field " + definingClass + "." + field; + int first, second; + try { + first = NestmatesJNI.getStaticIntField(definingClass, field); + NestmatesJNI.setStaticIntField(definingClass, field, (first + 1)); + second = NestmatesJNI.getStaticIntField(definingClass, field); + } + catch (Throwable t) { + throw new Error(desc + ": Unexpected exception: " + t, t); + } + if (second != first + 1) { + throw new Error(desc + ": wrong field values: first=" + first + + ", second=" + second + " (should equal first+1)"); + } + System.out.println(desc + " - passed"); + return first; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestMethodHandles.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestMethodHandles.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestMethodHandles.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestMethodHandles.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private static fields between nestmates and nest-host + * using different flavours of named nested types using MethodHandles + * @run main TestMethodHandles + */ + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; + +import java.lang.reflect.Field; + +public class TestMethodHandles { + + // private static field of nest-host for nestmates to access + private static int priv_field; + + // public constructor so we aren't relying on private access + public TestMethodHandles() {} + + // Methods that will access private static fields of nestmates + + // NOTE: No InnerNested calls in this test because non-static nested types + // can't have static fields. Also no StaticIface calls as static interface + // fields must be public (and final) + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findStaticGetter(o.getClass(), "priv_field", int.class); + priv_field = (int) mh.invoke(); + priv_field = (int) mh.invokeExact(); + mh = lookup().findStaticSetter(o.getClass(), "priv_field", int.class); + mh.invoke(2); + mh.invokeExact(3); + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findStaticGetter(o.getClass(), "priv_field", int.class); + priv_field = (int) mh.invoke(); + priv_field = (int) mh.invokeExact(); + mh = lookup().findStaticSetter(o.getClass(), "priv_field", int.class); + mh.invoke(2); + mh.invokeExact(3); + } + + // The various nestmates + + static interface StaticIface { + + // Methods that will access private static fields of nestmates + + default void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findStaticGetter(o.getClass(), "priv_field", int.class); + int priv_field = (int) mh.invoke(); + priv_field = (int) mh.invokeExact(); + mh = lookup().findStaticSetter(o.getClass(), "priv_field", int.class); + mh.invoke(2); + mh.invokeExact(3); + } + default void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findStaticGetter(o.getClass(), "priv_field", int.class); + int priv_field = (int) mh.invoke(); + priv_field = (int) mh.invokeExact(); + mh = lookup().findStaticSetter(o.getClass(), "priv_field", int.class); + mh.invoke(2); + mh.invokeExact(3); + } + } + + static class StaticNested { + + private static int priv_field; + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private static fields of nestmates + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findStaticGetter(o.getClass(), "priv_field", int.class); + priv_field = (int) mh.invoke(); + priv_field = (int) mh.invokeExact(); + mh = lookup().findStaticSetter(o.getClass(), "priv_field", int.class); + mh.invoke(2); + mh.invokeExact(3); + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findStaticGetter(o.getClass(), "priv_field", int.class); + priv_field = (int) mh.invoke(); + priv_field = (int) mh.invokeExact(); + mh = lookup().findStaticSetter(o.getClass(), "priv_field", int.class); + mh.invoke(2); + mh.invokeExact(3); + } + } + + class InnerNested { + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = lookup().findStaticGetter(o.getClass(), "priv_field", int.class); + priv_field = (int) mh.invoke(); + priv_field = (int) mh.invokeExact(); + mh = lookup().findStaticSetter(o.getClass(), "priv_field", int.class); + mh.invoke(2); + mh.invokeExact(3); + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = lookup().findStaticGetter(o.getClass(), "priv_field", int.class); + priv_field = (int) mh.invoke(); + priv_field = (int) mh.invokeExact(); + mh = lookup().findStaticSetter(o.getClass(), "priv_field", int.class); + mh.invoke(2); + mh.invokeExact(3); + } + } + + public static void main(String[] args) throws Throwable { + TestMethodHandles o = new TestMethodHandles(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestMethodHandles()); + o.access_priv(s); + + s.access_priv(o); + s.access_priv(new StaticNested()); + + i.access_priv(o); + i.access_priv(s); + + intf.access_priv(o); + intf.access_priv(s); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestPrivateStaticField.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestPrivateStaticField.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestPrivateStaticField.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestPrivateStaticField.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,118 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private static fields between nestmates and nest-host + * using different flavours of named nested types + * @run main TestPrivateStaticField + */ + +public class TestPrivateStaticField { + + // Private static field of nest-host for nestmates to access + private static int priv_field; + + // public constructor so we aren't relying on private access + public TestPrivateStaticField() {} + + // Methods that will access private static fields of nestmates + // We use the arguments for overloading purposes and use the fact + // you can access a static field through an object reference for + // convenience. + + // NOTE: No InnerNested calls in this test because non-static nested types + // can't have static fields. Also no StaticIface calls as static interface + // fields must be public (and final) + + void access_priv(TestPrivateStaticField o) { + priv_field = o.priv_field++; + } + void access_priv(StaticNested o) { + priv_field = o.priv_field++; + } + + // The various nestmates + + static interface StaticIface { + + // Methods that will access private static fields of nestmates + + default void access_priv(TestPrivateStaticField o) { + int priv_field = o.priv_field++; + } + default void access_priv(StaticNested o) { + int priv_field = o.priv_field++; + } + } + + static class StaticNested { + + private static int priv_field; + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private static fields of nestmates + + void access_priv(TestPrivateStaticField o) { + priv_field = o.priv_field++; + } + void access_priv(StaticNested o) { + priv_field = o.priv_field++; + } + } + + class InnerNested { + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestPrivateStaticField o) { + int priv_field = o.priv_field++; + } + void access_priv(StaticNested o) { + int priv_field = o.priv_field++; + } + } + + public static void main(String[] args) { + TestPrivateStaticField o = new TestPrivateStaticField(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestPrivateStaticField()); + o.access_priv(s); + + s.access_priv(o); + s.access_priv(new StaticNested()); + + i.access_priv(o); + i.access_priv(s); + + intf.access_priv(o); + intf.access_priv(s); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestReflection.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestReflection.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestReflection.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticFields/TestReflection.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,133 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private static fields between nestmates and nest-host + * using different flavours of named nested types using core reflection + * @run main TestReflection + */ + +import java.lang.reflect.Field; + +public class TestReflection { + + // private static field of nest-host for nestmates to access + private static int priv_field; + + // public constructor so we aren't relying on private access + public TestReflection() {} + + // Methods that will access private static fields of nestmates + + // NOTE: No InnerNested calls in this test because non-static nested types + // can't have static fields. Also no StaticIface calls as static interface + // fields must be public (and final) + + void access_priv(TestReflection o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + priv_field = f.getInt(null); + f.setInt(null, 2); + } + void access_priv(StaticNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + priv_field = f.getInt(null); + f.setInt(null, 2); + } + + // The various nestmates + + static interface StaticIface { + + // Methods that will access private static fields of nestmates + + default void access_priv(TestReflection o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + int priv_field = f.getInt(null); + f.setInt(null, 2); + } + default void access_priv(StaticNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + int priv_field = f.getInt(null); + f.setInt(null, 2); + } + } + + static class StaticNested { + + private static int priv_field; + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private static fields of nestmates + + void access_priv(TestReflection o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + priv_field = f.getInt(null); + f.setInt(null, 2); + } + void access_priv(StaticNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + priv_field = f.getInt(null); + f.setInt(null, 2); + } + } + + class InnerNested { + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestReflection o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + priv_field = f.getInt(null); + f.setInt(null, 2); + } + void access_priv(StaticNested o) throws Throwable { + Field f = o.getClass().getDeclaredField("priv_field"); + priv_field = f.getInt(null); + f.setInt(null, 2); + } + } + + public static void main(String[] args) throws Throwable { + TestReflection o = new TestReflection(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestReflection()); + o.access_priv(s); + + s.access_priv(o); + s.access_priv(new StaticNested()); + + i.access_priv(o); + i.access_priv(s); + + intf.access_priv(o); + intf.access_priv(s); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestInvokeStatic.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestInvokeStatic.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestInvokeStatic.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestInvokeStatic.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private static methods between nestmates and nest-host + * using different flavours of named nested types + * @run main TestInvokeStatic + */ + +public class TestInvokeStatic { + + // Private static method of nest-host for nestmates to access + private static void priv_static_invoke() { + System.out.println("TestInvokeStatic::priv_static_invoke"); + } + + // public constructor so we aren't relying on private access + public TestInvokeStatic() {} + + // Methods that will access private static methods of nestmates + // We use the arguments for overloading purposes and use the fact + // you can invoke a static method through an object reference for + // convenience. Except for static interface methods of course. + + // NOTE: No InnerNested calls in this test because non-static nested types + // can't have static method + + void access_priv(TestInvokeStatic o) { + o.priv_static_invoke(); + } + void access_priv(StaticNested o) { + o.priv_static_invoke(); + } + void access_priv(StaticIface o) { + StaticIface.priv_static_invoke(); + } + + // The various nestmates + + static interface StaticIface { + + private static void priv_static_invoke() { + System.out.println("StaticIface::priv_static_invoke"); + } + + // Methods that will access private static methods of nestmates + + default void access_priv(TestInvokeStatic o) { + o.priv_static_invoke(); + } + default void access_priv(StaticNested o) { + o.priv_static_invoke(); + } + default void access_priv(StaticIface o) { + StaticIface.priv_static_invoke(); + } + } + + static class StaticNested { + + private static void priv_static_invoke() { + System.out.println("StaticNested::priv_static_invoke"); + } + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private static methods of nestmates + + void access_priv(TestInvokeStatic o) { + o.priv_static_invoke(); + } + void access_priv(StaticNested o) { + o.priv_static_invoke(); + } + void access_priv(StaticIface o) { + StaticIface.priv_static_invoke(); + } + } + + class InnerNested { + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestInvokeStatic o) { + o.priv_static_invoke(); + } + void access_priv(StaticNested o) { + o.priv_static_invoke(); + } + void access_priv(StaticIface o) { + StaticIface.priv_static_invoke(); + } + } + + public static void main(String[] args) { + TestInvokeStatic o = new TestInvokeStatic(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestInvokeStatic()); + o.access_priv(s); + o.access_priv(intf); + + s.access_priv(o); + s.access_priv(new StaticNested()); + s.access_priv(intf); + + i.access_priv(o); + i.access_priv(s); + i.access_priv(intf); + + intf.access_priv(o); + intf.access_priv(s); + intf.access_priv(new StaticIface(){}); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestJNI.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestJNI.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestJNI.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestJNI.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,163 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test JNI access to private methods between nestmates and nest-host + * using different flavours of named nested types + * @compile ../NestmatesJNI.java + * @run main/othervm/native TestJNI + * @run main/othervm/native -Xcheck:jni TestJNI + */ +public class TestJNI { + + // Unlike reflection, the calling context is not relevant to JNI + // calls, but we keep the same structure as the reflection tests. + + // Private static method of nest-host for nestmates to access + private static void priv_static_invoke() { + System.out.println("TestJNI::priv_static_invoke"); + } + + static final String METHOD = "priv_static_invoke"; + + // public constructor so we aren't relying on private access + public TestJNI() {} + + // Methods that will access private static methods of nestmates + // We use the arguments for overloading purposes and use the fact + // you can invoke a static method through an object reference for + // convenience. Except for static interface methods of course. + + // NOTE: No InnerNested calls in this test because non-static nested types + // can't have static method + + void access_priv(TestJNI o) { + doCall(o.getClass(), METHOD); + } + void access_priv(StaticNested o) { + doCall(o.getClass(), METHOD); + } + void access_priv(StaticIface o) { + // Can't use o.getClass() as the method is not in that class + doCall(StaticIface.class, METHOD); + } + + // The various nestmates + + static interface StaticIface { + + private static void priv_static_invoke() { + System.out.println("StaticIface::priv_static_invoke"); + } + + // Methods that will access private static methods of nestmates + + default void access_priv(TestJNI o) { + doCall(o.getClass(), METHOD); + } + default void access_priv(StaticNested o) { + doCall(o.getClass(), METHOD); + } + default void access_priv(StaticIface o) { + // Can't use o.getClass() as the method is not in that class + doCall(StaticIface.class, METHOD); + } + } + + static class StaticNested { + + private static void priv_static_invoke() { + System.out.println("StaticNested::priv_static_invoke"); + } + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private static methods of nestmates + + void access_priv(TestJNI o) { + doCall(o.getClass(), METHOD); + } + void access_priv(StaticNested o) { + doCall(o.getClass(), METHOD); + } + void access_priv(StaticIface o) { + // Can't use o.getClass() as the method is not in that class + doCall(StaticIface.class, METHOD); + } + } + + class InnerNested { + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestJNI o) { + doCall(o.getClass(), METHOD); + } + void access_priv(StaticNested o) { + doCall(o.getClass(), METHOD); + } + void access_priv(StaticIface o) { + // Can't use o.getClass() as the method is not in that class + doCall(StaticIface.class, METHOD); + } + } + + public static void main(String[] args) { + TestJNI o = new TestJNI(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestJNI()); + o.access_priv(s); + o.access_priv(intf); + + s.access_priv(o); + s.access_priv(new StaticNested()); + s.access_priv(intf); + + i.access_priv(o); + i.access_priv(s); + i.access_priv(intf); + + intf.access_priv(o); + intf.access_priv(s); + intf.access_priv(new StaticIface(){}); + } + + static void doCall(Class<?> klass, String method) { + String definingClass = klass.getName(); + String desc = "Static invocation of " + definingClass + "." + method; + try { + NestmatesJNI.callStaticVoidVoid(definingClass, method); + System.out.println(desc + " - passed"); + } + catch (Throwable t) { + throw new Error(desc + ": Unexpected exception: " + t, t); + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestMethodHandles.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestMethodHandles.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestMethodHandles.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestMethodHandles.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,181 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private static methods between nestmates and nest-host + * using different flavours of named nested types using MethodHandles + * @run main TestMethodHandles + */ + + +import java.lang.invoke.*; +import static java.lang.invoke.MethodHandles.*; +import static java.lang.invoke.MethodType.*; + +public class TestMethodHandles { + + static final MethodType INVOKE_T = MethodType.methodType(void.class); + + // Private static method of nest-host for nestmates to access + private static void priv_static_invoke() { + System.out.println("TestMethodHandles::priv_static_invoke"); + } + + // public constructor so we aren't relying on private access + public TestMethodHandles() {} + + // Methods that will access private static methods of nestmates + + // NOTE: No InnerNested calls in this test because non-static nested types + // can't have static methods + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = + lookup().findStatic(o.getClass(), "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = + lookup().findStatic(o.getClass(), "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + void access_priv(StaticIface o) throws Throwable { + MethodHandle mh = + lookup().findStatic(StaticIface.class, "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + + // The various nestmates + + static interface StaticIface { + + private static void priv_static_invoke() { + System.out.println("StaticIface::priv_static_invoke"); + } + + // Methods that will access private static methods of nestmates + + default void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = + lookup().findStatic(o.getClass(), "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + default void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = + lookup().findStatic(o.getClass(), "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + default void access_priv(StaticIface o) throws Throwable { + MethodHandle mh = + lookup().findStatic(StaticIface.class, "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + } + + static class StaticNested { + + private static void priv_static_invoke() { + System.out.println("StaticNested::priv_static_invoke"); + } + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private static methods of nestmates + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = + lookup().findStatic(o.getClass(), "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = + lookup().findStatic(o.getClass(), "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + void access_priv(StaticIface o) throws Throwable { + MethodHandle mh = + lookup().findStatic(StaticIface.class, "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + } + + class InnerNested { + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestMethodHandles o) throws Throwable { + MethodHandle mh = + lookup().findStatic(o.getClass(), "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + void access_priv(StaticNested o) throws Throwable { + MethodHandle mh = + lookup().findStatic(o.getClass(), "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + void access_priv(StaticIface o) throws Throwable { + MethodHandle mh = + lookup().findStatic(StaticIface.class, "priv_static_invoke", INVOKE_T); + mh.invoke(); + mh.invokeExact(); + } + } + + public static void main(String[] args) throws Throwable { + TestMethodHandles o = new TestMethodHandles(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestMethodHandles()); + o.access_priv(s); + o.access_priv(intf); + + s.access_priv(o); + s.access_priv(new StaticNested()); + s.access_priv(intf); + + i.access_priv(o); + i.access_priv(s); + i.access_priv(intf); + + intf.access_priv(o); + intf.access_priv(s); + intf.access_priv(new StaticIface(){}); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestReflection.java openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestReflection.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestReflection.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/Nestmates/privateStaticMethods/TestReflection.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,149 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test access to private static methods between nestmates and nest-host + * using different flavours of named nested types using core reflection + * @run main TestReflection + * @run main/othervm -Dsun.reflect.noInflation=true TestReflection + */ + +// The first run will use NativeMethodAccessor and due to the limited number +// of calls we will not reach the inflation threshold. +// The second run disables inflation so we will use the GeneratedMethodAccessor +// instead. In this way both sets of Reflection classes are tested. + + +public class TestReflection { + + // Private method of nest-host for nestmates to access + private static void priv_static_invoke() { + System.out.println("TestReflection::priv_static_invoke"); + } + + // public constructor so we aren't relying on private access + public TestReflection() {} + + // Methods that will access private static methods of nestmates + + // NOTE: No InnerNested calls in this test because non-static nested types + // can't have static methods + + void access_priv(TestReflection o) throws Throwable { + o.getClass().getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + void access_priv(StaticNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + void access_priv(StaticIface o) throws Throwable { + // Can't use o.getClass() as the method is not in that class + StaticIface.class.getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + + // The various nestmates + + static interface StaticIface { + + private static void priv_static_invoke() { + System.out.println("StaticIface::priv_static_invoke"); + } + + // Methods that will access private static methods of nestmates + + default void access_priv(TestReflection o) throws Throwable { + o.getClass().getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + default void access_priv(StaticNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + default void access_priv(StaticIface o) throws Throwable { + // Can't use o.getClass() as the method is not in that class + StaticIface.class.getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + } + + static class StaticNested { + + private static void priv_static_invoke() { + System.out.println("StaticNested::priv_static_invoke"); + } + + // public constructor so we aren't relying on private access + public StaticNested() {} + + // Methods that will access private static methods of nestmates + + void access_priv(TestReflection o) throws Throwable { + o.getClass().getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + void access_priv(StaticNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + void access_priv(StaticIface o) throws Throwable { + // Can't use o.getClass() as the method is not in that class + StaticIface.class.getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + } + + class InnerNested { + + // public constructor so we aren't relying on private access + public InnerNested() {} + + void access_priv(TestReflection o) throws Throwable { + o.getClass().getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + void access_priv(StaticNested o) throws Throwable { + o.getClass().getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + void access_priv(StaticIface o) throws Throwable { + // Can't use o.getClass() as the method is not in that class + StaticIface.class.getDeclaredMethod("priv_static_invoke", new Class<?>[0]).invoke(null, new Object[0]); + } + } + + public static void main(String[] args) throws Throwable { + TestReflection o = new TestReflection(); + StaticNested s = new StaticNested(); + InnerNested i = o.new InnerNested(); + StaticIface intf = new StaticIface() {}; + + o.access_priv(new TestReflection()); + o.access_priv(s); + o.access_priv(intf); + + s.access_priv(o); + s.access_priv(new StaticNested()); + s.access_priv(intf); + + i.access_priv(o); + i.access_priv(s); + i.access_priv(intf); + + intf.access_priv(o); + intf.access_priv(s); + intf.access_priv(new StaticIface(){}); + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineDoubleDelete.java openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineDoubleDelete.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineDoubleDelete.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineDoubleDelete.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8178870 + * @bug 8178870 8010319 * @summary Redefine class with CFLH twice to test deleting the cached_class_file * @library /test/lib * @modules java.base/jdk.internal.misc @@ -34,27 +34,30 @@ * @run main/othervm/native -Xlog:redefine+class+load+exceptions -agentlib:RedefineDoubleDelete -javaagent:redefineagent.jar RedefineDoubleDelete */ +// package access top-level class to avoid problem with RedefineClassHelper +// and nested types. + +// The ClassFileLoadHook for this class turns foo into faa and prints out faa. +class RedefineDoubleDelete_B { + int faa() { System.out.println("foo"); return 1; } +} + public class RedefineDoubleDelete { // Class gets a redefinition error because it adds a data member public static String newB = - "class RedefineDoubleDelete$B {" + + "class RedefineDoubleDelete_B {" + " int count1 = 0;" + "}"; public static String newerB = - "class RedefineDoubleDelete$B { " + + "class RedefineDoubleDelete_B { " + " int faa() { System.out.println(\"baa\"); return 2; }" + "}"; - // The ClassFileLoadHook for this class turns foo into faa and prints out faa. - static class B { - int faa() { System.out.println("foo"); return 1; } - } - public static void main(String args[]) throws Exception { - B b = new B(); + RedefineDoubleDelete_B b = new RedefineDoubleDelete_B(); int val = b.faa(); if (val != 1) { throw new RuntimeException("return value wrong " + val); @@ -62,12 +65,12 @@ // Redefine B twice to get cached_class_file in both B scratch classes try { - RedefineClassHelper.redefineClass(B.class, newB); + RedefineClassHelper.redefineClass(RedefineDoubleDelete_B.class, newB); } catch (java.lang.UnsupportedOperationException e) { // this is expected } try { - RedefineClassHelper.redefineClass(B.class, newB); + RedefineClassHelper.redefineClass(RedefineDoubleDelete_B.class, newB); } catch (java.lang.UnsupportedOperationException e) { // this is expected } @@ -76,7 +79,7 @@ System.gc(); // Redefine with a compatible class - RedefineClassHelper.redefineClass(B.class, newerB); + RedefineClassHelper.redefineClass(RedefineDoubleDelete_B.class, newerB); val = b.faa(); if (val != 2) { throw new RuntimeException("return value wrong " + val); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineFinalizer.java openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineFinalizer.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineFinalizer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineFinalizer.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 6904403 + * @bug 6904403 8010319 * @summary Don't assert if we redefine finalize method * @library /test/lib * @modules java.base/jdk.internal.misc @@ -41,27 +41,31 @@ * * when redefining finalizer method */ + + +// package access top-level class to avoid problem with RedefineClassHelper +// and nested types. +class RedefineFinalizer_B { + protected void finalize() { + // should be empty + } +} + public class RedefineFinalizer { public static String newB = - "class RedefineFinalizer$B {" + + "class RedefineFinalizer_B {" + " protected void finalize() { " + " System.out.println(\"Finalizer called\");" + " }" + "}"; public static void main(String[] args) throws Exception { - RedefineClassHelper.redefineClass(B.class, newB); + RedefineClassHelper.redefineClass(RedefineFinalizer_B.class, newB); A a = new A(); } - static class A extends B { - } - - static class B { - protected void finalize() { - // should be empty - } + static class A extends RedefineFinalizer_B { } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineInterfaceCall.java openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineInterfaceCall.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineInterfaceCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineInterfaceCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8174962 + * @bug 8174962 8010319 * @summary Redefine class with interface method call * @library /test/lib * @modules java.base/jdk.internal.misc @@ -39,19 +39,21 @@ interface I1 { default int m() { return 0; } } interface I2 extends I1 {} -public class RedefineInterfaceCall { - - public static class C implements I2 { - public int test(I2 i) { - return i.m(); // invokeinterface cpCacheEntry - } +// package access top-level class to avoid problem with RedefineClassHelper +// and nested types. +class RedefineInterfaceCall_C implements I2 { + public int test(I2 i) { + return i.m(); // invokeinterface cpCacheEntry } +} + +public class RedefineInterfaceCall { static String newI1 = "interface I1 { default int m() { return 1; } }"; static String newC = - "public class RedefineInterfaceCall$C implements I2 { " + + "class RedefineInterfaceCall_C implements I2 { " + " public int test(I2 i) { " + " return i.m(); " + " } " + @@ -62,12 +64,12 @@ } public static void main(String[] args) throws Exception { - C c = new C(); + RedefineInterfaceCall_C c = new RedefineInterfaceCall_C(); assertEquals(test(c), 0); assertEquals(c.test(c), 0); - RedefineClassHelper.redefineClass(C.class, newC); + RedefineClassHelper.redefineClass(RedefineInterfaceCall_C.class, newC); assertEquals(c.test(c), 0); @@ -76,7 +78,7 @@ assertEquals(test(c), 1); assertEquals(c.test(c), 1); - RedefineClassHelper.redefineClass(C.class, newC); + RedefineClassHelper.redefineClass(RedefineInterfaceCall_C.class, newC); assertEquals(c.test(c), 1); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineInterfaceMethods.java openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineInterfaceMethods.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineInterfaceMethods.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineInterfaceMethods.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8081800 + * @bug 8081800 8010319 * @summary Redefine private and default interface methods * @library /test/lib * @modules java.base/jdk.internal.misc @@ -33,23 +33,27 @@ * @run main RedefineClassHelper * @run main/othervm -javaagent:redefineagent.jar -Xlog:redefine+class*=trace RedefineInterfaceMethods */ -public class RedefineInterfaceMethods { - static final int RET = -2; +// package access top-level class to avoid problem with RedefineClassHelper +// and nested types. - static interface B { - int ORIGINAL_RETURN = 1; - int NEW_RETURN = 2; - private int privateMethod() { - return ORIGINAL_RETURN; - } - public default int defaultMethod() { - return privateMethod(); - } +interface RedefineInterfaceMethods_B { + int ORIGINAL_RETURN = 1; + int NEW_RETURN = 2; + private int privateMethod() { + return ORIGINAL_RETURN; } + public default int defaultMethod() { + return privateMethod(); + } +} + +public class RedefineInterfaceMethods { + + static final int RET = -2; public static String redefinedPrivateMethod = - "interface RedefineInterfaceMethods$B {" + + "interface RedefineInterfaceMethods_B {" + " int ORIGINAL_RETURN = 1;" + " int NEW_RETURN = 2;" + " private int privateMethod() {" + @@ -61,7 +65,7 @@ "}"; public static String redefinedDefaultMethod = - "interface RedefineInterfaceMethods$B {" + + "interface RedefineInterfaceMethods_B {" + " int ORIGINAL_RETURN = 1;" + " int NEW_RETURN = 2;" + " private int privateMethod() {" + @@ -72,7 +76,7 @@ " }" + "}"; - static class Impl implements B { + static class Impl implements RedefineInterfaceMethods_B { } @@ -81,20 +85,20 @@ Impl impl = new Impl(); int res = impl.defaultMethod(); - if (res != B.ORIGINAL_RETURN) + if (res != RedefineInterfaceMethods_B.ORIGINAL_RETURN) throw new Error("defaultMethod returned " + res + - " expected " + B.ORIGINAL_RETURN); + " expected " + RedefineInterfaceMethods_B.ORIGINAL_RETURN); - RedefineClassHelper.redefineClass(B.class, redefinedPrivateMethod); + RedefineClassHelper.redefineClass(RedefineInterfaceMethods_B.class, redefinedPrivateMethod); res = impl.defaultMethod(); - if (res != B.NEW_RETURN) + if (res != RedefineInterfaceMethods_B.NEW_RETURN) throw new Error("defaultMethod returned " + res + - " expected " + B.NEW_RETURN); + " expected " + RedefineInterfaceMethods_B.NEW_RETURN); System.gc(); - RedefineClassHelper.redefineClass(B.class, redefinedDefaultMethod); + RedefineClassHelper.redefineClass(RedefineInterfaceMethods_B.class, redefinedDefaultMethod); res = impl.defaultMethod(); if (res != RET) diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefinePreviousVersions.java openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefinePreviousVersions.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefinePreviousVersions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefinePreviousVersions.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,7 @@ /* * @test - * @bug 8165246 + * @bug 8165246 8010319 * @summary Test has_previous_versions flag and processing during class unloading. * @requires vm.opt.final.ClassUnloading * @library /test/lib @@ -38,38 +38,43 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.process.OutputAnalyzer; +// package access top-level classes to avoid problem with RedefineClassHelper +// and nested types. + +class RedefinePreviousVersions_B { } + +class RedefinePreviousVersions_Running { + public static volatile boolean stop = false; + public static volatile boolean running = false; + static void localSleep() { + try { + Thread.sleep(10); // sleep for 10 ms + } catch(InterruptedException ie) { + } + } + + public static void infinite() { + running = true; + while (!stop) { localSleep(); } + } +} + + + public class RedefinePreviousVersions { public static String newB = - "class RedefinePreviousVersions$B {" + + "class RedefinePreviousVersions_B {" + "}"; - static class B { } - public static String newRunning = - "class RedefinePreviousVersions$Running {" + + "class RedefinePreviousVersions_Running {" + " public static volatile boolean stop = true;" + " public static volatile boolean running = true;" + " static void localSleep() { }" + " public static void infinite() { }" + "}"; - static class Running { - public static volatile boolean stop = false; - public static volatile boolean running = false; - static void localSleep() { - try{ - Thread.sleep(10); // sleep for 10 ms - } catch(InterruptedException ie) { - } - } - - public static void infinite() { - running = true; - while (!stop) { localSleep(); } - } - } - public static void main(String[] args) throws Exception { if (args.length > 0) { @@ -88,7 +93,7 @@ // Redefine a class and create some garbage // Since there are no methods running, the previous version is never added to the // previous_version_list and the flag _has_previous_versions should stay false - RedefineClassHelper.redefineClass(B.class, newB); + RedefineClassHelper.redefineClass(RedefinePreviousVersions_B.class, newB); for (int i = 0; i < 10 ; i++) { String s = new String("some garbage"); @@ -98,17 +103,17 @@ // Start a class that has a method running new Thread() { public void run() { - Running.infinite(); + RedefinePreviousVersions_Running.infinite(); } }.start(); - while (!Running.running) { + while (!RedefinePreviousVersions_Running.running) { Thread.sleep(10); // sleep for 10 ms } // Since a method of newRunning is running, this class should be added to the previous_version_list // of Running, and _has_previous_versions should return true at class unloading. - RedefineClassHelper.redefineClass(Running.class, newRunning); + RedefineClassHelper.redefineClass(RedefinePreviousVersions_Running.class, newRunning); for (int i = 0; i < 10 ; i++) { String s = new String("some garbage"); @@ -116,7 +121,7 @@ } // purge should clean everything up, except Xcomp it might not. - Running.stop = true; + RedefinePreviousVersions_Running.stop = true; for (int i = 0; i < 10 ; i++) { String s = new String("some garbage"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineRunningMethods.java openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineRunningMethods.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineRunningMethods.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineRunningMethods.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,7 @@ /* * @test - * @bug 8055008 8197901 + * @bug 8055008 8197901 8010319 * @summary Redefine EMCP and non-EMCP methods that are running in an infinite loop * @library /test/lib * @modules java.base/jdk.internal.misc @@ -34,10 +34,33 @@ * @run main/othervm -javaagent:redefineagent.jar -Xlog:redefine+class+iklass+add=trace,redefine+class+iklass+purge=trace,all=trace:file=all.log RedefineRunningMethods */ // Test is executed with full trace logging redirected to a file to ensure there is no crash during logging anonymous classes - see JDK-8197901 + + +// package access top-level class to avoid problem with RedefineClassHelper +// and nested types. +class RedefineRunningMethods_B { + static int count1 = 0; + static int count2 = 0; + public static volatile boolean stop = false; + static void localSleep() { + try{ + Thread.currentThread().sleep(10);//sleep for 10 ms + } catch(InterruptedException ie) { + } + } + + public static void infinite() { + while (!stop) { count1++; localSleep(); } + } + public static void infinite_emcp() { + while (!stop) { count2++; localSleep(); } + } +} + public class RedefineRunningMethods { public static String newB = - "class RedefineRunningMethods$B {" + + "class RedefineRunningMethods_B {" + " static int count1 = 0;" + " static int count2 = 0;" + " public static volatile boolean stop = false;" + @@ -56,7 +79,7 @@ "}"; public static String evenNewerB = - "class RedefineRunningMethods$B {" + + "class RedefineRunningMethods_B {" + " static int count1 = 0;" + " static int count2 = 0;" + " public static volatile boolean stop = false;" + @@ -72,50 +95,31 @@ " }" + "}"; - static class B { - static int count1 = 0; - static int count2 = 0; - public static volatile boolean stop = false; - static void localSleep() { - try{ - Thread.currentThread().sleep(10);//sleep for 10 ms - } catch(InterruptedException ie) { - } - } - - public static void infinite() { - while (!stop) { count1++; localSleep(); } - } - public static void infinite_emcp() { - while (!stop) { count2++; localSleep(); } - } - } - public static void main(String[] args) throws Exception { new Thread() { public void run() { - B.infinite(); + RedefineRunningMethods_B.infinite(); } }.start(); new Thread() { public void run() { - B.infinite_emcp(); + RedefineRunningMethods_B.infinite_emcp(); } }.start(); - RedefineClassHelper.redefineClass(B.class, newB); + RedefineClassHelper.redefineClass(RedefineRunningMethods_B.class, newB); System.gc(); - B.infinite(); + RedefineRunningMethods_B.infinite(); // Start a thread with the second version of infinite_emcp running new Thread() { public void run() { - B.infinite_emcp(); + RedefineRunningMethods_B.infinite_emcp(); } }.start(); @@ -124,22 +128,22 @@ System.gc(); } - RedefineClassHelper.redefineClass(B.class, evenNewerB); + RedefineClassHelper.redefineClass(RedefineRunningMethods_B.class, evenNewerB); System.gc(); for (int i = 0; i < 20 ; i++) { - B.infinite(); + RedefineRunningMethods_B.infinite(); String s = new String("some garbage"); System.gc(); } - B.infinite_emcp(); + RedefineRunningMethods_B.infinite_emcp(); // purge should clean everything up. - B.stop = true; + RedefineRunningMethods_B.stop = true; for (int i = 0; i < 20 ; i++) { - B.infinite(); + RedefineRunningMethods_B.infinite(); String s = new String("some garbage"); System.gc(); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/RedefineTests/RedefineRunningMethodsWithBacktrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 8087315 + * @bug 8087315 8010319 * @summary Get old method's stack trace elements after GC * @library /test/lib * @modules java.base/jdk.internal.misc @@ -36,16 +36,58 @@ import static jdk.test.lib.Asserts.*; +// package access top-level class to avoid problem with RedefineClassHelper +// and nested types. + +class RedefineRunningMethodsWithBacktrace_B { + static int count1 = 0; + static int count2 = 0; + public static volatile boolean stop = false; + static void localSleep() { + try { + Thread.sleep(10);//sleep for 10 ms + } catch(InterruptedException ie) { + } + } + + public static void infinite() { + while (!stop) { count1++; localSleep(); } + } + public static void throwable() { + // add some stuff to the original constant pool + String s1 = new String ("string1"); + String s2 = new String ("string2"); + String s3 = new String ("string3"); + String s4 = new String ("string4"); + String s5 = new String ("string5"); + String s6 = new String ("string6"); + String s7 = new String ("string7"); + String s8 = new String ("string8"); + String s9 = new String ("string9"); + String s10 = new String ("string10"); + String s11 = new String ("string11"); + String s12 = new String ("string12"); + String s13 = new String ("string13"); + String s14 = new String ("string14"); + String s15 = new String ("string15"); + String s16 = new String ("string16"); + String s17 = new String ("string17"); + String s18 = new String ("string18"); + String s19 = new String ("string19"); + throw new RuntimeException("throwable called"); + } +} + public class RedefineRunningMethodsWithBacktrace { public static String newB = - "class RedefineRunningMethodsWithBacktrace$B {" + + "class RedefineRunningMethodsWithBacktrace_B {" + " static int count1 = 0;" + " static int count2 = 0;" + " public static volatile boolean stop = false;" + " static void localSleep() { " + " try{ " + - " Thread.currentThread().sleep(10);" + + " Thread.sleep(10);" + " } catch(InterruptedException ie) { " + " } " + " } " + @@ -58,13 +100,13 @@ "}"; public static String evenNewerB = - "class RedefineRunningMethodsWithBacktrace$B {" + + "class RedefineRunningMethodsWithBacktrace_B {" + " static int count1 = 0;" + " static int count2 = 0;" + " public static volatile boolean stop = false;" + " static void localSleep() { " + " try{ " + - " Thread.currentThread().sleep(1);" + + " Thread.sleep(1);" + " } catch(InterruptedException ie) { " + " } " + " } " + @@ -74,45 +116,6 @@ " }" + "}"; - static class B { - static int count1 = 0; - static int count2 = 0; - public static volatile boolean stop = false; - static void localSleep() { - try { - Thread.currentThread().sleep(10);//sleep for 10 ms - } catch(InterruptedException ie) { - } - } - - public static void infinite() { - while (!stop) { count1++; localSleep(); } - } - public static void throwable() { - // add some stuff to the original constant pool - String s1 = new String ("string1"); - String s2 = new String ("string2"); - String s3 = new String ("string3"); - String s4 = new String ("string4"); - String s5 = new String ("string5"); - String s6 = new String ("string6"); - String s7 = new String ("string7"); - String s8 = new String ("string8"); - String s9 = new String ("string9"); - String s10 = new String ("string10"); - String s11 = new String ("string11"); - String s12 = new String ("string12"); - String s13 = new String ("string13"); - String s14 = new String ("string14"); - String s15 = new String ("string15"); - String s16 = new String ("string16"); - String s17 = new String ("string17"); - String s18 = new String ("string18"); - String s19 = new String ("string19"); - throw new RuntimeException("throwable called"); - } - } - private static void touchRedefinedMethodInBacktrace(Throwable throwable) { System.out.println("touchRedefinedMethodInBacktrace: "); throwable.printStackTrace(); // this actually crashes with the bug in @@ -133,7 +136,7 @@ private static Throwable getThrowableInB() { Throwable t = null; try { - B.throwable(); + RedefineRunningMethodsWithBacktrace_B.throwable(); } catch (Exception e) { t = e; // Don't print here because Throwable will cache the constructed stacktrace @@ -147,32 +150,32 @@ new Thread() { public void run() { - B.infinite(); + RedefineRunningMethodsWithBacktrace_B.infinite(); } }.start(); Throwable t1 = getThrowableInB(); - RedefineClassHelper.redefineClass(B.class, newB); + RedefineClassHelper.redefineClass(RedefineRunningMethodsWithBacktrace_B.class, newB); System.gc(); Throwable t2 = getThrowableInB(); - B.infinite(); + RedefineRunningMethodsWithBacktrace_B.infinite(); for (int i = 0; i < 20 ; i++) { String s = new String("some garbage"); System.gc(); } - RedefineClassHelper.redefineClass(B.class, evenNewerB); + RedefineClassHelper.redefineClass(RedefineRunningMethodsWithBacktrace_B.class, evenNewerB); System.gc(); Throwable t3 = getThrowableInB(); for (int i = 0; i < 20 ; i++) { - B.infinite(); + RedefineRunningMethodsWithBacktrace_B.infinite(); String s = new String("some garbage"); System.gc(); } @@ -182,10 +185,10 @@ touchRedefinedMethodInBacktrace(t3); // purge should clean everything up. - B.stop = true; + RedefineRunningMethodsWithBacktrace_B.stop = true; for (int i = 0; i < 20 ; i++) { - B.infinite(); + RedefineRunningMethodsWithBacktrace_B.infinite(); String s = new String("some garbage"); System.gc(); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTestCompiler.java openjdk-11-11~24/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTestCompiler.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTestCompiler.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTestCompiler.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,10 +24,13 @@ /* * @test ReservedStackTestCompiler * @summary Run ReservedStackTest with dedicated compilers C1 and C2. + * * @requires vm.flavor == "server" & !vm.emulatedClient + * @requires vm.opt.DeoptimizeAlot == null | vm.opt.DeoptimizeAlot == false * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation + * * @run main/othervm -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest * @run main/othervm -XX:-TieredCompilation -XX:-Inline -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java openjdk-11-11~24/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/ReservedStack/ReservedStackTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,9 +23,12 @@ /* * @test ReservedStackTest + * + * @requires vm.opt.DeoptimizeAlot == null | vm.opt.DeoptimizeAlot == false * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.base/jdk.internal.vm.annotation + * * @run main/othervm -XX:MaxInlineLevel=2 -XX:CompileCommand=exclude,java/util/concurrent/locks/AbstractOwnableSynchronizer.setExclusiveOwnerThread ReservedStackTest */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Template.java openjdk-11-11~24/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Template.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Template.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/SelectionResolution/classes/selectionresolution/Template.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -4394,6 +4394,15 @@ builder.objectref = C1; }); + // NOTE: The selection changes in JVMS 11 mean that private class methods + // are never selected to satisfy an interface method invocation, and so no + // IllegalAccessError is subsequently thrown. Because of this all the + // "private" cases below are commented out. At some point in the future + // these should be factored out and moved to a test that expects success + // but it is not that simple as the commented out cases result in 2600 + // testcases being excluded, but only ~150 failing cases were seen. Though + // it is not clear from the test if a single failure can result in further + // testcases being skipped. public static final Template IfaceMethodrefSelectionOverrideNonPublic = new Template("IfaceMethodrefSelection", /* Case 1: Objectref overrides. @@ -4401,22 +4410,22 @@ * I[](*) = mref * C[I](priv) = oref = expected */ - (final SelectionResolutionTestCase.Builder builder) -> { - final ClassData.Package pck = - builder.classdata.get(builder.methodref).packageId; - final ClassData oldexpected = - builder.classdata.get(builder.expected); - final MethodData meth = - new MethodData(MethodData.Access.PRIVATE, - MethodData.Context.INSTANCE); - final ClassData withDef = - new ClassData(pck, meth); - final int I = builder.methodref; - final int C = builder.addClass(withDef); - builder.hier.addInherit(C, I); - builder.objectref = C; - builder.expected = C; - }, + // (final SelectionResolutionTestCase.Builder builder) -> { + // final ClassData.Package pck = + // builder.classdata.get(builder.methodref).packageId; + // final ClassData oldexpected = + // builder.classdata.get(builder.expected); + // final MethodData meth = + // new MethodData(MethodData.Access.PRIVATE, + // MethodData.Context.INSTANCE); + // final ClassData withDef = + // new ClassData(pck, meth); + // final int I = builder.methodref; + // final int C = builder.addClass(withDef); + // builder.hier.addInherit(C, I); + // builder.objectref = C; + // builder.expected = C; + // }, /* Case 2: Objectref overrides. * * I[](*) = mref @@ -4466,27 +4475,27 @@ * C2[I2](priv) = expected, I1[I2]() * C1[I1,C2]() = oref */ - (final SelectionResolutionTestCase.Builder builder) -> { - final ClassData.Package pck = - builder.classdata.get(builder.expected).packageId; - final ClassData oldexpected = - builder.classdata.get(builder.expected); - final MethodData meth = - new MethodData(MethodData.Access.PRIVATE, - MethodData.Context.INSTANCE); - final ClassData withDef = - new ClassData(pck, meth); - final int I2 = builder.methodref; - final int I1 = builder.addInterface(emptyClass(pck)); - final int C2 = builder.addClass(withDef); - final int C1 = builder.addClass(emptyClass(pck)); - builder.hier.addInherit(C1, I1); - builder.hier.addInherit(C1, C2); - builder.hier.addInherit(I1, I2); - builder.hier.addInherit(C2, I2); - builder.objectref = C1; - builder.expected = C2; - }, + // (final SelectionResolutionTestCase.Builder builder) -> { + // final ClassData.Package pck = + // builder.classdata.get(builder.expected).packageId; + // final ClassData oldexpected = + // builder.classdata.get(builder.expected); + // final MethodData meth = + // new MethodData(MethodData.Access.PRIVATE, + // MethodData.Context.INSTANCE); + // final ClassData withDef = + // new ClassData(pck, meth); + // final int I2 = builder.methodref; + // final int I1 = builder.addInterface(emptyClass(pck)); + // final int C2 = builder.addClass(withDef); + // final int C1 = builder.addClass(emptyClass(pck)); + // builder.hier.addInherit(C1, I1); + // builder.hier.addInherit(C1, C2); + // builder.hier.addInherit(I1, I2); + // builder.hier.addInherit(C2, I2); + // builder.objectref = C1; + // builder.expected = C2; + // }, /* Case 5: Diamond, with superclass, expected at top, * class overriding with package private. * @@ -4549,24 +4558,24 @@ * C2[](priv) = expected, I1[](*) = mref * C1[I1,C2]() = oref */ - (final SelectionResolutionTestCase.Builder builder) -> { - final ClassData.Package pck = - builder.classdata.get(builder.expected).packageId; - final ClassData oldexpected = - builder.classdata.get(builder.expected); - final MethodData meth = - new MethodData(MethodData.Access.PRIVATE, - MethodData.Context.INSTANCE); - final ClassData withDef = - new ClassData(pck, meth); - final int I1 = builder.methodref; - final int C2 = builder.addClass(withDef); - final int C1 = builder.addClass(emptyClass(pck)); - builder.hier.addInherit(C1, I1); - builder.hier.addInherit(C1, C2); - builder.objectref = C1; - builder.expected = C2; - }, + // (final SelectionResolutionTestCase.Builder builder) -> { + // final ClassData.Package pck = + // builder.classdata.get(builder.expected).packageId; + // final ClassData oldexpected = + // builder.classdata.get(builder.expected); + // final MethodData meth = + // new MethodData(MethodData.Access.PRIVATE, + // MethodData.Context.INSTANCE); + // final ClassData withDef = + // new ClassData(pck, meth); + // final int I1 = builder.methodref; + // final int C2 = builder.addClass(withDef); + // final int C1 = builder.addClass(emptyClass(pck)); + // builder.hier.addInherit(C1, I1); + // builder.hier.addInherit(C1, C2); + // builder.objectref = C1; + // builder.expected = C2; + // }, /* Case 8: Y, with superclass, overlaping, expected * at top, class overrides * @@ -4622,26 +4631,26 @@ * C2[I2](priv) = expected, I1[](*) = mref * C1[I1,C2]() = oref */ - (final SelectionResolutionTestCase.Builder builder) -> { - final ClassData.Package pck = - builder.classdata.get(builder.expected).packageId; - final ClassData oldexpected = - builder.classdata.get(builder.expected); - final MethodData meth = - new MethodData(MethodData.Access.PRIVATE, - MethodData.Context.INSTANCE); - final ClassData withDef = - new ClassData(pck, meth); - final int I2 = builder.expected; - final int I1 = builder.methodref; - final int C2 = builder.addClass(withDef); - final int C1 = builder.addClass(emptyClass(pck)); - builder.hier.addInherit(C1, I1); - builder.hier.addInherit(C1, C2); - builder.hier.addInherit(C2, I2); - builder.objectref = C1; - builder.expected = C2; - }, + // (final SelectionResolutionTestCase.Builder builder) -> { + // final ClassData.Package pck = + // builder.classdata.get(builder.expected).packageId; + // final ClassData oldexpected = + // builder.classdata.get(builder.expected); + // final MethodData meth = + // new MethodData(MethodData.Access.PRIVATE, + // MethodData.Context.INSTANCE); + // final ClassData withDef = + // new ClassData(pck, meth); + // final int I2 = builder.expected; + // final int I1 = builder.methodref; + // final int C2 = builder.addClass(withDef); + // final int C1 = builder.addClass(emptyClass(pck)); + // builder.hier.addInherit(C1, I1); + // builder.hier.addInherit(C1, C2); + // builder.hier.addInherit(C2, I2); + // builder.objectref = C1; + // builder.expected = C2; + // }, /* Case 11: Diamond, with superclass, overlaping, expected * at top, class overrides * @@ -4702,25 +4711,25 @@ * C2[I](priv) = expected * C1[C2]() = oref */ - (final SelectionResolutionTestCase.Builder builder) -> { - final ClassData.Package pck = - builder.classdata.get(builder.expected).packageId; - final ClassData oldexpected = - builder.classdata.get(builder.expected); - final MethodData meth = - new MethodData(MethodData.Access.PRIVATE, - MethodData.Context.INSTANCE); - final ClassData withDef = - new ClassData(pck, meth); - final int I = builder.methodref; - final int C2 = builder.addClass(withDef); - final int C1 = builder.addClass(emptyClass(pck)); - builder.hier.addInherit(C1, I); - builder.hier.addInherit(C1, C2); - builder.hier.addInherit(C2, I); - builder.expected = C2; - builder.objectref = C1; - }, + // (final SelectionResolutionTestCase.Builder builder) -> { + // final ClassData.Package pck = + // builder.classdata.get(builder.expected).packageId; + // final ClassData oldexpected = + // builder.classdata.get(builder.expected); + // final MethodData meth = + // new MethodData(MethodData.Access.PRIVATE, + // MethodData.Context.INSTANCE); + // final ClassData withDef = + // new ClassData(pck, meth); + // final int I = builder.methodref; + // final int C2 = builder.addClass(withDef); + // final int C1 = builder.addClass(emptyClass(pck)); + // builder.hier.addInherit(C1, I); + // builder.hier.addInherit(C1, C2); + // builder.hier.addInherit(C2, I); + // builder.expected = C2; + // builder.objectref = C1; + // }, /* Case 14: Superclass overrides. * * I[](*) = mref diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceICCE.java openjdk-11-11~24/test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceICCE.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceICCE.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceICCE.java 2018-07-25 15:36:46.000000000 +0000 @@ -154,20 +154,7 @@ Template.IfaceMethodrefNotEqualsExpected, Template.IgnoredAbstract, Template.AllCallsiteCases, - Template.IfaceMethodrefAmbiguousResolvedIsIface), - - /* Group 175: private method in interface */ - new TestGroup.Simple(initBuilder, - Template.SetInvoke(SelectionResolutionTestCase.InvokeInstruction.INVOKEINTERFACE), - Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE), - EnumSet.of(MethodData.Access.PRIVATE), - EnumSet.of(MethodData.Context.INSTANCE), - EnumSet.of(ClassData.Package.SAME)), - Template.OverrideAbstractExpectedIface, - Template.MethodrefEqualsExpected, - Template.IgnoredAbstract, - Template.CallsiteEqualsMethodref, - Template.IfaceMethodrefSelection) + Template.IfaceMethodrefAmbiguousResolvedIsIface) ); private InvokeInterfaceICCE() { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceSuccessTest.java openjdk-11-11~24/test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceSuccessTest.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceSuccessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/SelectionResolution/InvokeInterfaceSuccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -136,6 +136,20 @@ Template.CallsiteUnrelatedToMethodref, Template.IfaceMethodrefSelection, Template.SelectionOverrideAbstract) + /* , + // Group 175: private method in interface [was ICCE case up to JDK 11] + // Can't get this to work for some reason. + new TestGroup.Simple(initBuilder, + Template.ResultCombo(EnumSet.of(Template.Kind.INTERFACE), + EnumSet.of(MethodData.Access.PRIVATE), + EnumSet.of(MethodData.Context.INSTANCE), + EnumSet.of(ClassData.Package.SAME)), + Template.OverrideAbstractExpectedIface, + Template.MethodrefEqualsExpected, + Template.IgnoredAbstract, + Template.CallsiteEqualsMethodref, + Template.IfaceMethodrefSelection) + */ ); private InvokeInterfaceSuccessTest() { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/SharedArchiveFile/SASymbolTableTest.java openjdk-11-11~24/test/hotspot/jtreg/runtime/SharedArchiveFile/SASymbolTableTest.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/SharedArchiveFile/SASymbolTableTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/SharedArchiveFile/SASymbolTableTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,7 +24,7 @@ /** * @test SASymbolTableTest * @summary Walk symbol table using SA, with and without CDS. - * @requires vm.cds + * @requires vm.cds & vm.hasSAandCanAttach * @library /test/lib * @modules java.base/jdk.internal.misc * jdk.hotspot.agent/sun.jvm.hotspot.oops @@ -59,11 +59,6 @@ public static void main(String[] args) throws Exception { - if (!Platform.shouldSAAttach()) { - System.out.println("SA attach not expected to work - test skipped."); - return; - } - CDSTestUtils.createArchiveAndCheck(); run(true); run(false); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/verifier/stackMapTableTests/badStackMapTable.jcod openjdk-11-11~24/test/hotspot/jtreg/runtime/verifier/stackMapTableTests/badStackMapTable.jcod --- openjdk-11-11~19/test/hotspot/jtreg/runtime/verifier/stackMapTableTests/badStackMapTable.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/verifier/stackMapTableTests/badStackMapTable.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,206 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +// This .jcod test was derived from the following Java program. In the .jcod +// file, The first opcode was changed to an illegal value to cause a 'bad +// instruction' VerifyError exception. Also, the stack map table was changed +// so that it contains an illegal verification type. The error occurred when +// the verifier tried to print the stack map table as part of the 'bad +// instruction' VerifyError exception. +// +// public class badStackMapTabe extends java.lang.Throwable { +// +// public static void m(int I, String s, long l, Object o) { +// try { +// if (I == l) { +// System.out.println("x"); +// } +// } catch (Exception e) { +// System.out.println("y"); +// } +// } +// +// public static void main(String argv[]) { +// badStackMapTabe.m(5, "hi", 6, "x"); +// } +// } + + +class badStackMapTable { + 0xCAFEBABE; + 0; // minor version + 55; // version + [42] { // Constant Pool + ; // first element is empty + Method #12 #24; // #1 at 0x0A + Field #25 #26; // #2 at 0x0F + String #27; // #3 at 0x14 + Method #28 #29; // #4 at 0x17 + class #30; // #5 at 0x1C + String #31; // #6 at 0x1F + String #32; // #7 at 0x22 + long 0x0000000000000006;; // #8 at 0x25 + Method #11 #33; // #10 at 0x2E + class #34; // #11 at 0x33 + class #35; // #12 at 0x36 + Utf8 "<init>"; // #13 at 0x39 + Utf8 "()V"; // #14 at 0x42 + Utf8 "Code"; // #15 at 0x48 + Utf8 "LineNumberTable"; // #16 at 0x4F + Utf8 "m"; // #17 at 0x61 + Utf8 "(ILjava/lang/String;JLjava/lang/Object;)V"; // #18 at 0x65 + Utf8 "StackMapTable"; // #19 at 0x91 + Utf8 "main"; // #20 at 0xA1 + Utf8 "([Ljava/lang/String;)V"; // #21 at 0xA8 + Utf8 "SourceFile"; // #22 at 0xC1 + Utf8 "badStackMapTable.java"; // #23 at 0xCE + NameAndType #13 #14; // #24 at 0xDA + class #36; // #25 at 0xDF + NameAndType #37 #38; // #26 at 0xE2 + Utf8 "x"; // #27 at 0xE7 + class #39; // #28 at 0xEB + NameAndType #40 #41; // #29 at 0xEE + Utf8 "java/lang/Exception"; // #30 at 0xF3 + Utf8 "y"; // #31 at 0x0109 + Utf8 "hi"; // #32 at 0x010D + NameAndType #17 #18; // #33 at 0x0112 + Utf8 "badStackMapTable"; // #34 at 0x0117 + Utf8 "java/lang/Throwable"; // #35 at 0x011E + Utf8 "java/lang/System"; // #36 at 0x0134 + Utf8 "out"; // #37 at 0x0147 + Utf8 "Ljava/io/PrintStream;"; // #38 at 0x014D + Utf8 "java/io/PrintStream"; // #39 at 0x0165 + Utf8 "println"; // #40 at 0x017B + Utf8 "(Ljava/lang/String;)V"; // #41 at 0x0185 + } // Constant Pool + + 0x0021; // access [ ACC_PUBLIC ACC_SUPER ] + #11;// this_cpx + #12;// super_cpx + + [0] { // Interfaces + } // Interfaces + + [0] { // fields + } // fields + + [3] { // methods + { // Member at 0x01A9 + 0x0001; // access + #13; // name_cpx + #14; // sig_cpx + [1] { // Attributes + Attr(#15, 29) { // Code at 0x01B1 + 1; // max_stack + 1; // max_locals + Bytes[5]{ + 0x2AB70001B1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#16, 6) { // LineNumberTable at 0x01C8 + [1] { // LineNumberTable + 0 1; // at 0x01D4 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x01D4 + 0x0009; // access + #17; // name_cpx + #18; // sig_cpx + [1] { // Attributes + Attr(#15, 95) { // Code at 0x01DC + 4; // max_stack + 6; // max_locals + Bytes[29]{ + 0xF88520949A000BB2; // Create an illegal opcode by changing 0x1A to 0xF8 + 0x00021203B60004A7; + 0x000D3A05B2000212; + 0x06B60004B1; + }; + [1] { // Traps + 0 15 18 5; // at 0x0211 + } // end Traps + [2] { // Attributes + Attr(#16, 26) { // LineNumberTable at 0x0213 + [6] { // LineNumberTable + 0 5; // at 0x021F + 7 6; // at 0x0223 + 15 10; // at 0x0227 + 18 8; // at 0x022B + 20 9; // at 0x022F + 28 11; // at 0x0233 + } + } // end LineNumberTable + ; + Attr(#19, 8) { // StackMapTable at 0x0233 + [3] { // + 15b; // same_frame + 66b, [1]z{9b,5}; // Create an invalid verification type by changing 7b to 9b + 9b; // same_frame + } + } // end StackMapTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member at 0x0241 + 0x0009; // access + #20; // name_cpx + #21; // sig_cpx + [1] { // Attributes + Attr(#15, 40) { // Code at 0x0249 + 5; // max_stack + 1; // max_locals + Bytes[12]{ + 0x0812071400081203; + 0xB8000AB1; + }; + [0] { // Traps + } // end Traps + [1] { // Attributes + Attr(#16, 10) { // LineNumberTable at 0x0267 + [2] { // LineNumberTable + 0 14; // at 0x0273 + 11 15; // at 0x0277 + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [1] { // Attributes + Attr(#22, 2) { // SourceFile at 0x0279 + #23; + } // end SourceFile + } // Attributes +} // end class badStackMapTable diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/verifier/stackMapTableTests/StackMapTableTest.java openjdk-11-11~24/test/hotspot/jtreg/runtime/verifier/stackMapTableTests/StackMapTableTest.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/verifier/stackMapTableTests/StackMapTableTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/verifier/stackMapTableTests/StackMapTableTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,48 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* + * @test + * @bug 8205422 + * @summary Test that the JVM does not assert when printing a stack map table + * containing a stack map with a bad verification type. + * @compile badStackMapTable.jcod + * @run main/othervm -verify StackMapTableTest + */ + +public class StackMapTableTest { + + public static void main(String args[]) throws Throwable { + System.out.println("Regression test for bug 8205422"); + try { + Class newClass = Class.forName("badStackMapTable"); + throw new RuntimeException("Expected VerifyError exception not thrown"); + } catch (java.lang.VerifyError e) { + if (!e.getMessage().contains("same_locals_1_stack_item_frame(@18,BAD:9)")) { + throw new RuntimeException( + "Unexpected VerifyError message: " + e.getMessage()); + } + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java openjdk-11-11~24/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java --- openjdk-11-11~19/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/runtime/whitebox/WBStackSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,7 +21,7 @@ * questions. */ -/* +/** * @test WBStackSize * @summary verify that whitebox functions getThreadFullStackSize() and getThreadRemainingStackSize are working * @modules java.base/jdk.internal.misc @@ -43,6 +43,7 @@ */ import sun.hotspot.WhiteBox; +import jdk.test.lib.Platform; public class WBStackSize { @@ -83,18 +84,40 @@ } public static void main(String[] args) { + long pageSize = wb.getVMPageSize(); + long configStackSize = wb.getIntxVMFlag("ThreadStackSize") * K; System.out.println("ThreadStackSize VM option: " + configStackSize); - long stackProtectionSize = wb.getIntxVMFlag("StackShadowPages") * wb.getVMPageSize(); + long stackProtectionSize = wb.getIntxVMFlag("StackShadowPages") * pageSize; System.out.println("Size of protected shadow pages: " + stackProtectionSize); long actualStackSize = wb.getThreadStackSize(); System.out.println("Full stack size: " + actualStackSize); - if (Math.abs(actualStackSize - configStackSize) > configStackSize * 0.1) { - throw new RuntimeException("getThreadFullStackSize value [" + actualStackSize - + "] should be within 90%..110% of ThreadStackSize value"); + if (!Platform.isAix()) { + if (Math.abs(actualStackSize - configStackSize) > configStackSize * 0.1) { + throw new RuntimeException("getThreadStackSize value [" + actualStackSize + + "] should be within 90%..110% of ThreadStackSize value"); + } + } else { + // AIX pthread implementation returns stacks with sizes varying a lot. + // We add +64K to assure stacks are not too small, thus we get + // even more variation to bigger sizes. So only check the lower bound. + // Allow for at least one page deviation. + long slack = (long)(configStackSize * 0.1); + if (slack < pageSize) { + if (configStackSize - actualStackSize > pageSize) { + throw new RuntimeException("getThreadStackSize value [" + actualStackSize + + "] should not be more than one page smaller than " + + "ThreadStackSize value"); + } + } else { + if (configStackSize - actualStackSize > slack) { + throw new RuntimeException("getThreadStackSize value [" + actualStackSize + + "] should not be less than 90% of ThreadStackSize value"); + } + } } long remainingStackSize = wb.getThreadRemainingStackSize(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/CanGenerateAllClassHook/CanGenerateAllClassHook.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,6 +27,7 @@ * @summary Tests that jvmtiEnv::GetPotentialCapabilities reports * can_generate_all_class_hook_events capability with CDS (-Xshare:on) * at ONLOAD and LIVE phases + * @requires vm.cds * @library /test/lib * @compile CanGenerateAllClassHook.java * @run main/othervm/native CanGenerateAllClassHook diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/libHeapMonitorTest.c 2018-07-25 15:36:46.000000000 +0000 @@ -208,6 +208,7 @@ ObjectTrace* trace, ExpectedContentFrame *expected, size_t expected_count, + jboolean check_lines, int print_out_comparisons) { jvmtiFrameInfo* frames; size_t i; @@ -224,6 +225,7 @@ char *name = NULL, *signature = NULL, *file_name = NULL; jclass declaring_class; int line_number; + jboolean differ; jvmtiError err; if (bci < 0 && expected[i].line_number != -1) { @@ -258,23 +260,21 @@ return FALSE; } + differ = (strcmp(name, expected[i].name) || + strcmp(signature, expected[i].signature) || + strcmp(file_name, expected[i].file_name) || + (check_lines && line_number != expected[i].line_number)); + if (print_out_comparisons) { - fprintf(stderr, "\tComparing:\n"); + fprintf(stderr, "\tComparing: (check_lines: %d)\n", check_lines); fprintf(stderr, "\t\tNames: %s and %s\n", name, expected[i].name); fprintf(stderr, "\t\tSignatures: %s and %s\n", signature, expected[i].signature); fprintf(stderr, "\t\tFile name: %s and %s\n", file_name, expected[i].file_name); fprintf(stderr, "\t\tLines: %d and %d\n", line_number, expected[i].line_number); - fprintf(stderr, "\t\tResult is %d\n", - (strcmp(name, expected[i].name) || - strcmp(signature, expected[i].signature) || - strcmp(file_name, expected[i].file_name) || - line_number != expected[i].line_number)); + fprintf(stderr, "\t\tResult is %d\n", differ); } - if (strcmp(name, expected[i].name) || - strcmp(signature, expected[i].signature) || - strcmp(file_name, expected[i].file_name) || - line_number != expected[i].line_number) { + if (differ) { return FALSE; } } @@ -369,7 +369,7 @@ return result; } -static double event_storage_get_average_rate(EventStorage* storage) { +static double event_storage_get_average_size(EventStorage* storage) { double accumulation = 0; int max_size; int i; @@ -388,14 +388,15 @@ static jboolean event_storage_contains(JNIEnv* env, EventStorage* storage, ExpectedContentFrame* frames, - size_t size) { + size_t size, + jboolean check_lines) { int i; event_storage_lock(storage); fprintf(stderr, "Checking storage count %d\n", storage->live_object_count); for (i = 0; i < storage->live_object_count; i++) { ObjectTrace* trace = storage->live_objects[i]; - if (check_sample_content(env, trace, frames, size, PRINT_OUT)) { + if (check_sample_content(env, trace, frames, size, check_lines, PRINT_OUT)) { event_storage_unlock(storage); return TRUE; } @@ -407,7 +408,8 @@ static jboolean event_storage_garbage_contains(JNIEnv* env, EventStorage* storage, ExpectedContentFrame* frames, - size_t size) { + size_t size, + jboolean check_lines) { int i; event_storage_lock(storage); fprintf(stderr, "Checking garbage storage count %d\n", @@ -419,7 +421,7 @@ continue; } - if (check_sample_content(env, trace, frames, size, PRINT_OUT)) { + if (check_sample_content(env, trace, frames, size, check_lines, PRINT_OUT)) { event_storage_unlock(storage); return TRUE; } @@ -837,8 +839,8 @@ } JNIEXPORT void JNICALL -Java_MyPackage_HeapMonitor_setSamplingRate(JNIEnv* env, jclass cls, jint value) { - (*jvmti)->SetHeapSamplingRate(jvmti, value); +Java_MyPackage_HeapMonitor_setSamplingInterval(JNIEnv* env, jclass cls, jint value) { + (*jvmti)->SetHeapSamplingInterval(jvmti, value); } JNIEXPORT jboolean JNICALL @@ -876,7 +878,9 @@ } JNIEXPORT jboolean JNICALL -Java_MyPackage_HeapMonitor_obtainedEvents(JNIEnv* env, jclass cls, jobjectArray frames) { +Java_MyPackage_HeapMonitor_obtainedEvents(JNIEnv* env, jclass cls, + jobjectArray frames, + jboolean check_lines) { jboolean result; jsize size = (*env)->GetArrayLength(env, frames); ExpectedContentFrame *native_frames = malloc(size * sizeof(*native_frames)); @@ -886,14 +890,17 @@ } fill_native_frames(env, frames, native_frames, size); - result = event_storage_contains(env, &global_event_storage, native_frames, size); + result = event_storage_contains(env, &global_event_storage, native_frames, + size, check_lines); free(native_frames), native_frames = NULL; return result; } JNIEXPORT jboolean JNICALL -Java_MyPackage_HeapMonitor_garbageContains(JNIEnv* env, jclass cls, jobjectArray frames) { +Java_MyPackage_HeapMonitor_garbageContains(JNIEnv* env, jclass cls, + jobjectArray frames, + jboolean check_lines) { jboolean result; jsize size = (*env)->GetArrayLength(env, frames); ExpectedContentFrame *native_frames = malloc(size * sizeof(*native_frames)); @@ -903,7 +910,8 @@ } fill_native_frames(env, frames, native_frames, size); - result = event_storage_garbage_contains(env, &global_event_storage, native_frames, size); + result = event_storage_garbage_contains(env, &global_event_storage, + native_frames, size, check_lines); free(native_frames), native_frames = NULL; return result; @@ -932,8 +940,8 @@ return FALSE; } - if (check_capability_error((*jvmti)->SetHeapSamplingRate(jvmti, 1<<19), - "Set Heap Sampling Rate")) { + if (check_capability_error((*jvmti)->SetHeapSamplingInterval(jvmti, 1<<19), + "Set Heap Sampling Interval")) { return FALSE; } return TRUE; @@ -942,23 +950,23 @@ JNIEXPORT jboolean JNICALL Java_MyPackage_HeapMonitorIllegalArgumentTest_testIllegalArgument(JNIEnv *env, jclass cls) { - if (check_error((*jvmti)->SetHeapSamplingRate(jvmti, 0), - "Sampling rate 0 failed\n")){ + if (check_error((*jvmti)->SetHeapSamplingInterval(jvmti, 0), + "Sampling interval 0 failed\n")){ return FALSE; } - if (check_error((*jvmti)->SetHeapSamplingRate(jvmti, 1024), - "Sampling rate 1024 failed\n")){ + if (check_error((*jvmti)->SetHeapSamplingInterval(jvmti, 1024), + "Sampling interval 1024 failed\n")){ return FALSE; } - if (!check_error((*jvmti)->SetHeapSamplingRate(jvmti, -1), - "Sampling rate -1 passed\n")){ + if (!check_error((*jvmti)->SetHeapSamplingInterval(jvmti, -1), + "Sampling interval -1 passed\n")){ return FALSE; } - if (!check_error((*jvmti)->SetHeapSamplingRate(jvmti, -1024), - "Sampling rate -1024 passed\n")){ + if (!check_error((*jvmti)->SetHeapSamplingInterval(jvmti, -1024), + "Sampling interval -1024 passed\n")){ return FALSE; } @@ -966,8 +974,8 @@ } JNIEXPORT jdouble JNICALL -Java_MyPackage_HeapMonitorStatRateTest_getAverageRate(JNIEnv *env, jclass cls) { - return event_storage_get_average_rate(&global_event_storage); +Java_MyPackage_HeapMonitor_getAverageSize(JNIEnv *env, jclass cls) { + return event_storage_get_average_size(&global_event_storage); } typedef struct sThreadsFound { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorArrayAllSampledTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorArrayAllSampledTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorArrayAllSampledTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorArrayAllSampledTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,7 @@ /** * @test * @build Frame HeapMonitor - * @summary Verifies the JVMTI Heap Monitor rate when allocating arrays. + * @summary Verifies the JVMTI Heap Monitor interval when allocating arrays. * @compile HeapMonitorArrayAllSampledTest.java * @run main/othervm/native -agentlib:HeapMonitorTest MyPackage.HeapMonitorArrayAllSampledTest */ @@ -46,7 +46,7 @@ public static void main(String[] args) { int sizes[] = {1000, 10000, 100000, 1000000}; - HeapMonitor.setSamplingRate(0); + HeapMonitor.setSamplingInterval(0); HeapMonitor.enableSamplingEvents(); for (int currentSize : sizes) { @@ -56,8 +56,8 @@ allocate(currentSize); // 10% error ensures a sanity test without becoming flaky. - // Flakiness is due to the fact that this test is dependent on the sampling rate, which is a - // statistical geometric variable around the sampling rate. This means that the test could be + // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a + // statistical geometric variable around the sampling interval. This means that the test could be // unlucky and not achieve the mean average fast enough for the test case. if (!HeapMonitor.statsHaveExpectedNumberSamples(maxIteration, 10)) { throw new RuntimeException("Statistics should show about " + maxIteration + " samples."); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorGCCMSTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,6 +28,7 @@ * @summary Verifies the JVMTI Heap Monitor Statistics using CMS GC * @build Frame HeapMonitor * @requires vm.gc == "ConcMarkSweep" | vm.gc == "null" + * @requires !vm.graal.enabled * @compile HeapMonitorGCCMSTest.java * @run main/othervm/native -agentlib:HeapMonitorTest -XX:+UseConcMarkSweepGC MyPackage.HeapMonitorGCTest */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorIllegalArgumentTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorIllegalArgumentTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorIllegalArgumentTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorIllegalArgumentTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,7 @@ /** * @test - * @summary Verifies the JVMTI SetHeapSamplingRate returns an illegal argument for negative ints. + * @summary Verifies the JVMTI SetHeapSamplingInterval returns an illegal argument for negative ints. * @build Frame HeapMonitor * @compile HeapMonitorIllegalArgumentTest.java * @run main/othervm/native -agentlib:HeapMonitorTest MyPackage.HeapMonitorIllegalArgumentTest diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitor.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,9 +23,13 @@ package MyPackage; +import java.lang.management.ManagementFactory; import java.util.ArrayList; import java.util.List; +import com.sun.management.HotSpotDiagnosticMXBean; +import com.sun.management.VMOption; + /** API for handling the underlying heap sampling monitoring system. */ public class HeapMonitor { private static int[][] arrays; @@ -41,8 +45,8 @@ } } - /** Set a specific sampling rate, 0 samples every allocation. */ - public native static void setSamplingRate(int rate); + /** Set a specific sampling interval, 0 samples every allocation. */ + public native static void setSamplingInterval(int interval); public native static void enableSamplingEvents(); public native static boolean enableSamplingEventsForTwoThreads(Thread firstThread, Thread secondThread); public native static void disableSamplingEvents(); @@ -56,7 +60,7 @@ int sum = 0; List<Frame> frames = new ArrayList<Frame>(); allocate(frames); - frames.add(new Frame("allocate", "()Ljava/util/List;", "HeapMonitor.java", 58)); + frames.add(new Frame("allocate", "()Ljava/util/List;", "HeapMonitor.java", 62)); return frames; } @@ -65,8 +69,8 @@ for (int j = 0; j < allocationIterations; j++) { sum += actuallyAllocate(); } - frames.add(new Frame("actuallyAllocate", "()I", "HeapMonitor.java", 93)); - frames.add(new Frame("allocate", "(Ljava/util/List;)V", "HeapMonitor.java", 66)); + frames.add(new Frame("actuallyAllocate", "()I", "HeapMonitor.java", 97)); + frames.add(new Frame("allocate", "(Ljava/util/List;)V", "HeapMonitor.java", 70)); } public static List<Frame> repeatAllocate(int max) { @@ -74,7 +78,7 @@ for (int i = 0; i < max; i++) { frames = allocate(); } - frames.add(new Frame("repeatAllocate", "(I)Ljava/util/List;", "HeapMonitor.java", 75)); + frames.add(new Frame("repeatAllocate", "(I)Ljava/util/List;", "HeapMonitor.java", 79)); return frames; } @@ -98,13 +102,45 @@ return sum; } + private static double averageOneElementSize; + private static native double getAverageSize(); + + // Calculate the size of a 1-element array in order to assess average sampling interval + // via the HeapMonitorStatIntervalTest. This is needed because various GCs could add + // extra memory to arrays. + // This is done by allocating a 1-element array and then looking in the heap monitoring + // samples for the average size of objects collected. + public static void calculateAverageOneElementSize() { + enableSamplingEvents(); + // Assume a size of 24 for the average size. + averageOneElementSize = 24; + + // Call allocateSize once, this allocates the internal array for the iterations. + int totalSize = 10 * 1024 * 1024; + allocateSize(totalSize); + + // Reset the storage and now really track the size of the elements. + resetEventStorage(); + allocateSize(totalSize); + disableSamplingEvents(); + + // Get the actual average size. + averageOneElementSize = getAverageSize(); + if (averageOneElementSize == 0) { + throw new RuntimeException("Could not calculate the average size of a 1-element array."); + } + } + public static int allocateSize(int totalSize) { + if (averageOneElementSize == 0) { + throw new RuntimeException("Average size of a 1-element array was not calculated."); + } + int sum = 0; - // Let us assume that a 1-element array is 24 bytes. - int iterations = totalSize / 24; + int iterations = (int) (totalSize / averageOneElementSize); - if (arrays == null) { + if (arrays == null || arrays.length < iterations) { arrays = new int[iterations][]; } @@ -127,7 +163,7 @@ public static int[][][] sampleEverything() { enableSamplingEvents(); - setSamplingRate(0); + setSamplingInterval(0); // Loop around an allocation loop and wait until the tlabs have settled. final int maxTries = 10; @@ -152,14 +188,42 @@ } public native static int sampledEvents(); - public native static boolean obtainedEvents(Frame[] frames); - public native static boolean garbageContains(Frame[] frames); + public native static boolean obtainedEvents(Frame[] frames, boolean checkLines); + public native static boolean garbageContains(Frame[] frames, boolean checkLines); public native static boolean eventStorageIsEmpty(); public native static void resetEventStorage(); public native static int getEventStorageElementCount(); public native static void forceGarbageCollection(); public native static boolean enableVMEvents(); + private static boolean getCheckLines() { + boolean checkLines = true; + + // Do not check lines for Graal since it is not always "precise" with BCIs at uncommon traps. + try { + HotSpotDiagnosticMXBean bean = ManagementFactory.getPlatformMXBean(HotSpotDiagnosticMXBean.class); + + VMOption enableJVMCI = bean.getVMOption("EnableJVMCI"); + VMOption useJVMCICompiler = bean.getVMOption("UseJVMCICompiler"); + String compiler = System.getProperty("jvmci.Compiler"); + + checkLines = !(enableJVMCI.getValue().equals("true") + && useJVMCICompiler.getValue().equals("true") && compiler.equals("graal")); + } catch (Exception e) { + // NOP. + } + + return checkLines; + } + + public static boolean obtainedEvents(Frame[] frames) { + return obtainedEvents(frames, getCheckLines()); + } + + public static boolean garbageContains(Frame[] frames) { + return garbageContains(frames, getCheckLines()); + } + public static boolean statsHaveExpectedNumberSamples(int expected, int acceptedErrorPercentage) { double actual = getEventStorageElementCount(); double diffPercentage = Math.abs(actual - expected) / expected; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatArrayCorrectnessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,7 +26,7 @@ /** * @test * @build Frame HeapMonitor - * @summary Verifies the JVMTI Heap Monitor rate when allocating arrays. + * @summary Verifies the JVMTI Heap Monitor interval when allocating arrays. * @compile HeapMonitorStatArrayCorrectnessTest.java * @run main/othervm/native -agentlib:HeapMonitorTest MyPackage.HeapMonitorStatArrayCorrectnessTest */ @@ -46,8 +46,6 @@ public static void main(String[] args) { int sizes[] = {1000, 10000, 100000}; - HeapMonitor.enableSamplingEvents(); - for (int currentSize : sizes) { System.out.println("Testing size " + currentSize); @@ -56,12 +54,16 @@ throw new RuntimeException("Should not have any events stored yet."); } + HeapMonitor.enableSamplingEvents(); + // 111 is as good a number as any. final int samplingMultiplier = 111; - HeapMonitor.setSamplingRate(samplingMultiplier * currentSize); + HeapMonitor.setSamplingInterval(samplingMultiplier * currentSize); allocate(currentSize); + HeapMonitor.disableSamplingEvents(); + // For simplifications, we ignore the array memory usage for array internals (with the array // sizes requested, it should be a negligible oversight). // @@ -77,8 +79,8 @@ expected /= samplingMultiplier; // 10% error ensures a sanity test without becoming flaky. - // Flakiness is due to the fact that this test is dependent on the sampling rate, which is a - // statistical geometric variable around the sampling rate. This means that the test could be + // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a + // statistical geometric variable around the sampling interval. This means that the test could be // unlucky and not achieve the mean average fast enough for the test case. if (!HeapMonitor.statsHaveExpectedNumberSamples((int) expected, 10)) { throw new RuntimeException("Statistics should show about " + expected + " samples."); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatIntervalTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2018, Google 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. + */ + +package MyPackage; + +/** + * @test + * @summary Verifies the JVMTI Heap Monitor sampling interval average. + * @build Frame HeapMonitor + * @compile HeapMonitorStatIntervalTest.java + * @requires vm.compMode != "Xcomp" + * @run main/othervm/native -agentlib:HeapMonitorTest MyPackage.HeapMonitorStatIntervalTest + */ + +public class HeapMonitorStatIntervalTest { + private static boolean testIntervalOnce(int interval, boolean throwIfFailure) { + HeapMonitor.resetEventStorage(); + HeapMonitor.setSamplingInterval(interval); + + HeapMonitor.enableSamplingEvents(); + + int allocationTotal = 10 * 1024 * 1024; + int allocationIterations = 10; + + double actualCount = 0; + for (int i = 0; i < allocationIterations; i++) { + HeapMonitor.resetEventStorage(); + HeapMonitor.allocateSize(allocationTotal); + actualCount += HeapMonitor.getEventStorageElementCount(); + } + + HeapMonitor.disableSamplingEvents(); + + double expectedCount = allocationTotal * allocationIterations / interval; + + double error = Math.abs(actualCount - expectedCount); + double errorPercentage = error / expectedCount * 100; + + boolean success = (errorPercentage < 10.0); + + if (!success && throwIfFailure) { + throw new RuntimeException("Interval average over 10% for interval " + interval + " -> " + + actualCount + ", " + expectedCount); + } + + return success; + } + + + private static void testInterval(int interval) { + // Test the interval twice, it can happen that the test is "unlucky" and the interval just goes above + // the 10% mark. So try again to squash flakiness. + // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a + // statistical geometric variable around the sampling interval. This means that the test could be + // unlucky and not achieve the mean average fast enough for the test case. + if (!testIntervalOnce(interval, false)) { + testIntervalOnce(interval, true); + } + } + + public static void main(String[] args) { + int[] tab = {1024, 8192}; + + HeapMonitor.calculateAverageOneElementSize(); + + for (int intervalIdx = 0; intervalIdx < tab.length; intervalIdx++) { + testInterval(tab[intervalIdx]); + } + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatObjectCorrectnessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,19 +41,22 @@ private native static boolean statsHaveExpectedNumberSamples(int expected, int percentError); private static void allocate() { + emptyStorage(); + + HeapMonitor.enableSamplingEvents(); for (int j = 0; j < maxIteration; j++) { obj = new BigObject(); } + HeapMonitor.disableSamplingEvents(); } - private static void testBigAllocationRate() { + private static void testBigAllocationInterval() { final int sizeObject = 1400; // 111 is as good a number as any. final int samplingMultiplier = 111; - HeapMonitor.setSamplingRate(samplingMultiplier * sizeObject); + HeapMonitor.setSamplingInterval(samplingMultiplier * sizeObject); - emptyStorage(); allocate(); // For simplifications, the code is allocating: @@ -76,8 +79,8 @@ expected /= samplingMultiplier; // 10% error ensures a sanity test without becoming flaky. - // Flakiness is due to the fact that this test is dependent on the sampling rate, which is a - // statistical geometric variable around the sampling rate. This means that the test could be + // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a + // statistical geometric variable around the sampling interval. This means that the test could be // unlucky and not achieve the mean average fast enough for the test case. if (!HeapMonitor.statsHaveExpectedNumberSamples((int) expected, 10)) { throw new RuntimeException("Statistics should show about " + expected + " samples."); @@ -94,16 +97,15 @@ private static void testEveryAllocationSampled() { // 0 means sample every allocation. - HeapMonitor.setSamplingRate(0); + HeapMonitor.setSamplingInterval(0); - emptyStorage(); allocate(); double expected = maxIteration; // 10% error ensures a sanity test without becoming flaky. - // Flakiness is due to the fact that this test is dependent on the sampling rate, which is a - // statistical geometric variable around the sampling rate. This means that the test could be + // Flakiness is due to the fact that this test is dependent on the sampling interval, which is a + // statistical geometric variable around the sampling interval. This means that the test could be // unlucky and not achieve the mean average fast enough for the test case. if (!HeapMonitor.statsHaveExpectedNumberSamples((int) expected, 10)) { throw new RuntimeException("Statistics should show about " + expected + " samples."); @@ -111,9 +113,7 @@ } public static void main(String[] args) { - HeapMonitor.enableSamplingEvents(); - - testBigAllocationRate(); + testBigAllocationInterval(); testEveryAllocationSampled(); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatRateTest.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,85 +0,0 @@ -/* - * Copyright (c) 2018, Google 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. - */ - -package MyPackage; - -/** - * @test - * @summary Verifies the JVMTI Heap Monitor sampling rate average. - * @build Frame HeapMonitor - * @compile HeapMonitorStatRateTest.java - * @requires vm.compMode != "Xcomp" - * @run main/othervm/native -agentlib:HeapMonitorTest MyPackage.HeapMonitorStatRateTest - */ - -public class HeapMonitorStatRateTest { - - private native static double getAverageRate(); - - private static boolean testRateOnce(int rate, boolean throwIfFailure) { - HeapMonitor.resetEventStorage(); - HeapMonitor.setSamplingRate(rate); - - HeapMonitor.enableSamplingEvents(); - - int allocationTotal = 10 * 1024 * 1024; - HeapMonitor.allocateSize(allocationTotal); - - HeapMonitor.disableSamplingEvents(); - - double actualCount = HeapMonitor.getEventStorageElementCount(); - double expectedCount = allocationTotal / rate; - - double error = Math.abs(actualCount - expectedCount); - double errorPercentage = error / expectedCount * 100; - - boolean failure = (errorPercentage > 10.0); - - if (failure && throwIfFailure) { - throw new RuntimeException("Rate average over 10% for rate " + rate + " -> " + actualCount - + ", " + expectedCount); - } - - return failure; - } - - - private static void testRate(int rate) { - // Test the rate twice, it can happen that the test is "unlucky" and the rate just goes above - // the 10% mark. So try again to squash flakiness. - // Flakiness is due to the fact that this test is dependent on the sampling rate, which is a - // statistical geometric variable around the sampling rate. This means that the test could be - // unlucky and not achieve the mean average fast enough for the test case. - if (!testRateOnce(rate, false)) { - testRateOnce(rate, true); - } - } - - public static void main(String[] args) { - int[] tab = {1024, 8192}; - - for (int rateIdx = 0; rateIdx < tab.length; rateIdx++) { - testRate(tab[rateIdx]); - } - } -} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorThreadTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,8 +41,8 @@ final int numThreads = 5; List<ThreadInformation> threadList = ThreadInformation.createThreadList(numThreads); - // Sample at a rate of 8k. - HeapMonitor.setSamplingRate(1 << 13); + // Sample at a interval of 8k. + HeapMonitor.setSamplingInterval(1 << 13); HeapMonitor.enableSamplingEvents(); System.err.println("Starting threads"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorVMEventsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,11 +26,13 @@ import java.util.ArrayList; import java.util.List; +// Graal is not tested here due to Graal not supporting DisableIntrinsic. /** * @test * @summary Verifies that when the VM event is sent, sampled events are also collected. * @build Frame HeapMonitor * @compile HeapMonitorVMEventsTest.java + * @requires !vm.graal.enabled * @run main/othervm/native -XX:+UnlockDiagnosticVMOptions * -XX:DisableIntrinsic=_clone * -agentlib:HeapMonitorTest MyPackage.HeapMonitorVMEventsTest @@ -60,10 +62,10 @@ double diff = Math.abs(first - second) * 100; diff /= first; - // Accept a 10% error rate: with objects being allocated: this allows a bit of room in + // Accept a 10% error interval: with objects being allocated: this allows a bit of room in // case other items are getting allocated during the test. if (diff > 10) { - throw new RuntimeException("Error rate is over the accepted rate: " + diff + throw new RuntimeException("Error interval is over the accepted interval: " + diff + ": " + first + " , " + second); } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbAttach.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbAttach.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbAttach.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbAttach.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,10 +27,11 @@ import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8191658 * @summary Test clhsdb attach, detach, reattach commands + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbAttach */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSCore.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,11 +21,12 @@ * questions. */ -/* +/** * @test * @bug 8174994 * @summary Test the clhsdb commands 'printmdo', 'printall' on a CDS enabled corefile. * @requires vm.cds + * @requires vm.hasSA * @requires os.family != "windows" * @requires vm.flavor == "server" * @library /test/lib diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbCDSJstackPrintAll.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,11 +21,11 @@ * questions. */ -/* +/** * @test * @bug 8174994 * @summary Test the clhsdb commands 'jstack', 'printall', 'where' with CDS enabled - * @requires vm.cds + * @requires vm.hasSA & vm.cds * @library /test/lib * @run main/othervm/timeout=2400 -Xmx1g ClhsdbCDSJstackPrintAll */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbField.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbField.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbField.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbField.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,10 +26,11 @@ import java.util.Map; import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8191538 * @summary Test clhsdb 'field' command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbField */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbFindPC.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,10 +28,11 @@ import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8193124 * @summary Test the clhsdb 'findpc' command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbFindPC */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbFlags.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,10 +30,11 @@ import jdk.test.lib.Platform; import jdk.test.lib.Utils; -/* +/** * @test * @bug 8190198 * @summary Test clhsdb flags command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbFlags */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbInspect.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,10 +27,11 @@ import java.util.ArrayList; import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8192985 * @summary Test the clhsdb 'inspect' command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbInspect */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbJdis.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbJdis.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbJdis.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbJdis.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,10 +28,11 @@ import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8193124 * @summary Test the clhsdb 'jdis' command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbJdis */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbJhisto.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -29,10 +29,11 @@ import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.Utils; -/* +/** * @test * @bug 8191658 * @summary Test clhsdb jhisto command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbJhisto */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbJstack.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,10 +28,11 @@ import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.Platform; -/* +/** * @test * @bug 8190198 * @summary Test clhsdb Jstack command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbJstack */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbLongConstant.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbLongConstant.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbLongConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbLongConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,10 +28,11 @@ import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.Platform; -/* +/** * @test * @bug 8190198 * @summary Test clhsdb longConstant command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbLongConstant */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPmap.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,10 +28,11 @@ import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.Platform; -/* +/** * @test * @bug 8190198 * @summary Test clhsdb pmap command + * @requires vm.hasSA * @library /test/lib * @requires os.family != "mac" * @run main/othervm ClhsdbPmap diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAll.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,10 +26,11 @@ import java.util.Map; import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8175384 * @summary Test clhsdb 'printall' command + * @requires vm.hasSA * @library /test/lib * @run main/othervm/timeout=2400 -Xmx1g ClhsdbPrintAll */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAs.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAs.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAs.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintAs.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,10 +27,11 @@ import java.util.ArrayList; import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8192985 * @summary Test the clhsdb 'printas' command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbPrintAs */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPrintStatics.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,10 +28,11 @@ import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.Platform; -/* +/** * @test * @bug 8190198 * @summary Test clhsdb printstatics command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbPrintStatics */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbPstack.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,12 +28,12 @@ import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.Platform; -/* +/** * @test * @bug 8190198 * @summary Test clhsdb pstack command + * @requires vm.hasSA & os.family != "mac" * @library /test/lib - * @requires os.family != "mac" * @run main/othervm ClhsdbPstack */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbRegionDetailsScanOopsForG1.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,12 +27,12 @@ import java.util.Map; import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8175312 * @summary Test clhsdb 'g1regiondetails' and 'scanoops' commands for G1GC + * @requires vm.hasSA & (vm.bits == "64" & os.maxMemory > 8g) * @library /test/lib - * @requires (vm.bits == "64" & os.maxMemory > 8g) * @run main/othervm/timeout=2400 ClhsdbRegionDetailsScanOopsForG1 */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbScanOops.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,10 +28,11 @@ import jdk.test.lib.Utils; import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8192985 * @summary Test the clhsdb 'scanoops' command + * @requires vm.hasSA * @library /test/lib * @run main/othervm/timeout=1200 ClhsdbScanOops */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbSource.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbSource.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbSource.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbSource.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,10 +30,11 @@ import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8192823 * @summary Test clhsdb source command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbSource */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbSymbol.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbSymbol.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbSymbol.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbSymbol.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,10 +28,11 @@ import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.Platform; -/* +/** * @test * @bug 8190198 * @summary Test clhsdb symboldump command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbSymbol */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbSymbolTable.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbSymbolTable.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbSymbolTable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbSymbolTable.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -27,10 +27,11 @@ import java.util.ArrayList; import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8191538 * @summary Test the clhsdb 'symboltable' and 'symbol' commands + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbSymbolTable */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbThread.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbThread.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbThread.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbThread.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,10 +26,11 @@ import java.util.Map; import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8193352 * @summary Test clhsdb 'thread' and 'threads' commands + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbThread */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbVmStructsDump.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbVmStructsDump.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbVmStructsDump.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbVmStructsDump.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,10 +26,11 @@ import java.util.Map; import jdk.test.lib.apps.LingeredApp; -/* +/** * @test * @bug 8191538 * @summary Test clhsdb 'vmstructsdump' command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbVmStructsDump */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/ClhsdbWhere.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,10 +28,11 @@ import jdk.test.lib.apps.LingeredApp; import jdk.test.lib.Platform; -/* +/** * @test * @bug 8190198 * @summary Test clhsdb where command + * @requires vm.hasSA * @library /test/lib * @run main/othervm ClhsdbWhere */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/DeadlockDetectionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -35,9 +35,10 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @summary Test deadlock detection + * @requires vm.hasSAandCanAttach * @library /test/lib * @modules java.base/jdk.internal.misc * @modules java.management @@ -69,14 +70,6 @@ public static void main(String[] args) throws Exception { System.out.println("Starting DeadlockDetectionTest"); - if (!Platform.shouldSAAttach()) { - // Silently skip the test if we don't have enough permissions to attach - // Not all conditions checked by function is relevant to SA but it's worth - // to check - System.err.println("Error! Insufficient permissions to attach."); - return; - } - if (Platform.isOSX()) { // Coredump stackwalking is not implemented for Darwin System.out.println("This test is not expected to work on OS X. Skipping"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/JhsdbThreadInfoTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/JhsdbThreadInfoTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/JhsdbThreadInfoTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/JhsdbThreadInfoTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,18 +32,15 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; -/* +/** * @test + * @requires vm.hasSAandCanAttach * @library /test/lib * @run main JhsdbThreadInfoTest */ public class JhsdbThreadInfoTest { public static void main(String[] args) throws Exception { - if (!Platform.shouldSAAttach()) { - System.out.println("SA attach not expected to work - test skipped."); - return; - } LingeredApp app = null; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/jmap-hprof/JMapHProfLargeHeapTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -37,10 +37,11 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @bug 6313383 * @key regression + * @requires vm.hasSAandCanAttach * @summary Regression test for hprof export issue due to large heaps (>2G) * @library /test/lib * @modules java.base/jdk.internal.misc @@ -58,10 +59,6 @@ private static final long G = 1024L * M; public static void main(String[] args) throws Exception { - if (!Platform.shouldSAAttach()) { - System.out.println("SA attach not expected to work - test skipped."); - return; - } // All heap dumps should create 1.0.2 file format testHProfFileFormat("-Xmx1g", 22 * M, HPROF_HEADER_1_0_2); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/sadebugd/SADebugDTest.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/sadebugd/SADebugDTest.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/sadebugd/SADebugDTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/sadebugd/SADebugDTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,15 +21,17 @@ * questions. */ -/* +/** * @test * @summary Checks that the jshdb debugd utility sucessfully starts * and tries to attach to a running process + * @requires vm.hasSAandCanAttach * @modules java.base/jdk.internal.misc * @library /test/lib * * @run main/othervm SADebugDTest */ + import java.io.File; import java.util.concurrent.CountDownLatch; import java.io.InputStreamReader; @@ -38,7 +40,6 @@ import java.util.concurrent.TimeUnit; import java.util.function.Predicate; import static jdk.test.lib.Asserts.assertTrue; -import static jdk.test.lib.Platform.shouldSAAttach; import static jdk.test.lib.process.ProcessTools.startProcess; public class SADebugDTest { @@ -55,11 +56,6 @@ public static void main(String[] args) throws Exception { - if (!shouldSAAttach()) { - log("Not possible to attach the SA. Skipping the test"); - return; - } - long ourPid = ProcessHandle.current().pid(); // The string we are expecting in the debugd ouput diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestClassDump.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestClassDump.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestClassDump.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestClassDump.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -30,10 +30,11 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @bug 8184982 * @summary Test ClassDump tool + * @requires vm.hasSAandCanAttach * @library /test/lib * @run main/othervm TestClassDump */ @@ -82,12 +83,6 @@ } public static void main(String[] args) throws Exception { - if (!Platform.shouldSAAttach()) { - // Silently skip the test if we don't have enough permissions to attach - System.out.println("SA attach not expected to work - test skipped."); - return; - } - LingeredApp theApp = null; try { theApp = LingeredApp.startApp(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestClhsdbJstackLock.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestClhsdbJstackLock.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestClhsdbJstackLock.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestClhsdbJstackLock.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,8 +36,9 @@ import jdk.test.lib.Utils; import jdk.test.lib.Asserts; -/* +/** * @test + * @requires vm.hasSAandCanAttach * @library /test/lib * @run main/othervm TestClhsdbJstackLock */ @@ -145,11 +146,6 @@ LingeredApp app = null; - if (!Platform.shouldSAAttach()) { - System.out.println("SA attach not expected to work - test skipped."); - return; - } - try { List<String> vmArgs = new ArrayList<String>(Utils.getVmOptions()); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestCpoolForInvokeDynamic.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,10 +41,10 @@ import jdk.test.lib.Utils; import jdk.test.lib.Asserts; -/* +/** * @test * @library /test/lib - * @requires os.family != "mac" + * @requires vm.hasSAandCanAttach & os.family != "mac" * @modules java.base/jdk.internal.misc * jdk.hotspot.agent/sun.jvm.hotspot * jdk.hotspot.agent/sun.jvm.hotspot.utilities @@ -120,12 +120,6 @@ "LingeredAppWithInvokeDynamic" }; - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - if (args == null || args.length == 0) { try { List<String> vmArgs = new ArrayList<String>(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestDefaultMethods.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,10 +40,10 @@ import jdk.test.lib.Utils; import jdk.test.lib.Asserts; -/* +/** * @test * @library /test/lib - * @requires os.family != "mac" + * @requires vm.hasSAandCanAttach & os.family != "mac" * @modules java.base/jdk.internal.misc * jdk.hotspot.agent/sun.jvm.hotspot * jdk.hotspot.agent/sun.jvm.hotspot.utilities @@ -131,12 +131,6 @@ "SlytherinSpeak" }; - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - if (args == null || args.length == 0) { try { List<String> vmArgs = new ArrayList<String>(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestG1HeapRegion.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,10 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; -/* +/** * @test * @library /test/lib - * @requires os.family != "mac" + * @requires vm.hasSAandCanAttach & os.family != "mac" * @requires vm.gc.G1 * @modules jdk.hotspot.agent/sun.jvm.hotspot * jdk.hotspot.agent/sun.jvm.hotspot.gc.g1 @@ -88,12 +88,6 @@ } public static void main (String... args) throws Exception { - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - if (args == null || args.length == 0) { try { List<String> vmArgs = new ArrayList<String>(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForInvokeDynamic.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,10 +46,10 @@ import jdk.test.lib.hprof.parser.PositionDataInputStream; import jdk.test.lib.hprof.model.Snapshot; -/* +/** * @test * @library /test/lib - * @requires os.family != "mac" + * @requires vm.hasSAandCanAttach & os.family != "mac" * @modules java.base/jdk.internal.misc * jdk.hotspot.agent/sun.jvm.hotspot * jdk.hotspot.agent/sun.jvm.hotspot.utilities @@ -115,12 +115,6 @@ String heapDumpFileName = "lambdaHeapDump.bin"; - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - File heapDumpFile = new File(heapDumpFileName); if (heapDumpFile.exists()) { heapDumpFile.delete(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestHeapDumpForLargeArray.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -42,11 +42,11 @@ import jdk.test.lib.Utils; import jdk.test.lib.Asserts; -/* +/** * @test * @library /test/lib * @bug 8171084 - * @requires (vm.bits == "64" & os.maxMemory > 8g) + * @requires vm.hasSAandCanAttach & (vm.bits == "64" & os.maxMemory > 8g) * @modules java.base/jdk.internal.misc * jdk.hotspot.agent/sun.jvm.hotspot * jdk.hotspot.agent/sun.jvm.hotspot.utilities @@ -89,12 +89,6 @@ String heapDumpFileName = "LargeArrayHeapDump.bin"; - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - File heapDumpFile = new File(heapDumpFileName); if (heapDumpFile.exists()) { heapDumpFile.delete(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSizeForInterface.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,9 +38,10 @@ import jdk.test.lib.Utils; import jdk.test.lib.Asserts; -/* +/** * @test * @library /test/lib + * @requires vm.hasSAandCanAttach * @modules java.base/jdk.internal.misc * jdk.hotspot.agent/sun.jvm.hotspot * jdk.hotspot.agent/sun.jvm.hotspot.utilities @@ -152,12 +153,6 @@ "LingeredAppWithInterface$1" }; - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - if (args == null || args.length == 0) { try { List<String> vmArgs = new ArrayList<String>(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestInstanceKlassSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -41,9 +41,10 @@ import java.io.*; import java.util.*; -/* +/** * @test * @library /test/lib + * @requires vm.hasSAandCanAttach * @modules java.base/jdk.internal.misc * jdk.hotspot.agent/sun.jvm.hotspot * jdk.hotspot.agent/sun.jvm.hotspot.utilities @@ -174,11 +175,6 @@ public static void main(String[] args) throws Exception { - if (!Platform.shouldSAAttach()) { - System.out.println("SA attach not expected to work - test skipped."); - return; - } - if (args == null || args.length == 0) { System.out.println ("No args run. Starting with args now."); startMeWithArgs(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestIntConstant.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestIntConstant.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestIntConstant.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestIntConstant.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,10 +32,11 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; -/* +/** * @test * @summary Test the 'intConstant' command of jhsdb clhsdb. * @bug 8190307 + * @requires vm.hasSAandCanAttach * @library /test/lib * @build jdk.test.lib.apps.* * @run main/othervm TestIntConstant @@ -129,12 +130,6 @@ public static void main (String... args) throws Exception { - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - try { testIntConstant(); } catch (Exception e) { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackLock.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackLock.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackLock.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestJhsdbJstackLock.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,9 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; -/* +/** * @test + * @requires vm.hasSAandCanAttach * @library /test/lib * @run main/othervm TestJhsdbJstackLock */ @@ -49,11 +50,6 @@ LingeredApp app = null; - if (!Platform.shouldSAAttach()) { - System.out.println("SA attach not expected to work - test skipped."); - return; - } - try { List<String> vmArgs = new ArrayList<String>(Utils.getVmOptions()); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestJmapCore.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,9 +21,10 @@ * questions. */ -/* +/** * @test TestJmapCore * @summary Test verifies that jhsdb jmap could generate heap dump from core when heap is full + * @requires vm.hasSA * @library /test/lib * @run driver/timeout=240 TestJmapCore run heap */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestJmapCoreMetaspace.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestJmapCoreMetaspace.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestJmapCoreMetaspace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestJmapCoreMetaspace.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,9 +21,10 @@ * questions. */ -/* +/** * @test TestJmapCoreMetaspace * @summary Test verifies that jhsdb jmap could generate heap dump from core when metspace is full + * @requires vm.hasSA * @library /test/lib * @run driver/timeout=240 TestJmapCore run metaspace */ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestPrintMdo.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,9 +36,10 @@ import jdk.test.lib.Utils; import jdk.test.lib.Asserts; -/* +/** * @test * @library /test/lib + * @requires vm.hasSAandCanAttach * @requires vm.flavor == "server" & !vm.emulatedClient & !(vm.opt.TieredStopAtLevel == 1) * @build jdk.test.lib.apps.* * @run main/othervm TestPrintMdo @@ -148,12 +149,6 @@ LingeredApp app = null; - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - try { List<String> vmArgs = new ArrayList<String>(); vmArgs.add("-XX:+ProfileInterpreter"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestRevPtrsForInvokeDynamic.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -36,10 +36,10 @@ import jdk.test.lib.process.ProcessTools; import jdk.test.lib.Utils; -/* +/** * @test * @library /test/lib - * @requires os.family != "mac" + * @requires vm.hasSAandCanAttach & os.family != "mac" * @modules java.base/jdk.internal.misc * jdk.hotspot.agent/sun.jvm.hotspot * jdk.hotspot.agent/sun.jvm.hotspot.utilities @@ -80,12 +80,6 @@ } public static void main (String... args) throws Exception { - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - if (args == null || args.length == 0) { try { List<String> vmArgs = new ArrayList<String>(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestType.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestType.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestType.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,10 +32,11 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.Utils; -/* +/** * @test * @summary Test the 'type' command of jhsdb clhsdb. * @bug 8190307 + * @requires vm.hasSAandCanAttach * @library /test/lib * @build jdk.test.lib.apps.* * @run main/othervm TestType @@ -95,12 +96,6 @@ public static void main (String... args) throws Exception { LingeredApp app = null; - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - try { List<String> vmArgs = new ArrayList<String>(); vmArgs.addAll(Utils.getVmOptions()); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestUniverse.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestUniverse.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/sa/TestUniverse.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/sa/TestUniverse.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,10 @@ import jdk.test.lib.Platform; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Test the 'universe' command of jhsdb clhsdb. - * @requires vm.gc != "Z" + * @requires vm.hasSAandCanAttach & vm.gc != "Z" * @bug 8190307 * @library /test/lib * @build jdk.test.lib.apps.* @@ -45,10 +45,10 @@ * @run main/othervm -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI -Xbootclasspath/a:. TestUniverse withoutZ */ -/* +/** * @test * @summary Test the 'universe' command of jhsdb clhsdb. - * @requires vm.gc == "Z" + * @requires vm.hasSAandCanAttach & vm.gc == "Z" * @bug 8190307 * @library /test/lib * @build jdk.test.lib.apps.* @@ -147,13 +147,6 @@ public static void main (String... args) throws Exception { - - if (!Platform.shouldSAAttach()) { - System.out.println( - "SA attach not expected to work - test skipped."); - return; - } - try { test("-XX:+UseG1GC"); test("-XX:+UseParallelGC"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/tmtools/jstat/GcCauseTest02.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,10 +32,13 @@ * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share - * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcCauseTest02 */ import utils.*; +// This test produces more than 90_000 classes until it eats up ~70% of the 128M meta space. +// We turn off VerifyDependencies because it slows down the test considerably in debug builds. public class GcCauseTest02 { public static void main(String[] args) throws Exception { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java openjdk-11-11~24/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java --- openjdk-11-11~19/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/serviceability/tmtools/jstat/GcTest02.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,10 +32,13 @@ * @modules java.base/jdk.internal.misc * @library /test/lib * @library ../share - * @run main/othervm -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02 + * @run main/othervm -XX:+IgnoreUnrecognizedVMOptions -XX:-VerifyDependencies + -XX:+UsePerfData -XX:MaxNewSize=4m -XX:MaxHeapSize=128M -XX:MaxMetaspaceSize=128M GcTest02 */ import utils.*; +// This test produces more than 90_000 classes until it eats up ~70% of the 128M meta space. +// We turn off VerifyDependencies because it slows down the test considerably in debug builds. public class GcTest02 { public static void main(String[] args) throws Exception { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/TEST.groups openjdk-11-11~24/test/hotspot/jtreg/TEST.groups --- openjdk-11-11~19/test/hotspot/jtreg/TEST.groups 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/TEST.groups 2018-07-25 15:36:46.000000000 +0000 @@ -76,7 +76,8 @@ hotspot_not_fast_compiler = \ :hotspot_compiler \ -:tier1_compiler \ - -:hotspot_slow_compiler + -:hotspot_slow_compiler \ + -compiler/graalunit hotspot_slow_compiler = \ compiler/codegen/aes \ @@ -156,7 +157,6 @@ applications/ctw/modules/java_desktop_2.java ctw_3 = \ - applications/ctw/modules/javafx_graphics.java \ applications/ctw/modules/java_xml.java \ applications/ctw/modules/jdk_compiler.java \ applications/ctw/modules/jdk_internal_vm_compiler.java \ @@ -329,846 +329,19 @@ vmTestbase_nsk_monitoring = \ vmTestbase/nsk/monitoring -vmTestbase_nsk_monitoring_quick = \ - vmTestbase/nsk/monitoring/MemoryNotificationInfo/MemoryNotificationInfo/info001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryNotificationInfo/from/from001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryNotificationInfo/getCount/getcount001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryNotificationInfo/getPoolName/getpoolname001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryNotificationInfo/getUsage/getusage001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold002/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold003/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold004/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold005/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryUsage/MemoryUsage/memoryusage001/TestDescription.java \ - vmTestbase/nsk/monitoring/MemoryUsage/from/from001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadInfo/from_c/from_c001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadInfo/getLockName/getlockname001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadInfo/getLockOwnerName/getlockownername001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadInfo/isInNative/isinnative001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadInfo/isSuspended/issuspended001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadInfo/isSuspended/issuspended002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find006/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset005/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel001/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel002/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel003/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel004/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel005/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel001/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel002/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel003/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel004/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel005/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername001/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername002/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername003/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername004/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername005/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames001/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames002/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames003/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames004/TestDescription.java \ - vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames005/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount001/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount002/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount003/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount004/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount005/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime001/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime002/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime003/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime004/TestDescription.java \ - vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime005/TestDescription.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean001/RuntimeMXBean001.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean002/TestDescription.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean003/TestDescription.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean004/TestDescription.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean005/TestDescription.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean006/RuntimeMXBean006.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean007/TestDescription.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean008/TestDescription.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean009/TestDescription.java \ - vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean010/TestDescription.java \ - vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon001/comptimemon001.java \ - vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon002/TestDescription.java \ - vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon003/TestDescription.java \ - vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon004/TestDescription.java \ - vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread001/RunningThread001.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock002/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock003/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock004/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock005/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/NativeDeadlock001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/SynchronizerDeadlock001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/SynchronizedMethodDeadlock001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/MixedDeadlock001/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_directly/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_server_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_server_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_proxy_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_proxy_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_directly/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_server_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_server_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_proxy_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_proxy_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_directly/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_server_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_server_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_proxy_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_proxy_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_directly/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_server_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_server_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_proxy_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_proxy_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_directly_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_server_default_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_server_custom_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_proxy_default_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_proxy_custom_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_directly_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_server_default_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_server_custom_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_proxy_default_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_proxy_custom_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_directly_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_server_default_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_server_custom_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_proxy_default_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_proxy_custom_array/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_directly_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_server_default_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_server_custom_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_proxy_default_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_proxy_custom_string/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_directly/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_server_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_server_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_proxy_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_proxy_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_directly/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_server_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_server_custom/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_proxy_default/TestDescription.java \ - vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_proxy_custom/TestDescription.java - - # Tests for default method implementation vmTestbase_vm_defmeth = \ vmTestbase/vm/runtime/defmeth - # JDI tests vmTestbase_nsk_jdi = \ vmTestbase/nsk/jdi - # Stress tests for classes loading/unloading # NSK tests for functionality of the HS system dictionary vmTestbase_nsk_sysdict = \ vmTestbase/nsk/sysdict/vm/stress - -vmTestbase_nsk_jdi_quick = \ - vmTestbase/nsk/jdi/Argument/description/description001/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/isValid/isvalid001/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/isValid/isvalid002/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/isValid/isvalid003/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/isValid/isvalid004/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/isValid/isvalid005/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/name/name001/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/value/value001/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/value/value002/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/value/value003/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/setValue/setvalue001/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/setValue/setvalue002/TestDescription.java \ - vmTestbase/nsk/jdi/Argument/mustSpecify/mustspecify001/TestDescription.java \ - vmTestbase/nsk/jdi/AttachingConnector/attach/attach002/TestDescription.java \ - vmTestbase/nsk/jdi/BooleanArgument/booleanValue/booleanvalue001/TestDescription.java \ - vmTestbase/nsk/jdi/BooleanArgument/booleanValue/booleanvalue002/TestDescription.java \ - vmTestbase/nsk/jdi/BooleanArgument/isValid/isvalid001/TestDescription.java \ - vmTestbase/nsk/jdi/BooleanArgument/isValid/isvalid002/TestDescription.java \ - vmTestbase/nsk/jdi/BooleanArgument/setValue/setvalue001/TestDescription.java \ - vmTestbase/nsk/jdi/BooleanArgument/setValue/setvalue002/TestDescription.java \ - vmTestbase/nsk/jdi/BooleanArgument/stringValueOf/stringvalueof001/TestDescription.java \ - vmTestbase/nsk/jdi/BooleanArgument/stringValueOf/stringvalueof002/TestDescription.java \ - vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses001/TestDescription.java \ - vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses002/TestDescription.java \ - vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses003/TestDescription.java \ - vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses004/TestDescription.java \ - vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses005/TestDescription.java \ - vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses002/TestDescription.java \ - vmTestbase/nsk/jdi/Connector/defaultArguments/defaultArguments001/TestDescription.java \ - vmTestbase/nsk/jdi/Connector/defaultArguments/defaultArguments002/TestDescription.java \ - vmTestbase/nsk/jdi/Connector/defaultArguments/defaultArguments003/TestDescription.java \ - vmTestbase/nsk/jdi/Connector/description/description001/TestDescription.java \ - vmTestbase/nsk/jdi/Connector/name/name001/TestDescription.java \ - vmTestbase/nsk/jdi/Connector/transport/transport001/TestDescription.java \ - vmTestbase/nsk/jdi/FloatValue/compareTo/compareto001/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerArgument/intValue/intvalue001/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerArgument/intValue/intvalue002/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerArgument/isValid/isvalid001/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerArgument/isValid/isvalid002/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerArgument/isValid/isvalid003/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerArgument/max/max001/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerArgument/min/min001/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerArgument/setValue/setvalue001/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerArgument/stringValueOf/stringvalueof001/TestDescription.java \ - vmTestbase/nsk/jdi/IntegerValue/compareTo/compareto001/TestDescription.java \ - vmTestbase/nsk/jdi/LaunchingConnector/launch/launch001/TestDescription.java \ - vmTestbase/nsk/jdi/LaunchingConnector/launch/launch002/TestDescription.java \ - vmTestbase/nsk/jdi/LaunchingConnector/launch/launch004/TestDescription.java \ - vmTestbase/nsk/jdi/ListeningConnector/accept/accept001/TestDescription.java \ - vmTestbase/nsk/jdi/ListeningConnector/accept/accept002/TestDescription.java \ - vmTestbase/nsk/jdi/ListeningConnector/stopListening/stoplis001/TestDescription.java \ - vmTestbase/nsk/jdi/ListeningConnector/supportsMultipleConnections/supportsmultipleconnections001/TestDescription.java \ - vmTestbase/nsk/jdi/ListeningConnector/listennosuspend/listennosuspend001/TestDescription.java \ - vmTestbase/nsk/jdi/LongValue/compareTo/compareto001/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/entryCount/entrycount002/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/owningThread/owningthread002/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/waitingThreads/waitingthreads002/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/waitingThreads/waitingthreads003/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/waitingThreads/waitingthreads004/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/isVerified/isverified003/TestDescription.java \ - vmTestbase/nsk/jdi/SelectedArgument/choices/choices001/TestDescription.java \ - vmTestbase/nsk/jdi/SelectedArgument/isValid/isvalid001/TestDescription.java \ - vmTestbase/nsk/jdi/SelectedArgument/isValid/isvalid002/TestDescription.java \ - vmTestbase/nsk/jdi/ShortType/_itself_/shorttype001/TestDescription.java \ - vmTestbase/nsk/jdi/ShortValue/compareTo/compareto001/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject002/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/thread/thread001/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname001/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname002/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables001/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables002/TestDescription.java \ - vmTestbase/nsk/jdi/StepEvent/_itself_/stepevent001/TestDescription.java \ - vmTestbase/nsk/jdi/StepEvent/_itself_/stepevent002/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addClassExclusionFilter/filter001/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addClassExclusionFilter/filter002/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addClassFilter_s/filter_s001/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addClassFilter_s/filter_s002/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt001/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt002/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/depth/depth001/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/depth/depth002/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/depth/depth003/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/size/size001/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/size/size002/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/thread/thread001/TestDescription.java \ - vmTestbase/nsk/jdi/StringArgument/isValid/isvalid001/TestDescription.java \ - vmTestbase/nsk/jdi/StringArgument/isValid/isvalid002/TestDescription.java \ - vmTestbase/nsk/jdi/StringArgument/isValid/isvalid003/TestDescription.java \ - vmTestbase/nsk/jdi/StringReference/value/value001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadDeathEvent/thread/thread001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter002/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter003/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter004/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter005/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadGroupReference/name/name001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadGroupReference/parent/parent001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadGroupReference/resume/resume001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadGroupReference/suspend/suspend001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadGroupReference/threadGroups/threadgroups001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadGroupReference/threads/threads001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/frame/frame001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/frameCount/framecount001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/frames/frames001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii002/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/isAtBreakpoint/isatbreakpoint001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended003/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended004/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/name/name001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/ownedMonitors/ownedmonitors001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/suspendCount/suspendcount001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/threadGroup/threadgroup001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/currentContendedMonitor/currentcm001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/interrupt/interrupt001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/resume/resume001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/status/status003/status003.java \ - vmTestbase/nsk/jdi/ThreadReference/status/status004/status004.java \ - vmTestbase/nsk/jdi/ThreadReference/status/status005/status005.java \ - vmTestbase/nsk/jdi/ThreadReference/status/status006/status006.java \ - vmTestbase/nsk/jdi/ThreadReference/status/status007/status007.java \ - vmTestbase/nsk/jdi/ThreadReference/status/status008/status008.java \ - vmTestbase/nsk/jdi/ThreadReference/stop/stop001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter002/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter003/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter004/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter005/TestDescription.java \ - vmTestbase/nsk/jdi/Transport/name/name001/TestDescription.java \ - vmTestbase/nsk/jdi/Type/name/name001/TestDescription.java \ - vmTestbase/nsk/jdi/Type/name/name002/TestDescription.java \ - vmTestbase/nsk/jdi/Type/name/name003/TestDescription.java \ - vmTestbase/nsk/jdi/Type/signature/signature001/TestDescription.java \ - vmTestbase/nsk/jdi/Type/signature/signature002/TestDescription.java \ - vmTestbase/nsk/jdi/Type/signature/signature003/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype002/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype003/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype007/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype008/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isFinal/isfinal001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isFinal/isfinal003/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isStatic/isstatic001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isStatic/isstatic003/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic002/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/name/name001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/name/name003/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/signature/sign001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/signature/sign003/TestDescription.java \ - vmTestbase/nsk/jdi/Value/type/type001/TestDescription.java \ - vmTestbase/nsk/jdi/Value/type/type002/type002.java \ - vmTestbase/nsk/jdi/Value/type/type003/TestDescription.java \ - vmTestbase/nsk/jdi/Value/_itself_/value001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/allClasses/allclasses001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/allClasses/allclasses002/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/allThreads/allthreads001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canGetBytecodes/cangetbytecodes001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canGetCurrentContendedMonitor/cangccm001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canGetMonitorInfo/cangetmonitorinfo001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canGetOwnedMonitorInfo/cangetinfo001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canGetSyntheticAttribute/cangetattr001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldAccess/canwatchaccess001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldModification/canwatchmod001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/classesByName/classesbyname001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/description/description001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/eventQueue/eventqueue001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/eventRequestManager/eventrmanager001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/exit/exit001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/exit/exit002/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_bool/mirrorof_bool001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_byte/mirrorof_byte001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_char/mirrorof_char001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_double/mirrorof_double001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_float/mirrorof_float001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_int/mirrorof_int001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_long/mirrorof_long001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_short/mirrorof_short001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_string/mirrorof_string001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/name/name001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/process/process001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/topLevelThreadGroups/toplevelgroups001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/version/version001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/allConnectors/allconnectors001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/attachingConnectors/attaching001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm002/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm003/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/defaultConnector/default001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/launchingConnectors/launching001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/listeningConnectors/listening001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/majorInterfaceVersion/major001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/minorInterfaceVersion/minor001/TestDescription.java \ - vmTestbase/nsk/jdi/VoidType/_itself_/voidtype001/TestDescription.java \ - vmTestbase/nsk/jdi/VoidValue/equals/equals001/equals001.java \ - vmTestbase/nsk/jdi/VoidValue/hashCode/hashcode001/hashcode001.java \ - vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath001/TestDescription.java \ - vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath002/TestDescription.java \ - vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath003/TestDescription.java \ - vmTestbase/nsk/jdi/VMDisconnectEvent/_itself_/disconnect001/TestDescription.java \ - vmTestbase/nsk/jdi/VMDisconnectEvent/_itself_/disconnect002/TestDescription.java \ - vmTestbase/nsk/jdi/VMDisconnectEvent/_itself_/disconnect003/TestDescription.java \ - vmTestbase/nsk/jdi/VMStartEvent/thread/thread001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointEvent/object/object001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointEvent/field/field001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointEvent/valueCurrent/valuecur001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter002/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter003/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter004/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s002/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s003/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s004/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt002/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt003/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt004/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt005/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt006/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter002/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter003/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter004/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter005/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter006/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter007/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter008/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/field/field001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/field/field002/TestDescription.java \ - vmTestbase/nsk/jdi/AttachingConnector/attach/attach003/TestDescription.java \ - vmTestbase/nsk/jdi/ClassObjectReference/toString/tostring001/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod003/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod010/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod012/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod013/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod014/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/newInstance/newinstance009/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/setValue/setvalue006/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/setValue/setvalue007/TestDescription.java \ - vmTestbase/nsk/jdi/Connector/_bounds_/bounds001/TestDescription.java \ - vmTestbase/nsk/jdi/Connector/toString/tostring001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc01x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc01x002/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc02x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc02x002/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc03x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc04x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc04x002/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc05x002/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc06x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc07x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc08x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc09x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc09x002/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc10x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/hotswap/tc10x002/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/multithrd/tc01x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x002/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x003/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/multithrd/tc03x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/multithrd/tc04x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/singlethrd/tc01x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/singlethrd/tc01x002/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/singlethrd/tc02x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/singlethrd/tc03x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/singlethrd/tc03x002/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/singlethrd/tc03x003/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/singlethrd/tc04x001/TestDescription.java \ - vmTestbase/nsk/jdi/BScenarios/singlethrd/tc05x001/TestDescription.java \ - vmTestbase/nsk/jdi/Event/equals/equals001/TestDescription.java \ - vmTestbase/nsk/jdi/Event/hashCode/hashcode001/TestDescription.java \ - vmTestbase/nsk/jdi/EventQueue/hashCode/hashcode001/TestDescription.java \ - vmTestbase/nsk/jdi/EventRequest/disable/disable003/TestDescription.java \ - vmTestbase/nsk/jdi/EventRequest/hashCode/hashcode001/TestDescription.java \ - vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq003/TestDescription.java \ - vmTestbase/nsk/jdi/EventRequestManager/hashCode/hashcode001/TestDescription.java \ - vmTestbase/nsk/jdi/EventSet/resume/resume011/TestDescription.java \ - vmTestbase/nsk/jdi/EventSet/toString/tostring001/TestDescription.java \ - vmTestbase/nsk/jdi/EventSet/virtualMachine/virtualmachine001/TestDescription.java \ - vmTestbase/nsk/jdi/LocalVariable/toString/tostring001/TestDescription.java \ - vmTestbase/nsk/jdi/Method/_bounds_/bounds001/TestDescription.java \ - vmTestbase/nsk/jdi/Method/isObsolete/isobsolete003/TestDescription.java \ - vmTestbase/nsk/jdi/MethodEntryRequest/_bounds_/filters001/TestDescription.java \ - vmTestbase/nsk/jdi/MethodExitRequest/_bounds_/filters001/TestDescription.java \ - vmTestbase/nsk/jdi/Mirror/hashCode/hashcode001/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/_bounds_/bounds001/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/_bounds_/bounds002/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod002/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod003/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod004/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod005/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod007/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod008/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod009/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod010/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod011/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod012/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod013/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod014/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue002/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue003/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue004/TestDescription.java \ - vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue005/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/_bounds_/bounds001/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/_bounds_/bounds002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/allFields/allfields005/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/allLineLocations/alllinelocations002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/alllinelocations_ss002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/allMethods/allmethods005/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/fields/fields005/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue004/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue005/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/getValues/getvalues002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/getValues/getvalues003/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_i/locationsofline_i002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsofline_ssi002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/methods/methods005/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/sourceName/sourcename004/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/sourceNames/sourcenames002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/sourcePaths/sourcepaths002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/visibleFields/visibfield005/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/visibleMethods/visibmethod006/TestDescription.java \ - vmTestbase/nsk/jdi/Scenarios/invokeMethod/popframes001/TestDescription.java \ - vmTestbase/nsk/jdi/Scenarios/invokeMethod/redefineclasses001/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/_bounds_/bounds002/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/getValue/getvalue003/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/getValues/getvalues003/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/hashCode/hashcode001/TestDescription.java \ - vmTestbase/nsk/jdi/StackFrame/setValue/setvalue005/setvalue005.java \ - vmTestbase/nsk/jdi/StackFrame/setValue/setvalue006/setvalue006.java \ - vmTestbase/nsk/jdi/StackFrame/toString/tostring001/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/_bounds_/filters001/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt003/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter001/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter002/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter003/TestDescription.java \ - vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter004/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadGroupReference/toString/tostring001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/ownedMonitors/ownedmonitors002/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes001/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes002/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes003/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes004/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes005/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes006/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes007/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/stop/stop002/TestDescription.java \ - vmTestbase/nsk/jdi/Type/hashCode/hashcode001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isPackagePrivate/ispackageprivate001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isPrivate/isprivate001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isProtected/isprotected001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isPublic/ispublic001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointEvent/_itself_/wevent001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/_bounds_/filters001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter001/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter002/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter003/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter004/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter005/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter006/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter007/TestDescription.java \ - vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter008/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canAddMethod/canaddmethod001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canGetSourceDebugExtension/cangetsde001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canPopFrames/canpopframes001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canRedefineClasses/canredefineclasses001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canRequestVMDeathEvent/canreqvmdev001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canUnrestrictedlyRedefineClasses/curc001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canUseInstanceFilters/canusefilters001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/getDefaultStratum/getdefaultstratum001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses002/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses003/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses004/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses005/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses006/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses007/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses008/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses009/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses010/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses011/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses012/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses013/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses014/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses015/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses016/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses020/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses022/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses024/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses026/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses027/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses028/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses029/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses030/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses032/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses034/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses035/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/setDefaultStratum/setdefaultstratum001/TestDescription.java \ - vmTestbase/nsk/jdi/VoidType/toString/tostring001/TestDescription.java \ - vmTestbase/nsk/jdi/VoidValue/equals/equals002/TestDescription.java \ - vmTestbase/nsk/jdi/VoidValue/toString/tostring001/TestDescription.java \ - vmTestbase/nsk/jdi/ConstantField/values001/TestDescription.java \ - vmTestbase/nsk/jdi/Accessible/isPackagePrivate/accipp002/TestDescription.java \ - vmTestbase/nsk/jdi/Accessible/isPrivate/isprivate002/TestDescription.java \ - vmTestbase/nsk/jdi/Accessible/isProtected/isprotected002/TestDescription.java \ - vmTestbase/nsk/jdi/Accessible/isPublic/ispublic002/TestDescription.java \ - vmTestbase/nsk/jdi/Accessible/isPublic/ispublic003/TestDescription.java \ - vmTestbase/nsk/jdi/Accessible/modifiers/modifiers002/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/allInterfaces/allinterfaces002/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/interfaces/interfaces002/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod015/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/isEnum/isenum001/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/setValue/setvalue008/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/subclasses/subclasses002/TestDescription.java \ - vmTestbase/nsk/jdi/ClassType/superclass/superclass002/TestDescription.java \ - vmTestbase/nsk/jdi/Field/isEnumConstant/isenumconstant001/TestDescription.java \ - vmTestbase/nsk/jdi/Field/type/type004/TestDescription.java \ - vmTestbase/nsk/jdi/Field/typeName/typename002/TestDescription.java \ - vmTestbase/nsk/jdi/LocalVariable/genericSignature/gensignature001/TestDescription.java \ - vmTestbase/nsk/jdi/Method/arguments/arguments003/TestDescription.java \ - vmTestbase/nsk/jdi/Method/argumentTypeNames/argumenttypenames003/TestDescription.java \ - vmTestbase/nsk/jdi/Method/isBridge/isbridge001/TestDescription.java \ - vmTestbase/nsk/jdi/Method/isVarArgs/isvarargs001/TestDescription.java \ - vmTestbase/nsk/jdi/PlugConnectors/AttachConnector/plugAttachConnect001/plugAttachConnect001.java \ - vmTestbase/nsk/jdi/PlugConnectors/AttachConnector/plugAttachConnect002/plugAttachConnect002.java \ - vmTestbase/nsk/jdi/PlugConnectors/AttachConnector/plugAttachConnect003/plugAttachConnect003.java \ - vmTestbase/nsk/jdi/PlugConnectors/LaunchConnector/plugLaunchConnect001/plugLaunchConnect001.java \ - vmTestbase/nsk/jdi/PlugConnectors/LaunchConnector/plugLaunchConnect002/plugLaunchConnect002.java \ - vmTestbase/nsk/jdi/PlugConnectors/LaunchConnector/plugLaunchConnect003/plugLaunchConnect003.java \ - vmTestbase/nsk/jdi/PlugConnectors/ListenConnector/plugListenConnect001/plugListenConnect001.java \ - vmTestbase/nsk/jdi/PlugConnectors/ListenConnector/plugListenConnect002/plugListenConnect002.java \ - vmTestbase/nsk/jdi/PlugConnectors/ListenConnector/plugListenConnect003/plugListenConnect003.java \ - vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect001/plugMultiConnect001.java \ - vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect002/plugMultiConnect002.java \ - vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect003/plugMultiConnect003.java \ - vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect004/plugMultiConnect004.java \ - vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect005/plugMultiConnect005.java \ - vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect006/plugMultiConnect006.java \ - vmTestbase/nsk/jdi/PlugConnectors/TransportService/transportService001/transportService001.java \ - vmTestbase/nsk/jdi/PlugConnectors/TransportService/transportService002/transportService002.java \ - vmTestbase/nsk/jdi/PlugConnectors/TransportService/transportService003/transportService003.java \ - vmTestbase/nsk/jdi/ReferenceType/allFields/allfields006/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/allMethods/allmethods006/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/classObject/classobj003/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/fields/fields006/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/genericSignature/genericSignature001/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/genericSignature/genericSignature002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/isAbstract/isabstract003/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/isFinal/isfinal002/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/isInitialized/isinit003/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/methods/methods006/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/visibleFields/visibfield006/TestDescription.java \ - vmTestbase/nsk/jdi/ReferenceType/visibleMethods/visibmethod007/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype009/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/genericSignature/genericSignature001/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/genericSignature/genericSignature002/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isFinal/isfinal004/TestDescription.java \ - vmTestbase/nsk/jdi/TypeComponent/isStatic/isstatic004/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/canBeModified/canbemodified001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM002/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM003/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM004/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM005/TestDescription.java \ - vmTestbase/nsk/jdi/VMCannotBeModifiedEx/_itself_/canntbemod001/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts001/instancecounts001.java \ - vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts002/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts003/instancecounts003.java \ - vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts004/instancecounts004.java \ - vmTestbase/nsk/jdi/ReferenceType/instances/instances001/instances001.java \ - vmTestbase/nsk/jdi/ReferenceType/instances/instances002/instances002.java \ - vmTestbase/nsk/jdi/ReferenceType/instances/instances005/instances005.java \ - vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects001/referringObjects001.java \ - vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java \ - vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects003/referringObjects003.java \ - vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects004/referringObjects004.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn003/forceEarlyReturn003.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn004/forceEarlyReturn004.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn005/forceEarlyReturn005.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn006/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn007/TestDescription.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn008/forceEarlyReturn008.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn009/forceEarlyReturn009.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn013/forceEarlyReturn013.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn014/forceEarlyReturn014.java \ - vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn015/forceEarlyReturn015.java \ - vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames001/ownedMonitorsAndFrames001.java \ - vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames002/ownedMonitorsAndFrames002.java \ - vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames003/ownedMonitorsAndFrames003.java \ - vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames004/ownedMonitorsAndFrames004.java \ - vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames005/ownedMonitorsAndFrames005.java \ - vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames008/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addClassExclusionFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addClassFilter_ClassName/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addClassFilter_ReferenceType/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addInstanceFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addThreadFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addClassExclusionFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addClassFilter_ClassName/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addClassFilter_ReferenceType/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addInstanceFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addThreadFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitRequest/addClassExclusionFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitRequest/addClassFilter_ClassName/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitRequest/addClassFilter_ReferenceType/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitRequest/addInstanceFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitRequest/addThreadFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitedRequest/addClassExclusionFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitedRequest/addClassFilter_ClassName/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitedRequest/addClassFilter_ReferenceType/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitedRequest/addInstanceFilter/TestDescription.java \ - vmTestbase/nsk/jdi/MonitorWaitedRequest/addThreadFilter/TestDescription.java \ - vmTestbase/nsk/jdi/stress/ClassPrepareEvents/ClassPrepareEvents001/ClassPrepareEvents001.java \ - vmTestbase/nsk/jdi/ClassPrepareRequest/addSourceNameFilter/addSourceNameFilter001/addSourceNameFilter001.java \ - vmTestbase/nsk/jdi/ClassPrepareRequest/addSourceNameFilter/addSourceNameFilter002/addSourceNameFilter002.java \ - vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java \ - vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn001/TestDescription.java \ - vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java \ - vmTestbase/nsk/jdi/stress/serial/monitorEvents001/TestDescription.java \ - vmTestbase/nsk/jdi/stress/serial/ownedMonitorsAndFrames001/TestDescription.java \ - vmTestbase/nsk/jdi/stress/serial/mixed001/TestDescription.java \ - vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn002/TestDescription.java \ - vmTestbase/nsk/jdi/stress/serial/monitorEvents002/TestDescription.java \ - vmTestbase/nsk/jdi/stress/serial/ownedMonitorsAndFrames002/TestDescription.java \ - vmTestbase/nsk/jdi/VirtualMachine/setDefaultStratum/setDefaultStratum002/setDefaultStratum002.java \ - vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/allLineLocations_ss003/allLineLocations_ss003.java \ - vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/allLineLocations_ss004/allLineLocations_ss004.java \ - vmTestbase/nsk/jdi/Method/allLineLocations_ss/allLineLocations_ss002/allLineLocations_ss002.java \ - vmTestbase/nsk/jdi/Method/allLineLocations_ss/allLineLocations_ss003/allLineLocations_ss003.java \ - vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsOfLine_ssi003/locationsOfLine_ssi003.java \ - vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsOfLine_ssi004/locationsOfLine_ssi004.java \ - vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsOfLine_ssi002/locationsOfLine_ssi002.java \ - vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsOfLine_ssi003/locationsOfLine_ssi003.java \ - vmTestbase/nsk/jdi/ReferenceType/sourceNames/sourceNames003/sourceNames003.java \ - vmTestbase/nsk/jdi/ReferenceType/sourcePaths/sourcePaths003/sourcePaths003.java \ - vmTestbase/nsk/jdi/ReferenceType/availableStrata/availableStrata002/availableStrata002.java \ - vmTestbase/nsk/jdi/ReferenceType/defaultStratum/defaultStratum002/defaultStratum002.java \ - vmTestbase/nsk/jdi/Location/lineNumber_s/lineNumber_s002/lineNumber_s002.java \ - vmTestbase/nsk/jdi/Location/sourceName_s/sourceName_s002/sourceName_s002.java \ - vmTestbase/nsk/jdi/Location/sourcePath_s/sourcePath_s002/sourcePath_s002.java \ - vmTestbase/nsk/jdi/AttachingConnector/attach/attach005/TestDescription.java \ - vmTestbase/nsk/jdi/AttachingConnector/attachnosuspend/attachnosuspend002/TestDescription.java \ - vmTestbase/nsk/jdi/AttachingConnector/attachnosuspend/attachnosuspend003/TestDescription.java \ - vmTestbase/nsk/jdi/MethodExitEvent/returnValue/returnValue001/returnValue001.java \ - vmTestbase/nsk/jdi/MethodExitEvent/returnValue/returnValue002/returnValue002.java \ - vmTestbase/nsk/jdi/MethodExitEvent/returnValue/returnValue003/returnValue003.java \ - vmTestbase/nsk/jdi/MethodExitEvent/returnValue/returnValue004/returnValue004.java \ - vmTestbase/nsk/jdi/StackFrame/getArgumentValues/getArgumentValues001/getArgumentValues001.java \ - vmTestbase/nsk/jdi/StackFrame/getArgumentValues/getArgumentValues002/getArgumentValues002.java \ - vmTestbase/nsk/jdi/StackFrame/getArgumentValues/getArgumentValues003/getArgumentValues003.java - vmTestbase_vm_metaspace = \ vmTestbase/metaspace @@ -1176,702 +349,10 @@ vmTestbase_nsk_jvmti = \ vmTestbase/nsk/jvmti -vmTestbase_nsk_jvmti_quick = \ - vmTestbase/nsk/jvmti/AddCapabilities/addcaps001/TestDescription.java \ - vmTestbase/nsk/jvmti/AddCapabilities/addcaps002/TestDescription.java \ - vmTestbase/nsk/jvmti/AddCapabilities/addcaps003/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch001/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch002/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch003/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch004/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch007/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch008/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch009/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch010/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch001/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch002/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch003/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch004/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch005/TestDescription.java \ - vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch006/TestDescription.java \ - vmTestbase/nsk/jvmti/Agent_OnLoad/agentonload001/TestDescription.java \ - vmTestbase/nsk/jvmti/Agent_OnLoad/agentonload002/TestDescription.java \ - vmTestbase/nsk/jvmti/Agent_OnLoad/agentonload003/TestDriver.java \ - vmTestbase/nsk/jvmti/Agent_OnUnload/agentonunload001/TestDriver.java \ - vmTestbase/nsk/jvmti/Breakpoint/breakpoint001/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk001/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk002/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk003/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk004/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk005/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk006/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk007/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk008/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk009/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassLoad/classload001/TestDescription.java \ - vmTestbase/nsk/jvmti/ClassPrepare/classprep001/TestDescription.java \ - vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk001/TestDescription.java \ - vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk002/TestDescription.java \ - vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk005/TestDescription.java \ - vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw001/TestDescription.java \ - vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw002/TestDescription.java \ - vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw001/TestDescription.java \ - vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw002/TestDescription.java \ - vmTestbase/nsk/jvmti/CompiledMethodLoad/compmethload001/TestDescription.java \ - vmTestbase/nsk/jvmti/CreateRawMonitor/crrawmon001/TestDescription.java \ - vmTestbase/nsk/jvmti/CreateRawMonitor/crrawmon002/TestDescription.java \ - vmTestbase/nsk/jvmti/DisposeEnvironment/disposeenv001/TestDescription.java \ - vmTestbase/nsk/jvmti/DisposeEnvironment/disposeenv002/TestDescription.java \ - vmTestbase/nsk/jvmti/Deallocate/dealloc001/TestDescription.java \ - vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon001/TestDescription.java \ - vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon003/TestDescription.java \ - vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon004/TestDescription.java \ - vmTestbase/nsk/jvmti/DynamicCodeGenerated/dyncodgen001/TestDescription.java \ - vmTestbase/nsk/jvmti/Exception/exception001/TestDescription.java \ - vmTestbase/nsk/jvmti/ExceptionCatch/excatch001/TestDescription.java \ - vmTestbase/nsk/jvmti/FieldAccess/fieldacc001/TestDescription.java \ - vmTestbase/nsk/jvmti/FieldAccess/fieldacc002/TestDescription.java \ - vmTestbase/nsk/jvmti/FieldAccess/fieldacc003/TestDescription.java \ - vmTestbase/nsk/jvmti/FieldAccess/fieldacc004/TestDescription.java \ - vmTestbase/nsk/jvmti/FieldModification/fieldmod001/TestDescription.java \ - vmTestbase/nsk/jvmti/FieldModification/fieldmod002/TestDescription.java \ - vmTestbase/nsk/jvmti/ForceGarbageCollection/forcegc001/TestDescription.java \ - vmTestbase/nsk/jvmti/ForceGarbageCollection/forcegc002/TestDescription.java \ - vmTestbase/nsk/jvmti/FramePop/framepop001/TestDescription.java \ - vmTestbase/nsk/jvmti/FramePop/framepop002/TestDescription.java \ - vmTestbase/nsk/jvmti/GenerateEvents/genevents001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetAllThreads/allthr001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetAllThreads/allthr002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetAvailableProcessors/getavailproc001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetArgumentsSize/argsize001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetArgumentsSize/argsize002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetBytecodes/bytecodes001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetBytecodes/bytecodes002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetBytecodes/bytecodes003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetCapabilities/getcaps001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetCapabilities/getcaps002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassFields/getclfld005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassFields/getclfld006/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassFields/getclfld007/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassLoader/getclsldr001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassLoader/getclsldr002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassLoader/getclsldr003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassLoaderClasses/clsldrclss001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassLoaderClasses/clsldrclss002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassMethods/getclmthd005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassMethods/getclmthd006/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassMethods/getclmthd007/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf006/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf007/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassSignature/getclsig004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassSignature/getclsig005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassSignature/getclsig006/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassStatus/getclstat005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassStatus/getclstat006/TestDescription.java \ - vmTestbase/nsk/jvmti/GetClassStatus/getclstat007/TestDescription.java \ - vmTestbase/nsk/jvmti/GetCurrentContendedMonitor/contmon001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetCurrentContendedMonitor/contmon002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetCurrentContendedMonitor/contmon003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetCurrentThreadCpuTime/curthrcputime001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetCurrentThreadCpuTimerInfo/curthrtimerinfo001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetEnvironmentLocalStorage/getenvstor001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetErrorName/geterrname001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetErrorName/geterrname002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetExtensionEvents/extevents001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetExtensionFunctions/extfuncs001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFieldDeclaringClass/getfldecl001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFieldDeclaringClass/getfldecl002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFieldDeclaringClass/getfldecl004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFieldModifiers/getfldmdf003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFieldModifiers/getfldmdf004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFieldName/getfldnm003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFieldName/getfldnm004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFieldName/getfldnm005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFrameCount/framecnt001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFrameCount/framecnt002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFrameCount/framecnt003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFrameLocation/frameloc002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetFrameLocation/frameloc003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetImplementedInterfaces/getintrf005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetImplementedInterfaces/getintrf006/TestDescription.java \ - vmTestbase/nsk/jvmti/GetImplementedInterfaces/getintrf007/TestDescription.java \ - vmTestbase/nsk/jvmti/GetJLocationFormat/getjlocfmt001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetJLocationFormat/getjlocfmt002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetJNIFunctionTable/getjniftab001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetJNIFunctionTable/getjniftab002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLineNumberTable/linetab001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLineNumberTable/linetab002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLineNumberTable/linetab003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLoadedClasses/loadedclss001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLoadedClasses/loadedclss002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLocalVariable/getlocal001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLocalVariable/getlocal002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMaxLocals/maxloc001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMaxLocals/maxloc002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodDeclaringClass/declcls001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodDeclaringClass/declcls002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodDeclaringClass/declcls003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetObjectHashCode/objhashcode001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodLocation/methloc001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodLocation/methloc002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodModifiers/methmod001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodModifiers/methmod002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodName/methname001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodName/methname002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetMethodName/methname003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetObjectSize/objsize001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetObjectsWithTags/objwithtags001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetOwnedMonitorInfo/ownmoninf001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetOwnedMonitorInfo/ownmoninf002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetOwnedMonitorInfo/ownmoninf003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetPhase/getphase001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetPhase/getphase002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetPotentialCapabilities/getpotcaps001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSourceDebugExtension/srcdebugex001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSourceDebugExtension/srcdebugex002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSourceDebugExtension/srcdebugex003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSourceFileName/getsrcfn004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSourceFileName/getsrcfn005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSourceFileName/getsrcfn006/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSystemProperties/getsysprops001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSystemProperties/getsysprops002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSystemProperty/getsysprop001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetSystemProperty/getsysprop002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetStackTrace/getstacktr001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetStackTrace/getstacktr002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetStackTrace/getstacktr003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetStackTrace/getstacktr004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetStackTrace/getstacktr005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetStackTrace/getstacktr006/TestDescription.java \ - vmTestbase/nsk/jvmti/GetStackTrace/getstacktr007/TestDescription.java \ - vmTestbase/nsk/jvmti/GetStackTrace/getstacktr008/TestDescription.java \ - vmTestbase/nsk/jvmti/GetStackTrace/getstacktr009/TestDescription.java \ - vmTestbase/nsk/jvmti/GetTag/gettag001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadCpuTime/thrcputime001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadCpuTime/thrcputime002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadCpuTimerInfo/thrtimerinfo001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadGroupChildren/getthrdgrpchld001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadGroupInfo/thrgrpinfo001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadGroupInfo/thrgrpinfo002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadInfo/thrinfo001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadInfo/thrinfo002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadLocalStorage/getthrdstor001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadState/thrstat001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadState/thrstat002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadState/thrstat003/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadState/thrstat004/TestDescription.java \ - vmTestbase/nsk/jvmti/GetThreadState/thrstat005/TestDescription.java \ - vmTestbase/nsk/jvmti/GetTime/gettime001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetTimerInfo/timerinfo001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetTopThreadGroups/topthrgrp001/TestDescription.java \ - vmTestbase/nsk/jvmti/GetTopThreadGroups/topthrgrp002/TestDescription.java \ - vmTestbase/nsk/jvmti/GetVersionNumber/getvern001/TestDescription.java \ - vmTestbase/nsk/jvmti/InterruptThread/intrpthrd001/TestDescription.java \ - vmTestbase/nsk/jvmti/InterruptThread/intrpthrd002/TestDescription.java \ - vmTestbase/nsk/jvmti/InterruptThread/intrpthrd003/TestDescription.java \ - vmTestbase/nsk/jvmti/IsArrayClass/isarray004/TestDescription.java \ - vmTestbase/nsk/jvmti/IsArrayClass/isarray005/TestDescription.java \ - vmTestbase/nsk/jvmti/IsFieldSynthetic/isfldsin002/TestDescription.java \ - vmTestbase/nsk/jvmti/IsFieldSynthetic/isfldsin003/TestDescription.java \ - vmTestbase/nsk/jvmti/IsInterface/isintrf004/TestDescription.java \ - vmTestbase/nsk/jvmti/IsInterface/isintrf005/TestDescription.java \ - vmTestbase/nsk/jvmti/IsMethodNative/isnative001/TestDescription.java \ - vmTestbase/nsk/jvmti/IsMethodNative/isnative002/TestDescription.java \ - vmTestbase/nsk/jvmti/IsMethodObsolete/isobsolete001/TestDescription.java \ - vmTestbase/nsk/jvmti/IsMethodSynthetic/issynth001/TestDescription.java \ - vmTestbase/nsk/jvmti/IsMethodSynthetic/issynth002/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverHeap/iterheap001/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverHeap/iterheap002/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverHeap/iterheap003/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverHeap/iterheap004/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverHeap/iterheap005/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverHeap/iterheap006/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverHeap/iterheap007/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls001/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls002/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls003/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls004/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls005/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls006/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls007/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj001/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj002/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj003/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj004/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj005/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj001/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj002/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj003/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj004/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj005/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateThroughHeap/callbacks/Callbacks.java \ - vmTestbase/nsk/jvmti/IterateThroughHeap/concrete-klass-filter/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateThroughHeap/non-concrete-klass-filter/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateThroughHeap/filter-tagged/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateThroughHeap/filter-untagged/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateThroughHeap/filter-class-tagged/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateThroughHeap/filter-class-untagged/TestDescription.java \ - vmTestbase/nsk/jvmti/IterateThroughHeap/abort/Abort.java \ - vmTestbase/nsk/jvmti/MethodEntry/mentry001/TestDescription.java \ - vmTestbase/nsk/jvmti/MethodEntry/mentry002/TestDescription.java \ - vmTestbase/nsk/jvmti/MethodExit/mexit002/TestDescription.java \ - vmTestbase/nsk/jvmti/MonitorContendedEnter/mcontenter001/TestDescription.java \ - vmTestbase/nsk/jvmti/MonitorContendedEntered/mcontentered001/TestDescription.java \ - vmTestbase/nsk/jvmti/MonitorWait/monitorwait001/TestDescription.java \ - vmTestbase/nsk/jvmti/MonitorWaited/monitorwaited001/TestDescription.java \ - vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind001/TestDescription.java \ - vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind002/TestDescription.java \ - vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind003/TestDescription.java \ - vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind004/TestDescription.java \ - vmTestbase/nsk/jvmti/NotifyFramePop/nframepop001/TestDescription.java \ - vmTestbase/nsk/jvmti/NotifyFramePop/nframepop002/TestDescription.java \ - vmTestbase/nsk/jvmti/NotifyFramePop/nframepop003/TestDescription.java \ - vmTestbase/nsk/jvmti/ObjectFree/objfree002/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe001/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe002/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe003/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe004/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe005/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe006/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe007/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe008/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe009/TestDescription.java \ - vmTestbase/nsk/jvmti/PopFrame/popframe010/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorEnter/rawmonenter001/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorEnter/rawmonenter002/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorEnter/rawmonenter003/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorEnter/rawmonenter004/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorExit/rawmonexit001/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorExit/rawmonexit002/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorExit/rawmonexit003/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorExit/rawmonexit005/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorNotify/rawmnntfy001/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorNotify/rawmnntfy002/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorNotify/rawmnntfy003/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorNotify/rawmnntfy004/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorNotifyAll/rawmnntfyall001/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorNotifyAll/rawmnntfyall002/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorNotifyAll/rawmnntfyall003/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorNotifyAll/rawmnntfyall004/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait001/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait002/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait003/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait004/TestDescription.java \ - vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait005/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass001/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass002/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass003/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass004/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass005/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass006/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass008/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass009/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass010/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass011/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass012/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass013/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass014/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass015/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass016/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass017/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass018/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass019/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass020/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass021/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass022/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass023/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass024/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass025/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass026/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass027/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass028/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass029/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass030/TestDescription.java \ - vmTestbase/nsk/jvmti/RedefineClasses/redefclass031/TestDescription.java \ - vmTestbase/nsk/jvmti/RelinquishCapabilities/relcaps001/TestDescription.java \ - vmTestbase/nsk/jvmti/RelinquishCapabilities/relcaps002/TestDescription.java \ - vmTestbase/nsk/jvmti/ResumeThread/resumethrd001/TestDescription.java \ - vmTestbase/nsk/jvmti/ResumeThread/resumethrd002/TestDescription.java \ - vmTestbase/nsk/jvmti/ResumeThreadList/resumethrdlst001/TestDescription.java \ - vmTestbase/nsk/jvmti/ResumeThreadList/resumethrdlst002/TestDescription.java \ - vmTestbase/nsk/jvmti/RunAgentThread/agentthr001/TestDescription.java \ - vmTestbase/nsk/jvmti/RunAgentThread/agentthr002/TestDescription.java \ - vmTestbase/nsk/jvmti/RunAgentThread/agentthr003/TestDescription.java \ - vmTestbase/nsk/jvmti/SetBreakpoint/setbrk002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetBreakpoint/setbrk003/TestDescription.java \ - vmTestbase/nsk/jvmti/SetBreakpoint/setbrk005/TestDescription.java \ - vmTestbase/nsk/jvmti/SetBreakpoint/setbrk007/TestDescription.java \ - vmTestbase/nsk/jvmti/SetBreakpoint/setbrk008/TestDescription.java \ - vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor003/TestDescription.java \ - vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb003/TestDescription.java \ - vmTestbase/nsk/jvmti/SetEventNotificationMode/setnotif001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetExtensionEventCallback/setextevent001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw003/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw004/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw005/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw006/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw003/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw004/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw005/TestDescription.java \ - vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw006/TestDescription.java \ - vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetLocalVariable/setlocal001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetLocalVariable/setlocal002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetLocalVariable/setlocal003/TestDescription.java \ - vmTestbase/nsk/jvmti/SetLocalVariable/setlocal004/TestDescription.java \ - vmTestbase/nsk/jvmti/SetSystemProperty/setsysprop002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetSystemProperty/setsysprop003/TestDescription.java \ - vmTestbase/nsk/jvmti/SetTag/settag001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor003/TestDescription.java \ - vmTestbase/nsk/jvmti/SetVerboseFlag/setvrbflag001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetVerboseFlag/setvrbflag002/TestDescription.java \ - vmTestbase/nsk/jvmti/SingleStep/singlestep001/TestDescription.java \ - vmTestbase/nsk/jvmti/SingleStep/singlestep003/TestDescription.java \ - vmTestbase/nsk/jvmti/SuspendThread/suspendthrd001/TestDescription.java \ - vmTestbase/nsk/jvmti/SuspendThreadList/suspendthrdlst001/TestDescription.java \ - vmTestbase/nsk/jvmti/StopThread/stopthrd006/TestDescription.java \ - vmTestbase/nsk/jvmti/StopThread/stopthrd007/TestDescription.java \ - vmTestbase/nsk/jvmti/ThreadEnd/threadend001/TestDescription.java \ - vmTestbase/nsk/jvmti/ThreadEnd/threadend002/TestDescription.java \ - vmTestbase/nsk/jvmti/ThreadStart/threadstart001/TestDescription.java \ - vmTestbase/nsk/jvmti/ThreadStart/threadstart002/TestDescription.java \ - vmTestbase/nsk/jvmti/ThreadStart/threadstart003/TestDescription.java \ - vmTestbase/nsk/jvmti/VMDeath/vmdeath001/TestDescription.java \ - vmTestbase/nsk/jvmti/VMInit/vminit001/TestDescription.java \ - vmTestbase/nsk/jvmti/VMObjectAlloc/vmobjalloc001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP01/ap01t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP02/ap02t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP03/ap03t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP05/ap05t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP05/ap05t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP06/ap06t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP07/ap07t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP07/ap07t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP09/ap09t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP10/ap10t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/allocation/AP11/ap11t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/bcinstr/BI01/bi01t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/bcinstr/BI01/bi01t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t004/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t005/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t006/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t008/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t009/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t010/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t011/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t012/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t013/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t014/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t015/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t016/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t017/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t018/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t019/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t020/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t021/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/capability/CM02/cm02t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/contention/TC01/tc01t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/contention/TC02/tc02t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/contention/TC04/tc04t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM01/em01t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM01/em01t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t004/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t008/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t009/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t010/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t011/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM04/em04t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM05/em05t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM06/em06t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/events/EM07/em07t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/general_functions/GF01/gf01t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/general_functions/GF04/gf04t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/general_functions/GF06/gf06t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t001/TestDriver.java \ - vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t004/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t005/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t006/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t007/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t008/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS103/hs103t002/hs103t002.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS104/hs104t001/hs104t001.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS104/hs104t002/hs104t002.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t001/hs202t001.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t002/hs202t002.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t001/hs203t001.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t002/hs203t002.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t003/hs203t003.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t002/hs204t002.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t003/hs204t003.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t004/hs204t004.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t001/hs301t001.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t002/hs301t002.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t003/hs301t003.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t004/hs301t004.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t005/hs301t005.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t001/hs302t001.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t002/hs302t002.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t003/hs302t003.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t004/hs302t004.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t005/hs302t005.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t006/hs302t006.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t007/hs302t007.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t008/hs302t008.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t009/hs302t009.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t010/hs302t010.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t011/hs302t011.java \ - vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t012/hs302t012.java \ - vmTestbase/nsk/jvmti/scenarios/jni_interception/JI01/ji01t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/jni_interception/JI03/ji03t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/jni_interception/JI03/ji03t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/jni_interception/JI03/ji03t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA01/ma01t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA02/ma02t001/TestDriver.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA03/ma03t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA04/ma04t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA04/ma04t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA04/ma04t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA05/ma05t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA06/ma06t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA07/ma07t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA08/ma08t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t004/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t005/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t007/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t008/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP03/sp03t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP03/sp03t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t002/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t003/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t001/TestDescription.java \ - vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java \ - vmTestbase/nsk/jvmti/AttachOnDemand/attach002a/TestDescription.java \ - vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java \ - vmTestbase/nsk/jvmti/RetransformClasses/retransform002/TestDescription.java \ - vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java \ - vmTestbase/nsk/jvmti/RetransformClasses/retransform004/TestDescription.java \ - vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/TestDescription.java \ - vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn002/TestDescription.java \ - vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix001/TestDescription.java \ - vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java \ - vmTestbase/nsk/jvmti/GetEnv/GetEnv001/GetEnv001.java \ - vmTestbase/nsk/jvmti/unit/MethodBind/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/OnUnload/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/StackTrace/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/agentthr/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/clsldrclss00x/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/events/redefineCFLH/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/extmech/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/functions/AddToBootstrapClassLoaderSearch/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/functions/Dispose/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/functions/environment/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/functions/nosuspendMonitorInfo/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/functions/nosuspendStackTrace/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/functions/rawmonitor/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/heap/BasicIterationTests/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/heap/BasicTagTests/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/heap/GetWithTests/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/heap/HeapWalkTests/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/heap/ObjectFreeTests/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/heap/ObjectSizeTests/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/heapref/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/refignore/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/setNullVMInit/JvmtiTest/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/GetLineNumberTable/linetab004/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal003/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal004/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/IsSynthetic/issynth001/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/FollowReferences/followref001/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/FollowReferences/followref002/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/FollowReferences/followref004/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/FollowReferences/followref005/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/FollowReferences/followref006/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretbase/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretfp/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretint/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretlong/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretobj/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretstr/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretvoid/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/GetAllStackTraces/getallstktr001/TestDescription.java \ - vmTestbase/nsk/jvmti/unit/GetConstantPool/getcpool001/TestDescription.java - # JDWP tests vmTestbase_nsk_jdwp = \ vmTestbase/nsk/jdwp -vmTestbase_nsk_jdwp_quick = \ - vmTestbase/nsk/jdwp/ArrayReference/GetValues/getvalues001/TestDescription.java \ - vmTestbase/nsk/jdwp/ArrayReference/GetValues/getvalues002/TestDescription.java \ - vmTestbase/nsk/jdwp/ArrayReference/Length/length001/TestDescription.java \ - vmTestbase/nsk/jdwp/ArrayReference/SetValues/setvalues001/TestDescription.java \ - vmTestbase/nsk/jdwp/ArrayType/NewInstance/newinstance001/TestDescription.java \ - vmTestbase/nsk/jdwp/ClassLoaderReference/VisibleClasses/visibclasses001/TestDescription.java \ - vmTestbase/nsk/jdwp/ClassObjectReference/ReflectedType/reflectype001/TestDescription.java \ - vmTestbase/nsk/jdwp/ClassType/InvokeMethod/invokemeth001/TestDescription.java \ - vmTestbase/nsk/jdwp/ClassType/NewInstance/newinst001/TestDescription.java \ - vmTestbase/nsk/jdwp/ClassType/SetValues/setvalues001/TestDescription.java \ - vmTestbase/nsk/jdwp/ClassType/Superclass/superclass001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/BREAKPOINT/breakpoint001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/EXCEPTION/exception001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/FIELD_ACCESS/fldaccess001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/FIELD_MODIFICATION/fldmodification001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/CLASS_PREPARE/clsprepare001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/CLASS_UNLOAD/clsunload001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/METHOD_ENTRY/methentry001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/METHOD_EXIT/methexit001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/SINGLE_STEP/singlestep001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/SINGLE_STEP/singlestep002/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/SINGLE_STEP/singlestep003/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/THREAD_DEATH/thrdeath001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/THREAD_START/thrstart001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/VM_DEATH/vmdeath001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/VM_START/vmstart001/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/Composite/composite001/TestDescription.java \ - vmTestbase/nsk/jdwp/EventRequest/Clear/clear001/TestDescription.java \ - vmTestbase/nsk/jdwp/EventRequest/ClearAllBreakpoints/clrallbreakp001/TestDescription.java \ - vmTestbase/nsk/jdwp/EventRequest/ClearAllBreakpoints/clrallbreakp002/TestDescription.java \ - vmTestbase/nsk/jdwp/EventRequest/ClearAllBreakpoints/clrallbreakp003/TestDescription.java \ - vmTestbase/nsk/jdwp/EventRequest/Set/set001/TestDescription.java \ - vmTestbase/nsk/jdwp/EventRequest/Set/set002/TestDescription.java \ - vmTestbase/nsk/jdwp/Method/LineTable/linetable001/TestDescription.java \ - vmTestbase/nsk/jdwp/Method/VariableTable/vartable001/TestDescription.java \ - vmTestbase/nsk/jdwp/Method/Bytecodes/bytecodes001/TestDescription.java \ - vmTestbase/nsk/jdwp/ObjectReference/DisableCollection/disablecol001/TestDescription.java \ - vmTestbase/nsk/jdwp/ObjectReference/EnableCollection/enablecol001/TestDescription.java \ - vmTestbase/nsk/jdwp/ObjectReference/GetValues/getvalues001/TestDescription.java \ - vmTestbase/nsk/jdwp/ObjectReference/InvokeMethod/invokemeth001/TestDescription.java \ - vmTestbase/nsk/jdwp/ObjectReference/IsCollected/iscollected001/TestDescription.java \ - vmTestbase/nsk/jdwp/ObjectReference/MonitorInfo/monitorinfo001/TestDescription.java \ - vmTestbase/nsk/jdwp/ObjectReference/ReferenceType/referencetype001/TestDescription.java \ - vmTestbase/nsk/jdwp/ObjectReference/SetValues/setvalues001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/ClassLoader/classloader001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/ClassObject/classobj001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/Fields/fields001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/GetValues/getvalues001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/Interfaces/interfaces001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/Methods/methods001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/Modifiers/modifiers001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/NestedTypes/nestedtypes001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/Signature/signature001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/SourceFile/srcfile001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/Status/status001/TestDescription.java \ - vmTestbase/nsk/jdwp/StackFrame/GetValues/getvalues001/TestDescription.java \ - vmTestbase/nsk/jdwp/StackFrame/SetValues/setvalues001/TestDescription.java \ - vmTestbase/nsk/jdwp/StackFrame/ThisObject/thisobject001/TestDescription.java \ - vmTestbase/nsk/jdwp/StringReference/Value/value001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadGroupReference/Children/children001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadGroupReference/Name/name001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadGroupReference/Parent/parent001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/CurrentContendedMonitor/curcontmonitor001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/Frames/frames001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/FrameCount/framecnt001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/Interrupt/interrupt001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/Name/name001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/OwnedMonitors/ownmonitors001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/Resume/resume001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/Status/status001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/Stop/stop001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/Suspend/suspend001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/SuspendCount/suspendcnt001/TestDescription.java \ - vmTestbase/nsk/jdwp/ThreadReference/ThreadGroup/threadgroup001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/AllThreads/allthreads001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/Capabilities/capabilities001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/ClassPaths/classpaths001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/ClassesBySignature/classbysig001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/CreateString/createstr001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/Dispose/dispose001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/DisposeObjects/disposeobj001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/Exit/exit001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/HoldEvents/holdevents001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/IDSizes/idsizes001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/TopLevelThreadGroups/threadgroups001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/ReleaseEvents/releaseevents001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/ReleaseEvents/releaseevents002/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/Resume/resume001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/Version/version001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/Version/version002/TestDescription.java \ - vmTestbase/nsk/jdwp/Event/VM_DEATH/vmdeath002/TestDescription.java \ - vmTestbase/nsk/jdwp/Method/IsObsolete/isobsolete001/TestDescription.java \ - vmTestbase/nsk/jdwp/Method/IsObsolete/isobsolete002/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/SourceDebugExtension/srcdebugext001/TestDescription.java \ - vmTestbase/nsk/jdwp/StackFrame/PopFrames/popframes001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/CapabilitiesNew/capabilitiesnew001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/RedefineClasses/redefinecls001/TestDescription.java \ - vmTestbase/nsk/jdwp/VirtualMachine/SetDefaultStratum/setdefstrat001/TestDescription.java \ - vmTestbase/nsk/jdwp/Method/VariableTableWithGeneric/vartblwithgen001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/FieldsWithGeneric/fldwithgeneric001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/MethodsWithGeneric/methwithgeneric001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/SignatureWithGeneric/sigwithgeneric001/TestDescription.java \ - vmTestbase/nsk/jdwp/ReferenceType/Instances/instances001/instances001.java \ - vmTestbase/nsk/jdwp/ReferenceType/Instances/instances002/instances002.java \ - vmTestbase/nsk/jdwp/ObjectReference/ReferringObjects/referringObjects001/referringObjects001.java \ - vmTestbase/nsk/jdwp/ObjectReference/ReferringObjects/referringObjects002/referringObjects002.java \ - vmTestbase/nsk/jdwp/VirtualMachine/InstanceCounts/instanceCounts001/instanceCounts001.java \ - vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java \ - vmTestbase/nsk/jdwp/ThreadReference/OwnedMonitorsStackDepthInfo/ownedMonitorsStackDepthInfo001/ownedMonitorsStackDepthInfo001.java \ - vmTestbase/nsk/jdwp/ThreadReference/OwnedMonitorsStackDepthInfo/ownedMonitorsStackDepthInfo002/ownedMonitorsStackDepthInfo002.java - vmTestbase_nsk_stress = \ vmTestbase/nsk/stress @@ -1888,32 +369,6 @@ :vmTestbase_vm_gc_misc \ :vmTestbase_vm_gc_ref -# vmTestbase_vm_gc w/ 'quick' k/w -vmTestbase_vm_gc_quick = \ - vmTestbase/vm/gc/compact/Compact_Arrays \ - vmTestbase/vm/gc/compact/Compact_Strings_TwoFields \ - vmTestbase/vm/gc/compact/Compact_InternedStrings_Strings \ - vmTestbase/vm/gc/compact/Humongous_Arrays5M \ - vmTestbase/vm/gc/compact/Humongous_NonbranchyTree \ - vmTestbase/vm/gc/containers/LinkedBlockingDeque_Arrays/TestDescription.java \ - vmTestbase/vm/gc/containers/LinkedHashMap_Arrays/TestDescription.java \ - vmTestbase/vm/gc/containers/Combination05/TestDescription.java \ - vmTestbase/gc/ArrayJuggle/Juggle01 \ - vmTestbase/gc/ArrayJuggle/Juggle14 \ - vmTestbase/gc/ArrayJuggle/Juggle22 \ - vmTestbase/gc/ArrayJuggle/Juggle29 \ - vmTestbase/gc/ArrayJuggle/Juggle34 \ - vmTestbase/gc/gctests/LargeObjects/large001/large001.java \ - vmTestbase/gc/gctests/LoadUnloadGC2/LoadUnloadGC2.java \ - vmTestbase/gc/gctests/StringGC/StringGC.java \ - vmTestbase/gc/gctests/StringInternGC/StringInternGC.java \ - vmTestbase/gc/gctests/ReferencesGC/ReferencesGC.java \ - vmTestbase/vm/gc/kind/parOld/TestDescription.java \ - vmTestbase/gc/lock/jni/jnilock001/TestDescription.java \ - vmTestbase/gc/lock/jniref/jnireflock04/TestDescription.java \ - vmTestbase/gc/lock/jvmti/alloc/jvmtialloclock02/TestDescription.java \ - vmTestbase/gc/lock/malloc/malloclock03/TestDescription.java - # In a loop: fill out the heap until OOME and then partly clear it. Variate object type and size vmTestbase_vm_gc_compact = \ vmTestbase/vm/gc/compact @@ -1983,287 +438,6 @@ vmTestbase/jit \ vmTestbase/vm/jit -vmTestbase_vm_compiler_quick = \ - vmTestbase/vm/compiler/jbe/constprop/constprop01/constprop01.java \ - vmTestbase/vm/compiler/jbe/constprop/constprop02/constprop02.java \ - vmTestbase/vm/compiler/jbe/dead/dead01/dead01.java \ - vmTestbase/vm/compiler/jbe/dead/dead02/dead02.java \ - vmTestbase/vm/compiler/jbe/dead/dead03/dead03.java \ - vmTestbase/vm/compiler/jbe/dead/dead04/dead04.java \ - vmTestbase/vm/compiler/jbe/dead/dead05/dead05.java \ - vmTestbase/vm/compiler/jbe/dead/dead06/dead06.java \ - vmTestbase/vm/compiler/jbe/dead/dead07/dead07.java \ - vmTestbase/vm/compiler/jbe/dead/dead08/dead08.java \ - vmTestbase/vm/compiler/jbe/dead/dead09/dead09.java \ - vmTestbase/vm/compiler/jbe/dead/dead10/dead10.java \ - vmTestbase/vm/compiler/jbe/dead/dead11/dead11.java \ - vmTestbase/vm/compiler/jbe/dead/dead12/dead12.java \ - vmTestbase/vm/compiler/jbe/dead/dead13/dead13.java \ - vmTestbase/vm/compiler/jbe/dead/dead14/dead14.java \ - vmTestbase/vm/compiler/jbe/dead/dead15/dead15.java \ - vmTestbase/vm/compiler/jbe/dead/dead16/dead16.java \ - vmTestbase/vm/compiler/jbe/hoist/hoist01/hoist01.java \ - vmTestbase/vm/compiler/jbe/hoist/hoist02/hoist02.java \ - vmTestbase/vm/compiler/jbe/hoist/hoist03/hoist03.java \ - vmTestbase/vm/compiler/jbe/hoist/hoist04/hoist04.java \ - vmTestbase/vm/compiler/jbe/subcommon/subcommon01/subcommon01.java \ - vmTestbase/vm/compiler/jbe/subcommon/subcommon03/subcommon03.java \ - vmTestbase/vm/compiler/jbe/subcommon/subcommon04/subcommon04.java \ - vmTestbase/vm/compiler/jbe/subcommon/subcommon05/subcommon05.java \ - vmTestbase/vm/compiler/coverage/parentheses/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/stringconcat/explicit/Explicit01/cs_disabled/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/stringconcat/explicit/Explicit01/cs_enabled/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/stringconcat/explicit/Merge01/cs_disabled/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/stringconcat/explicit/Merge01/cs_enabled/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Implicit01/cs_disabled/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Implicit01/cs_enabled/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Merge01/cs_disabled/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Merge01/cs_enabled/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/partialpeel/ForWhile/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/partialpeel/While/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/partialpeel/WhileWhile/TestDescription.java \ - vmTestbase/vm/compiler/optimizations/partialpeel/Do/TestDescription.java \ - vmTestbase/vm/compiler/complog/uninit/uninit001/uninit001.java \ - vmTestbase/vm/compiler/complog/uninit/uninit002/uninit002.java \ - vmTestbase/vm/compiler/complog/uninit/uninit003/uninit003.java \ - vmTestbase/vm/compiler/complog/uninit/uninit004/uninit004.java \ - vmTestbase/vm/compiler/complog/uninit/uninit005/uninit005.java \ - vmTestbase/vm/compiler/complog/uninit/uninit006/uninit006.java \ - vmTestbase/vm/compiler/complog/uninit/uninit007/uninit007.java \ - vmTestbase/vm/compiler/complog/uninit/uninit008/uninit008.java \ - vmTestbase/vm/compiler/complog/uninit/uninit009/uninit009.java \ - vmTestbase/vm/compiler/complog/uninit/uninit010/uninit010.java \ - vmTestbase/vm/compiler/complog/uninit/uninit011/uninit011.java \ - vmTestbase/vm/compiler/complog/uninit/uninit012/uninit012.java \ - vmTestbase/vm/compiler/complog/uninit/uninit013/uninit013.java \ - vmTestbase/jit/Arrays/ArrayBounds/ArrayBounds.java \ - vmTestbase/jit/Arrays/ArrayStoreCheck/ArrayStoreCheck.java \ - vmTestbase/jit/Arrays/ArrayTests/ArrayTests.java \ - vmTestbase/jit/CEETest/CEETest.java \ - vmTestbase/jit/CondExpr/CondExpr.java \ - vmTestbase/jit/DivTest/DivTest.java \ - vmTestbase/jit/ExcOpt/ExcOpt.java \ - vmTestbase/jit/FloatingPoint/FPCompare/TestFPBinop/TestFPBinop.java \ - vmTestbase/jit/FloatingPoint/gen_math/Filtering/Filtering.java \ - vmTestbase/jit/FloatingPoint/gen_math/Loops01/Loops01.java \ - vmTestbase/jit/FloatingPoint/gen_math/Loops02/Loops02.java \ - vmTestbase/jit/FloatingPoint/gen_math/Loops03/Loops03.java \ - vmTestbase/jit/FloatingPoint/gen_math/Loops04/Loops04.java \ - vmTestbase/jit/FloatingPoint/gen_math/Loops05/Loops05.java \ - vmTestbase/jit/FloatingPoint/gen_math/Loops06/Loops06.java \ - vmTestbase/jit/FloatingPoint/gen_math/Loops07/Loops07.java \ - vmTestbase/jit/FloatingPoint/gen_math/Matrix_3d/Matrix_3d.java \ - vmTestbase/jit/FloatingPoint/gen_math/ShortCircuitTest/ShortCircuitTest.java \ - vmTestbase/jit/FloatingPoint/gen_math/Summ/Summ.java \ - vmTestbase/jit/PrintProperties/PrintProperties.java \ - vmTestbase/jit/PrintThis/PrintThis.java \ - vmTestbase/jit/Robert/Robert.java \ - vmTestbase/jit/Sleeper/Sleeper.java \ - vmTestbase/jit/bounds/bounds.java \ - vmTestbase/jit/collapse/collapse.java \ - vmTestbase/jit/deoptimization/test01/test01.java \ - vmTestbase/jit/deoptimization/test02/test02.java \ - vmTestbase/jit/deoptimization/test03/test03.java \ - vmTestbase/jit/deoptimization/test04/test04.java \ - vmTestbase/jit/deoptimization/test05/test05.java \ - vmTestbase/jit/deoptimization/test06/test06.java \ - vmTestbase/jit/deoptimization/test07/test07.java \ - vmTestbase/jit/deoptimization/test08/test08.java \ - vmTestbase/jit/escape/AdaptiveBlocking/AdaptiveBlocking001/AdaptiveBlocking001.java \ - vmTestbase/jit/escape/LockElision/MatMul/MatMul.java \ - vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java \ - vmTestbase/jit/exception/exception.java \ - vmTestbase/jit/graph/cgt0/cgt0.java \ - vmTestbase/jit/graph/cgt1/cgt1.java \ - vmTestbase/jit/graph/cgt2/cgt2.java \ - vmTestbase/jit/graph/cgt3/cgt3.java \ - vmTestbase/jit/graph/cgt4/cgt4.java \ - vmTestbase/jit/graph/cgt5/cgt5.java \ - vmTestbase/jit/graph/cgt6/cgt6.java \ - vmTestbase/jit/graph/cgt7/cgt7.java \ - vmTestbase/jit/graph/cgt8/cgt8.java \ - vmTestbase/jit/graph/cgt9/cgt9.java \ - vmTestbase/jit/graph/cgt10/cgt10.java \ - vmTestbase/jit/graph/cgt11/cgt11.java \ - vmTestbase/jit/init/init01/init01.java \ - vmTestbase/jit/init/init02/init02.java \ - vmTestbase/jit/inline/inline003/inline003.java \ - vmTestbase/jit/inline/inline004/inline004.java \ - vmTestbase/jit/inline/inline005/inline005.java \ - vmTestbase/jit/inline/inline007/inline007.java \ - vmTestbase/jit/misctests/JitBug1/JitBug1.java \ - vmTestbase/jit/misctests/Pi/Pi.java \ - vmTestbase/jit/misctests/clss14702/clss14702.java \ - vmTestbase/jit/misctests/fpustack/GraphApplet.java \ - vmTestbase/jit/misctests/putfield00802/putfield00802.java \ - vmTestbase/jit/misctests/t5/t5.java \ - vmTestbase/jit/overflow/overflow.java \ - vmTestbase/jit/regression/b4427606/b4427606.java \ - vmTestbase/jit/regression/b4446672/b4446672.java \ - vmTestbase/jit/regression/CrashC1/CrashC1.java \ - vmTestbase/jit/series/series.java \ - vmTestbase/jit/t/t001/t001.java \ - vmTestbase/jit/t/t002/t002.java \ - vmTestbase/jit/t/t003/t003.java \ - vmTestbase/jit/t/t004/t004.java \ - vmTestbase/jit/t/t005/t005.java \ - vmTestbase/jit/t/t006/t006.java \ - vmTestbase/jit/t/t007/t007.java \ - vmTestbase/jit/t/t008/t008.java \ - vmTestbase/jit/t/t009/t009.java \ - vmTestbase/jit/t/t011/t011.java \ - vmTestbase/jit/t/t012/t012.java \ - vmTestbase/jit/t/t013/t013.java \ - vmTestbase/jit/t/t014/t014.java \ - vmTestbase/jit/t/t015/t015.java \ - vmTestbase/jit/t/t016/t016.java \ - vmTestbase/jit/t/t017/t017.java \ - vmTestbase/jit/t/t018/t018.java \ - vmTestbase/jit/t/t019/t019.java \ - vmTestbase/jit/t/t020/t020.java \ - vmTestbase/jit/t/t021/t021.java \ - vmTestbase/jit/t/t022/t022.java \ - vmTestbase/jit/t/t023/t023.java \ - vmTestbase/jit/t/t024/t024.java \ - vmTestbase/jit/t/t025/t025.java \ - vmTestbase/jit/t/t026/t026.java \ - vmTestbase/jit/t/t027/t027.java \ - vmTestbase/jit/t/t028/t028.java \ - vmTestbase/jit/t/t029/t029.java \ - vmTestbase/jit/t/t030/t030.java \ - vmTestbase/jit/t/t031/t031.java \ - vmTestbase/jit/t/t032/t032.java \ - vmTestbase/jit/t/t033/t033.java \ - vmTestbase/jit/t/t034/t034.java \ - vmTestbase/jit/t/t035/t035.java \ - vmTestbase/jit/t/t036/t036.java \ - vmTestbase/jit/t/t037/t037.java \ - vmTestbase/jit/t/t038/t038.java \ - vmTestbase/jit/t/t039/t039.java \ - vmTestbase/jit/t/t040/t040.java \ - vmTestbase/jit/t/t041/t041.java \ - vmTestbase/jit/t/t042/t042.java \ - vmTestbase/jit/t/t043/t043.java \ - vmTestbase/jit/t/t044/t044.java \ - vmTestbase/jit/t/t045/t045.java \ - vmTestbase/jit/t/t046/t046.java \ - vmTestbase/jit/t/t047/t047.java \ - vmTestbase/jit/t/t048/t048.java \ - vmTestbase/jit/t/t049/t049.java \ - vmTestbase/jit/t/t050/t050.java \ - vmTestbase/jit/t/t051/t051.java \ - vmTestbase/jit/t/t052/t052.java \ - vmTestbase/jit/t/t053/t053.java \ - vmTestbase/jit/t/t054/t054.java \ - vmTestbase/jit/t/t055/t055.java \ - vmTestbase/jit/t/t056/t056.java \ - vmTestbase/jit/t/t057/t057.java \ - vmTestbase/jit/t/t058/t058.java \ - vmTestbase/jit/t/t059/t059.java \ - vmTestbase/jit/t/t060/t060.java \ - vmTestbase/jit/t/t061/t061.java \ - vmTestbase/jit/t/t062/t062.java \ - vmTestbase/jit/t/t063/t063.java \ - vmTestbase/jit/t/t064/t064.java \ - vmTestbase/jit/t/t065/t065.java \ - vmTestbase/jit/t/t066/t066.java \ - vmTestbase/jit/t/t067/t067.java \ - vmTestbase/jit/t/t068/t068.java \ - vmTestbase/jit/t/t069/t069.java \ - vmTestbase/jit/t/t070/t070.java \ - vmTestbase/jit/t/t071/t071.java \ - vmTestbase/jit/t/t072/t072.java \ - vmTestbase/jit/t/t073/t073.java \ - vmTestbase/jit/t/t074/t074.java \ - vmTestbase/jit/t/t075/t075.java \ - vmTestbase/jit/t/t076/t076.java \ - vmTestbase/jit/t/t077/t077.java \ - vmTestbase/jit/t/t078/t078.java \ - vmTestbase/jit/t/t079/t079.java \ - vmTestbase/jit/t/t080/t080.java \ - vmTestbase/jit/t/t081/t081.java \ - vmTestbase/jit/t/t086/t086.java \ - vmTestbase/jit/t/t087/t087.java \ - vmTestbase/jit/t/t088/t088.java \ - vmTestbase/jit/t/t091/t091.java \ - vmTestbase/jit/t/t093/t093.java \ - vmTestbase/jit/t/t094/t094.java \ - vmTestbase/jit/t/t095/t095.java \ - vmTestbase/jit/t/t096/t096.java \ - vmTestbase/jit/t/t098/t098.java \ - vmTestbase/jit/t/t099/t099.java \ - vmTestbase/jit/t/t100/t100.java \ - vmTestbase/jit/t/t101/t101.java \ - vmTestbase/jit/t/t102/t102.java \ - vmTestbase/jit/t/t103/t103.java \ - vmTestbase/jit/t/t104/t104.java \ - vmTestbase/jit/t/t105/t105.java \ - vmTestbase/jit/t/t106/t106.java \ - vmTestbase/jit/t/t107/t107.java \ - vmTestbase/jit/t/t108/TestDescription.java \ - vmTestbase/jit/t/t109/TestDescription.java \ - vmTestbase/jit/t/t110/TestDescription.java \ - vmTestbase/jit/t/t111/TestDescription.java \ - vmTestbase/jit/t/t112/TestDescription.java \ - vmTestbase/jit/t/t113/TestDescription.java \ - vmTestbase/jit/tiered/TestDescription.java \ - vmTestbase/jit/verifier/VerifyInitLocal/VerifyInitLocal.java \ - vmTestbase/jit/verifier/VerifyMergeStack/VerifyMergeStack.java \ - vmTestbase/jit/wide/wide01/wide01.java \ - vmTestbase/jit/wide/wide02/wide02.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc1/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc2/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc3/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc4/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc5/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc6/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc7/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc8/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc9/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc10/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc11/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc12/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc13/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc14/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc15/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc16/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc17/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc18/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc19/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc20/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc21/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc22/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc23/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc24/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc25/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc26/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc27/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc28/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc29/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc30/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc31/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc32/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc33/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc34/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc35/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc36/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc37/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc38/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc39/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc40/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc41/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc42/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc43/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc44/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc45/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc46/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc47/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc48/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc49/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc50/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc51/TestDescription.java \ - vmTestbase/vm/jit/LongTransitions/nativeFnc52/TestDescription.java - # JSR292 tests (invokedynamic AKA Multi-Language VM AKA Da Vinci Machine) vmTestbase_vm_mlvm = \ vmTestbase/vm/mlvm @@ -2275,3 +449,5 @@ # JDB tests vmTestbase_nsk_jdb = \ vmTestbase/nsk/jdb + +# vmTestbase_*_quick groups are defined in TEST.quick-groups diff -Nru openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java --- openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/ByteCodeGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,14 +23,14 @@ package jdk.test.lib.jittester; -import java.io.FileOutputStream; +import jdk.test.lib.jittester.visitors.ByteCodeVisitor; + import java.io.IOException; import java.io.PrintWriter; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.util.function.Function; -import jdk.test.lib.jittester.visitors.ByteCodeVisitor; /** * Generates class files from IRTree @@ -88,8 +88,8 @@ } private void writeFile(String fileName, byte[] bytecode) { - try (FileOutputStream file = new FileOutputStream(generatorDir.resolve(fileName).toFile())) { - file.write(bytecode); + try { + Files.write(generatorDir.resolve(fileName), bytecode); } catch (IOException ex) { ex.printStackTrace(); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/JavaCodeGenerator.java openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/JavaCodeGenerator.java --- openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/JavaCodeGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/JavaCodeGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,6 @@ package jdk.test.lib.jittester; -import java.io.File; import java.io.IOException; import java.util.function.Function; import jdk.test.lib.jittester.visitors.JavaCodeVisitor; @@ -65,7 +64,9 @@ } private void compileJavaFile(String mainClassName) { - String classPath = getRoot() + File.pathSeparator + generatorDir; + String classPath = getRoot().resolve(generatorDir) + .toAbsolutePath() + .toString(); ProcessBuilder pb = new ProcessBuilder(JAVAC, "-cp", classPath, generatorDir.resolve(mainClassName + ".java").toString()); try { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java --- openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/jtreg/JitTesterDriver.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,15 +24,15 @@ package jdk.test.lib.jittester.jtreg; import jdk.test.lib.Asserts; +import jdk.test.lib.Utils; import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -import jdk.test.lib.Utils; + import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; -import java.util.function.Predicate; import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java --- openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TestsGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -58,7 +58,9 @@ } protected void generateGoldenOut(String mainClassName) { - String classPath = getRoot() + File.pathSeparator + generatorDir; + String classPath = getRoot().resolve(generatorDir) + .toAbsolutePath() + .toString(); ProcessBuilder pb = new ProcessBuilder(JAVA, "-Xint", DISABLE_WARNINGS, "-Xverify", "-cp", classPath, mainClassName); String goldFile = mainClassName + ".gold"; @@ -182,7 +184,10 @@ for (String name : env) { String path = System.getenv(name); if (path != null) { - return path + "/bin/"; + return Paths.get(path) + .resolve("bin") + .toAbsolutePath() + .toString(); } } return ""; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TypesParser.java openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TypesParser.java --- openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TypesParser.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/TypesParser.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,6 +31,7 @@ import java.lang.reflect.Modifier; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; @@ -207,7 +208,7 @@ Asserts.assertNotNull(klassesFileName, "Classes input file name is null"); Asserts.assertFalse(klassesFileName.isEmpty(), "Classes input file name is empty"); List<String> klassNamesList = new ArrayList<>(); - Path klassesFilePath = (new File(klassesFileName)).toPath(); + Path klassesFilePath = Paths.get(klassesFileName); try { Files.lines(klassesFilePath).forEach(line -> { line = line.trim(); @@ -223,7 +224,7 @@ throw new Error("Error reading klasses file", ex); } List<Class<?>> klassesList = new ArrayList<>(); - klassNamesList.stream().forEach(klassName -> { + klassNamesList.forEach(klassName -> { try { klassesList.add(Class.forName(klassName)); } catch (ClassNotFoundException ex) { @@ -237,7 +238,7 @@ Asserts.assertNotNull(methodsFileName, "Methods exclude input file name is null"); Asserts.assertFalse(methodsFileName.isEmpty(), "Methods exclude input file name is empty"); LinkedList<String> methodNamesList = new LinkedList<>(); - Path klassesFilePath = (new File(methodsFileName)).toPath(); + Path klassesFilePath = Paths.get(methodsFileName); try { Files.lines(klassesFilePath).forEach(line -> { line = line.trim(); @@ -253,7 +254,7 @@ throw new Error("Error reading exclude method file", ex); } Set<Executable> methodsList = new HashSet<>(); - methodNamesList.stream().forEach(methodName -> { + methodNamesList.forEach(methodName -> { String[] klassAndNameAndSig = methodName.split("::"); String klassName = klassAndNameAndSig[0].replaceAll("/", "\\."); String[] nameAndSig = klassAndNameAndSig[1].split("[\\(\\)]"); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/ByteCodeVisitor.java openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/ByteCodeVisitor.java --- openjdk-11-11~19/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/ByteCodeVisitor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/testlibrary/jittester/src/jdk/test/lib/jittester/visitors/ByteCodeVisitor.java 2018-07-25 15:36:46.000000000 +0000 @@ -1011,7 +1011,7 @@ @Override public byte[] visit(Interface node) { String name = node.getName(); - ContextDependedClassWriter classWriter = new ContextDependedClassWriter(context, CLASS_WRITER_FLAGS); + ContextDependedClassWriter classWriter = new ContextDependedClassWriter(CLASS_WRITER_FLAGS); classWriters.put(name, classWriter); TypeKlass parentKlass = node.getParentKlass(); classWriter.visit(Opcodes.V1_8, @@ -1036,7 +1036,7 @@ String name = node.getName(); TypeKlass prevClass = currentClass; currentClass = node.getThisKlass(); - ContextDependedClassWriter classWriter = new ContextDependedClassWriter(context, CLASS_WRITER_FLAGS); + ContextDependedClassWriter classWriter = new ContextDependedClassWriter(CLASS_WRITER_FLAGS); classWriters.put(name, classWriter); TypeKlass thisClass = node.getThisKlass(); TypeKlass parentClass = node.getParentKlass(); @@ -1233,7 +1233,7 @@ TypeKlass prevClass = currentClass; currentClass = node.getThisKlass(); String name = node.getName(); - ContextDependedClassWriter mainClassWriter = new ContextDependedClassWriter(context, CLASS_WRITER_FLAGS); + ContextDependedClassWriter mainClassWriter = new ContextDependedClassWriter(CLASS_WRITER_FLAGS); classWriters.put(name, mainClassWriter); TypeKlass thisClass = node.getThisKlass(); @@ -1780,11 +1780,10 @@ } } - private static class GeneratedClassesContext extends java.lang.ClassLoader { + private static class GeneratedClassesContext { private final HashMap<String, byte[]> byteCodes = new HashMap<>(); public void register(String name, byte[] bytecode) { - defineClass(name, bytecode, 0, bytecode.length); byteCodes.put(name, bytecode); } @@ -1795,37 +1794,32 @@ private static class ContextDependedClassWriter extends ClassWriter { - private final GeneratedClassesContext context; - - public ContextDependedClassWriter(GeneratedClassesContext context, int flags) { + public ContextDependedClassWriter(int flags) { super(flags); - this.context = context; } protected String getCommonSuperClass(String className1, String className2) { - Class<?> klass1; - Class<?> klass2; - try { - klass1 = Class.forName(className1.replace('/', '.'), false, context); - klass2 = Class.forName(className2.replace('/', '.'), false, context); - } catch (ClassNotFoundException e) { - throw new Error("can not get common supper for " + className1 - + " and " + className2, e); + TypeKlass type1 = (TypeKlass) TypeList.find(className1.replace('/', '.')); + TypeKlass type2 = (TypeKlass) TypeList.find(className2.replace('/', '.')); + if (type1 == null || type2 == null) { + return super.getCommonSuperClass(className1, className2); } - if (klass1.isAssignableFrom(klass2)) { + if (type2.canImplicitlyCastTo(type1)) { return className1; - } else if (klass2.isAssignableFrom(klass1)) { + } + if (type1.canImplicitlyCastTo(type2)) { return className2; - } else if (!klass1.isInterface() && !klass2.isInterface()) { - do { - klass1 = klass1.getSuperclass(); - } while (!klass1.isAssignableFrom(klass2)); - - return asInternalName(className1); - } else { + } + if (type1.isInterface() || type2.isInterface()) { return "java/lang/Object"; } + + do { + type1 = type1.getParent(); + } while (!type2.canImplicitlyCastTo(type1)); + + return asInternalName(type1.getName()); } } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/testlibrary_tests/RedefineClassTest.java openjdk-11-11~24/test/hotspot/jtreg/testlibrary_tests/RedefineClassTest.java --- openjdk-11-11~19/test/hotspot/jtreg/testlibrary_tests/RedefineClassTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/testlibrary_tests/RedefineClassTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -38,19 +38,22 @@ /* * Proof of concept test for the test utility class RedefineClassHelper */ + +// package access top-level class to avoid problem with RedefineClassHelper +// and nested types. +class RedefineClassTest_A { + public int Method() { + return 1; + } +} + public class RedefineClassTest { - public static String newClass = "class RedefineClassTest$A { public int Method() { return 2; } }"; + public static String newClass = "class RedefineClassTest_A { public int Method() { return 2; } }"; public static void main(String[] args) throws Exception { - A a = new A(); + RedefineClassTest_A a = new RedefineClassTest_A(); assertTrue(a.Method() == 1); - RedefineClassHelper.redefineClass(A.class, newClass); + RedefineClassHelper.redefineClass(RedefineClassTest_A.class, newClass); assertTrue(a.Method() == 2); } - - static class A { - public int Method() { - return 1; - } - } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java openjdk-11-11~24/test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java --- openjdk-11-11~19/test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/testlibrary_tests/TestMutuallyExclusivePlatformPredicates.java 2018-07-25 15:36:46.000000000 +0000 @@ -51,7 +51,7 @@ VM_TYPE("isClient", "isServer", "isGraal", "isMinimal", "isZero", "isEmbedded"), MODE("isInt", "isMixed", "isComp"), IGNORED("isEmulatedClient", "isDebugBuild", "isFastDebugBuild", "isSlowDebugBuild", - "shouldSAAttach", "isTieredSupported", "areCustomLoadersSupportedForCDS"); + "hasSA", "shouldSAAttach", "isTieredSupported", "areCustomLoadersSupportedForCDS"); public final List<String> methodNames; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/TEST.quick-groups openjdk-11-11~24/test/hotspot/jtreg/TEST.quick-groups --- openjdk-11-11~19/test/hotspot/jtreg/TEST.quick-groups 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/TEST.quick-groups 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1844 @@ +# +# Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA +# or visit www.oracle.com if you need additional information or have any +# questions. +# + +vmTestbase_nsk_monitoring_quick = \ + vmTestbase/nsk/monitoring/MemoryNotificationInfo/MemoryNotificationInfo/info001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryNotificationInfo/from/from001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryNotificationInfo/getCount/getcount001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryNotificationInfo/getPoolName/getpoolname001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryNotificationInfo/getUsage/getusage001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsage/getusage005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThreshold/getthreshold005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getCollectionUsageThresholdCount/getcount005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getPeakUsage/getpeak005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsage/getusage005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThreshold/getthreshold005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/getUsageThresholdCount/getcount005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdExceeded/isexceeded005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isCollectionUsageThresholdSupported/issupported005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdExceeded/isexceeded005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/isUsageThresholdSupported/issupported005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/resetPeakUsage/reset005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setCollectionUsageThreshold/setthreshold005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold002/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold003/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold004/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryPoolMBean/setUsageThreshold/setthreshold005/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryUsage/MemoryUsage/memoryusage001/TestDescription.java \ + vmTestbase/nsk/monitoring/MemoryUsage/from/from001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadInfo/from_c/from_c001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadInfo/getLockName/getlockname001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadInfo/getLockOwnerName/getlockownername001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadInfo/isInNative/isinnative001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadInfo/isSuspended/issuspended001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadInfo/isSuspended/issuspended002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/findMonitorDeadlockedThreads/find006/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isCurrentThreadCpuTimeSupported/curthcputime005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadContentionMonitoringSupported/thcontmonitor005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/isThreadCpuTimeSupported/thcputime005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/resetPeakThreadCount/reset005/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel001/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel002/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel003/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel004/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerLevel/getloggerlevel005/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel001/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel002/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel003/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel004/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/setLoggerLevel/setloggerlevel005/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername001/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername002/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername003/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername004/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getParentLoggerName/getparentloggername005/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames001/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames002/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames003/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames004/TestDescription.java \ + vmTestbase/nsk/monitoring/LoggingMXBean/getLoggerNames/getloggernames005/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount001/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount002/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount003/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount004/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionCount/getcollectioncount005/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime001/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime002/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime003/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime004/TestDescription.java \ + vmTestbase/nsk/monitoring/GarbageCollectorMXBean/getCollectionTime/getcollectiontime005/TestDescription.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean001/RuntimeMXBean001.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean002/TestDescription.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean003/TestDescription.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean004/TestDescription.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean005/TestDescription.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean006/RuntimeMXBean006.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean007/TestDescription.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean008/TestDescription.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean009/TestDescription.java \ + vmTestbase/nsk/monitoring/RuntimeMXBean/RuntimeMXBean010/TestDescription.java \ + vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon001/comptimemon001.java \ + vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon002/TestDescription.java \ + vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon003/TestDescription.java \ + vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon004/TestDescription.java \ + vmTestbase/nsk/monitoring/CompilationMXBean/comptimemon005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/TimedWaitingThread/TimedWaitingThread005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread001/RunningThread001.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/RunningThread/RunningThread005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SleepingThread/SleepingThread005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/WaitingThread/WaitingThread005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/BlockedThread/BlockedThread005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NativeBlockedThread/NativeBlockedThread005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/NewThread/NewThread005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/FinishedThread/FinishedThread005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/LockingThreads/LockingThreads005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/SynchronizerLockingThreads/SynchronizerLockingThreads005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock002/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock003/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock004/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/JavaDeadlock005/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/NativeDeadlock001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/SynchronizerDeadlock001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/SynchronizedMethodDeadlock001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/ThreadInfo/Deadlock/MixedDeadlock001/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_directly/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_server_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_server_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_proxy_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/baseBehaviorTest_proxy_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_directly/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_server_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_server_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_proxy_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadCpuTime/illegalArgumentsTest_proxy_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_directly/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_server_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_server_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_proxy_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/allocatedMemorySupportedTest_proxy_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_directly/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_server_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_server_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_proxy_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/baseBehaviorTest_proxy_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_directly_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_server_default_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_server_custom_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_proxy_default_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_proxy_custom_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_directly_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_server_default_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_server_custom_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_proxy_default_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/doubleAllocationTest_proxy_custom_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_directly_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_server_default_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_server_custom_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_proxy_default_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_proxy_custom_array/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_directly_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_server_default_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_server_custom_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_proxy_default_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/equalThreadsTest_proxy_custom_string/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_directly/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_server_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_server_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_proxy_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/illegalArgumentsTest_proxy_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_directly/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_server_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_server_custom/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_proxy_default/TestDescription.java \ + vmTestbase/nsk/monitoring/ThreadMXBean/GetThreadAllocatedBytes/noAllocationTest_proxy_custom/TestDescription.java + +vmTestbase_nsk_jdi_quick = \ + vmTestbase/nsk/jdi/Argument/description/description001/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/isValid/isvalid001/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/isValid/isvalid002/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/isValid/isvalid003/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/isValid/isvalid004/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/isValid/isvalid005/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/name/name001/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/value/value001/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/value/value002/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/value/value003/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/setValue/setvalue001/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/setValue/setvalue002/TestDescription.java \ + vmTestbase/nsk/jdi/Argument/mustSpecify/mustspecify001/TestDescription.java \ + vmTestbase/nsk/jdi/AttachingConnector/attach/attach002/TestDescription.java \ + vmTestbase/nsk/jdi/BooleanArgument/booleanValue/booleanvalue001/TestDescription.java \ + vmTestbase/nsk/jdi/BooleanArgument/booleanValue/booleanvalue002/TestDescription.java \ + vmTestbase/nsk/jdi/BooleanArgument/isValid/isvalid001/TestDescription.java \ + vmTestbase/nsk/jdi/BooleanArgument/isValid/isvalid002/TestDescription.java \ + vmTestbase/nsk/jdi/BooleanArgument/setValue/setvalue001/TestDescription.java \ + vmTestbase/nsk/jdi/BooleanArgument/setValue/setvalue002/TestDescription.java \ + vmTestbase/nsk/jdi/BooleanArgument/stringValueOf/stringvalueof001/TestDescription.java \ + vmTestbase/nsk/jdi/BooleanArgument/stringValueOf/stringvalueof002/TestDescription.java \ + vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses001/TestDescription.java \ + vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses002/TestDescription.java \ + vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses003/TestDescription.java \ + vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses004/TestDescription.java \ + vmTestbase/nsk/jdi/ClassLoaderReference/definedClasses/definedclasses005/TestDescription.java \ + vmTestbase/nsk/jdi/ClassLoaderReference/visibleClasses/visibleclasses002/TestDescription.java \ + vmTestbase/nsk/jdi/Connector/defaultArguments/defaultArguments001/TestDescription.java \ + vmTestbase/nsk/jdi/Connector/defaultArguments/defaultArguments002/TestDescription.java \ + vmTestbase/nsk/jdi/Connector/defaultArguments/defaultArguments003/TestDescription.java \ + vmTestbase/nsk/jdi/Connector/description/description001/TestDescription.java \ + vmTestbase/nsk/jdi/Connector/name/name001/TestDescription.java \ + vmTestbase/nsk/jdi/Connector/transport/transport001/TestDescription.java \ + vmTestbase/nsk/jdi/FloatValue/compareTo/compareto001/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerArgument/intValue/intvalue001/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerArgument/intValue/intvalue002/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerArgument/isValid/isvalid001/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerArgument/isValid/isvalid002/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerArgument/isValid/isvalid003/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerArgument/max/max001/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerArgument/min/min001/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerArgument/setValue/setvalue001/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerArgument/stringValueOf/stringvalueof001/TestDescription.java \ + vmTestbase/nsk/jdi/IntegerValue/compareTo/compareto001/TestDescription.java \ + vmTestbase/nsk/jdi/LaunchingConnector/launch/launch001/TestDescription.java \ + vmTestbase/nsk/jdi/LaunchingConnector/launch/launch002/TestDescription.java \ + vmTestbase/nsk/jdi/LaunchingConnector/launch/launch004/TestDescription.java \ + vmTestbase/nsk/jdi/ListeningConnector/accept/accept001/TestDescription.java \ + vmTestbase/nsk/jdi/ListeningConnector/accept/accept002/TestDescription.java \ + vmTestbase/nsk/jdi/ListeningConnector/stopListening/stoplis001/TestDescription.java \ + vmTestbase/nsk/jdi/ListeningConnector/supportsMultipleConnections/supportsmultipleconnections001/TestDescription.java \ + vmTestbase/nsk/jdi/ListeningConnector/listennosuspend/listennosuspend001/TestDescription.java \ + vmTestbase/nsk/jdi/LongValue/compareTo/compareto001/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/entryCount/entrycount002/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/owningThread/owningthread002/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/waitingThreads/waitingthreads002/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/waitingThreads/waitingthreads003/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/waitingThreads/waitingthreads004/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/isVerified/isverified003/TestDescription.java \ + vmTestbase/nsk/jdi/SelectedArgument/choices/choices001/TestDescription.java \ + vmTestbase/nsk/jdi/SelectedArgument/isValid/isvalid001/TestDescription.java \ + vmTestbase/nsk/jdi/SelectedArgument/isValid/isvalid002/TestDescription.java \ + vmTestbase/nsk/jdi/ShortType/_itself_/shorttype001/TestDescription.java \ + vmTestbase/nsk/jdi/ShortValue/compareTo/compareto001/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/thisObject/thisobject002/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/thread/thread001/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname001/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/visibleVariableByName/visiblevarbyname002/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables001/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/visibleVariables/visiblevariables002/TestDescription.java \ + vmTestbase/nsk/jdi/StepEvent/_itself_/stepevent001/TestDescription.java \ + vmTestbase/nsk/jdi/StepEvent/_itself_/stepevent002/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addClassExclusionFilter/filter001/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addClassExclusionFilter/filter002/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addClassFilter_s/filter_s001/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addClassFilter_s/filter_s002/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt001/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt002/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/depth/depth001/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/depth/depth002/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/depth/depth003/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/size/size001/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/size/size002/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/thread/thread001/TestDescription.java \ + vmTestbase/nsk/jdi/StringArgument/isValid/isvalid001/TestDescription.java \ + vmTestbase/nsk/jdi/StringArgument/isValid/isvalid002/TestDescription.java \ + vmTestbase/nsk/jdi/StringArgument/isValid/isvalid003/TestDescription.java \ + vmTestbase/nsk/jdi/StringReference/value/value001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadDeathEvent/thread/thread001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter002/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter003/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter004/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadDeathRequest/addThreadFilter/addthreadfilter005/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadGroupReference/name/name001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadGroupReference/parent/parent001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadGroupReference/resume/resume001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadGroupReference/suspend/suspend001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadGroupReference/threadGroups/threadgroups001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadGroupReference/threads/threads001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/frame/frame001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/frameCount/framecount001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/frames/frames001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii002/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/isAtBreakpoint/isatbreakpoint001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended003/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/isSuspended/issuspended004/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/name/name001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/ownedMonitors/ownedmonitors001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/suspendCount/suspendcount001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/threadGroup/threadgroup001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/currentContendedMonitor/currentcm001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/interrupt/interrupt001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/resume/resume001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/status/status003/status003.java \ + vmTestbase/nsk/jdi/ThreadReference/status/status004/status004.java \ + vmTestbase/nsk/jdi/ThreadReference/status/status005/status005.java \ + vmTestbase/nsk/jdi/ThreadReference/status/status006/status006.java \ + vmTestbase/nsk/jdi/ThreadReference/status/status007/status007.java \ + vmTestbase/nsk/jdi/ThreadReference/status/status008/status008.java \ + vmTestbase/nsk/jdi/ThreadReference/stop/stop001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter002/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter003/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter004/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadStartRequest/addThreadFilter/addthreadfilter005/TestDescription.java \ + vmTestbase/nsk/jdi/Transport/name/name001/TestDescription.java \ + vmTestbase/nsk/jdi/Type/name/name001/TestDescription.java \ + vmTestbase/nsk/jdi/Type/name/name002/TestDescription.java \ + vmTestbase/nsk/jdi/Type/name/name003/TestDescription.java \ + vmTestbase/nsk/jdi/Type/signature/signature001/TestDescription.java \ + vmTestbase/nsk/jdi/Type/signature/signature002/TestDescription.java \ + vmTestbase/nsk/jdi/Type/signature/signature003/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype002/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype003/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype007/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype008/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isFinal/isfinal001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isFinal/isfinal003/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isStatic/isstatic001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isStatic/isstatic003/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isSynthetic/issynthetic002/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/name/name001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/name/name003/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/signature/sign001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/signature/sign003/TestDescription.java \ + vmTestbase/nsk/jdi/Value/type/type001/TestDescription.java \ + vmTestbase/nsk/jdi/Value/type/type002/type002.java \ + vmTestbase/nsk/jdi/Value/type/type003/TestDescription.java \ + vmTestbase/nsk/jdi/Value/_itself_/value001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/allClasses/allclasses001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/allClasses/allclasses002/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/allThreads/allthreads001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canGetBytecodes/cangetbytecodes001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canGetCurrentContendedMonitor/cangccm001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canGetMonitorInfo/cangetmonitorinfo001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canGetOwnedMonitorInfo/cangetinfo001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canGetSyntheticAttribute/cangetattr001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldAccess/canwatchaccess001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canWatchFieldModification/canwatchmod001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/classesByName/classesbyname001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/description/description001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/eventQueue/eventqueue001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/eventRequestManager/eventrmanager001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/exit/exit001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/exit/exit002/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_bool/mirrorof_bool001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_byte/mirrorof_byte001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_char/mirrorof_char001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_double/mirrorof_double001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_float/mirrorof_float001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_int/mirrorof_int001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_long/mirrorof_long001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_short/mirrorof_short001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/mirrorOf_string/mirrorof_string001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/name/name001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/process/process001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/topLevelThreadGroups/toplevelgroups001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/version/version001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/allConnectors/allconnectors001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/attachingConnectors/attaching001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm002/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/connectedVirtualMachines/convm003/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/defaultConnector/default001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/launchingConnectors/launching001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/listeningConnectors/listening001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/majorInterfaceVersion/major001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/minorInterfaceVersion/minor001/TestDescription.java \ + vmTestbase/nsk/jdi/VoidType/_itself_/voidtype001/TestDescription.java \ + vmTestbase/nsk/jdi/VoidValue/equals/equals001/equals001.java \ + vmTestbase/nsk/jdi/VoidValue/hashCode/hashcode001/hashcode001.java \ + vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath001/TestDescription.java \ + vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath002/TestDescription.java \ + vmTestbase/nsk/jdi/VMDeathEvent/_itself_/vmdeath003/TestDescription.java \ + vmTestbase/nsk/jdi/VMDisconnectEvent/_itself_/disconnect001/TestDescription.java \ + vmTestbase/nsk/jdi/VMDisconnectEvent/_itself_/disconnect002/TestDescription.java \ + vmTestbase/nsk/jdi/VMDisconnectEvent/_itself_/disconnect003/TestDescription.java \ + vmTestbase/nsk/jdi/VMStartEvent/thread/thread001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointEvent/object/object001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointEvent/field/field001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointEvent/valueCurrent/valuecur001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter002/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter003/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassExclusionFilter/filter004/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s002/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s003/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_s/filter_s004/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt002/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt003/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt004/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt005/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addClassFilter_rt/filter_rt006/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter002/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter003/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter004/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter005/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter006/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter007/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addThreadFilter/addthreadfilter008/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/field/field001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/field/field002/TestDescription.java \ + vmTestbase/nsk/jdi/AttachingConnector/attach/attach003/TestDescription.java \ + vmTestbase/nsk/jdi/ClassObjectReference/toString/tostring001/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod003/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod010/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod011/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod012/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod013/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod014/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/newInstance/newinstance009/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/setValue/setvalue006/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/setValue/setvalue007/TestDescription.java \ + vmTestbase/nsk/jdi/Connector/_bounds_/bounds001/TestDescription.java \ + vmTestbase/nsk/jdi/Connector/toString/tostring001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc01x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc01x002/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc02x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc02x002/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc03x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc04x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc04x002/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc05x002/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc06x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc07x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc08x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc09x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc09x002/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc10x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/hotswap/tc10x002/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/multithrd/tc01x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x002/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x003/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/multithrd/tc02x004/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/multithrd/tc03x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/multithrd/tc04x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/singlethrd/tc01x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/singlethrd/tc01x002/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/singlethrd/tc02x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/singlethrd/tc03x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/singlethrd/tc03x002/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/singlethrd/tc03x003/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/singlethrd/tc04x001/TestDescription.java \ + vmTestbase/nsk/jdi/BScenarios/singlethrd/tc05x001/TestDescription.java \ + vmTestbase/nsk/jdi/Event/equals/equals001/TestDescription.java \ + vmTestbase/nsk/jdi/Event/hashCode/hashcode001/TestDescription.java \ + vmTestbase/nsk/jdi/EventQueue/hashCode/hashcode001/TestDescription.java \ + vmTestbase/nsk/jdi/EventRequest/disable/disable003/TestDescription.java \ + vmTestbase/nsk/jdi/EventRequest/hashCode/hashcode001/TestDescription.java \ + vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequest/delevtreq003/TestDescription.java \ + vmTestbase/nsk/jdi/EventRequestManager/hashCode/hashcode001/TestDescription.java \ + vmTestbase/nsk/jdi/EventSet/resume/resume011/TestDescription.java \ + vmTestbase/nsk/jdi/EventSet/toString/tostring001/TestDescription.java \ + vmTestbase/nsk/jdi/EventSet/virtualMachine/virtualmachine001/TestDescription.java \ + vmTestbase/nsk/jdi/LocalVariable/toString/tostring001/TestDescription.java \ + vmTestbase/nsk/jdi/Method/_bounds_/bounds001/TestDescription.java \ + vmTestbase/nsk/jdi/Method/isObsolete/isobsolete003/TestDescription.java \ + vmTestbase/nsk/jdi/MethodEntryRequest/_bounds_/filters001/TestDescription.java \ + vmTestbase/nsk/jdi/MethodExitRequest/_bounds_/filters001/TestDescription.java \ + vmTestbase/nsk/jdi/Mirror/hashCode/hashcode001/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/_bounds_/bounds001/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/_bounds_/bounds002/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod002/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod003/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod004/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod005/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod007/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod008/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod009/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod010/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod011/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod012/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod013/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/invokeMethod/invokemethod014/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue002/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue003/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue004/TestDescription.java \ + vmTestbase/nsk/jdi/ObjectReference/setValue/setvalue005/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/_bounds_/bounds001/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/_bounds_/bounds002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/allFields/allfields005/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/allLineLocations/alllinelocations002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/alllinelocations_ss002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/allMethods/allmethods005/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/fields/fields005/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue004/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/getValue/getvalue005/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/getValues/getvalues002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/getValues/getvalues003/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_i/locationsofline_i002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsofline_ssi002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/methods/methods005/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/sourceName/sourcename004/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/sourceNames/sourcenames002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/sourcePaths/sourcepaths002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/visibleFields/visibfield005/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/visibleMethods/visibmethod006/TestDescription.java \ + vmTestbase/nsk/jdi/Scenarios/invokeMethod/popframes001/TestDescription.java \ + vmTestbase/nsk/jdi/Scenarios/invokeMethod/redefineclasses001/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/_bounds_/bounds002/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/getValue/getvalue003/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/getValues/getvalues003/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/hashCode/hashcode001/TestDescription.java \ + vmTestbase/nsk/jdi/StackFrame/setValue/setvalue005/setvalue005.java \ + vmTestbase/nsk/jdi/StackFrame/setValue/setvalue006/setvalue006.java \ + vmTestbase/nsk/jdi/StackFrame/toString/tostring001/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/_bounds_/filters001/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addClassFilter_rt/filter_rt003/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter001/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter002/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter003/TestDescription.java \ + vmTestbase/nsk/jdi/StepRequest/addInstanceFilter/instancefilter004/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadGroupReference/toString/tostring001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/frames_ii/frames_ii001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/ownedMonitors/ownedmonitors002/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes001/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes002/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes003/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes004/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes005/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes006/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/popFrames/popframes007/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/stop/stop002/TestDescription.java \ + vmTestbase/nsk/jdi/Type/hashCode/hashcode001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isPackagePrivate/ispackageprivate001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isPrivate/isprivate001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isProtected/isprotected001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isPublic/ispublic001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointEvent/_itself_/wevent001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/_bounds_/filters001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter001/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter002/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter003/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter004/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter005/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter006/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter007/TestDescription.java \ + vmTestbase/nsk/jdi/WatchpointRequest/addInstanceFilter/instancefilter008/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canAddMethod/canaddmethod001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canGetSourceDebugExtension/cangetsde001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canPopFrames/canpopframes001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canRedefineClasses/canredefineclasses001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canRequestVMDeathEvent/canreqvmdev001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canUnrestrictedlyRedefineClasses/curc001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canUseInstanceFilters/canusefilters001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/getDefaultStratum/getdefaultstratum001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses002/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses003/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses004/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses005/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses006/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses007/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses008/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses009/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses010/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses011/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses012/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses013/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses014/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses015/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses016/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses020/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses022/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses024/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses026/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses027/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses028/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses029/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses030/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses032/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses034/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/redefineClasses/redefineclasses035/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/setDefaultStratum/setdefaultstratum001/TestDescription.java \ + vmTestbase/nsk/jdi/VoidType/toString/tostring001/TestDescription.java \ + vmTestbase/nsk/jdi/VoidValue/equals/equals002/TestDescription.java \ + vmTestbase/nsk/jdi/VoidValue/toString/tostring001/TestDescription.java \ + vmTestbase/nsk/jdi/ConstantField/values001/TestDescription.java \ + vmTestbase/nsk/jdi/Accessible/isPackagePrivate/accipp002/TestDescription.java \ + vmTestbase/nsk/jdi/Accessible/isPrivate/isprivate002/TestDescription.java \ + vmTestbase/nsk/jdi/Accessible/isProtected/isprotected002/TestDescription.java \ + vmTestbase/nsk/jdi/Accessible/isPublic/ispublic002/TestDescription.java \ + vmTestbase/nsk/jdi/Accessible/isPublic/ispublic003/TestDescription.java \ + vmTestbase/nsk/jdi/Accessible/modifiers/modifiers002/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/allInterfaces/allinterfaces002/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/interfaces/interfaces002/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/invokeMethod/invokemethod015/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/isEnum/isenum001/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/setValue/setvalue008/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/subclasses/subclasses002/TestDescription.java \ + vmTestbase/nsk/jdi/ClassType/superclass/superclass002/TestDescription.java \ + vmTestbase/nsk/jdi/Field/isEnumConstant/isenumconstant001/TestDescription.java \ + vmTestbase/nsk/jdi/Field/type/type004/TestDescription.java \ + vmTestbase/nsk/jdi/Field/typeName/typename002/TestDescription.java \ + vmTestbase/nsk/jdi/LocalVariable/genericSignature/gensignature001/TestDescription.java \ + vmTestbase/nsk/jdi/Method/arguments/arguments003/TestDescription.java \ + vmTestbase/nsk/jdi/Method/argumentTypeNames/argumenttypenames003/TestDescription.java \ + vmTestbase/nsk/jdi/Method/isBridge/isbridge001/TestDescription.java \ + vmTestbase/nsk/jdi/Method/isVarArgs/isvarargs001/TestDescription.java \ + vmTestbase/nsk/jdi/PlugConnectors/AttachConnector/plugAttachConnect001/plugAttachConnect001.java \ + vmTestbase/nsk/jdi/PlugConnectors/AttachConnector/plugAttachConnect002/plugAttachConnect002.java \ + vmTestbase/nsk/jdi/PlugConnectors/AttachConnector/plugAttachConnect003/plugAttachConnect003.java \ + vmTestbase/nsk/jdi/PlugConnectors/LaunchConnector/plugLaunchConnect001/plugLaunchConnect001.java \ + vmTestbase/nsk/jdi/PlugConnectors/LaunchConnector/plugLaunchConnect002/plugLaunchConnect002.java \ + vmTestbase/nsk/jdi/PlugConnectors/LaunchConnector/plugLaunchConnect003/plugLaunchConnect003.java \ + vmTestbase/nsk/jdi/PlugConnectors/ListenConnector/plugListenConnect001/plugListenConnect001.java \ + vmTestbase/nsk/jdi/PlugConnectors/ListenConnector/plugListenConnect002/plugListenConnect002.java \ + vmTestbase/nsk/jdi/PlugConnectors/ListenConnector/plugListenConnect003/plugListenConnect003.java \ + vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect001/plugMultiConnect001.java \ + vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect002/plugMultiConnect002.java \ + vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect003/plugMultiConnect003.java \ + vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect004/plugMultiConnect004.java \ + vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect005/plugMultiConnect005.java \ + vmTestbase/nsk/jdi/PlugConnectors/MultiConnectors/plugMultiConnect006/plugMultiConnect006.java \ + vmTestbase/nsk/jdi/PlugConnectors/TransportService/transportService001/transportService001.java \ + vmTestbase/nsk/jdi/PlugConnectors/TransportService/transportService002/transportService002.java \ + vmTestbase/nsk/jdi/PlugConnectors/TransportService/transportService003/transportService003.java \ + vmTestbase/nsk/jdi/ReferenceType/allFields/allfields006/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/allMethods/allmethods006/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/classObject/classobj003/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/fields/fields006/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/genericSignature/genericSignature001/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/genericSignature/genericSignature002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/isAbstract/isabstract003/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/isFinal/isfinal002/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/isInitialized/isinit003/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/methods/methods006/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/visibleFields/visibfield006/TestDescription.java \ + vmTestbase/nsk/jdi/ReferenceType/visibleMethods/visibmethod007/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/declaringType/decltype009/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/genericSignature/genericSignature001/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/genericSignature/genericSignature002/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isFinal/isfinal004/TestDescription.java \ + vmTestbase/nsk/jdi/TypeComponent/isStatic/isstatic004/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/canBeModified/canbemodified001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM002/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM003/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM004/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachineManager/createVirtualMachine/createVM005/TestDescription.java \ + vmTestbase/nsk/jdi/VMCannotBeModifiedEx/_itself_/canntbemod001/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts001/instancecounts001.java \ + vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts002/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts003/instancecounts003.java \ + vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts004/instancecounts004.java \ + vmTestbase/nsk/jdi/ReferenceType/instances/instances001/instances001.java \ + vmTestbase/nsk/jdi/ReferenceType/instances/instances002/instances002.java \ + vmTestbase/nsk/jdi/ReferenceType/instances/instances005/instances005.java \ + vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects001/referringObjects001.java \ + vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects002/referringObjects002.java \ + vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects003/referringObjects003.java \ + vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects004/referringObjects004.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn003/forceEarlyReturn003.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn004/forceEarlyReturn004.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn005/forceEarlyReturn005.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn006/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn007/TestDescription.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn008/forceEarlyReturn008.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn009/forceEarlyReturn009.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn013/forceEarlyReturn013.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn014/forceEarlyReturn014.java \ + vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn015/forceEarlyReturn015.java \ + vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames001/ownedMonitorsAndFrames001.java \ + vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames002/ownedMonitorsAndFrames002.java \ + vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames003/ownedMonitorsAndFrames003.java \ + vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames004/ownedMonitorsAndFrames004.java \ + vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames005/ownedMonitorsAndFrames005.java \ + vmTestbase/nsk/jdi/ThreadReference/ownedMonitorsAndFrames/ownedMonitorsAndFrames008/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addClassExclusionFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addClassFilter_ClassName/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addClassFilter_ReferenceType/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addInstanceFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnteredRequest/addThreadFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addClassExclusionFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addClassFilter_ClassName/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addClassFilter_ReferenceType/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addInstanceFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorContendedEnterRequest/addThreadFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitRequest/addClassExclusionFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitRequest/addClassFilter_ClassName/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitRequest/addClassFilter_ReferenceType/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitRequest/addInstanceFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitRequest/addThreadFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitedRequest/addClassExclusionFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitedRequest/addClassFilter_ClassName/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitedRequest/addClassFilter_ReferenceType/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitedRequest/addInstanceFilter/TestDescription.java \ + vmTestbase/nsk/jdi/MonitorWaitedRequest/addThreadFilter/TestDescription.java \ + vmTestbase/nsk/jdi/stress/ClassPrepareEvents/ClassPrepareEvents001/ClassPrepareEvents001.java \ + vmTestbase/nsk/jdi/ClassPrepareRequest/addSourceNameFilter/addSourceNameFilter001/addSourceNameFilter001.java \ + vmTestbase/nsk/jdi/ClassPrepareRequest/addSourceNameFilter/addSourceNameFilter002/addSourceNameFilter002.java \ + vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java \ + vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn001/TestDescription.java \ + vmTestbase/nsk/jdi/stress/serial/heapwalking001/TestDescription.java \ + vmTestbase/nsk/jdi/stress/serial/monitorEvents001/TestDescription.java \ + vmTestbase/nsk/jdi/stress/serial/ownedMonitorsAndFrames001/TestDescription.java \ + vmTestbase/nsk/jdi/stress/serial/mixed001/TestDescription.java \ + vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn002/TestDescription.java \ + vmTestbase/nsk/jdi/stress/serial/monitorEvents002/TestDescription.java \ + vmTestbase/nsk/jdi/stress/serial/ownedMonitorsAndFrames002/TestDescription.java \ + vmTestbase/nsk/jdi/VirtualMachine/setDefaultStratum/setDefaultStratum002/setDefaultStratum002.java \ + vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/allLineLocations_ss003/allLineLocations_ss003.java \ + vmTestbase/nsk/jdi/ReferenceType/allLineLocations_ss/allLineLocations_ss004/allLineLocations_ss004.java \ + vmTestbase/nsk/jdi/Method/allLineLocations_ss/allLineLocations_ss002/allLineLocations_ss002.java \ + vmTestbase/nsk/jdi/Method/allLineLocations_ss/allLineLocations_ss003/allLineLocations_ss003.java \ + vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsOfLine_ssi003/locationsOfLine_ssi003.java \ + vmTestbase/nsk/jdi/ReferenceType/locationsOfLine_ssi/locationsOfLine_ssi004/locationsOfLine_ssi004.java \ + vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsOfLine_ssi002/locationsOfLine_ssi002.java \ + vmTestbase/nsk/jdi/Method/locationsOfLine_ssi/locationsOfLine_ssi003/locationsOfLine_ssi003.java \ + vmTestbase/nsk/jdi/ReferenceType/sourceNames/sourceNames003/sourceNames003.java \ + vmTestbase/nsk/jdi/ReferenceType/sourcePaths/sourcePaths003/sourcePaths003.java \ + vmTestbase/nsk/jdi/ReferenceType/availableStrata/availableStrata002/availableStrata002.java \ + vmTestbase/nsk/jdi/ReferenceType/defaultStratum/defaultStratum002/defaultStratum002.java \ + vmTestbase/nsk/jdi/Location/lineNumber_s/lineNumber_s002/lineNumber_s002.java \ + vmTestbase/nsk/jdi/Location/sourceName_s/sourceName_s002/sourceName_s002.java \ + vmTestbase/nsk/jdi/Location/sourcePath_s/sourcePath_s002/sourcePath_s002.java \ + vmTestbase/nsk/jdi/AttachingConnector/attach/attach005/TestDescription.java \ + vmTestbase/nsk/jdi/AttachingConnector/attachnosuspend/attachnosuspend002/TestDescription.java \ + vmTestbase/nsk/jdi/AttachingConnector/attachnosuspend/attachnosuspend003/TestDescription.java \ + vmTestbase/nsk/jdi/MethodExitEvent/returnValue/returnValue001/returnValue001.java \ + vmTestbase/nsk/jdi/MethodExitEvent/returnValue/returnValue002/returnValue002.java \ + vmTestbase/nsk/jdi/MethodExitEvent/returnValue/returnValue003/returnValue003.java \ + vmTestbase/nsk/jdi/MethodExitEvent/returnValue/returnValue004/returnValue004.java \ + vmTestbase/nsk/jdi/StackFrame/getArgumentValues/getArgumentValues001/getArgumentValues001.java \ + vmTestbase/nsk/jdi/StackFrame/getArgumentValues/getArgumentValues002/getArgumentValues002.java \ + vmTestbase/nsk/jdi/StackFrame/getArgumentValues/getArgumentValues003/getArgumentValues003.java + +vmTestbase_nsk_jvmti_quick = \ + vmTestbase/nsk/jvmti/AddCapabilities/addcaps001/TestDescription.java \ + vmTestbase/nsk/jvmti/AddCapabilities/addcaps002/TestDescription.java \ + vmTestbase/nsk/jvmti/AddCapabilities/addcaps003/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch001/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch002/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch003/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch004/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch007/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch008/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch009/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch010/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch001/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch002/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch003/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch004/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch005/TestDescription.java \ + vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch006/TestDescription.java \ + vmTestbase/nsk/jvmti/Agent_OnLoad/agentonload001/TestDescription.java \ + vmTestbase/nsk/jvmti/Agent_OnLoad/agentonload002/TestDescription.java \ + vmTestbase/nsk/jvmti/Agent_OnLoad/agentonload003/TestDriver.java \ + vmTestbase/nsk/jvmti/Agent_OnUnload/agentonunload001/TestDriver.java \ + vmTestbase/nsk/jvmti/Breakpoint/breakpoint001/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk001/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk002/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk003/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk004/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk005/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk006/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk007/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk008/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk009/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassLoad/classload001/TestDescription.java \ + vmTestbase/nsk/jvmti/ClassPrepare/classprep001/TestDescription.java \ + vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk001/TestDescription.java \ + vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk002/TestDescription.java \ + vmTestbase/nsk/jvmti/ClearBreakpoint/clrbrk005/TestDescription.java \ + vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw001/TestDescription.java \ + vmTestbase/nsk/jvmti/ClearFieldAccessWatch/clrfldw002/TestDescription.java \ + vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw001/TestDescription.java \ + vmTestbase/nsk/jvmti/ClearFieldModificationWatch/clrfmodw002/TestDescription.java \ + vmTestbase/nsk/jvmti/CompiledMethodLoad/compmethload001/TestDescription.java \ + vmTestbase/nsk/jvmti/CreateRawMonitor/crrawmon001/TestDescription.java \ + vmTestbase/nsk/jvmti/CreateRawMonitor/crrawmon002/TestDescription.java \ + vmTestbase/nsk/jvmti/DisposeEnvironment/disposeenv001/TestDescription.java \ + vmTestbase/nsk/jvmti/DisposeEnvironment/disposeenv002/TestDescription.java \ + vmTestbase/nsk/jvmti/Deallocate/dealloc001/TestDescription.java \ + vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon001/TestDescription.java \ + vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon003/TestDescription.java \ + vmTestbase/nsk/jvmti/DestroyRawMonitor/drrawmon004/TestDescription.java \ + vmTestbase/nsk/jvmti/DynamicCodeGenerated/dyncodgen001/TestDescription.java \ + vmTestbase/nsk/jvmti/Exception/exception001/TestDescription.java \ + vmTestbase/nsk/jvmti/ExceptionCatch/excatch001/TestDescription.java \ + vmTestbase/nsk/jvmti/FieldAccess/fieldacc001/TestDescription.java \ + vmTestbase/nsk/jvmti/FieldAccess/fieldacc002/TestDescription.java \ + vmTestbase/nsk/jvmti/FieldAccess/fieldacc003/TestDescription.java \ + vmTestbase/nsk/jvmti/FieldAccess/fieldacc004/TestDescription.java \ + vmTestbase/nsk/jvmti/FieldModification/fieldmod001/TestDescription.java \ + vmTestbase/nsk/jvmti/FieldModification/fieldmod002/TestDescription.java \ + vmTestbase/nsk/jvmti/ForceGarbageCollection/forcegc001/TestDescription.java \ + vmTestbase/nsk/jvmti/ForceGarbageCollection/forcegc002/TestDescription.java \ + vmTestbase/nsk/jvmti/FramePop/framepop001/TestDescription.java \ + vmTestbase/nsk/jvmti/FramePop/framepop002/TestDescription.java \ + vmTestbase/nsk/jvmti/GenerateEvents/genevents001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetAllThreads/allthr001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetAllThreads/allthr002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetAvailableProcessors/getavailproc001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetArgumentsSize/argsize001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetArgumentsSize/argsize002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetBytecodes/bytecodes001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetBytecodes/bytecodes002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetBytecodes/bytecodes003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetCapabilities/getcaps001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetCapabilities/getcaps002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassFields/getclfld005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassFields/getclfld006/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassFields/getclfld007/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassLoader/getclsldr001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassLoader/getclsldr002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassLoader/getclsldr003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassLoaderClasses/clsldrclss001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassLoaderClasses/clsldrclss002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassMethods/getclmthd005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassMethods/getclmthd006/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassMethods/getclmthd007/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf006/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassModifiers/getclmdf007/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassSignature/getclsig004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassSignature/getclsig005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassSignature/getclsig006/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassStatus/getclstat005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassStatus/getclstat006/TestDescription.java \ + vmTestbase/nsk/jvmti/GetClassStatus/getclstat007/TestDescription.java \ + vmTestbase/nsk/jvmti/GetCurrentContendedMonitor/contmon001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetCurrentContendedMonitor/contmon002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetCurrentContendedMonitor/contmon003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetCurrentThreadCpuTime/curthrcputime001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetCurrentThreadCpuTimerInfo/curthrtimerinfo001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetEnvironmentLocalStorage/getenvstor001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetErrorName/geterrname001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetErrorName/geterrname002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetExtensionEvents/extevents001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetExtensionFunctions/extfuncs001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFieldDeclaringClass/getfldecl001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFieldDeclaringClass/getfldecl002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFieldDeclaringClass/getfldecl004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFieldModifiers/getfldmdf003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFieldModifiers/getfldmdf004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFieldName/getfldnm003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFieldName/getfldnm004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFieldName/getfldnm005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFrameCount/framecnt001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFrameCount/framecnt002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFrameCount/framecnt003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFrameLocation/frameloc002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetFrameLocation/frameloc003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetImplementedInterfaces/getintrf005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetImplementedInterfaces/getintrf006/TestDescription.java \ + vmTestbase/nsk/jvmti/GetImplementedInterfaces/getintrf007/TestDescription.java \ + vmTestbase/nsk/jvmti/GetJLocationFormat/getjlocfmt001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetJLocationFormat/getjlocfmt002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetJNIFunctionTable/getjniftab001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetJNIFunctionTable/getjniftab002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLineNumberTable/linetab001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLineNumberTable/linetab002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLineNumberTable/linetab003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLoadedClasses/loadedclss001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLoadedClasses/loadedclss002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLocalVariable/getlocal001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLocalVariable/getlocal002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetLocalVariableTable/localtab005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMaxLocals/maxloc001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMaxLocals/maxloc002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodDeclaringClass/declcls001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodDeclaringClass/declcls002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodDeclaringClass/declcls003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetObjectHashCode/objhashcode001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodLocation/methloc001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodLocation/methloc002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodModifiers/methmod001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodModifiers/methmod002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodName/methname001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodName/methname002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetMethodName/methname003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetObjectMonitorUsage/objmonusage005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetObjectSize/objsize001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetObjectsWithTags/objwithtags001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetOwnedMonitorInfo/ownmoninf001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetOwnedMonitorInfo/ownmoninf002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetOwnedMonitorInfo/ownmoninf003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetPhase/getphase001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetPhase/getphase002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetPotentialCapabilities/getpotcaps001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSourceDebugExtension/srcdebugex001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSourceDebugExtension/srcdebugex002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSourceDebugExtension/srcdebugex003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSourceFileName/getsrcfn004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSourceFileName/getsrcfn005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSourceFileName/getsrcfn006/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSystemProperties/getsysprops001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSystemProperties/getsysprops002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSystemProperty/getsysprop001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetSystemProperty/getsysprop002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetStackTrace/getstacktr001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetStackTrace/getstacktr002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetStackTrace/getstacktr003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetStackTrace/getstacktr004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetStackTrace/getstacktr005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetStackTrace/getstacktr006/TestDescription.java \ + vmTestbase/nsk/jvmti/GetStackTrace/getstacktr007/TestDescription.java \ + vmTestbase/nsk/jvmti/GetStackTrace/getstacktr008/TestDescription.java \ + vmTestbase/nsk/jvmti/GetStackTrace/getstacktr009/TestDescription.java \ + vmTestbase/nsk/jvmti/GetTag/gettag001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadCpuTime/thrcputime001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadCpuTime/thrcputime002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadCpuTimerInfo/thrtimerinfo001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadGroupChildren/getthrdgrpchld001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadGroupInfo/thrgrpinfo001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadGroupInfo/thrgrpinfo002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadInfo/thrinfo001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadInfo/thrinfo002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadLocalStorage/getthrdstor001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadState/thrstat001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadState/thrstat002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadState/thrstat003/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadState/thrstat004/TestDescription.java \ + vmTestbase/nsk/jvmti/GetThreadState/thrstat005/TestDescription.java \ + vmTestbase/nsk/jvmti/GetTime/gettime001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetTimerInfo/timerinfo001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetTopThreadGroups/topthrgrp001/TestDescription.java \ + vmTestbase/nsk/jvmti/GetTopThreadGroups/topthrgrp002/TestDescription.java \ + vmTestbase/nsk/jvmti/GetVersionNumber/getvern001/TestDescription.java \ + vmTestbase/nsk/jvmti/InterruptThread/intrpthrd001/TestDescription.java \ + vmTestbase/nsk/jvmti/InterruptThread/intrpthrd002/TestDescription.java \ + vmTestbase/nsk/jvmti/InterruptThread/intrpthrd003/TestDescription.java \ + vmTestbase/nsk/jvmti/IsArrayClass/isarray004/TestDescription.java \ + vmTestbase/nsk/jvmti/IsArrayClass/isarray005/TestDescription.java \ + vmTestbase/nsk/jvmti/IsFieldSynthetic/isfldsin002/TestDescription.java \ + vmTestbase/nsk/jvmti/IsFieldSynthetic/isfldsin003/TestDescription.java \ + vmTestbase/nsk/jvmti/IsInterface/isintrf004/TestDescription.java \ + vmTestbase/nsk/jvmti/IsInterface/isintrf005/TestDescription.java \ + vmTestbase/nsk/jvmti/IsMethodNative/isnative001/TestDescription.java \ + vmTestbase/nsk/jvmti/IsMethodNative/isnative002/TestDescription.java \ + vmTestbase/nsk/jvmti/IsMethodObsolete/isobsolete001/TestDescription.java \ + vmTestbase/nsk/jvmti/IsMethodSynthetic/issynth001/TestDescription.java \ + vmTestbase/nsk/jvmti/IsMethodSynthetic/issynth002/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverHeap/iterheap001/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverHeap/iterheap002/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverHeap/iterheap003/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverHeap/iterheap004/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverHeap/iterheap005/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverHeap/iterheap006/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverHeap/iterheap007/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls001/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls002/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls003/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls004/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls005/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls006/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverInstancesOfClass/iterinstcls007/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj001/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj002/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj003/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj004/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverObjectsReachableFromObject/iterobjreachobj005/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj001/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj002/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj003/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj004/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateOverReachableObjects/iterreachobj005/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateThroughHeap/callbacks/Callbacks.java \ + vmTestbase/nsk/jvmti/IterateThroughHeap/concrete-klass-filter/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateThroughHeap/non-concrete-klass-filter/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateThroughHeap/filter-tagged/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateThroughHeap/filter-untagged/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateThroughHeap/filter-class-tagged/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateThroughHeap/filter-class-untagged/TestDescription.java \ + vmTestbase/nsk/jvmti/IterateThroughHeap/abort/Abort.java \ + vmTestbase/nsk/jvmti/MethodEntry/mentry001/TestDescription.java \ + vmTestbase/nsk/jvmti/MethodEntry/mentry002/TestDescription.java \ + vmTestbase/nsk/jvmti/MethodExit/mexit002/TestDescription.java \ + vmTestbase/nsk/jvmti/MonitorContendedEnter/mcontenter001/TestDescription.java \ + vmTestbase/nsk/jvmti/MonitorContendedEntered/mcontentered001/TestDescription.java \ + vmTestbase/nsk/jvmti/MonitorWait/monitorwait001/TestDescription.java \ + vmTestbase/nsk/jvmti/MonitorWaited/monitorwaited001/TestDescription.java \ + vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind001/TestDescription.java \ + vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind002/TestDescription.java \ + vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind003/TestDescription.java \ + vmTestbase/nsk/jvmti/NativeMethodBind/nativemethbind004/TestDescription.java \ + vmTestbase/nsk/jvmti/NotifyFramePop/nframepop001/TestDescription.java \ + vmTestbase/nsk/jvmti/NotifyFramePop/nframepop002/TestDescription.java \ + vmTestbase/nsk/jvmti/NotifyFramePop/nframepop003/TestDescription.java \ + vmTestbase/nsk/jvmti/ObjectFree/objfree002/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe001/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe002/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe003/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe004/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe005/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe006/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe007/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe008/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe009/TestDescription.java \ + vmTestbase/nsk/jvmti/PopFrame/popframe010/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorEnter/rawmonenter001/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorEnter/rawmonenter002/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorEnter/rawmonenter003/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorEnter/rawmonenter004/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorExit/rawmonexit001/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorExit/rawmonexit002/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorExit/rawmonexit003/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorExit/rawmonexit005/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorNotify/rawmnntfy001/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorNotify/rawmnntfy002/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorNotify/rawmnntfy003/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorNotify/rawmnntfy004/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorNotifyAll/rawmnntfyall001/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorNotifyAll/rawmnntfyall002/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorNotifyAll/rawmnntfyall003/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorNotifyAll/rawmnntfyall004/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait001/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait002/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait003/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait004/TestDescription.java \ + vmTestbase/nsk/jvmti/RawMonitorWait/rawmnwait005/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/StressRedefineWithoutBytecodeCorruption/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass001/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass002/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass003/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass004/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass005/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass006/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass008/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass009/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass010/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass011/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass012/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass013/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass014/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass015/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass016/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass017/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass018/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass019/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass020/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass021/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass022/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass023/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass024/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass025/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass026/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass027/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass028/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass029/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass030/TestDescription.java \ + vmTestbase/nsk/jvmti/RedefineClasses/redefclass031/TestDescription.java \ + vmTestbase/nsk/jvmti/RelinquishCapabilities/relcaps001/TestDescription.java \ + vmTestbase/nsk/jvmti/RelinquishCapabilities/relcaps002/TestDescription.java \ + vmTestbase/nsk/jvmti/ResumeThread/resumethrd001/TestDescription.java \ + vmTestbase/nsk/jvmti/ResumeThread/resumethrd002/TestDescription.java \ + vmTestbase/nsk/jvmti/ResumeThreadList/resumethrdlst001/TestDescription.java \ + vmTestbase/nsk/jvmti/ResumeThreadList/resumethrdlst002/TestDescription.java \ + vmTestbase/nsk/jvmti/RunAgentThread/agentthr001/TestDescription.java \ + vmTestbase/nsk/jvmti/RunAgentThread/agentthr002/TestDescription.java \ + vmTestbase/nsk/jvmti/RunAgentThread/agentthr003/TestDescription.java \ + vmTestbase/nsk/jvmti/SetBreakpoint/setbrk002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetBreakpoint/setbrk003/TestDescription.java \ + vmTestbase/nsk/jvmti/SetBreakpoint/setbrk005/TestDescription.java \ + vmTestbase/nsk/jvmti/SetBreakpoint/setbrk007/TestDescription.java \ + vmTestbase/nsk/jvmti/SetBreakpoint/setbrk008/TestDescription.java \ + vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetEnvironmentLocalStorage/setenvstor003/TestDescription.java \ + vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetEventCallbacks/setevntcallb003/TestDescription.java \ + vmTestbase/nsk/jvmti/SetEventNotificationMode/setnotif001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetExtensionEventCallback/setextevent001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw003/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw004/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw005/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldAccessWatch/setfldw006/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw003/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw004/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw005/TestDescription.java \ + vmTestbase/nsk/jvmti/SetFieldModificationWatch/setfmodw006/TestDescription.java \ + vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetJNIFunctionTable/setjniftab002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetLocalVariable/setlocal001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetLocalVariable/setlocal002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetLocalVariable/setlocal003/TestDescription.java \ + vmTestbase/nsk/jvmti/SetLocalVariable/setlocal004/TestDescription.java \ + vmTestbase/nsk/jvmti/SetSystemProperty/setsysprop002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetSystemProperty/setsysprop003/TestDescription.java \ + vmTestbase/nsk/jvmti/SetTag/settag001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetThreadLocalStorage/setthrdstor003/TestDescription.java \ + vmTestbase/nsk/jvmti/SetVerboseFlag/setvrbflag001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetVerboseFlag/setvrbflag002/TestDescription.java \ + vmTestbase/nsk/jvmti/SingleStep/singlestep001/TestDescription.java \ + vmTestbase/nsk/jvmti/SingleStep/singlestep003/TestDescription.java \ + vmTestbase/nsk/jvmti/SuspendThread/suspendthrd001/TestDescription.java \ + vmTestbase/nsk/jvmti/SuspendThreadList/suspendthrdlst001/TestDescription.java \ + vmTestbase/nsk/jvmti/StopThread/stopthrd006/TestDescription.java \ + vmTestbase/nsk/jvmti/StopThread/stopthrd007/TestDescription.java \ + vmTestbase/nsk/jvmti/ThreadEnd/threadend001/TestDescription.java \ + vmTestbase/nsk/jvmti/ThreadEnd/threadend002/TestDescription.java \ + vmTestbase/nsk/jvmti/ThreadStart/threadstart001/TestDescription.java \ + vmTestbase/nsk/jvmti/ThreadStart/threadstart002/TestDescription.java \ + vmTestbase/nsk/jvmti/ThreadStart/threadstart003/TestDescription.java \ + vmTestbase/nsk/jvmti/VMDeath/vmdeath001/TestDescription.java \ + vmTestbase/nsk/jvmti/VMInit/vminit001/TestDescription.java \ + vmTestbase/nsk/jvmti/VMObjectAlloc/vmobjalloc001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP01/ap01t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP02/ap02t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP03/ap03t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP05/ap05t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP05/ap05t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP06/ap06t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP07/ap07t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP07/ap07t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP09/ap09t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP10/ap10t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/allocation/AP11/ap11t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/bcinstr/BI01/bi01t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/bcinstr/BI01/bi01t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/bcinstr/BI02/bi02t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/bcinstr/BI03/bi03t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/bcinstr/BI04/bi04t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t004/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t005/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t006/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t008/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t009/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t010/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t011/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t012/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t013/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t014/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t015/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t016/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t017/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t018/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t019/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t020/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM01/cm01t021/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/capability/CM02/cm02t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/contention/TC01/tc01t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/contention/TC02/tc02t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/contention/TC03/tc03t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/contention/TC04/tc04t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM01/em01t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM01/em01t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t004/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t008/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t009/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t010/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM02/em02t011/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM04/em04t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM05/em05t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM06/em06t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/events/EM07/em07t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/general_functions/GF01/gf01t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/general_functions/GF04/gf04t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/general_functions/GF06/gf06t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t001/TestDriver.java \ + vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/general_functions/GF08/gf08t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t004/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t005/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t006/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t007/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS101/hs101t008/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS102/hs102t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS103/hs103t002/hs103t002.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS104/hs104t001/hs104t001.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS104/hs104t002/hs104t002.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS201/hs201t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t001/hs202t001.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS202/hs202t002/hs202t002.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t001/hs203t001.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t002/hs203t002.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS203/hs203t003/hs203t003.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t002/hs204t002.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t003/hs204t003.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS204/hs204t004/hs204t004.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t001/hs301t001.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t002/hs301t002.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t003/hs301t003.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t004/hs301t004.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS301/hs301t005/hs301t005.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t001/hs302t001.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t002/hs302t002.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t003/hs302t003.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t004/hs302t004.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t005/hs302t005.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t006/hs302t006.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t007/hs302t007.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t008/hs302t008.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t009/hs302t009.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t010/hs302t010.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t011/hs302t011.java \ + vmTestbase/nsk/jvmti/scenarios/hotswap/HS302/hs302t012/hs302t012.java \ + vmTestbase/nsk/jvmti/scenarios/jni_interception/JI01/ji01t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/jni_interception/JI03/ji03t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/jni_interception/JI03/ji03t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/jni_interception/JI03/ji03t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA01/ma01t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA02/ma02t001/TestDriver.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA03/ma03t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA04/ma04t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA04/ma04t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA04/ma04t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA05/ma05t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA06/ma06t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA07/ma07t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA08/ma08t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t004/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t005/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t006/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t007/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/multienv/MA10/ma10t008/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP01/sp01t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP02/sp02t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP03/sp03t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP03/sp03t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP04/sp04t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP05/sp05t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t002/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP06/sp06t003/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t001/TestDescription.java \ + vmTestbase/nsk/jvmti/scenarios/sampling/SP07/sp07t002/TestDescription.java \ + vmTestbase/nsk/jvmti/AttachOnDemand/attach002a/TestDescription.java \ + vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java \ + vmTestbase/nsk/jvmti/RetransformClasses/retransform002/TestDescription.java \ + vmTestbase/nsk/jvmti/RetransformClasses/retransform003/TestDriver.java \ + vmTestbase/nsk/jvmti/RetransformClasses/retransform004/TestDescription.java \ + vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn001/TestDescription.java \ + vmTestbase/nsk/jvmti/ForceEarlyReturn/ForceEarlyReturn002/TestDescription.java \ + vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix001/TestDescription.java \ + vmTestbase/nsk/jvmti/SetNativeMethodPrefix/SetNativeMethodPrefix002/TestDriver.java \ + vmTestbase/nsk/jvmti/GetEnv/GetEnv001/GetEnv001.java \ + vmTestbase/nsk/jvmti/unit/MethodBind/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/OnUnload/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/StackTrace/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/agentthr/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/clsldrclss00x/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/events/redefineCFLH/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/extmech/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/functions/AddToBootstrapClassLoaderSearch/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/functions/Dispose/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/functions/environment/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/functions/nosuspendMonitorInfo/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/functions/nosuspendStackTrace/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/functions/rawmonitor/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/heap/BasicIterationTests/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/heap/BasicTagTests/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/heap/GetWithTests/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/heap/HeapWalkTests/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/heap/ObjectFreeTests/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/heap/ObjectSizeTests/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/heapref/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/refignore/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/setNullVMInit/JvmtiTest/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/GetLineNumberTable/linetab004/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal003/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/GetLocalVariable/getlocal004/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/IsSynthetic/issynth001/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/FollowReferences/followref001/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/FollowReferences/followref002/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/FollowReferences/followref003/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/FollowReferences/followref004/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/FollowReferences/followref005/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/FollowReferences/followref006/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretbase/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretfp/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretint/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretlong/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretobj/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretstr/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/ForceEarlyReturn/earlyretvoid/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/GetAllStackTraces/getallstktr001/TestDescription.java \ + vmTestbase/nsk/jvmti/unit/GetConstantPool/getcpool001/TestDescription.java + +vmTestbase_nsk_jdwp_quick = \ + vmTestbase/nsk/jdwp/ArrayReference/GetValues/getvalues001/TestDescription.java \ + vmTestbase/nsk/jdwp/ArrayReference/GetValues/getvalues002/TestDescription.java \ + vmTestbase/nsk/jdwp/ArrayReference/Length/length001/TestDescription.java \ + vmTestbase/nsk/jdwp/ArrayReference/SetValues/setvalues001/TestDescription.java \ + vmTestbase/nsk/jdwp/ArrayType/NewInstance/newinstance001/TestDescription.java \ + vmTestbase/nsk/jdwp/ClassLoaderReference/VisibleClasses/visibclasses001/TestDescription.java \ + vmTestbase/nsk/jdwp/ClassObjectReference/ReflectedType/reflectype001/TestDescription.java \ + vmTestbase/nsk/jdwp/ClassType/InvokeMethod/invokemeth001/TestDescription.java \ + vmTestbase/nsk/jdwp/ClassType/NewInstance/newinst001/TestDescription.java \ + vmTestbase/nsk/jdwp/ClassType/SetValues/setvalues001/TestDescription.java \ + vmTestbase/nsk/jdwp/ClassType/Superclass/superclass001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/BREAKPOINT/breakpoint001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/EXCEPTION/exception001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/FIELD_ACCESS/fldaccess001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/FIELD_MODIFICATION/fldmodification001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/CLASS_PREPARE/clsprepare001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/CLASS_UNLOAD/clsunload001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/METHOD_ENTRY/methentry001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/METHOD_EXIT/methexit001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/SINGLE_STEP/singlestep001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/SINGLE_STEP/singlestep002/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/SINGLE_STEP/singlestep003/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/THREAD_DEATH/thrdeath001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/THREAD_START/thrstart001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/VM_DEATH/vmdeath001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/VM_START/vmstart001/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/Composite/composite001/TestDescription.java \ + vmTestbase/nsk/jdwp/EventRequest/Clear/clear001/TestDescription.java \ + vmTestbase/nsk/jdwp/EventRequest/ClearAllBreakpoints/clrallbreakp001/TestDescription.java \ + vmTestbase/nsk/jdwp/EventRequest/ClearAllBreakpoints/clrallbreakp002/TestDescription.java \ + vmTestbase/nsk/jdwp/EventRequest/ClearAllBreakpoints/clrallbreakp003/TestDescription.java \ + vmTestbase/nsk/jdwp/EventRequest/Set/set001/TestDescription.java \ + vmTestbase/nsk/jdwp/EventRequest/Set/set002/TestDescription.java \ + vmTestbase/nsk/jdwp/Method/LineTable/linetable001/TestDescription.java \ + vmTestbase/nsk/jdwp/Method/VariableTable/vartable001/TestDescription.java \ + vmTestbase/nsk/jdwp/Method/Bytecodes/bytecodes001/TestDescription.java \ + vmTestbase/nsk/jdwp/ObjectReference/DisableCollection/disablecol001/TestDescription.java \ + vmTestbase/nsk/jdwp/ObjectReference/EnableCollection/enablecol001/TestDescription.java \ + vmTestbase/nsk/jdwp/ObjectReference/GetValues/getvalues001/TestDescription.java \ + vmTestbase/nsk/jdwp/ObjectReference/InvokeMethod/invokemeth001/TestDescription.java \ + vmTestbase/nsk/jdwp/ObjectReference/IsCollected/iscollected001/TestDescription.java \ + vmTestbase/nsk/jdwp/ObjectReference/MonitorInfo/monitorinfo001/TestDescription.java \ + vmTestbase/nsk/jdwp/ObjectReference/ReferenceType/referencetype001/TestDescription.java \ + vmTestbase/nsk/jdwp/ObjectReference/SetValues/setvalues001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/ClassLoader/classloader001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/ClassObject/classobj001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/Fields/fields001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/GetValues/getvalues001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/Interfaces/interfaces001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/Methods/methods001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/Modifiers/modifiers001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/NestedTypes/nestedtypes001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/Signature/signature001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/SourceFile/srcfile001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/Status/status001/TestDescription.java \ + vmTestbase/nsk/jdwp/StackFrame/GetValues/getvalues001/TestDescription.java \ + vmTestbase/nsk/jdwp/StackFrame/SetValues/setvalues001/TestDescription.java \ + vmTestbase/nsk/jdwp/StackFrame/ThisObject/thisobject001/TestDescription.java \ + vmTestbase/nsk/jdwp/StringReference/Value/value001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadGroupReference/Children/children001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadGroupReference/Name/name001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadGroupReference/Parent/parent001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/CurrentContendedMonitor/curcontmonitor001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/Frames/frames001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/FrameCount/framecnt001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/Interrupt/interrupt001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/Name/name001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/OwnedMonitors/ownmonitors001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/Resume/resume001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/Status/status001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/Stop/stop001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/Suspend/suspend001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/SuspendCount/suspendcnt001/TestDescription.java \ + vmTestbase/nsk/jdwp/ThreadReference/ThreadGroup/threadgroup001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/AllThreads/allthreads001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/Capabilities/capabilities001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/ClassPaths/classpaths001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/ClassesBySignature/classbysig001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/CreateString/createstr001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/Dispose/dispose001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/DisposeObjects/disposeobj001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/Exit/exit001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/HoldEvents/holdevents001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/IDSizes/idsizes001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/TopLevelThreadGroups/threadgroups001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/ReleaseEvents/releaseevents001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/ReleaseEvents/releaseevents002/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/Resume/resume001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/Version/version001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/Version/version002/TestDescription.java \ + vmTestbase/nsk/jdwp/Event/VM_DEATH/vmdeath002/TestDescription.java \ + vmTestbase/nsk/jdwp/Method/IsObsolete/isobsolete001/TestDescription.java \ + vmTestbase/nsk/jdwp/Method/IsObsolete/isobsolete002/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/SourceDebugExtension/srcdebugext001/TestDescription.java \ + vmTestbase/nsk/jdwp/StackFrame/PopFrames/popframes001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/CapabilitiesNew/capabilitiesnew001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/RedefineClasses/redefinecls001/TestDescription.java \ + vmTestbase/nsk/jdwp/VirtualMachine/SetDefaultStratum/setdefstrat001/TestDescription.java \ + vmTestbase/nsk/jdwp/Method/VariableTableWithGeneric/vartblwithgen001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/FieldsWithGeneric/fldwithgeneric001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/MethodsWithGeneric/methwithgeneric001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/SignatureWithGeneric/sigwithgeneric001/TestDescription.java \ + vmTestbase/nsk/jdwp/ReferenceType/Instances/instances001/instances001.java \ + vmTestbase/nsk/jdwp/ReferenceType/Instances/instances002/instances002.java \ + vmTestbase/nsk/jdwp/ObjectReference/ReferringObjects/referringObjects001/referringObjects001.java \ + vmTestbase/nsk/jdwp/ObjectReference/ReferringObjects/referringObjects002/referringObjects002.java \ + vmTestbase/nsk/jdwp/VirtualMachine/InstanceCounts/instanceCounts001/instanceCounts001.java \ + vmTestbase/nsk/jdwp/ThreadReference/ForceEarlyReturn/forceEarlyReturn002/forceEarlyReturn002.java \ + vmTestbase/nsk/jdwp/ThreadReference/OwnedMonitorsStackDepthInfo/ownedMonitorsStackDepthInfo001/ownedMonitorsStackDepthInfo001.java \ + vmTestbase/nsk/jdwp/ThreadReference/OwnedMonitorsStackDepthInfo/ownedMonitorsStackDepthInfo002/ownedMonitorsStackDepthInfo002.java + +# vmTestbase_vm_gc w/ 'quick' k/w +vmTestbase_vm_gc_quick = \ + vmTestbase/vm/gc/compact/Compact_Arrays \ + vmTestbase/vm/gc/compact/Compact_Strings_TwoFields \ + vmTestbase/vm/gc/compact/Compact_InternedStrings_Strings \ + vmTestbase/vm/gc/compact/Humongous_Arrays5M \ + vmTestbase/vm/gc/compact/Humongous_NonbranchyTree \ + vmTestbase/vm/gc/containers/LinkedBlockingDeque_Arrays/TestDescription.java \ + vmTestbase/vm/gc/containers/LinkedHashMap_Arrays/TestDescription.java \ + vmTestbase/vm/gc/containers/Combination05/TestDescription.java \ + vmTestbase/gc/ArrayJuggle/Juggle01 \ + vmTestbase/gc/ArrayJuggle/Juggle14 \ + vmTestbase/gc/ArrayJuggle/Juggle22 \ + vmTestbase/gc/ArrayJuggle/Juggle29 \ + vmTestbase/gc/ArrayJuggle/Juggle34 \ + vmTestbase/gc/gctests/LargeObjects/large001/large001.java \ + vmTestbase/gc/gctests/LoadUnloadGC2/LoadUnloadGC2.java \ + vmTestbase/gc/gctests/StringGC/StringGC.java \ + vmTestbase/gc/gctests/StringInternGC/StringInternGC.java \ + vmTestbase/gc/gctests/ReferencesGC/ReferencesGC.java \ + vmTestbase/vm/gc/kind/parOld/TestDescription.java \ + vmTestbase/gc/lock/jni/jnilock001/TestDescription.java \ + vmTestbase/gc/lock/jniref/jnireflock04/TestDescription.java \ + vmTestbase/gc/lock/jvmti/alloc/jvmtialloclock02/TestDescription.java \ + vmTestbase/gc/lock/malloc/malloclock03/TestDescription.java + +vmTestbase_vm_compiler_quick = \ + vmTestbase/vm/compiler/jbe/constprop/constprop01/constprop01.java \ + vmTestbase/vm/compiler/jbe/constprop/constprop02/constprop02.java \ + vmTestbase/vm/compiler/jbe/dead/dead01/dead01.java \ + vmTestbase/vm/compiler/jbe/dead/dead02/dead02.java \ + vmTestbase/vm/compiler/jbe/dead/dead03/dead03.java \ + vmTestbase/vm/compiler/jbe/dead/dead04/dead04.java \ + vmTestbase/vm/compiler/jbe/dead/dead05/dead05.java \ + vmTestbase/vm/compiler/jbe/dead/dead06/dead06.java \ + vmTestbase/vm/compiler/jbe/dead/dead07/dead07.java \ + vmTestbase/vm/compiler/jbe/dead/dead08/dead08.java \ + vmTestbase/vm/compiler/jbe/dead/dead09/dead09.java \ + vmTestbase/vm/compiler/jbe/dead/dead10/dead10.java \ + vmTestbase/vm/compiler/jbe/dead/dead11/dead11.java \ + vmTestbase/vm/compiler/jbe/dead/dead12/dead12.java \ + vmTestbase/vm/compiler/jbe/dead/dead13/dead13.java \ + vmTestbase/vm/compiler/jbe/dead/dead14/dead14.java \ + vmTestbase/vm/compiler/jbe/dead/dead15/dead15.java \ + vmTestbase/vm/compiler/jbe/dead/dead16/dead16.java \ + vmTestbase/vm/compiler/jbe/hoist/hoist01/hoist01.java \ + vmTestbase/vm/compiler/jbe/hoist/hoist02/hoist02.java \ + vmTestbase/vm/compiler/jbe/hoist/hoist03/hoist03.java \ + vmTestbase/vm/compiler/jbe/hoist/hoist04/hoist04.java \ + vmTestbase/vm/compiler/jbe/subcommon/subcommon01/subcommon01.java \ + vmTestbase/vm/compiler/jbe/subcommon/subcommon03/subcommon03.java \ + vmTestbase/vm/compiler/jbe/subcommon/subcommon04/subcommon04.java \ + vmTestbase/vm/compiler/jbe/subcommon/subcommon05/subcommon05.java \ + vmTestbase/vm/compiler/coverage/parentheses/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/stringconcat/explicit/Explicit01/cs_disabled/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/stringconcat/explicit/Explicit01/cs_enabled/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/stringconcat/explicit/Merge01/cs_disabled/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/stringconcat/explicit/Merge01/cs_enabled/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Implicit01/cs_disabled/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Implicit01/cs_enabled/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Merge01/cs_disabled/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/stringconcat/implicit/Merge01/cs_enabled/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/partialpeel/ForWhile/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/partialpeel/While/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/partialpeel/WhileWhile/TestDescription.java \ + vmTestbase/vm/compiler/optimizations/partialpeel/Do/TestDescription.java \ + vmTestbase/vm/compiler/complog/uninit/uninit001/uninit001.java \ + vmTestbase/vm/compiler/complog/uninit/uninit002/uninit002.java \ + vmTestbase/vm/compiler/complog/uninit/uninit003/uninit003.java \ + vmTestbase/vm/compiler/complog/uninit/uninit004/uninit004.java \ + vmTestbase/vm/compiler/complog/uninit/uninit005/uninit005.java \ + vmTestbase/vm/compiler/complog/uninit/uninit006/uninit006.java \ + vmTestbase/vm/compiler/complog/uninit/uninit007/uninit007.java \ + vmTestbase/vm/compiler/complog/uninit/uninit008/uninit008.java \ + vmTestbase/vm/compiler/complog/uninit/uninit009/uninit009.java \ + vmTestbase/vm/compiler/complog/uninit/uninit010/uninit010.java \ + vmTestbase/vm/compiler/complog/uninit/uninit011/uninit011.java \ + vmTestbase/vm/compiler/complog/uninit/uninit012/uninit012.java \ + vmTestbase/vm/compiler/complog/uninit/uninit013/uninit013.java \ + vmTestbase/jit/Arrays/ArrayBounds/ArrayBounds.java \ + vmTestbase/jit/Arrays/ArrayStoreCheck/ArrayStoreCheck.java \ + vmTestbase/jit/Arrays/ArrayTests/ArrayTests.java \ + vmTestbase/jit/CEETest/CEETest.java \ + vmTestbase/jit/CondExpr/CondExpr.java \ + vmTestbase/jit/DivTest/DivTest.java \ + vmTestbase/jit/ExcOpt/ExcOpt.java \ + vmTestbase/jit/FloatingPoint/FPCompare/TestFPBinop/TestFPBinop.java \ + vmTestbase/jit/FloatingPoint/gen_math/Filtering/Filtering.java \ + vmTestbase/jit/FloatingPoint/gen_math/Loops01/Loops01.java \ + vmTestbase/jit/FloatingPoint/gen_math/Loops02/Loops02.java \ + vmTestbase/jit/FloatingPoint/gen_math/Loops03/Loops03.java \ + vmTestbase/jit/FloatingPoint/gen_math/Loops04/Loops04.java \ + vmTestbase/jit/FloatingPoint/gen_math/Loops05/Loops05.java \ + vmTestbase/jit/FloatingPoint/gen_math/Loops06/Loops06.java \ + vmTestbase/jit/FloatingPoint/gen_math/Loops07/Loops07.java \ + vmTestbase/jit/FloatingPoint/gen_math/Matrix_3d/Matrix_3d.java \ + vmTestbase/jit/FloatingPoint/gen_math/ShortCircuitTest/ShortCircuitTest.java \ + vmTestbase/jit/FloatingPoint/gen_math/Summ/Summ.java \ + vmTestbase/jit/PrintProperties/PrintProperties.java \ + vmTestbase/jit/PrintThis/PrintThis.java \ + vmTestbase/jit/Robert/Robert.java \ + vmTestbase/jit/Sleeper/Sleeper.java \ + vmTestbase/jit/bounds/bounds.java \ + vmTestbase/jit/collapse/collapse.java \ + vmTestbase/jit/deoptimization/test01/test01.java \ + vmTestbase/jit/deoptimization/test02/test02.java \ + vmTestbase/jit/deoptimization/test03/test03.java \ + vmTestbase/jit/deoptimization/test04/test04.java \ + vmTestbase/jit/deoptimization/test05/test05.java \ + vmTestbase/jit/deoptimization/test06/test06.java \ + vmTestbase/jit/deoptimization/test07/test07.java \ + vmTestbase/jit/deoptimization/test08/test08.java \ + vmTestbase/jit/escape/AdaptiveBlocking/AdaptiveBlocking001/AdaptiveBlocking001.java \ + vmTestbase/jit/escape/LockElision/MatMul/MatMul.java \ + vmTestbase/jit/escape/LockCoarsening/LockCoarsening002/TestDescription.java \ + vmTestbase/jit/exception/exception.java \ + vmTestbase/jit/graph/cgt0/cgt0.java \ + vmTestbase/jit/graph/cgt1/cgt1.java \ + vmTestbase/jit/graph/cgt2/cgt2.java \ + vmTestbase/jit/graph/cgt3/cgt3.java \ + vmTestbase/jit/graph/cgt4/cgt4.java \ + vmTestbase/jit/graph/cgt5/cgt5.java \ + vmTestbase/jit/graph/cgt6/cgt6.java \ + vmTestbase/jit/graph/cgt7/cgt7.java \ + vmTestbase/jit/graph/cgt8/cgt8.java \ + vmTestbase/jit/graph/cgt9/cgt9.java \ + vmTestbase/jit/graph/cgt10/cgt10.java \ + vmTestbase/jit/graph/cgt11/cgt11.java \ + vmTestbase/jit/init/init01/init01.java \ + vmTestbase/jit/init/init02/init02.java \ + vmTestbase/jit/inline/inline003/inline003.java \ + vmTestbase/jit/inline/inline004/inline004.java \ + vmTestbase/jit/inline/inline005/inline005.java \ + vmTestbase/jit/inline/inline007/inline007.java \ + vmTestbase/jit/misctests/JitBug1/JitBug1.java \ + vmTestbase/jit/misctests/Pi/Pi.java \ + vmTestbase/jit/misctests/clss14702/clss14702.java \ + vmTestbase/jit/misctests/fpustack/GraphApplet.java \ + vmTestbase/jit/misctests/putfield00802/putfield00802.java \ + vmTestbase/jit/misctests/t5/t5.java \ + vmTestbase/jit/overflow/overflow.java \ + vmTestbase/jit/regression/b4427606/b4427606.java \ + vmTestbase/jit/regression/b4446672/b4446672.java \ + vmTestbase/jit/regression/CrashC1/CrashC1.java \ + vmTestbase/jit/series/series.java \ + vmTestbase/jit/t/t001/t001.java \ + vmTestbase/jit/t/t002/t002.java \ + vmTestbase/jit/t/t003/t003.java \ + vmTestbase/jit/t/t004/t004.java \ + vmTestbase/jit/t/t005/t005.java \ + vmTestbase/jit/t/t006/t006.java \ + vmTestbase/jit/t/t007/t007.java \ + vmTestbase/jit/t/t008/t008.java \ + vmTestbase/jit/t/t009/t009.java \ + vmTestbase/jit/t/t011/t011.java \ + vmTestbase/jit/t/t012/t012.java \ + vmTestbase/jit/t/t013/t013.java \ + vmTestbase/jit/t/t014/t014.java \ + vmTestbase/jit/t/t015/t015.java \ + vmTestbase/jit/t/t016/t016.java \ + vmTestbase/jit/t/t017/t017.java \ + vmTestbase/jit/t/t018/t018.java \ + vmTestbase/jit/t/t019/t019.java \ + vmTestbase/jit/t/t020/t020.java \ + vmTestbase/jit/t/t021/t021.java \ + vmTestbase/jit/t/t022/t022.java \ + vmTestbase/jit/t/t023/t023.java \ + vmTestbase/jit/t/t024/t024.java \ + vmTestbase/jit/t/t025/t025.java \ + vmTestbase/jit/t/t026/t026.java \ + vmTestbase/jit/t/t027/t027.java \ + vmTestbase/jit/t/t028/t028.java \ + vmTestbase/jit/t/t029/t029.java \ + vmTestbase/jit/t/t030/t030.java \ + vmTestbase/jit/t/t031/t031.java \ + vmTestbase/jit/t/t032/t032.java \ + vmTestbase/jit/t/t033/t033.java \ + vmTestbase/jit/t/t034/t034.java \ + vmTestbase/jit/t/t035/t035.java \ + vmTestbase/jit/t/t036/t036.java \ + vmTestbase/jit/t/t037/t037.java \ + vmTestbase/jit/t/t038/t038.java \ + vmTestbase/jit/t/t039/t039.java \ + vmTestbase/jit/t/t040/t040.java \ + vmTestbase/jit/t/t041/t041.java \ + vmTestbase/jit/t/t042/t042.java \ + vmTestbase/jit/t/t043/t043.java \ + vmTestbase/jit/t/t044/t044.java \ + vmTestbase/jit/t/t045/t045.java \ + vmTestbase/jit/t/t046/t046.java \ + vmTestbase/jit/t/t047/t047.java \ + vmTestbase/jit/t/t048/t048.java \ + vmTestbase/jit/t/t049/t049.java \ + vmTestbase/jit/t/t050/t050.java \ + vmTestbase/jit/t/t051/t051.java \ + vmTestbase/jit/t/t052/t052.java \ + vmTestbase/jit/t/t053/t053.java \ + vmTestbase/jit/t/t054/t054.java \ + vmTestbase/jit/t/t055/t055.java \ + vmTestbase/jit/t/t056/t056.java \ + vmTestbase/jit/t/t057/t057.java \ + vmTestbase/jit/t/t058/t058.java \ + vmTestbase/jit/t/t059/t059.java \ + vmTestbase/jit/t/t060/t060.java \ + vmTestbase/jit/t/t061/t061.java \ + vmTestbase/jit/t/t062/t062.java \ + vmTestbase/jit/t/t063/t063.java \ + vmTestbase/jit/t/t064/t064.java \ + vmTestbase/jit/t/t065/t065.java \ + vmTestbase/jit/t/t066/t066.java \ + vmTestbase/jit/t/t067/t067.java \ + vmTestbase/jit/t/t068/t068.java \ + vmTestbase/jit/t/t069/t069.java \ + vmTestbase/jit/t/t070/t070.java \ + vmTestbase/jit/t/t071/t071.java \ + vmTestbase/jit/t/t072/t072.java \ + vmTestbase/jit/t/t073/t073.java \ + vmTestbase/jit/t/t074/t074.java \ + vmTestbase/jit/t/t075/t075.java \ + vmTestbase/jit/t/t076/t076.java \ + vmTestbase/jit/t/t077/t077.java \ + vmTestbase/jit/t/t078/t078.java \ + vmTestbase/jit/t/t079/t079.java \ + vmTestbase/jit/t/t080/t080.java \ + vmTestbase/jit/t/t081/t081.java \ + vmTestbase/jit/t/t086/t086.java \ + vmTestbase/jit/t/t087/t087.java \ + vmTestbase/jit/t/t088/t088.java \ + vmTestbase/jit/t/t091/t091.java \ + vmTestbase/jit/t/t093/t093.java \ + vmTestbase/jit/t/t094/t094.java \ + vmTestbase/jit/t/t095/t095.java \ + vmTestbase/jit/t/t096/t096.java \ + vmTestbase/jit/t/t098/t098.java \ + vmTestbase/jit/t/t099/t099.java \ + vmTestbase/jit/t/t100/t100.java \ + vmTestbase/jit/t/t101/t101.java \ + vmTestbase/jit/t/t102/t102.java \ + vmTestbase/jit/t/t103/t103.java \ + vmTestbase/jit/t/t104/t104.java \ + vmTestbase/jit/t/t105/t105.java \ + vmTestbase/jit/t/t106/t106.java \ + vmTestbase/jit/t/t107/t107.java \ + vmTestbase/jit/t/t108/TestDescription.java \ + vmTestbase/jit/t/t109/TestDescription.java \ + vmTestbase/jit/t/t110/TestDescription.java \ + vmTestbase/jit/t/t111/TestDescription.java \ + vmTestbase/jit/t/t112/TestDescription.java \ + vmTestbase/jit/t/t113/TestDescription.java \ + vmTestbase/jit/tiered/TestDescription.java \ + vmTestbase/jit/verifier/VerifyInitLocal/VerifyInitLocal.java \ + vmTestbase/jit/verifier/VerifyMergeStack/VerifyMergeStack.java \ + vmTestbase/jit/wide/wide01/wide01.java \ + vmTestbase/jit/wide/wide02/wide02.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc1/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc2/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc3/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc4/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc5/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc6/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc7/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc8/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc9/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc10/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc11/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc12/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc13/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc14/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc15/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc16/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc17/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc18/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc19/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc20/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc21/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc22/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc23/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc24/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc25/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc26/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc27/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc28/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc29/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc30/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc31/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc32/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc33/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc34/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc35/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc36/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc37/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc38/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc39/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc40/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc41/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc42/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc43/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc44/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc45/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc46/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc47/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc48/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc49/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc50/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc51/TestDescription.java \ + vmTestbase/vm/jit/LongTransitions/nativeFnc52/TestDescription.java diff -Nru openjdk-11-11~19/test/hotspot/jtreg/TEST.ROOT openjdk-11-11~24/test/hotspot/jtreg/TEST.ROOT --- openjdk-11-11~19/test/hotspot/jtreg/TEST.ROOT 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/TEST.ROOT 2018-07-25 15:36:46.000000000 +0000 @@ -29,7 +29,7 @@ # The list of keywords supported in this test suite keys=cte_test jcmd nmt regression gc stress metaspace headful intermittent -groups=TEST.groups +groups=TEST.groups TEST.quick-groups # Source files for classes that will be used at the beginning of each test suite run, # to determine additional characteristics of the system for use with the @requires tag. @@ -40,6 +40,7 @@ requires.properties= \ sun.arch.data.model \ vm.simpleArch \ + vm.bits \ vm.flightRecorder \ vm.gc.G1 \ vm.gc.Serial \ @@ -51,6 +52,9 @@ vm.emulatedClient \ vm.cpu.features \ vm.debug \ + vm.hasSA \ + vm.hasSAandCanAttach \ + vm.hasJFR \ vm.rtm.cpu \ vm.rtm.os \ vm.aot \ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/jit/t/t113/t113.gold openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/jit/t/t113/t113.gold --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/jit/t/t113/t113.gold 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/jit/t/t113/t113.gold 2018-07-25 15:36:46.000000000 +0000 @@ -1,2 +1,2 @@ -java.lang.ClassCastException: jit.t.t113.kid1 cannot be cast to jit.t.t113.kid2 +java.lang.ClassCastException: class jit.t.t113.kid1 cannot be cast to class jit.t.t113.kid2 (jit.t.t113.kid1 and jit.t.t113.kid2 are in unnamed module of loader 'app') at jit.t.t113.t113.main(t113.java:59) diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/metaspace/staticReferences/StaticReferences.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/metaspace/staticReferences/StaticReferences.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/metaspace/staticReferences/StaticReferences.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/metaspace/staticReferences/StaticReferences.java 2018-07-25 15:36:46.000000000 +0000 @@ -67,7 +67,7 @@ /** * Test checks that static fields will be initialized in new loaded class. Test performs in loop the following routine: * 1.) Load class either by regular classloader or by Unsafe.defineAnonymousClass. - * 2.) Trigger unloading. Class must be alive. Next step will check that static fields would not lost. + * 2.) Trigger unloading. Class must be alive. Next step will check that static fields were not lost. * 3.) Change static fields. * 4.) Unload class. * 5.) Load class again as in step 1. @@ -82,7 +82,7 @@ private static String[] args; - private static final int LIMIT = 100; + private static final int LIMIT = 20; private List<Object> keepAlive = new LinkedList<Object>(); @@ -103,7 +103,7 @@ @Override public void run() { - random = new Random(runParams.getSeed()); + random = new Random(runParams.getSeed()); ExecutionController stresser = new Stresser(args); stresser.start(1); @@ -116,7 +116,7 @@ return; } for (int j = 0; j < fieldQuantities.length; j++) { - fieldQuantities[j] = 1 + random.nextInt(2000); + fieldQuantities[j] = 1 + random.nextInt(20); } bytecodeList.add(generateAndCompile(fieldQuantities)); } @@ -209,9 +209,9 @@ } } - private byte[] generateAndCompile(int[] filedQuantities) { + private byte[] generateAndCompile(int[] fieldQuantities) { Map<String, CharSequence> sources = new HashMap<String, CharSequence>(); - sources.put("A", generateSource(filedQuantities)); + sources.put("A", generateSource(fieldQuantities)); return InMemoryJavaCompiler.compile(sources).values().iterator().next(); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/metaspace/stressDictionary/StressDictionary.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/metaspace/stressDictionary/StressDictionary.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/metaspace/stressDictionary/StressDictionary.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/metaspace/stressDictionary/StressDictionary.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,7 +29,7 @@ * * @library /vmTestbase /test/lib * @run driver jdk.test.lib.FileInstaller . . - * @run main/othervm metaspace.stressDictionary.StressDictionary + * @run main/othervm metaspace.stressDictionary.StressDictionary -stressTime 30 */ package metaspace.stressDictionary; @@ -57,15 +57,16 @@ */ public class StressDictionary extends GCTestBase { + private static byte[] bytecode; + private class FillingDictionaryWorker implements Callable<Object> { @Override public Object call() throws Exception { while (stresser.continueExecution()) { try { - byte[] bytecode = generateAndCompile(); - bytecode[random.nextInt(bytecode.length)] = (byte) 42; - classloader.define(bytecode); - changeClassloaderIfRequired(); + byte[] badBytecode = bytecode.clone(); + badBytecode[random.nextInt(badBytecode.length)] = (byte) 42; + classloader.define(badBytecode); } catch (Throwable e) { // We can get ClassFormatError, ClassNotFoundException or anything else here } @@ -78,10 +79,8 @@ @Override public Object call() throws Exception { while (stresser.continueExecution()) { - byte[] bytecode = generateAndCompile(); Class<?> c = classloader.define(bytecode); testClass(c); - changeClassloaderIfRequired(); } return null; } @@ -89,8 +88,6 @@ private static String[] args; - private static final int DROP_CLASSLOADER_LIMIT = 50000; - private static final String methodName = "myMethod"; private static final int NUMBER_OF_CORRUPTING_THREADS = 10; @@ -116,6 +113,8 @@ random = new Random(runParams.getSeed()); stresser = new Stresser(args); stresser.start(1); + // Generate some bytecodes. + bytecode = generateAndCompile(); List<Callable<Object>> tasks = new LinkedList<Callable<Object>>(); for (int i = 0; i < NUMBER_OF_CORRUPTING_THREADS; i++) { tasks.add(this.new FillingDictionaryWorker()); @@ -131,13 +130,6 @@ } } - private void changeClassloaderIfRequired() { - if (ManagementFactory.getClassLoadingMXBean().getLoadedClassCount() > DROP_CLASSLOADER_LIMIT) { - ClassloaderUnderTest newOne = new ClassloaderUnderTest(); - classloader = newOne; - } - } - private byte[] generateAndCompile() { Map<String, CharSequence> sources = new HashMap<String, CharSequence>(); String className = "MyClass" + classesCounter.incrementAndGet(); diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001a.java 2018-07-25 15:36:46.000000000 +0000 @@ -48,6 +48,7 @@ int i = 111; int j = 222; int k = 444; + double[][][] test = new double[2][2][2]; synchronized (this) { lastBreak(); @@ -81,4 +82,8 @@ return line; } } + + public double testPrimitiveArray(double[][][] d){ + return 1.0; + } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdb/eval/eval001/eval001.java 2018-07-25 15:36:46.000000000 +0000 @@ -98,7 +98,8 @@ { DEBUGGEE_CLASS + "._eval001a.myMethod()", "2147483647" }, { "myClass.toString().equals(\"abcde\")", "true"}, { "i + j + k", "777"}, - { "new java.lang.String(\"Hello, World\").length()", "12"} + { "new java.lang.String(\"Hello, World\").length()", "12"}, + { DEBUGGEE_CLASS + "._eval001a.testPrimitiveArray(test)", "1.0" } }; protected void runCases() { diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdb/exclude/exclude001/exclude001.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdb/exclude/exclude001/exclude001.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdb/exclude/exclude001/exclude001.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdb/exclude/exclude001/exclude001.java 2018-07-25 15:36:46.000000000 +0000 @@ -61,9 +61,9 @@ * @run driver jdk.test.lib.FileInstaller . . * @build nsk.jdb.exclude.exclude001.exclude001 * nsk.jdb.exclude.exclude001.exclude001a - * @run main/othervm PropertyResolvingWrapper nsk.jdb.exclude.exclude001.exclude001 + * @run main/othervm/timeout=420 PropertyResolvingWrapper nsk.jdb.exclude.exclude001.exclude001 * -arch=${os.family}-${os.simpleArch} - * -waittime=5 + * -waittime=7 * -debugee.vmkind=java * -transport.address=dynamic * -jdb=${test.jdk}/bin/jdb diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects001/referringObjects001.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects001/referringObjects001.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects001/referringObjects001.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects001/referringObjects001.java 2018-07-25 15:36:46.000000000 +0000 @@ -52,6 +52,7 @@ * referrers with supported type(Strong, PhantomReference, SoftReference, WeakReference) * * @requires vm.gc != "Z" + * @requires !vm.graal.enabled * @library /vmTestbase * /test/lib * @run driver jdk.test.lib.FileInstaller . . diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects003/referringObjects003.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects003/referringObjects003.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects003/referringObjects003.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/ObjectReference/referringObjects/referringObjects003/referringObjects003.java 2018-07-25 15:36:46.000000000 +0000 @@ -52,6 +52,7 @@ * can't force collection of thread group because of thread group always has 1 referrer - parent thread group, so * just test disableCollection/enableCollection don't throw any unexpected exceptions * + * @requires !vm.graal.enabled * @library /vmTestbase * /test/lib * @run driver jdk.test.lib.FileInstaller . . diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/instances/instances001/instances001.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/instances/instances001/instances001.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/instances/instances001/instances001.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/ReferenceType/instances/instances001/instances001.java 2018-07-25 15:36:46.000000000 +0000 @@ -52,6 +52,7 @@ * - check the number of instances is correct * done * + * @requires !vm.graal.enabled * @library /vmTestbase * /test/lib * @run driver jdk.test.lib.FileInstaller . . diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts001/instancecounts001.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts001/instancecounts001.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts001/instancecounts001.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/VirtualMachine/instanceCounts/instancecounts001/instancecounts001.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,6 +40,7 @@ * - the debugger process checks that instanceCounts returns 0 and no * com.sun.jdi.ObjectCollectedException is thrown * + * @requires !vm.graal.enabled * @library /vmTestbase * /test/lib * @run driver jdk.test.lib.FileInstaller . . diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdi/VMOutOfMemoryException/VMOutOfMemoryException001/VMOutOfMemoryException001.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,6 +34,7 @@ * in debuggee VM through 'ArrayType.newInstance()' till VMOutOfMemoryException. Any other exception * thrown by 'ArrayType.newInstance()' is treated as product bug. * + * @requires !vm.graal.enabled * @library /vmTestbase * /test/lib * @run driver jdk.test.lib.FileInstaller . . diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdwp/ObjectReference/ReferringObjects/referringObjects001/referringObjects001.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdwp/ObjectReference/ReferringObjects/referringObjects001/referringObjects001.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdwp/ObjectReference/ReferringObjects/referringObjects001/referringObjects001.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdwp/ObjectReference/ReferringObjects/referringObjects001/referringObjects001.java 2018-07-25 15:36:46.000000000 +0000 @@ -66,6 +66,7 @@ * Finally, debugger sends debuggee signal to quit, waits for it exits * and exits too with the proper exit code. * + * @requires !vm.graal.enabled * @library /vmTestbase /test/hotspot/jtreg/vmTestbase * /test/lib * @run driver jdk.test.lib.FileInstaller . . diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdwp/ReferenceType/Instances/instances001/instances001.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdwp/ReferenceType/Instances/instances001/instances001.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdwp/ReferenceType/Instances/instances001/instances001.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdwp/ReferenceType/Instances/instances001/instances001.java 2018-07-25 15:36:46.000000000 +0000 @@ -61,6 +61,7 @@ * and exits too with the proper exit code. * * @requires vm.gc != "Z" + * @requires !vm.graal.enabled * @library /vmTestbase /test/hotspot/jtreg/vmTestbase * /test/lib * @run driver jdk.test.lib.FileInstaller . . diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdwp/VirtualMachine/InstanceCounts/instanceCounts001/instanceCounts001.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdwp/VirtualMachine/InstanceCounts/instanceCounts001/instanceCounts001.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jdwp/VirtualMachine/InstanceCounts/instanceCounts001/instanceCounts001.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jdwp/VirtualMachine/InstanceCounts/instanceCounts001/instanceCounts001.java 2018-07-25 15:36:46.000000000 +0000 @@ -62,6 +62,7 @@ * and exits too with the proper exit code. * * @requires vm.gc != "Z" + * @requires !vm.graal.enabled * @library /vmTestbase /test/hotspot/jtreg/vmTestbase * /test/lib * @run driver jdk.test.lib.FileInstaller . . diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/Allocate/alloc001/alloc001.bash 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,7 @@ JAVA="$TESTJAVA/bin/java" JAVA_OPTS="$TESTJAVAOPTS $TESTVMOPTS -cp $TESTCLASSPATH -agentlib:alloc001" -. ${TESTSRC}/../../../../../../../../../open/test/hotspot/jtreg/test_env.sh +. ${TESTSRC}/../../../../../test_env.sh # Set virtual memory usage limit to be not 'unlimited' on unix platforms # This is workaround for 6683371. diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/attach024Agent00.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/attach024Agent00.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/attach024Agent00.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/attach024Agent00.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,27 +30,27 @@ public static final String MODIFIED_TO_STRING = "attach024: Modified version"; - private static final String TESTED_CLASS_NAME = "java.util.ServiceConfigurationError"; + private static final String TESTED_CLASS_NAME = "java.util.TooManyListenersException"; protected void agentActions() { /* - * Check that ServiceConfigurationError isn't loaded, otherwise test checks + * Check that TooManyListenersException isn't loaded, otherwise test checks * doesn't make sense */ for (Class<?> klass : inst.getAllLoadedClasses()) { if (klass.getName().equals(TESTED_CLASS_NAME)) { - throw new TestBug("ServiceConfigurationError already loaded"); + throw new TestBug("TooManyListenersException already loaded"); } } - checkServiceConfigurationError(); + checkTooManyListenersException(); } - void checkServiceConfigurationError() { - java.util.ServiceConfigurationError e = new java.util.ServiceConfigurationError("Test"); - display("ServiceConfigurationError.toString(): " + e.toString()); + void checkTooManyListenersException() { + java.util.TooManyListenersException e = new java.util.TooManyListenersException("Test"); + display("TooManyListenersException.toString(): " + e.toString()); if (e.toString().equals(MODIFIED_TO_STRING)) { - setStatusFailed("Class ServiceConfigurationError was erroneously loaded from agent's jar"); + setStatusFailed("Class TooManyListenersException was erroneously loaded from agent's jar"); } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/java.base/java/util/ServiceConfigurationError.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/java.base/java/util/ServiceConfigurationError.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/java.base/java/util/ServiceConfigurationError.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/java.base/java/util/ServiceConfigurationError.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * 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. - */ -package java.util; - -import nsk.jvmti.AttachOnDemand.attach024.*; - -public class ServiceConfigurationError extends Error { - private static final long serialVersionUID = 74132770414881L; - - public ServiceConfigurationError(String msg) { - super(msg); - } - - public ServiceConfigurationError(String msg, Throwable cause) { - super(msg, cause); - } - - public String toString() { - return attach024Agent00.MODIFIED_TO_STRING; - } -} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/java.base/java/util/TooManyListenersException.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/java.base/java/util/TooManyListenersException.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/java.base/java/util/TooManyListenersException.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/java.base/java/util/TooManyListenersException.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,75 @@ +/* + * Copyright (c) 1996, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +package java.util; + +import nsk.jvmti.AttachOnDemand.attach024.*; + +/** + * <p> + * The <code> TooManyListenersException </code> Exception is used as part of + * the Java Event model to annotate and implement a unicast special case of + * a multicast Event Source. + * </p> + * <p> + * The presence of a "throws TooManyListenersException" clause on any given + * concrete implementation of the normally multicast "void addXyzEventListener" + * event listener registration pattern is used to annotate that interface as + * implementing a unicast Listener special case, that is, that one and only + * one Listener may be registered on the particular event listener source + * concurrently. + * </p> + * + * @see java.util.EventObject + * @see java.util.EventListener + * + * @author Laurence P. G. Cable + * @since 1.1 + */ + +public class TooManyListenersException extends Exception { + private static final long serialVersionUID = 5074640544770687831L; + + /** + * Constructs a TooManyListenersException with no detail message. + * A detail message is a String that describes this particular exception. + */ + + public TooManyListenersException() { + super(); + } + + /** + * Constructs a TooManyListenersException with the specified detail message. + * A detail message is a String that describes this particular exception. + * @param s the detail message + */ + + public TooManyListenersException(String s) { + super(s); + } + + public String toString() { + return attach024Agent00.MODIFIED_TO_STRING; + } +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach024/TestDescription.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,8 +35,8 @@ * agent starts new thread from the 'agentmain' method, and all test checks are executed * in this thread. * Test checks that agent's JAR file is appended at the end of the system class path. - * Agent's JAR file contains modified class java.util.ServiceConfigurationError (it is assumed - * that this class isn't loaded before agent is loaded), agent instantiates ServiceConfigurationError + * Agent's JAR file contains modified class java.util.TooManyListenersException (it is assumed + * that this class isn't loaded before agent is loaded), agent instantiates TooManyListenersException * and checks that non-modified version of this class was loaded from rt.jar (not from agent's JAR). * * @library /vmTestbase @@ -46,7 +46,7 @@ * nsk.share.aod.TargetApplicationWaitingAgents * nsk.jvmti.AttachOnDemand.attach024.attach024Agent00 * - * @comment compile modified java.util.ServiceConfigurationError + * @comment compile modified java.util.TooManyListenersException * @build ExecDriver * @run driver PropertyResolvingWrapper ExecDriver --cmd * ${compile.jdk}/bin/javac @@ -54,14 +54,14 @@ * -d ./bin/classes * --patch-module java.base=${test.src}/java.base * --add-reads java.base=ALL-UNNAMED - * ${test.src}/java.base/java/util/ServiceConfigurationError.java + * ${test.src}/java.base/java/util/TooManyListenersException.java * * @comment create attach024Agent00.jar in current directory * @run driver PropertyResolvingWrapper ExecDriver --cmd * ${compile.jdk}/bin/jar * -cfm attach024Agent00.jar ${test.src}/attach024Agent00.mf * -C ./bin/classes - * java/util/ServiceConfigurationError.class + * java/util/TooManyListenersException.class * @run driver ClassFileInstaller * nsk.jvmti.AttachOnDemand.attach024.attach024Agent00 * @run driver PropertyResolvingWrapper ExecDriver --cmd diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses/StressRedefine.java 2018-07-25 15:36:46.000000000 +0000 @@ -61,7 +61,10 @@ private static ExecutionController stresser; private static String[] args; - // This is random generator used for generating seeds for other Randoms. Setting seed from command line sets seed for this random. + private static byte[] bytecode; + + // This is random generator used for generating seeds for other Randoms. Setting seed + // from command line sets seed for this random. static Random seedGenerator; static { @@ -82,47 +85,53 @@ Tests.runTest(new StressRedefine(), args); } - @Override - public void run() { - seedGenerator = new Random(runParams.getSeed()); - GenerateSourceHelper.setRandom(new Random(seedGenerator.nextLong())); + @Override + public void run() { + seedGenerator = new Random(runParams.getSeed()); + GenerateSourceHelper.setRandom(new Random(seedGenerator.nextLong())); stresser = new Stresser(args); for (int i = 0; i < args.length; i++ ) { - if ("-staticMethodCallersNumber".equals(args[i])) { - staticMethodCallersNumber = Integer.parseInt(args[i + 1]); - } else if ("-nonstaticMethodCallersNumber".equals(args[i])) { - nonstaticMethodCallersNumber = Integer.parseInt(args[i + 1]); - } else if ("-redefiningThreadsNumber".equals(args[i])) { - redefiningThreadsNumber = Integer.parseInt(args[i + 1]); - } else if ("-corruptingBytecodeProbability".equals(args[i])) { - corruptingBytecodeProbability = Double.parseDouble(args[i + 1]); - } + if ("-staticMethodCallersNumber".equals(args[i])) { + staticMethodCallersNumber = Integer.parseInt(args[i + 1]); + } else if ("-nonstaticMethodCallersNumber".equals(args[i])) { + nonstaticMethodCallersNumber = Integer.parseInt(args[i + 1]); + } else if ("-redefiningThreadsNumber".equals(args[i])) { + redefiningThreadsNumber = Integer.parseInt(args[i + 1]); + } else if ("-corruptingBytecodeProbability".equals(args[i])) { + corruptingBytecodeProbability = Double.parseDouble(args[i + 1]); + } } //Dynamic attach if required nsk.share.jvmti.JVMTITest.commonInit(args); new StressRedefine().runIt(); + } + + private static void runMethod(Random random, String name) { + while (stresser.continueExecution()) { + try { + // Just for fun we transfer parameters to method + Object res = myClass.getMethod(name, double.class, int.class, Object.class) + .invoke(null, random.nextDouble(), random.nextInt(), new Object()); + } catch (IllegalArgumentException | InvocationTargetException + | IllegalAccessException | NoSuchMethodException e) { + // It's okay to get exception here since we are corrupting bytecode and can't expect + // class to work properly. + System.out.println("Got expected exception: " + e.toString()); + } } + } private static class StaticMethodCaller implements Runnable { private Random random; public StaticMethodCaller() {random = new Random(seedGenerator.nextLong());} - @Override - public void run() { - while (stresser.continueExecution()) { - try { - Object res = myClass.getMethod(GenerateSourceHelper.STATIC_METHOD_NAME, double.class, int.class, Object.class).invoke( - null, random.nextDouble(), random.nextInt(), new Object()); // Just for fun we transfer parameters to method - } catch (IllegalArgumentException | InvocationTargetException - | IllegalAccessException | NoSuchMethodException e) { - //It's okay to get exception here since we are corrupting bytecode and can't expect class to work properly. - System.out.println("Got expected exception: " + e.toString()); - } - } - } + @Override + public void run() { + runMethod(random, GenerateSourceHelper.STATIC_METHOD_NAME); + } } private static class NonstaticMethodCaller implements Runnable { @@ -130,59 +139,54 @@ public NonstaticMethodCaller() {random = new Random(seedGenerator.nextLong());} @Override - public void run() { - while (stresser.continueExecution()) { - try { - Object res = myClass.getMethod(GenerateSourceHelper.NONSTATIC_METHOD_NAME, double.class, int.class, Object.class). - invoke(myClass.newInstance(), random.nextDouble(), random.nextInt(), new Object()); // Just for fun we transfer parameters to method - } catch (IllegalArgumentException | InvocationTargetException | NoSuchMethodException | InstantiationException | IllegalAccessException e) { - //It's okay to get exception here since we are corrupting bytecode and can't expect class to work properly. - System.out.println("Got expected exception: " + e.toString()); - } - } - } + public void run() { + runMethod(random, GenerateSourceHelper.NONSTATIC_METHOD_NAME); + } } private static class Worker implements Runnable { private Random random; public Worker() {random = new Random(seedGenerator.nextLong());} - @Override - public void run() { - while (stresser.continueExecution()) { - byte[] bytecode = generateAndCompile(); - if (random.nextDouble() < corruptingBytecodeProbability) { - bytecode[random.nextInt(bytecode.length)] = 42; - } - makeRedefinition(2, myClass, bytecode); - } + @Override + public void run() { + while (stresser.continueExecution()) { + byte[] badBytecode = bytecode.clone(); + if (random.nextDouble() < corruptingBytecodeProbability) { + badBytecode[random.nextInt(bytecode.length)] = 42; } + makeRedefinition(2, myClass, badBytecode); + } + } } private void runIt() { myClass = new DefiningClassLoader().defineClass(generateAndCompile()); stresser.start(0); + // Generate some bytecode. + bytecode = generateAndCompile(); + List<Thread> threads = new LinkedList<Thread>(); for (int i = 0; i < staticMethodCallersNumber; i++) { - threads.add(new Thread(new StaticMethodCaller())); + threads.add(new Thread(new StaticMethodCaller())); } for (int i = 0; i < nonstaticMethodCallersNumber; i++) { - threads.add(new Thread(new NonstaticMethodCaller())); + threads.add(new Thread(new NonstaticMethodCaller())); } for (int i = 0; i < redefiningThreadsNumber; i++) { - threads.add(new Thread(new Worker())); + threads.add(new Thread(new Worker())); } for (Thread thread : threads) { - thread.start(); + thread.start(); } for (Thread thread : threads) { - try { - thread.join(); - } catch (InterruptedException e) { - throw new TestFailure("Thread " + Thread.currentThread() + " was interrupted:", e); - } + try { + thread.join(); + } catch (InterruptedException e) { + throw new TestFailure("Thread " + Thread.currentThread() + " was interrupted:", e); + } } } @@ -192,15 +196,14 @@ return InMemoryJavaCompiler.compile(sources).values().iterator().next(); } - // Auxiliary classloader. Used only once at the beginning. - private static class DefiningClassLoader extends URLClassLoader { - public DefiningClassLoader() { - super(new URL[0]); - } - - Class<?> defineClass(byte[] bytecode) { - return defineClass(null, bytecode, 0, bytecode.length); - } + // Auxiliary classloader. Used only once at the beginning. + private static class DefiningClassLoader extends URLClassLoader { + public DefiningClassLoader() { + super(new URL[0]); } + Class<?> defineClass(byte[] bytecode) { + return defineClass(null, bytecode, 0, bytecode.length); + } + } } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/ji05t001.c openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/ji05t001.c --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/ji05t001.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/jni_interception/JI05/ji05t001/ji05t001.c 2018-07-25 15:36:46.000000000 +0000 @@ -333,8 +333,11 @@ checkIntercept(1, 0, 1); /* expected interceptions: 1 */ NSK_DISPLAY0("\n<<< TEST CASE #4) done\n"); - NSK_DISPLAY1("\nagent A: returning exit code %d\n", + NSK_DISPLAY1("\nagent A: detaching and returning exit code %d\n", exitCode); + if ((res = JNI_ENV_PTR(vm)->DetachCurrentThread(JNI_ENV_ARG1(vm))) != 0) { + NSK_COMPLAIN1("TEST WARNING: agent A: DetachCurrentThread() returns: %d\n", res); + } return exitCode; } @@ -393,8 +396,11 @@ redir[1] = 1; - NSK_DISPLAY1("\nagent B: returning exit code %d\n", + NSK_DISPLAY1("\nagent B: detaching and returning exit code %d\n", exitCode); + if ((res = JNI_ENV_PTR(vm)->DetachCurrentThread(JNI_ENV_ARG1(vm))) != 0) { + NSK_COMPLAIN1("TEST WARNING: agent B: DetachCurrentThread() returns: %d\n", res); + } return exitCode; } /*********************/ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/ji06t001.c openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/ji06t001.c --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/ji06t001.c 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/jvmti/scenarios/jni_interception/JI06/ji06t001/ji06t001.c 2018-07-25 15:36:46.000000000 +0000 @@ -62,6 +62,18 @@ #define TRIES 30 #define MAX_THREADS 5 +// Helper for thread detach and terminate +#define THREAD_return(status) \ + do { \ + int res = JNI_ENV_PTR(vm)->DetachCurrentThread(JNI_ENV_ARG1(vm)); \ + if (res != 0) \ + NSK_COMPLAIN1("TEST WARNING: DetachCurrentThread() returns: %d\n", res); \ + else \ + NSK_DISPLAY0("Detaching thread ...\n"); \ + return status; \ + } while (0) + + static const char *javaField = "_ji06t001a"; static const char *classSig = "Lnsk/jvmti/scenarios/jni_interception/JI06/ji06t001a;"; @@ -225,16 +237,16 @@ thrStarted[indx-1] = 1; /* the thread is started */ if (enterMonitor(env, "waitingThread") == STATUS_FAILED) - return STATUS_FAILED; + THREAD_return(STATUS_FAILED); if (verbose) printf("waitingThread: thread #%d entered the monitor\n", indx); if (exitMonitor(env, "waitingThread") == STATUS_FAILED) - return STATUS_FAILED; + THREAD_return(STATUS_FAILED); NSK_DISPLAY2("waitingThread: thread #%d exits the monitor\n\treturning %d\n", indx, exitCode); - return exitCode; + THREAD_return(exitCode); } static int ownerThread(void *context) { @@ -254,7 +266,7 @@ NSK_DISPLAY0("ownerThread: trying to enter the monitor ...\n"); if (enterMonitor(env, "ownerThread") == STATUS_FAILED) - return STATUS_FAILED; + THREAD_return(STATUS_FAILED); monEntered = 1; /* the monitor has been entered */ NSK_DISPLAY1("ownerThread: entered the monitor: monEntered=%d\n\ @@ -272,12 +284,12 @@ } while(releaseMon != 1); if (exitMonitor(env, "ownerThread") == STATUS_FAILED) - return STATUS_FAILED; + THREAD_return(STATUS_FAILED); NSK_DISPLAY1("ownerThread: exits the monitor\n\treturning %d\n", exitCode); - return exitCode; + THREAD_return(exitCode); } static int redirectorThread(void *context) { @@ -301,7 +313,7 @@ NSK_DISPLAY1("redirectorThread: the MonitorEnter() redirected\n\treturning %d\n", exitCode); - return exitCode; + THREAD_return(exitCode); } /*********************/ diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Debugee.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Debugee.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Debugee.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Debugee.java 2018-07-25 15:36:46.000000000 +0000 @@ -637,10 +637,9 @@ public boolean isJFR_active() { String opts = argumentHandler.getLaunchOptions(); - int unlockPos = opts.indexOf("-XX:+UnlockCommercialFeatures"); int jfrPos = opts.indexOf("-XX:+FlightRecorder"); - if (unlockPos >= 0 && jfrPos >= 0 && jfrPos > unlockPos) + if (jfrPos >= 0) return true; else return false; diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/stress/except/except004.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/stress/except/except004.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/nsk/stress/except/except004.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/nsk/stress/except/except004.java 2018-07-25 15:36:46.000000000 +0000 @@ -211,15 +211,15 @@ Object integerValue = new Integer(0); Object doubleValue = new Double(0); Object trash = null; - Field abraPrivateField; Field abraIntegerField; Field abraBooleanField; + Field extPrivateField; try { - abraPrivateField = Abra.class.getDeclaredField("DONT_TOUCH_ME"); abraIntegerField = Abra.class.getDeclaredField("MAIN_CYR_NUMBER"); abraBooleanField = Abra.class.getDeclaredField("NOT_AN_INTEGER"); + extPrivateField = Ext.class.getDeclaredField("DONT_TOUCH_ME"); } catch (NoSuchFieldException nsfe) { - out.println("Test initialisation failed: field not found in class Abra"); + out.println("Test initialisation failed: field not found: " + nsfe.getMessage()); return 2; } @@ -369,7 +369,6 @@ // Check IllegalAccessException (positive): try { int junkIt = abraIntegerField.getInt(null); // legal - should pass -// int junkIt = abraPrivateField.getInt(null); // illegal - should fail if (TRACE_ON) log[messages++] = "Success: IllegalAccessException (positive)"; } catch (IllegalAccessException iae) { @@ -383,8 +382,7 @@ // Check IllegalAccessException (negative): try { -// int junkIt = abraIntegerField.getInt(null); // legal - should pass - int junkIt = abraPrivateField.getInt(null); // illegal - should fail + int junkIt = extPrivateField.getInt(null); // illegal - should fail log[messages++] = "Failure: IllegalAccessException (negative)"; exitCode = 2; // FAILED } catch (IllegalAccessException iae) { @@ -512,7 +510,7 @@ /** * This class should be used to check <code>CloneNotSupportedException</code>, - * <code>IllegalAccessException</code>, and <code>IllegalArgumentException</code>. + * and <code>IllegalArgumentException</code>. * The class extends <code>except004</code> in order that its (protected) * method <code>clone()</code> be available from <code>except004</code>. */ @@ -527,10 +525,6 @@ /** * Will try to incorrectly access to this field from outside this class. */ - private static final int DONT_TOUCH_ME = 666; - /** - * Will try to incorrectly access to this field from outside this class. - */ public static final int MAIN_CYR_NUMBER = 47; /** * Will try to get this field like <code>int<code> zero. @@ -551,3 +545,11 @@ } } } + +/* Package accessible class that has non-accessible private member */ +class Ext { + /** + * Will try to incorrectly access to this field from outside this class. + */ + private static final int DONT_TOUCH_ME = 666; +} diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/vm/mlvm/tools/Indify.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/vm/mlvm/tools/Indify.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/vm/mlvm/tools/Indify.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/vm/mlvm/tools/Indify.java 2018-07-25 15:36:46.000000000 +0000 @@ -4,9 +4,7 @@ * * 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. + * 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 diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/BasicTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -81,7 +81,7 @@ expectedClass = IllegalArgumentException.class; } else if (factory.getExecutionMode().equals("INVOKE_WITH_ARGS")) { // Notes from JDK-8029926 which details reasons behind CCE. - // The code below demonstrates the use of a MethodHandle + // The code below demonstrates the use of a MethodHandle // of kind REF_invokeInterface pointing to method I.m. // Because 'invoke' is called, this MethodHandle is effectively // wrapped in the type adaptations necessary to accept a C @@ -157,38 +157,38 @@ } /* - * Default method override w/ non-public concrete method + * Default method override attempt w/ non-public concrete method. + * Private methods never override any other method. * - * interface I { void m() default {} } - * class C implements I { - * [private/package-private/protected] - * void m() {} + * interface I { int m() default { returns 1; } } + * class C/D/E implements I { + * [private/protected/package-private] + * int m() { returns 2;} * } * */ - @KnownFailure(modes = {INVOKE_EXACT, INVOKE_GENERIC, INVOKE_WITH_ARGS, INDY}) // NPE, instead of IAE public void testNonPublicOverride() { TestBuilder b = factory.getBuilder(); Interface I = b.intf("I") - .defaultMethod("m","()V").emptyBody().build() + .defaultMethod("m", "()I").returns(1).build() .build(); ConcreteClass C = b.clazz("C").implement(I) - .concreteMethod("m", "()V").private_().emptyBody().build() + .concreteMethod("m", "()I").private_().returns(2).build() .build(); ConcreteClass D = b.clazz("D").implement(I) - .concreteMethod("m", "()V").protected_().emptyBody().build() + .concreteMethod("m", "()I").protected_().returns(2).build() .build(); ConcreteClass E = b.clazz("E").implement(I) - .concreteMethod("m", "()V").package_private().emptyBody().build() + .concreteMethod("m", "()I").package_private().returns(2).build() .build(); - b.test().callSite(I, C, "m", "()V").throws_(IllegalAccessError.class).done() - .test().callSite(I, D, "m", "()V").throws_(IllegalAccessError.class).done() - .test().callSite(I, E, "m", "()V").throws_(IllegalAccessError.class).done() + b.test().callSite(I, C, "m", "()I").returns(1).done() + .test().callSite(I, D, "m", "()I").throws_(IllegalAccessError.class).done() + .test().callSite(I, E, "m", "()I").throws_(IllegalAccessError.class).done() .run(); } diff -Nru openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/PrivateMethodsTest.java openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/PrivateMethodsTest.java --- openjdk-11-11~19/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/PrivateMethodsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/hotspot/jtreg/vmTestbase/vm/runtime/defmeth/PrivateMethodsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -48,11 +48,28 @@ // to even see an interface private method // Throw ICCE if method resolution returns interface private method + // Spec change JDK 11 - invokeinterface can be used for private interface + // methods and is now the preferred invocation bytecode - so no ICCE. + // Private methods are skipped during selection unless the resolved method + // is private. + // This change is not dependent on the classfile version. + + // Note on reflection testing: + // Reflection is only used for the initial callsite, which is not always + // the method of interest. For example where a default method m() calls + // the private interface method privateM(). It is the latter call we are + // really testing, but it is the call of the default method that occurs + // via reflection. + // In private cases reflection triggers a NoSuchMethodException instead of the + // expected IllegalAccessError. This indicates it is getDeclaredMethod() that is + // failing rather than the actual invoke(). Which in turn suggests the wrong class + // is being used, or that getMethod() is being used instead of getDeclaredMethod(). + /* * testPrivateInvokeVirtual * * interface I { - * default private int privateM() { return 1; } + * private int privateM() { return 1; } * default public int m() { return (I)this.privateM(); } // invokevirtual * } * class C implements I {} @@ -85,13 +102,13 @@ * testPrivateInvokeIntf * * interface I { - * default private int privateM() { return 1; } + * private int privateM() { return 1; } * default public int m() { return (I)this.privateM(); } // invokeinterface * } * class C implements I {} * - * TEST: I o = new C(); o.m()I throws IncompatibleClassChangeError - * TEST: C o = new C(); o.m()I throws IncompatibleClassChangeError + * TEST: I o = new C(); o.m()I returns 1 + * TEST: C o = new C(); o.m()I returns 1 */ public void testPrivateInvokeIntf() { TestBuilder b = factory.getBuilder(); @@ -105,8 +122,8 @@ ConcreteClass C = b.clazz("C").implement(I).build(); - b.test().callSite(I, C, "m", "()I").throws_(IncompatibleClassChangeError.class).done() - .test().callSite(C, C, "m", "()I").throws_(IncompatibleClassChangeError.class).done() + b.test().callSite(I, C, "m", "()I").returns(1).done() + .test().callSite(C, C, "m", "()I").returns(1).done() .run(); } @@ -115,13 +132,13 @@ * testPrivateInvokeStatic * * interface I { - * default private int privateM() { return 1; } + * private int privateM() { return 1; } * default public int m() { return I.privateM(); } // invokestatic * } * class C implements I {} * - * TEST: I o = new C(); o.m()I throws LinkageError - * TEST: C o = new C(); o.m()I throws LinkageError + * TEST: I o = new C(); o.m()I throws IncompatibleClassChangeError + * TEST: C o = new C(); o.m()I throws IncompatibleClassChangeError */ public void testPrivateInvokeStatic() { TestBuilder b = factory.getBuilder(); @@ -135,8 +152,8 @@ ConcreteClass C = b.clazz("C").implement(I).build(); - b.test().callSite(I, C, "m", "()I").throws_(LinkageError.class).done() - .test().callSite(C, C, "m", "()I").throws_(LinkageError.class).done() + b.test().callSite(I, C, "m", "()I").throws_(IncompatibleClassChangeError.class).done() + .test().callSite(C, C, "m", "()I").throws_(IncompatibleClassChangeError.class).done() .run(); } @@ -146,8 +163,8 @@ * testPrivateCallSameClass * * interface I { - * default private privateM()I { return 1; } - * default public int m() { return I.super.privateM(); } + * private privateM()I { return 1; } + * default public int m() { return I.super.privateM(); } // invokespecial * } * class C implements I {} * @@ -178,7 +195,7 @@ * Attempt to call from subinterface fails * interface I { - * default private privateM()I { return 1; } + * private privateM()I { return 1; } * } * J, K, L use invokespecial * interface J extends I { @@ -248,7 +265,7 @@ * Attempt to call from subclass fails * * interface I { - * default private privateM()I { return 1; } + * private privateM()I { return 1; } * } * class C implements I { * public int m() { return I.super.privateM(); } @@ -260,9 +277,9 @@ * public int m() { return C.super.privateM(); } * } * - * TEST: { C o = new C(); o.m()I throws LinkageError } - * TEST: { D o = new D(); o.m()I throws LinkageError } - * TEST: { E o = new E(); o.m()I throws NoSuchMethodError; } + * TEST: { C o = new C(); o.m()I throws IllegalAccessError (or VerifyError) } + * TEST: { D o = new D(); o.m()I throws VerifyError } + * TEST: { E o = new E(); o.m()I throws NoSuchMethodError (or VerifyError); } */ @NotApplicableFor(modes = { REDEFINITION }) // Can't redefine a class that gets error during loading public void testPrivateCallImplClass() { @@ -289,16 +306,19 @@ .build(); Class eeExpectedClass; + Class ccExpectedClass; if (factory.getVer() >= 52) { eeExpectedClass = NoSuchMethodError.class; + ccExpectedClass = IllegalAccessError.class; } else { // The test gets a VerifyError in this case due to an // invokespecial IMR bytecode. This was not allowed // until class file version 52. (See 8030249.) eeExpectedClass = VerifyError.class; + ccExpectedClass = VerifyError.class; } - b.test().callSite(C, C, "m", "()I").throws_(LinkageError.class).done() - .test().callSite(D, D, "m", "()I").throws_(LinkageError.class).done() + b.test().callSite(C, C, "m", "()I").throws_(ccExpectedClass).done() + .test().callSite(D, D, "m", "()I").throws_(VerifyError.class).done() .test().callSite(E, E, "m", "()I").throws_(eeExpectedClass).done() .run(); @@ -308,18 +328,18 @@ // method overriding /* - * testPrivateDefault + * testPrivate * * interface I { - * default private int m() { return 1; } + * private int m() { return 1; } * } * class C implements I {} * * TEST: { I o = new C(); o.m()I throws IllegalAccessError; } * -mode reflect throws NoSuchMethodException - * TEST: { C o = new C(); o.m()I throws java/lang/NoSuchMethodError; } + * TEST: { C o = new C(); o.m()I throws NoSuchMethodError; } */ - public void testPrivateDefault() { + public void testPrivate() { TestBuilder b = factory.getBuilder(); Interface I = b.intf("I") @@ -343,10 +363,10 @@ } /* - * testPrivateDefaultVsConcrete + * testPrivateVsConcrete * * interface I { - * default private int m() { return 1; } + * private int m() { return 1; } * } * class C implements I { * public int m() { return 2; } @@ -356,7 +376,7 @@ * -mode reflect throws NoSuchMethodException * TEST: { C o = new C(); o.m()I == 2; } */ - public void testPrivateDefaultVsConcrete() { + public void testPrivateVsConcrete() { TestBuilder b = factory.getBuilder(); Interface I = b.intf("I") @@ -385,7 +405,7 @@ * testPublicOverridePrivate * * interface I { - * default private int m() { return 1; } + * private int m() { return 1; } * } * interface J extends I { * default public int m() { return 2; } @@ -433,7 +453,7 @@ * default public int m() { return 1; } * } * interface J extends I { - * default private int m() { return 2; } + * private int m() { return 2; } * } * class C implements J {} * @@ -441,14 +461,6 @@ * TEST: { J o = new C(); o.m()I == IllegalAccessError; } II J.m priv * TEST: { C o = new C(); o.m()I == 1; } */ - /* - - REFLECTION: - Test2_J_C_m : FAILED - nsk.share.TestFailure: Caught exception as expected, but its type is wrong: - expected: java.lang.IllegalAccessError; - actual: java.lang.NoSuchMethodException. - */ public void testPrivateOverrideDefault() { TestBuilder b = factory.getBuilder(); @@ -475,7 +487,7 @@ * testPrivateReabstract * * interface I { - * default private int m() { return 1; } + * private int m() { return 1; } * } * interface J extends I { * abstract public int m(); @@ -522,23 +534,14 @@ * abstract public int m(); * } * interface J extends I { - * default private int m() { return 1; } + * private int m() { return 1; } * } * class C implements J {} * * TEST: { I o = new C(); o.m()I throws AbstractMethodError } - * TEST: { J o = new C(); o.m()I throws IncompatibleClassChangeError } + * TEST: { J o = new C(); o.m()I throws IllegalAccessError } * TEST: { C o = new C(); o.m()I throws AbstractMethodError } */ - /* - REFLECTION: - Test1_I_C_m : FAILED - nsk.share.TestFailure: No exception was thrown: java.lang.AbstractMethodError - Test2_J_C_m : FAILED - nsk.share.TestFailure: No exception was thrown: java.lang.AbstractMethodError - Test3_C_C_m : FAILED - nsk.share.TestFailure: No exception was thrown: java.lang.AbstractMethodError - */ public void testPrivateOverrideAbstract() { TestBuilder b = factory.getBuilder(); @@ -553,24 +556,17 @@ ConcreteClass C = b.clazz("C").implement(J).build(); - Class expectedClass; - if (factory.getExecutionMode().equals("REFLECTION")) { - expectedClass = IllegalAccessException.class; - } else { - expectedClass = IncompatibleClassChangeError.class; - } - b.test().callSite(I, C, "m", "()I").throws_(AbstractMethodError.class).done() - .test().privateCallSite(J, C, "m", "()I").throws_(expectedClass).done() + .test().privateCallSite(J, C, "m", "()I").throws_(IllegalAccessError.class).done() .test().callSite(C, C, "m", "()I").throws_(AbstractMethodError.class).done() .run(); } /* - * testPrivateInheritedDefault + * testPrivateInherited * * interface I { - * default private int m() { return 1; } + * private int m() { return 1; } * } * class B implements I {} * class C extends B {} @@ -580,7 +576,7 @@ * TEST: { B o = new C(); o.m()I throws NoSuchMethodError } * TEST: { C o = new C(); o.m()I throws NoSuchMethodError } */ - public void testPrivateInheritedDefault() { + public void testPrivateInherited() { TestBuilder b = factory.getBuilder(); Interface I = b.intf("I") @@ -607,10 +603,10 @@ } /* - * testPrivateDefaultVsConcreteInherited + * testPrivateVsConcreteInherited * * interface I { - * default private int m() { return 1; } + * private int m() { return 1; } * } * class B { * public int m() { return 2; } @@ -622,7 +618,7 @@ * TEST: { B o = new C(); o.m()I == 2; } * TEST: { C o = new C(); o.m()I == 2; } */ - public void testPrivateDefaultVsConcreteInherited() { + public void testPrivateVsConcreteInherited() { TestBuilder b = factory.getBuilder(); Interface I = b.intf("I") @@ -653,10 +649,10 @@ /* * testPrivateConflict * - * Conflicting default methods + * Conflicting methods * * interface I { - * default private int m() { return 1; } + * private int m() { return 1; } * } * interface J { * default public int m() { return 2; } diff -Nru openjdk-11-11~19/test/jdk/build/translations/VerifyTranslations.java openjdk-11-11~24/test/jdk/build/translations/VerifyTranslations.java --- openjdk-11-11~19/test/jdk/build/translations/VerifyTranslations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/build/translations/VerifyTranslations.java 2018-07-25 15:36:46.000000000 +0000 @@ -45,7 +45,7 @@ * The set of translations we want to see in an Oracle built image */ private static final Set<String> VALID_TRANSLATION_SUFFIXES = Set.of( - "_en", "_en_US", "_en_US_POSIX", "_ja", "_zh_CN", "_zh_TW", "_zh_HK" + "_en", "_en_US", "_en_US_POSIX", "_ja", "_zh_CN" ); /** diff -Nru openjdk-11-11~19/test/jdk/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java openjdk-11-11~24/test/jdk/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java --- openjdk-11-11~19/test/jdk/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/awt/SecurityWarning/GetSizeShouldNotReturnZero.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,15 +50,6 @@ { private static void init() { - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - Frame f = new Frame(); f.setSize(100, 100); f.setVisible(true); @@ -148,8 +139,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -172,8 +163,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -194,184 +185,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - GetSizeShouldNotReturnZero.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - GetSizeShouldNotReturnZero.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/ChaCha20CipherUnitTest.java openjdk-11-11~24/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/ChaCha20CipherUnitTest.java --- openjdk-11-11~19/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/ChaCha20CipherUnitTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/ChaCha20CipherUnitTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,252 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8153029 + * @library /test/lib + * @run main ChaCha20CipherUnitTest + * @summary Unit test for com.sun.crypto.provider.ChaCha20Cipher. + */ + +import java.nio.ByteBuffer; +import java.security.AlgorithmParameters; +import java.security.InvalidAlgorithmParameterException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.util.Arrays; + +import javax.crypto.Cipher; +import javax.crypto.spec.ChaCha20ParameterSpec; +import javax.crypto.spec.IvParameterSpec; +import javax.crypto.spec.SecretKeySpec; + +import jdk.test.lib.Utils; + +public class ChaCha20CipherUnitTest { + + private static final byte[] NONCE + = Utils.toByteArray("012345670123456701234567"); + private static final SecretKeySpec KEY = new SecretKeySpec( + Utils.toByteArray( + "0123456701234567012345670123456701234567012345670123456701234567"), + "ChaCha20"); + private static final ChaCha20ParameterSpec CHACHA20_PARAM_SPEC + = new ChaCha20ParameterSpec(NONCE, 0); + private static final IvParameterSpec IV_PARAM_SPEC + = new IvParameterSpec(NONCE); + + public static void main(String[] args) throws Exception { + testTransformations(); + testInit(); + testAEAD(); + testGetBlockSize(); + } + + private static void testTransformations() throws Exception { + System.out.println("== transformations =="); + + checkTransformation("ChaCha20", true); + checkTransformation("ChaCha20/None/NoPadding", true); + checkTransformation("ChaCha20-Poly1305", true); + checkTransformation("ChaCha20-Poly1305/None/NoPadding", true); + + checkTransformation("ChaCha20/ECB/NoPadding", false); + checkTransformation("ChaCha20/None/PKCS5Padding", false); + checkTransformation("ChaCha20-Poly1305/ECB/NoPadding", false); + checkTransformation("ChaCha20-Poly1305/None/PKCS5Padding", false); + } + + private static void checkTransformation(String transformation, + boolean expected) throws Exception { + try { + Cipher.getInstance(transformation); + if (!expected) { + throw new RuntimeException( + "Unexpected transformation: " + transformation); + } else { + System.out.println("Expected transformation: " + transformation); + } + } catch (NoSuchAlgorithmException e) { + if (!expected) { + System.out.println("Unexpected transformation: " + transformation); + } else { + throw new RuntimeException("Unexpected fail: " + transformation, e); + } + } + } + + private static void testInit() throws Exception { + testInitOnCrypt(Cipher.ENCRYPT_MODE); + testInitOnCrypt(Cipher.DECRYPT_MODE); + testInitOnWrap(Cipher.WRAP_MODE); + testInitOnWrap(Cipher.UNWRAP_MODE); + } + + private static void testInitOnCrypt(int opMode) throws Exception { + System.out.println("== init (" + getOpModeName(opMode) + ") =="); + + Cipher.getInstance("ChaCha20").init(opMode, KEY, CHACHA20_PARAM_SPEC); + Cipher.getInstance("ChaCha20").init(opMode, KEY, + CHACHA20_PARAM_SPEC, new SecureRandom()); + + try { + Cipher.getInstance("ChaCha20").init(opMode, KEY, IV_PARAM_SPEC); + throw new RuntimeException("ChaCha20ParameterSpec is needed"); + } catch (InvalidAlgorithmParameterException e) { + System.out.println("Expected " + e); + } + + Cipher.getInstance("ChaCha20-Poly1305").init(opMode, KEY, + IV_PARAM_SPEC); + Cipher.getInstance("ChaCha20-Poly1305").init(opMode, KEY, + IV_PARAM_SPEC, new SecureRandom()); + + try { + Cipher.getInstance("ChaCha20-Poly1305").init(opMode, KEY, + CHACHA20_PARAM_SPEC); + throw new RuntimeException("IvParameterSpec is needed"); + } catch (InvalidAlgorithmParameterException e) { + System.out.println("Expected " + e); + } + + AlgorithmParameters algorithmParameters = + AlgorithmParameters.getInstance("ChaCha20-Poly1305"); + algorithmParameters.init( + new byte[] { 4, 12, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8 }); + try { + Cipher.getInstance("ChaCha20").init(opMode, KEY, + algorithmParameters, new SecureRandom()); + throw new RuntimeException( + "ChaCha20 cipher doesn't accept AlgorithmParameters"); + } catch (InvalidAlgorithmParameterException e) { + System.out.println("Expected " + e); + } + Cipher.getInstance("ChaCha20-Poly1305").init(opMode, KEY, + algorithmParameters, new SecureRandom()); + } + + private static void testInitOnWrap(int opMode) throws Exception { + String opModeName = getOpModeName(opMode); + System.out.println("== init (" + opModeName + ") =="); + + Cipher chacha20Cipher = Cipher.getInstance("ChaCha20"); + try { + chacha20Cipher.init(opMode, KEY, new SecureRandom()); + throw new RuntimeException( + "Unexpected opration mode: " + opModeName); + } catch (Exception e) { + if (e instanceof UnsupportedOperationException) { + System.out.println("Expected " + e); + } else { + throw new RuntimeException("Unexpected exception: " + e); + } + } + } + + private static void testAEAD() throws Exception { + byte[] expectedPlainttext = Utils.toByteArray("01234567"); + byte[] ciphertext = testUpdateAAD(Cipher.ENCRYPT_MODE, expectedPlainttext); + byte[] plaintext = testUpdateAAD(Cipher.DECRYPT_MODE, ciphertext); + if (!Arrays.equals(plaintext, expectedPlainttext)) { + System.out.println("ciphertext: " + Arrays.toString(ciphertext)); + System.out.println("plaintext: " + Arrays.toString(plaintext)); + throw new RuntimeException("AEAD failed"); + } + } + + private static byte[] testUpdateAAD(int opMode, byte[] input) + throws Exception { + String opModeName = getOpModeName(opMode); + System.out.println("== updateAAD (" + opModeName + ") =="); + + byte[] aad = Utils.toByteArray("0000"); + ByteBuffer aadBuf = ByteBuffer.wrap(aad); + + Cipher cipher = Cipher.getInstance("ChaCha20"); + cipher.init(opMode, KEY, CHACHA20_PARAM_SPEC); + try { + cipher.updateAAD(aadBuf); + throw new RuntimeException("ChaCha20 cipher cannot apply AAD"); + } catch (IllegalStateException e) { + System.out.println("Expected " + e); + } + + Cipher aeadCipher = Cipher.getInstance("ChaCha20-Poly1305"); + try { + aeadCipher.updateAAD(aadBuf); + throw new RuntimeException( + "Cannot update AAD on uninitialized Cipher"); + } catch (IllegalStateException e) { + System.out.println("Expected " + e); + } + aeadCipher.init(opMode, KEY, IV_PARAM_SPEC); + aeadCipher.update(input); + try { + aeadCipher.updateAAD(aad); + throw new RuntimeException( + "Cannot update AAD after plaintext/cipertext update"); + } catch (IllegalStateException e) { + System.out.println("Expected " + e); + } + + aeadCipher = Cipher.getInstance("ChaCha20-Poly1305"); + aeadCipher.init(opMode, KEY, IV_PARAM_SPEC); + aeadCipher.updateAAD(aadBuf); + return aeadCipher.doFinal(input); + } + + private static void testGetBlockSize() throws Exception { + testGetBlockSize(Cipher.ENCRYPT_MODE); + testGetBlockSize(Cipher.DECRYPT_MODE); + } + + private static void testGetBlockSize(int opMode) throws Exception { + System.out.println("== getBlockSize (" + getOpModeName(opMode) + ") =="); + + Cipher cipher = Cipher.getInstance("ChaCha20"); + cipher.init(opMode, KEY, CHACHA20_PARAM_SPEC); + if (cipher.getBlockSize() != 0) { + throw new RuntimeException("Block size must be 0"); + } + } + + private static String getOpModeName(int opMode) { + switch (opMode) { + case Cipher.ENCRYPT_MODE: + return "ENCRYPT"; + + case Cipher.DECRYPT_MODE: + return "DECRYPT"; + + case Cipher.WRAP_MODE: + return "WRAP"; + + case Cipher.UNWRAP_MODE: + return "UNWRAP"; + + default: + return ""; + } + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/ChaCha20Poly1305ParametersUnitTest.java openjdk-11-11~24/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/ChaCha20Poly1305ParametersUnitTest.java --- openjdk-11-11~19/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/ChaCha20Poly1305ParametersUnitTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/ChaCha20Poly1305ParametersUnitTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8153029 + * @library /test/lib + * @run main ChaCha20Poly1305ParametersUnitTest + * @summary Unit test for com.sun.crypto.provider.ChaCha20Poly1305Parameters. + */ + +import java.io.IOException; +import java.security.AlgorithmParameters; +import java.security.spec.InvalidParameterSpecException; +import java.util.Arrays; + +import javax.crypto.spec.ChaCha20ParameterSpec; +import javax.crypto.spec.IvParameterSpec; + +public class ChaCha20Poly1305ParametersUnitTest { + + private static final String ALGORITHM = "ChaCha20-Poly1305"; + + private static final byte[] NONCE = { + 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8 }; + private static final byte[] PARAM = { + 4, 12, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8 }; + + private static final byte[] BAD_NONCE = { + 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; + private static final byte[] BAD_PARAM = { + 4, 13, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 }; + + public static void main(String[] args) throws Exception { + testInit(); + testGetParameterSpec(); + testGetEncoded(); + } + + private static void testInit() throws Exception { + System.out.println("== init =="); + + AlgorithmParameters ap = AlgorithmParameters.getInstance(ALGORITHM); + ap.init(new IvParameterSpec(NONCE)); + System.out.println("AlgorithmParameters: " + ap); + + ap = AlgorithmParameters.getInstance(ALGORITHM); + ap.init(PARAM); + + ap = AlgorithmParameters.getInstance(ALGORITHM); + try { + ap.init(new ChaCha20ParameterSpec(NONCE, 0)); + throw new RuntimeException("IvParameterSpec is needed"); + } catch (InvalidParameterSpecException e) { + System.out.println("Expected " + e); + } + + ap = AlgorithmParameters.getInstance(ALGORITHM); + try { + ap.init(new IvParameterSpec(BAD_NONCE)); + throw new RuntimeException("Nonce must be 96 bits in length"); + } catch (InvalidParameterSpecException e) { + System.out.println("Expected " + e); + } + + ap = AlgorithmParameters.getInstance(ALGORITHM); + try { + ap.init(BAD_PARAM); + throw new RuntimeException("Nonce must be 96 bits in length"); + } catch (IOException e) { + System.out.println("Expected " + e); + } + } + + private static void testGetParameterSpec() throws Exception { + System.out.println("== getParameterSpec =="); + + AlgorithmParameters ap = AlgorithmParameters.getInstance(ALGORITHM); + ap.init(PARAM); + + IvParameterSpec paramSpec = ap.getParameterSpec(IvParameterSpec.class); + byte[] nonce = paramSpec.getIV(); + System.out.println("Nonce: " + Arrays.toString(nonce)); + Arrays.equals(nonce, NONCE); + + try { + ap.getParameterSpec(ChaCha20ParameterSpec.class); + throw new RuntimeException("IvParameterSpec is needed"); + } catch (InvalidParameterSpecException e) { + System.out.println("Expected " + e); + } + } + + private static void testGetEncoded() throws Exception { + System.out.println("== getEncoded =="); + + AlgorithmParameters ap = AlgorithmParameters.getInstance(ALGORITHM); + ap.init(PARAM); + + byte[] defaultFormatEncoded = ap.getEncoded(); + System.out.println("Default format encoding: " + + Arrays.toString(defaultFormatEncoded)); + if (!Arrays.equals(defaultFormatEncoded, PARAM)) { + throw new RuntimeException("Default format encoding failed"); + } + + byte[] asn1FormatEncoded = ap.getEncoded("ASN.1"); + System.out.println("ASN.1 format encoding: " + + Arrays.toString(asn1FormatEncoded)); + if (!Arrays.equals(asn1FormatEncoded, PARAM)) { + throw new RuntimeException("ASN.1 format encoding failed"); + } + + byte[] nullFormatEncoded = ap.getEncoded(null); + System.out.println("Null format encoding: " + + Arrays.toString(nullFormatEncoded)); + if (!Arrays.equals(nullFormatEncoded, PARAM)) { + throw new RuntimeException("Null format encoding failed"); + } + + try { + ap.getEncoded("BAD"); + throw new RuntimeException("Format must be ASN.1"); + } catch (IOException e) { + System.out.println("Expected " + e); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/java.base/com/sun/crypto/provider/Poly1305UnitTest.java openjdk-11-11~24/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/java.base/com/sun/crypto/provider/Poly1305UnitTest.java --- openjdk-11-11~19/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/java.base/com/sun/crypto/provider/Poly1305UnitTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/java.base/com/sun/crypto/provider/Poly1305UnitTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package com.sun.crypto.provider; + +import java.nio.ByteBuffer; +import java.util.Arrays; + +import javax.crypto.spec.SecretKeySpec; + +public class Poly1305UnitTest { + + public static void main(String[] args) throws Exception { + byte[] key = new byte[] { + 28, -110, 64, -91, -21, 85, -45, -118, + -13, 51, -120, -122, 4, -10, -75, -16, + 71, 57, 23, -63, 64, 43, -128, 9, + -99, -54, 92, -68, 32, 112, 117, -64 + }; + + Poly1305 authenticator = new Poly1305(); + if (authenticator.engineGetMacLength() != 16) { + throw new RuntimeException( + "The length of Poly1305 MAC must be 16-bytes."); + } + + authenticator.engineInit(new SecretKeySpec(key, 0, 32, + "Poly1305"), null); + + byte[] message = new byte[] { + 39, 84, 119, 97, 115, 32, 98, 114, + 105, 108, 108, 105, 103, 44, 32, 97, + 110, 100, 32, 116, 104, 101, 32, 115, + 108, 105, 116, 104, 121, 32, 116, 111, + 118, 101, 115, 10, 68, 105, 100, 32, + 103, 121, 114, 101, 32, 97, 110, 100, + 32, 103, 105, 109, 98, 108, 101, 32, + 105, 110, 32, 116, 104, 101, 32, 119, + 97, 98, 101, 58, 10, 65, 108, 108, + 32, 109, 105, 109, 115, 121, 32, 119, + 101, 114, 101, 32, 116, 104, 101, 32, + 98, 111, 114, 111, 103, 111, 118, 101, + 115, 44, 10, 65, 110, 100, 32, 116, + 104, 101, 32, 109, 111, 109, 101, 32, + 114, 97, 116, 104, 115, 32, 111, 117, + 116, 103, 114, 97, 98, 101, 46 + }; + + authenticator.engineUpdate( + ByteBuffer.wrap(Arrays.copyOfRange(message, 0, 8))); + authenticator.engineUpdate(message, 8, 104); + authenticator.engineUpdate(message, 112, 7); + for (int i = 119; i < message.length; i++) { + authenticator.engineUpdate(message[i]); + } + + byte[] tag = authenticator.engineDoFinal(); + byte[] expectedTag = new byte[] { + 69, 65, 102, -102, 126, -86, -18, 97, + -25, 8, -36, 124, -68, -59, -21, 98 + }; + if (!Arrays.equals(tag, expectedTag)) { + throw new RuntimeException( + "Unexpected tag: " + Arrays.toString(tag)); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/Poly1305UnitTestDriver.java openjdk-11-11~24/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/Poly1305UnitTestDriver.java --- openjdk-11-11~19/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/Poly1305UnitTestDriver.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/crypto/provider/Cipher/ChaCha20/unittest/Poly1305UnitTestDriver.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8153029 + * @modules java.base/com.sun.crypto.provider + * @run main java.base/com.sun.crypto.provider.Poly1305UnitTest + * @summary Unit test for com.sun.crypto.provider.Poly1305. + */ diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/EvalArraysAsList.sh openjdk-11-11~24/test/jdk/com/sun/jdi/EvalArraysAsList.sh --- openjdk-11-11~19/test/jdk/com/sun/jdi/EvalArraysAsList.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/EvalArraysAsList.sh 2018-07-25 15:36:46.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/sh # -# Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -39,7 +39,7 @@ public class $classname { public static void main(String[] args) { java.util.List<Object> l = java.util.Arrays.asList(null, "a"); - System.out.println("java.util.Arrays.asList(null, \"a\") returns: " + l); + System.out.println("java.util.Arrays.asList(null, \\"a\\") returns: " + l); return; // @1 breakpoint } } diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/Host/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/Host/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/Host/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/Host/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "Host/Host.java";} + public int m() { + return 1; // original class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/Host/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/Host/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/Host/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/Host/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "Host/redef/Host.java";} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostA/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostA/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostA/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostA/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostA/Host.java";} + public static class A {} + public int m() { + return 1; // original class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostA/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostA/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostA/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostA/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostA/redef/Host.java"; } + public static class A {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAB/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAB/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAB/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAB/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostAB/Host.java";} + public static class A {} + public static class B {} + public int m() { + return 1; // original class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAB/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAB/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAB/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAB/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostAB/redef/Host.java"; } + public static class A {} + public static class B {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABC/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABC/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABC/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABC/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostABC/Host.java";} + public static class A {} + public static class B {} + public static class C {} + public int m() { + return 1; // original class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABC/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABC/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABC/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABC/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostABC/redef/Host.java"; } + public static class A {} + public static class B {} + public static class C {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABCD/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABCD/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABCD/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABCD/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostABCD/redef/Host.java"; } + public static class A {} + public static class B {} + public static class C {} + public static class D {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABD/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABD/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABD/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostABD/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostABD/redef/Host.java"; } + public static class A {} + public static class B {} + public static class D {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAC/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAC/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAC/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostAC/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostAC/redef/Host.java"; } + public static class A {} + public static class C {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostACB/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostACB/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostACB/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostACB/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostACB/redef/Host.java"; } + public static class A {} + public static class C {} + public static class B {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostB/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostB/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostB/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostB/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostB/redef/Host.java"; } + public static class B {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBA/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBA/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBA/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBA/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostBA/redef/Host.java"; } + public static class B {} + public static class A {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBAC/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBAC/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBAC/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBAC/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostBAC/redef/Host.java"; } + public static class B {} + public static class A {} + public static class C {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBCA/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBCA/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBCA/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostBCA/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostBCA/redef/Host.java"; } + public static class B {} + public static class C {} + public static class A {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostCAB/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostCAB/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostCAB/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostCAB/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostCAB/redef/Host.java"; } + public static class C {} + public static class A {} + public static class B {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostCBA/redef/Host.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostCBA/redef/Host.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostCBA/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/HostCBA/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostCBA/redef/Host.java"; } + public static class C {} + public static class B {} + public static class A {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/NamedBuffer.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/NamedBuffer.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/NamedBuffer.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/NamedBuffer.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.*; + +/* + * Copyright 2003 Wily Technology, Inc. + */ + +public class NamedBuffer +{ + private final String fName; + private final byte[] fBuffer; + + public + NamedBuffer( String name, + byte[] buffer) + { + fName = name; + fBuffer = buffer; + } + + public + NamedBuffer( String name, + InputStream stream) + throws IOException + { + this( name, + loadBufferFromStream(stream)); + } + + public String + getName() + { + return fName; + } + + public byte[] + getBuffer() + { + return fBuffer; + } + + public static byte[] + loadBufferFromStream(InputStream stream) + throws IOException + { + // hack for now, just assume the stream will fit in our reasonable size buffer. + // if not, panic + int bufferLimit = 200 * 1024; + byte[] readBuffer = new byte[bufferLimit]; + int actualSize = stream.read(readBuffer); + if ( actualSize >= bufferLimit ) + { + // if there might be more bytes, just surrender + throw new IOException("too big for buffer"); + } + + byte[] resultBuffer = new byte[actualSize]; + System.arraycopy( readBuffer, + 0, + resultBuffer, + 0, + actualSize); + return resultBuffer; + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/TestNestmateAttr.java openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/TestNestmateAttr.java --- openjdk-11-11~19/test/jdk/com/sun/jdi/RedefineNestmateAttr/TestNestmateAttr.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jdi/RedefineNestmateAttr/TestNestmateAttr.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,584 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Class redefinition must preclude changes to nest attributes + * @comment This is a copy of test/jdk/java/lang/instrument/RedefineNestmateAttr/ + * @comment modified for JDI + * @library /test/lib .. + * @modules java.compiler + * @run build TestScaffold VMConnection TargetListener TargetAdapter + * @compile NamedBuffer.java + * @compile Host/Host.java + * @run main/othervm TestNestmateAttr Host + * @compile HostA/Host.java + * @run main/othervm TestNestmateAttr HostA + * @compile HostAB/Host.java + * @run main/othervm TestNestmateAttr HostAB + * @compile HostABC/Host.java + * @run main/othervm TestNestmateAttr HostABC + */ + +/* Test Description + +The basic test class is called Host and we have variants that have zero or more +nested classes named A, B, C etc. Each variant of Host is defined in source +code in its own directory i.e. + +Host/Host.java defines zero nested classes +HostA/Host.java defines one nested class A +HostAB/Host.java defines two nested classes A and B (in that order) +etc. + +Each Host class has the form: + + public class Host { + public static String getID() { return "<directory name>/Host.java"; } + + < zero or more empty nested classes> + + public int m() { + return 1; // original class + } + } + +Under each directory is a directory "redef" with a modified version of the Host +class that changes the ID to e.g. Host/redef/Host.java, and the method m() +returns 2. This allows us to check we have the redefined class loaded. + +Using Host' to represent the redefined version we test redefinition +combinations as follows: + +Host: + Host -> Host' - succeeds m() returns 2 + Host -> HostA' - fails - added a nest member + +HostA: + HostA -> HostA' - succeeds m() returns 2 + HostA -> Host' - fails - removed a nest member + HostA -> HostAB' - fails - added a nest member + HostA -> HostB' - fails - replaced a nest member + +HostAB: + HostAB -> HostAB' - succeeds m() returns 2 + HostAB -> HostBA' - succeeds m() returns 2 + HostAB -> HostA' - fails - removed a nest member + HostAB -> HostABC' - fails - added a nest member + HostAB -> HostAC' - fails - replaced a nest member + +HostABC: + HostABC -> HostABC' - succeeds m() returns 2 + HostABC -> HostACB' - succeeds m() returns 2 + HostABC -> HostBAC' - succeeds m() returns 2 + HostABC -> HostBCA' - succeeds m() returns 2 + HostABC -> HostCAB' - succeeds m() returns 2 + HostABC -> HostCBA' - succeeds m() returns 2 + HostABC -> HostAB' - fails - removed a nest member + HostABC -> HostABCD' - fails - added a nest member + HostABC -> HostABD' - fails - replaced a nest member + +More than three nested classes doesn't add to the code coverage so +we stop here. + +Note that we always try to load the redefined version even when we expect it +to fail. + +We can only directly load one class Host per classloader, so to run all the +groups we either need to use new classloaders, or we reinvoke the test +requesting a different primary directory. We chose the latter using +multiple @run tags. So we proceed as follows: + + @compile Host/Host.java + @run TestNestmateAttr Host + @compile HostA/Host.java - replaces previous Host.class + @run TestNestmateAttr HostA + @compile HostAB/Host.java - replaces previous Host.class + @run TestNestmateAttr HostAB +etc. + +Within the test we directly compile redefined versions of the classes, +using CompilerUtil, and then read the .class file directly as a byte[]. + +Finally we test redefinition of the NestHost attribute - which is +conceptually simple, but in fact very tricky to do. We do that +when testing HostA so we can reuse the Host$A class. + +*/ + +import com.sun.jdi.*; +import com.sun.jdi.event.*; +import com.sun.jdi.request.*; + +import java.io.File; +import java.io.FileInputStream; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import jdk.test.lib.ByteCodeLoader; +import jdk.test.lib.compiler.CompilerUtils; +import jdk.test.lib.compiler.InMemoryJavaCompiler; +import static jdk.test.lib.Asserts.assertTrue; + +/* For JDI the test is split across two VMs and so split into + two main classes. This is the class we will run under the debugger. + Package access so we can define in the same source file for ease of + reference. +*/ +class Target { + // We have to load all of the variants of the classes that we will + // attempt to redefine. This requires some in-memory compilation + // and use of additional classloaders. + public static void main(String[] args) throws Throwable { + String origin = args[0]; + System.out.println("Target: Testing original Host class from " + origin); + + // Make sure the Host class loaded directly is an original version + // and from the expected location + Host h = new Host(); + assertTrue(h.m() == 1); + assertTrue(Host.getID().startsWith(origin + "/")); + + // The rest of this setup is only needed for the case + // when we perform the checkNestHostChanges() test. + if (origin.equals("HostA")) { + String name = "Host$A"; + + // Have to do this reflectively as there is no Host$A + // when compiling the "Host/" case. + Class<?> nestedA = Class.forName(name); // triggers initialization + + // This is compiled as a top-level class: the $ in the name is not + // significant to the compiler. + String hostA = "public class " + name + " {}"; + byte[] bytes = InMemoryJavaCompiler.compile(name, hostA); + // And we have to load this into a new classloader + Class<?> topLevelHostA = ByteCodeLoader.load(name, bytes); + // The loaded class has not been linked (as per ClassLoader.resolveClass) + // and so will be filtered out by VirtualMachine.allClasses(). There are + // a number of ways to force linking - this is the simplest. + Object o = topLevelHostA.newInstance(); + + // sanity check + assertTrue(nestedA.getClassLoader() != topLevelHostA.getClassLoader()); + + } + + breakpoint(); // debugger runs to here before enabling events + allowRedefine(); // debugger stops us here to attempt redefinitions + + System.out.println("Target executed okay"); + } + + static void allowRedefine() { } + static void breakpoint() { } +} + +public class TestNestmateAttr extends TestScaffold { + + static final String SRC = System.getProperty("test.src"); + static final String DEST = System.getProperty("test.classes"); + static final boolean VERBOSE = Boolean.getBoolean("verbose"); + + static String origin; + + // override this to correct a bug so arguments can be passed to + // the Target class + protected void startUp(String targetName) { + List<String> argList = new ArrayList<>(Arrays.asList(args)); + argList.add(0, targetName); // pre-pend so it becomes the first "app" arg + println("run args: " + argList); + connect((String[]) argList.toArray(args)); + waitForVMStart(); + } + + TestNestmateAttr (String[] args) { + super(args); + } + + public static void main(String[] args) throws Throwable { + origin = args[0]; + new TestNestmateAttr(args).startTests(); + } + + public void runTests() throws Exception { + // Get Target into debuggable state + BreakpointEvent bpe = startTo("Target", "breakpoint", "()V"); + EventRequestManager erm = vm().eventRequestManager(); + MethodEntryRequest mee = erm.createMethodEntryRequest(); + mee.addClassFilter("Target"); + mee.enable(); + + // Allow application to complete and shut down + listenUntilVMDisconnect(); + + if (getExceptionCaught()) { + throw new Exception("TestNestmateAttr: failed due to unexpected exception - check logs for details"); + } + else if (!testFailed) { + println("TestNestmateAttr: passed"); + } else { + throw new Exception("TestNestmateAttr: failure reported - check log for details"); + } + } + + // All the actual work is done from here once we see we've entered Target.allowRedefine() + public void methodEntered(MethodEntryEvent event) { + Method meth = event.location().method(); + + if (!meth.name().equals("allowRedefine")) { + return; + } + + System.out.println("TestNestmateAttr: Testing original Host class from " + origin); + + String[] badTransforms; // directories of bad classes + String[] goodTransforms; // directories of good classes + + boolean testNestHostChanges = false; + + switch (origin) { + case "Host": + badTransforms = new String[] { + "HostA" // add member + }; + goodTransforms = new String[] { + origin + }; + break; + + case "HostA": + badTransforms = new String[] { + "Host", // remove member + "HostAB", // add member + "HostB" // change member + }; + goodTransforms = new String[] { + origin + }; + testNestHostChanges = true; + break; + + case "HostAB": + badTransforms = new String[] { + "HostA", // remove member + "HostABC", // add member + "HostAC" // change member + }; + goodTransforms = new String[] { + origin, + "HostBA" // reorder members + }; + break; + + case "HostABC": + badTransforms = new String[] { + "HostAB", // remove member + "HostABCD", // add member + "HostABD" // change member + }; + goodTransforms = new String[] { + origin, + "HostACB", // reorder members + "HostBAC", // reorder members + "HostBCA", // reorder members + "HostCAB", // reorder members + "HostCBA" // reorder members + }; + break; + + default: throw new Error("Unknown test directory: " + origin); + } + + // Need to locate the type we will be trying to redefine in Target + findReferenceTypes(); + + try { + // Compile and check bad transformations + checkBadTransforms(_Host, badTransforms); + + // Compile and check good transformations + checkGoodTransforms(_Host, goodTransforms); + + if (testNestHostChanges) + checkNestHostChanges(); + } + catch (Throwable t) { + failure(t); + } + } + + // override to give exception details + protected void failure(Throwable t) { + super.failure(t.getMessage()); + t.printStackTrace(System.out); + } + + // These are references to the types in Target + // that we will be trying to redefine. + ReferenceType _Host; + ReferenceType _Host_A_nested; + ReferenceType _Host_A_topLevel; + + void findReferenceTypes() { + List<ReferenceType> classes = vm().allClasses(); + ClassLoaderReference cl = null; // track the main loader + ReferenceType a1 = null; + ReferenceType a2 = null; + for (ReferenceType c : classes) { + String name = c.name(); + if (name.equals("Host")) { + _Host = c; + cl = c.classLoader(); + } + else if (name.equals("Host$A")) { + if (a1 == null) { + a1 = c; + } else if (a2 == null) { + a2 = c; + } + else { + assertTrue(false); // Too many Host$A classes found! + } + } + } + assertTrue(_Host != null); + + // The rest of this setup is only needed for the case + // when we perform the checkNestHostChanges() test. + if (origin.equals("HostA")) { + assertTrue(a1 != null); + assertTrue(a2 != null); + + if (a1.classLoader() == cl) { + _Host_A_nested = a1; + assertTrue(a2.classLoader() != cl); + _Host_A_topLevel = a2; + } + else if (a2.classLoader() == cl) { + _Host_A_nested = a2; + assertTrue(a1.classLoader() != cl); + _Host_A_topLevel = a1; + } + else { + assertTrue(false); // Wrong classLoaders found + } + } + } + + void checkNestHostChanges() throws Throwable { + Map<ReferenceType, byte[]> map = new HashMap<>(); + + // case 1: remove NestHost attribute + // - try to redefine nested Host$A with a top-level + // class called Host$A + System.out.println("Trying bad retransform that removes the NestHost attribute"); + + String name = "Host$A"; + + // This is compiled as a top-level class: the $ in the name is not + // significant to the compiler. + String hostA = "public class " + name + " {}"; + byte[] bytes = InMemoryJavaCompiler.compile(name, hostA); + + map.put(_Host_A_nested, bytes); + + try { + vm().redefineClasses(map); + throw new Error("Retransformation to top-level class " + name + + " succeeded unexpectedly"); + } + catch (UnsupportedOperationException uoe) { + if (uoe.getMessage().contains("changes to class attribute not implemented")) { + System.out.println("Got expected exception " + uoe); + } + else throw new Error("Wrong UnsupportedOperationException", uoe); + } + + map.clear(); + + // case 2: add NestHost attribute + // - This is tricky because the class with no NestHost attribute + // has to have the name of a nested class! But we know how to + // do that as we already created a top-level Host$A. So now + // we try to replace with a really nested Host$A. + + System.out.println("Trying bad retransform that adds the NestHost attribute"); + + byte[] nestedBytes; + File clsfile = new File(DEST + "/" + name + ".class"); + if (VERBOSE) System.out.println("Reading bytes from " + clsfile); + try (FileInputStream str = new FileInputStream(clsfile)) { + nestedBytes = NamedBuffer.loadBufferFromStream(str); + } + + map.put(_Host_A_topLevel, nestedBytes); + + try { + vm().redefineClasses(map); + throw new Error("Retransformation to nested class " + name + + " succeeded unexpectedly"); + } + catch (UnsupportedOperationException uoe) { + if (uoe.getMessage().contains("changes to class attribute not implemented")) { + System.out.println("Got expected exception " + uoe); + } + else throw new Error("Wrong UnsupportedOperationException", uoe); + } + + map.clear(); + + // case 3: replace the NestHost attribute + // - the easiest way (perhaps only reasonable way) to do this + // is to search for the Utf8 entry used by the Constant_ClassRef, + // set in the NestHost attribute, and edit it to refer to a different + // name. We reuse nestedBytes from above. + + System.out.println("Trying bad retransform that changes the NestHost attribute"); + + int utf8Entry_length = 7; + boolean found = false; + for (int i = 0; i < nestedBytes.length - utf8Entry_length; i++) { + if (nestedBytes[i] == 1 && // utf8 tag + nestedBytes[i+1] == 0 && // msb of length + nestedBytes[i+2] == 4 && // lsb of length + nestedBytes[i+3] == (byte) 'H' && + nestedBytes[i+4] == (byte) 'o' && + nestedBytes[i+5] == (byte) 's' && + nestedBytes[i+6] == (byte) 't') { + + if (VERBOSE) System.out.println("Appear to have found Host utf8 entry starting at " + i); + + nestedBytes[i+3] = (byte) 'G'; + found = true; + break; + } + } + + if (!found) + throw new Error("Could not locate 'Host' name in byte array"); + + map.put(_Host_A_nested, nestedBytes); + + try { + vm().redefineClasses(map); + throw new Error("Retransformation to modified nested class" + + " succeeded unexpectedly"); + } + catch (UnsupportedOperationException uoe) { + if (uoe.getMessage().contains("changes to class attribute not implemented")) { + System.out.println("Got expected exception " + uoe); + } + else throw new Error("Wrong UnsupportedOperationException", uoe); + } + + } + + void checkGoodTransforms(ReferenceType c, String[] dirs) throws Throwable { + // To verify the redefinition actually took place we will invoke the + // Host.getID method and check the result. To do that we need to find the + // main thread in the target VM. We don't check that "(new Host()).m()" + // returns 2 due to the complexity of setting that up via JDI. + + ThreadReference main = null; + List<ThreadReference> threads = vm().allThreads(); + for (ThreadReference t : threads) { + if (t.name().equals("main")) { + main = t; + break; + } + } + + assertTrue(main != null); + + // Now find the method + Method getID = null; + List<Method> methods = _Host.methodsByName("getID"); + assertTrue(methods.size() == 1); + getID = methods.get(0); + + Map<ReferenceType, byte[]> map = new HashMap<>(); + for (String dir : dirs) { + dir += "/redef"; + System.out.println("Trying good retransform from " + dir); + byte[] buf = bytesForHostClass(dir); + map.put(c, buf); + vm().redefineClasses(map); + map.clear(); + // Test redefinition worked + Value v = ((ClassType)_Host).invokeMethod(main, getID, Collections.emptyList(), 0); + assertTrue(v instanceof StringReference); + String id = ((StringReference)v).value(); + if (VERBOSE) System.out.println("Redefined ID: " + id); + assertTrue(id.startsWith(dir)); + assertTrue(id.contains("/redef/")); + } + } + + void checkBadTransforms(ReferenceType c, String[] dirs) throws Throwable { + Map<ReferenceType, byte[]> map = new HashMap<>(); + for (String dir : dirs) { + dir += "/redef"; + System.out.println("Trying bad retransform from " + dir); + byte[] buf = bytesForHostClass(dir); + map.put(c, buf); + try { + vm().redefineClasses(map); + throw new Error("Retransformation from directory " + dir + + " succeeded unexpectedly"); + } + catch (UnsupportedOperationException uoe) { + if (uoe.getMessage().contains("changes to class attribute not implemented")) { + System.out.println("Got expected exception " + uoe); + } + else throw new Error("Wrong UnsupportedOperationException", uoe); + } + } + } + + static byte[] bytesForHostClass(String dir) throws Throwable { + compile("/" + dir); + File clsfile = new File(DEST + "/" + dir + "/Host.class"); + if (VERBOSE) System.out.println("Reading bytes from " + clsfile); + byte[] buf = null; + try (FileInputStream str = new FileInputStream(clsfile)) { + return buf = NamedBuffer.loadBufferFromStream(str); + } + } + + static void compile(String dir) throws Throwable { + File src = new File(SRC + dir); + File dst = new File(DEST + dir); + if (VERBOSE) System.out.println("Compiling from: " + src + "\n" + + " to: " + dst); + CompilerUtils.compile(src.toPath(), + dst.toPath(), + false /* don't recurse */, + new String[0]); + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/jndi/dns/Test6991580.java openjdk-11-11~24/test/jdk/com/sun/jndi/dns/Test6991580.java --- openjdk-11-11~19/test/jdk/com/sun/jndi/dns/Test6991580.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jndi/dns/Test6991580.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ /* * @test * @bug 6991580 8080108 8133035 - * @requires os.family != "windows" * @summary IPv6 Nameservers in resolv.conf throws NumberFormatException * @modules java.desktop * jdk.naming.dns/com.sun.jndi.dns + * @requires os.family != "windows" + * @build IPv6NameserverPlatformParsingTest * @run main/manual Test6991580 */ diff -Nru openjdk-11-11~19/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java openjdk-11-11~24/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java --- openjdk-11-11~19/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/jndi/ldap/DeadSSLLdapTimeoutTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,7 +67,8 @@ public void performOp(InitialContext ctx) throws NamingException {} public void handleNamingException(NamingException e, long start, long end) { - if (e.getCause() instanceof SocketTimeoutException) { + if (e.getCause() instanceof SocketTimeoutException + || e.getCause().getCause() instanceof SocketTimeoutException) { // SSL connect will timeout via readReply using // SocketTimeoutException e.printStackTrace(); diff -Nru openjdk-11-11~19/test/jdk/com/sun/security/auth/UnixPrincipalHashCode.java openjdk-11-11~24/test/jdk/com/sun/security/auth/UnixPrincipalHashCode.java --- openjdk-11-11~19/test/jdk/com/sun/security/auth/UnixPrincipalHashCode.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/security/auth/UnixPrincipalHashCode.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8198352 + * @requires os.family != "windows" + * @run main/othervm/policy=uphc.policy + * -Djava.security.auth.login.config=uphc.conf + * UnixPrincipalHashCode + * @summary java.util.MissingResourceException: sun.security.util.AuthResources + * when trying to use com.sun.security.auth.module.UnixLoginModule + */ + +import javax.security.auth.Subject; +import javax.security.auth.login.LoginContext; +import java.nio.file.Files; +import java.nio.file.Path; +import java.security.PrivilegedAction; +import java.util.List; + +public class UnixPrincipalHashCode { + public static void main(java.lang.String[] args) throws Exception { + Files.write(Path.of("uphc.conf"), List.of( + "entry {", + " com.sun.security.auth.module.UnixLoginModule required;", + "};")); + LoginContext lc = new LoginContext("entry"); + lc.login(); + Subject subject = lc.getSubject(); + PrivilegedAction action = () -> { + System.out.println(subject); + return null; + }; + Subject.doAsPrivileged(subject, action, null); + } +} diff -Nru openjdk-11-11~19/test/jdk/com/sun/security/auth/uphc.policy openjdk-11-11~24/test/jdk/com/sun/security/auth/uphc.policy --- openjdk-11-11~19/test/jdk/com/sun/security/auth/uphc.policy 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/com/sun/security/auth/uphc.policy 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,6 @@ +grant { + permission java.io.FilePermission "./-", "write"; + permission javax.security.auth.AuthPermission "modifyPrincipals"; + permission javax.security.auth.AuthPermission "createLoginContext"; + permission javax.security.auth.AuthPermission "doAsPrivileged"; +}; diff -Nru openjdk-11-11~19/test/jdk/java/awt/Choice/DragMouseOutAndRelease/DragMouseOutAndRelease.java openjdk-11-11~24/test/jdk/java/awt/Choice/DragMouseOutAndRelease/DragMouseOutAndRelease.java --- openjdk-11-11~19/test/jdk/java/awt/Choice/DragMouseOutAndRelease/DragMouseOutAndRelease.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Choice/DragMouseOutAndRelease/DragMouseOutAndRelease.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,15 +43,6 @@ private static void init() { - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - frame.setLayout (new FlowLayout ()); for (int i = 1; i<10;i++){ choice1.add("item "+i); @@ -193,8 +184,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -217,8 +208,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -239,184 +230,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - DragMouseOutAndRelease.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - DragMouseOutAndRelease.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java openjdk-11-11~24/test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java --- openjdk-11-11~19/test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Choice/SelectCurrentItemTest/SelectCurrentItemTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -81,14 +81,6 @@ this.setLayout (new BorderLayout ()); - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - frame = new Frame("SelectCurrentItemTest"); theChoice = new Choice(); for (int i = 0; i < 10; i++) { @@ -118,7 +110,7 @@ //What would normally go into main() will probably go here. //Use System.out.println for diagnostic messages that you want //to read after the test is done. - //Use Sysout.println for messages you want the tester to read. + //Use System.out.println for messages you want the tester to read. frame.setLocation(1,20); robot.mouseMove(10, 30); @@ -164,12 +156,12 @@ } public void itemStateChanged(ItemEvent e) { - Sysout.println("ItemEvent received. Test passes"); + System.out.println("ItemEvent received. Test passes"); passed = true; } public void windowOpened(WindowEvent e) { - Sysout.println("windowActivated()"); + System.out.println("windowActivated()"); Thread testThread = new Thread(this); testThread.start(); } @@ -182,142 +174,3 @@ public void windowDeiconified(WindowEvent e) {} }// class SelectCurrentItemTest - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setLocation(0, 400); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Choice/UnfocusableCB_ERR/UnfocusableCB_ERR.java openjdk-11-11~24/test/jdk/java/awt/Choice/UnfocusableCB_ERR/UnfocusableCB_ERR.java --- openjdk-11-11~19/test/jdk/java/awt/Choice/UnfocusableCB_ERR/UnfocusableCB_ERR.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Choice/UnfocusableCB_ERR/UnfocusableCB_ERR.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,15 +45,6 @@ private static void init() { - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - EventQueue.invokeLater(new Runnable() { public void run() { Thread.currentThread().setUncaughtExceptionHandler( @@ -193,8 +184,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -217,8 +208,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -239,184 +230,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - UnfocusableCB_ERR.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - UnfocusableCB_ERR.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java openjdk-11-11~24/test/jdk/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java --- openjdk-11-11~19/test/jdk/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Clipboard/HTMLTransferTest/HTMLTransferTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,14 +69,6 @@ public void init() { initImpl(); - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - } // init() private void initImpl() { @@ -93,7 +85,7 @@ for (int i = 0; i < HTMLTransferTest.HTMLFlavors.length; i++) { stFormats += "\"" + HTMLTransferTest.HTMLFlavors[i].getMimeType() + "\"\n"; } - Sysout.println(iniMsg + stFormats); + System.out.println(iniMsg + stFormats); System.err.println("===>" + iniMsg + stFormats); String javaPath = System.getProperty("java.home", ""); @@ -649,119 +641,3 @@ } } // class HTMLSelection - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf(' ', maxStringLength - 1); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Component/CompEventOnHiddenComponent/CompEventOnHiddenComponent.java openjdk-11-11~24/test/jdk/java/awt/Component/CompEventOnHiddenComponent/CompEventOnHiddenComponent.java --- openjdk-11-11~19/test/jdk/java/awt/Component/CompEventOnHiddenComponent/CompEventOnHiddenComponent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Component/CompEventOnHiddenComponent/CompEventOnHiddenComponent.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,15 +47,6 @@ private static void init() { - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - Robot robot; try { robot = new Robot(); @@ -213,8 +204,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -237,8 +228,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -261,182 +252,3 @@ } //*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - CompEventOnHiddenComponent.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - CompEventOnHiddenComponent.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Component/NoUpdateUponShow/NoUpdateUponShow.java openjdk-11-11~24/test/jdk/java/awt/Component/NoUpdateUponShow/NoUpdateUponShow.java --- openjdk-11-11~19/test/jdk/java/awt/Component/NoUpdateUponShow/NoUpdateUponShow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Component/NoUpdateUponShow/NoUpdateUponShow.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,18 +45,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - // Create the frame and the button Frame f = new Frame(); f.setBounds(100, 100, 200, 200); @@ -158,8 +146,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -182,8 +170,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -204,184 +192,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - ValidBounds.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - ValidBounds.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Container/isRemoveNotifyNeeded/JInternalFrameTest.java openjdk-11-11~24/test/jdk/java/awt/Container/isRemoveNotifyNeeded/JInternalFrameTest.java --- openjdk-11-11~19/test/jdk/java/awt/Container/isRemoveNotifyNeeded/JInternalFrameTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Container/isRemoveNotifyNeeded/JInternalFrameTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -79,17 +79,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - // We create a JFrame with two JInternalFrame. // Each JInternalFrame contains a HW Canvas component. JFrame jframe = new JFrame("mixing test"); @@ -206,8 +195,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -230,8 +219,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -252,184 +241,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - JInternalFrameTest.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - JInternalFrameTest.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Dialog/NonResizableDialogSysMenuResize/NonResizableDialogSysMenuResize.java openjdk-11-11~24/test/jdk/java/awt/Dialog/NonResizableDialogSysMenuResize/NonResizableDialogSysMenuResize.java --- openjdk-11-11~19/test/jdk/java/awt/Dialog/NonResizableDialogSysMenuResize/NonResizableDialogSysMenuResize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Dialog/NonResizableDialogSysMenuResize/NonResizableDialogSysMenuResize.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,19 +52,8 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - // We must be sure that the Size system command has the S key as the shortcut one in the System menu. - Sysout.println("NOTE: The test is known to work correctly with English MS Windows only."); + System.out.println("NOTE: The test is known to work correctly with English MS Windows only."); String s = Toolkit.getDefaultToolkit().getClass().getName(); @@ -208,8 +197,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -232,8 +221,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -254,184 +243,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - NonResizableDialogSysMenuResize.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - NonResizableDialogSysMenuResize.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java openjdk-11-11~24/test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java --- openjdk-11-11~19/test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/dnd/InterJVMGetDropSuccessTest/InterJVMGetDropSuccessTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -86,18 +86,6 @@ final DropTarget dropTarget = new DropTarget(frame, dropTargetListener); public void init() { - //Create instructions for the user here, as well as set up - // the environment -- set the layout manager, add buttons, - // etc. - - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - frame.setTitle("Test frame"); frame.setBounds(100, 100, 150, 150); } // init() @@ -361,139 +349,3 @@ } } // run() } // class child - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java openjdk-11-11~24/test/jdk/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java --- openjdk-11-11~19/test/jdk/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/dnd/NoFormatsCrashTest/NoFormatsCrashTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -134,18 +134,6 @@ } // run() public void init() { - //Create instructions for the user here, as well as set up - // the environment -- set the layout manager, add buttons, - // etc. - - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - frame.setTitle("Drop target frame"); frame.setLocation(200, 200); @@ -350,139 +338,3 @@ return pres; } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/event/HierarchyEvent/AncestorResized/AncestorResized.java openjdk-11-11~24/test/jdk/java/awt/event/HierarchyEvent/AncestorResized/AncestorResized.java --- openjdk-11-11~19/test/jdk/java/awt/event/HierarchyEvent/AncestorResized/AncestorResized.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/event/HierarchyEvent/AncestorResized/AncestorResized.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,15 +69,6 @@ Label label; Component[] components; - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - frame = new Frame("Test Frame"); frame.setLayout(new FlowLayout()); @@ -209,8 +200,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -233,8 +224,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -295,144 +286,3 @@ //************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/event/KeyEvent/CorrectTime/CorrectTime.java openjdk-11-11~24/test/jdk/java/awt/event/KeyEvent/CorrectTime/CorrectTime.java --- openjdk-11-11~19/test/jdk/java/awt/event/KeyEvent/CorrectTime/CorrectTime.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/event/KeyEvent/CorrectTime/CorrectTime.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -122,7 +122,7 @@ long eventTime = e.getWhen(); long currTime = System.currentTimeMillis(); long diff = currTime - eventTime; - Sysout.println(k + " diff is " + diff + ", event is "+ e); + System.out.println(k + " diff is " + diff + ", event is "+ e); if (diff < 0 || diff > REASONABLE_PATH_TIME) { diff -Nru openjdk-11-11~19/test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java openjdk-11-11~24/test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java --- openjdk-11-11~19/test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/event/KeyEvent/KeyTyped/CtrlASCII.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -186,35 +186,16 @@ public void init() { - //Create instructions for the user here, as well as set up - // the environment -- set the layout manager, add buttons, - // etc. - // XXX test for MS Windows fillHash( false ); this.setLayout (new BorderLayout ()); - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - }//End init() public void start () { - //Get things going. Request focus, set size, et cetera - setSize(400,300); setVisible(true); - //What would normally go into main() will probably go here. - //Use System.out.println for diagnostic messages that you want - //to read after the test is done. - //Use Sysout.println for messages you want the tester to read. - String original = "0123456789"; tf = new TextField(original, 20); this.add(tf); @@ -252,7 +233,7 @@ if( testFailed ) { throw new RuntimeException("The test failed.\n\n"); } - Sysout.println("Success\n"); + System.out.println("Success\n"); }// start() public void punchCtrlKey( Robot ro, int keyCode ) { @@ -277,7 +258,7 @@ char keych = evt.getKeyChar(); if( !keycharHash.containsKey( keych ) ) { System.out.println("Unexpected keychar: "+keych); - Sysout.println("Unexpected keychar: "+keych); + System.out.println("Unexpected keychar: "+keych); testFailed = true; } } @@ -297,148 +278,11 @@ break; default: System.out.println("Other Event "); - Sysout.println("Other Event "); + System.out.println("Other Event "); return; } System.out.print(" 0x"+ Integer.toHexString(evt.getKeyChar())); - Sysout.println (" 0x"+ Integer.toHexString(evt.getKeyChar())); + System.out.println (" 0x"+ Integer.toHexString(evt.getKeyChar())); } }// class CtrlASCII - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/event/MouseEvent/EventTimeInFuture/EventTimeInFuture.java openjdk-11-11~24/test/jdk/java/awt/event/MouseEvent/EventTimeInFuture/EventTimeInFuture.java --- openjdk-11-11~19/test/jdk/java/awt/event/MouseEvent/EventTimeInFuture/EventTimeInFuture.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/event/MouseEvent/EventTimeInFuture/EventTimeInFuture.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,8 +58,8 @@ frame.getLocationOnScreen().y - frame.getHeight()/5); Point end = new Point(frame.getLocationOnScreen().x + frame.getWidth() * 6 / 5, frame.getLocationOnScreen().y + frame.getHeight() * 6 / 5); - Sysout.println("start = " + start); - Sysout.println("end = " + end); + System.out.println("start = " + start); + System.out.println("end = " + end); Util.mouseMove(robot, start, end); // Start drag inside toplevel. @@ -87,7 +87,7 @@ long currTime = System.currentTimeMillis(); long diff = currTime - eventTime; - Sysout.println(k + " diff is " + diff + ", event is "+ e); + System.out.println(k + " diff is " + diff + ", event is "+ e); if (diff < 0){ AbstractTest.fail(k + " diff is " + diff + ", event = "+e); diff -Nru openjdk-11-11~19/test/jdk/java/awt/event/MouseEvent/RobotLWTest/RobotLWTest.java openjdk-11-11~24/test/jdk/java/awt/event/MouseEvent/RobotLWTest/RobotLWTest.java --- openjdk-11-11~19/test/jdk/java/awt/event/MouseEvent/RobotLWTest/RobotLWTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/event/MouseEvent/RobotLWTest/RobotLWTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,10 +48,6 @@ public void start () { - //What would normally go into main() will probably go here. - //Use System.out.println for diagnostic messages that you want - //to read after the test is done. - //Use Sysout.println for messages you want the tester to read. Frame frame = new Frame(); MyLWContainer c = new MyLWContainer(); MyLWComponent b = new MyLWComponent(); @@ -149,139 +145,3 @@ g.clearRect(0, 0, d.width - 1, d.height -1); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/6378278/InputVerifierTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/6378278/InputVerifierTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/6378278/InputVerifierTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/6378278/InputVerifierTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,21 +61,11 @@ private static void init() { - //*** Create instructions for the user here *** - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - JFrame frame = new JFrame(); JTextField t1 = new JTextField(); t1.setInputVerifier(new InputVerifier() { public boolean verify(JComponent input) { - Sysout.println("verify(" + input + ")"); + System.out.println("verify(" + input + ")"); ivWasCalled = true; return true; } @@ -226,8 +216,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -250,8 +240,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -272,143 +262,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/6382144/EndlessLoopTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/6382144/EndlessLoopTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/6382144/EndlessLoopTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/6382144/EndlessLoopTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,15 +69,6 @@ { //*** Create instructions for the user here *** - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - JFrame frame = new JFrame(); final JDialog dialog = new JDialog(frame, true); JButton button = new JButton("press me"); @@ -228,8 +219,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -246,8 +237,8 @@ public static synchronized void fail( Exception whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -268,143 +259,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/6401036/InputVerifierTest2.java openjdk-11-11~24/test/jdk/java/awt/Focus/6401036/InputVerifierTest2.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/6401036/InputVerifierTest2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/6401036/InputVerifierTest2.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,17 +59,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - JFrame frame = new JFrame(); frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE); JTextField tf = new JTextField(10); @@ -203,8 +192,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -221,8 +210,8 @@ public static synchronized void fail( Exception whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -243,143 +232,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusSetVisibleTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -69,9 +69,6 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an automatic test. Simply wait until it is done." - }); toolkitClassName = Toolkit.getDefaultToolkit().getClass().getName(); } @@ -151,7 +148,7 @@ recreateGUI(); - Sysout.println("Stage 1 in progress..."); + System.out.println("Stage 1 in progress..."); dialog.setModal(true); dialog.setAutoRequestFocus(false); @@ -175,7 +172,7 @@ recreateGUI(); - Sysout.println("Stage 2 in progress..."); + System.out.println("Stage 2 in progress..."); setVisible(focusedFrame, false); @@ -283,7 +280,7 @@ // On Windows, an owned Window will not be focused on its showing // if the owner is not currently active. if ("sun.awt.windows.WToolkit".equals(toolkitClassName)) { - Sysout.println("Stage 5.1 - Skiping."); + System.out.println("Stage 5.1 - Skiping."); } else { setVisible(ownedWindow, true); setVisible(frame, false); // 'ownedWindow' will be shown along with the owner. @@ -306,9 +303,9 @@ /////////////////////////////////// if ("sun.awt.motif.MToolkit".equals(toolkitClassName)) { - Sysout.println("Stage 6 - Skiping."); + System.out.println("Stage 6 - Skiping."); } else { - Sysout.println("Stage 6 in progress..."); + System.out.println("Stage 6 in progress..."); // --- // Testing the bug of activating invisible modal Dialog (awt_Window::SetAndActivateModalBlocker). @@ -343,7 +340,7 @@ setVisible(dialog, false); } - Sysout.println("Test passed."); + System.out.println("Test passed."); } /* @@ -356,7 +353,7 @@ void test(String msg, final Window showWindow, Window ownedWindow, final Button clickButton, boolean shouldFocusChange) { Window testWindow = (ownedWindow == null ? showWindow : ownedWindow); - Sysout.println(msg); + System.out.println(msg); if (showWindow.isVisible()) { showWindow.dispose(); @@ -428,7 +425,7 @@ if (!performed) { // In case of loosing ACTION_PERFORMED, try once more. - Sysout.println("(ACTION_EVENT was not generated. One more attemp.)"); + System.out.println("(ACTION_EVENT was not generated. One more attemp.)"); performed = Util.trackActionPerformed(clickButton, new Runnable() { public void run() { Util.clickOnComp(clickButton, robot); @@ -470,140 +467,3 @@ super("Test failed: " + msg); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - -// setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/AutoRequestFocusTest/AutoRequestFocusToFrontTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -80,9 +80,6 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an automatic test. Simply wait until it is done." - }); toolkitClassName = Toolkit.getDefaultToolkit().getClass().getName(); } @@ -245,7 +242,7 @@ Test.test("Test stage 7 in progress", frameButton); - Sysout.println("Test passed."); + System.out.println("Test passed."); } static class Test { @@ -270,7 +267,7 @@ * @param shouldFocusChange true for modal dialogs */ static void test(String msg, final Button testButton, boolean shouldFocusChange) { - Sysout.println(msg); + System.out.println(msg); showWindows(testWindow, showWindows, true); @@ -319,7 +316,7 @@ if (!performed) { // For the case when the robot failed to trigger ACTION_EVENT. - Sysout.println("(ACTION_EVENT was not generated. One more attemp.)"); + System.out.println("(ACTION_EVENT was not generated. One more attemp.)"); performed = Util.trackActionPerformed(testButton, new Runnable() { public void run() { Util.clickOnComp(testButton, robot); @@ -435,139 +432,3 @@ } } -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - -// setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/ChildWindowFocusTest/ChildWindowFocusTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/ChildWindowFocusTest/ChildWindowFocusTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/ChildWindowFocusTest/ChildWindowFocusTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/ChildWindowFocusTest/ChildWindowFocusTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,11 +56,7 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an AUTOMATIC test", "simply wait until it is done"}); - - Rectangle bounds = Sysout.dialog.getBounds(); - shift = (int)(bounds.x + bounds.width + 10); + shift = 100; } public void start() { @@ -98,7 +94,7 @@ clickOn(frame); checkFocusOwner(text0); - Sysout.println("Test passed."); + System.out.println("Test passed."); } void clickOnCheckFocusOwner(Component c) { @@ -116,7 +112,7 @@ Point p = c.getLocationOnScreen(); Dimension d = c.getSize(); - Sysout.println("Clicking " + c); + System.out.println("Clicking " + c); if (c instanceof Frame) { robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + ((Frame)c).getInsets().top/2); @@ -142,140 +138,3 @@ setBounds(0, x, 100, 100); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -65,9 +65,6 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an automatic test. Simply wait until it is done." - }); } public void start() { @@ -129,7 +126,7 @@ * Test that the last request succeeds */ f2.addFocusListener(listener1); - Sysout.println("Stage 1."); + System.out.println("Stage 1."); test1(); @@ -139,10 +136,10 @@ */ f2.removeFocusListener(listener1); f2.addFocusListener(listener2); - Sysout.println("Stage 2."); + System.out.println("Stage 2."); test2(); - Sysout.println("Test passed."); + System.out.println("Test passed."); } void test1() { @@ -197,140 +194,3 @@ super("Test failed: " + msg); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - -// setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/InputVerifierTest3/InputVerifierTest3.java openjdk-11-11~24/test/jdk/java/awt/Focus/InputVerifierTest3/InputVerifierTest3.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/InputVerifierTest3/InputVerifierTest3.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/InputVerifierTest3/InputVerifierTest3.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,15 +67,6 @@ { //*** Create instructions for the user here *** - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - JFrame frame = new JFrame(); frame.getContentPane().setLayout(new FlowLayout()); JTextField tf1 = new JTextField(10); @@ -205,8 +196,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -223,8 +214,8 @@ public static synchronized void fail( Exception whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -245,143 +236,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/ModalBlockedStealsFocusTest/ModalBlockedStealsFocusTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/ModalBlockedStealsFocusTest/ModalBlockedStealsFocusTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/ModalBlockedStealsFocusTest/ModalBlockedStealsFocusTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/ModalBlockedStealsFocusTest/ModalBlockedStealsFocusTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,14 +52,11 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an automatic test. Simply wait until it is done." - }); } public void start() { if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) { - Sysout.println("The test is not for MToolkit."); + System.out.println("The test is not for MToolkit."); return; } @@ -68,7 +65,7 @@ dialog.addWindowFocusListener(new WindowAdapter() { public void windowLostFocus(WindowEvent e) { - Sysout.println(e.toString()); + System.out.println(e.toString()); synchronized (lostFocus) { lostFocus.set(true); lostFocus.notifyAll(); @@ -106,7 +103,7 @@ if (Util.waitForCondition(lostFocus, 2000L)) { throw new TestFailedException("the modal blocked frame stole focus on its bringing to front!"); } else { - Sysout.println("Test passed"); + System.out.println("Test passed"); } } } @@ -116,140 +113,3 @@ super("Test failed: " + msg); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/ModalDialogInitialFocusTest/ModalDialogInitialFocusTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/ModalDialogInitialFocusTest/ModalDialogInitialFocusTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/ModalDialogInitialFocusTest/ModalDialogInitialFocusTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/ModalDialogInitialFocusTest/ModalDialogInitialFocusTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,9 +59,6 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is automatic test. Simply wait until it is done." - }); } public void start() { @@ -94,7 +91,7 @@ dialog.dispose(); if (passed) { - Sysout.println("Test passed."); + System.out.println("Test passed."); } else { throw new RuntimeException("Test failed: dialog requests extra focus on show!"); } @@ -114,140 +111,3 @@ } } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/ModalExcludedWindowClickTest/ModalExcludedWindowClickTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,21 +58,19 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an AUTOMATIC test", "simply wait until it is done"}); } public void start() { if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) { - Sysout.println("No testing on MToolkit."); + System.out.println("No testing on MToolkit."); return; } button.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { actionPerformed = true; - Sysout.println(e.paramString()); + System.out.println(e.paramString()); } }); @@ -105,14 +103,14 @@ if (!actionPerformed) { throw new RuntimeException("Test failed!"); } - Sysout.println("Test passed."); + System.out.println("Test passed."); } void clickOn(Component c) { Point p = c.getLocationOnScreen(); Dimension d = c.getSize(); - Sysout.println("Clicking " + c); + System.out.println("Clicking " + c); if (c instanceof Frame) { robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + ((Frame)c).getInsets().top/2); @@ -141,10 +139,10 @@ public void run() {} // Dummy implementation }); } catch(InterruptedException ie) { - Sysout.println("waitForIdle, non-fatal exception caught:"); + System.out.println("waitForIdle, non-fatal exception caught:"); ie.printStackTrace(); } catch(InvocationTargetException ite) { - Sysout.println("waitForIdle, non-fatal exception caught:"); + System.out.println("waitForIdle, non-fatal exception caught:"); ite.printStackTrace(); } @@ -152,140 +150,3 @@ robot.delay(200); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,14 +57,12 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an AUTOMATIC test", "simply wait until it is done"}); } public void start() { if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) { - Sysout.println("No testing on MToolkit."); + System.out.println("No testing on MToolkit."); return; } @@ -101,14 +99,14 @@ if (button == KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner()) { throw new RuntimeException("Test failed!"); } - Sysout.println("Test passed."); + System.out.println("Test passed."); } void clickOn(Component c) { Point p = c.getLocationOnScreen(); Dimension d = c.getSize(); - Sysout.println("Clicking " + c); + System.out.println("Clicking " + c); if (c instanceof Frame) { robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + ((Frame)c).getInsets().top/2); @@ -138,10 +136,10 @@ public void run() {} // Dummy implementation }); } catch(InterruptedException ie) { - Sysout.println("waitForIdle, non-fatal exception caught:"); + System.out.println("waitForIdle, non-fatal exception caught:"); ie.printStackTrace(); } catch(InvocationTargetException ite) { - Sysout.println("waitForIdle, non-fatal exception caught:"); + System.out.println("waitForIdle, non-fatal exception caught:"); ite.printStackTrace(); } @@ -149,140 +147,3 @@ robot.delay(200); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/NonFocusableResizableTooSmall/NonFocusableResizableTooSmall.java openjdk-11-11~24/test/jdk/java/awt/Focus/NonFocusableResizableTooSmall/NonFocusableResizableTooSmall.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/NonFocusableResizableTooSmall/NonFocusableResizableTooSmall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/NonFocusableResizableTooSmall/NonFocusableResizableTooSmall.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,17 +50,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - final Frame frame = new Frame(); frame.setFocusableWindowState(false); frame.setSize(200, 100); @@ -185,8 +174,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -209,8 +198,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -231,184 +220,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - NonFocusableResizableTooSmall.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - NonFocusableResizableTooSmall.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/ShowFrameCheckForegroundTest/ShowFrameCheckForegroundTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -123,127 +123,3 @@ super("Test failed: " + msg); } } - -/**************************************************** - * Standard Test Machinery - * DO NOT modify anything below -- it's a standard - * chunk of code whose purpose is to make user - * interaction uniform, and thereby make it simpler - * to read and understand someone else's test. - ****************************************************/ - -/** - * This is part of the standard test machinery. - * It creates a dialog (with the instructions), and is the interface - * for sending text messages to the user. - * To print the instructions, send an array of strings to Sysout.createDialog - * WithInstructions method. Put one line of instructions per array entry. - * To display a message for the tester to see, simply call Sysout.println - * with the string to be displayed. - * This mimics System.out.println but works within the test harness as well - * as standalone. - */ - -class Sysout { - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - * This is part of the standard test machinery. It provides a place for the - * test instructions to be displayed, and a place for interactive messages - * to the user to be displayed. - * To have the test instructions displayed, see Sysout. - * To have a message to the user be displayed, see Sysout. - * Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/ToFrontFocusTest/ToFrontFocus.java openjdk-11-11~24/test/jdk/java/awt/Focus/ToFrontFocusTest/ToFrontFocus.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/ToFrontFocusTest/ToFrontFocus.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/ToFrontFocusTest/ToFrontFocus.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,13 +55,6 @@ this.setLayout (new BorderLayout ()); - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); cover = new Frame("Cover frame"); cover.setBounds(100, 100, 200, 200); focus_frame = new Frame("Focusable frame"); @@ -137,140 +130,3 @@ }// start() }// class ToFrontFocus - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/WindowInitialFocusTest/WindowInitialFocusTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/WindowInitialFocusTest/WindowInitialFocusTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/WindowInitialFocusTest/WindowInitialFocusTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/WindowInitialFocusTest/WindowInitialFocusTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,9 +53,6 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an automatic test. Simply wait until it is done." - }); } public void start() { @@ -66,7 +63,7 @@ window.addWindowFocusListener(new WindowAdapter() { public void windowGainedFocus(WindowEvent e) { - Sysout.println(e.toString()); + System.out.println(e.toString()); synchronized (focused) { focused.set(true); focused.notifyAll(); @@ -105,7 +102,7 @@ if (Util.waitForCondition(focused, 2000L)) { throw new TestFailedException("the unfocusable window got focused on its showing!"); } else { - Sysout.println("Test passed"); + System.out.println("Test passed"); } } } @@ -115,140 +112,3 @@ super("Test failed: " + msg); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java openjdk-11-11~24/test/jdk/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java --- openjdk-11-11~19/test/jdk/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ final Object monitor = new Object(); FocusListener listener = new FocusAdapter () { public void focusGained(FocusEvent e) { - Sysout.println(e.toString()); + System.out.println(e.toString()); synchronized (monitor) { focusGained = true; monitor.notifyAll(); @@ -64,13 +64,11 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an automatic test. Simply wait until it's done."}); } public void start() { if ("sun.awt.motif.MToolkit".equals(Toolkit.getDefaultToolkit().getClass().getName())) { - Sysout.println("No testing on Motif."); + System.out.println("No testing on Motif."); return; } @@ -139,7 +137,7 @@ throw new RuntimeException("Test failed: window2 is not focusable!"); } - Sysout.println("Test for " + owner.getName() + " passed."); + System.out.println("Test for " + owner.getName() + " passed."); owner.dispose(); } @@ -147,7 +145,7 @@ Point p = c.getLocationOnScreen(); Dimension d = c.getSize(); - Sysout.println("Clicking " + c); + System.out.println("Clicking " + c); robot.mouseMove(p.x + (int)(d.getWidth()/2), p.y + (int)(d.getHeight()/2)); @@ -164,10 +162,10 @@ public void run() {} // Dummy implementation }); } catch(InterruptedException ie) { - Sysout.println("waitForIdle, non-fatal exception caught:"); + System.out.println("waitForIdle, non-fatal exception caught:"); ie.printStackTrace(); } catch(InvocationTargetException ite) { - Sysout.println("waitForIdle, non-fatal exception caught:"); + System.out.println("waitForIdle, non-fatal exception caught:"); ite.printStackTrace(); } } @@ -178,7 +176,7 @@ try { monitor.wait(3000); } catch (InterruptedException e) { - Sysout.println("Interrupted unexpectedly!"); + System.out.println("Interrupted unexpectedly!"); throw new RuntimeException(e); } } @@ -186,140 +184,3 @@ return focusGained; } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/font/PhoneticExtensions/PhoneticExtensionsGlyphTest.java openjdk-11-11~24/test/jdk/java/awt/font/PhoneticExtensions/PhoneticExtensionsGlyphTest.java --- openjdk-11-11~19/test/jdk/java/awt/font/PhoneticExtensions/PhoneticExtensionsGlyphTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/font/PhoneticExtensions/PhoneticExtensionsGlyphTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +/* + * @test + * @bug 8202696 + * @summary Verifies if Phonetic extensions are getting displayed. + */ + +import java.awt.Font; +import java.awt.GraphicsEnvironment; +import java.util.Locale; + +public class PhoneticExtensionsGlyphTest { + private static final String[] logicalFonts = {"dialog", "dialoginput", "serif", "sansserif", "monospaced"}; + + private static final String phoneticExtnChars = "\u1D00 \u1D01 \u1D02 \u1D03 \u1D04 \u1D05 \u1D06 \u1D07 \u1D08 \u1D09\n" + +"\u1D0A \u1D0B \u1D0C \u1D0D \u1D0E \u1D0F \u1D10 \u1D11 \u1D12 \u1D13\n" + +"\u1D14 \u1D15 \u1D16 \u1D17 \u1D18 \u1D19 \u1D1A \u1D1B \u1D1C \u1D1D\n" + +"\u1D1E \u1D1F \u1D20 \u1D21 \u1D22 \u1D23 \u1D24 \u1D25 \u1D26 \u1D27\n" + +"\u1D28 \u1D29 \u1D2A \u1D2B \u1D2C \u1D2D \u1D2E \u1D2F \u1D30 \u1D31\n" + +"\u1D32 \u1D33 \u1D34 \u1D35 \u1D36 \u1D37 \u1D38 \u1D39 \u1D3A \u1D3B\n" + +"\u1D3C \u1D3D \u1D3E \u1D3F \u1D40 \u1D41 \u1D42 \u1D43 \u1D44 \u1D45\n" + +"\u1D46 \u1D47 \u1D48 \u1D49 \u1D4A \u1D4B \u1D4C \u1D4D \u1D4E \u1D4F\n" + +"\u1D50 \u1D51 \u1D52 \u1D53 \u1D54 \u1D55 \u1D56 \u1D57 \u1D58 \u1D59\n" + +"\u1D5A \u1D5B \u1D5C \u1D5D \u1D5E \u1D5F \u1D60 \u1D61 \u1D62 \u1D63\n" + +"\u1D64 \u1D65 \u1D66 \u1D67 \u1D68 \u1D69 \u1D6A \u1D6B \u1D6C \u1D6D\n" + +"\u1D6E \u1D6F \u1D70 \u1D71 \u1D72 \u1D73 \u1D74 \u1D75 \u1D76 \u1D77\n" + +"\u1D78 \u1D79 \u1D7A \u1D7B \u1D7C \u1D7D \u1D7E \u1D7F"; + + public static void main(String[] args) throws Exception { + if (!System.getProperty("os.name").startsWith("Win")) { + return; + } + + if(!canDisplayPhoneticChars()) { + throw new RuntimeException("Phonetic extensions failed to display."); + } + } + + private static boolean isLogicalFont(Font f) { + String fontName = f.getFamily().toLowerCase(Locale.ROOT); + for (int i = 0; i < logicalFonts.length; i++) { + if (logicalFonts[i].equals(fontName)) { + return true; + } + } + return false; + } + + private static boolean canDisplayPhoneticChars() { + GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment(); + Font[] fonts = ge.getAllFonts(); + boolean ret = false; + for (Font font : fonts) { + if (isLogicalFont(font) && font.canDisplayUpTo(phoneticExtnChars) == -1) { + ret = true; + break; + } + } + return ret; + } +} Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/test/jdk/java/awt/font/TextLayout/TestVS-expect.png and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/test/jdk/java/awt/font/TextLayout/TestVS-expect.png differ diff -Nru openjdk-11-11~19/test/jdk/java/awt/font/TextLayout/TestVS.java openjdk-11-11~24/test/jdk/java/awt/font/TextLayout/TestVS.java --- openjdk-11-11~19/test/jdk/java/awt/font/TextLayout/TestVS.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/font/TextLayout/TestVS.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + * + */ + +/* @test + * @summary Verify Variation Selector matches an expected image + * @bug 8187100 + * @ignore Requires a special font installed. + */ + +import javax.swing.SwingUtilities; +import javax.swing.border.LineBorder; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JFrame; +import javax.swing.JTextArea; +import javax.swing.ImageIcon; +import java.awt.Font; +import java.awt.Color; + +public class TestVS { + public static void main(String[] args) { + SwingUtilities.invokeLater(new Runnable() { + public void run() { + new TestVS().run(); + } + }); + } + + private void run() { + Font ourFont = null; + final String fontName = "ipaexm.ttf"; + // download from https://ipafont.ipa.go.jp/node26#en + // and place in {user.home}/fonts/ + try { + ourFont = Font.createFont(Font.TRUETYPE_FONT, + new java.io.File(new java.io.File( + System.getProperty("user.home"), + "fonts"), fontName)); + ourFont = ourFont.deriveFont((float)48.0); + final String actualFontName = ourFont.getFontName(); + if (!actualFontName.equals("IPAexMincho")) { + System.err.println("*** Warning: missing font IPAexMincho."); + System.err.println("*** Using font: " + actualFontName); + } + } catch(Throwable t) { + t.printStackTrace(); + System.err.println("Fail: " + t); + return; + } + JFrame frame = new JFrame(System.getProperty("java.version")); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + JPanel panel = new JPanel(); + final JTextArea label = new JTextArea("empty"); + label.setSize(400, 300); + label.setBorder(new LineBorder(Color.black)); + label.setFont(ourFont); + + final String str = "\u845b\udb40\udd00\u845b\udb40\udd01\n"; + + label.setText(str); + + panel.add(label); + panel.add(new JLabel(ourFont.getFamily())); + + // Show the expected result. + panel.add(new JLabel(new ImageIcon("TestVS-expect.png"))); + + frame.getContentPane().add(panel); + frame.pack(); + frame.setVisible(true); + } +} diff -Nru openjdk-11-11~19/test/jdk/java/awt/font/TextLayout/VariationSelectorTest.java openjdk-11-11~24/test/jdk/java/awt/font/TextLayout/VariationSelectorTest.java --- openjdk-11-11~19/test/jdk/java/awt/font/TextLayout/VariationSelectorTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/font/TextLayout/VariationSelectorTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,65 @@ +/* @test + * @summary Verify two identical 'a's are rendered + * @bug 8187100 + * @ignore Requires a special font installed. + */ +import javax.swing.JFrame; +import javax.swing.JComponent; +import javax.swing.SwingUtilities; +import javax.swing.WindowConstants; +import java.awt.Font; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.font.FontRenderContext; +import java.awt.font.GlyphVector; + +public class VariationSelectorTest { + // A font supporting Unicode variation selectors is required + // At least DejaVu 2.20 from 2007 + private static final Font FONT = new Font("DejaVu Sans", Font.PLAIN, 12); + + public static void main(String[] args) { + final String fontName = FONT.getFontName(); + if (!fontName.equals("DejaVuSans")) { + System.err.println("*** Warning: Font DejaVuSans not installed."); + System.err.println("*** Using font: " + fontName); + } + SwingUtilities.invokeLater(() -> { + JFrame frame = new JFrame(); + frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); + frame.add(new MyComponent()); + frame.setSize(200, 200); + frame.setVisible(true); + frame.setLocationRelativeTo(null); + }); + } + + private static class MyComponent extends JComponent { + @Override + protected void paintComponent(Graphics g) { + Graphics2D g2d = (Graphics2D) g; + FontRenderContext frc = g2d.getFontRenderContext(); + String text = "a"; + GlyphVector gv = FONT.layoutGlyphVector( + frc, text.toCharArray(), 0, text.length(), + Font.LAYOUT_LEFT_TO_RIGHT); + System.out.println("'a'=" + gv.getNumGlyphs()); + g2d.drawString("=" + gv.getNumGlyphs() + " ('a')", 100, 50); + g2d.drawGlyphVector(gv, 80, 50); + String text2 = "a\ufe00"; + GlyphVector gv2 = FONT.layoutGlyphVector( + frc, text2.toCharArray(), 0, text2.length(), + Font.LAYOUT_LEFT_TO_RIGHT); + g2d.drawGlyphVector(gv2, 80, 100); + System.out.println("'a'+VS=" + gv2.getNumGlyphs()); + g2d.drawString("=" + gv2.getNumGlyphs() + " ('a'+VS)", 100, 100); + if ((gv.getNumGlyphs() == 1) && (gv2.getNumGlyphs() == 1)) { + System.out.println("PASS"); + g2d.drawString("PASS", 10, 15); + } else { + System.err.println("FAIL"); + g2d.drawString("FAIL", 10, 15); + } + } + } +} diff -Nru openjdk-11-11~19/test/jdk/java/awt/Frame/DisposeStressTest/DisposeStressTest.java openjdk-11-11~24/test/jdk/java/awt/Frame/DisposeStressTest/DisposeStressTest.java --- openjdk-11-11~19/test/jdk/java/awt/Frame/DisposeStressTest/DisposeStressTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Frame/DisposeStressTest/DisposeStressTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -77,13 +77,6 @@ this.setLayout (new BorderLayout ()); - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); }//End init() @@ -108,140 +101,3 @@ }// start() }// class DisposeStressTest - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Frame/DynamicLayout/DynamicLayout.java openjdk-11-11~24/test/jdk/java/awt/Frame/DynamicLayout/DynamicLayout.java --- openjdk-11-11~19/test/jdk/java/awt/Frame/DynamicLayout/DynamicLayout.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Frame/DynamicLayout/DynamicLayout.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,15 +56,6 @@ //*** Create instructions for the user here *** - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - // Turn off the dynamic layouting Toolkit.getDefaultToolkit().setDynamicLayout(false); System.out.println("isDynamicLayoutActive(): " + Toolkit.getDefaultToolkit().isDynamicLayoutActive()); @@ -207,8 +198,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -231,8 +222,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -253,184 +244,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test - class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { -//Counting events to see if we get enough -eventCount++; - -if( eventCount == 20 ) -{ -//got enough events, so pass - -DynamicLayout.pass(); -} -else if( tries == 20 ) -{ -//tried too many times without getting enough events so fail - -DynamicLayout.fail(); -} - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Frame/LayoutOnMaximizeTest/LayoutOnMaximizeTest.java openjdk-11-11~24/test/jdk/java/awt/Frame/LayoutOnMaximizeTest/LayoutOnMaximizeTest.java --- openjdk-11-11~19/test/jdk/java/awt/Frame/LayoutOnMaximizeTest/LayoutOnMaximizeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Frame/LayoutOnMaximizeTest/LayoutOnMaximizeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,20 +57,8 @@ private static void init() { - - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - // We must be sure that the Size system command is exactly the 3rd one in the System menu. - Sysout.println("NOTE: The test is known to work correctly with English MS Windows only."); + System.out.println("NOTE: The test is known to work correctly with English MS Windows only."); String s = Toolkit.getDefaultToolkit().getClass().getName(); @@ -240,8 +228,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -264,8 +252,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -286,184 +274,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test - class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { -//Counting events to see if we get enough -eventCount++; - -if( eventCount == 20 ) -{ -//got enough events, so pass - -LayoutOnMaximizeTest.pass(); -} -else if( tries == 20 ) -{ -//tried too many times without getting enough events so fail - -LayoutOnMaximizeTest.fail(); -} - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Frame/NonEDT_GUI_DeadlockTest/NonEDT_GUI_Deadlock.java openjdk-11-11~24/test/jdk/java/awt/Frame/NonEDT_GUI_DeadlockTest/NonEDT_GUI_Deadlock.java --- openjdk-11-11~19/test/jdk/java/awt/Frame/NonEDT_GUI_DeadlockTest/NonEDT_GUI_Deadlock.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Frame/NonEDT_GUI_DeadlockTest/NonEDT_GUI_Deadlock.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,19 +75,6 @@ public void init() { - //Create instructions for the user here, as well as set up - // the environment -- set the layout manager, add buttons, - // etc. - - - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - }//End init() public void start () @@ -109,10 +96,10 @@ } if( !bOK ) { // oops, - //Sysout.println("Deadlock!"); + //System.out.println("Deadlock!"); Runtime.getRuntime().halt(0); }else{ - //Sysout.println("Passed ok."); + //System.out.println("Passed ok."); } } }; @@ -183,141 +170,3 @@ }// class NonEDT_GUI_Deadlock - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Frame/ShownOffScreenOnWin98/ShownOffScreenOnWin98Test.java openjdk-11-11~24/test/jdk/java/awt/Frame/ShownOffScreenOnWin98/ShownOffScreenOnWin98Test.java --- openjdk-11-11~19/test/jdk/java/awt/Frame/ShownOffScreenOnWin98/ShownOffScreenOnWin98Test.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Frame/ShownOffScreenOnWin98/ShownOffScreenOnWin98Test.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,18 +52,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - boolean passed = false; try { @@ -178,8 +166,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -202,8 +190,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -224,184 +212,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - ShownOffScreenOnWin98Test.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - ShownOffScreenOnWin98Test.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java openjdk-11-11~24/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java --- openjdk-11-11~19/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Frame/UnfocusableMaximizedFrameResizablity/UnfocusableMaximizedFrameResizablity.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,7 +24,7 @@ /* @test @key headful - @bug 4980161 7158623 + @bug 4980161 7158623 8204860 @summary Setting focusable window state to false makes the maximized frame resizable @compile UnfocusableMaximizedFrameResizablity.java @run main UnfocusableMaximizedFrameResizablity @@ -36,29 +36,84 @@ import java.awt.AWTException; import java.awt.event.InputEvent; import java.awt.Robot; +import javax.swing.JFrame; +import javax.swing.SwingUtilities; public class UnfocusableMaximizedFrameResizablity { private static Frame frame; + private static JFrame jframe; private static Robot robot; private static boolean isProgInterruption = false; private static Thread mainThread = null; private static int sleepTime = 300000; - private static void createAndShowFrame() { + private static void createAndShowFrame() throws Exception { //The MAXIMIZED_BOTH state is not supported by the toolkit. Nothing to test. if (!Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)) { return; } - frame = new Frame("Unfocusable frame"); + //Case 1: Setting frame resizable to true followed by focusable to false + frame = createFrame("Resizable Unfocusable frame"); + frame.setResizable(true); + frame.setFocusableWindowState(false); + tryToResizeFrame(frame); + + //Case 2: Setting frame focusable to false followed by resizable to true + frame = createFrame("Unfocusable Resizable frame"); + frame.setFocusableWindowState(false); + frame.setResizable(true); + tryToResizeFrame(frame); + + //Case 3: Testing JFrame fullscreen behaviour only on Mac OS + if (System.getProperty("os.name").toLowerCase().startsWith("mac")) { + SwingUtilities.invokeAndWait(new Runnable() { + + Override + public void run() { + jframe = createJFrame("Unfocusable Resizable JFrame"); + jframe.setFocusableWindowState(false); + jframe.setResizable(true); + Object prop1 = jframe.getRootPane().getClientProperty("apple.awt.fullscreenable"); + jframe.setVisible(false); + jframe.setVisible(true); + Object prop2 = jframe.getRootPane().getClientProperty("apple.awt.fullscreenable"); + + if((prop1 != null && prop2 != null) && (!prop1.equals(prop2))) { + jframe.dispose(); + cleanup(); + throw new RuntimeException("Non-focusable resizable JFrame is fullscreenable!!"); + } + } + }); + } + + cleanup(); + } + + private static JFrame createJFrame(String title) { + JFrame jframe = new JFrame(title); + jframe.setMaximizedBounds(new Rectangle(0, 0, 300, 300)); + jframe.setSize(200, 200); + jframe.setVisible(true); + jframe.setExtendedState(Frame.MAXIMIZED_BOTH); + + return jframe; + } + + private static Frame createFrame(String title) { + Frame frame = new Frame(title); frame.setMaximizedBounds(new Rectangle(0, 0, 300, 300)); frame.setSize(200, 200); frame.setVisible(true); frame.setExtendedState(Frame.MAXIMIZED_BOTH); - frame.setFocusableWindowState(false); + return frame; + } + + private static void tryToResizeFrame(Frame frame) { try { robot = new Robot(); } catch (AWTException e) { @@ -89,16 +144,16 @@ cleanup(); throw new RuntimeException("The maximized unfocusable frame can be resized."); } - cleanup(); + + frame.dispose(); } private static void cleanup() { - frame.dispose(); isProgInterruption = true; mainThread.interrupt(); } - public static void main(String args[]) throws InterruptedException { + public static void main(String args[]) throws Exception { mainThread = Thread.currentThread(); diff -Nru openjdk-11-11~19/test/jdk/java/awt/grab/MenuDragEvents/MenuDragEvents.html openjdk-11-11~24/test/jdk/java/awt/grab/MenuDragEvents/MenuDragEvents.html --- openjdk-11-11~19/test/jdk/java/awt/grab/MenuDragEvents/MenuDragEvents.html 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/grab/MenuDragEvents/MenuDragEvents.html 1970-01-01 00:00:00.000000000 +0000 @@ -1,45 +0,0 @@ -<!-- - Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. - DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - - This code is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License version 2 only, as - published by the Free Software Foundation. - - 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. ---> - -<html> -<!-- - @test - @key headful - @bug 6390326 - @summary REGRESSION: Broken mouse behaviour of menus partially outside the main window. - @author oleg.sukhodolsky: area=awt-drab - @run applet MenuDragEvents.html - --> -<head> -<title> - - - -

MenuDragEvents
Bug ID: 6390326

- -

This is an AUTOMATIC test, simply wait for completion

- - - - - diff -Nru openjdk-11-11~19/test/jdk/java/awt/grab/MenuDragEvents/MenuDragEvents.java openjdk-11-11~24/test/jdk/java/awt/grab/MenuDragEvents/MenuDragEvents.java --- openjdk-11-11~19/test/jdk/java/awt/grab/MenuDragEvents/MenuDragEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/grab/MenuDragEvents/MenuDragEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,20 +21,13 @@ * questions. */ /* - test - @bug 6390326 + @test + @bug 6390326 8204946 + @key headful @summary REGRESSION: Broken mouse behaviour of menus partially outside the main window. - @author oleg.sukhodolsky: area=awt-drab - @run applet AutomaticAppletTest.html + @run main MenuDragEvents */ -/** - * MenuDragEvents.java - * - * summary: REGRESSION: Broken mouse behaviour of menus partially outside the main window. - */ - -import java.applet.Applet; import java.awt.AWTEvent; import java.awt.AWTException; import java.awt.BorderLayout; @@ -58,7 +51,7 @@ import javax.swing.event.MenuDragMouseEvent; import javax.swing.event.MenuDragMouseListener; -public class MenuDragEvents extends Applet +public class MenuDragEvents { //Declare things used in the test, like buttons and labels here boolean mouseDragged = false; @@ -66,22 +59,13 @@ boolean mouseReleased = false; boolean actionReceived = false; - public void init() - { - // Set up the environment -- set the layout manager, add - // buttons, etc. - - setLayout (new BorderLayout ()); - - }//End init() + public static void main(String[] args) { + MenuDragEvents test = new MenuDragEvents(); + test.doTest(); + } - public void start () + public void doTest () { - //Get things going. Request focus, set size, et cetera - setSize (200,200); - setVisible(true); - validate(); - Toolkit.getDefaultToolkit().addAWTEventListener(new AWTEventListener() { public void eventDispatched(AWTEvent event) { int id = event.getID(); @@ -130,6 +114,7 @@ }); JFrame frame = new JFrame("Menu"); + frame.setLayout (new BorderLayout ()); frame.setJMenuBar(mb); frame.setSize(200, 200); frame.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE); @@ -172,7 +157,10 @@ } System.out.println("Test passed"); - }// start() + + // dispose off the frame + frame.dispose(); + }// doTest() void dragMouse(Robot r, Point from, Point to) { final int n_step = 10; diff -Nru openjdk-11-11~19/test/jdk/java/awt/GridBagLayout/GridBagLayoutIpadXYTest/GridBagLayoutIpadXYTest.java openjdk-11-11~24/test/jdk/java/awt/GridBagLayout/GridBagLayoutIpadXYTest/GridBagLayoutIpadXYTest.java --- openjdk-11-11~19/test/jdk/java/awt/GridBagLayout/GridBagLayoutIpadXYTest/GridBagLayoutIpadXYTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/GridBagLayout/GridBagLayoutIpadXYTest/GridBagLayoutIpadXYTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -43,11 +43,6 @@ { this.setLayout (new BorderLayout ()); - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; }//End init() public void start () diff -Nru openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeForModalDialogTest/ConsumeForModalDialogTest.java openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeForModalDialogTest/ConsumeForModalDialogTest.java --- openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeForModalDialogTest/ConsumeForModalDialogTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeForModalDialogTest/ConsumeForModalDialogTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -59,16 +59,13 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is automatic test. Simply wait until it is done." - }); } public void start() { text.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { - Sysout.println(e.toString()); + System.out.println(e.toString()); passed = false; } }); @@ -116,7 +113,7 @@ robot.delay(200); } if (iter <= 0) { - Sysout.println("Test: the frame couldn't be focused!"); + System.out.println("Test: the frame couldn't be focused!"); return; } } @@ -136,146 +133,9 @@ robot.delay(1000); if (passed) { - Sysout.println("Test passed."); + System.out.println("Test passed."); } else { throw new RuntimeException("Test failed! Enexpected KeyTyped came into the JTextField."); } } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java --- openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/ConsumeNextMnemonicKeyTypedTest/ConsumeNextMnemonicKeyTypedTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,8 +62,6 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"Automatic test. Simply wait until it's done."}); } public void start() { @@ -98,7 +96,7 @@ robot.delay(200); } if (iter <= 0) { - Sysout.println("Test: text field couldn't be focused!"); + System.out.println("Test: text field couldn't be focused!"); return; } } @@ -140,7 +138,7 @@ robot.waitForIdle(); - Sysout.println("Test: character typed after mnemonic key press: " + text.getText()); + System.out.println("Test: character typed after mnemonic key press: " + text.getText()); if (!text.getText().equals(string)) { throw new RuntimeException("Test failed!"); @@ -158,143 +156,6 @@ throw new RuntimeException("Test failed!"); } - Sysout.println("Test passed."); + System.out.println("Test passed."); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/DefaultPolicyChange/DefaultPolicyChange_AWT.java openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/DefaultPolicyChange/DefaultPolicyChange_AWT.java --- openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/DefaultPolicyChange/DefaultPolicyChange_AWT.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/DefaultPolicyChange/DefaultPolicyChange_AWT.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,19 +49,19 @@ Window window = new Window(frame); FocusTraversalPolicy resultFTP = window.getFocusTraversalPolicy(); - Sysout.println("FocusTraversalPolicy on window = " + resultFTP); + System.out.println("FocusTraversalPolicy on window = " + resultFTP); /** * Note: this call doesn't affect already created components as they have * their policy initialized. Only new components will use this policy as * their default policy. **/ - Sysout.println("Now will set another policy."); + System.out.println("Now will set another policy."); currentKFM.setDefaultFocusTraversalPolicy(newFTP); resultFTP = window.getFocusTraversalPolicy(); if (!resultFTP.equals(defaultFTP)) { - Sysout.println("Failure! FocusTraversalPolicy should not change"); - Sysout.println("Was: " + defaultFTP); - Sysout.println("Become: " + resultFTP); + System.out.println("Failure! FocusTraversalPolicy should not change"); + System.out.println("Was: " + defaultFTP); + System.out.println("Become: " + resultFTP); throw new RuntimeException("Failure! FocusTraversalPolicy should not change"); } } diff -Nru openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.java openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.java --- openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/ButtonActionKeyTest/ButtonActionKeyTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -57,9 +57,6 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an automatic test. Simply wait until it is done." - }); } public void start() { @@ -71,7 +68,7 @@ button.getInputMap().put(KeyStroke.getKeyStroke("A"), "GO!"); button.getActionMap().put("GO!", new AbstractAction() { public void actionPerformed(ActionEvent e) { - Sysout.println("Action performed!"); + System.out.println("Action performed!"); text.requestFocusInWindow(); } }); @@ -79,7 +76,7 @@ text.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { if (e.getKeyChar() == 'a') { - Sysout.println(e.toString()); + System.out.println(e.toString()); synchronized (gotEvent) { gotEvent.set(true); gotEvent.notifyAll(); @@ -106,7 +103,7 @@ throw new TestFailedException("an action key went into the text field!"); } - Sysout.println("Test passed."); + System.out.println("Test passed."); } } @@ -115,140 +112,3 @@ super("Test failed: " + msg); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - -// setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java --- openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/EnqueueWithDialogButtonTest/EnqueueWithDialogButtonTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -235,141 +235,3 @@ } } }// class TestDialogTypeAhead - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.java openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.java --- openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/MenuItemActivatedTest/MenuItemActivatedTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -60,9 +60,6 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is an automatic test. Simply wait until it is done." - }); } public void start() { @@ -83,7 +80,7 @@ text.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { if (e.getKeyChar() == ' ') { - Sysout.println(e.toString()); + System.out.println(e.toString()); synchronized (gotEvent) { gotEvent.set(true); gotEvent.notifyAll(); @@ -115,7 +112,7 @@ throw new TestFailedException("a space went into the dialog's text field!"); } - Sysout.println("Test passed."); + System.out.println("Test passed."); } } @@ -124,140 +121,3 @@ super("Test failed: " + msg); } } - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - -// setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java --- openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/SubMenuShowTest/SubMenuShowTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -62,9 +62,6 @@ // the environment -- set the layout manager, add buttons, // etc. this.setLayout (new BorderLayout ()); - Sysout.createDialogWithInstructions(new String[] - {"This is a manual test. Simple wait until it is done." - }); } public void start() { @@ -78,7 +75,7 @@ item.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { - Sysout.println(e.toString()); + System.out.println(e.toString()); synchronized (activated) { activated.set(true); activated.notifyAll(); @@ -110,7 +107,7 @@ throw new TestFailedException("a submenu wasn't activated by mnemonic key press"); } - Sysout.println("Test passed."); + System.out.println("Test passed."); } } @@ -120,139 +117,3 @@ } } -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); -// dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - -// setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java --- openjdk-11-11~19/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/KeyboardFocusmanager/TypeAhead/TestDialogTypeAhead.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -291,140 +291,3 @@ } }// class TestDialogTypeAhead - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Menu/OpensWithNoGrab/OpensWithNoGrab.java openjdk-11-11~24/test/jdk/java/awt/Menu/OpensWithNoGrab/OpensWithNoGrab.java --- openjdk-11-11~19/test/jdk/java/awt/Menu/OpensWithNoGrab/OpensWithNoGrab.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Menu/OpensWithNoGrab/OpensWithNoGrab.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -46,15 +46,6 @@ final static int delay = 50; private static void init() { - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - if (!(OSInfo.getOSType().equals(OSInfo.OSType.LINUX) || OSInfo.getOSType().equals(OSInfo.OSType.SOLARIS))) { System.out.println("This test is for XAWT/Motif only"); @@ -205,8 +196,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -229,8 +220,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -251,184 +242,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - OpensWithNoGrab.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - OpensWithNoGrab.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - - class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java openjdk-11-11~24/test/jdk/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/AWT_Mixing/HierarchyBoundsListenerMixingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -434,14 +434,6 @@ //*** Create instructions for the user here *** //System.setProperty("sun.awt.disableMixing", "true"); - String[] instructions = { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog(); - Sysout.printInstructions(instructions); - HierarchyBoundsListenerMixingTest instance = new HierarchyBoundsListenerMixingTest(); instance.invoke(); @@ -499,8 +491,8 @@ } public static synchronized void pass() { - Sysout.println("The test passed."); - Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + System.out.println("The test passed."); + System.out.println("The test is over, hit Ctl-C to stop Java VM"); //first check if this is executing in main thread if (mainThread == Thread.currentThread()) { //Still in the main thread, so set the flag just for kicks, @@ -520,8 +512,8 @@ } public static synchronized void fail(String whyFailed) { - Sysout.println("The test failed: " + whyFailed); - Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + System.out.println("The test failed: " + whyFailed); + System.out.println("The test is over, hit Ctl-C to stop Java VM"); //check if this called from main thread if (mainThread == Thread.currentThread()) { //If main thread, fail now 'cause not sleeping @@ -535,158 +527,3 @@ }// class LWComboBox class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** -//************ Begin classes defined for the test **************** -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface -{ -static int newVar = 0; - -public void eventDispatched(AWTEvent e) -{ -//Counting events to see if we get enough -eventCount++; - -if( eventCount == 20 ) -{ -//got enough events, so pass - -LWComboBox.pass(); -} -else if( tries == 20 ) -{ -//tried too many times without getting enough events so fail - -LWComboBox.fail(); -} - -}// eventDispatched() - -}// NewClass class - - */ -//************** End classes defined for the test ******************* -/**************************************************** -Standard Test Machinery -DO NOT modify anything below -- it's a standard -chunk of code whose purpose is to make user -interaction uniform, and thereby make it simpler -to read and understand someone else's test. - ****************************************************/ -/** -This is part of the standard test machinery. -It creates a dialog (with the instructions), and is the interface -for sending text messages to the user. -To print the instructions, send an array of strings to Sysout.createDialog -WithInstructions method. Put one line of instructions per array entry. -To display a message for the tester to see, simply call Sysout.println -with the string to be displayed. -This mimics System.out.println but works within the test harness as well -as standalone. - */ -class Sysout { - - private static TestDialog dialog; - - public static void createDialogWithInstructions(String[] instructions) { - dialog = new TestDialog(new Frame(), "Instructions"); - dialog.printInstructions(instructions); - //dialog.setVisible(true); - println("Any messages for the tester will display here."); - } - - public static void createDialog() { - dialog = new TestDialog(new Frame(), "Instructions"); - String[] defInstr = {"Instructions will appear here. ", ""}; - dialog.printInstructions(defInstr); - //dialog.setVisible(true); - println("Any messages for the tester will display here."); - } - - public static void printInstructions(String[] instructions) { - dialog.printInstructions(instructions); - } - - public static void println(String messageIn) { - dialog.displayMessage(messageIn); - System.out.println(messageIn); - } -}// Sysout class - -/** -This is part of the standard test machinery. It provides a place for the -test instructions to be displayed, and a place for interactive messages -to the user to be displayed. -To have the test instructions displayed, see Sysout. -To have a message to the user be displayed, see Sysout. -Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog(Frame frame, String name) { - super(frame, name); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); - add("North", instructionsText); - - messageText = new TextArea("", 5, maxStringLength, scrollBoth); - add("Center", messageText); - - pack(); - - //setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions(String[] instructions) { - //Clear out any current instructions - instructionsText.setText(""); - - //Go down array of instruction strings - - String printStr, remainingStr; - for (int i = 0; i < instructions.length; i++) { - //chop up each into pieces maxSringLength long - remainingStr = instructions[i]; - while (remainingStr.length() > 0) { - //if longer than max then chop off first max chars to print - if (remainingStr.length() >= maxStringLength) { - //Try to chop on a word boundary - int posOfSpace = remainingStr.lastIndexOf(' ', maxStringLength - 1); - - if (posOfSpace <= 0) { - posOfSpace = maxStringLength - 1; - } - - printStr = remainingStr.substring(0, posOfSpace + 1); - remainingStr = remainingStr.substring(posOfSpace + 1); - } //else just print - else { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append(printStr + "\n"); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage(String messageIn) { - messageText.append(messageIn + "\n"); - System.out.println(messageIn); - } -}// TestDialog class - diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java openjdk-11-11~24/test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/AWT_Mixing/MixingPanelsResizing.java 2018-07-25 15:36:46.000000000 +0000 @@ -98,16 +98,8 @@ borderShift = frameBorderCounter(); borderShift = Math.abs(borderShift) == 1 ? borderShift : (borderShift / 2); - String[] instructions = { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; SwingUtilities.invokeAndWait(new Runnable() { public void run() { - Sysout.createDialog(); - Sysout.printInstructions(instructions); - // prepare controls frame = new JFrame(); @@ -273,8 +265,8 @@ } public static synchronized void pass() { - Sysout.println("The test passed."); - Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + System.out.println("The test passed."); + System.out.println("The test is over, hit Ctl-C to stop Java VM"); //first check if this is executing in main thread if (mainThread == Thread.currentThread()) { //Still in the main thread, so set the flag just for kicks, @@ -294,8 +286,8 @@ } public static synchronized void fail(String whyFailed) { - Sysout.println("The test failed: " + whyFailed); - Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + System.out.println("The test failed: " + whyFailed); + System.out.println("The test is over, hit Ctl-C to stop Java VM"); //check if this called from main thread if (mainThread == Thread.currentThread()) { //If main thread, fail now 'cause not sleeping @@ -309,158 +301,3 @@ }// class JButtonInGlassPane class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** -//************ Begin classes defined for the test **************** -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface -{ -static int newVar = 0; - -public void eventDispatched(AWTEvent e) -{ -//Counting events to see if we get enough -eventCount++; - -if( eventCount == 20 ) -{ -//got enough events, so pass - -JButtonInGlassPane.pass(); -} -else if( tries == 20 ) -{ -//tried too many times without getting enough events so fail - -JButtonInGlassPane.fail(); -} - -}// eventDispatched() - -}// NewClass class - - */ -//************** End classes defined for the test ******************* -/**************************************************** -Standard Test Machinery -DO NOT modify anything below -- it's a standard -chunk of code whose purpose is to make user -interaction uniform, and thereby make it simpler -to read and understand someone else's test. - ****************************************************/ -/** -This is part of the standard test machinery. -It creates a dialog (with the instructions), and is the interface -for sending text messages to the user. -To print the instructions, send an array of strings to Sysout.createDialog -WithInstructions method. Put one line of instructions per array entry. -To display a message for the tester to see, simply call Sysout.println -with the string to be displayed. -This mimics System.out.println but works within the test harness as well -as standalone. - */ -class Sysout { - - private static TestDialog dialog; - - public static void createDialogWithInstructions(String[] instructions) { - dialog = new TestDialog(new Frame(), "Instructions"); - dialog.printInstructions(instructions); - //dialog.setVisible(true); - println("Any messages for the tester will display here."); - } - - public static void createDialog() { - dialog = new TestDialog(new Frame(), "Instructions"); - String[] defInstr = {"Instructions will appear here. ", ""}; - dialog.printInstructions(defInstr); - //dialog.setVisible(true); - println("Any messages for the tester will display here."); - } - - public static void printInstructions(String[] instructions) { - dialog.printInstructions(instructions); - } - - public static void println(String messageIn) { - dialog.displayMessage(messageIn); - System.out.println(messageIn); - } -}// Sysout class - -/** -This is part of the standard test machinery. It provides a place for the -test instructions to be displayed, and a place for interactive messages -to the user to be displayed. -To have the test instructions displayed, see Sysout. -To have a message to the user be displayed, see Sysout. -Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog(Frame frame, String name) { - super(frame, name); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); - add("North", instructionsText); - - messageText = new TextArea("", 5, maxStringLength, scrollBoth); - add("Center", messageText); - - pack(); - - //setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions(String[] instructions) { - //Clear out any current instructions - instructionsText.setText(""); - - //Go down array of instruction strings - - String printStr, remainingStr; - for (int i = 0; i < instructions.length; i++) { - //chop up each into pieces maxSringLength long - remainingStr = instructions[i]; - while (remainingStr.length() > 0) { - //if longer than max then chop off first max chars to print - if (remainingStr.length() >= maxStringLength) { - //Try to chop on a word boundary - int posOfSpace = remainingStr.lastIndexOf(' ', maxStringLength - 1); - - if (posOfSpace <= 0) { - posOfSpace = maxStringLength - 1; - } - - printStr = remainingStr.substring(0, posOfSpace + 1); - remainingStr = remainingStr.substring(posOfSpace + 1); - } //else just print - else { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append(printStr + "\n"); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage(String messageIn) { - messageText.append(messageIn + "\n"); - System.out.println(messageIn); - } -}// TestDialog class - diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java openjdk-11-11~24/test/jdk/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/AWT_Mixing/OverlappingTestBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -550,17 +550,8 @@ * classes ******************************************************/ private static void init() throws InterruptedException { - //*** Create instructions for the user here *** //System.setProperty("sun.awt.disableMixing", "true"); - String[] instructions = { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog(); - Sysout.printInstructions(instructions); - instance.testAwtControls(); if (wasHWClicked) { @@ -634,8 +625,8 @@ * Set test as passed. Usually shoudn't be called directly. */ public static synchronized void pass() { - Sysout.println("The test passed."); - Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + System.out.println("The test passed."); + System.out.println("The test is over, hit Ctl-C to stop Java VM"); //first check if this is executing in main thread if (mainThread == Thread.currentThread()) { //Still in the main thread, so set the flag just for kicks, @@ -662,8 +653,8 @@ * @param whyFailed reason */ public static synchronized void fail(String whyFailed) { - Sysout.println("The test failed: " + whyFailed); - Sysout.println("The test is over, hit Ctl-C to stop Java VM"); + System.out.println("The test failed: " + whyFailed); + System.out.println("The test is over, hit Ctl-C to stop Java VM"); //check if this called from main thread if (mainThread == Thread.currentThread()) { //If main thread, fail now 'cause not sleeping @@ -677,156 +668,3 @@ }// class LWComboBox class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** -//************ Begin classes defined for the test **************** -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface -{ -static int newVar = 0; - -public void eventDispatched(AWTEvent e) -{ -//Counting events to see if we get enough -eventCount++; - -if( eventCount == 20 ) -{ -//got enough events, so pass - -LWComboBox.pass(); -} -else if( tries == 20 ) -{ -//tried too many times without getting enough events so fail - -LWComboBox.fail(); -} - -}// eventDispatched() - -}// NewClass class - - */ -//************** End classes defined for the test ******************* -/**************************************************** -Standard Test Machinery -DO NOT modify anything below -- it's a standard -chunk of code whose purpose is to make user -interaction uniform, and thereby make it simpler -to read and understand someone else's test. - ****************************************************/ -/** -This is part of the standard test machinery. -It creates a dialog (with the instructions), and is the interface -for sending text messages to the user. -To print the instructions, send an array of strings to Sysout.createDialog -WithInstructions method. Put one line of instructions per array entry. -To display a message for the tester to see, simply call Sysout.println -with the string to be displayed. -This mimics System.out.println but works within the test harness as well -as standalone. - */ -class Sysout { - private static TestDialog dialog; - - public static void createDialogWithInstructions(String[] instructions) { - dialog = new TestDialog(new Frame(), "Instructions"); - dialog.printInstructions(instructions); - //dialog.setVisible(true); - println("Any messages for the tester will display here."); - } - - public static void createDialog() { - dialog = new TestDialog(new Frame(), "Instructions"); - String[] defInstr = {"Instructions will appear here. ", ""}; - dialog.printInstructions(defInstr); - //dialog.setVisible(true); - println("Any messages for the tester will display here."); - } - - public static void printInstructions(String[] instructions) { - dialog.printInstructions(instructions); - } - - public static void println(String messageIn) { - dialog.displayMessage(messageIn); - System.out.println(messageIn); - } -}// Sysout class - -/** -This is part of the standard test machinery. It provides a place for the -test instructions to be displayed, and a place for interactive messages -to the user to be displayed. -To have the test instructions displayed, see Sysout. -To have a message to the user be displayed, see Sysout. -Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog { - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog(Frame frame, String name) { - super(frame, name); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea("", 15, maxStringLength, scrollBoth); - add("North", instructionsText); - - messageText = new TextArea("", 5, maxStringLength, scrollBoth); - add("Center", messageText); - - pack(); - - //setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions(String[] instructions) { - //Clear out any current instructions - instructionsText.setText(""); - - //Go down array of instruction strings - - String printStr, remainingStr; - for (int i = 0; i < instructions.length; i++) { - //chop up each into pieces maxSringLength long - remainingStr = instructions[i]; - while (remainingStr.length() > 0) { - //if longer than max then chop off first max chars to print - if (remainingStr.length() >= maxStringLength) { - //Try to chop on a word boundary - int posOfSpace = remainingStr.lastIndexOf(' ', maxStringLength - 1); - - if (posOfSpace <= 0) { - posOfSpace = maxStringLength - 1; - } - - printStr = remainingStr.substring(0, posOfSpace + 1); - remainingStr = remainingStr.substring(posOfSpace + 1); - } //else just print - else { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append(printStr + "\n"); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage(String messageIn) { - messageText.append(messageIn + "\n"); - System.out.println(messageIn); - } -}// TestDialog class - diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/HWDisappear.java openjdk-11-11~24/test/jdk/java/awt/Mixing/HWDisappear.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/HWDisappear.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/HWDisappear.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,17 +51,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - // Create the frame and the button JFrame f = new JFrame(); @@ -200,8 +189,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -224,8 +213,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -246,184 +235,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - HWDisappear.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - HWDisappear.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/JButtonInGlassPane.java openjdk-11-11~24/test/jdk/java/awt/Mixing/JButtonInGlassPane.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/JButtonInGlassPane.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/JButtonInGlassPane.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,17 +52,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - JFrame frame = new JFrame("Glass Pane children test"); frame.setLayout(null); @@ -200,8 +189,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -224,8 +213,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -246,184 +235,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - JButtonInGlassPane.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - JButtonInGlassPane.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/LWComboBox.java openjdk-11-11~24/test/jdk/java/awt/Mixing/LWComboBox.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/LWComboBox.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/LWComboBox.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,17 +53,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - JFrame f = new JFrame("LW menu test"); JComboBox ch; @@ -195,8 +184,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -219,8 +208,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -241,184 +230,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - LWComboBox.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - LWComboBox.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/LWPopupMenu.java openjdk-11-11~24/test/jdk/java/awt/Mixing/LWPopupMenu.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/LWPopupMenu.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/LWPopupMenu.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -55,17 +55,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - JFrame f = new JFrame("LW menu test"); JMenuBar menubar = new JMenuBar(); @@ -202,8 +191,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -226,8 +215,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -248,184 +237,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - LWPopupMenu.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - LWPopupMenu.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/MixingInHwPanel.java openjdk-11-11~24/test/jdk/java/awt/Mixing/MixingInHwPanel.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/MixingInHwPanel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/MixingInHwPanel.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -52,17 +52,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - // Create the components: frame -> hwPanel -> JDesktopPane -> // -> JInternalFrame -> hwButton Frame frame = new Frame("Mixing in a heavyweight Panel"); @@ -198,8 +187,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -222,8 +211,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -244,184 +233,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - MixingInHwPanel.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - MixingInHwPanel.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/MixingOnDialog.java openjdk-11-11~24/test/jdk/java/awt/Mixing/MixingOnDialog.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/MixingOnDialog.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/MixingOnDialog.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,18 +53,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - // Create components final Dialog d = new Dialog((Frame)null, "Button-JButton mix test"); final Button heavy = new Button(" Heavyweight Button "); @@ -198,8 +186,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -222,8 +210,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -244,184 +232,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - MixingOnDialog.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - MixingOnDialog.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/MixingOnShrinkingHWButton.java openjdk-11-11~24/test/jdk/java/awt/Mixing/MixingOnShrinkingHWButton.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/MixingOnShrinkingHWButton.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/MixingOnShrinkingHWButton.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -54,18 +54,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - // Create components final Dialog d = new Dialog((Frame)null, "Button-JButton mix test"); final Button heavy = new Button(" Heavyweight Button "); @@ -199,8 +187,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -223,8 +211,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -245,184 +233,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - MixingOnDialog.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - MixingOnDialog.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/NonOpaqueInternalFrame.java openjdk-11-11~24/test/jdk/java/awt/Mixing/NonOpaqueInternalFrame.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/NonOpaqueInternalFrame.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/NonOpaqueInternalFrame.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,16 +67,6 @@ private static void init() { - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - // Create a frame with two non-opaque JInternalFrame's containing // heavyweight buttons. JFrame jframe = new JFrame("mixing test"); @@ -204,8 +194,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -228,8 +218,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -250,184 +240,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - NonOpaqueInternalFrame.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - NonOpaqueInternalFrame.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/OpaqueTest.java openjdk-11-11~24/test/jdk/java/awt/Mixing/OpaqueTest.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/OpaqueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/OpaqueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -56,18 +56,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - // Create components final Frame f = new Frame("Button-JButton mix test"); final Panel p = new Panel(); @@ -220,8 +208,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -244,8 +232,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -266,184 +254,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - OpaqueTest.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - OpaqueTest.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/OverlappingButtons.java openjdk-11-11~24/test/jdk/java/awt/Mixing/OverlappingButtons.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/OverlappingButtons.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/OverlappingButtons.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,16 +58,6 @@ { //*** Create instructions for the user here *** - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - // Create components final Frame f = new Frame("Button-JButton mix test"); final Panel p = new Panel(); @@ -211,8 +201,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -235,8 +225,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -257,184 +247,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - OverlappingButtons.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - OverlappingButtons.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/setComponentZOrder.java openjdk-11-11~24/test/jdk/java/awt/Mixing/setComponentZOrder.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/setComponentZOrder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/setComponentZOrder.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,17 +48,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - try { Container c = new Container(); Button b = new Button("b"); @@ -147,8 +136,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -171,8 +160,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -193,184 +182,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - setComponentZOrder.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - setComponentZOrder.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/Validating.java openjdk-11-11~24/test/jdk/java/awt/Mixing/Validating.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/Validating.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/Validating.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,17 +48,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - if (!Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)) { System.out.println("The test environment does not support maximization. The test cannot be performed."); pass(); @@ -177,8 +166,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -201,8 +190,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -223,184 +212,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - Validating.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - Validating.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Mixing/ValidBounds.java openjdk-11-11~24/test/jdk/java/awt/Mixing/ValidBounds.java --- openjdk-11-11~19/test/jdk/java/awt/Mixing/ValidBounds.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Mixing/ValidBounds.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,18 +49,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - // Create the frame and the button Frame f = new Frame(); f.setBounds(100, 100, 400, 300); @@ -183,8 +171,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -207,8 +195,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -229,184 +217,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - ValidBounds.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - ValidBounds.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/MouseAdapter/MouseAdapterUnitTest/MouseAdapterUnitTest.java openjdk-11-11~24/test/jdk/java/awt/MouseAdapter/MouseAdapterUnitTest/MouseAdapterUnitTest.java --- openjdk-11-11~19/test/jdk/java/awt/MouseAdapter/MouseAdapterUnitTest/MouseAdapterUnitTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/MouseAdapter/MouseAdapterUnitTest/MouseAdapterUnitTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -53,15 +53,6 @@ private static void init() { - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - MouseAdapter ma = new MouseAdapter(){ public void mouseClicked(MouseEvent e) {clicked = true;} @@ -280,8 +271,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -304,8 +295,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -326,184 +317,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - MouseAdapterUnitTest.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - MouseAdapterUnitTest.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/print/PageFormat/NullPaper.java openjdk-11-11~24/test/jdk/java/awt/print/PageFormat/NullPaper.java --- openjdk-11-11~19/test/jdk/java/awt/print/PageFormat/NullPaper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/print/PageFormat/NullPaper.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -58,20 +58,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This test should throw a NullPointerException. ", - "If the NullPointerException is correctly thrown ", - "by the call to setPaper() then the test succeeds. ", - "If no exception is thrown by setPaper() or if an ", - "exception other than NullPointerException is thrown ", - "then the test fails." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - boolean settingNullWorked = false; try { @@ -167,8 +153,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -193,8 +179,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -215,210 +201,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// make listeners in a class defined here, and instantiate them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - NullPaper.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - NullPaper.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog implements ActionListener - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - Panel buttonP = new Panel(); - Button passB = new Button( "pass" ); - Button failB = new Button( "fail" ); - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - passB = new Button( "pass" ); - passB.setActionCommand( "pass" ); - passB.addActionListener( this ); - buttonP.add( "East", passB ); - - failB = new Button( "fail" ); - failB.setActionCommand( "fail" ); - failB.addActionListener( this ); - buttonP.add( "West", failB ); - - add( "South", buttonP ); - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - //catch presses of the passed and failed buttons. - //simply call the standard pass() or fail() static methods of - //NullPaper - public void actionPerformed( ActionEvent e ) - { - if( e.getActionCommand() == "pass" ) - { - NullPaper.pass(); - } - else - { - NullPaper.fail(); - } - } - - }// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java openjdk-11-11~24/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java --- openjdk-11-11~19/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/print/RemotePrinterStatusRefresh/RemotePrinterStatusRefresh.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,264 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8153732 + * @requires (os.family == "Windows") + * @summary Windows remote printer changes do not reflect in lookupPrintServices() + * @ignore Requires a new network printer installation\removal + * @run main/manual RemotePrinterStatusRefresh + */ + +import java.awt.GridBagConstraints; +import java.awt.GridBagLayout; +import java.awt.event.ActionEvent; +import java.awt.print.PageFormat; +import java.awt.print.Paper; +import java.awt.print.PrinterException; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; +import javax.swing.BorderFactory; +import javax.swing.Box; +import javax.swing.JButton; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JPanel; +import javax.swing.JTextArea; +import javax.swing.SwingUtilities; +import java.awt.print.PrinterJob; +import javax.print.PrintService; + +public class RemotePrinterStatusRefresh +{ + private static TestUI test = null; + public static void main(String args[]) throws Exception { + final CountDownLatch latch = new CountDownLatch(1); + + // Test UI creation + test = new TestUI(latch); + + SwingUtilities.invokeAndWait(new Runnable() { + @Override + public void run() { + try { + test.createUI(); + } catch (Exception e) { + throw new RuntimeException(e); + } + } + }); + + // RemotePrinterStatusRefresh creation + RemotePrinterStatusRefresh RemotePrinterStatusRefresh = new RemotePrinterStatusRefresh(); + SwingUtilities.invokeAndWait(() -> { + collectPrintersList(test.resultsTextArea, true); + }); + + // 8 min = 480000 msec + if(waitForFlag(480000)) { + SwingUtilities.invokeAndWait(() -> { + collectPrintersList(test.resultsTextArea, false); + }); + } else { + dispose(); + throw new RuntimeException("No new network printer got added/removed!! Test timed out!!"); + } + + boolean status = latch.await(1, TimeUnit.MINUTES); + if (!status) { + dispose(); + throw new RuntimeException("Test timed out."); + } + + if (test.testResult == false) { + dispose(); + throw new RuntimeException("Test Failed."); + } + + dispose(); + } + + public static void dispose() throws Exception { + SwingUtilities.invokeAndWait(() -> { + test.disposeUI(); + }); + } + + public static boolean waitForFlag (long maxTimeoutInMsec) throws Exception { + while(!test.isAdded && maxTimeoutInMsec > 0) { + maxTimeoutInMsec -= 100; + Thread.sleep(100); + } + + if(maxTimeoutInMsec <= 0) { + return false; + } else { + return true; + } + } + + private static void collectPrintersList(JTextArea textArea, boolean before) { + if(before) { + System.out.println("List of printers(before): "); + textArea.setText("List of printers(before): \n"); + for (PrintService printServiceBefore : PrinterJob.lookupPrintServices()) { + System.out.println(printServiceBefore); + textArea.append(printServiceBefore.toString()); + textArea.append("\n"); + } + } else { + textArea.append("\n"); + System.out.println("List of printers(after): "); + textArea.append("List of printers(after): \n"); + for (PrintService printServiceAfter : PrinterJob.lookupPrintServices()) { + System.out.println(printServiceAfter); + textArea.append(printServiceAfter.toString()); + textArea.append("\n"); + } + } + } +} + +class TestUI { + private static JFrame mainFrame; + private static JPanel mainControlPanel; + + private static JTextArea instructionTextArea; + + private static JPanel resultButtonPanel; + private static JButton passButton; + private static JButton failButton; + private static JButton addedButton; + + private static JPanel testPanel; + private static JButton testButton; + private static JLabel buttonPressCountLabel; + + private static GridBagLayout layout; + private final CountDownLatch latch; + public boolean testResult = false; + public volatile Boolean isAdded = false; + public static JTextArea resultsTextArea; + + public TestUI(CountDownLatch latch) throws Exception { + this.latch = latch; + } + + public final void createUI() { + mainFrame = new JFrame("RemotePrinterStatusRefresh"); + layout = new GridBagLayout(); + mainControlPanel = new JPanel(layout); + resultButtonPanel = new JPanel(layout); + testPanel = new JPanel(layout); + GridBagConstraints gbc = new GridBagConstraints(); + + // Create Test instructions + String instructions + = "This test displays the current list of printers(before) attached to \n" + + "this computer in the results panel.\n\n" + + "Please follow the below steps for this manual test\n" + + "--------------------------------------------------------------------\n" + + "Step 1: Add/Remove a new network printer and Wait for 4 minutes after adding/removing\n" + + "Step 2: Then click on 'Printer Added/Removed' button\n" + + "Step 2: Once the new network printer is added/removed, see if it is \n" + + " the same as displayed/not displayed in the results panel.\n" + + "Step 3: If displayed/not displayed, then click 'Pass' else click on 'Fail' button"; + + instructionTextArea = new JTextArea(); + instructionTextArea.setText(instructions); + instructionTextArea.setEditable(false); + instructionTextArea.setBorder(BorderFactory. + createTitledBorder("Test Instructions")); + + gbc.gridx = 0; + gbc.gridy = 0; + gbc.fill = GridBagConstraints.HORIZONTAL; + mainControlPanel.add(instructionTextArea, gbc); + + gbc.gridx = 0; + gbc.gridy = 1; + testPanel.add(Box.createVerticalStrut(50)); + mainControlPanel.add(testPanel); + + addedButton = new JButton("Printer Added/Removed"); + addedButton.setActionCommand("Added"); + addedButton.addActionListener((ActionEvent e) -> { + System.out.println("Added Button pressed!"); + isAdded = true; + }); + + // Create resultButtonPanel with Pass, Fail buttons + passButton = new JButton("Pass"); + passButton.setActionCommand("Pass"); + passButton.addActionListener((ActionEvent e) -> { + System.out.println("Pass Button pressed!"); + testResult = true; + latch.countDown(); + disposeUI(); + }); + + failButton = new JButton("Fail"); + failButton.setActionCommand("Fail"); + failButton.addActionListener((ActionEvent e) -> { + System.out.println("Fail Button pressed!"); + testResult = false; + latch.countDown(); + disposeUI(); + }); + + gbc.gridx = 0; + gbc.gridy = 0; + resultButtonPanel.add(addedButton, gbc); + + gbc.gridx = 1; + gbc.gridy = 0; + resultButtonPanel.add(passButton, gbc); + + gbc.gridx = 2; + gbc.gridy = 0; + resultButtonPanel.add(failButton, gbc); + + resultsTextArea = new JTextArea(); + resultsTextArea.setEditable(false); + resultsTextArea.setBorder(BorderFactory. + createTitledBorder("Results")); + + gbc.gridx = 0; + gbc.gridy = 1; + gbc.fill = GridBagConstraints.HORIZONTAL; + mainControlPanel.add(resultsTextArea, gbc); + + gbc.gridx = 0; + gbc.gridy = 2; + mainControlPanel.add(resultButtonPanel, gbc); + + mainFrame.add(mainControlPanel); + mainFrame.pack(); + mainFrame.setVisible(true); + } + + public void disposeUI() { + mainFrame.dispose(); + } +} diff -Nru openjdk-11-11~19/test/jdk/java/awt/Toolkit/Headless/AWTEventListener/AWTListener.java openjdk-11-11~24/test/jdk/java/awt/Toolkit/Headless/AWTEventListener/AWTListener.java --- openjdk-11-11~19/test/jdk/java/awt/Toolkit/Headless/AWTEventListener/AWTListener.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Toolkit/Headless/AWTEventListener/AWTListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,11 +48,11 @@ public void eventDispatched(AWTEvent event) { } }; - Sysout.println("Test: listener to add = " +orig); + System.out.println("Test: listener to add = " +orig); toolkit.addAWTEventListener(orig, AWTEvent.CONTAINER_EVENT_MASK); for (AWTEventListener l: toolkit.getAWTEventListeners()){ - Sysout.println("Test: listener = " +l+" "); + System.out.println("Test: listener = " +l+" "); } if ( toolkit.getAWTEventListeners().length == 0 ) { @@ -60,12 +60,12 @@ } for (AWTEventListener l: toolkit.getAWTEventListeners(AWTEvent.CONTAINER_EVENT_MASK)){ - Sysout.println("Test: listener = " +l); + System.out.println("Test: listener = " +l); } if ( toolkit.getAWTEventListeners(AWTEvent.CONTAINER_EVENT_MASK).length == 0 ) { throw new RuntimeException("Case 2. An empty array returned unexpectedly"); } - Sysout.println("Test PASSED"); + System.out.println("Test PASSED"); } } diff -Nru openjdk-11-11~19/test/jdk/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJobHeadless.java openjdk-11-11~24/test/jdk/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJobHeadless.java --- openjdk-11-11~19/test/jdk/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJobHeadless.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJobHeadless.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -50,7 +50,7 @@ } catch (NullPointerException e) { stage1Passed = true; e.printStackTrace(); - Sysout.println("Stage 1 passed. getPrintJob(null, String, property) has thrown NPE."); + System.out.println("Stage 1 passed. getPrintJob(null, String, property) has thrown NPE."); } if (!stage1Passed) { throw new RuntimeException("getPrintJob() should have thrown NPE but didn't."); @@ -62,12 +62,12 @@ } catch (NullPointerException e) { stage2Passed = true; e.printStackTrace(); - Sysout.println("Stage 2 passed. getPrintJob(null, String, jobAttrs, pageAttr) has thrown NPE."); + System.out.println("Stage 2 passed. getPrintJob(null, String, jobAttrs, pageAttr) has thrown NPE."); } if (!stage2Passed) { throw new RuntimeException("getPrintJob() should have thrown NPE but didn't."); } - Sysout.println("Test PASSED"); + System.out.println("Test PASSED"); } } diff -Nru openjdk-11-11~19/test/jdk/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java openjdk-11-11~24/test/jdk/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java --- openjdk-11-11~19/test/jdk/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Toolkit/Headless/GetPrintJob/GetPrintJob.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -49,7 +49,7 @@ (Frame) null, "title", new Properties()); } catch (NullPointerException e) { stage1Passed = true; - Sysout.println("Stage 1 passed. getPrintJob(null, String, property) has thrown NPE."); + System.out.println("Stage 1 passed. getPrintJob(null, String, property) has thrown NPE."); } if (!stage1Passed) { throw new RuntimeException("getPrintJob() should have thrown NPE but didn't."); @@ -60,12 +60,12 @@ (Frame) null, "title", new JobAttributes(), new PageAttributes()); } catch (NullPointerException e) { stage2Passed = true; - Sysout.println("Stage 2 passed. getPrintJob(null, String, jobAttrs, pageAttr) has thrown NPE."); + System.out.println("Stage 2 passed. getPrintJob(null, String, jobAttrs, pageAttr) has thrown NPE."); } if (!stage2Passed) { throw new RuntimeException("getPrintJob() should have thrown NPE but didn't."); } - Sysout.println("Test PASSED"); + System.out.println("Test PASSED"); } } diff -Nru openjdk-11-11~19/test/jdk/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh openjdk-11-11~24/test/jdk/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh --- openjdk-11-11~19/test/jdk/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Toolkit/Headless/WrappedToolkitTest/WrappedToolkitTest.sh 2018-07-25 15:36:46.000000000 +0000 @@ -122,7 +122,7 @@ fi ;; - SunOS | Linux ) + AIX | Linux | SunOS ) ${COMPILEJAVA}/bin/javac ${TESTJAVACOPTS} \ --add-exports java.desktop/sun.awt=ALL-UNNAMED \ --add-exports java.desktop/sun.awt.X11=ALL-UNNAMED ${CP} \ diff -Nru openjdk-11-11~19/test/jdk/java/awt/Toolkit/RealSync/RealSyncOnEDT.java openjdk-11-11~24/test/jdk/java/awt/Toolkit/RealSync/RealSyncOnEDT.java --- openjdk-11-11~19/test/jdk/java/awt/Toolkit/RealSync/RealSyncOnEDT.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Toolkit/RealSync/RealSyncOnEDT.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -48,16 +48,6 @@ private static void init() { - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - - // Try to invoke the realSync() on the EDT try { EventQueue.invokeAndWait(new Runnable() { @@ -172,8 +162,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -196,8 +186,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -218,184 +208,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - RealSyncOnEDT.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - RealSyncOnEDT.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Window/AlwaysOnTop/TestAlwaysOnTopBeforeShow.java openjdk-11-11~24/test/jdk/java/awt/Window/AlwaysOnTop/TestAlwaysOnTopBeforeShow.java --- openjdk-11-11~19/test/jdk/java/awt/Window/AlwaysOnTop/TestAlwaysOnTopBeforeShow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Window/AlwaysOnTop/TestAlwaysOnTopBeforeShow.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2014, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -248,8 +248,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -272,8 +272,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -294,183 +294,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - TestAlwaysOnTopBeforeShow.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - TestAlwaysOnTopBeforeShow.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Window/GrabSequence/GrabSequence.java openjdk-11-11~24/test/jdk/java/awt/Window/GrabSequence/GrabSequence.java --- openjdk-11-11~19/test/jdk/java/awt/Window/GrabSequence/GrabSequence.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Window/GrabSequence/GrabSequence.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2005, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,7 +45,6 @@ System.out.println("This test is for XToolkit and WToolkit only. Now using " + toolkit + ". Automatically passed."); return; } - Sysout.createDialog(); Frame frame = new Frame("Frame"); frame.setBackground(Color.green); frame.setForeground(Color.green); @@ -205,8 +204,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -229,8 +228,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -251,184 +250,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - AutomaticMainTest.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - AutomaticMainTest.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/awt/Window/PropertyChangeListenerLockSerialization/PropertyChangeListenerLockSerialization.java openjdk-11-11~24/test/jdk/java/awt/Window/PropertyChangeListenerLockSerialization/PropertyChangeListenerLockSerialization.java --- openjdk-11-11~19/test/jdk/java/awt/Window/PropertyChangeListenerLockSerialization/PropertyChangeListenerLockSerialization.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/awt/Window/PropertyChangeListenerLockSerialization/PropertyChangeListenerLockSerialization.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2008, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -47,17 +47,6 @@ private static void init() { - //*** Create instructions for the user here *** - - String[] instructions = - { - "This is an AUTOMATIC test, simply wait until it is done.", - "The result (passed or failed) will be shown in the", - "message window below." - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - File file = new File(System.getProperty("test.classes", "."), "frame.ser"); @@ -174,8 +163,8 @@ public static synchronized void pass() { - Sysout.println( "The test passed." ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test passed." ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //first check if this is executing in main thread if ( mainThread == Thread.currentThread() ) { @@ -198,8 +187,8 @@ public static synchronized void fail( String whyFailed ) { - Sysout.println( "The test failed: " + whyFailed ); - Sysout.println( "The test is over, hit Ctl-C to stop Java VM" ); + System.out.println( "The test failed: " + whyFailed ); + System.out.println( "The test is over, hit Ctl-C to stop Java VM" ); //check if this called from main thread if ( mainThread == Thread.currentThread() ) { @@ -220,184 +209,3 @@ class TestPassedException extends RuntimeException { } - -//*********** End Standard Test Machinery Section ********** - - -//************ Begin classes defined for the test **************** - -// if want to make listeners, here is the recommended place for them, then instantiate -// them in init() - -/* Example of a class which may be written as part of a test -class NewClass implements anInterface - { - static int newVar = 0; - - public void eventDispatched(AWTEvent e) - { - //Counting events to see if we get enough - eventCount++; - - if( eventCount == 20 ) - { - //got enough events, so pass - - PropertyChangeListenerLockSerialization.pass(); - } - else if( tries == 20 ) - { - //tried too many times without getting enough events so fail - - PropertyChangeListenerLockSerialization.fail(); - } - - }// eventDispatched() - - }// NewClass class - -*/ - - -//************** End classes defined for the test ******************* - - - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout -{ - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.setVisible(true); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - System.out.println(messageIn); - } - -}// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog -{ - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("Center", messageText); - - pack(); - - setVisible(true); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - System.out.println(messageIn); - } - -}// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/java/beans/Beans/TypoInBeanDescription.java openjdk-11-11~24/test/jdk/java/beans/Beans/TypoInBeanDescription.java --- openjdk-11-11~19/test/jdk/java/beans/Beans/TypoInBeanDescription.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/beans/Beans/TypoInBeanDescription.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.beans.BeanInfo; +import java.beans.IntrospectionException; +import java.beans.Introspector; +import java.io.IOException; +import java.net.URI; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; + +/** + * @test + * @bug 8205454 + */ +public final class TypoInBeanDescription { + + private static final String[] typos = {"&", "<", ">", """}; + + public static void main(final String[] args) throws IOException { + FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/")); + Files.walkFileTree(fs.getPath("/modules/java.desktop"), new SimpleFileVisitor<>() { + @Override + public FileVisitResult visitFile(Path file, + BasicFileAttributes attrs) { + file = file.subpath(2, file.getNameCount()); + String name = file.toString(); + if (name.endsWith(".class")) { + name = name.substring(0, name.indexOf(".")).replace('/', '.'); + + final Class type; + try { + type = Class.forName(name); + } catch (Throwable e) { + return FileVisitResult.CONTINUE; + } + final BeanInfo beanInfo; + try { + beanInfo = Introspector.getBeanInfo(type); + } catch (IntrospectionException e) { + return FileVisitResult.CONTINUE; + } + test(beanInfo); + } + return FileVisitResult.CONTINUE; + } + }); + } + + private static void test(final BeanInfo beanInfo) { + for (var pd : beanInfo.getPropertyDescriptors()) { + String d = pd.getShortDescription(); + String n = pd.getName(); + String dn = pd.getDisplayName(); + for (String typo : typos) { + if (d.contains(typo) || n.contains(typo) || dn.contains(typo)) { + throw new RuntimeException("Wrong name: " + beanInfo.getBeanDescriptor()); + } + } + } + } +} diff -Nru openjdk-11-11~19/test/jdk/java/io/FileInputStream/UnreferencedFISClosesFd.java openjdk-11-11~24/test/jdk/java/io/FileInputStream/UnreferencedFISClosesFd.java --- openjdk-11-11~19/test/jdk/java/io/FileInputStream/UnreferencedFISClosesFd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/io/FileInputStream/UnreferencedFISClosesFd.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,8 @@ * * @test * @modules java.base/java.io:open + * @library /test/lib + * @build jdk.test.lib.util.FileUtils UnreferencedFISClosesFd * @bug 6524062 * @summary Test to ensure that FIS.finalize() invokes the close() method as per * the specification. @@ -41,18 +43,15 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.lang.reflect.Field; -import java.nio.file.Files; import java.nio.file.Path; -import java.nio.file.Paths; import java.util.ArrayDeque; import java.util.HashSet; -import java.util.List; -import java.util.Optional; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import com.sun.management.UnixOperatingSystemMXBean; +import jdk.test.lib.util.FileUtils; + /** * Tests for FIS unreferenced. * - Not subclassed - cleaner cleanup @@ -146,8 +145,8 @@ String name = inFile.getPath(); + FileUtils.listFileDescriptors(System.out); long fdCount0 = getFdCount(); - System.out.printf("initial count of open file descriptors: %d%n", fdCount0); int failCount = 0; failCount += test(new FileInputStream(name), CleanupType.CLEANER); @@ -166,11 +165,10 @@ // Check the final count of open file descriptors long fdCount = getFdCount(); - System.out.printf("final count of open file descriptors: %d%n", fdCount); if (fdCount != fdCount0) { - listProcFD(); - throw new AssertionError("raw fd count wrong: expected: " + fdCount0 - + ", actual: " + fdCount); + System.out.printf("initial count of open file descriptors: %d%n", fdCount0); + System.out.printf("final count of open file descriptors: %d%n", fdCount); + FileUtils.listFileDescriptors(System.out); } } @@ -274,27 +272,4 @@ } return 0; } - - /** - * Method to list the open file descriptors (if supported by the 'lsof' command). - */ - static void listProcFD() { - List lsofDirs = List.of("/usr/bin", "/usr/sbin"); - Optional lsof = lsofDirs.stream() - .map(s -> Paths.get(s, "lsof")) - .filter(f -> Files.isExecutable(f)) - .findFirst(); - lsof.ifPresent(exe -> { - try { - System.out.printf("Open File Descriptors:%n"); - long pid = ProcessHandle.current().pid(); - ProcessBuilder pb = new ProcessBuilder(exe.toString(), "-p", Integer.toString((int) pid)); - pb.inheritIO(); - Process p = pb.start(); - p.waitFor(10, TimeUnit.SECONDS); - } catch (IOException | InterruptedException ie) { - ie.printStackTrace(); - } - }); - } } diff -Nru openjdk-11-11~19/test/jdk/java/io/FileOutputStream/UnreferencedFOSClosesFd.java openjdk-11-11~24/test/jdk/java/io/FileOutputStream/UnreferencedFOSClosesFd.java --- openjdk-11-11~19/test/jdk/java/io/FileOutputStream/UnreferencedFOSClosesFd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/io/FileOutputStream/UnreferencedFOSClosesFd.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,6 +25,8 @@ * * @test * @modules java.base/java.io:open + * @library /test/lib + * @build jdk.test.lib.util.FileUtils UnreferencedFOSClosesFd * @bug 6524062 * @summary Test to ensure that FOS.finalize() invokes the close() method as per * the specification. @@ -41,11 +43,15 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.lang.reflect.Field; +import java.nio.file.Path; +import java.util.ArrayDeque; import java.util.HashSet; import java.util.concurrent.atomic.AtomicInteger; import com.sun.management.UnixOperatingSystemMXBean; +import jdk.test.lib.util.FileUtils; + public class UnreferencedFOSClosesFd { enum CleanupType { @@ -133,8 +139,8 @@ String name = inFile.getPath(); + FileUtils.listFileDescriptors(System.out); long fdCount0 = getFdCount(); - System.out.printf("initial count of open file descriptors: %d%n", fdCount0); int failCount = 0; failCount += test(new FileOutputStream(name), CleanupType.CLEANER); @@ -153,10 +159,10 @@ // Check the final count of open file descriptors long fdCount = getFdCount(); - System.out.printf("final count of open file descriptors: %d%n", fdCount); if (fdCount != fdCount0) { - throw new AssertionError("raw fd count wrong: expected: " + fdCount0 - + ", actual: " + fdCount); + System.out.printf("initial count of open file descriptors: %d%n", fdCount0); + System.out.printf("final count of open file descriptors: %d%n", fdCount); + FileUtils.listFileDescriptors(System.out); } } diff -Nru openjdk-11-11~19/test/jdk/java/io/RandomAccessFile/UnreferencedRAFClosesFd.java openjdk-11-11~24/test/jdk/java/io/RandomAccessFile/UnreferencedRAFClosesFd.java --- openjdk-11-11~19/test/jdk/java/io/RandomAccessFile/UnreferencedRAFClosesFd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/io/RandomAccessFile/UnreferencedRAFClosesFd.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,7 @@ import java.io.File; import java.io.FileDescriptor; import java.io.FileNotFoundException; +import java.io.IOException; import java.io.RandomAccessFile; import java.lang.management.ManagementFactory; import java.lang.management.OperatingSystemMXBean; @@ -32,13 +33,19 @@ import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; import java.lang.reflect.Field; +import java.nio.file.Path; +import java.util.ArrayDeque; import java.util.HashSet; import com.sun.management.UnixOperatingSystemMXBean; +import jdk.test.lib.util.FileUtils; + /** * @test * @bug 8080225 + * @library /test/lib + * @build jdk.test.lib.util.FileUtils UnreferencedRAFClosesFd * @modules java.base/java.io:open * @summary Test to ensure that an unclosed and unreferenced RandomAccessFile closes the fd * @run main/othervm UnreferencedRAFClosesFd @@ -54,8 +61,8 @@ inFile.createNewFile(); inFile.deleteOnExit(); + FileUtils.listFileDescriptors(System.out); long fdCount0 = getFdCount(); - System.out.printf("initial count of open file descriptors: %d%n", fdCount0); String name = inFile.getPath(); RandomAccessFile raf; @@ -101,10 +108,10 @@ // Check the final count of open file descriptors long fdCount = getFdCount(); - System.out.printf("final count of open file descriptors: %d%n", fdCount); if (fdCount != fdCount0) { - throw new AssertionError("raw fd count wrong: expected: " + fdCount0 - + ", actual: " + fdCount); + System.out.printf("initial count of open file descriptors: %d%n", fdCount0); + System.out.printf("final count of open file descriptors: %d%n", fdCount); + FileUtils.listFileDescriptors(System.out); } } diff -Nru openjdk-11-11~19/test/jdk/java/io/Reader/NullReader.java openjdk-11-11~24/test/jdk/java/io/Reader/NullReader.java --- openjdk-11-11~19/test/jdk/java/io/Reader/NullReader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/io/Reader/NullReader.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,7 +35,7 @@ /* * @test - * @bug 8196298 + * @bug 8196298 8204930 * @run testng NullReader * @summary Check for expected behavior of Reader.nullReader(). */ @@ -96,6 +96,11 @@ } @Test(groups = "open") + public static void testReady() throws IOException { + assertFalse(openReader.ready()); + } + + @Test(groups = "open") public static void testSkip() throws IOException { assertEquals(0, openReader.skip(1), "skip() != 0"); } @@ -129,6 +134,11 @@ } @Test(groups = "closed", expectedExceptions = IOException.class) + public static void testReadyClosed() throws IOException { + closedReader.ready(); + } + + @Test(groups = "closed", expectedExceptions = IOException.class) public static void testSkipClosed() throws IOException { closedReader.skip(1); } diff -Nru openjdk-11-11~19/test/jdk/java/lang/Class/GetPackageBootLoaderChildLayer.java openjdk-11-11~24/test/jdk/java/lang/Class/GetPackageBootLoaderChildLayer.java --- openjdk-11-11~19/test/jdk/java/lang/Class/GetPackageBootLoaderChildLayer.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/Class/GetPackageBootLoaderChildLayer.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @requires !vm.graal.enabled + * @modules jdk.attach + * @run main/othervm --limit-modules jdk.attach -Djdk.attach.allowAttachSelf + * GetPackageBootLoaderChildLayer + * @summary Exercise Class.getPackage on a class defined to the boot loader + * but in a module that is in a child layer rather than the boot layer + */ + +import com.sun.tools.attach.VirtualMachine; + +public class GetPackageBootLoaderChildLayer { + public static void main(String[] args) throws Exception { + // ensure that the java.management module is not in the boot layer + ModuleLayer.boot().findModule("java.management").ifPresent(m -> { + throw new RuntimeException("java.management loaded!!!"); + }); + + // start local JMX agent via the attach mechanism + String vmid = "" + ProcessHandle.current().pid(); + VirtualMachine vm = VirtualMachine.attach(vmid); + vm.startLocalManagementAgent(); + + // check layer, class loader, and Package object + Class clazz = Class.forName("javax.management.MXBean"); + if (clazz.getModule().getLayer() == ModuleLayer.boot()) + throw new RuntimeException("Module is in boot layer!!!"); + ClassLoader loader = clazz.getClassLoader(); + if (loader != null) + throw new RuntimeException("Unexpected class loader: " + loader); + Package p = clazz.getPackage(); + if (!p.getName().equals("javax.management")) + throw new RuntimeException("Unexpected package " + p); + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/Host/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/Host/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/Host/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/Host/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "Host/Host.java";} + public int m() { + return 1; // original class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/Host/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/Host/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/Host/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/Host/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "Host/redef/Host.java";} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostA/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostA/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostA/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostA/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostA/Host.java";} + public static class A {} + public int m() { + return 1; // original class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostA/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostA/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostA/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostA/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostA/redef/Host.java"; } + public static class A {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAB/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAB/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAB/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAB/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostAB/Host.java";} + public static class A {} + public static class B {} + public int m() { + return 1; // original class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAB/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAB/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAB/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAB/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostAB/redef/Host.java"; } + public static class A {} + public static class B {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABC/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABC/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABC/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABC/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostABC/Host.java";} + public static class A {} + public static class B {} + public static class C {} + public int m() { + return 1; // original class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABC/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABC/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABC/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABC/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostABC/redef/Host.java"; } + public static class A {} + public static class B {} + public static class C {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABCD/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABCD/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABCD/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABCD/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostABCD/redef/Host.java"; } + public static class A {} + public static class B {} + public static class C {} + public static class D {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABD/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABD/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABD/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostABD/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostABD/redef/Host.java"; } + public static class A {} + public static class B {} + public static class D {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAC/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAC/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAC/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostAC/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostAC/redef/Host.java"; } + public static class A {} + public static class C {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostACB/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostACB/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostACB/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostACB/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostACB/redef/Host.java"; } + public static class A {} + public static class C {} + public static class B {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostB/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostB/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostB/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostB/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostB/redef/Host.java"; } + public static class B {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBA/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBA/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBA/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBA/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostBA/redef/Host.java"; } + public static class B {} + public static class A {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBAC/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBAC/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBAC/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBAC/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostBAC/redef/Host.java"; } + public static class B {} + public static class A {} + public static class C {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBCA/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBCA/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBCA/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostBCA/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostBCA/redef/Host.java"; } + public static class B {} + public static class C {} + public static class A {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostCAB/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostCAB/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostCAB/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostCAB/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostCAB/redef/Host.java"; } + public static class C {} + public static class A {} + public static class B {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostCBA/redef/Host.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostCBA/redef/Host.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostCBA/redef/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/HostCBA/redef/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public class Host { + public static String getID() { return "HostCBA/redef/Host.java"; } + public static class C {} + public static class B {} + public static class A {} + public int m() { + return 2; // redefined class + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/TestNestmateAttr.java openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/TestNestmateAttr.java --- openjdk-11-11~19/test/jdk/java/lang/instrument/RedefineNestmateAttr/TestNestmateAttr.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/instrument/RedefineNestmateAttr/TestNestmateAttr.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,376 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Class redefinition must preclude changes to nest attributes + * @library /test/lib + * @modules java.base/jdk.internal.misc + * @modules java.compiler + * java.instrument + * jdk.jartool/sun.tools.jar + * @compile ../NamedBuffer.java + * @run main RedefineClassHelper + * @compile Host/Host.java + * @run main/othervm -javaagent:redefineagent.jar -Xlog:redefine+class+nestmates=trace TestNestmateAttr Host + * @compile HostA/Host.java + * @run main/othervm -javaagent:redefineagent.jar -Xlog:redefine+class+nestmates=trace TestNestmateAttr HostA + * @compile HostAB/Host.java + * @run main/othervm -javaagent:redefineagent.jar -Xlog:redefine+class+nestmates=trace TestNestmateAttr HostAB + * @compile HostABC/Host.java + * @run main/othervm -javaagent:redefineagent.jar -Xlog:redefine+class+nestmates=trace TestNestmateAttr HostABC + */ + +/* Test Description + +The basic test class is call Host and we have variants that have zero or more +nested classes named A, B, C etc. Each variant of Host is defined in source +code in its own directory i.e. + +Host/Host.java defines zero nested classes +HostA/Host.java defines one nested class A +HostAB/Host.java defines two nested classes A and B (in that order) +etc. + +Each Host class has the form: + + public class Host { + public static String getID() { return "/Host.java"; } + + < zero or more empty nested classes> + + public int m() { + return 1; // original class + } + } + +Under each directory is a directory "redef" with a modified version of the Host +class that changes the ID to e.g. Host/redef/Host.java, and the method m() +returns 2. This allows us to check we have the redefined class loaded. + +Using Host' to represent the redefined version we test redefinition +combinations as follows: + +Host: + Host -> Host' - succeeds m() returns 2 + Host -> HostA' - fails - added a nest member + +HostA: + HostA -> HostA' - succeeds m() returns 2 + HostA -> Host' - fails - removed a nest member + HostA -> HostAB' - fails - added a nest member + HostA -> HostB' - fails - replaced a nest member + +HostAB: + HostAB -> HostAB' - succeeds m() returns 2 + HostAB -> HostBA' - succeeds m() returns 2 + HostAB -> HostA' - fails - removed a nest member + HostAB -> HostABC' - fails - added a nest member + HostAB -> HostAC' - fails - replaced a nest member + +HostABC: + HostABC -> HostABC' - succeeds m() returns 2 + HostABC -> HostACB' - succeeds m() returns 2 + HostABC -> HostBAC' - succeeds m() returns 2 + HostABC -> HostBCA' - succeeds m() returns 2 + HostABC -> HostCAB' - succeeds m() returns 2 + HostABC -> HostCBA' - succeeds m() returns 2 + HostABC -> HostAB' - fails - removed a nest member + HostABC -> HostABCD' - fails - added a nest member + HostABC -> HostABD' - fails - replaced a nest member + +More than three nested classes doesn't add to the code coverage so +we stop here. + +Note that we always try to load the redefined version even when we expect it +to fail. + +We can only directly load one class Host per classloader, so to run all the +groups we either need to use new classloaders, or we reinvoke the test +requesting a different primary directory. We chose the latter using +multiple @run tags. So we preceed as follows: + + @compile Host/Host.java + @run TestNestmateAttr Host + @compile HostA/Host.java - replaces previous Host.class + @run TestNestmateAttr HostA + @compile HostAB/Host.java - replaces previous Host.class + @run TestNestmateAttr HostAB +etc. + +Within the test we directly compile redefined versions of the classes, +using CompilerUtil, and then read the .class file directly as a byte[] +to use with the RedefineClassHelper. + +Finally we test redefinition of the NestHost attribute - which is +conceptually simple, but in fact very tricky to do. We do that +when testing HostA so we can reuse the Host$A class. + +*/ + +import java.io.File; +import java.io.FileInputStream; +import jdk.test.lib.ByteCodeLoader; +import jdk.test.lib.compiler.CompilerUtils; +import jdk.test.lib.compiler.InMemoryJavaCompiler; +import static jdk.test.lib.Asserts.assertTrue; + +public class TestNestmateAttr { + + static final String SRC = System.getProperty("test.src"); + static final String DEST = System.getProperty("test.classes"); + static final boolean VERBOSE = Boolean.getBoolean("verbose"); + + public static void main(String[] args) throws Throwable { + String origin = args[0]; + System.out.println("Testing original Host class from " + origin); + + // Make sure the Host class loaded directly is an original version + // and from the expected location + Host h = new Host(); + assertTrue(h.m() == 1); + assertTrue(Host.getID().startsWith(origin + "/")); + + String[] badTransforms; // directories of bad classes + String[] goodTransforms; // directories of good classes + + boolean testNestHostChanges = false; + + switch (origin) { + case "Host": + badTransforms = new String[] { + "HostA" // add member + }; + goodTransforms = new String[] { + origin + }; + break; + + case "HostA": + badTransforms = new String[] { + "Host", // remove member + "HostAB", // add member + "HostB" // change member + }; + goodTransforms = new String[] { + origin + }; + testNestHostChanges = true; + break; + + case "HostAB": + badTransforms = new String[] { + "HostA", // remove member + "HostABC", // add member + "HostAC" // change member + }; + goodTransforms = new String[] { + origin, + "HostBA" // reorder members + }; + break; + + case "HostABC": + badTransforms = new String[] { + "HostAB", // remove member + "HostABCD", // add member + "HostABD" // change member + }; + goodTransforms = new String[] { + origin, + "HostACB", // reorder members + "HostBAC", // reorder members + "HostBCA", // reorder members + "HostCAB", // reorder members + "HostCBA" // reorder members + }; + break; + + default: throw new Error("Unknown test directory: " + origin); + } + + // Compile and check bad transformations + checkBadTransforms(Host.class, badTransforms); + + // Compile and check good transformations + checkGoodTransforms(Host.class, goodTransforms); + + if (testNestHostChanges) + checkNestHostChanges(); + } + + static void checkNestHostChanges() throws Throwable { + // case 1: remove NestHost attribute + // - try to redefine Host$A with a top-level + // class called Host$A + System.out.println("Trying bad retransform that removes the NestHost attribute"); + + String name = "Host$A"; + // This is compiled as a top-level class: the $ in the name is not + // significant to the compiler. + String hostA = "public class " + name + " {}"; + + // Have to do this reflectively as there is no Host$A + // when compiling the "Host/" case. + Class nestedA = Class.forName(name); + + try { + RedefineClassHelper.redefineClass(nestedA, hostA); + throw new Error("Retransformation to top-level class " + name + + " succeeded unexpectedly"); + } + catch (UnsupportedOperationException uoe) { + if (uoe.getMessage().contains("attempted to change the class Nest")) { + System.out.println("Got expected exception " + uoe); + } + else throw new Error("Wrong UnsupportedOperationException", uoe); + } + + // case 2: add NestHost attribute + // - This is tricky because the class with no NestHost attribute + // has to have the name of a nested class! Plus we need the + // redefining class in bytecode form. + // - Use the InMemoryJavaCompiler plus ByteCodeLoader to load + // the top-level Host$A class + // - Try to redefine that class with a real nested Host$A + + System.out.println("Trying bad retransform that adds the NestHost attribute"); + byte[] bytes = InMemoryJavaCompiler.compile(name, hostA); + Class topLevelHostA = ByteCodeLoader.load(name, bytes); + + byte[] nestedBytes; + File clsfile = new File(DEST + "/" + name + ".class"); + if (VERBOSE) System.out.println("Reading bytes from " + clsfile); + try (FileInputStream str = new FileInputStream(clsfile)) { + nestedBytes = NamedBuffer.loadBufferFromStream(str); + } + try { + RedefineClassHelper.redefineClass(topLevelHostA, nestedBytes); + throw new Error("Retransformation to nested class " + name + + " succeeded unexpectedly"); + } + catch (UnsupportedOperationException uoe) { + if (uoe.getMessage().contains("attempted to change the class Nest")) { + System.out.println("Got expected exception " + uoe); + } + else throw new Error("Wrong UnsupportedOperationException", uoe); + } + + // case 3: replace the NestHost attribute + // - the easiest way (perhaps only reasonable way) to do this + // is to search for the Utf8 entry used by the Constant_ClassRef, + // set in the NestHost attribute, and edit it to refer to a different + // name. + System.out.println("Trying bad retransform that changes the NestHost attribute"); + int utf8Entry_length = 7; + boolean found = false; + for (int i = 0; i < nestedBytes.length - utf8Entry_length; i++) { + if (nestedBytes[i] == 1 && // utf8 tag + nestedBytes[i+1] == 0 && // msb of length + nestedBytes[i+2] == 4 && // lsb of length + nestedBytes[i+3] == (byte) 'H' && + nestedBytes[i+4] == (byte) 'o' && + nestedBytes[i+5] == (byte) 's' && + nestedBytes[i+6] == (byte) 't') { + + if (VERBOSE) System.out.println("Appear to have found Host utf8 entry starting at " + i); + + nestedBytes[i+3] = (byte) 'G'; + found = true; + break; + } + } + + if (!found) + throw new Error("Could not locate 'Host' name in byte array"); + + try { + RedefineClassHelper.redefineClass(nestedA, nestedBytes); + throw new Error("Retransformation to modified nested class" + + " succeeded unexpectedly"); + } + catch (UnsupportedOperationException uoe) { + if (uoe.getMessage().contains("attempted to change the class Nest")) { + System.out.println("Got expected exception " + uoe); + } + else throw new Error("Wrong UnsupportedOperationException", uoe); + } + + } + + static void checkGoodTransforms(Class c, String[] dirs) throws Throwable { + for (String dir : dirs) { + dir += "/redef"; + System.out.println("Trying good retransform from " + dir); + byte[] buf = bytesForHostClass(dir); + RedefineClassHelper.redefineClass(c, buf); + + // Test redefintion worked + Host h = new Host(); + assertTrue(h.m() == 2); + if (VERBOSE) System.out.println("Redefined ID: " + Host.getID()); + assertTrue(Host.getID().startsWith(dir)); + } + } + + static void checkBadTransforms(Class c, String[] dirs) throws Throwable { + for (String dir : dirs) { + dir += "/redef"; + System.out.println("Trying bad retransform from " + dir); + byte[] buf = bytesForHostClass(dir); + try { + RedefineClassHelper.redefineClass(c, buf); + throw new Error("Retransformation from directory " + dir + + " succeeded unexpectedly"); + } + catch (UnsupportedOperationException uoe) { + if (uoe.getMessage().contains("attempted to change the class Nest")) { + System.out.println("Got expected exception " + uoe); + } + else throw new Error("Wrong UnsupportedOperationException", uoe); + } + } + } + + static byte[] bytesForHostClass(String dir) throws Throwable { + compile("/" + dir); + File clsfile = new File(DEST + "/" + dir + "/Host.class"); + if (VERBOSE) System.out.println("Reading bytes from " + clsfile); + byte[] buf = null; + try (FileInputStream str = new FileInputStream(clsfile)) { + return buf = NamedBuffer.loadBufferFromStream(str); + } + } + + static void compile(String dir) throws Throwable { + File src = new File(SRC + dir); + File dst = new File(DEST + dir); + if (VERBOSE) System.out.println("Compiling from: " + src + "\n" + + " to: " + dst); + CompilerUtils.compile(src.toPath(), + dst.toPath(), + false /* don't recurse */, + new String[0]); + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/invoke/AccessControlTest.java openjdk-11-11~24/test/jdk/java/lang/invoke/AccessControlTest.java --- openjdk-11-11~19/test/jdk/java/lang/invoke/AccessControlTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/invoke/AccessControlTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -241,8 +241,10 @@ LookupCase lc = this.in(c2); int m1 = lc.lookupModes(); int m2 = fixMods(m.getModifiers()); - // privacy is strictly enforced on lookups - if (c1 != c2) m1 &= ~PRIVATE; + // allow private lookup on nestmates. Otherwise, privacy is strictly enforced + if (c1 != c2 && ((m2 & PRIVATE) == 0 || !c1.isNestmateOf(c2))) { + m1 &= ~PRIVATE; + } // protected access is sometimes allowed if ((m2 & PROTECTED) != 0) { int prev = m2; @@ -252,7 +254,7 @@ m2 |= PUBLIC; // from a subclass, it acts like a public method also } if (verbosity >= 2) - System.out.println(this+" willAccess "+lc+" m1="+m1+" m2="+m2+" => "+((m2 & m1) != 0)); + System.out.format("%s willAccess %s m1=0x%h m2=0x%h => %s%n", this, lc, m1, m2, ((m2 & m1) != 0)); return (m2 & m1) != 0; } diff -Nru openjdk-11-11~19/test/jdk/java/lang/invoke/FinalVirtualCallFromInterface.java openjdk-11-11~24/test/jdk/java/lang/invoke/FinalVirtualCallFromInterface.java --- openjdk-11-11~19/test/jdk/java/lang/invoke/FinalVirtualCallFromInterface.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/invoke/FinalVirtualCallFromInterface.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,61 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8200167 8010319 + * @summary Regression test for a bug introduced in 8200167 and fixed in 8010319 + * @run main FinalVirtualCallFromInterface + */ + +import java.lang.invoke.*; + +/* + * Test that a MethodHandle for a final method, called from an interface, works correctly. + * With only 8200167 applied this fails with: + * Exception in thread "main" java.lang.InternalError: Should only be invoked on a subclass + * at + * java.base/java.lang.invoke.DirectMethodHandle.checkReceiver(DirectMethodHandle.java:441) + * + * The nestmate update under 8010319 fixes that bug. + */ +public class FinalVirtualCallFromInterface { + + static class Final { + public final void fm() {} + } + + static interface FinalUser { + static void test() throws Throwable { + MethodType mt = MethodType.methodType(void.class); + MethodHandle mh = MethodHandles.lookup().findVirtual(Final.class, "fm", mt); + Final f = new Final(); + mh.invokeExact(f); + mh.invoke(f); + } + } + + public static void main(String[] args) throws Throwable { + FinalUser.test(); + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/invoke/PrivateInterfaceCallI4.jasm openjdk-11-11~24/test/jdk/java/lang/invoke/PrivateInterfaceCallI4.jasm --- openjdk-11-11~19/test/jdk/java/lang/invoke/PrivateInterfaceCallI4.jasm 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/invoke/PrivateInterfaceCallI4.jasm 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// invokeDirect is modified to use invokeinterface instead of invokevirtual + +interface PrivateInterfaceCall$I4 implements PrivateInterfaceCall$I1 + version 55:0 +{ + public static Method invokeDirect:"(LPrivateInterfaceCall$I4;)V" + stack 1 locals 2 + { + aload_0; + invokeinterface InterfaceMethod PrivateInterfaceCall$I4.toString:"()Ljava/lang/String;", 1; + astore_1; + return; + } + + public static Method invokeDirectFinal:"(LPrivateInterfaceCall$I4;)V" + stack 1 locals 2 + { + aload_0; + invokeinterface InterfaceMethod PrivateInterfaceCall$I4.getClass:"()Ljava/lang/Class;", 1; + astore_1; + return; + } + static abstract interface InnerClass I4=class PrivateInterfaceCall$I4 of class PrivateInterfaceCall; + static abstract interface InnerClass I1=class PrivateInterfaceCall$I1 of class PrivateInterfaceCall; + +} // end Class PrivateInterfaceCall$I4 diff -Nru openjdk-11-11~19/test/jdk/java/lang/invoke/PrivateInterfaceCall.java openjdk-11-11~24/test/jdk/java/lang/invoke/PrivateInterfaceCall.java --- openjdk-11-11~19/test/jdk/java/lang/invoke/PrivateInterfaceCall.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/invoke/PrivateInterfaceCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,316 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8046171 + * @summary Test direct and MethodHandle access to private interface methods using invokeinterface semantics + * to ensure all receiver typechecks occur as required. + * @comment This complements SpecialInterfaceCall which tests invokespecial semantics. + * @compile PrivateInterfaceCall.java + * @compile PrivateInterfaceCallI4.jasm + * @run main/othervm -Xint PrivateInterfaceCall + * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=1 PrivateInterfaceCall + * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=2 PrivateInterfaceCall + * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=3 PrivateInterfaceCall + * @run main/othervm -Xbatch -XX:-TieredCompilation PrivateInterfaceCall + */ + +// This is an adaptation of SpecialInterfaceCall to only use private interface methods and with +// virtual invocation semantics. Because we don't have the same corner cases as for invokespecial +// there's no practical difference between the I3 and I2 cases here. But we do have to ensure the +// correct versions of the methods get executed. +// In addition we add tests that involve calls from nestmates - which also covers the distinction +// between the caller being a class and being an interface. + +import java.lang.invoke.*; + +public class PrivateInterfaceCall { + interface I1 { + private void priv_m() { throw new Error("Should not call this"); }; + } + interface I2 extends I1 { + private void priv_m() { }; + + static void invokeDirect(I2 i) { + i.priv_m(); // generates invokeinterface + } + static void invokeInterfaceMH(I2 i) throws Throwable { + // emulates behaviour of invokeDirect + mh_I2_priv_m_from_I2.invokeExact(i); + } + // special case of invoking an Object method via an interface + static void invokeInterfaceObjectMH(I2 i) throws Throwable { + // emulates invokeInterface of I2.toString on i, which resolves + // to Object.toString + String s = (String) mh_I2_toString_from_I2.invokeExact(i); + } + // special case of invoking a final Object method via an interface + static void invokeInterfaceObjectFinalMH(I2 i) throws Throwable { + // emulates invokeInterface of I1.getClass on i, which resolves + // to Object.getClass + Class c = (Class) mh_I2_getClass_from_I2.invokeExact(i); + } + + static void init() throws Throwable { + MethodType mt = MethodType.methodType(void.class); + MethodHandles.Lookup lookup = MethodHandles.lookup(); + mh_I2_priv_m_from_I2 = lookup.findVirtual(I2.class, "priv_m", mt); + + mt = MethodType.methodType(String.class); + mh_I2_toString_from_I2 = lookup.findVirtual(I2.class, "toString", mt); + + mt = MethodType.methodType(Class.class); + mh_I2_getClass_from_I2 = lookup.findVirtual(I2.class, "getClass", mt); + } + } + interface I3 extends I2 { + static void invokeInterfaceMH(I2 i) throws Throwable { + // emulates behaviour of I2.invokeDirect + mh_I2_priv_m_from_I3.invokeExact(i); + } + static void init() throws Throwable { + MethodType mt = MethodType.methodType(void.class); + mh_I2_priv_m_from_I3 = MethodHandles.lookup().findVirtual(I2.class, "priv_m", mt); + } + } + + // This interface acts like I2 but we define directInvoke* methods + // that we will rewrite the bytecode of to use invokeinterface + // (see PrivateInterfaceCallI4.jasm). + interface I4 extends I1 { + static void invokeDirect(I4 i) { + // invokeinterface I4.toString() + throw new Error("Class file for I4 is not overwritten"); + } + static void invokeDirectFinal(I4 i) { + // invokeinterface I4.getClass() - final method + throw new Error("Class file for I4 is not overwritten"); + } + } + + // check invocations from nestmates outside the + // inheritance hierarchy - and from a class not interface + static void invokeDirect(I2 i) { + i.priv_m(); // generates invokeinterface + } + static void invokeInterfaceMH(I2 i) throws Throwable { + mh_I2_priv_m_from_PIC.invokeExact(i); + } + + // Concrete classes + static class C2 implements I2 { } + static class C3 implements I3 { } + static class C4 implements I4 { } + + // Classes that don't implement I2/I3 but do have a + // priv_m method in their hierarchy + static class D1 implements I1 { } + static class E { + private void priv_m() { throw new Error("Should not call this"); } + } + + // This MH acts like the invocation in I2.invokeDirect with caller I2 + static MethodHandle mh_I2_priv_m_from_I2; + + // This MH acts like the invocation in I3.invokeDirect with caller I3 + static MethodHandle mh_I2_priv_m_from_I3; + + // This MH acts like the invocation in PrivateInterfaceCall.invokeDirect + // with caller PrivateInterfaceCall + static MethodHandle mh_I2_priv_m_from_PIC; + + // This MH acts likes an invokeinterface of I2.toString from I2 + static MethodHandle mh_I2_toString_from_I2; + + // This MH acts likes an invokeinterface of I2.getClass from I2 + static MethodHandle mh_I2_getClass_from_I2; + + static { + try { + MethodType mt = MethodType.methodType(void.class); + mh_I2_priv_m_from_PIC = MethodHandles.lookup().findVirtual(I2.class, "priv_m", mt); + I2.init(); + I3.init(); + } catch (Throwable e) { + throw new Error(e); + } + } + + static void runPositiveTests() { + shouldNotThrow(() -> PrivateInterfaceCall.invokeDirect(new C2())); + shouldNotThrow(() -> PrivateInterfaceCall.invokeDirect(new C3())); + shouldNotThrow(() -> PrivateInterfaceCall.invokeInterfaceMH(new C2())); + shouldNotThrow(() -> PrivateInterfaceCall.invokeInterfaceMH(new C3())); + + shouldNotThrow(() -> I2.invokeDirect(new C2())); + shouldNotThrow(() -> I2.invokeDirect(new C3())); + shouldNotThrow(() -> I2.invokeInterfaceMH(new C2())); + shouldNotThrow(() -> I2.invokeInterfaceMH(new C3())); + shouldNotThrow(() -> I2.invokeInterfaceObjectMH(new C2())); + shouldNotThrow(() -> I2.invokeInterfaceObjectMH(new C3())); + shouldNotThrow(() -> I2.invokeInterfaceObjectFinalMH(new C2())); + shouldNotThrow(() -> I2.invokeInterfaceObjectFinalMH(new C3())); + + // This looks odd but at runtime the only constraint is that the + // receiver is an I2. In contrast in the invokespecial case the + // receiver must be an I3. + shouldNotThrow(() -> I3.invokeInterfaceMH(unsafeCastI3(new C2()))); + shouldNotThrow(() -> I3.invokeInterfaceMH(new C3())); + + shouldNotThrow(() -> I4.invokeDirect(new C4())); + shouldNotThrow(() -> I4.invokeDirectFinal(new C4())); + } + + static void runNegativeTests() { + System.out.println("ICCE PrivateInterfaceCall.invokeDirect D1"); + shouldThrowICCE(() -> PrivateInterfaceCall.invokeDirect(unsafeCastI2(new D1()))); + System.out.println("ICCE PrivateInterfaceCall.invokeDirect E"); + shouldThrowICCE(() -> PrivateInterfaceCall.invokeDirect(unsafeCastI2(new E()))); + System.out.println("ICCE PrivateInterfaceCall.invokeInterfaceMH D1"); + shouldThrowICCE(() -> PrivateInterfaceCall.invokeInterfaceMH(unsafeCastI2(new D1()))); + System.out.println("ICCE PrivateInterfaceCall.invokeInterfaceMH E"); + shouldThrowICCE(() -> PrivateInterfaceCall.invokeInterfaceMH(unsafeCastI2(new E()))); + + + System.out.println("ICCE I2.invokeInterfaceMH D1"); + shouldThrowICCE(() -> I2.invokeInterfaceMH(unsafeCastI2(new D1()))); + System.out.println("ICCE I2.invokeInterfaceMH E"); + shouldThrowICCE(() -> I2.invokeInterfaceMH(unsafeCastI2(new E()))); + + System.out.println("ICCE I2.invokeInterfaceObjectFinalMH D1"); + shouldThrowICCE(() -> I2.invokeInterfaceObjectFinalMH(unsafeCastI2(new D1()))); + System.out.println("ICCE I2.invokeInterfaceObjectFinalMH E"); + shouldThrowICCE(() -> I2.invokeInterfaceObjectFinalMH(unsafeCastI2(new E()))); + + System.out.println("ICCE I3.invokeInterfaceMH D1"); + shouldThrowICCE(() -> I3.invokeInterfaceMH(unsafeCastI3(new D1()))); + System.out.println("ICCE I3.invokeInterfaceMH E"); + shouldThrowICCE(() -> I3.invokeInterfaceMH(unsafeCastI3(new E()))); + + System.out.println("ICCE I4.invokeDirect D1"); + shouldThrowICCE(() -> I4.invokeDirect(unsafeCastI4(new D1()))); + System.out.println("ICCE I4.invokeDirect E"); + shouldThrowICCE(() -> I4.invokeDirect(unsafeCastI4(new E()))); + } + + static void warmup() { + for (int i = 0; i < 20_000; i++) { + runPositiveTests(); + } + } + + public static void main(String[] args) throws Throwable { + System.out.println("UNRESOLVED:"); + runNegativeTests(); + runPositiveTests(); + + System.out.println("RESOLVED:"); + runNegativeTests(); + + System.out.println("WARMUP:"); + warmup(); + + System.out.println("COMPILED:"); + runNegativeTests(); + runPositiveTests(); + } + + static interface Test { + void run() throws Throwable; + } + + static void shouldThrowICCE(Test t) { + shouldThrow(IncompatibleClassChangeError.class, + "does not implement the requested interface", t); + } + + // Depending on whether the exception originates in the linkResolver, the interpreter + // or the compiler, the message can be different - which is unfortunate and could be + // fixed. So we allow the listed reason or else a null message. + static void shouldThrow(Class expectedError, String reason, Test t) { + try { + t.run(); + } catch (Throwable e) { + // Don't accept subclasses as they can hide unexpected failure modes + if (expectedError == e.getClass()) { + String msg = e.getMessage(); + if ((msg != null && msg.contains(reason)) || msg == null) { + // passed + System.out.println("Threw expected: " + e); + return; + } + else { + throw new AssertionError("Wrong exception reason: expected '" + reason + + "', got '" + msg + "'", e); + } + } else { + String msg = String.format("Wrong exception thrown: expected=%s; thrown=%s", + expectedError.getName(), e.getClass().getName()); + throw new AssertionError(msg, e); + } + } + throw new AssertionError("No exception thrown: expected " + expectedError.getName()); + } + + static void shouldNotThrow(Test t) { + try { + t.run(); + // passed + } catch (Throwable e) { + throw new AssertionError("Exception was thrown: ", e); + } + } + + // Note: these unsafe casts are only possible for interface types + + static I2 unsafeCastI2(Object obj) { + try { + MethodHandle mh = MethodHandles.identity(Object.class); + mh = MethodHandles.explicitCastArguments(mh, mh.type().changeReturnType(I2.class)); + return (I2)mh.invokeExact((Object) obj); + } catch (Throwable e) { + throw new Error(e); + } + } + + static I3 unsafeCastI3(Object obj) { + try { + MethodHandle mh = MethodHandles.identity(Object.class); + mh = MethodHandles.explicitCastArguments(mh, mh.type().changeReturnType(I3.class)); + return (I3)mh.invokeExact((Object) obj); + } catch (Throwable e) { + throw new Error(e); + } + } + + static I4 unsafeCastI4(Object obj) { + try { + MethodHandle mh = MethodHandles.identity(Object.class); + mh = MethodHandles.explicitCastArguments(mh, mh.type().changeReturnType(I4.class)); + return (I4)mh.invokeExact((Object) obj); + } catch (Throwable e) { + throw new Error(e); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/invoke/SpecialInterfaceCall.java openjdk-11-11~24/test/jdk/java/lang/invoke/SpecialInterfaceCall.java --- openjdk-11-11~19/test/jdk/java/lang/invoke/SpecialInterfaceCall.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/invoke/SpecialInterfaceCall.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,9 +23,10 @@ /** * @test - * @bug 8200167 + * @bug 8200167 8010319 * @summary Test direct and MethodHandle access to interface methods using invokespecial semantics - * @compile SpecialInterfaceCall.java + * @comment This must be compiled so invokespecial is used + * @compile -XDdisableVirtualizedPrivateInvoke SpecialInterfaceCall.java * @compile SpecialInterfaceCallI4.jasm * @run main/othervm -Xint SpecialInterfaceCall * @run main/othervm -Xbatch -XX:+TieredCompilation -XX:TieredStopAtLevel=1 SpecialInterfaceCall diff -Nru openjdk-11-11~19/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java openjdk-11-11~24/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java --- openjdk-11-11~19/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/invoke/t8150782/TestAccessClass.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ */ /* @test + * @bug 8150782 8207027 * @compile TestAccessClass.java TestCls.java * @run testng/othervm -ea -esa test.java.lang.invoke.t8150782.TestAccessClass */ @@ -54,11 +55,17 @@ } @Test - public void returnsSameClass() throws IllegalAccessException, ClassNotFoundException { + public void returnsSameClassInSamePackage() throws IllegalAccessException, ClassNotFoundException { Class aClass = lookup().accessClass(Class1.class); assertEquals(Class1.class, aClass); } + @Test + public void returnsSameArrayClassInSamePackage() throws IllegalAccessException, ClassNotFoundException { + Class aClass = lookup().accessClass(Class1[].class); + assertEquals(Class1[].class, aClass); + } + @DataProvider Object[][] illegalAccessAccess() { return new Object[][] { diff -Nru openjdk-11-11~19/test/jdk/java/lang/invoke/t8150782/TestFindClass.java openjdk-11-11~24/test/jdk/java/lang/invoke/t8150782/TestFindClass.java --- openjdk-11-11~19/test/jdk/java/lang/invoke/t8150782/TestFindClass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/invoke/t8150782/TestFindClass.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,6 +24,7 @@ */ /* @test + * @bug 8150782 8207027 * @compile TestFindClass.java TestCls.java * @run testng/othervm -ea -esa test.java.lang.invoke.t8150782.TestFindClass */ @@ -56,11 +57,17 @@ } @Test - public void returnsRequestedClass() throws IllegalAccessException, ClassNotFoundException { + public void returnsRequestedClassInSamePackage() throws IllegalAccessException, ClassNotFoundException { Class aClass = lookup().findClass(PACKAGE_PREFIX + "TestFindClass$Class1"); assertEquals(Class1.class, aClass); } + @Test + public void returnsRequestedArrayClassInSamePackage() throws IllegalAccessException, ClassNotFoundException { + Class aClass = lookup().findClass("[L" + PACKAGE_PREFIX + "TestFindClass$Class1;"); + assertEquals(Class1[].class, aClass); + } + @Test(expectedExceptions = {ClassNotFoundException.class}) public void classNotFoundExceptionTest() throws IllegalAccessException, ClassNotFoundException { lookup().findClass(PACKAGE_PREFIX + "TestFindClass$NonExistent"); diff -Nru openjdk-11-11~19/test/jdk/java/lang/invoke/VarHandles/VarHandleMethodReferenceTest.java openjdk-11-11~24/test/jdk/java/lang/invoke/VarHandles/VarHandleMethodReferenceTest.java --- openjdk-11-11~19/test/jdk/java/lang/invoke/VarHandles/VarHandleMethodReferenceTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/invoke/VarHandles/VarHandleMethodReferenceTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,92 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8195650 + * @summary Test linking of method references to VarHandle access methods. + * @run testng VarHandleMethodReferenceTest + */ + +import org.testng.annotations.Test; + +import java.lang.invoke.*; + +public class VarHandleMethodReferenceTest { + + interface R { + void apply(); + } + + @Test + public void testMethodReferences() { + VarHandle vh = MethodHandles.arrayElementVarHandle(int[].class); + + // The compilation of these method references will result in the + // placement of MethodHandles in the constant pool that reference + // VarHandle signature polymorphic methods. + // When those constant method handles are loaded the VarHandle invoker + // mechanism will be used where the first argument to invocation will be + // the bound VarHandle instance + + // VarHandle invokers are tested by other test classes so here it + // is just necessary to check that functional objects can be successfully + // obtained, it does not matter about the signature of the functional + // interface + + R r; + r = vh::get; + r = vh::set; + r = vh::getVolatile; + r = vh::setVolatile; + r = vh::getOpaque; + r = vh::setOpaque; + r = vh::getAcquire; + r = vh::setRelease; + + r = vh::compareAndSet; + r = vh::compareAndExchange; + r = vh::compareAndExchangeAcquire; + r = vh::compareAndExchangeRelease; + r = vh::weakCompareAndSetPlain; + r = vh::weakCompareAndSet; + r = vh::weakCompareAndSetAcquire; + r = vh::weakCompareAndSetRelease; + + r = vh::getAndSet; + r = vh::getAndSetAcquire; + r = vh::getAndSetRelease; + r = vh::getAndAdd; + r = vh::getAndAddAcquire; + r = vh::getAndAddRelease; + r = vh::getAndBitwiseOr; + r = vh::getAndBitwiseOrAcquire; + r = vh::getAndBitwiseOrRelease; + r = vh::getAndBitwiseAnd; + r = vh::getAndBitwiseAndAcquire; + r = vh::getAndBitwiseAndRelease; + r = vh::getAndBitwiseXor; + r = vh::getAndBitwiseXorAcquire; + r = vh::getAndBitwiseXorRelease; + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/empty.policy openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/empty.policy --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/empty.policy 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/empty.policy 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,5 @@ +// A deliberately empty policy file for use with jtreg. +// Setting othervm/java.security.policy=empty.policy +// causes jtreg to run under the default system policy +// and default security manager, with the addition of +// the permissions jtreg itself needs to run. diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberMalformedHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberMalformedHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberMalformedHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberMalformedHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to class with invalid class file format + +class HostOfMemberMalformedHost$MemberMalformedHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 ""; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "Hosts.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "HostOfMemberMalformedHost$MemberMalformedHost"; // #13 + Utf8 "MemberMalformedHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "HostOfMemberMalformedHost"; // #17 + // added + Utf8 "MalformedHost"; // #18 + class #18; // #19 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 68; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + 0x0013; // Modified #19 + } // end NestHost + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 8; + } + } // end InnerClasses + } // Attributes +} // end class HostOfMemberMalformedHost$MemberMalformedHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberMissingHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberMissingHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberMissingHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberMissingHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to non-existent class + +class HostOfMemberMissingHost$MemberMissingHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 ""; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "Hosts.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "HostOfMemberMissingHost$MemberMissingHost"; // #13 + Utf8 "MemberMissingHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "HostOfMemberMissingHost"; // #17 + class #10; // #18 - added + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 60; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + 0x0012; // modified + } // end NestHost + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 8; + } + } // end InnerClasses + } // Attributes +} // end class HostOfMemberMissingHost$MemberMissingHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNoHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNoHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNoHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNoHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute deleted + +class HostOfMemberNoHost$MemberNoHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 ""; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "Hosts.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "HostOfMemberNoHost$MemberNoHost"; // #13 + Utf8 "MemberNoHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "HostOfMemberNoHost"; // #17 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 57; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 8; + } + } // end InnerClasses + } // Attributes +} // end class HostOfMemberNoHost$MemberNoHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNotInstanceHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNotInstanceHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNotInstanceHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNotInstanceHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to non-instance class + +class HostOfMemberNotInstanceHost$MemberNotInstanceHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #14; // #1 + class #15; // #2 + class #18; // #3 + Utf8 "oa"; // #4 + Utf8 "[LInvalidNestHost;"; // #5 + Utf8 ""; // #6 + Utf8 "()V"; // #7 + Utf8 "Code"; // #8 + Utf8 "LineNumberTable"; // #9 + Utf8 "SourceFile"; // #10 + Utf8 "Hosts.java"; // #11 + Utf8 "NestHost"; // #12 + class #19; // #13 + NameAndType #6 #7; // #14 + Utf8 "HostOfMemberNotInstanceHost$MemberNotInstanceHost"; // #15 + Utf8 "MemberNotInstanceHost"; // #16 + Utf8 "InnerClasses"; // #17 + Utf8 "java/lang/Object"; // #18 + Utf8 "HostOfMemberNotInstanceHost"; // #19 + class #5; // #20 - added + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0000; // access + #6; // name_cpx + #7; // sig_cpx + [] { // Attributes + Attr(#8) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#9) { // LineNumberTable + [] { // LineNumberTable + 0 63; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#10) { // SourceFile + #11; + } // end SourceFile + ; + Attr(#12) { // NestHost + 0x0014; // Modified #20 + } // end NestHost + ; + Attr(#17) { // InnerClasses + [] { // InnerClasses + #2 #13 #16 8; + } + } // end InnerClasses + } // Attributes +} // end class HostOfMemberNotInstanceHost$MemberNotInstanceHost + diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNotOurHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNotOurHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNotOurHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostOfMemberNotOurHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to class with no nest + +class HostOfMemberNotOurHost$MemberNotOurHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 ""; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "Hosts.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "HostOfMemberNotOurHost$MemberNotOurHost"; // #13 + Utf8 "MemberNotOurHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "HostOfMemberNotOurHost"; // #17 + // Added + Utf8 "InvalidNestHost"; // #18 + class #18; // #19 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 68; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + 0x0013; // Modified #19 + } // end NestHost + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 8; + } + } // end InnerClasses + } // Attributes +} // end class HostOfMemberNotOurHost$MemberNotOurHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/Hosts.java openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/Hosts.java --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/Hosts.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/Hosts.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// Non-public classes so we can keep them all in this one source file + +class HostOfMemberNoHost { + // Missing NestHost attribute + static class MemberNoHost {} +} + +class HostOfMemberMissingHost { + // Missing NestHost class + static class MemberMissingHost {} +} + +class HostOfMemberNotInstanceHost { + // Invalid NestHost class (not instance class) + static class MemberNotInstanceHost { + Object[] oa; // create CP entry to use in jcod change + } +} + +class HostOfMemberNotOurHost { + // Valid but different NestHost class + static class MemberNotOurHost {} +} + +class HostOfMemberMalformedHost { + // Malformed NestHost class + static class MemberMalformedHost {} +} + +// Host lists itself as a member along +// with real member. +class HostWithSelfMember { + static class Member {} +} + +// Host lists duplicate members. +class HostWithDuplicateMembers { + static class Member1 {} + static interface Member2 {} +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostWithDuplicateMembers.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostWithDuplicateMembers.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostWithDuplicateMembers.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostWithDuplicateMembers.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Modify NestMembers attribute to contain multiple duplicates + +class HostWithDuplicateMembers { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #16; // #1 + class #17; // #2 + class #18; // #3 + class #19; // #4 + Utf8 "Member2"; // #5 + Utf8 "InnerClasses"; // #6 + class #20; // #7 + Utf8 "Member1"; // #8 + Utf8 ""; // #9 + Utf8 "()V"; // #10 + Utf8 "Code"; // #11 + Utf8 "LineNumberTable"; // #12 + Utf8 "SourceFile"; // #13 + Utf8 "Hosts.java"; // #14 + Utf8 "NestMembers"; // #15 + NameAndType #9 #10; // #16 + Utf8 "HostWithDuplicateMembers"; // #17 + Utf8 "java/lang/Object"; // #18 + Utf8 "HostWithDuplicateMembers$Member2"; // #19 + Utf8 "HostWithDuplicateMembers$Member1"; // #20 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #9; // name_cpx + #10; // sig_cpx + [] { // Attributes + Attr(#11) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#12) { // LineNumberTable + [] { // LineNumberTable + 0 60; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#13) { // SourceFile + #14; + } // end SourceFile + ; + Attr(#15) { // NestMembers + 0x0006000700040007; // modified + 0x000400070004; + } // end NestMembers + ; + Attr(#6) { // InnerClasses + [] { // InnerClasses + #4 #2 #5 1544; + #7 #2 #8 8; + } + } // end InnerClasses + } // Attributes +} // end class HostWithDuplicateMembers diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostWithSelfMember.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostWithSelfMember.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/HostWithSelfMember.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/HostWithSelfMember.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,102 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// Modify NestMembers attribute to include reference to the currnet class + +class HostWithSelfMember { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #14; // #1 + class #15; // #2 + class #16; // #3 + class #17; // #4 + Utf8 "Member"; // #5 + Utf8 "InnerClasses"; // #6 + Utf8 ""; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "SourceFile"; // #11 + Utf8 "Hosts.java"; // #12 + Utf8 "NestMembers"; // #13 + NameAndType #7 #8; // #14 + Utf8 "HostWithSelfMember"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "HostWithSelfMember$Member"; // #17 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 55; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#11) { // SourceFile + #12; + } // end SourceFile + ; + Attr(#13) { // NestMembers + 0x000200040002; // modified - added self + } // end NestMembers + ; + Attr(#6) { // InnerClasses + [] { // InnerClasses + #4 #2 #5 8; + } + } // end InnerClasses + } // Attributes +} // end class HostWithSelfMember diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/InvalidNestHost.java openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/InvalidNestHost.java --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/InvalidNestHost.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/InvalidNestHost.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* Empty class to use as an invalid nest-host class, in the same package as + * the test classes. + */ +public class InvalidNestHost { +} + diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MalformedHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MalformedHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MalformedHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MalformedHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// Invalid class file format + +class MalformedHost { + 0xDEADBEEF; // bad magic number + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 ""; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "MemberMalformedHost"; // #14 + Utf8 "java/lang/Object"; // #16 + Utf8 "TestReflectionAPI"; // #17 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 68; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + } // Attributes +} // end class MalformedHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberMalformedHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberMalformedHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberMalformedHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberMalformedHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to class with invalid class file format + +class TestReflectionAPI$MemberMalformedHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 ""; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "TestReflectionAPI.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "TestReflectionAPI$MemberMalformedHost"; // #13 + Utf8 "MemberMalformedHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "TestReflectionAPI"; // #17 + // added + Utf8 "MalformedHost"; // #18 + class #18; // #19 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 68; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + 0x0013; // Modified #19 + } // end NestHost + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 8; + } + } // end InnerClasses + } // Attributes +} // end class TestReflectionAPI$MemberMalformedHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberMissingHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberMissingHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberMissingHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberMissingHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,103 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to non-existent class + +class TestReflectionAPI$MemberMissingHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 ""; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "TestReflectionAPI.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "TestReflectionAPI$MemberMissingHost"; // #13 + Utf8 "MemberMissingHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "TestReflectionAPI"; // #17 + class #10; // #18 - added + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 60; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + 0x0012; // modified + } // end NestHost + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 8; + } + } // end InnerClasses + } // Attributes +} // end class TestReflectionAPI$MemberMissingHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberNoHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberNoHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberNoHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberNoHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute deleted + +class TestReflectionAPI$MemberNoHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 ""; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "TestReflectionAPI.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "TestReflectionAPI$MemberNoHost"; // #13 + Utf8 "MemberNoHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "TestReflectionAPI"; // #17 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 57; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 8; + } + } // end InnerClasses + } // Attributes +} // end class TestReflectionAPI$MemberNoHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberNotInstanceHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberNotInstanceHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberNotInstanceHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberNotInstanceHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,113 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to non-instance class + +class TestReflectionAPI$MemberNotInstanceHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #14; // #1 + class #15; // #2 + class #18; // #3 + Utf8 "oa"; // #4 + Utf8 "[LInvalidNestHost;"; // #5 + Utf8 ""; // #6 + Utf8 "()V"; // #7 + Utf8 "Code"; // #8 + Utf8 "LineNumberTable"; // #9 + Utf8 "SourceFile"; // #10 + Utf8 "TestReflectionAPI.java"; // #11 + Utf8 "NestHost"; // #12 + class #19; // #13 + NameAndType #6 #7; // #14 + Utf8 "TestReflectionAPI$MemberNotInstanceHost"; // #15 + Utf8 "MemberNotInstanceHost"; // #16 + Utf8 "InnerClasses"; // #17 + Utf8 "java/lang/Object"; // #18 + Utf8 "TestReflectionAPI"; // #19 + class #5; // #20 - added + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + } // Attributes + } // Member + } // fields + + [] { // methods + { // Member + 0x0000; // access + #6; // name_cpx + #7; // sig_cpx + [] { // Attributes + Attr(#8) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#9) { // LineNumberTable + [] { // LineNumberTable + 0 63; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#10) { // SourceFile + #11; + } // end SourceFile + ; + Attr(#12) { // NestHost + 0x0014; // Modified #20 + } // end NestHost + ; + Attr(#17) { // InnerClasses + [] { // InnerClasses + #2 #13 #16 8; + } + } // end InnerClasses + } // Attributes +} // end class TestReflectionAPI$MemberNotInstanceHost + diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberNotOurHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberNotOurHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/MemberNotOurHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/MemberNotOurHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute refers to class with no nest + +class TestReflectionAPI$MemberNotOurHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #3 #12; // #1 + class #13; // #2 + class #16; // #3 + Utf8 ""; // #4 + Utf8 "()V"; // #5 + Utf8 "Code"; // #6 + Utf8 "LineNumberTable"; // #7 + Utf8 "SourceFile"; // #8 + Utf8 "TestReflectionAPI.java"; // #9 + Utf8 "NestHost"; // #10 + class #17; // #11 + NameAndType #4 #5; // #12 + Utf8 "TestReflectionAPI$MemberNotOurHost"; // #13 + Utf8 "MemberNotOurHost"; // #14 + Utf8 "InnerClasses"; // #15 + Utf8 "java/lang/Object"; // #16 + Utf8 "TestReflectionAPI"; // #17 + // Added + Utf8 "InvalidNestHost"; // #18 + class #18; // #19 + } // Constant Pool + + 0x0020; // access + #2;// this_cpx + #3;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0000; // access + #4; // name_cpx + #5; // sig_cpx + [] { // Attributes + Attr(#6) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#7) { // LineNumberTable + [] { // LineNumberTable + 0 68; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#8) { // SourceFile + #9; + } // end SourceFile + ; + Attr(#10) { // NestHost + 0x0013; // Modified #19 + } // end NestHost + ; + Attr(#15) { // InnerClasses + [] { // InnerClasses + #2 #11 #14 8; + } + } // end InnerClasses + } // Attributes +} // end class TestReflectionAPI$MemberNotOurHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost2.java openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost2.java --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost2.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost2.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package P2; + +/* + * This is used to produce a jcod file in which we modify the + * NestHost attribute to claim that P2.PackagedNestHost.Member + * is a member of the nest of P1.PackagedNestHost. + */ +public class PackagedNestHost2 { + public static class Member { } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost2Member.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost2Member.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost2Member.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost2Member.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestHost attribute is modified to contain P1.PackagedNestHost +// m() is declared private + +class P2/PackagedNestHost2$Member { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #7 #18; // #1 + Field #19 #20; // #2 + String #21; // #3 + Method #22 #23; // #4 + Method #24 #25; // #5 + class #26; // #6 + class #29; // #7 + Utf8 ""; // #8 + Utf8 "()V"; // #9 + Utf8 "Code"; // #10 + Utf8 "LineNumberTable"; // #11 + Utf8 "m"; // #12 + Utf8 "doAccess"; // #13 + Utf8 "SourceFile"; // #14 + Utf8 "PackagedNestHost2.java"; // #15 + Utf8 "NestHost"; // #16 + class #30; // #17 + NameAndType #8 #9; // #18 + class #31; // #19 + NameAndType #32 #33; // #20 + Utf8 "You should never see this!"; // #21 + class #34; // #22 + NameAndType #35 #36; // #23 + class #38; // #24 + NameAndType #12 #9; // #25 + Utf8 "P2/PackagedNestHost2$Member"; // #26 + Utf8 "Member"; // #27 + Utf8 "InnerClasses"; // #28 + Utf8 "java/lang/Object"; // #29 + Utf8 "P2/PackagedNestHost2"; // #30 + Utf8 "java/lang/System"; // #31 + Utf8 "out"; // #32 + Utf8 "Ljava/io/PrintStream;"; // #33 + Utf8 "java/io/PrintStream"; // #34 + Utf8 "println"; // #35 + Utf8 "(Ljava/lang/String;)V"; // #36 + class #39; // #37 + Utf8 "P1/PackagedNestHost$Member"; // #38 + Utf8 "P1/PackagedNestHost"; // #39 + } // Constant Pool + + 0x0021; // access + #6;// this_cpx + #7;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #8; // name_cpx + #9; // sig_cpx + [] { // Attributes + Attr(#10) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#11) { // LineNumberTable + [] { // LineNumberTable + 0 32; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x000A; // access - modified + #12; // name_cpx + #9; // sig_cpx + [] { // Attributes + Attr(#10) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#11) { // LineNumberTable + [] { // LineNumberTable + 0 35; + 8 36; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #13; // name_cpx + #9; // sig_cpx + [] { // Attributes + Attr(#10) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80005B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#11) { // LineNumberTable + [] { // LineNumberTable + 0 42; + 3 43; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#14) { // SourceFile + #15; + } // end SourceFile + ; + Attr(#16) { // NestHost + 0x0025; // modified - #37 + } // end NestHost + ; + Attr(#28) { // InnerClasses + [] { // InnerClasses + #6 #17 #27 9; + #24 #37 #27 9; + } + } // end InnerClasses + } // Attributes +} // end class P2/PackagedNestHost2$Member diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost.java openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost.java --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package P1; + +/* + * This is used to produce a jcod file in which we modify the + * NestMembers attribute to claim that P2.PackagedNestHost.Member + * is a member of our nest. + */ +public class PackagedNestHost { + public static class Member { } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHost.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// NestMembers attribute is modified to contain P2.PackagedNestHost2.Member + +class P1/PackagedNestHost { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #4 #16; // #1 + Method #17 #18; // #2 + class #19; // #3 + class #20; // #4 + class #21; // #5 + Utf8 "Member"; // #6 + Utf8 "InnerClasses"; // #7 + Utf8 ""; // #8 + Utf8 "()V"; // #9 + Utf8 "Code"; // #10 + Utf8 "LineNumberTable"; // #11 + Utf8 "doAccess"; // #12 + Utf8 "SourceFile"; // #13 + Utf8 "PackagedNestHost.java"; // #14 + Utf8 "NestMembers"; // #15 + NameAndType #8 #9; // #16 + class #23; // #17 + NameAndType #24 #9; // #18 + Utf8 "P1/PackagedNestHost"; // #19 + Utf8 "java/lang/Object"; // #20 + Utf8 "P1/PackagedNestHost$Member"; // #21 + class #25; // #22 + Utf8 "P2/PackagedNestHost2$Member"; // #23 + Utf8 "m"; // #24 + Utf8 "P2/PackagedNestHost2"; // #25 + } // Constant Pool + + 0x0021; // access + #3;// this_cpx + #4;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #8; // name_cpx + #9; // sig_cpx + [] { // Attributes + Attr(#10) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#11) { // LineNumberTable + [] { // LineNumberTable + 0 31; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x0009; // access + #12; // name_cpx + #9; // sig_cpx + [] { // Attributes + Attr(#10) { // Code + 0; // max_stack + 0; // max_locals + Bytes[]{ + 0xB80002B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#11) { // LineNumberTable + [] { // LineNumberTable + 0 44; + 3 45; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#13) { // SourceFile + #14; + } // end SourceFile + ; + Attr(#15) { // NestMembers + 0x00010011; // modified - #17 + } // end NestMembers + ; + Attr(#7) { // InnerClasses + [] { // InnerClasses + #5 #3 #6 9; + #17 #22 #6 9; + } + } // end InnerClasses + } // Attributes +} // end class P1/PackagedNestHost diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHostMember.jcod openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHostMember.jcod --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/PackagedNestHostMember.jcod 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/PackagedNestHostMember.jcod 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// m() is declared private + +class P1/PackagedNestHost$Member { + 0xCAFEBABE; + 0; // minor version + 55; // version + [] { // Constant Pool + ; // first element is empty + Method #6 #16; // #1 + Field #17 #18; // #2 + String #19; // #3 + Method #20 #21; // #4 + class #22; // #5 + class #25; // #6 + Utf8 ""; // #7 + Utf8 "()V"; // #8 + Utf8 "Code"; // #9 + Utf8 "LineNumberTable"; // #10 + Utf8 "m"; // #11 + Utf8 "SourceFile"; // #12 + Utf8 "PackagedNestHost.java"; // #13 + Utf8 "NestHost"; // #14 + class #26; // #15 + NameAndType #7 #8; // #16 + class #27; // #17 + NameAndType #28 #29; // #18 + Utf8 "You should never see this!"; // #19 + class #30; // #20 + NameAndType #31 #32; // #21 + Utf8 "P1/PackagedNestHost$Member"; // #22 + Utf8 "Member"; // #23 + Utf8 "InnerClasses"; // #24 + Utf8 "java/lang/Object"; // #25 + Utf8 "P1/PackagedNestHost"; // #26 + Utf8 "java/lang/System"; // #27 + Utf8 "out"; // #28 + Utf8 "Ljava/io/PrintStream;"; // #29 + Utf8 "java/io/PrintStream"; // #30 + Utf8 "println"; // #31 + Utf8 "(Ljava/lang/String;)V"; // #32 + } // Constant Pool + + 0x0021; // access + #5;// this_cpx + #6;// super_cpx + + [] { // Interfaces + } // Interfaces + + [] { // fields + } // fields + + [] { // methods + { // Member + 0x0001; // access + #7; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 1; // max_stack + 1; // max_locals + Bytes[]{ + 0x2AB70001B1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 32; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + ; + { // Member + 0x000A; // access - modified + #11; // name_cpx + #8; // sig_cpx + [] { // Attributes + Attr(#9) { // Code + 2; // max_stack + 0; // max_locals + Bytes[]{ + 0xB200021203B60004; + 0xB1; + }; + [] { // Traps + } // end Traps + [] { // Attributes + Attr(#10) { // LineNumberTable + [] { // LineNumberTable + 0 35; + 8 36; + } + } // end LineNumberTable + } // Attributes + } // end Code + } // Attributes + } // Member + } // methods + + [] { // Attributes + Attr(#12) { // SourceFile + #13; + } // end SourceFile + ; + Attr(#14) { // NestHost + 0x000F; + } // end NestHost + ; + Attr(#24) { // InnerClasses + [] { // InnerClasses + #5 #15 #23 9; + } + } // end InnerClasses + } // Attributes +} // end class P1/PackagedNestHost$Member diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/SampleNest.java openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/SampleNest.java --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/SampleNest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/SampleNest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.util.Arrays; +import java.util.List; +import java.util.LinkedList; + +// A sample nest for use with reflection API tests +public class SampleNest { + + // recursively gather all the named nested types + + static List> _nestedTypes = new LinkedList<>(); + + static void gather(Class c) { + _nestedTypes.add(c); + for (Class d : c.getDeclaredClasses()) { + gather(d); + } + } + + static { + gather(SampleNest.class); + SampleNest s = new SampleNest(); + } + + public static Class[] nestedTypes() { + return _nestedTypes.toArray(new Class[0]); + } + + // Define a nested type of each possible kind + + static class StaticClass { } + static interface StaticIface { } + class InnerClass { } + interface InnerIface { } + + // check multi-level nesting + + static class DeepNest1 { + static class DeepNest2 { + static class DeepNest3 { + } + } + } + + // local and anonymous classes aren't declared + // so they have to add themselves + public SampleNest() { + class LocalClass { } + _nestedTypes.add(LocalClass.class); + + Runnable r = new Runnable() { + public void run() { + // anonymous class + _nestedTypes.add(getClass()); + } + }; + r.run(); + } +} + diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/testPkg/Host.java openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/testPkg/Host.java --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/testPkg/Host.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/testPkg/Host.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package testPkg; + +// Host class with single member +public class Host { + public static class Member { + } +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/testPkg/Singleton.java openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/testPkg/Singleton.java --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/testPkg/Singleton.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/testPkg/Singleton.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package testPkg; + +// Self-hosting singleton nest +public class Singleton { +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/TestReflectionAPI.java openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/TestReflectionAPI.java --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/TestReflectionAPI.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/TestReflectionAPI.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,322 @@ +/* + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test the new nestmate reflection API + * @compile TestReflectionAPI.java + * PackagedNestHost.java + * PackagedNestHost2.java + * SampleNest.java + * Hosts.java + * InvalidNestHost.java + * + * @compile MemberNoHost.jcod + * MemberMissingHost.jcod + * MemberNotInstanceHost.jcod + * MemberNotOurHost.jcod + * MemberMalformedHost.jcod + * MalformedHost.jcod + * PackagedNestHost.jcod + * PackagedNestHost2Member.jcod + * PackagedNestHostMember.jcod + * HostOfMemberNoHost.jcod + * HostOfMemberMissingHost.jcod + * HostOfMemberNotInstanceHost.jcod + * HostOfMemberNotOurHost.jcod + * HostOfMemberMalformedHost.jcod + * HostWithSelfMember.jcod + * HostWithDuplicateMembers.jcod + * + * @run main/othervm TestReflectionAPI + * @run main/othervm/java.security.policy=empty.policy TestReflectionAPI + */ + +// We need a nest member class that is invalid for each of the possible reasons, +// plus we need some external classes to test other failure modes. +// For each nested class below there is a corresponding .jcod file which breaks one +// of the rules regarding nest membership. For the package related tests we have +// additional PackageNestHost*.java sources. +// For testing getNestMembers we need an external host class that has a nested class +// which we can form a jcod file from such that we get all the expected failure modes. +// Note that all the .java files must be compiled in the same step, while all +// .jcod files must be compiled in a later step. + +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashSet; + +public class TestReflectionAPI { + + // Valid nest member + static class Member {} + + // Missing NestHost attribute + static class MemberNoHost {} + + // Missing NestHost class + static class MemberMissingHost {} + + // Invalid NestHost class (not instance class) + static class MemberNotInstanceHost { + Object[] oa; // create CP entry to use in jcod change + } + + // Valid but different NestHost class + static class MemberNotOurHost {} + + // Malformed NestHost class + static class MemberMalformedHost {} + + public static void main(String[] args) throws Throwable { + // run tests twice so that failure reasons are + // seen to remain the same + for (int i = 0; i < 2; i++) { + test_getNestHost(); + test_isNestmateOf(); + test_getNestMembers(); + } + } + + static void test_getNestHost() { + Class host = TestReflectionAPI.class; + + // sampling of "good" checks + + checkHost(host, host); + checkHost(Member.class, host); + Runnable r = new Runnable() { public void run() {}}; + checkHost(r.getClass(), host); + + // all the "bad" classes should report themselves as their + // own nest host - no exceptions should be thrown + Class[] allClasses = host.getDeclaredClasses(); + for (Class c : allClasses) { + if (c == Member.class) + continue; + checkHost(c, c); + } + checkHost(P1.PackagedNestHost.Member.class, + P1.PackagedNestHost.Member.class); + checkHost(P2.PackagedNestHost2.Member.class, + P2.PackagedNestHost2.Member.class); + + // test some 'special' classes + checkHost(int.class, int.class); // primitive + checkHost(Object[].class, Object[].class); // array + checkHost(Thread.State.class, Thread.class); // enum + checkHost(java.lang.annotation.Documented.class, // annotation + java.lang.annotation.Documented.class); + } + + static void test_isNestmateOf() { + Class host = TestReflectionAPI.class; + checkNestmates(host, host, true); + checkNestmates(Member.class, host, true); + Runnable r = new Runnable() { public void run() {}}; + checkNestmates(r.getClass(), host, true); + + // all the "bad" classes should report themselves as their + // own nest host - no exceptions should be thrown - so not + // nestmates + Class[] allClasses = host.getDeclaredClasses(); + for (Class c : allClasses) { + if (c == Member.class) + continue; + checkNestmates(host, c, false); + } + + // 'special' classes + checkNestmates(int.class, int.class, true); // primitive + checkNestmates(int.class, long.class, false); // primitive + checkNestmates(Object[].class, Object[].class, true); // array + checkNestmates(Object[].class, int[].class, false); // array + checkNestmates(Thread.State.class, Thread.class, true); // enum + checkNestmates(java.lang.annotation.Documented.class, // annotation + java.lang.annotation.Documented.class, true); + } + + static void test_getNestMembers() { + // Sampling of "good" checks + Class[] good = { Object.class, Object[].class, int.class}; + checkSingletonNests(good); + + // More thorough correctness check + checkNest(SampleNest.class, SampleNest.nestedTypes(), false); + + // Special cases - legal but not produced by javac + checkNest(HostWithSelfMember.class, + new Class[] { HostWithSelfMember.class, + HostWithSelfMember.Member.class }, + true); + checkNest(HostWithDuplicateMembers.class, + new Class[] { HostWithDuplicateMembers.class, + HostWithDuplicateMembers.Member1.class, + HostWithDuplicateMembers.Member2.class }, + true); + + // Hosts with "bad" members + Class[] bad = { + HostOfMemberNoHost.class, + HostOfMemberMissingHost.class, + HostOfMemberNotOurHost.class, + HostOfMemberNotInstanceHost.class, + HostOfMemberMalformedHost.class, + }; + Class[] exceptions = { + IncompatibleClassChangeError.class, + NoClassDefFoundError.class, + IncompatibleClassChangeError.class, + IncompatibleClassChangeError.class, + ClassFormatError.class, + }; + String[] messages = { + "Nest member HostOfMemberNoHost$MemberNoHost in HostOfMemberNoHost " + + "declares a different nest host of HostOfMemberNoHost$MemberNoHost", + "Unable to load nest-host class (NestHost) of " + + "HostOfMemberMissingHost$MemberMissingHost", + "Type HostOfMemberNotOurHost$MemberNotOurHost is not a nest member " + + "of InvalidNestHost: current type is not listed as a nest member", + "Type HostOfMemberNotInstanceHost$MemberNotInstanceHost is not a nest " + + "member of [LInvalidNestHost;: current type is not listed as a nest member", + "Incompatible magic value 3735928559 in class file MalformedHost", + }; + for (int i = 0; i < bad.length; i++) { + try { + bad[i].getNestMembers(); + throw new Error("getNestMembers() succeeded for class " + + bad[i].getName()); + } catch (LinkageError e) { + checkException(e, messages[i], exceptions[i]); + } + } + } + + static void checkException(Throwable actual, String msg, Class expected) { + if (!actual.getClass().equals(expected)) + throw new Error("Unexpected exception: got " + actual.getClass().getName() + + " but expected " + expected.getName()); + if (!actual.getMessage().contains(msg)) + throw new Error("Wrong " + actual.getClass().getSimpleName() +": \"" + + actual.getMessage() + "\" does not contain \"" + + msg + "\""); + System.out.println("OK - got expected exception: " + actual); + } + + static void checkHost(Class target, Class expected) { + System.out.println("Checking nest host of " + target.getName()); + Class host = target.getNestHost(); + if (host != expected) + throw new Error("Class " + target.getName() + + " has nest host " + host.getName() + + " but expected " + expected.getName()); + } + + static void checkNestmates(Class a, Class b, boolean mates) { + System.out.println("Checking if " + a.getName() + + " isNestmateOf " + b.getName()); + + if (a.isNestmateOf(b) != mates) + throw new Error("Class " + a.getName() + " is " + + (mates ? "not " : "") + + "a nestmate of " + b.getName() + " but should " + + (mates ? "" : "not ") + "be"); + } + + static Comparator> cmp = Comparator.comparing(Class::getName); + + static void checkNest(Class host, Class[] unsortedTypes, boolean expectDups) { + Class[] members = host.getNestMembers(); + Arrays.sort(members, cmp); + Class[] nestedTypes = unsortedTypes.clone(); + Arrays.sort(nestedTypes, cmp); + printMembers(host, members); + printDeclared(host, nestedTypes); + if (!Arrays.equals(members, nestedTypes)) { + if (!expectDups) { + throw new Error("Class " + host.getName() + " has different members " + + "compared to declared classes"); + } + else { + // get rid of duplicates + Class[] memberSet = + Arrays.stream(members).sorted(cmp).distinct().toArray(Class[]::new); + if (!Arrays.equals(memberSet, nestedTypes)) { + throw new Error("Class " + host.getName() + " has different members " + + "compared to declared classes, even after duplicate removal"); + } + } + } + // verify all the relationships that must hold for nest members + for (Class a : members) { + checkHost(a, host); + checkNestmates(a, host, true); + Class[] aMembers = a.getNestMembers(); + if (aMembers[0] != host) { + throw new Error("Class " + a.getName() + " getNestMembers()[0] = " + + aMembers[0].getName() + " not " + host.getName()); + + } + Arrays.sort(aMembers, cmp); + if (!Arrays.equals(members, aMembers)) { + throw new Error("Class " + a.getName() + " has different members " + + "compared to host " + host.getName()); + } + for (Class b : members) { + checkNestmates(a, b, true); + } + } + } + + static void checkSingletonNests(Class[] classes) { + for (Class host : classes) { + Class[] members = host.getNestMembers(); + if (members.length != 1) { + printMembers(host, members); + throw new Error("Class " + host.getName() + " lists " + members.length + + " members instead of 1 (itself)"); + } + if (members[0] != host) { + printMembers(host, members); + throw new Error("Class " + host.getName() + " lists " + + members[0].getName() + " as member instead of itself"); + } + } + } + + static void printMembers(Class host, Class[] members) { + System.out.println("Class " + host.getName() + " has members: "); + for (Class c : members) { + System.out.println(" - " + c.getName()); + } + } + + static void printDeclared(Class host, Class[] declared) { + System.out.println("Class " + host.getName() + " has declared types: "); + for (Class c : declared) { + System.out.println(" - " + c.getName()); + } + } + +} diff -Nru openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/TestSecurityManagerChecks.java openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/TestSecurityManagerChecks.java --- openjdk-11-11~19/test/jdk/java/lang/reflect/Nestmates/TestSecurityManagerChecks.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/lang/reflect/Nestmates/TestSecurityManagerChecks.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046171 + * @summary Test that security checks occur for getNestHost/getNestMembers + * + * @library /test/lib + * @build TestSecurityManagerChecks testPkg.Host testPkg.Singleton + * @run driver ClassFileInstaller testPkg.Host testPkg.Host$Member testPkg.Singleton + * @run main/othervm -Xbootclasspath/a:. TestSecurityManagerChecks + */ + +// ClassFileInstaller copies the testPkg files into the "current" directory +// so we can add it to the bootclasspath. Then when we run the test the +// loader for the testPkg files is the bootloader but the loader for the +// test class is the system loader, hence a package access check will fail +// because the system loader is not the same as, nor a parent of, the bootloader. +import java.security.Security; + +public class TestSecurityManagerChecks { + + public static void main(String[] args) throws Throwable { + + // First get hold of the target classes before we enable security + Class host = testPkg.Host.class; + Class member = testPkg.Host.Member.class; + Class memberArray = testPkg.Host.Member[].class; + Class singleton = testPkg.Singleton.class; + + // Next add testPkg to the set of packages for which package-access + // permission is required + Security.setProperty("package.access", + Security.getProperty("package.access") + ",testPkg."); + + // Finally install a default security manager + SecurityManager sm = new SecurityManager(); + System.setSecurityManager(sm); + + // These cases all succeed + getNestHost(int.class); // primitive + getNestHost(int[].class); // primitive[] + getNestHost(host); // host class + getNestHost(memberArray); // NestedT[] + getNestHost(singleton); // Singleton nest + + getNestMembers(int.class); // primitive + getNestMembers(int[].class); // primitive[] + getNestMembers(memberArray); // NestedT[] + getNestMembers(singleton); // Singleton nest + + // these cases all fail + getNestHostThrows(member); // NestedT + + getNestMembersThrows(member); // NestedT + getNestMembersThrows(host); // host class + } + + static void getNestHost(Class c) { + Class host = c.getNestHost(); + System.out.println("OK - getNestHost succeeded for " + c.getName()); + } + + static void getNestHostThrows(Class c) throws SecurityException { + try { + Class host = c.getNestHost(); + throw new Error("getNestHost succeeded for " + c.getName()); + } catch (SecurityException e) { + System.out.println("OK - getNestHost for " + c.getName() + + " got expected exception: " + e); + } + } + + static void getNestMembers(Class c) { + Class[] members = c.getNestMembers(); + System.out.println("OK - getNestMembers succeeded for " + c.getName()); + } + + static void getNestMembersThrows(Class c) throws SecurityException { + try { + Class[] members = c.getNestMembers(); + throw new Error("getNestMembers succeeded for " + c.getName()); + } catch (SecurityException e) { + System.out.println("OK - getNestMembers for " + c.getName() + + " got expected exception: " + e); + } + } + +} diff -Nru openjdk-11-11~19/test/jdk/java/net/httpclient/CancelledResponse.java openjdk-11-11~24/test/jdk/java/net/httpclient/CancelledResponse.java --- openjdk-11-11~19/test/jdk/java/net/httpclient/CancelledResponse.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/httpclient/CancelledResponse.java 2018-07-25 15:36:46.000000000 +0000 @@ -339,9 +339,11 @@ Thread.sleep(10); } out.println("sent " + s); - } catch (SSLException | SocketException x) { - // if SSL then we might get a "Broken Pipe", otherwise - // a "Socket closed". + } catch (SSLException | SocketException | RuntimeException x) { + // if SSL then we might get a "Broken Pipe", or a + // RuntimeException wrapping an InvalidAlgorithmParameterException + // (probably if the channel is closed during the handshake), + // otherwise we get a "Socket closed". boolean expected = cancelled.get(); if (sent > 0 && expected) { System.out.println("Connection closed by peer as expected: " + x); @@ -349,6 +351,7 @@ } else { System.out.println("Unexpected exception (sent=" + sent + ", cancelled=" + expected + "): " + x); + if (x instanceof RuntimeException) throw (RuntimeException) x; throw new RuntimeException(x); } } catch (IOException | InterruptedException e) { diff -Nru openjdk-11-11~19/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java openjdk-11-11~24/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java --- openjdk-11-11~19/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/httpclient/http2/FixedThreadPoolTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -177,13 +177,24 @@ System.err.println("DONE"); } + // expect highest supported version we know about + static String expectedTLSVersion(SSLContext ctx) { + SSLParameters params = ctx.getSupportedSSLParameters(); + String[] protocols = params.getProtocols(); + for (String prot : protocols) { + if (prot.equals("TLSv1.3")) + return "TLSv1.3"; + } + return "TLSv1.2"; + } + static void paramsTest() throws Exception { System.err.println("paramsTest"); Http2TestServer server = new Http2TestServer(true, 0, exec, sslContext); server.addHandler((t -> { SSLSession s = t.getSSLSession(); String prot = s.getProtocol(); - if (prot.equals("TLSv1.2")) { + if (prot.equals(expectedTLSVersion(sslContext))) { t.sendResponseHeaders(200, -1); } else { System.err.printf("Protocols =%s\n", prot); diff -Nru openjdk-11-11~19/test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java openjdk-11-11~24/test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java --- openjdk-11-11~19/test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java 2018-07-25 15:36:46.000000000 +0000 @@ -156,7 +156,7 @@ }; private SettingsFrame getServerSettingProperties() { - SettingsFrame s = SettingsFrame.getDefaultSettings(); + SettingsFrame s = SettingsFrame.defaultRFCSettings(); if (properties == null) return s; for (int i=0; i connect(uriString, USE_DEFAULT_SSL_PARAMETERS)); - success &= checkProtocol(handler.getSSLSession(), "TLSv1.2"); + success &= checkProtocol(handler.getSSLSession(), expectedTLSVersion(null)); // set SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA cipher suite // which has less priority in default cipher suite list diff -Nru openjdk-11-11~19/test/jdk/java/net/httpclient/MockServer.java openjdk-11-11~24/test/jdk/java/net/httpclient/MockServer.java --- openjdk-11-11~19/test/jdk/java/net/httpclient/MockServer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/httpclient/MockServer.java 2018-07-25 15:36:46.000000000 +0000 @@ -183,7 +183,8 @@ } catch (IOException |InterruptedException e1) { cleanup(); } catch (Throwable t) { - System.out.println("X: " + t); + System.out.println("Exception: " + t); + t.printStackTrace(); cleanup(); } } @@ -283,7 +284,7 @@ } try { socket.close(); - } catch (IOException e) {} + } catch (Throwable e) {} synchronized (removals) { removals.add(this); } @@ -338,7 +339,7 @@ closed = true; try { ss.close(); - } catch (IOException e) { + } catch (Throwable e) { e.printStackTrace(); } for (Connection c : sockets) { diff -Nru openjdk-11-11~19/test/jdk/java/net/httpclient/ShortResponseBody.java openjdk-11-11~24/test/jdk/java/net/httpclient/ShortResponseBody.java --- openjdk-11-11~19/test/jdk/java/net/httpclient/ShortResponseBody.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/httpclient/ShortResponseBody.java 2018-07-25 15:36:46.000000000 +0000 @@ -264,19 +264,47 @@ // can be used to prolong request body publication static final class InfiniteInputStream extends InputStream { + int count = 0; + int k16 = 0; @Override public int read() throws IOException { + if (++count == 1) { + System.out.println("Start sending 1 byte"); + } + if (count > 16 * 1024) { + k16++; + System.out.println("... 16K sent."); + count = count % (16 * 1024); + } + if (k16 > 128) { + System.out.println("WARNING: InfiniteInputStream: " + + "more than 128 16k buffers generated: returning EOF"); + return -1; + } return 1; } @Override public int read(byte[] buf, int offset, int length) { //int count = offset; - //length = Math.max(0, Math.min(buf.length - offset, length)); + length = Math.max(0, Math.min(buf.length - offset, length)); //for (; count < length; count++) // buf[offset++] = 0x01; //return count; - return Math.max(0, Math.min(buf.length - offset, length)); + if (count == 0) { + System.out.println("Start sending " + length); + } else if (count > 16 * 1024) { + k16++; + System.out.println("... 16K sent."); + count = count % (16 * 1024); + } + if (k16 > 128) { + System.out.println("WARNING: InfiniteInputStream: " + + "more than 128 16k buffers generated: returning EOF"); + return -1; + } + count += length; + return length; } } @@ -493,10 +521,13 @@ out.print(requestMethod + " "); URI uriPath = readRequestPath(is); out.println(uriPath); - readRequestHeaders(is); + String headers = readRequestHeaders(is); String query = uriPath.getRawQuery(); - assert query != null; + if (query == null) { + out.println("Request headers: [" + headers + "]"); + } + assert query != null : "null query for uriPath: " + uriPath; String qv = query.split("=")[1]; int len; if (qv.equals("all")) { @@ -542,9 +573,11 @@ } // Read until the end of a HTTP request headers - static void readRequestHeaders(InputStream is) throws IOException { + static String readRequestHeaders(InputStream is) throws IOException { int requestEndCount = 0, r; + StringBuilder sb = new StringBuilder(); while ((r = is.read()) != -1) { + sb.append((char) r); if (r == requestEnd[requestEndCount]) { requestEndCount++; if (requestEndCount == 4) { @@ -554,6 +587,7 @@ requestEndCount = 0; } } + return sb.toString(); } } diff -Nru openjdk-11-11~19/test/jdk/java/net/httpclient/SplitResponse.java openjdk-11-11~24/test/jdk/java/net/httpclient/SplitResponse.java --- openjdk-11-11~19/test/jdk/java/net/httpclient/SplitResponse.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/httpclient/SplitResponse.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,6 +32,7 @@ import java.util.concurrent.CompletableFuture; import javax.net.ssl.SSLContext; import javax.net.ServerSocketFactory; +import javax.net.ssl.SSLException; import javax.net.ssl.SSLServerSocketFactory; import java.net.http.HttpClient; import java.net.http.HttpClient.Version; @@ -268,7 +269,7 @@ String onechar = s.substring(i, i + 1); try { conn.send(onechar); - } catch(SocketException x) { + } catch(SocketException | SSLException x) { if (!useSSL || i != len - 1) throw x; if (x.getMessage().contains("closed by remote host")) { String osname = System.getProperty("os.name", "unknown"); diff -Nru openjdk-11-11~19/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/SSLEchoTubeTest.java openjdk-11-11~24/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/SSLEchoTubeTest.java --- openjdk-11-11~19/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/SSLEchoTubeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/SSLEchoTubeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -350,7 +350,7 @@ @Override public void cancel() { - cancelled.set(true); + queue.add(EOF); } } diff -Nru openjdk-11-11~19/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/WindowControllerTest.java openjdk-11-11~24/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/WindowControllerTest.java --- openjdk-11-11~19/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/WindowControllerTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/httpclient/whitebox/java.net.http/jdk/internal/net/http/WindowControllerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,147 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.internal.net.http; + +import org.testng.annotations.Test; +import static jdk.internal.net.http.frame.SettingsFrame.DEFAULT_INITIAL_WINDOW_SIZE; +import static org.testng.Assert.assertEquals; +import static org.testng.Assert.assertThrows; + +public class WindowControllerTest { + + @Test + public void testConnectionWindowOverflow() { + WindowController wc = new WindowController(); + assertEquals(wc.connectionWindowSize(), DEFAULT_INITIAL_WINDOW_SIZE); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.connectionWindowSize(), DEFAULT_INITIAL_WINDOW_SIZE); + + wc.registerStream(1, DEFAULT_INITIAL_WINDOW_SIZE); + wc.tryAcquire(DEFAULT_INITIAL_WINDOW_SIZE - 1, 1, null); + assertEquals(wc.connectionWindowSize(), 1); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.connectionWindowSize(), 1); + + wc.increaseConnectionWindow(Integer.MAX_VALUE - 1 -1); + assertEquals(wc.connectionWindowSize(), Integer.MAX_VALUE - 1); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.connectionWindowSize(), Integer.MAX_VALUE - 1); + + wc.increaseConnectionWindow(1); + assertEquals(wc.connectionWindowSize(), Integer.MAX_VALUE); + assertEquals(wc.increaseConnectionWindow(1), false); + assertEquals(wc.increaseConnectionWindow(100), false); + assertEquals(wc.increaseConnectionWindow(Integer.MAX_VALUE), false); + assertEquals(wc.connectionWindowSize(), Integer.MAX_VALUE); + } + + @Test + public void testStreamWindowOverflow() { + WindowController wc = new WindowController(); + wc.registerStream(1, DEFAULT_INITIAL_WINDOW_SIZE); + assertEquals(wc.increaseStreamWindow(Integer.MAX_VALUE, 1), false); + assertEquals(wc.increaseStreamWindow(Integer.MAX_VALUE, 1), false); + assertEquals(wc.increaseStreamWindow(Integer.MAX_VALUE, 1), false); + + wc.registerStream(3, DEFAULT_INITIAL_WINDOW_SIZE); + assertEquals(wc.increaseStreamWindow(100, 3), true); + assertEquals(wc.increaseStreamWindow(Integer.MAX_VALUE, 3), false); + assertEquals(wc.increaseStreamWindow(Integer.MAX_VALUE, 3), false); + + wc.registerStream(5, 0); + assertEquals(wc.increaseStreamWindow(Integer.MAX_VALUE, 5), true); + assertEquals(wc.increaseStreamWindow(1, 5), false); + assertEquals(wc.increaseStreamWindow(1, 5), false); + assertEquals(wc.increaseStreamWindow(10, 5), false); + + wc.registerStream(7, -1); + assertEquals(wc.increaseStreamWindow(Integer.MAX_VALUE, 7), true); + assertEquals(wc.increaseStreamWindow(1, 7), true); + assertEquals(wc.increaseStreamWindow(1, 7), false); + assertEquals(wc.increaseStreamWindow(10, 7), false); + + wc.registerStream(9, -1); + assertEquals(wc.increaseStreamWindow(1, 9), true); + assertEquals(wc.increaseStreamWindow(1, 9), true); + assertEquals(wc.increaseStreamWindow(1, 9), true); + assertEquals(wc.increaseStreamWindow(10, 9), true); + assertEquals(wc.increaseStreamWindow(Integer.MAX_VALUE, 9), false); + + wc.registerStream(11, -10); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.increaseStreamWindow(1, 11), true); + assertEquals(wc.streamWindowSize(11), 1); + assertEquals(wc.increaseStreamWindow(Integer.MAX_VALUE, 11), false); + assertEquals(wc.streamWindowSize(11), 1); + } + + @Test + public void testStreamAdjustment() { + WindowController wc = new WindowController(); + wc.registerStream(1, 100); + wc.registerStream(3, 100); + wc.registerStream(5, 100); + + // simulate some stream send activity before receiving the server's + // SETTINGS frame, and staying within the connection window size + wc.tryAcquire(49, 1 , null); + wc.tryAcquire(50, 3 , null); + wc.tryAcquire(51, 5 , null); + + wc.adjustActiveStreams(-200); + assertEquals(wc.streamWindowSize(1), -149); + assertEquals(wc.streamWindowSize(3), -150); + assertEquals(wc.streamWindowSize(5), -151); + } + + static final Class IE = InternalError.class; + + @Test + public void testRemoveStream() { + WindowController wc = new WindowController(); + wc.registerStream(1, 999); + wc.removeStream(1); + assertThrows(IE, () -> wc.tryAcquire(5, 1, null)); + + wc.registerStream(3, 999); + wc.tryAcquire(998, 3, null); + wc.removeStream(3); + assertThrows(IE, () -> wc.tryAcquire(5, 1, null)); + } +} diff -Nru openjdk-11-11~19/test/jdk/java/net/httpclient/whitebox/WindowControllerTestDriver.java openjdk-11-11~24/test/jdk/java/net/httpclient/whitebox/WindowControllerTestDriver.java --- openjdk-11-11~19/test/jdk/java/net/httpclient/whitebox/WindowControllerTestDriver.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/httpclient/whitebox/WindowControllerTestDriver.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8207960 + * @modules java.net.http/jdk.internal.net.http + * @summary Non-negative WINDOW_UPDATE increments may leave the stream window size negative + * @run testng/othervm java.net.http/jdk.internal.net.http.WindowControllerTest + */ diff -Nru openjdk-11-11~19/test/jdk/java/net/Socket/ExceptionText.java openjdk-11-11~24/test/jdk/java/net/Socket/ExceptionText.java --- openjdk-11-11~19/test/jdk/java/net/Socket/ExceptionText.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/net/Socket/ExceptionText.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,139 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @library /test/lib + * @build jdk.test.lib.Utils + * @bug 8204233 8207846 + * @summary Add configurable option for enhanced socket IOException messages + * @run main/othervm + * ExceptionText + * WITHOUT_Enhanced_Text + * @run main/othervm + * -Djdk.includeInExceptions= + * ExceptionText + * WITHOUT_Enhanced_Text + * @run main/othervm + * -Djdk.includeInExceptions=somethingElse + * ExceptionText + * WITHOUT_Enhanced_Text + * @run main/othervm + * -Djdk.includeInExceptions=blah,blah,blah, + * ExceptionText + * WITHOUT_Enhanced_Text + * @run main/othervm + * -Djdk.includeInExceptions=hostInfo + * ExceptionText + * expectEnhancedText + * @run main/othervm + * -Djdk.includeInExceptions=foo,hostinfo,bar + * ExceptionText + * expectEnhancedText + * @run main/othervm + * -Djdk.includeInExceptions=",HOSTINFO," + * ExceptionText + * expectEnhancedText + */ + +import java.io.IOException; +import java.net.InetSocketAddress; +import java.net.Socket; +import java.nio.channels.AsynchronousSocketChannel; +import java.nio.channels.ClosedChannelException; +import java.nio.channels.SocketChannel; +import java.util.concurrent.ExecutionException; +import jdk.test.lib.Utils; + +public class ExceptionText { + + enum TestTarget {SOCKET, CHANNEL, ASYNC_CHANNEL}; + + public static void main(String args[]) throws Exception { + String passOrFail = args[0]; + boolean expectEnhancedText; + if (passOrFail.equals("expectEnhancedText")) { + expectEnhancedText = true; + } else { + expectEnhancedText = false; + } + test(expectEnhancedText); + } + + static final InetSocketAddress dest = Utils.refusingEndpoint(); + static final String PORT = ":" + Integer.toString(dest.getPort()); + static final String HOST = dest.getHostString(); + + static void test(boolean withProperty) { + // Socket + IOException e = getException(TestTarget.SOCKET); + checkResult(e, withProperty); + // SocketChannel + e = getException(TestTarget.CHANNEL); + checkResult(e, withProperty); + // AsyncSocketChannel + e = getException(TestTarget.ASYNC_CHANNEL); + checkResult(e, withProperty); + } + + static void checkResult(IOException e, boolean withProperty) { + String msg = e.getMessage(); + if (!withProperty) { + if (msg.contains(HOST) || msg.contains(PORT)) { + System.err.println("msg = " + msg); + throw new RuntimeException("Test failed: exception contains address info"); + } + } else { + if (!msg.contains(HOST) || !msg.contains(PORT)) { + if (e instanceof ClosedChannelException) + return; // has no detail msg + System.err.println("msg = " + msg); + throw new RuntimeException("Test failed: exception does not contain address info"); + } + } + } + + static IOException getException(TestTarget target) { + try { + if (target == TestTarget.SOCKET) { + Socket s = new Socket(); + s.connect(dest); + } else if (target == TestTarget.CHANNEL) { + SocketChannel c = SocketChannel.open(dest); + } else if (target == TestTarget.ASYNC_CHANNEL) { + AsynchronousSocketChannel c = AsynchronousSocketChannel.open(); + try { + c.connect(dest).get(); + } catch (InterruptedException | ExecutionException ee) { + if (ee.getCause() instanceof IOException) + throw (IOException)ee.getCause(); + throw new RuntimeException(ee.getCause()); + } + } + return null; + } catch (IOException e) { + e.printStackTrace(); + return e; + } + } +} diff -Nru openjdk-11-11~19/test/jdk/java/nio/channels/FileChannel/CleanerTest.java openjdk-11-11~24/test/jdk/java/nio/channels/FileChannel/CleanerTest.java --- openjdk-11-11~19/test/jdk/java/nio/channels/FileChannel/CleanerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/nio/channels/FileChannel/CleanerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,7 +25,9 @@ * @bug 8147615 * @summary Test whether an unreferenced FileChannel is actually cleaned * @requires (os.family == "linux") | (os.family == "mac") | (os.family == "solaris") | (os.family == "aix") - * @modules java.management + * @library /test/lib + * @build jdk.test.lib.util.FileUtils CleanerTest + * @modules java.management java.base/sun.nio.ch:+open * @run main/othervm CleanerTest */ @@ -35,11 +37,19 @@ import java.lang.ref.PhantomReference; import java.lang.ref.Reference; import java.lang.ref.ReferenceQueue; +import java.lang.ref.PhantomReference; +import java.lang.ref.WeakReference; +import java.lang.reflect.Field; import java.nio.channels.FileChannel; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardOpenOption; +import java.util.HashSet; + +import jdk.test.lib.util.FileUtils; + +import sun.nio.ch.FileChannelImpl; public class CleanerTest { public static void main(String[] args) throws Throwable { @@ -53,32 +63,64 @@ return; } + FileUtils.listFileDescriptors(System.out); + long fdCount0 = unixMxBean.getOpenFileDescriptorCount(); + Path path = Paths.get(System.getProperty("test.dir", "."), "junk"); try { FileChannel fc = FileChannel.open(path, StandardOpenOption.CREATE, StandardOpenOption.READ, StandardOpenOption.WRITE); - ReferenceQueue refQueue = new ReferenceQueue(); - Reference fcRef = new PhantomReference(fc, refQueue); - - long fdCount0 = unixMxBean.getOpenFileDescriptorCount(); - fc = null; + // Prepare to wait for Channel, FD and Cleaner to be reclaimed + ReferenceQueue refQueue = new ReferenceQueue<>(); + HashSet> pending = new HashSet<>(); + + Reference fcRef = new PhantomReference<>(fc, refQueue); + pending.add(fcRef); + + Field fdField = FileChannelImpl.class.getDeclaredField("fd"); + fdField.setAccessible(true); + Object fd = fdField.get(fc); // get the fd from the channel + WeakReference fdWeak = new WeakReference<>(fd, refQueue); + pending.add(fdWeak); + + Field closerField = FileChannelImpl.class.getDeclaredField("closer"); + closerField.setAccessible(true); + Object closer = closerField.get(fc); + System.out.printf(" cleanup: %s, fd: %s, cf: %s%n", fc, fd, closer); + + if (closer != null) { + WeakReference closerWeak = new WeakReference<>(closer, refQueue); + pending.add(closerWeak); + System.out.printf(" closerWeak: %s%n", closerWeak); + } - // Perform repeated GCs until the reference has been enqueued. - do { - Thread.sleep(1); - System.gc(); - } while (refQueue.poll() == null); - - // Loop until the open file descriptor count has been decremented. - while (unixMxBean.getOpenFileDescriptorCount() > fdCount0 - 1) { - Thread.sleep(1); + // Wait for all of the objects being tracked to be reclaimed; + // The test will timeout if they are not reclaimed within the jtreg timeout + Reference r; + while (((r = refQueue.remove(1000L)) != null) + || !pending.isEmpty()) { + System.out.printf(" r: %s, pending: %d%n", r, pending.size()); + if (r != null) { + pending.remove(r); + } else { + fc = null; + fd = null; + closer = null; + System.gc(); // attempt to reclaim them + } } + Reference.reachabilityFence(fc); + Reference.reachabilityFence(fd); + Reference.reachabilityFence(closer); + long fdCount = unixMxBean.getOpenFileDescriptorCount(); - if (fdCount != fdCount0 - 1) { - throw new RuntimeException("FD count expected " + - (fdCount0 - 1) + "; actual " + fdCount); + if (fdCount != fdCount0) { + // Add debugging info about file descriptor changes + System.out.printf("initial count of open file descriptors: %d%n", fdCount0); + System.out.printf("final count of open file descriptors: %d%n", fdCount); + FileUtils.listFileDescriptors(System.out); } } finally { Files.delete(path); diff -Nru openjdk-11-11~19/test/jdk/java/nio/channels/FileChannel/TempDirectBuffersReclamation.java openjdk-11-11~24/test/jdk/java/nio/channels/FileChannel/TempDirectBuffersReclamation.java --- openjdk-11-11~19/test/jdk/java/nio/channels/FileChannel/TempDirectBuffersReclamation.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/nio/channels/FileChannel/TempDirectBuffersReclamation.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,91 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.io.IOException; +import java.io.UncheckedIOException; +import java.lang.management.BufferPoolMXBean; +import java.lang.management.ManagementFactory; +import java.nio.ByteBuffer; +import java.nio.channels.FileChannel; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; + +import static java.nio.file.StandardOpenOption.CREATE; +import static java.nio.file.StandardOpenOption.TRUNCATE_EXISTING; +import static java.nio.file.StandardOpenOption.WRITE; + +/* + * @test + * @bug 8202788 + * @summary Test reclamation of thread-local temporary direct byte buffers at thread exit + * @modules java.management + * @run main/othervm TempDirectBuffersReclamation + */ +public class TempDirectBuffersReclamation { + + public static void main(String[] args) throws IOException { + + BufferPoolMXBean dbPool = ManagementFactory + .getPlatformMXBeans(BufferPoolMXBean.class) + .stream() + .filter(bp -> bp.getName().equals("direct")) + .findFirst() + .orElseThrow(() -> new RuntimeException("Can't obtain direct BufferPoolMXBean")); + + long count0 = dbPool.getCount(); + long memoryUsed0 = dbPool.getMemoryUsed(); + + Thread thread = new Thread(TempDirectBuffersReclamation::doFileChannelWrite); + thread.start(); + try { + thread.join(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + + long count1 = dbPool.getCount(); + long memoryUsed1 = dbPool.getMemoryUsed(); + + if (count0 != count1 || memoryUsed0 != memoryUsed1) { + throw new AssertionError( + "Direct BufferPool not same before thread activity and after thread exit.\n" + + "Before: # of buffers: " + count0 + ", memory used: " + memoryUsed0 + "\n" + + " After: # of buffers: " + count1 + ", memory used: " + memoryUsed1 + "\n" + ); + } + } + + static void doFileChannelWrite() { + try { + Path file = Files.createTempFile("test", ".tmp"); + try (FileChannel fc = FileChannel.open(file, CREATE, WRITE, TRUNCATE_EXISTING)) { + fc.write(ByteBuffer.wrap("HELLO".getBytes(StandardCharsets.UTF_8))); + } finally { + Files.delete(file); + } + } catch (IOException e) { + throw new UncheckedIOException(e); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/java/nio/channels/Selector/RacyDeregister.java openjdk-11-11~24/test/jdk/java/nio/channels/Selector/RacyDeregister.java --- openjdk-11-11~19/test/jdk/java/nio/channels/Selector/RacyDeregister.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/nio/channels/Selector/RacyDeregister.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,7 +34,7 @@ /* * @test - * @bug 6429204 8203766 + * @bug 6429204 8203766 8205641 * @summary SelectionKey.interestOps does not update interest set on Windows. * @author Frank Ding * @run main/timeout=1200 RacyDeregister @@ -91,6 +91,9 @@ public void run() { try { for (int k = 0; k < NUM_OUTER_LOOP_ITERATIONS; k++) { + System.out.format("outer loop %3d at %7d ms%n", k, + System.currentTimeMillis() - t0); + System.out.flush(); for (int i = 0; i < 10000; i++) { synchronized (notifyLock) { synchronized (selectorLock) { @@ -115,6 +118,7 @@ System.err.printf ("Notified after %d ms%n", t - beginTime); + System.err.flush(); break; } } @@ -130,6 +134,7 @@ if (t - t0 > TIMEOUT_THRESHOLD_MILLIS) { System.err.format ("Timeout after %d outer loop iterations%n", k); + System.err.flush(); succTermination = false; // wake up main thread doing select() sel.wakeup(); @@ -141,6 +146,7 @@ sel.wakeup(); } catch (Exception e) { System.out.println(e); + System.out.flush(); succTermination = true; // wake up main thread doing select() sel.wakeup(); @@ -153,11 +159,13 @@ sel.select(); if (Boolean.TRUE.equals(succTermination)) { System.out.println("Test passed"); + System.out.flush(); sel.close(); sc.close(); break; } else if (Boolean.FALSE.equals(succTermination)) { System.err.println("Failed to pass the test"); + System.err.flush(); sel.close(); sc.close(); throw new RuntimeException("Failed to pass the test"); diff -Nru openjdk-11-11~19/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java openjdk-11-11~24/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java --- openjdk-11-11~19/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/nio/channels/Selector/RegisterDuringSelect.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,6 +28,7 @@ */ import java.io.IOException; +import java.nio.channels.ClosedSelectorException; import java.nio.channels.Pipe; import java.nio.channels.SelectionKey; import java.nio.channels.Selector; @@ -44,9 +45,14 @@ @Override public Void call() throws IOException { for (;;) { - sel.select(); + try { + sel.select(); + } catch (ClosedSelectorException ignore) { + return null; + } if (sel.isOpen()) { barrier.arriveAndAwaitAdvance(); + System.out.println("selectLoop advanced ..."); } else { // closed return null; @@ -107,3 +113,4 @@ } } + diff -Nru openjdk-11-11~19/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java openjdk-11-11~24/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java --- openjdk-11-11~19/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/nio/channels/Selector/SelectWithConsumer.java 2018-07-25 15:36:46.000000000 +0000 @@ -411,8 +411,6 @@ int n = sel.select(k -> assertTrue(false), 60*1000); long duration = System.currentTimeMillis() - start; assertTrue(n == 0); - assertTrue(duration > 500 && duration < 5000, - "select took " + duration + " ms"); assertTrue(Thread.currentThread().isInterrupted()); assertTrue(sel.isOpen()); } finally { @@ -550,12 +548,18 @@ // write to sink to ensure that the source is readable sink.write(messageBuffer()); - sink.configureBlocking(false); source.configureBlocking(false); - SelectionKey key1 = sink.register(sel, SelectionKey.OP_WRITE); - SelectionKey key2 = source.register(sel, SelectionKey.OP_READ); + SelectionKey key1 = source.register(sel, SelectionKey.OP_READ); + // make sure pipe source is readable before we do following checks. + // this is sometime necessary on windows where pipe is implemented + // as a pair of connected socket, so there is no guarantee that written + // bytes on sink side is immediately available on source side. + sel.select(); + sink.configureBlocking(false); + SelectionKey key2 = sink.register(sel, SelectionKey.OP_WRITE); sel.selectNow(); + assertTrue(sel.keys().contains(key1)); assertTrue(sel.keys().contains(key2)); assertTrue(sel.selectedKeys().contains(key1)); diff -Nru openjdk-11-11~19/test/jdk/java/nio/file/Files/CallWithInterruptSet.java openjdk-11-11~24/test/jdk/java/nio/file/Files/CallWithInterruptSet.java --- openjdk-11-11~19/test/jdk/java/nio/file/Files/CallWithInterruptSet.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/nio/file/Files/CallWithInterruptSet.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8205612 + * @run testng CallWithInterruptSet + * @summary Test invoking Files methods with the interrupt status set + */ + +import java.io.InputStream; +import java.io.OutputStream; +import java.io.IOException; +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.Reader; +import java.io.Writer; +import java.nio.file.Files; +import java.nio.file.Path; + +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +public class CallWithInterruptSet { + + @Test + public void testReadAllBytes() throws Exception { + Path file = mkfile(100); + Thread.currentThread().interrupt(); + try { + byte[] bytes = Files.readAllBytes(file); + assertTrue(bytes.length == 100); + } finally { + assertTrue(Thread.interrupted()); // clear interrupt + } + } + + @Test + public void testInputStream() throws IOException { + Path file = mkfile(100); + Thread.currentThread().interrupt(); + try (InputStream in = Files.newInputStream(file)) { + int n = in.read(new byte[10]); + assertTrue(n > 0); + } finally { + assertTrue(Thread.interrupted()); // clear interrupt + } + } + + @Test + public void testOutputStream() throws Exception { + Path file = mkfile(); + try (OutputStream out = Files.newOutputStream(file)) { + Thread.currentThread().interrupt(); + out.write(new byte[10]); + } finally { + assertTrue(Thread.interrupted()); // clear interrupt + } + assertTrue(Files.size(file) == 10); + } + + @Test + public void testReadString() throws Exception { + Path file = mkfile(); + Files.writeString(file, "hello"); + Thread.currentThread().interrupt(); + try { + String msg = Files.readString(file); + assertEquals(msg, "hello"); + } finally { + assertTrue(Thread.interrupted()); // clear interrupt + } + } + + @Test + public void testWriteString() throws Exception { + Path file = mkfile(); + Thread.currentThread().interrupt(); + try { + Files.writeString(file, "hello"); + } finally { + assertTrue(Thread.interrupted()); // clear interrupt + } + String msg = Files.readString(file); + assertEquals(msg, "hello"); + } + + @Test + public void testBufferedReader() throws Exception { + Path file = mkfile(); + Files.writeString(file, "hello"); + Thread.currentThread().interrupt(); + try (BufferedReader reader = Files.newBufferedReader(file)) { + String msg = reader.readLine(); + assertEquals(msg, "hello"); + } finally { + assertTrue(Thread.interrupted()); // clear interrupt + } + } + + @Test + public void testBufferedWriter() throws Exception { + Path file = mkfile(); + Thread.currentThread().interrupt(); + try (BufferedWriter writer = Files.newBufferedWriter(file)) { + writer.write("hello"); + } finally { + assertTrue(Thread.interrupted()); // clear interrupt + } + String msg = Files.readString(file); + assertEquals(msg, "hello"); + } + + private Path mkfile() throws IOException { + return Files.createTempFile(Path.of("."), "tmp", "tmp"); + } + + private Path mkfile(int size) throws IOException { + return Files.write(mkfile(), new byte[size]); + } + +} diff -Nru openjdk-11-11~19/test/jdk/java/nio/file/Files/ReadWriteString.java openjdk-11-11~24/test/jdk/java/nio/file/Files/ReadWriteString.java --- openjdk-11-11~19/test/jdk/java/nio/file/Files/ReadWriteString.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/nio/file/Files/ReadWriteString.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,8 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.nio.charset.Charset; +import java.nio.charset.MalformedInputException; +import java.nio.charset.UnmappableCharacterException; import static java.nio.charset.StandardCharsets.US_ASCII; import static java.nio.charset.StandardCharsets.ISO_8859_1; import static java.nio.charset.StandardCharsets.UTF_8; @@ -31,8 +33,8 @@ import java.nio.file.OpenOption; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.StandardOpenOption; import static java.nio.file.StandardOpenOption.APPEND; +import static java.nio.file.StandardOpenOption.CREATE; import java.util.Random; import java.util.concurrent.Callable; import static org.testng.Assert.assertTrue; @@ -43,7 +45,7 @@ import org.testng.annotations.Test; /* @test - * @bug 8201276 + * @bug 8201276 8205058 * @build ReadWriteString PassThroughFileSystem * @run testng ReadWriteString * @summary Unit test for methods for Files readString and write methods. @@ -52,7 +54,6 @@ @Test(groups = "readwrite") public class ReadWriteString { - private static final OpenOption OPTION_CREATE = StandardOpenOption.CREATE; // data for text files private static final String EN_STRING = "The quick brown fox jumps over the lazy dog"; private static final String JA_STRING = "\u65e5\u672c\u8a9e\u6587\u5b57\u5217"; @@ -74,7 +75,8 @@ baos.write(str2.getBytes()); return baos.toByteArray(); } catch (IOException ex) { - return null; //shouldn't happen + // in case it happens, fail the test + throw new RuntimeException(ex); } } @@ -125,20 +127,20 @@ */ @Test public void testNulls() { - Path path = Paths.get("."); + Path path = Paths.get("foo"); String s = "abc"; checkNullPointerException(() -> Files.readString((Path) null)); checkNullPointerException(() -> Files.readString((Path) null, UTF_8)); checkNullPointerException(() -> Files.readString(path, (Charset) null)); - checkNullPointerException(() -> Files.writeString((Path) null, s, OPTION_CREATE)); - checkNullPointerException(() -> Files.writeString(path, (CharSequence) null, OPTION_CREATE)); + checkNullPointerException(() -> Files.writeString((Path) null, s, CREATE)); + checkNullPointerException(() -> Files.writeString(path, (CharSequence) null, CREATE)); checkNullPointerException(() -> Files.writeString(path, s, (OpenOption[]) null)); - checkNullPointerException(() -> Files.writeString((Path) null, s, UTF_8, OPTION_CREATE)); - checkNullPointerException(() -> Files.writeString(path, (CharSequence) null, UTF_8, OPTION_CREATE)); - checkNullPointerException(() -> Files.writeString(path, s, (Charset) null, OPTION_CREATE)); + checkNullPointerException(() -> Files.writeString((Path) null, s, UTF_8, CREATE)); + checkNullPointerException(() -> Files.writeString(path, (CharSequence) null, UTF_8, CREATE)); + checkNullPointerException(() -> Files.writeString(path, s, (Charset) null, CREATE)); checkNullPointerException(() -> Files.writeString(path, s, UTF_8, (OpenOption[]) null)); } @@ -168,13 +170,13 @@ * @param cs the Charset * @throws IOException if the input is malformed */ - @Test(dataProvider = "malformedWrite", expectedExceptions = IOException.class) + @Test(dataProvider = "malformedWrite", expectedExceptions = UnmappableCharacterException.class) public void testMalformedWrite(Path path, String s, Charset cs) throws IOException { path.toFile().deleteOnExit(); if (cs == null) { - Files.writeString(path, s, OPTION_CREATE); + Files.writeString(path, s, CREATE); } else { - Files.writeString(path, s, cs, OPTION_CREATE); + Files.writeString(path, s, cs, CREATE); } } @@ -188,11 +190,11 @@ * @param csRead the Charset to use for reading the file * @throws IOException when the Charset used for reading the file is incorrect */ - @Test(dataProvider = "illegalInput", expectedExceptions = IOException.class) + @Test(dataProvider = "illegalInput", expectedExceptions = MalformedInputException.class) public void testMalformedRead(Path path, byte[] data, Charset csWrite, Charset csRead) throws IOException { path.toFile().deleteOnExit(); String temp = new String(data, csWrite); - Files.writeString(path, temp, csWrite, OPTION_CREATE); + Files.writeString(path, temp, csWrite, CREATE); String s; if (csRead == null) { s = Files.readString(path); @@ -212,7 +214,6 @@ } private void testReadWrite(int size, Charset cs, boolean append) throws IOException { - StringBuilder sb = new StringBuilder(size); String expected; String str = generateString(size); Path result; @@ -235,8 +236,7 @@ if (append) { - sb.append(str).append(str); - expected = sb.toString(); + expected = str + str; } else { expected = str; } @@ -247,14 +247,12 @@ } else { read = Files.readString(result, cs); } - //System.out.println("chars read: " + read.length()); - //System.out.println(read); - //System.out.println("---end---"); + assertTrue(read.equals(expected), "String read not the same as written"); } static final char[] CHARS = "abcdefghijklmnopqrstuvwxyz \r\n".toCharArray(); - StringBuilder sb = new StringBuilder(512); + StringBuilder sb = new StringBuilder(1024 << 4); Random random = new Random(); private String generateString(int size) { diff -Nru openjdk-11-11~19/test/jdk/java/security/KeyStore/ProbeKeystores.java openjdk-11-11~24/test/jdk/java/security/KeyStore/ProbeKeystores.java --- openjdk-11-11~19/test/jdk/java/security/KeyStore/ProbeKeystores.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/security/KeyStore/ProbeKeystores.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,7 @@ /* * @test - * @bug 8044445 8194307 + * @bug 8044445 8194307 8207318 * @summary test new methods from JEP-229: Create PKCS12 Keystores by Default */ @@ -180,7 +180,8 @@ throw new Exception("ERROR: expected a " + type + " keystore, " + "got a " + ks.getType() + " keystore instead"); } else { - System.out.println("Probed a " + type + " keystore named '" + file + "'"); + System.out.println("Probed a " + type + " keystore named '" + file + + "' with " + ks.size() + " entries"); } // Next try with an incorrect password @@ -197,7 +198,8 @@ throw new Exception("ERROR: expected a " + type + " keystore, " + "got a " + ks.getType() + " keystore instead"); } else { - System.out.println("Probed a " + type + " keystore named '" + file + "'"); + System.out.println("Probed a " + type + " keystore named '" + file + + "' with " + ks.size() + " entries"); } // Next try with an incorrect password within a LoadStoreParameter diff -Nru openjdk-11-11~19/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java openjdk-11-11~24/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java --- openjdk-11-11~19/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/time/test/java/time/format/TestZoneTextPrinterParser.java 2018-07-25 15:36:46.000000000 +0000 @@ -49,7 +49,7 @@ /* * @test - * @bug 8081022 8151876 8166875 8189784 + * @bug 8081022 8151876 8166875 8189784 8206980 * @key randomness */ @@ -156,12 +156,15 @@ {"America/Chicago", "CST", none, Locale.ENGLISH, TextStyle.SHORT}, {"Asia/Taipei", "CST", preferred, Locale.ENGLISH, TextStyle.SHORT}, {"Australia/South", "ACST", preferred_s, Locale.ENGLISH, TextStyle.SHORT}, - {"America/Chicago", "CDT", none, Locale.ENGLISH, TextStyle.SHORT}, + {"America/Chicago", "CDT", none, Locale.ENGLISH, TextStyle.SHORT}, {"Asia/Shanghai", "CDT", preferred_s, Locale.ENGLISH, TextStyle.SHORT}, - {"America/Juneau", "AKST", none, Locale.ENGLISH, TextStyle.SHORT}, - {"America/Juneau", "AKDT", none, Locale.ENGLISH, TextStyle.SHORT}, - {"Pacific/Honolulu", "HST", none, Locale.ENGLISH, TextStyle.SHORT}, - {"America/Halifax", "AST", none, Locale.ENGLISH, TextStyle.SHORT}, + {"America/Juneau", "AKST", none, Locale.ENGLISH, TextStyle.SHORT}, + {"America/Juneau", "AKDT", none, Locale.ENGLISH, TextStyle.SHORT}, + {"Pacific/Honolulu", "HST", none, Locale.ENGLISH, TextStyle.SHORT}, + {"America/Halifax", "AST", none, Locale.ENGLISH, TextStyle.SHORT}, + {"Z", "Z", none, Locale.ENGLISH, TextStyle.SHORT}, + {"Z", "Z", none, Locale.US, TextStyle.SHORT}, + {"Z", "Z", none, Locale.CANADA, TextStyle.SHORT}, }; } diff -Nru openjdk-11-11~19/test/jdk/java/util/Arrays/TimSortStackSize2.java openjdk-11-11~24/test/jdk/java/util/Arrays/TimSortStackSize2.java --- openjdk-11-11~19/test/jdk/java/util/Arrays/TimSortStackSize2.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/Arrays/TimSortStackSize2.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,6 +24,8 @@ /* * @test * @bug 8072909 + * @summary Test TimSort stack size on big arrays + * @key intermittent * @library /lib/testlibrary /test/lib * @modules java.management * java.base/jdk.internal @@ -33,8 +35,6 @@ * sun.hotspot.WhiteBox$WhiteBoxPermission * @run main/othervm -Xbootclasspath/a:. -XX:+UnlockDiagnosticVMOptions * -XX:+WhiteBoxAPI TimSortStackSize2 - * @summary Test TimSort stack size on big arrays - * @key intermittent */ import java.util.ArrayList; import java.util.Arrays; @@ -64,22 +64,20 @@ */ try { Boolean compressedOops = WhiteBox.getWhiteBox() - .getBooleanVMFlag("UseCompressedOops"); + .getBooleanVMFlag("UseCompressedOops"); long memory = (compressedOops == null || compressedOops) ? 385 : 770; - final String xmsValue = "-Xms" + memory + "m"; - final String xmxValue = "-Xmx" + memory + "m"; + final String xmsValue = "-Xms" + memory + "m"; + final String xmxValue = "-Xmx" + 2 * memory + "m"; System.out.printf("compressedOops: %s; Test will be started with \"%s %s\"%n", compressedOops, xmsValue, xmxValue); - ProcessBuilder processBuilder = ProcessTools - .createJavaProcessBuilder(Utils.addTestJavaOpts(xmsValue, xmxValue, - "TimSortStackSize2", "67108864" - ) - ); - OutputAnalyzer output = ProcessTools.executeProcess(processBuilder); + OutputAnalyzer output = ProcessTools.executeTestJava(xmsValue, + xmxValue, + "TimSortStackSize2", + "67108864"); System.out.println(output.getOutput()); output.shouldHaveExitValue(0); - } catch( Exception e ){ + } catch (Exception e) { e.printStackTrace(); throw new RuntimeException(e); } diff -Nru openjdk-11-11~19/test/jdk/java/util/Calendar/JapaneseEraNameTest.java openjdk-11-11~24/test/jdk/java/util/Calendar/JapaneseEraNameTest.java --- openjdk-11-11~19/test/jdk/java/util/Calendar/JapaneseEraNameTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/Calendar/JapaneseEraNameTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,7 @@ /* * @test - * @bug 8202088 + * @bug 8202088 8207152 * @summary Test the localized Japanese new era name (May 1st. 2019-) * is retrieved no matter CLDR provider contains the name or not. * @modules jdk.localedata @@ -51,7 +51,7 @@ Object[][] names() { return new Object[][] { // type, locale, name - { LONG, JAPAN, "\u65b0\u5143\u53f7" }, // NewEra + { LONG, JAPAN, "\u5143\u53f7" }, // NewEra { LONG, US, "NewEra" }, { SHORT, JAPAN, "N" }, { SHORT, US, "N" }, diff -Nru openjdk-11-11~19/test/jdk/java/util/Collection/HotPotatoes.java openjdk-11-11~24/test/jdk/java/util/Collection/HotPotatoes.java --- openjdk-11-11~19/test/jdk/java/util/Collection/HotPotatoes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/Collection/HotPotatoes.java 2018-07-25 15:36:46.000000000 +0000 @@ -70,7 +70,8 @@ System.out.printf("implClazz=%s, argClazz=%s\n", implClazz.getName(), argClazz.getName()); final int iterations = 100000; - final List list = (List) argClazz.newInstance(); + final List list = (List) + argClazz.getDeclaredConstructor().newInstance(); final Integer one = Integer.valueOf(1); final List oneElementList = Collections.singletonList(one); final Constructor constr diff -Nru openjdk-11-11~19/test/jdk/java/util/Collection/IteratorMicroBenchmark.java openjdk-11-11~24/test/jdk/java/util/Collection/IteratorMicroBenchmark.java --- openjdk-11-11~19/test/jdk/java/util/Collection/IteratorMicroBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/Collection/IteratorMicroBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -325,7 +325,7 @@ } @SafeVarargs @SuppressWarnings("varargs") - private Stream concatStreams(Stream ... streams) { + private static Stream concatStreams(Stream ... streams) { return Stream.of(streams).flatMap(s -> s); } diff -Nru openjdk-11-11~19/test/jdk/java/util/Collection/MOAT.java openjdk-11-11~24/test/jdk/java/util/Collection/MOAT.java --- openjdk-11-11~19/test/jdk/java/util/Collection/MOAT.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/Collection/MOAT.java 2018-07-25 15:36:46.000000000 +0000 @@ -415,6 +415,7 @@ equal(c.toString(),"[]"); equal(c.toArray().length, 0); equal(c.toArray(new Object[0]).length, 0); + equal(c.toArray(Object[]::new).length, 0); check(c.toArray(new Object[]{42})[0] == null); Object[] a = new Object[1]; a[0] = Boolean.TRUE; @@ -690,6 +691,13 @@ check(a.getClass() == Integer[].class); } + { + Integer[] a = c.toArray(Integer[]::new); + equal(c.size(), a.length); + check(a.getClass() == Integer[].class); + check(Arrays.equals(c.toArray(new Integer[0]), a)); + } + check(c.equals(c)); if (c instanceof Serializable) { //System.out.printf("Serializing %s%n", c.getClass().getName()); diff -Nru openjdk-11-11~19/test/jdk/java/util/Collection/RemoveMicroBenchmark.java openjdk-11-11~24/test/jdk/java/util/Collection/RemoveMicroBenchmark.java --- openjdk-11-11~19/test/jdk/java/util/Collection/RemoveMicroBenchmark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/Collection/RemoveMicroBenchmark.java 2018-07-25 15:36:46.000000000 +0000 @@ -284,7 +284,7 @@ } @SafeVarargs @SuppressWarnings("varargs") - private Stream concatStreams(Stream ... streams) { + private static Stream concatStreams(Stream ... streams) { return Stream.of(streams).flatMap(s -> s); } diff -Nru openjdk-11-11~19/test/jdk/java/util/Collections/DelegatingIteratorForEachRemaining.java openjdk-11-11~24/test/jdk/java/util/Collections/DelegatingIteratorForEachRemaining.java --- openjdk-11-11~19/test/jdk/java/util/Collections/DelegatingIteratorForEachRemaining.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/Collections/DelegatingIteratorForEachRemaining.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,198 @@ +/* + * Copyright (c) 2018 Google Inc. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @run junit DelegatingIteratorForEachRemaining + */ + +import org.junit.Assert; +import org.junit.Test; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.Objects; +import java.util.Set; +import java.util.Spliterator; +import java.util.function.BiConsumer; +import java.util.function.BiFunction; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Stream; + +public class DelegatingIteratorForEachRemaining { + + static abstract class ForwardingIterator implements Iterator { + private final Iterator delegate; + + protected ForwardingIterator(Iterator delegate) { + this.delegate = Objects.requireNonNull(delegate); + } + + @Override public boolean hasNext() { return delegate.hasNext(); } + @Override public E next() { return delegate.next(); } + @Override public void remove() { delegate.remove(); } + @Override public void forEachRemaining(Consumer action) { + delegate.forEachRemaining(action); + } + } + + static final class ThrowingIterator extends ForwardingIterator { + public ThrowingIterator(Iterator delegate) { + super(delegate); + } + + @Override + public void forEachRemaining(Consumer action) { + throw new UnsupportedOperationException(); + } + } + + static abstract class ForwardingSet implements Set { + private final Set delegate; + + protected ForwardingSet(Set delegate) { + this.delegate = Objects.requireNonNull(delegate); + } + + @Override public int size() { return delegate.size(); } + @Override public boolean isEmpty() { return delegate.isEmpty(); } + @Override public boolean contains(Object o) { return delegate.contains(o); } + @Override public Iterator iterator() { return delegate.iterator(); } + @Override public Object[] toArray() { return delegate.toArray(); } + @Override public T[] toArray( T[] ts) { return delegate.toArray(ts); } + @Override public boolean add(E e) { return delegate.add(e); } + @Override public boolean remove(Object o) { return delegate.remove(o); } + @Override public boolean containsAll( Collection c) { return delegate.containsAll(c); } + @Override public boolean addAll( Collection c) { return delegate.addAll(c); } + @Override public boolean retainAll( Collection c) { return delegate.retainAll(c); } + @Override public boolean removeAll( Collection c) { return delegate.removeAll(c); } + @Override public void clear() { delegate.clear(); } + @Override public boolean equals(Object o) { return delegate.equals(o); } + @Override public int hashCode() { return delegate.hashCode(); } + @Override public Spliterator spliterator() { return delegate.spliterator(); } + @Override public boolean removeIf(Predicate filter) { return delegate.removeIf(filter); } + @Override public Stream stream() { return delegate.stream(); } + @Override public Stream parallelStream() { return delegate.parallelStream(); } + @Override public void forEach(Consumer action) { delegate.forEach(action); } + } + + static class ThrowingSet extends ForwardingSet { + public ThrowingSet(Set delegate) { + super(delegate); + } + + @Override + public ThrowingIterator iterator() { + return new ThrowingIterator<>(super.iterator()); + } + } + + static abstract class ForwardingMap implements Map { + private final Map delegate; + + public ForwardingMap(Map delegate) { + this.delegate = delegate; + } + + @Override public int size() { return delegate.size(); } + @Override public boolean isEmpty() { return delegate.isEmpty(); } + @Override public boolean containsKey(Object o) { return delegate.containsKey(o); } + @Override public boolean containsValue(Object o) { return delegate.containsValue(o); } + @Override public V get(Object o) { return delegate.get(o); } + @Override public V put(K k, V v) { return delegate.put(k, v); } + @Override public V remove(Object o) { return delegate.remove(o); } + @Override public void putAll(Map map) { delegate.putAll(map); } + @Override public void clear() { delegate.clear(); } + @Override public Set keySet() { return delegate.keySet(); } + @Override public Collection values() { return delegate.values(); } + @Override public Set> entrySet() { return delegate.entrySet(); } + @Override public boolean equals(Object o) { return delegate.equals(o); } + @Override public int hashCode() { return delegate.hashCode(); } + @Override public V getOrDefault(Object key, V defaultValue) { return delegate.getOrDefault(key, defaultValue); } + @Override public void forEach(BiConsumer action) { delegate.forEach(action); } + @Override public void replaceAll(BiFunction function) { delegate.replaceAll(function); } + @Override public V putIfAbsent(K key, V value) { return delegate.putIfAbsent(key, value); } + @Override public boolean remove(Object key, Object value) { return delegate.remove(key, value); } + @Override public boolean replace(K key, V oldValue, V newValue) { return delegate.replace(key, oldValue, newValue); } + @Override public V replace(K key, V value) { return delegate.replace(key, value); } + @Override public V computeIfAbsent(K key, Function mappingFunction) { return delegate.computeIfAbsent(key, mappingFunction); } + @Override public V computeIfPresent(K key, BiFunction remappingFunction) { return delegate.computeIfPresent(key, remappingFunction); } + @Override public V compute(K key, BiFunction remappingFunction) { return delegate.compute(key, remappingFunction); } + @Override public V merge(K key, V value, BiFunction remappingFunction) { return delegate.merge(key, value, remappingFunction); } + } + + static class ThrowingMap extends ForwardingMap { + public ThrowingMap(Map delegate) { + super(delegate); + } + + @Override + public ThrowingSet> entrySet() { + return new ThrowingSet<>(super.entrySet()); + } + + @Override + public Set keySet() { + return new ThrowingSet(super.keySet()); + } + } + + static void assertThrowingIterator(Iterator iterator) { + try { + iterator.forEachRemaining((entry) -> {}); + Assert.fail(); + } catch (UnsupportedOperationException expected) { + } + } + + private static Map map() { + Map map = new HashMap<>(); + map.put("name", "Bill"); + map.put("age", 23); + return new ThrowingMap<>(map); + } + + @Test public void testUnwrapped() { + assertThrowingIterator(map().entrySet().iterator()); + assertThrowingIterator(map().keySet().iterator()); + } + + @Test public void test_unmodifiableMap_entrySet() { + assertThrowingIterator(Collections.unmodifiableMap(map()).entrySet().iterator()); + } + + @Test public void test_checkedMap_entrySet() { + assertThrowingIterator(Collections.checkedMap(map(), String.class, Object.class).entrySet().iterator()); + } + + @Test public void test_entrySet_checkedSet() { + Set> entrySet = map().entrySet(); + Class clazz = entrySet.iterator().next().getClass(); + assertThrowingIterator(Collections.checkedSet(entrySet, clazz).iterator()); + } +} diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/ArrayBlockingQueue/WhiteBox.java openjdk-11-11~24/test/jdk/java/util/concurrent/ArrayBlockingQueue/WhiteBox.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/ArrayBlockingQueue/WhiteBox.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/ArrayBlockingQueue/WhiteBox.java 2018-07-25 15:36:46.000000000 +0000 @@ -59,7 +59,6 @@ import java.util.concurrent.ArrayBlockingQueue; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ThreadLocalRandom; -import java.util.concurrent.TimeUnit; import java.util.function.BooleanSupplier; @Test diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/ConcurrentHashMap/MapCheck.java openjdk-11-11~24/test/jdk/java/util/concurrent/ConcurrentHashMap/MapCheck.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/ConcurrentHashMap/MapCheck.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/ConcurrentHashMap/MapCheck.java 2018-07-25 15:36:46.000000000 +0000 @@ -109,7 +109,7 @@ static Map newMap(Class cl) { try { - return (Map)cl.newInstance(); + return (Map)cl.getDeclaredConstructor().newInstance(); } catch (Exception e) { throw new RuntimeException("Can't instantiate " + cl + ": " + e); } @@ -407,7 +407,7 @@ timer.start("Put (putAll) ", size * 2); Map s2 = null; try { - s2 = (Map) (s.getClass().newInstance()); + s2 = (Map) s.getClass().getDeclaredConstructor().newInstance(); s2.putAll(s); } catch (Exception e) { e.printStackTrace(); return; } diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/ConcurrentHashMap/MapLoops.java openjdk-11-11~24/test/jdk/java/util/concurrent/ConcurrentHashMap/MapLoops.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/ConcurrentHashMap/MapLoops.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/ConcurrentHashMap/MapLoops.java 2018-07-25 15:36:46.000000000 +0000 @@ -156,7 +156,8 @@ static void test(int i, int nkeys, Class mapClass) throws Exception { System.out.print("Threads: " + i + "\t:"); - Map map = (Map)mapClass.newInstance(); + Map map = (Map) + mapClass.getDeclaredConstructor().newInstance(); Integer[] key = makeKeys(nkeys); // Uncomment to start with a non-empty table // for (int j = 0; j < nkeys; j += 4) // start 1/4 occupied diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/ConcurrentHashMap/WhiteBox.java openjdk-11-11~24/test/jdk/java/util/concurrent/ConcurrentHashMap/WhiteBox.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/ConcurrentHashMap/WhiteBox.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/ConcurrentHashMap/WhiteBox.java 2018-07-25 15:36:46.000000000 +0000 @@ -45,15 +45,20 @@ import java.io.ByteArrayOutputStream; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; +import java.lang.invoke.MethodHandle; import java.lang.invoke.MethodHandles; +import java.lang.invoke.MethodType; import java.lang.invoke.VarHandle; +import java.util.List; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ThreadLocalRandom; +import java.util.function.Supplier; @Test public class WhiteBox { final ThreadLocalRandom rnd = ThreadLocalRandom.current(); final VarHandle TABLE, NEXTTABLE, SIZECTL; + final MethodHandle TABLE_SIZE_FOR; WhiteBox() throws ReflectiveOperationException { Class mClass = ConcurrentHashMap.class; @@ -65,11 +70,33 @@ TABLE = lookup.findVarHandle(mClass, "table", nodeArrayClass); NEXTTABLE = lookup.findVarHandle(mClass, "nextTable", nodeArrayClass); SIZECTL = lookup.findVarHandle(mClass, "sizeCtl", int.class); + TABLE_SIZE_FOR = lookup.findStatic( + mClass, "tableSizeFor", + MethodType.methodType(int.class, int.class)); } Object[] table(ConcurrentHashMap m) { return (Object[]) TABLE.getVolatile(m); } Object[] nextTable(ConcurrentHashMap m) { return (Object[]) NEXTTABLE.getVolatile(m); } int sizeCtl(ConcurrentHashMap m) { return (int) SIZECTL.getVolatile(m); } + int tableSizeFor(int n) { + try { + return (int) TABLE_SIZE_FOR.invoke(n); + } catch (Throwable t) { throw new AssertionError(t); } + } + + List> newConcurrentHashMapSuppliers( + int initialCapacity) { + return List.of( + () -> new ConcurrentHashMap(initialCapacity), + () -> new ConcurrentHashMap(initialCapacity, 0.75f), + () -> new ConcurrentHashMap(initialCapacity, 0.75f, 1)); + } + + ConcurrentHashMap newConcurrentHashMap(int initialCapacity) { + List> suppliers + = newConcurrentHashMapSuppliers(initialCapacity); + return suppliers.get(rnd.nextInt(suppliers.size())).get(); + } @Test public void defaultConstructor() { @@ -83,7 +110,7 @@ public void shouldNotResizeWhenInitialCapacityProvided() { int initialCapacity = rnd.nextInt(1, 100); Object[] initialTable = null; - ConcurrentHashMap m = new ConcurrentHashMap(initialCapacity); + ConcurrentHashMap m = newConcurrentHashMap(initialCapacity); // table is lazily initialized assertNull(table(m)); @@ -101,6 +128,34 @@ assertEquals(initialTable.length, expectedInitialTableLength); } + @Test + public void constructorsShouldGiveSameInitialCapacity() { + int initialCapacity = rnd.nextInt(1, 256); + long distinctTableLengths + = newConcurrentHashMapSuppliers(initialCapacity).stream() + .map(Supplier::get) + .mapToInt(map -> { map.put(42, 42); return table(map).length; }) + .distinct() + .count(); + assertEquals(1L, distinctTableLengths); + } + + @Test + public void testTableSizeFor() { + assertEquals(1, tableSizeFor(0)); + assertEquals(1, tableSizeFor(1)); + assertEquals(2, tableSizeFor(2)); + assertEquals(4, tableSizeFor(3)); + assertEquals(16, tableSizeFor(15)); + assertEquals(16, tableSizeFor(16)); + assertEquals(32, tableSizeFor(17)); + int maxSize = 1 << 30; + assertEquals(maxSize, tableSizeFor(maxSize - 1)); + assertEquals(maxSize, tableSizeFor(maxSize)); + assertEquals(maxSize, tableSizeFor(maxSize + 1)); + assertEquals(maxSize, tableSizeFor(Integer.MAX_VALUE)); + } + byte[] serialBytes(Object o) { try { ByteArrayOutputStream bos = new ByteArrayOutputStream(); @@ -132,7 +187,7 @@ public void testSerialization() { assertInvariants(serialClone(new ConcurrentHashMap())); - ConcurrentHashMap m = new ConcurrentHashMap(rnd.nextInt(100)); + ConcurrentHashMap m = newConcurrentHashMap(rnd.nextInt(100)); m.put(1, 1); ConcurrentHashMap clone = serialClone(m); assertInvariants(clone); diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/forkjoin/FJExceptionTableLeak.java openjdk-11-11~24/test/jdk/java/util/concurrent/forkjoin/FJExceptionTableLeak.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/forkjoin/FJExceptionTableLeak.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/forkjoin/FJExceptionTableLeak.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,77 +34,102 @@ /* * @test - * @bug 8004138 + * @bug 8004138 8205576 * @modules java.base/java.util.concurrent:open + * @run testng FJExceptionTableLeak * @summary Checks that ForkJoinTask thrown exceptions are not leaked. * This whitebox test is sensitive to forkjoin implementation details. */ +import static org.testng.Assert.*; +import org.testng.annotations.Test; + import static java.util.concurrent.TimeUnit.MILLISECONDS; import java.lang.ref.ReferenceQueue; import java.lang.ref.WeakReference; -import java.lang.reflect.Field; +import java.lang.invoke.MethodHandles; +import java.lang.invoke.VarHandle; import java.util.ArrayList; import java.util.concurrent.CountDownLatch; import java.util.concurrent.ForkJoinPool; import java.util.concurrent.ForkJoinTask; import java.util.concurrent.RecursiveAction; +import java.util.concurrent.ThreadLocalRandom; +import java.util.concurrent.locks.ReentrantLock; import java.util.function.BooleanSupplier; +@Test public class FJExceptionTableLeak { + final ThreadLocalRandom rnd = ThreadLocalRandom.current(); + final VarHandle NEXT, EX; + final Object[] exceptionTable; + final ReentrantLock exceptionTableLock; + + FJExceptionTableLeak() throws ReflectiveOperationException { + MethodHandles.Lookup lookup = MethodHandles.privateLookupIn( + ForkJoinTask.class, MethodHandles.lookup()); + Class nodeClass = Class.forName( + ForkJoinTask.class.getName() + "$ExceptionNode"); + VarHandle exceptionTableHandle = lookup.findStaticVarHandle( + ForkJoinTask.class, "exceptionTable", arrayClass(nodeClass)); + VarHandle exceptionTableLockHandle = lookup.findStaticVarHandle( + ForkJoinTask.class, "exceptionTableLock", ReentrantLock.class); + exceptionTable = (Object[]) exceptionTableHandle.get(); + exceptionTableLock = (ReentrantLock) exceptionTableLockHandle.get(); + + NEXT = lookup.findVarHandle(nodeClass, "next", nodeClass); + EX = lookup.findVarHandle(nodeClass, "ex", Throwable.class); + } + + static Class arrayClass(Class klazz) { + try { + return (Class) Class.forName("[L" + klazz.getName() + ";"); + } catch (ReflectiveOperationException ex) { + throw new Error(ex); + } + } + + Object next(Object node) { return NEXT.get(node); } + Throwable ex(Object node) { return (Throwable) EX.get(node); } + static class FailingTaskException extends RuntimeException {} static class FailingTask extends RecursiveAction { public void compute() { throw new FailingTaskException(); } } - static int bucketsInuse(Object[] exceptionTable) { - int count = 0; - for (Object x : exceptionTable) - if (x != null) count++; - return count; + /** Counts all FailingTaskExceptions still recorded in exceptionTable. */ + int retainedExceptions() { + exceptionTableLock.lock(); + try { + int count = 0; + for (Object node : exceptionTable) + for (; node != null; node = next(node)) + if (ex(node) instanceof FailingTaskException) + count++; + return count; + } finally { + exceptionTableLock.unlock(); + } } - public static void main(String[] args) throws Exception { - final ForkJoinPool pool = new ForkJoinPool(4); - final Field exceptionTableField = - ForkJoinTask.class.getDeclaredField("exceptionTable"); - exceptionTableField.setAccessible(true); - final Object[] exceptionTable = (Object[]) exceptionTableField.get(null); - - if (bucketsInuse(exceptionTable) != 0) throw new AssertionError(); - - final ArrayList tasks = new ArrayList<>(); + @Test + public void exceptionTableCleanup() throws Exception { + ArrayList failedTasks = failedTasks(); - // Keep submitting failing tasks until most of the exception - // table buckets are in use - do { - for (int i = 0; i < exceptionTable.length; i++) { - FailingTask task = new FailingTask(); - pool.execute(task); - tasks.add(task); // retain strong refs to all tasks, for now - } - for (FailingTask task : tasks) { - try { - task.join(); - throw new AssertionError("should throw"); - } catch (FailingTaskException success) {} - } - } while (bucketsInuse(exceptionTable) < exceptionTable.length * 3 / 4); - - // Retain a strong ref to one last failing task; - // task.join() will trigger exception table expunging. - FailingTask lastTask = tasks.get(0); + // Retain a strong ref to one last failing task + FailingTask lastTask = failedTasks.get(rnd.nextInt(failedTasks.size())); // Clear all other strong refs, making exception table cleanable - tasks.clear(); + failedTasks.clear(); BooleanSupplier exceptionTableIsClean = () -> { try { + // Trigger exception table expunging as side effect lastTask.join(); throw new AssertionError("should throw"); } catch (FailingTaskException expected) {} - int count = bucketsInuse(exceptionTable); + int count = retainedExceptions(); if (count == 0) throw new AssertionError("expected to find last task"); return count == 1; @@ -112,6 +137,35 @@ gcAwait(exceptionTableIsClean); } + /** Sequestered into a separate method to inhibit GC retention. */ + ArrayList failedTasks() + throws Exception { + final ForkJoinPool pool = new ForkJoinPool(rnd.nextInt(1, 4)); + + assertEquals(0, retainedExceptions()); + + final ArrayList tasks = new ArrayList<>(); + + for (int i = exceptionTable.length; i--> 0; ) { + FailingTask task = new FailingTask(); + pool.execute(task); + tasks.add(task); // retain strong refs to all tasks, for now + task = null; // excessive GC retention paranoia + } + for (FailingTask task : tasks) { + try { + task.join(); + throw new AssertionError("should throw"); + } catch (FailingTaskException success) {} + task = null; // excessive GC retention paranoia + } + + if (rnd.nextBoolean()) + gcAwait(() -> retainedExceptions() == tasks.size()); + + return tasks; + } + // --------------- GC finalization infrastructure --------------- /** No guarantees, but effective in practice. */ diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java openjdk-11-11~24/test/jdk/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/locks/ReentrantReadWriteLock/MapLoops.java 2018-07-25 15:36:46.000000000 +0000 @@ -104,7 +104,8 @@ // warmup System.out.println("Warmup..."); for (int k = 0; k < 2; ++k) { - Map map = (Map)mapClass.newInstance(); + Map map = (Map) + mapClass.getDeclaredConstructor().newInstance(); LoopHelpers.BarrierTimer timer = new LoopHelpers.BarrierTimer(); CyclicBarrier barrier = new CyclicBarrier(1, timer); new Runner(map, key, barrier, rnd.split()).run(); @@ -113,7 +114,8 @@ for (int i = 1; i <= maxThreads; i += (i+1) >>> 1) { System.out.print("Threads: " + i + "\t:"); - Map map = (Map)mapClass.newInstance(); + Map map = (Map) + mapClass.getDeclaredConstructor().newInstance(); LoopHelpers.BarrierTimer timer = new LoopHelpers.BarrierTimer(); CyclicBarrier barrier = new CyclicBarrier(i+1, timer); for (int k = 0; k < i; ++k) diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/AbstractQueuedLongSynchronizerTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/AbstractQueuedLongSynchronizerTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/AbstractQueuedLongSynchronizerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/AbstractQueuedLongSynchronizerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -251,8 +251,8 @@ assertTrue(c.await(timeoutMillis, MILLISECONDS)); break; case awaitNanos: - long nanosTimeout = MILLISECONDS.toNanos(timeoutMillis); - long nanosRemaining = c.awaitNanos(nanosTimeout); + long timeoutNanos = MILLISECONDS.toNanos(timeoutMillis); + long nanosRemaining = c.awaitNanos(timeoutNanos); assertTrue(nanosRemaining > 0); break; case awaitUntil: @@ -279,8 +279,8 @@ break; case awaitNanos: startTime = System.nanoTime(); - long nanosTimeout = MILLISECONDS.toNanos(timeoutMillis); - long nanosRemaining = c.awaitNanos(nanosTimeout); + long timeoutNanos = MILLISECONDS.toNanos(timeoutMillis); + long nanosRemaining = c.awaitNanos(timeoutNanos); assertTrue(nanosRemaining <= 0); assertTrue(nanosRemaining > -MILLISECONDS.toNanos(LONG_DELAY_MS)); assertTrue(millisElapsedSince(startTime) >= timeoutMillis); diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/AbstractQueuedSynchronizerTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/AbstractQueuedSynchronizerTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/AbstractQueuedSynchronizerTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/AbstractQueuedSynchronizerTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -255,8 +255,8 @@ assertTrue(c.await(timeoutMillis, MILLISECONDS)); break; case awaitNanos: - long nanosTimeout = MILLISECONDS.toNanos(timeoutMillis); - long nanosRemaining = c.awaitNanos(nanosTimeout); + long timeoutNanos = MILLISECONDS.toNanos(timeoutMillis); + long nanosRemaining = c.awaitNanos(timeoutNanos); assertTrue(nanosRemaining > 0); break; case awaitUntil: @@ -283,8 +283,8 @@ break; case awaitNanos: startTime = System.nanoTime(); - long nanosTimeout = MILLISECONDS.toNanos(timeoutMillis); - long nanosRemaining = c.awaitNanos(nanosTimeout); + long timeoutNanos = MILLISECONDS.toNanos(timeoutMillis); + long nanosRemaining = c.awaitNanos(timeoutNanos); assertTrue(nanosRemaining <= 0); assertTrue(nanosRemaining > -MILLISECONDS.toNanos(LONG_DELAY_MS)); assertTrue(millisElapsedSince(startTime) >= timeoutMillis); diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ArrayDequeTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ArrayDequeTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ArrayDequeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ArrayDequeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -772,7 +772,7 @@ ArrayDeque l = new ArrayDeque(); l.add(new Object()); try { - l.toArray(null); + l.toArray((Object[])null); shouldThrow(); } catch (NullPointerException success) {} } diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/BlockingQueueTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/BlockingQueueTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/BlockingQueueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/BlockingQueueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -161,7 +161,7 @@ public void testToArray_NullArray() { final Collection q = emptyCollection(); try { - q.toArray(null); + q.toArray((Object[])null); shouldThrow(); } catch (NullPointerException success) {} } diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/Collection8Test.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/Collection8Test.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/Collection8Test.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/Collection8Test.java 2018-07-25 15:36:46.000000000 +0000 @@ -209,7 +209,7 @@ () -> c.iterator().forEachRemaining(null), () -> c.spliterator().forEachRemaining(null), () -> c.spliterator().tryAdvance(null), - () -> c.toArray(null)); + () -> c.toArray((Object[])null)); if (!impl.permitsNulls()) { assertThrows( diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/CompletableFutureTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/CompletableFutureTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/CompletableFutureTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/CompletableFutureTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -4415,7 +4415,7 @@ f.complete(null); f = new CompletableFuture<>(); - CompletableFuture.anyOf(new CompletableFuture[] { f, incomplete }); + CompletableFuture.anyOf(f, incomplete); f.complete(null); } @@ -4433,7 +4433,7 @@ f.complete(null); f = new CompletableFuture<>(); - CompletableFuture.anyOf(new CompletableFuture[] { incomplete, f }); + CompletableFuture.anyOf(incomplete, f); f.complete(null); } } diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentHashMap8Test.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentHashMap8Test.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentHashMap8Test.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentHashMap8Test.java 2018-07-25 15:36:46.000000000 +0000 @@ -200,8 +200,8 @@ static Set populatedSet(Integer[] elements) { Set a = ConcurrentHashMap.newKeySet(); assertTrue(a.isEmpty()); - for (int i = 0; i < elements.length; i++) - assertTrue(a.add(elements[i])); + for (Integer element : elements) + assertTrue(a.add(element)); assertFalse(a.isEmpty()); assertEquals(elements.length, a.size()); return a; diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentLinkedDequeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -689,9 +689,11 @@ */ public void testToArray() { ConcurrentLinkedDeque q = populatedDeque(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.poll()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -702,8 +704,9 @@ Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.poll()); + for (Integer o : ints) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -712,7 +715,7 @@ public void testToArray_NullArg() { ConcurrentLinkedDeque q = populatedDeque(SIZE); try { - q.toArray(null); + q.toArray((Object[])null); shouldThrow(); } catch (NullPointerException success) {} } diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentLinkedQueueTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentLinkedQueueTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentLinkedQueueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentLinkedQueueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -416,9 +416,11 @@ */ public void testToArray() { ConcurrentLinkedQueue q = populatedQueue(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.poll()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -429,8 +431,9 @@ Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.poll()); + for (Integer o : ints) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -439,7 +442,7 @@ public void testToArray_NullArg() { ConcurrentLinkedQueue q = populatedQueue(SIZE); try { - q.toArray(null); + q.toArray((Object[])null); shouldThrow(); } catch (NullPointerException success) {} } diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentSkipListSetTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentSkipListSetTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentSkipListSetTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentSkipListSetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -483,9 +483,11 @@ */ public void testToArray() { ConcurrentSkipListSet q = populatedSet(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.pollFirst()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.pollFirst()); + assertTrue(q.isEmpty()); } /** @@ -495,8 +497,9 @@ ConcurrentSkipListSet q = populatedSet(SIZE); Integer[] ints = new Integer[SIZE]; assertSame(ints, q.toArray(ints)); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.pollFirst()); + for (Integer o : ints) + assertSame(o, q.pollFirst()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentSkipListSubSetTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentSkipListSubSetTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/ConcurrentSkipListSubSetTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/ConcurrentSkipListSubSetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -434,9 +434,11 @@ */ public void testToArray() { NavigableSet q = populatedSet(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.pollFirst()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.pollFirst()); + assertTrue(q.isEmpty()); } /** @@ -447,8 +449,9 @@ Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.pollFirst()); + for (Integer o : ints) + assertSame(o, q.pollFirst()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/DelayQueueTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/DelayQueueTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/DelayQueueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/DelayQueueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -593,10 +593,12 @@ */ public void testToArray() throws InterruptedException { DelayQueue q = populatedQueue(SIZE); - Object[] o = q.toArray(); - Arrays.sort(o); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.take()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + Arrays.sort(a); + for (Object o : a) + assertSame(o, q.take()); + assertTrue(q.isEmpty()); } /** @@ -608,8 +610,9 @@ PDelay[] array = q.toArray(ints); assertSame(ints, array); Arrays.sort(ints); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.remove()); + for (PDelay o : ints) + assertSame(o, q.remove()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/LinkedBlockingDequeTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/LinkedBlockingDequeTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/LinkedBlockingDequeTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/LinkedBlockingDequeTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1570,9 +1570,11 @@ */ public void testToArray() throws InterruptedException { LinkedBlockingDeque q = populatedDeque(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.poll()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -1583,8 +1585,9 @@ Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.remove()); + for (Integer o : ints) + assertSame(o, q.remove()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/LinkedBlockingQueueTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/LinkedBlockingQueueTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/LinkedBlockingQueueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/LinkedBlockingQueueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -656,9 +656,11 @@ */ public void testToArray() { LinkedBlockingQueue q = populatedQueue(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.poll()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -669,8 +671,9 @@ Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.poll()); + for (Integer o : ints) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/LinkedListTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/LinkedListTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/LinkedListTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/LinkedListTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -385,9 +385,11 @@ */ public void testToArray() { LinkedList q = populatedQueue(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.poll()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -398,8 +400,9 @@ Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.poll()); + for (Integer o : ints) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -409,7 +412,7 @@ LinkedList l = new LinkedList(); l.add(new Object()); try { - l.toArray(null); + l.toArray((Object[])null); shouldThrow(); } catch (NullPointerException success) {} } diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/LinkedTransferQueueTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/LinkedTransferQueueTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/LinkedTransferQueueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/LinkedTransferQueueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -502,10 +502,11 @@ */ public void testToArray() { LinkedTransferQueue q = populatedQueue(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) { - assertSame(o[i], q.poll()); - } + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -516,9 +517,9 @@ Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); - for (int i = 0; i < ints.length; i++) { - assertSame(ints[i], q.poll()); - } + for (Integer o : ints) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/PriorityBlockingQueueTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/PriorityBlockingQueueTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/PriorityBlockingQueueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/PriorityBlockingQueueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -600,10 +600,12 @@ */ public void testToArray() throws InterruptedException { PriorityBlockingQueue q = populatedQueue(SIZE); - Object[] o = q.toArray(); - Arrays.sort(o); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.take()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + Arrays.sort(a); + for (Object o : a) + assertSame(o, q.take()); + assertTrue(q.isEmpty()); } /** @@ -615,8 +617,9 @@ Integer[] array = q.toArray(ints); assertSame(ints, array); Arrays.sort(ints); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.take()); + for (Integer o : ints) + assertSame(o, q.take()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/PriorityQueueTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/PriorityQueueTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/PriorityQueueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/PriorityQueueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -463,10 +463,12 @@ */ public void testToArray() { PriorityQueue q = populatedQueue(SIZE); - Object[] o = q.toArray(); - Arrays.sort(o); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.poll()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + Arrays.sort(a); + for (Object o : a) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** @@ -478,8 +480,9 @@ Integer[] array = q.toArray(ints); assertSame(ints, array); Arrays.sort(ints); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.poll()); + for (Integer o : ints) + assertSame(o, q.poll()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/RecursiveActionTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/RecursiveActionTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/RecursiveActionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/RecursiveActionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -364,8 +364,8 @@ fibActions[4].cancel(true); fibActions[5].completeExceptionally(new FJException()); - for (int i = 0; i < fibActions.length; i++) - fibActions[i].fork(); + for (FibAction fibAction : fibActions) + fibAction.fork(); sq.put(fibActions); diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/SubmissionPublisherTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/SubmissionPublisherTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/SubmissionPublisherTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/SubmissionPublisherTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -361,9 +361,7 @@ TestSubscriber s = new TestSubscriber(); SubmissionPublisher p = basicPublisher(); s.throwOnCall = true; - try { - p.subscribe(s); - } catch (Exception ok) {} + p.subscribe(s); s.awaitError(); assertEquals(0, s.nexts); assertEquals(1, s.errors); diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/SynchronousQueueTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/SynchronousQueueTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/SynchronousQueueTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/SynchronousQueueTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -464,7 +464,7 @@ public void testToArray_null(boolean fair) { final SynchronousQueue q = new SynchronousQueue(fair); try { - Object[] o = q.toArray(null); + Object[] o = q.toArray((Object[])null); shouldThrow(); } catch (NullPointerException success) {} } diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/TreeSetTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/TreeSetTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/TreeSetTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/TreeSetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -481,9 +481,11 @@ */ public void testToArray() { TreeSet q = populatedSet(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.pollFirst()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.pollFirst()); + assertTrue(q.isEmpty()); } /** @@ -494,8 +496,9 @@ Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.pollFirst()); + for (Integer o : ints) + assertSame(o, q.pollFirst()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/concurrent/tck/TreeSubSetTest.java openjdk-11-11~24/test/jdk/java/util/concurrent/tck/TreeSubSetTest.java --- openjdk-11-11~19/test/jdk/java/util/concurrent/tck/TreeSubSetTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/concurrent/tck/TreeSubSetTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -432,9 +432,11 @@ */ public void testToArray() { NavigableSet q = populatedSet(SIZE); - Object[] o = q.toArray(); - for (int i = 0; i < o.length; i++) - assertSame(o[i], q.pollFirst()); + Object[] a = q.toArray(); + assertSame(Object[].class, a.getClass()); + for (Object o : a) + assertSame(o, q.pollFirst()); + assertTrue(q.isEmpty()); } /** @@ -445,8 +447,9 @@ Integer[] ints = new Integer[SIZE]; Integer[] array = q.toArray(ints); assertSame(ints, array); - for (int i = 0; i < ints.length; i++) - assertSame(ints[i], q.pollFirst()); + for (Integer o : ints) + assertSame(o, q.pollFirst()); + assertTrue(q.isEmpty()); } /** diff -Nru openjdk-11-11~19/test/jdk/java/util/List/ListFactories.java openjdk-11-11~24/test/jdk/java/util/List/ListFactories.java --- openjdk-11-11~19/test/jdk/java/util/List/ListFactories.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/List/ListFactories.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,6 +32,7 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import java.util.ListIterator; import org.testng.annotations.DataProvider; import org.testng.annotations.Test; @@ -48,7 +49,7 @@ /* * @test - * @bug 8048330 + * @bug 8048330 8203184 * @summary Test convenience static factory methods on List. * @run testng ListFactories */ @@ -330,6 +331,24 @@ assertSame(copy1, copy2); } + @Test + public void copyOfSubList() { + List orig = List.of(0, 1, 2, 3); + List sub = orig.subList(0, 3); + List copy = List.copyOf(sub); + + assertNotSame(sub, copy); + } + + @Test + public void copyOfSubSubList() { + List orig = List.of(0, 1, 2, 3); + List sub = orig.subList(0, 3).subList(0, 2); + List copy = List.copyOf(sub); + + assertNotSame(sub, copy); + } + @Test(expectedExceptions=NullPointerException.class) public void copyOfRejectsNullCollection() { List list = List.copyOf(null); @@ -339,4 +358,15 @@ public void copyOfRejectsNullElements() { List list = List.copyOf(Arrays.asList(1, null, 3)); } + + @Test + public void iteratorShouldNotBeListIterator() { + List list = List.of(1, 2, 3, 4, 5); + Iterator it = list.iterator(); + it.next(); + try { + ((ListIterator) it).previous(); + fail("ListIterator operation succeeded on Iterator"); + } catch (ClassCastException|UnsupportedOperationException ignore) { } + } } diff -Nru openjdk-11-11~19/test/jdk/java/util/Locale/LSRDataTest.java openjdk-11-11~24/test/jdk/java/util/Locale/LSRDataTest.java --- openjdk-11-11~19/test/jdk/java/util/Locale/LSRDataTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/Locale/LSRDataTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,361 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8204938 + * @summary Checks the IANA language subtag registry data update + * with Locale.LanguageRange parse method. + * @run main LSRDataTest + */ +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Locale; +import java.util.Locale.LanguageRange; +import java.util.stream.Collectors; +import java.util.stream.Stream; + +import static java.util.Locale.LanguageRange.MAX_WEIGHT; +import static java.util.Locale.LanguageRange.MIN_WEIGHT; + +public class LSRDataTest { + + private static final char HYPHEN = '-'; + private static final Map singleLangEquivMap = new HashMap<>(); + private static final Map> multiLangEquivsMap = new HashMap<>(); + private static final Map regionVariantEquivMap = new HashMap<>(); + + // path to the lsr file from the make folder, this test relies on the + // relative path to the file in the make folder, considering + // test and make will always exist in the same jdk layout + private static final String LSR_FILE_PATH = System.getProperty("test.src", ".") + + "/../../../../../make/data/lsrdata/language-subtag-registry.txt"; + + public static void main(String[] args) throws IOException { + + loadLSRData(Paths.get(LSR_FILE_PATH).toRealPath()); + + // checking the tags with weight + String ranges = "Accept-Language: aam, adp, aue, bcg, cqu, ema," + + " en-gb-oed, gti, koj, kwq, kxe, lii, lmm, mtm, ngv," + + " oyb, phr, pub, suj, taj;q=0.9, yug;q=0.5, gfx;q=0.4"; + List expected = parse(ranges); + List actual = LanguageRange.parse(ranges); + checkEquality(actual, expected); + + // checking all language ranges + ranges = generateLangRanges(); + expected = parse(ranges); + actual = LanguageRange.parse(ranges); + checkEquality(actual, expected); + + // checking all region/variant ranges + ranges = generateRegionRanges(); + expected = parse(ranges); + actual = LanguageRange.parse(ranges); + checkEquality(actual, expected); + + } + + // generate range string containing all equiv language tags + private static String generateLangRanges() { + return Stream.concat(singleLangEquivMap.keySet().stream(), multiLangEquivsMap + .keySet().stream()).collect(Collectors.joining(",")); + } + + // generate range string containing all equiv region tags + private static String generateRegionRanges() { + return regionVariantEquivMap.keySet().stream() + .map(r -> "en".concat(r)).collect(Collectors.joining(", ")); + } + + // load LSR data from the file + private static void loadLSRData(Path path) throws IOException { + String type = null; + String tag = null; + String preferred; + + for (String line : Files.readAllLines(path, Charset.forName("UTF-8"))) { + line = line.toLowerCase(Locale.ROOT); + int index = line.indexOf(' ') + 1; + if (line.startsWith("type:")) { + type = line.substring(index); + } else if (line.startsWith("tag:") || line.startsWith("subtag:")) { + tag = line.substring(index); + } else if (line.startsWith("preferred-value:") && !type.equals("extlang")) { + preferred = line.substring(index); + processDataAndGenerateMaps(type, tag, preferred); + } else if (line.equals("%%")) { + type = null; + tag = null; + } + } + } + + private static void processDataAndGenerateMaps(String type, + String tag, + String preferred) { + StringBuilder sb; + if (type.equals("region") || type.equals("variant")) { + if (!regionVariantEquivMap.containsKey(preferred)) { + String tPref = HYPHEN + preferred; + String tTag = HYPHEN + tag; + regionVariantEquivMap.put(tPref, tTag); + regionVariantEquivMap.put(tTag, tPref); + } else { + throw new RuntimeException("New case, need implementation." + + " A region/variant subtag \"" + preferred + + "\" is registered for more than one subtags."); + } + } else { // language, grandfathered, and redundant + if (!singleLangEquivMap.containsKey(preferred) + && !multiLangEquivsMap.containsKey(preferred)) { + // new entry add it into single equiv map + singleLangEquivMap.put(preferred, tag); + singleLangEquivMap.put(tag, preferred); + } else if (singleLangEquivMap.containsKey(preferred) + && !multiLangEquivsMap.containsKey(preferred)) { + String value = singleLangEquivMap.get(preferred); + List subtags = List.of(preferred, value, tag); + // remove from single eqiv map before adding to multi equiv + singleLangEquivMap.keySet().removeAll(subtags); + addEntriesToMultiEquivsMap(subtags); + } else if (multiLangEquivsMap.containsKey(preferred) + && !singleLangEquivMap.containsKey(preferred)) { + List subtags = multiLangEquivsMap.get(preferred); + // should use the order preferred, subtags, tag to keep the + // expected order same as the JDK API in multi equivalent maps + subtags.add(0, preferred); + subtags.add(tag); + addEntriesToMultiEquivsMap(subtags); + } + } + } + + // Add entries into the multi equivalent map from the given subtags + private static void addEntriesToMultiEquivsMap(List subtags) { + // for each subtag within the given subtags, add an entry in multi + // equivalent language map with subtag as the key and the value + // as the list of all subtags excluding the one which is getting + // traversed + subtags.forEach(subtag -> multiLangEquivsMap.put(subtag, subtags.stream() + .filter(t -> !t.equals(subtag)) + .collect(Collectors.toList()))); + } + + private static List parse(String ranges) { + ranges = ranges.replace(" ", "").toLowerCase(Locale.ROOT); + if (ranges.startsWith("accept-language:")) { + ranges = ranges.substring(16); + } + String[] langRanges = ranges.split(","); + List priorityList = new ArrayList<>(langRanges.length); + int numOfRanges = 0; + for (String range : langRanges) { + int wIndex = range.indexOf(";q="); + String tag; + double weight = 0.0; + if (wIndex == -1) { + tag = range; + weight = MAX_WEIGHT; + } else { + tag = range.substring(0, wIndex); + try { + weight = Double.parseDouble(range.substring(wIndex + 3)); + } catch (RuntimeException ex) { + throw new IllegalArgumentException("weight= " + weight + " for" + + " language range \"" + tag + "\", should be" + + " represented as a double"); + } + + if (weight < MIN_WEIGHT || weight > MAX_WEIGHT) { + throw new IllegalArgumentException("weight=" + weight + + " for language range \"" + tag + + "\", must be between " + MIN_WEIGHT + + " and " + MAX_WEIGHT + "."); + } + } + + LanguageRange entry = new LanguageRange(tag, weight); + if (!priorityList.contains(entry)) { + + int index = numOfRanges; + // find the index in the list to add the current range at the + // correct index sorted by the descending order of weight + for (int i = 0; i < priorityList.size(); i++) { + if (priorityList.get(i).getWeight() < weight) { + index = i; + break; + } + } + priorityList.add(index, entry); + numOfRanges++; + + String equivalent = getEquivalentForRegionAndVariant(tag); + if (equivalent != null) { + LanguageRange equivRange = new LanguageRange(equivalent, weight); + if (!priorityList.contains(equivRange)) { + priorityList.add(index + 1, equivRange); + numOfRanges++; + } + } + + List equivalents = getEquivalentsForLanguage(tag); + if (equivalents != null) { + for (String equiv : equivalents) { + LanguageRange equivRange = new LanguageRange(equiv, weight); + if (!priorityList.contains(equivRange)) { + priorityList.add(index + 1, equivRange); + numOfRanges++; + } + + equivalent = getEquivalentForRegionAndVariant(equiv); + if (equivalent != null) { + equivRange = new LanguageRange(equivalent, weight); + if (!priorityList.contains(equivRange)) { + priorityList.add(index + 1, equivRange); + numOfRanges++; + } + } + } + } + } + } + return priorityList; + } + + /** + * A faster alternative approach to String.replaceFirst(), if the given + * string is a literal String, not a regex. + */ + private static String replaceFirstSubStringMatch(String range, + String substr, String replacement) { + int pos = range.indexOf(substr); + if (pos == -1) { + return range; + } else { + return range.substring(0, pos) + replacement + + range.substring(pos + substr.length()); + } + } + + private static List getEquivalentsForLanguage(String range) { + String r = range; + + while (r.length() > 0) { + if (singleLangEquivMap.containsKey(r)) { + String equiv = singleLangEquivMap.get(r); + // Return immediately for performance if the first matching + // subtag is found. + return List.of(replaceFirstSubStringMatch(range, r, equiv)); + } else if (multiLangEquivsMap.containsKey(r)) { + List equivs = multiLangEquivsMap.get(r); + List result = new ArrayList(equivs.size()); + for (int i = 0; i < equivs.size(); i++) { + result.add(i, replaceFirstSubStringMatch(range, + r, equivs.get(i))); + } + return result; + } + + // Truncate the last subtag simply. + int index = r.lastIndexOf(HYPHEN); + if (index == -1) { + break; + } + r = r.substring(0, index); + } + + return null; + } + + private static String getEquivalentForRegionAndVariant(String range) { + int extensionKeyIndex = getExtentionKeyIndex(range); + + for (String subtag : regionVariantEquivMap.keySet()) { + int index; + if ((index = range.indexOf(subtag)) != -1) { + // Check if the matching text is a valid region or variant. + if (extensionKeyIndex != Integer.MIN_VALUE + && index > extensionKeyIndex) { + continue; + } + + int len = index + subtag.length(); + if (range.length() == len || range.charAt(len) == HYPHEN) { + return replaceFirstSubStringMatch(range, subtag, + regionVariantEquivMap.get(subtag)); + } + } + } + + return null; + } + + private static int getExtentionKeyIndex(String s) { + char[] c = s.toCharArray(); + int index = Integer.MIN_VALUE; + for (int i = 1; i < c.length; i++) { + if (c[i] == HYPHEN) { + if (i - index == 2) { + return index; + } else { + index = i; + } + } + } + return Integer.MIN_VALUE; + } + + private static void checkEquality(List expected, + List actual) { + + int expectedSize = expected.size(); + int actualSize = actual.size(); + + if (expectedSize != actualSize) { + throw new RuntimeException("[FAILED: Size of the priority list" + + " does not match, Expected size=" + expectedSize + "]"); + } else { + for (int i = 0; i < expectedSize; i++) { + LanguageRange lr1 = expected.get(i); + LanguageRange lr2 = actual.get(i); + + if (!lr1.getRange().equals(lr2.getRange()) + || lr1.getWeight() != lr2.getWeight()) { + throw new RuntimeException("[FAILED: Ranges at index " + + i + " do not match Expected: range=" + lr1.getRange() + + ", weight=" + lr1.getWeight() + ", Actual: range=" + + lr2.getRange() + ", weight=" + lr2.getWeight() + "]"); + } + } + } + } +} diff -Nru openjdk-11-11~19/test/jdk/java/util/logging/LocalizedLevelName.java openjdk-11-11~24/test/jdk/java/util/logging/LocalizedLevelName.java --- openjdk-11-11~19/test/jdk/java/util/logging/LocalizedLevelName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/logging/LocalizedLevelName.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,8 +37,8 @@ "SEVERE", Locale.ENGLISH, "Severe", Level.SEVERE, "WARNING", Locale.JAPANESE, "\u8B66\u544A", Level.WARNING, "INFO", Locale.SIMPLIFIED_CHINESE, "\u4FE1\u606F", Level.INFO, - "SEVERE", Locale.TRADITIONAL_CHINESE, "\u56B4\u91CD", Level.SEVERE, - "CONFIG", Locale.forLanguageTag("zh-HK"), "\u7D44\u614B", Level.CONFIG, + "SEVERE", Locale.SIMPLIFIED_CHINESE, "\u4E25\u91CD", Level.SEVERE, + "CONFIG", Locale.forLanguageTag("zh-CN"), "\u914D\u7F6E", Level.CONFIG, "ALL", Locale.ROOT, "All", Level.ALL, "SEVERE", Locale.ROOT, "Severe", Level.SEVERE, "WARNING", Locale.ROOT, "Warning", Level.WARNING, diff -Nru openjdk-11-11~19/test/jdk/java/util/Map/LockStep.java openjdk-11-11~24/test/jdk/java/util/Map/LockStep.java --- openjdk-11-11~19/test/jdk/java/util/Map/LockStep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/java/util/Map/LockStep.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,7 +28,6 @@ * @key randomness */ -import java.util.Arrays; import java.util.Collections; import java.util.HashMap; import java.util.Hashtable; @@ -104,23 +103,21 @@ final Random r = new Random(); for (int i = 0; i < iterations; i++) { - List maps = Arrays.asList( - new Map[] { - new IdentityHashMap(11), - new HashMap(16), - new LinkedHashMap(16), - new WeakHashMap(16), - new Hashtable(16), - new TreeMap(), - new ConcurrentHashMap(16), - new ConcurrentSkipListMap(), - Collections.checkedMap(new HashMap(16), Integer.class, Integer.class), - Collections.checkedSortedMap(new TreeMap(), Integer.class, Integer.class), - Collections.checkedNavigableMap(new TreeMap(), Integer.class, Integer.class), - Collections.synchronizedMap(new HashMap(16)), - Collections.synchronizedSortedMap(new TreeMap()), - Collections.synchronizedNavigableMap(new TreeMap()) - }); + List maps = List.of( + new IdentityHashMap(11), + new HashMap(16), + new LinkedHashMap(16), + new WeakHashMap(16), + new Hashtable(16), + new TreeMap(), + new ConcurrentHashMap(16), + new ConcurrentSkipListMap(), + Collections.checkedMap(new HashMap(16), Integer.class, Integer.class), + Collections.checkedSortedMap(new TreeMap(), Integer.class, Integer.class), + Collections.checkedNavigableMap(new TreeMap(), Integer.class, Integer.class), + Collections.synchronizedMap(new HashMap(16)), + Collections.synchronizedSortedMap(new TreeMap()), + Collections.synchronizedNavigableMap(new TreeMap())); for (int j = 0; j < 10; j++) put(maps, r.nextInt(100), r.nextInt(100)); diff -Nru openjdk-11-11~19/test/jdk/javax/management/security/HashedPasswordFileTest.java openjdk-11-11~24/test/jdk/javax/management/security/HashedPasswordFileTest.java --- openjdk-11-11~19/test/jdk/javax/management/security/HashedPasswordFileTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/management/security/HashedPasswordFileTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,15 +22,17 @@ */ /* @test - * @bug 5016517 + * @bug 5016517 8204661 * @summary Test Hashed passwords * @library /test/lib * @modules java.management + * jdk.management.agent/jdk.internal.agent * @build HashedPasswordFileTest * @run testng/othervm HashedPasswordFileTest * */ +import jdk.internal.agent.ConnectorAddressLink; import jdk.test.lib.Utils; import jdk.test.lib.process.ProcessTools; import org.testng.Assert; @@ -405,7 +407,6 @@ @Test public void testDefaultAgent() throws Exception { List pbArgs = new ArrayList<>(); - int port = Utils.getFreePort(); generateClearTextPasswordFile(); // This will run only on a POSIX compliant system @@ -424,10 +425,12 @@ pbArgs.add("-cp"); pbArgs.add(System.getProperty("test.class.path")); - pbArgs.add("-Dcom.sun.management.jmxremote.port=" + port); + pbArgs.add("-Dcom.sun.management.jmxremote.port=0"); pbArgs.add("-Dcom.sun.management.jmxremote.authenticate=true"); pbArgs.add("-Dcom.sun.management.jmxremote.password.file=" + file.getAbsolutePath()); pbArgs.add("-Dcom.sun.management.jmxremote.ssl=false"); + pbArgs.add("--add-exports"); + pbArgs.add("jdk.management.agent/jdk.internal.agent=ALL-UNNAMED"); pbArgs.add(TestApp.class.getSimpleName()); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( @@ -445,7 +448,6 @@ @Test public void testDefaultAgentNoHash() throws Exception { List pbArgs = new ArrayList<>(); - int port = Utils.getFreePort(); generateClearTextPasswordFile(); // This will run only on a POSIX compliant system @@ -464,11 +466,13 @@ pbArgs.add("-cp"); pbArgs.add(System.getProperty("test.class.path")); - pbArgs.add("-Dcom.sun.management.jmxremote.port=" + port); + pbArgs.add("-Dcom.sun.management.jmxremote.port=0"); pbArgs.add("-Dcom.sun.management.jmxremote.authenticate=true"); pbArgs.add("-Dcom.sun.management.jmxremote.password.file=" + file.getAbsolutePath()); pbArgs.add("-Dcom.sun.management.jmxremote.password.toHashes=false"); pbArgs.add("-Dcom.sun.management.jmxremote.ssl=false"); + pbArgs.add("--add-exports"); + pbArgs.add("jdk.management.agent/jdk.internal.agent=ALL-UNNAMED"); pbArgs.add(TestApp.class.getSimpleName()); ProcessBuilder pb = ProcessTools.createJavaProcessBuilder( @@ -496,12 +500,12 @@ public static void main(String[] args) throws IOException { try { - JMXServiceURL url = new JMXServiceURL("service:jmx:rmi:///jndi/rmi://localhost:" - + System.getProperty("com.sun.management.jmxremote.port") + "/jmxrmi"); + Map propsMap = ConnectorAddressLink.importRemoteFrom(0); + String jmxServiceUrl = propsMap.get("sun.management.JMXConnectorServer.0.remoteAddress"); Map env = new HashMap<>(1); // any dummy credentials will do. We just have to trigger password hashing env.put("jmx.remote.credentials", new String[]{"a", "a"}); - try (JMXConnector cc = JMXConnectorFactory.connect(url, env)) { + try (JMXConnector cc = JMXConnectorFactory.connect(new JMXServiceURL(jmxServiceUrl), env)) { cc.getMBeanServerConnection(); } } catch (SecurityException ex) { diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/ciphersuites/ECCurvesconstraints.java openjdk-11-11~24/test/jdk/javax/net/ssl/ciphersuites/ECCurvesconstraints.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/ciphersuites/ECCurvesconstraints.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/ciphersuites/ECCurvesconstraints.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,6 +40,7 @@ import java.io.ByteArrayInputStream; import java.io.InputStream; import java.io.OutputStream; +import java.io.IOException; import java.security.KeyStore; import java.security.KeyFactory; import java.security.cert.Certificate; @@ -49,7 +50,6 @@ import java.util.Base64; import javax.net.ssl.KeyManagerFactory; import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLHandshakeException; import javax.net.ssl.SSLServerSocket; import javax.net.ssl.SSLServerSocketFactory; import javax.net.ssl.SSLSocket; @@ -141,7 +141,7 @@ sslOS.flush(); throw new Exception("EC curve secp224k1 should be disabled"); - } catch (SSLHandshakeException she) { + } catch (IOException she) { // expected exception: no cipher suites in common System.out.println("Expected exception: " + she); } finally { @@ -183,7 +183,7 @@ sslIS.read(); throw new Exception("EC curve secp224k1 should be disabled"); - } catch (SSLHandshakeException she) { + } catch (IOException she) { // expected exception: Received fatal alert System.out.println("Expected exception: " + she); } finally { diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/compatibility/Compatibility.java openjdk-11-11~24/test/jdk/javax/net/ssl/compatibility/Compatibility.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/compatibility/Compatibility.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/compatibility/Compatibility.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -51,6 +51,7 @@ import java.util.concurrent.Future; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; +import java.util.stream.Stream; import jdk.test.lib.process.OutputAnalyzer; @@ -157,10 +158,6 @@ "ServerStatus=%s, ClientStatus=%s, CaseStatus=%s%n", serverStatus, clientStatus, testCase.getStatus()); - // Confirm the server has stopped. - if(new File(Utils.PORT_LOG).exists()) { - throw new RuntimeException("Server doesn't stop."); - } System.out.println("----- Case end -----"); } } @@ -236,10 +233,12 @@ private static List jdkList(String listFileProp) throws IOException { String listFile = System.getProperty(listFileProp); System.out.println(listFileProp + "=" + listFile); - if (listFile != null && new File(listFile).exists()) { - return Files.lines(Paths.get(listFile)) - .filter(line -> { return !line.trim().isEmpty(); }) - .collect(Collectors.toList()); + if (listFile != null && Files.exists(Paths.get(listFile))) { + try (Stream lines = Files.lines(Paths.get(listFile))) { + return lines.filter(line -> { + return !line.trim().isEmpty(); + }).collect(Collectors.toList()); + } } else { return new ArrayList<>(); } @@ -263,12 +262,13 @@ // Retrieves the latest server port from port.log. private static int getServerPort() throws IOException { - if (!new File(Utils.PORT_LOG).exists()) { + if (!Files.exists(Paths.get(Utils.PORT_LOG))) { return -1; } - return Integer.valueOf( - Files.lines(Paths.get(Utils.PORT_LOG)).findFirst().get()); + try (Stream lines = Files.lines(Paths.get(Utils.PORT_LOG))) { + return Integer.valueOf(lines.findFirst().get()); + } } private static OutputAnalyzer runServer(String jdkPath, diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/compatibility/Server.java openjdk-11-11~24/test/jdk/javax/net/ssl/compatibility/Server.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/compatibility/Server.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/compatibility/Server.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -146,10 +146,9 @@ server.close(); } - // Cleanups port.log. - File file = new File(Utils.PORT_LOG); - if (file.exists()) { - file.delete(); + // Cleanups port log. + if (!new File(Utils.PORT_LOG).delete()) { + throw new RuntimeException("Cannot delete port log"); } } diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/DTLS/InvalidRecords.java openjdk-11-11~24/test/jdk/javax/net/ssl/DTLS/InvalidRecords.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/DTLS/InvalidRecords.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/DTLS/InvalidRecords.java 2018-07-25 15:36:46.000000000 +0000 @@ -55,7 +55,7 @@ @Override DatagramPacket createHandshakePacket(byte[] ba, SocketAddress socketAddr) { - if (needInvalidRecords && (ba.length >= 60) && + if ((ba.length >= 60) && (ba[0x00] == (byte)0x16) && (ba[0x0D] == (byte)0x01) && (ba[0x3B] == (byte)0x00) && (ba[0x3C] > 0)) { @@ -64,6 +64,16 @@ // ba[0x3B]: length of session ID // ba[0x3C]: length of cookie + if (!needInvalidRecords) { + // The 2nd ClientHello with cookie. The 1st one should be + // rejected as expected. + // + // This may happen if the last few bytes of the packet are + // for supported_version extension. + throw new RuntimeException( + "the crashed handshake message was rejected as expected"); + } + // ClientHello with cookie needInvalidRecords = false; System.out.println("invalidate ClientHello message"); Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/test/jdk/javax/net/ssl/etc/keystore and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/test/jdk/javax/net/ssl/etc/keystore differ diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/etc/README openjdk-11-11~24/test/jdk/javax/net/ssl/etc/README --- openjdk-11-11~19/test/jdk/javax/net/ssl/etc/README 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/etc/README 2018-07-25 15:36:46.000000000 +0000 @@ -80,11 +80,34 @@ -dname "CN=dummy.example.com, OU=Dummy, O=Dummy, L=Cupertino, ST=CA, C=US" \ -validity 3652 -keypass passphrase -keystore keystore -storepass passphrase +Alias name: dummyecrsa +-------------------- +Creation date: Apr 13, 2018 +Entry type: PrivateKeyEntry +Certificate chain length: 2 +Certificate[1]: +Owner: CN=dummy.example.com, OU=Dummy, O=Dummy, L=Cupertino, ST=CA, C=US +Issuer: CN=dummy.example.com, OU=Dummy, O=Dummy, L=Cupertino, ST=CA, C=US +Serial number: 6f2d1faa +Valid from: Fri Apr 13 16:20:55 CST 2018 until: Wed Apr 12 16:20:55 CST 2028 +Version: 3 + +This can be generated by using keytool command: +% keytool -genkeypair -alias dummyecrsa -keyalg EC -keysize 256 \ + -keypass passphrase -storepass passphrase -keystore keystore \ + -dname "CN=dummy.example.com, OU=Dummy, O=Dummy, L=Cupertino, ST=CA, C=US" +% keytool -certreq -alias dummyecrsa -storepass passphrase -keystore keystore \ + -file ecrsa.csr +% keytool -gencert -alias dummy -storepass passphrase -keystore keystore \ + -validity 3652 -infile ecrsa.csr -outfile ecrsa.cer +% keytool -importcert -alias dummyecrsa -storepass passphrase -keystore keystore \ + -file ecrsa.cer + truststore entries ================== -This key store contains only trusted certificate entries. The same -certificates are used in both keystore and truststore. +This key store contains only trusted certificate entries. The same +certificates, except dummyecrsa, are used in both keystore and truststore. unknown_keystore Binary files /tmp/tmp2TwRYL/hA9qakM4ET/openjdk-11-11~19/test/jdk/javax/net/ssl/etc/truststore and /tmp/tmp2TwRYL/Xs5mbpruCG/openjdk-11-11~24/test/jdk/javax/net/ssl/etc/truststore differ diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/ciphersuites/CipherSuitesInOrder.java openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/ciphersuites/CipherSuitesInOrder.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/ciphersuites/CipherSuitesInOrder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/ciphersuites/CipherSuitesInOrder.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,6 +30,7 @@ * @test * @bug 7174244 * @summary NPE in Krb5ProxyImpl.getServerKeys() + * @ignore the dependent implementation details are changed * @run main/othervm CipherSuitesInOrder */ diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/interop/CipherTest.java openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/interop/CipherTest.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/interop/CipherTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/interop/CipherTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,7 +21,6 @@ * questions. */ - import java.io.*; import java.net.*; import java.util.*; @@ -29,7 +28,6 @@ import java.security.*; import java.security.cert.*; -import java.security.cert.Certificate; import javax.net.ssl.*; @@ -103,11 +101,11 @@ public static class TestParameters { - String cipherSuite; - String protocol; + CipherSuite cipherSuite; + Protocol protocol; String clientAuth; - TestParameters(String cipherSuite, String protocol, + TestParameters(CipherSuite cipherSuite, Protocol protocol, String clientAuth) { this.cipherSuite = cipherSuite; this.protocol = protocol; @@ -115,7 +113,7 @@ } boolean isEnabled() { - return TLSCipherStatus.isEnabled(cipherSuite, protocol); + return cipherSuite.supportedByProtocol(protocol); } public String toString() { @@ -125,134 +123,6 @@ } return s; } - - static enum TLSCipherStatus { - // cipher suites supported since TLS 1.2 - CS_01("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), - CS_02("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), - CS_03("TLS_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), - CS_04("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), - CS_05("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), - CS_06("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), - CS_07("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), - - CS_08("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_09("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_10("TLS_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_11("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_12("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_13("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_14("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - - CS_15("TLS_DH_anon_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), - CS_16("TLS_DH_anon_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_17("TLS_RSA_WITH_NULL_SHA256", 0x0303, 0xFFFF), - - CS_20("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_21("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_22("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_23("TLS_RSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_24("TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_25("TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_26("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_27("TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - - CS_28("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_29("TLS_RSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_30("TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_31("TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_32("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_33("TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - - CS_34("TLS_DH_anon_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_35("TLS_DH_anon_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - - // cipher suites obsoleted since TLS 1.2 - CS_50("SSL_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_51("SSL_DHE_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_52("SSL_DHE_DSS_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_53("SSL_DH_anon_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_54("TLS_KRB5_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_55("TLS_KRB5_WITH_DES_CBC_MD5", 0x0000, 0x0303), - - // cipher suites obsoleted since TLS 1.1 - CS_60("SSL_RSA_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), - CS_61("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), - CS_62("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), - CS_63("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), - CS_64("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), - CS_65("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), - CS_66("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 0x0000, 0x0302), - CS_67("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), - CS_68("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 0x0000, 0x0302), - CS_69("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 0x0000, 0x0302), - - // ignore TLS_EMPTY_RENEGOTIATION_INFO_SCSV always - CS_99("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", 0xFFFF, 0x0000); - - // the cipher suite name - final String cipherSuite; - - // supported since protocol version - final int supportedSince; - - // obsoleted since protocol version - final int obsoletedSince; - - TLSCipherStatus(String cipherSuite, - int supportedSince, int obsoletedSince) { - this.cipherSuite = cipherSuite; - this.supportedSince = supportedSince; - this.obsoletedSince = obsoletedSince; - } - - static boolean isEnabled(String cipherSuite, String protocol) { - int versionNumber = toVersionNumber(protocol); - - if (versionNumber < 0) { - return true; // unlikely to happen - } - - for (TLSCipherStatus status : TLSCipherStatus.values()) { - if (cipherSuite.equals(status.cipherSuite)) { - if ((versionNumber < status.supportedSince) || - (versionNumber >= status.obsoletedSince)) { - return false; - } - - return true; - } - } - - return true; - } - - private static int toVersionNumber(String protocol) { - int versionNumber = -1; - - switch (protocol) { - case "SSLv2Hello": - versionNumber = 0x0002; - break; - case "SSLv3": - versionNumber = 0x0300; - break; - case "TLSv1": - versionNumber = 0x0301; - break; - case "TLSv1.1": - versionNumber = 0x0302; - break; - case "TLSv1.2": - versionNumber = 0x0303; - break; - default: - // unlikely to happen - } - - return versionNumber; - } - } } private List tests; @@ -269,11 +139,23 @@ String[] clientAuths = {null, "RSA", "DSA"}; tests = new ArrayList( cipherSuites.length * protocols.length * clientAuths.length); - for (int i = 0; i < cipherSuites.length; i++) { - String cipherSuite = cipherSuites[i]; + for (int j = 0; j < protocols.length; j++) { + String protocol = protocols[j]; + if (protocol.equals(Protocol.SSLV2HELLO.name)) { + System.out.println("Skipping SSLv2Hello protocol"); + continue; + } - for (int j = 0; j < protocols.length; j++) { - String protocol = protocols[j]; + for (int i = 0; i < cipherSuites.length; i++) { + String cipherSuite = cipherSuites[i]; + + // skip kerberos cipher suites and TLS_EMPTY_RENEGOTIATION_INFO_SCSV + if (cipherSuite.startsWith("TLS_KRB5") || cipherSuite.equals( + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV.name())) { + System.out.println("Skipping unsupported test for " + + cipherSuite + " of " + protocol); + continue; + } if (!peerFactory.isSupported(cipherSuite, protocol)) { continue; @@ -281,13 +163,16 @@ for (int k = 0; k < clientAuths.length; k++) { String clientAuth = clientAuths[k]; - if ((clientAuth != null) && - (cipherSuite.indexOf("DH_anon") != -1)) { - // no client with anonymous ciphersuites + // no client with anonymous cipher suites; + // TLS 1.3 doesn't support DSA + if ((clientAuth != null && cipherSuite.contains("DH_anon")) + || ("DSA".equals(clientAuth) && "TLSv1.3".equals(protocol))) { continue; } - tests.add(new TestParameters(cipherSuite, protocol, - clientAuth)); + tests.add(new TestParameters( + CipherSuite.cipherSuite(cipherSuite), + Protocol.protocol(protocol), + clientAuth)); } } } @@ -356,7 +241,7 @@ // no more tests break; } - if (params.isEnabled() == false) { + if (!params.isEnabled()) { System.out.println("Skipping disabled test " + params); continue; } @@ -422,7 +307,7 @@ } PATH = new File(System.getProperty("test.src", "."), relPath); CipherTest.peerFactory = peerFactory; - System.out.print( + System.out.println( "Initializing test '" + peerFactory.getName() + "'..."); secureRandom = new SecureRandom(); secureRandom.nextInt(); @@ -455,27 +340,12 @@ abstract Server newServer(CipherTest cipherTest) throws Exception; boolean isSupported(String cipherSuite, String protocol) { - // skip kerberos cipher suites - if (cipherSuite.startsWith("TLS_KRB5")) { - System.out.println("Skipping unsupported test for " + - cipherSuite + " of " + protocol); - return false; - } - - // skip SSLv2Hello protocol - if (protocol.equals("SSLv2Hello")) { - System.out.println("Skipping unsupported test for " + - cipherSuite + " of " + protocol); - return false; - } - // ignore exportable cipher suite for TLSv1.1 - if (protocol.equals("TLSv1.1")) { - if (cipherSuite.indexOf("_EXPORT_WITH") != -1) { + if (protocol.equals("TLSv1.1") + && (cipherSuite.indexOf("_EXPORT_WITH") != -1)) { System.out.println("Skipping obsoleted test for " + cipherSuite + " of " + protocol); return false; - } } // ignore obsoleted cipher suite for the specified protocol diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/interop/ClientJSSEServerJSSE.java openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/interop/ClientJSSEServerJSSE.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/interop/ClientJSSEServerJSSE.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/interop/ClientJSSEServerJSSE.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,6 +26,7 @@ * @bug 4496785 * @summary Verify that all ciphersuites work in all configurations * @author Andreas Sterbenz + * @library ../../TLSCommon * @run main/othervm/timeout=300 ClientJSSEServerJSSE */ import java.security.Security; diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/interop/JSSEClient.java openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/interop/JSSEClient.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/interop/JSSEClient.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/interop/JSSEClient.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,16 +21,16 @@ * questions. */ - -import java.io.*; -import java.net.*; -import java.util.*; - -import java.security.*; -import java.security.cert.*; +import java.io.InputStream; +import java.io.OutputStream; import java.security.cert.Certificate; -import javax.net.ssl.*; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLSession; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManager; class JSSEClient extends CipherTest.Client { @@ -47,12 +47,15 @@ SSLSocket socket = null; try { keyManager.setAuthType(params.clientAuth); - sslContext.init(new KeyManager[] {keyManager}, new TrustManager[] {cipherTest.trustManager}, cipherTest.secureRandom); + sslContext.init( + new KeyManager[] { keyManager }, + new TrustManager[] { CipherTest.trustManager }, + CipherTest.secureRandom); SSLSocketFactory factory = (SSLSocketFactory)sslContext.getSocketFactory(); - socket = (SSLSocket)factory.createSocket("127.0.0.1", cipherTest.serverPort); - socket.setSoTimeout(cipherTest.TIMEOUT); - socket.setEnabledCipherSuites(new String[] {params.cipherSuite}); - socket.setEnabledProtocols(new String[] {params.protocol}); + socket = (SSLSocket)factory.createSocket("127.0.0.1", CipherTest.serverPort); + socket.setSoTimeout(CipherTest.TIMEOUT); + socket.setEnabledCipherSuites(new String[] { params.cipherSuite.name() }); + socket.setEnabledProtocols(new String[] { params.protocol.name }); InputStream in = socket.getInputStream(); OutputStream out = socket.getOutputStream(); sendRequest(in, out); @@ -60,12 +63,14 @@ SSLSession session = socket.getSession(); session.invalidate(); String cipherSuite = session.getCipherSuite(); - if (params.cipherSuite.equals(cipherSuite) == false) { - throw new Exception("Negotiated ciphersuite mismatch: " + cipherSuite + " != " + params.cipherSuite); + if (!params.cipherSuite.name().equals(cipherSuite)) { + throw new Exception("Negotiated ciphersuite mismatch: " + + cipherSuite + " != " + params.cipherSuite); } String protocol = session.getProtocol(); - if (params.protocol.equals(protocol) == false) { - throw new Exception("Negotiated protocol mismatch: " + protocol + " != " + params.protocol); + if (!params.protocol.name.equals(protocol)) { + throw new Exception("Negotiated protocol mismatch: " + protocol + + " != " + params.protocol); } if (cipherSuite.indexOf("DH_anon") == -1) { session.getPeerCertificates(); diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/interop/JSSEServer.java openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/interop/JSSEServer.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/sanity/interop/JSSEServer.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/sanity/interop/JSSEServer.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2005, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,17 +21,18 @@ * questions. */ - -import java.io.*; -import java.net.*; -import java.util.*; -import java.util.concurrent.*; - -import java.security.*; -import java.security.cert.*; -import java.security.cert.Certificate; - -import javax.net.ssl.*; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; + +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.TrustManager; class JSSEServer extends CipherTest.Server { @@ -40,23 +41,28 @@ JSSEServer(CipherTest cipherTest) throws Exception { super(cipherTest); SSLContext serverContext = SSLContext.getInstance("TLS"); - serverContext.init(new KeyManager[] {cipherTest.keyManager}, new TrustManager[] {cipherTest.trustManager}, cipherTest.secureRandom); - - SSLServerSocketFactory factory = (SSLServerSocketFactory)serverContext.getServerSocketFactory(); - serverSocket = (SSLServerSocket)factory.createServerSocket(cipherTest.serverPort); - cipherTest.serverPort = serverSocket.getLocalPort(); + serverContext.init( + new KeyManager[] { CipherTest.keyManager }, + new TrustManager[] { CipherTest.trustManager }, + CipherTest.secureRandom); + + SSLServerSocketFactory factory + = (SSLServerSocketFactory) serverContext.getServerSocketFactory(); + serverSocket + = (SSLServerSocket) factory.createServerSocket(CipherTest.serverPort); + CipherTest.serverPort = serverSocket.getLocalPort(); serverSocket.setEnabledCipherSuites(factory.getSupportedCipherSuites()); serverSocket.setWantClientAuth(true); } public void run() { - System.out.println("JSSE Server listening on port " + cipherTest.serverPort); + System.out.println("JSSE Server listening on port " + CipherTest.serverPort); Executor exec = Executors.newFixedThreadPool (cipherTest.THREADS, DaemonThreadFactory.INSTANCE); try { while (true) { final SSLSocket socket = (SSLSocket)serverSocket.accept(); - socket.setSoTimeout(cipherTest.TIMEOUT); + socket.setSoTimeout(CipherTest.TIMEOUT); Runnable r = new Runnable() { public void run() { try { diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/ServerName/SSLSocketExplorerFailure.java openjdk-11-11~24/test/jdk/javax/net/ssl/ServerName/SSLSocketExplorerFailure.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/ServerName/SSLSocketExplorerFailure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/ServerName/SSLSocketExplorerFailure.java 2018-07-25 15:36:46.000000000 +0000 @@ -45,6 +45,7 @@ import java.util.*; import java.net.*; import javax.net.ssl.*; +import java.security.Security; public class SSLSocketExplorerFailure { @@ -232,6 +233,9 @@ volatile Exception clientException = null; public static void main(String[] args) throws Exception { + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + Security.setProperty("jdk.certpath.disabledAlgorithms", ""); + String keyFilename = System.getProperty("test.src", ".") + "/" + pathToStores + "/" + keyStoreFile; diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/ServerName/SSLSocketSNISensitive.java openjdk-11-11~24/test/jdk/javax/net/ssl/ServerName/SSLSocketSNISensitive.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/ServerName/SSLSocketSNISensitive.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/ServerName/SSLSocketSNISensitive.java 2018-07-25 15:36:46.000000000 +0000 @@ -54,7 +54,8 @@ import java.security.interfaces.*; import java.util.Base64; - +// Note: this test case works only on TLS 1.2 and prior versions because of +// the use of MD5withRSA signed certificate. public class SSLSocketSNISensitive { /* @@ -415,7 +416,7 @@ TrustManagerFactory tmf = TrustManagerFactory.getInstance(tmAlgorithm); tmf.init(ks); - SSLContext ctx = SSLContext.getInstance("TLS"); + SSLContext ctx = SSLContext.getInstance("TLSv1.2"); KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509"); kmf.init(ks, passphrase); diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/CheckStatus.java openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/CheckStatus.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/CheckStatus.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/CheckStatus.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,15 +25,16 @@ * @test * @bug 4948079 * @summary SSLEngineResult needs updating [none yet] - * - * This is a simple hack to test a bunch of conditions and check - * their return codes. - * + * @ignore the dependent implementation details are changed * @run main/othervm -Djsse.enableCBCProtection=false CheckStatus * * @author Brad Wetmore */ +/* + * This is a simple hack to test a bunch of conditions and check + * their return codes. + */ import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; import java.io.*; diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/ConnectionTest.java openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/ConnectionTest.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/ConnectionTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/ConnectionTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,17 +26,18 @@ * @bug 4495742 * @summary Add non-blocking SSL/TLS functionality, usable with any * I/O abstraction + * @ignore the dependent implementation details are changed + * @author Brad Wetmore * + * @run main/othervm ConnectionTest + */ + +/* * This is a bit hacky, meant to test various conditions. The main * thing I wanted to do with this was to do buffer reads/writes * when buffers were not empty. (buffer.position() = 10) * The code could certainly be tightened up a lot. - * - * @author Brad Wetmore - * - * @run main/othervm ConnectionTest */ - import javax.net.ssl.*; import javax.net.ssl.SSLEngineResult.*; import java.io.*; diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/EngineCloseOnAlert.java openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/EngineCloseOnAlert.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/EngineCloseOnAlert.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/EngineCloseOnAlert.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,8 @@ * @test * @bug 8133632 * @summary javax.net.ssl.SSLEngine does not properly handle received - * SSL fatal alerts + * SSL fatal alerts + * @ignore the dependent implementation details are changed * @run main/othervm EngineCloseOnAlert */ diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/IllegalHandshakeMessage.java openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/IllegalHandshakeMessage.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/IllegalHandshakeMessage.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/IllegalHandshakeMessage.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,7 +30,7 @@ * @test * @bug 8180643 * @summary Illegal handshake message - * + * @ignore the dependent implementation details are changed * @run main/othervm IllegalHandshakeMessage */ diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/IllegalRecordVersion.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,7 +28,7 @@ * @test * @bug 8042449 * @summary Issue for negative byte major record version - * + * @ignore the dependent implementation details are changed * @run main/othervm IllegalRecordVersion */ diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/LargeBufs.java openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/LargeBufs.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/LargeBufs.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/LargeBufs.java 2018-07-25 15:36:46.000000000 +0000 @@ -45,7 +45,7 @@ public class LargeBufs { - private static boolean debug = false; + private static boolean debug = true; private SSLContext sslc; static private SSLEngine ssle1; // client @@ -297,6 +297,11 @@ } else { log("Data transferred cleanly"); } + + a.position(a.limit()); + b.position(b.limit()); + a.limit(a.capacity()); + b.limit(b.capacity()); } private static void log(String str) { diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/NoAuthClientAuth.java openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/NoAuthClientAuth.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/SSLEngine/NoAuthClientAuth.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/SSLEngine/NoAuthClientAuth.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,15 +21,19 @@ * questions. */ +// +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. +// + /* * @test * @bug 4495742 * @summary Demonstrate SSLEngine switch from no client auth to client auth. - * @run main/othervm NoAuthClientAuth - * - * SunJSSE does not support dynamic system properties, no way to re-use - * system properties in samevm/agentvm mode. - * + * @run main/othervm NoAuthClientAuth SSLv3 + * @run main/othervm NoAuthClientAuth TLSv1 + * @run main/othervm NoAuthClientAuth TLSv1.1 + * @run main/othervm NoAuthClientAuth TLSv1.2 * @author Brad R. Wetmore */ @@ -78,6 +82,7 @@ import java.security.*; import java.nio.*; +// Note that this test case depends on JSSE provider implementation details. public class NoAuthClientAuth { /* @@ -94,7 +99,7 @@ * including specific handshake messages, and might be best examined * after gaining some familiarity with this application. */ - private static boolean debug = false; + private static boolean debug = true; private SSLContext sslc; @@ -128,15 +133,21 @@ private static String trustFilename = System.getProperty("test.src", ".") + "/" + pathToStores + "/" + trustStoreFile; + // the specified protocol + private static String tlsProtocol; /* * Main entry point for this test. */ public static void main(String args[]) throws Exception { + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + if (debug) { System.setProperty("javax.net.debug", "all"); } + tlsProtocol = args[0]; + NoAuthClientAuth test = new NoAuthClientAuth(); test.runTest(); @@ -243,8 +254,8 @@ for (java.security.cert.Certificate c : certs) { System.out.println(c); } - log("Closing server."); - serverEngine.closeOutbound(); +// log("Closing server."); +// serverEngine.closeOutbound(); } // nothing. } @@ -253,18 +264,30 @@ log("----"); - clientResult = clientEngine.unwrap(sTOc, clientIn); - log("client unwrap: ", clientResult); - runDelegatedTasks(clientResult, clientEngine); - clientIn.clear(); + if (!clientEngine.isInboundDone()) { + clientResult = clientEngine.unwrap(sTOc, clientIn); + log("client unwrap: ", clientResult); + runDelegatedTasks(clientResult, clientEngine); + clientIn.clear(); + sTOc.compact(); + } else { + sTOc.clear(); + } - serverResult = serverEngine.unwrap(cTOs, serverIn); - log("server unwrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); - serverIn.clear(); + if (!serverEngine.isInboundDone()) { + serverResult = serverEngine.unwrap(cTOs, serverIn); + log("server unwrap: ", serverResult); + runDelegatedTasks(serverResult, serverEngine); + serverIn.clear(); + cTOs.compact(); + } else { + cTOs.clear(); + } - cTOs.compact(); - sTOc.compact(); + if (hsCompleted == 2) { + log("Closing server."); + serverEngine.closeOutbound(); + } } } @@ -286,6 +309,7 @@ */ clientEngine = sslc.createSSLEngine("client", 80); clientEngine.setUseClientMode(true); + clientEngine.setEnabledProtocols(new String[] { tlsProtocol }); } /* diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/SSLSession/RenegotiateTLS13.java openjdk-11-11~24/test/jdk/javax/net/ssl/SSLSession/RenegotiateTLS13.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/SSLSession/RenegotiateTLS13.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/SSLSession/RenegotiateTLS13.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,292 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @run main/othervm -Djavax.net.debug=ssl RenegotiateTLS13 + */ + +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManagerFactory; +import java.io.DataInputStream; +import java.io.DataOutputStream; +import java.io.File; +import java.io.IOException; +import java.security.KeyStore; +import java.security.SecureRandom; + +public class RenegotiateTLS13 { + + static final String dataString = "This is a test"; + + // Run the server as a thread instead of the client + static boolean separateServerThread = false; + + static String pathToStores = "../etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + // Server ready flag + volatile static boolean serverReady = false; + // Turn on SSL debugging + static boolean debug = false; + // Server done flag + static boolean done = false; + + // Main server code + + void doServerSide() throws Exception { + SSLServerSocketFactory sslssf; + sslssf = initContext().getServerSocketFactory(); + SSLServerSocket sslServerSocket = + (SSLServerSocket) sslssf.createServerSocket(serverPort); + serverPort = sslServerSocket.getLocalPort(); + + serverReady = true; + + SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); + + DataInputStream sslIS = + new DataInputStream(sslSocket.getInputStream()); + String s = ""; + while (s.compareTo("done") != 0) { + try { + s = sslIS.readUTF(); + System.out.println("Received: " + s); + } catch (IOException e) { + throw e; + } + } + done = true; + sslSocket.close(); + } + + // Main client code + void doClientSide() throws Exception { + + while (!serverReady) { + Thread.sleep(5); + } + + SSLSocketFactory sslsf; + sslsf = initContext().getSocketFactory(); + + SSLSocket sslSocket = (SSLSocket) + sslsf.createSocket("localhost", serverPort); + + DataOutputStream sslOS = + new DataOutputStream(sslSocket.getOutputStream()); + + sslOS.writeUTF("With " + dataString); + sslOS.writeUTF("With " + dataString); + sslOS.writeUTF("With " + dataString); + + sslSocket.startHandshake(); + + sslOS.writeUTF("With " + dataString); + sslOS.writeUTF("With " + dataString); + sslOS.writeUTF("With " + dataString); + + sslSocket.startHandshake(); + + sslOS.writeUTF("With " + dataString); + sslOS.writeUTF("With " + dataString); + sslOS.writeUTF("With " + dataString); + sslOS.writeUTF("done"); + + while (!done) { + Thread.sleep(5); + } + sslSocket.close(); + } + + volatile int serverPort = 0; + + volatile Exception serverException = null; + volatile Exception clientException = null; + + public static void main(String[] args) throws Exception { + String keyFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + if (debug) + System.setProperty("javax.net.debug", "ssl"); + + new RenegotiateTLS13(); + } + + Thread clientThread = null; + Thread serverThread = null; + + /* + * Primary constructor, used to drive remainder of the test. + * + * Fork off the other side, then do your work. + */ + RenegotiateTLS13() throws Exception { + try { + if (separateServerThread) { + startServer(true); + startClient(false); + } else { + startClient(true); + startServer(false); + } + } catch (Exception e) { + // swallow for now. Show later + } + + /* + * Wait for other side to close down. + */ + if (separateServerThread) { + serverThread.join(); + } else { + clientThread.join(); + } + + /* + * When we get here, the test is pretty much over. + * Which side threw the error? + */ + Exception local; + Exception remote; + String whichRemote; + + if (separateServerThread) { + remote = serverException; + local = clientException; + whichRemote = "server"; + } else { + remote = clientException; + local = serverException; + whichRemote = "client"; + } + + /* + * If both failed, return the curthread's exception, but also + * print the remote side Exception + */ + if ((local != null) && (remote != null)) { + System.out.println(whichRemote + " also threw:"); + remote.printStackTrace(); + System.out.println(); + throw local; + } + + if (remote != null) { + throw remote; + } + + if (local != null) { + throw local; + } + } + + void startServer(boolean newThread) throws Exception { + if (newThread) { + serverThread = new Thread() { + public void run() { + try { + doServerSide(); + } catch (Exception e) { + /* + * Our server thread just died. + * + * Release the client, if not active already... + */ + System.err.println("Server died..."); + serverReady = true; + serverException = e; + } + } + }; + serverThread.start(); + } else { + try { + doServerSide(); + } catch (Exception e) { + serverException = e; + } finally { + serverReady = true; + } + } + } + + void startClient(boolean newThread) throws Exception { + if (newThread) { + clientThread = new Thread() { + public void run() { + try { + doClientSide(); + } catch (Exception e) { + /* + * Our client thread just died. + */ + System.err.println("Client died..."); + clientException = e; + } + } + }; + clientThread.start(); + } else { + try { + doClientSide(); + } catch (Exception e) { + clientException = e; + } + } + } + + // Initialize context for TLS 1.3 + SSLContext initContext() throws Exception { + System.out.println("Using TLS13"); + SSLContext sc = SSLContext.getInstance("TLSv1.3"); + KeyStore ks = KeyStore.getInstance( + new File(System.getProperty("javax.net.ssl.keyStore")), + passwd.toCharArray()); + KeyManagerFactory kmf = KeyManagerFactory.getInstance( + KeyManagerFactory.getDefaultAlgorithm()); + kmf.init(ks, passwd.toCharArray()); + TrustManagerFactory tmf = TrustManagerFactory.getInstance( + TrustManagerFactory.getDefaultAlgorithm()); + tmf.init(ks); + sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom()); + return sc; + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/SSLSession/TestEnabledProtocols.java openjdk-11-11~24/test/jdk/javax/net/ssl/SSLSession/TestEnabledProtocols.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/SSLSession/TestEnabledProtocols.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/SSLSession/TestEnabledProtocols.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -33,309 +33,251 @@ * session * 4701722 protocol mismatch exceptions should be consistent between * SSLv3 and TLSv1 + * @library /javax/net/ssl/templates * @run main/othervm TestEnabledProtocols * @author Ram Marti */ -import java.io.*; -import java.net.*; -import java.util.*; -import java.security.*; -import javax.net.ssl.*; -import java.security.cert.*; - -public class TestEnabledProtocols { - - /* - * For each of the valid protocols combinations, start a server thread - * that sets up an SSLServerSocket supporting that protocol. Then run - * a client thread that attemps to open a connection with all - * possible protocol combinataion. Verify that we get handshake - * exceptions correctly. Whenever the connection is established - * successfully, verify that the negotiated protocol was correct. - * See results file in this directory for complete results. - */ - - static final String[][] protocolStrings = { - {"TLSv1"}, - {"TLSv1", "SSLv2Hello"}, - {"TLSv1", "SSLv3"}, - {"SSLv3", "SSLv2Hello"}, - {"SSLv3"}, - {"TLSv1", "SSLv3", "SSLv2Hello"} - }; - - static final boolean [][] eXceptionArray = { - // Do we expect exception? Protocols supported by the server - { false, true, false, true, true, true }, // TLSv1 - { false, false, false, true, true, false}, // TLSv1,SSLv2Hello - { false, true, false, true, false, true }, // TLSv1,SSLv3 - { true, true, false, false, false, false}, // SSLv3, SSLv2Hello - { true, true, false, true, false, true }, // SSLv3 - { false, false, false, false, false, false } // TLSv1,SSLv3,SSLv2Hello - }; - - static final String[][] protocolSelected = { - // TLSv1 - { "TLSv1", null, "TLSv1", null, null, null }, - - // TLSv1,SSLv2Hello - { "TLSv1", "TLSv1", "TLSv1", null, null, "TLSv1"}, - - // TLSv1,SSLv3 - { "TLSv1", null, "TLSv1", null, "SSLv3", null }, - - // SSLv3, SSLv2Hello - { null, null, "SSLv3", "SSLv3", "SSLv3", "SSLv3"}, - - // SSLv3 - { null, null, "SSLv3", null, "SSLv3", null }, - - // TLSv1,SSLv3,SSLv2Hello - { "TLSv1", "TLSv1", "TLSv1", "SSLv3", "SSLv3", "TLSv1" } - - }; - - /* - * Where do we find the keystores? - */ - final static String pathToStores = "../etc"; - static String passwd = "passphrase"; - static String keyStoreFile = "keystore"; - static String trustStoreFile = "truststore"; - - /* - * Is the server ready to serve? - */ - volatile static boolean serverReady = false; - - /* - * Turn on SSL debugging? - */ - final static boolean debug = false; - - // use any free port by default - volatile int serverPort = 0; - - volatile Exception clientException = null; - - public static void main(String[] args) throws Exception { - // reset the security property to make sure that the algorithms - // and keys used in this test are not disabled. - Security.setProperty("jdk.tls.disabledAlgorithms", ""); - - String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - System.setProperty("javax.net.ssl.keyStore", keyFilename); - System.setProperty("javax.net.ssl.keyStorePassword", passwd); - System.setProperty("javax.net.ssl.trustStore", trustFilename); - System.setProperty("javax.net.ssl.trustStorePassword", passwd); - - if (debug) - System.setProperty("javax.net.debug", "all"); - - new TestEnabledProtocols(); +import java.io.InputStream; +import java.io.InterruptedIOException; +import java.io.OutputStream; +import java.security.Security; +import java.util.Arrays; + +import javax.net.ssl.SSLException; +import javax.net.ssl.SSLHandshakeException; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLSocket; + +public class TestEnabledProtocols extends SSLSocketTemplate { + + private final String[] serverProtocols; + private final String[] clientProtocols; + private final boolean exceptionExpected; + private final String selectedProtocol; + + public TestEnabledProtocols(String[] serverProtocols, + String[] clientProtocols, boolean exceptionExpected, + String selectedProtocol) { + this.serverProtocols = serverProtocols; + this.clientProtocols = clientProtocols; + this.exceptionExpected = exceptionExpected; + this.selectedProtocol = selectedProtocol; } - TestEnabledProtocols() throws Exception { - /* - * Start the tests. - */ - SSLServerSocketFactory sslssf = - (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); - SSLServerSocket sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(serverPort); - serverPort = sslServerSocket.getLocalPort(); - // sslServerSocket.setNeedClientAuth(true); - - for (int i = 0; i < protocolStrings.length; i++) { - String [] serverProtocols = protocolStrings[i]; - startServer ss = new startServer(serverProtocols, - sslServerSocket, protocolStrings.length); - ss.setDaemon(true); - ss.start(); - for (int j = 0; j < protocolStrings.length; j++) { - String [] clientProtocols = protocolStrings[j]; - startClient sc = new startClient( - clientProtocols, serverProtocols, - eXceptionArray[i][j], protocolSelected[i][j]); - sc.start(); - sc.join(); - if (clientException != null) { - ss.requestStop(); - throw clientException; - } - } - ss.requestStop(); - System.out.println("Waiting for the server to complete"); - ss.join(); - } + @Override + protected void configureServerSocket(SSLServerSocket sslServerSocket) { + sslServerSocket.setEnabledProtocols(serverProtocols); } - class startServer extends Thread { - private String[] enabledP = null; - SSLServerSocket sslServerSocket = null; - int numExpConns; - volatile boolean stopRequested = false; - - public startServer(String[] enabledProtocols, - SSLServerSocket sslServerSocket, - int numExpConns) { - super("Server Thread"); - serverReady = false; - enabledP = enabledProtocols; - this.sslServerSocket = sslServerSocket; - sslServerSocket.setEnabledProtocols(enabledP); - this.numExpConns = numExpConns; + @Override + protected void runServerApplication(SSLSocket socket) throws Exception { + try { + socket.startHandshake(); + + InputStream in = socket.getInputStream(); + OutputStream out = socket.getOutputStream(); + out.write(280); + in.read(); + } catch (SSLHandshakeException se) { + // ignore it; this is part of the testing + // log it for debugging + System.out.println("Server SSLHandshakeException:"); + se.printStackTrace(System.out); + } catch (InterruptedIOException ioe) { + // must have been interrupted, no harm + } catch (SSLException ssle) { + // The client side may have closed the socket. + System.out.println("Server SSLException:"); + ssle.printStackTrace(System.out); + } catch (Exception e) { + System.out.println("Server exception:"); + e.printStackTrace(System.out); + throw new RuntimeException(e); } + } - public void requestStop() { - stopRequested = true; - } + @Override + protected void runClientApplication(SSLSocket sslSocket) throws Exception { + try { + System.out.println("=== Starting new test run ==="); + showProtocols("server", serverProtocols); + showProtocols("client", clientProtocols); + + sslSocket.setEnabledProtocols(clientProtocols); + sslSocket.startHandshake(); + + String protocolName = sslSocket.getSession().getProtocol(); + System.out.println("Protocol name after getSession is " + + protocolName); + + if (protocolName.equals(selectedProtocol)) { + System.out.println("** Success **"); + } else { + System.out.println("** FAILURE ** "); + throw new RuntimeException + ("expected protocol " + selectedProtocol + + " but using " + protocolName); + } - public void run() { - int conns = 0; - while (!stopRequested) { - SSLSocket socket = null; - try { - serverReady = true; - socket = (SSLSocket)sslServerSocket.accept(); - conns++; - - // set ready to false. this is just to make the - // client wait and synchronise exception messages - serverReady = false; - socket.startHandshake(); - SSLSession session = socket.getSession(); - session.invalidate(); - - InputStream in = socket.getInputStream(); - OutputStream out = socket.getOutputStream(); - out.write(280); - in.read(); - - socket.close(); - // sleep for a while so that the server thread can be - // stopped - Thread.sleep(30); - } catch (SSLHandshakeException se) { - // ignore it; this is part of the testing - // log it for debugging - System.out.println("Server SSLHandshakeException:"); - se.printStackTrace(System.out); - } catch (java.io.InterruptedIOException ioe) { - // must have been interrupted, no harm - break; - } catch (java.lang.InterruptedException ie) { - // must have been interrupted, no harm - break; - } catch (Exception e) { - System.out.println("Server exception:"); - e.printStackTrace(System.out); - throw new RuntimeException(e); - } finally { - try { - if (socket != null) { - socket.close(); - } - } catch (IOException e) { - // ignore - } - } - if (conns >= numExpConns) { - break; - } + InputStream in = sslSocket.getInputStream(); + OutputStream out = sslSocket.getOutputStream(); + in.read(); + out.write(280); + } catch (SSLHandshakeException e) { + if (!exceptionExpected) { + System.out.println( + "Client got UNEXPECTED SSLHandshakeException:"); + e.printStackTrace(System.out); + System.out.println("** FAILURE **"); + throw new RuntimeException(e); + } else { + System.out.println( + "Client got expected SSLHandshakeException:"); + e.printStackTrace(System.out); + System.out.println("** Success **"); } + } catch (Exception e) { + System.out.println("Client got UNEXPECTED Exception:"); + e.printStackTrace(System.out); + System.out.println("** FAILURE **"); + throw new RuntimeException(e); } } - private static void showProtocols(String name, String[] protocols) { - System.out.println("Enabled protocols on the " + name + " are: " + Arrays.asList(protocols)); - } + public static void main(String[] args) throws Exception { + Security.setProperty("jdk.tls.disabledAlgorithms", ""); - class startClient extends Thread { - boolean hsCompleted = false; - boolean exceptionExpected = false; - private String[] enabledP = null; - private String[] serverP = null; // used to print the result - private String protocolToUse = null; - - startClient(String[] enabledProtocol, - String[] serverP, - boolean eXception, - String protocol) throws Exception { - super("Client Thread"); - this.enabledP = enabledProtocol; - this.serverP = serverP; - this.exceptionExpected = eXception; - this.protocolToUse = protocol; - } + runCase(new String[] { "TLSv1" }, + new String[] { "TLSv1" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1" }, + new String[] { "TLSv1", "SSLv2Hello" }, + true, null); + runCase(new String[] { "TLSv1" }, + new String[] { "TLSv1", "SSLv3" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1" }, + new String[] { "SSLv3", "SSLv2Hello" }, + true, null); + runCase(new String[] { "TLSv1" }, + new String[] { "SSLv3" }, + true, null); + runCase(new String[] { "TLSv1" }, + new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + true, null); + + runCase(new String[] { "TLSv1", "SSLv2Hello" }, + new String[] { "TLSv1" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1", "SSLv2Hello" }, + new String[] { "TLSv1", "SSLv2Hello" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1", "SSLv2Hello" }, + new String[] { "TLSv1", "SSLv3" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1", "SSLv2Hello" }, + new String[] { "SSLv3", "SSLv2Hello" }, + true, null); + runCase(new String[] { "TLSv1", "SSLv2Hello" }, + new String[] { "SSLv3" }, + true, null); + runCase(new String[] { "TLSv1", "SSLv2Hello" }, + new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + false, "TLSv1"); + + runCase(new String[] { "TLSv1", "SSLv3" }, + new String[] { "TLSv1" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1", "SSLv3" }, + new String[] { "TLSv1", "SSLv2Hello" }, + true, null); + runCase(new String[] { "TLSv1", "SSLv3" }, + new String[] { "TLSv1", "SSLv3" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1", "SSLv3" }, + new String[] { "SSLv3", "SSLv2Hello" }, + true, null); + runCase(new String[] { "TLSv1", "SSLv3" }, + new String[] { "SSLv3" }, + false, "SSLv3"); + runCase(new String[] { "TLSv1", "SSLv3" }, + new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + true, null); + + runCase(new String[] { "SSLv3", "SSLv2Hello" }, + new String[] { "TLSv1" }, + true, null); + runCase(new String[] { "SSLv3", "SSLv2Hello" }, + new String[] { "TLSv1", "SSLv2Hello" }, + true, null); + runCase(new String[] { "SSLv3", "SSLv2Hello" }, + new String[] { "TLSv1", "SSLv3" }, + false, "SSLv3"); + runCase(new String[] { "SSLv3", "SSLv2Hello" }, + new String[] { "SSLv3", "SSLv2Hello" }, + false, "SSLv3"); + runCase(new String[] { "SSLv3", "SSLv2Hello" }, + new String[] { "SSLv3" }, + false, "SSLv3"); + runCase(new String[] { "SSLv3", "SSLv2Hello" }, + new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + false, "SSLv3"); + + runCase(new String[] { "SSLv3" }, + new String[] { "TLSv1" }, + true, null); + runCase(new String[] { "SSLv3" }, + new String[] { "TLSv1", "SSLv2Hello" }, + true, null); + runCase(new String[] { "SSLv3" }, + new String[] { "TLSv1", "SSLv3" }, + false, "SSLv3"); + runCase(new String[] { "SSLv3" }, + new String[] { "SSLv3", "SSLv2Hello" }, + true, null); + runCase(new String[] { "SSLv3" }, + new String[] { "SSLv3" }, + false, "SSLv3"); + runCase(new String[] { "SSLv3" }, + new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + true, null); + + runCase(new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + new String[] { "TLSv1" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + new String[] { "TLSv1", "SSLv2Hello" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + new String[] { "TLSv1", "SSLv3" }, + false, "TLSv1"); + runCase(new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + new String[] { "SSLv3", "SSLv2Hello" }, + false, "SSLv3"); + runCase(new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + new String[] { "SSLv3" }, + false, "SSLv3"); + runCase(new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + new String[] { "TLSv1", "SSLv3", "SSLv2Hello" }, + false, "TLSv1"); + } - public void run() { - SSLSocket sslSocket = null; - try { - while (!serverReady) { - Thread.sleep(50); - } - System.out.flush(); - System.out.println("=== Starting new test run ==="); - showProtocols("server", serverP); - showProtocols("client", enabledP); - - SSLSocketFactory sslsf = - (SSLSocketFactory)SSLSocketFactory.getDefault(); - sslSocket = (SSLSocket) - sslsf.createSocket("localhost", serverPort); - sslSocket.setEnabledProtocols(enabledP); - sslSocket.startHandshake(); - - SSLSession session = sslSocket.getSession(); - session.invalidate(); - String protocolName = session.getProtocol(); - System.out.println("Protocol name after getSession is " + - protocolName); - - if (protocolName.equals(protocolToUse)) { - System.out.println("** Success **"); - } else { - System.out.println("** FAILURE ** "); - throw new RuntimeException - ("expected protocol " + protocolToUse + - " but using " + protocolName); - } - - InputStream in = sslSocket.getInputStream(); - OutputStream out = sslSocket.getOutputStream(); - in.read(); - out.write(280); - - sslSocket.close(); - - } catch (SSLHandshakeException e) { - if (!exceptionExpected) { - System.out.println("Client got UNEXPECTED SSLHandshakeException:"); - e.printStackTrace(System.out); - System.out.println("** FAILURE **"); - clientException = e; - } else { - System.out.println("Client got expected SSLHandshakeException:"); - e.printStackTrace(System.out); - System.out.println("** Success **"); - } - } catch (RuntimeException e) { - clientException = e; - } catch (Exception e) { - System.out.println("Client got UNEXPECTED Exception:"); - e.printStackTrace(System.out); - System.out.println("** FAILURE **"); - clientException = e; - } - } + private static void runCase( + String[] serverProtocols, + String[] clientProtocols, + boolean exceptionExpected, + String selectedProtocol) throws Exception { + new TestEnabledProtocols( + serverProtocols, + clientProtocols, + exceptionExpected, + selectedProtocol).run(); } + private static void showProtocols(String name, String[] protocols) { + System.out.printf("Enabled protocols on the %s are: %s%n", + name, + Arrays.asList(protocols)); + } } diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/Stapling/HttpsUrlConnClient.java openjdk-11-11~24/test/jdk/javax/net/ssl/Stapling/HttpsUrlConnClient.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/Stapling/HttpsUrlConnClient.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/Stapling/HttpsUrlConnClient.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -109,6 +109,11 @@ static SimpleOCSPServer intOcsp; // Intermediate CA OCSP Responder static int intOcspPort; // Port number for intermed. OCSP + // Extra configuration parameters and constants + static final String[] TLS13ONLY = new String[] { "TLSv1.3" }; + static final String[] TLS12MAX = + new String[] { "TLSv1.2", "TLSv1.1", "TLSv1" }; + private static final String SIMPLE_WEB_PAGE = "\n" + "Web Page!\n" + "

Web Page!

\n"; @@ -124,7 +129,7 @@ */ public static void main(String[] args) throws Exception { if (debug) { - System.setProperty("javax.net.debug", "ssl"); + System.setProperty("javax.net.debug", "ssl:handshake"); } System.setProperty("javax.net.ssl.keyStore", ""); @@ -136,7 +141,8 @@ createPKI(); utcDateFmt.setTimeZone(TimeZone.getTimeZone("GMT")); - testPKIXParametersRevEnabled(); + testPKIXParametersRevEnabled(TLS12MAX); + testPKIXParametersRevEnabled(TLS13ONLY); // shut down the OCSP responders before finishing the test intOcsp.stop(); @@ -148,8 +154,10 @@ * enabled and client-side OCSP disabled. It will only pass if all * stapled responses are present, valid and have a GOOD status. */ - static void testPKIXParametersRevEnabled() throws Exception { + static void testPKIXParametersRevEnabled(String[] allowedProts) + throws Exception { ClientParameters cliParams = new ClientParameters(); + cliParams.protocols = allowedProts; ServerParameters servParams = new ServerParameters(); serverReady = false; @@ -194,7 +202,7 @@ // because of the client alert if (tr.serverExc instanceof SSLHandshakeException) { if (!tr.serverExc.getMessage().contains( - "alert: bad_certificate_status_response")) { + "bad_certificate_status_response")) { throw tr.serverExc; } } @@ -333,7 +341,8 @@ if (contentLength == -1) { contentLength = Integer.MAX_VALUE; } - byte[] response = new byte[contentLength > 2048 ? 2048 : contentLength]; + byte[] response = new byte[contentLength > 2048 ? 2048 : + contentLength]; int total = 0; while (total < contentLength) { int count = in.read(response, total, response.length - total); @@ -391,8 +400,8 @@ /** * Checks a validation failure to see if it failed for the reason we think * it should. This comes in as an SSLException of some sort, but it - * encapsulates a ValidatorException which in turn encapsulates the - * CertPathValidatorException we are interested in. + * encapsulates a CertPathValidatorException at some point in the + * exception stack. * * @param e the exception thrown at the top level * @param reason the underlying CertPathValidatorException BasicReason @@ -404,19 +413,31 @@ BasicReason reason) { boolean result = false; - if (e instanceof SSLException) { - Throwable valExc = e.getCause(); - if (valExc instanceof sun.security.validator.ValidatorException) { - Throwable cause = valExc.getCause(); - if (cause instanceof CertPathValidatorException) { - CertPathValidatorException cpve = - (CertPathValidatorException)cause; - if (cpve.getReason() == reason) { - result = true; - } - } + // Locate the CertPathValidatorException. If one + // Does not exist, then it's an automatic failure of + // the test. + Throwable curExc = e; + CertPathValidatorException cpve = null; + while (curExc != null) { + if (curExc instanceof CertPathValidatorException) { + cpve = (CertPathValidatorException)curExc; + } + curExc = curExc.getCause(); + } + + // If we get through the loop and cpve is null then we + // we didn't find CPVE and this is a failure + if (cpve != null) { + if (cpve.getReason() == reason) { + result = true; + } else { + System.out.println("CPVE Reason Mismatch: Expected = " + + reason + ", Actual = " + cpve.getReason()); } + } else { + System.out.println("Failed to find an expected CPVE"); } + return result; } @@ -698,6 +719,8 @@ boolean enabled = true; PKIXBuilderParameters pkixParams = null; PKIXRevocationChecker revChecker = null; + String[] protocols = null; + String[] cipherSuites = null; ClientParameters() { } } @@ -717,9 +740,19 @@ static class TestResult { Exception serverExc = null; Exception clientExc = null; + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("Test Result:\n"). + append("\tServer Exc = ").append(serverExc).append("\n"). + append("\tClient Exc = ").append(clientExc).append("\n"); + return sb.toString(); + } } static class HtucSSLSocketFactory extends SSLSocketFactory { + ClientParameters params; SSLContext sslc = SSLContext.getInstance("TLS"); HtucSSLSocketFactory(ClientParameters cliParams) @@ -747,6 +780,7 @@ } sslc.init(null, tmf.getTrustManagers(), null); + params = cliParams; } @Override @@ -754,7 +788,7 @@ boolean autoClose) throws IOException { Socket sock = sslc.getSocketFactory().createSocket(s, host, port, autoClose); - setCiphers(sock); + customizeSocket(sock); return sock; } @@ -762,7 +796,7 @@ public Socket createSocket(InetAddress host, int port) throws IOException { Socket sock = sslc.getSocketFactory().createSocket(host, port); - setCiphers(sock); + customizeSocket(sock); return sock; } @@ -771,7 +805,7 @@ InetAddress localAddress, int localPort) throws IOException { Socket sock = sslc.getSocketFactory().createSocket(host, port, localAddress, localPort); - setCiphers(sock); + customizeSocket(sock); return sock; } @@ -779,7 +813,7 @@ public Socket createSocket(String host, int port) throws IOException { Socket sock = sslc.getSocketFactory().createSocket(host, port); - setCiphers(sock); + customizeSocket(sock); return sock; } @@ -789,7 +823,7 @@ throws IOException { Socket sock = sslc.getSocketFactory().createSocket(host, port, localAddress, localPort); - setCiphers(sock); + customizeSocket(sock); return sock; } @@ -803,10 +837,15 @@ return sslc.getSupportedSSLParameters().getCipherSuites(); } - private static void setCiphers(Socket sock) { + private void customizeSocket(Socket sock) { if (sock instanceof SSLSocket) { - String[] ciphers = { "TLS_RSA_WITH_AES_128_CBC_SHA" }; - ((SSLSocket)sock).setEnabledCipherSuites(ciphers); + SSLSocket sslSock = (SSLSocket)sock; + if (params.protocols != null) { + sslSock.setEnabledProtocols(params.protocols); + } + if (params.cipherSuites != null) { + sslSock.setEnabledCipherSuites(params.cipherSuites); + } } } } diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/Stapling/SSLEngineWithStapling.java openjdk-11-11~24/test/jdk/javax/net/ssl/Stapling/SSLEngineWithStapling.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/Stapling/SSLEngineWithStapling.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/Stapling/SSLEngineWithStapling.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -106,7 +106,7 @@ * including specific handshake messages, and might be best examined * after gaining some familiarity with this application. */ - private static final boolean debug = false; + private static final boolean debug = true; private SSLEngine clientEngine; // client Engine private ByteBuffer clientOut; // write side of clientEngine @@ -142,12 +142,17 @@ static SimpleOCSPServer intOcsp; // Intermediate CA OCSP Responder static int intOcspPort; // Port number for intermed. OCSP + // Extra configuration parameters and constants + static final String[] TLS13ONLY = new String[] { "TLSv1.3" }; + static final String[] TLS12MAX = + new String[] { "TLSv1.2", "TLSv1.1", "TLSv1" }; + /* * Main entry point for this test. */ public static void main(String args[]) throws Exception { if (debug) { - System.setProperty("javax.net.debug", "ssl"); + System.setProperty("javax.net.debug", "ssl:handshake"); } // Create the PKI we will use for the test and start the OCSP servers @@ -166,16 +171,23 @@ TimeUnit.HOURS.toMillis(8)))); intOcsp.updateStatusDb(revInfo); - SSLEngineWithStapling test = new SSLEngineWithStapling(); - try { - test.runTest(); - throw new RuntimeException("Expected failure due to revocation " + - "did not occur"); - } catch (Exception e) { - if (!checkClientValidationFailure(e, - CertPathValidatorException.BasicReason.REVOKED)) { - System.out.println("*** Didn't find the exception we wanted"); - throw e; + // Create a list of TLS protocol configurations we can use to + // drive tests with different handshaking models. + List allowedProtList = List.of(TLS12MAX, TLS13ONLY); + + for (String[] protocols : allowedProtList) { + SSLEngineWithStapling test = new SSLEngineWithStapling(); + try { + test.runTest(protocols); + throw new RuntimeException("Expected failure due to " + + "revocation did not occur"); + } catch (Exception e) { + if (!checkClientValidationFailure(e, + CertPathValidatorException.BasicReason.REVOKED)) { + System.out.println( + "*** Didn't find the exception we wanted"); + throw e; + } } } @@ -218,10 +230,10 @@ * One could easily separate these phases into separate * sections of code. */ - private void runTest() throws Exception { + private void runTest(String[] protocols) throws Exception { boolean dataDone = false; - createSSLEngines(); + createSSLEngines(protocols); createBuffers(); SSLEngineResult clientResult; // results from client's last operation @@ -290,7 +302,7 @@ * Using the SSLContext created during object creation, * create/configure the SSLEngines we'll use for this test. */ - private void createSSLEngines() throws Exception { + private void createSSLEngines(String[] protocols) throws Exception { // Initialize the KeyManager and TrustManager for the server KeyManagerFactory servKmf = KeyManagerFactory.getInstance("PKIX"); servKmf.init(serverKeystore, passwd.toCharArray()); @@ -321,6 +333,7 @@ * handshake. */ serverEngine = servCtx.createSSLEngine(); + serverEngine.setEnabledProtocols(protocols); serverEngine.setUseClientMode(false); serverEngine.setNeedClientAuth(false); @@ -328,6 +341,7 @@ * Similar to above, but using client mode instead. */ clientEngine = cliCtx.createSSLEngine("client", 80); + clientEngine.setEnabledProtocols(protocols); clientEngine.setUseClientMode(true); } @@ -637,8 +651,8 @@ /** * Checks a validation failure to see if it failed for the reason we think * it should. This comes in as an SSLException of some sort, but it - * encapsulates a ValidatorException which in turn encapsulates the - * CertPathValidatorException we are interested in. + * encapsulates a CertPathValidatorException at some point in the + * exception stack. * * @param e the exception thrown at the top level * @param reason the underlying CertPathValidatorException BasicReason @@ -650,22 +664,31 @@ CertPathValidatorException.BasicReason reason) { boolean result = false; - if (e instanceof SSLException) { - Throwable sslhe = e.getCause(); - if (sslhe instanceof SSLHandshakeException) { - Throwable valExc = sslhe.getCause(); - if (valExc instanceof sun.security.validator.ValidatorException) { - Throwable cause = valExc.getCause(); - if (cause instanceof CertPathValidatorException) { - CertPathValidatorException cpve = - (CertPathValidatorException)cause; - if (cpve.getReason() == reason) { - result = true; - } - } - } + // Locate the CertPathValidatorException. If one + // Does not exist, then it's an automatic failure of + // the test. + Throwable curExc = e; + CertPathValidatorException cpve = null; + while (curExc != null) { + if (curExc instanceof CertPathValidatorException) { + cpve = (CertPathValidatorException)curExc; + } + curExc = curExc.getCause(); + } + + // If we get through the loop and cpve is null then we + // we didn't find CPVE and this is a failure + if (cpve != null) { + if (cpve.getReason() == reason) { + result = true; + } else { + System.out.println("CPVE Reason Mismatch: Expected = " + + reason + ", Actual = " + cpve.getReason()); } + } else { + System.out.println("Failed to find an expected CPVE"); } + return result; } } diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/Stapling/SSLSocketWithStapling.java openjdk-11-11~24/test/jdk/javax/net/ssl/Stapling/SSLSocketWithStapling.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/Stapling/SSLSocketWithStapling.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/Stapling/SSLSocketWithStapling.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,6 +35,10 @@ import java.io.*; import java.math.BigInteger; +import java.net.InetAddress; +import java.net.Socket; +import java.net.ServerSocket; +import java.security.GeneralSecurityException; import java.security.KeyPair; import java.security.KeyPairGenerator; import javax.net.ssl.*; @@ -71,7 +75,7 @@ */ // Turn on TLS debugging - static boolean debug = false; + static final boolean debug = false; /* * Should we run the client or server in a separate thread? @@ -106,6 +110,11 @@ static SimpleOCSPServer intOcsp; // Intermediate CA OCSP Responder static int intOcspPort; // Port number for intermed. OCSP + // Extra configuration parameters and constants + static final String[] TLS13ONLY = new String[] { "TLSv1.3" }; + static final String[] TLS12MAX = + new String[] { "TLSv1.2", "TLSv1.1", "TLSv1" }; + /* * If the client or server is doing some kind of object creation * that the other side depends on, and that thread prematurely @@ -116,20 +125,31 @@ */ public static void main(String[] args) throws Exception { if (debug) { - System.setProperty("javax.net.debug", "ssl"); + System.setProperty("javax.net.debug", "ssl:handshake"); } try { // Create the PKI we will use for the test and start the OCSP servers createPKI(); - testAllDefault(); - testPKIXParametersRevEnabled(); - testRevokedCertificate(); - testHardFailFallback(); - testSoftFailFallback(); - testLatencyNoStaple(false); - testLatencyNoStaple(true); + testAllDefault(false); + testAllDefault(true); + testPKIXParametersRevEnabled(false); + testPKIXParametersRevEnabled(true); + testRevokedCertificate(false); + testRevokedCertificate(true); + testRevokedIntermediate(false); + testRevokedIntermediate(true); + testMissingIntermediate(false); + testMissingIntermediate(true); + testHardFailFallback(false); + testHardFailFallback(true); + testSoftFailFallback(false); + testSoftFailFallback(true); + testLatencyNoStaple(false, false); + testLatencyNoStaple(false, true); + testLatencyNoStaple(true, false); + testLatencyNoStaple(true, true); } finally { // shut down the OCSP responders before finishing the test intOcsp.stop(); @@ -140,9 +160,16 @@ /** * Default test using no externally-configured PKIXBuilderParameters */ - static void testAllDefault() throws Exception { + static void testAllDefault(boolean isTls13) throws Exception { ClientParameters cliParams = new ClientParameters(); ServerParameters servParams = new ServerParameters(); + if (isTls13) { + cliParams.protocols = TLS13ONLY; + servParams.protocols = TLS13ONLY; + } else { + cliParams.protocols = TLS12MAX; + servParams.protocols = TLS12MAX; + } serverReady = false; Map revInfo = new HashMap<>(); @@ -188,9 +215,16 @@ * enabled and client-side OCSP disabled. It will only pass if all * stapled responses are present, valid and have a GOOD status. */ - static void testPKIXParametersRevEnabled() throws Exception { + static void testPKIXParametersRevEnabled(boolean isTls13) throws Exception { ClientParameters cliParams = new ClientParameters(); ServerParameters servParams = new ServerParameters(); + if (isTls13) { + cliParams.protocols = TLS13ONLY; + servParams.protocols = TLS13ONLY; + } else { + cliParams.protocols = TLS12MAX; + servParams.protocols = TLS12MAX; + } serverReady = false; System.out.println("====================================="); @@ -222,9 +256,16 @@ * pass if the OCSP response is found, since we will check the * CertPathValidatorException reason for revoked status. */ - static void testRevokedCertificate() throws Exception { + static void testRevokedCertificate(boolean isTls13) throws Exception { ClientParameters cliParams = new ClientParameters(); ServerParameters servParams = new ServerParameters(); + if (isTls13) { + cliParams.protocols = TLS13ONLY; + servParams.protocols = TLS13ONLY; + } else { + cliParams.protocols = TLS12MAX; + servParams.protocols = TLS12MAX; + } serverReady = false; Map revInfo = new HashMap<>(); @@ -242,9 +283,9 @@ fiveMinsAgo)); intOcsp.updateStatusDb(revInfo); - System.out.println("======================================="); - System.out.println("Stapling enabled, default configuration"); - System.out.println("======================================="); + System.out.println("============================================"); + System.out.println("Stapling enabled, detect revoked certificate"); + System.out.println("============================================"); cliParams.pkixParams = new PKIXBuilderParameters(trustStore, new X509CertSelector()); @@ -274,13 +315,146 @@ } /** + * Perform a test where the intermediate CA certificate is revoked and + * placed in the TLS handshake. Client-side OCSP is disabled, so this + * test will only pass if the OCSP response for the intermediate CA is + * found and placed into the CertificateStatus or Certificate message + * (depending on the protocol version) since we will check + * the CertPathValidatorException reason for revoked status. + */ + static void testRevokedIntermediate(boolean isTls13) throws Exception { + ClientParameters cliParams = new ClientParameters(); + ServerParameters servParams = new ServerParameters(); + if (isTls13) { + cliParams.protocols = TLS13ONLY; + servParams.protocols = TLS13ONLY; + } else { + cliParams.protocols = TLS12MAX; + servParams.protocols = TLS12MAX; + } + serverReady = false; + Map revInfo = + new HashMap<>(); + + // We will prove revocation checking is disabled by marking the SSL + // certificate as revoked. The test would only pass if revocation + // checking did not happen. + X509Certificate intCACert = + (X509Certificate)intKeystore.getCertificate(INT_ALIAS); + Date fiveMinsAgo = new Date(System.currentTimeMillis() - + TimeUnit.MINUTES.toMillis(5)); + revInfo.put(intCACert.getSerialNumber(), + new SimpleOCSPServer.CertStatusInfo( + SimpleOCSPServer.CertStatus.CERT_STATUS_REVOKED, + fiveMinsAgo)); + rootOcsp.updateStatusDb(revInfo); + + System.out.println("==============================================="); + System.out.println("Stapling enabled, detect revoked CA certificate"); + System.out.println("==============================================="); + + cliParams.pkixParams = new PKIXBuilderParameters(trustStore, + new X509CertSelector()); + cliParams.pkixParams.setRevocationEnabled(true); + Security.setProperty("ocsp.enable", "false"); + + SSLSocketWithStapling sslTest = new SSLSocketWithStapling(cliParams, + servParams); + TestResult tr = sslTest.getResult(); + if (!checkClientValidationFailure(tr.clientExc, BasicReason.REVOKED)) { + if (tr.clientExc != null) { + throw tr.clientExc; + } else { + throw new RuntimeException( + "Expected client failure, but the client succeeded"); + } + } + + // Return the ssl certificate to non-revoked status + revInfo.put(intCACert.getSerialNumber(), + new SimpleOCSPServer.CertStatusInfo( + SimpleOCSPServer.CertStatus.CERT_STATUS_GOOD)); + rootOcsp.updateStatusDb(revInfo); + + System.out.println(" PASS"); + System.out.println("=======================================\n"); + } + + /** + * Test a case where OCSP stapling is attempted, but partially occurs + * because the root OCSP responder is unreachable. This should use a + * default hard-fail behavior. + */ + static void testMissingIntermediate(boolean isTls13) throws Exception { + ClientParameters cliParams = new ClientParameters(); + ServerParameters servParams = new ServerParameters(); + if (isTls13) { + cliParams.protocols = TLS13ONLY; + servParams.protocols = TLS13ONLY; + } else { + cliParams.protocols = TLS12MAX; + servParams.protocols = TLS12MAX; + } + serverReady = false; + + // Make the OCSP responder reject connections + rootOcsp.rejectConnections(); + + System.out.println("======================================="); + System.out.println("Stapling enbled in client and server,"); + System.out.println("but root OCSP responder disabled."); + System.out.println("PKIXParameters with Revocation checking"); + System.out.println("enabled."); + System.out.println("======================================="); + + Security.setProperty("ocsp.enable", "false"); + cliParams.pkixParams = new PKIXBuilderParameters(trustStore, + new X509CertSelector()); + cliParams.pkixParams.setRevocationEnabled(true); + + SSLSocketWithStapling sslTest = new SSLSocketWithStapling(cliParams, + servParams); + TestResult tr = sslTest.getResult(); + if (!checkClientValidationFailure(tr.clientExc, + BasicReason.UNDETERMINED_REVOCATION_STATUS)) { + if (tr.clientExc != null) { + throw tr.clientExc; + } else { + throw new RuntimeException( + "Expected client failure, but the client succeeded"); + } + } + + System.out.println(" PASS"); + System.out.println("=======================================\n"); + + // Make root OCSP responder accept connections + rootOcsp.acceptConnections(); + + // Wait 5 seconds for server ready + for (int i = 0; (i < 100 && !rootOcsp.isServerReady()); i++) { + Thread.sleep(50); + } + if (!rootOcsp.isServerReady()) { + throw new RuntimeException("Root OCSP responder not ready yet"); + } + } + + /** * Test a case where client-side stapling is attempted, but does not * occur because OCSP responders are unreachable. This should use a * default hard-fail behavior. */ - static void testHardFailFallback() throws Exception { + static void testHardFailFallback(boolean isTls13) throws Exception { ClientParameters cliParams = new ClientParameters(); ServerParameters servParams = new ServerParameters(); + if (isTls13) { + cliParams.protocols = TLS13ONLY; + servParams.protocols = TLS13ONLY; + } else { + cliParams.protocols = TLS12MAX; + servParams.protocols = TLS12MAX; + } serverReady = false; // make OCSP responders reject connections @@ -320,7 +494,8 @@ rootOcsp.acceptConnections(); // Wait 5 seconds for server ready - for (int i = 0; (i < 100 && (!intOcsp.isServerReady() || !rootOcsp.isServerReady())); i++) { + for (int i = 0; (i < 100 && (!intOcsp.isServerReady() || + !rootOcsp.isServerReady())); i++) { Thread.sleep(50); } if (!intOcsp.isServerReady() || !rootOcsp.isServerReady()) { @@ -333,9 +508,16 @@ * occur because OCSP responders are unreachable. Client-side OCSP * checking is enabled for this, with SOFT_FAIL. */ - static void testSoftFailFallback() throws Exception { + static void testSoftFailFallback(boolean isTls13) throws Exception { ClientParameters cliParams = new ClientParameters(); ServerParameters servParams = new ServerParameters(); + if (isTls13) { + cliParams.protocols = TLS13ONLY; + servParams.protocols = TLS13ONLY; + } else { + cliParams.protocols = TLS12MAX; + servParams.protocols = TLS12MAX; + } serverReady = false; // make OCSP responders reject connections @@ -381,7 +563,8 @@ rootOcsp.acceptConnections(); // Wait 5 seconds for server ready - for (int i = 0; (i < 100 && (!intOcsp.isServerReady() || !rootOcsp.isServerReady())); i++) { + for (int i = 0; (i < 100 && (!intOcsp.isServerReady() || + !rootOcsp.isServerReady())); i++) { Thread.sleep(50); } if (!intOcsp.isServerReady() || !rootOcsp.isServerReady()) { @@ -400,9 +583,17 @@ * will change the result from the client failing with CPVE (no fallback) * to a pass (fallback active). */ - static void testLatencyNoStaple(Boolean fallback) throws Exception { + static void testLatencyNoStaple(Boolean fallback, boolean isTls13) + throws Exception { ClientParameters cliParams = new ClientParameters(); ServerParameters servParams = new ServerParameters(); + if (isTls13) { + cliParams.protocols = TLS13ONLY; + servParams.protocols = TLS13ONLY; + } else { + cliParams.protocols = TLS12MAX; + servParams.protocols = TLS12MAX; + } serverReady = false; // Give a 1 second delay before running the test. @@ -411,7 +602,8 @@ Thread.sleep(1000); // Wait 5 seconds for server ready - for (int i = 0; (i < 100 && (!intOcsp.isServerReady() || !rootOcsp.isServerReady())); i++) { + for (int i = 0; (i < 100 && (!intOcsp.isServerReady() || + !rootOcsp.isServerReady())); i++) { Thread.sleep(50); } if (!intOcsp.isServerReady() || !rootOcsp.isServerReady()) { @@ -462,7 +654,8 @@ Thread.sleep(1000); // Wait 5 seconds for server ready - for (int i = 0; (i < 100 && (!intOcsp.isServerReady() || !rootOcsp.isServerReady())); i++) { + for (int i = 0; (i < 100 && (!intOcsp.isServerReady() || + !rootOcsp.isServerReady())); i++) { Thread.sleep(50); } if (!intOcsp.isServerReady() || !rootOcsp.isServerReady()) { @@ -504,7 +697,8 @@ SSLContext sslc = SSLContext.getInstance("TLS"); sslc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - SSLServerSocketFactory sslssf = sslc.getServerSocketFactory(); + SSLServerSocketFactory sslssf = new CustomizedServerSocketFactory(sslc, + servParams.protocols, servParams.ciphers); try (SSLServerSocket sslServerSocket = (SSLServerSocket) sslssf.createServerSocket(serverPort)) { @@ -570,7 +764,8 @@ SSLContext sslc = SSLContext.getInstance("TLS"); sslc.init(null, tmf.getTrustManagers(), null); - SSLSocketFactory sslsf = sslc.getSocketFactory(); + SSLSocketFactory sslsf = new CustomizedSocketFactory(sslc, + cliParams.protocols, cliParams.ciphers); try (SSLSocket sslSocket = (SSLSocket)sslsf.createSocket("localhost", serverPort); InputStream sslIS = sslSocket.getInputStream(); @@ -927,6 +1122,8 @@ boolean enabled = true; PKIXBuilderParameters pkixParams = null; PKIXRevocationChecker revChecker = null; + String[] protocols = null; + String[] ciphers = null; ClientParameters() { } } @@ -939,10 +1136,161 @@ String respUri = ""; boolean respOverride = false; boolean ignoreExts = false; + String[] protocols = null; + String[] ciphers = null; ServerParameters() { } } + static class CustomizedSocketFactory extends SSLSocketFactory { + final SSLContext sslc; + final String[] protocols; + final String[] cipherSuites; + + CustomizedSocketFactory(SSLContext ctx, String[] prots, String[] suites) + throws GeneralSecurityException { + super(); + sslc = (ctx != null) ? ctx : SSLContext.getDefault(); + protocols = prots; + cipherSuites = suites; + + // Create the Trust Manager Factory using the PKIX variant + TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); + } + + @Override + public Socket createSocket(Socket s, String host, int port, + boolean autoClose) throws IOException { + Socket sock = sslc.getSocketFactory().createSocket(s, host, port, + autoClose); + customizeSocket(sock); + return sock; + } + + @Override + public Socket createSocket(InetAddress host, int port) + throws IOException { + Socket sock = sslc.getSocketFactory().createSocket(host, port); + customizeSocket(sock); + return sock; + } + + @Override + public Socket createSocket(InetAddress host, int port, + InetAddress localAddress, int localPort) throws IOException { + Socket sock = sslc.getSocketFactory().createSocket(host, port, + localAddress, localPort); + customizeSocket(sock); + return sock; + } + + @Override + public Socket createSocket(String host, int port) + throws IOException { + Socket sock = sslc.getSocketFactory().createSocket(host, port); + customizeSocket(sock); + return sock; + } + + @Override + public Socket createSocket(String host, int port, + InetAddress localAddress, int localPort) + throws IOException { + Socket sock = sslc.getSocketFactory().createSocket(host, port, + localAddress, localPort); + customizeSocket(sock); + return sock; + } + + @Override + public String[] getDefaultCipherSuites() { + return sslc.getDefaultSSLParameters().getCipherSuites(); + } + + @Override + public String[] getSupportedCipherSuites() { + return sslc.getSupportedSSLParameters().getCipherSuites(); + } + + private void customizeSocket(Socket sock) { + if (sock instanceof SSLSocket) { + if (protocols != null) { + ((SSLSocket)sock).setEnabledProtocols(protocols); + } + if (cipherSuites != null) { + ((SSLSocket)sock).setEnabledCipherSuites(cipherSuites); + } + } + } + } + + static class CustomizedServerSocketFactory extends SSLServerSocketFactory { + final SSLContext sslc; + final String[] protocols; + final String[] cipherSuites; + + CustomizedServerSocketFactory(SSLContext ctx, String[] prots, String[] suites) + throws GeneralSecurityException { + super(); + sslc = (ctx != null) ? ctx : SSLContext.getDefault(); + protocols = prots; + cipherSuites = suites; + + // Create the Trust Manager Factory using the PKIX variant + TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); + } + + @Override + public ServerSocket createServerSocket(int port) throws IOException { + ServerSocket sock = + sslc.getServerSocketFactory().createServerSocket(port); + customizeSocket(sock); + return sock; + } + + @Override + public ServerSocket createServerSocket(int port, int backlog) + throws IOException { + ServerSocket sock = + sslc.getServerSocketFactory().createServerSocket(port, + backlog); + customizeSocket(sock); + return sock; + } + + @Override + public ServerSocket createServerSocket(int port, int backlog, + InetAddress ifAddress) throws IOException { + ServerSocket sock = + sslc.getServerSocketFactory().createServerSocket(port, + backlog, ifAddress); + customizeSocket(sock); + return sock; + } + + @Override + public String[] getDefaultCipherSuites() { + return sslc.getDefaultSSLParameters().getCipherSuites(); + } + + @Override + public String[] getSupportedCipherSuites() { + return sslc.getSupportedSSLParameters().getCipherSuites(); + } + + private void customizeSocket(ServerSocket sock) { + if (sock instanceof SSLServerSocket) { + if (protocols != null) { + ((SSLServerSocket)sock).setEnabledProtocols(protocols); + } + if (cipherSuites != null) { + ((SSLServerSocket)sock).setEnabledCipherSuites(cipherSuites); + } + } + } + } + + static class TestResult { Exception serverExc = null; Exception clientExc = null; diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/Stapling/StapleEnableProps.java openjdk-11-11~24/test/jdk/javax/net/ssl/Stapling/StapleEnableProps.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/Stapling/StapleEnableProps.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/Stapling/StapleEnableProps.java 2018-07-25 15:36:46.000000000 +0000 @@ -70,11 +70,16 @@ */ private static final boolean debug = false; - // These two ByteBuffer references will be used to hang onto ClientHello + // These four ByteBuffer references will be used to hang onto ClientHello // messages with and without the status_request[_v2] extensions. These - // will be used in the server-side stapling tests. - private static ByteBuffer cHelloStaple; - private static ByteBuffer cHelloNoStaple; + // will be used in the server-side stapling tests. There are two sets, + // one for 1.2 and earlier versions of the protocol and one for 1.3 + // and later versions, since the handshake and extension sets differ + // between the two sets. + private static ByteBuffer cHello12Staple; + private static ByteBuffer cHello12NoStaple; + private static ByteBuffer cHello13Staple; + private static ByteBuffer cHello13NoStaple; // The following items are used to set up the keystores. private static final String passwd = "passphrase"; @@ -94,6 +99,11 @@ private static SimpleOCSPServer intOcsp; // Intermediate CA OCSP server private static int intOcspPort; // Port for intermediate OCSP + // Extra configuration parameters and constants + static final String[] TLS13ONLY = new String[] { "TLSv1.3" }; + static final String[] TLS12MAX = + new String[] { "TLSv1.2", "TLSv1.1", "TLSv1" }; + // A few helpful TLS definitions to make it easier private static final int HELLO_EXT_STATUS_REQ = 5; private static final int HELLO_EXT_STATUS_REQ_V2 = 17; @@ -103,7 +113,7 @@ */ public static void main(String args[]) throws Exception { if (debug) { - System.setProperty("javax.net.debug", "ssl"); + System.setProperty("javax.net.debug", "ssl:handshake,verbose"); } // Create the PKI we will use for the test and start the OCSP servers @@ -128,6 +138,7 @@ System.out.println("========================================="); System.out.println("Client Test 1: " + "jdk.tls.client.enableStatusRequestExtension = true"); + System.out.println("Version = TLS 1.2"); System.out.println("========================================="); System.setProperty("jdk.tls.client.enableStatusRequestExtension", @@ -136,6 +147,7 @@ ctxStaple.init(null, tmf.getTrustManagers(), null); SSLEngine engine = ctxStaple.createSSLEngine(); engine.setUseClientMode(true); + engine.setEnabledProtocols(TLS12MAX); SSLSession session = engine.getSession(); ByteBuffer clientOut = ByteBuffer.wrap("I'm a Client".getBytes()); ByteBuffer cTOs = @@ -151,12 +163,13 @@ cTOs.flip(); System.out.println(dumpHexBytes(cTOs)); checkClientHello(cTOs, true, true); - cHelloStaple = cTOs; + cHello12Staple = cTOs; // Test with the property set to false System.out.println("========================================="); System.out.println("Client Test 2: " + "jdk.tls.client.enableStatusRequestExtension = false"); + System.out.println("Version = TLS 1.2"); System.out.println("========================================="); System.setProperty("jdk.tls.client.enableStatusRequestExtension", @@ -165,6 +178,7 @@ ctxNoStaple.init(null, tmf.getTrustManagers(), null); engine = ctxNoStaple.createSSLEngine(); engine.setUseClientMode(true); + engine.setEnabledProtocols(TLS12MAX); session = engine.getSession(); cTOs = ByteBuffer.allocateDirect(session.getPacketBufferSize()); @@ -178,7 +192,95 @@ cTOs.flip(); System.out.println(dumpHexBytes(cTOs)); checkClientHello(cTOs, false, false); - cHelloNoStaple = cTOs; + cHello12NoStaple = cTOs; + + // Turn the property back on to true and test using TLS 1.3 + System.out.println("========================================="); + System.out.println("Client Test 3: " + + "jdk.tls.client.enableStatusRequestExtension = true"); + System.out.println("Version = TLS 1.3"); + System.out.println("========================================="); + + System.setProperty("jdk.tls.client.enableStatusRequestExtension", + "true"); + ctxStaple = SSLContext.getInstance("TLS"); + ctxStaple.init(null, tmf.getTrustManagers(), null); + engine = ctxStaple.createSSLEngine(); + engine.setUseClientMode(true); + engine.setEnabledProtocols(TLS13ONLY); + session = engine.getSession(); + cTOs = ByteBuffer.allocateDirect(session.getPacketBufferSize()); + + // Create and check the ClientHello message + clientResult = engine.wrap(clientOut, cTOs); + log("client wrap: ", clientResult); + if (clientResult.getStatus() != SSLEngineResult.Status.OK) { + throw new SSLException("Client wrap got status: " + + clientResult.getStatus()); + } + cTOs.flip(); + System.out.println(dumpHexBytes(cTOs)); + checkClientHello(cTOs, true, false); + cHello13Staple = cTOs; + + // Turn the property off again and test in a TLS 1.3 handshake + System.out.println("========================================="); + System.out.println("Client Test 4: " + + "jdk.tls.client.enableStatusRequestExtension = false"); + System.out.println("Version = TLS 1.3"); + System.out.println("========================================="); + + System.setProperty("jdk.tls.client.enableStatusRequestExtension", + "false"); + ctxNoStaple = SSLContext.getInstance("TLS"); + ctxNoStaple.init(null, tmf.getTrustManagers(), null); + engine = ctxNoStaple.createSSLEngine(); + engine.setUseClientMode(true); + engine.setEnabledProtocols(TLS13ONLY); + session = engine.getSession(); + cTOs = ByteBuffer.allocateDirect(session.getPacketBufferSize()); + + // Create and check the ClientHello message + clientResult = engine.wrap(clientOut, cTOs); + log("client wrap: ", clientResult); + if (clientResult.getStatus() != SSLEngineResult.Status.OK) { + throw new SSLException("Client wrap got status: " + + clientResult.getStatus()); + } + cTOs.flip(); + System.out.println(dumpHexBytes(cTOs)); + checkClientHello(cTOs, false, false); + cHello13NoStaple = cTOs; + + // A TLS 1.3-capable hello, one that is not strictly limited to + // the TLS 1.3 protocol should have both status_request and + // status_request_v2 + System.out.println("========================================="); + System.out.println("Client Test 5: " + + "jdk.tls.client.enableStatusRequestExtension = true"); + System.out.println("Version = TLS 1.3 capable [default hello]"); + System.out.println("========================================="); + + System.setProperty("jdk.tls.client.enableStatusRequestExtension", + "true"); + ctxStaple = SSLContext.getInstance("TLS"); + ctxStaple.init(null, tmf.getTrustManagers(), null); + engine = ctxStaple.createSSLEngine(); + engine.setUseClientMode(true); + // Note: Unlike the other tests, there is no explicit protocol setting + session = engine.getSession(); + cTOs = ByteBuffer.allocateDirect(session.getPacketBufferSize()); + + // Create and check the ClientHello message + clientResult = engine.wrap(clientOut, cTOs); + log("client wrap: ", clientResult); + if (clientResult.getStatus() != SSLEngineResult.Status.OK) { + throw new SSLException("Client wrap got status: " + + clientResult.getStatus()); + } + cTOs.flip(); + System.out.println(dumpHexBytes(cTOs)); + checkClientHello(cTOs, true, true); } private static void testServerProp() throws Exception { @@ -189,6 +291,7 @@ System.out.println("========================================="); System.out.println("Server Test 1: " + "jdk.tls.server.enableStatusRequestExtension = true"); + System.out.println("Version = TLS 1.2"); System.out.println("========================================="); System.setProperty("jdk.tls.server.enableStatusRequestExtension", @@ -197,6 +300,7 @@ ctxStaple.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); SSLEngine engine = ctxStaple.createSSLEngine(); engine.setUseClientMode(false); + engine.setEnabledProtocols(TLS12MAX); SSLSession session = engine.getSession(); ByteBuffer serverOut = ByteBuffer.wrap("I'm a Server".getBytes()); ByteBuffer serverIn = @@ -205,7 +309,7 @@ ByteBuffer.allocateDirect(session.getPacketBufferSize()); // Consume the client hello - serverResult = engine.unwrap(cHelloStaple, serverIn); + serverResult = engine.unwrap(cHello12Staple, serverIn); log("server unwrap: ", serverResult); if (serverResult.getStatus() != SSLEngineResult.Status.OK) { throw new SSLException("Server unwrap got status: " + @@ -234,12 +338,13 @@ checkServerHello(sTOc, false, true); // Flip the client hello so we can reuse it in the next test. - cHelloStaple.flip(); + cHello12Staple.flip(); // Test with the server-side enable property set to false System.out.println("========================================="); System.out.println("Server Test 2: " + "jdk.tls.server.enableStatusRequestExtension = false"); + System.out.println("Version = TLS 1.2"); System.out.println("========================================="); System.setProperty("jdk.tls.server.enableStatusRequestExtension", @@ -248,12 +353,13 @@ ctxNoStaple.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); engine = ctxNoStaple.createSSLEngine(); engine.setUseClientMode(false); + engine.setEnabledProtocols(TLS12MAX); session = engine.getSession(); serverIn = ByteBuffer.allocate(session.getApplicationBufferSize() + 50); sTOc = ByteBuffer.allocateDirect(session.getPacketBufferSize()); // Consume the client hello - serverResult = engine.unwrap(cHelloStaple, serverIn); + serverResult = engine.unwrap(cHello12Staple, serverIn); log("server unwrap: ", serverResult); if (serverResult.getStatus() != SSLEngineResult.Status.OK) { throw new SSLException("Server unwrap got status: " + diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java openjdk-11-11~24/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/templates/SSLEngineTemplate.java 2018-07-25 15:36:46.000000000 +0000 @@ -245,6 +245,8 @@ log("\tClosing clientEngine's *OUTBOUND*..."); clientEngine.closeOutbound(); dataDone = true; + log("\tClosing serverEngine's *OUTBOUND*..."); + serverEngine.closeOutbound(); } } } diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java openjdk-11-11~24/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/templates/SSLSocketTemplate.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -133,6 +133,7 @@ protected SSLContext createClientSSLContext() throws Exception { return createSSLContext(trustedCertStrs, endEntityCertStrs, endEntityPrivateKeys, + endEntityPrivateKeyAlgs, endEntityPrivateKeyNames, getClientContextParameters()); } @@ -143,6 +144,7 @@ protected SSLContext createServerSSLContext() throws Exception { return createSSLContext(trustedCertStrs, endEntityCertStrs, endEntityPrivateKeys, + endEntityPrivateKeyAlgs, endEntityPrivateKeyNames, getServerContextParameters()); } @@ -357,173 +359,235 @@ private final static String[] trustedCertStrs = { // SHA256withECDSA, curve prime256v1 // Validity - // Not Before: Nov 25 04:19:51 2016 GMT - // Not After : Nov 5 04:19:51 2037 GMT + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 17 07:18:16 2038 GMT // Subject Key Identifier: - // CA:48:E8:00:C1:42:BD:59:9B:79:D9:B4:B4:CE:3F:68:0C:C8:C4:0C + // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 "-----BEGIN CERTIFICATE-----\n" + - "MIICHDCCAcGgAwIBAgIJAJtKs6ZEcVjxMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xNjExMjUwNDE5NTFaFw0zNzExMDUwNDE5NTFaMDsxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" + - "MBMGByqGSM49AgEGCCqGSM49AwEHA0IABKMO/AFDHZia65RaqMIBX7WBdtzFj8fz\n" + - "ggqMADLJhoszS6qfTUDYskETw3uHfB3KAOENsoKX446qFFPuVjxS1aejga0wgaow\n" + - "HQYDVR0OBBYEFMpI6ADBQr1Zm3nZtLTOP2gMyMQMMGsGA1UdIwRkMGKAFMpI6ADB\n" + - "Qr1Zm3nZtLTOP2gMyMQMoT+kPTA7MQswCQYDVQQGEwJVUzENMAsGA1UEChMESmF2\n" + - "YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2WCCQCbSrOmRHFY8TAPBgNV\n" + - "HRMBAf8EBTADAQH/MAsGA1UdDwQEAwIBBjAKBggqhkjOPQQDAgNJADBGAiEA5cJ/\n" + - "jirBbXxzpZ6kdp/Zb/yrIBnr4jiPGJTLgRTb8s4CIQChUDfP1Zqg0qJVfqFNaL4V\n" + - "a0EAeJHXGZnvCGGqHzoxkg==\n" + + "MIIBvjCCAWOgAwIBAgIJAIvFG6GbTroCMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + + "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + + "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYTAlVT\n" + + "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTBZ\n" + + "MBMGByqGSM49AgEGCCqGSM49AwEHA0IABBz1WeVb6gM2mh85z3QlvaB/l11b5h0v\n" + + "LIzmkC3DKlVukZT+ltH2Eq1oEkpXuf7QmbM0ibrUgtjsWH3mULfmcWmjUDBOMB0G\n" + + "A1UdDgQWBBRgz71z//oaMNKk7NNJcUbvGjWghjAfBgNVHSMEGDAWgBRgz71z//oa\n" + + "MNKk7NNJcUbvGjWghjAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMCA0kAMEYCIQCG\n" + + "6wluh1r2/T6L31mZXRKf9JxeSf9pIzoLj+8xQeUChQIhAJ09wAi1kV8yePLh2FD9\n" + + "2YEHlSQUAbwwqCDEVB5KxaqP\n" + "-----END CERTIFICATE-----", + // -----BEGIN PRIVATE KEY----- + // MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQg/HcHdoLJCdq3haVd + // XZTSKP00YzM3xX97l98vGL/RI1KhRANCAAQc9VnlW+oDNpofOc90Jb2gf5ddW+Yd + // LyyM5pAtwypVbpGU/pbR9hKtaBJKV7n+0JmzNIm61ILY7Fh95lC35nFp + // -----END PRIVATE KEY----- // SHA256withRSA, 2048 bits // Validity - // Not Before: Nov 25 04:20:02 2016 GMT - // Not After : Nov 5 04:20:02 2037 GMT + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 17 07:18:16 2038 GMT // Subject Key Identifier: - // A2:DC:55:38:E4:47:7C:8B:D3:E0:CA:FA:AD:3A:C8:4A:DD:12:A0:8E + // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C "-----BEGIN CERTIFICATE-----\n" + - "MIIDpzCCAo+gAwIBAgIJAO586A+hYNXaMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTAeFw0xNjExMjUwNDIwMDJaFw0zNzExMDUwNDIwMDJaMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMm3veDSU4zKXO0aAHos\n" + - "cFRXGLBTe+MUJXAtlkNyx7VKaMZNt5wrUuqzyi/r0LFUdRfNCzZf3X8s8HPHQVii\n" + - "29tK0y/yeTn4sJTATSmGaAysMJQpKQcfAQ79ItcEGQ721TFQZ3kOBdgp3t/yUYAP\n" + - "K2tFze/QbIw72LE52SBnPPPTzyimNw7Ai2MLl4eQlyMkTs7JS07zIiAO5QYbS8s+\n" + - "1NW0A3Y+d0B0q8wYEoHGq7QVjOKlSAksfO0tzi4l0Zu6Uf+J5kMAyZ4ZFgEJvGvw\n" + - "y/OKJ+soRFH/5cy1SL8B6AWD1y7WXugeeHTHRW1eOjTxqfG1rZqTVd2lfOMER8y1\n" + - "bXcCAwEAAaOBrTCBqjAdBgNVHQ4EFgQUotxVOORHfIvT4Mr6rTrISt0SoI4wawYD\n" + - "VR0jBGQwYoAUotxVOORHfIvT4Mr6rTrISt0SoI6hP6Q9MDsxCzAJBgNVBAYTAlVT\n" + - "MQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZjZYIJ\n" + - "AO586A+hYNXaMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMA0GCSqGSIb3\n" + - "DQEBCwUAA4IBAQAtNZJSFeFU6Yid0WSCs2qLAVaTyHsUNSUPUFIIhFAKxdP4DFS0\n" + - "+aeOFwdqizAU3kReAYULsfwEBgO51lPBSpB+9coUNQwu7cc8Q5Xqw/llRB0PrINS\n" + - "pZl7PW6Ur2ExTBocnUT9A/nhm8iO4PFD/Ly11sf5OdZihhX69NJ2h3a3gcrLjIpO\n" + - "L/ewTOgSi5xs+AGGQa+huN3YVL7dh+/rCUvMZVSBX5PloxWS5MMJi0Ui6YjwCFGO\n" + - "J4G9m7pI+gJs/x1UG0AgplMF2UCFfiY1SAeE2nKAeOOXAXEwEjFy0ToVTmqXx7fg\n" + - "m9YjhuePxlBrd2DF/YW0pc8gmLnrtm4rKPLz\n" + + "MIIDSTCCAjGgAwIBAgIJAI4ZF3iy8zG+MA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + + "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + + "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMDsxCzAJBgNVBAYT\n" + + "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + + "ZTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALpMcY7aWieXDEM1/YJf\n" + + "JW27b4nRIFZyEYhEloyGsKTuQiiQjc8cqRZFNXe2vwziDB4IyTEl0Hjl5QF6ZaQE\n" + + "huPzzwvQm1pv64KrRXrmj3FisQK8B5OWLty9xp6xDqsaMRoyObLK+oIb20T5fSlE\n" + + "evmo1vYjnh8CX0Yzx5Gr5ye6YSEHQvYOWEws8ad17OlyToR2KMeC8w4qo6rs59pW\n" + + "g7Mxn9vo22ImDzrtAbTbXbCias3xlE0Bp0h5luyf+5U4UgksoL9B9r2oP4GrLNEV\n" + + "oJk57t8lwaR0upiv3CnS8LcJELpegZub5ggqLY8ZPYFQPjlK6IzLOm6rXPgZiZ3m\n" + + "RL0CAwEAAaNQME4wHQYDVR0OBBYEFA3dk8n+S701t+iZeJD721o92xVMMB8GA1Ud\n" + + "IwQYMBaAFA3dk8n+S701t+iZeJD721o92xVMMAwGA1UdEwQFMAMBAf8wDQYJKoZI\n" + + "hvcNAQELBQADggEBAJTRC3rKUUhVH07/1+stUungSYgpM08dY4utJq0BDk36BbmO\n" + + "0AnLDMbkwFdHEoqF6hQIfpm7SQTmXk0Fss6Eejm8ynYr6+EXiRAsaXOGOBCzF918\n" + + "/RuKOzqABfgSU4UBKECLM5bMfQTL60qx+HdbdVIpnikHZOFfmjCDVxoHsGyXc1LW\n" + + "Jhkht8IGOgc4PMGvyzTtRFjz01kvrVQZ75aN2E0GQv6dCxaEY0i3ypSzjUWAKqDh\n" + + "3e2OLwUSvumcdaxyCdZAOUsN6pDBQ+8VRG7KxnlRlY1SMEk46QgQYLbPDe/+W/yH\n" + + "ca4PejicPeh+9xRAwoTpiE2gulfT7Lm+fVM7Ruc=\n" + "-----END CERTIFICATE-----", + // -----BEGIN PRIVATE KEY----- + // MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQC6THGO2lonlwxD + // Nf2CXyVtu2+J0SBWchGIRJaMhrCk7kIokI3PHKkWRTV3tr8M4gweCMkxJdB45eUB + // emWkBIbj888L0Jtab+uCq0V65o9xYrECvAeTli7cvcaesQ6rGjEaMjmyyvqCG9tE + // +X0pRHr5qNb2I54fAl9GM8eRq+cnumEhB0L2DlhMLPGndezpck6EdijHgvMOKqOq + // 7OfaVoOzMZ/b6NtiJg867QG0212womrN8ZRNAadIeZbsn/uVOFIJLKC/Qfa9qD+B + // qyzRFaCZOe7fJcGkdLqYr9wp0vC3CRC6XoGbm+YIKi2PGT2BUD45SuiMyzpuq1z4 + // GYmd5kS9AgMBAAECggEAFHSoU2MuWwJ+2jJnb5U66t2V1bAcuOE1g5zkWvG/G5z9 + // rq6Qo5kmB8f5ovdx6tw3MGUOklLwnRXBG3RxDJ1iokz3AvkY1clMNsDPlDsUrQKF + // JSO4QUBQTPSZhnsyfR8XHSU+qJ8Y+ohMfzpVv95BEoCzebtXdVgxVegBlcEmVHo2 + // kMmkRN+bYNsr8eb2r+b0EpyumS39ZgKYh09+cFb78y3T6IFMGcVJTP6nlGBFkmA/ + // 25pYeCF2tSki08qtMJZQAvKfw0Kviibk7ZxRbJqmc7B1yfnOEHP6ftjuvKl2+RP/ + // +5P5f8CfIP6gtA0LwSzAqQX/hfIKrGV5j0pCqrD0kQKBgQDeNR6Xi4sXVq79lihO + // a1bSeV7r8yoQrS8x951uO+ox+UIZ1MsAULadl7zB/P0er92p198I9M/0Jth3KBuS + // zj45mucvpiiGvmQlMKMEfNq4nN7WHOu55kufPswQB2mR4J3xmwI+4fM/nl1zc82h + // De8JSazRldJXNhfx0RGFPmgzbwKBgQDWoVXrXLbCAn41oVnWB8vwY9wjt92ztDqJ + // HMFA/SUohjePep9UDq6ooHyAf/Lz6oE5NgeVpPfTDkgvrCFVKnaWdwALbYoKXT2W + // 9FlyJox6eQzrtHAacj3HJooXWuXlphKSizntfxj3LtMR9BmrmRJOfK+SxNOVJzW2 + // +MowT20EkwKBgHmpB8jdZBgxI7o//m2BI5Y1UZ1KE5vx1kc7VXzHXSBjYqeV9FeF + // 2ZZLP9POWh/1Fh4pzTmwIDODGT2UPhSQy0zq3O0fwkyT7WzXRknsuiwd53u/dejg + // iEL2NPAJvulZ2+AuiHo5Z99LK8tMeidV46xoJDDUIMgTG+UQHNGhK5gNAoGAZn/S + // Cn7SgMC0CWSvBHnguULXZO9wH1wZAFYNLL44OqwuaIUFBh2k578M9kkke7woTmwx + // HxQTjmWpr6qimIuY6q6WBN8hJ2Xz/d1fwhYKzIp20zHuv5KDUlJjbFfqpsuy3u1C + // kts5zwI7pr1ObRbDGVyOdKcu7HI3QtR5qqyjwaUCgYABo7Wq6oHva/9V34+G3Goh + // 63bYGUnRw2l5BD11yhQv8XzGGZFqZVincD8gltNThB0Dc/BI+qu3ky4YdgdZJZ7K + // z51GQGtaHEbrHS5caV79yQ8QGY5mUVH3E+VXSxuIqb6pZq2DH4sTAEFHyncddmOH + // zoXBInYwRG9KE/Bw5elhUw== + // -----END PRIVATE KEY----- // SHA256withDSA, 2048 bits // Validity - // Not Before: Nov 25 04:19:56 2016 GMT - // Not After : Nov 5 04:19:56 2037 GMT + // Not Before: May 22 07:18:18 2018 GMT + // Not After : May 17 07:18:18 2038 GMT // Subject Key Identifier: - // 19:46:10:43:24:6A:A5:14:BE:E2:92:01:79:F0:4C:5F:E1:AE:81:B5 + // 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 "-----BEGIN CERTIFICATE-----\n" + - "MIIFCzCCBLGgAwIBAgIJAOnEn6YZD/sAMAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + - "EwJVUzENMAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2\n" + - "Y2UwHhcNMTYxMTI1MDQxOTU2WhcNMzcxMTA1MDQxOTU2WjA7MQswCQYDVQQGEwJV\n" + - "UzENMAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2Y2Uw\n" + - "ggNGMIICOQYHKoZIzjgEATCCAiwCggEBAJa17ZYdIChv5yeYuPK3zXxgUEGGsdUD\n" + - "AzfQUxtMryCtc3aNgWLxsN1/QYvp9v+hh4twnG20VemCEH9Qlx06Pxg74DwSOA83\n" + - "SecO2y7cdgmrHpep9drxKbXVZafwBhbTSwhV+IDO7EO6+LaRvZuya/YOqNIE9ENx\n" + - "FVk0NrNsDB6pfDEXZsCZALMN2mcl8KGn1q7vdzJQUEV7F6uLGP33znVfmQyWJH3Y\n" + - "W09WVCFXHvDzZHGXDO2O2QwIU1B5AsXnOGeLnKgXzErCoNKwUbVFP0W0OVeJo4pc\n" + - "ZfL/8TVELGG90AuuH1V3Gsq6PdzCDPw4Uv/v5m7/6kwXqBQxAJA7jhMCIQCORIGV\n" + - "mHy5nBLRhIP4vC7vsTxb4CTApPVmZeL5gTIwtQKCAQB2VZLY22k2+IQM6deRGK3L\n" + - "l7tPChGrKnGmTbtUThIza70Sp9DmTBiLzMEY+IgG8kYuT5STVxWjs0cxXCKZGMQW\n" + - "tioMtiXPA2M3HA0/8E0mDLSmzb0RAd2xxnDyGsuqo1eVmx7PLjN3bn3EjhD/+j3d\n" + - "Jx3ZVScMGyq7sVWppUvpudEXi+2etf6GUHjrcX27juo7u4zQ1ezC/HYG1H+jEFqG\n" + - "hdQ6b7H+LBHZH9LegOyIZTMrzAY/TwIr77sXrNJWRoxmDErKB+8bRDybYhNJswlZ\n" + - "m0N5YYUlPmepgbl6XzwCv0y0d81h3bayqIPLXEUtRAl9GuM0hNAlA1Y+qSn9xLFY\n" + - "A4IBBQACggEAZgWC0uflwqQQP1GRU1tolmFZwyVtKre7SjYgCeQBrOa0Xnj/SLaD\n" + - "g1HZ1oH0hccaR/45YouJiCretbbsQ77KouldGSGqTHJgRL75Y2z5uvxa60+YxZ0Z\n" + - "v8xvZnj4seyOjgJLxSSYSPl5n/F70RaNiCLVz/kGe6OQ8KoAeQjdDTOHXCegO9KX\n" + - "tvhM7EaYc8CII9OIR7S7PXJW0hgLKynZcu/Unh02aM0ABh/uLmw1+tvo8e8KTp98\n" + - "NKYSVf6kV3/ya58n4h64UbIYL08JoKUM/5SFETcKAZTU0YKZbpWTM79oJMr8oYVk\n" + - "P9jKitNsXq0Xkzt5dSO0kfu/kM7zpnaFsqOBrTCBqjAdBgNVHQ4EFgQUGUYQQyRq\n" + - "pRS+4pIBefBMX+GugbUwawYDVR0jBGQwYoAUGUYQQyRqpRS+4pIBefBMX+GugbWh\n" + - "P6Q9MDsxCzAJBgNVBAYTAlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5K\n" + - "U1NFIFRlc3QgU2VyaXZjZYIJAOnEn6YZD/sAMA8GA1UdEwEB/wQFMAMBAf8wCwYD\n" + - "VR0PBAQDAgEGMAsGCWCGSAFlAwQDAgNHADBEAiAwBafz5RRR9nc4cCYoYuBlT/D9\n" + - "9eayhkjhBY/zYunypwIgNp/JnFR88/T4hh36QfSKBGXId9RBCM6uaOkOKnEGkps=\n" + + "MIIErjCCBFSgAwIBAgIJAOktYLNCbr02MAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + + "EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" + + "Y2UwHhcNMTgwNTIyMDcxODE4WhcNMzgwNTE3MDcxODE4WjA7MQswCQYDVQQGEwJV\n" + + "UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Uw\n" + + "ggNHMIICOQYHKoZIzjgEATCCAiwCggEBAO5GyPhSm0ze3LSu+gicdULLj05iOfTL\n" + + "UvZQ29sYz41zmqrLBQbdKiHqgJu2Re9sgTb5suLNjF047TOLPnU3jhPtWm2X8Xzi\n" + + "VGIcHym/Q/MeZxStt/88seqroI3WOKzIML2GcrishT+lcGrtH36Tf1+ue2Snn3PS\n" + + "WyxygNqPjllP5uUjYmFLvAf4QLMldkd/D2VxcwsHjB8y5iUZsXezc/LEhRZS/02m\n" + + "ivqlRw3AMkq/OVe/ZtxFWsP0nsfxEGdZuaUFpppGfixxFvymrB3+J51cTt+pZBDq\n" + + "D2y0DYfc+88iCs4jwHTfcDIpLb538HBjBj2rEgtQESQmB0ooD/+wsPsCIQC1bYch\n" + + "gElNtDYL3FgpLgNSUYp7gIWv9ehaC7LO2z7biQKCAQBitvFOnDkUja8NAF7lDpOV\n" + + "b5ipQ8SicBLW3kQamxhyuyxgZyy/PojZ/oPorkqW/T/A0rhnG6MssEpAtdiwVB+c\n" + + "rBYGo3bcwmExJhdOJ6dYuKFppPWhCwKMHs9npK+lqBMl8l5j58xlcFeC7ZfGf8GY\n" + + "GkhFW0c44vEQhMMbac6ZTTP4mw+1t7xJfmDMlLEyIpTXaAAk8uoVLWzQWnR40sHi\n" + + "ybvS0u3JxQkb7/y8tOOZu8qlz/YOS7lQ6UxUGX27Ce1E0+agfPphetoRAlS1cezq\n" + + "Wa7r64Ga0nkj1kwkcRqjgTiJx0NwnUXr78VAXFhVF95+O3lfqhvdtEGtkhDGPg7N\n" + + "A4IBBgACggEBAMmSHQK0w2i+iqUjOPzn0yNEZrzepLlLeQ1tqtn0xnlv5vBAeefD\n" + + "Pm9dd3tZOjufVWP7hhEz8xPobb1CS4e3vuQiv5UBfhdPL3f3l9T7JMAKPH6C9Vve\n" + + "OQXE5eGqbjsySbcmseHoYUt1WCSnSda1opX8zchX04e7DhGfE2/L9flpYEoSt8lI\n" + + "vMNjgOwvKdW3yvPt1/eBBHYNFG5gWPv/Q5KoyCtHS03uqGm4rNc/wZTIEEfd66C+\n" + + "QRaUltjOaHmtwOdDHaNqwhYZSVOip+Mo+TfyzHFREcdHLapo7ZXqbdYkRGxRR3d+\n" + + "3DfHaraJO0OKoYlPkr3JMvM/MSGR9AnZOcejUDBOMB0GA1UdDgQWBBR2Zp73O91F\n" + + "5TvZcjw/8FQ5hjEmUzAfBgNVHSMEGDAWgBR2Zp73O91F5TvZcjw/8FQ5hjEmUzAM\n" + + "BgNVHRMEBTADAQH/MAsGCWCGSAFlAwQDAgNHADBEAiBzriYE41M2y9Hy5ppkL0Qn\n" + + "dIlNc8JhXT/PHW7GDtViagIgMko8Qoj9gDGPK3+O9E8DC3wGiiF9CObM4LN387ok\n" + + "J+g=\n" + "-----END CERTIFICATE-----" + // -----BEGIN PRIVATE KEY----- + // MIICZQIBADCCAjkGByqGSM44BAEwggIsAoIBAQDuRsj4UptM3ty0rvoInHVCy49O + // Yjn0y1L2UNvbGM+Nc5qqywUG3Soh6oCbtkXvbIE2+bLizYxdOO0ziz51N44T7Vpt + // l/F84lRiHB8pv0PzHmcUrbf/PLHqq6CN1jisyDC9hnK4rIU/pXBq7R9+k39frntk + // p59z0lsscoDaj45ZT+blI2JhS7wH+ECzJXZHfw9lcXMLB4wfMuYlGbF3s3PyxIUW + // Uv9Npor6pUcNwDJKvzlXv2bcRVrD9J7H8RBnWbmlBaaaRn4scRb8pqwd/iedXE7f + // qWQQ6g9stA2H3PvPIgrOI8B033AyKS2+d/BwYwY9qxILUBEkJgdKKA//sLD7AiEA + // tW2HIYBJTbQ2C9xYKS4DUlGKe4CFr/XoWguyzts+24kCggEAYrbxTpw5FI2vDQBe + // 5Q6TlW+YqUPEonAS1t5EGpsYcrssYGcsvz6I2f6D6K5Klv0/wNK4ZxujLLBKQLXY + // sFQfnKwWBqN23MJhMSYXTienWLihaaT1oQsCjB7PZ6SvpagTJfJeY+fMZXBXgu2X + // xn/BmBpIRVtHOOLxEITDG2nOmU0z+JsPtbe8SX5gzJSxMiKU12gAJPLqFS1s0Fp0 + // eNLB4sm70tLtycUJG+/8vLTjmbvKpc/2Dku5UOlMVBl9uwntRNPmoHz6YXraEQJU + // tXHs6lmu6+uBmtJ5I9ZMJHEao4E4icdDcJ1F6+/FQFxYVRfefjt5X6ob3bRBrZIQ + // xj4OzQQjAiEAsceWOM8do4etxp2zgnoNXV8PUUyqWhz1+0srcKV7FR4= + // -----END PRIVATE KEY----- }; // End entity certificate. private final static String[] endEntityCertStrs = { // SHA256withECDSA, curve prime256v1 // Validity - // Not Before: Nov 25 04:19:51 2016 GMT - // Not After : Aug 12 04:19:51 2036 GMT + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 17 07:18:16 2038 GMT // Authority Key Identifier: - // CA:48:E8:00:C1:42:BD:59:9B:79:D9:B4:B4:CE:3F:68:0C:C8:C4:0C + // 60:CF:BD:73:FF:FA:1A:30:D2:A4:EC:D3:49:71:46:EF:1A:35:A0:86 "-----BEGIN CERTIFICATE-----\n" + - "MIIB1zCCAXygAwIBAgIJAPFq2QL/nUNZMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + - "AlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + - "ZTAeFw0xNjExMjUwNDE5NTFaFw0zNjA4MTIwNDE5NTFaMFUxCzAJBgNVBAYTAlVT\n" + + "MIIBqjCCAVCgAwIBAgIJAPLY8qZjgNRAMAoGCCqGSM49BAMCMDsxCzAJBgNVBAYT\n" + + "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + + "ZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYTAlVT\n" + "MQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZjZTEY\n" + "MBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD\n" + - "QgAE4yvRGVvy9iVATyuHPJVdX6+lh/GLm/sRJ5qLT/3PVFOoNIvlEVNiARo7xhyj\n" + - "2p6bnf32gNg5Ye+QCw20VUv9E6NPME0wCwYDVR0PBAQDAgPoMB0GA1UdDgQWBBSO\n" + - "hHlHZQp9hyBfSGTSQWeszqMXejAfBgNVHSMEGDAWgBTKSOgAwUK9WZt52bS0zj9o\n" + - "DMjEDDAKBggqhkjOPQQDAgNJADBGAiEAu3t6cvFglBAZfkhZlEwB04ZjUFqyfiRj\n" + - "4Hr275E4ZoQCIQDUEonJHlmA19J6oobfR5lYsmoqPm1r0DPm/IiNNKGKKA==\n" + + "QgAEb+9n05qfXnfHUb0xtQJNS4JeSi6IjOfW5NqchvKnfJey9VkJzR7QHLuOESdf\n" + + "xlR7q8YIWgih3iWLGfB+wxHiOqMjMCEwHwYDVR0jBBgwFoAUYM+9c//6GjDSpOzT\n" + + "SXFG7xo1oIYwCgYIKoZIzj0EAwIDSAAwRQIgWpRegWXMheiD3qFdd8kMdrkLxRbq\n" + + "1zj8nQMEwFTUjjQCIQDRIrAjZX+YXHN9b0SoWWLPUq0HmiFIi8RwMnO//wJIGQ==\n" + "-----END CERTIFICATE-----", // SHA256withRSA, 2048 bits // Validity - // Not Before: Nov 25 04:20:02 2016 GMT - // Not After : Aug 12 04:20:02 2036 GMT + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 17 07:18:16 2038 GMT // Authority Key Identifier: - // A2:DC:55:38:E4:47:7C:8B:D3:E0:CA:FA:AD:3A:C8:4A:DD:12:A0:8E + // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C "-----BEGIN CERTIFICATE-----\n" + - "MIIDdjCCAl6gAwIBAgIJAJDcIGOlAmBmMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + - "BAYTAlVTMQ0wCwYDVQQKEwRKYXZhMR0wGwYDVQQLExRTdW5KU1NFIFRlc3QgU2Vy\n" + - "aXZjZTAeFw0xNjExMjUwNDIwMDJaFw0zNjA4MTIwNDIwMDJaMFUxCzAJBgNVBAYT\n" + + "MIIDNjCCAh6gAwIBAgIJAO2+yPcFryUTMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + + "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + + "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0zODA1MTcwNzE4MTZaMFUxCzAJBgNVBAYT\n" + "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + "ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MIIBIjANBgkqhkiG9w0BAQEFAAOC\n" + - "AQ8AMIIBCgKCAQEAp0dHrifTg2aY0sH03f2JjK2fW4DL6gLDKq0YirsNE07z54LF\n" + - "IeeDio49XwPjB7OpbUTC1hf/YKZ7XiRWyPa1rYozZ88emhZt+cpkyKz+nmW4avlA\n" + - "WnrV+gx4+bU9T+WuBWdAraBcq27Y1I26yfCEtC8k3+O0sdlHbhasF+BUDmX/n4+n\n" + - "ifJdbNm5eSDx8eFYHFTdjhAud3An2X6QD9WWSoJpPdDi4utHhFAlxW6osjJxsAPv\n" + - "zo8YsqmpCMjZcEks4ZsqiZKKiWUWUAjCcbMerDPDX29fyeo348uztvJsmNRzfcwl\n" + - "FtwxpYdxuZqwHi2QoNaQTGXjjbZFmjn7qEkjXwIDAQABo2MwYTALBgNVHQ8EBAMC\n" + - "A+gwHQYDVR0OBBYEFP+henfufE6Znr60lRkmayadVdxnMB8GA1UdIwQYMBaAFKLc\n" + - "VTjkR3yL0+DK+q06yErdEqCOMBIGA1UdEQEB/wQIMAaHBH8AAAEwDQYJKoZIhvcN\n" + - "AQELBQADggEBAK56pV2XoAIkrHFTCkWtYX518nuvkzN6a6BqPKALQlmlbJnq/lhV\n" + - "tPQx79b0j7tow28l2ze/3M0hRb5Ft/d/7mITZNMR+0owk4U51AU2NacRt7fpoxu5\n" + - "wX3hTa4VgX2+BAXeoWF+Yzy6Jj5gAVmSLzBnkTUH0d+EyL1pp+DFE3QdvZqf3+nP\n" + - "zkxz15h3iW8FwI+7/19MX2j2XB/sG8mJpqoszWw8lM4qCa2eWyCbqSHhPi+/+rGg\n" + - "dDG5uzZeOC845GEH2T3tHDA+F3WwcZG/W+4RR6ZaaHlqPKKMcwFL73YbsqdCiKBv\n" + - "p6sXrhIiP0oXImRBRLDlidj5TIOLfAtNM9A=\n" + + "AQ8AMIIBCgKCAQEAszfBobWfZIp8AgC6PiWDDavP65mSvgCXUGxACbxVNAfkLhNR\n" + + "QOsHriRB3X1Q3nvO9PetC6wKlvE9jlnDDj7D+1j1r1CHO7ms1fq8rfcQYdkanDtu\n" + + "4AlHo8v+SSWX16MIXFRYDj2VVHmyPtgbltcg4zGAuwT746FdLI94uXjJjq1IOr/v\n" + + "0VIlwE5ORWH5Xc+5Tj+oFWK0E4a4GHDgtKKhn2m72hN56/GkPKGkguP5NRS1qYYV\n" + + "/EFkdyQMOV8J1M7HaicSft4OL6eKjTrgo93+kHk+tv0Dc6cpVBnalX3TorG8QI6B\n" + + "cHj1XQd78oAlAC+/jF4pc0mwi0un49kdK9gRfQIDAQABoyMwITAfBgNVHSMEGDAW\n" + + "gBQN3ZPJ/ku9NbfomXiQ+9taPdsVTDANBgkqhkiG9w0BAQsFAAOCAQEApXS0nKwm\n" + + "Kp8gpmO2yG1rpd1+2wBABiMU4JZaTqmma24DQ3RzyS+V2TeRb29dl5oTUEm98uc0\n" + + "GPZvhK8z5RFr4YE17dc04nI/VaNDCw4y1NALXGs+AHkjoPjLyGbWpi1S+gfq2sNB\n" + + "Ekkjp6COb/cb9yiFXOGVls7UOIjnVZVd0r7KaPFjZhYh82/f4PA/A1SnIKd1+nfH\n" + + "2yk7mSJNC7Z3qIVDL8MM/jBVwiC3uNe5GPB2uwhd7k5LGAVN3j4HQQGB0Sz+VC1h\n" + + "92oi6xDa+YBva2fvHuCd8P50DDjxmp9CemC7rnZ5j8egj88w14X44Xjb/Fd/ApG9\n" + + "e57NnbT7KM+Grw==\n" + + "-----END CERTIFICATE-----", + + // SHA256withRSA, curv prime256v1 + // Validity + // Not Before: May 22 07:18:16 2018 GMT + // Not After : May 21 07:18:16 2028 GMT + // Authority Key Identifier: + // 0D:DD:93:C9:FE:4B:BD:35:B7:E8:99:78:90:FB:DB:5A:3D:DB:15:4C + "-----BEGIN CERTIFICATE-----\n" + + "MIICazCCAVOgAwIBAgIJAO2+yPcFryUUMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNV\n" + + "BAYTAlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2Vy\n" + + "aXZjZTAeFw0xODA1MjIwNzE4MTZaFw0yODA1MjEwNzE4MTZaMFUxCzAJBgNVBAYT\n" + + "AlVTMQ0wCwYDVQQKDARKYXZhMR0wGwYDVQQLDBRTdW5KU1NFIFRlc3QgU2VyaXZj\n" + + "ZTEYMBYGA1UEAwwPUmVncmVzc2lvbiBUZXN0MFkwEwYHKoZIzj0CAQYIKoZIzj0D\n" + + "AQcDQgAE59MERNTlVZ1eeps8Z3Oue5ZkgQdPtD+WIE6tj3PbIKpxGPDxvfNP959A\n" + + "yQjEK/ehWQVrCMmNoEkIzY+IIBgB06MjMCEwHwYDVR0jBBgwFoAUDd2Tyf5LvTW3\n" + + "6Jl4kPvbWj3bFUwwDQYJKoZIhvcNAQELBQADggEBAFOTVEqs70ykhZiIdrEsF1Ra\n" + + "I3B2rLvwXZk52uSltk2/bzVvewA577ZCoxQ1pL7ynkisPfBN1uVYtHjM1VA3RC+4\n" + + "+TAK78dnI7otYjWoHp5rvs4l6c/IbOspS290IlNuDUxMErEm5wxIwj+Aukx/1y68\n" + + "hOyCvHBLMY2c1LskH1MMBbDuS1aI+lnGpToi+MoYObxGcV458vxuT8+wwV8Fkpvd\n" + + "ll8IIFmeNPRv+1E+lXbES6CSNCVaZ/lFhPgdgYKleN7sfspiz50DG4dqafuEAaX5\n" + + "xaK1NWXJxTRz0ROH/IUziyuDW6jphrlgit4+3NCzp6vP9hAJQ8Vhcj0n15BKHIQ=\n" + "-----END CERTIFICATE-----", // SHA256withDSA, 2048 bits // Validity - // Not Before: Nov 25 04:19:56 2016 GMT - // Not After : Aug 12 04:19:56 2036 GMT + // Not Before: May 22 07:18:20 2018 GMT + // Not After : May 17 07:18:20 2038 GMT // Authority Key Identifier: - // 19:46:10:43:24:6A:A5:14:BE:E2:92:01:79:F0:4C:5F:E1:AE:81:B5 + // 76:66:9E:F7:3B:DD:45:E5:3B:D9:72:3C:3F:F0:54:39:86:31:26:53 "-----BEGIN CERTIFICATE-----\n" + - "MIIE2jCCBICgAwIBAgIJAONcI1oba9V9MAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + - "EwJVUzENMAsGA1UEChMESmF2YTEdMBsGA1UECxMUU3VuSlNTRSBUZXN0IFNlcml2\n" + - "Y2UwHhcNMTYxMTI1MDQxOTU2WhcNMzYwODEyMDQxOTU2WjBVMQswCQYDVQQGEwJV\n" + + "MIIEnDCCBEGgAwIBAgIJAP/jh1qVhNVjMAsGCWCGSAFlAwQDAjA7MQswCQYDVQQG\n" + + "EwJVUzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2\n" + + "Y2UwHhcNMTgwNTIyMDcxODIwWhcNMzgwNTE3MDcxODIwWjBVMQswCQYDVQQGEwJV\n" + "UzENMAsGA1UECgwESmF2YTEdMBsGA1UECwwUU3VuSlNTRSBUZXN0IFNlcml2Y2Ux\n" + - "GDAWBgNVBAMMD1JlZ3Jlc3Npb24gVGVzdDCCA0YwggI5BgcqhkjOOAQBMIICLAKC\n" + - "AQEAlrXtlh0gKG/nJ5i48rfNfGBQQYax1QMDN9BTG0yvIK1zdo2BYvGw3X9Bi+n2\n" + - "/6GHi3CcbbRV6YIQf1CXHTo/GDvgPBI4DzdJ5w7bLtx2Casel6n12vEptdVlp/AG\n" + - "FtNLCFX4gM7sQ7r4tpG9m7Jr9g6o0gT0Q3EVWTQ2s2wMHql8MRdmwJkAsw3aZyXw\n" + - "oafWru93MlBQRXsXq4sY/ffOdV+ZDJYkfdhbT1ZUIVce8PNkcZcM7Y7ZDAhTUHkC\n" + - "xec4Z4ucqBfMSsKg0rBRtUU/RbQ5V4mjilxl8v/xNUQsYb3QC64fVXcayro93MIM\n" + - "/DhS/+/mbv/qTBeoFDEAkDuOEwIhAI5EgZWYfLmcEtGEg/i8Lu+xPFvgJMCk9WZl\n" + - "4vmBMjC1AoIBAHZVktjbaTb4hAzp15EYrcuXu08KEasqcaZNu1ROEjNrvRKn0OZM\n" + - "GIvMwRj4iAbyRi5PlJNXFaOzRzFcIpkYxBa2Kgy2Jc8DYzccDT/wTSYMtKbNvREB\n" + - "3bHGcPIay6qjV5WbHs8uM3dufcSOEP/6Pd0nHdlVJwwbKruxVamlS+m50ReL7Z61\n" + - "/oZQeOtxfbuO6ju7jNDV7ML8dgbUf6MQWoaF1Dpvsf4sEdkf0t6A7IhlMyvMBj9P\n" + - "Aivvuxes0lZGjGYMSsoH7xtEPJtiE0mzCVmbQ3lhhSU+Z6mBuXpfPAK/TLR3zWHd\n" + - "trKog8tcRS1ECX0a4zSE0CUDVj6pKf3EsVgDggEFAAKCAQBEGmdP55PyE3M+Q3fU\n" + - "dCGq0sbKw/04xPVhaNYRnRKNR82n+wb8bMCI1vvFqXy1BB6svti4mTHbQZ8+bQXm\n" + - "gyce67uYMwIa5BIk6omNGCeW/kd4ruPgyFxeb6O/Y/7w6AWyRmQttlxRA5M5OhSC\n" + - "tVS4oVC1KK1EfHAUh7mu8S8GrWJoJAWA3PM97Oy/HSGCEUl6HGEu1m7FHPhOKeYG\n" + - "cLkSaov5cbCYO76smHchI+tdUciVqeL3YKQdS+KAzsQoeAZIu/WpbaI1V+5/rSG1\n" + - "I94uBITLCjlJfJZ1aredCDrRXOFH7qgSBhM8/WzwFpFCnnpbSKMgrcrKubsFmW9E\n" + - "jQhXo2MwYTALBgNVHQ8EBAMCA+gwHQYDVR0OBBYEFNA9PhQOjB+05fxxXPNqe0OT\n" + - "doCjMB8GA1UdIwQYMBaAFBlGEEMkaqUUvuKSAXnwTF/hroG1MBIGA1UdEQEB/wQI\n" + - "MAaHBH8AAAEwCwYJYIZIAWUDBAMCA0cAMEQCIE0LM2sZi+L8tjH9sgjLEwJmYZvO\n" + - "yqNfQnXrkTCb+MLMAiBZLaRTVJrOW3edQjum+SonKKuiN22bRclO6pGuNRCtng==\n" + + "GDAWBgNVBAMMD1JlZ3Jlc3Npb24gVGVzdDCCA0cwggI6BgcqhkjOOAQBMIICLQKC\n" + + "AQEAmlavgoJrMcjqWRVcDE2dmWAPREgnzQvneEDef68cprDzjSwvOs5QeFyx75ib\n" + + "ado1e6jO/rW1prCGWHDD1oA/Tn4Pk3vu0nUxzvl1qATc+aJbpUU5Op0bvp6LbCsQ\n" + + "QslV9FeRh7Eb7bP6gpc/kHCBzEgC1VCK7prccXWy+t6SMOHbND3h+UbckfSaUuaV\n" + + "sVJNTD1D6GElfRj4Nmz1BGPfSYvKorwNZEU3gXwFgtDoAcGx7tcyClLpDHfqRfw/\n" + + "7yiqLyeiP7D4hl5lMNouJWDlAdMFp0FMgS3s9VDFinIcr6VtBWMTG7+4+czHAB+3\n" + + "fvrwlqNzhBn3uFHrekN/w8fNxwIhAJo7Sae1za7IMW0Q6hE5B4b+s2B/FaKPoA4E\n" + + "jtZu13B9AoIBAQCOZqLMKfvqZWUgT0PQ3QjR7dAFdd06I9Y3+TOQzZk1+j+vw/6E\n" + + "X4vFItX4gihb/u5Q9CdmpwhVGi7bvo+7+/IKeTgoQ6f5+PSug7SrWWUQ5sPwaZui\n" + + "zXZJ5nTeZDucFc2yFx0wgnjbPwiUxZklOT7xGiOMtzOTa2koCz5KuIBL+/wPKKxm\n" + + "ypo9VoY9xfbdU6LMXZv/lpD5XTM9rYHr/vUTNkukvV6Hpm0YMEWhVZKUJiqCqTqG\n" + + "XHaleOxSw6uQWB/+TznifcC7gB48UOQjCqOKf5VuwQneJLhlhU/jhRV3xtr+hLZa\n" + + "hW1wYhVi8cjLDrZFKlgEQqhB4crnJU0mJY+tA4IBBQACggEAID0ezl00/X8mv7eb\n" + + "bzovum1+DEEP7FM57k6HZEG2N3ve4CW+0m9Cd+cWPz8wkZ+M0j/Eqa6F0IdbkXEc\n" + + "Q7CuzvUyJ57xQ3L/WCgXsiS+Bh8O4Mz7GwW22CGmHqafbVv+hKBfr8MkskO6GJUt\n" + + "SUF/CVLzB4gMIvZMH26tBP2xK+i7FeEK9kT+nGdzQSZBAhFYpEVCBplHZO24/OYq\n" + + "1DNoU327nUuXIhmsfA8N0PjiWbIZIjTPwBGr9H0LpATI7DIDNcvRRvtROP+pBU9y\n" + + "fuykPkptg9C0rCM9t06bukpOSaEz/2VIQdLE8fHYFA6pHZ6CIc2+5cfvMgTPhcjz\n" + + "W2jCt6MjMCEwHwYDVR0jBBgwFoAUdmae9zvdReU72XI8P/BUOYYxJlMwCwYJYIZI\n" + + "AWUDBAMCA0gAMEUCIQCeI5fN08b9BpOaHdc3zQNGjp24FOL/RxlBLeBAorswJgIg\n" + + "JEZ8DhYxQy1O7mmZ2UIT7op6epWMB4dENjs0qWPmcKo=\n" + "-----END CERTIFICATE-----" }; @@ -532,65 +596,81 @@ // // EC private key related to cert endEntityCertStrs[0]. // - "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgGAy4Pxrd2keM7AdP\n" + - "VNUMEO5iO681v4/tstVGfdXkCTuhRANCAATjK9EZW/L2JUBPK4c8lV1fr6WH8Yub\n" + - "+xEnmotP/c9UU6g0i+URU2IBGjvGHKPanpud/faA2Dlh75ALDbRVS/0T", + "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgn5K03bpTLjEtFQRa\n" + + "JUtx22gtmGEvvSUSQdimhGthdtihRANCAARv72fTmp9ed8dRvTG1Ak1Lgl5KLoiM\n" + + "59bk2pyG8qd8l7L1WQnNHtAcu44RJ1/GVHurxghaCKHeJYsZ8H7DEeI6", // // RSA private key related to cert endEntityCertStrs[1]. // - "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCnR0euJ9ODZpjS\n" + - "wfTd/YmMrZ9bgMvqAsMqrRiKuw0TTvPngsUh54OKjj1fA+MHs6ltRMLWF/9gpnte\n" + - "JFbI9rWtijNnzx6aFm35ymTIrP6eZbhq+UBaetX6DHj5tT1P5a4FZ0CtoFyrbtjU\n" + - "jbrJ8IS0LyTf47Sx2UduFqwX4FQOZf+fj6eJ8l1s2bl5IPHx4VgcVN2OEC53cCfZ\n" + - "fpAP1ZZKgmk90OLi60eEUCXFbqiyMnGwA+/OjxiyqakIyNlwSSzhmyqJkoqJZRZQ\n" + - "CMJxsx6sM8Nfb1/J6jfjy7O28myY1HN9zCUW3DGlh3G5mrAeLZCg1pBMZeONtkWa\n" + - "OfuoSSNfAgMBAAECggEAWnAHKPkPObN2XDvQj1RL0WrtBSOVG2dy7Ne4tQh8ATxm\n" + - "UXw56CKq03YjaANJ8xgHObQ7QlSnFTHs8PDkmrIHd1OIh09LVDNcMfhilLwyzKBi\n" + - "HDO1vzU6Cn5DyX1bMJ8UfodcSIKyl1zOjdwyaItIs8HpRcJuJtk57SME18PIrh9H\n" + - "EWchWSxTvPvKDY2bhb4vBMgVPfTQO3yc8gY/1J5vKPqDpyEuCGjV13zd/AoL/u5A\n" + - "sG10hQ2veJ9KAn1xwPwEoAkCdNLL8vPB1rCbeMZNamqHZRihfoOgDnnJIf3FtUFF\n" + - "8bS2FM2kGQR+05SZdhBmJl0obPrbBWil/2vxqeFrgQKBgQDZl1yQsFss2BKK2VAh\n" + - "9PKc8tU1v6RpHQZhJEDSct2slHQS5DF6bWl5kJiPevXSvcnjgoPamZf7Joii+Rds\n" + - "3xtPQmRw2vQmXBQzQS1YoRuh4hUlkdFWCjUNNg1kvipue6FO4PVg3ViP7llN8PXK\n" + - "rSpVxn0a36UiN9jN2zMOUs6tJwKBgQDEzlqa7DghMli7TUdL44uvD2/ceiHqHMMw\n" + - "5eLsEHeRVn/EVU99beKw/dAOGwRssTpCd9h7fwzQ2503/Qb/Goe0nKE7+xvt3/sE\n" + - "n2Y8Qfv1W1+hGb2qU2jhQaR5bZrLZp0+BgRuQ4ttpYvzopYe4FLZWhDBA0zsGyu0\n" + - "nCi7lUSrCQKBgGeGYW8hyS9r2l6fiEWvsiLEUnbRKFsuiRN82S6HojpzI0q9sWDL\n" + - "X6yMBFn3qa/LxpttRGikPTAsJERN+Tw+ZlLuhrU/J3x8wMumDfomJOx/kYofd5bV\n" + - "ImqXtgWhiLSqM5RA6d5dUb6hK3Iu2/LDMuo+ltVLZNkD8y32RbNh6J1vAoGAbLqQ\n" + - "pgyhSf3Vtc0Q+aVB87p0k3tKJ1wynl4zSzYhyMLgHakAHIzL8/qVqmVUwXP8euJZ\n" + - "UIk1nGHobxk0d1XB6Y+rKEcn+/iFZt1ljx7pQ3ly0L824NXqGKC6bHeYUI1li/Gp\n" + - "Gv3oFvCh7D1D8NUAEKLIpMndAohUUhkAC/qAkHkCgYEAzSIarDNquayV+umC1SXm\n" + - "Zo6XLuzWjudLxPd2lyCfwR2aRKlrb+5OFYErX+RSLyCJmaqVZMyXP09PBIvNXu2Z\n" + - "+gbx5WUC+kA+6zdKEPXowei6i6EHMXYT2AL7395ZbPajZjsCduE3WuUztuHrhtMm\n" + - "JI+k1o4rCnSLlX4gWdN1oTs=", + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCzN8GhtZ9kinwC\n" + + "ALo+JYMNq8/rmZK+AJdQbEAJvFU0B+QuE1FA6weuJEHdfVDee870960LrAqW8T2O\n" + + "WcMOPsP7WPWvUIc7uazV+ryt9xBh2RqcO27gCUejy/5JJZfXowhcVFgOPZVUebI+\n" + + "2BuW1yDjMYC7BPvjoV0sj3i5eMmOrUg6v+/RUiXATk5FYfldz7lOP6gVYrQThrgY\n" + + "cOC0oqGfabvaE3nr8aQ8oaSC4/k1FLWphhX8QWR3JAw5XwnUzsdqJxJ+3g4vp4qN\n" + + "OuCj3f6QeT62/QNzpylUGdqVfdOisbxAjoFwePVdB3vygCUAL7+MXilzSbCLS6fj\n" + + "2R0r2BF9AgMBAAECggEASIkPkMCuw4WdTT44IwERus3IOIYOs2IP3BgEDyyvm4B6\n" + + "JP/iihDWKfA4zEl1Gqcni1RXMHswSglXra682J4kui02Ov+vzEeJIY37Ibn2YnP5\n" + + "ZjRT2s9GtI/S2o4hl8A/mQb2IMViFC+xKehTukhV4j5d6NPKk0XzLR7gcMjnYxwn\n" + + "l21fS6D2oM1xRG/di7sL+uLF8EXLRzfiWDNi12uQv4nwtxPKvuKhH6yzHt7YqMH0\n" + + "46pmDKDaxV4w1JdycjCb6NrCJOYZygoQobuZqOQ30UZoZsPJrtovkncFr1e+lNcO\n" + + "+aWDfOLCtTH046dEQh5oCShyXMybNlry/QHsOtHOwQKBgQDh2iIjs+FPpQy7Z3EX\n" + + "DGEvHYqPjrYO9an2KSRr1m9gzRlWYxKY46WmPKwjMerYtra0GP+TBHrgxsfO8tD2\n" + + "wUAII6sd1qup0a/Sutgf2JxVilLykd0+Ge4/Cs51tCdJ8EqDV2B6WhTewOY2EGvg\n" + + "JiKYkeNwgRX/9M9CFSAMAk0hUQKBgQDLJAartL3DoGUPjYtpJnfgGM23yAGl6G5r\n" + + "NSXDn80BiYIC1p0bG3N0xm3yAjqOtJAUj9jZbvDNbCe3GJfLARMr23legX4tRrgZ\n" + + "nEdKnAFKAKL01oM+A5/lHdkwaZI9yyv+hgSVdYzUjB8rDmzeVQzo1BT7vXypt2yV\n" + + "6O1OnUpCbQKBgA/0rzDChopv6KRcvHqaX0tK1P0rYeVQqb9ATNhpf9jg5Idb3HZ8\n" + + "rrk91BNwdVz2G5ZBpdynFl9G69rNAMJOCM4KZw5mmh4XOEq09Ivba8AHU7DbaTv3\n" + + "7QL7KnbaUWRB26HHzIMYVh0el6T+KADf8NXCiMTr+bfpfbL3dxoiF3zhAoGAbCJD\n" + + "Qse1dBs/cKYCHfkSOsI5T6kx52Tw0jS6Y4X/FOBjyqr/elyEexbdk8PH9Ar931Qr\n" + + "NKMvn8oA4iA/PRrXX7M2yi3YQrWwbkGYWYjtzrzEAdzmg+5eARKAeJrZ8/bg9l3U\n" + + "ttKaItJsDPlizn8rngy3FsJpR9aSAMK6/+wOiYkCgYEA1tZkI1rD1W9NYZtbI9BE\n" + + "qlJVFi2PBOJMKNuWdouPX3HLQ72GJSQff2BFzLTELjweVVJ0SvY4IipzpQOHQOBy\n" + + "5qh/p6izXJZh3IHtvwVBjHoEVplg1b2+I5e3jDCfqnwcQw82dW5SxOJMg1h/BD0I\n" + + "qAL3go42DYeYhu/WnECMeis=", // - // DSA private key related to cert endEntityCertStrs[2]. + // EC private key related to cert endEntityCertStrs[2]. // - "MIICZAIBADCCAjkGByqGSM44BAEwggIsAoIBAQCWte2WHSAob+cnmLjyt818YFBB\n" + - "hrHVAwM30FMbTK8grXN2jYFi8bDdf0GL6fb/oYeLcJxttFXpghB/UJcdOj8YO+A8\n" + - "EjgPN0nnDtsu3HYJqx6XqfXa8Sm11WWn8AYW00sIVfiAzuxDuvi2kb2bsmv2DqjS\n" + - "BPRDcRVZNDazbAweqXwxF2bAmQCzDdpnJfChp9au73cyUFBFexerixj99851X5kM\n" + - "liR92FtPVlQhVx7w82RxlwztjtkMCFNQeQLF5zhni5yoF8xKwqDSsFG1RT9FtDlX\n" + - "iaOKXGXy//E1RCxhvdALrh9VdxrKuj3cwgz8OFL/7+Zu/+pMF6gUMQCQO44TAiEA\n" + - "jkSBlZh8uZwS0YSD+Lwu77E8W+AkwKT1ZmXi+YEyMLUCggEAdlWS2NtpNviEDOnX\n" + - "kRity5e7TwoRqypxpk27VE4SM2u9EqfQ5kwYi8zBGPiIBvJGLk+Uk1cVo7NHMVwi\n" + - "mRjEFrYqDLYlzwNjNxwNP/BNJgy0ps29EQHdscZw8hrLqqNXlZsezy4zd259xI4Q\n" + - "//o93Scd2VUnDBsqu7FVqaVL6bnRF4vtnrX+hlB463F9u47qO7uM0NXswvx2BtR/\n" + - "oxBahoXUOm+x/iwR2R/S3oDsiGUzK8wGP08CK++7F6zSVkaMZgxKygfvG0Q8m2IT\n" + - "SbMJWZtDeWGFJT5nqYG5el88Ar9MtHfNYd22sqiDy1xFLUQJfRrjNITQJQNWPqkp\n" + - "/cSxWAQiAiAKHYbYwEy0XS9J0MeKQmqPswn0nCJKvH+esfMKkZvV3w==" + "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgGVc7hICpmp91jbYe\n" + + "nrr8nYHD37RZP3VENY+szuA7WjuhRANCAATn0wRE1OVVnV56mzxnc657lmSBB0+0\n" + + "P5YgTq2Pc9sgqnEY8PG980/3n0DJCMQr96FZBWsIyY2gSQjNj4ggGAHT", + + // + // DSA private key related to cert endEntityCertStrs[3]. + // + "MIICZQIBADCCAjoGByqGSM44BAEwggItAoIBAQCaVq+CgmsxyOpZFVwMTZ2ZYA9E\n" + + "SCfNC+d4QN5/rxymsPONLC86zlB4XLHvmJtp2jV7qM7+tbWmsIZYcMPWgD9Ofg+T\n" + + "e+7SdTHO+XWoBNz5olulRTk6nRu+notsKxBCyVX0V5GHsRvts/qClz+QcIHMSALV\n" + + "UIrumtxxdbL63pIw4ds0PeH5RtyR9JpS5pWxUk1MPUPoYSV9GPg2bPUEY99Ji8qi\n" + + "vA1kRTeBfAWC0OgBwbHu1zIKUukMd+pF/D/vKKovJ6I/sPiGXmUw2i4lYOUB0wWn\n" + + "QUyBLez1UMWKchyvpW0FYxMbv7j5zMcAH7d++vCWo3OEGfe4Uet6Q3/Dx83HAiEA\n" + + "mjtJp7XNrsgxbRDqETkHhv6zYH8Voo+gDgSO1m7XcH0CggEBAI5moswp++plZSBP\n" + + "Q9DdCNHt0AV13Toj1jf5M5DNmTX6P6/D/oRfi8Ui1fiCKFv+7lD0J2anCFUaLtu+\n" + + "j7v78gp5OChDp/n49K6DtKtZZRDmw/Bpm6LNdknmdN5kO5wVzbIXHTCCeNs/CJTF\n" + + "mSU5PvEaI4y3M5NraSgLPkq4gEv7/A8orGbKmj1Whj3F9t1Tosxdm/+WkPldMz2t\n" + + "gev+9RM2S6S9XoembRgwRaFVkpQmKoKpOoZcdqV47FLDq5BYH/5POeJ9wLuAHjxQ\n" + + "5CMKo4p/lW7BCd4kuGWFT+OFFXfG2v6EtlqFbXBiFWLxyMsOtkUqWARCqEHhyucl\n" + + "TSYlj60EIgIgLfA75+8KcKxdN8mr6gzGjQe7jPFGG42Ejhd7Q2F4wuw=" }; - // Private key names of endEntityPrivateKeys. - private final static String[] endEntityPrivateKeyNames = { + // Private key algorithm of endEntityPrivateKeys. + private final static String[] endEntityPrivateKeyAlgs = { "EC", "RSA", + "EC", "DSA", }; + // Private key names of endEntityPrivateKeys. + private final static String[] endEntityPrivateKeyNames = { + "ecdsa", + "rsa", + "ec-rsa", + "dsa", + }; + /* * Create an instance of SSLContext with the specified trust/key materials. */ @@ -599,6 +679,7 @@ String[] keyMaterialCerts, String[] keyMaterialKeys, String[] keyMaterialKeyAlgs, + String[] keyMaterialKeyNames, ContextParameters params) throws Exception { KeyStore ts = null; // trust store @@ -665,7 +746,7 @@ Certificate[] chain = new Certificate[] { keyCert }; // import the key entry. - ks.setKeyEntry("cert-" + keyMaterialKeyAlgs[i], + ks.setKeyEntry("cert-" + keyMaterialKeyNames[i], priKey, passphrase, chain); } } diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/CipherSuite.java openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/CipherSuite.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/CipherSuite.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/CipherSuite.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,238 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public enum CipherSuite { + + TLS_AES_256_GCM_SHA384( + 0x1302, Protocol.TLSV1_3, Protocol.TLSV1_3), + TLS_AES_128_GCM_SHA256( + 0x1301, Protocol.TLSV1_3, Protocol.TLSV1_3), + TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256( + 0xCCAA, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256( + 0xCCA9, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256( + 0xCCA8, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384( + 0xC032, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256( + 0xC031, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384( + 0xC030, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256( + 0xC02F, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384( + 0xC02E, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256( + 0xC02D, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384( + 0xC02C, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256( + 0xC02B, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384( + 0xC02A, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256( + 0xC029, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384( + 0xC028, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256( + 0xC027, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384( + 0xC026, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA( + 0xC025, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256( + 0xC025, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384( + 0xC024, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256( + 0xC023, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_anon_WITH_AES_256_CBC_SHA( + 0xC019, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_anon_WITH_AES_128_CBC_SHA( + 0xC018, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_anon_WITH_3DES_EDE_CBC_SHA( + 0xC017, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_anon_WITH_RC4_128_SHA( + 0xC016, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_anon_WITH_NULL_SHA( + 0xC015, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA( + 0xC014, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA( + 0xC013, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA( + 0xC012, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_RC4_128_SHA( + 0xC011, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_RSA_WITH_NULL_SHA( + 0xC010, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_RSA_WITH_AES_256_CBC_SHA( + 0xC00F, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_RSA_WITH_AES_128_CBC_SHA( + 0xC00E, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA( + 0xC00D, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_RSA_WITH_RC4_128_SHA( + 0xC00C, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_RSA_WITH_NULL_SHA( + 0xC00B, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA( + 0xC00A, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA( + 0xC009, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA( + 0xC008, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_RC4_128_SHA( + 0xC007, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDHE_ECDSA_WITH_NULL_SHA( + 0xC006, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA( + 0xC003, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_ECDSA_WITH_RC4_128_SHA( + 0xC002, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_ECDH_ECDSA_WITH_NULL_SHA( + 0xC001, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_EMPTY_RENEGOTIATION_INFO_SCSV( + 0x00FF, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_DH_anon_WITH_AES_256_GCM_SHA384( + 0x00A7, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DH_anon_WITH_AES_128_GCM_SHA256( + 0x00A6, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DHE_DSS_WITH_AES_256_GCM_SHA384( + 0x00A3, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DHE_DSS_WITH_AES_128_GCM_SHA256( + 0x00A2, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DHE_RSA_WITH_AES_256_GCM_SHA384( + 0x009F, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DHE_RSA_WITH_AES_128_GCM_SHA256( + 0x009E, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_RSA_WITH_AES_256_GCM_SHA384( + 0x009D, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_RSA_WITH_AES_128_GCM_SHA256( + 0x009C, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DH_anon_WITH_AES_256_CBC_SHA256( + 0x006D, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DH_anon_WITH_AES_128_CBC_SHA256( + 0x006C, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DHE_RSA_WITH_AES_256_CBC_SHA256( + 0x006B, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DHE_DSS_WITH_AES_256_CBC_SHA256( + 0x006A, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DHE_RSA_WITH_AES_128_CBC_SHA256( + 0x0067, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA( + 0x004C, Protocol.TLSV1, Protocol.TLSV1_2), + TLS_DHE_DSS_WITH_AES_128_CBC_SHA256( + 0x0040, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_RSA_WITH_AES_256_CBC_SHA256( + 0x003D, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_RSA_WITH_AES_128_CBC_SHA256( + 0x003C, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_RSA_WITH_NULL_SHA256( + 0x003B, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_DH_anon_WITH_AES_256_CBC_SHA( + 0x003A, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_DHE_RSA_WITH_AES_256_CBC_SHA( + 0x0039, Protocol.TLSV1, Protocol.TLSV1_2), + TLS_DHE_DSS_WITH_AES_256_CBC_SHA( + 0x0038, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_RSA_WITH_AES_256_CBC_SHA( + 0x0035, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_DH_anon_WITH_AES_128_CBC_SHA( + 0x0034, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_DHE_RSA_WITH_AES_128_CBC_SHA( + 0x0033, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_DHE_DSS_WITH_AES_128_CBC_SHA( + 0x0032, Protocol.TLSV1_2, Protocol.TLSV1_2), + TLS_RSA_WITH_AES_128_CBC_SHA( + 0x002F, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_KRB5_WITH_3DES_EDE_CBC_MD5( + 0x0023, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_KRB5_WITH_DES_CBC_MD5( + 0x0022, Protocol.SSLV3, Protocol.TLSV1_1), + TLS_KRB5_WITH_3DES_EDE_CBC_SHA( + 0x001F, Protocol.SSLV3, Protocol.TLSV1_2), + TLS_KRB5_WITH_DES_CBC_SHA( + 0x001E, Protocol.SSLV3, Protocol.TLSV1_2), + SSL_DH_anon_WITH_3DES_EDE_CBC_SHA( + 0x001B, Protocol.SSLV3, Protocol.TLSV1_2), + SSL_DH_anon_WITH_DES_CBC_SHA( + 0x001A, Protocol.SSLV3, Protocol.TLSV1_1), + SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA( + 0x0019, Protocol.SSLV3, Protocol.TLSV1), + SSL_DH_anon_WITH_RC4_128_MD5( + 0x0018, Protocol.SSLV3, Protocol.TLSV1_2), + SSL_DH_anon_EXPORT_WITH_RC4_40_MD5( + 0x0017, Protocol.SSLV3, Protocol.TLSV1), + SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA( + 0x0016, Protocol.SSLV3, Protocol.TLSV1_2), + SSL_DHE_RSA_WITH_DES_CBC_SHA( + 0x0015, Protocol.SSLV3, Protocol.TLSV1_1), + SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA( + 0x0014, Protocol.SSLV3, Protocol.TLSV1), + SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA( + 0x0013, Protocol.SSLV3, Protocol.TLSV1_2), + SSL_DHE_DSS_WITH_DES_CBC_SHA( + 0x0012, Protocol.SSLV3, Protocol.TLSV1_1), + SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA( + 0x0011, Protocol.SSLV3, Protocol.TLSV1), + SSL_RSA_WITH_3DES_EDE_CBC_SHA( + 0x000A, Protocol.SSLV3, Protocol.TLSV1_2), + SSL_RSA_WITH_DES_CBC_SHA( + 0x0009, Protocol.SSLV3, Protocol.TLSV1_1), + SSL_RSA_EXPORT_WITH_DES40_CBC_SHA( + 0x0008, Protocol.SSLV3, Protocol.TLSV1), + SSL_RSA_WITH_RC4_128_SHA( + 0x0005, Protocol.SSLV3, Protocol.TLSV1_2), + SSL_RSA_WITH_RC4_128_MD5( + 0x0004, Protocol.SSLV3, Protocol.TLSV1_2), + SSL_RSA_EXPORT_WITH_RC4_40_MD5( + 0x0003, Protocol.SSLV3, Protocol.TLSV1), + SSL_RSA_WITH_NULL_SHA( + 0x0002, Protocol.SSLV3, Protocol.TLSV1_2), + SSL_RSA_WITH_NULL_MD5( + 0x0001, Protocol.SSLV3, Protocol.TLSV1_2); + + public final int id; + public final Protocol startProtocol; + public final Protocol endProtocol; + + private CipherSuite( + int id, + Protocol startProtocol, + Protocol endProtocol) { + this.id = id; + this.startProtocol = startProtocol; + this.endProtocol = endProtocol; + } + + public boolean supportedByProtocol(Protocol protocol) { + return startProtocol.id <= protocol.id + && protocol.id <= endProtocol.id; + } + + public static CipherSuite cipherSuite(String name) { + return CipherSuite.valueOf(CipherSuite.class, name); + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/Protocol.java openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/Protocol.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/Protocol.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/Protocol.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,58 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +public enum Protocol { + + SSLV2HELLO(0x0002, "SSLv2Hello"), + SSLV3 (0x0300, "SSLv3"), + TLSV1 (0x0301, "TLSv1"), + TLSV1_1 (0x0302, "TLSv1.1"), + TLSV1_2 (0x0303, "TLSv1.2"), + TLSV1_3 (0x0304, "TLSv1.3"), + + DTLS1_3 (0xFEFC, "DTLSv1.3"), + DTLS1_2 (0xFEFD, "DTLSv1.2"), + DTLS1_0 (0xFEFF, "DTLSv1.0"); + + public final int id; + public final String name; + + private Protocol(int id, String name) { + this.id = id; + this.name = name; + } + + public String toString() { + return name; + } + + public static Protocol protocol(String name) { + for (Protocol protocol : values()) { + if (protocol.name.equals(name)) { + return protocol; + } + } + + return null; + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/SSLEngineTestCase.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,6 +85,12 @@ SSLEngineTestCase.ENABLED_NON_KRB_NOT_ANON_CIPHERS, "Enabled by default non kerberos not anonymous"), /** + * Ciphers supported by TLS 1.3 only. + */ + TLS13_CIPHERS( + SSLEngineTestCase.TLS13_CIPHERS, + "Supported by TLS 1.3 only"), + /** * Ciphers unsupported by the tested SSLEngine. */ UNSUPPORTED_CIPHERS(SSLEngineTestCase.UNSUPPORTED_CIPHERS, @@ -174,6 +180,11 @@ private static final String SERVER_NAME = "service.localhost"; private static final String SNI_PATTERN = ".*"; + private static final String[] TLS13_CIPHERS = { + "TLS_AES_256_GCM_SHA384", + "TLS_AES_128_GCM_SHA256" + }; + private static final String[] SUPPORTED_NON_KRB_CIPHERS; static { @@ -183,8 +194,8 @@ List supportedCiphersList = new LinkedList<>(); for (String cipher : allSupportedCiphers) { if (!cipher.contains("KRB5") - && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { - + && !isTLS13Cipher(cipher) + && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { supportedCiphersList.add(cipher); } } @@ -204,6 +215,7 @@ List supportedCiphersList = new LinkedList<>(); for (String cipher : allSupportedCiphers) { if (!cipher.contains("KRB5") + && !isTLS13Cipher(cipher) && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV") && !cipher.endsWith("_SHA256") && !cipher.endsWith("_SHA384")) { @@ -226,7 +238,8 @@ List supportedCiphersList = new LinkedList<>(); for (String cipher : allSupportedCiphers) { if (cipher.contains("KRB5") - && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { + && !isTLS13Cipher(cipher) + && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { supportedCiphersList.add(cipher); } } @@ -246,7 +259,8 @@ List enabledCiphersList = new LinkedList<>(); for (String cipher : enabledCiphers) { if (!cipher.contains("anon") && !cipher.contains("KRB5") - && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { + && !isTLS13Cipher(cipher) + && !cipher.contains("TLS_EMPTY_RENEGOTIATION_INFO_SCSV")) { enabledCiphersList.add(cipher); } } @@ -303,6 +317,16 @@ this.maxPacketSize = 0; } + private static boolean isTLS13Cipher(String cipher) { + for (String cipherSuite : TLS13_CIPHERS) { + if (cipherSuite.equals(cipher)) { + return true; + } + } + + return false; + } + /** * Wraps data with the specified engine. * @@ -392,7 +416,7 @@ int length = net.remaining(); System.out.println(wrapper + " wrapped " + length + " bytes."); System.out.println(wrapper + " handshake status is " - + engine.getHandshakeStatus()); + + engine.getHandshakeStatus() + " Result is " + r.getStatus()); if (maxPacketSize < length && maxPacketSize != 0) { throw new AssertionError("Handshake wrapped net buffer length " + length + " exceeds maximum packet size " @@ -480,7 +504,7 @@ SSLEngineResult r = engine.unwrap(net, app); app.flip(); System.out.println(unwrapper + " handshake status is " - + engine.getHandshakeStatus()); + + engine.getHandshakeStatus() + " Result is " + r.getStatus()); checkResult(r, wantedStatus); if (result != null && result.length > 0) { result[0] = r; @@ -713,8 +737,13 @@ case "TLSv1.1": runTests(Ciphers.SUPPORTED_NON_KRB_NON_SHA_CIPHERS); break; - default: + case "DTLSv1.1": + case "TLSv1.2": runTests(Ciphers.SUPPORTED_NON_KRB_CIPHERS); + break; + case "TLSv1.3": + runTests(Ciphers.TLS13_CIPHERS); + break; } break; case "krb": diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/TestSessionLocalPrincipal.java openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/TestSessionLocalPrincipal.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/TestSessionLocalPrincipal.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/TestSessionLocalPrincipal.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,344 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.security.KeyFactory; +import java.security.KeyStore; +import java.security.Principal; +import java.security.PrivateKey; +import java.security.Security; +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.security.spec.PKCS8EncodedKeySpec; +import java.util.Base64; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManagerFactory; + +/* + * @test + * @bug 8206355 + * @summary Test principal that was sent to the peer during handshake. + * @run main/othervm TestSessionLocalPrincipal + */ +public class TestSessionLocalPrincipal { + + public static void main(String[] args) throws Exception { + + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + for (String tlsProtocol : new String[]{ + "TLSv1.3", "TLSv1.2", "TLSv1.1", "TLSv1"}) { + for (boolean clientAuth : new boolean[]{true, false}) { + System.out.printf("Protocol %s: Client side auth enabled: %s%n", + tlsProtocol, clientAuth); + CountDownLatch serverReady = new CountDownLatch(1); + Server server = new Server(tlsProtocol, clientAuth, + serverReady); + server.start(); + + // Wait till server is ready to accept connection. + serverReady.await(); + new Client(tlsProtocol, clientAuth, server.port).doClientSide(); + if (server.serverExc != null) { + throw new RuntimeException(server.serverExc); + } + } + } + } + + public static class Server implements Runnable { + + private volatile int port = 0; + private final String tlsProtocol; + private final boolean clientAuth; + private final CountDownLatch latch; + private volatile Exception serverExc; + + public Server(String tlsProtocol, boolean clientAuth, + CountDownLatch latch) { + this.tlsProtocol = tlsProtocol; + this.clientAuth = clientAuth; + this.latch = latch; + } + + public void start() { + + ExecutorService executor = null; + try { + executor = Executors.newCachedThreadPool(new ThreadFactory() { + @Override + public Thread newThread(Runnable r) { + Thread t = Executors.defaultThreadFactory() + .newThread(r); + t.setDaemon(true); + return t; + } + }); + executor.execute(this); + } finally { + if (executor != null) { + executor.shutdown(); + } + } + } + + /* + * Define the server side operation. + */ + void doServerSide() throws Exception { + + SSLContext ctx = getSSLContext(tlsProtocol); + SSLServerSocketFactory sslssf = ctx.getServerSocketFactory(); + SSLServerSocket sslServerSocket + = (SSLServerSocket) sslssf.createServerSocket(port); + port = sslServerSocket.getLocalPort(); + System.out.println("Server listining on port: " + port); + sslServerSocket.setEnabledProtocols(new String[]{tlsProtocol}); + /* + * Signal Client, the server is ready to accept client request. + */ + latch.countDown(); + try (SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept()) { + sslSocket.setNeedClientAuth(this.clientAuth); + sslSocket.setSoTimeout(5000); + try (InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream();) { + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + } + } finally { + sslServerSocket.close(); + } + } + + @Override + public void run() { + try { + doServerSide(); + } catch (Exception e) { + // Print the exception for debug purpose. + e.printStackTrace(System.out); + serverExc = e; + } + } + } + + /* + * Define the client side of the test. + */ + public static class Client { + + private final int serverPort; + private final String tlsProtocol; + private final boolean clientAuth; + + public Client(String tlsProtocol, boolean clientAuth, int serverPort) { + this.tlsProtocol = tlsProtocol; + this.clientAuth = clientAuth; + this.serverPort = serverPort; + } + + void doClientSide() throws Exception { + + SSLContext ctx = getSSLContext(this.tlsProtocol); + SSLSocketFactory sslsf = ctx.getSocketFactory(); + try (SSLSocket sslSocket + = (SSLSocket) sslsf.createSocket("localhost", serverPort)) { + sslSocket.setEnabledProtocols(new String[]{this.tlsProtocol}); + Principal principal = sslSocket.getSession().getLocalPrincipal(); + if (this.clientAuth && principal == null) { + throw new RuntimeException("Principal can not be null"); + } + if (!this.clientAuth && principal != null) { + throw new RuntimeException("Principal should be null"); + } + try (InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream()) { + sslOS.write(86); + sslOS.flush(); + sslIS.read(); + } + } + } + } + + // get the ssl context + protected static SSLContext getSSLContext(String tlsProtocol) + throws Exception { + + // Generate certificate from cert string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + // Create a key store + KeyStore ts = KeyStore.getInstance("PKCS12"); + KeyStore ks = KeyStore.getInstance("PKCS12"); + ts.load(null, null); + ks.load(null, null); + char passphrase[] = "passphrase".toCharArray(); + + // Import the trusted cert + ts.setCertificateEntry("trusted-cert-" + + KeyType.rsa_pkcs1_sha256.getKeyType(), + cf.generateCertificate(new ByteArrayInputStream( + KeyType.rsa_pkcs1_sha256.getTrustedCert().getBytes()))); + + boolean hasKeyMaterials = KeyType.rsa_pkcs1_sha256.getEndCert() != null + && KeyType.rsa_pkcs1_sha256.getPrivateKey() != null; + if (hasKeyMaterials) { + + // Generate the private key. + PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( + Base64.getMimeDecoder().decode( + KeyType.rsa_pkcs1_sha256.getPrivateKey())); + KeyFactory kf = KeyFactory.getInstance( + KeyType.rsa_pkcs1_sha256.getKeyType()); + PrivateKey priKey = kf.generatePrivate(priKeySpec); + + // Generate certificate chain + Certificate keyCert = cf.generateCertificate( + new ByteArrayInputStream( + KeyType.rsa_pkcs1_sha256.getEndCert().getBytes())); + Certificate[] chain = new Certificate[]{keyCert}; + + // Import the key entry. + ks.setKeyEntry("cert-" + KeyType.rsa_pkcs1_sha256.getKeyType(), + priKey, passphrase, chain); + } + + // Create SSL context + TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); + tmf.init(ts); + + SSLContext context = SSLContext.getInstance(tlsProtocol); + if (hasKeyMaterials) { + KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509"); + kmf.init(ks, passphrase); + context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + } else { + context.init(null, tmf.getTrustManagers(), null); + } + return context; + } +} + +enum KeyType { + + rsa_pkcs1_sha256( + "RSA", + /** + * Signature Algorithm: sha256WithRSAEncryption + * Issuer: CN = localhost + * Validity Not Before: Jun 4 15:22:04 2018 GMT + * Not After: May 30 15:22:04 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsaEncryption + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDBjCCAe6gAwIBAgIUc8yTYekR2LuXkkCJYqWlS/pBMKIwDQYJKoZIhvcNAQEL\n" + + "BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTE4MDYwNDE1MjIwNFoXDTM4MDUz\n" + + "MDE1MjIwNFowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF\n" + + "AAOCAQ8AMIIBCgKCAQEA2jDPGMogc9dq2w5b+FHqbfaGPokRmyObiU8y/l/dqkM5\n" + + "9IV+qj8VQUI4NtpdCTWr16812z4AjXrk5HIBrECfQbHPUcm1rme5YVZ0WxV0+Ufy\n" + + "hDmrGwDLhkxGqc3hOhRrlF2wdXeUfjIzhvS9+S/401++t/jvq+cqFF1BHnzYOu+l\n" + + "nbi/o95Oqo8MlwiRqg3xy3fNRfqXk7DWy+QT8s+Vc3Pcj1EW6K0iJJ23BVTdv6YT\n" + + "Ja5IKiWL4XsLht3fWvZwF+PoYfKb+JYflt0rafpxg9xkowe7GnGh2SpV7bJaH/QN\n" + + "3PTFEKQWgWHjWwjR171GOzSaEgaklvKde6+zNWeYKwIDAQABo1AwTjAdBgNVHQ4E\n" + + "FgQUqCtGe8/Ky4O6pH7xeTUy9yrv4n0wHwYDVR0jBBgwFoAUqCtGe8/Ky4O6pH7x\n" + + "eTUy9yrv4n0wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAuqch30im\n" + + "M09sARarbfK3OExqYK2xoyuUscgTqQNDpNL2gMdXY9e0lTmGVgw9pVYtNZPZRxem\n" + + "jR5an2XegvG9qVU6vLENDwLCqZgsTb2gvmXngiG8NVcYd81GNqD228mkgBosNJku\n" + + "6BR+C8zlURzsNEt657eVvIp9ObGomdAbWhpdqihBD180PP18DIBWopyfHfJtT5FA\n" + + "U2kSPBp+P1EtdceW0zfwv3rF8hwRbnQBzuoYrZfn2PiMYaGUqOgbqUltCMD/Dp9G\n" + + "xK0nfAXEwIqHWWnijGwAd6YrszMjBUcSGmlehdF+XZK6jHNlw64RB4WTfavr+rY0\n" + + "dTe6g4o5GYr9nQ==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDaMM8YyiBz12rb\n" + + "Dlv4Uept9oY+iRGbI5uJTzL+X92qQzn0hX6qPxVBQjg22l0JNavXrzXbPgCNeuTk\n" + + "cgGsQJ9Bsc9RybWuZ7lhVnRbFXT5R/KEOasbAMuGTEapzeE6FGuUXbB1d5R+MjOG\n" + + "9L35L/jTX763+O+r5yoUXUEefNg676WduL+j3k6qjwyXCJGqDfHLd81F+peTsNbL\n" + + "5BPyz5Vzc9yPURborSIknbcFVN2/phMlrkgqJYvhewuG3d9a9nAX4+hh8pv4lh+W\n" + + "3Stp+nGD3GSjB7sacaHZKlXtslof9A3c9MUQpBaBYeNbCNHXvUY7NJoSBqSW8p17\n" + + "r7M1Z5grAgMBAAECggEAHs/7vw10TcejEHJTrJqs14CT7qresKDzqw1jLycMn6nE\n" + + "unJLs/EaqE+Yrq5hqxZIQTo+CcsUuuYbAuPStqedleJtW6h3nryJImTaI67BCR8O\n" + + "8XtPXY3cMAf/hqVLZC9UDey5Ka2Ma9HdEvbnCRSsN/VycnqWJhmMCLouowaQZqoE\n" + + "VopscUix8GqELv0vEo2CszZfUjtSVbNTlNgwDf5U7eSKXMuFsnSn/LE7AMvHsEyo\n" + + "HatxogwlM/WjpTnf/WIeJY3VhaK10IsP6OEgUn/p4VtI2DQ/TJdgYrvD5vhjY8ip\n" + + "XuUPuPILRvJWo8dRXJqa4diXB12q5YhP8iiOp4BgkQKBgQD1GtlOR+JVgOzpQ11h\n" + + "s5/iJOsczee80pQscbSRJnzSsIaP9WM8CyJgvbPxIQxLUQeYnxM/bxNKkpJtzxRK\n" + + "pob+v4NoRn8PTpqbOp1obmWJT7uHTaoeavQo7r7uZI4i3eEgHCCQkMzpqzz7UFTY\n" + + "2Yst7bBTPUivlSVQQBEc8bLpeQKBgQDj47EjpAlh8DmJRTElg58t+XJehXGTqmlx\n" + + "nYu8DQLSzGbOQ/Z4srakC1mkM0LHCmULIIWk3KhV1GBCeArv7DlZ9A1SkI95bsq9\n" + + "GBeQpovL0PXKkOOWMJBklP/CTECO4eyA8r6c1d8wytBb6MrJ8bi74DdT+JlFjK5A\n" + + "zNoeNx6JwwKBgQCehIPABeuSYvRVlDTDqFkh98B6+4wBaatc5xjhuyOFW5dbaVeJ\n" + + "kKXmLSpAK6B44WnpQhA/uUWfuBWtoPy9nt+1yARjnxwzuSFyfUEqNiPC32coBYmd\n" + + "bIyGIIopQa1PTXJ4wtgoxw1PnmitHHITYPaLeKrN2te0fuAH+7dVodeU+QKBgAct\n" + + "VJbaw7Dh7+3yz+lui8TW5lMzwK/13fxGCfCSOFSLO3Gjkk+a0UW5VclmE+RQ333K\n" + + "OGtIx8RsO9vcC/wiZGwA06qWAu7AHoJ2D8fudtikbBlFFuXUAbgpOSTVYfMeCmTF\n" + + "QFuQIMdYm9dJLZnOkxLXrOZoHeui0poX2Ya6FawhAoGAAI/QCyDbuvnJzGmjSbvl\n" + + "5Ndr9lNAansCXaUzXuVLp6dD6PnB8HVCE8tdETZrcXseyTBeltaxAhj+tCybJvDO\n" + + "sV8UmPR0w9ibExmUIVGX5BpoRlB/KWxEG3ar/wJbUZVZ2oSdIAZvCvdbN956SLDg\n" + + "Pg5M5wrRqs71s2EiIJd0HrU=" + ); + private final String keyType; + private final String trustedCert; + private final String endCert; + private final String privateKey; + + private KeyType(String keyType, String selfCert, String privateKey) { + this.keyType = keyType; + this.trustedCert = selfCert; + this.endCert = selfCert; + this.privateKey = privateKey; + } + + public String getKeyType() { + return keyType; + } + + public String getTrustedCert() { + return trustedCert; + } + + public String getEndCert() { + return endCert; + } + + public String getPrivateKey() { + return privateKey; + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/TLSTest.java openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/TLSTest.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/TLSCommon/TLSTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/TLSCommon/TLSTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,1246 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.io.ByteArrayInputStream; +import java.io.InputStream; +import java.io.OutputStream; +import java.security.KeyFactory; +import java.security.KeyStore; +import java.security.PrivateKey; +import java.security.Security; +import java.security.cert.Certificate; +import java.security.cert.CertificateFactory; +import java.security.spec.PKCS8EncodedKeySpec; +import java.util.Base64; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.ThreadFactory; +import java.util.concurrent.TimeUnit; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.SSLSocketFactory; +import javax.net.ssl.TrustManagerFactory; + +/* + * @test + * @bug 8205111 + * @summary Test TLS with different types of supported keys. + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 ecdsa_secp384r1_sha384 + * TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 ecdsa_secp521r1_sha512 + * TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_128_GCM_SHA256 + * + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha1 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha384 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 rsa_pkcs1_sha512 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 ec_rsa_pkcs1_sha256 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 ecdsa_sha1 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 ecdsa_secp384r1_sha384 + * TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 ecdsa_secp521r1_sha512 + * TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha256 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha384 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_rsae_sha512 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha256 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha384 TLS_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.3 rsa_pss_pss_sha512 TLS_AES_256_GCM_SHA384 + * + * @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA + * @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha256 + * TLS_RSA_WITH_AES_128_CBC_SHA + * @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha384 + * TLS_RSA_WITH_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.2 rsa_pkcs1_sha512 + * TLS_RSA_WITH_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.2 ec_rsa_pkcs1_sha256 + * TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 + * @run main/othervm TLSTest TLSv1.2 ecdsa_sha1 + * TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.2 ecdsa_secp384r1_sha384 + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384 + * @run main/othervm TLSTest TLSv1.2 ecdsa_secp521r1_sha512 + * TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA + * @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha256 + * TLS_RSA_WITH_AES_256_CBC_SHA256 + * @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha384 + * TLS_RSA_WITH_AES_256_CBC_SHA + * @run main/othervm TLSTest TLSv1.2 rsa_pss_rsae_sha512 + * TLS_RSA_WITH_AES_128_CBC_SHA256 + * @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha256 + * TLS_DHE_RSA_WITH_AES_256_CBC_SHA256 + * @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha384 + * TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 + * @run main/othervm TLSTest TLSv1.2 rsa_pss_pss_sha512 + * TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 + * + * @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA + * @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha256 + * TLS_RSA_WITH_AES_256_CBC_SHA + * @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha384 + * TLS_RSA_WITH_AES_128_CBC_SHA + * @run main/othervm TLSTest TLSv1.1 rsa_pkcs1_sha512 + * TLS_RSA_WITH_AES_256_CBC_SHA + * @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha256 + * TLS_RSA_WITH_AES_128_CBC_SHA + * @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha384 + * TLS_RSA_WITH_AES_256_CBC_SHA + * @run main/othervm TLSTest TLSv1.1 rsa_pss_rsae_sha512 + * TLS_RSA_WITH_AES_128_CBC_SHA + * + * @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha1 TLS_RSA_WITH_AES_128_CBC_SHA + * @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha256 TLS_RSA_WITH_AES_256_CBC_SHA + * @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha384 TLS_RSA_WITH_AES_128_CBC_SHA + * @run main/othervm TLSTest TLSv1 rsa_pkcs1_sha512 TLS_RSA_WITH_AES_256_CBC_SHA + * @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha256 + * TLS_RSA_WITH_AES_128_CBC_SHA + * @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha384 + * TLS_RSA_WITH_AES_256_CBC_SHA + * @run main/othervm TLSTest TLSv1 rsa_pss_rsae_sha512 + * TLS_RSA_WITH_AES_128_CBC_SHA + */ +public class TLSTest { + + private volatile static boolean clientRenegoReady = false; + + public static void main(String[] args) throws Exception { + + final String tlsProtocol = args[0]; + final KeyType keyType = KeyType.valueOf(args[1]); + final String cipher = args[2]; + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + CountDownLatch serverReady = new CountDownLatch(1); + Server server = new Server(tlsProtocol, keyType, cipher, serverReady); + server.start(); + + // Wait till server is ready to accept connection. + serverReady.await(); + new Client(tlsProtocol, keyType, cipher, server.port).doClientSide(); + if (server.serverExc != null) { + throw new RuntimeException(server.serverExc); + } + } + + public static class Server implements Runnable { + + private volatile int port = 0; + private final String tlsProtocol; + private final KeyType keyType; + private final String cipher; + private final CountDownLatch latch; + private volatile Exception serverExc; + + public Server(String tlsProtocol, KeyType keyType, String cipher, + CountDownLatch latch) { + this.tlsProtocol = tlsProtocol; + this.keyType = keyType; + this.cipher = cipher; + this.latch = latch; + } + + public void start() { + + ExecutorService executor = null; + try { + executor = Executors.newCachedThreadPool(new ThreadFactory() { + @Override + public Thread newThread(Runnable r) { + Thread t = Executors.defaultThreadFactory() + .newThread(r); + t.setDaemon(true); + return t; + } + }); + executor.execute(this); + } finally { + if (executor != null) { + executor.shutdown(); + } + } + } + + /* + * Define the server side operation. + */ + void doServerSide() throws Exception { + + SSLContext ctx = getSSLContext(tlsProtocol, + keyType.getTrustedCert(), keyType.getEndCert(), + keyType.getPrivateKey(), keyType.getKeyType()); + SSLServerSocketFactory sslssf = ctx.getServerSocketFactory(); + SSLServerSocket sslServerSocket + = (SSLServerSocket) sslssf.createServerSocket(port); + port = sslServerSocket.getLocalPort(); + System.out.println("Server listining on port: " + port); + // specify the enabled server cipher suites + sslServerSocket.setEnabledCipherSuites(new String[]{this.cipher}); + sslServerSocket.setEnabledProtocols(new String[]{tlsProtocol}); + /* + * Signal Client, the server is ready to accept client request. + */ + latch.countDown(); + try (SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept()) { + sslSocket.setNeedClientAuth(false); + sslSocket.setSoTimeout(5000); + try (InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream();) { + sslIS.read(); + sslOS.write(85); + sslOS.flush(); + while (!clientRenegoReady) { + System.out.println("Waiting for ClientHello"); + TimeUnit.MILLISECONDS.sleep(50); + } + for (int i = 0; i < 4; i++) { + sslIS.read(); + sslOS.write(89); + sslOS.flush(); + TimeUnit.MILLISECONDS.sleep(50); // wait for a while + } + } + } finally { + sslServerSocket.close(); + } + } + + @Override + public void run() { + try { + doServerSide(); + } catch (Exception e) { + // Print the exception for debug purpose. + e.printStackTrace(System.out); + serverExc = e; + } + } + } + + /* + * Define the client side of the test. + */ + public static class Client { + + private final int serverPort; + private final String tlsProtocol; + private final KeyType keyType; + private final String cipher; + + public Client(String tlsProtocol, KeyType keyType, String cipher, + int serverPort) { + this.tlsProtocol = tlsProtocol; + this.keyType = keyType; + this.cipher = cipher; + this.serverPort = serverPort; + } + + void doClientSide() throws Exception { + + SSLContext ctx = getSSLContext(this.tlsProtocol, + keyType.getTrustedCert(), null, null, keyType.getKeyType()); + SSLSocketFactory sslsf = ctx.getSocketFactory(); + try (SSLSocket sslSocket + = (SSLSocket) sslsf.createSocket("localhost", serverPort)) { + // Specify the client cipher suites + sslSocket.setEnabledCipherSuites(new String[]{this.cipher}); + sslSocket.setEnabledProtocols(new String[]{this.tlsProtocol}); + InputStream sslIS = sslSocket.getInputStream(); + OutputStream sslOS = sslSocket.getOutputStream(); + try { + sslOS.write(86); + sslOS.flush(); + sslIS.read(); + // Re-handshake for key-update and session resumption. + sslSocket.startHandshake(); + System.out.println("Client: Re-Handshake completed."); + } finally { + clientRenegoReady = true; + } + try { + for (int i = 0; i < 4; i++) { + sslOS.write(88); + sslOS.flush(); + sslIS.read(); + TimeUnit.MILLISECONDS.sleep(50); // wait for a while + } + } finally { + sslIS.close(); + sslOS.close(); + } + } + } + } + + // get the ssl context + protected static SSLContext getSSLContext(String tlsProtocol, + String trustedCertStr, String keyCertStr, + String privateKey, String keyType) throws Exception { + + // Generate certificate from cert string + CertificateFactory cf = CertificateFactory.getInstance("X.509"); + + // Create a key store + KeyStore ts = KeyStore.getInstance("PKCS12"); + KeyStore ks = KeyStore.getInstance("PKCS12"); + ts.load(null, null); + ks.load(null, null); + char passphrase[] = "passphrase".toCharArray(); + + // Import the trusted cert + ts.setCertificateEntry("trusted-cert-" + keyType, + cf.generateCertificate(new ByteArrayInputStream( + trustedCertStr.getBytes()))); + + boolean hasKeyMaterials = keyCertStr != null && privateKey != null; + if (hasKeyMaterials) { + + // Generate the private key. + PKCS8EncodedKeySpec priKeySpec = new PKCS8EncodedKeySpec( + Base64.getMimeDecoder().decode(privateKey)); + KeyFactory kf = KeyFactory.getInstance(keyType); + PrivateKey priKey = kf.generatePrivate(priKeySpec); + + // Generate certificate chain + Certificate keyCert = cf.generateCertificate( + new ByteArrayInputStream(keyCertStr.getBytes())); + Certificate[] chain = new Certificate[]{keyCert}; + + // Import the key entry. + ks.setKeyEntry("cert-" + keyType, priKey, passphrase, chain); + } + + // Create SSL context + TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); + tmf.init(ts); + + SSLContext context = SSLContext.getInstance(tlsProtocol); + if (hasKeyMaterials) { + KeyManagerFactory kmf = KeyManagerFactory.getInstance("NewSunX509"); + kmf.init(ks, passphrase); + context.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + } else { + context.init(null, tmf.getTrustManagers(), null); + } + return context; + } + + enum KeyType { + + ec_rsa_pkcs1_sha256( + "EC", + /** + * Signature Algorithm: sha256WithRSAEncryption + * Issuer: CN = root + * Validity Not Before: Jun 5 07:20:59 2018 GMT + * Not After : May 31 07:20:59 2038 GMT + * Subject: CN = root + * Public Key Algorithm: rsaEncryption + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIC/DCCAeSgAwIBAgIUDJ+blgr9+e9ezH0Cj/NZ1Skd8GQwDQYJKoZIhvcNAQEL\n" + + "BQAwDzENMAsGA1UEAwwEcm9vdDAeFw0xODA2MDUwNzIwNTlaFw0zODA1MzEwNzIw\n" + + "NTlaMA8xDTALBgNVBAMMBHJvb3QwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK\n" + + "AoIBAQDV48Mrbx+kWa1h/M2+Unr4AZM2raONrmwixJmosoiy+wOfjGfcwZyEyvNm\n" + + "FzVor3klBJLAam/4ndgyytFmCvaUT9oLm9N99dViSL2Tn388bWFFmMngsmGlFLMD\n" + + "fTsuBvxsYedyFUAgnpqLQCBiGrX930LF4bexegiBUftEK6lTbuq98vKW6bHT+B+o\n" + + "jkd23zYC7yBo9hgSuoDpI4s8lGh6vwAiijybaVve8t/idWHXWqk9mLJ//j5rj39F\n" + + "PYjDg7LF8xFV7nP7q/6KK0XBQdUMpmrShC/hE4BoUPks0dOEjAh+nN4O1J/4xlYX\n" + + "O5oaPVtvi3LJdjQvTQA7mEyM02ClAgMBAAGjUDBOMB0GA1UdDgQWBBTwyBBY7sOc\n" + + "sEdvYf7oRvf7MIIsjTAfBgNVHSMEGDAWgBTwyBBY7sOcsEdvYf7oRvf7MIIsjTAM\n" + + "BgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQC6CnR4XWQ4uO2H5Ngt+4Yk\n" + + "V82+oBlxa9SMK/tt67YC7wsxALsYqQ8oj3sGhH6mlNv2gDQ/OOC/HcdI/N72s+/n\n" + + "HnWq7vInx2M5P0QCRXjTUxx4+OPdH11zbsK5ZkE0SCOwlzlkcqU1fkwbr+vovgcP\n" + + "HgYL+3eGlNcz6+XwtVfySDbRkLYGbLlG1dH5WqR9+Z7glRgl6D+ZdOxEAwhbCAu1\n" + + "ADGGckA4107gVrR2r8YvzS/cO9Q97XWEXlfeHs5t7TQSJdNg6Gep1jLpFEQ98h/c\n" + + "y4VBmOqhZ4vJ+/k16IW83XV8NcroIrqyfVJFRxVTCpitj4kDecqd9XHRE2/Xf5bb\n" + + "-----END CERTIFICATE-----\n", + /** + * Signature Algorithm: sha256WithRSAEncryption + * Issuer: CN = root + * Validity Not Before: Jun 5 07:20:59 2018 GMT + * Not After : May 31 07:20:59 2038 GMT + * Subject: CN = localhost + * ASN1 OID: prime256v1 + * Public Key Algorithm: id-ecPublicKey + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIICwzCCAaugAwIBAgIUHY0HRPAMz4oLuNzl/b39FHi6AgwwDQYJKoZIhvcNAQEL\n" + + "BQAwDzENMAsGA1UEAwwEcm9vdDAeFw0xODA2MDUwNzIwNTlaFw0zODA1MzEwNzIw\n" + + "NTlaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDBZMBMGByqGSM49AgEGCCqGSM49AwEH\n" + + "A0IABF1zheAdyEUerLNUqXHw2WmXnMVJnKSMTeq+bk9WsZGBOZzJcEtyr1887JAR\n" + + "urn0uJ7J3YLUNlMuHaSWZ8hExGujgdwwgdkwCQYDVR0TBAIwADALBgNVHQ8EBAMC\n" + + "A/gwEwYDVR0lBAwwCgYIKwYBBQUHAwEwHQYDVR0OBBYEFMzV+8JMWSrdIJ+iZE9K\n" + + "4zn+roK6MEoGA1UdIwRDMEGAFPDIEFjuw5ywR29h/uhG9/swgiyNoROkETAPMQ0w\n" + + "CwYDVQQDDARyb290ghQMn5uWCv35717MfQKP81nVKR3wZDARBglghkgBhvhCAQEE\n" + + "BAMCBkAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJhdGVkIENlcnRpZmlj\n" + + "YXRlMA0GCSqGSIb3DQEBCwUAA4IBAQCvyScCVQVTG3d3yLcLT/q6G1I8N/4JrvzZ\n" + + "126BHoh8Oej4pbqn05SPdT4VH+J4UbTA8uHH9CLrAQv3WAU+P+tjXf61IRYNCm73\n" + + "A6K7ZvkpZpnvyT3ynMpG509OZbKxQrJWvyN22MTApi7Y8+s3+UAwUG4SZwlEHLn+\n" + + "sGASjfYouH4BRbymeNmuoHXWHO/P8O52cylElyUEHcwJx17IqJRNcwMb2aexPe+h\n" + + "P3HcVS6fxFW1I02cq62KEfexRTvVNijXU8vaYDC0aP0M+fMN/xc/HPJiUyRNCKOC\n" + + "Q8B6w2/GDQQeVbxoO0CLuHuOodA+oJIw4bX0y4XvTs76HK1R/nue\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgVHQp1EG3PgASz7Nu\n" + + "uv9dvFLxsr3qfgC6CgZU4xorLbChRANCAARdc4XgHchFHqyzVKlx8Nlpl5zFSZyk\n" + + "jE3qvm5PVrGRgTmcyXBLcq9fPOyQEbq59Lieyd2C1DZTLh2klmfIRMRr" + ), + ecdsa_sha1( + "EC", + /** + * Signature Algorithm: ecdsa-with-SHA1 + * Issuer: CN = localhost + * Validity Not Before: Jun 4 15:20:45 2018 GMT + * Not After : May 30 15:20:45 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: id-ecPublicKey + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIBdzCCAR+gAwIBAgIUO79CpzonO37fqCHN1VHS+aa5t5owCQYHKoZIzj0EATAU\n" + + "MRIwEAYDVQQDDAlsb2NhbGhvc3QwHhcNMTgwNjA0MTUyMDQ1WhcNMzgwNTMwMTUy\n" + + "MDQ1WjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwWTATBgcqhkjOPQIBBggqhkjOPQMB\n" + + "BwNCAAR6LMO6lBGdmpo87XTjtA2vsXvq1kd8ktaIGEdCrA8BKk0A30LW8SY5Be29\n" + + "ScYu8d+IjQ3X/fpblrVh/64pOgQzo1AwTjAdBgNVHQ4EFgQU3RhUvLzu/b6sNegl\n" + + "/5TPncFFh4MwHwYDVR0jBBgwFoAU3RhUvLzu/b6sNegl/5TPncFFh4MwDAYDVR0T\n" + + "BAUwAwEB/zAJBgcqhkjOPQQBA0cAMEQCIEle4IWFybL1xKVmFCNnR8bK1l5LzqAj\n" + + "YBdXK+LBJDliAiBFKkkOaZsXZir09t1tgPNneIgYMeXCQAJ1mQ7rQRiKPg==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgyJJNI8eqYVKcCshG\n" + + "t89mrRZ1jMeD8fAbgijAG7WfgtGhRANCAAR6LMO6lBGdmpo87XTjtA2vsXvq1kd8\n" + + "ktaIGEdCrA8BKk0A30LW8SY5Be29ScYu8d+IjQ3X/fpblrVh/64pOgQz" + ), + rsa_pss_pss_sha256( + "RSASSA-PSS", + /** + * Signature Algorithm: rsassaPss + * Issuer: CN = localhost + * Validity Not Before: Jun 6 07:11:00 2018 GMT + * Not After : Jun 1 07:11:00 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsassaPss + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDZjCCAh2gAwIBAgIUHxwPs3eAgJ057nJwiLgWZWeNqdgwPgYJKoZIhvcNAQEK\n" + + "MDGgDTALBglghkgBZQMEAgGhGjAYBgkqhkiG9w0BAQgwCwYJYIZIAWUDBAIBogQC\n" + + "AgDeMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xODA2MDYwNzExMDBaFw0zODA2\n" + + "MDEwNzExMDBaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASAwCwYJKoZIhvcNAQEK\n" + + "A4IBDwAwggEKAoIBAQCl8r4Qrg27BYUO/1Va2Ix8QPGzN/lvzmKvP5Ff26ovNW4v\n" + + "RUx68HzAhhiWtcl+PwLSbJqJreEkTlle7PnRAypby3fO7ZAK0Y3YiHquaBg7d+7Y\n" + + "FhhHwv8gG0lZcyA0BkXFJHqdq76qar0xHC6DVezXm0K3mcceymGtFR9BzWmAj+7D\n" + + "YsSwvtTQ7WNoQmf0cdDMSM71IwaTwIwvT2wzX1vv5hcdDyXdr64WFqWSA9sNJ2K6\n" + + "arxaaU1klwKSgDokF6njafWQ4UxdR67d5W1MYoiioDs2Yy3utsMpO2OUzZVBZNdT\n" + + "gkr1jsJhIurpz/5K51lwJIRQBezEFSb+60AFVoMJAgMBAAGjUDBOMB0GA1UdDgQW\n" + + "BBQfFit5ilWJmZgCX4QY0HsaI9iIDDAfBgNVHSMEGDAWgBQfFit5ilWJmZgCX4QY\n" + + "0HsaI9iIDDAMBgNVHRMEBTADAQH/MD4GCSqGSIb3DQEBCjAxoA0wCwYJYIZIAWUD\n" + + "BAIBoRowGAYJKoZIhvcNAQEIMAsGCWCGSAFlAwQCAaIEAgIA3gOCAQEAa4yUQ3gh\n" + + "d1YWPdEa1sv2hdkhtenw6m5yxbmaQl2+nIKSpk4RfpXC7K1EYwBF8TdfFbD8hGGh\n" + + "5n81BT0/dn1R9SRGCv7KTxx4lfQt31frlsw/tVciwyXQtcUZ6DqfnLP0/aRVLNgx\n" + + "zaP542JUHFYLTC3EGz2zUgv70ZUTlIsPG3/p8YO1iXdnYGQyzOuQPUBpI7nS7UtR\n" + + "Ug8VE9ACpBxxI3qChMahFZGHlXCCSjSmxpQa6UO4SQl8q5tPNnqdzWwvAW8qkCy4\n" + + "6barRQ4sMcGayhHh/uSTx7bcl0FMJpcI1ygbw7/Pc03zKtw0gMTBMns7q4yXjb/u\n" + + "ef47nW0t+LRAAg==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEuwIBADALBgkqhkiG9w0BAQoEggSnMIIEowIBAAKCAQEApfK+EK4NuwWFDv9V\n" + + "WtiMfEDxszf5b85irz+RX9uqLzVuL0VMevB8wIYYlrXJfj8C0myaia3hJE5ZXuz5\n" + + "0QMqW8t3zu2QCtGN2Ih6rmgYO3fu2BYYR8L/IBtJWXMgNAZFxSR6nau+qmq9MRwu\n" + + "g1Xs15tCt5nHHsphrRUfQc1pgI/uw2LEsL7U0O1jaEJn9HHQzEjO9SMGk8CML09s\n" + + "M19b7+YXHQ8l3a+uFhalkgPbDSdiumq8WmlNZJcCkoA6JBep42n1kOFMXUeu3eVt\n" + + "TGKIoqA7NmMt7rbDKTtjlM2VQWTXU4JK9Y7CYSLq6c/+SudZcCSEUAXsxBUm/utA\n" + + "BVaDCQIDAQABAoIBAAc4vRS0vlw5LUUtz2UYr2Ro3xvRf8Vh0eGWfpkRUiKjzJu6\n" + + "BE4FUSh/rWpBlvcrfs/xcfgz3OxbjIAZB/YUkS9Vd21F4VLXM7kMl2onlYZg/b/h\n" + + "lkTpM3kONu7xl6Er9LVTlRJveuinpHwSoeONRbVMSGb9BjFM1VtW4/lVGxZBG05D\n" + + "y9i/o4vCZqULn9cAumOwicKuCyTcS58XcMJ+puSPfRA71PYLxqFkASAoJsUwCXpo\n" + + "gs39lLsIFgrfO8mBO1ux/SE+QaRc+9XqFSHHKD1XqF/9zSYBgWjE910EcpdYEdZx\n" + + "GEkwea7Fn4brO5OpIrHY/45naqbUOBzv6gufMAECgYEAz7PHCdcrQvmOb8EiNbQH\n" + + "uvSimwObWJFeN1ykp6mfRbSnkXw7p8+M4Tc8HFi8QLpoq63Ev2AwoaQCQvHbFC2Y\n" + + "1Cz0EkC0aOp+tZP7U2AUBdkcDesZAJQTad0zV6KesyIUXdxZXDG8JJ1XSNWfTJV4\n" + + "QD+BjLZ0jiAyCIfVYvWQqYkCgYEAzIln1nKTixLMPr5CldSmR7ZarEtPJU+hHwVg\n" + + "dV/Lc6d2Yy9JgunOXRo4BXB1TEo8JFbK3HBQH6tS8li4qDr7WK5wyYfh8qb4WZyu\n" + + "lc562f2WVYntcN8/Ojb+Vyrt7lk9sq/8KoVHxEAWd6mqL9VTPYuAu1Vw9fTGIZfB\n" + + "lDeELYECgYAvdzU4UXzofGGJtohb332YwwlaBZP9xJLUcg6K5l+orWVSASMc8XiP\n" + + "i3DoRXsYC8GZ4kdBOPlEJ1gA9oaLcPQpIPDSLwlLpLM6Scw4vI822uvnXl/DWxOo\n" + + "sM1n7Jj59QLUhGPDhvYpI+/rjC4wcUQe4qR3hMbUKBVnD6u7RsU9iQKBgQCQ17VK\n" + + "7bSCRfuRaxaoGADww7gOTv5rQ6qr1xjpxb7D1hFGR9Rc+smCsPB/GZZXQjK44SWj\n" + + "WX3ED4Ubzaxmpe4cbNu+O5XMSmWQwB36RFBHUwdE5/nXdqDFzu/qNqJrqZLBmVKP\n" + + "ofaiiWffsaytVvotmT6+atElvAMbAua42V+nAQKBgHtIn3mYMHLriYGhQzpkFEA2\n" + + "8YcAMlKppueOMAKVy8nLu2r3MidmLAhMiKJQKG45I3Yg0/t/25tXLiOPJlwrOebh\n" + + "xQqUBI/JUOIpGAEnr48jhOXnCS+i+z294G5U/RgjXrlR4bCPvrtCmwzWwe0h79w2\n" + + "Q2hO5ZTW6UD9CVA85whf" + ), + rsa_pss_rsae_sha256( + "RSA", + /** + * Signature Algorithm: rsassaPss + * Issuer: CN = root + * Validity Not Before: Jun 6 07:11:39 2018 GMT + * Not After : Jun 1 07:11:39 2038 GMT + * Subject: CN = root + * Public Key Algorithm: rsassaPss + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDXDCCAhOgAwIBAgIUM883yXaRA3QIV+WMuFpPscABr3IwPgYJKoZIhvcNAQEK\n" + + "MDGgDTALBglghkgBZQMEAgGhGjAYBgkqhkiG9w0BAQgwCwYJYIZIAWUDBAIBogQC\n" + + "AgDeMA8xDTALBgNVBAMMBHJvb3QwHhcNMTgwNjA2MDcxMTM5WhcNMzgwNjAxMDcx\n" + + "MTM5WjAPMQ0wCwYDVQQDDARyb290MIIBIDALBgkqhkiG9w0BAQoDggEPADCCAQoC\n" + + "ggEBAL5mCEWQRETgkJpn/RdyQZed7gXJEBrlsF0VcTs6RbEHx4clDnhiySPrqX2p\n" + + "KgfpMtxt6wKV+qY6+mSKyhDlUnVVgNdX0IgyXXXl5zcCfVRkbqEwRoon0HRLilaP\n" + + "NAeLhQDOtR4Kuw+tGaLMMUncdVoIlgR4TCEgWVkiX+Xri7/A2t8vnBgE8xxp+Xbl\n" + + "r/gYBS0K68zyGCSEQY0DltiPkWgvLWYiFAuDYobJZhVcDDNbgIMdzS9KfDX8Pm7F\n" + + "OC4Uu5Us4QemADFX/Iqf/jURJjJJ1lJpH9ue2I3tpJhVMg7lumfrc+Mf0+85St7Y\n" + + "smxURgAd2Qv9ecpMtk3ROYci2UkCAwEAAaNQME4wHQYDVR0OBBYEFINgLu8Yw9nh\n" + + "J5xEH0/w9NOVEOFNMB8GA1UdIwQYMBaAFINgLu8Yw9nhJ5xEH0/w9NOVEOFNMAwG\n" + + "A1UdEwQFMAMBAf8wPgYJKoZIhvcNAQEKMDGgDTALBglghkgBZQMEAgGhGjAYBgkq\n" + + "hkiG9w0BAQgwCwYJYIZIAWUDBAIBogQCAgDeA4IBAQBjuUjrtllwaE1ZB7+nCiDT\n" + + "0o4SoX+1klU0M45L/IBsqIJI0uyBdwToPFXaswK0JrC3YuoOGjBfWlDGtmcoG0L8\n" + + "V3nlWh0QO2/XQYjpT8SMRLcP9xRpY/rap85LqTkPlGhk3h0Z0LZTuK9KGznaHB/X\n" + + "RfIRAerYwkRV6F4YbpJxLkZ/1udutQcByKXnGaosFZSZVyfy/Xn0+xWiBkuGv6hC\n" + + "pZh0//f+9cjUiWChx0ROa+3DmDc5mzFIxC0VGMGZWSekgFAyi7eOu09DB2BDg2O/\n" + + "C3MPBzynuw9E1a4NhEqNx+Cm0gJj5ZAUAAE1/aR8103fND3CA1SqiTgDVJh9Xg8i\n" + + "-----END CERTIFICATE-----\n", + /** + * Signature Algorithm: rsassaPss + * Issuer: CN = root + * Validity Not Before: Jun 6 07:11:39 2018 GMT + * Not After : Jun 1 07:11:39 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsaEncryption + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIID8DCCAqegAwIBAgIUC+I1WgIEDAn5GlIUequsVbhnSr4wPgYJKoZIhvcNAQEK\n" + + "MDGgDTALBglghkgBZQMEAgGhGjAYBgkqhkiG9w0BAQgwCwYJYIZIAWUDBAIBogQC\n" + + "AgDeMA8xDTALBgNVBAMMBHJvb3QwHhcNMTgwNjA2MDcxMTM5WhcNMzgwNjAxMDcx\n" + + "MTM5WjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" + + "DwAwggEKAoIBAQDD8nVjgSWSwVmP6wHXl+8cjESonTvCqSU1xLiySoqOH+/u5kTc\n" + + "g5uk7J9qr3sDpLLVmnB7lITrv3cxX7GufAC2lrWPhKdY2/BTpCGP4Twg/sC7Z2Mn\n" + + "APNabmPh+BhpQA3PllULdnsV/aEKeP3dFF+piJmSDKwowLhDc0wdD1t15jDk812U\n" + + "nNQugd465g0g6z57m3MFX1veUryaNqgoHncuVRjvXPm2HHKUYvIt28Od3w+LbOGe\n" + + "U2ykiS/KC0QQMsW7JZzeFSoogkZry/rUz1MJVSA49QNSVOdmVuUvD9tX8q+Dv+lD\n" + + "G20+9c6sz9qbzlJk4uOx39ES98Y5vAVA25C/AgMBAAGjgdwwgdkwCQYDVR0TBAIw\n" + + "ADALBgNVHQ8EBAMCA/gwEwYDVR0lBAwwCgYIKwYBBQUHAwEwHQYDVR0OBBYEFHju\n" + + "i01kwWAQXy8XCa7MFigVAz/pMEoGA1UdIwRDMEGAFINgLu8Yw9nhJ5xEH0/w9NOV\n" + + "EOFNoROkETAPMQ0wCwYDVQQDDARyb290ghQzzzfJdpEDdAhX5Yy4Wk+xwAGvcjAR\n" + + "BglghkgBhvhCAQEEBAMCBkAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJh\n" + + "dGVkIENlcnRpZmljYXRlMD4GCSqGSIb3DQEBCjAxoA0wCwYJYIZIAWUDBAIBoRow\n" + + "GAYJKoZIhvcNAQEIMAsGCWCGSAFlAwQCAaIEAgIA3gOCAQEAsasJTqce1nlDSl+L\n" + + "rHuKiuQhr2KFq9DIXrTe2TEPIKBIEQnMOX/fHtahOAvkdgQmv573Z63uzHWoWSie\n" + + "V5+fHDOOL0vGQ1y3hklIqPnNs0cOORr0sed2p5ibwM1W3OBHRGqWtdYHf0o3sJnD\n" + + "vHo1Vhxc6Zabv5Bf1pTT3GGL4cM66LRWJAoDOx4RiCZObBqDUhZ7z9ntJM+o8xtE\n" + + "4uf08tqOESQ1hJSug9GApSX5QKu59BkPza4KTCjz6tagBKBF7x/CUbYcbjsWe8A6\n" + + "TZAyfBFsdj3G20BL+o3+zCy6yBUB6Z/DzB1zx65roVt9BpF0reHHCA2/gwa9sKYh\n" + + "qx2Knw==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDD8nVjgSWSwVmP\n" + + "6wHXl+8cjESonTvCqSU1xLiySoqOH+/u5kTcg5uk7J9qr3sDpLLVmnB7lITrv3cx\n" + + "X7GufAC2lrWPhKdY2/BTpCGP4Twg/sC7Z2MnAPNabmPh+BhpQA3PllULdnsV/aEK\n" + + "eP3dFF+piJmSDKwowLhDc0wdD1t15jDk812UnNQugd465g0g6z57m3MFX1veUrya\n" + + "NqgoHncuVRjvXPm2HHKUYvIt28Od3w+LbOGeU2ykiS/KC0QQMsW7JZzeFSoogkZr\n" + + "y/rUz1MJVSA49QNSVOdmVuUvD9tX8q+Dv+lDG20+9c6sz9qbzlJk4uOx39ES98Y5\n" + + "vAVA25C/AgMBAAECggEAD8rgzy4/ev5+W20Tbu7d5K0hc32IrX24dAbw493CIQZN\n" + + "7jE855Dr4HT5vD18aqTBjRmvayZjOCTsVFxkE64G2LB43aJRYoYHbpZR5ii/EeG2\n" + + "YuRIR4J6GpW/Ex1Nyl3RPyPcotnfvbv9WLy7qS/VLfLGfdDrpzUxJK6MOeNc+bl5\n" + + "qB1ulSCaFAM9shaEKW1jXHoHhl386dtduXtCOZNU2OTmSAqh5GHKTN0CuNF9b2Ys\n" + + "3gkwVdxwle3EaY97mJVqoB3YCBZgRnT3oilJCRM7L4y6W4MVL0AmDlBrPtvsxRIS\n" + + "obFPm6c0qLVoPVbw2Z2PO9XLJmsrEAsFoVxYe8lAgQKBgQDjQ3R61ksPrmq1TDl5\n" + + "wK5FlfUfAmnnt0Sh1Sk8xSkAcEaRyTil0vKYM/flsHVD949rJm15uJ4jhKQd8+f+\n" + + "GQDj//yCNi3b/JRcOZJ4zMSnB6u4r+YJ7C5CwiGPmAm668SCvoskq93yCZ3RixM6\n" + + "59Tj7V7GQo+9gazkt1hGEcR0nwKBgQDcuUnUXshzubOftS6+nFvCO8F4JfmoHbxp\n" + + "DO3VZAvuimdbxjscMtuYVWa097gzatApkfjL4ZlxuL2yxx5GDy9mW6ipJpM/NBvC\n" + + "fvN23dzoKf1zJ9yh2jZIb4z7q87LwHiiQ7TZrOno8M8Szv7qs8K4W+/0IY6fk7Yz\n" + + "l9AgHExP4QKBgQCyE9Q8wJf2hKwWvdC3p5Sm8BcvojuMFx4PVTFH7hHvxwp1B+B8\n" + + "h2wSeX5BG+D3Tg+yXV0hKNm5aSEUW1+oyrzY62hYO835d9Rk47PzNjjNzQPw5tvx\n" + + "YIDrTKTxmKffMQk9jcMIDCgQlRp17G04FhrKMuC1p8hsLSVl3oir9xYibwKBgEHz\n" + + "Yyn/gCmD7TXlLyhpE8m/jRlXT3d6GxfQcyf1ktMdq7ByVKsiTxb/PYcJFZLXcYda\n" + + "RFq29+BQ8O2ALX2FgAY3kPepvQl/imPdBuYXeLAuC7riyDvcNagDHL7+IPYkdmcV\n" + + "j+4Sinm9qkHWc7ixKZdocRQjCriHrENSMy/FBNBBAoGAfi0ZGZxyIeik5qUBy+P+\n" + + "+ce6n5/1kdczPTpzJae+eCPqg3VQuGz3NutZ2tdx1IMcYSeMfiB6xLMWSKSraxEi\n" + + "2BCtdPcyUau8w12BXwn+hyK2u79OhHbexisrJUOVXE+yA8C/k0r0SrZHS0PHYZjj\n" + + "xkWyr/6XyeGP/vX8WvfF2eM=" + ), + rsa_pkcs1_sha1( + "RSA", + /** + * Signature Algorithm: sha1WithRSAEncryption + * Issuer: CN = localhost + * Validity Not Before: Jun 4 15:23:09 2018 GMT + * Not After : May 30 15:23:09 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsaEncryption + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDBjCCAe6gAwIBAgIUYYGwpeC0sJpk4SP0SYgAiN9Z1qswDQYJKoZIhvcNAQEF\n" + + "BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTE4MDYwNDE1MjMwOVoXDTM4MDUz\n" + + "MDE1MjMwOVowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF\n" + + "AAOCAQ8AMIIBCgKCAQEApbeNHuHv5VuUteMxa5Ga4N2QDnmGk1pAGuhFVG7Roh/3\n" + + "kU3gJzg0UHsvc0BUWPHDOoswYXiW3zzfa2TdUny/EeF3xxw10vbnV+M1iDnKwDEM\n" + + "aCtihBTHCdRd3DBRkNbyDPgOBU4zmx5fZhLej6tC0Ez5V+yScPtUe0RCWEpMRZu4\n" + + "f5bK//AknFcReEmbTuvxDD6BtpEj8pUJatWIuPPgQRbjzm37WL9ZsnwldLNAvPdx\n" + + "DBNfmGhOrIwJJ6m/ihlJgiwoM4Ffpqa/I+gciDUX9xPogFi9f93ShL9FyGDQO28+\n" + + "0HOgDi9O3KthJ17QCSOkG3leIWm/bqE4wQ3iMF3EzQIDAQABo1AwTjAdBgNVHQ4E\n" + + "FgQU1t/aKj/JelP2U02UaK4ICGLigtwwHwYDVR0jBBgwFoAU1t/aKj/JelP2U02U\n" + + "aK4ICGLigtwwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAnVX/n4/A\n" + + "0KMrjkbXYGSjECTXy15xIrMME71eD4HvCe3n5E5ONBfivPGsj9z+y73pQJm92F1v\n" + + "Wi2Y1+819ObYwXTrI1b0zgV8WJ6pj+E14eNECM5npEH/QJMSVeJLWCuisQGTaGJH\n" + + "TTemZfOTspmFQ9V/meOXjh7kgmF5plclnhDgwLe5Ryih665YOADxxgncP6ViQibI\n" + + "dSTnGH4+Ikj6iQja/Xxb1uc7KYMqQsji7oUHp/NDwM6av1tbdt5TMSrwnT1T36D+\n" + + "zc/Kua1BkI3RqfooZ1CIQc0lHr8Au7fG/HNDPBNPFuB/g0c7IE4l0bcjEIDJEtj+\n" + + "dmEitVZ8mcuRgQ==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQClt40e4e/lW5S1\n" + + "4zFrkZrg3ZAOeYaTWkAa6EVUbtGiH/eRTeAnODRQey9zQFRY8cM6izBheJbfPN9r\n" + + "ZN1SfL8R4XfHHDXS9udX4zWIOcrAMQxoK2KEFMcJ1F3cMFGQ1vIM+A4FTjObHl9m\n" + + "Et6Pq0LQTPlX7JJw+1R7REJYSkxFm7h/lsr/8CScVxF4SZtO6/EMPoG2kSPylQlq\n" + + "1Yi48+BBFuPObftYv1myfCV0s0C893EME1+YaE6sjAknqb+KGUmCLCgzgV+mpr8j\n" + + "6ByINRf3E+iAWL1/3dKEv0XIYNA7bz7Qc6AOL07cq2EnXtAJI6QbeV4hab9uoTjB\n" + + "DeIwXcTNAgMBAAECggEAWiZUOuymWJtNdvU1OVNocdOWPomV0CtUnE6nCJuQpyXE\n" + + "w+MdgbhtnSqmUYg5WnmKvxphI2U6jg7La9zfGbSLLOr/Ae4yyaVPjNwpjwYBajRE\n" + + "j5aqbTfwX0SMGvCeLrD/1FZNKk20fTo0o464TGfaXP7C1jX4JEZVWwlzHhytCWAg\n" + + "tkApQmmU0AsDnLll4zWDa/IeeVDJXkF95S4Dyj0LCrJ8+9PF2zN0AKYGuDjOWY2d\n" + + "yeWW9oXI7zzBBtCriPy+GYXNpHmfpURCWBt4Nc89EV2qB6ZYmMXkspfA/wLtcRm1\n" + + "zchbptCakgaNfw5qMJrucB5Jz1I7vfMSlcu4VZ0lAQKBgQDZ5PvqVet5/flPaJTR\n" + + "Ct8Ye1Y62lZgz1woNjzhC0btL2eAcMtgsebznlTFY4NLb4M2eo7CabSGs7xykhBS\n" + + "t4o//eh+MupMYHYGrzaPHjRnBbm/mTR1DUuPmBX6ZGtwXifFmwvhZdaRWuCzVoYN\n" + + "uUONvUV5R/xz9niyXRtN1HVLMQKBgQDCspxCgHc3OvXYEHl10Yoc4qsGH+7NQTAA\n" + + "5TzhhdxcR6vxnBJSKh/kzMPM4QYXdwPfaHMsay+FEiGz6agdKgtTAA6mKnjjM4zk\n" + + "e/J9ou8QWm08T0GxUXcx1NGYM8Nsamz2svZ0XAe76I0hhosV5nxmXabayPgHe50L\n" + + "8SD6qFO0XQKBgHO0bbVNNMLOA8KQJV4wKLHGZM7RvEaiNizASGm0ZFB0+MAypTzO\n" + + "m3ZIYHmE02aOa53VTNOd8BgLf4lTWMmj3w0GFpxVCyfNnT8FcbJj9q2yU6WThFCX\n" + + "48T3nMwe4RKFXRdIsvFY86yyFloFGyBUfbPZivfRKxSlEAie+m3E4RgxAoGAVrxT\n" + + "OJ0afxRZKWRNd9tdd/jSz+ux6ua7h+qX8LA9ty6GvyAUWV5Czx8Zq1Aj8pgmtYRG\n" + + "quclSFcHhKr3JebxHIzN+eC58h2pCrDdGnNXpSVjvJZiYag1PZHdvbxxtv7ChDS9\n" + + "7qCBIYk8Nk9F7v+7M69NAfK97Dd5gzRsyL3sbFECgYBxz2nCKeBv2frxtD36nlY1\n" + + "bDhZv1Asyxq0yt9GSkVWeHnSIFHfwBu3w6qW7+qdlQizu+6GZ3wq9dyyrXUA4zPU\n" + + "QnYWYYk30p4uqLXFCrnscVOm3v7f51oEYVoEKjqGl2C/BTy7iSgCRd+cp6y34DsV\n" + + "PsRyQCB/QarxsDNAuioguQ==" + ), + rsa_pkcs1_sha256( + "RSA", + /** + * Signature Algorithm: sha256WithRSAEncryption + * Issuer: CN = localhost + * Validity Not Before: Jun 4 15:22:04 2018 GMT + * Not After: May 30 15:22:04 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsaEncryption + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDBjCCAe6gAwIBAgIUc8yTYekR2LuXkkCJYqWlS/pBMKIwDQYJKoZIhvcNAQEL\n" + + "BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTE4MDYwNDE1MjIwNFoXDTM4MDUz\n" + + "MDE1MjIwNFowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF\n" + + "AAOCAQ8AMIIBCgKCAQEA2jDPGMogc9dq2w5b+FHqbfaGPokRmyObiU8y/l/dqkM5\n" + + "9IV+qj8VQUI4NtpdCTWr16812z4AjXrk5HIBrECfQbHPUcm1rme5YVZ0WxV0+Ufy\n" + + "hDmrGwDLhkxGqc3hOhRrlF2wdXeUfjIzhvS9+S/401++t/jvq+cqFF1BHnzYOu+l\n" + + "nbi/o95Oqo8MlwiRqg3xy3fNRfqXk7DWy+QT8s+Vc3Pcj1EW6K0iJJ23BVTdv6YT\n" + + "Ja5IKiWL4XsLht3fWvZwF+PoYfKb+JYflt0rafpxg9xkowe7GnGh2SpV7bJaH/QN\n" + + "3PTFEKQWgWHjWwjR171GOzSaEgaklvKde6+zNWeYKwIDAQABo1AwTjAdBgNVHQ4E\n" + + "FgQUqCtGe8/Ky4O6pH7xeTUy9yrv4n0wHwYDVR0jBBgwFoAUqCtGe8/Ky4O6pH7x\n" + + "eTUy9yrv4n0wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAuqch30im\n" + + "M09sARarbfK3OExqYK2xoyuUscgTqQNDpNL2gMdXY9e0lTmGVgw9pVYtNZPZRxem\n" + + "jR5an2XegvG9qVU6vLENDwLCqZgsTb2gvmXngiG8NVcYd81GNqD228mkgBosNJku\n" + + "6BR+C8zlURzsNEt657eVvIp9ObGomdAbWhpdqihBD180PP18DIBWopyfHfJtT5FA\n" + + "U2kSPBp+P1EtdceW0zfwv3rF8hwRbnQBzuoYrZfn2PiMYaGUqOgbqUltCMD/Dp9G\n" + + "xK0nfAXEwIqHWWnijGwAd6YrszMjBUcSGmlehdF+XZK6jHNlw64RB4WTfavr+rY0\n" + + "dTe6g4o5GYr9nQ==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDaMM8YyiBz12rb\n" + + "Dlv4Uept9oY+iRGbI5uJTzL+X92qQzn0hX6qPxVBQjg22l0JNavXrzXbPgCNeuTk\n" + + "cgGsQJ9Bsc9RybWuZ7lhVnRbFXT5R/KEOasbAMuGTEapzeE6FGuUXbB1d5R+MjOG\n" + + "9L35L/jTX763+O+r5yoUXUEefNg676WduL+j3k6qjwyXCJGqDfHLd81F+peTsNbL\n" + + "5BPyz5Vzc9yPURborSIknbcFVN2/phMlrkgqJYvhewuG3d9a9nAX4+hh8pv4lh+W\n" + + "3Stp+nGD3GSjB7sacaHZKlXtslof9A3c9MUQpBaBYeNbCNHXvUY7NJoSBqSW8p17\n" + + "r7M1Z5grAgMBAAECggEAHs/7vw10TcejEHJTrJqs14CT7qresKDzqw1jLycMn6nE\n" + + "unJLs/EaqE+Yrq5hqxZIQTo+CcsUuuYbAuPStqedleJtW6h3nryJImTaI67BCR8O\n" + + "8XtPXY3cMAf/hqVLZC9UDey5Ka2Ma9HdEvbnCRSsN/VycnqWJhmMCLouowaQZqoE\n" + + "VopscUix8GqELv0vEo2CszZfUjtSVbNTlNgwDf5U7eSKXMuFsnSn/LE7AMvHsEyo\n" + + "HatxogwlM/WjpTnf/WIeJY3VhaK10IsP6OEgUn/p4VtI2DQ/TJdgYrvD5vhjY8ip\n" + + "XuUPuPILRvJWo8dRXJqa4diXB12q5YhP8iiOp4BgkQKBgQD1GtlOR+JVgOzpQ11h\n" + + "s5/iJOsczee80pQscbSRJnzSsIaP9WM8CyJgvbPxIQxLUQeYnxM/bxNKkpJtzxRK\n" + + "pob+v4NoRn8PTpqbOp1obmWJT7uHTaoeavQo7r7uZI4i3eEgHCCQkMzpqzz7UFTY\n" + + "2Yst7bBTPUivlSVQQBEc8bLpeQKBgQDj47EjpAlh8DmJRTElg58t+XJehXGTqmlx\n" + + "nYu8DQLSzGbOQ/Z4srakC1mkM0LHCmULIIWk3KhV1GBCeArv7DlZ9A1SkI95bsq9\n" + + "GBeQpovL0PXKkOOWMJBklP/CTECO4eyA8r6c1d8wytBb6MrJ8bi74DdT+JlFjK5A\n" + + "zNoeNx6JwwKBgQCehIPABeuSYvRVlDTDqFkh98B6+4wBaatc5xjhuyOFW5dbaVeJ\n" + + "kKXmLSpAK6B44WnpQhA/uUWfuBWtoPy9nt+1yARjnxwzuSFyfUEqNiPC32coBYmd\n" + + "bIyGIIopQa1PTXJ4wtgoxw1PnmitHHITYPaLeKrN2te0fuAH+7dVodeU+QKBgAct\n" + + "VJbaw7Dh7+3yz+lui8TW5lMzwK/13fxGCfCSOFSLO3Gjkk+a0UW5VclmE+RQ333K\n" + + "OGtIx8RsO9vcC/wiZGwA06qWAu7AHoJ2D8fudtikbBlFFuXUAbgpOSTVYfMeCmTF\n" + + "QFuQIMdYm9dJLZnOkxLXrOZoHeui0poX2Ya6FawhAoGAAI/QCyDbuvnJzGmjSbvl\n" + + "5Ndr9lNAansCXaUzXuVLp6dD6PnB8HVCE8tdETZrcXseyTBeltaxAhj+tCybJvDO\n" + + "sV8UmPR0w9ibExmUIVGX5BpoRlB/KWxEG3ar/wJbUZVZ2oSdIAZvCvdbN956SLDg\n" + + "Pg5M5wrRqs71s2EiIJd0HrU=" + ), + rsa_pkcs1_sha384( + "RSA", + /** + * Signature Algorithm: sha384WithRSAEncryption + * Issuer: CN = localhost + * Validity Not Before: Jun 7 07:59:56 2018 GMT + * Not After: Jun 2 07:59:56 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsaEncryption + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDBjCCAe6gAwIBAgIUcjBWKuODVu3MEVfJLsTPV7yRdo8wDQYJKoZIhvcNAQEM\n" + + "BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTE4MDYwNzA3NTk1NloXDTM4MDYw\n" + + "MjA3NTk1NlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF\n" + + "AAOCAQ8AMIIBCgKCAQEAvIgnQr3nGpMz/QYksk2r+SpqbRhiOFno6c/kyJmSu8TQ\n" + + "08RV8Ad8CalnADkHlPBoTmCqY5v9aOupcl1+jCe7e4idz4IJsuY1KRU/Uj4lYVqO\n" + + "1W78HxIgKd3jbSgA9628lJ6Nhv6OqyA8KCInKboI8FdDmdRVzu+FCmGKLBtUVnOP\n" + + "OkzMzttkrg7oyUoCagYizZLY8lhUA8RfgxIMK3zhS1t3k5LbH36+kd6sECNrg5+y\n" + + "6Dbd7g67ja40ALZpWU75yLNR9G71XZ0b6HyFjbF31oVCHtoeN6MiEXYS0F6+VT+x\n" + + "y5xg4y4JZfZFJB7GUaAso4XZxKYTypv7DgPE7WquHwIDAQABo1AwTjAdBgNVHQ4E\n" + + "FgQUMQoCUE5YPhS4im6eAZaCRrNfqH8wHwYDVR0jBBgwFoAUMQoCUE5YPhS4im6e\n" + + "AZaCRrNfqH8wDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQwFAAOCAQEAm5o/OH/x\n" + + "i1Z4TVPYRDbDgRZoGsikQtt6JxYRgqhwHrTo188kJw61X4hRaMcV5Td8WTsqXJCq\n" + + "dfGGpV4L6FCwBNNNxIyHGTrtjNtGae2x2c9XYX0O6nnmgQP4+Koo7ouqpxmMzfGa\n" + + "uN3PWP8ABhEiLCBfRRK8w9kpxOuJfQyiwXQQN9TH6MU63O52ydA5NYA2RMbRcjsC\n" + + "BE4VHGsJJo1z8Z9KI7pdSvP3/wTSMVpYY6kxanMSHNeFV5aDfSOX8U8oqIF7xkiA\n" + + "o1CjhPYUvS9MEmoq74ulKNgfstjYcymiP10odaiv4wg1oIhxVtNV/fpdKQKHDeu0\n" + + "30Ac3llO11/faA==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEwAIBADANBgkqhkiG9w0BAQEFAASCBKowggSmAgEAAoIBAQC8iCdCvecakzP9\n" + + "BiSyTav5KmptGGI4Wejpz+TImZK7xNDTxFXwB3wJqWcAOQeU8GhOYKpjm/1o66ly\n" + + "XX6MJ7t7iJ3Pggmy5jUpFT9SPiVhWo7VbvwfEiAp3eNtKAD3rbyUno2G/o6rIDwo\n" + + "IicpugjwV0OZ1FXO74UKYYosG1RWc486TMzO22SuDujJSgJqBiLNktjyWFQDxF+D\n" + + "EgwrfOFLW3eTktsffr6R3qwQI2uDn7LoNt3uDruNrjQAtmlZTvnIs1H0bvVdnRvo\n" + + "fIWNsXfWhUIe2h43oyIRdhLQXr5VP7HLnGDjLgll9kUkHsZRoCyjhdnEphPKm/sO\n" + + "A8Ttaq4fAgMBAAECggEBAJp+lHW7+wsq/9pj02SOA9RubsIxziNRgm0/4MKGHtli\n" + + "QqKW7LmC2KFuQarMESt7Cm7YBikUZkg5fiTq+s3NrXRhErk+XcZNodilwbsalDVA\n" + + "KXY7ub2Yc+T7IOiNdKWCqNu9RksOhUk0ZDebLS6jdbnGOO5xM1QdsY89OSZFywn/\n" + + "xk1S+gvx5f7icchhSvPse3H2Sw3411HriWB83cDH09YPCZcJTv2QM/xophSru2j/\n" + + "kpRQhnJqGZ1M+1QDVi5HWNx+Y5v0QuCVWOi8Hat/S7x2J3opAqaCIjK0ErOC/OdY\n" + + "BJqjOyH8tfwnkwD+ghGIj44/lDsi0GY/2CsD63PNX7kCgYEA5Nz5pIi//2FqnOS7\n" + + "Pnvo374ZhMaepwvDdGOfkDDyL6k+5pLaO4SL5znQQzGmM6EWi3z7ZKw99MzQcwR6\n" + + "4COAgBqDm0vXY0MI4vLPzZpOe6hABieiaj4tvG9Ts2yqjBPLo6mZ6UDMFbg4Tt0F\n" + + "bfaqF5jA/mR2SpBzhRIeX0/eW3sCgYEA0uLw75774f6hnUWqi2jMtgwiOHXSFb+f\n" + + "bnxWGNJfxVW76rVh9892m1FXdU8SZivwg50dvo/GDQ1NsaaL5ypPsoP4d00336VT\n" + + "Gx1NAlo9WuD306cYXzMUmXCCwoCbOw7vdAAoIEDei8+nr6QO7yb5/FsWrmSZuadf\n" + + "ljLT+02f1K0CgYEAq0j7CfpS//ZPzXae8OfZ5UKoZKgma00xjnVVIZyQVb1sVzMH\n" + + "Y84Syw6I4RFSm4dvkRwMJk+G2yVCySJMOF45uSae4uaDIEY2a2xgvDdFj+TfbfvR\n" + + "4YQBxOrpEPs+NTJHkYjIqTsWwxaqBdQDUUZwDNMFdh+ILMwpuSlTU/A5sesCgYEA\n" + + "q+Y7OUfhz/TMbjN0chDqFVbMqjM4HWxGnDwTvkX1tRhOhmJ1yhc9ehuS69eZitk0\n" + + "Q0RWE5iEeu0mMLIuhi8SKdSzOyQhcFcF6Cs5M7q1GpgYy1kAX9F2cCCrJbrJThm9\n" + + "jFP4YVofTd3ltSFI3x5pVZA2a88rE49gNkGWU9mReD0CgYEAkXoH6Sn+Elp6Oa+k\n" + + "jF5jQ14RNH4SoBSFR8mY6jOIGzINTWiMCaBMiPusjkrq7SfgIM3iEeJWmgghlZdl\n" + + "0ynmwThnfQnEEtsvpSMteI11eVrZrMGVZOhgALxf4zcmQCpPVQicNQLkocuAZSAo\n" + + "mzO1FvNUBCMZb/5PQdiFw3pMEyQ=" + ), + rsa_pkcs1_sha512( + "RSA", + /** + * Signature Algorithm: sha512WithRSAEncryption + * Issuer: CN = localhost + * Validity Not Before: Jun 7 08:00:45 2018 GMT + * Not After: Jun 2 08:00:45 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsaEncryption + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDBjCCAe6gAwIBAgIUZEjv/5m6CpjS/ZAZ20O81p64tCwwDQYJKoZIhvcNAQEN\n" + + "BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTE4MDYwNzA4MDA0NVoXDTM4MDYw\n" + + "MjA4MDA0NVowFDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEF\n" + + "AAOCAQ8AMIIBCgKCAQEA2heH4cASjGrc2ir6n4pqoQSzT5mhlR8/iF/5XrfISSbn\n" + + "fZNZnPk2cTQSDD8HNbRT9bvtrIYQITrGgUYKBTwtwycsM6v76+TFWsPBHWbn8bny\n" + + "eGsFxhNXsrRXZYiqDwoiPE+J8aTQMt4WlNBaZjt/9BEUYyTyZ8c53WWaE9aSE3sQ\n" + + "ynulZ8ruhkc9hbybEO1UfAQEWIY+nR0U9aBPSkmMxGbYaVhRecI6U5f2HpUA1llx\n" + + "LXJRD7PpiljccbxH2sNUdB4zL72XLsY1hn7igb0V9nNy79dzBTplmygEFv3ciLNi\n" + + "Jx5kOWEtuQh/DlWxptIW85lHugjkNdDnyiinCjIUBQIDAQABo1AwTjAdBgNVHQ4E\n" + + "FgQU8u4DRt2RBndU7GqGw9/IFdkfMRwwHwYDVR0jBBgwFoAU8u4DRt2RBndU7GqG\n" + + "w9/IFdkfMRwwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQ0FAAOCAQEAWt8hlw9e\n" + + "kCFqGd+MqZLGg6Lv5tgJ1GRb+tMmGfRTwG0kegBzY7qU4ZZvasRH0F0lT7G8YNGs\n" + + "Asddvx6WuCQxW+V9WAfZMorSyUE1PKm0OR/vyZoZ7KoqWfMuxsPG6C/uh5Np4gd8\n" + + "8dIAASemQo8zLI+MBUjOiww+EwXkZ14m8vKAxKDk9JxzmgrkgH3U6CxhFgm51bmx\n" + + "d6axFU4srW+wjONb4nWLh3Cd9cSwL9nvbIG09T9xDf783uz3NYIqsmrKSP4h76WQ\n" + + "dueGgIRtJkV/x2dOmbCAh+SbY99kWG2wVFDmznweYSqzaqNfX4uiIkFB8M1Pi/9W\n" + + "ZOZBzpaxm+ARCw==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQDaF4fhwBKMatza\n" + + "KvqfimqhBLNPmaGVHz+IX/let8hJJud9k1mc+TZxNBIMPwc1tFP1u+2shhAhOsaB\n" + + "RgoFPC3DJywzq/vr5MVaw8EdZufxufJ4awXGE1eytFdliKoPCiI8T4nxpNAy3haU\n" + + "0FpmO3/0ERRjJPJnxzndZZoT1pITexDKe6Vnyu6GRz2FvJsQ7VR8BARYhj6dHRT1\n" + + "oE9KSYzEZthpWFF5wjpTl/YelQDWWXEtclEPs+mKWNxxvEfaw1R0HjMvvZcuxjWG\n" + + "fuKBvRX2c3Lv13MFOmWbKAQW/dyIs2InHmQ5YS25CH8OVbGm0hbzmUe6COQ10OfK\n" + + "KKcKMhQFAgMBAAECggEAFE5YkoZls7lHcvDJgQ1MPE3JvEGbr9zG95WoDE+kUFtU\n" + + "9nY/w8PYc9XbUFSWAUQXBSxIRuX8nntwfBzfVflycVc2YGFFBYO5dGgBlRE9y136\n" + + "24drdDPc2IC+GnANFXVmFqN5PoyP7gyLobN8l0Q296yXb1vDTjJYiuqo2+wAkduZ\n" + + "gQDjl1jTS/1RXjix7Kaw9PrO5ONqp9f8FqJCVyezhp+OMNA88Uz619jvYC4axNh4\n" + + "zjESAf1YXPJUTM9nznmFQ8jS4+6I0yvf0jaNpCY1bC7kaHBMKkYWiBMPaNWYHa9o\n" + + "9EyPN5tPk8OTk/m9+e98vo9R1JR9016TKxDQtRxzAQKBgQDztIFeYuAUh5uTAGe+\n" + + "7FTfnsF+Pl3raWUf9T8d/m+3XujAXNrtURb2TkyQlsB+cNWa9VH/mMGz5RFE1mlC\n" + + "XaWKPrf0SAdbmx+wcRrEOlf+ARNj8XbEyKptpi7tgN11s6Eyztkn6xwUmSCEuZ+x\n" + + "Rly2F6A3FuHTJh24yjIFnP8vZQKBgQDlGDoFj9mKKkbAxoZGZYN/B+T5EUAW/OaH\n" + + "Oaxqi55QpGCbxGVR+G0AMG6WEN81qm812GTHJD22As6Lz9zFThKkJN2za43CAgrq\n" + + "MA7KgqO0w5rvuXXiPCHZUvdDkKFpIMZj4ftq83Xh3mkN5mbhF9FP0v3/xrczowYP\n" + + "oj11IHWYIQKBgQDkuvfo5Jg37IcB05GLyjhmoZQtrs9rkcIN2ppgxluIGZYOZZg8\n" + + "wKzyg86srjEA+1ogVDufz3mOJGKu3yZv2YDzXaY9qhTtz4xQh/d9UN0hU1Ulqo20\n" + + "aDo9K4pD83znaa7UBvwd0TbLxmSU7buKIOYHKel/iwRsrwuaUnvcdNu1WQKBgBa0\n" + + "SvPIKNgPjomGY0JQxzJstt2UPxTIJZSbO6Inih4V3FkzopL4Gt1c72jB7U0lQfZF\n" + + "Jt+xkMgcCRpEFG4daa2I1cv1ScxDZY+GCcE6Jz0/8Xf2ml88dGJUXZr9l3GSxPab\n" + + "K86SqEklQKYXAnUmZiESGQgjSn68llowSwTznZPhAoGBAMH2scnvGRbPmzm91pyY\n" + + "1loeejtO8qWQsRFaSZyqtlW1c/zHaotTU1XhmVxnliv/HCb3t7qlssb3snCTUY9R\n" + + "mcyMWbaTIBMNfW2IspX4hhkLuCwzhskl/08/8GJwkOEAo3q/TYigyFPVEwq8R9uq\n" + + "l0uEakWMhPrvr/N1FT1KXo6S" + ), + ecdsa_secp384r1_sha384( + "EC", + /** + * Signature Algorithm: ecdsa-with-SHA384 + * Issuer: CN = localhost + * Validity Not Before: Jun 7 08:02:00 2018 GMT + * Not After : Jun 2 08:02:00 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: id-ecPublicKey + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIBuDCCAT2gAwIBAgIUIs1pMDA3bRg9B2OP7GFMAYxhr8owCgYIKoZIzj0EAwMw\n" + + "FDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTE4MDYwNzA4MDIwMFoXDTM4MDYwMjA4\n" + + "MDIwMFowFDESMBAGA1UEAwwJbG9jYWxob3N0MHYwEAYHKoZIzj0CAQYFK4EEACID\n" + + "YgAEeXrId3yy/0mJPNXXGXlMSQEvIpSyDCcKKQd2Zm1qt0gA1HUSHulfStyHUI6D\n" + + "l/pY7iR0wO/xYIWhirmqT+XbVPTWIJb245Lf9GFiR/d6UyUbqXuNg9GpnURsy5Zh\n" + + "x4Dfo1AwTjAdBgNVHQ4EFgQUk3NPE5K8ovMPNFtzX27rprTndU0wHwYDVR0jBBgw\n" + + "FoAUk3NPE5K8ovMPNFtzX27rprTndU0wDAYDVR0TBAUwAwEB/zAKBggqhkjOPQQD\n" + + "AwNpADBmAjEAonkaekNeu3ICbZyvbuMIBppBemAdGgTArlVEl+V6BFqhqpAwNwvl\n" + + "ipkjYLDTLCNmAjEAofWQz5kSdpigbJCU/ke9JFce9Vy6gp4kPIghN6f6EYtlwQQU\n" + + "yXwh67EHeFD4Bnr7\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIG2AgEAMBAGByqGSM49AgEGBSuBBAAiBIGeMIGbAgEBBDCpxyn85BJ+JFfT5U7U\n" + + "VY+c8v2oY873YOVussMDiC82VYGKZDZH8D6C6h0b33iCpm2hZANiAAR5esh3fLL/\n" + + "SYk81dcZeUxJAS8ilLIMJwopB3ZmbWq3SADUdRIe6V9K3IdQjoOX+ljuJHTA7/Fg\n" + + "haGKuapP5dtU9NYglvbjkt/0YWJH93pTJRupe42D0amdRGzLlmHHgN8=" + ), + ecdsa_secp521r1_sha512( + "EC", + /** + * Signature Algorithm: ecdsa-with-SHA512 + * Issuer: CN = localhost + * Validity Not Before: Jun 7 08:03:11 2018 GMT + * Not After : Jun 2 08:03:11 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: id-ecPublicKey + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIICATCCAWOgAwIBAgIUPA5KmdGlz29IePn+kPah9OlNRyYwCgYIKoZIzj0EAwQw\n" + + "FDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTE4MDYwNzA4MDMxMVoXDTM4MDYwMjA4\n" + + "MDMxMVowFDESMBAGA1UEAwwJbG9jYWxob3N0MIGbMBAGByqGSM49AgEGBSuBBAAj\n" + + "A4GGAAQAs1phx3tISw+G2HA8r4ZflQ3Q/5o9U5zeFz79PsKEPSsE1xhGbUyWDasB\n" + + "SeUKOvVsli5vYy0hdO132Q7Nl+QANUEARY2ax5ERXIJBY9S+PRdP7OG4fr966Rv8\n" + + "vaCE2g8pV9NnAtalN3sk8iCEdVUthvL9R6nopiEd7Fz9SMRGOSu18FajUDBOMB0G\n" + + "A1UdDgQWBBTUUVvZJV1MlH/cRuWxfMF9eIsXBTAfBgNVHSMEGDAWgBTUUVvZJV1M\n" + + "lH/cRuWxfMF9eIsXBTAMBgNVHRMEBTADAQH/MAoGCCqGSM49BAMEA4GLADCBhwJB\n" + + "UUzp0KbJ1dj1h2xd4yN1DXW+Xyxah8Z5oiWvG1EfTYL201GcgmUhfqqwJBJphtsh\n" + + "Bg7qTGGg5F9cVOI9+yMCcDoCQgCJ3chYHlTiC5QpW54hdeV+k45PoCQ62Foopn2i\n" + + "N/aUEkWfZ7OidC7O3BWlhDvrHcPLisxHx4oF7vebatReBE+DLQ==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIHuAgEAMBAGByqGSM49AgEGBSuBBAAjBIHWMIHTAgEBBEIAz7qc9msPhSoh0iiT\n" + + "Z0146/sLJL5K+JNo2KdKpZOf1mS/egCCbp7lndigL7jr0JnBRIjk+pmeBtIId6mW\n" + + "MrcvF4KhgYkDgYYABACzWmHHe0hLD4bYcDyvhl+VDdD/mj1TnN4XPv0+woQ9KwTX\n" + + "GEZtTJYNqwFJ5Qo69WyWLm9jLSF07XfZDs2X5AA1QQBFjZrHkRFcgkFj1L49F0/s\n" + + "4bh+v3rpG/y9oITaDylX02cC1qU3eyTyIIR1VS2G8v1HqeimIR3sXP1IxEY5K7Xw\n" + + "Vg==" + ), + rsa_pss_rsae_sha384( + "RSA", + /** + * Signature Algorithm: rsassaPss + * Issuer: CN = root + * Validity Not Before: Jun 7 08:04:01 2018 GMT + * Not After : Jun 2 08:04:01 2038 GMT + * Subject: CN = root + * Public Key Algorithm: rsassaPss + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDXDCCAhOgAwIBAgIUTYfwEB8SfPXHN+jU18mGBoInoxwwPgYJKoZIhvcNAQEK\n" + + "MDGgDTALBglghkgBZQMEAgKhGjAYBgkqhkiG9w0BAQgwCwYJYIZIAWUDBAICogQC\n" + + "AgDOMA8xDTALBgNVBAMMBHJvb3QwHhcNMTgwNjA3MDgwNDAxWhcNMzgwNjAyMDgw\n" + + "NDAxWjAPMQ0wCwYDVQQDDARyb290MIIBIDALBgkqhkiG9w0BAQoDggEPADCCAQoC\n" + + "ggEBANVenkAl6FfHbzw1HG38BAS6tuNBSXU9m5/0kEGP5J5tWqGNVL/zwRoFGPH4\n" + + "q1KUpmbE6kgDka5fwBKALlh1mnLbgNG283mc3zj4MDgv+IZvK9D2pJfd8oTmMNqS\n" + + "QGwL19tlLjXiq+shwcccOMGJrmAU21Ca+rn/kn+nOjMnhP3mWyR9z/K1PI6D4wvJ\n" + + "Kexp54vhuu9dgfBM4d5vlCtnbE5Y5kZHEVhLHbmlR1urnqjlqq7YVl8W4UUaV6CE\n" + + "Djj3b6+u+87zjMv9NJh+bn44DPlnnc8WkUIohf8ci4rdUQlT/STkIjl6L1MDSUxC\n" + + "3PAjRaTGgpdg3bq81omO1O7OQEcCAwEAAaNQME4wHQYDVR0OBBYEFK6KsXrsGUu2\n" + + "IoaQ+Q07G3Vi7AWWMB8GA1UdIwQYMBaAFK6KsXrsGUu2IoaQ+Q07G3Vi7AWWMAwG\n" + + "A1UdEwQFMAMBAf8wPgYJKoZIhvcNAQEKMDGgDTALBglghkgBZQMEAgKhGjAYBgkq\n" + + "hkiG9w0BAQgwCwYJYIZIAWUDBAICogQCAgDOA4IBAQBuflWm96V3EvIBfuTcjIq/\n" + + "R0AEqNb17F7v96cJHNj1FKM0mFu8R1UBWDYzwNAdXLylDzn/4OEsYmcY2AaLKn9j\n" + + "E5IXcMeGTuDX0rsUJtdBu4ueHzr4PUMkEsRHL9vG6EYj12+UyHl1iN2F4dWU6Vvs\n" + + "mtKjGZCA2VG2+xczyS1PouLV/H/My7O0cB0eO3kOlMFENcLRMgcwWLvUKuKgzZ2z\n" + + "XerJdFBQ1wEJQr9JdcbAXJkQCbiFq/sgdzLuo9KwiQ9WOm99eB//iHQkOiNF0NLn\n" + + "hMdqUqaPOvUBl2gVC+aPm0cdlFj1IcbAaOq6Kg2OA3edapyUQF3+jZm4pnPHyT8Y\n" + + "-----END CERTIFICATE-----\n", + /** + * Signature Algorithm: rsassaPss + * Issuer: CN = root + * Validity Not Before: Jun 7 08:04:01 2018 GMT + * Not After : Jun 2 08:04:01 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsaEncryption + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIID8DCCAqegAwIBAgIUKNLkRNjNsv7usNhc8tvkJwyKBxgwPgYJKoZIhvcNAQEK\n" + + "MDGgDTALBglghkgBZQMEAgKhGjAYBgkqhkiG9w0BAQgwCwYJYIZIAWUDBAICogQC\n" + + "AgDOMA8xDTALBgNVBAMMBHJvb3QwHhcNMTgwNjA3MDgwNDAxWhcNMzgwNjAyMDgw\n" + + "NDAxWjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" + + "DwAwggEKAoIBAQCe7chGqR+iYpXWHDWK0LZVff4XDc/dS0CloNQr6GAa/Gb7p37v\n" + + "kjWStk5BKpRg1SNZtssFNEOXR4phjFf3boUQ7A1i9e+eYJAmbGalwwotY1zxdr5k\n" + + "faWYxIiMSaPHHwPfe/pnY1RF6lOsLlegPw6xxg08LETaU+M9QCJ9EodXDEb19/Kw\n" + + "INer/Cduou7TdVDFPYY02lMoj7WrvFgu90fRL/EmsMgN6dB9pBS6GbJK5e8E4lpg\n" + + "KacuXdCf3eHWMz/4MGKxXEzXTv4kjvR067xjZmtvO70iTQgmL54w1YdLO5oU1yYl\n" + + "yXJ/z0iBEM5TG4nESoTWkILZDLcqjyCPfzdXAgMBAAGjgdwwgdkwCQYDVR0TBAIw\n" + + "ADALBgNVHQ8EBAMCA/gwEwYDVR0lBAwwCgYIKwYBBQUHAwEwHQYDVR0OBBYEFC5n\n" + + "8hdp8OS1TWG/EzvMHa1R8608MEoGA1UdIwRDMEGAFK6KsXrsGUu2IoaQ+Q07G3Vi\n" + + "7AWWoROkETAPMQ0wCwYDVQQDDARyb290ghRNh/AQHxJ89cc36NTXyYYGgiejHDAR\n" + + "BglghkgBhvhCAQEEBAMCBkAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJh\n" + + "dGVkIENlcnRpZmljYXRlMD4GCSqGSIb3DQEBCjAxoA0wCwYJYIZIAWUDBAICoRow\n" + + "GAYJKoZIhvcNAQEIMAsGCWCGSAFlAwQCAqIEAgIAzgOCAQEACnNXDJXG4sneapAr\n" + + "U3CjwrNB+ip7v6qTuntIMVxpo5ONMdE0lX8UcAsUfnIaUKpNZxAENelsG7ywdV3R\n" + + "unWV28bY4faIrgzKB230KS0GvjQ+gARvaP39V/7r2OtpXfLzMKlddacAQt65G4uB\n" + + "9j9pDb6hD2FZvBZLsfuzezl6TGO7mDw61BK61A+9cJLLnHzpR7TdgjKWtZ2FB29P\n" + + "zXly+ukq56Xadu9QbDzjnKxrPSzgd2i05C62qBWZ8/0ZvCIcFqEVAa/IReTIwCCo\n" + + "805SJ0VB3hOUK8eg/FOT10cK+JPZaSTQxYCUxL9fAaoQB7SnA6MsBXprpq1Ibse6\n" + + "zGU9Zw==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCe7chGqR+iYpXW\n" + + "HDWK0LZVff4XDc/dS0CloNQr6GAa/Gb7p37vkjWStk5BKpRg1SNZtssFNEOXR4ph\n" + + "jFf3boUQ7A1i9e+eYJAmbGalwwotY1zxdr5kfaWYxIiMSaPHHwPfe/pnY1RF6lOs\n" + + "LlegPw6xxg08LETaU+M9QCJ9EodXDEb19/KwINer/Cduou7TdVDFPYY02lMoj7Wr\n" + + "vFgu90fRL/EmsMgN6dB9pBS6GbJK5e8E4lpgKacuXdCf3eHWMz/4MGKxXEzXTv4k\n" + + "jvR067xjZmtvO70iTQgmL54w1YdLO5oU1yYlyXJ/z0iBEM5TG4nESoTWkILZDLcq\n" + + "jyCPfzdXAgMBAAECggEAEWKPcvNTK48/NsG1Na8pEucKYXk4UMvHkZarPvZXdPxB\n" + + "Q6wJ3akPxTG+E7DVtFX8XPb69GHINwczYwJYKQ/k7Hn16OpgQOHtQta+z8krFtX0\n" + + "t9E2eIWqFLEDAt2XVdPVt5+3P5IFCPTeHEqheT0MnXO9xOROz9c3V17ppubc+S+J\n" + + "fm5gme7i+nK5tU3r+SFl9BY9YKHHIXamggUJioVtpSQHrZEK6ygBxyKrdKGbS2Ii\n" + + "XTvlsvKXePkGUBiKZ6dqkZwPIRFrExObrrGuxp3l6ajTZe5l4/Q8amG6yVvwhOyG\n" + + "ASLKr+9TouErnLjty+uGpWgn+YvIdzrligq5dnPmIQKBgQDKNKRByiikoAbvvrmh\n" + + "FHelRegG9wsHAe07L0hPgoObj1iq/HKocNpZtu6Qqzm1cAQ+oinACDbf699xIUWC\n" + + "V7jEou/d4kdcbJ9b4o5fMj9YNc6XVO34ce9sHkD1CSsOWlgtlfwui2c0y5H2buUw\n" + + "dBY9OVRbCQMvgL+UZMmbsHxPsQKBgQDJNb5syiJyWOwI3wZuvVXDAzOXoq7Yn2lP\n" + + "E047wPM4d6F3dVBIPlyremHdEhYpUD4mP7d2bO9e9+o0deMqh7vJP/JlangZSUYD\n" + + "qXmMpNBwVcZ/n4rfkMInWLy7r1XYgQJ1L1+rVnbTLQPrDa/4+JO5IyBAPTAftXQ1\n" + + "xaevCZmBhwKBgHCtdPrUVGGoazUd6wNADIwksG9xKsv03uWkK39jE0OUVayykJIc\n" + + "kRB9R+OGBtp8WWEtrGY+LZYKMrEwATPo/iVVRqU2et2eCg+B6CRUM8hL85uQ0Csq\n" + + "EmkFUt05Bq0w2wJMGgM124UoC2Zv1XdyuRHU6JTyKLxH2nouz8naRuuBAoGANPws\n" + + "GyXXkFkOPv/MB9lf/iyXp3S1qmHAL4yb62xSICqQoI6KB5w0dwuRPdAHefWhiBz7\n" + + "SPpCxrVuPUZV/dskfkiSolY5Lh93intUgM7d/Nb5oJ34ygqqtgXOHXZ8mrjOVuGU\n" + + "xd/NBqsx/vHpxxxeekBfu8rhI1h7M7XLBHL4s30CgYEAnmwpLxK36H4fyg3FT5uS\n" + + "nCJuWFIP8LvWaPm8iDUJ45flOPbXokoV+UZbe7A+TK6tdyTXtfoM59/IsLtiEp7n\n" + + "VuE9osST2ZOTD+l10ukIcjJJgI/Pwjtd36EGXyGftdAtT4sFMRxP4sGSXZodqHrZ\n" + + "T9fE4yY/E4FyzS7yMeoXIyo=" + ), + rsa_pss_rsae_sha512( + "RSA", + /** + * Signature Algorithm: rsassaPss + * Issuer: CN = root + * Validity Not Before: Jun 7 08:05:27 2018 GMT + * Not After : Jun 2 08:05:27 2038 GMT + * Subject: CN = root + * Public Key Algorithm: rsassaPss + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDXDCCAhOgAwIBAgIUUpFAFfaMrxI32lmRz/42b2V23C8wPgYJKoZIhvcNAQEK\n" + + "MDGgDTALBglghkgBZQMEAgOhGjAYBgkqhkiG9w0BAQgwCwYJYIZIAWUDBAIDogQC\n" + + "AgC+MA8xDTALBgNVBAMMBHJvb3QwHhcNMTgwNjA3MDgwNTI3WhcNMzgwNjAyMDgw\n" + + "NTI3WjAPMQ0wCwYDVQQDDARyb290MIIBIDALBgkqhkiG9w0BAQoDggEPADCCAQoC\n" + + "ggEBAMDE8lSB3tzeRr1GW/A1hU+n1zErrqNBjOm/mW2k+eUqfRnCnga9Li82/rA0\n" + + "5nSxWb9vHY4M7dr82lhNBt/AdQB7nkDmD1BDWnuQuDTrhIFTvHjh802KUJT8sz/G\n" + + "xXMXYxvK7kQPIuW+1xNxZirwnwLLZ7uo7WlvFqgMsYPJQ2+qREWRBgsj2BiDs90x\n" + + "2Cc7YqRBAMglmT/NsqJoK7RZqAfhLEn1KYSkou7C4Fx32qc4RQGuUQzfTXMX1UGT\n" + + "fjU1i7IcY0eY1Ed+VFPUI6Kl/aeFSfal+/Lz2siq8CT2fLxXwGtM/YtaOdQhCuvV\n" + + "ekmntL7KalQS32f681qaccFTmSUCAwEAAaNQME4wHQYDVR0OBBYEFM1g6dCfIEe1\n" + + "3kE2spDLZe4xbN3KMB8GA1UdIwQYMBaAFM1g6dCfIEe13kE2spDLZe4xbN3KMAwG\n" + + "A1UdEwQFMAMBAf8wPgYJKoZIhvcNAQEKMDGgDTALBglghkgBZQMEAgOhGjAYBgkq\n" + + "hkiG9w0BAQgwCwYJYIZIAWUDBAIDogQCAgC+A4IBAQAMa7OlZheye0Km/f4+95St\n" + + "WXWYUhMuBHo2G/goFhCFEYtHiJa2B/e+14lPq+95xMLJ8kQRxQolG/brOIDeUwdx\n" + + "85Pqfx50UnoZUhE+d5iJAJPHiS5aUoYa1Nxu7pw7eC402imkZt/P5OmPU1B9LTql\n" + + "Mizo7guIVyXOXE11iOSFXfUk3q0XxErBzEIQmZDQjbv2idWPuTJV5G/Mo3dm+Oiq\n" + + "6JTWKzCMp2pMFvUllP0FNEzIc1Q5qTkwFCzf8d5NLVa143kWuU0G9VbAjAJaEEfa\n" + + "PUlfJQzkEKn0MsGWkpYMepbF4z7FB37jrLaHgHZvxpX1dXg8NWOqBXGSD154hzpf\n" + + "-----END CERTIFICATE-----\n", + /** + * Signature Algorithm: rsassaPss + * Issuer: CN = root + * Validity Not Before: Jun 7 08:05:27 2018 GMT + * Not After : Jun 2 08:05:27 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsaEncryption + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIID8DCCAqegAwIBAgIUP97IqgwiXunHNhSojyU10fxkvz0wPgYJKoZIhvcNAQEK\n" + + "MDGgDTALBglghkgBZQMEAgOhGjAYBgkqhkiG9w0BAQgwCwYJYIZIAWUDBAIDogQC\n" + + "AgC+MA8xDTALBgNVBAMMBHJvb3QwHhcNMTgwNjA3MDgwNTI3WhcNMzgwNjAyMDgw\n" + + "NTI3WjAUMRIwEAYDVQQDDAlsb2NhbGhvc3QwggEiMA0GCSqGSIb3DQEBAQUAA4IB\n" + + "DwAwggEKAoIBAQDCyeGmgpaHoXnRcsuhMhzsoinxDqSCHfJB62g0HuZDpZG3yjlE\n" + + "U9zVTLeuCtWsrQnC0LCaNODjjvE9vI1tbY5L7B1pz3JNHrASzituzd3vPNlKjX5f\n" + + "EUG4dBEOIx0UvwTDlf8taL897aLRmUHKE29qPV3Xo80M794CdQsUSq/sNQDkE1qF\n" + + "m7MAmznXTS++RUqtofyz4W570KBwfM9pO4hFd20JvjkumadXY1dJbt99LyO3LVZd\n" + + "QsztBe5meWElFcQJj/GdkSGFlrEGpePgwQ6U5MCrWDQonX1JX3aIiby4EFZrvdCK\n" + + "r15pBpCEowoV57KDIzkROV2vRyYfjO+E5AUHAgMBAAGjgdwwgdkwCQYDVR0TBAIw\n" + + "ADALBgNVHQ8EBAMCA/gwEwYDVR0lBAwwCgYIKwYBBQUHAwEwHQYDVR0OBBYEFIZl\n" + + "PBtklckudi3unnRw45td3lYOMEoGA1UdIwRDMEGAFM1g6dCfIEe13kE2spDLZe4x\n" + + "bN3KoROkETAPMQ0wCwYDVQQDDARyb290ghRSkUAV9oyvEjfaWZHP/jZvZXbcLzAR\n" + + "BglghkgBhvhCAQEEBAMCBkAwLAYJYIZIAYb4QgENBB8WHU9wZW5TU0wgR2VuZXJh\n" + + "dGVkIENlcnRpZmljYXRlMD4GCSqGSIb3DQEBCjAxoA0wCwYJYIZIAWUDBAIDoRow\n" + + "GAYJKoZIhvcNAQEIMAsGCWCGSAFlAwQCA6IEAgIAvgOCAQEAEAhEFgf7PkNrqB/e\n" + + "IWs6LbXmSWS6h9iv/7m42AsxslBXqvyFLLmKcl8g1yowgUPP3Wp4tBWU8F5OHgbQ\n" + + "KdGJVXsrw+5Dlj5joXUisiEnG10nDr+i6qMx8k0U+K2qzBPTyAGkK5CadY04AquX\n" + + "3EBWnUIzXSX+5quBR94g+okKC+lyiwtoq7uJrIA4I4buikgsKWHNIU/3DqcI54fb\n" + + "ty1bWgW1CP48dShs0phZs8k716L0J9Gfz1fkhb1czAZikcecitt5GrbAUj9GDq1Q\n" + + "1zjvjQiPXaZFXiDVmUUEVUsVDFtEuwiMKRxpprXEWklbQnOcWONCRy3113DdWauX\n" + + "ECtlAw==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDCyeGmgpaHoXnR\n" + + "csuhMhzsoinxDqSCHfJB62g0HuZDpZG3yjlEU9zVTLeuCtWsrQnC0LCaNODjjvE9\n" + + "vI1tbY5L7B1pz3JNHrASzituzd3vPNlKjX5fEUG4dBEOIx0UvwTDlf8taL897aLR\n" + + "mUHKE29qPV3Xo80M794CdQsUSq/sNQDkE1qFm7MAmznXTS++RUqtofyz4W570KBw\n" + + "fM9pO4hFd20JvjkumadXY1dJbt99LyO3LVZdQsztBe5meWElFcQJj/GdkSGFlrEG\n" + + "pePgwQ6U5MCrWDQonX1JX3aIiby4EFZrvdCKr15pBpCEowoV57KDIzkROV2vRyYf\n" + + "jO+E5AUHAgMBAAECggEABOg3Eg3KIwKTYg5lSNtNVTzEl7kJtelxN+3pQx7gKCYc\n" + + "pKeoh6shLhJvsie9uErnqwu81zWr0K/CLg749R/EbO820nqSY5T5VI/zEiiHhcZf\n" + + "pvwnideSc0YhQ9zol6Q0R4UY15kC8FlzN5qHyMJylReUrKEIwmGskx1FuS4kfmvQ\n" + + "JYx7pzrVYAVtktIEz7BSsN9t0Gigtj20DoT8g9W+pcXRxmiLzJ3pYOe8n7oHcZGf\n" + + "cPzT4IYWIHeFfzX6XPoNMUocPU94P/POlRAKYv3vRPqFhHjPq/WCWGhGvAQ7vzKT\n" + + "UNCuFP1FyDGTsD6S/qsBxJ5f8WGYncJAxv6iR0hVOQKBgQDp3nFoEiDdSvfTAabW\n" + + "64y+pp6U1VxjecR9VOpiUQOCriXefyyqgJIVtQI3CM8igMenHQtFBkcQB+GXnl9I\n" + + "2d3a/AOWozFdWWEf+VOcHSo0WY2tqs2WSgiTPzThMLXAfqF0e5SK9nOw5Y8YcQDJ\n" + + "bn+5n7rtjxq3O7SBXGH7sGUJRQKBgQDVOLQ2aSupYraJX7bXFdcI0X/3KuUBQnyp\n" + + "qcDIc4Ho00DhdjTM/Nf3iRZOY0Fv1GOb1Dzp5pKCCuAeiYpEfgNR0aYrAABRrL4+\n" + + "lOZyFvXcueZFPeSuzm17fyNtwgwnG8RlDmXqTSlqnIfEs+wti1cojI2Tpdq8QnCa\n" + + "VcnYFnSr2wKBgANj3BT8HknW6ly+q2J2K6Yf2DCkHyC6BSUj8/nU3s4oJBhjk4wt\n" + + "LPDvnMabdBU19K7xdtZbTvBmjNibzRnLPrIL8Slf2DlYMFY8UP/0VEZJ/gnEbhJ9\n" + + "pD4uLmANSrUtoL2FhRO2mtq3mSlrie1hkqxoKleDOYnqbaVqZ2k0l2JZAoGBALi2\n" + + "JLg2J9LXZxZeyoBNtTk4dEjk6fpLZL9+BTohhlryF3S5+EfUiiswoRhLN/bu4VOv\n" + + "aw2d5zGsxjbuI8/t8mZA3ljF6YDXyv9f8rrHVTpf+THmymL9BS9FFqYQwoJmtZ5t\n" + + "+LAfJE/tRliLHYDfAyRnjoZn2bPZQr8Qroj5+xydAoGACHEc7aoEwZ/z8cnrHuoT\n" + + "T0QUw6HNlic5FgK+bZy7SXj9SqJBkWADzRJ/tVDopWT/EiDiGeqNP/uBPYt6i7m2\n" + + "SoqCLYdGDIbUFyDQg3zC48IXlHyEF3whx0bg/0hoKs/E/rXuxYIH/10aEwmb0FQO\n" + + "GA3T726uW8XrrTssMkhzixU=" + ), + rsa_pss_pss_sha384( + "RSASSA-PSS", + /** + * Signature Algorithm: rsassaPss + * Issuer: CN = localhost + * Validity Not Before: Jun 7 08:06:30 2018 GMT + * Not After : Jun 2 08:06:30 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsassaPss + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDZjCCAh2gAwIBAgIUA5CP0rop4wp/QliNQrIiWzepcncwPgYJKoZIhvcNAQEK\n" + + "MDGgDTALBglghkgBZQMEAgKhGjAYBgkqhkiG9w0BAQgwCwYJYIZIAWUDBAICogQC\n" + + "AgDOMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xODA2MDcwODA2MzBaFw0zODA2\n" + + "MDIwODA2MzBaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASAwCwYJKoZIhvcNAQEK\n" + + "A4IBDwAwggEKAoIBAQDP7X9JUp1rPzcxyzpHOS4jJm/AOhgJC5ueK54wn+ZwxIk4\n" + + "hAjHGDGsUIfxzDmMW7nCxvmw/BV0xfAqCdLRYd1Id9cMuNiPYiDu/LC10rMRbdFl\n" + + "0GQvnaqXGLb0EJETJiEWiYemljswr4E3hzeKk6Z2dXD4WhUl9M+4ACjB5hGDTUD0\n" + + "sKYMMtjRfz1TVUtgnbzqHMc0dZFY7BVCIoOGDtXpZbQTHeuMFt+X6WWoYbpe62S/\n" + + "+lPe1Jj4WqQyRaiJ9wBUvF1jxZughLfggTUH+bIFqKEPTsZTY/GF5Tw0devRbkjr\n" + + "7iiwKWZUqrw0gQNvfpMHkJ20vl88NIUTskx+ehXRAgMBAAGjUDBOMB0GA1UdDgQW\n" + + "BBTk0W52uedFo2XRMmO+vjCb1HxgVTAfBgNVHSMEGDAWgBTk0W52uedFo2XRMmO+\n" + + "vjCb1HxgVTAMBgNVHRMEBTADAQH/MD4GCSqGSIb3DQEBCjAxoA0wCwYJYIZIAWUD\n" + + "BAICoRowGAYJKoZIhvcNAQEIMAsGCWCGSAFlAwQCAqIEAgIAzgOCAQEAMubCeSw/\n" + + "XnF+EYmLt3Vj/1CRbqCG46VUYYGqFsIDB36q2Vate2UMeOMbBXNldNLWS6QWHPhv\n" + + "wJR72OcviVh7twH3qDd6jBzkt6jiwXyeSZeCu7g8p6RhtoUT7pxSm/f7aQ+SQRNT\n" + + "+XX1E4pakzEmyvCzyFzm6i7ol/KhZKI3bycUNMmNldE/TmDAwQLI2I6ld/jlQ4Yl\n" + + "qQd2af1P7T19898EkA0Ka1LYRVNzlAz40rQc9Nw5etq2vuXMg9U229KZvT6qikWD\n" + + "4V4xzTMfn2l+yfrHU6XGUawJoDds1dy03hrveYH90PKboQaPEOAn3MPjNlZF21Dl\n" + + "Ukj3JA+ZxAZmcw==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEvAIBADALBgkqhkiG9w0BAQoEggSoMIIEpAIBAAKCAQEAz+1/SVKdaz83Mcs6\n" + + "RzkuIyZvwDoYCQubniueMJ/mcMSJOIQIxxgxrFCH8cw5jFu5wsb5sPwVdMXwKgnS\n" + + "0WHdSHfXDLjYj2Ig7vywtdKzEW3RZdBkL52qlxi29BCREyYhFomHppY7MK+BN4c3\n" + + "ipOmdnVw+FoVJfTPuAAoweYRg01A9LCmDDLY0X89U1VLYJ286hzHNHWRWOwVQiKD\n" + + "hg7V6WW0Ex3rjBbfl+llqGG6Xutkv/pT3tSY+FqkMkWoifcAVLxdY8WboIS34IE1\n" + + "B/myBaihD07GU2PxheU8NHXr0W5I6+4osClmVKq8NIEDb36TB5CdtL5fPDSFE7JM\n" + + "fnoV0QIDAQABAoIBAGB1eh5G0DaHnhBgikmuUiQGWcNgb/QKSYgoDfvawinAUzQ/\n" + + "tF7Ab5LTzS00I+JkTxn3+q/LUhzZEqA97GosL17GEaKaQgTKbiLQYR4If//u5TyJ\n" + + "X2DjkNcFpSI2aUbr4l+1L5Ptj8n3MUfUV8TW2FuOAfmEuNjh6Fcg48eH9snk/wTI\n" + + "8yvQPODnEaW/9MucySd0LJK3YX+rRa5EG3kJry+FmdMBzaLrCOInq/j1P7wXmlBc\n" + + "6Jpynhu/HzYjbk9s3xqUHckX1+DLfzpIEFqXJF0YjswiV2EEP2YLt2OYDP4X8M2X\n" + + "zfZ4l2ArHcfPZwy2/chui+VAm4bNPsYjDeqMHC0CgYEA+6ujKrhYx8mjiaqmYStR\n" + + "KZvmy5sL3GQEpZ3y6s7JNKW+h6z75USlRQYRGG1L9DRyEtfkuYzvzZwVR+ermGJb\n" + + "XvHIBDdgDmurORHqYGVywfqfo+5KM1GAMeDvBW0LeGoZIYOdno2q/lnNm1kX/g4d\n" + + "VBMiurHeNkOdJXSgNc7EZ6cCgYEA04E3PxU12Xs3N2/ZoEYcAnEm6zbljt8fc/CG\n" + + "gyRfGWb6RzIF9oKmLENhcNWpX+7hk2HsUZmQlmTofF7JwF/UBkySWclNXnO2OQwd\n" + + "AGF+WXQwACVg3S2X/y5Pu+8JpaEJdyahuynSuBmxyjavFBTDkI02Heu5ZSwVN6Fp\n" + + "tYDmxccCgYEA+Kfs3xilH0CqxCpHmVojJulSb3kRjv+DV99nU3hcdBgO2B6iAzR/\n" + + "1mLYITpcATyQOO32nx4RESVWIWVUtYr4nCZnaUMNNTJMSmbZG8UgTWhCssWNqoas\n" + + "EpwbjVDgNGkfy20vHqj6ebRg4Ux12B45/AesGKoE07iaW5ePc5qHk6ECgYBpeSS9\n" + + "1qv1+pY8lRCn9o59QUQxRD0SFH6w6J+LwpWSK2JgIrgKiHip1ig/hq1iY9QmFU0u\n" + + "HDCYb1Xov7RItQEc6w6Iq/RjR7z1ke7cg8HohiJx0DIP2m7UGJo2lCvxZu87dg5t\n" + + "MZwdpuKcfsysbPZhnaoBHc5kf6lNBreahd+PfQKBgQDzZHFUndVfI28zn10ZzY8M\n" + + "zVeUMn+m1Dhp/e4F0t3XPTWCkwlYI3bk0k5BWHYSdLb2R7gKhTMynxPUb53oeY6P\n" + + "Pt/tA+dbjGHPx+v98wOorsD28qH0WG/V1xQdGRA9/dDZtJDolLqNn2B3t0QH9Kco\n" + + "LsJldTLzMQSVP/05BAt6DQ==" + ), + rsa_pss_pss_sha512( + "RSASSA-PSS", + /** + * Signature Algorithm: rsassaPss + * Issuer: CN = localhost + * Validity Not Before: Jun 7 08:07:22 2018 GMT + * Not After : Jun 2 08:07:22 2038 GMT + * Subject: CN = localhost + * Public Key Algorithm: rsassaPss + */ + "-----BEGIN CERTIFICATE-----\n" + + "MIIDZjCCAh2gAwIBAgIUCoYfs6/TS3M2xgZYjN2Ke4LPEOwwPgYJKoZIhvcNAQEK\n" + + "MDGgDTALBglghkgBZQMEAgOhGjAYBgkqhkiG9w0BAQgwCwYJYIZIAWUDBAIDogQC\n" + + "AgC+MBQxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0xODA2MDcwODA3MjJaFw0zODA2\n" + + "MDIwODA3MjJaMBQxEjAQBgNVBAMMCWxvY2FsaG9zdDCCASAwCwYJKoZIhvcNAQEK\n" + + "A4IBDwAwggEKAoIBAQDG/9pbt7MT6Be3aUg94VKQ9BMojLYjBDzM7bd/y07+Lfdd\n" + + "67IUhQ5VkJcxgs7Qtb8ztnUJQEzyLBkcZA/hvvpLUXJUP3UisRNV12MBfHUcFAVN\n" + + "33pdm7X/UJDVadUZTAfe6PUIuk/+ZpOmTnwE/sEfhCZAtNwm+08EdysUhK9aVl83\n" + + "vC+eEj22584Vzd2fQj9YYU1hN0OKWvavrHvc3XCjam15UCWBZa1ujXnjOtYkPDE6\n" + + "0C/BS+WE/GtLGGc04O410/ezvs/M66RdlMFJRBLW3F9grL2oG41CmoLzFaPL6AOD\n" + + "W2EYBf094uvreR7mDlr8MCmig4+IHCpdwmbbYrhjAgMBAAGjUDBOMB0GA1UdDgQW\n" + + "BBSZnv73VPYJzx4m2n0xIYHRL+avKDAfBgNVHSMEGDAWgBSZnv73VPYJzx4m2n0x\n" + + "IYHRL+avKDAMBgNVHRMEBTADAQH/MD4GCSqGSIb3DQEBCjAxoA0wCwYJYIZIAWUD\n" + + "BAIDoRowGAYJKoZIhvcNAQEIMAsGCWCGSAFlAwQCA6IEAgIAvgOCAQEAeHFMR7gi\n" + + "hcd7acEBc4Qw+JCH81+8PAwfCH+7uMbLronUDmHPgeMckNvGGEFenDDp+pqnpiFN\n" + + "pKdDpelv4lkE72gFGVpEGlrCjVrwJSyPR26Dju9Nx+WQCQIiTUGd03fBgxb+rh5U\n" + + "kvauleAa7Xb0TkpWawfe2RadfAwSHcdwYGVA5Rh1dTfn5Chz8fdt5y6tFcLnJpgY\n" + + "tvHk5Z5hFTgsDpdTv/aKcUypsQDnBmCaAot3S9ks3FBea/g/ACrqi/Td8OaHr9/W\n" + + "wLnBvPtd++XvAFMaZKrMfjIzlmQyHfLQ/4EA9PPOK9DqBkUcnvcSLH6TL57yoDB6\n" + + "h6/Ppk90DH6vhA==\n" + + "-----END CERTIFICATE-----\n", + // + // Private key. + // + "MIIEvAIBADALBgkqhkiG9w0BAQoEggSoMIIEpAIBAAKCAQEAxv/aW7ezE+gXt2lI\n" + + "PeFSkPQTKIy2IwQ8zO23f8tO/i33XeuyFIUOVZCXMYLO0LW/M7Z1CUBM8iwZHGQP\n" + + "4b76S1FyVD91IrETVddjAXx1HBQFTd96XZu1/1CQ1WnVGUwH3uj1CLpP/maTpk58\n" + + "BP7BH4QmQLTcJvtPBHcrFISvWlZfN7wvnhI9tufOFc3dn0I/WGFNYTdDilr2r6x7\n" + + "3N1wo2pteVAlgWWtbo154zrWJDwxOtAvwUvlhPxrSxhnNODuNdP3s77PzOukXZTB\n" + + "SUQS1txfYKy9qBuNQpqC8xWjy+gDg1thGAX9PeLr63ke5g5a/DApooOPiBwqXcJm\n" + + "22K4YwIDAQABAoIBADoeFuOabs5thh+mu9Z2q+pxnfbFwZvQbQFcm67S7asGOaxQ\n" + + "XZ3ojhsnM0DedxA1RDYSH3QoN1Cy2FKWVp0TbX35t24rakZLeN4lHWEdvAYLQtFP\n" + + "ZylXhHugR+xMEFRnBBVx6740y4/83TpAya+bx0MxEQrsxy8LTjR7qTVA2wWCmDur\n" + + "n2wzt7axGGBWq0/4n62aRszhAYDVIa6EXI2UAcGQwdWuw4iiVRjdEVc6I/W3GA62\n" + + "a+RlhA1LPcNkAiONVoVhBCFxSZq+ERuupS31mVjbGEDlOUDw0XfrJb3n4ekXbN4C\n" + + "6EHCbBA6DPr9FrMT6dgqpTfnsF26rQp2kgLrngECgYEA6UpueG7YvwQxi+vq3tGS\n" + + "7FldARE2obWrGDVbm+WA1TlnOwQDyCZPTSYFtNkBoqZtFzVZsM8mjYu8vDnrCuVN\n" + + "DmthBwbH2LYQXVXeZhaZVCF6QWP77OWLrlEVlhbHHG0xdgzgP5cNJWe56JpQZW3C\n" + + "GIbmmsSE8jIYgjh5MBAxlSMCgYEA2l7jGeUw/U017FRg/mTFbLM74Tc7/GHyVinF\n" + + "MouM+v+erXoNRXL6KH43RoHbiFhfDD9e67pu2O0BsHn2BUV5GKAi4hcyoYqi1h7h\n" + + "oGtk1DyFCcOV+6NzUqe72RrTv1868K/j2sRmfqtU3gNlKFId+CUVYGUEjK2pNDHd\n" + + "IvqEo8ECgYApqoKKffm2PBCBVhRv0Wx1TAyhWSqxvRmezEDdWiMlcggu8Sufvr/h\n" + + "Ho5cW3nATAsl3wBy5LyVAUUnNQz2uDeIAMOmlp5w5SuND/4Vq6mc7hHAxhPDnsfQ\n" + + "zWiWkuDjAdmYpPoUQW02pgz9Lzp2syC8crOTJtA71ZitAVsbq3i/kwKBgQC550ft\n" + + "drnTGxVKAbelO0L7vEbBABXYUcZOZjcURcuar112EE8WDcE8Ed+a7dhoZdtdAOId\n" + + "StUtZfAnPl0ctb1XIpUv51HaRr1EDnxE5sirCm60FkcsOEVoW5XHSVh1NmxmFUek\n" + + "qckcE14nt7o5rlcHNwLQ0o8h+IHxBnZdXernwQKBgQCunOWvYd7MGlIjpkl6roq7\n" + + "MrQ/zaAkUyGsTgBxEu3p5+x2ENG6SukEtHGGDE6TMxlcKdTSohL2lXZX2AkP+eXf\n" + + "sF3h66iQ8DrGrYoyCgx3KTx3G+KPfblAqwDMTqj2G5fAeWDwXrpEacpTXiFZvNAn\n" + + "KtqEurWf+mUeJVzLj1x1BA==" + ); + + private final String keyType; + private final String trustedCert; + private final String endCert; + private final String privateKey; + + private KeyType(String keyType, String trustedCert, String endCert, + String privateKey) { + this.keyType = keyType; + this.trustedCert = trustedCert; + this.endCert = endCert; + this.privateKey = privateKey; + } + + private KeyType(String keyType, String selfCert, String privateKey) { + this(keyType, selfCert, selfCert, privateKey); + } + + public String getKeyType() { + return keyType; + } + + public String getTrustedCert() { + return trustedCert; + } + + public String getEndCert() { + return endCert; + } + + public String getPrivateKey() { + return privateKey; + } + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/TLSv12/DisabledShortDSAKeys.java openjdk-11-11~24/test/jdk/javax/net/ssl/TLSv12/DisabledShortDSAKeys.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/TLSv12/DisabledShortDSAKeys.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/TLSv12/DisabledShortDSAKeys.java 2018-07-25 15:36:46.000000000 +0000 @@ -289,8 +289,14 @@ volatile Exception clientException = null; public static void main(String[] args) throws Exception { - if (debug) + Security.setProperty("jdk.certpath.disabledAlgorithms", + "DSA keySize < 1024"); + Security.setProperty("jdk.tls.disabledAlgorithms", + "DSA keySize < 1024"); + + if (debug) { System.setProperty("javax.net.debug", "all"); + } /* * Get the customized arguments. diff -Nru openjdk-11-11~19/test/jdk/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java openjdk-11-11~24/test/jdk/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java --- openjdk-11-11~19/test/jdk/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/net/ssl/TLSv12/DisabledShortRSAKeys.java 2018-07-25 15:36:46.000000000 +0000 @@ -238,8 +238,14 @@ } public static void main(String[] args) throws Exception { - if (debug) + Security.setProperty("jdk.certpath.disabledAlgorithms", + "RSA keySize < 1024"); + Security.setProperty("jdk.tls.disabledAlgorithms", + "RSA keySize < 1024"); + + if (debug) { System.setProperty("javax.net.debug", "all"); + } /* * Get the customized arguments. diff -Nru openjdk-11-11~19/test/jdk/javax/sound/sampled/Clip/AutoCloseTimeCheck.java openjdk-11-11~24/test/jdk/javax/sound/sampled/Clip/AutoCloseTimeCheck.java --- openjdk-11-11~19/test/jdk/javax/sound/sampled/Clip/AutoCloseTimeCheck.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/sound/sampled/Clip/AutoCloseTimeCheck.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,128 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.applet.AudioClip; +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.nio.file.Files; +import java.util.concurrent.TimeUnit; + +import javax.sound.sampled.AudioFileFormat.Type; +import javax.sound.sampled.AudioFormat; +import javax.sound.sampled.AudioInputStream; +import javax.sound.sampled.AudioSystem; + +import static javax.sound.sampled.AudioFormat.Encoding.PCM_SIGNED; +import static javax.sound.sampled.AudioSystem.NOT_SPECIFIED; + +/** + * @test + * @bug 8202264 + */ +public final class AutoCloseTimeCheck { + + public static void main(final String[] args) throws Exception { + // Prepare the audio file + File file = new File("audio.wav"); + try { + AudioFormat format = + new AudioFormat(PCM_SIGNED, 44100, 8, 1, 1, 44100, false); + AudioSystem.write(getStream(format), Type.WAVE, file); + } catch (final Exception ignored) { + return; // the test is not applicable + } + try { + testSmallDelay(file); + testBigDelay(file); + } finally { + Files.delete(file.toPath()); + } + } + + /** + * Checks that after a big period of non-activity the clip will be closed + * and the "Direct Clip" thread will stop. + */ + private static void testBigDelay(final File file) throws Exception { + AudioClip clip = (AudioClip) file.toURL().getContent(); + clip.loop(); + clip.stop(); + sleep(20000); // 20 sec for slow systems + if (count() != 0) { + throw new RuntimeException("Thread was found"); + } + } + + /** + * Checks that after small period of non-activity the clip will not be + * closed and the "Direct Clip" thread will alive. + */ + private static void testSmallDelay(final File file) throws IOException { + AudioClip clip = (AudioClip) file.toURL().getContent(); + long threadID = 0; + // Will run the test no more than 15 seconds + long endtime = System.nanoTime() + TimeUnit.SECONDS.toNanos(15); + while (endtime - System.nanoTime() > 0) { + clip.loop(); + sleep(500); + + long data = count(); + if (data != threadID) { + System.out.println("Playing on new thread: " + data + " at " + + new java.util.Date()); + if (threadID == 0) { + threadID = data; + } else { + throw new RuntimeException("Thread was changed"); + } + } + + clip.stop(); + sleep(500); + } + } + + private static void sleep(int millis) { + try { + Thread.sleep(millis); + } catch (InterruptedException ignored) { + } + } + + private static long count() { + for (final Thread t : Thread.getAllStackTraces().keySet()) { + if (t.getName().equals("Direct Clip")) { + return t.getId(); + } + } + return 0; + } + + private static AudioInputStream getStream(final AudioFormat format) { + final int dataSize = 5000 * format.getFrameSize(); + final InputStream in = new ByteArrayInputStream(new byte[dataSize]); + return new AudioInputStream(in, format, NOT_SPECIFIED); + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/event/RightAltKeyTest.java openjdk-11-11~24/test/jdk/javax/swing/event/RightAltKeyTest.java --- openjdk-11-11~19/test/jdk/javax/swing/event/RightAltKeyTest.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/event/RightAltKeyTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @key headful + * @bug 8194873 + * @requires (os.family == "Windows") + * @summary Checks that right ALT (ALT_GRAPH) key works on Swing components + * @run main RightAltKeyTest + */ + +import javax.swing.JFrame; +import javax.swing.JMenu; +import javax.swing.JMenuBar; +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.JTabbedPane; +import javax.swing.JTextField; +import javax.swing.JLabel; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.KeyStroke; +import javax.swing.event.MenuEvent; +import javax.swing.event.MenuListener; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.FocusEvent; +import java.awt.event.FocusListener; +import java.awt.event.InputEvent; +import java.awt.event.KeyEvent; +import java.awt.GridLayout; +import java.awt.Robot; +import java.lang.reflect.InvocationTargetException; + +public class RightAltKeyTest { + + boolean action = false; + JFrame frame; + + void testJMenu() { + frame = new JFrame("Menu Frame"); + JMenuBar mb = new JMenuBar(); + JMenu m1 = new JMenu("File"); + JMenuItem i1 = new JMenuItem("Save"); + JMenuItem i2 = new JMenuItem("Load"); + + m1.setMnemonic(KeyEvent.VK_F); + + m1.addMenuListener(new MenuListener() { + @Override + public void menuSelected(MenuEvent e) { + action = true; + disposeUI(); + } + + @Override + public void menuDeselected(MenuEvent e) { + } + + @Override + public void menuCanceled(MenuEvent e) { + } + }); + + frame.setJMenuBar(mb); + mb.add(m1); + m1.add(i1); + m1.add(i2); + + frame.setSize(200, 200); + frame.setVisible(true); + } + + void testJMenuItem() { + frame = new JFrame("Menu Frame"); + JMenuBar mb = new JMenuBar(); + JMenu m1 = new JMenu("File"); + JMenuItem i1 = new JMenuItem("Save"); + i1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S, + InputEvent.ALT_GRAPH_DOWN_MASK)); + i1.addActionListener((e) -> { + action = true; + disposeUI(); + }); + + frame.setJMenuBar(mb); + mb.add(m1); + m1.add(i1); + + frame.setSize(200, 200); + frame.setVisible(true); + } + + void testJOptionPane() { + int selection = JOptionPane.showConfirmDialog(null, "Do you wish " + + "to save file?","Confirm", JOptionPane.YES_NO_CANCEL_OPTION); + //Pressed Yes + if (selection == 0) { + action = true; + } + } + + void testJTabbedPane() { + frame =new JFrame(); + JPanel p1=new JPanel(); + JPanel p2=new JPanel(); + JTabbedPane tp=new JTabbedPane(); + tp.add("Main",p1); + tp.add("Visit",p2); + tp.setMnemonicAt(0, KeyEvent.VK_M); + tp.setMnemonicAt(1, KeyEvent.VK_V); + + tp.addChangeListener((e) -> { + if (tp.getSelectedIndex() == 1) + action = true; + disposeUI(); + }); + + frame.add(tp); + frame.setSize(200,200); + frame.setVisible(true); + } + + void testJTextArea() { + JTextField firstField = new JTextField(10); + JTextField lastField = new JTextField(10); + + JLabel firstLabel = new JLabel("First Name", JLabel.RIGHT); + firstLabel.setDisplayedMnemonic('F'); + firstLabel.setLabelFor(firstField); + + JLabel lastLabel = new JLabel("Last Name", JLabel.RIGHT); + lastLabel.setDisplayedMnemonic('L'); + lastLabel.setLabelFor(lastField); + + JPanel p = new JPanel(); + p.setLayout(new GridLayout(2, 2, 5, 5)); + p.add(firstLabel); + p.add(firstField); + p.add(lastLabel); + p.add(lastField); + + frame = new JFrame("MnemonicLabels"); + lastField.addFocusListener(new FocusListener() { + @Override + public void focusGained(FocusEvent e) { + action = true; + disposeUI(); + } + + @Override + public void focusLost(FocusEvent e) { + + } + }); + + frame.add(p); + frame.setSize(200,200); + frame.setVisible(true); + } + + void test() throws Exception { + UIManager.LookAndFeelInfo[] lookAndFeels = UIManager + .getInstalledLookAndFeels(); + for (UIManager.LookAndFeelInfo lookAndFeel : lookAndFeels) { + UIManager.setLookAndFeel(lookAndFeel.getClassName()); + + Robot robot = new Robot(); + robot.setAutoDelay(100); + robot.waitForIdle(); + + action = false; + SwingUtilities.invokeLater(this::testJMenu); + robot.waitForIdle(); + robot.keyPress(KeyEvent.VK_ALT_GRAPH); + robot.keyPress(KeyEvent.VK_F); + robot.keyRelease(KeyEvent.VK_F); + robot.keyRelease(KeyEvent.VK_ALT_GRAPH); + robot.waitForIdle(); + if (!action) + errLog("JMenu", lookAndFeel.getClassName()); + + action = false; + SwingUtilities.invokeLater(this::testJMenuItem); + robot.waitForIdle(); + robot.keyPress(KeyEvent.VK_ALT_GRAPH); + robot.keyPress(KeyEvent.VK_S); + robot.keyRelease(KeyEvent.VK_S); + robot.keyRelease(KeyEvent.VK_ALT_GRAPH); + robot.waitForIdle(); + if (!action) + errLog("JMenuItem", lookAndFeel.getClassName()); + + action = false; + SwingUtilities.invokeLater(this::testJOptionPane); + robot.waitForIdle(); + robot.keyPress(KeyEvent.VK_ALT_GRAPH); + robot.keyPress(KeyEvent.VK_Y); + robot.keyRelease(KeyEvent.VK_Y); + robot.keyRelease(KeyEvent.VK_ALT_GRAPH); + robot.waitForIdle(); + if (!action) + errLog("JOptionPane", lookAndFeel.getClassName()); + + action = false; + SwingUtilities.invokeLater(this::testJTabbedPane); + robot.waitForIdle(); + robot.keyPress(KeyEvent.VK_ALT_GRAPH); + robot.keyPress(KeyEvent.VK_V); + robot.keyRelease(KeyEvent.VK_V); + robot.keyRelease(KeyEvent.VK_ALT_GRAPH); + robot.waitForIdle(); + if (!action) + errLog("JTabbedPane", lookAndFeel.getClassName()); + + action = false; + SwingUtilities.invokeLater(this::testJTextArea); + robot.waitForIdle(); + robot.keyPress(KeyEvent.VK_ALT_GRAPH); + robot.keyPress(KeyEvent.VK_L); + robot.keyRelease(KeyEvent.VK_L); + robot.keyRelease(KeyEvent.VK_ALT_GRAPH); + robot.waitForIdle(); + if (!action) + errLog("JTextArea", lookAndFeel.getClassName()); + } + System.out.println("Passed."); + } + + void disposeUI() { + frame.setVisible(false); + frame.dispose(); + } + + void errLog(String componentName, String lookAndFeel) + throws InvocationTargetException, InterruptedException + { + SwingUtilities.invokeAndWait(this::disposeUI); + throw new RuntimeException("Actions are not performed for "+ + componentName + " with " + lookAndFeel + " look and feel."); + } + + public static void main(String[] args) throws Exception { + RightAltKeyTest t = new RightAltKeyTest(); + t.test(); + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/GraphicsConfigNotifier/OrderOfGConfigNotify.java openjdk-11-11~24/test/jdk/javax/swing/GraphicsConfigNotifier/OrderOfGConfigNotify.java --- openjdk-11-11~19/test/jdk/javax/swing/GraphicsConfigNotifier/OrderOfGConfigNotify.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/GraphicsConfigNotifier/OrderOfGConfigNotify.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.EventQueue; +import java.util.concurrent.atomic.AtomicBoolean; + +import javax.swing.JFrame; +import javax.swing.JPanel; + +/** + * @test + * @key headful + * @bug 8201552 + * @summary Container should get "graphicsConfiguration" notification when all + * its children are updated + */ +public final class OrderOfGConfigNotify { + + private static String name = "graphicsConfiguration"; + + public static void main(final String[] args) throws Exception { + EventQueue.invokeAndWait(() -> { + AtomicBoolean parentCalled = new AtomicBoolean(false); + AtomicBoolean childCalled = new AtomicBoolean(false); + + JFrame frame = new JFrame(); + + JPanel parent = new JPanel(); + parent.addPropertyChangeListener(evt -> { + if (!evt.getPropertyName().equals(name)) { + return; + } + if (!childCalled.get()) { + throw new RuntimeException("Parent is called/child is not"); + } + parentCalled.set(true); + if (parent.getGraphicsConfiguration() == null) { + throw new RuntimeException("GraphicsConfiguration is null"); + } + }); + JPanel child = new JPanel(); + child.addPropertyChangeListener(evt -> { + if (!evt.getPropertyName().equals(name)) { + return; + } + childCalled.set(true); + if (child.getGraphicsConfiguration() == null) { + throw new RuntimeException("GraphicsConfiguration is null"); + } + }); + parent.add(child); + + // Frame.add() should update graphicsConfiguration for all hierarchy + frame.add(parent); + if (!parentCalled.get() || !childCalled.get()) { + throw new RuntimeException("Property listener was not called"); + } + }); + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/GraphicsConfigNotifier/StalePreferredSize.java openjdk-11-11~24/test/jdk/javax/swing/GraphicsConfigNotifier/StalePreferredSize.java --- openjdk-11-11~19/test/jdk/javax/swing/GraphicsConfigNotifier/StalePreferredSize.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/GraphicsConfigNotifier/StalePreferredSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,212 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.Component; +import java.awt.Dimension; +import java.awt.EventQueue; +import java.awt.FlowLayout; +import java.awt.Font; +import java.util.List; +import java.util.Objects; +import java.util.concurrent.Callable; + +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JComboBox; +import javax.swing.JEditorPane; +import javax.swing.JFormattedTextField; +import javax.swing.JFrame; +import javax.swing.JLabel; +import javax.swing.JList; +import javax.swing.JMenu; +import javax.swing.JMenuItem; +import javax.swing.JRadioButton; +import javax.swing.JScrollPane; +import javax.swing.JSpinner; +import javax.swing.JTable; +import javax.swing.JTextArea; +import javax.swing.JTextField; +import javax.swing.JToolTip; +import javax.swing.JTree; +import javax.swing.SpinnerListModel; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.tree.DefaultMutableTreeNode; + +import static javax.swing.UIManager.getInstalledLookAndFeels; + +/** + * @test + * @key headful + * @bug 8201552 + * @summary Initial layout of the component should use correct graphics config. + * It is checked by SwingUtilities.updateComponentTreeUI(), if layout + * was correct the call to updateComponentTreeUI() will be no-op. + * @compile -encoding utf-8 StalePreferredSize.java + * @run main/othervm/timeout=200 StalePreferredSize + * @run main/othervm/timeout=200 -Dsun.java2d.uiScale=1 StalePreferredSize + * @run main/othervm/timeout=200 -Dsun.java2d.uiScale=2.25 StalePreferredSize + */ +public final class StalePreferredSize { + + // Some text to be tested + static final String TEXT[] = new String[]{ + "A few words to get started before the " + + "bugoverlapping text", + "A quick brown fox jumps over the lazy dog", + "El veloz murciélago hindú comía feliz cardillo y kiwi. La cigüeña " + + "tocaba el saxofón detrás del palenque de paja", + "Voix ambiguë d’un cœur qui au zéphyr préfère les jattes de kiwis", + "다람쥐 헌 쳇바퀴에 타고파", + "Съешь ещё этих мягких французских булок да выпей же чаю"}; + + static JFrame frame; + static Component component; + static int typeFont = 0; // 0 - default, 1 - bold, 2 - italic + + public static void main(final String[] args) throws Exception { + for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) { + EventQueue.invokeAndWait(() -> setLookAndFeel(laf)); + for (typeFont = 0; typeFont < 3; typeFont++) { + System.err.println("typeFont = " + typeFont); + for (final boolean html : new boolean[]{true, false}) { + for (String text : TEXT) { + if (html) { + text = "" + text + ""; + } + test(text); + } + } + } + } + } + + private static void test(String text) throws Exception { + System.err.println("text = " + text); + // Each Callable create a component to be tested + final List> comps = List.of( + () -> new JLabel(text), + () -> new JButton(text), + () -> new JMenuItem(text), + () -> new JMenu(text), + () -> new JList<>(new String[]{text}), + () -> new JComboBox<>(new String[]{text}), + () -> new JTextField(text), + () -> new JTextArea(text), + () -> new JCheckBox(text), + () -> new JFormattedTextField(text), + () -> new JRadioButton(text), + () -> new JTree(new DefaultMutableTreeNode(text)), + () -> new JSpinner(new SpinnerListModel(new String[]{text})), + () -> { + JToolTip tip = new JToolTip(); + tip.setTipText(text); + return tip; + }, + () -> { + JEditorPane pane = new JEditorPane(); + pane.setText(text); + return pane; + }, + () -> { + JTable table = new JTable(1, 1); + table.getModel().setValueAt(text, 0, 0); + return table; + } + ); + + for (final Callable creator : comps) { + checkComponent(creator); + } + } + + static void checkComponent(Callable creator) throws Exception { + EventQueue.invokeAndWait(() -> { + + try { + component = creator.call(); + } catch (Exception e) { + throw new RuntimeException(e); + } + + Font font = component.getFont(); + if (typeFont == 1) { + component.setFont(new Font(font.deriveFont(Font.BOLD).getAttributes())); + } + if (typeFont == 2) { + component.setFont(new Font(font.deriveFont(Font.ITALIC).getAttributes())); + } + + frame = new JFrame(); + frame.setLayout(new FlowLayout()); + frame.add(new JScrollPane(component)); + frame.setSize(300, 100); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + }); + + EventQueue.invokeAndWait(() -> { + + // After the frame was shown we change nothing, so current layout + // should be optimal and updateComponentTreeUI() should be no-op + Dimension before = component.getPreferredSize(); + SwingUtilities.updateComponentTreeUI(frame); + Dimension after = component.getPreferredSize(); + + // We change the font size to some big value, as a result the + // layout and preferredSize of the component should be changed + component.setFont(component.getFont().deriveFont(35f)); + Dimension last = component.getPreferredSize(); + + frame.dispose(); + + if (!Objects.equals(before, after)) { + System.err.println("Component: " + component); + System.err.println("Before: " + before); + System.err.println("After: " + after); + throw new RuntimeException("Wrong PreferredSize"); + } + // TODO JDK-8206024 +// if (Objects.equals(after, last)) { +// System.err.println("Component: " + component); +// System.err.println("After: " + after); +// System.err.println("Last: " + last); +// throw new RuntimeException("Wrong PreferredSize"); +// } + }); + } + + private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) { + try { + UIManager.setLookAndFeel(laf.getClassName()); + System.err.println("LookAndFeel: " + laf.getClassName()); + } catch (final UnsupportedLookAndFeelException ignored) { + System.err.println( + "Unsupported LookAndFeel: " + laf.getClassName()); + } catch (ClassNotFoundException | InstantiationException | + IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/GraphicsConfigNotifier/TestSingleScreenGConfigNotify.java openjdk-11-11~24/test/jdk/javax/swing/GraphicsConfigNotifier/TestSingleScreenGConfigNotify.java --- openjdk-11-11~19/test/jdk/javax/swing/GraphicsConfigNotifier/TestSingleScreenGConfigNotify.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/GraphicsConfigNotifier/TestSingleScreenGConfigNotify.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.EventQueue; +import java.awt.GraphicsConfiguration; +import java.util.Objects; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; + +import javax.swing.JButton; +import javax.swing.JFrame; + +/** + * @test + * @key headful + * @bug 8201552 + * @summary Verifies if graphicsConfiguration property notification is sent + * when frame is shown on the screen. + * @run main TestSingleScreenGConfigNotify + * @run main/othervm -Dsun.java2d.uiScale=2.25 TestSingleScreenGConfigNotify + */ +public final class TestSingleScreenGConfigNotify { + + private static String name = "graphicsConfiguration"; + private static CountDownLatch go = new CountDownLatch(1); + private static JFrame frame; + private static GraphicsConfiguration after; + private static GraphicsConfiguration before; + private static JButton button; + + public static void main(final String[] args) throws Exception { + EventQueue.invokeAndWait(() -> { + frame = new JFrame(); + + frame.setSize(300,300); + frame.setLocationRelativeTo(null); + button = new JButton(); + button.addPropertyChangeListener(evt -> { + if (evt.getPropertyName().equals(name)) { + go.countDown(); + } + }); + + before = button.getGraphicsConfiguration(); + + frame.add(button); + frame.setVisible(true); + }); + + boolean called = go.await(10, TimeUnit.SECONDS); + + EventQueue.invokeAndWait(() -> { + after = button.getGraphicsConfiguration(); + frame.dispose(); + }); + + if (Objects.equals(before, after) && called) { + throw new RuntimeException("propertyChange() should not be called"); + } + if (!Objects.equals(before, after) && !called) { + throw new RuntimeException("propertyChange() should be called"); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java openjdk-11-11~24/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java --- openjdk-11-11~19/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/JEditorPane/8195095/ImageViewTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,7 +24,7 @@ /** * @test * @key headful - * @bug 8195095 + * @bug 8195095 8206238 * @summary Tests if Images are scaled correctly in JEditorPane. * @run main ImageViewTest */ @@ -40,22 +40,16 @@ public class ImageViewTest { - private static final int WIDTH = 200; - private static final int HEIGHT = 200; private static JFrame f; - private static JEditorPane editorPane1; - private static JEditorPane editorPane2; - private static JEditorPane editorPane3; - private static JEditorPane editorPane4; - - private static void test(Robot r, JEditorPane editorPane) throws Exception { + private static void test(Robot r, JEditorPane editorPane, + final int WIDTH, final int HEIGHT ) throws Exception { SwingUtilities.invokeAndWait(() -> { f = new JFrame(); editorPane.setEditable(false); f.add(editorPane); - f.setSize(220,240); + f.setSize(WIDTH + 20, HEIGHT + 40); f.setLocationRelativeTo(null); f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); @@ -109,34 +103,78 @@ Robot r = new Robot(); + final JEditorPane[] editorPanes = new JEditorPane[11]; + SwingUtilities.invokeAndWait(() -> { - editorPane1 = new JEditorPane("text/html", + editorPanes[0] = new JEditorPane("text/html", " setLookAndFeel(laf)); - SwingUtilities.invokeAndWait(new bug6421058()); - } - } - - @Override - public void run() { - final JFrame mainFrame = new JFrame(); - try { - testDefaultFont(mainFrame); - } finally { - mainFrame.dispose(); - } - } - - private static void testDefaultFont(final JFrame frame) { - frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - - JSpinner spinner = new JSpinner(); - frame.add(spinner); - frame.setSize(300, 100); - frame.setVisible(true); - - final DefaultEditor editor = (DefaultEditor) spinner.getEditor(); - final Font editorFont = editor.getTextField().getFont(); - - /* - * Validate that the font of the text field is changed to the - * font of JSpinner if the font of text field was not set by the - * user. - */ - - if (!(editorFont instanceof UIResource)) { - throw new RuntimeException("Font must be UIResource"); - } - if (!editorFont.equals(spinner.getFont())) { - throw new RuntimeException("Wrong FONT"); - } - } - - private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) { - try { - UIManager.setLookAndFeel(laf.getClassName()); - } catch (ClassNotFoundException | InstantiationException | - UnsupportedLookAndFeelException | IllegalAccessException e) { - throw new RuntimeException(e); - } - } -} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontByDefault.java openjdk-11-11~24/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontByDefault.java --- openjdk-11-11~19/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontByDefault.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontByDefault.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @key headful + * @bug 6421058 + * @summary Verify font of the text field is changed to the font of + * JSpinner if the font of text field was NOT set by the user + */ + +import java.awt.Font; +import javax.swing.JFrame; +import javax.swing.JSpinner; +import javax.swing.JSpinner.DefaultEditor; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.plaf.UIResource; +import static javax.swing.UIManager.getInstalledLookAndFeels; + +public class FontByDefault implements Runnable { + + public static void main(final String[] args) throws Exception { + for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) { + SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); + SwingUtilities.invokeAndWait(new FontByDefault()); + } + } + + @Override + public void run() { + final JFrame mainFrame = new JFrame(); + try { + testDefaultFont(mainFrame); + } finally { + mainFrame.dispose(); + } + } + + private static void testDefaultFont(final JFrame frame) { + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + + JSpinner spinner = new JSpinner(); + frame.add(spinner); + frame.setSize(300, 100); + frame.setVisible(true); + + final DefaultEditor editor = (DefaultEditor) spinner.getEditor(); + final Font editorFont = editor.getTextField().getFont(); + + /* + * Validate that the font of the text field is changed to the + * font of JSpinner if the font of text field was not set by the + * user. + */ + + if (!(editorFont instanceof UIResource)) { + throw new RuntimeException("Font must be UIResource"); + } + if (!editorFont.equals(spinner.getFont())) { + throw new RuntimeException("Wrong FONT"); + } + } + + private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) { + try { + UIManager.setLookAndFeel(laf.getClassName()); + } catch (ClassNotFoundException | InstantiationException | + UnsupportedLookAndFeelException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetByLaF.java openjdk-11-11~24/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetByLaF.java --- openjdk-11-11~19/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetByLaF.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetByLaF.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.EventQueue; +import java.awt.Font; + +import javax.swing.JFormattedTextField; +import javax.swing.JSpinner; +import javax.swing.JSpinner.DefaultEditor; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; + +import static javax.swing.UIManager.getInstalledLookAndFeels; + +/** + * @test + * @key headful + * @bug 8205144 + * @summary Verify font of the text field is changed to the font of + * JSpinner if the font of text field was NOT set by the user and look + * and feel tried to set it to default font of the TextUI + */ +public final class FontSetByLaF { + + public static void main(final String[] args) throws Exception { + for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) { + EventQueue.invokeAndWait(() -> setLookAndFeel(laf)); + EventQueue.invokeAndWait(() -> { + + JSpinner spinner = new JSpinner(); + DefaultEditor editor = (DefaultEditor) spinner.getEditor(); + JFormattedTextField textField = editor.getTextField(); + + Font before = textField.getFont(); + SwingUtilities.updateComponentTreeUI(spinner); + Font after = textField.getFont(); + + if (!before.equals(after)) { + System.err.println("Before: " + before); + System.err.println("After: " + after); + throw new RuntimeException(); + } + }); + } + } + + private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) { + try { + UIManager.setLookAndFeel(laf.getClassName()); + System.err.println("LookAndFeel: " + laf.getClassName()); + } catch (final UnsupportedLookAndFeelException ignored) { + System.err.println( + "Unsupported LookAndFeel: " + laf.getClassName()); + } catch (ClassNotFoundException | InstantiationException | + IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetByUser.java openjdk-11-11~24/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetByUser.java --- openjdk-11-11~19/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetByUser.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/FontSetByUser.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,114 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.awt.FlowLayout; +import java.awt.Font; + +import javax.swing.JFrame; +import javax.swing.JSpinner; +import javax.swing.SwingUtilities; +import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; +import javax.swing.plaf.UIResource; + +import static javax.swing.JSpinner.*; +import static javax.swing.UIManager.getInstalledLookAndFeels; + +/** + * @test + * @key headful + * @bug 5036022 + */ +public class FontSetByUser implements Runnable { + + private static final Font USERS_FONT = new Font("dialog", Font.BOLD, 41); + + public static void main(final String[] args) throws Exception { + for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) { + SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); + SwingUtilities.invokeAndWait(new FontSetByUser()); + } + } + + @Override + public void run() { + final JFrame frame1 = new JFrame(); + try { + testDefaultFont(frame1); + } finally { + frame1.dispose(); + } + } + + private static void testDefaultFont(final JFrame frame) { + final JSpinner spinner = new JSpinner(); + final JSpinner spinner_u = new JSpinner(); + frame.setLayout(new FlowLayout(FlowLayout.CENTER, 50, 50)); + frame.getContentPane().add(spinner); + frame.getContentPane().add(spinner_u); + frame.pack(); + frame.setLocationRelativeTo(null); + frame.setVisible(true); + final DefaultEditor ed = (DefaultEditor) spinner.getEditor(); + final DefaultEditor ed_u = (DefaultEditor) spinner_u.getEditor(); + ed_u.getTextField().setFont(USERS_FONT); + + for (int i = 5; i < 40; i += 5) { + /* + * Validate that the font of the text field is changed to the + * font of JSpinner if the font of text field was not set by the + * user. + */ + final Font tff = ed.getTextField().getFont(); + if (!(tff instanceof UIResource)) { + throw new RuntimeException("Font must be UIResource"); + } + if (spinner.getFont().getSize() != tff.getSize()) { + throw new RuntimeException("Rrong size"); + } + spinner.setFont(new Font("dialog", Font.BOLD, i)); + /* + * Validate that the font of the text field is NOT changed to the + * font of JSpinner if the font of text field was set by the user. + */ + final Font tff_u = ed_u.getTextField().getFont(); + if (tff_u instanceof UIResource || !tff_u.equals(USERS_FONT)) { + throw new RuntimeException("Font must NOT be UIResource"); + } + if (spinner_u.getFont().getSize() == tff_u.getSize()) { + throw new RuntimeException("Wrong size"); + } + spinner_u.setFont(new Font("dialog", Font.BOLD, i)); + } + } + + private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) { + try { + UIManager.setLookAndFeel(laf.getClassName()); + System.out.println("LookAndFeel: " + laf.getClassName()); + } catch (ClassNotFoundException | InstantiationException | + UnsupportedLookAndFeelException | IllegalAccessException e) { + throw new RuntimeException(e); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/WrongEditorTextFieldFont.java openjdk-11-11~24/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/WrongEditorTextFieldFont.java --- openjdk-11-11~19/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/WrongEditorTextFieldFont.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/JSpinner/WrongEditorTextFieldFont/WrongEditorTextFieldFont.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.awt.FlowLayout; -import java.awt.Font; - -import javax.swing.JFrame; -import javax.swing.JSpinner; -import javax.swing.SwingUtilities; -import javax.swing.UIManager; -import javax.swing.UnsupportedLookAndFeelException; -import javax.swing.plaf.UIResource; - -import static javax.swing.JSpinner.*; -import static javax.swing.UIManager.getInstalledLookAndFeels; - -/** - * @test - * @key headful - * @bug 5036022 - * @author Sergey Bylokhov - */ -public class WrongEditorTextFieldFont implements Runnable { - - private static final Font USERS_FONT = new Font("dialog", Font.BOLD, 41); - - public static void main(final String[] args) throws Exception { - for (final UIManager.LookAndFeelInfo laf : getInstalledLookAndFeels()) { - SwingUtilities.invokeAndWait(() -> setLookAndFeel(laf)); - SwingUtilities.invokeAndWait(new WrongEditorTextFieldFont()); - } - } - - @Override - public void run() { - final JFrame frame1 = new JFrame(); - try { - testDefaultFont(frame1); - } finally { - frame1.dispose(); - } - } - - private static void testDefaultFont(final JFrame frame) { - final JSpinner spinner = new JSpinner(); - final JSpinner spinner_u = new JSpinner(); - frame.setLayout(new FlowLayout(FlowLayout.CENTER, 50, 50)); - frame.getContentPane().add(spinner); - frame.getContentPane().add(spinner_u); - frame.pack(); - frame.setLocationRelativeTo(null); - frame.setVisible(true); - final DefaultEditor ed = (DefaultEditor) spinner.getEditor(); - final DefaultEditor ed_u = (DefaultEditor) spinner_u.getEditor(); - ed_u.getTextField().setFont(USERS_FONT); - - for (int i = 5; i < 40; i += 5) { - /* - * Validate that the font of the text field is changed to the - * font of JSpinner if the font of text field was not set by the - * user. - */ - final Font tff = ed.getTextField().getFont(); - if (!(tff instanceof UIResource)) { - throw new RuntimeException("Font must be UIResource"); - } - if (spinner.getFont().getSize() != tff.getSize()) { - throw new RuntimeException("Rrong size"); - } - spinner.setFont(new Font("dialog", Font.BOLD, i)); - /* - * Validate that the font of the text field is NOT changed to the - * font of JSpinner if the font of text field was set by the user. - */ - final Font tff_u = ed_u.getTextField().getFont(); - if (tff_u instanceof UIResource || !tff_u.equals(USERS_FONT)) { - throw new RuntimeException("Font must NOT be UIResource"); - } - if (spinner_u.getFont().getSize() == tff_u.getSize()) { - throw new RuntimeException("Wrong size"); - } - spinner_u.setFont(new Font("dialog", Font.BOLD, i)); - } - } - - private static void setLookAndFeel(final UIManager.LookAndFeelInfo laf) { - try { - UIManager.setLookAndFeel(laf.getClassName()); - System.out.println("LookAndFeel: " + laf.getClassName()); - } catch (ClassNotFoundException | InstantiationException | - UnsupportedLookAndFeelException | IllegalAccessException e) { - throw new RuntimeException(e); - } - } -} diff -Nru openjdk-11-11~19/test/jdk/javax/swing/reliability/HangDuringStaticInitialization.java openjdk-11-11~24/test/jdk/javax/swing/reliability/HangDuringStaticInitialization.java --- openjdk-11-11~19/test/jdk/javax/swing/reliability/HangDuringStaticInitialization.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/javax/swing/reliability/HangDuringStaticInitialization.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import java.net.URI; +import java.nio.file.FileSystem; +import java.nio.file.FileSystems; +import java.nio.file.FileVisitResult; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.SimpleFileVisitor; +import java.nio.file.attribute.BasicFileAttributes; + +/** + * @test + * @bug 8189604 + * @run main/othervm -Djava.awt.headless=false HangDuringStaticInitialization + * @run main/othervm -Djava.awt.headless=true HangDuringStaticInitialization + */ +public final class HangDuringStaticInitialization { + + public static void main(final String[] args) throws Exception { + FileSystem fs = FileSystems.getFileSystem(URI.create("jrt:/")); + test(fs, "/modules/java.desktop"); + test(fs, "/modules/java.datatransfer"); + } + + private static void test(FileSystem fs, String s) throws Exception { + Files.walkFileTree(fs.getPath(s), new SimpleFileVisitor<>() { + @Override + public FileVisitResult visitFile(Path file, + BasicFileAttributes attrs) { + file = file.subpath(2, file.getNameCount()); + String name = file.toString(); + if (name.endsWith(".class")) { + name = name.substring(0, name.indexOf(".")).replace('/', '.'); + try { + Class.forName(name, true, null); + } catch (Throwable e) { + // only the crash / hang will be considered as failure + } + } + return FileVisitResult.CONTINUE; + } + }); + } +} \ No newline at end of file diff -Nru openjdk-11-11~19/test/jdk/jdk/internal/misc/TerminatingThreadLocal/TestTerminatingThreadLocal.java openjdk-11-11~24/test/jdk/jdk/internal/misc/TerminatingThreadLocal/TestTerminatingThreadLocal.java --- openjdk-11-11~19/test/jdk/jdk/internal/misc/TerminatingThreadLocal/TestTerminatingThreadLocal.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/internal/misc/TerminatingThreadLocal/TestTerminatingThreadLocal.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,90 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import jdk.internal.misc.TerminatingThreadLocal; + +import java.util.Arrays; +import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; +import java.util.function.Consumer; + +/* + * @test + * @bug 8202788 + * @summary TerminatingThreadLocal unit test + * @modules java.base/jdk.internal.misc + * @run main TestTerminatingThreadLocal + */ +public class TestTerminatingThreadLocal { + + public static void main(String[] args) { + ttlTestSet(42, 112); + ttlTestSet(null, 112); + ttlTestSet(42, null); + } + + static void ttlTestSet(T v0, T v1) { + ttlTest(v0, ttl -> { } ); + ttlTest(v0, ttl -> { ttl.get(); }, v0); + ttlTest(v0, ttl -> { ttl.get(); ttl.remove(); } ); + ttlTest(v0, ttl -> { ttl.get(); ttl.set(v1); }, v1); + ttlTest(v0, ttl -> { ttl.set(v1); }, v1); + ttlTest(v0, ttl -> { ttl.set(v1); ttl.remove(); } ); + ttlTest(v0, ttl -> { ttl.set(v1); ttl.remove(); ttl.get(); }, v0); + ttlTest(v0, ttl -> { ttl.get(); ttl.remove(); ttl.set(v1); }, v1); + } + + @SafeVarargs + static void ttlTest(T initialValue, + Consumer> ttlOps, + T... expectedTerminatedValues) + { + List terminatedValues = new CopyOnWriteArrayList<>(); + + TerminatingThreadLocal ttl = new TerminatingThreadLocal<>() { + @Override + protected void threadTerminated(T value) { + terminatedValues.add(value); + } + + @Override + protected T initialValue() { + return initialValue; + } + }; + + Thread thread = new Thread(() -> ttlOps.accept(ttl)); + thread.start(); + try { + thread.join(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } + + if (!terminatedValues.equals(Arrays.asList(expectedTerminatedValues))) { + throw new AssertionError("Expected terminated values: " + + Arrays.toString(expectedTerminatedValues) + + " but got: " + terminatedValues); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/jdk/internal/platform/docker/MetricsCpuTester.java openjdk-11-11~24/test/jdk/jdk/internal/platform/docker/MetricsCpuTester.java --- openjdk-11-11~19/test/jdk/jdk/internal/platform/docker/MetricsCpuTester.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/internal/platform/docker/MetricsCpuTester.java 2018-07-25 15:36:46.000000000 +0000 @@ -95,10 +95,13 @@ + Arrays.toString(ipCpuSet) + ", got : " + Arrays.toString(cpuSets)); } - if (!Arrays.equals(ipCpuSet, effectiveCpus)) { - throw new RuntimeException("Effective Cpusets not equal, expected : " - + Arrays.toString(ipCpuSet) + ", got : " - + Arrays.toString(effectiveCpus)); + // Check to see if this metric is supported on this platform + if (effectiveCpus.length != 0) { + if (!Arrays.equals(ipCpuSet, effectiveCpus)) { + throw new RuntimeException("Effective Cpusets not equal, expected : " + + Arrays.toString(ipCpuSet) + ", got : " + + Arrays.toString(effectiveCpus)); + } } System.out.println("TEST PASSED!!!"); } @@ -127,10 +130,13 @@ + Arrays.toString(cpuSets)); } - if (!Arrays.equals(ipCpuSet, effectiveMems)) { - throw new RuntimeException("Effective mem nodes not equal, expected : " - + Arrays.toString(ipCpuSet) + ", got : " - + Arrays.toString(effectiveMems)); + // Check to see if this metric is supported on this platform + if (effectiveMems.length != 0) { + if (!Arrays.equals(ipCpuSet, effectiveMems)) { + throw new RuntimeException("Effective mem nodes not equal, expected : " + + Arrays.toString(ipCpuSet) + ", got : " + + Arrays.toString(effectiveMems)); + } } System.out.println("TEST PASSED!!!"); } diff -Nru openjdk-11-11~19/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java openjdk-11-11~24/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java --- openjdk-11-11~19/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/internal/platform/docker/MetricsMemoryTester.java 2018-07-25 15:36:46.000000000 +0000 @@ -95,10 +95,11 @@ private static void testKernelMemoryLimit(String value) { long limit = getMemoryValue(value); - if (limit != Metrics.systemMetrics().getKernelMemoryLimit()) { + long kmemlimit = Metrics.systemMetrics().getKernelMemoryLimit(); + if (kmemlimit != 0 && limit != kmemlimit) { throw new RuntimeException("Kernel Memory limit not equal, expected : [" + limit + "]" + ", got : [" - + Metrics.systemMetrics().getKernelMemoryLimit() + "]"); + + kmemlimit + "]"); } System.out.println("TEST PASSED!!!"); } diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestFieldAccess.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestFieldAccess.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestFieldAccess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestFieldAccess.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestFieldAccess */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestGetStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestGetStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestGetStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestGetStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,10 +42,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Verifies that a recorded JFR event has the correct stack trace info * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestGetStackTrace */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestHiddenMethod.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,9 +42,10 @@ import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @library /test/lib * @modules java.scripting diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestMethodGetModifiers.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestMethodGetModifiers.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestMethodGetModifiers.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestMethodGetModifiers.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,9 +39,10 @@ import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -Xint jdk.jfr.api.consumer.TestMethodGetModifiers */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestReadTwice.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestReadTwice.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestReadTwice.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestReadTwice.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.test.lib.Utils; -/* +/** * @test * @summary Reads the recorded file two times and verifies that both reads are the same * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestReadTwice */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedClassLoader.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedClassLoader.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedClassLoader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedClassLoader.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.TestClassLoader; -/* +/** * @test * @summary Verifies the methods of the RecordedClassLoader * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordedClassLoader */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThread.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThread.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThread.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThread.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Tests that the RecordedEvent.getThread() returns th expected info * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordedEventGetThread */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThreadOther.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThreadOther.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThreadOther.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedEventGetThreadOther.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.Utils; -/* +/** * @test * @summary Tests that the RecordedEvent.getThread() returns th expected info * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordedEventGetThreadOther */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Verifies the methods of the RecordedEvent * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordedEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedFrame.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedFrame.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedFrame.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedFrame.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Simple test for RecordedFrame APIs * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -Xint -XX:+UseInterpreter -Dinterpreted=true jdk.jfr.api.consumer.TestRecordedFrame * @run main/othervm -Xcomp -XX:-UseInterpreter -Dinterpreted=false jdk.jfr.api.consumer.TestRecordedFrame diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedFullStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedFullStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedFullStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedFullStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,9 +40,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.RecurseThread; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordedFullStackTrace */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedInstantEventTimestamp.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedInstantEventTimestamp.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedInstantEventTimestamp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedInstantEventTimestamp.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Tests that an instant event gets recorded with its start time equal to its end time * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordedInstantEventTimestamp */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedMethodDescriptor.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedMethodDescriptor.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedMethodDescriptor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedMethodDescriptor.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,9 +40,10 @@ import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordedMethodDescriptor */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedObject.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedObject.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedObject.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedObject.java 2018-07-25 15:36:46.000000000 +0000 @@ -47,10 +47,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Verifies the methods of the RecordedObject * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordedObject */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedThreadGroupParent.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedThreadGroupParent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordedThreadGroupParent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordedThreadGroupParent.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Tests getParent method in RecordedThreadGroup * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordedThreadGroupParent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordingFile.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordingFile.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordingFile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordingFile.java 2018-07-25 15:36:46.000000000 +0000 @@ -49,10 +49,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.Utils; -/* +/** * @test * @summary Verifies that all methods in RecordingFIle are working * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordingFile */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordingFileReadEventEof.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordingFileReadEventEof.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordingFileReadEventEof.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordingFileReadEventEof.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Verifies that RecordingFile.readEvent() throws EOF when past the last record * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordingFileReadEventEof */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordingInternals.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordingInternals.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestRecordingInternals.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestRecordingInternals.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Tests that chunks are read in order and constant pools from multiple chunks can be read * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestRecordingInternals */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestSingleRecordedEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestSingleRecordedEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestSingleRecordedEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestSingleRecordedEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Verifies that a single JFR event is recorded as expected * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestSingleRecordedEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestToString.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestToString.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestToString.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestToString.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Sanity checks that RecordedEvent#toString returns something valid * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestToString */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestValueDescriptorRecorded.java openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestValueDescriptorRecorded.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/consumer/TestValueDescriptorRecorded.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/consumer/TestValueDescriptorRecorded.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Verifies that the recorded value descriptors are correct * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.consumer.TestValueDescriptorRecorded */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/dynamic/TestDynamicAnnotations.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/dynamic/TestDynamicAnnotations.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/dynamic/TestDynamicAnnotations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/dynamic/TestDynamicAnnotations.java 2018-07-25 15:36:46.000000000 +0000 @@ -51,9 +51,10 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.dynamic.TestDynamicAnnotations */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/dynamic/TestEventFactory.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/dynamic/TestEventFactory.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/dynamic/TestEventFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/dynamic/TestEventFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -53,9 +53,10 @@ import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.dynamic.TestEventFactory */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestAbstractEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestAbstractEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestAbstractEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestAbstractEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Tests that abstract events are not part of metadata * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestAbstractEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestBeginEnd.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestBeginEnd.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestBeginEnd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestBeginEnd.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Test for RecordedEvent.getDuration() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestBeginEnd */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestClinitRegistration.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestClinitRegistration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestClinitRegistration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestClinitRegistration.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test enable/disable event and verify recording has expected events. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestClinitRegistration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestClonedEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestClonedEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestClonedEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestClonedEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Tests that a cloned event can be successfully committed. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestClonedEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestEnableDisable.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestEnableDisable.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestEnableDisable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestEnableDisable.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test enable/disable event and verify recording has expected events. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestEnableDisable */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestEventFactory.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestEventFactory.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestEventFactory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestEventFactory.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.Asserts; -/* +/** * @test * @summary EventFactory simple test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestEventFactory */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestEventFactoryRegisterTwice.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestEventFactoryRegisterTwice.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestEventFactoryRegisterTwice.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestEventFactoryRegisterTwice.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.Asserts; -/* +/** * @test * @summary Verifies that EventFactory can register the same event twice * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestEventFactoryRegisterTwice */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestEventFactoryRegistration.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestEventFactoryRegistration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestEventFactoryRegistration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestEventFactoryRegistration.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.Asserts; -/* +/** * @test * @summary EventFactory register/unregister API test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestEventFactoryRegistration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestExtends.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestExtends.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestExtends.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestExtends.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test with event class inheritance * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestExtends */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestGetDuration.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestGetDuration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestGetDuration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestGetDuration.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Test for RecordedEvent.getDuration() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestGetDuration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestIsEnabled.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestIsEnabled.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestIsEnabled.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestIsEnabled.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Test Event.isEnabled() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestIsEnabled */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestIsEnabledMultiple.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestIsEnabledMultiple.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestIsEnabledMultiple.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestIsEnabledMultiple.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.jfr.Recording; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test Event.isEnabled() with multiple recordings * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestIsEnabledMultiple */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestOwnCommit.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestOwnCommit.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestOwnCommit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestOwnCommit.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Use custom event that reuse method names begin, end and commit. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestOwnCommit */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestShouldCommit.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestShouldCommit.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestShouldCommit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestShouldCommit.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.Recording; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test enable/disable event and verify recording has expected events. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -Xlog:jfr+event+setting=trace jdk.jfr.api.event.TestShouldCommit */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestStaticEnable.java openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestStaticEnable.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/event/TestStaticEnable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/event/TestStaticEnable.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Enable an event from a static function in the event. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.event.TestStaticEnable */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestAddListenerTwice.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestAddListenerTwice.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestAddListenerTwice.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestAddListenerTwice.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.Recording; import jdk.jfr.RecordingState; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.flightrecorder.TestAddListenerTwice */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestAddPeriodicEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestAddPeriodicEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestAddPeriodicEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestAddPeriodicEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.jfr.FlightRecorder; import jdk.jfr.Recording; -/* +/** * @test * @summary * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestAddPeriodicEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestFlightRecorderListenerRecorderInitialized.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestFlightRecorderListenerRecorderInitialized.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestFlightRecorderListenerRecorderInitialized.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestFlightRecorderListenerRecorderInitialized.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.jfr.FlightRecorder; import jdk.jfr.FlightRecorderListener; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestFlightRecorderListenerRecorderInitialized */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestGetEventTypes.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestGetEventTypes.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestGetEventTypes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestGetEventTypes.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm/timeout=600 jdk.jfr.api.flightrecorder.TestGetEventTypes */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestGetPlatformRecorder.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestGetPlatformRecorder.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestGetPlatformRecorder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestGetPlatformRecorder.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.FlightRecorder; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestGetPlatformRecorder */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestGetRecordings.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestGetRecordings.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestGetRecordings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestGetRecordings.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.jfr.FlightRecorder; import jdk.jfr.Recording; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestGetRecordings */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestGetSettings.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestGetSettings.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestGetSettings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestGetSettings.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.jfr.EventType; import jdk.jfr.Recording; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestGetSettings */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestIsAvailable.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestIsAvailable.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestIsAvailable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestIsAvailable.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,9 +28,10 @@ import jdk.jfr.FlightRecorder; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -XX:+FlightRecorder jdk.jfr.api.flightrecorder.TestIsAvailable true * @run main/othervm -XX:-FlightRecorder jdk.jfr.api.flightrecorder.TestIsAvailable false diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestIsInitialized.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestIsInitialized.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestIsInitialized.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestIsInitialized.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.FlightRecorderListener; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestIsInitialized */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestListener.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestListener.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestListener.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.Recording; import jdk.jfr.RecordingState; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.flightrecorder.TestListener */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestListenerNull.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestListenerNull.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestListenerNull.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestListenerNull.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.FlightRecorder; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestListenerNull */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestPeriodicEventsSameHook.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestPeriodicEventsSameHook.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestPeriodicEventsSameHook.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestPeriodicEventsSameHook.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,10 +28,11 @@ import jdk.jfr.Event; import jdk.jfr.FlightRecorder; -/* +/** * @test * @summary Check that an IllegalArgumentException is thrown if event is added twice * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestPeriodicEventsSameHook */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestRecorderInitializationCallback.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestRecorderInitializationCallback.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestRecorderInitializationCallback.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestRecorderInitializationCallback.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.jfr.FlightRecorder; import jdk.jfr.FlightRecorderListener; -/* +/** * @test * @summary Test Flight Recorder initialization callback is only called once * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestRecorderInitializationCallback */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestRegisterUnregisterEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestRegisterUnregisterEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestRegisterUnregisterEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestRegisterUnregisterEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.jfr.EventType; import jdk.jfr.FlightRecorder; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestRegisterUnregisterEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestSettingsControl.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestSettingsControl.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestSettingsControl.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestSettingsControl.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.jfr.SettingControl; import jdk.jfr.SettingDefinition; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestSettingsControl */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestSnapshot.java openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestSnapshot.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/flightrecorder/TestSnapshot.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/flightrecorder/TestSnapshot.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,8 +40,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* @test +/** + * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.flightrecorder.TestSnapshot */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestCategory.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestCategory.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestCategory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestCategory.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.jfr.EventType; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestCategory */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestContentType.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestContentType.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestContentType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestContentType.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,9 +39,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestContentType */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestDescription.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestDescription.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestDescription.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestDescription.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,9 +41,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleSetting; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestDescription */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestDynamicAnnotation.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestDynamicAnnotation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestDynamicAnnotation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestDynamicAnnotation.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.jfr.AnnotationElement; import jdk.jfr.MetadataDefinition; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestDynamicAnnotation */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestEnabled.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestEnabled.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestEnabled.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestEnabled.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.jfr.Recording; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestEnabled */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestExperimental.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestExperimental.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestExperimental.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestExperimental.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestExperimental */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestFieldAnnotations.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestFieldAnnotations.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestFieldAnnotations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestFieldAnnotations.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,9 +39,10 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestFieldAnnotations */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestHasValue.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestHasValue.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestHasValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestHasValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.jfr.Timestamp; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestHasValue */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestInheritedAnnotations.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestInheritedAnnotations.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestInheritedAnnotations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestInheritedAnnotations.java 2018-07-25 15:36:46.000000000 +0000 @@ -48,9 +48,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestInheritedAnnotations */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestLabel.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestLabel.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestLabel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestLabel.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,9 +42,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleSetting; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestLabel */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestMetadata.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestMetadata.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestMetadata.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestMetadata.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestMetadata */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestName.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestName.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestName.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,9 +42,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleSetting; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestName */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestPeriod.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestPeriod.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestPeriod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestPeriod.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestLabel */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestRegisteredFalseAndRunning.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestRegisteredFalseAndRunning.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestRegisteredFalseAndRunning.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestRegisteredFalseAndRunning.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.Recording; import jdk.jfr.Registered; -/* +/** * @test Tests that commit doesn't throw exception when an event has not been registered. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestRegisteredFalseAndRunning * @run main/othervm -XX:FlightRecorderOptions=retransform=false jdk.jfr.api.metadata.annotations.TestRegisteredFalseAndRunning diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestRegistered.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestRegistered.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestRegistered.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestRegistered.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.jfr.EventType; import jdk.jfr.FlightRecorder; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestRegistered */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestRelational.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestRelational.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestRelational.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestRelational.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,9 +40,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestRelational */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestSimpleMetadataEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestSimpleMetadataEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestSimpleMetadataEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestSimpleMetadataEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.jfr.EventType; import jdk.jfr.MetadataDefinition; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestSimpleMetadataEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestStackTrace */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestThreshold.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestThreshold.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestThreshold.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestThreshold.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestThreshold */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestTypesIdentical.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestTypesIdentical.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/annotations/TestTypesIdentical.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/annotations/TestTypesIdentical.java 2018-07-25 15:36:46.000000000 +0000 @@ -51,9 +51,10 @@ import jdk.jfr.Unsigned; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.annotations.TestTypesIdentical */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotationElements.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotationElements.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotationElements.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotationElements.java 2018-07-25 15:36:46.000000000 +0000 @@ -62,10 +62,11 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test for AnnotationElement.getAnnotationElements() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetAnnotationElements */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotation.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotation.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.jfr.Label; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test getAnnotations() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetAnnotation */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotations.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotations.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetAnnotations.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.jfr.Period; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test getAnnotations() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetAnnotations */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetCategory.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetCategory.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetCategory.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetCategory.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.jfr.EventType; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test setName(). * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetCategory */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDefaultValues.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDefaultValues.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDefaultValues.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDefaultValues.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test getDefaultValues() * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetDefaultValues */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDescription.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDescription.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDescription.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetDescription.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.jfr.Label; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test descriptive annotations for EventType * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetDescription */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetEventType.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetEventType.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetEventType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetEventType.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,10 +29,11 @@ import jdk.jfr.EventType; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test getEventType() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetEventType */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetField.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetField.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetField.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetField.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test getField() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetField */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetFields.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetFields.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetFields.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetFields.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test getFields() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetFields */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetSettings.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetSettings.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetSettings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestGetSettings.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.SettingDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test getSettings() * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.eventtype.TestGetSettings */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestUnloadingEventClass.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestUnloadingEventClass.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/eventtype/TestUnloadingEventClass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/eventtype/TestUnloadingEventClass.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.jfr.internal.JVM; import jdk.test.lib.Utils; -/* +/** * @test * @key jfr * @summary Test that verifies event metadata is removed when an event class is unloaded. + * @requires vm.hasJFR * * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestDefaultValue.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestDefaultValue.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestDefaultValue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestDefaultValue.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,10 +29,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test SettingDescriptor.getName() * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestDefaultValue */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotationElement.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotationElement.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotationElement.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotationElement.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test SettingDescriptor.getAnnotationElements() * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetAnnotationElement */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotation.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotation.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test SettingDescriptor.getAnnotation(); * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetAnnotation */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetContentType.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetContentType.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetContentType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetContentType.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test SettingDescriptor.getContentType() * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetDescription */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetDescription.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetDescription.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetDescription.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetDescription.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test SettingDescriptor.getDescription() * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetDescription */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetLabel.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetLabel.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetLabel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetLabel.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test SettingDescriptor.getLabel() * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetLabel */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetName.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetName.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetName.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,10 +28,11 @@ import jdk.jfr.SettingDescriptor; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test SettingDescriptor.getName() * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetName */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeId.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeId.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeId.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeId.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,10 +29,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test SettingDescriptor.getTypeId() * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetTypeId */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeName.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeName.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetTypeName.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,10 +29,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test SettingDescriptor.getTypeName(); * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetTypeName */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestClasses.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestClasses.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestClasses.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestClasses.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test ValueDescriptor.getAnnotations() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.valuedescriptor.TestClasses */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestConstructor.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestConstructor.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestConstructor.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestConstructor.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test ValueDescriptor.getAnnotations() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.valuedescriptor.TestConstructor */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetAnnotations.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetAnnotations.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetAnnotations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetAnnotations.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test ValueDescriptor.getAnnotations() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.valuedescriptor.TestGetAnnotations */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetFields.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetFields.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetFields.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestGetFields.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,10 +28,11 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test ValueDescriptor.getAnnotations() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.valuedescriptor.TestGetFields */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestIsArray.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestIsArray.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestIsArray.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestIsArray.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test ValueDescriptor.isArray(). * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.valuedescriptor.TestIsArray */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestSimpleTypes.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestSimpleTypes.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestSimpleTypes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestSimpleTypes.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test all basic types in ValueDescriptor. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.valuedescriptor.TestSimpleTypes */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestValueDescriptorContentType.java openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestValueDescriptorContentType.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestValueDescriptorContentType.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestValueDescriptorContentType.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.jfr.ValueDescriptor; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Test ValueDescriptor.getContentType() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.metadata.valuedescriptor.TestValueDescriptorContentType */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recorder/TestRecorderInitialized.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recorder/TestRecorderInitialized.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recorder/TestRecorderInitialized.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recorder/TestRecorderInitialized.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.FlightRecorderListener; import jdk.test.lib.Asserts; -/* +/** * @test TestRecorderListener * @key jfr + * @requires vm.hasJFR * @library /test/lib * * @run main/othervm jdk.jfr.api.recorder.TestRecorderInitialized diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recorder/TestRecorderListener.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recorder/TestRecorderListener.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recorder/TestRecorderListener.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recorder/TestRecorderListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.Recording; import jdk.jfr.RecordingState; -/* +/** * @test TestRecorderListener * * @key jfr + * @requires vm.hasJFR * @run main/othervm jdk.jfr.api.recorder.TestRecorderListener */ public class TestRecorderListener { diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recorder/TestStartStopRecording.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recorder/TestStartStopRecording.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recorder/TestStartStopRecording.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recorder/TestStartStopRecording.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.jfr.Recording; import jdk.test.lib.Utils; -/* +/** * @test TestStartStopRecording * * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recorder.TestStartStopRecording */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestFileExist.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestFileExist.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestFileExist.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestFileExist.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Set destination to an existing file. File should be overwritten. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.destination.TestDestFileExist */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestFileReadOnly.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestFileReadOnly.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestFileReadOnly.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestFileReadOnly.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.FileHelper; -/* +/** * @test * @summary Set destination to a read-only file. Expects exception. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.destination.TestDestFileReadOnly */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestInvalid.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestInvalid.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestInvalid.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestInvalid.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,10 +39,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test setDestination to invalid paths * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.destination.TestDestInvalid */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestLongPath.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestLongPath.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestLongPath.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestLongPath.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.FileHelper; -/* +/** * @test * @summary Set destination to a long path * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.destination.TestDestLongPath */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestMultiple.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestMultiple.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestMultiple.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestMultiple.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @summary Test setDestination with concurrent recordings * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -Xlog:jfr=trace jdk.jfr.api.recording.destination.TestDestMultiple */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestReadOnly.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestReadOnly.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestReadOnly.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestReadOnly.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,10 +40,11 @@ import jdk.test.lib.jfr.FileHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test setDestination to read-only dir * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.destination.TestDestReadOnly */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestState.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestState.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestState.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @summary Call setDestination() when recording in different states * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.destination.TestDestState */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskFalse.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskFalse.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskFalse.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskFalse.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,10 +39,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @summary Basic test for setDestination with disk=false * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.destination.TestDestToDiskFalse */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskTrue.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskTrue.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskTrue.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestToDiskTrue.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Basic test for setDestination with disk=true * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.destination.TestDestToDiskTrue */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestWithDuration.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestWithDuration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/destination/TestDestWithDuration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/destination/TestDestWithDuration.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,10 +39,11 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @summary Test that recording is auto closed after duration * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.destination.TestDestWithDuration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpInvalid.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpInvalid.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpInvalid.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpInvalid.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test copyTo and parse file * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.dump.TestDumpInvalid */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDump.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDump.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDump.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDump.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Test copyTo and parse file * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.dump.TestDump */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpLongPath.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpLongPath.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpLongPath.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpLongPath.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.FileHelper; -/* +/** * @test * @summary Test copyTo and parse file * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.dump.TestDumpLongPath */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpMultiple.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpMultiple.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpMultiple.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpMultiple.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @summary Test copyTo and parse file * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.dump.TestDumpMultiple */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpReadOnly.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpReadOnly.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpReadOnly.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpReadOnly.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.test.lib.jfr.FileHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test copyTo and parse file * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.dump.TestDumpReadOnly */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpState.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpState.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/dump/TestDumpState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/dump/TestDumpState.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,10 +42,11 @@ import jdk.test.lib.jfr.SimpleEventHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary call copyTo() with recording in all states. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.dump.TestDumpState */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestChunkPeriod.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestChunkPeriod.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestChunkPeriod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestChunkPeriod.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary Test periodic setting that involves chunks. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestChunkPeriod */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestEnableClass.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestEnableClass.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestEnableClass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestEnableClass.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,10 +28,11 @@ import jdk.jfr.Recording; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @summary Simple enable Event class. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestEnableClass */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestEnableName.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestEnableName.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestEnableName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestEnableName.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Simple enable Event class. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestEnableName */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestEventTime.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestEventTime.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestEventTime.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestEventTime.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test getStartTime() and getEndTime(). Verify startTime <= endTime * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestEventTime */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestLoadEventAfterStart.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestLoadEventAfterStart.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestLoadEventAfterStart.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestLoadEventAfterStart.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Load event class after recording started. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @build jdk.test.lib.jfr.SimpleEvent * @run main/othervm jdk.jfr.api.recording.event.TestLoadEventAfterStart diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestPeriod.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestPeriod.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestPeriod.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestPeriod.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test event period. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestPeriod */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestRecordingEnableDisable.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestRecordingEnableDisable.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestRecordingEnableDisable.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestRecordingEnableDisable.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.jfr.SimpleEvent; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @summary Enable, disable, enable event during recording. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestRecordingEnableDisable */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestReEnableClass.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestReEnableClass.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestReEnableClass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestReEnableClass.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.Recording; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @summary Enable, disable, enable event during recording. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestReEnableClass */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestReEnableMultiple.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestReEnableMultiple.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestReEnableMultiple.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestReEnableMultiple.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,10 +39,11 @@ import jdk.test.lib.jfr.SimpleEvent; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @summary Enable, disable, enable event during recording. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestReEnableMultiple */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestReEnableName.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestReEnableName.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestReEnableName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestReEnableName.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Enable/disable event by name during recording. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestReEnableName */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestThreshold.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestThreshold.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/event/TestThreshold.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/event/TestThreshold.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test event threshold. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.event.TestThreshold */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestGetId.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestGetId.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestGetId.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestGetId.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.Recording; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Verify that each recording get unique a id * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.misc.TestGetId */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestGetSize.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestGetSize.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestGetSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestGetSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.jfr.Recording; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Test recording file size with Recording.getSize() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.misc.TestGetSize */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestGetSizeToMem.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestGetSizeToMem.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestGetSizeToMem.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestGetSizeToMem.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Test recording file size with Recording.getSize() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.misc.TestGetSizeToMem */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestGetStream.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestGetStream.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestGetStream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestGetStream.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,10 +43,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @summary A simple test for Recording.getStream() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.misc.TestGetStream */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestRecordingBase.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestRecordingBase.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestRecordingBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestRecordingBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,10 +40,11 @@ import jdk.jfr.Recording; import jdk.jfr.RecordingState; -/* +/** * @test * @summary Basic tests for Recording * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.misc.TestRecordingBase */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestRecordingCopy.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestRecordingCopy.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/misc/TestRecordingCopy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/misc/TestRecordingCopy.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import java.util.List; -/* +/** * @test * @summary A simple test for Recording.copy() * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.misc.TestRecordingCopy */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/options/TestDuration.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/options/TestDuration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/options/TestDuration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/options/TestDuration.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.CommonHelper; -/* +/** * @test * @summary Test setDuration(). Verify recording is stopped automatically. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.options.TestDuration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/options/TestName.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/options/TestName.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/options/TestName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/options/TestName.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test setName(). * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.options.TestName */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestConfigurationGetContents.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestConfigurationGetContents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestConfigurationGetContents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestConfigurationGetContents.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.jfr.Configuration; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Verifies Configuration.getContents() for every configuration * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.settings.TestConfigurationGetContents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromPath.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromPath.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromPath.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromPath.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Test setName(). * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.settings.TestCreateConfigFromPath */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromReader.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromReader.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromReader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestCreateConfigFromReader.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Test setName(). * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.settings.TestCreateConfigFromReader */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestGetConfigurations.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestGetConfigurations.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestGetConfigurations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestGetConfigurations.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,11 +29,12 @@ import jdk.jfr.Configuration; import jdk.test.lib.Asserts; -/* +/** * @test * @summary Verifies that there is the default config and that it has * the expected parameters * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.settings.TestGetConfigurations */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestSettingsAvailability.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestSettingsAvailability.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/settings/TestSettingsAvailability.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/settings/TestSettingsAvailability.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,10 +39,11 @@ import jdk.jfr.consumer.RecordingFile; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Verifies that event types has the correct type of settings * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.settings.TestSettingsAvailability */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestOptionState.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestOptionState.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestOptionState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestOptionState.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.Recording; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr * @summary Test options in different states + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.state.TestOptionState */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateDuration.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateDuration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateDuration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateDuration.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test Recording state * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.state.TestStateDuration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateIdenticalListeners.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateIdenticalListeners.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateIdenticalListeners.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateIdenticalListeners.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.FlightRecorderListener; import jdk.jfr.Recording; -/* +/** * @test * @summary Test Recording state with concurrent recordings * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.state.TestStateIdenticalListeners */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateInvalid.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateInvalid.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateInvalid.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateInvalid.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test start/stop/close recording from different recording states. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.state.TestStateInvalid */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestState.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestState.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestState.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.RecordingState; import jdk.test.lib.jfr.CommonHelper; -/* +/** * @test * @summary Test Recording state * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.state.TestState */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateMultiple.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateMultiple.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateMultiple.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateMultiple.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test Recording state with concurrent recordings * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.state.TestStateMultiple */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateScheduleStart.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateScheduleStart.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/state/TestStateScheduleStart.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/state/TestStateScheduleStart.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @summary Test Recording state * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.state.TestStateScheduleStart */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/time/TestTimeDuration.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/time/TestTimeDuration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/time/TestTimeDuration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/time/TestTimeDuration.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.Recording; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr * @summary Test Recording.setDuration() and Recording.get*Time() + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.time.TestTimeDuration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/time/TestTime.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/time/TestTime.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/time/TestTime.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/time/TestTime.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.jfr.Recording; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr * @summary Test Recording.get*Time() + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.time.TestTime */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/time/TestTimeMultiple.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/time/TestTimeMultiple.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/time/TestTimeMultiple.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/time/TestTimeMultiple.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.jfr.Recording; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr * @summary Test recording times with concurrent recordings + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.time.TestTimeMultiple */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/time/TestTimeScheduleStart.java openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/time/TestTimeScheduleStart.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/recording/time/TestTimeScheduleStart.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/recording/time/TestTimeScheduleStart.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.CommonHelper; -/* +/** * @test * @key jfr * @summary Test Recording.scheduleStart() and Recording.get*Time() + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.api.recording.time.TestTimeScheduleStart */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/api/settings/TestFilterEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/api/settings/TestFilterEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/api/settings/TestFilterEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/api/settings/TestFilterEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import static jdk.test.lib.Asserts.assertEquals; -/* +/** * @test * @summary The test uses SettingControl * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.api.settings.TestFilterEvents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestHelp.java openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestHelp.java --- openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestHelp.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestHelp.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,10 +27,11 @@ import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Test help * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.cmd.TestHelp */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestPrintDefault.java openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestPrintDefault.java --- openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestPrintDefault.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestPrintDefault.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,10 +29,11 @@ import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @key jfr * @summary Tests print --json + * @requires vm.hasJFR * * @library /test/lib /test/jdk * @modules java.scripting diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestPrint.java openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestPrint.java --- openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestPrint.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestPrint.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.test.lib.Utils; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Test jfr print * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.cmd.TestPrint */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestPrintJSON.java openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestPrintJSON.java --- openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestPrintJSON.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestPrintJSON.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @key jfr * @summary Tests print --json + * @requires vm.hasJFR * * @library /test/lib /test/jdk * @modules jdk.scripting.nashorn diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestPrintXML.java openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestPrintXML.java --- openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestPrintXML.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestPrintXML.java 2018-07-25 15:36:46.000000000 +0000 @@ -52,10 +52,11 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; -/* +/** * @test * @key jfr * @summary Tests print --xml + * @requires vm.hasJFR * * @library /test/lib /test/jdk * @modules java.scripting diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestReconstruct.java openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestReconstruct.java --- openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestReconstruct.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestReconstruct.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,10 +41,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Test jfr reconstruct * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.cmd.TestReconstruct diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestSplit.java openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestSplit.java --- openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestSplit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestSplit.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.jfr.consumer.RecordingFile; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Test jfr split * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.cmd.TestSplit */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestSummary.java openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestSummary.java --- openjdk-11-11~19/test/jdk/jdk/jfr/cmd/TestSummary.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/cmd/TestSummary.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.jfr.consumer.RecordingFile; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Test jfr info * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.cmd.TestSummary */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestAllocInNewTLAB.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestAllocInNewTLAB.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestAllocInNewTLAB.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestAllocInNewTLAB.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test that event is triggered when an object is allocated in a new TLAB. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 jdk.jfr.event.compiler.TestAllocInNewTLAB * @run main/othervm -XX:+UseTLAB -XX:TLABSize=100k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=1 -XX:-FastTLABRefill jdk.jfr.event.compiler.TestAllocInNewTLAB diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestAllocOutsideTLAB.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestAllocOutsideTLAB.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestAllocOutsideTLAB.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestAllocOutsideTLAB.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test that when an object is allocated outside a TLAB an event will be triggered. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 jdk.jfr.event.compiler.TestAllocOutsideTLAB * @run main/othervm -XX:+UseTLAB -XX:-FastTLABRefill -XX:TLABSize=90k -XX:-ResizeTLAB -XX:TLABRefillWasteFraction=256 jdk.jfr.event.compiler.TestAllocOutsideTLAB diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeCacheConfig.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeCacheConfig.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeCacheConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeCacheConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.Events; import sun.hotspot.WhiteBox; -/* +/** * @test TestCodeCacheConfig * @key jfr + * @requires vm.hasJFR * @library /test/lib * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeCacheFull.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,8 +35,9 @@ import sun.hotspot.WhiteBox; import sun.hotspot.code.BlobType; -/* +/** * @test TestCodeCacheFull + * @requires vm.hasJFR * * @library /test/lib * @modules jdk.jfr diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeCacheStats.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeCacheStats.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeCacheStats.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeCacheStats.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.compiler.TestCodeCacheStats */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeSweeperConfig.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeSweeperConfig.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeSweeperConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeSweeperConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -XX:+UseCodeCacheFlushing -XX:-SegmentedCodeCache jdk.jfr.event.compiler.TestCodeSweeperConfig * @run main/othervm -XX:+UseCodeCacheFlushing -XX:+SegmentedCodeCache jdk.jfr.event.compiler.TestCodeSweeperConfig diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeSweeper.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeSweeper.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeSweeper.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeSweeper.java 2018-07-25 15:36:46.000000000 +0000 @@ -51,9 +51,10 @@ * event is received, the event is verified. If an event is missing, we do NOT * fail. */ -/* +/** * @test TestCodeSweeper * @key jfr + * @requires vm.hasJFR * @library /test/lib * @build sun.hotspot.WhiteBox * @run driver ClassFileInstaller sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeSweeperStats.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeSweeperStats.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCodeSweeperStats.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCodeSweeperStats.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,9 +41,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.Utils; -/* +/** * @test TestCodeSweeperStats * @key jfr + * @requires vm.hasJFR * @library /test/lib * @requires vm.compMode!="Xint" * @build sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerCompile.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerCompile.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerCompile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerCompile.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,9 +39,10 @@ import jdk.test.lib.jfr.Events; import sun.hotspot.WhiteBox; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.compMode!="Xint" * @library /test/lib * @build sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerConfig.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerConfig.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerConfig.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerConfig.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.compiler.TestCompilerConfig */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerInlining.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerInlining.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerInlining.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerInlining.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,11 +43,12 @@ import java.util.*; import java.util.stream.IntStream; -/* +/** * @test CompilerInliningTest * @bug 8073607 * @key jfr * @summary Verifies that corresponding JFR events are emitted in case of inlining. + * @requires vm.hasJFR * * @requires vm.opt.Inline == true | vm.opt.Inline == null * @library /test/lib diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerPhase.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerPhase.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerPhase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerPhase.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.Events; import sun.hotspot.WhiteBox; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.compMode!="Xint" & vm.flavor == "server" & (vm.opt.TieredStopAtLevel == 4 | vm.opt.TieredStopAtLevel == null) * @library /test/lib * @build sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerStats.java openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerStats.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/compiler/TestCompilerStats.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/compiler/TestCompilerStats.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.compiler.TestCompilerStats */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSConcurrent.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.collection; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * @requires vm.opt.ExplicitGCInvokesConcurrent != false * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithCMSMarkSweep.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.collection; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * @requires vm.opt.ExplicitGCInvokesConcurrent != true diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1ConcurrentMark.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1ConcurrentMark.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1ConcurrentMark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1ConcurrentMark.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.collection; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "G1" | vm.gc == null * @requires vm.opt.ExplicitGCInvokesConcurrent != false diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1FullCollection.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1FullCollection.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1FullCollection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithG1FullCollection.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.collection; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "G1" | vm.gc == null * @requires vm.opt.ExplicitGCInvokesConcurrent != true diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithParallelOld.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.collection; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithPSMarkSweep.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithPSMarkSweep.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithPSMarkSweep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithPSMarkSweep.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.collection; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCCauseWithSerial.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.collection; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "Serial" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSConcurrent.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * & vm.opt.ExplicitGCInvokesConcurrent != false diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithCMSMarkSweep.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * & vm.opt.ExplicitGCInvokesConcurrent != true diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1ConcurrentMark.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1ConcurrentMark.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1ConcurrentMark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1ConcurrentMark.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "G1" | vm.gc == null) * & vm.opt.ExplicitGCInvokesConcurrent != false diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1FullCollection.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1FullCollection.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1FullCollection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithG1FullCollection.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "G1" | vm.gc == null) * & vm.opt.ExplicitGCInvokesConcurrent != true diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParallelOld.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParallelOld.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParallelOld.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParallelOld.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithParNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithPSMarkSweep.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithPSMarkSweep.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithPSMarkSweep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithPSMarkSweep.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithSerial.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithSerial.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithSerial.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCEventMixedWithSerial.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "Serial" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCGarbageCollectionEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCGarbageCollectionEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCGarbageCollectionEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCGarbageCollectionEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -Xlog:gc*=debug -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps jdk.jfr.event.gc.collection.TestGCGarbageCollectionEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCWithFasttime.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCWithFasttime.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestGCWithFasttime.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestGCWithFasttime.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UseParallelGC -XX:+UseParallelOldGC jdk.jfr.event.gc.collection.TestGCWithFasttime diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithDefNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithDefNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithDefNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithDefNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Serial" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -Xmx50m -Xmn2m -XX:+UseSerialGC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug jdk.jfr.event.gc.collection.TestYoungGarbageCollectionEventWithDefNew diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithG1New.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithG1New.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithG1New.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithG1New.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -Xmx50m -Xmn2m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug jdk.jfr.event.gc.collection.TestYoungGarbageCollectionEventWithG1New diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParallelScavenge.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParallelScavenge.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParallelScavenge.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParallelScavenge.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -Xmx50m -Xmn2m -XX:+UseParallelGC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:-UseAdaptiveSizePolicy -Xlog:gc+heap=trace,gc*=debug jdk.jfr.event.gc.collection.TestYoungGarbageCollectionEventWithParallelScavenge diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/collection/TestYoungGarbageCollectionEventWithParNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.collection; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * @library /test/lib /test/jdk * @run main/othervm -Xmx50m -Xmn2m -XX:+UseConcMarkSweepGC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug jdk.jfr.event.gc.collection.TestYoungGarbageCollectionEventWithParNew diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.EventVerifier; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "Parallel" | vm.gc == null) * & vm.opt.ExplicitGCInvokesConcurrent != true * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEventWithDefaultPauseTarget.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEventWithDefaultPauseTarget.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEventWithDefaultPauseTarget.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCConfigurationEventWithDefaultPauseTarget.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.EventVerifier; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps jdk.jfr.event.gc.configuration.TestGCConfigurationEventWithDefaultPauseTarget */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWith32BitOops.sh openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWith32BitOops.sh --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWith32BitOops.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWith32BitOops.sh 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,7 @@ # # @test TestGCHeapConfigurationEventWith32BitOops # @key jfr +# @requires vm.hasJFR # @requires vm.gc == "Parallel" | vm.gc == null # @library /test/lib /test/jdk # @build jdk.jfr.event.gc.configuration.TestGCHeapConfigurationEventWith32BitOops sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithHeapBasedOops.sh openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithHeapBasedOops.sh --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithHeapBasedOops.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithHeapBasedOops.sh 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,7 @@ # # @test TestGCHeapConfigurationEventWithHeapBasedOops # @key jfr +# @requires vm.hasJFR # @requires vm.gc == "Parallel" | vm.gc == null # @library /test/lib /test/jdk # @build jdk.jfr.event.gc.configuration.TestGCHeapConfigurationEventWithHeapBasedOops diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithZeroBasedOops.sh openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithZeroBasedOops.sh --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithZeroBasedOops.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCHeapConfigurationEventWithZeroBasedOops.sh 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,7 @@ # # @test TestGCHeapConfigurationEventWithZeroBasedOops # @key jfr +# @requires vm.hasJFR # @requires vm.gc == "Parallel" | vm.gc == null # @library /test/lib /test/jdk # @build jdk.jfr.event.gc.configuration.TestGCHeapConfigurationEventWithZeroBasedOops diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCSurvivorConfigurationEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCSurvivorConfigurationEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCSurvivorConfigurationEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCSurvivorConfigurationEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.EventVerifier; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:MaxTenuringThreshold=13 -XX:InitialTenuringThreshold=9 jdk.jfr.event.gc.configuration.TestGCSurvivorConfigurationEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCTLABConfigurationEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCTLABConfigurationEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCTLABConfigurationEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCTLABConfigurationEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.EventVerifier; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:+UseTLAB -XX:MinTLABSize=3k -XX:TLABRefillWasteFraction=96 jdk.jfr.event.gc.configuration.TestGCTLABConfigurationEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithMinAndMaxSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,9 +30,10 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run driver jdk.jfr.event.gc.configuration.TestGCYoungGenerationConfigurationEventWithMinAndMaxSize */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithNewRatio.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithNewRatio.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithNewRatio.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/configuration/TestGCYoungGenerationConfigurationEventWithNewRatio.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,9 +28,10 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.EventVerifier; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:NewRatio=4 jdk.jfr.event.gc.configuration.TestGCYoungGenerationConfigurationEventWithNewRatio */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestCMSConcurrentModeFailureEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationFailedEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @library /test/lib /test/jdk * @requires vm.gc == "G1" | vm.gc == null diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationInfoEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationInfoEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationInfoEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestEvacuationInfoEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,9 +36,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:G1HeapRegionSize=1m -Xmx64m -Xmn16m -XX:+UseG1GC jdk.jfr.event.gc.detailed.TestEvacuationInfoEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1AIHOPEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1AIHOPEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1AIHOPEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1AIHOPEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:NewSize=2m -XX:MaxNewSize=2m -Xmx32m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+G1UseAdaptiveIHOP jdk.jfr.event.gc.detailed.TestG1AIHOPEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1ConcurrentModeFailureEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1ConcurrentModeFailureEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1ConcurrentModeFailureEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1ConcurrentModeFailureEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "G1" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1EvacMemoryStatsEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1EvacMemoryStatsEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1EvacMemoryStatsEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1EvacMemoryStatsEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:NewSize=2m -XX:MaxNewSize=2m -Xmx32m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps jdk.jfr.event.gc.detailed.TestG1EvacMemoryStatsEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1HeapRegionTypeChangeEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1HeapRegionTypeChangeEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1HeapRegionTypeChangeEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1HeapRegionTypeChangeEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @bug 8149650 + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @key jfr * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1IHOPEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1IHOPEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1IHOPEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1IHOPEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:NewSize=2m -XX:MaxNewSize=2m -Xmx32m -XX:+UseG1GC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:-G1UseAdaptiveIHOP jdk.jfr.event.gc.detailed.TestG1IHOPEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1MMUEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1MMUEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestG1MMUEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestG1MMUEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:NewSize=2m -XX:MaxNewSize=2m -Xmx32m -XX:+UseG1GC -XX:MaxGCPauseMillis=75 -XX:GCPauseIntervalMillis=150 -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps jdk.jfr.event.gc.detailed.TestG1MMUEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithG1.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,10 +24,11 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test * @key jfr * @summary Test that events are created when an object is aged or promoted during a GC and the copying of the object requires a new PLAB or direct heap allocation + * @requires vm.hasJFR * * @requires (vm.gc == "G1" | vm.gc == null) * & vm.opt.ExplicitGCInvokesConcurrent != true diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithParallelScavenge.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithParallelScavenge.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithParallelScavenge.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionEventWithParallelScavenge.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,10 +24,11 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test * @key jfr * @summary Test that events are created when an object is aged or promoted during a GC and the copying of the object requires a new PLAB or direct heap allocation + * @requires vm.hasJFR * * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithDefNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithDefNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithDefNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithDefNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.detailed; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "Serial" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParallelScavenge.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParallelScavenge.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParallelScavenge.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParallelScavenge.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,9 +25,10 @@ package jdk.jfr.event.gc.detailed; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestPromotionFailedEventWithParNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.event.gc.detailed.TestPromotionFailedEventWithParNew diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithCMS.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,9 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test + * @requires vm.hasJFR * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled * @library /test/lib /test/jdk * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx64m jdk.jfr.event.gc.detailed.TestStressAllocationGCEventsWithCMS diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithDefNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithDefNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithDefNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithDefNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,9 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test + * @requires vm.hasJFR * @requires vm.gc == "null" | vm.gc == "Serial" * @library /test/lib /test/jdk * @run main/othervm -XX:+UseSerialGC -Xmx64m jdk.jfr.event.gc.detailed.TestStressAllocationGCEventsWithDefNew diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithG1.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithG1.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithG1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithG1.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,9 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test + * @requires vm.hasJFR * @requires vm.gc == "null" | vm.gc == "G1" * @library /test/lib /test/jdk * @run main/othervm -XX:+UseG1GC -Xmx64m jdk.jfr.event.gc.detailed.TestStressAllocationGCEventsWithG1 diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParallel.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParallel.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParallel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParallel.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,9 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test + * @requires vm.hasJFR * @requires vm.gc == "null" | vm.gc == "Parallel" * @library /test/lib /test/jdk * @run main/othervm -XX:+UseParallelGC -Xmx64m jdk.jfr.event.gc.detailed.TestStressAllocationGCEventsWithParallel diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressAllocationGCEventsWithParNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,9 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test + * @requires vm.hasJFR * @requires vm.gc == "null" & !vm.graal.enabled * @library /test/lib /test/jdk * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx64m jdk.jfr.event.gc.detailed.TestStressAllocationGCEventsWithParNew diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithCMS.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,9 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test + * @requires vm.hasJFR * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled * @library /test/lib /test/jdk * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx256m jdk.jfr.event.gc.detailed.TestStressBigAllocationGCEventsWithCMS 1048576 diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithDefNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithDefNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithDefNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithDefNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,9 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test + * @requires vm.hasJFR * @requires vm.gc == "null" | vm.gc == "Serial" * @library /test/lib /test/jdk * @run main/othervm -XX:+UseSerialGC -Xmx256m jdk.jfr.event.gc.detailed.TestStressBigAllocationGCEventsWithDefNew 1048576 diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithG1.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithG1.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithG1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithG1.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,6 +32,7 @@ * fits exactly to one region, if not - G1 will allocate another almost empty * region as a continue of humongous. Thus we will exhaust memory very fast and * test will fail with OOME. + * @requires vm.hasJFR * @requires vm.gc == "null" | vm.gc == "G1" * @library /test/lib /test/jdk * @run main/othervm -XX:+UseG1GC -XX:MaxNewSize=5m -Xmx256m -XX:G1HeapRegionSize=1048576 jdk.jfr.event.gc.detailed.TestStressBigAllocationGCEventsWithG1 1048544 diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParallel.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParallel.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParallel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParallel.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,9 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test + * @requires vm.hasJFR * @requires vm.gc == "null" | vm.gc == "Parallel" * @library /test/lib /test/jdk * @run main/othervm -XX:+UseParallelGC -Xmx256m jdk.jfr.event.gc.detailed.TestStressBigAllocationGCEventsWithParallel 1048576 diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestStressBigAllocationGCEventsWithParNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,9 @@ */ package jdk.jfr.event.gc.detailed; -/* +/** * @test + * @requires vm.hasJFR * @requires vm.gc == "null" & !vm.graal.enabled * @library /test/lib /test/jdk * @run main/othervm -XX:+UseConcMarkSweepGC -Xmx256m jdk.jfr.event.gc.detailed.TestStressBigAllocationGCEventsWithParNew 1048576 diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestTenuringDistributionEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestTenuringDistributionEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/detailed/TestTenuringDistributionEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/detailed/TestTenuringDistributionEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @bug 8009538 + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @key jfr * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryCommittedSize.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryCommittedSize.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryCommittedSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryCommittedSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,9 +36,10 @@ import jdk.test.lib.jfr.GCHelper; import sun.hotspot.WhiteBox; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @build sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventConcurrentCMS.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * & vm.opt.ExplicitGCInvokesConcurrent != false * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventDefNewSerial.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventDefNewSerial.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventDefNewSerial.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventDefNewSerial.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.heapsummary; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Serial" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UseSerialGC jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventDefNewSerial diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventG1.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventG1.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventG1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventG1.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.heapsummary; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "G1" | vm.gc == null) * & vm.opt.ExplicitGCInvokesConcurrent != true * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventParNewCMS.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.heapsummary; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * & vm.opt.ExplicitGCInvokesConcurrent != true * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSParOld.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSParOld.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSParOld.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSParOld.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.heapsummary; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseParallelGC jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventPSParOld diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSSerial.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSSerial.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSSerial.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/heapsummary/TestHeapSummaryEventPSSerial.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.heapsummary; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:-UseParallelOldGC -XX:+UseParallelGC jdk.jfr.event.gc.heapsummary.TestHeapSummaryEventPSSerial diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSConcurrent.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.objectcount; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * & vm.opt.ExplicitGCInvokesConcurrent != false * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithCMSMarkSweep.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.objectcount; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * & vm.opt.ExplicitGCInvokesConcurrent != true * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1ConcurrentMark.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1ConcurrentMark.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1ConcurrentMark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1ConcurrentMark.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.objectcount; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "G1" | vm.gc == null) * & vm.opt.ExplicitGCInvokesConcurrent != false * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1FullCollection.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1FullCollection.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1FullCollection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithG1FullCollection.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.objectcount; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "G1" | vm.gc == null) * & vm.opt.ExplicitGCInvokesConcurrent != true * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithParallelOld.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithParallelOld.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithParallelOld.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithParallelOld.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.objectcount; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseParallelGC -XX:+UseParallelOldGC -XX:MarkSweepDeadRatio=0 -XX:-UseCompressedOops -XX:+IgnoreUnrecognizedVMOptions jdk.jfr.event.gc.objectcount.TestObjectCountAfterGCEventWithParallelOld diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithPSMarkSweep.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithPSMarkSweep.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithPSMarkSweep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithPSMarkSweep.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.objectcount; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UseParallelGC -XX:-UseParallelOldGC -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:MarkSweepDeadRatio=0 -XX:-UseCompressedOops -XX:+IgnoreUnrecognizedVMOptions jdk.jfr.event.gc.objectcount.TestObjectCountAfterGCEventWithPSMarkSweep diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithSerial.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithSerial.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithSerial.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountAfterGCEventWithSerial.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.objectcount; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Serial" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseSerialGC -XX:MarkSweepDeadRatio=0 -XX:-UseCompressedOops -XX:+IgnoreUnrecognizedVMOptions jdk.jfr.event.gc.objectcount.TestObjectCountAfterGCEventWithSerial diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/objectcount/TestObjectCountEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Serial" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -XX:+UseSerialGC -XX:-UseCompressedOops -XX:MarkSweepDeadRatio=0 -XX:+IgnoreUnrecognizedVMOptions jdk.jfr.event.gc.objectcount.TestObjectCountEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSConcurrent.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.refstat; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * & vm.opt.ExplicitGCInvokesConcurrent != false * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithCMSMarkSweep.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.refstat; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "ConcMarkSweep" | vm.gc == null) & !vm.graal.enabled * & vm.opt.ExplicitGCInvokesConcurrent != true * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithDefNew.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithDefNew.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithDefNew.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithDefNew.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.refstat; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Serial" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug -Xmx50m -Xmn2m -XX:+UseSerialGC jdk.jfr.event.gc.refstat.TestRefStatEventWithDefNew diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1ConcurrentMark.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1ConcurrentMark.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1ConcurrentMark.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1ConcurrentMark.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.refstat; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "G1" | vm.gc == null) * & vm.opt.ExplicitGCInvokesConcurrent != false * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1FullCollection.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1FullCollection.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1FullCollection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1FullCollection.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.refstat; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires (vm.gc == "G1" | vm.gc == null) * & vm.opt.ExplicitGCInvokesConcurrent != true * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1New.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1New.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1New.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithG1New.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.refstat; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug -Xmx50m -Xmn2m -XX:+UseG1GC jdk.jfr.event.gc.refstat.TestRefStatEventWithG1New diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelOld.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelOld.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelOld.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelOld.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.refstat; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug -XX:+UseParallelGC -XX:+UseParallelOldGC jdk.jfr.event.gc.refstat.TestRefStatEventWithParallelOld diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelScavenge.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelScavenge.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelScavenge.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithParallelScavenge.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.refstat; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug -Xmx50m -Xmn2m -XX:-UseLargePages -XX:+UseParallelGC -XX:-UseAdaptiveSizePolicy jdk.jfr.event.gc.refstat.TestRefStatEventWithParallelScavenge diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithPSMarkSweep.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithPSMarkSweep.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithPSMarkSweep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/refstat/TestRefStatEventWithPSMarkSweep.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,9 +26,10 @@ package jdk.jfr.event.gc.refstat; import jdk.test.lib.jfr.GCHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps -Xlog:gc+heap=trace,gc*=debug -XX:+UseParallelGC -XX:-UseParallelOldGC jdk.jfr.event.gc.refstat.TestRefStatEventWithPSMarkSweep diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestConcMarkSweepAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestDefNewAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestDefNewAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestDefNewAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestDefNewAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "Serial" * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1HumongousAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1HumongousAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1HumongousAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1HumongousAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "G1" * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1OldAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1OldAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1OldAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1OldAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "G1" * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1YoungAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1YoungAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1YoungAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestG1YoungAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "G1" * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMarkSweepCompactAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMarkSweepCompactAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMarkSweepCompactAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMarkSweepCompactAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "Serial" * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceConcMarkSweepGCAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled * @requires !(vm.compMode == "Xcomp" & os.arch == "aarch64") diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceG1GCAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceG1GCAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceG1GCAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceG1GCAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,9 +23,10 @@ * questions. */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "G1" * @requires !(vm.compMode == "Xcomp" & os.arch == "aarch64") diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceParallelGCAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceParallelGCAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceParallelGCAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceParallelGCAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "Parallel" * @requires !(vm.compMode == "Xcomp" & os.arch == "aarch64") diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceSerialGCAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceSerialGCAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceSerialGCAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestMetaspaceSerialGCAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "Serial" * @requires !(vm.compMode == "Xcomp" & os.arch == "aarch64") diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelMarkSweepAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelMarkSweepAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelMarkSweepAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelMarkSweepAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "Parallel" * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelScavengeAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelScavengeAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelScavengeAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestParallelScavengeAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires vm.gc == "null" | vm.gc == "Parallel" * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/gc/stacktrace/TestParNewAllocationPendingStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,9 +24,10 @@ */ package jdk.jfr.event.gc.stacktrace; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @requires (vm.gc == "null" | vm.gc == "ConcMarkSweep") & !vm.graal.enabled * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/EvilInstrument.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/EvilInstrument.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/EvilInstrument.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/EvilInstrument.java 2018-07-25 15:36:46.000000000 +0000 @@ -46,6 +46,7 @@ * @summary This test runs JFR with a javaagent that reads/writes files and * sockets during every class definition. This is to verify that the i/o * instrumentation in JFR does not interfere with javaagents. + * @requires vm.hasJFR * * @library /test/lib /test/jdk * @modules java.instrument diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestDisabledEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestDisabledEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestDisabledEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestDisabledEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,10 +39,11 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test with FlightRecorder enabled but with the events disabled. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.event.io.TestDisabledEvents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestFileChannelEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestFileChannelEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestFileChannelEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestFileChannelEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,9 +39,10 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.event.io.TestFileChannelEvents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestFileReadOnly.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestFileReadOnly.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestFileReadOnly.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestFileReadOnly.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,9 +40,10 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.event.io.TestFileReadOnly */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestFileStreamEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestFileStreamEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestFileStreamEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestFileStreamEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.Events; -/* +/** * @test TestFileStreamEvents * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.event.io.TestFileStreamEvents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestInstrumentation.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestInstrumentation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestInstrumentation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestInstrumentation.java 2018-07-25 15:36:46.000000000 +0000 @@ -47,6 +47,7 @@ * @test * @summary Test that will instrument the same classes that JFR will also instrument. * @key jfr + * @requires vm.hasJFR * * @library /test/lib /test/jdk * @modules java.base/jdk.internal.org.objectweb.asm diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestRandomAccessFileEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestRandomAccessFileEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestRandomAccessFileEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestRandomAccessFileEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,9 +37,10 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.event.io.TestRandomAccessFileEvents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestRandomAccessFileThread.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestRandomAccessFileThread.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestRandomAccessFileThread.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestRandomAccessFileThread.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,10 +42,11 @@ import jdk.test.lib.thread.XRun; -/* +/** * @test * @summary Verify the event time stamp and thread name * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:+UnlockExperimentalVMOptions -XX:-UseFastUnorderedTimeStamps jdk.jfr.event.io.TestRandomAccessFileThread */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestSocketChannelEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestSocketChannelEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestSocketChannelEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestSocketChannelEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,9 +41,10 @@ import jdk.test.lib.thread.TestThread; import jdk.test.lib.thread.XRun; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.event.io.TestSocketChannelEvents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestSocketEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestSocketEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/io/TestSocketEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/io/TestSocketEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,9 +42,10 @@ import jdk.test.lib.thread.TestThread; import jdk.test.lib.thread.XRun; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.event.io.TestSocketEvents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/metadata/TestDefaultConfigurations.java openjdk-11-11~24/test/jdk/jdk/jfr/event/metadata/TestDefaultConfigurations.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/metadata/TestDefaultConfigurations.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/metadata/TestDefaultConfigurations.java 2018-07-25 15:36:46.000000000 +0000 @@ -53,9 +53,10 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @library /test/lib * @modules java.xml diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/metadata/TestEventMetadata.java openjdk-11-11~24/test/jdk/jdk/jfr/event/metadata/TestEventMetadata.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/metadata/TestEventMetadata.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/metadata/TestEventMetadata.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.metadata.TestEventMetadata */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestAllocationTime.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestAllocationTime.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestAllocationTime.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestAllocationTime.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,9 +37,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestArrayInformation.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestArrayInformation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestArrayInformation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestArrayInformation.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,9 +36,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestCircularReference.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestCircularReference.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestCircularReference.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestCircularReference.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestClassLoaderLeak.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestCMS.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestCMS.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestCMS.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestCMS.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" & !vm.graal.enabled * @summary Test leak profiler with CMS GC * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestFieldInformation.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestFieldInformation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestFieldInformation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestFieldInformation.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestG1.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestG1.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestG1.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestG1.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @summary Test leak profiler with G1 GC * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestHeapDeep.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestHeapDeep.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestHeapDeep.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestHeapDeep.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestHeapShallow.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestHeapShallow.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestHeapShallow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestHeapShallow.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.jfr.internal.test.WhiteBox; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestLargeRootSet.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestLargeRootSet.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestLargeRootSet.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestLargeRootSet.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestLastKnownHeapUsage.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestLastKnownHeapUsage.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestLastKnownHeapUsage.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestLastKnownHeapUsage.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,87 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package jdk.jfr.event.oldobject; + +import java.io.IOException; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.ArrayList; +import java.util.List; + +import jdk.jfr.Recording; +import jdk.jfr.consumer.RecordedEvent; +import jdk.jfr.consumer.RecordingFile; +import jdk.jfr.internal.test.WhiteBox; +import jdk.test.lib.jfr.EventNames; +import jdk.test.lib.jfr.Events; + +/** + * @test + * @key jfr + * @requires vm.hasJFR + * @requires vm.gc == "null" + * @library /test/lib /test/jdk + * @modules jdk.jfr/jdk.jfr.internal.test + * @run main/othervm -XX:TLABSize=2k -XX:-FastTLABRefill jdk.jfr.event.oldobject.TestLastKnownHeapUsage + */ +public class TestLastKnownHeapUsage { + + public final static List heap = new ArrayList<>(); + + public static void main(String[] args) throws Exception { + WhiteBox.setWriteAllObjectSamples(true); + long last = 0; + for (int i = 1; i <= 5; i++) { + long heapUsage = recordOldObjects(i); + System.out.println("Recording: " + i + " heapUsage=" + heapUsage); + if (heapUsage < last) { + throw new Exception("Unexpect decrease of heap usage"); + } + } + } + + private static long recordOldObjects(int index) throws IOException { + try (Recording r = new Recording()) { + r.enable(EventNames.OldObjectSample).withStackTrace().with("cutoff", "infinity"); + r.start(); + System.gc(); + for (int i = 0; i < 20; i++) { + heap.add(new byte[1_000_000]); + } + System.gc(); + r.stop(); + Path p = Paths.get("recording-" + index + ".jfr"); + r.dump(p); + List events = RecordingFile.readAllEvents(p); + Events.hasEvents(events); + long max = 0; + for (RecordedEvent e : RecordingFile.readAllEvents(p)) { + long heapUsage = Events.assertField(e, "lastKnownHeapUsage").atLeast(0L).below(1_000_000_000L).getValue(); + max = Math.max(max, heapUsage); + } + return max; + } + } +} diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestListenerLeak.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestListenerLeak.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestListenerLeak.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestListenerLeak.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestMetadataRetention.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestMetadataRetention.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestMetadataRetention.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestMetadataRetention.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,9 +41,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.TestClassLoader; -/* +/** * @test * @summary The test verifies that an old object sample maintains references to "stale" metadata + * @requires vm.hasJFR * @requires vm.gc == "null" * @key jfr * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestObjectDescription.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestObjectDescription.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestObjectDescription.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestObjectDescription.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,9 +39,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestParallel.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestParallel.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestParallel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestParallel.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @summary Test leak profiler with Parallel GC * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestParallelOld.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestParallelOld.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestParallelOld.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestParallelOld.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @summary Test leak profiler with Parallel Old GC * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestReferenceChainLimit.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestReferenceChainLimit.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestReferenceChainLimit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestReferenceChainLimit.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestSanityDefault.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestSanityDefault.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestSanityDefault.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestSanityDefault.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @library /test/lib /test/jdk * @summary Purpose of this test is to run leak profiler without command line tweaks or WhiteBox hacks until we succeed diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestSerial.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestSerial.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestSerial.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestSerial.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @requires vm.gc == "null" * @summary Test leak profiler with Serial GC * @library /test/lib /test/jdk diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestThreadLocalLeak.java openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestThreadLocalLeak.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/oldobject/TestThreadLocalLeak.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/oldobject/TestThreadLocalLeak.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal.test * @run main/othervm -XX:TLABSize=2k jdk.jfr.event.oldobject.TestThreadLocalLeak diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestCPUInformation.java openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestCPUInformation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestCPUInformation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestCPUInformation.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.os.TestCPUInformation */ @@ -53,8 +54,8 @@ Events.assertField(event, "hwThreads").atLeast(1); Events.assertField(event, "cores").atLeast(1); Events.assertField(event, "sockets").atLeast(1); - Events.assertField(event, "cpu").containsAny("Intel", "AMD", "Unknown x86", "sparc", "ARM", "PPC", "PowerPC", "AArch64"); - Events.assertField(event, "description").containsAny("Intel", "AMD", "Unknown x86", "SPARC", "ARM", "PPC", "PowerPC", "AArch64"); + Events.assertField(event, "cpu").containsAny("Intel", "AMD", "Unknown x86", "sparc", "ARM", "PPC", "PowerPC", "AArch64", "s390"); + Events.assertField(event, "description").containsAny("Intel", "AMD", "Unknown x86", "SPARC", "ARM", "PPC", "PowerPC", "AArch64", "zArch"); } } } diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestCPULoad.java openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestCPULoad.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestCPULoad.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestCPULoad.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.os.TestCPULoad */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestCPUTimeStampCounter.java openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestCPUTimeStampCounter.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestCPUTimeStampCounter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestCPUTimeStampCounter.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.os.TestCPUTimeStampCounter */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.sh openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.sh --- openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestInitialEnvironmentVariable.sh 2018-07-25 15:36:46.000000000 +0000 @@ -22,9 +22,11 @@ # # @test # @key jfr +# @requires vm.hasJFR # @library /test/lib # @build jdk.jfr.event.os.TestInitialEnvironmentVariable # @run shell TestInitialEnvironmentVariable.sh + echo ------------------------------------------------------------- echo "TESTCLASSES='$TESTCLASSES'" echo "TESTSRC='$TESTSRC'" diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestOSInfo.java openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestOSInfo.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestOSInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestOSInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.os.TestOSInfo */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestPhysicalMemoryEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestPhysicalMemoryEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestPhysicalMemoryEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestPhysicalMemoryEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.os.TestPhysicalMemoryEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestSystemProcess.java openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestSystemProcess.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestSystemProcess.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestSystemProcess.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.os.TestSystemProcess */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestThreadContextSwitches.java openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestThreadContextSwitches.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/os/TestThreadContextSwitches.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/os/TestThreadContextSwitches.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.os.TestThreadContextSwitches */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/profiling/TestFullStackTrace.java openjdk-11-11~24/test/jdk/jdk/jfr/event/profiling/TestFullStackTrace.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/profiling/TestFullStackTrace.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/profiling/TestFullStackTrace.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.RecurseThread; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.profiling.TestFullStackTrace */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestActiveRecordingEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestActiveRecordingEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestActiveRecordingEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestActiveRecordingEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,10 +43,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Tests that the recording properties are properly reflected in the ActiveRecording event * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestActiveRecordingEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestActiveSettingEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,10 +40,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Tests that active setting are available in the ActiveSettingevent * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestActiveSettingEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestBiasedLockRevocationEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestBiasedLockRevocationEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestBiasedLockRevocationEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestBiasedLockRevocationEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,9 +37,10 @@ import java.util.concurrent.FutureTask; import java.util.stream.Collectors; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * * @run main/othervm jdk.jfr.event.runtime.TestBiasedLockRevocationEvents diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassDefineEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassDefineEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassDefineEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassDefineEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,9 +36,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.TestClassLoader; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @build jdk.jfr.event.runtime.TestClasses * @run main/othervm jdk.jfr.event.runtime.TestClassDefineEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassLoaderStatsEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassLoaderStatsEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassLoaderStatsEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassLoaderStatsEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,9 +39,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @build jdk.jfr.event.runtime.TestClasses * @run main/othervm jdk.jfr.event.runtime.TestClassLoaderStatsEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassLoadEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassLoadEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassLoadEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassLoadEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,9 +37,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.TestClassLoader; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @build jdk.jfr.event.runtime.TestClasses * @run main/othervm jdk.jfr.event.runtime.TestClassLoadEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassLoadingStatisticsEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassLoadingStatisticsEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassLoadingStatisticsEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassLoadingStatisticsEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.TestClassLoader; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @build jdk.jfr.event.runtime.TestClasses * @run main/othervm jdk.jfr.event.runtime.TestClassLoadingStatisticsEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassUnloadEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassUnloadEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestClassUnloadEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestClassUnloadEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.TestClassLoader; -/* +/** * @test * @summary The test verifies that a class unload event is created when class is unloaded * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @build jdk.jfr.event.runtime.TestClasses * @run main/othervm -Xlog:class+unload -Xlog:gc -Xmx16m jdk.jfr.event.runtime.TestClassUnloadEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestExceptionEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestExceptionEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestExceptionEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestExceptionEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestExceptionEvents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestExceptionSubclass.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestExceptionSubclass.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestExceptionSubclass.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestExceptionSubclass.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,10 +27,11 @@ import java.util.concurrent.TimeUnit; -/* +/** * @test * @key jfr * @bug 8013122 + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestExceptionSubclass */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaBlockedEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaBlockedEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaBlockedEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaBlockedEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,9 +40,10 @@ import jdk.test.lib.thread.TestThread; import jdk.test.lib.thread.XRun; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * * @run main/othervm jdk.jfr.event.runtime.TestJavaBlockedEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorInflateEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorInflateEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorInflateEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorInflateEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.thread.TestThread; import jdk.test.lib.thread.XRun; -/* +/** * @test TestJavaMonitorInflateEvent * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestJavaMonitorInflateEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.thread.TestThread; import jdk.test.lib.thread.XRun; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestJavaMonitorWaitEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitTimeOut.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitTimeOut.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitTimeOut.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaMonitorWaitTimeOut.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestJavaMonitorWaitTimeOut */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEventBean.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEventBean.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEventBean.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEventBean.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,9 +37,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * * @run main/othervm jdk.jfr.event.runtime.TestJavaThreadStatisticsEventBean diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestJavaThreadStatisticsEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,9 +37,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestJavaThreadStatisticsEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestModuleEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Tests the JFR events related to modules * @key jfr + * @requires vm.hasJFR * @requires !vm.graal.enabled * @library /test/lib * @run main/othervm --limit-modules java.base,jdk.jfr jdk.jfr.event.runtime.TestModuleEvents diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestNativeLibrariesEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,9 +37,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestNativeLibrariesEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestNetworkUtilizationEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.jfr.event.runtime; + +import jdk.jfr.Recording; +import jdk.jfr.consumer.RecordedEvent; +import jdk.test.lib.Asserts; +import jdk.test.lib.Platform; +import jdk.test.lib.jfr.EventNames; +import jdk.test.lib.jfr.Events; + +import java.net.DatagramPacket; +import java.net.DatagramSocket; +import java.net.InetAddress; +import java.time.Duration; +import java.time.Instant; +import java.util.List; +import java.util.Map; + +import static java.util.stream.Collectors.averagingLong; +import static java.util.stream.Collectors.groupingBy; + +/** + * @test + * @key jfr + * @requires vm.hasJFR + * @library /test/lib + * + * @run main/othervm jdk.jfr.event.runtime.TestNetworkUtilizationEvent + */ +public class TestNetworkUtilizationEvent { + + private static final long packetSendCount = 100; + + public static void main(String[] args) throws Throwable { + testSimple(); + } + + static void testSimple() throws Throwable { + + Instant start = Instant.now(); + Recording recording = new Recording(); + recording.enable(EventNames.NetworkUtilization); + recording.start(); + + DatagramSocket socket = new DatagramSocket(); + String msg = "hello!"; + byte[] buf = msg.getBytes(); + + // Send a few packets both to the loopback address as well to an external + DatagramPacket packet = new DatagramPacket(buf, buf.length, InetAddress.getLoopbackAddress(), 12345); + for (int i = 0; i < packetSendCount; ++i) { + socket.send(packet); + } + packet = new DatagramPacket(buf, buf.length, InetAddress.getByName("10.0.0.0"), 12345); + for (int i = 0; i < packetSendCount; ++i) { + socket.send(packet); + } + + // Now there should have been traffic on at least two different interfaces + recording.stop(); + Duration runtime = Duration.between(start, Instant.now()); + List events = Events.fromRecording(recording); + + // Calculate the average write rate for each interface + Map writeRates = events.stream() + .collect(groupingBy(e -> Events.assertField(e, "networkInterface").getValue(), + averagingLong(e -> Events.assertField(e, "writeRate").getValue()))); + + // Our test packets should have generated at least this much traffic per second + long expectedTraffic = (buf.length * packetSendCount) / Math.max(1, runtime.toSeconds()); + + // Count the number of interfaces that have seen at least our test traffic + long interfacesWithTraffic = writeRates.values().stream() + .filter(d -> d >= expectedTraffic) + .count(); + + if (Platform.isWindows() || Platform.isSolaris()) { + // Windows and Solaris do not track statistics for the loopback interface + Asserts.assertGreaterThanOrEqual(writeRates.size(), 1); + Asserts.assertGreaterThanOrEqual(interfacesWithTraffic, Long.valueOf(1)); + } else { + Asserts.assertGreaterThanOrEqual(writeRates.size(), 2); + Asserts.assertGreaterThanOrEqual(interfacesWithTraffic, Long.valueOf(2)); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestSafepointEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestSafepointEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestSafepointEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestSafepointEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,9 +38,10 @@ import jdk.test.lib.jfr.Events; import sun.hotspot.WhiteBox; -/* +/** * @test TestSafepointEvents * @key jfr + * @requires vm.hasJFR * @library /test/lib * @build sun.hotspot.WhiteBox * @run main ClassFileInstaller sun.hotspot.WhiteBox diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestSizeTFlags.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestSizeTFlags.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestSizeTFlags.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestSizeTFlags.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @bug 8058552 + * @requires vm.hasJFR * @requires vm.gc == "G1" | vm.gc == null * @key jfr * @summary Test checks that flags of type size_t are being sent to the jfr diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestSystemPropertyEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestSystemPropertyEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestSystemPropertyEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestSystemPropertyEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestSystemPropertyEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadAllocationEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadAllocationEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadAllocationEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadAllocationEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,9 +43,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr * jdk.management diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadCpuTimeEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadCpuTimeEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadCpuTimeEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadCpuTimeEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,9 +43,10 @@ import java.util.concurrent.CyclicBarrier; import java.util.stream.Collectors; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr * jdk.management @@ -160,26 +161,48 @@ return totalTime; } - static void testSimple() throws Throwable { - Recording recording = new Recording(); + static List generateEvents(int minimumEventCount, CyclicBarrier barrier) throws Throwable { + int retryCount = 0; - // Default period is once per chunk - recording.enable(EventNames.ThreadCPULoad).withPeriod(Duration.ofMillis(eventPeriodMillis)); - recording.start(); + while (true) { + Recording recording = new Recording(); + + // Default period is once per chunk + recording.enable(EventNames.ThreadCPULoad).withPeriod(Duration.ofMillis(eventPeriodMillis)); + recording.start(); + + // Run a single pass + barrier.await(); + barrier.await(); + + recording.stop(); + List events = Events.fromRecording(recording); + + long numEvents = events.stream() + .filter(e -> e.getThread().getJavaName().equals(cpuConsumerThreadName)) + .count(); + + // If the JFR periodicals thread is really starved, we may not get enough events. + // In that case, we simply retry the operation. + if (numEvents < minimumEventCount) { + System.out.println("Not enough events recorded, trying again..."); + if (retryCount++ > 10) { + Asserts.fail("Retry count exceeded"); + throw new RuntimeException(); + } + } else { + return events; + } + } + } + static void testSimple() throws Throwable { Duration testRunTime = Duration.ofMillis(eventPeriodMillis * cpuConsumerRunFactor); CyclicBarrier barrier = new CyclicBarrier(2); CpuConsumingThread thread = new CpuConsumingThread(testRunTime, barrier); - - // Run a single pass thread.start(); - barrier.await(); - barrier.await(); - recording.stop(); - List events = Events.fromRecording(recording); - - Events.hasEvents(events); + List events = generateEvents(1, barrier); verifyPerThreadInvariant(events, cpuConsumerThreadName); thread.interrupt(); @@ -187,23 +210,12 @@ } static void testCompareWithMXBean() throws Throwable { - Recording recording = new Recording(); - - recording.enable(EventNames.ThreadCPULoad).withPeriod(Duration.ofMillis(eventPeriodMillis)); - recording.start(); - Duration testRunTime = Duration.ofMillis(eventPeriodMillis * cpuConsumerRunFactor); CyclicBarrier barrier = new CyclicBarrier(2); CpuConsumingThread thread = new CpuConsumingThread(testRunTime, barrier); - - // Run a single pass thread.start(); - barrier.await(); - barrier.await(); - - recording.stop(); - List beforeEvents = Events.fromRecording(recording); + List beforeEvents = generateEvents(2, barrier); verifyPerThreadInvariant(beforeEvents, cpuConsumerThreadName); // Run a second single pass diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadDumpEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadDumpEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadDumpEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadDumpEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestThreadDumpEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadParkEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadParkEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadParkEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadParkEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,9 +41,10 @@ import jdk.test.lib.thread.TestThread; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * * @run main/othervm jdk.jfr.event.runtime.TestThreadParkEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadSleepEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadSleepEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadSleepEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadSleepEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestThreadSleepEvent */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadStartEndEvents.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadStartEndEvents.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThreadStartEndEvents.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThreadStartEndEvents.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.event.runtime.TestThreadStartEndEvents */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThrowableInstrumentation.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThrowableInstrumentation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestThrowableInstrumentation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestThrowableInstrumentation.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,10 +29,11 @@ import java.util.Objects; import jdk.test.lib.Platform; -/* +/** * @test * @bug 8153324 * @summary Verify instrumented Throwable bytecode by compiling it with C1. + * @requires vm.hasJFR * @library /test/lib * @modules java.base/jdk.internal.misc * java.management diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestVmFlagChangedEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestVmFlagChangedEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestVmFlagChangedEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestVmFlagChangedEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,9 +37,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test TestVmFlagChangedEvent * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr * jdk.management diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestVMInfoEvent.sh openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestVMInfoEvent.sh --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestVMInfoEvent.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestVMInfoEvent.sh 2018-07-25 15:36:46.000000000 +0000 @@ -22,6 +22,7 @@ # # @test # @key jfr +# @requires vm.hasJFR # @library /test/lib /test/jdk # @build jdk.jfr.event.runtime.TestVMInfoEvent # @run shell TestVMInfoEvent.sh diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestVMOperation.java openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestVMOperation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/runtime/TestVMOperation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/runtime/TestVMOperation.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,9 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test + * @requires vm.hasJFR * @requires vm.gc == "Parallel" | vm.gc == null * @key jfr * @library /test/lib diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/event/sampling/TestNative.java openjdk-11-11~24/test/jdk/jdk/jfr/event/sampling/TestNative.java --- openjdk-11-11~19/test/jdk/jdk/jfr/event/sampling/TestNative.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/event/sampling/TestNative.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,6 +40,7 @@ /* * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules java.base/jdk.internal.misc * @run main/native jdk.jfr.event.sampling.TestNative diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/JcmdAsserts.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/JcmdAsserts.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/JcmdAsserts.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/JcmdAsserts.java 2018-07-25 15:36:46.000000000 +0000 @@ -47,7 +47,7 @@ output.shouldMatch("Flight Recorder has been used"); } - public static void assertRecordingDumpedToFile(OutputAnalyzer output, String name, File recording) { + public static void assertRecordingDumpedToFile(OutputAnalyzer output, File recording) { output.shouldContain("Dumped recording"); output.shouldContain(recording.getAbsolutePath()); } diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdChangeLogLevel.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdChangeLogLevel.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdChangeLogLevel.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdChangeLogLevel.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.test.lib.dcmd.JcmdExecutor; import jdk.test.lib.dcmd.PidJcmdExecutor; -/* +/** * @test TestJcmdLogLevelChange * @key jfr * @summary Test changing log level + * @requires vm.hasJFR * * @library /test/lib /test/jdk * diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdConfigure.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdConfigure.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdConfigure.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdConfigure.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.jfr.internal.Options; import jdk.test.lib.Asserts; -/* +/** * @test * @summary The test verifies JFR.configure command * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jcmd.TestJcmdConfigure diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdDumpGeneratedFilename.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdDumpGeneratedFilename.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdDumpGeneratedFilename.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdDumpGeneratedFilename.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.jfr.jcmd; + +import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.util.Iterator; + +import jdk.jfr.Configuration; +import jdk.jfr.Recording; +import jdk.test.lib.jfr.FileHelper; +import jdk.test.lib.process.OutputAnalyzer; + +/** + * @test + * @summary The test verifies JFR.dump command + * @key jfr + * @requires vm.hasJFR + * @library /test/lib /test/jdk + * @run main/othervm jdk.jfr.jcmd.TestJcmdDumpGeneratedFilename + */ +public class TestJcmdDumpGeneratedFilename { + + public static void main(String[] args) throws Exception { + // Increase the id for a recording + for (int i = 0; i < 300; i++) { + new Recording(); + } + try (Recording r = new Recording(Configuration.getConfiguration("default"))) { + r.start(); + r.stop(); + testDumpFilename(); + testDumpFilename(r); + testDumpDiectory(); + testDumpDiectory(r); + } + } + + private static void testDumpFilename() throws Exception { + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump"); + verifyFile(readFilename(output), null); + } + + private static void testDumpFilename(Recording r) throws Exception { + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "name=" + r.getId()); + verifyFile(readFilename(output), r.getId()); + } + + private static void testDumpDiectory() throws Exception { + Path directory = Paths.get(".").toAbsolutePath().normalize(); + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "filename=" + directory); + String filename = readFilename(output); + verifyFile(filename, null); + verifyDirectory(filename, directory); + } + + private static void testDumpDiectory(Recording r) throws Exception { + Path directory = Paths.get(".").toAbsolutePath().normalize(); + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "name=" + r.getId(), "filename=" + directory); + String filename = readFilename(output); + verifyFile(filename, r.getId()); + verifyDirectory(filename, directory); + } + + private static void verifyDirectory(String filename, Path directory) throws Exception { + if (!filename.contains(directory.toAbsolutePath().normalize().toString())) { + throw new Exception("Expected dump to be at " + directory); + } + } + + private static void verifyFile(String filename, Long id) throws Exception { + String idText = id == null ? "" : "-id-" + Long.toString(id); + String expectedName = "hotspot-pid-" + ProcessHandle.current().pid() + idText; + if (!filename.contains(expectedName)) { + throw new Exception("Expected filename to contain " + expectedName); + } + FileHelper.verifyRecording(new File(filename)); + } + + private static String readFilename(OutputAnalyzer output) throws Exception { + Iterator it = output.asLines().iterator(); + while (it.hasNext()) { + String line = it.next(); + if (line.contains("written to")) { + line = it.next(); // blank line + return it.next(); + } + } + throw new Exception("Could not find filename of dumped recording."); + } +} diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdDump.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdDump.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdDump.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdDump.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,33 +26,147 @@ package jdk.jfr.jcmd; import java.io.File; - -import jdk.test.lib.jfr.FileHelper; +import java.nio.file.Files; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Predicate; + +import jdk.jfr.Event; +import jdk.jfr.Recording; +import jdk.jfr.consumer.RecordedEvent; +import jdk.jfr.consumer.RecordingFile; +import jdk.test.lib.jfr.EventNames; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary The test verifies JFR.dump command * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk - * @run main/othervm jdk.jfr.jcmd.TestJcmdDump + * @run main/othervm -XX:FlightRecorderOptions:maxchunksize=1M jdk.jfr.jcmd.TestJcmdDump */ public class TestJcmdDump { + static class StoppedEvent extends Event { + } + static class RunningEvent extends Event { + } + + private static final String[] names = { null, "r1" }; + private static final boolean booleanValues[] = { true, false }; + public static void main(String[] args) throws Exception { - String name = "TestJcmdDump"; - File recording = new File(name + ".jfr"); + // Create a stopped recording in the repository to complicate things + Recording r = new Recording(); + r.start(); + StoppedEvent de = new StoppedEvent(); + de.commit(); + r.stop(); + + // The implementation of JFR.dump touch code that can't be executed using the + // Java API. It is therefore important to try all combinations. The + // implementation is non-trivial and depends on the combination + for (String name : names) { + for (boolean disk : booleanValues) { + try (Recording r1 = new Recording(); Recording r2 = new Recording()) { + System.out.println(); + System.out.println(); + System.out.println("Starting recordings with disk=" + disk); + r1.setToDisk(disk); + // To complicate things, only enable OldObjectSample for one recording + r1.enable(EventNames.OldObjectSample).withoutStackTrace(); + r1.setName("r1"); + r2.setToDisk(disk); + r2.setName("r2"); + r1.start(); + r2.start(); + + // Expect no path to GC roots + jfrDump(Boolean.FALSE, name, disk, rootCount -> rootCount == 0); + // Expect path to GC roots + jfrDump(null, name, disk, rootCount -> rootCount == 0); + // Expect at least one path to a GC root + jfrDump(Boolean.TRUE, name, disk, rootCount -> rootCount > 0); + } + } + } + r.close(); // release recording data from the stopped recording + } + + private static void jfrDump(Boolean pathToGCRoots, String name, boolean disk, Predicate successPredicate) throws Exception { + List leakList = new ArrayList<>(); + leakList.add(new Object[1000_0000]); + System.gc(); + while (true) { + RunningEvent re = new RunningEvent(); + re.commit(); + leakList.add(new Object[1000_0000]); + leakList.add(new Object[1000_0000]); + leakList.add(new Object[1000_0000]); + System.gc(); // This will shorten time for object to be emitted. + File recording = new File("TestJCMdDump.jfr"); + String[] params = buildParameters(pathToGCRoots, name, recording); + OutputAnalyzer output = JcmdHelper.jcmd(params); + JcmdAsserts.assertRecordingDumpedToFile(output, recording); + int rootCount = 0; + int oldObjectCount = 0; + int stoppedEventCount = 0; + int runningEventCount = 0; + for (RecordedEvent e : RecordingFile.readAllEvents(recording.toPath())) { + if (e.getEventType().getName().equals(EventNames.OldObjectSample)) { + if (e.getValue("root") != null) { + rootCount++; + } + oldObjectCount++; + } + if (e.getEventType().getName().equals(StoppedEvent.class.getName())) { + stoppedEventCount++; + } + if (e.getEventType().getName().equals(RunningEvent.class.getName())) { + runningEventCount++; + } + } + System.out.println("Name: " + name); + System.out.println("Disk: " + disk); + System.out.println("Path to GC roots: " + pathToGCRoots); + System.out.println("Old Objects: " + oldObjectCount); + System.out.println("Root objects: "+ rootCount); + System.out.println("Stopped events: "+ stoppedEventCount); + System.out.println("Running events: "+ runningEventCount); + + System.out.println(); + if (runningEventCount == 0) { + throw new Exception("Missing event from running recording"); + } + if (name == null && stoppedEventCount == 0) { + throw new Exception("Missing event from stopped recording"); + } + if (name != null && stoppedEventCount > 0) { + throw new Exception("Stopped event should not be part of dump"); + } + if (oldObjectCount != 0 && successPredicate.test(rootCount)) { + return; + } + System.out.println(); + System.out.println(); + System.out.println(); + System.out.println("************* Retrying! **************"); + Files.delete(recording.toPath()); + } + } - OutputAnalyzer output = JcmdHelper.jcmd("JFR.start", "name=" + name); - JcmdAsserts.assertRecordingHasStarted(output); - JcmdHelper.waitUntilRunning(name); - - output = JcmdHelper.jcmd("JFR.dump", - "name=" + name, - "filename=" + recording.getAbsolutePath()); - JcmdAsserts.assertRecordingDumpedToFile(output, name, recording); - JcmdHelper.stopAndCheck(name); - FileHelper.verifyRecording(recording); + private static String[] buildParameters(Boolean pathToGCRoots, String name, File recording) { + List params = new ArrayList<>(); + params.add("JFR.dump"); + params.add("filename=" + recording.getAbsolutePath()); + if (pathToGCRoots != null) { // if path-to-gc-roots is omitted, default is used (disabled). + params.add("path-to-gc-roots=" + pathToGCRoots); + } + if (name != null) { // if name is omitted, all recordings will be dumped + params.add("name=" + name); + } + return params.toArray(new String[0]); } } diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdDumpLimited.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdDumpLimited.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdDumpLimited.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdDumpLimited.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,292 @@ +/* + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Oracle designates this + * particular file as subject to the "Classpath" exception as provided + * by Oracle in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package jdk.jfr.jcmd; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; +import java.nio.file.Paths; +import java.time.Duration; +import java.time.Instant; +import java.time.LocalDateTime; +import java.time.LocalTime; +import java.time.ZoneOffset; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import jdk.jfr.Event; +import jdk.jfr.Recording; +import jdk.test.lib.Asserts; +import jdk.test.lib.process.OutputAnalyzer; + +/** + * @test + * @summary The test verifies JFR.dump command + * @key jfr + * @requires vm.hasJFR + * @library /test/lib /test/jdk + * @run main/othervm jdk.jfr.jcmd.TestJcmdDumpLimited + */ +public class TestJcmdDumpLimited { + + static class TestEvent extends Event { + int id; + int number; + } + + static class TestRecording { + Instant time; + final Recording r; + Path path; + int size; + int total; + int id; + Instant now; + + TestRecording(int id, int events) throws IOException, InterruptedException { + r = new Recording(); + r.start(); + for (int i = 0; i < events; i++) { + TestEvent event = new TestEvent(); + event.id = id; + event.number = i; + event.commit(); + if (i == events / 2) { + time = Instant.now(); + } + } + r.stop(); + Thread.sleep(1); + path = Paths.get("dump-" + id + ".jfr"); + r.dump(path); + size = (int) Files.size(path); + this.id = id; + this.now = Instant.now(); + } + + public void close() { + r.close(); + } + } + + private static long totalSize; + private static long lastFiveSize; + private static long firstFiveSize; + private static long middleSize; + private static long centerSize; + private static long lastSize; + + private static Instant middle; + private static Instant centerLeft; + private static Instant centerRight; + + public static void main(String[] args) throws Exception { + + List recs = new ArrayList<>(); + + for (int i = 0; i < 9; i++) { + recs.add(new TestRecording(i, 100)); + } + int last = 0; + List reversed = new ArrayList<>(recs); + Collections.reverse(reversed); + for (TestRecording r : reversed) { + r.total = r.size + last; + last += r.size; + } + + for (TestRecording r : recs) { + System.out.println("Recording " + r.id + ": size=" + r.size + " (total=" + r.total + ", time=" + r.now + ")"); + } + + centerLeft = recs.get(3).time; + middle = recs.get(4).time; + centerRight = recs.get(5).time; + + totalSize = size(recs, 0, 9); + lastFiveSize = size(recs, 4, 5); + firstFiveSize = size(recs, 0, 5); + middleSize = size(recs, 4, 1); + centerSize = size(recs, 3, 3); + lastSize = size(recs, 8, 1); + + testDump(); + testDumpMaxSize(); + testDumpMaxSizeSmall(); + testDumpBegin(); + testDumpEnd(); + testDumpBeginEndInstant(); + testDumpBeginEndLocalDateTime(); + testDumpBeginEndLocalTime(); + testDumpBeginEndSame(); + testDumpMaxAge(); + testDumpBeginEndRelative(); + testDumpTooEarly(); + testDumpTooLate(); + testDumpBeginMaxAge(); + TestDumpEndMaxage(); + testDumpEndBegin(); + testDumpInvalidTime(); + } + + private static int size(List recs, int skip, int limit) { + return recs.stream().skip(skip).limit(limit).mapToInt(r -> r.size).sum(); + } + + private static void testDumpEndBegin() throws Exception { + Path testEndBegin = Paths.get("testEndBegin.jfr"); + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "filename=" + testEndBegin.toFile().getAbsolutePath(), "begin=" + Instant.now(), "end=" + Instant.now().minusSeconds(200)); + output.shouldContain("Dump failed, begin must preceed end."); + assertMissingFile(testEndBegin); + } + + private static void TestDumpEndMaxage() throws Exception { + Path testEndMaxAge = Paths.get("testEndMaxAge.jfr"); + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "filename=" + testEndMaxAge.toFile().getAbsolutePath(), "end=" + Instant.now(), "maxage=2h"); + output.shouldContain("Dump failed, maxage can't be combined with begin or end."); + assertMissingFile(testEndMaxAge); + } + + private static Path testDumpBeginMaxAge() throws Exception { + Path testBeginMaxAge = Paths.get("testBeginMaxAge.jfr"); + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "filename=" + testBeginMaxAge.toFile().getAbsolutePath(), "begin=" + Instant.now().minusSeconds(100), "maxage=2h"); + output.shouldContain("Dump failed, maxage can't be combined with begin or end."); + assertMissingFile(testBeginMaxAge); + return testBeginMaxAge; + } + + private static void testDumpTooLate() throws Exception { + Path missing = Paths.get("missing2.jfr"); + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "filename=" + missing.toFile().getAbsolutePath(), "begin=" + Instant.now().plus(Duration.ofHours(1)), + "end=" + Instant.now().plus(Duration.ofHours(2))); + output.shouldContain("Dump failed. No data found in the specified interval."); + assertMissingFile(missing); + } + + private static void testDumpTooEarly() throws Exception { + Path missing = Paths.get("missing.jfr"); + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "filename=" + missing.toFile().getAbsolutePath(), "end=" + Instant.now().minus(Duration.ofHours(1))); + output.shouldContain("Dump failed. No data found in the specified interval."); + assertMissingFile(missing); + } + + private static void testDumpBeginEndRelative() throws IOException { + Path testBeginEndRelative = Paths.get("testBeginEndRelative.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testBeginEndRelative.toFile().getAbsolutePath(), "begin=-3h", "end=-0s"); + Asserts.assertEquals(totalSize, Files.size(testBeginEndRelative), "Expected dump with begin=-3h end=0s to contain data from all recordings"); + Files.delete(testBeginEndRelative); + } + + private static void testDumpMaxAge() throws IOException { + Path testMaxAge = Paths.get("testMaxAge.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testMaxAge.toFile().getAbsolutePath(), "maxage=2h"); + Asserts.assertEquals(totalSize, Files.size(testMaxAge), "Expected dump with maxage=2h to contain data from all recordings"); + Files.delete(testMaxAge); + } + + private static void testDumpBeginEndSame() throws IOException { + Path testBeginEnd = Paths.get("testBeginEndSame.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testBeginEnd.toFile().getAbsolutePath(), "begin=" + middle, "end=" + middle); + Asserts.assertEquals(middleSize, Files.size(testBeginEnd), "Expected dump with begin=" + middle + "end=" + middle + " contain data from middle recording"); + Files.delete(testBeginEnd); + } + + private static void testDumpBeginEndInstant() throws IOException { + Path testBeginEnd = Paths.get("testBeginEndInstant.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testBeginEnd.toFile().getAbsolutePath(), "begin=" + centerLeft, "end=" + centerRight); + Asserts.assertEquals(centerSize, Files.size(testBeginEnd), "Expected dump with begin=" + centerLeft + " end=" + centerRight + " contain data from the 'center'-recordings"); + Files.delete(testBeginEnd); + } + + private static void testDumpBeginEndLocalDateTime() throws IOException { + LocalDateTime centerLeftLocal = LocalDateTime.ofInstant(centerLeft, ZoneOffset.systemDefault()); + LocalDateTime centerRightLocal = LocalDateTime.ofInstant(centerRight, ZoneOffset.systemDefault()); + Path testBeginEnd = Paths.get("testBeginEndLocalDateTime.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testBeginEnd.toFile().getAbsolutePath(), "begin=" + centerLeftLocal, "end=" + centerRightLocal); + Asserts.assertEquals(centerSize, Files.size(testBeginEnd), "Expected dump with begin=" + centerLeftLocal + " end=" + centerRightLocal + " contain data from the 'center'-recordings"); + Files.delete(testBeginEnd); + } + + private static void testDumpBeginEndLocalTime() throws IOException { + LocalTime centerLeftLocal = LocalTime.ofInstant(centerLeft, ZoneOffset.systemDefault()); + LocalTime centerRightLocal = LocalTime.ofInstant(centerRight, ZoneOffset.systemDefault()); + Path testBeginEnd = Paths.get("testBeginEndLocalTime.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testBeginEnd.toFile().getAbsolutePath(), "begin=" + centerLeftLocal, "end=" + centerRightLocal); + Asserts.assertEquals(centerSize, Files.size(testBeginEnd), "Expected dump with begin=" + centerLeftLocal + " end=" + centerRightLocal + " contain data from the 'center'-recordings"); + Files.delete(testBeginEnd); + } + + private static void testDumpEnd() throws IOException { + Path testEnd = Paths.get("testEnd.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testEnd.toFile().getAbsolutePath(), "end=" + middle); + Asserts.assertEquals(firstFiveSize, Files.size(testEnd), "Expected dump with end=" + middle + " to contain data from the five first recordings"); + Files.delete(testEnd); + } + + private static void testDumpBegin() throws IOException { + Path testBegin = Paths.get("testBegin.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testBegin.toFile().getAbsolutePath(), "begin=" + middle); + Asserts.assertEquals(lastFiveSize, Files.size(testBegin), "Expected dump with begin=" + middle + " to contain data from the last five recordings"); + Files.delete(testBegin); + } + + private static void testDumpMaxSize() throws IOException { + Path testMaxSize = Paths.get("testMaxSize.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testMaxSize.toFile().getAbsolutePath(), "maxsize=" + lastFiveSize); + Asserts.assertEquals(lastFiveSize, Files.size(testMaxSize), "Expected dump with maxsize=" + lastFiveSize + " to contain data from the last five recordings"); + Files.delete(testMaxSize); + } + + private static void testDumpMaxSizeSmall() throws IOException { + Path testMaxSizeSmall = Paths.get("testMaxSizeSmall.jfr"); + JcmdHelper.jcmd("JFR.dump", "filename=" + testMaxSizeSmall.toFile().getAbsolutePath(), "maxsize=1k"); + Asserts.assertEquals(lastSize, Files.size(testMaxSizeSmall), "Expected dump with maxsize=1k to contain data from the last recording"); + Files.delete(testMaxSizeSmall); + } + + private static void testDump() throws IOException { + Path all = Paths.get("all.jfr"); + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "filename=" + all.toFile().getAbsolutePath()); + JcmdAsserts.assertRecordingDumpedToFile(output, all.toFile()); + Asserts.assertEquals(totalSize, Files.size(all), "Expected dump to be sum of all recordings"); + Files.delete(all); + } + + private static void testDumpInvalidTime() throws Exception { + Path invalidTime = Paths.get("invalidTime.jfr"); + OutputAnalyzer output = JcmdHelper.jcmd("JFR.dump", "filename=" + invalidTime.toFile().getAbsolutePath(), "begin=4711"); + output.shouldContain("Dump failed, not a valid begin time."); + assertMissingFile(invalidTime); + } + + private static void assertMissingFile(Path missing) throws Exception { + if (Files.exists(missing)) { + throw new Exception("Unexpected dumpfile found"); + } + } + +} diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRoots.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRoots.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRoots.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdDumpPathToGCRoots.java 2018-07-25 15:36:46.000000000 +0000 @@ -41,9 +41,10 @@ import jdk.jfr.internal.test.WhiteBox; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Start a recording with or without path-to-gc-roots + * @requires vm.hasJFR * @modules jdk.jfr/jdk.jfr.internal.test * @library /test/lib /test/jdk * @key jfr diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdLegacy.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdLegacy.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdLegacy.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdLegacy.java 2018-07-25 15:36:46.000000000 +0000 @@ -28,6 +28,7 @@ import java.io.File; import java.io.IOException; import java.nio.file.Path; +import java.nio.file.Paths; import jdk.jfr.Recording; import jdk.jfr.consumer.RecordedEvent; @@ -37,9 +38,10 @@ import jdk.test.lib.jfr.FileHelper; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test TestClassId * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jcmd.TestJcmdLegacy @@ -58,13 +60,13 @@ private static void testJcmd() throws Exception { String name = "testLegacy"; - File p = new File(name + ".jfr"); + Path p = Paths.get(name + ".jfr").toAbsolutePath().normalize(); OutputAnalyzer output = JcmdHelper.jcmd("JFR.start", "name=" + name, "settings=" + SETTINGS.getCanonicalPath()); JcmdAsserts.assertRecordingHasStarted(output); JcmdHelper.waitUntilRunning(name); - JcmdHelper.stopWriteToFileAndCheck(name, p); - FileHelper.verifyRecording(p); - verify(p.toPath()); + JcmdHelper.stopWriteToFileAndCheck(name, p.toFile()); + FileHelper.verifyRecording(p.toFile()); + verify(p); } private static void testAPI() throws IOException, Exception { diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdSaveToFile.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdSaveToFile.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdSaveToFile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdSaveToFile.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.test.lib.jfr.FileHelper; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary The test verifies that recording can be written to a file both with JFR.start and JFR.stop * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jcmd.TestJcmdSaveToFile */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartDirNotExist.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartDirNotExist.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartDirNotExist.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartDirNotExist.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Verify error when starting with a dir that does not exist. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jcmd.TestJcmdStartDirNotExist */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartInvaldFile.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartInvaldFile.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartInvaldFile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartInvaldFile.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,10 +27,11 @@ import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Verify error when starting with invalid file. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jcmd.TestJcmdStartInvaldFile */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartPathToGCRoots.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartPathToGCRoots.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartPathToGCRoots.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartPathToGCRoots.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @summary Start a recording with or without path-to-gc-roots + * @requires vm.hasJFR * @library /test/lib /test/jdk * @key jfr * diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartReadOnlyFile.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartReadOnlyFile.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartReadOnlyFile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartReadOnlyFile.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.jfr.FileHelper; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Verify error when starting with read-only file. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jcmd.TestJcmdStartReadOnlyFile */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartStopDefault.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartStopDefault.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartStopDefault.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartStopDefault.java 2018-07-25 15:36:46.000000000 +0000 @@ -25,7 +25,8 @@ package jdk.jfr.jcmd; -import java.io.File; +import java.nio.file.Path; +import java.nio.file.Paths; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -33,17 +34,18 @@ import jdk.test.lib.jfr.FileHelper; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Start a recording without name. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jcmd.TestJcmdStartStopDefault */ public class TestJcmdStartStopDefault { public static void main(String[] args) throws Exception { - File recording = new File("TestJcmdStartStopDefault.jfr"); + Path recording = Paths.get(".","TestJcmdStartStopDefault.jfr").toAbsolutePath().normalize(); OutputAnalyzer output = JcmdHelper.jcmd("JFR.start"); JcmdAsserts.assertRecordingHasStarted(output); @@ -53,10 +55,10 @@ output = JcmdHelper.jcmd("JFR.dump", "name=" + name, - "filename=" + recording.getAbsolutePath()); - JcmdAsserts.assertRecordingDumpedToFile(output, name, recording); + "filename=" + recording); + JcmdAsserts.assertRecordingDumpedToFile(output, recording.toFile()); JcmdHelper.stopAndCheck(name); - FileHelper.verifyRecording(recording); + FileHelper.verifyRecording(recording.toFile()); } private static String parseRecordingName(OutputAnalyzer output) { @@ -65,7 +67,7 @@ // Use JFR.dump name=recording-1 filename=FILEPATH to copy recording data to file. String stdout = output.getStdout(); - Pattern p = Pattern.compile(".*Use JFR.dump name=(\\S+).*", Pattern.DOTALL); + Pattern p = Pattern.compile(".*Use jcmd \\d+ JFR.dump name=(\\S+).*", Pattern.DOTALL); Matcher m = p.matcher(stdout); Asserts.assertTrue(m.matches(), "Could not parse recording name"); String name = m.group(1); diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartWithOptions.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartWithOptions.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartWithOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartWithOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.jfr.RecordingState; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary The test verifies that recording can be started with options delay|duration|maxage|maxsize * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:+FlightRecorder -XX:FlightRecorderOptions=maxchunksize=2097152 jdk.jfr.jcmd.TestJcmdStartWithOptions */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartWithSettings.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartWithSettings.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStartWithSettings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStartWithSettings.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary The test verifies that recording can be started with setting file(s) * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jcmd.TestJcmdStartWithSettings */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStopInvalidFile.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStopInvalidFile.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStopInvalidFile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStopInvalidFile.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,10 +27,11 @@ import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Verify error when stopping with invalid file. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jcmd.TestJcmdStopInvalidFile */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStopReadOnlyFile.java openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStopReadOnlyFile.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jcmd/TestJcmdStopReadOnlyFile.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jcmd/TestJcmdStopReadOnlyFile.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.jfr.FileHelper; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Verify error when stopping with read-only file. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jcmd.TestJcmdStopReadOnlyFile */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/info/TestConfigurationInfo.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/info/TestConfigurationInfo.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/info/TestConfigurationInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/info/TestConfigurationInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.management.jfr.ConfigurationInfo; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr * @summary Test for ConfigurationInfo. Compare infos from java API and jmx API. + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.info.TestConfigurationInfo */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/info/TestEventTypeInfo.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/info/TestEventTypeInfo.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/info/TestEventTypeInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/info/TestEventTypeInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.management.jfr.FlightRecorderMXBean; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr * @summary Test for EventTypeInfo + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.info.TestEventTypeInfo */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/info/TestRecordingInfo.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/info/TestRecordingInfo.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/info/TestRecordingInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/info/TestRecordingInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.management.jfr.RecordingInfo; import jdk.test.lib.jfr.CommonHelper; -/* +/** * @test * @key jfr * @summary Test for RecordingInfo + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.info.TestRecordingInfo */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/info/TestSettingDescriptorInfo.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/info/TestSettingDescriptorInfo.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/info/TestSettingDescriptorInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/info/TestSettingDescriptorInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.management.jfr.EventTypeInfo; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr * @summary Test for SettingDescriptorInfo. Compare infos from java API and jmx API. + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.info.TestSettingDescriptorInfo */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/security/TestEnoughPermission.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/security/TestEnoughPermission.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/security/TestEnoughPermission.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/security/TestEnoughPermission.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,10 +35,11 @@ import jdk.management.jfr.FlightRecorderMXBean; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr * @summary Test with minimal needed permissions. All functions should work. + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm/secure=java.lang.SecurityManager/java.security.policy=enough.policy jdk.jfr.jmx.security.TestEnoughPermission */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/security/TestNoControlPermission.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/security/TestNoControlPermission.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/security/TestNoControlPermission.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/security/TestNoControlPermission.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @key jfr * @summary Verify we get SecurityExceptions when missing management permission "control". + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm/secure=java.lang.SecurityManager/java.security.policy=nocontrol.policy jdk.jfr.jmx.security.TestNoControlPermission */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/security/TestNoMonitorPermission.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/security/TestNoMonitorPermission.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/security/TestNoMonitorPermission.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/security/TestNoMonitorPermission.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @key jfr * @summary Verify we get SecurityExceptions when missing management permission "monitor". + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm/secure=java.lang.SecurityManager/java.security.policy=nomonitor.policy jdk.jfr.jmx.security.TestNoMonitorPermission */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/security/TestNotificationListenerPermission.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/security/TestNotificationListenerPermission.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/security/TestNotificationListenerPermission.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/security/TestNotificationListenerPermission.java 2018-07-25 15:36:46.000000000 +0000 @@ -37,10 +37,11 @@ import jdk.jfr.jmx.JmxHelper; -/* +/** * @test * @key jfr * @summary Test with minimal needed permissions. All functions should work. + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm/secure=java.lang.SecurityManager/java.security.policy=listener.policy jdk.jfr.jmx.security.TestNotificationListenerPermission */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestClone.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestClone.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestClone.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestClone.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,9 +40,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestClone */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCloneRepeat.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCloneRepeat.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCloneRepeat.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCloneRepeat.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,9 +39,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestCloneRepeat */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestConfigurationInfo.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestConfigurationInfo.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestConfigurationInfo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestConfigurationInfo.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.management.jfr.ConfigurationInfo; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestConfigurationInfo */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCopyToInvalidPath.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCopyToInvalidPath.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCopyToInvalidPath.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCopyToInvalidPath.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestCopyToInvalidPath */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCopyTo.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCopyTo.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCopyTo.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCopyTo.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestCopyTo */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCopyToReadOnlyDir.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCopyToReadOnlyDir.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCopyToReadOnlyDir.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCopyToReadOnlyDir.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.FileHelper; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestCopyToReadOnlyDir */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCopyToRunning.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCopyToRunning.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestCopyToRunning.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestCopyToRunning.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @key jfr * @summary Copy a recording to file while it is running. + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestCopyToRunning */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestEventTypes.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestEventTypes.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestEventTypes.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestEventTypes.java 2018-07-25 15:36:46.000000000 +0000 @@ -42,10 +42,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.Events; -/* +/** * @test * @key jfr * @summary Verifies that EventTypes from jmx and FlightRecorder are the same. + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestEventTypes */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestGetRecordings.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestGetRecordings.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestGetRecordings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestGetRecordings.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,9 +30,10 @@ import jdk.management.jfr.FlightRecorderMXBean; import jdk.management.jfr.RecordingInfo; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestGetRecordings */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestGetRecordingsMultiple.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestGetRecordingsMultiple.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestGetRecordingsMultiple.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestGetRecordingsMultiple.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.management.jfr.RecordingInfo; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestGetRecordingsMultiple */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestMultipleRecordings.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestMultipleRecordings.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestMultipleRecordings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestMultipleRecordings.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.management.jfr.FlightRecorderMXBean; import jdk.management.jfr.RecordingInfo; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestMultipleRecordings */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestNotificationListener.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestNotificationListener.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestNotificationListener.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestNotificationListener.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.management.jfr.FlightRecorderMXBean; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestNotificationListener */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestPredefinedConfigurationInvalid.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestPredefinedConfigurationInvalid.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestPredefinedConfigurationInvalid.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestPredefinedConfigurationInvalid.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestPredefinedConfigurationInvalid */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestPredefinedConfiguration.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestPredefinedConfiguration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestPredefinedConfiguration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestPredefinedConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.management.jfr.RecordingInfo; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestPredefinedConfiguration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingOptions.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingOptions.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.management.jfr.FlightRecorderMXBean; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestRecordingOptions */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingSettingsInvalid.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingSettingsInvalid.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingSettingsInvalid.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingSettingsInvalid.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.management.jfr.FlightRecorderMXBean; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr * @summary Verify exception when setting invalid settings. + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestRecordingSettingsInvalid */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingSettings.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingSettings.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingSettings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingSettings.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.management.jfr.FlightRecorderMXBean; import jdk.test.lib.Asserts; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestRecordingSettings */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingSettingsMultiple.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingSettingsMultiple.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingSettingsMultiple.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingSettingsMultiple.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,9 +30,10 @@ import jdk.management.jfr.FlightRecorderMXBean; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestRecordingSettingsMultiple */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingStateInvalid.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingStateInvalid.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingStateInvalid.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingStateInvalid.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.test.lib.jfr.CommonHelper; import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestRecordingStateInvalid */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingState.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingState.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestRecordingState.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestRecordingState.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.management.jfr.FlightRecorderMXBean; import jdk.management.jfr.RecordingInfo; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestRecordingState */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestSetConfigurationInvalid.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestSetConfigurationInvalid.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestSetConfigurationInvalid.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestSetConfigurationInvalid.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @key jfr * @summary Verify Exception when setting invalid config. + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestSetConfigurationInvalid */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestSetConfiguration.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestSetConfiguration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestSetConfiguration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestSetConfiguration.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.EventNames; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestSetConfiguration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestSnapshot.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestSnapshot.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestSnapshot.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestSnapshot.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,8 +34,10 @@ import jdk.management.jfr.RecordingInfo; import jdk.test.lib.jfr.SimpleEvent; -/* @test +/** + * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestSnapshot */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestStartRecording.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestStartRecording.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestStartRecording.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestStartRecording.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.management.jfr.EventTypeInfo; import jdk.management.jfr.FlightRecorderMXBean; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestStartRecording */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestStreamClosed.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestStreamClosed.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestStreamClosed.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestStreamClosed.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @key jfr * @summary Call readStream() after closeStream() + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestStreamClosed */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestStream.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestStream.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestStream.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestStream.java 2018-07-25 15:36:46.000000000 +0000 @@ -35,9 +35,10 @@ import jdk.management.jfr.FlightRecorderMXBean; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestStream */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestStreamMultiple.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestStreamMultiple.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestStreamMultiple.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestStreamMultiple.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.SimpleEventHelper; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestStreamMultiple */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestWrongId.java openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestWrongId.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jmx/TestWrongId.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jmx/TestWrongId.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.test.lib.jfr.VoidFunction; -/* +/** * @test * @key jfr * @summary Call functions with invalid argument id. Verify Exception. + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm jdk.jfr.jmx.TestWrongId */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestBeginAndEnd.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestBeginAndEnd.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestBeginAndEnd.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestBeginAndEnd.java 2018-07-25 15:36:46.000000000 +0000 @@ -27,9 +27,10 @@ import jdk.jfr.internal.JVM; -/* +/** * @test TestBeginAndEnd * @key jfr + * @requires vm.hasJFR * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jvm.TestBeginAndEnd */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestClassId.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestClassId.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestClassId.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestClassId.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,9 +31,10 @@ import jdk.jfr.internal.JVM; import jdk.jfr.internal.Type; -/* +/** * @test TestClassId * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jvm.TestClassId diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestCounterTime.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestCounterTime.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestCounterTime.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestCounterTime.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.internal.JVM; -/* +/** * @test TestCounterTime * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jvm.TestCounterTime diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestCreateNative.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestCreateNative.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestCreateNative.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestCreateNative.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,10 +30,11 @@ import jdk.jfr.Recording; import jdk.jfr.internal.JVM; -/* +/** * @test * @summary Checks that the JVM can rollback on native initialization failures. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jvm.TestCreateNative diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestDumpOnCrash.java 2018-07-25 15:36:46.000000000 +0000 @@ -36,10 +36,11 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @key jfr * @summary Verifies that data associated with a running recording can be evacuated to an hs_err_pidXXX.jfr when the VM crashes + * @requires vm.hasJFR * * @library /test/lib * @modules java.base/jdk.internal.misc diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestGetAllEventClasses.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestGetAllEventClasses.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestGetAllEventClasses.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestGetAllEventClasses.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,9 +30,10 @@ import java.util.List; -/* +/** * @test TestGetAllEventClasses * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @modules jdk.jfr/jdk.jfr.internal * diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestGetEventWriter.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestGetEventWriter.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestGetEventWriter.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestGetEventWriter.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,9 +30,10 @@ import jdk.jfr.internal.EventWriter; import jdk.jfr.internal.JVM; -/* +/** * @test TestGetEventWriter * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestGetStackTraceId.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestGetStackTraceId.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestGetStackTraceId.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestGetStackTraceId.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.internal.JVM; import jdk.test.lib.Asserts; -/* +/** * @test TestGetStackTraceId * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jvm.TestGetStackTraceId diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestJavaEvent.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestJavaEvent.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestJavaEvent.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestJavaEvent.java 2018-07-25 15:36:46.000000000 +0000 @@ -40,9 +40,10 @@ import jdk.jfr.consumer.RecordedEvent; import jdk.jfr.consumer.RecordingFile; -/* +/** * @test TestGetThreadId * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jvm.TestJavaEvent diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestJFRIntrinsic.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,10 +23,11 @@ * questions. */ -/* +/** * @test * @summary Intrinsic for JFR * @key jfr + * @requires vm.hasJFR * @library /test/lib * * @modules jdk.jfr/jdk.jfr.internal diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestJfrJavaBase.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,11 +23,12 @@ * questions. */ -/* +/** * @test * @bug 8157032 * @key jfr * @summary verify that jfr can not be used when JVM is executed only with java.base + * @requires vm.hasJFR * @library /test/lib * @modules java.base/jdk.internal.misc * @run driver jdk.jfr.jvm.TestJfrJavaBase diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestLargeJavaEvent512k.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestLargeJavaEvent512k.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestLargeJavaEvent512k.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestLargeJavaEvent512k.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,9 +43,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.Stressor; -/* +/** * @test TestLargeJavaEvent512k * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * java.base/jdk.internal.org.objectweb.asm diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestLargeJavaEvent64k.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestLargeJavaEvent64k.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestLargeJavaEvent64k.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestLargeJavaEvent64k.java 2018-07-25 15:36:46.000000000 +0000 @@ -43,9 +43,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.Stressor; -/* +/** * @test TestLargeJavaEvent64k * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * java.base/jdk.internal.org.objectweb.asm diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestLogImplementation.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestLogImplementation.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestLogImplementation.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestLogImplementation.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,9 +30,10 @@ import jdk.jfr.internal.LogTag; import jdk.jfr.internal.LogLevel; -/* +/** * @test TestLogImplementation * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jvm.TestLogImplementation diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestLogOutput.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestLogOutput.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestLogOutput.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestLogOutput.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import java.util.ArrayList; import java.util.List; -/* +/** * @test TestLogOutput * @key jfr * @summary Sanity test jfr logging output + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -Xlog:disable -Xlog:jfr*=trace:file=jfr_trace.txt -XX:StartFlightRecording=duration=1s,filename=recording.jfr jdk.jfr.jvm.TestLogOutput */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestPid.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestPid.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestPid.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestPid.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.jfr.internal.JVM; -/* +/** * @test TestPid * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * @run main/othervm jdk.jfr.jvm.TestPid diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestUnloadEventClassCount.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestUnloadEventClassCount.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestUnloadEventClassCount.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestUnloadEventClassCount.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.jfr.FlightRecorder; import jdk.jfr.internal.JVM; -/* +/** * @test * @key jfr * @summary Unit test for JVM#getUnloadedEventClassCount + * @requires vm.hasJFR * * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestUnsupportedVM.java openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestUnsupportedVM.java --- openjdk-11-11~19/test/jdk/jdk/jfr/jvm/TestUnsupportedVM.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/jvm/TestUnsupportedVM.java 2018-07-25 15:36:46.000000000 +0000 @@ -64,9 +64,10 @@ import jdk.management.jfr.SettingDescriptorInfo; import jdk.test.lib.Utils; -/* +/** * @test TestUnsupportedVM * @key jfr + * @requires vm.hasJFR * * @modules jdk.jfr * jdk.management.jfr diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestBadOptionValues.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @library /test/lib * @modules java.base/jdk.internal.misc diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestDumpOnExit.java 2018-07-25 15:36:46.000000000 +0000 @@ -38,10 +38,11 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @summary Start a FlightRecording with dumponexit. Verify dump exists. * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.startupargs.TestDumpOnExit */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestMemoryOptions.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,9 +33,10 @@ import jdk.test.lib.process.ProcessTools; import jdk.internal.misc.Unsafe; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @modules jdk.jfr/jdk.jfr.internal * java.base/jdk.internal.misc diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestMultipleStartupRecordings.java 2018-07-25 15:36:46.000000000 +0000 @@ -29,9 +29,10 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * * @library /test/lib * diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestOldObjectQueueSize.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestOldObjectQueueSize.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestOldObjectQueueSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestOldObjectQueueSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.jfr.EventNames; import jdk.test.lib.jfr.Events; -/* +/** * @test * @summary Test -XX:FlightRecorderOptions=old-object-queue-size + * @requires vm.hasJFR * @modules jdk.jfr/jdk.jfr.internal.test * @library /test/lib * @key jfr diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestRepositoryPath.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestRepositoryPath.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestRepositoryPath.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestRepositoryPath.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.Asserts; -/* +/** * @test * @summary Set repository path. Verify recording created in repo. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:StartFlightRecording=name=TestStartRecording,settings=profile -XX:FlightRecorderOptions=repository=./repo jdk.jfr.startupargs.TestRepositoryPath */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestRepositoryPathLong.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestRepositoryPathLong.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestRepositoryPathLong.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestRepositoryPathLong.java 2018-07-25 15:36:46.000000000 +0000 @@ -31,10 +31,11 @@ import jdk.test.lib.Asserts; -/* +/** * @test * @summary Set repository path. Verify recording created in repo. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:StartFlightRecording=name=myrec,settings=profile -XX:FlightRecorderOptions=repository=./subdirectory/subdirectory1/subdirectory2/subdirectory3/subdirectory4/subdirectory5/subdirectory6/subdirectory7/subdirectory8/subdirectory9/subdirectory10/subdirectory11/subdirectory12/subdirectory13/subdirectory14/subdirectory15 jdk.jfr.startupargs.TestRepositoryPathLong */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestRetransform.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestRetransform.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestRetransform.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestRetransform.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,9 +32,10 @@ import jdk.test.lib.jfr.Events; import jdk.test.lib.jfr.SimpleEvent; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm -XX:FlightRecorderOptions=retransform=false jdk.jfr.startupargs.TestRetransform * @run main/othervm -XX:FlightRecorderOptions=retransform=true jdk.jfr.startupargs.TestRetransform diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestRetransformUsingLog.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,9 +34,10 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib * @run main/othervm jdk.jfr.startupargs.TestRetransformUsingLog */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartDelay.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartDelay.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartDelay.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartDelay.java 2018-07-25 15:36:46.000000000 +0000 @@ -33,10 +33,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.CommonHelper; -/* +/** * @test * @summary Start a recording with delay. Verify recording starts later. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:StartFlightRecording=name=TestStartDelay,delay=5000s jdk.jfr.startupargs.TestStartDelay */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartDelayRunning.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartDelayRunning.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartDelayRunning.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartDelayRunning.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.CommonHelper; -/* +/** * @test * @summary Verify that a recopding with a delay is started. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:StartFlightRecording=name=TestStartDelay,delay=1s jdk.jfr.startupargs.TestStartDelayRunning */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartDuration.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartDuration.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartDuration.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartDuration.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,10 +34,11 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @summary Start a recording with duration. Verify recording stops. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main jdk.jfr.startupargs.TestStartDuration */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartMaxAgeSize.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartMaxAgeSize.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartMaxAgeSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartMaxAgeSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.jfr.CommonHelper; -/* +/** * @test * @summary Start a recording with delay. Verify recording starts later. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:StartFlightRecording=name=TestStartMaxAgeSize,maxage=10s,maxsize=1000000 jdk.jfr.startupargs.TestStartMaxAgeSize */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartName.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartName.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartName.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartName.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,9 +30,10 @@ import jdk.test.lib.process.OutputAnalyzer; import jdk.test.lib.process.ProcessTools; -/* +/** * @test * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main jdk.jfr.startupargs.TestStartName */ diff -Nru openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartRecording.java openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartRecording.java --- openjdk-11-11~19/test/jdk/jdk/jfr/startupargs/TestStartRecording.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/jfr/startupargs/TestStartRecording.java 2018-07-25 15:36:46.000000000 +0000 @@ -32,10 +32,11 @@ import jdk.test.lib.Asserts; import jdk.test.lib.process.OutputAnalyzer; -/* +/** * @test * @summary Start a recording with -XX:StartFlightRecording. Dump recording with jcmd. * @key jfr + * @requires vm.hasJFR * @library /test/lib /test/jdk * @run main/othervm -XX:StartFlightRecording=name=TestStartRecording,settings=profile jdk.jfr.startupargs.TestStartRecording */ diff -Nru openjdk-11-11~19/test/jdk/jdk/lambda/vm/InterfaceAccessFlagsTest.java openjdk-11-11~24/test/jdk/jdk/lambda/vm/InterfaceAccessFlagsTest.java --- openjdk-11-11~19/test/jdk/jdk/lambda/vm/InterfaceAccessFlagsTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/lambda/vm/InterfaceAccessFlagsTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -71,7 +71,8 @@ } } - @Test(groups = "vm_prototype") + /* excluded: 8187655 */ + @Test(enabled=false, groups = "vm_prototype") public void testPrivateMethodCall() { testMethodCallWithFlag(AccessFlag.PRIVATE); } diff -Nru openjdk-11-11~19/test/jdk/jdk/modules/etc/DefaultModules.java openjdk-11-11~24/test/jdk/jdk/modules/etc/DefaultModules.java --- openjdk-11-11~19/test/jdk/jdk/modules/etc/DefaultModules.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/modules/etc/DefaultModules.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,112 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8197532 + * @modules jdk.compiler + * jdk.jlink + * jdk.zipfs + * @library src /lib/testlibrary + * @build java.json/* + * @run main DefaultModules + * @summary Test that all modules that export an API are in the set of modules + * resolved when compiling or running code on the class path + */ + +import java.io.PrintStream; +import java.nio.file.Files; +import java.nio.file.Path; +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; +import java.util.spi.ToolProvider; + +import jdk.testlibrary.ProcessTools; +import jdk.testlibrary.OutputAnalyzer; + +/** + * This test compiles and runs the following tests on the class path: + * + * TestRootModules.java.java - tests that every module that exports an API + * is resolved. Also tests that java.se is not resolved. + * + * TestJson.java - exercises APIs exported by the java.json module. The + * java.json module is not a Java SE module. + */ + +public class DefaultModules { + private static final PrintStream out = System.out; + + public static void main(String[] args) throws Exception { + String javaHome = System.getProperty("java.home"); + String testSrc = System.getProperty("test.src"); + + // $JDK_HOME/bin/java TestModules.java + String source = Path.of(testSrc, "src", "TestRootModules.java").toString(); + ProcessTools.executeTestJava(source) + .outputTo(System.out) + .errorTo(System.err) + .shouldHaveExitValue(0); + + /** + * Create a run-time image containing java.se, java.json and the javac + * compiler. Use the run-time image to compile and run both + * TestModules.java and JsonTest.java + */ + if (Files.exists(Path.of(javaHome, "jmods", "java.se.jmod"))) { + // jlink --add-modules java.se,java.json,jdk.compiler,jdk.zipfs + Path here = Path.of("."); + Path image = Files.createTempDirectory(here, "images").resolve("myimage"); + ToolProvider jlink = ToolProvider.findFirst("jlink") + .orElseThrow(() -> new RuntimeException("jlink not found")); + int exitCode = jlink.run(System.out, System.err, + "--module-path", System.getProperty("test.module.path"), + "--add-modules", "java.se,java.json,jdk.compiler,jdk.zipfs", + "--output", image.toString()); + if (exitCode != 0) + throw new RuntimeException("jlink failed"); + + // path to java launcher in run-time image + String javaLauncher = image.resolve("bin").resolve("java").toString(); + if (System.getProperty("os.name").startsWith("Windows")) + javaLauncher += ".exe"; + + // $CUSTOM_JDK/bin/java TestRootModules.java + source = Path.of(testSrc, "src", "TestRootModules.java").toString(); + out.format("Command line: [%s %s]%n", javaLauncher, source); + ProcessTools.executeProcess(new ProcessBuilder(javaLauncher, source)) + .outputTo(System.out) + .errorTo(System.err) + .shouldHaveExitValue(0); + + // $CUSTOM_JDK/bin/java TestJson.java + source = Path.of(testSrc, "src", "TestJson.java").toString(); + out.format("Command line: [%s %s]%n", javaLauncher, source); + ProcessTools.executeProcess(new ProcessBuilder(javaLauncher, source)) + .outputTo(System.out) + .errorTo(System.err) + .shouldHaveExitValue(0); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/jdk/modules/etc/src/java.json/javax/json/Json.java openjdk-11-11~24/test/jdk/jdk/modules/etc/src/java.json/javax/json/Json.java --- openjdk-11-11~19/test/jdk/jdk/modules/etc/src/java.json/javax/json/Json.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/modules/etc/src/java.json/javax/json/Json.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,34 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.json; + +import java.io.InputStream; + +public class Json { + private Json() { } + + public static JsonParser createParser(InputStream in) { + return new JsonParser() { }; + } +} diff -Nru openjdk-11-11~19/test/jdk/jdk/modules/etc/src/java.json/javax/json/JsonParser.java openjdk-11-11~24/test/jdk/jdk/modules/etc/src/java.json/javax/json/JsonParser.java --- openjdk-11-11~19/test/jdk/jdk/modules/etc/src/java.json/javax/json/JsonParser.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/modules/etc/src/java.json/javax/json/JsonParser.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package javax.json; + +public interface JsonParser { +} diff -Nru openjdk-11-11~19/test/jdk/jdk/modules/etc/src/java.json/module-info.java openjdk-11-11~24/test/jdk/jdk/modules/etc/src/java.json/module-info.java --- openjdk-11-11~19/test/jdk/jdk/modules/etc/src/java.json/module-info.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/modules/etc/src/java.json/module-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,25 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +module java.json { + exports javax.json; +} diff -Nru openjdk-11-11~19/test/jdk/jdk/modules/etc/src/TestJson.java openjdk-11-11~24/test/jdk/jdk/modules/etc/src/TestJson.java --- openjdk-11-11~19/test/jdk/jdk/modules/etc/src/TestJson.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/modules/etc/src/TestJson.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +import javax.json.*; +import java.io.InputStream; + +/** + * Exercise APIs exported by the java.json module + */ + +public class TestJson { + public static void main(String[] args) { + JsonParser parser = Json.createParser(InputStream.nullInputStream()); + } +} diff -Nru openjdk-11-11~19/test/jdk/jdk/modules/etc/src/TestRootModules.java openjdk-11-11~24/test/jdk/jdk/modules/etc/src/TestRootModules.java --- openjdk-11-11~19/test/jdk/jdk/modules/etc/src/TestRootModules.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/modules/etc/src/TestRootModules.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,57 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +import java.lang.module.ModuleDescriptor; +import java.lang.module.ModuleFinder; +import java.lang.module.ModuleReference; + +/** + * Test the set of modules in the boot layer includes all modules that export + * an API. Also test that java.se is not resolved. + */ + +public class TestRootModules { + public static void main(String[] args) { + // all modules that export an API should be resolved + // For now, this test ignores the ModuleResolution attribute + ModuleLayer bootLayer = ModuleLayer.boot(); + ModuleFinder.ofSystem().findAll().stream() + .map(ModuleReference::descriptor) + .filter(descriptor -> descriptor.exports() + .stream() + .filter(e -> !e.isQualified()) + .findAny() + .isPresent()) + .map(ModuleDescriptor::name) + .forEach(name -> { + if (!bootLayer.findModule(name).isPresent()) + throw new RuntimeException(name + " not in boot layer"); + }); + + // java.se should not be resolved + ModuleLayer.boot() + .findModule("java.se") + .map(m -> { throw new RuntimeException("java.se should not be resolved"); }); + } +} diff -Nru openjdk-11-11~19/test/jdk/jdk/nio/Basic.java openjdk-11-11~24/test/jdk/jdk/nio/Basic.java --- openjdk-11-11~19/test/jdk/jdk/nio/Basic.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/jdk/nio/Basic.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,277 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/** + * @test + * @bug 8198372 + * @modules jdk.net java.base/sun.nio.ch:+open + * @run testng Basic + * @summary Basic tests for jdk.nio.Channels + */ + +import java.io.Closeable; +import java.io.FileDescriptor; +import java.io.IOException; +import java.lang.reflect.Field; +import java.net.InetAddress; +import java.net.InetSocketAddress; +import java.net.SocketAddress; +import java.nio.ByteBuffer; +import java.nio.channels.SelectableChannel; +import java.nio.channels.SelectionKey; +import java.nio.channels.Selector; +import java.nio.channels.ServerSocketChannel; +import java.nio.channels.SocketChannel; + +import jdk.nio.Channels; +import jdk.nio.Channels.SelectableChannelCloser; + +import sun.nio.ch.IOUtil; + +import org.testng.annotations.Test; +import static org.testng.Assert.*; + +@Test +public class Basic { + + /** + * A loopback connection + */ + static class Connection implements Closeable { + private final SocketChannel sc1; + private final SocketChannel sc2; + + private Connection(SocketChannel sc1, SocketChannel sc2) { + this.sc1 = sc1; + this.sc2 = sc2; + } + + static Connection open() throws IOException { + try (ServerSocketChannel ssc = ServerSocketChannel.open()) { + InetAddress lb = InetAddress.getLoopbackAddress(); + ssc.bind(new InetSocketAddress(lb, 0)); + SocketChannel sc1 = SocketChannel.open(ssc.getLocalAddress()); + SocketChannel sc2 = ssc.accept(); + return new Connection(sc1, sc2); + } + } + + SocketChannel channel1() { + return sc1; + } + + SocketChannel channel2() { + return sc2; + } + + public void close() throws IOException { + try { + sc1.close(); + } finally { + sc2.close(); + } + } + } + + /** + * A SelectableChannelCloser that tracks if the implCloseChannel and + * implReleaseChannel methods are invoked + */ + static class Closer implements SelectableChannelCloser { + int closeCount; + SelectableChannel invokedToClose; + int releaseCount; + SelectableChannel invokedToRelease; + + @Override + public void implCloseChannel(SelectableChannel sc) { + closeCount++; + invokedToClose = sc; + } + + @Override + public void implReleaseChannel(SelectableChannel sc) { + releaseCount++; + invokedToRelease = sc; + } + } + + /** + * Basic test of channel registered with Selector + */ + public void testSelect() throws IOException { + Selector sel = Selector.open(); + try (Connection connection = Connection.open()) { + + // create channel with the file descriptor from one end of the connection + FileDescriptor fd = getFD(connection.channel1()); + SelectableChannel ch = Channels.readWriteSelectableChannel(fd, new Closer()); + + // register for read events, channel should not be selected + ch.configureBlocking(false); + SelectionKey key = ch.register(sel, SelectionKey.OP_READ); + int n = sel.selectNow(); + assertTrue(n == 0); + + // write bytes to other end of connection + SocketChannel peer = connection.channel2(); + ByteBuffer msg = ByteBuffer.wrap("hello".getBytes("UTF-8")); + int nwrote = peer.write(msg); + assertTrue(nwrote >= 0); + + // channel should be selected + n = sel.select(); + assertTrue(n == 1); + assertTrue(sel.selectedKeys().contains(key)); + assertTrue(key.isReadable()); + assertFalse(key.isWritable()); + sel.selectedKeys().clear(); + + // change interest set for writing, channel should be selected + key.interestOps(SelectionKey.OP_WRITE); + n = sel.select(); + assertTrue(n == 1); + assertTrue(sel.selectedKeys().contains(key)); + assertTrue(key.isWritable()); + assertFalse(key.isReadable()); + sel.selectedKeys().clear(); + + // change interest set for reading + writing, channel should be selected + key.interestOps(SelectionKey.OP_READ | SelectionKey.OP_WRITE); + n = sel.select(); + assertTrue(n == 1); + assertTrue(sel.selectedKeys().contains(key)); + assertTrue(key.isWritable()); + assertTrue(key.isReadable()); + sel.selectedKeys().clear(); + + // change interest set to 0 to deregister, channel should not be selected + key.interestOps(0); + n = sel.selectNow(); + assertTrue(n == 0); + + } finally { + sel.close(); + } + } + + /** + * Test that the SelectableChannelCloser implCloseChannel method is invoked. + */ + public void testImplCloseChannel() throws IOException { + try (Connection connection = Connection.open()) { + FileDescriptor fd = getFD(connection.channel1()); + Closer closer = new Closer(); + SelectableChannel ch = Channels.readWriteSelectableChannel(fd, closer); + + // close channel twice, checking that the closer is invoked only once + for (int i=0; i<2; i++) { + ch.close(); + + // implCloseChannel should been invoked once + assertTrue(closer.closeCount == 1); + assertTrue(closer.invokedToClose == ch); + + // implReleaseChannel should not have been invoked + assertTrue(closer.releaseCount == 0); + } + } + } + + /** + * Test that the SelectableChannelCloser implReleaseChannel method is invoked. + */ + public void testImplReleaseChannel() throws IOException { + Selector sel = Selector.open(); + try (Connection connection = Connection.open()) { + FileDescriptor fd = getFD(connection.channel1()); + Closer closer = new Closer(); + SelectableChannel ch = Channels.readWriteSelectableChannel(fd, closer); + + // register with Selector, invoking selectNow to ensure registered + ch.configureBlocking(false); + ch.register(sel, SelectionKey.OP_WRITE); + sel.selectNow(); + + // close channel + ch.close(); + + // implCloseChannel should have been invoked + assertTrue(closer.closeCount == 1); + assertTrue(closer.invokedToClose == ch); + + // implReleaseChannel should not have been invoked + assertTrue(closer.releaseCount == 0); + + // flush the selector + sel.selectNow(); + + // implReleaseChannel should have been invoked + assertTrue(closer.releaseCount == 1); + assertTrue(closer.invokedToRelease == ch); + + } finally { + sel.close(); + } + } + + @Test(expectedExceptions = IllegalArgumentException.class) + public void testInvalidFileDescriptor() throws IOException { + FileDescriptor fd = IOUtil.newFD(-1); + Channels.readWriteSelectableChannel(fd, new SelectableChannelCloser() { + @Override + public void implCloseChannel(SelectableChannel sc) { } + @Override + public void implReleaseChannel(SelectableChannel sc) { } + }); + } + + @Test(expectedExceptions = NullPointerException.class) + public void testNullFileDescriptor() throws IOException { + Channels.readWriteSelectableChannel(null, new SelectableChannelCloser() { + @Override + public void implCloseChannel(SelectableChannel sc) { } + @Override + public void implReleaseChannel(SelectableChannel sc) { } + }); + } + + @Test(expectedExceptions = NullPointerException.class) + public void testNullCloser() throws IOException { + try (Connection connection = Connection.open()) { + FileDescriptor fd = getFD(connection.channel1()); + Channels.readWriteSelectableChannel(fd, null); + } + } + + private static FileDescriptor getFD(SocketChannel sc) { + try { + Class clazz = sc.getClass(); + Field f = clazz.getDeclaredField("fd"); + f.setAccessible(true); + return (FileDescriptor) f.get(sc); + } catch (Exception e) { + throw new Error(e); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/lib/security/cacerts/VerifyCACerts.java openjdk-11-11~24/test/jdk/lib/security/cacerts/VerifyCACerts.java --- openjdk-11-11~19/test/jdk/lib/security/cacerts/VerifyCACerts.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/lib/security/cacerts/VerifyCACerts.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,8 +24,7 @@ /** * @test - * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 - * @requires java.runtime.name ~= "OpenJDK.*" + * @bug 8189131 8198240 8191844 8189949 8191031 8196141 8204923 8195774 8199779 * @summary Check root CA entries in cacerts file */ import java.io.File; @@ -42,7 +41,7 @@ + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 75; + private static final int COUNT = 90; // map of cert alias to SHA-256 fingerprint private static final Map FINGERPRINT_MAP @@ -198,6 +197,36 @@ "14:65:FA:20:53:97:B8:76:FA:A6:F0:A9:95:8E:55:90:E4:0F:CC:7F:AA:4F:B7:C2:C8:67:75:21:FB:5F:B6:58"); put("starfieldrootg2ca [jdk]", "2C:E1:CB:0B:F9:D2:F9:E1:02:99:3F:BE:21:51:52:C3:B2:DD:0C:AB:DE:1C:68:E5:31:9B:83:91:54:DB:B7:F5"); + put("entrustrootcaec1 [jdk]", + "02:ED:0E:B2:8C:14:DA:45:16:5C:56:67:91:70:0D:64:51:D7:FB:56:F0:B2:AB:1D:3B:8E:B0:70:E5:6E:DF:F5"); + put("entrust2048ca [jdk]", + "6D:C4:71:72:E0:1C:BC:B0:BF:62:58:0D:89:5F:E2:B8:AC:9A:D4:F8:73:80:1E:0C:10:B9:C8:37:D2:1E:B1:77"); + put("entrustrootcag2 [jdk]", + "43:DF:57:74:B0:3E:7F:EF:5F:E4:0D:93:1A:7B:ED:F1:BB:2E:6B:42:73:8C:4E:6D:38:41:10:3D:3A:A7:F3:39"); + put("entrustevca [jdk]", + "73:C1:76:43:4F:1B:C6:D5:AD:F4:5B:0E:76:E7:27:28:7C:8D:E5:76:16:C1:E6:E6:14:1A:2B:2C:BC:7D:8E:4C"); + put("affirmtrustnetworkingca [jdk]", + "0A:81:EC:5A:92:97:77:F1:45:90:4A:F3:8D:5D:50:9F:66:B5:E2:C5:8F:CD:B5:31:05:8B:0E:17:F3:F0:B4:1B"); + put("affirmtrustpremiumca [jdk]", + "70:A7:3F:7F:37:6B:60:07:42:48:90:45:34:B1:14:82:D5:BF:0E:69:8E:CC:49:8D:F5:25:77:EB:F2:E9:3B:9A"); + put("affirmtrustcommercialca [jdk]", + "03:76:AB:1D:54:C5:F9:80:3C:E4:B2:E2:01:A0:EE:7E:EF:7B:57:B6:36:E8:A9:3C:9B:8D:48:60:C9:6F:5F:A7"); + put("affirmtrustpremiumeccca [jdk]", + "BD:71:FD:F6:DA:97:E4:CF:62:D1:64:7A:DD:25:81:B0:7D:79:AD:F8:39:7E:B4:EC:BA:9C:5E:84:88:82:14:23"); + put("deutschetelekomrootca2 [jdk]", + "B6:19:1A:50:D0:C3:97:7F:7D:A9:9B:CD:AA:C8:6A:22:7D:AE:B9:67:9E:C7:0B:A3:B0:C9:D9:22:71:C1:70:D3"); + put("ttelesecglobalrootclass3ca [jdk]", + "FD:73:DA:D3:1C:64:4F:F1:B4:3B:EF:0C:CD:DA:96:71:0B:9C:D9:87:5E:CA:7E:31:70:7A:F3:E9:6D:52:2B:BD"); + put("ttelesecglobalrootclass2ca [jdk]", + "91:E2:F5:78:8D:58:10:EB:A7:BA:58:73:7D:E1:54:8A:8E:CA:CD:01:45:98:BC:0B:14:3E:04:1B:17:05:25:52"); + put("starfieldservicesrootg2ca [jdk]", + "56:8D:69:05:A2:C8:87:08:A4:B3:02:51:90:ED:CF:ED:B1:97:4A:60:6A:13:C6:E5:29:0F:CB:2A:E6:3E:DA:B5"); + put("globalsignca [jdk]", + "EB:D4:10:40:E4:BB:3E:C7:42:C9:E3:81:D3:1E:F2:A4:1A:48:B6:68:5C:96:E7:CE:F3:C1:DF:6C:D4:33:1C:99"); + put("globalsignr3ca [jdk]", + "CB:B5:22:D7:B7:F1:27:AD:6A:01:13:86:5B:DF:1C:D4:10:2E:7D:07:59:AF:63:5A:7C:F4:72:0D:C9:63:C5:3B"); + put("globalsigneccrootcar5 [jdk]", + "17:9F:BC:14:8A:3D:D0:0F:D2:4E:A1:34:58:CC:43:BF:A7:F5:9C:81:82:D7:83:A5:13:F6:EB:EC:10:0C:89:24"); } }; diff -Nru openjdk-11-11~19/test/jdk/ProblemList.txt openjdk-11-11~24/test/jdk/ProblemList.txt --- openjdk-11-11~19/test/jdk/ProblemList.txt 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/ProblemList.txt 2018-07-25 15:36:46.000000000 +0000 @@ -39,15 +39,18 @@ # # Shell tests are othervm by default. # -# List items are testnames followed by labels, all MUST BE commented +# List items are testnames followed by labels, all MUST BE commented # as to why they are here and use a label: # generic-all Problems on all platforms -# generic-ARCH Where ARCH is one of: sparc, sparcv9, x64, i586, etc. +# generic-ARCH Where ARCH is one of: sparc, sparcv9, x64, i586, ppc64, +# ppc64le, s390x etc. # OSNAME-all Where OSNAME is one of: solaris, linux, windows, macosx, aix # OSNAME-ARCH Specific on to one OSNAME and ARCH, e.g. solaris-amd64 # OSNAME-REV Specific on to one OSNAME and REV, e.g. solaris-5.8 # -# More than one label is allowed but must be on the same line. +# More than one label is allowed but must be on the same line comma seperated, +# without spaces. +# If there are several lines mentioning the same test, the last one is used. # ############################################################################# # @@ -80,7 +83,7 @@ # Fixing the tests: # # Some tests just may need to be run with "othervm", and that can easily be -# done my adding a @run line (or modifying any existing @run): +# done by adding a @run line (or modifying any existing @run): # @run main/othervm NameOfMainClass # Make sure this @run follows any use of @library. # Otherwise, if the test is a samevm possibility, make sure the test is @@ -128,7 +131,7 @@ java/awt/dnd/BadSerializaionTest/BadSerializationTest.java 8039082 generic-all java/awt/dnd/MissingEventsOnModalDialog/MissingEventsOnModalDialogTest.java 8164464 linux-all,macosx-all java/awt/dnd/URIListBetweenJVMsTest/URIListBetweenJVMsTest.html 8171510 macosx-all -java/awt/dnd/7171812/bug7171812.java 8041447 macosx-all +javax/swing/dnd/7171812/bug7171812.java 8041447 macosx-all java/awt/Focus/ChoiceFocus/ChoiceFocus.java 8169103 windows-all,macosx-all java/awt/Focus/ClearLwQueueBreakTest/ClearLwQueueBreakTest.java 8198618 macosx-all java/awt/Focus/ConsumeNextKeyTypedOnModalShowTest/ConsumeNextKeyTypedOnModalShowTest.java 6986252 macosx-all @@ -196,7 +199,6 @@ java/awt/TrayIcon/ActionEventTest/ActionEventTest.java 8150540 windows-all java/awt/TrayIcon/ModalityTest/ModalityTest.java 8150540 windows-all,macosx-all java/awt/TrayIcon/MouseEventMask/MouseEventMaskTest.java 8150540 windows-all -java/awt/TrayIcon/MouseEventMask/MouseEventMovedTest.java 8150540 windows-all java/awt/TrayIcon/MouseMovedTest/MouseMovedTest.java 8150540 windows-all java/awt/TrayIcon/SecurityCheck/FunctionalityCheck/FunctionalityCheck.java 8150540 windows-all java/awt/TrayIcon/TrayIconEventModifiers/TrayIconEventModifiersTest.java 8150540 windows-all @@ -244,7 +246,6 @@ sun/java2d/SunGraphics2D/SourceClippingBlitTest/SourceClippingBlitTest.java 8196185 generic-all sun/java2d/pipe/InterpolationQualityTest.java 8171303 windows-all,linux-all,macosx-all java/awt/FullScreen/DisplayChangeVITest/DisplayChangeVITest.java 8169469 windows-all -java/awt/Graphics/ClippedCopyAreaTest/ClippedCopyAreaTest.java 8196436 linux-all java/awt/Graphics2D/DrawString/DrawRotatedStringUsingRotatedFont.java 8197796 generic-all java/awt/TextArea/TextAreaScrolling/TextAreaScrolling.java 8196300 windows-all java/awt/print/PrinterJob/Margins.java 8196301 windows-all @@ -280,12 +281,12 @@ java/awt/Modal/FileDialog/FileDialogModal5Test.java 8198664 macosx-all java/awt/Modal/FileDialog/FileDialogModal6Test.java 8198664 macosx-all java/awt/Modal/FileDialog/FileDialogNonModal1Test.java 8198664 macosx-all -java/awt/Modal/FileDialog/FileDialogNonModal2Test.java 8198664,8203003 macosx-all,linux-all +java/awt/Modal/FileDialog/FileDialogNonModal2Test.java 8198664 macosx-all,linux-all java/awt/Modal/FileDialog/FileDialogNonModal3Test.java 8198664 macosx-all java/awt/Modal/FileDialog/FileDialogNonModal4Test.java 8198664 macosx-all java/awt/Modal/FileDialog/FileDialogNonModal5Test.java 8198664 macosx-all -java/awt/Modal/FileDialog/FileDialogNonModal6Test.java 8198664,8203003 macosx-all,linux-all -java/awt/Modal/FileDialog/FileDialogNonModal7Test.java 8198664,8203003 macosx-all,linux-all +java/awt/Modal/FileDialog/FileDialogNonModal6Test.java 8198664 macosx-all,linux-all +java/awt/Modal/FileDialog/FileDialogNonModal7Test.java 8198664 macosx-all,linux-all java/awt/Modal/FileDialog/FileDialogTKModal1Test.java 8196430 generic-all java/awt/Modal/FileDialog/FileDialogTKModal2Test.java 8196430 generic-all java/awt/Modal/FileDialog/FileDialogTKModal3Test.java 8196430 generic-all @@ -399,8 +400,6 @@ java/awt/Mouse/EnterExitEvents/FullscreenEnterEventTest.java 8051455 macosx-all java/awt/Mouse/MouseModifiersUnitTest/MouseModifiersUnitTest_Standard.java 7124407 macosx-all java/awt/Mouse/RemovedComponentMouseListener/RemovedComponentMouseListener.java 8157170 macosx-all -java/awt/Focus/ForwardingFocusToProxyMotifTest/ForwardingFocusToProxyMotifTest.java 8196436 linux-all -java/awt/Window/OverrideRedirectRemoved/ChildWindowProblem.java 8196438 linux-all java/awt/Modal/ToBack/ToBackAppModal1Test.java 8196441 linux-all,macosx-all java/awt/Modal/ToBack/ToBackAppModal2Test.java 8196441 linux-all,macosx-all java/awt/Modal/ToBack/ToBackAppModal3Test.java 8196441 linux-all,macosx-all @@ -475,8 +474,6 @@ java/awt/Focus/WindowUpdateFocusabilityTest/WindowUpdateFocusabilityTest.html 8202926 linux-all java/awt/datatransfer/ConstructFlavoredObjectTest/ConstructFlavoredObjectTest.java 8202860 linux-all java/awt/dnd/DisposeFrameOnDragCrash/DisposeFrameOnDragTest.java 8202790 macosx-all,linux-all -java/awt/Clipboard/NoDataConversionFailureTest/NoDataConversionFailureTest.html 8202791 macosx-all -java/awt/Clipboard/ImageTransferTest/ImageTransferTest.html 8202792 macosx-all java/awt/FileDialog/FilenameFilterTest/FilenameFilterTest.html 8202882 linux-all java/awt/MenuBar/8007006/bug8007006.java 8202886 macosx-all java/awt/Frame/FramesGC/FramesGC.java 8079069 macosx-all @@ -485,8 +482,6 @@ java/awt/Focus/NonFocusableBlockedOwnerTest/NonFocusableBlockedOwnerTest.html 7124275 macosx-all java/awt/Focus/TranserFocusToWindow/TranserFocusToWindow.java 6848810 macosx-all java/awt/Component/NativeInLightShow/NativeInLightShow.java 8202932 linux-all -java/awt/grab/GrabOnUnfocusableToplevel/GrabOnUnfocusableToplevel.java 8202933 linux-all -java/awt/grab/MenuDragEvents/MenuDragEvents.html 8202934 linux-all java/awt/FileDialog/ModalFocus/FileDialogModalFocusTest.java 8194751 linux-all java/awt/image/VolatileImage/BitmaskVolatileImage.java 8133102 linux-all java/awt/SplashScreen/MultiResolutionSplash/unix/UnixMultiResolutionSplashTest.java 8203004 linux-all @@ -528,6 +523,7 @@ java/lang/management/MemoryMXBean/PendingAllGC.sh 8158837 generic-all java/lang/management/ThreadMXBean/ThreadMXBeanStateTest.java 8081652 generic-all +java/lang/management/ThreadMXBean/AllThreadIds.java 8131745 generic-all ############################################################################ @@ -535,10 +531,6 @@ java/io/pathNames/GeneralWin32.java 8180264 windows-all -java/io/FileInputStream/UnreferencedFISClosesFd.java 8202292 linux-all -java/io/FileOutputStream/UnreferencedFOSClosesFd.java 8202292 linux-all -java/io/RandomAccessFile/UnreferencedRAFClosesFd.java 8202292 linux-all - ############################################################################ # jdk_management @@ -546,6 +538,9 @@ com/sun/management/OperatingSystemMXBean/GetProcessCpuLoad.java 8030957 aix-all com/sun/management/OperatingSystemMXBean/GetSystemCpuLoad.java 8030957 aix-all +sun/management/jmxremote/bootstrap/RmiSslBootstrapTest.sh 8205653 generic-all +sun/management/jmxremote/bootstrap/RmiRegistrySslTest.java 8205653 generic-all + ############################################################################ # jdk_jmx @@ -561,7 +556,9 @@ java/net/MulticastSocket/NoLoopbackPackets.java 7122846 macosx-all java/net/MulticastSocket/SetLoopbackMode.java 7122846 macosx-all -java/net/MulticastSocket/Test.java 7145658 macosx-all +java/net/MulticastSocket/Test.java 7145658,8207404 macosx-all,aix-all +java/net/MulticastSocket/JoinLeave.java 8207404 aix-all +java/net/MulticastSocket/SetGetNetworkInterfaceTest.java 8207404 aix-all java/net/DatagramSocket/SendDatagramToBadAddress.java 7143960 macosx-all @@ -574,6 +571,7 @@ java/nio/channels/DatagramChannel/ChangingAddress.java 7141822 macosx-all java/nio/channels/Selector/Wakeup.java 6963118 windows-all +java/nio/channels/Selector/RacyDeregister.java 8201765 windows-all java/nio/file/WatchService/Basic.java 7158947 solaris-all Solaris 11 java/nio/file/WatchService/MayFlies.java 7158947 solaris-all Solaris 11 @@ -600,6 +598,16 @@ ############################################################################ +# jdk_sctp + +com/sun/nio/sctp/SctpMultiChannel/SendFailed.java 8141694 linux-all + +com/sun/nio/sctp/SctpMultiChannel/SocketOptionTests.java 8141694 linux-all + +com/sun/nio/sctp/SctpChannel/SocketOptionTests.java 8141694 linux-all + +############################################################################ + # jdk_security sun/security/pkcs11/ec/TestKeyFactory.java 8026976 generic-all @@ -614,66 +622,65 @@ javax/net/ssl/DTLS/RespondToRetransmit.java 8169086 macosx-x64 javax/net/ssl/DTLS/CipherSuite.java 8202059 macosx-x64 -sun/security/krb5/auto/UnboundSSL.java 8180265 windows-all sun/security/provider/KeyStore/DKSTest.sh 8180266 windows-all sun/security/pkcs11/Cipher/ReinitCipher.java 8204203 windows-all sun/security/pkcs11/Cipher/TestPKCS5PaddingError.java 8204203 windows-all sun/security/pkcs11/Cipher/TestRSACipher.java 8204203 windows-all -sun/security/pkcs11/Cipher/TestRSACipherWrap.java 8204203 windows-all -sun/security/pkcs11/Cipher/TestRawRSACipher.java 8204203 windows-all -sun/security/pkcs11/Cipher/TestSymmCiphers.java 8204203 windows-all -sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java 8204203 windows-all -sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java 8204203 windows-all -sun/security/pkcs11/KeyAgreement/TestDH.java 8204203 windows-all -sun/security/pkcs11/KeyAgreement/TestInterop.java 8204203 windows-all -sun/security/pkcs11/KeyAgreement/TestShort.java 8204203 windows-all -sun/security/pkcs11/KeyAgreement/UnsupportedDHKeys.java 8204203 windows-all -sun/security/pkcs11/KeyGenerator/DESParity.java 8204203 windows-all -sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java 8204203 windows-all -sun/security/pkcs11/KeyPairGenerator/TestDH2048.java 8204203 windows-all -sun/security/pkcs11/KeyStore/SecretKeysBasic.sh 8204203 windows-all -sun/security/pkcs11/Mac/MacKAT.java 8204203 windows-all -sun/security/pkcs11/Mac/MacSameTest.java 8204203 windows-all -sun/security/pkcs11/Mac/ReinitMac.java 8204203 windows-all -sun/security/pkcs11/MessageDigest/ByteBuffers.java 8204203 windows-all -sun/security/pkcs11/MessageDigest/DigestKAT.java 8204203 windows-all -sun/security/pkcs11/MessageDigest/ReinitDigest.java 8204203 windows-all -sun/security/pkcs11/MessageDigest/TestCloning.java 8204203 windows-all -sun/security/pkcs11/Provider/ConfigQuotedString.sh 8204203 windows-all -sun/security/pkcs11/Provider/Login.sh 8204203 windows-all -sun/security/pkcs11/SampleTest.java 8204203 windows-all -sun/security/pkcs11/Secmod/AddPrivateKey.java 8204203 windows-all -sun/security/pkcs11/Secmod/Crypto.java 8204203 windows-all -sun/security/pkcs11/Secmod/GetPrivateKey.java 8204203 windows-all -sun/security/pkcs11/Secmod/JksSetPrivateKey.java 8204203 windows-all -sun/security/pkcs11/Secmod/LoadKeystore.java 8204203 windows-all -sun/security/pkcs11/Secmod/TestNssDbSqlite.java 8204203 windows-all -sun/security/pkcs11/SecureRandom/Basic.java 8204203 windows-all -sun/security/pkcs11/SecureRandom/TestDeserialization.java 8204203 windows-all -sun/security/pkcs11/Serialize/SerializeProvider.java 8204203 windows-all -sun/security/pkcs11/Signature/ByteBuffers.java 8204203 windows-all -sun/security/pkcs11/Signature/ReinitSignature.java 8204203 windows-all -sun/security/pkcs11/Signature/TestDSA.java 8204203 windows-all -sun/security/pkcs11/Signature/TestDSAKeyLength.java 8204203 windows-all -sun/security/pkcs11/Signature/TestRSAKeyLength.java 8204203 windows-all -sun/security/pkcs11/ec/ReadCertificates.java 8204203 windows-all -sun/security/pkcs11/ec/ReadPKCS12.java 8204203 windows-all -sun/security/pkcs11/ec/TestCurves.java 8204203 windows-all -sun/security/pkcs11/ec/TestECDH.java 8204203 windows-all -sun/security/pkcs11/ec/TestECDH2.java 8204203 windows-all -sun/security/pkcs11/ec/TestECDSA.java 8204203 windows-all -sun/security/pkcs11/ec/TestECDSA2.java 8204203 windows-all -sun/security/pkcs11/ec/TestECGenSpec.java 8204203 windows-all -sun/security/pkcs11/rsa/KeyWrap.java 8204203 windows-all -sun/security/pkcs11/rsa/TestCACerts.java 8204203 windows-all -sun/security/pkcs11/rsa/TestKeyFactory.java 8204203 windows-all -sun/security/pkcs11/rsa/TestKeyPairGenerator.java 8204203 windows-all -sun/security/pkcs11/rsa/TestSignatures.java 8204203 windows-all -sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8204203 windows-all -sun/security/pkcs11/tls/TestLeadingZeroesP11.java 8204203 windows-all -sun/security/pkcs11/tls/TestMasterSecret.java 8204203 windows-all -sun/security/pkcs11/tls/TestPRF.java 8204203 windows-all +sun/security/pkcs11/Cipher/TestRSACipherWrap.java 8204203 windows-all +sun/security/pkcs11/Cipher/TestRawRSACipher.java 8204203 windows-all +sun/security/pkcs11/Cipher/TestSymmCiphers.java 8204203 windows-all +sun/security/pkcs11/Cipher/TestSymmCiphersNoPad.java 8204203 windows-all +sun/security/pkcs11/KeyAgreement/SupportedDHKeys.java 8204203 windows-all +sun/security/pkcs11/KeyAgreement/TestDH.java 8204203 windows-all +sun/security/pkcs11/KeyAgreement/TestInterop.java 8204203 windows-all +sun/security/pkcs11/KeyAgreement/TestShort.java 8204203 windows-all +sun/security/pkcs11/KeyAgreement/UnsupportedDHKeys.java 8204203 windows-all +sun/security/pkcs11/KeyGenerator/DESParity.java 8204203 windows-all +sun/security/pkcs11/KeyGenerator/TestKeyGenerator.java 8204203 windows-all +sun/security/pkcs11/KeyPairGenerator/TestDH2048.java 8204203 windows-all +sun/security/pkcs11/KeyStore/SecretKeysBasic.sh 8204203 windows-all +sun/security/pkcs11/Mac/MacKAT.java 8204203 windows-all +sun/security/pkcs11/Mac/MacSameTest.java 8204203 windows-all +sun/security/pkcs11/Mac/ReinitMac.java 8204203 windows-all +sun/security/pkcs11/MessageDigest/ByteBuffers.java 8204203 windows-all +sun/security/pkcs11/MessageDigest/DigestKAT.java 8204203 windows-all +sun/security/pkcs11/MessageDigest/ReinitDigest.java 8204203 windows-all +sun/security/pkcs11/MessageDigest/TestCloning.java 8204203 windows-all +sun/security/pkcs11/Provider/ConfigQuotedString.sh 8204203 windows-all +sun/security/pkcs11/Provider/Login.sh 8204203 windows-all +sun/security/pkcs11/SampleTest.java 8204203 windows-all +sun/security/pkcs11/Secmod/AddPrivateKey.java 8204203 windows-all +sun/security/pkcs11/Secmod/Crypto.java 8204203 windows-all +sun/security/pkcs11/Secmod/GetPrivateKey.java 8204203 windows-all +sun/security/pkcs11/Secmod/JksSetPrivateKey.java 8204203 windows-all +sun/security/pkcs11/Secmod/LoadKeystore.java 8204203 windows-all +sun/security/pkcs11/Secmod/TestNssDbSqlite.java 8204203 windows-all +sun/security/pkcs11/SecureRandom/Basic.java 8204203 windows-all +sun/security/pkcs11/SecureRandom/TestDeserialization.java 8204203 windows-all +sun/security/pkcs11/Serialize/SerializeProvider.java 8204203 windows-all +sun/security/pkcs11/Signature/ByteBuffers.java 8204203 windows-all +sun/security/pkcs11/Signature/ReinitSignature.java 8204203 windows-all +sun/security/pkcs11/Signature/TestDSA.java 8204203 windows-all +sun/security/pkcs11/Signature/TestDSAKeyLength.java 8204203 windows-all +sun/security/pkcs11/Signature/TestRSAKeyLength.java 8204203 windows-all +sun/security/pkcs11/ec/ReadCertificates.java 8204203 windows-all +sun/security/pkcs11/ec/ReadPKCS12.java 8204203 windows-all +sun/security/pkcs11/ec/TestCurves.java 8204203 windows-all +sun/security/pkcs11/ec/TestECDH.java 8204203 windows-all +sun/security/pkcs11/ec/TestECDH2.java 8204203 windows-all +sun/security/pkcs11/ec/TestECDSA.java 8204203 windows-all +sun/security/pkcs11/ec/TestECDSA2.java 8204203 windows-all +sun/security/pkcs11/ec/TestECGenSpec.java 8204203 windows-all +sun/security/pkcs11/rsa/KeyWrap.java 8204203 windows-all +sun/security/pkcs11/rsa/TestCACerts.java 8204203 windows-all +sun/security/pkcs11/rsa/TestKeyFactory.java 8204203 windows-all +sun/security/pkcs11/rsa/TestKeyPairGenerator.java 8204203 windows-all +sun/security/pkcs11/rsa/TestSignatures.java 8204203 windows-all +sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 8204203 windows-all +sun/security/pkcs11/tls/TestLeadingZeroesP11.java 8204203 windows-all +sun/security/pkcs11/tls/TestMasterSecret.java 8204203 windows-all +sun/security/pkcs11/tls/TestPRF.java 8204203 windows-all sun/security/pkcs11/tls/TestPremaster.java 8204203 windows-all ############################################################################ @@ -682,6 +689,7 @@ javax/sound/sampled/DirectAudio/bug6372428.java 8055097 generic-all javax/sound/sampled/Clip/bug5070081.java 8055097 generic-all javax/sound/sampled/DataLine/LongFramePosition.java 8055097 generic-all +javax/sound/sampled/Clip/AutoCloseTimeCheck.java 8207150 generic-all javax/sound/sampled/Clip/Drain/ClipDrain.java 7062792 generic-all @@ -720,7 +728,6 @@ javax/swing/JSplitPane/4201995/bug4201995.java 8079127 generic-all javax/swing/JTree/DnD/LastNodeLowerHalfDrop.java 8159131 linux-all javax/swing/JTree/4633594/JTreeFocusTest.java 8173125 macosx-all -javax/swing/JTree/8003400/Test8003401.java 8011259 macosx-all,linux-all javax/swing/JFileChooser/8041694/bug8041694.java 8196302 windows-all javax/swing/AbstractButton/6711682/bug6711682.java 8060765 windows-all,macosx-all javax/swing/Action/8133039/bug8133039.java 8196089 windows-all,macosx-all @@ -801,7 +808,7 @@ javax/swing/PopupFactory/8048506/bug8048506.java 8202660 windows-all javax/swing/JTextArea/TextViewOOM/TextViewOOM.java 8167355 generic-all javax/swing/JEditorPane/8195095/ImageViewTest.java 8202656 windows-all -javax/swing/text/Utilities/8142966/SwingFontMetricsTest.java 8202663 windows-all +javax/swing/text/Utilities/8142966/SwingFontMetricsTest.java 8199529 windows-all javax/swing/JPopupMenu/8075063/ContextMenuScrollTest.java 202880 linux-all javax/swing/dnd/8139050/NativeErrorsInTableDnD.java 8202765 macosx-all,linux-all javax/swing/Popup/TaskbarPositionTest.java 8065097 macosx-all,linux-all @@ -823,9 +830,6 @@ tools/pack200/CommandLineTests.java 8059906 generic-all -tools/jimage/JImageExtractTest.java 8198405,8198819 generic-all -tools/jimage/JImageListTest.java 8198405 windows-all - ############################################################################ # jdk_jdi diff -Nru openjdk-11-11~19/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java openjdk-11-11~24/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java --- openjdk-11-11~19/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/EntrustCA.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,169 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8195774 + * @summary Interoperability tests with Entrust EC CA + * @build ValidatePathWithParams + * @run main/othervm -Djava.security.debug=certpath EntrustCA OCSP + * @run main/othervm -Djava.security.debug=certpath EntrustCA CRL + */ + +/* + * Obtain test artifacts for Entrust EC CA from: + * + * Valid https://validec.entrust.net + * + * Revoked https://revokedec.entrust.net + */ +public class EntrustCA { + + // Owner: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", + // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US + // Issuer: CN=Entrust Root Certification Authority - EC1, OU="(c) 2012 Entrust, Inc. - for authorized use only", + // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US + private static final String INT = "-----BEGIN CERTIFICATE-----\n" + + "MIID5zCCA2ygAwIBAgIQCoPUgD5+n1EAAAAAUdTB9zAKBggqhkjOPQQDAzCBvzEL\n" + + "MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl\n" + + "ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEy\n" + + "IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEzMDEGA1UE\n" + + "AxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRUMxMB4X\n" + + "DTE2MDQwNTIwMTk1NFoXDTM3MTAwNTIwNDk1NFowgboxCzAJBgNVBAYTAlVTMRYw\n" + + "FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3Qu\n" + + "bmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNiBFbnRydXN0LCBJbmMu\n" + + "IC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNVBAMTJUVudHJ1c3QgQ2Vy\n" + + "dGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMUowdjAQBgcqhkjOPQIBBgUrgQQAIgNi\n" + + "AAT14eFXmpQX/dEf7NAxrMH13n0btz1KKvH2S1rROGPAKex2CY8yxznbffK/MbCk\n" + + "F7ByYXGs1+8kL5xmTysU/c+YmjOZx2mMSAk2DPw30fijJ3tRrwChZ+TBpgtB6+A5\n" + + "MsCjggEuMIIBKjAOBgNVHQ8BAf8EBAMCAQYwEgYDVR0TAQH/BAgwBgEB/wIBADAz\n" + + "BggrBgEFBQcBAQQnMCUwIwYIKwYBBQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3Qu\n" + + "bmV0MDMGA1UdHwQsMCowKKAmoCSGImh0dHA6Ly9jcmwuZW50cnVzdC5uZXQvZWMx\n" + + "cm9vdC5jcmwwOwYDVR0gBDQwMjAwBgRVHSAAMCgwJgYIKwYBBQUHAgEWGmh0dHA6\n" + + "Ly93d3cuZW50cnVzdC5uZXQvcnBhMB0GA1UdJQQWMBQGCCsGAQUFBwMBBggrBgEF\n" + + "BQcDAjAdBgNVHQ4EFgQUw/lFA77I+Qs8RTXz63Ls5+jrlJswHwYDVR0jBBgwFoAU\n" + + "t2PnGt2N6QimVYOk4GpQQWURQkkwCgYIKoZIzj0EAwMDaQAwZgIxAPnVAOqxKDd7\n" + + "v37EBmpPqWCCWBFPKW6HpRx3GUWc9caeQIw8rO2HXYgf92pb/TsJYAIxAJhI0MpR\n" + + "z5L42xF1R9UIPfQxCMwgsnWBqIqcfMrMO+2DxQy6GIP3cFFj9gRyxguKWw==\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=validec.entrust.net, SERIALNUMBER=D15576572, OID.2.5.4.15=Private Organization, O="Entrust, Inc.", + // OID.1.3.6.1.4.1.311.60.2.1.2=Maryland, OID.1.3.6.1.4.1.311.60.2.1.3=US, L=Kanata, ST=Ontario, C=CA + // Issuer: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", + // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US + private static final String VALID = "-----BEGIN CERTIFICATE-----\n" + + "MIIFrTCCBTKgAwIBAgIQYtgW4DLwh74AAAAAVqBXkTAKBggqhkjOPQQDAjCBujEL\n" + + "MAkGA1UEBhMCVVMxFjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1Nl\n" + + "ZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDE2\n" + + "IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25seTEuMCwGA1UE\n" + + "AxMlRW50cnVzdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAtIEwxSjAeFw0xODA2\n" + + "MjUxMzE1NTdaFw0xOTA2MjUxMzQ1NTBaMIHJMQswCQYDVQQGEwJDQTEQMA4GA1UE\n" + + "CBMHT250YXJpbzEPMA0GA1UEBxMGS2FuYXRhMRMwEQYLKwYBBAGCNzwCAQMTAlVT\n" + + "MRkwFwYLKwYBBAGCNzwCAQITCE1hcnlsYW5kMRYwFAYDVQQKEw1FbnRydXN0LCBJ\n" + + "bmMuMR0wGwYDVQQPExRQcml2YXRlIE9yZ2FuaXphdGlvbjESMBAGA1UEBRMJRDE1\n" + + "NTc2NTcyMRwwGgYDVQQDExN2YWxpZGVjLmVudHJ1c3QubmV0MFkwEwYHKoZIzj0C\n" + + "AQYIKoZIzj0DAQcDQgAEHQe7lUaAUgIwR9EiLJlhkbx+HfSr22M3JvQD6+fnYgqd\n" + + "55e6E1UE45fk92UpqPi1CEbXrdpmWKu1Z470B9cPGaOCAwcwggMDMB4GA1UdEQQX\n" + + "MBWCE3ZhbGlkZWMuZW50cnVzdC5uZXQwggF/BgorBgEEAdZ5AgQCBIIBbwSCAWsB\n" + + "aQB1AFWB1MIWkDYBSuoLm1c8U/DA5Dh4cCUIFy+jqh0HE9MMAAABZDcxpMkAAAQD\n" + + "AEYwRAIgIb0PwjCcNOchJg8Zywz/0Lwm2vEOJUSao6BqNUIsyaYCIElHHexB06LE\n" + + "yXWDXO7UqOtWT6uqkdJN8V4TzwT9B4o4AHcA3esdK3oNT6Ygi4GtgWhwfi6OnQHV\n" + + "XIiNPRHEzbbsvswAAAFkNzGkvgAABAMASDBGAiEAlxy/kxB9waIifYn+EV550pvA\n" + + "C3jUfS/bjsKbcsBH9cQCIQDSHTJORz6fZu8uLFhpV525pw7iHVh2dSn3gpcteObh\n" + + "DQB3ALvZ37wfinG1k5Qjl6qSe0c4V5UKq1LoGpCWZDaOHtGFAAABZDcxpTsAAAQD\n" + + "AEgwRgIhAPCBqVqSvAEIXMPloV0tfBEEdjRrAhiG407cPqYwt9AFAiEAuQf4R5os\n" + + "MLkD3XhxvrTDvnD+PUOf8PzPevsWkuxNqcQwDgYDVR0PAQH/BAQDAgeAMB0GA1Ud\n" + + "JQQWMBQGCCsGAQUFBwMBBggrBgEFBQcDAjBjBggrBgEFBQcBAQRXMFUwIwYIKwYB\n" + + "BQUHMAGGF2h0dHA6Ly9vY3NwLmVudHJ1c3QubmV0MC4GCCsGAQUFBzAChiJodHRw\n" + + "Oi8vYWlhLmVudHJ1c3QubmV0L2wxai1lYzEuY2VyMDMGA1UdHwQsMCowKKAmoCSG\n" + + "Imh0dHA6Ly9jcmwuZW50cnVzdC5uZXQvbGV2ZWwxai5jcmwwSgYDVR0gBEMwQTA2\n" + + "BgpghkgBhvpsCgECMCgwJgYIKwYBBQUHAgEWGmh0dHA6Ly93d3cuZW50cnVzdC5u\n" + + "ZXQvcnBhMAcGBWeBDAEBMB8GA1UdIwQYMBaAFMP5RQO+yPkLPEU18+ty7Ofo65Sb\n" + + "MB0GA1UdDgQWBBT+J7OhS6gskCanmOGnx10DPSF8ATAJBgNVHRMEAjAAMAoGCCqG\n" + + "SM49BAMCA2kAMGYCMQCQLUQABT74TmdHzAtB97uNF5+Zy15wzkmlKeRSOXCIf2C5\n" + + "YKjsgdkR1OdzZXcpjNgCMQDfWcdPhodNXZC4l1lLPOPaTzPPw6uVqqoITQlc6r1t\n" + + "dRkkD6K9ii/X8EtwoFp7s80=\n" + + "-----END CERTIFICATE-----"; + + // Owner: CN=revokedec.entrust.net, SERIALNUMBER=115868500, OID.2.5.4.15=Private Organization, O="Entrust, Inc.", + // OID.1.3.6.1.4.1.311.60.2.1.2=Texas, OID.1.3.6.1.4.1.311.60.2.1.3=US, L=Kanata, ST=Ontario, C=CA + // Issuer: CN=Entrust Certification Authority - L1J, OU="(c) 2016 Entrust, Inc. - for authorized use only", + // OU=See www.entrust.net/legal-terms, O="Entrust, Inc.", C=US + private static final String REVOKED = "-----BEGIN CERTIFICATE-----\n" + + "MIIGJzCCBaygAwIBAgIRAM0WDfag1taIAAAAAFagJ5gwCgYIKoZIzj0EAwIwgbox\n" + + "CzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9T\n" + + "ZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAx\n" + + "NiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxLjAsBgNV\n" + + "BAMTJUVudHJ1c3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgLSBMMUowHhcNMTcw\n" + + "NTI0MTcwNzA4WhcNMTkwNTI0MTczNjU1WjCByDELMAkGA1UEBhMCQ0ExEDAOBgNV\n" + + "BAgTB09udGFyaW8xDzANBgNVBAcTBkthbmF0YTETMBEGCysGAQQBgjc8AgEDEwJV\n" + + "UzEWMBQGCysGAQQBgjc8AgECEwVUZXhhczEWMBQGA1UEChMNRW50cnVzdCwgSW5j\n" + + "LjEdMBsGA1UEDxMUUHJpdmF0ZSBPcmdhbml6YXRpb24xEjAQBgNVBAUTCTExNTg2\n" + + "ODUwMDEeMBwGA1UEAxMVcmV2b2tlZGVjLmVudHJ1c3QubmV0MFkwEwYHKoZIzj0C\n" + + "AQYIKoZIzj0DAQcDQgAEN5MP/59yrs9uwVM/Mrc8IuHonMChAZgN2twwvh8KTnR2\n" + + "3stfem/R+NtLccq+4ds1+8ktnXgP7u1x0as6IJOH1qOCA4EwggN9MCAGA1UdEQQZ\n" + + "MBeCFXJldm9rZWRlYy5lbnRydXN0Lm5ldDCCAfcGCisGAQQB1nkCBAIEggHnBIIB\n" + + "4wHhAHYA7ku9t3XOYLrhQmkfq+GeZqMPfl+wctiDAMR7iXqo/csAAAFcO4iiogAA\n" + + "BAMARzBFAiAgHVpryyNVgnsUIihu+5DC2/vuP8Cy5iXq8NhCBXg8UgIhAKi5jImT\n" + + "f1FJksvHboc0EZh9TWhWljVZ6E5jB2CL+qzeAHcAVhQGmi/XwuzT9eG9RLI+x0Z2\n" + + "ubyZEVzA75SYVdaJ0N0AAAFcO4ij9QAABAMASDBGAiEA4B2p2726ISSkKC9WVlzj\n" + + "BVwYZ1Hr7mTjPrFqkoGpEHYCIQC5iuInkJXGBANLTH06BHIQkkr4KnFRl9QBOSw4\n" + + "b+kNqgB1AN3rHSt6DU+mIIuBrYFocH4ujp0B1VyIjT0RxM227L7MAAABXDuIpkcA\n" + + "AAQDAEYwRAIgQ9ssw19wIhHWW6IWgwnIyB7e30HacBNX6S1eQ3GUX04CICffGj3A\n" + + "WWmK9lixmk35YklMnSXNqHQezSYRiCYtXxejAHcApLkJkLQYWBSHuxOizGdwCjw1\n" + + "mAT5G9+443fNDsgN3BAAAAFcO4inUwAABAMASDBGAiEA+8T9tpPw/mU/STsNv0oz\n" + + "8Nla21fKlpEOyWqDKWPSUeYCIQCwI5tDyyaJtyFY9/OVqLG+BKPKjscUtTqGJYl4\n" + + "XbOo1jAOBgNVHQ8BAf8EBAMCB4AwHQYDVR0lBBYwFAYIKwYBBQUHAwEGCCsGAQUF\n" + + "BwMCMGMGCCsGAQUFBwEBBFcwVTAjBggrBgEFBQcwAYYXaHR0cDovL29jc3AuZW50\n" + + "cnVzdC5uZXQwLgYIKwYBBQUHMAKGImh0dHA6Ly9haWEuZW50cnVzdC5uZXQvbDFq\n" + + "LWVjMS5jZXIwMwYDVR0fBCwwKjAooCagJIYiaHR0cDovL2NybC5lbnRydXN0Lm5l\n" + + "dC9sZXZlbDFqLmNybDBKBgNVHSAEQzBBMDYGCmCGSAGG+mwKAQIwKDAmBggrBgEF\n" + + "BQcCARYaaHR0cDovL3d3dy5lbnRydXN0Lm5ldC9ycGEwBwYFZ4EMAQEwHwYDVR0j\n" + + "BBgwFoAUw/lFA77I+Qs8RTXz63Ls5+jrlJswHQYDVR0OBBYEFIj28ytR8ulo1p2t\n" + + "ZnBQOLK0rlLUMAkGA1UdEwQCMAAwCgYIKoZIzj0EAwIDaQAwZgIxANzqGRI0en5P\n" + + "gSUDcdwoQSNKrBPBfGz2AQVLHAXsxvIlGhKZAQtM49zxA8AdFy/agwIxAMEjJH6A\n" + + "4UbcGZc40eYu6wUbAxiUDD3gwSElNQ8Z6IhNLPCCdMM6KZORyaagAcXn4A==\n" + + "-----END CERTIFICATE-----"; + + public static void main(String[] args) throws Exception { + + ValidatePathWithParams pathValidator = new ValidatePathWithParams(null); + + if (args.length >= 1 && "CRL".equalsIgnoreCase(args[0])) { + pathValidator.enableCRLCheck(); + } else { + // OCSP check by default + pathValidator.enableOCSPCheck(); + } + + // Validate valid + pathValidator.validate(new String[]{VALID, INT}, + ValidatePathWithParams.Status.GOOD, null, System.out); + + // Validate Revoked + pathValidator.validate(new String[]{REVOKED, INT}, + ValidatePathWithParams.Status.REVOKED, + "Wed May 24 10:39:28 PDT 2017", System.out); + } + +} diff -Nru openjdk-11-11~19/test/jdk/sun/java2d/cmm/ColorConvertOp/ConstructorsNullTest/ConstructorsNullTest.java openjdk-11-11~24/test/jdk/sun/java2d/cmm/ColorConvertOp/ConstructorsNullTest/ConstructorsNullTest.java --- openjdk-11-11~19/test/jdk/sun/java2d/cmm/ColorConvertOp/ConstructorsNullTest/ConstructorsNullTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/java2d/cmm/ColorConvertOp/ConstructorsNullTest/ConstructorsNullTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2000, 2007, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -75,14 +75,6 @@ this.setLayout (new BorderLayout ()); - String[] instructions = - { - "This is an AUTOMATIC test", - "simply wait until it is done" - }; - Sysout.createDialog( ); - Sysout.printInstructions( instructions ); - }//End init() public void start () @@ -108,153 +100,16 @@ } if (!passed) { - Sysout.println("Test FAILED: one of constructors didn't throw NullPointerException."); + System.out.println("Test FAILED: one of constructors didn't throw NullPointerException."); throw new RuntimeException("Test FAILED: one of constructors didn't throw NullPointerException."); } - Sysout.println("Test PASSED: all constructors threw NullPointerException."); + System.out.println("Test PASSED: all constructors threw NullPointerException."); //What would normally go into main() will probably go here. //Use System.out.println for diagnostic messages that you want //to read after the test is done. - //Use Sysout.println for messages you want the tester to read. + //Use System.out.println for messages you want the tester to read. }// start() }// class ConstructorsNullTest - - -/**************************************************** - Standard Test Machinery - DO NOT modify anything below -- it's a standard - chunk of code whose purpose is to make user - interaction uniform, and thereby make it simpler - to read and understand someone else's test. - ****************************************************/ - -/** - This is part of the standard test machinery. - It creates a dialog (with the instructions), and is the interface - for sending text messages to the user. - To print the instructions, send an array of strings to Sysout.createDialog - WithInstructions method. Put one line of instructions per array entry. - To display a message for the tester to see, simply call Sysout.println - with the string to be displayed. - This mimics System.out.println but works within the test harness as well - as standalone. - */ - -class Sysout - { - private static TestDialog dialog; - - public static void createDialogWithInstructions( String[] instructions ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - dialog.printInstructions( instructions ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - public static void createDialog( ) - { - dialog = new TestDialog( new Frame(), "Instructions" ); - String[] defInstr = { "Instructions will appear here. ", "" } ; - dialog.printInstructions( defInstr ); - dialog.show(); - println( "Any messages for the tester will display here." ); - } - - - public static void printInstructions( String[] instructions ) - { - dialog.printInstructions( instructions ); - } - - - public static void println( String messageIn ) - { - dialog.displayMessage( messageIn ); - } - - }// Sysout class - -/** - This is part of the standard test machinery. It provides a place for the - test instructions to be displayed, and a place for interactive messages - to the user to be displayed. - To have the test instructions displayed, see Sysout. - To have a message to the user be displayed, see Sysout. - Do not call anything in this dialog directly. - */ -class TestDialog extends Dialog - { - - TextArea instructionsText; - TextArea messageText; - int maxStringLength = 80; - - //DO NOT call this directly, go through Sysout - public TestDialog( Frame frame, String name ) - { - super( frame, name ); - int scrollBoth = TextArea.SCROLLBARS_BOTH; - instructionsText = new TextArea( "", 15, maxStringLength, scrollBoth ); - add( "North", instructionsText ); - - messageText = new TextArea( "", 5, maxStringLength, scrollBoth ); - add("South", messageText); - - pack(); - - show(); - }// TestDialog() - - //DO NOT call this directly, go through Sysout - public void printInstructions( String[] instructions ) - { - //Clear out any current instructions - instructionsText.setText( "" ); - - //Go down array of instruction strings - - String printStr, remainingStr; - for( int i=0; i < instructions.length; i++ ) - { - //chop up each into pieces maxSringLength long - remainingStr = instructions[ i ]; - while( remainingStr.length() > 0 ) - { - //if longer than max then chop off first max chars to print - if( remainingStr.length() >= maxStringLength ) - { - //Try to chop on a word boundary - int posOfSpace = remainingStr. - lastIndexOf( ' ', maxStringLength - 1 ); - - if( posOfSpace <= 0 ) posOfSpace = maxStringLength - 1; - - printStr = remainingStr.substring( 0, posOfSpace + 1 ); - remainingStr = remainingStr.substring( posOfSpace + 1 ); - } - //else just print - else - { - printStr = remainingStr; - remainingStr = ""; - } - - instructionsText.append( printStr + "\n" ); - - }// while - - }// for - - }//printInstructions() - - //DO NOT call this directly, go through Sysout - public void displayMessage( String messageIn ) - { - messageText.append( messageIn + "\n" ); - } - - }// TestDialog class diff -Nru openjdk-11-11~19/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh openjdk-11-11~24/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh --- openjdk-11-11~19/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/management/jmxremote/bootstrap/GeneratePropertyPassword.sh 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ # -# Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -34,13 +34,12 @@ OS=`uname -s` UMASK=`umask` -case $OS in -CYGWIN_NT*) +if [[ $OS == CYGWIN_NT* ]] ; then OS="Windows_NT" if [ -z "$SystemRoot" ] ; then - SystemRoot=$SYSTEMROOT + SystemRoot=`cygpath $SYSTEMROOT` fi -esac +fi case $OS in SunOS | Linux | Darwin | AIX ) @@ -70,17 +69,17 @@ if [ "$OS" = "Windows_NT" ]; then USER=`id -u -n` CACLS="$SystemRoot/system32/cacls.exe" - REVOKEALL="${TESTSRC}/../../windows/revokeall.exe" + TEST_SRC=`cygpath ${TESTSRC}` + REVOKEALL="$TEST_SRC/../../windows/revokeall.exe" if [ ! -f "$REVOKEALL" ] ; then echo "$REVOKEALL missing" exit 1 fi + chmod ug+x $REVOKEALL fi - - ;; *) - echo "Unrecognized system!" + echo "Unrecognized system! $OS" exit 1 ;; esac diff -Nru openjdk-11-11~19/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ReadTimeout.java openjdk-11-11~24/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ReadTimeout.java --- openjdk-11-11~19/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ReadTimeout.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/net/www/protocol/https/HttpsURLConnection/ReadTimeout.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -175,9 +175,9 @@ throw new Exception( "system property timeout configuration does not work"); - } catch (SocketTimeoutException stex) { + } catch (SSLException | SocketTimeoutException ex) { System.out.println("Got expected timeout exception for " + - "system property timeout configuration: " + stex); + "system property timeout configuration: " + getCause(ex)); } finally { done(); http.disconnect(); @@ -196,9 +196,9 @@ throw new Exception( "HttpsURLConnection.setReadTimeout() does not work"); - } catch (SocketTimeoutException stex) { + } catch (SSLException | SocketTimeoutException ex) { System.out.println("Got expected timeout exception for " + - "HttpsURLConnection.setReadTimeout(): " + stex); + "HttpsURLConnection.setReadTimeout(): " + getCause(ex)); } finally { done(); http.disconnect(); @@ -208,6 +208,20 @@ } } + private Exception getCause(Exception ex) { + Exception cause = null; + if (ex instanceof SSLException) { + cause = (Exception) ex.getCause(); + if (!(cause instanceof SocketTimeoutException)) { + throw new RuntimeException("Unexpected cause", cause); + } + } else { + cause = ex; + } + + return cause; + } + static class NameVerifier implements HostnameVerifier { public boolean verify(String hostname, SSLSession session) { return true; diff -Nru openjdk-11-11~19/test/jdk/sun/nio/ch/TestMaxCachedBufferSize.java openjdk-11-11~24/test/jdk/sun/nio/ch/TestMaxCachedBufferSize.java --- openjdk-11-11~19/test/jdk/sun/nio/ch/TestMaxCachedBufferSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/nio/ch/TestMaxCachedBufferSize.java 2018-07-25 15:36:46.000000000 +0000 @@ -39,6 +39,7 @@ import java.util.List; import java.util.Random; +import java.util.concurrent.CountDownLatch; /* * @test @@ -93,6 +94,7 @@ // by setting the jdk.nio.maxCachedBufferSize property. private static class Worker implements Runnable { private final int id; + private final CountDownLatch finishLatch, exitLatch; private final Random random = new Random(); private long smallBufferCount = 0; private long largeBufferCount = 0; @@ -152,6 +154,13 @@ } } catch (IOException e) { throw new Error("I/O error", e); + } finally { + finishLatch.countDown(); + try { + exitLatch.await(); + } catch (InterruptedException e) { + // ignore + } } } @@ -160,8 +169,10 @@ loop(); } - public Worker(int id) { + public Worker(int id, CountDownLatch finishLatch, CountDownLatch exitLatch) { this.id = id; + this.finishLatch = finishLatch; + this.exitLatch = exitLatch; } } @@ -171,10 +182,6 @@ System.out.printf("Direct %d / %dK\n", directCount, directTotalCapacity / 1024); - // Note that directCount could be < expectedCount. This can - // happen if a GC occurs after one of the worker threads exits - // since its thread-local DirectByteBuffer could be cleaned up - // before we reach here. if (directCount > expectedCount) { throw new Error(String.format( "inconsistent direct buffer total count, expected = %d, found = %d", @@ -208,46 +215,57 @@ threadNum, iters, maxBufferSize); System.out.println(); + final CountDownLatch finishLatch = new CountDownLatch(threadNum); + final CountDownLatch exitLatch = new CountDownLatch(1); final Thread[] threads = new Thread[threadNum]; for (int i = 0; i < threadNum; i += 1) { - threads[i] = new Thread(new Worker(i)); + threads[i] = new Thread(new Worker(i, finishLatch, exitLatch)); threads[i].start(); } try { - for (int i = 0; i < threadNum; i += 1) { - threads[i].join(); + try { + finishLatch.await(); + } catch (InterruptedException e) { + throw new Error("finishLatch.await() interrupted!", e); } - } catch (InterruptedException e) { - throw new Error("join() interrupted!", e); - } - // There is an assumption here that, at this point, only the - // cached DirectByteBuffers should be active. Given we - // haven't used any other DirectByteBuffers in this test, this - // should hold. - // - // Also note that we can only do the sanity checking at the - // end and not during the run given that, at any time, there - // could be buffers currently in use by some of the workers - // that will not be cached. - - System.out.println(); - if (maxBufferSize < SMALL_BUFFER_MAX_SIZE) { - // The max buffer size is smaller than all buffers that - // were allocated. No buffers should have been cached. - checkDirectBuffers(0, 0); - } else if (maxBufferSize < LARGE_BUFFER_MIN_SIZE) { - // The max buffer size is larger than all small buffers - // but smaller than all large buffers that were - // allocated. Only small buffers could have been cached. - checkDirectBuffers(threadNum, - (long) threadNum * (long) SMALL_BUFFER_MAX_SIZE); - } else { - // The max buffer size is larger than all buffers that - // were allocated. All buffers could have been cached. - checkDirectBuffers(threadNum, - (long) threadNum * (long) LARGE_BUFFER_MAX_SIZE); + // There is an assumption here that, at this point, only the + // cached DirectByteBuffers should be active. Given we + // haven't used any other DirectByteBuffers in this test, this + // should hold. + // + // Also note that we can only do the sanity checking at the + // end and not during the run given that, at any time, there + // could be buffers currently in use by some of the workers + // that will not be cached. + + System.out.println(); + if (maxBufferSize < SMALL_BUFFER_MAX_SIZE) { + // The max buffer size is smaller than all buffers that + // were allocated. No buffers should have been cached. + checkDirectBuffers(0, 0); + } else if (maxBufferSize < LARGE_BUFFER_MIN_SIZE) { + // The max buffer size is larger than all small buffers + // but smaller than all large buffers that were + // allocated. Only small buffers could have been cached. + checkDirectBuffers(threadNum, + (long) threadNum * (long) SMALL_BUFFER_MAX_SIZE); + } else { + // The max buffer size is larger than all buffers that + // were allocated. All buffers could have been cached. + checkDirectBuffers(threadNum, + (long) threadNum * (long) LARGE_BUFFER_MAX_SIZE); + } + } finally { + exitLatch.countDown(); + try { + for (int i = 0; i < threadNum; i += 1) { + threads[i].join(); + } + } catch (InterruptedException e) { + // ignore + } } } } diff -Nru openjdk-11-11~19/test/jdk/sun/nio/cs/TestIBMBugs.java openjdk-11-11~24/test/jdk/sun/nio/cs/TestIBMBugs.java --- openjdk-11-11~19/test/jdk/sun/nio/cs/TestIBMBugs.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/nio/cs/TestIBMBugs.java 2018-07-25 15:36:46.000000000 +0000 @@ -30,6 +30,7 @@ import java.io.*; import java.nio.*; import java.nio.charset.*; +import java.util.Arrays; public class TestIBMBugs { @@ -173,6 +174,53 @@ } } + private static void bug8202329() throws Exception { + String original = "\\\u007E\u00A5\u203E"; // [backslash][tilde][yen][overscore] + byte[] expectedBytes; // bytes after conversion + String expectedStringfromBytes; // String constructed from bytes + + Charset charset; // charset used for conversion + + ByteBuffer bb; // Buffer that holds encoded bytes + byte[] ba; // byte array that holds encoded bytes + + CharBuffer cb; // Buffer that holds decoded chars + + + // Test IBM943, where \ and ~ are encoded to unmappable i.e., 0x3f + // and [yen] and [overscore] are encoded to 0x5c and 0x7e + charset = Charset.forName("IBM943"); + expectedBytes = new byte[] {0x3f, 0x3f, 0x5c, 0x7e}; + expectedStringfromBytes = "??\u00A5\u203E"; + bb = charset.encode(original); + ba = new byte[bb.remaining()]; + bb.get(ba, 0, ba.length); + if(!Arrays.equals(ba, expectedBytes)) { + throw new Exception("IBM943 failed to encode"); + } + cb = charset.decode(ByteBuffer.wrap(expectedBytes)); + if(!cb.toString().equals(expectedStringfromBytes)) { + throw new Exception("IBM943 failed to decode"); + } + + + // Test IBM943C, where \ and ~ are encoded to 0x5c and 0x7e + // and [yen] and [overscore] are encoded to 0x5c and 0x7e + charset = Charset.forName("IBM943C"); + expectedBytes = new byte[] {0x5c, 0x7e, 0x5c, 0x7e}; + expectedStringfromBytes = "\\~\\~"; + bb = charset.encode(original); + ba = new byte[bb.remaining()]; + bb.get(ba, 0, ba.length); + if(!Arrays.equals(ba, expectedBytes)) { + throw new Exception("IBM943C failed to encode"); + } + cb = charset.decode(ByteBuffer.wrap(expectedBytes)); + if(!cb.toString().equals(expectedStringfromBytes)) { + throw new Exception("IBM943C failed to decode"); + } + } + public static void main (String[] args) throws Exception { bug6577466(); // need to be tested before any other IBM949C test case @@ -183,5 +231,6 @@ bug6371619(); bug6371431(); bug6569191(); + bug8202329(); } } diff -Nru openjdk-11-11~19/test/jdk/sun/security/ec/InvalidCurve.java openjdk-11-11~24/test/jdk/sun/security/ec/InvalidCurve.java --- openjdk-11-11~19/test/jdk/sun/security/ec/InvalidCurve.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ec/InvalidCurve.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -40,7 +40,7 @@ try { keyGen = KeyPairGenerator.getInstance("EC", "SunEC"); ECGenParameterSpec brainpoolSpec = - new ECGenParameterSpec("brainpoolP256r1"); + new ECGenParameterSpec("brainpoolP160r1"); keyGen.initialize(brainpoolSpec); } catch (InvalidAlgorithmParameterException ex) { System.out.println(ex.getMessage()); diff -Nru openjdk-11-11~19/test/jdk/sun/security/ec/TestEC.java openjdk-11-11~24/test/jdk/sun/security/ec/TestEC.java --- openjdk-11-11~19/test/jdk/sun/security/ec/TestEC.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ec/TestEC.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -34,6 +34,7 @@ * @library ../pkcs11/ec * @library ../pkcs11/sslecc * @library ../../../java/security/testlibrary + * @library ../../../javax/net/ssl/TLSCommon * @modules jdk.crypto.cryptoki/sun.security.pkcs11.wrapper * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" TestEC * @run main/othervm/java.security.policy=TestEC.policy -Djdk.tls.namedGroups="secp256r1,sect193r1" TestEC diff -Nru openjdk-11-11~19/test/jdk/sun/security/ec/xec/TestXDH.java openjdk-11-11~24/test/jdk/sun/security/ec/xec/TestXDH.java --- openjdk-11-11~19/test/jdk/sun/security/ec/xec/TestXDH.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ec/xec/TestXDH.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,7 @@ /* * @test - * @bug 8171277 + * @bug 8171277 8206915 * @summary Test XDH key agreement * @library /test/lib * @build jdk.test.lib.Convert @@ -66,15 +66,17 @@ throws Exception { KeyPairGenerator kpg = KeyPairGenerator.getInstance(name); + AlgorithmParameterSpec paramSpec = null; if (param instanceof Integer) { kpg.initialize((Integer) param); } else if (param instanceof String) { - kpg.initialize(new NamedParameterSpec((String) param)); + paramSpec = new NamedParameterSpec((String) param); + kpg.initialize(paramSpec); } KeyPair kp = kpg.generateKeyPair(); KeyAgreement ka = KeyAgreement.getInstance(name); - ka.init(kp.getPrivate()); + ka.init(kp.getPrivate(), paramSpec); ka.doPhase(kp.getPublic(), true); byte[] secret = ka.generateSecret(); @@ -96,6 +98,16 @@ throw new RuntimeException("Arrays not equal"); } + // make sure generateSecret() resets the state to after init() + try { + ka.generateSecret(); + throw new RuntimeException("generateSecret does not reset state"); + } catch (IllegalStateException ex) { + // do nothing---this is expected + } + ka.doPhase(pubKey, true); + ka.generateSecret(); + // test with XDH key specs XECPublicKeySpec xdhPublic = kf.getKeySpec(kp.getPublic(), XECPublicKeySpec.class); diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/KDC.java openjdk-11-11~24/test/jdk/sun/security/krb5/auto/KDC.java --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/KDC.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/KDC.java 2018-07-25 15:36:46.000000000 +0000 @@ -713,10 +713,10 @@ /** * Returns a KerberosTime. * - * @param offset offset from NOW in milliseconds + * @param offset offset from NOW in seconds */ - private static KerberosTime timeFor(long offset) { - return new KerberosTime(new Date().getTime() + offset); + private static KerberosTime timeAfter(int offset) { + return new KerberosTime(new Date().getTime() + offset * 1000L); } /** @@ -832,12 +832,12 @@ KerberosTime from = body.from; KerberosTime till = body.till; if (from == null || from.isZero()) { - from = timeFor(0); + from = timeAfter(0); } if (till == null) { throw new KrbException(Krb5.KDC_ERR_NEVER_VALID); // TODO } else if (till.isZero()) { - till = timeFor(1000 * DEFAULT_LIFETIME); + till = timeAfter(DEFAULT_LIFETIME); } boolean[] bFlags = new boolean[Krb5.TKT_OPTS_MAX+1]; @@ -863,7 +863,7 @@ } if (body.kdcOptions.get(KDCOptions.RENEWABLE)) { bFlags[Krb5.TKT_OPTS_RENEWABLE] = true; - //renew = timeFor(1000 * 3600 * 24 * 7); + //renew = timeAfter(3600 * 24 * 7); } if (body.kdcOptions.get(KDCOptions.PROXIABLE)) { bFlags[Krb5.TKT_OPTS_PROXIABLE] = true; @@ -933,7 +933,7 @@ key, cname, new TransitedEncoding(1, new byte[0]), // TODO - timeFor(0), + timeAfter(0), from, till, renewTill, body.addresses != null ? body.addresses @@ -952,13 +952,13 @@ EncTGSRepPart enc_part = new EncTGSRepPart( key, new LastReq(new LastReqEntry[] { - new LastReqEntry(0, timeFor(-10000)) + new LastReqEntry(0, timeAfter(-10)) }), body.getNonce(), // TODO: detect replay - timeFor(1000 * 3600 * 24), + timeAfter(3600 * 24), // Next 5 and last MUST be same with ticket tFlags, - timeFor(0), + timeAfter(0), from, till, renewTill, service, @@ -986,7 +986,7 @@ + " " +ke.returnCodeMessage()); if (kerr == null) { kerr = new KRBError(null, null, null, - timeFor(0), + timeAfter(0), 0, ke.returnCode(), body.cname, @@ -1059,20 +1059,21 @@ KerberosTime till = body.till; KerberosTime rtime = body.rtime; if (from == null || from.isZero()) { - from = timeFor(0); + from = timeAfter(0); } if (till == null) { throw new KrbException(Krb5.KDC_ERR_NEVER_VALID); // TODO } else if (till.isZero()) { - till = timeFor(1000 * DEFAULT_LIFETIME); - } else if (till.greaterThan(timeFor(24 * 3600 * 1000))) { + till = timeAfter(DEFAULT_LIFETIME); + } else if (till.greaterThan(timeAfter(24 * 3600)) + && System.getProperty("test.kdc.force.till") == null) { // If till is more than 1 day later, make it renewable - till = timeFor(1000 * DEFAULT_LIFETIME); + till = timeAfter(DEFAULT_LIFETIME); body.kdcOptions.set(KDCOptions.RENEWABLE, true); if (rtime == null) rtime = till; } if (rtime == null && body.kdcOptions.get(KDCOptions.RENEWABLE)) { - rtime = timeFor(1000 * DEFAULT_RENEWTIME); + rtime = timeAfter(DEFAULT_RENEWTIME); } //body.from boolean[] bFlags = new boolean[Krb5.TKT_OPTS_MAX+1]; @@ -1088,7 +1089,7 @@ } if (body.kdcOptions.get(KDCOptions.RENEWABLE)) { bFlags[Krb5.TKT_OPTS_RENEWABLE] = true; - //renew = timeFor(1000 * 3600 * 24 * 7); + //renew = timeAfter(3600 * 24 * 7); } if (body.kdcOptions.get(KDCOptions.PROXIABLE)) { bFlags[Krb5.TKT_OPTS_PROXIABLE] = true; @@ -1234,7 +1235,7 @@ key, body.cname, new TransitedEncoding(1, new byte[0]), - timeFor(0), + timeAfter(0), from, till, rtime, body.addresses, @@ -1246,13 +1247,13 @@ EncASRepPart enc_part = new EncASRepPart( key, new LastReq(new LastReqEntry[]{ - new LastReqEntry(0, timeFor(-10000)) + new LastReqEntry(0, timeAfter(-10)) }), body.getNonce(), // TODO: detect replay? - timeFor(1000 * 3600 * 24), + timeAfter(3600 * 24), // Next 5 and last MUST be same with ticket tFlags, - timeFor(0), + timeAfter(0), from, till, rtime, service, @@ -1314,7 +1315,7 @@ eData = temp.toByteArray(); } kerr = new KRBError(null, null, null, - timeFor(0), + timeAfter(0), 0, ke.returnCode(), body.cname, diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/LongLife.java openjdk-11-11~24/test/jdk/sun/security/krb5/auto/LongLife.java --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/LongLife.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/LongLife.java 2018-07-25 15:36:46.000000000 +0000 @@ -23,7 +23,7 @@ /* * @test - * @bug 8131051 8194486 + * @bug 8131051 8194486 8187218 * @summary KDC might issue a renewable ticket even if not requested * @library /test/lib * @compile -XDignore.symbol.file LongLife.java @@ -31,7 +31,12 @@ * @run main/othervm -Djdk.net.hosts.file=TestHosts LongLife */ +import org.ietf.jgss.GSSCredential; +import org.ietf.jgss.GSSManager; import sun.security.krb5.Config; +import javax.security.auth.Subject; +import javax.security.auth.kerberos.KerberosTicket; +import java.security.PrivilegedExceptionAction; public class LongLife { @@ -39,11 +44,53 @@ OneKDC kdc = new OneKDC(null).writeJAASConf(); - // A lifetime 2d will make it renewable + test(kdc, "10h", false, 36000, false); + test(kdc, "2d", false, KDC.DEFAULT_LIFETIME, true); + test(kdc, "2d", true, 2 * 24 * 3600, false); + + // 8187218: getRemainingLifetime() is negative if lifetime + // is longer than 30 days. + test(kdc, "30d", true, 30 * 24 * 3600, false); + } + + static void test( + KDC kdc, + String ticketLifetime, + boolean forceTill, // if true, KDC will not try RENEWABLE + int expectedLifeTime, + boolean expectedRenewable) throws Exception { + KDC.saveConfig(OneKDC.KRB5_CONF, kdc, - "ticket_lifetime = 2d"); + "ticket_lifetime = " + ticketLifetime); Config.refresh(); - Context.fromJAAS("client"); + if (forceTill) { + System.setProperty("test.kdc.force.till", ""); + } else { + System.clearProperty("test.kdc.force.till"); + } + + Context c = Context.fromJAAS("client"); + + GSSCredential cred = Subject.doAs(c.s(), + (PrivilegedExceptionAction) + ()-> { + GSSManager m = GSSManager.getInstance(); + return m.createCredential(GSSCredential.INITIATE_ONLY); + }); + + KerberosTicket tgt = c.s().getPrivateCredentials(KerberosTicket.class) + .iterator().next(); + System.out.println(tgt); + + int actualLifeTime = cred.getRemainingLifetime(); + if (actualLifeTime < expectedLifeTime - 60 + || actualLifeTime > expectedLifeTime + 60) { + throw new Exception("actualLifeTime is " + actualLifeTime); + } + + if (tgt.isRenewable() != expectedRenewable) { + throw new Exception("TGT's RENEWABLE flag is " + tgt.isRenewable()); + } } } diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/SSL.java openjdk-11-11~24/test/jdk/sun/security/krb5/auto/SSL.java --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/SSL.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/SSL.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,329 +0,0 @@ -/* - * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 6894643 6913636 8005523 8025123 8194486 - * @summary Test JSSE Kerberos ciphersuite - * @library /test/lib - * @run main jdk.test.lib.FileInstaller TestHosts TestHosts - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_WITH_RC4_128_SHA - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_WITH_RC4_128_SHA unbound - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_WITH_RC4_128_SHA unbound sni - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_WITH_3DES_EDE_CBC_SHA - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_WITH_3DES_EDE_CBC_MD5 - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_WITH_DES_CBC_SHA - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_WITH_DES_CBC_MD5 - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_EXPORT_WITH_RC4_40_SHA - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_EXPORT_WITH_RC4_40_MD5 - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSL - * TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5 - */ -import java.io.*; -import java.security.Permission; -import javax.net.ssl.*; -import java.security.Principal; -import java.security.Security; -import java.util.Date; -import java.util.List; -import java.util.ArrayList; -import java.util.Locale; -import javax.security.auth.kerberos.ServicePermission; -import sun.security.jgss.GSSUtil; -import sun.security.krb5.PrincipalName; -import sun.security.krb5.internal.ktab.KeyTab; - -public class SSL extends SecurityManager { - - private static String krb5Cipher; - private static final int LOOP_LIMIT = 3; - private static int loopCount = 0; - private static volatile String server; - private static volatile int port; - private static String sniHostname = null; - private static String sniMatcherPattern = null; - - private static String permChecks = ""; - - // 0-Not started, 1-Start OK, 2-Failure - private static volatile int serverState = 0; - - @Override - public void checkPermission(Permission perm, Object context) { - checkPermission(perm); - } - - public void checkPermission(Permission perm) { - if (!(perm instanceof ServicePermission)) { - return; - } - ServicePermission p = (ServicePermission)perm; - // ServicePermissions required to create GSSName are ignored - if (!p.getActions().isEmpty()) { - permChecks = permChecks - + p.getActions().toUpperCase(Locale.US).charAt(0); - } - } - - public static void main(String[] args) throws Exception { - // reset the security property to make sure that the algorithms - // and keys used in this test are not disabled. - Security.setProperty("jdk.tls.disabledAlgorithms", ""); - - krb5Cipher = args[0]; - - boolean unbound = args.length > 1; - - // Workaround for JDK-8161101, reference the class before - // SecurityManager is set. - System.out.println("Touching " + ServicePermission.class); - - System.setSecurityManager(new SSL()); - - KDC kdc = KDC.create(OneKDC.REALM); - server = "host." + OneKDC.REALM_LOWER_CASE; - - if (args.length > 2) { - sniHostname = "test." + server; - sniMatcherPattern = ".*"; - } - - kdc.addPrincipal(OneKDC.USER, OneKDC.PASS); - kdc.addPrincipalRandKey("krbtgt/" + OneKDC.REALM); - KDC.saveConfig(OneKDC.KRB5_CONF, kdc); - System.setProperty("java.security.krb5.conf", OneKDC.KRB5_CONF); - - // Add 3 versions of keys into keytab - KeyTab ktab = KeyTab.create(OneKDC.KTAB); - String serviceName = null; - if (sniHostname != null) { - serviceName = "host/" + sniHostname; - } else { - serviceName = "host/" + server; - } - PrincipalName service = new PrincipalName( - serviceName, PrincipalName.KRB_NT_SRV_HST); - ktab.addEntry(service, "pass1".toCharArray(), 1, true); - ktab.addEntry(service, "pass2".toCharArray(), 2, true); - ktab.addEntry(service, "pass3".toCharArray(), 3, true); - ktab.save(); - - // and use the middle one as the real key - kdc.addPrincipal(serviceName, "pass2".toCharArray()); - - - // JAAS config entry name ssl - System.setProperty("java.security.auth.login.config", OneKDC.JAAS_CONF); - File f = new File(OneKDC.JAAS_CONF); - FileOutputStream fos = new FileOutputStream(f); - fos.write(( - "ssl {\n" + - " com.sun.security.auth.module.Krb5LoginModule required\n" + - (unbound ? - " principal=*\n" : - " principal=\"" + serviceName + "\"\n") + - " useKeyTab=true\n" + - " keyTab=" + OneKDC.KTAB + "\n" + - " isInitiator=false\n" + - " storeKey=true;\n};\n" - ).getBytes()); - fos.close(); - - Context c; - final Context s = Context.fromJAAS("ssl"); - - s.startAsServer(GSSUtil.GSS_KRB5_MECH_OID); - - Thread server = new Thread(new Runnable() { - public void run() { - try { - s.doAs(new JsseServerAction(), null); - } catch (Exception e) { - e.printStackTrace(); - serverState = 2; - } - } - }); - server.setDaemon(true); - server.start(); - - while (serverState == 0) { - Thread.sleep(50); - } - - if (serverState == 2) { - throw new Exception("Server already failed"); - } - - c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); - c.startAsClient(serviceName, GSSUtil.GSS_KRB5_MECH_OID); - c.doAs(new JsseClientAction(), null); - - // Add another version of key, make sure it can be loaded - Thread.sleep(2000); - ktab = KeyTab.getInstance(OneKDC.KTAB); - ktab.addEntry(service, "pass4".toCharArray(), 4, true); - ktab.save(); - kdc.addPrincipal(serviceName, "pass4".toCharArray()); - - c = Context.fromUserPass(OneKDC.USER, OneKDC.PASS, false); - c.startAsClient(serviceName, GSSUtil.GSS_KRB5_MECH_OID); - c.doAs(new JsseClientAction(), null); - - // Permission checking check. Please note this is highly - // implementation related. - if (unbound) { - // For unbound, server does not know what name to check. - // Client checks "initiate", then server gets the name - // and checks "accept". Second connection resume. - if (!permChecks.equals("IA")) { - throw new Exception(permChecks); - } - } else { - // For bound, JAAS checks "accept" once. Server checks again, - // client then checks "initiate". Second connection resume. - if (!permChecks.equals("AAI")) { - throw new Exception(permChecks); - } - } - } - - // Following codes copied from - // http://java.sun.com/javase/6/docs/technotes/guides/security/jgss/lab/part2.html#JSSE - private static class JsseClientAction implements Action { - public byte[] run(Context s, byte[] input) throws Exception { - SSLSocketFactory sslsf = - (SSLSocketFactory) SSLSocketFactory.getDefault(); - System.out.println("Connecting " + server + ":" + port); - SSLSocket sslSocket = (SSLSocket) sslsf.createSocket(server, port); - - // Enable only a KRB5 cipher suite. - String enabledSuites[] = {krb5Cipher}; - sslSocket.setEnabledCipherSuites(enabledSuites); - // Should check for exception if enabledSuites is not supported - - if (sniHostname != null) { - List serverNames = new ArrayList<>(); - serverNames.add(new SNIHostName(sniHostname)); - SSLParameters params = sslSocket.getSSLParameters(); - params.setServerNames(serverNames); - sslSocket.setSSLParameters(params); - } - - BufferedReader in = new BufferedReader(new InputStreamReader( - sslSocket.getInputStream())); - BufferedWriter out = new BufferedWriter(new OutputStreamWriter( - sslSocket.getOutputStream())); - - String outStr = "Hello There!\n"; - out.write(outStr); - out.flush(); - System.out.print("Sending " + outStr); - - String inStr = in.readLine(); - System.out.println("Received " + inStr); - - String cipherSuiteChosen = sslSocket.getSession().getCipherSuite(); - System.out.println("Cipher suite in use: " + cipherSuiteChosen); - Principal self = sslSocket.getSession().getLocalPrincipal(); - System.out.println("I am: " + self.toString()); - Principal peer = sslSocket.getSession().getPeerPrincipal(); - System.out.println("Server is: " + peer.toString()); - - sslSocket.close(); - // This line should not be needed. It's the server's duty to - // forget the old key - //sslSocket.getSession().invalidate(); - return null; - } - } - - private static class JsseServerAction implements Action { - public byte[] run(Context s, byte[] input) throws Exception { - SSLServerSocketFactory sslssf = - (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); - SSLServerSocket sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(0); // any port - port = sslServerSocket.getLocalPort(); - System.out.println("Listening on " + port); - serverState = 1; - - // Enable only a KRB5 cipher suite. - String enabledSuites[] = {krb5Cipher}; - sslServerSocket.setEnabledCipherSuites(enabledSuites); - // Should check for exception if enabledSuites is not supported - - if (sniMatcherPattern != null) { - List matchers = new ArrayList<>(); - matchers.add(SNIHostName.createSNIMatcher(sniMatcherPattern)); - SSLParameters params = sslServerSocket.getSSLParameters(); - params.setSNIMatchers(matchers); - sslServerSocket.setSSLParameters(params); - } - - while (loopCount++ < LOOP_LIMIT) { - System.out.println("Waiting for incoming connection..."); - - SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); - - System.out.println("Got connection from client " - + sslSocket.getInetAddress()); - - BufferedReader in = new BufferedReader(new InputStreamReader( - sslSocket.getInputStream())); - BufferedWriter out = new BufferedWriter(new OutputStreamWriter( - sslSocket.getOutputStream())); - - String inStr = in.readLine(); - System.out.println("Received " + inStr); - - String outStr = inStr + " " + new Date().toString() + "\n"; - out.write(outStr); - System.out.println("Sending " + outStr); - out.flush(); - - String cipherSuiteChosen = - sslSocket.getSession().getCipherSuite(); - System.out.println("Cipher suite in use: " + cipherSuiteChosen); - Principal self = sslSocket.getSession().getLocalPrincipal(); - System.out.println("I am: " + self.toString()); - Principal peer = sslSocket.getSession().getPeerPrincipal(); - System.out.println("Client is: " + peer.toString()); - - sslSocket.close(); - } - return null; - } - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/SSLwithPerms.java openjdk-11-11~24/test/jdk/sun/security/krb5/auto/SSLwithPerms.java --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/SSLwithPerms.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/SSLwithPerms.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8038089 8194486 - * @summary TLS optional support for Kerberos cipher suites needs to be re-examined - * @library ../../../../java/security/testlibrary/ /test/lib - * @run main jdk.test.lib.FileInstaller TestHosts TestHosts - * @run main/othervm -Djdk.net.hosts.file=TestHosts SSLwithPerms - */ -import java.io.*; -import javax.net.ssl.*; -import javax.security.auth.AuthPermission; -import javax.security.auth.kerberos.ServicePermission; -import java.net.SocketPermission; -import java.nio.ByteBuffer; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.security.Principal; -import java.security.Security; -import java.security.SecurityPermission; -import java.util.Collections; -import java.util.Date; -import java.util.List; -import java.util.ArrayList; -import java.util.Locale; -import java.util.PropertyPermission; - -import sun.security.jgss.GSSUtil; - -public class SSLwithPerms { - - static String KRB5_CONF = "krb5.conf"; - static String JAAS_CONF = "jaas.conf"; - static String REALM = "REALM"; - static String KTAB = "ktab"; - static String HOST = "host." + REALM.toLowerCase(Locale.US); - static String SERVER = "host/" + HOST; - static String USER = "user"; - static char[] PASS = "password".toCharArray(); - - public static void main(String[] args) throws Exception { - - Security.setProperty("jdk.tls.disabledAlgorithms", ""); - if (args.length == 0) { - KDC kdc = KDC.create(REALM, HOST, 0, true); - - kdc.addPrincipal(USER, PASS); - kdc.addPrincipalRandKey("krbtgt/" + REALM); - kdc.addPrincipalRandKey(SERVER); - KDC.saveConfig(KRB5_CONF, kdc); - kdc.writeKtab(KTAB); - - File f = new File(JAAS_CONF); - FileOutputStream fos = new FileOutputStream(f); - fos.write(( - "ssl {\n" + - " com.sun.security.auth.module.Krb5LoginModule required\n" + - " principal=\"" + SERVER + "\"\n" + - " useKeyTab=true\n" + - " keyTab=" + KTAB + "\n" + - " isInitiator=false\n" + - " storeKey=true;\n};\n" - ).getBytes()); - fos.close(); - - String hostsFileName = System.getProperty("test.src", ".") + "/TestHosts"; - - Proc pc = Proc.create("SSLwithPerms") - .args("client") - .inheritIO() - .prop("java.security.manager", "") - .prop("java.security.krb5.conf", KRB5_CONF) - .prop("jdk.net.hosts.file", hostsFileName) - .prop("javax.net.ssl", "handshake") - .prop("sun.security.krb5.debug", "true") - .perm(new SecurityPermission("setProperty.jdk.tls.disabledAlgorithms")) - .perm(new java.util.PropertyPermission("user.name", "read")) - .perm(new PropertyPermission("sun.security.krb5.principal", "read")) - .perm(new FilePermission("port", "read")) - .perm(new FilePermission(hostsFileName, "read")) - .perm(new FilePermission(KTAB, "read")) - .perm(new AuthPermission("modifyPrincipals")) - .perm(new AuthPermission("modifyPrivateCredentials")) - .perm(new AuthPermission("doAs")) - .perm(new SocketPermission("127.0.0.1", "connect")) - .perm(new ServicePermission("host/host.realm@REALM", "initiate")) - .start(); - - Proc ps = Proc.create("SSLwithPerms") - .args("server") - .inheritIO() - .prop("java.security.manager", "") - .prop("java.security.krb5.conf", KRB5_CONF) - .prop("java.security.auth.login.config", JAAS_CONF) - .prop("jdk.net.hosts.file", hostsFileName) - .prop("javax.net.ssl", "handshake") - .prop("sun.security.krb5.debug", "true") - .perm(new SecurityPermission("setProperty.jdk.tls.disabledAlgorithms")) - .perm(new AuthPermission("createLoginContext.ssl")) - .perm(new AuthPermission("doAs")) - .perm(new FilePermission(hostsFileName, "read")) - .perm(new FilePermission("port", "write")) - .perm(new SocketPermission("127.0.0.1", "accept")) - .perm(new ServicePermission("host/host.realm@REALM", "accept")) - .start(); - - if (pc.waitFor() != 0) { - throw new Exception(); - } - if (ps.waitFor() != 0) { - throw new Exception(); - } - } else if (args[0].equals("client")) { - Context c; - c = Context.fromUserPass(USER, PASS, false); - c.doAs(new JsseClientAction(), null); - } else if (args[0].equals("server")) { - final Context s = Context.fromJAAS("ssl"); - s.doAs(new JsseServerAction(), null); - } - } - - private static class JsseClientAction implements Action { - public byte[] run(Context s, byte[] input) throws Exception { - SSLSocketFactory sslsf = - (SSLSocketFactory) SSLSocketFactory.getDefault(); - while (!Files.exists(Paths.get("port"))) { - Thread.sleep(100); - } - int port = ByteBuffer.allocate(4) - .put(Files.readAllBytes(Paths.get("port"))).getInt(0); - System.out.println("Connecting " + SERVER + ":" + port); - SSLSocket sslSocket = (SSLSocket) sslsf.createSocket(HOST, port); - - // Enable only a KRB5 cipher suite. - String enabledSuites[] = {"TLS_KRB5_WITH_RC4_128_SHA"}; - sslSocket.setEnabledCipherSuites(enabledSuites); - - SSLParameters params = sslSocket.getSSLParameters(); - params.setServerNames(Collections.singletonList(new SNIHostName(HOST))); - sslSocket.setSSLParameters(params); - - BufferedReader in = new BufferedReader(new InputStreamReader( - sslSocket.getInputStream())); - BufferedWriter out = new BufferedWriter(new OutputStreamWriter( - sslSocket.getOutputStream())); - - String outStr = "Hello There!\n"; - out.write(outStr); - out.flush(); - System.out.print("Sending " + outStr); - - String inStr = in.readLine(); - System.out.println("Received " + inStr); - - String cipherSuiteChosen = sslSocket.getSession().getCipherSuite(); - System.out.println("Cipher suite in use: " + cipherSuiteChosen); - Principal self = sslSocket.getSession().getLocalPrincipal(); - System.out.println("I am: " + self.toString()); - Principal peer = sslSocket.getSession().getPeerPrincipal(); - System.out.println("Server is: " + peer.toString()); - - sslSocket.close(); - return null; - } - } - - private static class JsseServerAction implements Action { - public byte[] run(Context s, byte[] input) throws Exception { - SSLServerSocketFactory sslssf = - (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); - SSLServerSocket sslServerSocket = - (SSLServerSocket) sslssf.createServerSocket(0); // any port - int port = sslServerSocket.getLocalPort(); - System.out.println("Listening on " + port); - - String enabledSuites[] = {"TLS_KRB5_WITH_RC4_128_SHA"}; - sslServerSocket.setEnabledCipherSuites(enabledSuites); - - Files.write(Paths.get("port"), ByteBuffer.allocate(4).putInt(port).array()); - System.out.println("Waiting for incoming connection..."); - - SSLSocket sslSocket = (SSLSocket) sslServerSocket.accept(); - - System.out.println("Got connection from client " - + sslSocket.getInetAddress()); - - BufferedReader in = new BufferedReader(new InputStreamReader( - sslSocket.getInputStream())); - BufferedWriter out = new BufferedWriter(new OutputStreamWriter( - sslSocket.getOutputStream())); - - String inStr = in.readLine(); - System.out.println("Received " + inStr); - - String outStr = inStr + " " + new Date().toString() + "\n"; - out.write(outStr); - System.out.println("Sending " + outStr); - out.flush(); - - String cipherSuiteChosen = - sslSocket.getSession().getCipherSuite(); - System.out.println("Cipher suite in use: " + cipherSuiteChosen); - Principal self = sslSocket.getSession().getLocalPrincipal(); - System.out.println("I am: " + self.toString()); - Principal peer = sslSocket.getSession().getPeerPrincipal(); - System.out.println("Client is: " + peer.toString()); - - sslSocket.close(); - return null; - } - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/unbound.ssl.jaas.conf openjdk-11-11~24/test/jdk/sun/security/krb5/auto/unbound.ssl.jaas.conf --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/unbound.ssl.jaas.conf 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/unbound.ssl.jaas.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -com.sun.net.ssl.client { - com.sun.security.auth.module.Krb5LoginModule required - principal="USER@TEST.REALM" - doNotPrompt=true - useKeyTab=true - keyTab="krb5.keytab.data"; -}; - -server_star { - com.sun.security.auth.module.Krb5LoginModule required - principal="*" - isInitiator=false - useKeyTab=true - keyTab="krb5.keytab.data" - storeKey=true; -}; - -server_multiple_principals { - com.sun.security.auth.module.Krb5LoginModule required - principal="host/service1.localhost@TEST.REALM" - isInitiator=false - useKeyTab=true - keyTab="krb5.keytab.data" - storeKey=true; - - com.sun.security.auth.module.Krb5LoginModule required - principal="host/service2.localhost@TEST.REALM" - isInitiator=false - useKeyTab=true - keyTab="krb5.keytab.data" - storeKey=true; - - com.sun.security.auth.module.Krb5LoginModule required - principal="host/service3.localhost@TEST.REALM" - isInitiator=false - useKeyTab=true - keyTab="krb5.keytab.data" - storeKey=true; -}; - diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/UnboundSSL.java openjdk-11-11~24/test/jdk/sun/security/krb5/auto/UnboundSSL.java --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/UnboundSSL.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/UnboundSSL.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,138 +0,0 @@ -/* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivilegedActionException; -import java.util.HashMap; -import java.util.Map; - -import javax.security.auth.login.LoginException; - -/* - * @test - * @bug 8025123 8194486 - * @summary Checks if an unbound server can handle connections - * only for allowed service principals - * @library /test/lib - * @run main jdk.test.lib.FileInstaller TestHosts TestHosts - * @run main/othervm/policy=unbound.ssl.policy -Djdk.net.hosts.file=TestHosts - * UnboundSSL unbound.ssl.jaas.conf server_star - * @run main/othervm/policy=unbound.ssl.policy -Djdk.net.hosts.file=TestHosts - * UnboundSSL unbound.ssl.jaas.conf server_multiple_principals - */ -public class UnboundSSL { - - public static void main(String[] args) throws IOException, - NoSuchAlgorithmException,LoginException, PrivilegedActionException, - InterruptedException { - UnboundSSL test = new UnboundSSL(); - test.start(args[0], args[1]); - } - - private void start(String jaacConfigFile, String serverJaasConfig) - throws IOException, NoSuchAlgorithmException,LoginException, - PrivilegedActionException, InterruptedException { - - // define principals - String service1host = "service1." + UnboundSSLUtils.HOST; - String service2host = "service2." + UnboundSSLUtils.HOST; - String service3host = "service3." + UnboundSSLUtils.HOST; - String service1Principal = "host/" + service1host + "@" - + UnboundSSLUtils.REALM; - String service2Principal = "host/" + service2host + "@" - + UnboundSSLUtils.REALM; - String service3Principal = "host/" + service3host + "@" - + UnboundSSLUtils.REALM; - - Map principals = new HashMap<>(); - principals.put(UnboundSSLUtils.USER_PRINCIPAL, - UnboundSSLUtils.USER_PASSWORD); - principals.put(UnboundSSLUtils.KRBTGT_PRINCIPAL, null); - principals.put(service1Principal, null); - principals.put(service2Principal, null); - principals.put(service3Principal, null); - - System.setProperty("java.security.krb5.conf", - UnboundSSLUtils.KRB5_CONF_FILENAME); - - // start a local KDC instance - KDC.startKDC(UnboundSSLUtils.HOST, UnboundSSLUtils.KRB5_CONF_FILENAME, - UnboundSSLUtils.REALM, principals, - UnboundSSLUtils.KTAB_FILENAME, KDC.KtabMode.APPEND); - - System.setProperty("java.security.auth.login.config", - UnboundSSLUtils.TEST_SRC + UnboundSSLUtils.FS + jaacConfigFile); - System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); - - try (final SSLEchoServer server = SSLEchoServer.init( - UnboundSSLUtils.TLS_KRB5_FILTER, UnboundSSLUtils.SNI_PATTERN)) { - - // start a server instance - UnboundSSLUtils.startServerWithJaas(server, serverJaasConfig); - - // wait for the server is ready - while (!server.isReady()) { - Thread.sleep(UnboundSSLUtils.DELAY); - } - - int port = server.getPort(); - - // run clients - - // the server should have a permission to handle a request - // with this service principal (there should be an appropriate - // javax.security.auth.kerberos.ServicePermission in policy file) - System.out.println("Connect: SNI hostname = " + service1host - + ", successful connection is expected"); - SSLClient.init(UnboundSSLUtils.HOST, port, - UnboundSSLUtils.TLS_KRB5_FILTER, service1host).connect(); - - // the server should NOT have a permission to handle a request - // with this service principal (there should be an appropriate - // javax.security.auth.kerberos.ServicePermission in policy file) - // handshake failures is expected - System.out.println("Connect: SNI hostname = " + service2host - + ", connection failure is expected"); - try { - SSLClient.init(UnboundSSLUtils.HOST, port, - UnboundSSLUtils.TLS_KRB5_FILTER, service2host) - .connect(); - throw new RuntimeException("Test failed: " - + "expected IOException not thrown"); - } catch (IOException e) { - System.out.println("Expected exception: " + e); - } - - // the server should have a permission to handle a request - // with this service principal (there should be an appropriate - // javax.security.auth.kerberos.ServicePermission in policy file) - System.out.println("Connect: SNI hostname = " + service3host - + ", successful connection is expected"); - SSLClient.init(UnboundSSLUtils.HOST, port, - UnboundSSLUtils.TLS_KRB5_FILTER, service3host).connect(); - } - - System.out.println("Test passed"); - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/UnboundSSLMultipleKeys.java openjdk-11-11~24/test/jdk/sun/security/krb5/auto/UnboundSSLMultipleKeys.java --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/UnboundSSLMultipleKeys.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/UnboundSSLMultipleKeys.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivilegedActionException; -import java.util.HashMap; -import java.util.Map; - -import javax.security.auth.login.LoginException; - -/* - * @test - * @bug 8025123 8194486 - * @summary Checks if an unbound server pick up a correct key from keytab - * @library /test/lib - * @run main jdk.test.lib.FileInstaller TestHosts TestHosts - * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLMultipleKeys - * unbound.ssl.jaas.conf server_star - * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLMultipleKeys - * unbound.ssl.jaas.conf server_multiple_principals - */ -public class UnboundSSLMultipleKeys { - - public static void main(String[] args) - throws IOException, NoSuchAlgorithmException, LoginException, - PrivilegedActionException, InterruptedException { - UnboundSSLMultipleKeys test = new UnboundSSLMultipleKeys(); - test.start(args[0], args[1]); - } - - private void start(String jaacConfigFile, String serverJaasConfig) - throws IOException, NoSuchAlgorithmException, LoginException, - PrivilegedActionException, InterruptedException { - - // define service principals - String service1host = "service1." + UnboundSSLUtils.HOST; - String service2host = "service2." + UnboundSSLUtils.HOST; - String service3host = "service3." + UnboundSSLUtils.HOST; - String service1Principal = "host/" + service1host + "@" - + UnboundSSLUtils.REALM; - String service2Principal = "host/" + service2host + "@" - + UnboundSSLUtils.REALM; - String service3Principal = "host/" + service3host + "@" - + UnboundSSLUtils.REALM; - - Map principals = new HashMap<>(); - principals.put(UnboundSSLUtils.USER_PRINCIPAL, - UnboundSSLUtils.USER_PASSWORD); - principals.put(UnboundSSLUtils.KRBTGT_PRINCIPAL, "pass"); - principals.put(service1Principal, "pass0"); - principals.put(service1Principal, "pass1"); - principals.put(service1Principal, "pass2"); - principals.put(service2Principal, "pass"); - principals.put(service3Principal, "pass"); - - System.setProperty("java.security.krb5.conf", - UnboundSSLUtils.KRB5_CONF_FILENAME); - - /* - * Start a local KDC instance - * - * Keytab file contains 3 keys (with different KVNO) for service1 - * principal, but password for only one key is the same with the record - * for service1 principal in KDC. - */ - KDC.startKDC(UnboundSSLUtils.HOST, UnboundSSLUtils.KRB5_CONF_FILENAME, - UnboundSSLUtils.REALM, principals, - UnboundSSLUtils.KTAB_FILENAME, KDC.KtabMode.APPEND); - - System.setProperty("java.security.auth.login.config", - UnboundSSLUtils.TEST_SRC + UnboundSSLUtils.FS + jaacConfigFile); - System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); - - // start an SSL server instance - try (SSLEchoServer server = SSLEchoServer.init( - UnboundSSLUtils.TLS_KRB5_FILTER, UnboundSSLUtils.SNI_PATTERN)) { - - UnboundSSLUtils.startServerWithJaas(server, serverJaasConfig); - - // wait for the server is ready - while (!server.isReady()) { - Thread.sleep(UnboundSSLUtils.DELAY); - } - - // run a client - System.out.println("Successful connection is expected"); - SSLClient.init(UnboundSSLUtils.HOST, server.getPort(), - UnboundSSLUtils.TLS_KRB5_FILTER, service1host).connect(); - } - - System.out.println("Test passed"); - } - -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/unbound.ssl.policy openjdk-11-11~24/test/jdk/sun/security/krb5/auto/unbound.ssl.policy --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/unbound.ssl.policy 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/unbound.ssl.policy 1970-01-01 00:00:00.000000000 +0000 @@ -1,27 +0,0 @@ -grant { - permission java.util.PropertyPermission "*", "read,write"; - permission java.net.SocketPermission "*:*", "listen,resolve,accept,connect"; - permission java.io.FilePermission "/-", "read"; - permission java.io.FilePermission "*", "read,write,delete"; - permission java.lang.RuntimePermission "accessDeclaredMembers"; - permission java.lang.reflect.ReflectPermission "suppressAccessChecks"; - permission java.lang.RuntimePermission "accessClassInPackage.*"; - permission javax.security.auth.AuthPermission "doAs"; - permission javax.security.auth.AuthPermission "getSubject"; - permission javax.security.auth.AuthPermission - "createLoginContext.server_star"; - permission javax.security.auth.AuthPermission - "createLoginContext.server_multiple_principals"; - permission javax.security.auth.AuthPermission "modifyPrincipals"; - permission javax.security.auth.PrivateCredentialPermission "javax.security.auth.kerberos.KeyTab java.security.Principal \"krb5.keytab.data\"", "read"; - - // clients have a permission to use all service principals - permission javax.security.auth.kerberos.ServicePermission "*", "initiate"; - - // server has a service permission - // to accept only service1 and service3 principals - permission javax.security.auth.kerberos.ServicePermission - "host/service1.localhost@TEST.REALM", "accept"; - permission javax.security.auth.kerberos.ServicePermission - "host/service3.localhost@TEST.REALM", "accept"; -}; diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/UnboundSSLPrincipalProperty.java openjdk-11-11~24/test/jdk/sun/security/krb5/auto/UnboundSSLPrincipalProperty.java --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/UnboundSSLPrincipalProperty.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/UnboundSSLPrincipalProperty.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivilegedActionException; -import java.util.HashMap; -import java.util.Map; -import javax.security.auth.login.LoginException; - -/* - * @test - * @bug 8025123 8194486 - * @summary Checks if an unbound server uses a service principal - * from sun.security.krb5.principal system property if specified - * @library /test/lib - * @run main jdk.test.lib.FileInstaller TestHosts TestHosts - * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLPrincipalProperty - * unbound.ssl.jaas.conf server_star - * @run main/othervm -Djdk.net.hosts.file=TestHosts UnboundSSLPrincipalProperty - * unbound.ssl.jaas.conf server_multiple_principals - */ -public class UnboundSSLPrincipalProperty { - - public static void main(String[] args) throws IOException, - NoSuchAlgorithmException,LoginException, PrivilegedActionException, - InterruptedException { - UnboundSSLPrincipalProperty test = new UnboundSSLPrincipalProperty(); - test.start(args[0], args[1]); - } - - public void start(String jaacConfigFile, String serverJaasConfig) - throws IOException, NoSuchAlgorithmException,LoginException, - PrivilegedActionException, InterruptedException { - - // define principals - String service1host = "service1." + UnboundSSLUtils.HOST; - String service3host = "service3." + UnboundSSLUtils.HOST; - String service1Principal = "host/" + service1host + "@" - + UnboundSSLUtils.REALM; - String service3Principal = "host/" + service3host - + "@" + UnboundSSLUtils.REALM; - - Map principals = new HashMap<>(); - principals.put(UnboundSSLUtils.USER_PRINCIPAL, - UnboundSSLUtils.USER_PASSWORD); - principals.put(UnboundSSLUtils.KRBTGT_PRINCIPAL, null); - principals.put(service1Principal, null); - principals.put(service3Principal, null); - - System.setProperty("java.security.krb5.conf", - UnboundSSLUtils.KRB5_CONF_FILENAME); - - // start a local KDC instance - KDC.startKDC(UnboundSSLUtils.HOST, UnboundSSLUtils.KRB5_CONF_FILENAME, - UnboundSSLUtils.REALM, principals, - UnboundSSLUtils.KTAB_FILENAME, KDC.KtabMode.APPEND); - - System.setProperty("java.security.auth.login.config", - UnboundSSLUtils.TEST_SRC + UnboundSSLUtils.FS + jaacConfigFile); - System.setProperty("javax.security.auth.useSubjectCredsOnly", "false"); - - // start an SSL server instance - try (final SSLEchoServer server = SSLEchoServer.init( - UnboundSSLUtils.TLS_KRB5_FILTER, UnboundSSLUtils.SNI_PATTERN)) { - - // specify a service principal for the server - System.setProperty("sun.security.krb5.principal", - service3Principal); - - UnboundSSLUtils.startServerWithJaas(server, serverJaasConfig); - - // wait for the server is ready - while (!server.isReady()) { - Thread.sleep(UnboundSSLUtils.DELAY); - } - - int port = server.getPort(); - - // connetion failure is expected - // since service3 principal was specified to use by the server - System.out.println("Connect: SNI hostname = " + service1host - + ", connection failure is expected"); - try { - SSLClient.init(UnboundSSLUtils.HOST, port, - UnboundSSLUtils.TLS_KRB5_FILTER, service1host) - .connect(); - throw new RuntimeException("Test failed: " - + "expected IOException not thrown"); - } catch (IOException e) { - System.out.println("Expected exception: " + e); - } - - System.out.println("Connect: SNI hostname = " + service3host - + ", successful connection is expected"); - SSLClient.init(UnboundSSLUtils.HOST, port, - UnboundSSLUtils.TLS_KRB5_FILTER, service3host).connect(); - } - - System.out.println("Test passed"); - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/krb5/auto/UnboundSSLUtils.java openjdk-11-11~24/test/jdk/sun/security/krb5/auto/UnboundSSLUtils.java --- openjdk-11-11~19/test/jdk/sun/security/krb5/auto/UnboundSSLUtils.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/krb5/auto/UnboundSSLUtils.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,292 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -import java.io.BufferedInputStream; -import java.io.BufferedOutputStream; -import java.io.File; -import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.security.PrivilegedActionException; -import java.security.PrivilegedExceptionAction; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.Map; -import javax.net.ssl.SNIHostName; -import javax.net.ssl.SNIMatcher; -import javax.net.ssl.SNIServerName; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLParameters; -import javax.net.ssl.SSLServerSocket; -import javax.net.ssl.SSLServerSocketFactory; -import javax.net.ssl.SSLSocket; -import javax.net.ssl.SSLSocketFactory; -import javax.security.auth.Subject; -import javax.security.auth.login.LoginContext; -import javax.security.auth.login.LoginException; - -/* - * Helper class for unbound krb5 tests. - */ -class UnboundSSLUtils { - - static final String KTAB_FILENAME = "krb5.keytab.data"; - static final String HOST = "localhost"; - static final String REALM = "TEST.REALM"; - static final String KRBTGT_PRINCIPAL = "krbtgt/" + REALM; - static final String TEST_SRC = System.getProperty("test.src", "."); - static final String TLS_KRB5_FILTER = "TLS_KRB5"; - static final String USER = "USER"; - static final String USER_PASSWORD = "password"; - static final String FS = System.getProperty("file.separator"); - static final String SNI_PATTERN = ".*"; - static final String USER_PRINCIPAL = USER + "@" + REALM; - static final String KRB5_CONF_FILENAME = "krb5.conf"; - static final int DELAY = 1000; - - static String[] filterStringArray(String[] src, String filter) { - return Arrays.stream(src).filter((item) -> item.startsWith(filter)) - .toArray(size -> new String[size]); - } - - /* - * The method does JAAS login, - * and runs an SSL server in the JAAS context. - */ - static void startServerWithJaas(final SSLEchoServer server, - String config) throws LoginException, PrivilegedActionException { - LoginContext context = new LoginContext(config); - context.login(); - System.out.println("Server: successful authentication"); - Subject.doAs(context.getSubject(), - (PrivilegedExceptionAction) () -> { - SSLEchoServer.startServer(server); - return null; - }); - } - -} - -class SSLClient { - - private final static byte[][] arrays = { - new byte[] {-1, 0, 2}, - new byte[] {} - }; - - private final SSLSocket socket; - - private SSLClient(SSLSocket socket) { - this.socket = socket; - } - - void connect() throws IOException { - System.out.println("Client: connect to server"); - try (BufferedInputStream bis = new BufferedInputStream( - socket.getInputStream()); - BufferedOutputStream bos = new BufferedOutputStream( - socket.getOutputStream())) { - - for (byte[] bytes : arrays) { - System.out.println("Client: send byte array: " - + Arrays.toString(bytes)); - - bos.write(bytes); - bos.flush(); - - byte[] recieved = new byte[bytes.length]; - int read = bis.read(recieved, 0, bytes.length); - if (read < 0) { - throw new IOException("Client: couldn't read a response"); - } - - System.out.println("Client: recieved byte array: " - + Arrays.toString(recieved)); - - if (!Arrays.equals(bytes, recieved)) { - throw new IOException("Client: sent byte array " - + "is not equal with recieved byte array"); - } - } - socket.getSession().invalidate(); - } finally { - if (!socket.isClosed()) { - socket.close(); - } - } - } - - static SSLClient init(String host, int port, String cipherSuiteFilter, - String sniHostName) throws NoSuchAlgorithmException, IOException { - SSLContext sslContext = SSLContext.getDefault(); - SSLSocketFactory ssf = (SSLSocketFactory) sslContext.getSocketFactory(); - SSLSocket socket = (SSLSocket) ssf.createSocket(host, port); - SSLParameters params = new SSLParameters(); - - if (cipherSuiteFilter != null) { - String[] cipherSuites = UnboundSSLUtils.filterStringArray( - ssf.getSupportedCipherSuites(), cipherSuiteFilter); - System.out.println("Client: enabled cipher suites: " - + Arrays.toString(cipherSuites)); - params.setCipherSuites(cipherSuites); - } - - if (sniHostName != null) { - System.out.println("Client: set SNI hostname: " + sniHostName); - SNIHostName serverName = new SNIHostName(sniHostName); - List serverNames = new ArrayList<>(); - serverNames.add(serverName); - params.setServerNames(serverNames); - } - - socket.setSSLParameters(params); - - return new SSLClient(socket); - } - -} - -class SSLEchoServer implements Runnable, AutoCloseable { - - private final SSLServerSocket ssocket; - private volatile boolean stopped = false; - private volatile boolean ready = false; - - /* - * Starts the server in a separate thread. - */ - static void startServer(SSLEchoServer server) { - Thread serverThread = new Thread(server, "SSL echo server thread"); - serverThread.setDaemon(true); - serverThread.start(); - } - - private SSLEchoServer(SSLServerSocket ssocket) { - this.ssocket = ssocket; - } - - /* - * Main server loop. - */ - @Override - public void run() { - System.out.println("Server: started"); - while (!stopped) { - ready = true; - try (SSLSocket socket = (SSLSocket) ssocket.accept()) { - System.out.println("Server: client connection accepted"); - try ( - BufferedInputStream bis = new BufferedInputStream( - socket.getInputStream()); - BufferedOutputStream bos = new BufferedOutputStream( - socket.getOutputStream()) - ) { - byte[] buffer = new byte[1024]; - int read; - while ((read = bis.read(buffer)) > 0) { - bos.write(buffer, 0, read); - System.out.println("Server: recieved " + read - + " bytes: " - + Arrays.toString(Arrays.copyOf(buffer, read))); - bos.flush(); - } - } - } catch (IOException e) { - if (stopped) { - // stopped == true means that stop() method was called, - // so just ignore the exception, and finish the loop - break; - } - System.out.println("Server: couldn't accept client connection: " - + e); - } - } - System.out.println("Server: finished"); - } - - boolean isReady() { - return ready; - } - - void stop() { - stopped = true; - ready = false; - - // close the server socket to interupt accept() method - try { - if (!ssocket.isClosed()) { - ssocket.close(); - } - } catch (IOException e) { - throw new RuntimeException("Unexpected exception: " + e); - } - } - - @Override - public void close() { - stop(); - } - - int getPort() { - return ssocket.getLocalPort(); - } - - /* - * Creates server instance. - * - * @param cipherSuiteFilter Filter for enabled cipher suites - * @param sniMatcherPattern Pattern for SNI server hame - */ - static SSLEchoServer init(String cipherSuiteFilter, - String sniPattern) throws NoSuchAlgorithmException, IOException { - SSLContext context = SSLContext.getDefault(); - SSLServerSocketFactory ssf = - (SSLServerSocketFactory) context.getServerSocketFactory(); - SSLServerSocket ssocket = - (SSLServerSocket) ssf.createServerSocket(0); - - // specify enabled cipher suites - if (cipherSuiteFilter != null) { - String[] ciphersuites = UnboundSSLUtils.filterStringArray( - ssf.getSupportedCipherSuites(), cipherSuiteFilter); - System.out.println("Server: enabled cipher suites: " - + Arrays.toString(ciphersuites)); - ssocket.setEnabledCipherSuites(ciphersuites); - } - - // specify SNI matcher pattern - if (sniPattern != null) { - System.out.println("Server: set SNI matcher: " + sniPattern); - SNIMatcher matcher = SNIHostName.createSNIMatcher(sniPattern); - List matchers = new ArrayList<>(); - matchers.add(matcher); - SSLParameters params = ssocket.getSSLParameters(); - params.setSNIMatchers(matchers); - ssocket.setSSLParameters(params); - } - - return new SSLEchoServer(ssocket); - } - -} - diff -Nru openjdk-11-11~19/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java openjdk-11-11~24/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java --- openjdk-11-11~19/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/mscapi/InteropWithSunRsaSign.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + + +/** + * @test + * @bug 8205445 + * @summary Interop test between SunMSCAPI and SunRsaSign on RSASSA-PSS + * @requires os.family == "windows" + */ + +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.PrivateKey; +import java.security.PublicKey; +import java.security.SecureRandom; +import java.security.Signature; +import java.security.spec.MGF1ParameterSpec; +import java.security.spec.PSSParameterSpec; +import java.util.Random; + +public class InteropWithSunRsaSign { + + private static final SecureRandom NOT_SECURE_RANDOM = new SecureRandom() { + Random r = new Random(); + @Override + public void nextBytes(byte[] bytes) { + r.nextBytes(bytes); + } + }; + + private static boolean allResult = true; + private static byte[] msg = "hello".getBytes(); + + public static void main(String[] args) throws Exception { + + matrix(new PSSParameterSpec( + "SHA-1", + "MGF1", + MGF1ParameterSpec.SHA1, + 20, + PSSParameterSpec.TRAILER_FIELD_BC)); + + matrix(new PSSParameterSpec( + "SHA-256", + "MGF1", + MGF1ParameterSpec.SHA256, + 32, + PSSParameterSpec.TRAILER_FIELD_BC)); + + matrix(new PSSParameterSpec( + "SHA-384", + "MGF1", + MGF1ParameterSpec.SHA384, + 48, + PSSParameterSpec.TRAILER_FIELD_BC)); + + matrix(new PSSParameterSpec( + "SHA-512", + "MGF1", + MGF1ParameterSpec.SHA512, + 64, + PSSParameterSpec.TRAILER_FIELD_BC)); + + // non-typical salt length + matrix(new PSSParameterSpec( + "SHA-1", + "MGF1", + MGF1ParameterSpec.SHA1, + 17, + PSSParameterSpec.TRAILER_FIELD_BC)); + + if (!allResult) { + throw new Exception("Failed"); + } + } + + static void matrix(PSSParameterSpec pss) throws Exception { + + System.out.printf("\n%10s%20s%20s%20s %s\n", pss.getDigestAlgorithm(), + "KeyPairGenerator", "signer", "verifier", "result"); + System.out.printf("%10s%20s%20s%20s %s\n", + "-------", "----------------", "------", "--------", "------"); + + // KeyPairGenerator chooses SPI when getInstance() is called. + String[] provsForKPG = {"SunRsaSign", "SunMSCAPI"}; + + // "-" means no preferred provider. In this case, SPI is chosen + // when initSign/initVerify is called. Worth testing. + String[] provsForSignature = {"SunRsaSign", "SunMSCAPI", "-"}; + + int pos = 0; + for (String pg : provsForKPG) { + for (String ps : provsForSignature) { + for (String pv : provsForSignature) { + System.out.printf("%10d%20s%20s%20s ", ++pos, pg, ps, pv); + try { + boolean result = test(pg, ps, pv, pss); + System.out.println(result); + if (!result) { + allResult = false; + } + } catch (Exception e) { + if (pg.equals("-") || pg.equals(ps)) { + // When Signature provider is automatically + // chosen or the same with KeyPairGenerator, + // this is an error. + allResult = false; + System.out.println("X " + e.getMessage()); + } else { + // Known restriction: SunRsaSign and SunMSCAPI can't + // use each other's private key for signing. + System.out.println(e.getMessage()); + } + } + } + } + } + } + + static boolean test(String pg, String ps, String pv, PSSParameterSpec pss) + throws Exception { + + KeyPairGenerator kpg = pg.length() == 1 + ? KeyPairGenerator.getInstance("RSA") + :KeyPairGenerator.getInstance("RSA", pg); + kpg.initialize( + pss.getDigestAlgorithm().equals("SHA-512") ? 2048: 1024, + NOT_SECURE_RANDOM); + KeyPair kp = kpg.generateKeyPair(); + PrivateKey pr = kp.getPrivate(); + PublicKey pu = kp.getPublic(); + + Signature s = ps.length() == 1 + ? Signature.getInstance("RSASSA-PSS") + : Signature.getInstance("RSASSA-PSS", ps); + s.initSign(pr); + s.setParameter(pss); + s.update(msg); + byte[] sig = s.sign(); + + Signature s2 = pv.length() == 1 + ? Signature.getInstance("RSASSA-PSS") + : Signature.getInstance("RSASSA-PSS", pv); + s2.initVerify(pu); + s2.setParameter(pss); + s2.update(msg); + + return s2.verify(sig); + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/ec/TestECDH.java openjdk-11-11~24/test/jdk/sun/security/pkcs11/ec/TestECDH.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/ec/TestECDH.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/ec/TestECDH.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2006, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2006, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -61,8 +61,37 @@ private final static String secret163 = "04:ae:71:c1:c6:4d:f4:34:4d:72:70:a4:64:65:7f:2d:88:2d:3f:50:be"; - @Override - public void main(Provider p) throws Exception { + + // from https://tools.ietf.org/html/rfc7027#appendix-A.1 + private final static String pubBrainpoolP256r1a = "305a301406072a8648ce3d020106092b24030302080101070342000444106e913f92bc02a1705d9953a8414db95e1aaa49e81d9e85f929a8e3100be58ab4846f11caccb73ce49cbdd120f5a900a69fd32c272223f789ef10eb089bdc"; + private final static String privBrainpoolP256r1a = "3042020100301406072a8648ce3d020106092b240303020801010704273025020101042081db1ee100150ff2ea338d708271be38300cb54241d79950f77b063039804f1d"; + private final static String pubBrainpoolP256r1b = "305a301406072a8648ce3d020106092b2403030208010107034200048d2d688c6cf93e1160ad04cc4429117dc2c41825e1e9fca0addd34e6f1b39f7b990c57520812be512641e47034832106bc7d3e8dd0e4c7f1136d7006547cec6a"; + private final static String privBrainpoolP256r1b = "3042020100301406072a8648ce3d020106092b240303020801010704273025020101042055e40bc41e37e3e2ad25c3c6654511ffa8474a91a0032087593852d3e7d76bd3"; + private final static String secretBrainpoolP256r1 = "89afc39d41d3b327814b80940b042590f96556ec91e6ae7939bce31f3a18bf2b"; + + // from https://tools.ietf.org/html/draft-merkle-ikev2-ke-brainpool-00#appendix-A.5 + private final static String pubBrainpoolP320r1a = "306a301406072a8648ce3d020106092b240303020801010903520004bc43666c00e4b943fe1c785dd8aa842a42ab54b0b49819f960f77694193cd3afa71b6b3c826c773469e998892c0764468023c8e3a7b8f219a1446042be175d4476b2fdfd85b22ead2f29101a1242a578"; + private final static String privBrainpoolP320r1a = "304a020100301406072a8648ce3d020106092b2403030208010109042f302d02010104287cd9c454ba907f7617e262a7fd73764c4a3157c13f82279ef9f062be5d49a8e390b66a4dcedfa867"; + private final static String pubBrainpoolP320r1b = "306a301406072a8648ce3d020106092b240303020801010903520004b1246229429354d1d687bca48bccd6fc733b146dac03642a0ad4b896f5d8bcbd2f4bca16776e4526a41683898f9a76ef36ea2dc7b74d419e55cf3664721890d6a2b2fb8ceb7c113167ed137a358ee37f"; + private final static String privBrainpoolP320r1b = "304a020100301406072a8648ce3d020106092b2403030208010109042f302d0201010428b832a73da5f671e80d87f09372544801f6812224b19a4bc1b37aa7db0842e6dd3ca11de0f802bfed"; + private final static String secretBrainpoolP320r1 = "730314d906b2f21dc11be05031b028d665696beec7139328cdf70c718be5d208659bb96743a88067"; + + // from https://tools.ietf.org/html/rfc7027#appendix-A.2 + private final static String pubBrainpoolP384r1a = "307a301406072a8648ce3d020106092b240303020801010b0362000468b665dd91c195800650cdd363c625f4e742e8134667b767b1b476793588f885ab698c852d4a6e77a252d6380fcaf06855bc91a39c9ec01dee36017b7d673a931236d2f1f5c83942d049e3fa20607493e0d038ff2fd30c2ab67d15c85f7faa59"; + private final static String privBrainpoolP384r1a = "3052020100301406072a8648ce3d020106092b240303020801010b0437303502010104301e20f5e048a5886f1f157c74e91bde2b98c8b52d58e5003d57053fc4b0bd65d6f15eb5d1ee1610df870795143627d042"; + private final static String pubBrainpoolP384r1b = "307a301406072a8648ce3d020106092b240303020801010b036200044d44326f269a597a5b58bba565da5556ed7fd9a8a9eb76c25f46db69d19dc8ce6ad18e404b15738b2086df37e71d1eb462d692136de56cbe93bf5fa3188ef58bc8a3a0ec6c1e151a21038a42e9185329b5b275903d192f8d4e1f32fe9cc78c48"; + private final static String privBrainpoolP384r1b = "3052020100301406072a8648ce3d020106092b240303020801010b043730350201010430032640bc6003c59260f7250c3db58ce647f98e1260acce4acda3dd869f74e01f8ba5e0324309db6a9831497abac96670"; + private final static String secretBrainpoolP384r1 = "0bd9d3a7ea0b3d519d09d8e48d0785fb744a6b355e6304bc51c229fbbce239bbadf6403715c35d4fb2a5444f575d4f42"; + + + // from https://tools.ietf.org/html/rfc7027#appendix-A.3 + private final static String pubBrainpoolP512r1a = "30819b301406072a8648ce3d020106092b240303020801010d03818200040a420517e406aac0acdce90fcd71487718d3b953efd7fbec5f7f27e28c6149999397e91e029e06457db2d3e640668b392c2a7e737a7f0bf04436d11640fd09fd72e6882e8db28aad36237cd25d580db23783961c8dc52dfa2ec138ad472a0fcef3887cf62b623b2a87de5c588301ea3e5fc269b373b60724f5e82a6ad147fde7"; + private final static String privBrainpoolP512r1a = "3062020100301406072a8648ce3d020106092b240303020801010d04473045020101044016302ff0dbbb5a8d733dab7141c1b45acbc8715939677f6a56850a38bd87bd59b09e80279609ff333eb9d4c061231fb26f92eeb04982a5f1d1764cad57665422"; + private final static String pubBrainpoolP512r1b = "30819b301406072a8648ce3d020106092b240303020801010d03818200049d45f66de5d67e2e6db6e93a59ce0bb48106097ff78a081de781cdb31fce8ccbaaea8dd4320c4119f1e9cd437a2eab3731fa9668ab268d871deda55a5473199f2fdc313095bcdd5fb3a91636f07a959c8e86b5636a1e930e8396049cb481961d365cc11453a06c719835475b12cb52fc3c383bce35e27ef194512b71876285fa"; + private final static String privBrainpoolP512r1b = "3062020100301406072a8648ce3d020106092b240303020801010d044730450201010440230e18e1bcc88a362fa54e4ea3902009292f7f8033624fd471b5d8ace49d12cfabbc19963dab8e2f1eba00bffb29e4d72d13f2224562f405cb80503666b25429"; + private final static String secretBrainpoolP512r1 = "a7927098655f1f9976fa50a9d566865dc530331846381c87256baf3226244b76d36403c024d7bbf0aa0803eaff405d3d24f11a9b5c0bef679fe1454b21c4cd1f"; + + @Override public void main(Provider p) throws Exception { if (p.getService("KeyAgreement", "ECDH") == null) { System.out.println("Provider does not support ECDH, skipping"); return; @@ -93,6 +122,19 @@ test(p, pub192a, priv192a, pub192b, priv192b, secret192); test(p, pub163a, priv163a, pub163b, priv163b, secret163); + if (getSupportedECParameterSpec("brainpoolP256r1", p).isPresent()) { + test(p, pubBrainpoolP256r1a, privBrainpoolP256r1a, pubBrainpoolP256r1b, privBrainpoolP256r1b, secretBrainpoolP256r1); + } + if (getSupportedECParameterSpec("brainpoolP320r1", p).isPresent()) { + test(p, pubBrainpoolP320r1a, privBrainpoolP320r1a, pubBrainpoolP320r1b, privBrainpoolP320r1b, secretBrainpoolP320r1); + } + if (getSupportedECParameterSpec("brainpoolP384r1", p).isPresent()) { + test(p, pubBrainpoolP384r1a, privBrainpoolP384r1a, pubBrainpoolP384r1b, privBrainpoolP384r1b, secretBrainpoolP384r1); + } + if (getSupportedECParameterSpec("brainpoolP512r1", p).isPresent()) { + test(p, pubBrainpoolP512r1a, privBrainpoolP512r1a, pubBrainpoolP512r1b, privBrainpoolP512r1b, secretBrainpoolP512r1); + } + System.out.println("OK"); } diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java openjdk-11-11~24/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.java 2018-07-25 15:36:46.000000000 +0000 @@ -197,6 +197,9 @@ } public static void main(String[] args) throws Exception { + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + Security.setProperty("jdk.certpath.disabledAlgorithms", ""); + // Get the customized arguments. parseArguments(args); main(new ClientAuth()); diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.sh openjdk-11-11~24/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.sh --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/KeyStore/ClientAuth.sh 2018-07-25 15:36:46.000000000 +0000 @@ -55,46 +55,46 @@ ARCH=`isainfo` case "$ARCH" in sparc* ) - FS="/" - PS=":" - CP="${FS}bin${FS}cp" - CHMOD="${FS}bin${FS}chmod" - ;; + FS="/" + PS=":" + CP="${FS}bin${FS}cp" + CHMOD="${FS}bin${FS}chmod" + ;; i[3-6]86 ) - FS="/" - PS=":" - CP="${FS}bin${FS}cp" - CHMOD="${FS}bin${FS}chmod" - ;; + FS="/" + PS=":" + CP="${FS}bin${FS}cp" + CHMOD="${FS}bin${FS}chmod" + ;; amd64* ) - FS="/" - PS=":" - CP="${FS}bin${FS}cp" - CHMOD="${FS}bin${FS}chmod" - ;; + FS="/" + PS=":" + CP="${FS}bin${FS}cp" + CHMOD="${FS}bin${FS}chmod" + ;; * ) # ?itanium? ) # amd64* ) - echo "Unsupported System: Solaris ${ARCH}" - exit 0; - ;; + echo "Unsupported System: Solaris ${ARCH}" + exit 0; + ;; esac ;; Linux ) ARCH=`uname -m` case "$ARCH" in i[3-6]86 ) - FS="/" - PS=":" - CP="${FS}bin${FS}cp" - CHMOD="${FS}bin${FS}chmod" - ;; + FS="/" + PS=":" + CP="${FS}bin${FS}cp" + CHMOD="${FS}bin${FS}chmod" + ;; * ) # ia64 ) # x86_64 ) - echo "Unsupported System: Linux ${ARCH}" - exit 0; - ;; + echo "Unsupported System: Linux ${ARCH}" + exit 0; + ;; esac ;; Windows* ) @@ -126,23 +126,44 @@ # compile test ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} \ - -classpath ${TESTSRC} \ - -d ${TESTCLASSES} \ - ${TESTSRC}${FS}ClientAuth.java \ - ${TESTSRC}${FS}..${FS}PKCS11Test.java + -classpath ${TESTSRC} \ + -d ${TESTCLASSES} \ + ${TESTSRC}${FS}ClientAuth.java \ + ${TESTSRC}${FS}..${FS}PKCS11Test.java + +# run test +echo "Run ClientAuth TLSv1 ..." +${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \ + -classpath ${TESTCLASSES} \ + -DDIR=${TESTSRC}${FS}ClientAuthData${FS} \ + -DCUSTOM_DB_DIR=${TESTCLASSES} \ + -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \ + -DNO_DEFAULT=true \ + -DNO_DEIMOS=true \ + -Dtest.src=${TESTSRC} \ + -Dtest.classes=${TESTCLASSES} \ + ClientAuth TLSv1 + +# save error status +status=$? + +# return if failed +if [ "${status}" != "0" ] ; then + exit $status +fi # run test -echo "Run ClientAuth ..." +echo "Run ClientAuth TLSv1.1 ..." ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \ - -classpath ${TESTCLASSES} \ - -DDIR=${TESTSRC}${FS}ClientAuthData${FS} \ - -DCUSTOM_DB_DIR=${TESTCLASSES} \ - -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \ - -DNO_DEFAULT=true \ - -DNO_DEIMOS=true \ - -Dtest.src=${TESTSRC} \ - -Dtest.classes=${TESTCLASSES} \ - ClientAuth + -classpath ${TESTCLASSES} \ + -DDIR=${TESTSRC}${FS}ClientAuthData${FS} \ + -DCUSTOM_DB_DIR=${TESTCLASSES} \ + -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \ + -DNO_DEFAULT=true \ + -DNO_DEIMOS=true \ + -Dtest.src=${TESTSRC} \ + -Dtest.classes=${TESTCLASSES} \ + ClientAuth TLSv1.1 # save error status status=$? @@ -155,15 +176,15 @@ # run test with specified TLS protocol and cipher suite echo "Run ClientAuth TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA" ${TESTJAVA}${FS}bin${FS}java ${TESTVMOPTS} \ - -classpath ${TESTCLASSES} \ - -DDIR=${TESTSRC}${FS}ClientAuthData${FS} \ - -DCUSTOM_DB_DIR=${TESTCLASSES} \ - -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \ - -DNO_DEFAULT=true \ - -DNO_DEIMOS=true \ - -Dtest.src=${TESTSRC} \ - -Dtest.classes=${TESTCLASSES} \ - ClientAuth TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA + -classpath ${TESTCLASSES} \ + -DDIR=${TESTSRC}${FS}ClientAuthData${FS} \ + -DCUSTOM_DB_DIR=${TESTCLASSES} \ + -DCUSTOM_P11_CONFIG=${TESTSRC}${FS}ClientAuthData${FS}p11-nss.txt \ + -DNO_DEFAULT=true \ + -DNO_DEIMOS=true \ + -Dtest.src=${TESTSRC} \ + -Dtest.classes=${TESTCLASSES} \ + ClientAuth TLSv1.2 TLS_DHE_RSA_WITH_AES_128_CBC_SHA # save error status status=$? diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/PKCS11Test.java openjdk-11-11~24/test/jdk/sun/security/pkcs11/PKCS11Test.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/PKCS11Test.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/PKCS11Test.java 2018-07-25 15:36:46.000000000 +0000 @@ -47,6 +47,7 @@ import java.util.Iterator; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.Properties; import java.util.ServiceConfigurationError; import java.util.ServiceLoader; @@ -408,7 +409,11 @@ return nss3_version; try { - libfile = getNSSLibDir() + System.mapLibraryName(library); + String libdir = getNSSLibDir(); + if (libdir == null) { + return 0.0; + } + libfile = libdir + System.mapLibraryName(library); try (FileInputStream is = new FileInputStream(libfile)) { byte[] data = new byte[1000]; int read = 0; @@ -576,21 +581,8 @@ } curve = kcProp.substring(begin, end); - ECParameterSpec e = getECParameterSpec(p, curve); - System.out.print("\t "+ curve + ": "); - try { - KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", p); - kpg.initialize(e); - kpg.generateKeyPair(); - results.add(e); - System.out.println("Supported"); - } catch (ProviderException ex) { - System.out.println("Unsupported: PKCS11: " + - ex.getCause().getMessage()); - } catch (InvalidAlgorithmParameterException ex) { - System.out.println("Unsupported: Key Length: " + - ex.getMessage()); - } + getSupportedECParameterSpec(curve, p) + .ifPresent(spec -> results.add(spec)); } if (results.size() == 0) { @@ -600,6 +592,27 @@ return results; } + static Optional getSupportedECParameterSpec(String curve, + Provider p) throws Exception { + ECParameterSpec e = getECParameterSpec(p, curve); + System.out.print("\t "+ curve + ": "); + try { + KeyPairGenerator kpg = KeyPairGenerator.getInstance("EC", p); + kpg.initialize(e); + kpg.generateKeyPair(); + System.out.println("Supported"); + return Optional.of(e); + } catch (ProviderException ex) { + System.out.println("Unsupported: PKCS11: " + + ex.getCause().getMessage()); + return Optional.empty(); + } catch (InvalidAlgorithmParameterException ex) { + System.out.println("Unsupported: Key Length: " + + ex.getMessage()); + return Optional.empty(); + } + } + private static ECParameterSpec getECParameterSpec(Provider p, String name) throws Exception { diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/Secmod/pkcs11.txt openjdk-11-11~24/test/jdk/sun/security/pkcs11/Secmod/pkcs11.txt --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/Secmod/pkcs11.txt 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/Secmod/pkcs11.txt 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,4 @@ +library= +name=NSS Internal PKCS #11 Module +parameters=configdir='sql:./tmpdb' certPrefix='' keyPrefix='' secmod='' flags= updatedir='' updateCertPrefix='' updateKeyPrefix='' updateid='' updateTokenDescription='' +NSS=Flags=internal,critical trustOrder=75 cipherOrder=100 slotParams=(1={slotFlags=[RSA,DSA,DH,RC2,RC4,DES,RANDOM,SHA1,MD5,MD2,SSL,TLS,AES,Camellia,SEED,SHA256,SHA512] askpw=any timeout=30}) diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/Secmod/TestNssDbSqlite.java openjdk-11-11~24/test/jdk/sun/security/pkcs11/Secmod/TestNssDbSqlite.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/Secmod/TestNssDbSqlite.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/Secmod/TestNssDbSqlite.java 2018-07-25 15:36:46.000000000 +0000 @@ -26,6 +26,8 @@ * @test * @bug 8165996 * @summary Test NSS DB Sqlite + * @comment There is no NSS on Aix. + * @requires os.family != "aix" * @library ../ * @modules java.base/sun.security.rsa * java.base/sun.security.provider diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/SecmodTest.java openjdk-11-11~24/test/jdk/sun/security/pkcs11/SecmodTest.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/SecmodTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/SecmodTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -55,7 +55,7 @@ DBDIR = System.getProperty("test.classes", ".") + SEP + "tmpdb"; if (useSqlite) { - System.setProperty("pkcs11test.nss.db", "sql:/" + DBDIR); + System.setProperty("pkcs11test.nss.db", "sql:" + DBDIR); } else { System.setProperty("pkcs11test.nss.db", DBDIR); } @@ -67,6 +67,7 @@ if (useSqlite) { copyFile("key4.db", BASE, DBDIR); copyFile("cert9.db", BASE, DBDIR); + copyFile("pkcs11.txt", BASE, DBDIR); } else { copyFile("secmod.db", BASE, DBDIR); copyFile("key3.db", BASE, DBDIR); diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/sslecc/CipherTest.java openjdk-11-11~24/test/jdk/sun/security/pkcs11/sslecc/CipherTest.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/sslecc/CipherTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/sslecc/CipherTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -105,11 +105,11 @@ public static class TestParameters { - String cipherSuite; - String protocol; + CipherSuite cipherSuite; + Protocol protocol; String clientAuth; - TestParameters(String cipherSuite, String protocol, + TestParameters(CipherSuite cipherSuite, Protocol protocol, String clientAuth) { this.cipherSuite = cipherSuite; this.protocol = protocol; @@ -117,7 +117,7 @@ } boolean isEnabled() { - return TLSCipherStatus.isEnabled(cipherSuite, protocol); + return cipherSuite.supportedByProtocol(protocol); } @Override @@ -128,134 +128,6 @@ } return s; } - - static enum TLSCipherStatus { - // cipher suites supported since TLS 1.2 - CS_01("TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), - CS_02("TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), - CS_03("TLS_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), - CS_04("TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), - CS_05("TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384", 0x0303, 0xFFFF), - CS_06("TLS_DHE_RSA_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), - CS_07("TLS_DHE_DSS_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), - - CS_08("TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_09("TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_10("TLS_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_11("TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_12("TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_13("TLS_DHE_RSA_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_14("TLS_DHE_DSS_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - - CS_15("TLS_DH_anon_WITH_AES_256_CBC_SHA256", 0x0303, 0xFFFF), - CS_16("TLS_DH_anon_WITH_AES_128_CBC_SHA256", 0x0303, 0xFFFF), - CS_17("TLS_RSA_WITH_NULL_SHA256", 0x0303, 0xFFFF), - - CS_20("TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_21("TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_22("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_23("TLS_RSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_24("TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_25("TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_26("TLS_DHE_RSA_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_27("TLS_DHE_DSS_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - - CS_28("TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_29("TLS_RSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_30("TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_31("TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_32("TLS_DHE_RSA_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - CS_33("TLS_DHE_DSS_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - - CS_34("TLS_DH_anon_WITH_AES_256_GCM_SHA384", 0x0303, 0xFFFF), - CS_35("TLS_DH_anon_WITH_AES_128_GCM_SHA256", 0x0303, 0xFFFF), - - // cipher suites obsoleted since TLS 1.2 - CS_50("SSL_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_51("SSL_DHE_RSA_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_52("SSL_DHE_DSS_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_53("SSL_DH_anon_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_54("TLS_KRB5_WITH_DES_CBC_SHA", 0x0000, 0x0303), - CS_55("TLS_KRB5_WITH_DES_CBC_MD5", 0x0000, 0x0303), - - // cipher suites obsoleted since TLS 1.1 - CS_60("SSL_RSA_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), - CS_61("SSL_DH_anon_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), - CS_62("SSL_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), - CS_63("SSL_DHE_RSA_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), - CS_64("SSL_DHE_DSS_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), - CS_65("SSL_DH_anon_EXPORT_WITH_DES40_CBC_SHA", 0x0000, 0x0302), - CS_66("TLS_KRB5_EXPORT_WITH_RC4_40_SHA", 0x0000, 0x0302), - CS_67("TLS_KRB5_EXPORT_WITH_RC4_40_MD5", 0x0000, 0x0302), - CS_68("TLS_KRB5_EXPORT_WITH_DES_CBC_40_SHA", 0x0000, 0x0302), - CS_69("TLS_KRB5_EXPORT_WITH_DES_CBC_40_MD5", 0x0000, 0x0302), - - // ignore TLS_EMPTY_RENEGOTIATION_INFO_SCSV always - CS_99("TLS_EMPTY_RENEGOTIATION_INFO_SCSV", 0xFFFF, 0x0000); - - // the cipher suite name - final String cipherSuite; - - // supported since protocol version - final int supportedSince; - - // obsoleted since protocol version - final int obsoletedSince; - - TLSCipherStatus(String cipherSuite, - int supportedSince, int obsoletedSince) { - this.cipherSuite = cipherSuite; - this.supportedSince = supportedSince; - this.obsoletedSince = obsoletedSince; - } - - static boolean isEnabled(String cipherSuite, String protocol) { - int versionNumber = toVersionNumber(protocol); - - if (versionNumber < 0) { - return true; // unlikely to happen - } - - for (TLSCipherStatus status : TLSCipherStatus.values()) { - if (cipherSuite.equals(status.cipherSuite)) { - if ((versionNumber < status.supportedSince) || - (versionNumber >= status.obsoletedSince)) { - return false; - } - - return true; - } - } - - return true; - } - - private static int toVersionNumber(String protocol) { - int versionNumber = -1; - - switch (protocol) { - case "SSLv2Hello": - versionNumber = 0x0002; - break; - case "SSLv3": - versionNumber = 0x0300; - break; - case "TLSv1": - versionNumber = 0x0301; - break; - case "TLSv1.1": - versionNumber = 0x0302; - break; - case "TLSv1.2": - versionNumber = 0x0303; - break; - default: - // unlikely to happen - } - - return versionNumber; - } - } } private List tests; @@ -283,14 +155,21 @@ for (int k = 0; k < clientAuths.length; k++) { String clientAuth = clientAuths[k]; - if ((clientAuth != null) && - (cipherSuite.indexOf("DH_anon") != -1)) { - // no client with anonymous ciphersuites + // no client with anonymous cipher suites. + // TLS_EMPTY_RENEGOTIATION_INFO_SCSV always be skipped. + // TLS 1.3 is skipped due to the signature algorithm, + // exactly MD5withRSA, in the certificates is not allowed. + if ((clientAuth != null && cipherSuite.contains("DH_anon") + || cipherSuite.equals( + CipherSuite.TLS_EMPTY_RENEGOTIATION_INFO_SCSV.name()) + || "TLSv1.3".equals(protocol))) { continue; } - tests.add(new TestParameters(cipherSuite, protocol, - clientAuth)); + tests.add(new TestParameters( + CipherSuite.cipherSuite(cipherSuite), + Protocol.protocol(protocol), + clientAuth)); } } } diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java openjdk-11-11~24/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/sslecc/ClientJSSEServerJSSE.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ * @bug 6405536 * @summary Verify that all ciphersuites work (incl. ECC using NSS crypto) * @author Andreas Sterbenz - * @library .. + * @library .. ../../../../javax/net/ssl/TLSCommon * @library ../../../../java/security/testlibrary * @modules jdk.crypto.cryptoki * @run main/othervm -Djdk.tls.namedGroups="secp256r1,sect193r1" diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs11/sslecc/JSSEClient.java openjdk-11-11~24/test/jdk/sun/security/pkcs11/sslecc/JSSEClient.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs11/sslecc/JSSEClient.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs11/sslecc/JSSEClient.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -67,8 +67,8 @@ } socket.setSoTimeout(CipherTest.TIMEOUT); - socket.setEnabledCipherSuites(new String[] {params.cipherSuite}); - socket.setEnabledProtocols(new String[] {params.protocol}); + socket.setEnabledCipherSuites(new String[] {params.cipherSuite.name()}); + socket.setEnabledProtocols(new String[] {params.protocol.name}); InputStream in = socket.getInputStream(); OutputStream out = socket.getOutputStream(); sendRequest(in, out); @@ -76,11 +76,11 @@ SSLSession session = socket.getSession(); session.invalidate(); String cipherSuite = session.getCipherSuite(); - if (params.cipherSuite.equals(cipherSuite) == false) { + if (!params.cipherSuite.name().equals(cipherSuite)) { throw new Exception("Negotiated ciphersuite mismatch: " + cipherSuite + " != " + params.cipherSuite); } String protocol = session.getProtocol(); - if (params.protocol.equals(protocol) == false) { + if (!params.protocol.name.equals(protocol)) { throw new Exception("Negotiated protocol mismatch: " + protocol + " != " + params.protocol); } if (cipherSuite.indexOf("DH_anon") == -1) { diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs12/EmptyPassword.java openjdk-11-11~24/test/jdk/sun/security/pkcs12/EmptyPassword.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs12/EmptyPassword.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs12/EmptyPassword.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8202299 + * @modules java.base/sun.security.tools.keytool + * java.base/sun.security.x509 + * @library /test/lib + * @summary Java Keystore fails to load PKCS12/PFX certificates created in WindowsServer2016 + */ + +import jdk.test.lib.Asserts; +import sun.security.tools.keytool.CertAndKeyGen; +import sun.security.x509.X500Name; + +import java.io.File; +import java.io.FileOutputStream; +import java.security.KeyStore; +import java.security.cert.Certificate; + +public class EmptyPassword { + + public static void main(String[] args) throws Exception { + + // KeyStore is protected with password "\0". + CertAndKeyGen gen = new CertAndKeyGen("RSA", "SHA256withRSA"); + gen.generate(2048); + KeyStore ks = KeyStore.getInstance("PKCS12"); + ks.load(null, null); + ks.setKeyEntry("a", gen.getPrivateKey(), new char[1], + new Certificate[] { + gen.getSelfCertificate(new X500Name("CN=Me"), 100) + }); + try (FileOutputStream fos = new FileOutputStream("p12")) { + ks.store(fos, new char[1]); + } + + // It can be loaded with password "". + ks = KeyStore.getInstance(new File("p12"), new char[0]); + Asserts.assertTrue(ks.getKey("a", new char[0]) != null); + Asserts.assertTrue(ks.getCertificate("a") != null); + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/pkcs12/PBES2Encoding.java openjdk-11-11~24/test/jdk/sun/security/pkcs12/PBES2Encoding.java --- openjdk-11-11~19/test/jdk/sun/security/pkcs12/PBES2Encoding.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/pkcs12/PBES2Encoding.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8202837 + * @summary PBES2 AlgorithmId encoding error in PKCS12 KeyStore + */ + +import java.io.ByteArrayInputStream; +import java.security.KeyStore; + +public class PBES2Encoding { + + // This is a PKCS 12 file using PBES2 to encrypt the cert and key. It is + // generated with these commands: + // + // keytool -keystore ks -genkeypair -storepass changeit -alias a -dname CN=A + // openssl pkcs12 -in ks -nodes -out kandc -passin pass:changeit + // openssl pkcs12 -export -in kandc -out p12 -name a -passout pass:changeit + // -certpbe AES-128-CBC -keypbe AES-128-CBC + + static final String P12_FILE = + "308208860201033082084c06092a864886f70d010701a082083d048208393082" + + "08353082050406092a864886f70d010706a08204f5308204f1020100308204ea" + + "06092a864886f70d010701304906092a864886f70d01050d303c301b06092a86" + + "4886f70d01050c300e040879e103dcdf95bd3e02020800301d06096086480165" + + "0304010204108afe09885014c1315a431956bf051cd1808204909af1a5964e45" + + "fa24887c963d422500a54576bda5b79beba0a97ec61fd7f68e1d7acca9c7a2ff" + + "fa90cc161d1e930a8315158089ce5e842ae758f63d723bd02b82120e663c2965" + + "a32101d27f268f7101d9b8786ddeeb8ddfa57d63c7b110ad9015b6279f8c5adf" + + "d2a78f82d6641bbb4c363bfe6d5be78993c54a1a52d83acba21f70a70c104c18" + + "1968df3009896fb3af534661a8a3d25a09974adfd6dd587f067fd5a2017f0d34" + + "99ca0dfd9950f555e950ceb3120408fb9b72e3b43020e4cde2f1c7726901328d" + + "78471d7825ce6c9968d9f8e3ae2f2963cfc7d81bd1facfa55f56d711f3568673" + + "6c75bc6ae67beee1a70355bf1daa17aba7cdc4fe35b06881503b7a99d1c3efeb" + + "e036217042e2f7918c038dc5505447acbe84db6ac10527dd65597b25c8d5f68a" + + "349ca4da866b76934aa7c1f4c452b6c45bd97d991c35d3ce63e20342817f7874" + + "40d73d2b3329aafba3c95ed2601d2fc85231f0f1797f7e36ae4ff379af030a09" + + "1d9c476468eff8be50632c706f0308a5e3a307a1929241b8fcd4fef447c6606b" + + "7c45cc01c3dae196b54479d453428c378ec9cdbd45ff514793a91d61d0b230ff" + + "4af62765773e9b51ef2f5965c046b25e7c09b42838b2a19fe5262756a64e7b96" + + "6fa0159f369d6afb9f4486e2cc7e56a9b9d5afdd28e8c0e19ff4cdf2f7904a12" + + "8284201f51dbdfb3fffb2d482764226c8bee83190d99e6bd0bf310eab5501922" + + "aede091d3ee8fc405874a63fc696c577829192c65b70964bf54db87c77fe823b" + + "19a8344275142387926909c39c0008d9111c78d7e296ba74ca448010db327e11" + + "0927fe2029a5fcfde66d6883a26bab78e3dfdb9569a64d117b26e04d627b35b7" + + "3a795eb9e6ea7bd4469403cb8a822831c71bc587d3b81b0ae4ca381df8b6872c" + + "8bea5f8c99be643f34bafe5bac178c5a36a4c8088e0535eda0511326e3b0ae5e" + + "dafde080886fa539f659525d3fcd38468e8c00c05d223d6bd060ef875894f7bc" + + "63e61854fad5f6146959d0447a4714a3b79292890ae52c7aa82075f56386e3d3" + + "fa2d3376156dc2f5811bd1ac2ca97cb1068a22577513e68a7a0116c6268f9146" + + "a718c9e11dad701f3562be8cb9beb3aadd2003b32e3d88afbf178f7a7b5daf09" + + "f5acaad1fe0dd27d7094a522a39ede71e621dc2b25b4e855d9a1853cdfa5f6f7" + + "b4a0e1c7a5eacd4903aef9eae6a1c2df370137830bcf5cae2e96eef2d9934e9d" + + "21e756499370cba32dc923f26915864b2a3cd5b046fad05922ff686f8ccb0b2b" + + "4bce27d4c91a0c4d3fab3fd65eb0327d2435c27bdd789b66cb88fe56c31b1785" + + "b8820a7c07947f3bf0d6d18ab2d334d927a70dad2fcdad31422138bb3ef39a3d" + + "0e66c298e66d38efad20a8e963b98a59e8b6c5d92aea4364c5f720ea9ab6f510" + + "2c5ccad50bcb3b5d3fe1ae2810118af0339a6b980c3e2ff1014675ef3a8ea84c" + + "3a27b18a088979cddaee68cb65761fdeafc1ab766c13ca8c073cadedec3bf7c0" + + "bdc2e91dcbb1295100a3d66838992a19049a7c25ad683c55ed9831cf187dfdba" + + "242c38a9a32b9d023753c31519987f43d57a02b238230e93f8c5f5ab64516ece" + + "eb915dda45ceb7257e87c909a381248a809b30202884b26eac08b53f9de2478f" + + "3b0b410698e44744fbe63082032906092a864886f70d010701a082031a048203" + + "16308203123082030e060b2a864886f70d010c0a0102a08202c3308202bf3049" + + "06092a864886f70d01050d303c301b06092a864886f70d01050c300e040875ea" + + "e60a1bd8525102020800301d060960864801650304010204101c066ab644ec44" + + "506b2accab7458b77f04820270c4f2702354ebcd5eb1bfb82bd22382035a7907" + + "ab5af91d045250ac1d56f95e4b0d944a99bccd266ea4f7402e5c2082f70ac8ff" + + "081242bbd0e9b374eedcafbca01983ca9e324d8850cad4ac43396b1a3250e365" + + "fa01e3882d19a01f017724a90242d0558d75399cf310ac551cd60d92e26bc8b2" + + "7872882b1f41819d1f660f18a0a2825bd81c861e02124c586046a3609f36713b" + + "dcefdc617788032d13268dfb6530205757aba368950041830cbd07ad3ef3987a" + + "5d71c1cf9987be05de696b4191a44f405227c89fc857dfbf956fe0ab1a0d8c02" + + "613773b1234acd9d3c75994ea00883c1686e3e57661d9937c1837770b3dd2874" + + "0ccfcff02d1998cb9907a78b9d95475542cd3e064231f40e425a745dbc5cfec8" + + "30f7b6e935487e68b664d998ddfaa06db44c247a0f012f17099c8bb955827e13" + + "5017b2526bee9a222e70933f6d7b8968dffe4ca033022d4eac85259434d68e89" + + "43d3c9e4c516ec88bb81971d6751803aef4afdb01505f81f8f71d3c074ab788f" + + "7a5d197c3985488b6acc53c23bef91906f3009c6ec199cc916fcb88876a28727" + + "32ee95d59f636d78e597e10a0e305bd1a5ccda8ad9716f0b5e9c8ca9bfa9ee54" + + "224c1183d499d063c6c1ec02b7f9a482b8983bcbad6b64eefc77ef961ec4dd02" + + "1f832e3c048b9f77034bbd896b7ab13a9f22d7fe94c88626e77b7c0b2d9fac44" + + "914bd9c50cc69ef58044ae1cc423eb321bf5ce2c7505df45d21b932c675c0c5b" + + "3705328245bc70ac262808519681f94489912a3dea891aab2d3bdc573b6b17cf" + + "6bfd8c1a93404a91efaca5441cd2192b71529a543938056382a7f54fabea4760" + + "6ef9ea7c8cdd663036e528ae6043ff138354b43b85cf488f3748fb1051313830" + + "1106092a864886f70d01091431041e020061302306092a864886f70d01091531" + + "160414664fad18d5583599e1cbe7fe694f36237e2272c530313021300906052b" + + "0e03021a0500041472658e404aba0df42263cff430397794c379977504084962" + + "aeaf211dfa1f02020800"; + + public static void main(String[] args) throws Exception { + + byte[] p12 = new byte[P12_FILE.length() / 2]; + for (int i = 0; i < p12.length; i++) { + p12[i] = Integer.valueOf(P12_FILE.substring(2 * i, 2 * i + 2), 16) + .byteValue(); + } + + KeyStore ks = KeyStore.getInstance("pkcs12"); + ks.load(new ByteArrayInputStream(p12), "changeit".toCharArray()); + + // Make sure both cert and key can be retrieved + System.out.println(ks.getCertificate("a")); + System.out.println(ks.getKey("a", "changeit".toCharArray())); + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/provider/SecureRandom/CommonSeeder.java openjdk-11-11~24/test/jdk/sun/security/provider/SecureRandom/CommonSeeder.java --- openjdk-11-11~19/test/jdk/sun/security/provider/SecureRandom/CommonSeeder.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/provider/SecureRandom/CommonSeeder.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,70 +21,39 @@ * questions. */ -import sun.security.provider.AbstractDrbg; -import sun.security.provider.EntropySource; - -import java.lang.reflect.Field; -import java.lang.reflect.Modifier; import java.security.DrbgParameters; import java.security.SecureRandom; import java.security.Security; +import sun.security.provider.SeedGenerator; /** * @test - * @bug 8051408 - * @modules java.base/java.lang.reflect:open - * java.base/sun.security.provider:+open + * @bug 8051408 8202608 + * @modules java.base/sun.security.provider + * @build java.base/sun.security.provider.SeedGenerator * @run main/othervm CommonSeeder * @summary check entropy reading of DRBGs */ public class CommonSeeder { - static class MyES implements EntropySource { - int count = 100; - int lastCount = 100; - - @Override - public byte[] getEntropy(int minEntropy, int minLength, - int maxLength, boolean pr) { - count--; - return new byte[minLength]; - } - - /** - * Confirms genEntropy() has been called {@code less} times - * since last check. - */ - public void checkUsage(int less) throws Exception { - if (lastCount != count + less) { - throw new Exception(String.format( - "lastCount = %d, count = %d, less = %d", - lastCount, count, less)); - } - lastCount = count; - } - } - public static void main(String[] args) throws Exception { byte[] result = new byte[10]; - MyES es = new MyES(); - // Set es as the default entropy source, overriding SeedGenerator. - setDefaultSeeder(es); + // Use patched SeedGenerator in java.base/sun/security/provider/. // Nothing happened yet - es.checkUsage(0); + SeedGenerator.checkUsage(0); SecureRandom sr; sr = SecureRandom.getInstance("DRBG"); // No entropy reading if only getInstance - es.checkUsage(0); + SeedGenerator.checkUsage(0); // Entropy is read at 1st nextBytes of the 1st DRBG sr.nextInt(); - es.checkUsage(1); + SeedGenerator.checkUsage(1); for (String mech : new String[]{"Hash_DRBG", "HMAC_DRBG", "CTR_DRBG"}) { System.out.println("Testing " + mech + "..."); @@ -96,7 +65,7 @@ sr = SecureRandom.getInstance("DRBG"); sr.nextInt(); sr.reseed(); - es.checkUsage(0); + SeedGenerator.checkUsage(0); // DRBG with pr_true always read from default entropy, and // its nextBytes always reseed itself @@ -106,28 +75,19 @@ sr = SecureRandom.getInstance("DRBG"); sr.nextInt(); - es.checkUsage(2); // one instantiate, one reseed + SeedGenerator.checkUsage(2); // one instantiate, one reseed sr.nextInt(); - es.checkUsage(1); // one reseed in nextBytes + SeedGenerator.checkUsage(1); // one reseed in nextBytes sr.reseed(); - es.checkUsage(1); // one reseed + SeedGenerator.checkUsage(1); // one reseed sr.nextBytes(result, DrbgParameters.nextBytes(-1, false, null)); - es.checkUsage(0); // pr_false for this call + SeedGenerator.checkUsage(0); // pr_false for this call sr.nextBytes(result, DrbgParameters.nextBytes(-1, true, null)); - es.checkUsage(1); // pr_true for this call + SeedGenerator.checkUsage(1); // pr_true for this call sr.reseed(DrbgParameters.reseed(true, null)); - es.checkUsage(1); // reseed from es + SeedGenerator.checkUsage(1); // reseed from es sr.reseed(DrbgParameters.reseed(false, null)); - es.checkUsage(0); // reseed from AbstractDrbg.SeederHolder.seeder + SeedGenerator.checkUsage(0); // reseed from AbstractDrbg.SeederHolder.seeder } } - - static void setDefaultSeeder(EntropySource es) throws Exception { - Field f = AbstractDrbg.class.getDeclaredField("defaultES"); - f.setAccessible(true); // no more private - Field f2 = Field.class.getDeclaredField("modifiers"); - f2.setAccessible(true); - f2.setInt(f, f2.getInt(f) - Modifier.FINAL); // no more final - f.set(null, es); - } } diff -Nru openjdk-11-11~19/test/jdk/sun/security/provider/SecureRandom/java.base/sun/security/provider/SeedGenerator.java openjdk-11-11~24/test/jdk/sun/security/provider/SecureRandom/java.base/sun/security/provider/SeedGenerator.java --- openjdk-11-11~19/test/jdk/sun/security/provider/SecureRandom/java.base/sun/security/provider/SeedGenerator.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/provider/SecureRandom/java.base/sun/security/provider/SeedGenerator.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// This is not the real sun.security.provider.SeedGenerator class. Used by +// ../../../../CommonSeeder.java only. +package sun.security.provider; + +public class SeedGenerator { + + static int count = 100; + static int lastCount = 100; + + public static void generateSeed(byte[] result) { + count--; + } + + /** + * Confirms genEntropy() has been called {@code less} times + * since last check. + */ + public static void checkUsage(int less) throws Exception { + if (lastCount != count + less) { + throw new Exception(String.format( + "lastCount = %d, count = %d, less = %d", + lastCount, count, less)); + } + lastCount = count; + } + + // Needed by AbstractDrbg.java + static byte[] getSystemEntropy() { + return new byte[20]; + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/rsa/pss/InitAgain.java openjdk-11-11~24/test/jdk/sun/security/rsa/pss/InitAgain.java --- openjdk-11-11~19/test/jdk/sun/security/rsa/pss/InitAgain.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/rsa/pss/InitAgain.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +import java.security.*; +import java.security.spec.*; + +/** + * @test + * @bug 8205445 + * @summary Make sure old state is cleared when init is called again + */ +public class InitAgain { + + public static void main(String[] args) throws Exception { + + byte[] msg = "hello".getBytes(); + + Signature s1 = Signature.getInstance("RSASSA-PSS"); + Signature s2 = Signature.getInstance("RSASSA-PSS"); + + s1.setParameter(PSSParameterSpec.DEFAULT); + s2.setParameter(PSSParameterSpec.DEFAULT); + + KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA"); + kpg.initialize(1024); + KeyPair kp = kpg.generateKeyPair(); + + s1.initSign(kp.getPrivate()); + s1.update(msg); + s1.initSign(kp.getPrivate()); + s1.update(msg); + // Data digested in s1: + // Before this fix, msg | msg + // After this fix, msg + + s2.initVerify(kp.getPublic()); + s2.update(msg); + s2.initVerify(kp.getPublic()); + s2.update(msg); + s2.initVerify(kp.getPublic()); + s2.update(msg); + // Data digested in s2: + // Before this fix, msg | msg | msg + // After this fix, msg + + if (!s2.verify(s1.sign())) { + throw new Exception(); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/AppOutputStream/NoExceptionOnClose.java openjdk-11-11~24/test/jdk/sun/security/ssl/AppOutputStream/NoExceptionOnClose.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/AppOutputStream/NoExceptionOnClose.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/AppOutputStream/NoExceptionOnClose.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,14 +21,16 @@ * questions. */ +// +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. +// + /* * @test 1.3 01/03/08 * @bug 4378397 * @summary JSSE socket output stream doesn't throw after socket is closed * @run main/othervm NoExceptionOnClose - * - * SunJSSE does not support dynamic system properties, no way to re-use - * system properties in samevm/agentvm mode. * @author Jaya Hangal */ @@ -152,11 +154,11 @@ try { sslOS.write(22); sslOS.flush(); - } catch (SocketException socketClosed) { + } catch (SSLException | SocketException socketClosed) { System.out.println("Received \"" + socketClosed.getMessage() + "\" exception as expected"); isSocketClosedThrown = true; - } + } if (!isSocketClosedThrown) { throw new Exception("No Exception thrown on write() after" + " close()"); diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/CipherSuite/SSL_NULL.java openjdk-11-11~24/test/jdk/sun/security/ssl/CipherSuite/SSL_NULL.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/CipherSuite/SSL_NULL.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/CipherSuite/SSL_NULL.java 2018-07-25 15:36:46.000000000 +0000 @@ -24,7 +24,8 @@ /** * @test * @bug 4854838 - * @summary Verify that SSL_NULL_WITH_NULL_NULL is returned as ciphersuite if the handshake fails + * @summary Verify that SSL_NULL_WITH_NULL_NULL is returned as ciphersuite + * if the handshake fails * @author Andreas Sterbenz */ @@ -34,7 +35,6 @@ import javax.net.ssl.*; public class SSL_NULL { - private static volatile Boolean result; public static void main(String[] args) throws Exception { @@ -71,15 +71,18 @@ SSLSocketFactory.getDefault().createSocket( "localhost", serverSocket.getLocalPort()); socket.setEnabledCipherSuites( - new String[] { "SSL_RSA_WITH_RC4_128_MD5" }); + new String[] { "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" }); try { OutputStream out = socket.getOutputStream(); out.write(0); out.flush(); throw new RuntimeException("No exception received"); } catch (SSLHandshakeException e) { + System.out.println("Expected handshake exception: " + e); } + System.out.println("client: " + socket.getSession().getCipherSuite()); + // wait for other thread to set result while (result == null) { Thread.sleep(50); diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/ClientHandshaker/LengthCheckTest.java openjdk-11-11~24/test/jdk/sun/security/ssl/ClientHandshaker/LengthCheckTest.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/ClientHandshaker/LengthCheckTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/ClientHandshaker/LengthCheckTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -74,7 +74,6 @@ import java.nio.*; import java.util.List; import java.util.ArrayList; -import sun.security.ssl.ProtocolVersion; public class LengthCheckTest { @@ -155,6 +154,7 @@ private static final int TLS_ALERT_UNEXPECTED_MSG = 0x0A; private static final int TLS_ALERT_HANDSHAKE_FAILURE = 0x28; private static final int TLS_ALERT_INTERNAL_ERROR = 0x50; + private static final int TLS_ALERT_ILLEGAL_PARAMETER = 0x2F; public interface HandshakeTest { void execTest() throws Exception; @@ -268,24 +268,24 @@ runDelegatedTasks(serverResult, serverEngine); sTOc.flip(); dumpByteBuffer("SERVER-TO-CLIENT", sTOc); + + // We expect to see the server generate an alert here + serverResult = serverEngine.wrap(serverOut, sTOc); + log("server wrap: ", serverResult); + runDelegatedTasks(serverResult, serverEngine); + sTOc.flip(); + dumpByteBuffer("SERVER-TO-CLIENT", sTOc); } catch (SSLProtocolException ssle) { log("Received expected SSLProtocolException: " + ssle); gotException = true; } - // We expect to see the server generate an alert here - serverResult = serverEngine.wrap(serverOut, sTOc); - log("server wrap: ", serverResult); - runDelegatedTasks(serverResult, serverEngine); - sTOc.flip(); - dumpByteBuffer("SERVER-TO-CLIENT", sTOc); - // At this point we can verify that both an exception // was thrown and the proper action (a TLS alert) was // sent back to the client. if (gotException == false || !isTlsMessage(sTOc, TLS_RECTYPE_ALERT, TLS_ALERT_LVL_FATAL, - TLS_ALERT_UNEXPECTED_MSG)) { + TLS_ALERT_ILLEGAL_PARAMETER)) { throw new SSLException( "Server failed to throw Alert:fatal:internal_error"); } @@ -783,10 +783,9 @@ int ver_major = Byte.toUnsignedInt(bBuf.get()); int ver_minor = Byte.toUnsignedInt(bBuf.get()); int recLen = Short.toUnsignedInt(bBuf.getShort()); - ProtocolVersion pv = ProtocolVersion.valueOf(ver_major, ver_minor); log("===== " + header + " (" + tlsRecType(type) + " / " + - pv + " / " + bufLen + " bytes) ====="); + ver_major + "." + ver_minor + " / " + bufLen + " bytes) ====="); bBuf.reset(); for (int i = 0; i < bufLen; i++) { if (i != 0 && i % 16 == 0) { diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.sh openjdk-11-11~24/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.sh --- openjdk-11-11~19/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/EngineArgs/DebugReportsOneExtraByte.sh 2018-07-25 15:36:46.000000000 +0000 @@ -1,7 +1,7 @@ #! /bin/sh # -# Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. +# Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. # # This code is free software; you can redistribute it and/or modify it @@ -54,7 +54,7 @@ ${COMPILEJAVA}${FS}bin${FS}javac ${TESTJAVACOPTS} ${TESTTOOLVMOPTS} -d . \ ${TESTSRC}${FS}DebugReportsOneExtraByte.java -STRING='main, WRITE: TLSv1 Application Data, length = 8' +STRING='WRITE: TLS10 application_data, length = 8' echo "Examining debug output for the string:" echo "${STRING}" diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/ExtensionType/OptimalListSize.java openjdk-11-11~24/test/jdk/sun/security/ssl/ExtensionType/OptimalListSize.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/ExtensionType/OptimalListSize.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/ExtensionType/OptimalListSize.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/** - * @test - * @bug 8080535 - * @summary Expected size of Character.UnicodeBlock.map is not optimal - * @library /lib/testlibrary - * @modules java.base/java.util:open - * java.base/sun.security.ssl:open - * @build jdk.testlibrary.OptimalCapacity - * @run main OptimalListSize - */ - -import jdk.testlibrary.OptimalCapacity; - -public class OptimalListSize { - public static void main(String[] args) throws Throwable { - OptimalCapacity.ofArrayList( - Class.forName("sun.security.ssl.ExtensionType"), - "knownExtensions", 16); - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/internal/java.base/sun/security/ssl/TestHkdf.java openjdk-11-11~24/test/jdk/sun/security/ssl/internal/java.base/sun/security/ssl/TestHkdf.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/internal/java.base/sun/security/ssl/TestHkdf.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/internal/java.base/sun/security/ssl/TestHkdf.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * Actual test code for the package private HKDF implementation + */ + +package sun.security.ssl; + +import java.util.Arrays; +import java.util.List; +import java.util.LinkedList; +import java.util.Objects; +import java.security.NoSuchAlgorithmException; +import java.security.InvalidKeyException; +import javax.crypto.SecretKey; +import javax.crypto.spec.SecretKeySpec; + +public class TestHkdf { + public static class TestData { + public TestData(String name, String algStr, String ikmStr, + String saltStr, String infoStr, int oLen, String expPrkStr, + String expOkmStr) { + testName = Objects.requireNonNull(name); + algName = Objects.requireNonNull(algStr); + IKM = hex2bin(Objects.requireNonNull(ikmStr)); + if ((outLen = oLen) <= 0) { + throw new IllegalArgumentException( + "Output length must be greater than 0"); + } + expectedPRK = hex2bin(Objects.requireNonNull(expPrkStr)); + expectedOKM = hex2bin(Objects.requireNonNull(expOkmStr)); + + // Non-mandatory fields - may be null + salt = (saltStr != null) ? hex2bin(saltStr) : null; + info = (infoStr != null) ? hex2bin(infoStr) : null; + } + + public final String testName; + public final String algName; + public final byte[] IKM; + public final byte[] salt; + public final byte[] info; + public final int outLen; + public final byte[] expectedPRK; + public final byte[] expectedOKM; + } + + public static final List testList = new LinkedList() {{ + add(new TestData("RFC 5689 Test Case 1", "SHA-256", + "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", + "000102030405060708090a0b0c", + "f0f1f2f3f4f5f6f7f8f9", + 42, + "077709362c2e32df0ddc3f0dc47bba6390b6c73bb50f9c3122ec844ad7c2b3e5", + "3cb25f25faacd57a90434f64d0362f2a2d2d0a90cf1a5a4c5db02d56ecc4c5bf" + + "34007208d5b887185865")); + add(new TestData("RFC 5689 Test Case 2", "SHA-256", + "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" + + "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f" + + "404142434445464748494a4b4c4d4e4f", + "606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f" + + "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f" + + "a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", + "b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecf" + + "d0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeef" + + "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", + 82, + "06a6b88c5853361a06104c9ceb35b45cef760014904671014a193f40c15fc244", + "b11e398dc80327a1c8e7f78c596a49344f012eda2d4efad8a050cc4c19afa97c" + + "59045a99cac7827271cb41c65e590e09da3275600c2f09b8367793a9aca3db71" + + "cc30c58179ec3e87c14c01d5c1f3434f1d87")); + add(new TestData("RFC 5689 Test Case 3", "SHA-256", + "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", + null, null, 42, + "19ef24a32c717b167f33a91d6f648bdf96596776afdb6377ac434c1c293ccb04", + "8da4e775a563c18f715f802a063c5a31b8a11f5c5ee1879ec3454e5f3c738d2d" + + "9d201395faa4b61a96c8")); + add(new TestData("RFC 5689 Test Case 4", "SHA-1", + "0b0b0b0b0b0b0b0b0b0b0b", + "000102030405060708090a0b0c", + "f0f1f2f3f4f5f6f7f8f9", + 42, + "9b6c18c432a7bf8f0e71c8eb88f4b30baa2ba243", + "085a01ea1b10f36933068b56efa5ad81a4f14b822f5b091568a9cdd4f155fda2" + + "c22e422478d305f3f896")); + add(new TestData("RFC 5689 Test Case 5", "SHA-1", + "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" + + "202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f" + + "404142434445464748494a4b4c4d4e4f", + "606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f" + + "808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f" + + "a0a1a2a3a4a5a6a7a8a9aaabacadaeaf", + "b0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecf" + + "d0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeef" + + "f0f1f2f3f4f5f6f7f8f9fafbfcfdfeff", + 82, + "8adae09a2a307059478d309b26c4115a224cfaf6", + "0bd770a74d1160f7c9f12cd5912a06ebff6adcae899d92191fe4305673ba2ffe" + + "8fa3f1a4e5ad79f3f334b3b202b2173c486ea37ce3d397ed034c7f9dfeb15c5e" + + "927336d0441f4c4300e2cff0d0900b52d3b4")); + add(new TestData("RFC 5689 Test Case 6", "SHA-1", + "0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b", + null, null, 42, + "da8c8a73c7fa77288ec6f5e7c297786aa0d32d01", + "0ac1af7002b3d761d1e55298da9d0506b9ae52057220a306e07b6b87e8df21d0" + + "ea00033de03984d34918")); + add(new TestData("RFC 5689 Test Case 7", "SHA-1", + "0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c0c", + null, null, 42, + "2adccada18779e7c2077ad2eb19d3f3e731385dd", + "2c91117204d745f3500d636a62f64f0ab3bae548aa53d423b0d1f27ebba6f5e5" + + "673a081d70cce7acfc48")); + }}; + + public static void main(String args[]) throws Exception { + int testsPassed = 0; + + int testNo = 0; + for (TestData test : testList) { + System.out.println("*** Test " + ++testNo + ": " + + test.testName); + if (runVector(test)) { + testsPassed++; + } + } + + System.out.println("Total tests: " + testList.size() + + ", Passed: " + testsPassed + ", Failed: " + + (testList.size() - testsPassed)); + if (testsPassed != testList.size()) { + throw new RuntimeException("One or more tests failed. " + + "Check output for details"); + } + } + + private static boolean runVector(TestData testData) + throws NoSuchAlgorithmException, InvalidKeyException { + String kdfName, prfName; + HKDF kdfHkdf; + boolean result = true; + SecretKey actualPRK; + SecretKey actualOKM; + byte[] deriveData; + + // Get an instance of the HKDF derivation engine + kdfHkdf = new HKDF(testData.algName); + + // Set up the input keying material and the salt as a secret + SecretKey ikmKey = new SecretKeySpec(testData.IKM, "HKDF-IKM"); + SecretKey saltKey = (testData.salt != null) ? + new SecretKeySpec(testData.salt, "HKDF-Salt") : null; + + // *** HKDF-Extract-only testing + System.out.println("* HKDF-Extract-Only:"); + actualPRK = kdfHkdf.extract(saltKey, ikmKey, "HKDF-PRK"); + result &= compareKeyAndData(actualPRK, testData.expectedPRK); + + // *** HKDF Expand-Only testing + // For these tests, we'll use the actualPRK as the input key + System.out.println("* HKDF-Expand-Only:"); + actualOKM = kdfHkdf.expand(actualPRK, testData.info, testData.outLen, + "HKDF-OKM"); + result &= compareKeyAndData(actualOKM, testData.expectedOKM); + + // *** HKDF Extract-then-Expand testing + // System.out.println("* HKDF-Extract-then-Expand:"); + // actualOKM = kdfHkdf.extractExpand(ikmKey, saltKey, testData.info, + // testData.outLen, "HKDF-OKM2"); + // result &= compareKeyAndData(actualOKM, testData.expectedOKM); + + return result; + } + + /** + * Compare actual key output from HKDF against an expected output value. + * + * @param outKey the KDF output in key form + * @param expectedOut the expected value + * + * @return true if the underlying data for outKey, outData and + * expectedOut are the same. + */ + private static boolean compareKeyAndData(SecretKey outKey, + byte[] expectedOut) { + boolean result = false; + + if (Arrays.equals(outKey.getEncoded(), expectedOut)) { + System.out.println("\t* Key output: Pass"); + result = true; + } else { + System.out.println("\t* Key output: FAIL"); + System.out.println("Expected:\n" + + dumpHexBytes(expectedOut, 16, "\n", " ")); + System.out.println("Actual:\n" + + dumpHexBytes(outKey.getEncoded(), 16, "\n", " ")); + System.out.println(); + } + + return result; + } + + /** + * Dump the hex bytes of a buffer into string form. + * + * @param data The array of bytes to dump to stdout. + * @param itemsPerLine The number of bytes to display per line + * if the {@code lineDelim} character is blank then all bytes + * will be printed on a single line. + * @param lineDelim The delimiter between lines + * @param itemDelim The delimiter between bytes + * + * @return The hexdump of the byte array + */ + private static String dumpHexBytes(byte[] data, int itemsPerLine, + String lineDelim, String itemDelim) { + StringBuilder sb = new StringBuilder(); + if (data != null) { + for (int i = 0; i < data.length; i++) { + if (i % itemsPerLine == 0 && i != 0) { + sb.append(lineDelim); + } + sb.append(String.format("%02X", data[i])).append(itemDelim); + } + } + + return sb.toString(); + } + + private static byte[] hex2bin(String hex) { + int i; + int len = hex.length(); + byte[] data = new byte [len / 2]; + for (i = 0; i < len; i += 2) { + data[i / 2] = (byte)((Character.digit(hex.charAt(i), 16) << 4) + + Character.digit(hex.charAt(i + 1), 16)); + } + return data; + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/internal/TEST.properties openjdk-11-11~24/test/jdk/sun/security/ssl/internal/TEST.properties --- openjdk-11-11~19/test/jdk/sun/security/ssl/internal/TEST.properties 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/internal/TEST.properties 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,3 @@ +modules = \ + java.base/sun.security.ssl +bootclasspath.dirs=. diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/internal/TestRun.java openjdk-11-11~24/test/jdk/sun/security/ssl/internal/TestRun.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/internal/TestRun.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/internal/TestRun.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8145255 + * @run main/othervm java.base/sun.security.ssl.TestHkdf + * @summary HKDF for Sun JSSE + */ + diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDefaultProtocols.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDefaultProtocols.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDefaultProtocols.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDefaultProtocols.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,13 +32,23 @@ * CustomizedDefaultProtocols */ -import javax.net.*; -import javax.net.ssl.*; -import java.util.Arrays; import java.security.Security; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import javax.net.SocketFactory; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.TrustManager; public class CustomizedDefaultProtocols { - static enum ContextVersion { + enum ContextVersion { TLS_CV_01("SSL", new String[] {"SSLv3", "TLSv1", "TLSv1.1"}), TLS_CV_02("TLS", @@ -51,13 +61,15 @@ new String[] {"SSLv3", "TLSv1", "TLSv1.1"}), TLS_CV_06("TLSv1.2", new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}), - TLS_CV_07("Default", + TLS_CV_07("TLSv1.3", + new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}), + TLS_CV_08("Default", new String[] {"SSLv3", "TLSv1", "TLSv1.1"}); final String contextVersion; final String[] enabledProtocols; final static String[] supportedProtocols = new String[] { - "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}; + "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}; ContextVersion(String contextVersion, String[] enabledProtocols) { this.contextVersion = contextVersion; @@ -72,17 +84,33 @@ success = false; } - if (!Arrays.equals(target, expected)) { + if (!protocolEquals(target, expected)) { System.out.println("\tError: Expected to get protocols " + Arrays.toString(expected)); - System.out.println("\tError: The actual protocols " + - Arrays.toString(target)); success = false; } + System.out.println("\t Protocols found " + Arrays.toString(target)); return success; } + private static boolean protocolEquals( + String[] actualProtocols, + String[] expectedProtocols) { + if (actualProtocols.length != expectedProtocols.length) { + return false; + } + + Set set = new HashSet<>(Arrays.asList(expectedProtocols)); + for (String actual : actualProtocols) { + if (set.add(actual)) { + return false; + } + } + + return true; + } + private static boolean checkCipherSuites(String[] target) { boolean success = true; if (target.length == 0) { diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSDefaultProtocols.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,263 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. + +/* + * @test + * @summary Test jdk.tls.client.protocols with DTLS + * @run main/othervm -Djdk.tls.client.protocols="DTLSv1.0" + * CustomizedDTLSDefaultProtocols +*/ + + +import java.security.Security; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import javax.net.SocketFactory; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.TrustManager; + +public class CustomizedDTLSDefaultProtocols { + + enum ContextVersion { + TLS_CV_01("DTLS", + new String[] {"DTLSv1.0"}), + TLS_CV_02("DTLSv1.0", + new String[] {"DTLSv1.0"}), + TLS_CV_03("DTLSv1.2", + new String[] {"DTLSv1.0", "DTLSv1.2"}); + + final String contextVersion; + final String[] enabledProtocols; + final static String[] supportedProtocols = new String[] { + "DTLSv1.0", "DTLSv1.2"}; + + ContextVersion(String contextVersion, String[] enabledProtocols) { + this.contextVersion = contextVersion; + this.enabledProtocols = enabledProtocols; + } + } + + private static boolean checkProtocols(String[] target, String[] expected) { + boolean success = true; + if (target.length == 0) { + System.out.println("\tError: No protocols"); + success = false; + } + + if (!protocolEquals(target, expected)) { + System.out.println("\tError: Expected to get protocols " + + Arrays.toString(expected)); + success = false; + } + System.out.println("\t Protocols found " + Arrays.toString(target)); + + return success; + } + + private static boolean protocolEquals( + String[] actualProtocols, + String[] expectedProtocols) { + if (actualProtocols.length != expectedProtocols.length) { + return false; + } + + Set set = new HashSet<>(Arrays.asList(expectedProtocols)); + for (String actual : actualProtocols) { + if (set.add(actual)) { + return false; + } + } + + return true; + } + + private static boolean checkCipherSuites(String[] target) { + boolean success = true; + if (target.length == 0) { + System.out.println("\tError: No cipher suites"); + success = false; + } + + return success; + } + + public static void main(String[] args) throws Exception { + // reset the security property to make sure that the algorithms + // and keys used in this test are not disabled. + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + + boolean failed = false; + for (ContextVersion cv : ContextVersion.values()) { + System.out.println("Checking SSLContext of " + cv.contextVersion); + SSLContext context = SSLContext.getInstance(cv.contextVersion); + + // Default SSLContext is initialized automatically. + if (!cv.contextVersion.equals("Default")) { + // Use default TK, KM and random. + context.init((KeyManager[])null, (TrustManager[])null, null); + } + + // + // Check SSLContext + // + // Check default SSLParameters of SSLContext + System.out.println("\tChecking default SSLParameters"); + SSLParameters parameters = context.getDefaultSSLParameters(); + + String[] protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + String[] ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // Check supported SSLParameters of SSLContext + System.out.println("\tChecking supported SSLParameters"); + parameters = context.getSupportedSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLEngine + // + // Check SSLParameters of SSLEngine + System.out.println(); + System.out.println("\tChecking SSLEngine of this SSLContext"); + System.out.println("\tChecking SSLEngine.getSSLParameters()"); + SSLEngine engine = context.createSSLEngine(); + engine.setUseClientMode(true); + parameters = engine.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = engine.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = engine.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = engine.getSupportedProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = engine.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLSocket + // + // Check SSLParameters of SSLSocket + System.out.println(); + System.out.println("\tChecking SSLSocket of this SSLContext"); + System.out.println("\tChecking SSLSocket.getSSLParameters()"); + SocketFactory fac = context.getSocketFactory(); + SSLSocket socket = (SSLSocket)fac.createSocket(); + parameters = socket.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = socket.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = socket.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = socket.getSupportedProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = socket.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLServerSocket + // + // Check SSLParameters of SSLServerSocket + System.out.println(); + System.out.println("\tChecking SSLServerSocket of this SSLContext"); + System.out.println("\tChecking SSLServerSocket.getSSLParameters()"); + SSLServerSocketFactory sf = context.getServerSocketFactory(); + SSLServerSocket ssocket = (SSLServerSocket)sf.createServerSocket(); + parameters = ssocket.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = ssocket.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = ssocket.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = ssocket.getSupportedProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = ssocket.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + } + + if (failed) { + throw new Exception("Run into problems, see log for more details"); + } else { + System.out.println("\t... Success"); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedDTLSServerDefaultProtocols.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,283 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. + +/* + * @test + * @summary Test jdk.tls.server.protocols with DTLS + * @run main/othervm -Djdk.tls.server.protocols="DTLSv1.0" + * CustomizedDTLSServerDefaultProtocols + */ + +import java.security.NoSuchAlgorithmException; +import java.security.Security; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import javax.net.SocketFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; + +public class CustomizedDTLSServerDefaultProtocols { + + final static String[] supportedProtocols = new String[]{ + "DTLSv1.0", "DTLSv1.2"}; + + enum ContextVersion { + TLS_CV_01("DTLS", + new String[]{"DTLSv1.0"}, + supportedProtocols), + TLS_CV_02("DTLSv1.0", + supportedProtocols, + new String[]{"DTLSv1.0"}), + TLS_CV_03("DTLS1.2", + supportedProtocols, + supportedProtocols); + + final String contextVersion; + final String[] serverEnabledProtocols; + final String[] clientEnabledProtocols; + + ContextVersion(String contextVersion, String[] serverEnabledProtocols, + String[] clientEnabledProtocols) { + this.contextVersion = contextVersion; + this.serverEnabledProtocols = serverEnabledProtocols; + this.clientEnabledProtocols = clientEnabledProtocols; + } + } + + private static boolean checkProtocols(String[] target, String[] expected) { + boolean success = true; + if (target.length == 0) { + System.out.println("\tError: No protocols"); + success = false; + } + + if (!protocolEquals(target, expected)) { + System.out.println("\tError: Expected to get protocols " + + Arrays.toString(expected)); + success = false; + } + System.out.println("\t Protocols found " + Arrays.toString(target)); + return success; + } + + private static boolean protocolEquals( + String[] actualProtocols, + String[] expectedProtocols) { + if (actualProtocols.length != expectedProtocols.length) { + return false; + } + + Set set = new HashSet<>(Arrays.asList(expectedProtocols)); + for (String actual : actualProtocols) { + if (set.add(actual)) { + return false; + } + } + + return true; + } + + private static boolean checkCipherSuites(String[] target) { + boolean success = true; + if (target.length == 0) { + System.out.println("\tError: No cipher suites"); + success = false; + } + + return success; + } + + public static void main(String[] args) throws Exception { + // reset the security property to make sure that the algorithms + // and keys used in this test are not disabled. + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + System.out.println("jdk.tls.client.protocols = " + + System.getProperty("jdk.tls.client.protocols")); + System.out.println("jdk.tls.server.protocols = "+ + System.getProperty("jdk.tls.server.protocols")); + Test(); + } + + static void Test() throws Exception { + boolean failed = false; + + SSLContext context; + for (ContextVersion cv : ContextVersion.values()) { + System.out.println("Checking SSLContext of " + cv.contextVersion); + try { + context = SSLContext.getInstance(cv.contextVersion); + } catch (NoSuchAlgorithmException e) { + if (cv.contextVersion.compareToIgnoreCase("DTLS1.2") == 0) { + System.out.println("Exception expected: " + e.getMessage()); + continue; + } + throw e; + } + // Default SSLContext is initialized automatically. + if (!cv.contextVersion.equals("Default")) { + // Use default TK, KM and random. + context.init(null, null, null); + } + + // + // Check SSLContext + // + // Check default SSLParameters of SSLContext + System.out.println("\tChecking default SSLParameters"); + SSLParameters parameters = context.getDefaultSSLParameters(); + + String[] protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + String[] ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // Check supported SSLParameters of SSLContext + System.out.println("\tChecking supported SSLParameters"); + parameters = context.getSupportedSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, supportedProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLEngine + // + // Check SSLParameters of SSLEngine + System.out.println(); + System.out.println("\tChecking SSLEngine of this SSLContext"); + System.out.println("\tChecking SSLEngine.getSSLParameters()"); + SSLEngine engine = context.createSSLEngine(); + engine.setUseClientMode(true); + parameters = engine.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = engine.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = engine.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = engine.getSupportedProtocols(); + failed |= !checkProtocols(protocols, supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = engine.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLSocket + // + // Check SSLParameters of SSLSocket + System.out.println(); + System.out.println("\tChecking SSLSocket of this SSLContext"); + System.out.println("\tChecking SSLSocket.getSSLParameters()"); + SocketFactory fac = context.getSocketFactory(); + SSLSocket socket = (SSLSocket) fac.createSocket(); + parameters = socket.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLSocket.getEnabledProtocols()"); + protocols = socket.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + System.out.println("\tChecking SSLSocket.getEnabledCipherSuites()"); + ciphers = socket.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLSocket.getSupportedProtocols()"); + protocols = socket.getSupportedProtocols(); + failed |= !checkProtocols(protocols, supportedProtocols); + + System.out.println( + "\tChecking SSLSocket.getSupportedCipherSuites()"); + ciphers = socket.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLServerSocket + // + // Check SSLParameters of SSLServerSocket + System.out.println(); + System.out.println("\tChecking SSLServerSocket of this SSLContext"); + System.out.println("\tChecking SSLServerSocket.getSSLParameters()"); + SSLServerSocketFactory sf = context.getServerSocketFactory(); + SSLServerSocket ssocket = (SSLServerSocket) sf.createServerSocket(); + parameters = ssocket.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.serverEnabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = ssocket.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.serverEnabledProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = ssocket.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = ssocket.getSupportedProtocols(); + failed |= !checkProtocols(protocols, supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = ssocket.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + if (failed) { + throw new Exception("Run into problems, see log for more details"); + } else { + System.out.println("\t... Success"); + } + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedServerDefaultProtocols.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedServerDefaultProtocols.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedServerDefaultProtocols.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/CustomizedServerDefaultProtocols.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,289 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. + +/* + * @test + * @summary Test jdk.tls.server.protocols with TLS + * @run main/othervm -Djdk.tls.server.protocols="SSLv3,TLSv1,TLSv1.1" + * CustomizedServerDefaultProtocols + */ + +import java.security.Security; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import javax.net.SocketFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; + +public class CustomizedServerDefaultProtocols { + + final static String[] supportedProtocols = new String[]{ + "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}; + + enum ContextVersion { + TLS_CV_01("SSL", + new String[]{"SSLv3", "TLSv1", "TLSv1.1"}, + new String[]{"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}), + TLS_CV_02("TLS", + new String[]{"SSLv3", "TLSv1", "TLSv1.1"}, + new String[]{"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}), + TLS_CV_03("SSLv3", + supportedProtocols, + new String[]{"SSLv3", "TLSv1"}), + TLS_CV_04("TLSv1", + supportedProtocols, + new String[]{"SSLv3", "TLSv1"}), + TLS_CV_05("TLSv1.1", + supportedProtocols, + new String[]{"SSLv3", "TLSv1", "TLSv1.1"}), + TLS_CV_06("TLSv1.2", + supportedProtocols, + new String[]{"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}), + TLS_CV_07("TLSv1.3", + supportedProtocols, + new String[]{"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}), + TLS_CV_08("Default", + new String[]{"SSLv3", "TLSv1", "TLSv1.1"}, + new String[]{"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}); + + final String contextVersion; + final String[] serverEnabledProtocols; + final String[] clientEnabledProtocols; + + ContextVersion(String contextVersion, String[] serverEnabledProtocols, + String[] clientEnabledProtocols) { + this.contextVersion = contextVersion; + this.serverEnabledProtocols = serverEnabledProtocols; + this.clientEnabledProtocols = clientEnabledProtocols; + } + } + + private static boolean checkProtocols(String[] target, String[] expected) { + boolean success = true; + if (target.length == 0) { + System.out.println("\tError: No protocols"); + success = false; + } + + if (!protocolEquals(target, expected)) { + System.out.println("\tError: Expected to get protocols " + + Arrays.toString(expected)); + success = false; + } + System.out.println("\t Protocols found " + Arrays.toString(target)); + return success; + } + + private static boolean protocolEquals( + String[] actualProtocols, + String[] expectedProtocols) { + if (actualProtocols.length != expectedProtocols.length) { + return false; + } + + Set set = new HashSet<>(Arrays.asList(expectedProtocols)); + for (String actual : actualProtocols) { + if (set.add(actual)) { + return false; + } + } + + return true; + } + + private static boolean checkCipherSuites(String[] target) { + boolean success = true; + if (target.length == 0) { + System.out.println("\tError: No cipher suites"); + success = false; + } + + return success; + } + + public static void main(String[] args) throws Exception { + // reset the security property to make sure that the algorithms + // and keys used in this test are not disabled. + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + System.out.println("jdk.tls.client.protocols = " + + System.getProperty("jdk.tls.client.protocols")); + System.out.println("jdk.tls.server.protocols = "+ + System.getProperty("jdk.tls.server.protocols")); + Test(); + } + + static void Test() throws Exception { + boolean failed = false; + + for (ContextVersion cv : ContextVersion.values()) { + System.out.println("Checking SSLContext of " + cv.contextVersion); + SSLContext context = SSLContext.getInstance(cv.contextVersion); + + // Default SSLContext is initialized automatically. + if (!cv.contextVersion.equals("Default")) { + // Use default TK, KM and random. + context.init(null, null, null); + } + + // + // Check SSLContext + // + // Check default SSLParameters of SSLContext + System.out.println("\tChecking default SSLParameters"); + SSLParameters parameters = context.getDefaultSSLParameters(); + + String[] protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + String[] ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // Check supported SSLParameters of SSLContext + System.out.println("\tChecking supported SSLParameters"); + parameters = context.getSupportedSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, supportedProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLEngine + // + // Check SSLParameters of SSLEngine + System.out.println(); + System.out.println("\tChecking SSLEngine of this SSLContext"); + System.out.println("\tChecking SSLEngine.getSSLParameters()"); + SSLEngine engine = context.createSSLEngine(); + engine.setUseClientMode(true); + parameters = engine.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = engine.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = engine.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = engine.getSupportedProtocols(); + failed |= !checkProtocols(protocols, supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = engine.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLSocket + // + // Check SSLParameters of SSLSocket + System.out.println(); + System.out.println("\tChecking SSLSocket of this SSLContext"); + System.out.println("\tChecking SSLSocket.getSSLParameters()"); + SocketFactory fac = context.getSocketFactory(); + SSLSocket socket = (SSLSocket) fac.createSocket(); + parameters = socket.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLSocket.getEnabledProtocols()"); + protocols = socket.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.clientEnabledProtocols); + + System.out.println("\tChecking SSLSocket.getEnabledCipherSuites()"); + ciphers = socket.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLSocket.getSupportedProtocols()"); + protocols = socket.getSupportedProtocols(); + failed |= !checkProtocols(protocols, supportedProtocols); + + System.out.println( + "\tChecking SSLSocket.getSupportedCipherSuites()"); + ciphers = socket.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLServerSocket + // + // Check SSLParameters of SSLServerSocket + System.out.println(); + System.out.println("\tChecking SSLServerSocket of this SSLContext"); + System.out.println("\tChecking SSLServerSocket.getSSLParameters()"); + SSLServerSocketFactory sf = context.getServerSocketFactory(); + SSLServerSocket ssocket = (SSLServerSocket) sf.createServerSocket(); + parameters = ssocket.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.serverEnabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = ssocket.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.serverEnabledProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = ssocket.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = ssocket.getSupportedProtocols(); + failed |= !checkProtocols(protocols, supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = ssocket.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + if (failed) { + throw new Exception("Run into problems, see log for more details"); + } else { + System.out.println("\t... Success"); + } + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/DefaultDTLSEnabledProtocols.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,260 @@ +/* + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * 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. + */ + +// SunJSSE does not support dynamic system properties, no way to re-use +// system properties in samevm/agentvm mode. + +/* + * @test + * @summary Test jdk.tls.client.protocols with DTLS + * @run main/othervm DefaultDTLSEnabledProtocols + */ + +import java.security.Security; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import javax.net.SocketFactory; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.TrustManager; + +public class DefaultDTLSEnabledProtocols { + static enum ContextVersion { + TLS_CV_01("DTLS", + new String[] {"DTLSv1.0", "DTLSv1.2"}), + TLS_CV_02("DTLSv1.0", + new String[] {"DTLSv1.0"}), + TLS_CV_03("DTLSv1.2", + new String[] {"DTLSv1.0", "DTLSv1.2"}); + + final String contextVersion; + final String[] enabledProtocols; + final static String[] supportedProtocols = new String[] { + "DTLSv1.0", "DTLSv1.2"}; + + ContextVersion(String contextVersion, String[] enabledProtocols) { + this.contextVersion = contextVersion; + this.enabledProtocols = enabledProtocols; + } + } + + private static boolean checkProtocols(String[] target, String[] expected) { + boolean success = true; + if (target.length == 0) { + System.out.println("\tError: No protocols"); + success = false; + } + + if (!protocolEquals(target, expected)) { + System.out.println("\tError: Expected to get protocols " + + Arrays.toString(expected)); + success = false; + } + System.out.println("\t Protocols found " + Arrays.toString(target)); + + return success; + } + + private static boolean protocolEquals( + String[] actualProtocols, + String[] expectedProtocols) { + if (actualProtocols.length != expectedProtocols.length) { + return false; + } + + Set set = new HashSet<>(Arrays.asList(expectedProtocols)); + for (String actual : actualProtocols) { + if (set.add(actual)) { + return false; + } + } + + return true; + } + + private static boolean checkCipherSuites(String[] target) { + boolean success = true; + if (target.length == 0) { + System.out.println("\tError: No cipher suites"); + success = false; + } + + return success; + } + + public static void main(String[] args) throws Exception { + // reset the security property to make sure that the algorithms + // and keys used in this test are not disabled. + Security.setProperty("jdk.tls.disabledAlgorithms", ""); + + boolean failed = false; + for (ContextVersion cv : ContextVersion.values()) { + System.out.println("Checking SSLContext of " + cv.contextVersion); + SSLContext context = SSLContext.getInstance(cv.contextVersion); + + // Default SSLContext is initialized automatically. + if (!cv.contextVersion.equals("Default")) { + // Use default TK, KM and random. + context.init((KeyManager[])null, (TrustManager[])null, null); + } + + // + // Check SSLContext + // + // Check default SSLParameters of SSLContext + System.out.println("\tChecking default SSLParameters"); + SSLParameters parameters = context.getDefaultSSLParameters(); + + String[] protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + String[] ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // Check supported SSLParameters of SSLContext + System.out.println("\tChecking supported SSLParameters"); + parameters = context.getSupportedSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLEngine + // + // Check SSLParameters of SSLEngine + System.out.println(); + System.out.println("\tChecking SSLEngine of this SSLContext"); + System.out.println("\tChecking SSLEngine.getSSLParameters()"); + SSLEngine engine = context.createSSLEngine(); + engine.setUseClientMode(true); + parameters = engine.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = engine.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = engine.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = engine.getSupportedProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = engine.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLSocket + // + // Check SSLParameters of SSLSocket + System.out.println(); + System.out.println("\tChecking SSLSocket of this SSLContext"); + System.out.println("\tChecking SSLSocket.getSSLParameters()"); + SocketFactory fac = context.getSocketFactory(); + SSLSocket socket = (SSLSocket)fac.createSocket(); + parameters = socket.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = socket.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.enabledProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = socket.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = socket.getSupportedProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = socket.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + // + // Check SSLServerSocket + // + // Check SSLParameters of SSLServerSocket + System.out.println(); + System.out.println("\tChecking SSLServerSocket of this SSLContext"); + System.out.println("\tChecking SSLServerSocket.getSSLParameters()"); + SSLServerSocketFactory sf = context.getServerSocketFactory(); + SSLServerSocket ssocket = (SSLServerSocket)sf.createServerSocket(); + parameters = ssocket.getSSLParameters(); + + protocols = parameters.getProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + ciphers = parameters.getCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getEnabledProtocols()"); + protocols = ssocket.getEnabledProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + System.out.println("\tChecking SSLEngine.getEnabledCipherSuites()"); + ciphers = ssocket.getEnabledCipherSuites(); + failed |= !checkCipherSuites(ciphers); + + System.out.println("\tChecking SSLEngine.getSupportedProtocols()"); + protocols = ssocket.getSupportedProtocols(); + failed |= !checkProtocols(protocols, cv.supportedProtocols); + + System.out.println( + "\tChecking SSLEngine.getSupportedCipherSuites()"); + ciphers = ssocket.getSupportedCipherSuites(); + failed |= !checkCipherSuites(ciphers); + } + + if (failed) { + throw new Exception("Run into problems, see log for more details"); + } else { + System.out.println("\t... Success"); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/DefaultEnabledProtocols.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/DefaultEnabledProtocols.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/DefaultEnabledProtocols.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/DefaultEnabledProtocols.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,17 +31,27 @@ * @run main/othervm DefaultEnabledProtocols */ -import javax.net.*; -import javax.net.ssl.*; -import java.util.Arrays; import java.security.Security; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import javax.net.SocketFactory; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.TrustManager; public class DefaultEnabledProtocols { - static enum ContextVersion { + enum ContextVersion { TLS_CV_01("SSL", - new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}), + new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}), TLS_CV_02("TLS", - new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}), + new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}), TLS_CV_03("SSLv3", new String[] {"SSLv3", "TLSv1"}), TLS_CV_04("TLSv1", @@ -50,13 +60,15 @@ new String[] {"SSLv3", "TLSv1", "TLSv1.1"}), TLS_CV_06("TLSv1.2", new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}), - TLS_CV_07("Default", - new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}); + TLS_CV_07("TLSv1.3", + new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}), + TLS_CV_08("Default", + new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}); final String contextVersion; final String[] enabledProtocols; final static String[] supportedProtocols = new String[] { - "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}; + "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}; ContextVersion(String contextVersion, String[] enabledProtocols) { this.contextVersion = contextVersion; @@ -71,17 +83,33 @@ success = false; } - if (!Arrays.equals(target, expected)) { + if (!protocolEquals(target, expected)) { System.out.println("\tError: Expected to get protocols " + Arrays.toString(expected)); - System.out.println("\tError: The actual protocols " + - Arrays.toString(target)); success = false; } + System.out.println("\t Protocols found " + Arrays.toString(target)); return success; } + private static boolean protocolEquals( + String[] actualProtocols, + String[] expectedProtocols) { + if (actualProtocols.length != expectedProtocols.length) { + return false; + } + + Set set = new HashSet<>(Arrays.asList(expectedProtocols)); + for (String actual : actualProtocols) { + if (set.add(actual)) { + return false; + } + } + + return true; + } + private static boolean checkCipherSuites(String[] target) { boolean success = true; if (target.length == 0) { diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/NoOldVersionContext.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/NoOldVersionContext.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/NoOldVersionContext.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/NoOldVersionContext.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,10 +32,20 @@ * NoOldVersionContext */ -import javax.net.*; -import javax.net.ssl.*; -import java.util.Arrays; import java.security.Security; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import javax.net.SocketFactory; +import javax.net.ssl.KeyManager; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLParameters; +import javax.net.ssl.SSLServerSocket; +import javax.net.ssl.SSLServerSocketFactory; +import javax.net.ssl.SSLSocket; +import javax.net.ssl.TrustManager; public class NoOldVersionContext { static enum ContextVersion { @@ -51,13 +61,15 @@ new String[] {"SSLv3", "TLSv1", "TLSv1.1"}), TLS_CV_06("TLSv1.2", new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}), - TLS_CV_07("Default", + TLS_CV_07("TLSv1.3", + new String[] {"SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}), + TLS_CV_08("Default", new String[] {"TLSv1", "TLSv1.1", "TLSv1.2"}); final String contextVersion; final String[] enabledProtocols; final static String[] supportedProtocols = new String[] { - "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2"}; + "SSLv2Hello", "SSLv3", "TLSv1", "TLSv1.1", "TLSv1.2", "TLSv1.3"}; ContextVersion(String contextVersion, String[] enabledProtocols) { this.contextVersion = contextVersion; @@ -72,7 +84,7 @@ success = false; } - if (!Arrays.equals(target, expected)) { + if (!protocolEquals(target, expected)) { System.out.println("\tError: Expected to get protocols " + Arrays.toString(expected)); System.out.println("\tError: The actual protocols " + @@ -83,6 +95,23 @@ return success; } + private static boolean protocolEquals( + String[] actualProtocols, + String[] expectedProtocols) { + if (actualProtocols.length != expectedProtocols.length) { + return false; + } + + Set set = new HashSet<>(Arrays.asList(expectedProtocols)); + for (String actual : actualProtocols) { + if (set.add(actual)) { + return false; + } + } + + return true; + } + private static boolean checkCipherSuites(String[] target) { boolean success = true; if (target.length == 0) { diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/TrustTrustedCert.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/TrustTrustedCert.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLContextImpl/TrustTrustedCert.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLContextImpl/TrustTrustedCert.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -131,12 +131,10 @@ sslIS.read(); sslOS.write('A'); sslOS.flush(); - } catch (SSLHandshakeException e) { - if (expectFail && !e.toString().contains("certificate_unknown")) { - throw new RuntimeException( - "Expected to see certificate_unknown in exception output", - e); - } + } catch (SSLException ssle) { + if (!expectFail) { + throw ssle; + } // Otherwise, ignore. } } @@ -158,12 +156,15 @@ sslOS.flush(); sslIS.read(); } catch (SSLHandshakeException e) { + if (expectFail) { // focus on the CertPathValidatorException - Throwable t = e.getCause().getCause(); - if ((t == null) - || (expectFail && !t.toString().contains("MD5withRSA"))) { - throw new RuntimeException( + Throwable t = e.getCause().getCause(); + if (t == null || !t.toString().contains("MD5withRSA")) { + throw new RuntimeException( "Expected to see MD5withRSA in exception output", t); + } + } else { + throw e; } } } diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/CloseEngineException.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/CloseEngineException.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/CloseEngineException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/CloseEngineException.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -45,9 +45,10 @@ import java.security.*; import java.nio.*; +// Note that this test case depends on JSSE provider implementation details. public class CloseEngineException { - private static boolean debug = false; + private static boolean debug = true; private SSLContext sslc; private SSLEngine ssle1; // client @@ -94,43 +95,53 @@ SSLEngineResult result1; // ssle1's results from last operation SSLEngineResult result2; // ssle2's results from last operation - while (!isEngineClosed(ssle1) || !isEngineClosed(ssle2)) { + while (!isEngineClosed(ssle1) && !isEngineClosed(ssle2)) { log("================"); - result1 = ssle1.wrap(appOut1, oneToTwo); - result2 = ssle2.wrap(appOut2, twoToOne); + if (!isEngineClosed(ssle1)) { + result1 = ssle1.wrap(appOut1, oneToTwo); + runDelegatedTasks(result1, ssle1); + + log("wrap1: " + result1); + log("oneToTwo = " + oneToTwo); + log(""); - log("wrap1: " + result1); - log("oneToTwo = " + oneToTwo); - log(""); - - log("wrap2: " + result2); - log("twoToOne = " + twoToOne); + oneToTwo.flip(); + } + if (!isEngineClosed(ssle2)) { + result2 = ssle2.wrap(appOut2, twoToOne); + runDelegatedTasks(result2, ssle2); - runDelegatedTasks(result1, ssle1); - runDelegatedTasks(result2, ssle2); + log("wrap2: " + result2); + log("twoToOne = " + twoToOne); - oneToTwo.flip(); - twoToOne.flip(); + twoToOne.flip(); + } log("----"); - result1 = ssle1.unwrap(twoToOne, appIn1); - result2 = ssle2.unwrap(oneToTwo, appIn2); + if (!isEngineClosed(ssle1) && !dataDone) { + log("--"); + result1 = ssle1.unwrap(twoToOne, appIn1); + runDelegatedTasks(result1, ssle1); + + log("unwrap1: " + result1); + log("twoToOne = " + twoToOne); + log(""); - log("unwrap1: " + result1); - log("twoToOne = " + twoToOne); - log(""); - - log("unwrap2: " + result2); - log("oneToTwo = " + oneToTwo); + twoToOne.compact(); + } + if (!isEngineClosed(ssle2)) { + log("---"); + result2 = ssle2.unwrap(oneToTwo, appIn2); + runDelegatedTasks(result2, ssle2); - runDelegatedTasks(result1, ssle1); - runDelegatedTasks(result2, ssle2); + log("unwrap2: " + result2); + log("oneToTwo = " + oneToTwo); - oneToTwo.compact(); - twoToOne.compact(); + oneToTwo.compact(); + } /* * If we've transfered all the data between app1 and app2, @@ -154,7 +165,7 @@ throw new Exception( "TEST FAILED: didn't throw Exception"); } catch (SSLException e) { - System.out.println("PARTIAL PASS"); + System.err.println("PARTIAL PASS"); } } } @@ -167,7 +178,7 @@ throw new Exception( "TEST FAILED: didn't throw Exception"); } catch (SSLException e) { - System.out.println("TEST PASSED"); + System.err.println("TEST PASSED"); } } @@ -181,7 +192,7 @@ test.runTest(); - System.out.println("Test Passed."); + System.err.println("Test Passed."); } /* @@ -277,7 +288,7 @@ private static void log(String str) { if (debug) { - System.out.println(str); + System.err.println(str); } } } diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/CloseInboundException.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/CloseInboundException.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/CloseInboundException.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/CloseInboundException.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,275 +0,0 @@ -/* - * Copyright (c) 2003, 2013, 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. - */ - -// -// SunJSSE does not support dynamic system properties, no way to re-use -// system properties in samevm/agentvm mode. -// - -/* - * @test - * @bug 4931274 - * @summary closeInbound does not signal when a close_notify has not - * been received. - * @run main/othervm CloseInboundException - * @author Brad Wetmore - */ - -import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; -import java.io.*; -import java.security.*; -import java.nio.*; - -public class CloseInboundException { - - private SSLEngine ssle1; // client - private SSLEngine ssle2; // server - - SSLEngineResult result1; // ssle1's results from last operation - SSLEngineResult result2; // ssle2's results from last operation - - private static String pathToStores = "../../../../javax/net/ssl/etc"; - private static String keyStoreFile = "keystore"; - private static String trustStoreFile = "truststore"; - private static String passwd = "passphrase"; - - private static String keyFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + keyStoreFile; - private static String trustFilename = - System.getProperty("test.src", "./") + "/" + pathToStores + - "/" + trustStoreFile; - - private ByteBuffer appOut1; // write side of ssle1 - private ByteBuffer appIn1; // read side of ssle1 - private ByteBuffer appOut2; // write side of ssle2 - private ByteBuffer appIn2; // read side of ssle2 - - private ByteBuffer oneToTwo; // "reliable" transport ssle1->ssle2 - private ByteBuffer twoToOne; // "reliable" transport ssle2->ssle1 - - /* - * Majority of the test case is here, setup is done below. - */ - private void runTest(boolean inboundClose) throws Exception { - - boolean done = false; - - while (!isEngineClosed(ssle1) || !isEngineClosed(ssle2)) { - - System.out.println("================"); - - result1 = ssle1.wrap(appOut1, oneToTwo); - result2 = ssle2.wrap(appOut2, twoToOne); - - System.out.println("wrap1 = " + result1); - System.out.println("oneToTwo = " + oneToTwo); - - System.out.println("wrap2 = " + result2); - System.out.println("twoToOne = " + twoToOne); - - runDelegatedTasks(result1, ssle1); - runDelegatedTasks(result2, ssle2); - - oneToTwo.flip(); - twoToOne.flip(); - - System.out.println("----"); - result1 = ssle1.unwrap(twoToOne, appIn1); - - if (done && inboundClose) { - try { - result2 = ssle2.unwrap(oneToTwo, appIn2); - throw new Exception("Didn't throw Exception"); - } catch (SSLException e) { - System.out.println("Caught proper exception\n" + e); - return; - } - } else { - result2 = ssle2.unwrap(oneToTwo, appIn2); - } - - System.out.println("unwrap1 = " + result1); - System.out.println("twoToOne = " + twoToOne); - - System.out.println("unwrap2 = " + result2); - System.out.println("oneToTwo = " + oneToTwo); - - runDelegatedTasks(result1, ssle1); - runDelegatedTasks(result2, ssle2); - - oneToTwo.compact(); - twoToOne.compact(); - - /* - * If we've transfered all the data between app1 and app2, - * we try to close and see what that gets us. - */ - if (!done && (appOut1.limit() == appIn2.position()) && - (appOut2.limit() == appIn1.position())) { - - if (inboundClose) { - try { - System.out.println("Closing ssle1's *INBOUND*..."); - ssle1.closeInbound(); - throw new Exception("closeInbound didn't throw"); - } catch (SSLException e) { - System.out.println("Caught closeInbound exc properly"); - checkStatus(); - /* - * Let the message processing continue to - * handle the alert. - */ - } - done = true; - } else { - done = true; - System.out.println("Closing ssle1's *OUTBOUND*..."); - ssle1.closeOutbound(); - } - } - } - } - - /* - * Check to see if the close generated a close_notify message, - * that the result status is sane, and that close again doesn't - * generate a new exception. - * - * We'll consume the wrapped data when we loop back around. - */ - private void checkStatus() throws Exception { - System.out.println("\nCalling last wrap"); - int pos = oneToTwo.position(); - - result1 = ssle1.wrap(appOut1, oneToTwo); - System.out.println("result1 = " + result1); - - if ((pos >= oneToTwo.position()) || - !result1.getStatus().equals(Status.CLOSED) || - !result1.getHandshakeStatus().equals( - HandshakeStatus.NOT_HANDSHAKING) || - !ssle1.isOutboundDone() || - !ssle1.isInboundDone()) { - throw new Exception(result1.toString()); - } - System.out.println("Make sure we don't throw a second SSLException."); - ssle1.closeInbound(); - } - - public static void main(String args[]) throws Exception { - - CloseInboundException test; - - test = new CloseInboundException(); - test.runTest(false); - - test = new CloseInboundException(); - test.runTest(true); - System.out.println("Test PASSED!!!"); - } - - /* - * ********************************************************** - * Majority of the test case is above, below is just setup stuff - * ********************************************************** - */ - - public CloseInboundException() throws Exception { - - SSLContext sslc = getSSLContext(keyFilename, trustFilename); - - ssle1 = sslc.createSSLEngine("host1", 1); - ssle1.setUseClientMode(true); - - ssle2 = sslc.createSSLEngine("host2", 2); - ssle2.setUseClientMode(false); - - createBuffers(); - } - - /* - * Create an initialized SSLContext to use for this test. - */ - private SSLContext getSSLContext(String keyFile, String trustFile) - throws Exception { - - KeyStore ks = KeyStore.getInstance("JKS"); - KeyStore ts = KeyStore.getInstance("JKS"); - - char[] passphrase = "passphrase".toCharArray(); - - ks.load(new FileInputStream(keyFile), passphrase); - ts.load(new FileInputStream(trustFile), passphrase); - - KeyManagerFactory kmf = KeyManagerFactory.getInstance("SunX509"); - kmf.init(ks, passphrase); - - TrustManagerFactory tmf = TrustManagerFactory.getInstance("SunX509"); - tmf.init(ts); - - SSLContext sslCtx = SSLContext.getInstance("TLS"); - - sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - - return sslCtx; - } - - private void createBuffers() { - // Size the buffers as appropriate. - SSLSession session = ssle1.getSession(); - int appBufferMax = session.getApplicationBufferSize(); - int netBufferMax = session.getPacketBufferSize(); - - appIn1 = ByteBuffer.allocateDirect(appBufferMax + 50); - appIn2 = ByteBuffer.allocateDirect(appBufferMax + 50); - - oneToTwo = ByteBuffer.allocateDirect(netBufferMax); - twoToOne = ByteBuffer.allocateDirect(netBufferMax); - - appOut1 = ByteBuffer.wrap("Hi Engine2, I'm SSLEngine1".getBytes()); - appOut2 = ByteBuffer.wrap("Hello Engine1, I'm SSLEngine2".getBytes()); - - System.out.println("AppOut1 = " + appOut1); - System.out.println("AppOut2 = " + appOut2); - System.out.println(); - } - - private static void runDelegatedTasks(SSLEngineResult result, - SSLEngine engine) throws Exception { - - if (result.getHandshakeStatus().equals(HandshakeStatus.NEED_TASK)) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - System.out.println("running delegated task..."); - runnable.run(); - } - } - } - - private static boolean isEngineClosed(SSLEngine engine) { - return (engine.isOutboundDone() && engine.isInboundDone()); - } - -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/EngineEnforceUseClientMode.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2004, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -28,7 +28,7 @@ /* * @test - * @bug 4980882 + * @bug 4980882 8207250 * @summary SSLEngine should enforce setUseClientMode * @run main/othervm EngineEnforceUseClientMode * @author Brad R. Wetmore @@ -107,10 +107,9 @@ "wrap(): Didn't catch the exception properly"); } catch (IllegalStateException e) { System.out.println("Caught the correct exception."); - ssle3.wrap(appOut1, oneToTwo); oneToTwo.flip(); if (oneToTwo.hasRemaining()) { - throw new Exception("wrap1 generated data"); + throw new Exception("wrap generated data"); } oneToTwo.clear(); } @@ -122,12 +121,11 @@ "unwrap(): Didn't catch the exception properly"); } catch (IllegalStateException e) { System.out.println("Caught the correct exception."); - ssle4.wrap(appOut1, oneToTwo); - oneToTwo.flip(); - if (oneToTwo.hasRemaining()) { - throw new Exception("wrap2 generated data"); + appIn1.flip(); + if (appIn1.hasRemaining()) { + throw new Exception("unwrap generated data"); } - oneToTwo.clear(); + appIn1.clear(); } try { @@ -137,12 +135,6 @@ "unwrap(): Didn't catch the exception properly"); } catch (IllegalStateException e) { System.out.println("Caught the correct exception."); - ssle5.wrap(appOut1, oneToTwo); - oneToTwo.flip(); - if (oneToTwo.hasRemaining()) { - throw new Exception("wrap3 generated data"); - } - oneToTwo.clear(); } boolean dataDone = false; @@ -198,14 +190,18 @@ checkTransfer(appOut1, appIn2); checkTransfer(appOut2, appIn1); + // Should not be able to set mode now, no matter if + // it is the same of different. System.out.println("Try changing modes..."); - try { - ssle2.setUseClientMode(false); - throw new RuntimeException( - "setUseClientMode(): " + - "Didn't catch the exception properly"); - } catch (IllegalArgumentException e) { - System.out.println("Caught the correct exception."); + for (boolean b : new Boolean[] {true, false}) { + try { + ssle2.setUseClientMode(b); + throw new RuntimeException( + "setUseClientMode(" + b + "): " + + "Didn't catch the exception properly"); + } catch (IllegalArgumentException e) { + System.out.println("Caught the correct exception."); + } } return; @@ -311,8 +307,10 @@ log("Data transferred cleanly"); } - a.clear(); - b.clear(); + a.position(a.limit()); + b.position(b.limit()); + a.limit(a.capacity()); + b.limit(b.capacity()); } private static void log(String str) { diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/RehandshakeFinished.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/RehandshakeFinished.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/RehandshakeFinished.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/RehandshakeFinished.java 2018-07-25 15:36:46.000000000 +0000 @@ -160,7 +160,7 @@ TrustManagerFactory.getInstance("SunX509"); tmf.init(ts); - SSLContext sslCtx = SSLContext.getInstance("TLS"); + SSLContext sslCtx = SSLContext.getInstance("TLSv1.2"); sslCtx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); sslc = sslCtx; } catch (Exception e) { diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/SSLEngineKeyLimit.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,482 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8164879 + * @library /lib/testlibrary ../../ + * @summary Verify AES/GCM's limits set in the jdk.tls.keyLimits property + * start a new handshake sequence to renegotiate the symmetric key with an + * SSLSocket connection. This test verifies the handshake method was called + * via debugging info. It does not verify the renegotiation was successful + * as that is very hard. + * + * @run main SSLEngineKeyLimit 0 server AES/GCM/NoPadding keyupdate 1050000 + * @run main SSLEngineKeyLimit 1 client AES/GCM/NoPadding keyupdate 2^22 + */ + +/* + * This test runs in another process so we can monitor the debug + * results. The OutputAnalyzer must see correct debug output to return a + * success. + */ + +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLEngineResult; +import javax.net.ssl.TrustManagerFactory; +import java.io.File; +import java.io.PrintWriter; +import java.nio.ByteBuffer; +import java.security.KeyStore; +import java.security.SecureRandom; +import java.util.Arrays; + +import jdk.testlibrary.ProcessTools; +import jdk.testlibrary.Utils; +import jdk.testlibrary.OutputAnalyzer; + +public class SSLEngineKeyLimit { + + SSLEngine eng; + static ByteBuffer cTos; + static ByteBuffer sToc; + static ByteBuffer outdata; + ByteBuffer buf; + static boolean ready = false; + + static String pathToStores = "../../../../javax/net/ssl/etc/"; + static String keyStoreFile = "keystore"; + static String passwd = "passphrase"; + static String keyFilename; + static int dataLen = 10240; + static boolean serverwrite = true; + int totalDataLen = 0; + static boolean sc = true; + int delay = 1; + static boolean readdone = false; + + // Turn on debugging + static boolean debug = false; + + SSLEngineKeyLimit() { + buf = ByteBuffer.allocate(dataLen*4); + } + + /** + * args should have two values: server|client, + * Prepending 'p' is for internal use only. + */ + public static void main(String args[]) throws Exception { + + for (int i = 0; i < args.length; i++) { + System.out.print(" " + args[i]); + } + System.out.println(); + if (args[0].compareTo("p") != 0) { + boolean expectedFail = (Integer.parseInt(args[0]) == 1); + if (expectedFail) { + System.out.println("Test expected to not find updated msg"); + } + + // Write security property file to overwrite default + File f = new File("keyusage."+ System.nanoTime()); + PrintWriter p = new PrintWriter(f); + p.write("jdk.tls.keyLimits="); + for (int i = 2; i < args.length; i++) { + p.write(" "+ args[i]); + } + p.close(); + + System.setProperty("test.java.opts", + "-Dtest.src=" + System.getProperty("test.src") + + " -Dtest.jdk=" + System.getProperty("test.jdk") + + " -Djavax.net.debug=ssl,handshake" + + " -Djava.security.properties=" + f.getName()); + + System.out.println("test.java.opts: " + + System.getProperty("test.java.opts")); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, + Utils.addTestJavaOpts("SSLEngineKeyLimit", "p", args[1])); + + OutputAnalyzer output = ProcessTools.executeProcess(pb); + try { + if (expectedFail) { + output.shouldNotContain("KeyUpdate: write key updated"); + output.shouldNotContain("KeyUpdate: read key updated"); + } else { + output.shouldContain("KeyUpdate: triggered, read side"); + output.shouldContain("KeyUpdate: triggered, write side"); + output.shouldContain("KeyUpdate: write key updated"); + output.shouldContain("KeyUpdate: read key updated"); + } + } catch (Exception e) { + throw e; + } finally { + System.out.println("-- BEGIN Stdout:"); + System.out.println(output.getStdout()); + System.out.println("-- END Stdout"); + System.out.println("-- BEGIN Stderr:"); + System.out.println(output.getStderr()); + System.out.println("-- END Stderr"); + } + return; + } + + if (args[0].compareTo("p") != 0) { + throw new Exception ("Tried to run outside of a spawned process"); + } + + if (args[1].compareTo("client") == 0) { + serverwrite = false; + } + + cTos = ByteBuffer.allocateDirect(dataLen*4); + keyFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + keyStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + + sToc = ByteBuffer.allocateDirect(dataLen*4); + outdata = ByteBuffer.allocateDirect(dataLen); + + byte[] data = new byte[dataLen]; + Arrays.fill(data, (byte)0x0A); + outdata.put(data); + outdata.flip(); + cTos.clear(); + sToc.clear(); + + Thread ts = new Thread(serverwrite ? new Client() : new Server()); + ts.start(); + (serverwrite ? new Server() : new Client()).run(); + ts.interrupt(); + ts.join(); + } + + private static void doTask(SSLEngineResult result, + SSLEngine engine) throws Exception { + + if (result.getHandshakeStatus() == + SSLEngineResult.HandshakeStatus.NEED_TASK) { + Runnable runnable; + while ((runnable = engine.getDelegatedTask()) != null) { + print("\trunning delegated task..."); + runnable.run(); + } + SSLEngineResult.HandshakeStatus hsStatus = + engine.getHandshakeStatus(); + if (hsStatus == SSLEngineResult.HandshakeStatus.NEED_TASK) { + throw new Exception( + "handshake shouldn't need additional tasks"); + } + print("\tnew HandshakeStatus: " + hsStatus); + } + } + + static void print(String s) { + if (debug) { + System.out.println(s); + } + } + + static void log(String s, SSLEngineResult r) { + if (!debug) { + return; + } + System.out.println(s + ": " + + r.getStatus() + "/" + r.getHandshakeStatus()+ " " + + r.bytesConsumed() + "/" + r.bytesProduced() + " "); + + } + + void write() throws Exception { + int i = 0; + SSLEngineResult r; + boolean again = true; + + while (!ready) { + Thread.sleep(delay); + } + print("Write-side. "); + + while (i++ < 150) { + while (sc) { + if (readdone) { + return; + } + Thread.sleep(delay); + } + + outdata.rewind(); + print("write wrap"); + + while (true) { + r = eng.wrap(outdata, getWriteBuf()); + log("write wrap", r); + if (debug && r.getStatus() != SSLEngineResult.Status.OK) { + print("outdata pos: " + outdata.position() + + " rem: " + outdata.remaining() + + " lim: " + outdata.limit() + + " cap: " + outdata.capacity()); + print("writebuf pos: " + getWriteBuf().position() + + " rem: " + getWriteBuf().remaining() + + " lim: " + getWriteBuf().limit() + + " cap: " + getWriteBuf().capacity()); + } + if (again && r.getStatus() == SSLEngineResult.Status.OK && + r.getHandshakeStatus() == + SSLEngineResult.HandshakeStatus.NEED_WRAP) { + print("again"); + again = false; + continue; + } + break; + } + doTask(r, eng); + getWriteBuf().flip(); + sc = true; + while (sc) { + if (readdone) { + return; + } + Thread.sleep(delay); + } + + while (true) { + buf.clear(); + r = eng.unwrap(getReadBuf(), buf); + log("write unwrap", r); + if (debug && r.getStatus() != SSLEngineResult.Status.OK) { + print("buf pos: " + buf.position() + + " rem: " + buf.remaining() + + " lim: " + buf.limit() + + " cap: " + buf.capacity()); + print("readbuf pos: " + getReadBuf().position() + + " rem: " + getReadBuf().remaining() + + " lim: " + getReadBuf().limit() + + " cap:" + getReadBuf().capacity()); + } + break; + } + doTask(r, eng); + getReadBuf().compact(); + print("compacted readbuf pos: " + getReadBuf().position() + + " rem: " + getReadBuf().remaining() + + " lim: " + getReadBuf().limit() + + " cap: " + getReadBuf().capacity()); + sc = true; + } + } + + void read() throws Exception { + byte b = 0x0B; + ByteBuffer buf2 = ByteBuffer.allocateDirect(dataLen); + SSLEngineResult r = null; + boolean exit, again = true; + + while (eng == null) { + Thread.sleep(delay); + } + + try { + System.out.println("connected"); + print("entering read loop"); + ready = true; + while (true) { + + while (!sc) { + Thread.sleep(delay); + } + + print("read wrap"); + exit = false; + while (!exit) { + buf2.put(b); + buf2.flip(); + r = eng.wrap(buf2, getWriteBuf()); + log("read wrap", r); + if (debug) { + // && r.getStatus() != SSLEngineResult.Status.OK) { + print("buf2 pos: " + buf2.position() + + " rem: " + buf2.remaining() + + " cap: " + buf2.capacity()); + print("writebuf pos: " + getWriteBuf().position() + + " rem: " + getWriteBuf().remaining() + + " cap: " + getWriteBuf().capacity()); + } + if (again && r.getStatus() == SSLEngineResult.Status.OK && + r.getHandshakeStatus() == + SSLEngineResult.HandshakeStatus.NEED_WRAP) { + buf2.compact(); + again = false; + continue; + } + exit = true; + } + doTask(r, eng); + buf2.clear(); + getWriteBuf().flip(); + + sc = false; + + while (!sc) { + Thread.sleep(delay); + } + + while (true) { + buf.clear(); + r = eng.unwrap(getReadBuf(), buf); + log("read unwrap", r); + if (debug && + r.getStatus() != SSLEngineResult.Status.OK) { + print("buf pos " + buf.position() + + " rem: " + buf.remaining() + + " lim: " + buf.limit() + + " cap: " + buf.capacity()); + print("readbuf pos: " + getReadBuf().position() + + " rem: " + getReadBuf().remaining() + + " lim: " + getReadBuf().limit() + + " cap: " + getReadBuf().capacity()); + doTask(r, eng); + } + + if (again && r.getStatus() == SSLEngineResult.Status.OK && + r.getHandshakeStatus() == + SSLEngineResult.HandshakeStatus.NEED_UNWRAP) { + buf.clear(); + print("again"); + again = false; + continue; + + } + break; + } + buf.clear(); + getReadBuf().compact(); + + totalDataLen += r.bytesProduced(); + sc = false; + } + } catch (Exception e) { + sc = false; + readdone = true; + System.out.println(e.getMessage()); + e.printStackTrace(); + System.out.println("Total data read = " + totalDataLen); + } + } + + ByteBuffer getReadBuf() { + return null; + } + + ByteBuffer getWriteBuf() { + return null; + } + + + SSLContext initContext() throws Exception { + SSLContext sc = SSLContext.getInstance("TLSv1.3"); + KeyStore ks = KeyStore.getInstance( + new File(System.getProperty("javax.net.ssl.keyStore")), + passwd.toCharArray()); + KeyManagerFactory kmf = KeyManagerFactory.getInstance( + KeyManagerFactory.getDefaultAlgorithm()); + kmf.init(ks, passwd.toCharArray()); + TrustManagerFactory tmf = TrustManagerFactory.getInstance( + TrustManagerFactory.getDefaultAlgorithm()); + tmf.init(ks); + sc.init(kmf.getKeyManagers(), + tmf.getTrustManagers(), new SecureRandom()); + return sc; + } + + static class Server extends SSLEngineKeyLimit implements Runnable { + Server() throws Exception { + super(); + eng = initContext().createSSLEngine(); + eng.setUseClientMode(false); + eng.setNeedClientAuth(true); + } + + public void run() { + try { + if (serverwrite) { + write(); + } else { + read(); + } + + } catch (Exception e) { + System.out.println("server: " + e.getMessage()); + e.printStackTrace(); + } + System.out.println("Server closed"); + } + + @Override + ByteBuffer getWriteBuf() { + return sToc; + } + @Override + ByteBuffer getReadBuf() { + return cTos; + } + } + + + static class Client extends SSLEngineKeyLimit implements Runnable { + Client() throws Exception { + super(); + eng = initContext().createSSLEngine(); + eng.setUseClientMode(true); + } + + public void run() { + try { + if (!serverwrite) { + write(); + } else { + read(); + } + } catch (Exception e) { + System.out.println("client: " + e.getMessage()); + e.printStackTrace(); + } + System.out.println("Client closed"); + } + @Override + ByteBuffer getWriteBuf() { + return cTos; + } + @Override + ByteBuffer getReadBuf() { + return sToc; + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/TLS13BeginHandshake.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/TLS13BeginHandshake.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLEngineImpl/TLS13BeginHandshake.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLEngineImpl/TLS13BeginHandshake.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,191 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @summary Test SSLEngine.begineHandshake() triggers a KeyUpdate handshake + * in TLSv1.3 + * @run main/othervm TLS13BeginHandshake + */ + +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.SSLEngine; +import javax.net.ssl.SSLEngineResult; +import javax.net.ssl.SSLEngineResult.HandshakeStatus; +import javax.net.ssl.SSLSession; +import javax.net.ssl.TrustManagerFactory; +import java.io.File; +import java.nio.ByteBuffer; +import java.security.KeyStore; +import java.security.SecureRandom; + +public class TLS13BeginHandshake { + static String pathToStores = + System.getProperty("test.src") + "/../../../../javax/net/ssl/etc/"; + static String keyStoreFile = "keystore"; + static String passwd = "passphrase"; + + private SSLEngine serverEngine, clientEngine; + SSLEngineResult clientResult, serverResult; + private ByteBuffer clientOut, clientIn; + private ByteBuffer serverOut, serverIn; + private ByteBuffer cTOs,sTOc; + + public static void main(String args[]) throws Exception{ + new TLS13BeginHandshake().runDemo(); + } + + private void runDemo() throws Exception { + int done = 0; + + createSSLEngines(); + createBuffers(); + + while (!isEngineClosed(clientEngine) || !isEngineClosed(serverEngine)) { + + System.out.println("================"); + clientResult = clientEngine.wrap(clientOut, cTOs); + System.out.println("client wrap: " + clientResult); + runDelegatedTasks(clientResult, clientEngine); + serverResult = serverEngine.wrap(serverOut, sTOc); + System.out.println("server wrap: " + serverResult); + runDelegatedTasks(serverResult, serverEngine); + + cTOs.flip(); + sTOc.flip(); + + System.out.println("----"); + clientResult = clientEngine.unwrap(sTOc, clientIn); + System.out.println("client unwrap: " + clientResult); + if (clientResult.getStatus() == SSLEngineResult.Status.CLOSED) { + break; + } runDelegatedTasks(clientResult, clientEngine); + serverResult = serverEngine.unwrap(cTOs, serverIn); + System.out.println("server unwrap: " + serverResult); + runDelegatedTasks(serverResult, serverEngine); + + cTOs.compact(); + sTOc.compact(); + + //System.err.println("so limit="+serverOut.limit()+" so pos="+serverOut.position()); + //System.out.println("bf ctos limit="+cTOs.limit()+" pos="+cTOs.position()+" cap="+cTOs.capacity()); + //System.out.println("bf stoc limit="+sTOc.limit()+" pos="+sTOc.position()+" cap="+sTOc.capacity()); + if (done < 2 && (clientOut.limit() == serverIn.position()) && + (serverOut.limit() == clientIn.position())) { + + if (done == 0) { + checkTransfer(serverOut, clientIn); + checkTransfer(clientOut, serverIn); + clientEngine.beginHandshake(); + done++; + continue; + } + + checkTransfer(serverOut, clientIn); + checkTransfer(clientOut, serverIn); + System.out.println("\tClosing..."); + clientEngine.closeOutbound(); + done++; + continue; + } + } + + } + + private static boolean isEngineClosed(SSLEngine engine) { + if (engine.isInboundDone()) + System.out.println("inbound closed"); + if (engine.isOutboundDone()) + System.out.println("outbound closed"); + return (engine.isOutboundDone() && engine.isInboundDone()); + } + + private static void checkTransfer(ByteBuffer a, ByteBuffer b) + throws Exception { + a.flip(); + b.flip(); + + if (!a.equals(b)) { + throw new Exception("Data didn't transfer cleanly"); + } else { + System.out.println("\tData transferred cleanly"); + } + + a.compact(); + b.compact(); + + } + private void createBuffers() { + SSLSession session = clientEngine.getSession(); + int appBufferMax = session.getApplicationBufferSize(); + int netBufferMax = session.getPacketBufferSize(); + + clientIn = ByteBuffer.allocate(appBufferMax + 50); + serverIn = ByteBuffer.allocate(appBufferMax + 50); + + cTOs = ByteBuffer.allocateDirect(netBufferMax); + sTOc = ByteBuffer.allocateDirect(netBufferMax); + + clientOut = ByteBuffer.wrap("client".getBytes()); + serverOut = ByteBuffer.wrap("server".getBytes()); + } + + private void createSSLEngines() throws Exception { + serverEngine = initContext().createSSLEngine(); + serverEngine.setUseClientMode(false); + serverEngine.setNeedClientAuth(true); + + clientEngine = initContext().createSSLEngine("client", 80); + clientEngine.setUseClientMode(true); + } + + private SSLContext initContext() throws Exception { + SSLContext sc = SSLContext.getInstance("TLSv1.3"); + KeyStore ks = KeyStore.getInstance(new File(pathToStores + keyStoreFile), + passwd.toCharArray()); + KeyManagerFactory kmf = + KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + kmf.init(ks, passwd.toCharArray()); + TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + tmf.init(ks); + sc.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom()); + return sc; + } + + private static void runDelegatedTasks(SSLEngineResult result, + SSLEngine engine) throws Exception { + + if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { + Runnable runnable; + while ((runnable = engine.getDelegatedTask()) != null) { + runnable.run(); + } + HandshakeStatus hsStatus = engine.getHandshakeStatus(); + if (hsStatus == HandshakeStatus.NEED_TASK) { + throw new Exception( + "handshake shouldn't need additional tasks"); + } + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksClient.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,269 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8206929 + * @summary ensure that client only resumes a session if certain properties + * of the session are compatible with the new connection + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 ResumeChecksClient BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksClient BASIC + * @run main/othervm ResumeChecksClient BASIC + * @run main/othervm ResumeChecksClient VERSION_2_TO_3 + * @run main/othervm ResumeChecksClient VERSION_3_TO_2 + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksClient CIPHER_SUITE + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksClient SIGNATURE_SCHEME + * + */ + +import javax.net.*; +import javax.net.ssl.*; +import java.io.*; +import java.security.*; +import java.net.*; +import java.util.*; + +public class ResumeChecksClient { + + static String pathToStores = "../../../../javax/net/ssl/etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + enum TestMode { + BASIC, + VERSION_2_TO_3, + VERSION_3_TO_2, + CIPHER_SUITE, + SIGNATURE_SCHEME + } + + public static void main(String[] args) throws Exception { + + TestMode mode = TestMode.valueOf(args[0]); + + String keyFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + Server server = startServer(); + server.signal(); + SSLContext sslContext = SSLContext.getDefault(); + while (!server.started) { + Thread.yield(); + } + connect(sslContext, server.port, mode, false); + + server.signal(); + long secondStartTime = System.currentTimeMillis(); + Thread.sleep(10); + SSLSession secondSession = connect(sslContext, server.port, mode, true); + + server.go = false; + server.signal(); + + switch (mode) { + case BASIC: + // fail if session is not resumed + if (secondSession.getCreationTime() > secondStartTime) { + throw new RuntimeException("Session was not reused"); + } + break; + case VERSION_2_TO_3: + case VERSION_3_TO_2: + case CIPHER_SUITE: + case SIGNATURE_SCHEME: + // fail if a new session is not created + if (secondSession.getCreationTime() <= secondStartTime) { + throw new RuntimeException("Existing session was used"); + } + break; + default: + throw new RuntimeException("unknown mode: " + mode); + } + } + + private static class NoSig implements AlgorithmConstraints { + + private final String alg; + + NoSig(String alg) { + this.alg = alg; + } + + + private boolean test(String a) { + return !a.toLowerCase().contains(alg.toLowerCase()); + } + + public boolean permits(Set primitives, Key key) { + return true; + } + public boolean permits(Set primitives, + String algorithm, AlgorithmParameters parameters) { + + return test(algorithm); + } + public boolean permits(Set primitives, + String algorithm, Key key, AlgorithmParameters parameters) { + + return test(algorithm); + } + } + + private static SSLSession connect(SSLContext sslContext, int port, + TestMode mode, boolean second) { + + try { + SSLSocket sock = (SSLSocket) + sslContext.getSocketFactory().createSocket(); + SSLParameters params = sock.getSSLParameters(); + + switch (mode) { + case BASIC: + // do nothing to ensure resumption works + break; + case VERSION_2_TO_3: + if (second) { + params.setProtocols(new String[] {"TLSv1.3"}); + } else { + params.setProtocols(new String[] {"TLSv1.2"}); + } + break; + case VERSION_3_TO_2: + if (second) { + params.setProtocols(new String[] {"TLSv1.2"}); + } else { + params.setProtocols(new String[] {"TLSv1.3"}); + } + break; + case CIPHER_SUITE: + if (second) { + params.setCipherSuites( + new String[] {"TLS_AES_256_GCM_SHA384"}); + } else { + params.setCipherSuites( + new String[] {"TLS_AES_128_GCM_SHA256"}); + } + break; + case SIGNATURE_SCHEME: + AlgorithmConstraints constraints = + params.getAlgorithmConstraints(); + if (second) { + params.setAlgorithmConstraints(new NoSig("ecdsa")); + } else { + params.setAlgorithmConstraints(new NoSig("rsa")); + } + break; + default: + throw new RuntimeException("unknown mode: " + mode); + } + sock.setSSLParameters(params); + sock.connect(new InetSocketAddress("localhost", port)); + PrintWriter out = new PrintWriter( + new OutputStreamWriter(sock.getOutputStream())); + out.println("message"); + out.flush(); + BufferedReader reader = new BufferedReader( + new InputStreamReader(sock.getInputStream())); + String inMsg = reader.readLine(); + System.out.println("Client received: " + inMsg); + SSLSession result = sock.getSession(); + sock.close(); + return result; + } catch (Exception ex) { + // unexpected exception + throw new RuntimeException(ex); + } + } + + private static Server startServer() { + Server server = new Server(); + new Thread(server).start(); + return server; + } + + private static class Server implements Runnable { + + public volatile boolean go = true; + private boolean signal = false; + public volatile int port = 0; + public volatile boolean started = false; + + private synchronized void waitForSignal() { + while (!signal) { + try { + wait(); + } catch (InterruptedException ex) { + // do nothing + } + } + signal = false; + } + public synchronized void signal() { + signal = true; + notify(); + } + + public void run() { + try { + + SSLContext sc = SSLContext.getDefault(); + ServerSocketFactory fac = sc.getServerSocketFactory(); + SSLServerSocket ssock = (SSLServerSocket) + fac.createServerSocket(0); + this.port = ssock.getLocalPort(); + + waitForSignal(); + started = true; + while (go) { + try { + System.out.println("Waiting for connection"); + Socket sock = ssock.accept(); + BufferedReader reader = new BufferedReader( + new InputStreamReader(sock.getInputStream())); + String line = reader.readLine(); + System.out.println("server read: " + line); + PrintWriter out = new PrintWriter( + new OutputStreamWriter(sock.getOutputStream())); + out.println(line); + out.flush(); + waitForSignal(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLSessionImpl/ResumeChecksServer.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,307 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8206929 + * @summary ensure that server only resumes a session if certain properties + * of the session are compatible with the new connection + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 ResumeChecksServer BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer BASIC + * @run main/othervm ResumeChecksServer BASIC + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.2 ResumeChecksServer CLIENT_AUTH + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer CLIENT_AUTH + * @run main/othervm ResumeChecksServer CLIENT_AUTH + * @run main/othervm ResumeChecksServer VERSION_2_TO_3 + * @run main/othervm ResumeChecksServer VERSION_3_TO_2 + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer CIPHER_SUITE + * @run main/othervm -Djdk.tls.client.protocols=TLSv1.3 ResumeChecksServer SIGNATURE_SCHEME + * + */ + +import javax.net.*; +import javax.net.ssl.*; +import java.io.*; +import java.security.*; +import java.net.*; +import java.util.*; + +public class ResumeChecksServer { + + static String pathToStores = "../../../../javax/net/ssl/etc"; + static String keyStoreFile = "keystore"; + static String trustStoreFile = "truststore"; + static String passwd = "passphrase"; + + enum TestMode { + BASIC, + CLIENT_AUTH, + VERSION_2_TO_3, + VERSION_3_TO_2, + CIPHER_SUITE, + SIGNATURE_SCHEME + } + + public static void main(String[] args) throws Exception { + + TestMode mode = TestMode.valueOf(args[0]); + + String keyFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + keyStoreFile; + String trustFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + trustStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + System.setProperty("javax.net.ssl.trustStore", trustFilename); + System.setProperty("javax.net.ssl.trustStorePassword", passwd); + + SSLSession secondSession = null; + + SSLContext sslContext = SSLContext.getDefault(); + ServerSocketFactory fac = sslContext.getServerSocketFactory(); + SSLServerSocket ssock = (SSLServerSocket) + fac.createServerSocket(0); + + Client client = startClient(ssock.getLocalPort()); + + try { + connect(client, ssock, mode, false); + } catch (Exception ex) { + throw new RuntimeException(ex); + } + + long secondStartTime = System.currentTimeMillis(); + Thread.sleep(10); + try { + secondSession = connect(client, ssock, mode, true); + } catch (SSLHandshakeException ex) { + // this is expected + } catch (Exception ex) { + throw new RuntimeException(ex); + } + + client.go = false; + client.signal(); + + switch (mode) { + case BASIC: + // fail if session is not resumed + if (secondSession.getCreationTime() > secondStartTime) { + throw new RuntimeException("Session was not reused"); + } + break; + case CLIENT_AUTH: + // throws an exception if the client is not authenticated + secondSession.getPeerCertificates(); + break; + case VERSION_2_TO_3: + case VERSION_3_TO_2: + case CIPHER_SUITE: + case SIGNATURE_SCHEME: + // fail if a new session is not created + if (secondSession.getCreationTime() <= secondStartTime) { + throw new RuntimeException("Existing session was used"); + } + break; + default: + throw new RuntimeException("unknown mode: " + mode); + } + } + + private static class NoSig implements AlgorithmConstraints { + + private final String alg; + + NoSig(String alg) { + this.alg = alg; + } + + + private boolean test(String a) { + return !a.toLowerCase().contains(alg.toLowerCase()); + } + + public boolean permits(Set primitives, Key key) { + return true; + } + public boolean permits(Set primitives, + String algorithm, AlgorithmParameters parameters) { + + return test(algorithm); + } + public boolean permits(Set primitives, + String algorithm, Key key, AlgorithmParameters parameters) { + + return test(algorithm); + } + } + + private static SSLSession connect(Client client, SSLServerSocket ssock, + TestMode mode, boolean second) throws Exception { + + try { + client.signal(); + System.out.println("Waiting for connection"); + SSLSocket sock = (SSLSocket) ssock.accept(); + SSLParameters params = sock.getSSLParameters(); + + switch (mode) { + case BASIC: + // do nothing to ensure resumption works + break; + case CLIENT_AUTH: + if (second) { + params.setNeedClientAuth(true); + } else { + params.setNeedClientAuth(false); + } + break; + case VERSION_2_TO_3: + if (second) { + params.setProtocols(new String[] {"TLSv1.3"}); + } else { + params.setProtocols(new String[] {"TLSv1.2"}); + } + break; + case VERSION_3_TO_2: + if (second) { + params.setProtocols(new String[] {"TLSv1.2"}); + } else { + params.setProtocols(new String[] {"TLSv1.3"}); + } + break; + case CIPHER_SUITE: + if (second) { + params.setCipherSuites( + new String[] {"TLS_AES_128_GCM_SHA256"}); + } else { + params.setCipherSuites( + new String[] {"TLS_AES_256_GCM_SHA384"}); + } + break; + case SIGNATURE_SCHEME: + params.setNeedClientAuth(true); + AlgorithmConstraints constraints = + params.getAlgorithmConstraints(); + if (second) { + params.setAlgorithmConstraints(new NoSig("ecdsa")); + } else { + params.setAlgorithmConstraints(new NoSig("rsa")); + } + break; + default: + throw new RuntimeException("unknown mode: " + mode); + } + sock.setSSLParameters(params); + BufferedReader reader = new BufferedReader( + new InputStreamReader(sock.getInputStream())); + String line = reader.readLine(); + System.out.println("server read: " + line); + PrintWriter out = new PrintWriter( + new OutputStreamWriter(sock.getOutputStream())); + out.println(line); + out.flush(); + out.close(); + SSLSession result = sock.getSession(); + sock.close(); + return result; + } catch (SSLHandshakeException ex) { + if (!second) { + throw ex; + } + } + return null; + } + + private static Client startClient(int port) { + Client client = new Client(port); + new Thread(client).start(); + return client; + } + + private static class Client implements Runnable { + + public volatile boolean go = true; + private boolean signal = false; + private final int port; + + Client(int port) { + this.port = port; + } + + private synchronized void waitForSignal() { + while (!signal) { + try { + wait(); + } catch (InterruptedException ex) { + // do nothing + } + } + signal = false; + + try { + Thread.sleep(1000); + } catch (InterruptedException ex) { + // do nothing + } + } + public synchronized void signal() { + signal = true; + notify(); + } + + public void run() { + try { + + SSLContext sc = SSLContext.getDefault(); + + waitForSignal(); + while (go) { + try { + SSLSocket sock = (SSLSocket) + sc.getSocketFactory().createSocket(); + sock.connect(new InetSocketAddress("localhost", port)); + PrintWriter out = new PrintWriter( + new OutputStreamWriter(sock.getOutputStream())); + out.println("message"); + out.flush(); + BufferedReader reader = new BufferedReader( + new InputStreamReader(sock.getInputStream())); + String inMsg = reader.readLine(); + System.out.println("Client received: " + inMsg); + out.close(); + sock.close(); + waitForSignal(); + } catch (Exception ex) { + ex.printStackTrace(); + } + } + } catch (Exception ex) { + throw new RuntimeException(ex); + } + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/SSLSocketImpl/AsyncSSLSocketClose.java openjdk-11-11~24/test/jdk/sun/security/ssl/SSLSocketImpl/AsyncSSLSocketClose.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/SSLSocketImpl/AsyncSSLSocketClose.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/SSLSocketImpl/AsyncSSLSocketClose.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2007, 2013, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2007, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -25,10 +25,6 @@ // SunJSSE does not support dynamic system properties, no way to re-use // system properties in samevm/agentvm mode. // -// The test may timeout occasionally on heavy loaded system because -// there are lot of TLS transactions involved. Frequent timeout(s) should -// be analyzed further. -// /* * @test @@ -40,19 +36,23 @@ import javax.net.ssl.*; import java.io.*; +import java.util.concurrent.CountDownLatch; +import java.util.concurrent.TimeUnit; -public class AsyncSSLSocketClose implements Runnable -{ +public class AsyncSSLSocketClose implements Runnable { SSLSocket socket; SSLServerSocket ss; + // Is the socket ready to close? + private final CountDownLatch closeCondition = new CountDownLatch(1); + // Where do we find the keystores? static String pathToStores = "../../../../javax/net/ssl/etc"; static String keyStoreFile = "keystore"; static String trustStoreFile = "truststore"; static String passwd = "passphrase"; - public static void main(String[] args) { + public static void main(String[] args) throws Exception { String keyFilename = System.getProperty("test.src", "./") + "/" + pathToStores + "/" + keyStoreFile; @@ -68,58 +68,68 @@ new AsyncSSLSocketClose(); } - public AsyncSSLSocketClose() { - try { - SSLServerSocketFactory sslssf = + public AsyncSSLSocketClose() throws Exception { + SSLServerSocketFactory sslssf = (SSLServerSocketFactory)SSLServerSocketFactory.getDefault(); - ss = (SSLServerSocket) sslssf.createServerSocket(0); - - SSLSocketFactory sslsf = - (SSLSocketFactory)SSLSocketFactory.getDefault(); - socket = (SSLSocket)sslsf.createSocket("localhost", - ss.getLocalPort()); - SSLSocket serverSoc = (SSLSocket) ss.accept(); - ss.close(); - - (new Thread(this)).start(); - serverSoc.startHandshake(); - - try { - Thread.sleep(5000); - } catch (Exception e) { - e.printStackTrace(); - } - - socket.setSoLinger(true, 10); - System.out.println("Calling Socket.close"); - socket.close(); - System.out.println("ssl socket get closed"); - System.out.flush(); + ss = (SSLServerSocket) sslssf.createServerSocket(0); - } catch (IOException e) { - e.printStackTrace(); + SSLSocketFactory sslsf = + (SSLSocketFactory)SSLSocketFactory.getDefault(); + socket = (SSLSocket)sslsf.createSocket("localhost", ss.getLocalPort()); + SSLSocket serverSoc = (SSLSocket)ss.accept(); + ss.close(); + + (new Thread(this)).start(); + serverSoc.startHandshake(); + + boolean closeIsReady = closeCondition.await(90L, TimeUnit.SECONDS); + if (!closeIsReady) { + System.out.println( + "Ignore, the closure is not ready yet in 90 seconds."); + return; } + socket.setSoLinger(true, 10); + System.out.println("Calling Socket.close"); + socket.close(); + System.out.println("ssl socket get closed"); + System.out.flush(); } // block in write public void run() { - try { - byte[] ba = new byte[1024]; - for (int i=0; i + * Prepending 'p' is for internal use only. + */ + public static void main(String args[]) throws Exception { + if (args[0].compareTo("p") != 0) { + + boolean expectedFail = (Integer.parseInt(args[0]) == 1); + if (expectedFail) { + System.out.println("Test expected to not find updated msg"); + } + //Write security property file to overwrite default + File f = new File("keyusage."+ System.nanoTime()); + PrintWriter p = new PrintWriter(f); + p.write("jdk.tls.keyLimits="); + for (int i = 2; i < args.length; i++) { + p.write(" "+ args[i]); + } + p.close(); + System.out.println("Keyusage path = " + f.getAbsolutePath()); + System.setProperty("test.java.opts", + "-Dtest.src=" + System.getProperty("test.src") + + " -Dtest.jdk=" + System.getProperty("test.jdk") + + " -Djavax.net.debug=ssl,handshake " + + " -Djava.security.properties=" + f.getName()); + + System.out.println("test.java.opts: " + + System.getProperty("test.java.opts")); + + ProcessBuilder pb = ProcessTools.createJavaProcessBuilder(true, + Utils.addTestJavaOpts("SSLSocketKeyLimit", "p", args[1])); + + OutputAnalyzer output = ProcessTools.executeProcess(pb); + try { + if (expectedFail) { + output.shouldNotContain("KeyUpdate: write key updated"); + output.shouldNotContain("KeyUpdate: read key updated"); + } else { + output.shouldContain("KeyUpdate: triggered, read side"); + output.shouldContain("KeyUpdate: triggered, write side"); + output.shouldContain("KeyUpdate: write key updated"); + output.shouldContain("KeyUpdate: read key updated"); + } + } catch (Exception e) { + throw e; + } finally { + System.out.println("-- BEGIN Stdout:"); + System.out.println(output.getStdout()); + System.out.println("-- END Stdout"); + System.out.println("-- BEGIN Stderr:"); + System.out.println(output.getStderr()); + System.out.println("-- END Stderr"); + } + return; + } + + if (args.length > 0 && args[0].compareToIgnoreCase("client") == 0) { + serverwrite = false; + } + + String keyFilename = + System.getProperty("test.src", "./") + "/" + pathToStores + + "/" + keyStoreFile; + + System.setProperty("javax.net.ssl.keyStore", keyFilename); + System.setProperty("javax.net.ssl.keyStorePassword", passwd); + + Arrays.fill(data, (byte)0x0A); + Thread ts = new Thread(new Server()); + + ts.start(); + while (!serverReady) { + Thread.sleep(100); + } + new Client().run(); + ts.join(10000); // 10sec + System.exit(0); + } + + void write(SSLSocket s) throws Exception { + int i = 0; + in = s.getInputStream(); + out = s.getOutputStream(); + while (i++ < 150) { + out.write(data, 0, dataLen); + System.out.print("W"); + in.readNBytes(1); + System.out.print("R"); + } + out.write(0x0D); + out.flush(); + + // Let read side all the data + while (!done) { + Thread.sleep(100); + } + out.close(); + in.close(); + } + + + void read(SSLSocket s) throws Exception { + byte[] buf = new byte[dataLen]; + int len; + byte i = 0; + try { + System.out.println("Server: connected " + s.getSession().getCipherSuite()); + in = s.getInputStream(); + out = s.getOutputStream(); + while (true) { + len = in.read(buf, 0, dataLen); + System.out.print("r"); + out.write(i++); + System.out.print("w"); + for (byte b: buf) { + if (b == 0x0A || b == 0x0D) { + continue; + } + System.out.println("\nData invalid: " + new HexDumpEncoder().encode(buf)); + break; + } + + if (len > 0 && buf[len-1] == 0x0D) { + System.out.println("got end byte"); + break; + } + totalDataLen += len; + } + } catch (Exception e) { + System.out.println("\n" + e.getMessage()); + e.printStackTrace(); + } finally { + // Tell write side that we are done reading + out.close(); + in.close(); + done = true; + } + System.out.println("\nTotalDataLen = " + totalDataLen); + } + + static class Server extends SSLSocketKeyLimit implements Runnable { + private SSLServerSocketFactory ssf; + private SSLServerSocket ss; + Server() { + super(); + try { + ssf = initContext().getServerSocketFactory(); + ss = (SSLServerSocket) ssf.createServerSocket(serverPort); + serverPort = ss.getLocalPort(); + } catch (Exception e) { + System.out.println("server: " + e.getMessage()); + e.printStackTrace(); + } + } + + public void run() { + try { + serverReady = true; + System.out.println("Server waiting... port: " + serverPort); + socket = (SSLSocket) ss.accept(); + if (serverwrite) { + write(socket); + } else { + read(socket); + } + + socket.close(); + } catch (Exception e) { + System.out.println("server: " + e.getMessage()); + e.printStackTrace(); + } + System.out.println("Server closed"); + } + } + + + static class Client extends SSLSocketKeyLimit implements Runnable { + private SSLSocketFactory sf; + + Client() { + super(); + } + + public void run() { + try { + sf = initContext().getSocketFactory(); + System.out.println("Client: connecting... port: " + serverPort); + socket = (SSLSocket)sf.createSocket("localhost", serverPort); + System.out.println("Client: connected." + socket.getSession().getCipherSuite()); + + // Opposite of what the server does + if (!serverwrite) { + write(socket); + } else { + read(socket); + } + + } catch (Exception e) { + System.err.println("client: " + e.getMessage()); + e.printStackTrace(); + } + } + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java openjdk-11-11~24/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/Stapling/java.base/sun/security/ssl/StatusResponseManagerTests.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,492 @@ +/* + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package sun.security.ssl; + +import java.io.IOException; +import java.math.BigInteger; +import java.security.cert.*; +import java.util.*; +import java.security.KeyPair; +import java.security.KeyPairGenerator; +import java.security.KeyStore; +import java.security.PublicKey; +import java.util.concurrent.TimeUnit; + +import sun.security.testlibrary.SimpleOCSPServer; +import sun.security.testlibrary.CertificateBuilder; + +import static sun.security.ssl.CertStatusExtension.*; + +/* + * Checks that the hash value for a certificate's issuer name is generated + * correctly. Requires any certificate that is not self-signed. + * + * NOTE: this test uses Sun private classes which are subject to change. + */ +public class StatusResponseManagerTests { + + private static final boolean debug = true; + private static final boolean ocspDebug = false; + + // PKI components we will need for this test + static String passwd = "passphrase"; + static String ROOT_ALIAS = "root"; + static String INT_ALIAS = "intermediate"; + static String SSL_ALIAS = "ssl"; + static KeyStore rootKeystore; // Root CA Keystore + static KeyStore intKeystore; // Intermediate CA Keystore + static KeyStore serverKeystore; // SSL Server Keystore + static KeyStore trustStore; // SSL Client trust store + static X509Certificate rootCert; + static X509Certificate intCert; + static X509Certificate sslCert; + static SimpleOCSPServer rootOcsp; // Root CA OCSP Responder + static int rootOcspPort; // Port number for root OCSP + static SimpleOCSPServer intOcsp; // Intermediate CA OCSP Responder + static int intOcspPort; // Port number for intermed. OCSP + + static X509Certificate[] chain; + + public static void main(String[] args) throws Exception { + Map testList = + new LinkedHashMap() {{ + put("Basic OCSP fetch test", testOcspFetch); + put("Clear StatusResponseManager cache", testClearSRM); + put("Basic OCSP_MULTI fetch test", testOcspMultiFetch); + put("Test Cache Expiration", testCacheExpiry); + }}; + + // Create the CAs and OCSP responders + createPKI(); + + // Grab the certificates and make a chain we can reuse for tests + sslCert = (X509Certificate)serverKeystore.getCertificate(SSL_ALIAS); + intCert = (X509Certificate)intKeystore.getCertificate(INT_ALIAS); + rootCert = (X509Certificate)rootKeystore.getCertificate(ROOT_ALIAS); + chain = new X509Certificate[3]; + chain[0] = sslCert; + chain[1] = intCert; + chain[2] = rootCert; + + runTests(testList); + + intOcsp.stop(); + rootOcsp.stop(); + } + + // Test a simple RFC 6066 server-side fetch + public static final TestCase testOcspFetch = new TestCase() { + @Override + public Map.Entry runTest() { + StatusResponseManager srm = new StatusResponseManager(); + Boolean pass = Boolean.FALSE; + String message = null; + CertStatusRequest oReq = OCSPStatusRequest.EMPTY_OCSP; + + try { + // Get OCSP responses for non-root certs in the chain + Map responseMap = srm.get( + CertStatusRequestType.OCSP, oReq, chain, 5000, + TimeUnit.MILLISECONDS); + + // There should be one entry in the returned map and + // one entry in the cache when the operation is complete. + if (responseMap.size() != 1) { + message = "Incorrect number of responses: expected 1, got " + + responseMap.size(); + } else if (!responseMap.containsKey(sslCert)) { + message = "Response map key is incorrect, expected " + + sslCert.getSubjectX500Principal().toString(); + } else if (srm.size() != 1) { + message = "Incorrect number of cache entries: " + + "expected 1, got " + srm.size(); + } else { + pass = Boolean.TRUE; + } + } catch (Exception e) { + e.printStackTrace(System.out); + message = e.getClass().getName(); + } + + return new AbstractMap.SimpleEntry<>(pass, message); + } + }; + + // Test clearing the StatusResponseManager cache. + public static final TestCase testClearSRM = new TestCase() { + @Override + public Map.Entry runTest() { + StatusResponseManager srm = new StatusResponseManager(); + Boolean pass = Boolean.FALSE; + String message = null; + CertStatusRequest oReq = OCSPStatusRequest.EMPTY_OCSP_MULTI; + + try { + // Get OCSP responses for non-root certs in the chain + srm.get(CertStatusRequestType.OCSP_MULTI, oReq, chain, 5000, + TimeUnit.MILLISECONDS); + + // There should be two entries in the returned map and + // two entries in the cache when the operation is complete. + if (srm.size() != 2) { + message = "Incorrect number of responses: expected 2, got " + + srm.size(); + } else { + // Next, clear the SRM, then check the size again + srm.clear(); + if (srm.size() != 0) { + message = "Incorrect number of responses: expected 0," + + " got " + srm.size(); + } else { + pass = Boolean.TRUE; + } + } + } catch (Exception e) { + e.printStackTrace(System.out); + message = e.getClass().getName(); + } + + return new AbstractMap.SimpleEntry<>(pass, message); + } + }; + + // Test a simple RFC 6961 server-side fetch + public static final TestCase testOcspMultiFetch = new TestCase() { + @Override + public Map.Entry runTest() { + StatusResponseManager srm = new StatusResponseManager(); + Boolean pass = Boolean.FALSE; + String message = null; + CertStatusRequest oReq = OCSPStatusRequest.EMPTY_OCSP_MULTI; + + try { + // Get OCSP responses for non-root certs in the chain + Map responseMap = srm.get( + CertStatusRequestType.OCSP_MULTI, oReq, chain, 5000, + TimeUnit.MILLISECONDS); + + // There should be two entries in the returned map and + // two entries in the cache when the operation is complete. + if (responseMap.size() != 2) { + message = "Incorrect number of responses: expected 2, got " + + responseMap.size(); + } else if (!responseMap.containsKey(sslCert) || + !responseMap.containsKey(intCert)) { + message = "Response map keys are incorrect, expected " + + sslCert.getSubjectX500Principal().toString() + + " and " + + intCert.getSubjectX500Principal().toString(); + } else if (srm.size() != 2) { + message = "Incorrect number of cache entries: " + + "expected 2, got " + srm.size(); + } else { + pass = Boolean.TRUE; + } + } catch (Exception e) { + e.printStackTrace(System.out); + message = e.getClass().getName(); + } + + return new AbstractMap.SimpleEntry<>(pass, message); + } + }; + + // Test cache expiration + public static final TestCase testCacheExpiry = new TestCase() { + @Override + public Map.Entry runTest() { + // For this test, we will set the cache expiry to 5 seconds + System.setProperty("jdk.tls.stapling.cacheLifetime", "5"); + StatusResponseManager srm = new StatusResponseManager(); + Boolean pass = Boolean.FALSE; + String message = null; + CertStatusRequest oReq = OCSPStatusRequest.EMPTY_OCSP_MULTI; + + try { + // Get OCSP responses for non-root certs in the chain + srm.get(CertStatusRequestType.OCSP_MULTI, oReq, chain, 5000, + TimeUnit.MILLISECONDS); + + // There should be two entries in the returned map and + // two entries in the cache when the operation is complete. + if (srm.size() != 2) { + message = "Incorrect number of responses: expected 2, got " + + srm.size(); + } else { + // Next, wait for more than 5 seconds so the responses + // in the SRM will expire. + Thread.sleep(7000); + if (srm.size() != 0) { + message = "Incorrect number of responses: expected 0," + + " got " + srm.size(); + } else { + pass = Boolean.TRUE; + } + } + } catch (Exception e) { + e.printStackTrace(System.out); + message = e.getClass().getName(); + } + + // Set the cache lifetime back to the default + System.setProperty("jdk.tls.stapling.cacheLifetime", ""); + return new AbstractMap.SimpleEntry<>(pass, message); + } + }; + + /** + * Creates the PKI components necessary for this test, including + * Root CA, Intermediate CA and SSL server certificates, the keystores + * for each entity, a client trust store, and starts the OCSP responders. + */ + private static void createPKI() throws Exception { + CertificateBuilder cbld = new CertificateBuilder(); + KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); + keyGen.initialize(2048); + KeyStore.Builder keyStoreBuilder = + KeyStore.Builder.newInstance("PKCS12", null, + new KeyStore.PasswordProtection(passwd.toCharArray())); + + // Generate Root, IntCA, EE keys + KeyPair rootCaKP = keyGen.genKeyPair(); + log("Generated Root CA KeyPair"); + KeyPair intCaKP = keyGen.genKeyPair(); + log("Generated Intermediate CA KeyPair"); + KeyPair sslKP = keyGen.genKeyPair(); + log("Generated SSL Cert KeyPair"); + + // Set up the Root CA Cert + cbld.setSubjectName("CN=Root CA Cert, O=SomeCompany"); + cbld.setPublicKey(rootCaKP.getPublic()); + cbld.setSerialNumber(new BigInteger("1")); + // Make a 3 year validity starting from 60 days ago + long start = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(60); + long end = start + TimeUnit.DAYS.toMillis(1085); + cbld.setValidity(new Date(start), new Date(end)); + addCommonExts(cbld, rootCaKP.getPublic(), rootCaKP.getPublic()); + addCommonCAExts(cbld); + // Make our Root CA Cert! + X509Certificate rootCert = cbld.build(null, rootCaKP.getPrivate(), + "SHA256withRSA"); + log("Root CA Created:\n" + certInfo(rootCert)); + + // Now build a keystore and add the keys and cert + rootKeystore = keyStoreBuilder.getKeyStore(); + Certificate[] rootChain = {rootCert}; + rootKeystore.setKeyEntry(ROOT_ALIAS, rootCaKP.getPrivate(), + passwd.toCharArray(), rootChain); + + // Now fire up the OCSP responder + rootOcsp = new SimpleOCSPServer(rootKeystore, passwd, ROOT_ALIAS, null); + rootOcsp.enableLog(ocspDebug); + rootOcsp.setNextUpdateInterval(3600); + rootOcsp.start(); + + // Wait 5 seconds for server ready + for (int i = 0; (i < 100 && !rootOcsp.isServerReady()); i++) { + Thread.sleep(50); + } + if (!rootOcsp.isServerReady()) { + throw new RuntimeException("Server not ready yet"); + } + + rootOcspPort = rootOcsp.getPort(); + String rootRespURI = "http://localhost:" + rootOcspPort; + log("Root OCSP Responder URI is " + rootRespURI); + + // Now that we have the root keystore and OCSP responder we can + // create our intermediate CA. + cbld.reset(); + cbld.setSubjectName("CN=Intermediate CA Cert, O=SomeCompany"); + cbld.setPublicKey(intCaKP.getPublic()); + cbld.setSerialNumber(new BigInteger("100")); + // Make a 2 year validity starting from 30 days ago + start = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30); + end = start + TimeUnit.DAYS.toMillis(730); + cbld.setValidity(new Date(start), new Date(end)); + addCommonExts(cbld, intCaKP.getPublic(), rootCaKP.getPublic()); + addCommonCAExts(cbld); + cbld.addAIAExt(Collections.singletonList(rootRespURI)); + // Make our Intermediate CA Cert! + X509Certificate intCaCert = cbld.build(rootCert, rootCaKP.getPrivate(), + "SHA256withRSA"); + log("Intermediate CA Created:\n" + certInfo(intCaCert)); + + // Provide intermediate CA cert revocation info to the Root CA + // OCSP responder. + Map revInfo = + new HashMap<>(); + revInfo.put(intCaCert.getSerialNumber(), + new SimpleOCSPServer.CertStatusInfo( + SimpleOCSPServer.CertStatus.CERT_STATUS_GOOD)); + rootOcsp.updateStatusDb(revInfo); + + // Now build a keystore and add the keys, chain and root cert as a TA + intKeystore = keyStoreBuilder.getKeyStore(); + Certificate[] intChain = {intCaCert, rootCert}; + intKeystore.setKeyEntry(INT_ALIAS, intCaKP.getPrivate(), + passwd.toCharArray(), intChain); + intKeystore.setCertificateEntry(ROOT_ALIAS, rootCert); + + // Now fire up the Intermediate CA OCSP responder + intOcsp = new SimpleOCSPServer(intKeystore, passwd, + INT_ALIAS, null); + intOcsp.enableLog(ocspDebug); + intOcsp.setNextUpdateInterval(3600); + intOcsp.start(); + + // Wait 5 seconds for server ready + for (int i = 0; (i < 100 && !intOcsp.isServerReady()); i++) { + Thread.sleep(50); + } + if (!intOcsp.isServerReady()) { + throw new RuntimeException("Server not ready yet"); + } + + intOcspPort = intOcsp.getPort(); + String intCaRespURI = "http://localhost:" + intOcspPort; + log("Intermediate CA OCSP Responder URI is " + intCaRespURI); + + // Last but not least, let's make our SSLCert and add it to its own + // Keystore + cbld.reset(); + cbld.setSubjectName("CN=SSLCertificate, O=SomeCompany"); + cbld.setPublicKey(sslKP.getPublic()); + cbld.setSerialNumber(new BigInteger("4096")); + // Make a 1 year validity starting from 7 days ago + start = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(7); + end = start + TimeUnit.DAYS.toMillis(365); + cbld.setValidity(new Date(start), new Date(end)); + + // Add extensions + addCommonExts(cbld, sslKP.getPublic(), intCaKP.getPublic()); + boolean[] kuBits = {true, false, true, false, false, false, + false, false, false}; + cbld.addKeyUsageExt(kuBits); + List ekuOids = new ArrayList<>(); + ekuOids.add("1.3.6.1.5.5.7.3.1"); + ekuOids.add("1.3.6.1.5.5.7.3.2"); + cbld.addExtendedKeyUsageExt(ekuOids); + cbld.addSubjectAltNameDNSExt(Collections.singletonList("localhost")); + cbld.addAIAExt(Collections.singletonList(intCaRespURI)); + // Make our SSL Server Cert! + X509Certificate sslCert = cbld.build(intCaCert, intCaKP.getPrivate(), + "SHA256withRSA"); + log("SSL Certificate Created:\n" + certInfo(sslCert)); + + // Provide SSL server cert revocation info to the Intermeidate CA + // OCSP responder. + revInfo = new HashMap<>(); + revInfo.put(sslCert.getSerialNumber(), + new SimpleOCSPServer.CertStatusInfo( + SimpleOCSPServer.CertStatus.CERT_STATUS_GOOD)); + intOcsp.updateStatusDb(revInfo); + + // Now build a keystore and add the keys, chain and root cert as a TA + serverKeystore = keyStoreBuilder.getKeyStore(); + Certificate[] sslChain = {sslCert, intCaCert, rootCert}; + serverKeystore.setKeyEntry(SSL_ALIAS, sslKP.getPrivate(), + passwd.toCharArray(), sslChain); + serverKeystore.setCertificateEntry(ROOT_ALIAS, rootCert); + + // And finally a Trust Store for the client + trustStore = keyStoreBuilder.getKeyStore(); + trustStore.setCertificateEntry(ROOT_ALIAS, rootCert); + } + + private static void addCommonExts(CertificateBuilder cbld, + PublicKey subjKey, PublicKey authKey) throws IOException { + cbld.addSubjectKeyIdExt(subjKey); + cbld.addAuthorityKeyIdExt(authKey); + } + + private static void addCommonCAExts(CertificateBuilder cbld) + throws IOException { + cbld.addBasicConstraintsExt(true, true, -1); + // Set key usage bits for digitalSignature, keyCertSign and cRLSign + boolean[] kuBitSettings = {true, false, false, false, false, true, + true, false, false}; + cbld.addKeyUsageExt(kuBitSettings); + } + + /** + * Helper routine that dumps only a few cert fields rather than + * the whole toString() output. + * + * @param cert An X509Certificate to be displayed + * + * @return The {@link String} output of the issuer, subject and + * serial number + */ + private static String certInfo(X509Certificate cert) { + StringBuilder sb = new StringBuilder(); + sb.append("Issuer: ").append(cert.getIssuerX500Principal()). + append("\n"); + sb.append("Subject: ").append(cert.getSubjectX500Principal()). + append("\n"); + sb.append("Serial: ").append(cert.getSerialNumber()).append("\n"); + return sb.toString(); + } + + /** + * Log a message on stdout + * + * @param message The message to log + */ + private static void log(String message) { + if (debug) { + System.out.println(message); + } + } + + public static void runTests(Map testList) { + int testNo = 0; + int numberFailed = 0; + Map.Entry result; + + System.out.println("============ Tests ============"); + for (String testName : testList.keySet()) { + System.out.println("Test " + ++testNo + ": " + testName); + result = testList.get(testName).runTest(); + System.out.print("Result: " + (result.getKey() ? "PASS" : "FAIL")); + System.out.println(" " + + (result.getValue() != null ? result.getValue() : "")); + System.out.println("-------------------------------------------"); + if (!result.getKey()) { + numberFailed++; + } + } + + System.out.println("End Results: " + (testList.size() - numberFailed) + + " Passed" + ", " + numberFailed + " Failed."); + if (numberFailed > 0) { + throw new RuntimeException( + "One or more tests failed, see test output for details"); + } + } + + public interface TestCase { + Map.Entry runTest(); + } +} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/Stapling/StatusResponseManager.java openjdk-11-11~24/test/jdk/sun/security/ssl/Stapling/StatusResponseManager.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/Stapling/StatusResponseManager.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/Stapling/StatusResponseManager.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,32 @@ +/* + * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 8046321 + * @library ../../../../java/security/testlibrary + * @build CertificateBuilder SimpleOCSPServer + * @run main/othervm -Djavax.net.debug=ssl:respmgr java.base/sun.security.ssl.StatusResponseManagerTests + * @summary OCSP Stapling for TLS + */ + diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/Stapling/TEST.properties openjdk-11-11~24/test/jdk/sun/security/ssl/Stapling/TEST.properties --- openjdk-11-11~19/test/jdk/sun/security/ssl/Stapling/TEST.properties 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/Stapling/TEST.properties 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,6 @@ +modules = \ + java.base/sun.security.provider.certpath \ + java.base/sun.security.util \ + java.base/sun.security.x509 \ + java.base/sun.security.ssl +bootclasspath.dirs=. diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/BogusStatusRequest.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/BogusStatusRequest.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/BogusStatusRequest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/BogusStatusRequest.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; - -final class BogusStatusRequest implements StatusRequest { - BogusStatusRequest() { } - - @Override - public int length() { return 0; } - - @Override - public void send(HandshakeOutStream s) throws IOException { } - - @Override - public String toString() { - return "BogusStatusRequest"; - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqExtensionTests.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqExtensionTests.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqExtensionTests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqExtensionTests.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,338 +0,0 @@ -/* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.util.*; -import java.nio.ByteBuffer; - -/* - * Checks that the hash value for a certificate's issuer name is generated - * correctly. Requires any certificate that is not self-signed. - * - * NOTE: this test uses Sun private classes which are subject to change. - */ -public class CertStatusReqExtensionTests { - - private static final boolean debug = false; - - // Default status_request extension (type = ocsp, OCSPStatusRequest - // with no responder IDs or extensions - private static final byte[] CSRE_DEF_OSR = {1, 0, 0, 0, 0}; - - // A status_request extension using a user-defined type (0xFF) and - // an underlying no-Responder ID/no-extension OCSPStatusRequest - private static final byte[] CSRE_TYPE_FF = {-1, 0, 0, 0, 0}; - - // A CertStatusReqExtension with 5 ResponderIds and 1 Extension - private static final byte[] CSRE_REQ_RID_EXTS = { - 1, 0, -13, 0, 59, -95, 57, 48, - 55, 49, 16, 48, 14, 6, 3, 85, - 4, 10, 19, 7, 83, 111, 109, 101, - 73, 110, 99, 49, 16, 48, 14, 6, - 3, 85, 4, 11, 19, 7, 83, 111, - 109, 101, 80, 75, 73, 49, 17, 48, - 15, 6, 3, 85, 4, 3, 19, 8, - 83, 111, 109, 101, 79, 67, 83, 80, - 0, 68, -95, 66, 48, 64, 49, 13, - 48, 11, 6, 3, 85, 4, 10, 19, - 4, 79, 104, 77, 121, 49, 14, 48, - 12, 6, 3, 85, 4, 11, 19, 5, - 66, 101, 97, 114, 115, 49, 15, 48, - 13, 6, 3, 85, 4, 11, 19, 6, - 84, 105, 103, 101, 114, 115, 49, 14, - 48, 12, 6, 3, 85, 4, 3, 19, - 5, 76, 105, 111, 110, 115, 0, 58, - -95, 56, 48, 54, 49, 16, 48, 14, - 6, 3, 85, 4, 10, 19, 7, 67, - 111, 109, 112, 97, 110, 121, 49, 13, - 48, 11, 6, 3, 85, 4, 11, 19, - 4, 87, 101, 115, 116, 49, 19, 48, - 17, 6, 3, 85, 4, 3, 19, 10, - 82, 101, 115, 112, 111, 110, 100, 101, - 114, 49, 0, 24, -94, 22, 4, 20, - -67, -36, 114, 121, 92, -79, 116, -1, - 102, -107, 7, -21, 18, -113, 64, 76, - 96, -7, -66, -63, 0, 24, -94, 22, - 4, 20, -51, -69, 107, -82, -39, -87, - 45, 25, 41, 28, -76, -68, -11, -110, - -94, -97, 62, 47, 58, -125, 0, 51, - 48, 49, 48, 47, 6, 9, 43, 6, - 1, 5, 5, 7, 48, 1, 2, 4, - 34, 4, 32, -26, -81, -120, -61, -127, - -79, 0, -39, -54, 49, 3, -51, -57, - -85, 19, -126, 94, -2, 21, 26, 98, - 6, 105, -35, -37, -29, -73, 101, 53, - 44, 15, -19 - }; - - public static void main(String[] args) throws Exception { - Map testList = - new LinkedHashMap() {{ - put("CTOR (default)", testCtorDefault); - put("CTOR (int, StatusRequest)", testCtorStatReqs); - put("CTOR (HandshakeInStream, length, getReqType, getRequest)", - testCtorInStream); - }}; - - TestUtils.runTests(testList); - } - - public static final TestCase testCtorDefault = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - CertStatusReqExtension csreDef = new CertStatusReqExtension(); - HandshakeOutStream hsout = - new HandshakeOutStream(null); - csreDef.send(hsout); - TestUtils.valueCheck(wrapExtData(null), hsout.toByteArray()); - - // The length should be 4 (2 bytes for the type, 2 for the - // encoding of zero-length - if (csreDef.length() != 4) { - throw new RuntimeException("Incorrect length from " + - "default object. Expected 4, got " + - csreDef.length()); - } - - // Since there's no data, there are no status_type or request - // data fields defined. Both should return null in this case - if (csreDef.getType() != null) { - throw new RuntimeException("Default CSRE returned " + - "non-null status_type"); - } else if (csreDef.getRequest() != null) { - throw new RuntimeException("Default CSRE returned " + - "non-null request object"); - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - public static final TestCase testCtorStatReqs = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - HandshakeOutStream hsout = - new HandshakeOutStream(null); - StatusRequest basicStatReq = new OCSPStatusRequest(); - - // Create an extension using a default-style OCSPStatusRequest - // (no responder IDs, no extensions). - CertStatusReqExtension csre1 = new CertStatusReqExtension( - StatusRequestType.OCSP, basicStatReq); - csre1.send(hsout); - TestUtils.valueCheck(wrapExtData(CSRE_DEF_OSR), - hsout.toByteArray()); - hsout.reset(); - - // Create the extension using a StatusRequestType not already - // instantiated as a static StatusRequestType - // (e.g. OCSP/OCSP_MULTI) - CertStatusReqExtension csre2 = - new CertStatusReqExtension(StatusRequestType.get(-1), - basicStatReq); - csre2.send(hsout); - TestUtils.valueCheck(wrapExtData(CSRE_TYPE_FF), - hsout.toByteArray()); - - // Create the extension using a StatusRequest that - // does not match the status_type field - // This should throw an IllegalArgumentException - try { - CertStatusReqExtension csreBadRequest = - new CertStatusReqExtension(StatusRequestType.OCSP, - new BogusStatusRequest()); - throw new RuntimeException("Constructor accepted a " + - "StatusRequest that is inconsistent with " + - "the status_type"); - } catch (IllegalArgumentException iae) { } - - // We don't allow a null value for the StatusRequestType - // parameter in this constructor. - try { - CertStatusReqExtension csreBadRequest = - new CertStatusReqExtension(null, basicStatReq); - throw new RuntimeException("Constructor accepted a " + - "null StatusRequestType"); - } catch (NullPointerException npe) { } - - // We also don't allow a null value for the StatusRequest - // parameter in this constructor. - try { - CertStatusReqExtension csreBadRequest = - new CertStatusReqExtension(StatusRequestType.OCSP, - null); - throw new RuntimeException("Constructor accepted a " + - "null StatusRequest"); - } catch (NullPointerException npe) { } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test the constructor that builds the ob ject using data from - // a HandshakeInStream - // This also tests the length, getReqType and getRequest methods - public static final TestCase testCtorInStream = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - OCSPStatusRequest osr; - - try { - // To simulate the extension coming in a ServerHello, the - // type and length would already be read by HelloExtensions - // and there is no extension data - HandshakeInStream hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(new byte[0])); - CertStatusReqExtension csre = - new CertStatusReqExtension(hsis, hsis.available()); - // Verify length/type/request - if (csre.length() != 4) { - throw new RuntimeException("Invalid length: received " + - csre.length() + ", expected 4"); - } else if (csre.getType() != null) { - throw new RuntimeException("Non-null type from default " + - "extension"); - } else if (csre.getRequest() != null) { - throw new RuntimeException("Non-null request from default " + - "extension"); - } - - // Try the an extension with a default OCSPStatusRequest - hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(CSRE_DEF_OSR)); - csre = new CertStatusReqExtension(hsis, hsis.available()); - if (csre.length() != (CSRE_DEF_OSR.length + 4)) { - throw new RuntimeException("Invalid length: received " + - csre.length() + ", expected " + - CSRE_DEF_OSR.length + 4); - } else if (!csre.getType().equals(StatusRequestType.OCSP)) { - throw new RuntimeException("Unknown status_type: " + - String.format("0x%02X", csre.getType().id)); - } else { - osr = (OCSPStatusRequest)csre.getRequest(); - if (!osr.getResponderIds().isEmpty() || - !osr.getExtensions().isEmpty()) { - throw new RuntimeException("Non-default " + - "OCSPStatusRequest found in extension"); - } - } - - // Try with a non-default extension - hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(CSRE_REQ_RID_EXTS)); - csre = new CertStatusReqExtension(hsis, hsis.available()); - if (csre.length() != (CSRE_REQ_RID_EXTS.length + 4)) { - throw new RuntimeException("Invalid length: received " + - csre.length() + ", expected " + - CSRE_REQ_RID_EXTS.length + 4); - } else if (!(csre.getType().equals(StatusRequestType.OCSP))) { - throw new RuntimeException("Unknown status_type: " + - String.format("0x%02X", csre.getType().id)); - } else { - osr = (OCSPStatusRequest)csre.getRequest(); - if (osr.getResponderIds().size() != 5 || - osr.getExtensions().size() != 1) { - throw new RuntimeException("Incorrect number of " + - "ResponderIds or Extensions found in " + - "OCSPStatusRequest"); - } - } - - // Create a CSRE that asserts status_request and has the - // proper length, but really is a bunch of random junk inside - // In this case, it will create an UnknownStatusRequest to - // handle the unparseable data. - byte[] junkData = new byte[48]; - Random r = new Random(System.currentTimeMillis()); - r.nextBytes(junkData); - junkData[0] = 7; // Ensure it isn't a valid status_type - hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(junkData)); - csre = new CertStatusReqExtension(hsis, hsis.available()); - StatusRequest sr = csre.getRequest(); - if (!(sr instanceof UnknownStatusRequest)) { - throw new RuntimeException("Expected returned status " + - "request to be of type UnknownStatusRequest but " + - "received " + sr.getClass().getName()); - } else if (csre.length() != (junkData.length + 4)) { - throw new RuntimeException("Invalid length: received " + - csre.length() + ", expected " + - junkData.length + 4); - } - - // Set the leading byte to 1 (OCSP type) and run again - // It should pass the argument check and fail trying to parse - // the underlying StatusRequest. - junkData[0] = (byte)StatusRequestType.OCSP.id; - hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(junkData)); - try { - csre = new CertStatusReqExtension(hsis, hsis.available()); - throw new RuntimeException("Expected CTOR exception did " + - "not occur"); - } catch (IOException ioe) { } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Take CSRE extension data and add extension type and length decorations - private static byte[] wrapExtData(byte[] extData) { - int bufferLen = (extData != null ? extData.length : 0) + 4; - ByteBuffer bb = ByteBuffer.allocate(bufferLen); - bb.putShort((short)ExtensionType.EXT_STATUS_REQUEST.id); - bb.putShort((short)(extData != null ? extData.length: 0)); - if (extData != null) { - bb.put(extData); - } - return bb.array(); - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqItemV2Tests.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqItemV2Tests.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqItemV2Tests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqItemV2Tests.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,455 +0,0 @@ -/* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.security.cert.*; -import java.util.*; -import java.nio.ByteBuffer; -import javax.net.ssl.SSLException; -import javax.security.auth.x500.X500Principal; -import sun.security.provider.certpath.ResponderId; -import sun.security.provider.certpath.OCSPNonceExtension; - -/* - * Checks that the hash value for a certificate's issuer name is generated - * correctly. Requires any certificate that is not self-signed. - * - * NOTE: this test uses Sun private classes which are subject to change. - */ -public class CertStatusReqItemV2Tests { - - private static final boolean debug = false; - - private static final byte[] DEF_CSRIV2_OCSP_MULTI_BYTES = { - 2, 0, 4, 0, 0, 0, 0 - }; - - private static final byte[] DEF_CSRIV2_OCSP_BYTES = { - 1, 0, 4, 0, 0, 0, 0 - }; - - // This is a CSRIV2 (ocsp_multi) that has a single - // responder ID and no extensions. - private static final byte[] CSRIV2_1RID = { - 2, 0, 32, 0, 28, 0, 26, -95, - 24, 48, 22, 49, 20, 48, 18, 6, - 3, 85, 4, 3, 19, 11, 79, 67, - 83, 80, 32, 83, 105, 103, 110, 101, - 114, 0 , 0 - }; - - // This is a CSRIV2 (ocsp_multi) that has a single - // responder ID and no extensions. The request_length - // field is too short in this case. - private static final byte[] CSRIV2_LENGTH_TOO_SHORT = { - 2, 0, 27, 0, 28, 0, 26, -95, - 24, 48, 22, 49, 20, 48, 18, 6, - 3, 85, 4, 3, 19, 11, 79, 67, - 83, 80, 32, 83, 105, 103, 110, 101, - 114, 0 , 0 - }; - - // This is a CSRIV2 (ocsp_multi) that has a single - // responder ID and no extensions. The request_length - // field is too long in this case. - private static final byte[] CSRIV2_LENGTH_TOO_LONG = { - 2, 0, 54, 0, 28, 0, 26, -95, - 24, 48, 22, 49, 20, 48, 18, 6, - 3, 85, 4, 3, 19, 11, 79, 67, - 83, 80, 32, 83, 105, 103, 110, 101, - 114, 0 , 0 - }; - - // A CSRIV2 (ocsp) with one Responder ID (byName: CN=OCSP Signer) - // and a nonce extension (32 bytes). - private static final byte[] CSRIV2_OCSP_1RID_1EXT = { - 1, 0, 83, 0, 28, 0, 26, -95, - 24, 48, 22, 49, 20, 48, 18, 6, - 3, 85, 4, 3, 19, 11, 79, 67, - 83, 80, 32, 83, 105, 103, 110, 101, - 114, 0, 51, 48, 49, 48, 47, 6, - 9, 43, 6, 1, 5, 5, 7, 48, - 1, 2, 4, 34, 4, 32, -34, -83, - -66, -17, -34, -83, -66, -17, -34, -83, - -66, -17, -34, -83, -66, -17, -34, -83, - -66, -17, -34, -83, -66, -17, -34, -83, - -66, -17, -34, -83, -66, -17 - }; - - public static void main(String[] args) throws Exception { - Map testList = - new LinkedHashMap() {{ - put("CTOR (Default)", testCtorTypeStatReq); - put("CTOR (Byte array)", testCtorByteArray); - put("CTOR (invalid lengths)", testCtorInvalidLengths); - }}; - - TestUtils.runTests(testList); - } - - public static final TestCase testCtorTypeStatReq = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - // Attempt to create CSRIv2 objects using null pointers - // for either parameter. In either case NPE should be thrown - CertStatusReqItemV2 csriNull; - try { - csriNull = new CertStatusReqItemV2(null, - new OCSPStatusRequest()); - throw new RuntimeException("Did not catch expected NPE " + - "for null status_type parameter"); - } catch (NullPointerException npe) { } - - try { - csriNull = new CertStatusReqItemV2(StatusRequestType.OCSP, - null); - throw new RuntimeException("Did not catch expected NPE " + - "for null StatusRequest parameter"); - } catch (NullPointerException npe) { } - - // Create an "ocsp_multi" type request using a default - // (no Responder IDs, no Extensions) OCSPStatusRequest - CertStatusReqItemV2 csriMulti = - new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest()); - HandshakeOutStream hsout = new HandshakeOutStream(null); - csriMulti.send(hsout); - TestUtils.valueCheck(DEF_CSRIV2_OCSP_MULTI_BYTES, - hsout.toByteArray()); - hsout.reset(); - - // Create an "ocsp" type request using a default - // (no Responder IDs, no Extensions) OCSPStatusRequest - CertStatusReqItemV2 csriSingle = - new CertStatusReqItemV2(StatusRequestType.OCSP, - new OCSPStatusRequest(new LinkedList<>(), - new LinkedList<>())); - csriSingle.send(hsout); - TestUtils.valueCheck(DEF_CSRIV2_OCSP_BYTES, - hsout.toByteArray()); - - // Create the CertStatusRequestItemV2 with a user-defined - // StatusRequestType value - CertStatusReqItemV2 csriNine = - new CertStatusReqItemV2(StatusRequestType.get(9), - new OCSPStatusRequest(null, null)); - if (csriNine.getType().id != 9) { - throw new RuntimeException("Expected status_type = 9, " + - "got " + csriNine.getType().id); - } else { - StatusRequest sr = csriNine.getRequest(); - if (!(sr instanceof OCSPStatusRequest)) { - throw new RuntimeException("Expected " + - "OCSPStatusRequest, got " + - sr.getClass().getName()); - } - } - - // Create the CertStatusRequestItemV2 with a StatusRequest - // that does not match the status_type argument. - // We expect IllegalArgumentException in this case. - try { - CertStatusReqItemV2 csriBadSR = new CertStatusReqItemV2( - StatusRequestType.OCSP_MULTI, - new BogusStatusRequest()); - throw new RuntimeException("Constructor accepted a " + - "StatusRequest that is inconsistent with " + - "the status_type"); - } catch (IllegalArgumentException iae) { - // The expected result...nothing to do here - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test the constructor form that takes the data from a byte array - public static final TestCase testCtorByteArray = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - StatusRequestType sType; - StatusRequest sReq; - ResponderId checkRid = - new ResponderId(new X500Principal("CN=OCSP Signer")); - Extension checkExt = new OCSPNonceExtension(32); - - CertStatusReqItemV2 csriv = - new CertStatusReqItemV2(CSRIV2_OCSP_1RID_1EXT); - sType = csriv.getType(); - if (sType != StatusRequestType.OCSP) { - throw new RuntimeException("Unexpected StatusRequestType " + - sType.getClass().getName()); - } - - sReq = csriv.getRequest(); - if (sReq instanceof OCSPStatusRequest) { - OCSPStatusRequest osr = (OCSPStatusRequest)sReq; - List ridList = osr.getResponderIds(); - List extList = osr.getExtensions(); - - if (ridList.size() != 1 || !ridList.contains(checkRid)) { - throw new RuntimeException("Responder list mismatch"); - } else if (extList.size() != 1 || - !extList.get(0).getId().equals(checkExt.getId())) { - throw new RuntimeException("Extension list mismatch"); - } - } else { - throw new RuntimeException("Expected OCSPStatusRequest " + - "from decoded bytes, got " + - sReq.getClass().getName()); - } - - // Create a CSRIV2 out of random data. A non-OCSP/OCSP_MULTI - // type will be forcibly set and the outer length field will - // be correct. - // The constructor should create a StatusRequestType object - // and an UnknownStatusRequest object consisting of the - // data segment. - byte[] junkData = new byte[48]; - Random r = new Random(System.currentTimeMillis()); - r.nextBytes(junkData); - junkData[0] = 7; // status_type = 7 - junkData[1] = 0; - junkData[2] = 45; // request_length = 45 - csriv = new CertStatusReqItemV2(junkData); - - sType = csriv.getType(); - sReq = csriv.getRequest(); - if (sType.id != junkData[0]) { - throw new RuntimeException("StatusRequestType mismatch: " + - "expected 7, got " + sType.id); - } - if (sReq instanceof UnknownStatusRequest) { - // Verify the underlying StatusRequest bytes have been - // preserved correctly. - HandshakeOutStream hsout = new HandshakeOutStream(null); - sReq.send(hsout); - byte[] srDataOut = hsout.toByteArray(); - TestUtils.valueCheck(srDataOut, junkData, 0, 3, - srDataOut.length); - } else { - throw new RuntimeException("StatusRequest mismatch: " + - "expected UnknownStatusRequest, got " + - sReq.getClass().getName()); - } - - // Test the parsing of the default OCSP/OCSP_MULTI extensions - // and make sure the underlying StatusRequestType and - // StatusRequest objects are correct. - csriv = new CertStatusReqItemV2(DEF_CSRIV2_OCSP_MULTI_BYTES); - sType = csriv.getType(); - sReq = csriv.getRequest(); - if (sType != StatusRequestType.OCSP_MULTI) { - throw new RuntimeException("StatusRequestType mismatch: " + - "expected OCSP_MULTI (2), got " + sType.id); - } - if (!(sReq instanceof OCSPStatusRequest)) { - throw new RuntimeException("StatusRequest mismatch: " + - "expected OCSPStatusRequest, got " + - sReq.getClass().getName()); - } - - csriv = new CertStatusReqItemV2(DEF_CSRIV2_OCSP_BYTES); - sType = csriv.getType(); - sReq = csriv.getRequest(); - if (sType != StatusRequestType.OCSP) { - throw new RuntimeException("StatusRequestType mismatch: " + - "expected OCSP (1), got " + sType.id); - } - if (!(sReq instanceof OCSPStatusRequest)) { - throw new RuntimeException("StatusRequest mismatch: " + - "expected OCSPStatusRequest, got " + - sReq.getClass().getName()); - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - public static final TestCase testCtorInvalidLengths = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - try { - CertStatusReqItemV2 csriTooShort = - new CertStatusReqItemV2(CSRIV2_LENGTH_TOO_SHORT); - throw new RuntimeException("Expected exception not thrown"); - } catch (SSLException ssle) { } - - try { - CertStatusReqItemV2 csriTooLong = - new CertStatusReqItemV2(CSRIV2_LENGTH_TOO_LONG); - throw new RuntimeException("Expected exception not thrown"); - } catch (SSLException ssle) { } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test the constructor form that takes the data from HandshakeInputStream - public static final TestCase testCtorInputStream = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - StatusRequestType sType; - StatusRequest sReq; - ResponderId checkRid = - new ResponderId(new X500Principal("CN=OCSP Signer")); - Extension checkExt = new OCSPNonceExtension(32); - - HandshakeInStream hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(CSRIV2_OCSP_1RID_1EXT)); - CertStatusReqItemV2 csriv = new CertStatusReqItemV2(hsis); - sType = csriv.getType(); - if (sType != StatusRequestType.OCSP) { - throw new RuntimeException("Unexpected StatusRequestType " + - sType.getClass().getName()); - } - - sReq = csriv.getRequest(); - if (sReq instanceof OCSPStatusRequest) { - OCSPStatusRequest osr = (OCSPStatusRequest)sReq; - List ridList = osr.getResponderIds(); - List extList = osr.getExtensions(); - - if (ridList.size() != 1 || !ridList.contains(checkRid)) { - throw new RuntimeException("Responder list mismatch"); - } else if (extList.size() != 1 || - !extList.get(0).getId().equals(checkExt.getId())) { - throw new RuntimeException("Extension list mismatch"); - } - } else { - throw new RuntimeException("Expected OCSPStatusRequest " + - "from decoded bytes, got " + - sReq.getClass().getName()); - } - - // Create a CSRIV2 out of random data. A non-OCSP/OCSP_MULTI - // type will be forcibly set and the outer length field will - // be correct. - // The constructor should create a StatusRequestType object - // and an UnknownStatusRequest object consisting of the - // data segment. - byte[] junkData = new byte[48]; - Random r = new Random(System.currentTimeMillis()); - r.nextBytes(junkData); - junkData[0] = 7; // status_type = 7 - junkData[1] = 0; - junkData[2] = 45; // request_length = 45 - hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(junkData)); - csriv = new CertStatusReqItemV2(hsis); - - sType = csriv.getType(); - sReq = csriv.getRequest(); - if (sType.id != junkData[0]) { - throw new RuntimeException("StatusRequestType mismatch: " + - "expected 7, got " + sType.id); - } - if (sReq instanceof UnknownStatusRequest) { - // Verify the underlying StatusRequest bytes have been - // preserved correctly. - HandshakeOutStream hsout = new HandshakeOutStream(null); - sReq.send(hsout); - byte[] srDataOut = hsout.toByteArray(); - TestUtils.valueCheck(srDataOut, junkData, 0, 3, - srDataOut.length); - } else { - throw new RuntimeException("StatusRequest mismatch: " + - "expected UnknownStatusRequest, got " + - sReq.getClass().getName()); - } - - // Test the parsing of the default OCSP/OCSP_MULTI extensions - // and make sure the underlying StatusRequestType and - // StatusRequest objects are correct. - hsis = new HandshakeInStream(); - hsis.incomingRecord( - ByteBuffer.wrap(DEF_CSRIV2_OCSP_MULTI_BYTES)); - csriv = new CertStatusReqItemV2(hsis); - sType = csriv.getType(); - sReq = csriv.getRequest(); - if (sType != StatusRequestType.OCSP_MULTI) { - throw new RuntimeException("StatusRequestType mismatch: " + - "expected OCSP_MULTI (2), got " + sType.id); - } - if (!(sReq instanceof OCSPStatusRequest)) { - throw new RuntimeException("StatusRequest mismatch: " + - "expected OCSPStatusRequest, got " + - sReq.getClass().getName()); - } - - hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(DEF_CSRIV2_OCSP_BYTES)); - csriv = new CertStatusReqItemV2(hsis); - sType = csriv.getType(); - sReq = csriv.getRequest(); - if (sType != StatusRequestType.OCSP) { - throw new RuntimeException("StatusRequestType mismatch: " + - "expected OCSP (1), got " + sType.id); - } - if (!(sReq instanceof OCSPStatusRequest)) { - throw new RuntimeException("StatusRequest mismatch: " + - "expected OCSPStatusRequest, got " + - sReq.getClass().getName()); - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqListV2ExtensionTests.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqListV2ExtensionTests.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqListV2ExtensionTests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/CertStatusReqListV2ExtensionTests.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,405 +0,0 @@ -/* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.util.*; -import java.nio.ByteBuffer; -import javax.net.ssl.*; - -/* - * Checks that the hash value for a certificate's issuer name is generated - * correctly. Requires any certificate that is not self-signed. - * - * NOTE: this test uses Sun private classes which are subject to change. - */ -public class CertStatusReqListV2ExtensionTests { - - private static final boolean debug = false; - - // Default status_request_v2 extension with two items - // 1. Type = ocsp_multi, OCSPStatusRequest is default - // 2. Type = ocsp, OCSPStatusRequest is default - private static final byte[] CSRLV2_DEF = { - 0, 14, 2, 0, 4, 0, 0, 0, - 0, 1, 0, 4, 0, 0, 0, 0 - }; - - // A status_request_v2 where the item list length is - // longer than the provided data - private static final byte[] CSRLV2_LEN_TOO_LONG = { - 0, 18, 2, 0, 4, 0, 0, 0, - 0, 1, 0, 4, 0, 0, 0, 0 - }; - - // A status_request_v2 where the item list length is - // shorter than the provided data - private static final byte[] CSRLV2_LEN_TOO_SHORT = { - 0, 11, 2, 0, 4, 0, 0, 0, - 0, 1, 0, 4, 0, 0, 0, 0 - }; - - // A status_request_v2 extension with a zero-length - // certificate_status_req_list (not allowed by the spec) - private static final byte[] CSRLV2_INVALID_ZEROLEN = {0, 0}; - - // A status_request_v2 extension with two items (ocsp_multi and ocsp) - // using OCSPStatusRequests with 5 ResponderIds and 1 Extension each. - private static final byte[] CSRLV2_TWO_NON_DEF_ITEMS = { - 2, 90, 2, 1, 42, 0, -13, 0, - 59, -95, 57, 48, 55, 49, 16, 48, - 14, 6, 3, 85, 4, 10, 19, 7, - 83, 111, 109, 101, 73, 110, 99, 49, - 16, 48, 14, 6, 3, 85, 4, 11, - 19, 7, 83, 111, 109, 101, 80, 75, - 73, 49, 17, 48, 15, 6, 3, 85, - 4, 3, 19, 8, 83, 111, 109, 101, - 79, 67, 83, 80, 0, 68, -95, 66, - 48, 64, 49, 13, 48, 11, 6, 3, - 85, 4, 10, 19, 4, 79, 104, 77, - 121, 49, 14, 48, 12, 6, 3, 85, - 4, 11, 19, 5, 66, 101, 97, 114, - 115, 49, 15, 48, 13, 6, 3, 85, - 4, 11, 19, 6, 84, 105, 103, 101, - 114, 115, 49, 14, 48, 12, 6, 3, - 85, 4, 3, 19, 5, 76, 105, 111, - 110, 115, 0, 58, -95, 56, 48, 54, - 49, 16, 48, 14, 6, 3, 85, 4, - 10, 19, 7, 67, 111, 109, 112, 97, - 110, 121, 49, 13, 48, 11, 6, 3, - 85, 4, 11, 19, 4, 87, 101, 115, - 116, 49, 19, 48, 17, 6, 3, 85, - 4, 3, 19, 10, 82, 101, 115, 112, - 111, 110, 100, 101, 114, 49, 0, 24, - -94, 22, 4, 20, -67, -36, 114, 121, - 92, -79, 116, -1, 102, -107, 7, -21, - 18, -113, 64, 76, 96, -7, -66, -63, - 0, 24, -94, 22, 4, 20, -51, -69, - 107, -82, -39, -87, 45, 25, 41, 28, - -76, -68, -11, -110, -94, -97, 62, 47, - 58, -125, 0, 51, 48, 49, 48, 47, - 6, 9, 43, 6, 1, 5, 5, 7, - 48, 1, 2, 4, 34, 4, 32, -26, - -81, -120, -61, -127, -79, 0, -39, -54, - 49, 3, -51, -57, -85, 19, -126, 94, - -2, 21, 26, 98, 6, 105, -35, -37, - -29, -73, 101, 53, 44, 15, -19, 1, - 1, 42, 0, -13, 0, 59, -95, 57, - 48, 55, 49, 16, 48, 14, 6, 3, - 85, 4, 10, 19, 7, 83, 111, 109, - 101, 73, 110, 99, 49, 16, 48, 14, - 6, 3, 85, 4, 11, 19, 7, 83, - 111, 109, 101, 80, 75, 73, 49, 17, - 48, 15, 6, 3, 85, 4, 3, 19, - 8, 83, 111, 109, 101, 79, 67, 83, - 80, 0, 68, -95, 66, 48, 64, 49, - 13, 48, 11, 6, 3, 85, 4, 10, - 19, 4, 79, 104, 77, 121, 49, 14, - 48, 12, 6, 3, 85, 4, 11, 19, - 5, 66, 101, 97, 114, 115, 49, 15, - 48, 13, 6, 3, 85, 4, 11, 19, - 6, 84, 105, 103, 101, 114, 115, 49, - 14, 48, 12, 6, 3, 85, 4, 3, - 19, 5, 76, 105, 111, 110, 115, 0, - 58, -95, 56, 48, 54, 49, 16, 48, - 14, 6, 3, 85, 4, 10, 19, 7, - 67, 111, 109, 112, 97, 110, 121, 49, - 13, 48, 11, 6, 3, 85, 4, 11, - 19, 4, 87, 101, 115, 116, 49, 19, - 48, 17, 6, 3, 85, 4, 3, 19, - 10, 82, 101, 115, 112, 111, 110, 100, - 101, 114, 49, 0, 24, -94, 22, 4, - 20, -67, -36, 114, 121, 92, -79, 116, - -1, 102, -107, 7, -21, 18, -113, 64, - 76, 96, -7, -66, -63, 0, 24, -94, - 22, 4, 20, -51, -69, 107, -82, -39, - -87, 45, 25, 41, 28, -76, -68, -11, - -110, -94, -97, 62, 47, 58, -125, 0, - 51, 48, 49, 48, 47, 6, 9, 43, - 6, 1, 5, 5, 7, 48, 1, 2, - 4, 34, 4, 32, -26, -81, -120, -61, - -127, -79, 0, -39, -54, 49, 3, -51, - -57, -85, 19, -126, 94, -2, 21, 26, - 98, 6, 105, -35, -37, -29, -73, 101, - 53, 44, 15, -19 - }; - - public static void main(String[] args) throws Exception { - Map testList = - new LinkedHashMap() {{ - put("CTOR (default)", testCtorDefault); - put("CTOR (List runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - CertStatusReqListV2Extension csrlV2 = - new CertStatusReqListV2Extension(); - HandshakeOutStream hsout = new HandshakeOutStream(null); - csrlV2.send(hsout); - TestUtils.valueCheck(wrapExtData(new byte[0]), - hsout.toByteArray()); - - // The length should be 4 (2 bytes for the type, 2 for the - // encoding of zero-length - if (csrlV2.length() != 4) { - throw new RuntimeException("Incorrect length from " + - "default object. Expected 4, got " + - csrlV2.length()); - } - - // Since there's no data, there are no status_type or request - // data fields defined. An empty, unmodifiable list should be - // returned when obtained from the extension. - List itemList = csrlV2.getRequestItems(); - if (!itemList.isEmpty()) { - throw new RuntimeException("Default CSRLV2 returned " + - "non-empty request list"); - } else { - try { - itemList.add(new CertStatusReqItemV2( - StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest())); - throw new RuntimeException("Returned itemList is " + - "modifiable!"); - } catch (UnsupportedOperationException uoe) { } - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - public static final TestCase testCtorItemList = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - OCSPStatusRequest osr = new OCSPStatusRequest(); - List noItems = Collections.emptyList(); - List defList = - new ArrayList() {{ - add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, osr)); - add(new CertStatusReqItemV2(StatusRequestType.OCSP, osr)); - }}; - List unknownTypesList = - new ArrayList() {{ - add(new CertStatusReqItemV2(StatusRequestType.get(8), - new UnknownStatusRequest(new byte[0]))); - add(new CertStatusReqItemV2(StatusRequestType.get(12), - new UnknownStatusRequest(new byte[5]))); - }}; - - try { - HandshakeOutStream hsout = new HandshakeOutStream(null); - StatusRequest basicStatReq = new OCSPStatusRequest(); - - // Create an extension using a default-style OCSPStatusRequest - // (no responder IDs, no extensions). - CertStatusReqListV2Extension csrlv2 = - new CertStatusReqListV2Extension(defList); - csrlv2.send(hsout); - TestUtils.valueCheck(wrapExtData(CSRLV2_DEF), - hsout.toByteArray()); - hsout.reset(); - - // Create the extension using a StatusRequestType not already - // instantiated as a static StatusRequestType - // (e.g. OCSP/OCSP_MULTI) - csrlv2 = new CertStatusReqListV2Extension(unknownTypesList); - List itemList = csrlv2.getRequestItems(); - if (itemList.size() != unknownTypesList.size()) { - throw new RuntimeException("Custom CSRLV2 returned " + - "an incorrect number of items: expected " + - unknownTypesList.size() + ", got " + - itemList.size()); - } else { - // Verify that the list is unmodifiable - try { - itemList.add(new CertStatusReqItemV2( - StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest())); - throw new RuntimeException("Returned itemList is " + - "modifiable!"); - } catch (UnsupportedOperationException uoe) { } - } - - // Pass a null value for the item list. This should throw - // an exception - try { - CertStatusReqListV2Extension csrlv2Null = - new CertStatusReqListV2Extension(null); - throw new RuntimeException("Constructor accepted a " + - "null request list"); - } catch (NullPointerException npe) { } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test the constructor that builds the ob ject using data from - // a HandshakeInStream - // This also tests the length, getReqType and getRequest methods - public static final TestCase testCtorInStream = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - OCSPStatusRequest osr; - CertStatusReqListV2Extension csrlv2; - - try { - // To simulate the extension coming in a ServerHello, the - // type and length would already be read by HelloExtensions - // and there is no extension data - HandshakeInStream hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(new byte[0])); - csrlv2 = new CertStatusReqListV2Extension(hsis, - hsis.available()); - - // Verify length/request list - if (csrlv2.length() != 4) { - throw new RuntimeException("Invalid length: received " + - csrlv2.length() + ", expected 4"); - } else { - List itemList = - csrlv2.getRequestItems(); - if (!itemList.isEmpty()) { - throw new RuntimeException("Default CSRLV2 returned " + - "non-empty request list"); - } else { - try { - itemList.add(new CertStatusReqItemV2( - StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest())); - throw new RuntimeException("Returned itemList is " + - "modifiable!"); - } catch (UnsupportedOperationException uoe) { } - } - } - - // Try the an extension with our basic client-generated - // status_request_v2 (2 items, ocsp_multi and ocsp, each with - // a default OCSPStatusRequest - hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(CSRLV2_DEF)); - csrlv2 = new CertStatusReqListV2Extension(hsis, - hsis.available()); - if (csrlv2.length() != (CSRLV2_DEF.length + 4)) { - throw new RuntimeException("Invalid length: received " + - csrlv2.length() + ", expected " + - CSRLV2_DEF.length + 4); - } else { - List itemList = - csrlv2.getRequestItems(); - if (itemList.size() != 2) { - throw new RuntimeException("Unexpected number of " + - "items request list, expected 2, got " + - itemList.size()); - } else { - try { - itemList.add(new CertStatusReqItemV2( - StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest())); - throw new RuntimeException("Returned itemList is " + - "modifiable!"); - } catch (UnsupportedOperationException uoe) { } - } - } - - // Try incoming data with an illegal zero-length - // certificate_status_req_list - try { - hsis = new HandshakeInStream(); - hsis.incomingRecord( - ByteBuffer.wrap(CSRLV2_INVALID_ZEROLEN)); - csrlv2 = new CertStatusReqListV2Extension(hsis, - hsis.available()); - throw new RuntimeException("Unxpected successful " + - "object construction"); - } catch (SSLException ssle) { } - - // Try extensions where the certificate_status_req_list length - // is either too long or too short - try { - hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(CSRLV2_LEN_TOO_LONG)); - csrlv2 = new CertStatusReqListV2Extension(hsis, - hsis.available()); - throw new RuntimeException("Unxpected successful " + - "object construction"); - } catch (SSLException ssle) { } - - try { - hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(CSRLV2_LEN_TOO_SHORT)); - csrlv2 = new CertStatusReqListV2Extension(hsis, - hsis.available()); - throw new RuntimeException("Unxpected successful " + - "object construction"); - } catch (SSLException ssle) { } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Take CSRE extension data and add extension type and length decorations - private static byte[] wrapExtData(byte[] extData) { - int bufferLen = extData.length + 4; - ByteBuffer bb = ByteBuffer.allocate(bufferLen); - - bb.putShort((short)ExtensionType.EXT_STATUS_REQUEST_V2.id); - bb.putShort((short)extData.length); - if (extData.length != 0) { - bb.put(extData); - } - return bb.array(); - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/OCSPStatusRequestTests.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/OCSPStatusRequestTests.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/OCSPStatusRequestTests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/OCSPStatusRequestTests.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,332 +0,0 @@ -/* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.security.cert.*; -import java.util.*; -import java.nio.ByteBuffer; -import javax.security.auth.x500.X500Principal; -import sun.security.provider.certpath.ResponderId; -import sun.security.provider.certpath.OCSPNonceExtension; - -/* - * Checks that the hash value for a certificate's issuer name is generated - * correctly. Requires any certificate that is not self-signed. - * - * NOTE: this test uses Sun private classes which are subject to change. - */ -public class OCSPStatusRequestTests { - - private static final boolean debug = false; - - // The default (no Responder IDs or Extensions) - private static final byte[] DEF_OCSPREQ_BYTES = { 0, 0, 0, 0 }; - - // OCSP Extension with one Responder ID (byName: CN=OCSP Signer) and - // a nonce extension (32 bytes). - private static final byte[] OCSPREQ_1RID_1EXT = { - 0, 28, 0, 26, -95, 24, 48, 22, - 49, 20, 48, 18, 6, 3, 85, 4, - 3, 19, 11, 79, 67, 83, 80, 32, - 83, 105, 103, 110, 101, 114, 0, 51, - 48, 49, 48, 47, 6, 9, 43, 6, - 1, 5, 5, 7, 48, 1, 2, 4, - 34, 4, 32, -34, -83, -66, -17, -34, - -83, -66, -17, -34, -83, -66, -17, -34, - -83, -66, -17, -34, -83, -66, -17, -34, - -83, -66, -17, -34, -83, -66, -17, -34, - -83, -66, -17 - }; - - public static void main(String[] args) throws Exception { - Map testList = - new LinkedHashMap() {{ - put("CTOR (default)", testCtorDefault); - put("CTOR (Responder Id and Extension)", testCtorRidsExts); - put("CTOR (HandshakeInStream)", testCtorInStream); - put("CTOR (byte array)", testCtorByteArray); - put("Length tests", testLength); - put("Equals tests", testEquals); - }}; - - TestUtils.runTests(testList); - } - - // Test the default constructor and its encoding - public static final TestCase testCtorDefault = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - // Create a OCSPStatusRequest with a single ResponderId - // and Extension - OCSPStatusRequest osrDefault = new OCSPStatusRequest(); - HandshakeOutStream hsout = new HandshakeOutStream(null); - osrDefault.send(hsout); - System.out.println("Encoded Result:"); - TestUtils.dumpBytes(hsout.toByteArray()); - - TestUtils.valueCheck(DEF_OCSPREQ_BYTES, hsout.toByteArray()); - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test the constructor form that allows the user to specify zero - // or more ResponderId objects and/or Extensions - public static final TestCase testCtorRidsExts = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - List ridList = new LinkedList() {{ - add(new ResponderId(new X500Principal("CN=OCSP Signer"))); - }}; - List extList = new LinkedList() {{ - add(new OCSPNonceExtension(32)); - }}; - - // Default-style OCSPStatusRequest using both empty Lists and - // null inputs - OCSPStatusRequest osrDef1 = - new OCSPStatusRequest(new LinkedList(), - null); - OCSPStatusRequest osrDef2 = - new OCSPStatusRequest(null, - new LinkedList()); - HandshakeOutStream hsout = new HandshakeOutStream(null); - osrDef1.send(hsout); - System.out.println("Encoded Result:"); - TestUtils.dumpBytes(hsout.toByteArray()); - TestUtils.valueCheck(DEF_OCSPREQ_BYTES, hsout.toByteArray()); - - hsout.reset(); - osrDef2.send(hsout); - System.out.println("Encoded Result:"); - TestUtils.dumpBytes(hsout.toByteArray()); - TestUtils.valueCheck(DEF_OCSPREQ_BYTES, hsout.toByteArray()); - - hsout.reset(); - OCSPStatusRequest osrWithItems = - new OCSPStatusRequest(ridList, extList); - osrWithItems.send(hsout); - System.out.println("Encoded Result:"); - byte[] encodedData = hsout.toByteArray(); - TestUtils.dumpBytes(encodedData); - // Check everything except the last 32 bytes (nonce data) - TestUtils.valueCheck(OCSPREQ_1RID_1EXT, encodedData, 0, 0, - encodedData.length - 32); - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test the constructor that builds the ob ject using data from - // a HandshakeInStream - public static final TestCase testCtorInStream = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - ResponderId checkRid = - new ResponderId(new X500Principal("CN=OCSP Signer")); - Extension checkExt = new OCSPNonceExtension(32); - - HandshakeInStream hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(OCSPREQ_1RID_1EXT)); - OCSPStatusRequest osr = new OCSPStatusRequest(hsis); - - List ridList = osr.getResponderIds(); - List extList = osr.getExtensions(); - - if (ridList.size() != 1 || !ridList.contains(checkRid)) { - throw new RuntimeException("Responder list mismatch"); - } else if (extList.size() != 1 || - !extList.get(0).getId().equals(checkExt.getId())) { - throw new RuntimeException("Extension list mismatch"); - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test the constructor form that takes the data from a byte array - public static final TestCase testCtorByteArray = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - ResponderId checkRid = - new ResponderId(new X500Principal("CN=OCSP Signer")); - Extension checkExt = new OCSPNonceExtension(32); - - OCSPStatusRequest osr = - new OCSPStatusRequest(OCSPREQ_1RID_1EXT); - - List ridList = osr.getResponderIds(); - List extList = osr.getExtensions(); - - if (ridList.size() != 1 || !ridList.contains(checkRid)) { - throw new RuntimeException("Responder list mismatch"); - } else if (extList.size() != 1 || - !extList.get(0).getId().equals(checkExt.getId())) { - throw new RuntimeException("Extension list mismatch"); - } - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test the length functions for both default and non-default - // OCSPStatusRequest objects - public static final TestCase testLength = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - HandshakeInStream hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(OCSPREQ_1RID_1EXT)); - OCSPStatusRequest osr = new OCSPStatusRequest(hsis); - OCSPStatusRequest osrDefault = new OCSPStatusRequest(); - - if (osrDefault.length() != DEF_OCSPREQ_BYTES.length) { - throw new RuntimeException("Invalid length for default: " + - "Expected" + DEF_OCSPREQ_BYTES.length + - ", received " + osrDefault.length()); - } else if (osr.length() != OCSPREQ_1RID_1EXT.length) { - throw new RuntimeException("Invalid length for default: " + - "Expected" + OCSPREQ_1RID_1EXT.length + - ", received " + osr.length()); - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test the equals method with default and non-default objects - public static final TestCase testEquals = new TestCase() { - @Override - public Map.Entry runTest() { - Boolean pass = Boolean.FALSE; - String message = null; - try { - // Make two different lists with the same ResponderId values - // and also make a extension list - List ridList1 = new LinkedList() {{ - add(new ResponderId(new X500Principal("CN=OCSP Signer"))); - }}; - List ridList2 = new LinkedList() {{ - add(new ResponderId(new X500Principal("CN=OCSP Signer"))); - }}; - List extList = new LinkedList() {{ - add(new OCSPNonceExtension(32)); - }}; - - // We expect two default OCSP objects to be equal - OCSPStatusRequest osrDefault = new OCSPStatusRequest(); - if (!osrDefault.equals(new OCSPStatusRequest())) { - throw new RuntimeException("Default OCSPStatusRequest" + - " equality test failed"); - } - - // null test (expect false return) - if (osrDefault.equals(null)) { - throw new RuntimeException("OCSPStatusRequest matched" + - " unexpectedly"); - } - - // Self-reference test - OCSPStatusRequest osrSelfRef = osrDefault; - if (!osrDefault.equals(osrSelfRef)) { - throw new RuntimeException("Default OCSPStatusRequest" + - " equality test failed"); - } - - // Two OCSPStatusRequests with matching ResponderIds should - // be considered equal - OCSPStatusRequest osrByList1 = - new OCSPStatusRequest(ridList1, null); - OCSPStatusRequest osrByList2 = new OCSPStatusRequest(ridList2, - Collections.emptyList()); - if (!osrByList1.equals(osrByList2)) { - throw new RuntimeException("Single Responder ID " + - "OCSPStatusRequest equality test failed"); - } - - // We expect OCSPStatusRequests with different nonces to be - // considered unequal. - HandshakeInStream hsis = new HandshakeInStream(); - hsis.incomingRecord(ByteBuffer.wrap(OCSPREQ_1RID_1EXT)); - OCSPStatusRequest osrStream = new OCSPStatusRequest(hsis); - OCSPStatusRequest osrRidExt = new OCSPStatusRequest(ridList1, - extList); - if (osrStream.equals(osrRidExt)) { - throw new RuntimeException("OCSPStatusRequest matched" + - " unexpectedly"); - } - - pass = Boolean.TRUE; - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/StatusReqSelection.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/StatusReqSelection.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/StatusReqSelection.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/StatusReqSelection.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,899 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * 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. - */ - -// SunJSSE does not support dynamic system properties, no way to re-use -// system properties in samevm/agentvm mode. - -// See ../../../../RunStatReqSelect.java for the jtreg header - -package sun.security.ssl; - -import javax.net.ssl.*; -import javax.net.ssl.SSLEngineResult.*; -import javax.security.auth.x500.X500Principal; -import java.io.*; -import java.math.BigInteger; -import java.security.*; -import java.nio.*; -import java.security.cert.X509Certificate; -import java.security.cert.Extension; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.concurrent.TimeUnit; - -import sun.security.provider.certpath.OCSPNonceExtension; -import sun.security.provider.certpath.ResponderId; -import sun.security.testlibrary.SimpleOCSPServer; -import sun.security.testlibrary.CertificateBuilder; - -public class StatusReqSelection { - - /* - * Enables logging of the SSLEngine operations. - */ - private static final boolean logging = true; - - /* - * Enables the JSSE system debugging system property: - * - * -Djavax.net.debug=all - * - * This gives a lot of low-level information about operations underway, - * including specific handshake messages, and might be best examined - * after gaining some familiarity with this application. - */ - private static final boolean debug = false; - - // The following items are used to set up the keystores. - private static final String passwd = "passphrase"; - private static final String ROOT_ALIAS = "root"; - private static final String INT_ALIAS = "intermediate"; - private static final String SSL_ALIAS = "ssl"; - - // PKI and server components we will need for this test - private static KeyManagerFactory kmf; - private static TrustManagerFactory tmf; - private static KeyStore rootKeystore; // Root CA Keystore - private static KeyStore intKeystore; // Intermediate CA Keystore - private static KeyStore serverKeystore; // SSL Server Keystore - private static KeyStore trustStore; // SSL Client trust store - private static SimpleOCSPServer rootOcsp; // Root CA OCSP Responder - private static int rootOcspPort; // Port for root OCSP - private static SimpleOCSPServer intOcsp; // Intermediate CA OCSP server - private static int intOcspPort; // Port for intermediate OCSP - private static SSLContext ctxStaple; // SSLContext for all tests - - // Some useful objects we will need for test purposes - private static final SecureRandom RNG = new SecureRandom(); - - // We'll be using these objects repeatedly to make hello messages - private static final ProtocolVersion VER_1_0 = ProtocolVersion.TLS10; - private static final ProtocolVersion VER_1_2 = ProtocolVersion.TLS12; - private static final CipherSuiteList SUITES = new CipherSuiteList( - CipherSuite.valueOf("TLS_RSA_WITH_AES_128_GCM_SHA256")); - private static final SessionId SID = new SessionId(new byte[0]); - private static final HelloExtension RNIEXT = - new RenegotiationInfoExtension(new byte[0], new byte[0]); - private static final List algList = - new ArrayList() {{ - add(SignatureAndHashAlgorithm.valueOf(4, 1, 0)); - }}; // List with only SHA256withRSA - private static final SignatureAlgorithmsExtension SIGALGEXT = - new SignatureAlgorithmsExtension(algList); - - /* - * Main entry point for this test. - */ - public static void main(String args[]) throws Exception { - int testsPassed = 0; - - if (debug) { - System.setProperty("javax.net.debug", "ssl"); - } - - // All tests will have stapling enabled on the server side - System.setProperty("jdk.tls.server.enableStatusRequestExtension", - "true"); - - // Create a single SSLContext that we can use for all tests - ctxStaple = SSLContext.getInstance("TLS"); - - // Create the PKI we will use for the test and start the OCSP servers - createPKI(); - - // Set up the KeyManagerFactory and TrustManagerFactory - kmf = KeyManagerFactory.getInstance("PKIX"); - kmf.init(serverKeystore, passwd.toCharArray()); - tmf = TrustManagerFactory.getInstance("PKIX"); - tmf.init(trustStore); - - List testList = new ArrayList() {{ - add(new TestCase("ClientHello: No stapling extensions", - makeHelloNoStaplingExts(), false, false)); - add(new TestCase("ClientHello: Default status_request only", - makeDefaultStatReqOnly(), true, false)); - add(new TestCase("ClientHello: Default status_request_v2 only", - makeDefaultStatReqV2Only(), false, true)); - add(new TestCase("ClientHello: Both status_request exts, default", - makeDefaultStatReqBoth(), false, true)); - add(new TestCase( - "ClientHello: Hello with status_request and responder IDs", - makeStatReqWithRid(), false, false)); - add(new TestCase( - "ClientHello: Hello with status_request using no " + - "responder IDs but provides the OCSP nonce extension", - makeStatReqNoRidNonce(), true, false)); - add(new TestCase("ClientHello with default status_request and " + - "status_request_v2 with ResponderIds", - makeStatReqDefV2WithRid(), true, false)); - add(new TestCase("ClientHello with default status_request and " + - "status_request_v2 (OCSP_MULTI with ResponderId, " + - "OCSP as a default request)", - makeStatReqDefV2MultiWithRidSingleDef(), false, true)); - add(new TestCase("ClientHello with status_request and " + - "status_request_v2 and all OCSPStatusRequests use " + - "Responder IDs", - makeStatReqAllWithRid(), false, false)); - add(new TestCase("ClientHello with default status_request and " + - "status_request_v2 that has a default OCSP item and " + - "multiple OCSP_MULTI items, only one is default", - makeHelloMultiV2andSingle(), false, true)); - }}; - - // Run the client and server property tests - for (TestCase test : testList) { - try { - log("*** Test: " + test.testName); - if (runTest(test)) { - log("PASS: status_request: " + test.statReqEnabled + - ", status_request_v2: " + test.statReqV2Enabled); - testsPassed++; - } - } catch (Exception e) { - // If we get an exception, we'll count it as a failure - log("Test failure due to exception: " + e); - } - log(""); - } - - // Summary - if (testsPassed != testList.size()) { - throw new RuntimeException(testList.size() - testsPassed + - " tests failed out of " + testList.size() + " total."); - } else { - log("Total tests: " + testList.size() + ", all passed"); - } - } - - private static boolean runTest(TestCase test) throws Exception { - SSLEngineResult serverResult; - - // Create a Server SSLEngine to receive our customized ClientHello - ctxStaple.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - SSLEngine engine = ctxStaple.createSSLEngine(); - engine.setUseClientMode(false); - engine.setNeedClientAuth(false); - - SSLSession session = engine.getSession(); - ByteBuffer serverOut = ByteBuffer.wrap("I'm a Server".getBytes()); - ByteBuffer serverIn = - ByteBuffer.allocate(session.getApplicationBufferSize() + 50); - ByteBuffer sTOc = - ByteBuffer.allocateDirect(session.getPacketBufferSize()); - - // Send the ClientHello ByteBuffer in the test case - if (debug) { - System.out.println("Sending Client Hello:\n" + - dumpHexBytes(test.data)); - } - - // Consume the client hello - serverResult = engine.unwrap(test.data, serverIn); - if (debug) { - log("server unwrap: ", serverResult); - } - if (serverResult.getStatus() != SSLEngineResult.Status.OK) { - throw new SSLException("Server unwrap got status: " + - serverResult.getStatus()); - } else if (serverResult.getHandshakeStatus() != - SSLEngineResult.HandshakeStatus.NEED_TASK) { - throw new SSLException("Server unwrap expected NEED_TASK, got: " + - serverResult.getHandshakeStatus()); - } - runDelegatedTasks(serverResult, engine); - if (engine.getHandshakeStatus() != - SSLEngineResult.HandshakeStatus.NEED_WRAP) { - throw new SSLException("Expected NEED_WRAP, got: " + - engine.getHandshakeStatus()); - } - - // Generate a TLS record with the ServerHello - serverResult = engine.wrap(serverOut, sTOc); - if (debug) { - log("client wrap: ", serverResult); - } - if (serverResult.getStatus() != SSLEngineResult.Status.OK) { - throw new SSLException("Client wrap got status: " + - serverResult.getStatus()); - } - sTOc.flip(); - - if (debug) { - log("Server Response:\n" + dumpHexBytes(sTOc)); - } - - return checkServerHello(sTOc, test.statReqEnabled, - test.statReqV2Enabled); - } - - /** - * Make a TLSv1.2 ClientHello with only RNI and no stapling extensions - */ - private static ByteBuffer makeHelloNoStaplingExts() throws IOException { - // Craft the ClientHello byte buffer - HelloExtensions exts = new HelloExtensions(); - exts.add(RNIEXT); - exts.add(SIGALGEXT); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - - /** - * Make a TLSv1.2 ClientHello with the RNI and Status Request extensions - */ - private static ByteBuffer makeDefaultStatReqOnly() throws IOException { - // Craft the ClientHello byte buffer - HelloExtensions exts = new HelloExtensions(); - exts.add(RNIEXT); - exts.add(SIGALGEXT); - exts.add(new CertStatusReqExtension(StatusRequestType.OCSP, - new OCSPStatusRequest(null, null))); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - - /** - * Make a TLSv1.2 ClientHello with the RNI and Status Request V2 extension - */ - private static ByteBuffer makeDefaultStatReqV2Only() throws IOException { - // Craft the ClientHello byte buffer - HelloExtensions exts = new HelloExtensions(); - OCSPStatusRequest osr = new OCSPStatusRequest(); - List itemList = new ArrayList<>(2); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - osr)); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP, osr)); - - exts.add(RNIEXT); - exts.add(SIGALGEXT); - exts.add(new CertStatusReqListV2Extension(itemList)); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - /** - * Make a TLSv1.2 ClientHello with Status Request and Status Request V2 - * extensions. - */ - private static ByteBuffer makeDefaultStatReqBoth() throws IOException { - // Craft the ClientHello byte buffer - HelloExtensions exts = new HelloExtensions(); - OCSPStatusRequest osr = new OCSPStatusRequest(); - List itemList = new ArrayList<>(2); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - osr)); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP, osr)); - - exts.add(RNIEXT); - exts.add(SIGALGEXT); - exts.add(new CertStatusReqExtension(StatusRequestType.OCSP, - new OCSPStatusRequest(null, null))); - exts.add(new CertStatusReqListV2Extension(itemList)); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - - /** - * Make a ClientHello using a status_request that has a single - * responder ID in it. - */ - private static ByteBuffer makeStatReqWithRid() throws IOException { - HelloExtensions exts = new HelloExtensions(); - exts.add(RNIEXT); - exts.add(SIGALGEXT); - List rids = new ArrayList() {{ - add(new ResponderId(new X500Principal("CN=Foo"))); - }}; - exts.add(new CertStatusReqExtension(StatusRequestType.OCSP, - new OCSPStatusRequest(rids, null))); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - - /** - * Make a ClientHello using a status_request that has no - * responder IDs but does provide the nonce extension. - */ - private static ByteBuffer makeStatReqNoRidNonce() throws IOException { - HelloExtensions exts = new HelloExtensions(); - exts.add(RNIEXT); - exts.add(SIGALGEXT); - List ocspExts = new ArrayList() {{ - add(new OCSPNonceExtension(16)); - }}; - exts.add(new CertStatusReqExtension(StatusRequestType.OCSP, - new OCSPStatusRequest(null, ocspExts))); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - - /** - * Make a ClientHello using a default status_request and a - * status_request_v2 that has a single responder ID in it. - */ - private static ByteBuffer makeStatReqDefV2WithRid() throws IOException { - HelloExtensions exts = new HelloExtensions(); - List rids = new ArrayList() {{ - add(new ResponderId(new X500Principal("CN=Foo"))); - }}; - List itemList = new ArrayList<>(2); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest(rids, null))); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP, - new OCSPStatusRequest(rids, null))); - - exts.add(RNIEXT); - exts.add(SIGALGEXT); - exts.add(new CertStatusReqExtension(StatusRequestType.OCSP, - new OCSPStatusRequest(null, null))); - exts.add(new CertStatusReqListV2Extension(itemList)); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - - /** - * Make a ClientHello using a default status_request and a - * status_request_v2 that has a single responder ID in it for the - * OCSP_MULTI request item and a default OCSP request item. - */ - private static ByteBuffer makeStatReqDefV2MultiWithRidSingleDef() - throws IOException { - HelloExtensions exts = new HelloExtensions(); - List rids = new ArrayList() {{ - add(new ResponderId(new X500Principal("CN=Foo"))); - }}; - List itemList = new ArrayList<>(2); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest(rids, null))); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP, - new OCSPStatusRequest(null, null))); - - exts.add(RNIEXT); - exts.add(SIGALGEXT); - exts.add(new CertStatusReqExtension(StatusRequestType.OCSP, - new OCSPStatusRequest(null, null))); - exts.add(new CertStatusReqListV2Extension(itemList)); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - - /** - * Make a ClientHello using status_request and status_request_v2 where - * all underlying OCSPStatusRequests use responder IDs. - */ - private static ByteBuffer makeStatReqAllWithRid() throws IOException { - HelloExtensions exts = new HelloExtensions(); - List rids = new ArrayList() {{ - add(new ResponderId(new X500Principal("CN=Foo"))); - }}; - List itemList = new ArrayList<>(2); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest(rids, null))); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP, - new OCSPStatusRequest(rids, null))); - - exts.add(RNIEXT); - exts.add(SIGALGEXT); - exts.add(new CertStatusReqExtension(StatusRequestType.OCSP, - new OCSPStatusRequest(rids, null))); - exts.add(new CertStatusReqListV2Extension(itemList)); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - - /** - * Make a TLSv1.2 ClientHello multiple CertStatusReqItemV2s of different - * types. One of the middle items should be acceptable while the others - * have responder IDs. The status_request (v1) should also be acceptable - * but should be overridden in favor of the status_request_v2. - */ - private static ByteBuffer makeHelloMultiV2andSingle() throws IOException { - // Craft the ClientHello byte buffer - HelloExtensions exts = new HelloExtensions(); - List fooRid = Collections.singletonList( - new ResponderId(new X500Principal("CN=Foo"))); - List barRid = Collections.singletonList( - new ResponderId(new X500Principal("CN=Bar"))); - List itemList = new ArrayList<>(); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP, - new OCSPStatusRequest(null, null))); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest(fooRid, null))); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest(null, null))); - itemList.add(new CertStatusReqItemV2(StatusRequestType.OCSP_MULTI, - new OCSPStatusRequest(barRid, null))); - - exts.add(RNIEXT); - exts.add(SIGALGEXT); - exts.add(new CertStatusReqExtension(StatusRequestType.OCSP, - new OCSPStatusRequest(null, null))); - exts.add(new CertStatusReqListV2Extension(itemList)); - return createTlsRecord(Record.ct_handshake, VER_1_2, - createClientHelloMsg(VER_1_2, SID, SUITES, exts)); - } - - /** - * Wrap a TLS content message into a TLS record header - * - * @param contentType a byte containing the content type value - * @param pv the protocol version for this record - * @param data a byte buffer containing the message data - * @return - */ - private static ByteBuffer createTlsRecord(byte contentType, - ProtocolVersion pv, ByteBuffer data) { - int msgLen = (data != null) ? data.limit() : 0; - - // Allocate enough space to hold the TLS record header + the message - ByteBuffer recordBuf = ByteBuffer.allocate(msgLen + 5); - recordBuf.put(contentType); - recordBuf.putShort((short)pv.v); - recordBuf.putShort((short)msgLen); - if (msgLen > 0) { - recordBuf.put(data); - } - - recordBuf.flip(); - return recordBuf; - } - - /** - * Craft and encode a ClientHello message as a byte array. - * - * @param pv the protocol version asserted in the hello message. - * @param sessId the session ID for this hello message. - * @param suites a list consisting of one or more cipher suite objects - * @param extensions a list of HelloExtension objects - * - * @return a byte array containing the encoded ClientHello message. - */ - private static ByteBuffer createClientHelloMsg(ProtocolVersion pv, - SessionId sessId, CipherSuiteList suites, - HelloExtensions extensions) throws IOException { - ByteBuffer msgBuf; - - HandshakeOutStream hsos = - new HandshakeOutStream(new SSLEngineOutputRecord()); - - // Construct the client hello object from the first 3 parameters - HandshakeMessage.ClientHello cHello = - new HandshakeMessage.ClientHello(RNG, pv, sessId, suites, - false); - - // Use the HelloExtensions provided by the caller - if (extensions != null) { - cHello.extensions = extensions; - } - - cHello.send(hsos); - msgBuf = ByteBuffer.allocate(hsos.size() + 4); - - // Combine the handshake type with the length - msgBuf.putInt((HandshakeMessage.ht_client_hello << 24) | - (hsos.size() & 0x00FFFFFF)); - msgBuf.put(hsos.toByteArray()); - msgBuf.flip(); - return msgBuf; - } - - /* - * If the result indicates that we have outstanding tasks to do, - * go ahead and run them in this thread. - */ - private static void runDelegatedTasks(SSLEngineResult result, - SSLEngine engine) throws Exception { - - if (result.getHandshakeStatus() == HandshakeStatus.NEED_TASK) { - Runnable runnable; - while ((runnable = engine.getDelegatedTask()) != null) { - if (debug) { - log("\trunning delegated task..."); - } - runnable.run(); - } - HandshakeStatus hsStatus = engine.getHandshakeStatus(); - if (hsStatus == HandshakeStatus.NEED_TASK) { - throw new Exception( - "handshake shouldn't need additional tasks"); - } - if (debug) { - log("\tnew HandshakeStatus: " + hsStatus); - } - } - } - - private static void log(String str, SSLEngineResult result) { - if (!logging) { - return; - } - HandshakeStatus hsStatus = result.getHandshakeStatus(); - log(str + - result.getStatus() + "/" + hsStatus + ", " + - result.bytesConsumed() + "/" + result.bytesProduced() + - " bytes"); - if (hsStatus == HandshakeStatus.FINISHED) { - log("\t...ready for application data"); - } - } - - private static void log(String str) { - if (logging) { - System.out.println(str); - } - } - - /** - * Dump a ByteBuffer as a hexdump to stdout. The dumping routine will - * start at the current position of the buffer and run to its limit. - * After completing the dump, the position will be returned to its - * starting point. - * - * @param data the ByteBuffer to dump to stdout. - * - * @return the hexdump of the byte array. - */ - private static String dumpHexBytes(ByteBuffer data) { - StringBuilder sb = new StringBuilder(); - if (data != null) { - int i = 0; - data.mark(); - while (data.hasRemaining()) { - if (i % 16 == 0 && i != 0) { - sb.append("\n"); - } - sb.append(String.format("%02X ", data.get())); - i++; - } - data.reset(); - } - - return sb.toString(); - } - - /** - * Tests the ServerHello for the presence (or not) of the status_request - * or status_request_v2 hello extension. It is assumed that the provided - * ByteBuffer has its position set at the first byte of the TLS record - * containing the ServerHello and contains the entire hello message. Upon - * successful completion of this method the ByteBuffer will have its - * position reset to the initial offset in the buffer. If an exception is - * thrown the position at the time of the exception will be preserved. - * - * @param statReqPresent true if the status_request hello extension should - * be present. - * @param statReqV2Present true if the status_request_v2 hello extension - * should be present. - * - * @return true if the ServerHello's extension set matches the presence - * booleans for status_request and status_request_v2. False if - * not, or if the TLS record or message is of the wrong type. - */ - private static boolean checkServerHello(ByteBuffer data, - boolean statReqPresent, boolean statReqV2Present) { - boolean hasV1 = false; - boolean hasV2 = false; - Objects.requireNonNull(data); - int startPos = data.position(); - data.mark(); - - // Process the TLS record header - int type = Byte.toUnsignedInt(data.get()); - int ver_major = Byte.toUnsignedInt(data.get()); - int ver_minor = Byte.toUnsignedInt(data.get()); - int recLen = Short.toUnsignedInt(data.getShort()); - - // Simple sanity checks - if (type != 22) { - log("Not a handshake: Type = " + type); - return false; - } else if (recLen > data.remaining()) { - log("Incomplete record in buffer: Record length = " + recLen + - ", Remaining = " + data.remaining()); - return false; - } - - // Grab the handshake message header. - int msgHdr = data.getInt(); - int msgType = (msgHdr >> 24) & 0x000000FF; - int msgLen = msgHdr & 0x00FFFFFF; - - // More simple sanity checks - if (msgType != 2) { - log("Not a ServerHello: Type = " + msgType); - return false; - } - - // Skip over the protocol version and server random - data.position(data.position() + 34); - - // Jump past the session ID - int sessLen = Byte.toUnsignedInt(data.get()); - if (sessLen != 0) { - data.position(data.position() + sessLen); - } - - // Skip the cipher suite and compression method - data.position(data.position() + 3); - - // Go through the extensions and look for the request extension - // expected by the caller. - int extsLen = Short.toUnsignedInt(data.getShort()); - while (data.position() < recLen + startPos + 5) { - int extType = Short.toUnsignedInt(data.getShort()); - int extLen = Short.toUnsignedInt(data.getShort()); - hasV1 |= (extType == ExtensionType.EXT_STATUS_REQUEST.id); - hasV2 |= (extType == ExtensionType.EXT_STATUS_REQUEST_V2.id); - data.position(data.position() + extLen); - } - - if (hasV1 != statReqPresent) { - log("The status_request extension is " + - "inconsistent with the expected result: expected = " + - statReqPresent + ", actual = " + hasV1); - } - if (hasV2 != statReqV2Present) { - log("The status_request_v2 extension is " + - "inconsistent with the expected result: expected = " + - statReqV2Present + ", actual = " + hasV2); - } - - // Reset the position to the initial spot at the start of this method. - data.reset(); - - return ((hasV1 == statReqPresent) && (hasV2 == statReqV2Present)); - } - - /** - * Creates the PKI components necessary for this test, including - * Root CA, Intermediate CA and SSL server certificates, the keystores - * for each entity, a client trust store, and starts the OCSP responders. - */ - private static void createPKI() throws Exception { - CertificateBuilder cbld = new CertificateBuilder(); - KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); - keyGen.initialize(2048); - KeyStore.Builder keyStoreBuilder = - KeyStore.Builder.newInstance("PKCS12", null, - new KeyStore.PasswordProtection(passwd.toCharArray())); - - // Generate Root, IntCA, EE keys - KeyPair rootCaKP = keyGen.genKeyPair(); - log("Generated Root CA KeyPair"); - KeyPair intCaKP = keyGen.genKeyPair(); - log("Generated Intermediate CA KeyPair"); - KeyPair sslKP = keyGen.genKeyPair(); - log("Generated SSL Cert KeyPair"); - - // Set up the Root CA Cert - cbld.setSubjectName("CN=Root CA Cert, O=SomeCompany"); - cbld.setPublicKey(rootCaKP.getPublic()); - cbld.setSerialNumber(new BigInteger("1")); - // Make a 3 year validity starting from 60 days ago - long start = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(60); - long end = start + TimeUnit.DAYS.toMillis(1085); - cbld.setValidity(new Date(start), new Date(end)); - addCommonExts(cbld, rootCaKP.getPublic(), rootCaKP.getPublic()); - addCommonCAExts(cbld); - // Make our Root CA Cert! - X509Certificate rootCert = cbld.build(null, rootCaKP.getPrivate(), - "SHA256withRSA"); - log("Root CA Created:\n" + certInfo(rootCert)); - - // Now build a keystore and add the keys and cert - rootKeystore = keyStoreBuilder.getKeyStore(); - java.security.cert.Certificate[] rootChain = {rootCert}; - rootKeystore.setKeyEntry(ROOT_ALIAS, rootCaKP.getPrivate(), - passwd.toCharArray(), rootChain); - - // Now fire up the OCSP responder - rootOcsp = new SimpleOCSPServer(rootKeystore, passwd, ROOT_ALIAS, null); - rootOcsp.enableLog(debug); - rootOcsp.setNextUpdateInterval(3600); - rootOcsp.start(); - - // Wait 5 seconds for server ready - for (int i = 0; (i < 100 && !rootOcsp.isServerReady()); i++) { - Thread.sleep(50); - } - if (!rootOcsp.isServerReady()) { - throw new RuntimeException("Server not ready yet"); - } - - rootOcspPort = rootOcsp.getPort(); - String rootRespURI = "http://localhost:" + rootOcspPort; - log("Root OCSP Responder URI is " + rootRespURI); - - // Now that we have the root keystore and OCSP responder we can - // create our intermediate CA. - cbld.reset(); - cbld.setSubjectName("CN=Intermediate CA Cert, O=SomeCompany"); - cbld.setPublicKey(intCaKP.getPublic()); - cbld.setSerialNumber(new BigInteger("100")); - // Make a 2 year validity starting from 30 days ago - start = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30); - end = start + TimeUnit.DAYS.toMillis(730); - cbld.setValidity(new Date(start), new Date(end)); - addCommonExts(cbld, intCaKP.getPublic(), rootCaKP.getPublic()); - addCommonCAExts(cbld); - cbld.addAIAExt(Collections.singletonList(rootRespURI)); - // Make our Intermediate CA Cert! - X509Certificate intCaCert = cbld.build(rootCert, rootCaKP.getPrivate(), - "SHA256withRSA"); - log("Intermediate CA Created:\n" + certInfo(intCaCert)); - - // Provide intermediate CA cert revocation info to the Root CA - // OCSP responder. - Map revInfo = - new HashMap<>(); - revInfo.put(intCaCert.getSerialNumber(), - new SimpleOCSPServer.CertStatusInfo( - SimpleOCSPServer.CertStatus.CERT_STATUS_GOOD)); - rootOcsp.updateStatusDb(revInfo); - - // Now build a keystore and add the keys, chain and root cert as a TA - intKeystore = keyStoreBuilder.getKeyStore(); - java.security.cert.Certificate[] intChain = {intCaCert, rootCert}; - intKeystore.setKeyEntry(INT_ALIAS, intCaKP.getPrivate(), - passwd.toCharArray(), intChain); - intKeystore.setCertificateEntry(ROOT_ALIAS, rootCert); - - // Now fire up the Intermediate CA OCSP responder - intOcsp = new SimpleOCSPServer(intKeystore, passwd, - INT_ALIAS, null); - intOcsp.enableLog(debug); - intOcsp.setNextUpdateInterval(3600); - intOcsp.start(); - - // Wait 5 seconds for server ready - for (int i = 0; (i < 100 && !intOcsp.isServerReady()); i++) { - Thread.sleep(50); - } - if (!intOcsp.isServerReady()) { - throw new RuntimeException("Server not ready yet"); - } - - intOcspPort = intOcsp.getPort(); - String intCaRespURI = "http://localhost:" + intOcspPort; - log("Intermediate CA OCSP Responder URI is " + intCaRespURI); - - // Last but not least, let's make our SSLCert and add it to its own - // Keystore - cbld.reset(); - cbld.setSubjectName("CN=SSLCertificate, O=SomeCompany"); - cbld.setPublicKey(sslKP.getPublic()); - cbld.setSerialNumber(new BigInteger("4096")); - // Make a 1 year validity starting from 7 days ago - start = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(7); - end = start + TimeUnit.DAYS.toMillis(365); - cbld.setValidity(new Date(start), new Date(end)); - - // Add extensions - addCommonExts(cbld, sslKP.getPublic(), intCaKP.getPublic()); - boolean[] kuBits = {true, false, true, false, false, false, - false, false, false}; - cbld.addKeyUsageExt(kuBits); - List ekuOids = new ArrayList<>(); - ekuOids.add("1.3.6.1.5.5.7.3.1"); - ekuOids.add("1.3.6.1.5.5.7.3.2"); - cbld.addExtendedKeyUsageExt(ekuOids); - cbld.addSubjectAltNameDNSExt(Collections.singletonList("localhost")); - cbld.addAIAExt(Collections.singletonList(intCaRespURI)); - // Make our SSL Server Cert! - X509Certificate sslCert = cbld.build(intCaCert, intCaKP.getPrivate(), - "SHA256withRSA"); - log("SSL Certificate Created:\n" + certInfo(sslCert)); - - // Provide SSL server cert revocation info to the Intermeidate CA - // OCSP responder. - revInfo = new HashMap<>(); - revInfo.put(sslCert.getSerialNumber(), - new SimpleOCSPServer.CertStatusInfo( - SimpleOCSPServer.CertStatus.CERT_STATUS_GOOD)); - intOcsp.updateStatusDb(revInfo); - - // Now build a keystore and add the keys, chain and root cert as a TA - serverKeystore = keyStoreBuilder.getKeyStore(); - java.security.cert.Certificate[] sslChain = {sslCert, intCaCert, rootCert}; - serverKeystore.setKeyEntry(SSL_ALIAS, sslKP.getPrivate(), - passwd.toCharArray(), sslChain); - serverKeystore.setCertificateEntry(ROOT_ALIAS, rootCert); - - // And finally a Trust Store for the client - trustStore = keyStoreBuilder.getKeyStore(); - trustStore.setCertificateEntry(ROOT_ALIAS, rootCert); - } - - private static void addCommonExts(CertificateBuilder cbld, - PublicKey subjKey, PublicKey authKey) throws IOException { - cbld.addSubjectKeyIdExt(subjKey); - cbld.addAuthorityKeyIdExt(authKey); - } - - private static void addCommonCAExts(CertificateBuilder cbld) - throws IOException { - cbld.addBasicConstraintsExt(true, true, -1); - // Set key usage bits for digitalSignature, keyCertSign and cRLSign - boolean[] kuBitSettings = {true, false, false, false, false, true, - true, false, false}; - cbld.addKeyUsageExt(kuBitSettings); - } - - /** - * Helper routine that dumps only a few cert fields rather than - * the whole toString() output. - * - * @param cert an X509Certificate to be displayed - * - * @return the String output of the issuer, subject and - * serial number - */ - private static String certInfo(X509Certificate cert) { - StringBuilder sb = new StringBuilder(); - sb.append("Issuer: ").append(cert.getIssuerX500Principal()). - append("\n"); - sb.append("Subject: ").append(cert.getSubjectX500Principal()). - append("\n"); - sb.append("Serial: ").append(cert.getSerialNumber()).append("\n"); - return sb.toString(); - } - - private static class TestCase { - public final String testName; - public final ByteBuffer data; - public final boolean statReqEnabled; - public final boolean statReqV2Enabled; - - TestCase(String name, ByteBuffer buffer, boolean srEn, boolean srv2En) { - testName = (name != null) ? name : ""; - data = Objects.requireNonNull(buffer, - "TestCase requires a non-null ByteBuffer"); - statReqEnabled = srEn; - statReqV2Enabled = srv2En; - } - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/StatusResponseManagerTests.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/StatusResponseManagerTests.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/StatusResponseManagerTests.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/StatusResponseManagerTests.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,460 +0,0 @@ -/* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.io.IOException; -import java.math.BigInteger; -import java.security.cert.*; -import java.util.*; -import java.security.KeyPair; -import java.security.KeyPairGenerator; -import java.security.KeyStore; -import java.security.PublicKey; -import java.util.concurrent.TimeUnit; - -import sun.security.testlibrary.SimpleOCSPServer; -import sun.security.testlibrary.CertificateBuilder; - -/* - * Checks that the hash value for a certificate's issuer name is generated - * correctly. Requires any certificate that is not self-signed. - * - * NOTE: this test uses Sun private classes which are subject to change. - */ -public class StatusResponseManagerTests { - - private static final boolean debug = true; - private static final boolean ocspDebug = false; - - // PKI components we will need for this test - static String passwd = "passphrase"; - static String ROOT_ALIAS = "root"; - static String INT_ALIAS = "intermediate"; - static String SSL_ALIAS = "ssl"; - static KeyStore rootKeystore; // Root CA Keystore - static KeyStore intKeystore; // Intermediate CA Keystore - static KeyStore serverKeystore; // SSL Server Keystore - static KeyStore trustStore; // SSL Client trust store - static X509Certificate rootCert; - static X509Certificate intCert; - static X509Certificate sslCert; - static SimpleOCSPServer rootOcsp; // Root CA OCSP Responder - static int rootOcspPort; // Port number for root OCSP - static SimpleOCSPServer intOcsp; // Intermediate CA OCSP Responder - static int intOcspPort; // Port number for intermed. OCSP - - static X509Certificate[] chain; - - public static void main(String[] args) throws Exception { - Map testList = - new LinkedHashMap() {{ - put("Basic OCSP fetch test", testOcspFetch); - put("Clear StatusResponseManager cache", testClearSRM); - put("Basic OCSP_MULTI fetch test", testOcspMultiFetch); - put("Test Cache Expiration", testCacheExpiry); - }}; - - // Create the CAs and OCSP responders - createPKI(); - - // Grab the certificates and make a chain we can reuse for tests - sslCert = (X509Certificate)serverKeystore.getCertificate(SSL_ALIAS); - intCert = (X509Certificate)intKeystore.getCertificate(INT_ALIAS); - rootCert = (X509Certificate)rootKeystore.getCertificate(ROOT_ALIAS); - chain = new X509Certificate[3]; - chain[0] = sslCert; - chain[1] = intCert; - chain[2] = rootCert; - - TestUtils.runTests(testList); - - intOcsp.stop(); - rootOcsp.stop(); - } - - // Test a simple RFC 6066 server-side fetch - public static final TestCase testOcspFetch = new TestCase() { - @Override - public Map.Entry runTest() { - StatusResponseManager srm = new StatusResponseManager(); - Boolean pass = Boolean.FALSE; - String message = null; - StatusRequest oReq = new OCSPStatusRequest(); - - try { - // Get OCSP responses for non-root certs in the chain - Map responseMap = srm.get( - StatusRequestType.OCSP, oReq, chain, 5000, - TimeUnit.MILLISECONDS); - - // There should be one entry in the returned map and - // one entry in the cache when the operation is complete. - if (responseMap.size() != 1) { - message = "Incorrect number of responses: expected 1, got " - + responseMap.size(); - } else if (!responseMap.containsKey(sslCert)) { - message = "Response map key is incorrect, expected " + - sslCert.getSubjectX500Principal().toString(); - } else if (srm.size() != 1) { - message = "Incorrect number of cache entries: " + - "expected 1, got " + srm.size(); - } else { - pass = Boolean.TRUE; - } - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test clearing the StatusResponseManager cache. - public static final TestCase testClearSRM = new TestCase() { - @Override - public Map.Entry runTest() { - StatusResponseManager srm = new StatusResponseManager(); - Boolean pass = Boolean.FALSE; - String message = null; - StatusRequest oReq = new OCSPStatusRequest(); - - try { - // Get OCSP responses for non-root certs in the chain - srm.get(StatusRequestType.OCSP_MULTI, oReq, chain, 5000, - TimeUnit.MILLISECONDS); - - // There should be two entries in the returned map and - // two entries in the cache when the operation is complete. - if (srm.size() != 2) { - message = "Incorrect number of responses: expected 2, got " - + srm.size(); - } else { - // Next, clear the SRM, then check the size again - srm.clear(); - if (srm.size() != 0) { - message = "Incorrect number of responses: expected 0," + - " got " + srm.size(); - } else { - pass = Boolean.TRUE; - } - } - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test a simple RFC 6961 server-side fetch - public static final TestCase testOcspMultiFetch = new TestCase() { - @Override - public Map.Entry runTest() { - StatusResponseManager srm = new StatusResponseManager(); - Boolean pass = Boolean.FALSE; - String message = null; - StatusRequest oReq = new OCSPStatusRequest(); - - try { - // Get OCSP responses for non-root certs in the chain - Map responseMap = srm.get( - StatusRequestType.OCSP_MULTI, oReq, chain, 5000, - TimeUnit.MILLISECONDS); - - // There should be two entries in the returned map and - // two entries in the cache when the operation is complete. - if (responseMap.size() != 2) { - message = "Incorrect number of responses: expected 2, got " - + responseMap.size(); - } else if (!responseMap.containsKey(sslCert) || - !responseMap.containsKey(intCert)) { - message = "Response map keys are incorrect, expected " + - sslCert.getSubjectX500Principal().toString() + - " and " + - intCert.getSubjectX500Principal().toString(); - } else if (srm.size() != 2) { - message = "Incorrect number of cache entries: " + - "expected 2, got " + srm.size(); - } else { - pass = Boolean.TRUE; - } - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - // Test cache expiration - public static final TestCase testCacheExpiry = new TestCase() { - @Override - public Map.Entry runTest() { - // For this test, we will set the cache expiry to 5 seconds - System.setProperty("jdk.tls.stapling.cacheLifetime", "5"); - StatusResponseManager srm = new StatusResponseManager(); - Boolean pass = Boolean.FALSE; - String message = null; - StatusRequest oReq = new OCSPStatusRequest(); - - try { - // Get OCSP responses for non-root certs in the chain - srm.get(StatusRequestType.OCSP_MULTI, oReq, chain, 5000, - TimeUnit.MILLISECONDS); - - // There should be two entries in the returned map and - // two entries in the cache when the operation is complete. - if (srm.size() != 2) { - message = "Incorrect number of responses: expected 2, got " - + srm.size(); - } else { - // Next, wait for more than 5 seconds so the responses - // in the SRM will expire. - Thread.sleep(7000); - if (srm.size() != 0) { - message = "Incorrect number of responses: expected 0," + - " got " + srm.size(); - } else { - pass = Boolean.TRUE; - } - } - } catch (Exception e) { - e.printStackTrace(System.out); - message = e.getClass().getName(); - } - - // Set the cache lifetime back to the default - System.setProperty("jdk.tls.stapling.cacheLifetime", ""); - return new AbstractMap.SimpleEntry<>(pass, message); - } - }; - - /** - * Creates the PKI components necessary for this test, including - * Root CA, Intermediate CA and SSL server certificates, the keystores - * for each entity, a client trust store, and starts the OCSP responders. - */ - private static void createPKI() throws Exception { - CertificateBuilder cbld = new CertificateBuilder(); - KeyPairGenerator keyGen = KeyPairGenerator.getInstance("RSA"); - keyGen.initialize(2048); - KeyStore.Builder keyStoreBuilder = - KeyStore.Builder.newInstance("PKCS12", null, - new KeyStore.PasswordProtection(passwd.toCharArray())); - - // Generate Root, IntCA, EE keys - KeyPair rootCaKP = keyGen.genKeyPair(); - log("Generated Root CA KeyPair"); - KeyPair intCaKP = keyGen.genKeyPair(); - log("Generated Intermediate CA KeyPair"); - KeyPair sslKP = keyGen.genKeyPair(); - log("Generated SSL Cert KeyPair"); - - // Set up the Root CA Cert - cbld.setSubjectName("CN=Root CA Cert, O=SomeCompany"); - cbld.setPublicKey(rootCaKP.getPublic()); - cbld.setSerialNumber(new BigInteger("1")); - // Make a 3 year validity starting from 60 days ago - long start = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(60); - long end = start + TimeUnit.DAYS.toMillis(1085); - cbld.setValidity(new Date(start), new Date(end)); - addCommonExts(cbld, rootCaKP.getPublic(), rootCaKP.getPublic()); - addCommonCAExts(cbld); - // Make our Root CA Cert! - X509Certificate rootCert = cbld.build(null, rootCaKP.getPrivate(), - "SHA256withRSA"); - log("Root CA Created:\n" + certInfo(rootCert)); - - // Now build a keystore and add the keys and cert - rootKeystore = keyStoreBuilder.getKeyStore(); - Certificate[] rootChain = {rootCert}; - rootKeystore.setKeyEntry(ROOT_ALIAS, rootCaKP.getPrivate(), - passwd.toCharArray(), rootChain); - - // Now fire up the OCSP responder - rootOcsp = new SimpleOCSPServer(rootKeystore, passwd, ROOT_ALIAS, null); - rootOcsp.enableLog(ocspDebug); - rootOcsp.setNextUpdateInterval(3600); - rootOcsp.start(); - - // Wait 5 seconds for server ready - for (int i = 0; (i < 100 && !rootOcsp.isServerReady()); i++) { - Thread.sleep(50); - } - if (!rootOcsp.isServerReady()) { - throw new RuntimeException("Server not ready yet"); - } - - rootOcspPort = rootOcsp.getPort(); - String rootRespURI = "http://localhost:" + rootOcspPort; - log("Root OCSP Responder URI is " + rootRespURI); - - // Now that we have the root keystore and OCSP responder we can - // create our intermediate CA. - cbld.reset(); - cbld.setSubjectName("CN=Intermediate CA Cert, O=SomeCompany"); - cbld.setPublicKey(intCaKP.getPublic()); - cbld.setSerialNumber(new BigInteger("100")); - // Make a 2 year validity starting from 30 days ago - start = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(30); - end = start + TimeUnit.DAYS.toMillis(730); - cbld.setValidity(new Date(start), new Date(end)); - addCommonExts(cbld, intCaKP.getPublic(), rootCaKP.getPublic()); - addCommonCAExts(cbld); - cbld.addAIAExt(Collections.singletonList(rootRespURI)); - // Make our Intermediate CA Cert! - X509Certificate intCaCert = cbld.build(rootCert, rootCaKP.getPrivate(), - "SHA256withRSA"); - log("Intermediate CA Created:\n" + certInfo(intCaCert)); - - // Provide intermediate CA cert revocation info to the Root CA - // OCSP responder. - Map revInfo = - new HashMap<>(); - revInfo.put(intCaCert.getSerialNumber(), - new SimpleOCSPServer.CertStatusInfo( - SimpleOCSPServer.CertStatus.CERT_STATUS_GOOD)); - rootOcsp.updateStatusDb(revInfo); - - // Now build a keystore and add the keys, chain and root cert as a TA - intKeystore = keyStoreBuilder.getKeyStore(); - Certificate[] intChain = {intCaCert, rootCert}; - intKeystore.setKeyEntry(INT_ALIAS, intCaKP.getPrivate(), - passwd.toCharArray(), intChain); - intKeystore.setCertificateEntry(ROOT_ALIAS, rootCert); - - // Now fire up the Intermediate CA OCSP responder - intOcsp = new SimpleOCSPServer(intKeystore, passwd, - INT_ALIAS, null); - intOcsp.enableLog(ocspDebug); - intOcsp.setNextUpdateInterval(3600); - intOcsp.start(); - - // Wait 5 seconds for server ready - for (int i = 0; (i < 100 && !intOcsp.isServerReady()); i++) { - Thread.sleep(50); - } - if (!intOcsp.isServerReady()) { - throw new RuntimeException("Server not ready yet"); - } - - intOcspPort = intOcsp.getPort(); - String intCaRespURI = "http://localhost:" + intOcspPort; - log("Intermediate CA OCSP Responder URI is " + intCaRespURI); - - // Last but not least, let's make our SSLCert and add it to its own - // Keystore - cbld.reset(); - cbld.setSubjectName("CN=SSLCertificate, O=SomeCompany"); - cbld.setPublicKey(sslKP.getPublic()); - cbld.setSerialNumber(new BigInteger("4096")); - // Make a 1 year validity starting from 7 days ago - start = System.currentTimeMillis() - TimeUnit.DAYS.toMillis(7); - end = start + TimeUnit.DAYS.toMillis(365); - cbld.setValidity(new Date(start), new Date(end)); - - // Add extensions - addCommonExts(cbld, sslKP.getPublic(), intCaKP.getPublic()); - boolean[] kuBits = {true, false, true, false, false, false, - false, false, false}; - cbld.addKeyUsageExt(kuBits); - List ekuOids = new ArrayList<>(); - ekuOids.add("1.3.6.1.5.5.7.3.1"); - ekuOids.add("1.3.6.1.5.5.7.3.2"); - cbld.addExtendedKeyUsageExt(ekuOids); - cbld.addSubjectAltNameDNSExt(Collections.singletonList("localhost")); - cbld.addAIAExt(Collections.singletonList(intCaRespURI)); - // Make our SSL Server Cert! - X509Certificate sslCert = cbld.build(intCaCert, intCaKP.getPrivate(), - "SHA256withRSA"); - log("SSL Certificate Created:\n" + certInfo(sslCert)); - - // Provide SSL server cert revocation info to the Intermeidate CA - // OCSP responder. - revInfo = new HashMap<>(); - revInfo.put(sslCert.getSerialNumber(), - new SimpleOCSPServer.CertStatusInfo( - SimpleOCSPServer.CertStatus.CERT_STATUS_GOOD)); - intOcsp.updateStatusDb(revInfo); - - // Now build a keystore and add the keys, chain and root cert as a TA - serverKeystore = keyStoreBuilder.getKeyStore(); - Certificate[] sslChain = {sslCert, intCaCert, rootCert}; - serverKeystore.setKeyEntry(SSL_ALIAS, sslKP.getPrivate(), - passwd.toCharArray(), sslChain); - serverKeystore.setCertificateEntry(ROOT_ALIAS, rootCert); - - // And finally a Trust Store for the client - trustStore = keyStoreBuilder.getKeyStore(); - trustStore.setCertificateEntry(ROOT_ALIAS, rootCert); - } - - private static void addCommonExts(CertificateBuilder cbld, - PublicKey subjKey, PublicKey authKey) throws IOException { - cbld.addSubjectKeyIdExt(subjKey); - cbld.addAuthorityKeyIdExt(authKey); - } - - private static void addCommonCAExts(CertificateBuilder cbld) - throws IOException { - cbld.addBasicConstraintsExt(true, true, -1); - // Set key usage bits for digitalSignature, keyCertSign and cRLSign - boolean[] kuBitSettings = {true, false, false, false, false, true, - true, false, false}; - cbld.addKeyUsageExt(kuBitSettings); - } - - /** - * Helper routine that dumps only a few cert fields rather than - * the whole toString() output. - * - * @param cert An X509Certificate to be displayed - * - * @return The {@link String} output of the issuer, subject and - * serial number - */ - private static String certInfo(X509Certificate cert) { - StringBuilder sb = new StringBuilder(); - sb.append("Issuer: ").append(cert.getIssuerX500Principal()). - append("\n"); - sb.append("Subject: ").append(cert.getSubjectX500Principal()). - append("\n"); - sb.append("Serial: ").append(cert.getSerialNumber()).append("\n"); - return sb.toString(); - } - - /** - * Log a message on stdout - * - * @param message The message to log - */ - private static void log(String message) { - if (debug) { - System.out.println(message); - } - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/TestCase.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/TestCase.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/TestCase.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/TestCase.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.util.Map; - -public interface TestCase { - Map.Entry runTest(); -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/TestUtils.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/TestUtils.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/TestUtils.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/java.base/sun/security/ssl/TestUtils.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -package sun.security.ssl; - -import java.nio.ByteBuffer; -import java.util.Arrays; -import java.util.Map; - -public class TestUtils { - - // private constructor to prevent instantiation for this utility class - private TestUtils() { - throw new AssertionError(); - } - - public static void runTests(Map testList) { - int testNo = 0; - int numberFailed = 0; - Map.Entry result; - - System.out.println("============ Tests ============"); - for (String testName : testList.keySet()) { - System.out.println("Test " + ++testNo + ": " + testName); - result = testList.get(testName).runTest(); - System.out.print("Result: " + (result.getKey() ? "PASS" : "FAIL")); - System.out.println(" " + - (result.getValue() != null ? result.getValue() : "")); - System.out.println("-------------------------------------------"); - if (!result.getKey()) { - numberFailed++; - } - } - - System.out.println("End Results: " + (testList.size() - numberFailed) + - " Passed" + ", " + numberFailed + " Failed."); - if (numberFailed > 0) { - throw new RuntimeException( - "One or more tests failed, see test output for details"); - } - } - - public static void dumpBytes(byte[] data) { - dumpBytes(ByteBuffer.wrap(data)); - } - - public static void dumpBytes(ByteBuffer data) { - int i = 0; - - data.mark(); - while (data.hasRemaining()) { - if (i % 16 == 0 && i != 0) { - System.out.print("\n"); - } - System.out.print(String.format("%02X ", data.get())); - i++; - } - System.out.print("\n"); - data.reset(); - } - - public static void valueCheck(byte[] array1, byte[] array2) { - if (!Arrays.equals(array1, array2)) { - throw new RuntimeException("Array mismatch"); - } - } - - // Compares a range of bytes at specific offsets in each array - public static void valueCheck(byte[] array1, byte[] array2, int skip1, - int skip2, int length) { - ByteBuffer buf1 = ByteBuffer.wrap(array1); - ByteBuffer buf2 = ByteBuffer.wrap(array2); - - // Skip past however many bytes are requested in both buffers - buf1.position(skip1); - buf2.position(skip2); - - // Reset the limits on each buffer to account for the length - buf1.limit(buf1.position() + length); - buf2.limit(buf2.position() + length); - - if (!buf1.equals(buf2)) { - throw new RuntimeException("Array range mismatch"); - } - } - - // Concatenate 1 or more arrays - public static byte[] gatherBuffers(byte[]... arrays) { - int totalLength = 0; - for (byte[] ar : arrays) { - totalLength += ar != null ? ar.length : 0; - } - - byte[] resultBuf = new byte[totalLength]; - int offset = 0; - for (byte[] ar : arrays) { - if (ar != null) { - System.arraycopy(ar, 0, resultBuf, offset, ar.length); - offset += ar.length; - } - } - return resultBuf; - } -} diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/RunStatReqSelect.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/RunStatReqSelect.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/RunStatReqSelect.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/RunStatReqSelect.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8132943 - * @library ../../../../java/security/testlibrary - * @build CertificateBuilder SimpleOCSPServer - * @run main/othervm java.base/sun.security.ssl.StatusReqSelection - * @summary ServerHandshaker may select non-empty OCSPStatusRequest - * structures when Responder ID selection is not supported - */ - diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/TEST.properties openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/TEST.properties --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/TEST.properties 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/TEST.properties 1970-01-01 00:00:00.000000000 +0000 @@ -1,6 +0,0 @@ -modules = \ - java.base/sun.security.provider.certpath \ - java.base/sun.security.util \ - java.base/sun.security.x509 \ - java.base/sun.security.ssl -bootclasspath.dirs=. diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/TestRun.java openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/TestRun.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/StatusStapling/TestRun.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/StatusStapling/TestRun.java 1970-01-01 00:00:00.000000000 +0000 @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * This code is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License version 2 only, as - * published by the Free Software Foundation. - * - * This code is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * version 2 for more details (a copy is included in the LICENSE file that - * accompanied this code). - * - * You should have received a copy of the GNU General Public License version - * 2 along with this work; if not, write to the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - * - * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA - * or visit www.oracle.com if you need additional information or have any - * questions. - */ - -/* - * @test - * @bug 8046321 - * @library ../../../../java/security/testlibrary - * @build CertificateBuilder SimpleOCSPServer - * @run main/othervm java.base/sun.security.ssl.CertStatusReqExtensionTests - * @run main/othervm java.base/sun.security.ssl.CertStatusReqItemV2Tests - * @run main/othervm java.base/sun.security.ssl.CertStatusReqListV2ExtensionTests - * @run main/othervm java.base/sun.security.ssl.OCSPStatusRequestTests - * @run main/othervm -Djavax.net.debug=ssl:respmgr java.base/sun.security.ssl.StatusResponseManagerTests - * @summary OCSP Stapling for TLS - */ - diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java openjdk-11-11~24/test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/X509TrustManagerImpl/BasicConstraints.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -357,6 +357,7 @@ SSLSocket sslSocket = (SSLSocket)sslsf.createSocket("localhost", serverPort); + sslSocket.setEnabledProtocols(new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" }); try { InputStream sslIS = sslSocket.getInputStream(); OutputStream sslOS = sslSocket.getOutputStream(); diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/X509TrustManagerImpl/CertRequestOverflow.java openjdk-11-11~24/test/jdk/sun/security/ssl/X509TrustManagerImpl/CertRequestOverflow.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/X509TrustManagerImpl/CertRequestOverflow.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/X509TrustManagerImpl/CertRequestOverflow.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2012, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,6 +96,9 @@ SSLServerSocket sslServerSocket = (SSLServerSocket) sslssf.createServerSocket(serverPort); serverPort = sslServerSocket.getLocalPort(); + if (debug) { + System.out.println("Server port is " + serverPort); + } // enable endpoint identification // ignore, we may test the feature when known how to parse client @@ -153,6 +156,10 @@ SSLSocketFactory sslsf = getContext(false).getSocketFactory(); SSLSocket sslSocket = (SSLSocket) sslsf.createSocket("localhost", serverPort); + if (debug) { + System.out.println("Connected to: " + + sslSocket.getRemoteSocketAddress()); + } // enable endpoint identification SSLParameters params = sslSocket.getSSLParameters(); @@ -214,7 +221,7 @@ tms = new TrustManager[] {clientTM}; } - SSLContext ctx = SSLContext.getInstance("TLS"); + SSLContext ctx = SSLContext.getInstance("TLSv1.2"); ctx.init(kmf.getKeyManagers(), tms, null); return ctx; @@ -243,17 +250,19 @@ return serverChecked; } - + @Override public void checkClientTrusted(X509Certificate chain[], String authType) throws CertificateException { tm.checkClientTrusted(chain, authType); } + @Override public void checkServerTrusted(X509Certificate chain[], String authType) throws CertificateException { tm.checkServerTrusted(chain, authType); } + @Override public X509Certificate[] getAcceptedIssuers() { // (hack code) increase the size of the returned array to make a // overflow CertificateRequest. @@ -268,24 +277,28 @@ return issuersList.toArray(issuers); } + @Override public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { clientChecked = true; tm.checkClientTrusted(chain, authType); } + @Override public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) throws CertificateException { serverChecked = true; tm.checkServerTrusted(chain, authType); } + @Override public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException { clientChecked = true; tm.checkClientTrusted(chain, authType); } + @Override public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) throws CertificateException { serverChecked = true; @@ -357,6 +370,7 @@ void startServer(boolean newThread) throws Exception { if (newThread) { serverThread = new Thread() { + @Override public void run() { try { doServerSide(); @@ -381,6 +395,7 @@ void startClient(boolean newThread) throws Exception { if (newThread) { clientThread = new Thread() { + @Override public void run() { try { doClientSide(); diff -Nru openjdk-11-11~19/test/jdk/sun/security/ssl/X509TrustManagerImpl/SelfIssuedCert.java openjdk-11-11~24/test/jdk/sun/security/ssl/X509TrustManagerImpl/SelfIssuedCert.java --- openjdk-11-11~19/test/jdk/sun/security/ssl/X509TrustManagerImpl/SelfIssuedCert.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/ssl/X509TrustManagerImpl/SelfIssuedCert.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2009, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2009, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -209,6 +209,7 @@ SSLSocket sslSocket = (SSLSocket)sslsf.createSocket("localhost", serverPort); + sslSocket.setEnabledProtocols(new String[] { "TLSv1", "TLSv1.1", "TLSv1.2" }); InputStream sslIS = sslSocket.getInputStream(); OutputStream sslOS = sslSocket.getOutputStream(); diff -Nru openjdk-11-11~19/test/jdk/sun/security/tools/jarsigner/AltProvider.java openjdk-11-11~24/test/jdk/sun/security/tools/jarsigner/AltProvider.java --- openjdk-11-11~19/test/jdk/sun/security/tools/jarsigner/AltProvider.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/tools/jarsigner/AltProvider.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,7 +23,7 @@ /* * @test - * @bug 4906940 8130302 + * @bug 4906940 8130302 8194152 * @summary -providerPath, -providerClass, -addprovider, and -providerArg * @library /test/lib * @modules java.base/jdk.internal.misc @@ -159,6 +159,11 @@ private static OutputAnalyzer tool(String tool, String args) throws Throwable { JDKToolLauncher l = JDKToolLauncher.createUsingTestJDK(tool); + + // Set locale to en-US so that the output are not translated into other languages. + l.addVMArg("-Duser.language=en"); + l.addVMArg("-Duser.country=US"); + for (String a: args.split("\\s+")) { if (a.startsWith("-J")) { l.addVMArg(a.substring(2)); diff -Nru openjdk-11-11~19/test/jdk/sun/security/tools/jarsigner/warnings/NoTimestampTest.java openjdk-11-11~24/test/jdk/sun/security/tools/jarsigner/warnings/NoTimestampTest.java --- openjdk-11-11~19/test/jdk/sun/security/tools/jarsigner/warnings/NoTimestampTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/tools/jarsigner/warnings/NoTimestampTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -22,12 +22,13 @@ */ import java.util.Date; +import java.util.Locale; import jdk.testlibrary.OutputAnalyzer; import jdk.test.lib.util.JarUtils; /** * @test - * @bug 8024302 8026037 + * @bug 8024302 8026037 8196213 * @summary Checks warnings if -tsa and -tsacert options are not specified * @library /lib/testlibrary /test/lib ../ * @build jdk.test.lib.util.JarUtils @@ -40,8 +41,16 @@ * and checks that proper warnings are shown. */ public static void main(String[] args) throws Throwable { - NoTimestampTest test = new NoTimestampTest(); - test.start(); + Locale reservedLocale = Locale.getDefault(); + Locale.setDefault(Locale.US); + + try { + NoTimestampTest test = new NoTimestampTest(); + test.start(); + } finally { + // Restore the reserved locale + Locale.setDefault(reservedLocale); + } } private void start() throws Throwable { diff -Nru openjdk-11-11~19/test/jdk/sun/security/tools/keytool/PrintSSL.java openjdk-11-11~24/test/jdk/sun/security/tools/keytool/PrintSSL.java --- openjdk-11-11~19/test/jdk/sun/security/tools/keytool/PrintSSL.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/security/tools/keytool/PrintSSL.java 2018-07-25 15:36:46.000000000 +0000 @@ -53,7 +53,7 @@ // make sure that "-printcert" works with weak algorithms OutputAnalyzer out = SecurityTools.keytool("-genkeypair " + "-keystore keystore -storepass passphrase " - + "-keypass passphrase -keyalg rsa -keysize 512 " + + "-keypass passphrase -keyalg rsa -keysize 1024 " + "-sigalg MD5withRSA -alias rsa_alias -dname CN=Server"); System.out.println(out.getOutput()); out.shouldHaveExitValue(0); @@ -92,7 +92,7 @@ System.setProperty("javax.net.ssl.keyStorePassword", "passphrase"); System.setProperty("javax.net.ssl.keyStore", "keystore"); SSLServerSocketFactory sslssf = - (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); + (SSLServerSocketFactory) SSLServerSocketFactory.getDefault(); try (ServerSocket server = sslssf.createServerSocket(0)) { this.serverPort = server.getLocalPort(); System.out.printf("%nServer started on: %s%n", getServerPort()); @@ -110,5 +110,5 @@ } } - } + diff -Nru openjdk-11-11~19/test/jdk/sun/tools/jhsdb/AlternateHashingTest.java openjdk-11-11~24/test/jdk/sun/tools/jhsdb/AlternateHashingTest.java --- openjdk-11-11~19/test/jdk/sun/tools/jhsdb/AlternateHashingTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/tools/jhsdb/AlternateHashingTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,10 +21,11 @@ * questions. */ -/* +/** * @test * @bug 8030750 * @summary Test alternate hashing of strings in Serviceability Agent. + * @requires vm.hasSAandCanAttach * @library /test/lib * @library /lib/testlibrary * @compile AlternateHashingTest.java @@ -111,13 +112,6 @@ public static void main(String[] args) throws Exception { - if (!Platform.shouldSAAttach()) { - // Silently skip the test if we don't have enough permissions to attach - System.err.println("Error! Insufficient permissions to attach - test skipped."); - return; - } - - testAltHashing(); // The test throws RuntimeException on error. diff -Nru openjdk-11-11~19/test/jdk/sun/tools/jhsdb/BasicLauncherTest.java openjdk-11-11~24/test/jdk/sun/tools/jhsdb/BasicLauncherTest.java --- openjdk-11-11~19/test/jdk/sun/tools/jhsdb/BasicLauncherTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/tools/jhsdb/BasicLauncherTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,11 +21,12 @@ * questions. */ -/* +/** * @test * @summary Basic test for jhsdb launcher * @library /test/lib * @library /lib/testlibrary + * @requires vm.hasSAandCanAttach * @build jdk.testlibrary.* * @build jdk.test.lib.apps.* * @run main BasicLauncherTest @@ -200,12 +201,6 @@ public static void main(String[] args) throws Exception { - if (!Platform.shouldSAAttach()) { - // Silently skip the test if we don't have enough permissions to attach - System.err.println("Error! Insufficient permissions to attach."); - return; - } - launchCLHSDB(); launch("compiler detected", null, "jmap", "--clstats"); diff -Nru openjdk-11-11~19/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java openjdk-11-11~24/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java --- openjdk-11-11~19/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/tools/jhsdb/heapconfig/JMapHeapConfigTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -32,11 +32,12 @@ import jdk.testlibrary.Utils; import jdk.test.lib.Platform; -/* +/** * @test * @bug 8042397 * @summary Unit test for jmap utility test heap configuration reader * + * @requires vm.hasSAandCanAttach * @library /test/lib * @library /lib/testlibrary * @modules java.management @@ -119,12 +120,6 @@ public static void main(String[] args) throws Exception { System.out.println("Starting JMapHeapConfigTest"); - if (!Platform.shouldSAAttach()) { - // Silently skip the test if we don't have enough permissions to attach - System.err.println("Error! Insufficient permissions to attach."); - return; - } - if (!LingeredApp.isLastModifiedWorking()) { // Exact behaviour of the test depends to operating system and the test nature, // so just print the warning and continue diff -Nru openjdk-11-11~19/test/jdk/sun/tools/jhsdb/HeapDumpTest.java openjdk-11-11~24/test/jdk/sun/tools/jhsdb/HeapDumpTest.java --- openjdk-11-11~19/test/jdk/sun/tools/jhsdb/HeapDumpTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/tools/jhsdb/HeapDumpTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -21,10 +21,11 @@ * questions. */ -/* +/** * @test * @bug 8163346 * @summary Test hashing of extended characters in Serviceability Agent. + * @requires vm.hasSAandCanAttach * @library /test/lib * @library /lib/testlibrary * @compile -encoding utf8 HeapDumpTest.java @@ -125,13 +126,6 @@ public static void main(String[] args) throws Exception { - if (!Platform.shouldSAAttach()) { - // Silently skip the test if we don't have enough permissions to attach - System.err.println("Error! Insufficient permissions to attach - test skipped."); - return; - } - - testHeapDump(); // The test throws RuntimeException on error. diff -Nru openjdk-11-11~19/test/jdk/sun/tools/jrunscript/jrunscript-eTest.sh openjdk-11-11~24/test/jdk/sun/tools/jrunscript/jrunscript-eTest.sh --- openjdk-11-11~19/test/jdk/sun/tools/jrunscript/jrunscript-eTest.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/tools/jrunscript/jrunscript-eTest.sh 2018-07-25 15:36:46.000000000 +0000 @@ -42,7 +42,7 @@ # -e option with JavaScript explicitly choosen as language rm -f jrunscript-eTest.out 2>/dev/null -${JRUNSCRIPT} -J-Djava.awt.headless=true -l nashorn -e "println('hello')" > jrunscript-eTest.out 2>&1 +${JRUNSCRIPT} -J-Dnashorn.args.prepend=--no-deprecation-warning -J-Djava.awt.headless=true -l nashorn -e "println('hello')" > jrunscript-eTest.out 2>&1 $golden_diff jrunscript-eTest.out ${TESTSRC}/dash-e.out if [ $? != 0 ] diff -Nru openjdk-11-11~19/test/jdk/sun/tools/jrunscript/jrunscript-fTest.sh openjdk-11-11~24/test/jdk/sun/tools/jrunscript/jrunscript-fTest.sh --- openjdk-11-11~19/test/jdk/sun/tools/jrunscript/jrunscript-fTest.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/tools/jrunscript/jrunscript-fTest.sh 2018-07-25 15:36:46.000000000 +0000 @@ -43,7 +43,7 @@ # with -l option rm -f jrunscript-fTest.out 2>/dev/null -${JRUNSCRIPT} -J-Djava.awt.headless=true -l nashorn -f ${TESTSRC}/hello.js > jrunscript-fTest.out 2>&1 +${JRUNSCRIPT} -J-Dnashorn.args.prepend=--no-deprecation-warning -J-Djava.awt.headless=true -l nashorn -f ${TESTSRC}/hello.js > jrunscript-fTest.out 2>&1 $golden_diff jrunscript-fTest.out ${TESTSRC}/dash-f.out if [ $? != 0 ] diff -Nru openjdk-11-11~19/test/jdk/sun/tools/jrunscript/jrunscriptTest.sh openjdk-11-11~24/test/jdk/sun/tools/jrunscript/jrunscriptTest.sh --- openjdk-11-11~19/test/jdk/sun/tools/jrunscript/jrunscriptTest.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/sun/tools/jrunscript/jrunscriptTest.sh 2018-07-25 15:36:46.000000000 +0000 @@ -40,7 +40,7 @@ fi rm -f jrunscriptTest.out 2>/dev/null -${JRUNSCRIPT} -J-Djava.awt.headless=true -l nashorn > jrunscriptTest.out 2>&1 < jrunscriptTest.out 2>&1 < ALIAS_LOCALES + = List.of(Locale.forLanguageTag("az-AZ"), Locale.forLanguageTag("bs-BA"), + Locale.forLanguageTag("ha-Latn-GH"), Locale.forLanguageTag("ha-Latn-NE"), + Locale.forLanguageTag("ha-Latn-NG"), Locale.forLanguageTag("i-lux"), + Locale.forLanguageTag("kk-Cyrl-KZ"), Locale.forLanguageTag("ks-Arab-IN"), + Locale.forLanguageTag("ky-Cyrl-KG"), Locale.forLanguageTag("lb"), + Locale.forLanguageTag("lb"), Locale.forLanguageTag("mn-Cyrl-MN"), + Locale.forLanguageTag("mo"), Locale.forLanguageTag("ms-Latn-BN"), + Locale.forLanguageTag("ms-Latn-MY"), Locale.forLanguageTag("ms-Latn-SG"), + Locale.forLanguageTag("pa-IN"), Locale.forLanguageTag("pa-PK"), + Locale.forLanguageTag("scc"), Locale.forLanguageTag("scr"), + Locale.forLanguageTag("sh"), Locale.forLanguageTag("shi-MA"), + Locale.forLanguageTag("sr-BA"), Locale.forLanguageTag("sr-RS"), + Locale.forLanguageTag("sr-XK"), Locale.forLanguageTag("tl"), + Locale.forLanguageTag("tzm-Latn-MA"), Locale.forLanguageTag("ug-Arab-CN"), + Locale.forLanguageTag("uz-AF"), Locale.forLanguageTag("uz-UZ"), + Locale.forLanguageTag("vai-LR"), Locale.forLanguageTag("vai-LR"), + Locale.forLanguageTag("yue-CN"), Locale.forLanguageTag("yue-HK"), + Locale.forLanguageTag("zh-CN"), Locale.forLanguageTag("zh-HK"), + Locale.forLanguageTag("zh-MO"), Locale.forLanguageTag("zh-SG"), + Locale.forLanguageTag("zh-TW")); + + private static final Map CALENDAR_DATA_MAP = Map.of( + Locale.forLanguageTag("zh-CN"), "\u5468\u65E5", + Locale.forLanguageTag("zh-TW"), "\u9031\u65E5"); + private static final Map NAN_DATA_MAP = Map.of( + Locale.forLanguageTag("zh-CN"), "NaN", + Locale.forLanguageTag("zh-TW"), "\u975E\u6578\u503C"); + + public static void main(String[] args) { + testCldrSupportedLocales(); + CALENDAR_DATA_MAP.forEach((k, v) -> testCalendarData(k, v)); + NAN_DATA_MAP.forEach((k, v) -> testNanData(k, v)); + } + + /** + * tests that CLDR provider should return true for alias locales. + * + */ + private static void testCldrSupportedLocales() { + LocaleProviderAdapter cldr = LocaleProviderAdapter.forType(LocaleProviderAdapter.Type.CLDR); + Set availableLocs = Set.of(cldr.getAvailableLocales()); + Set langtags = new HashSet<>(); + availableLocs.forEach(loc -> langtags.add(loc.toLanguageTag())); + ALIAS_LOCALES.stream().filter(loc -> !cldr.isSupportedProviderLocale(loc, langtags)).findAny() + .ifPresent(l -> { + throw new RuntimeException("Locale " + l + + " is not supported by CLDR locale provider"); + }); + } + + private static void testCalendarData(Locale loc, String expected) { + DateFormatSymbols dfs = DateFormatSymbols.getInstance(loc); + String[] shortDays = dfs.getShortWeekdays(); + String actual = shortDays[Calendar.SUNDAY]; + if (!actual.equals(expected)) { + throw new RuntimeException("Calendar data mismatch for locale: " + + loc + ", expected is: " + expected + ", actual is: " + actual); + } + } + + private static void testNanData(Locale loc, String expected) { + DecimalFormatSymbols dfs = DecimalFormatSymbols.getInstance(loc); + String actual = dfs.getNaN(); + if (!actual.equals(expected)) { + throw new RuntimeException("NaN mismatch for locale: " + + loc + ", expected is: " + expected + ", actual is: " + actual); + } + } +} diff -Nru openjdk-11-11~19/test/jdk/TEST.ROOT openjdk-11-11~24/test/jdk/TEST.ROOT --- openjdk-11-11~19/test/jdk/TEST.ROOT 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/TEST.ROOT 2018-07-25 15:36:46.000000000 +0000 @@ -40,6 +40,9 @@ vm.gc.Z \ vm.graal.enabled \ vm.cds \ + vm.hasSA \ + vm.hasSAandCanAttach \ + vm.hasJFR \ docker.support \ release.implementor diff -Nru openjdk-11-11~19/test/jdk/tools/jimage/JImageExtractTest.java openjdk-11-11~24/test/jdk/tools/jimage/JImageExtractTest.java --- openjdk-11-11~19/test/jdk/tools/jimage/JImageExtractTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/jimage/JImageExtractTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -34,11 +34,10 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.nio.file.attribute.FileAttribute; -import java.nio.file.attribute.PosixFilePermission; -import java.nio.file.attribute.PosixFilePermissions; +import java.nio.file.attribute.*; import java.util.Arrays; import java.util.HashSet; +import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -47,12 +46,13 @@ public class JImageExtractTest extends JImageCliTest { public void testExtract() throws IOException { + Set notJImageModules = Files.walk(Paths.get("."),1).collect(Collectors.toSet()); jimage("extract", getImagePath()) .assertSuccess() .resultChecker(r -> { assertTrue(r.output.isEmpty(), "Output is not expected"); }); - verifyExplodedImage(Paths.get(".")); + verifyExplodedImage(Paths.get("."), notJImageModules); } public void testExtractHelp() { @@ -68,12 +68,13 @@ public void testExtractToDir() throws IOException { Path tmp = Files.createTempDirectory(Paths.get("."), getClass().getName()); + Set notJImageModules = Files.walk(tmp,1).collect(Collectors.toSet()); jimage("extract", "--dir", tmp.toString(), getImagePath()) .assertSuccess() .resultChecker(r -> { assertTrue(r.output.isEmpty(), "Output is not expected"); }); - verifyExplodedImage(tmp); + verifyExplodedImage(tmp, notJImageModules); } public void testExtractNoImageSpecified() { @@ -105,13 +106,14 @@ public void testExtractToNotExistingDir() throws IOException { Path tmp = Files.createTempDirectory(Paths.get("."), getClass().getName()); + Set notJImageModules = Files.walk(tmp,1).collect(Collectors.toSet()); Files.delete(tmp); jimage("extract", "--dir", tmp.toString(), getImagePath()) .assertSuccess() .resultChecker(r -> { assertTrue(r.output.isEmpty(), "Output is not expected"); }); - verifyExplodedImage(tmp); + verifyExplodedImage(tmp, notJImageModules); } public void testExtractFromDir() { @@ -132,20 +134,35 @@ // nothing to test return; } - + Set notJImageModules = Files.walk(tmp,1).collect(Collectors.toSet()); jimage("extract", "--dir", symlink.toString(), getImagePath()) .assertSuccess() .resultChecker(r -> { assertTrue(r.output.isEmpty(), "Output is not expected"); }); - verifyExplodedImage(tmp); + verifyExplodedImage(tmp, notJImageModules); } public void testExtractToReadOnlyDir() throws IOException { - Set perms = PosixFilePermissions.fromString("r-xr--r--"); - FileAttribute> atts = PosixFilePermissions.asFileAttribute(perms); - Path tmp = Files.createTempDirectory(Paths.get("."), getClass().getName(), atts); - jimage("extract", "--dir", tmp.toString(), getImagePath()) + Path filePath = Files.createTempDirectory(Paths.get("."), getClass().getName()); + Set supportedAttr = filePath.getFileSystem().supportedFileAttributeViews(); + if (supportedAttr.contains("posix")) { + Files.setPosixFilePermissions(filePath, PosixFilePermissions.fromString("r-xr--r--")); + } else if (supportedAttr.contains("acl")) { + System.out.println("Entered into acl block"); + UserPrincipal fileOwner = Files.getOwner(filePath); + AclFileAttributeView view = Files.getFileAttributeView(filePath, AclFileAttributeView.class); + AclEntry entry = AclEntry.newBuilder() + .setType(AclEntryType.DENY) + .setPrincipal(fileOwner) + .setPermissions(AclEntryPermission.WRITE_DATA) + .setFlags(AclEntryFlag.FILE_INHERIT, AclEntryFlag.DIRECTORY_INHERIT) + .build(); + List acl = view.getAcl(); + acl.add(0, entry); + view.setAcl(acl); + } + jimage("extract", "--dir", filePath.toString(), getImagePath()) .assertFailure() .assertShowsError(); } @@ -167,15 +184,16 @@ .assertShowsError(); } - private void verifyExplodedImage(Path imagePath) throws IOException { + private void verifyExplodedImage(Path imagePath, Set notJImageModules) throws IOException { Set allModules = Files.walk(imagePath, 1).collect(Collectors.toSet()); assertTrue(allModules.stream().anyMatch(p -> "java.base".equals(p.getFileName().toString())), "Exploded image contains java.base module."); - Set badModules = allModules.stream() .filter(p -> !Files.exists(p.resolve("module-info.class"))) .collect(Collectors.toSet()); - assertEquals(badModules, new HashSet() {{ add(imagePath); }}, + // filter bad modules which are not part of jimage + badModules.removeAll(notJImageModules); + assertEquals(badModules, new HashSet() {{}}, "There are no exploded modules with missing 'module-info.class'"); } diff -Nru openjdk-11-11~19/test/jdk/tools/jimage/JImageListTest.java openjdk-11-11~24/test/jdk/tools/jimage/JImageListTest.java --- openjdk-11-11~19/test/jdk/tools/jimage/JImageListTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/jimage/JImageListTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -224,6 +224,8 @@ public static void main(String[] args) throws Throwable { new JImageListTest().runTests(); + // Just to ensure that jimage files will be unmapped + System.gc(); } } diff -Nru openjdk-11-11~19/test/jdk/tools/jjs/jjs-fileTest.sh openjdk-11-11~24/test/jdk/tools/jjs/jjs-fileTest.sh --- openjdk-11-11~19/test/jdk/tools/jjs/jjs-fileTest.sh 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/jjs/jjs-fileTest.sh 2018-07-25 15:36:46.000000000 +0000 @@ -35,7 +35,7 @@ setup rm -f jjs-fileTest.out 2>/dev/null -${JJS} -J-Djava.security.manager ${TESTSRC}/file.js > jjs-fileTest.out 2>&1 +${JJS} --no-deprecation-warning -J-Djava.security.manager ${TESTSRC}/file.js > jjs-fileTest.out 2>&1 $golden_diff jjs-fileTest.out ${TESTSRC}/file.out if [ $? != 0 ] diff -Nru openjdk-11-11~19/test/jdk/tools/launcher/modules/addexports/AddExportsTestWarningError.java openjdk-11-11~24/test/jdk/tools/launcher/modules/addexports/AddExportsTestWarningError.java --- openjdk-11-11~19/test/jdk/tools/launcher/modules/addexports/AddExportsTestWarningError.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/launcher/modules/addexports/AddExportsTestWarningError.java 2018-07-25 15:36:46.000000000 +0000 @@ -80,7 +80,7 @@ builder.compile("m1", MODS_DIR); builder.compile("m2", MODS_DIR, "--add-exports", "m1/p1=m2"); - builder.compile("m3", MODS_DIR, "--add-exports", "m1/p1=m3"); + builder.compile("m3", MODS_DIR, "--add-exports", "m1/p1=m3", "--add-reads", "m3=m1"); } diff -Nru openjdk-11-11~19/test/jdk/tools/launcher/modules/validate/src/hello/module-info.java openjdk-11-11~24/test/jdk/tools/launcher/modules/validate/src/hello/module-info.java --- openjdk-11-11~19/test/jdk/tools/launcher/modules/validate/src/hello/module-info.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/launcher/modules/validate/src/hello/module-info.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,23 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +module hello { } diff -Nru openjdk-11-11~19/test/jdk/tools/launcher/modules/validate/src/hello/p/Main.java openjdk-11-11~24/test/jdk/tools/launcher/modules/validate/src/hello/p/Main.java --- openjdk-11-11~19/test/jdk/tools/launcher/modules/validate/src/hello/p/Main.java 1970-01-01 00:00:00.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/launcher/modules/validate/src/hello/p/Main.java 2018-07-25 15:36:46.000000000 +0000 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ +package p; + +public class Main { + public static void main(String[] args) { + System.out.println("Hello world"); + } +} diff -Nru openjdk-11-11~19/test/jdk/tools/launcher/modules/validate/ValidateModulesTest.java openjdk-11-11~24/test/jdk/tools/launcher/modules/validate/ValidateModulesTest.java --- openjdk-11-11~19/test/jdk/tools/launcher/modules/validate/ValidateModulesTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/launcher/modules/validate/ValidateModulesTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -23,9 +23,10 @@ /** * @test + * @bug 8178380 8194937 * @modules java.xml - * @library /lib/testlibrary - * @build ValidateModulesTest JarUtils jdk.testlibrary.* + * @library src /lib/testlibrary + * @build ValidateModulesTest hello/* JarUtils jdk.testlibrary.* * @run testng ValidateModulesTest * @summary Basic test for java --validate-modules */ @@ -45,13 +46,40 @@ public class ValidateModulesTest { /** - * Test that the system modules validate. + * Basic test --validate-modules when there are no errors. */ - public void testSystemModules() throws Exception { - run("--validate-modules") - .stdoutShouldContain("java.base") - .stdoutShouldContain("java.xml") - .shouldHaveExitValue(0); + public void testNoErrors() throws Exception { + String modulePath = System.getProperty("test.module.path"); + + test("--validate-modules"); + + test("--validate-modules", "-version") + .shouldContain("Runtime Environment"); + + test("--validate-modules", "--list-modules") + .shouldContain("java.base"); + + test("--validate-modules", "-d", "java.base") + .shouldContain("exports java.lang"); + + test("-p", modulePath, "-m", "hello/p.Main") + .shouldContain("Hello world"); + + test("-p", modulePath, "--validate-modules", "-m", "hello/p.Main") + .shouldNotContain("Hello world"); + + test("-p", modulePath, "--validate-modules", "--list-modules") + .shouldContain("hello"); + + test("-p", modulePath, "--validate-modules", "-d", "hello") + .shouldContain("hello") + .shouldContain("contains p"); + + testExpectingError("--validate-modules", "--add-modules", "BAD") + .shouldContain("Module BAD not found"); + + testExpectingError("--validate-modules", "-m", "BAD") + .shouldContain("Module BAD not found"); } /** @@ -68,12 +96,9 @@ Path lib = Files.createDirectory(tmpdir.resolve("lib")); JarUtils.createJarFile(lib.resolve("xml.jar"), classes); - int exitValue = run("-p", lib.toString(), "--validate-modules") + testExpectingError("-p", lib.toString(), "--validate-modules") .shouldContain("xml automatic") - .shouldContain("conflicts with module java.xml") - .getExitValue(); - assertTrue(exitValue != 0); - + .shouldContain("conflicts with module java.xml"); } /** @@ -89,10 +114,8 @@ JarUtils.createJarFile(lib.resolve("foo-1.0.jar"), classes); JarUtils.createJarFile(lib.resolve("foo-2.0.jar"), classes); - int exitValue = run("-p", lib.toString(), "--validate-modules") - .shouldContain("contains same module") - .getExitValue(); - assertTrue(exitValue != 0); + testExpectingError("-p", lib.toString(), "--validate-modules") + .shouldContain("contains same module"); } /** @@ -110,18 +133,30 @@ Path lib2 = Files.createDirectory(tmpdir.resolve("lib2")); JarUtils.createJarFile(lib2.resolve("foo-2.0.jar"), classes); - run("-p", lib1 + File.pathSeparator + lib2, "--validate-modules") - .shouldContain("shadowed by") - .shouldHaveExitValue(0); + test("-p", lib1 + File.pathSeparator + lib2, "--validate-modules") + .shouldContain("shadowed by"); + } + + /** + * Runs the java launcher with the given arguments, expecting a 0 exit code + */ + private OutputAnalyzer test(String... args) throws Exception { + OutputAnalyzer analyzer = ProcessTools.executeTestJava(args) + .outputTo(System.out) + .errorTo(System.out); + assertTrue(analyzer.getExitValue() == 0); + return analyzer; } /** - * Runs the java launcher with the given arguments. + * Runs the java launcher with the given arguments, expecting a non-0 exit code */ - private OutputAnalyzer run(String... args) throws Exception { - return ProcessTools.executeTestJava(args) + private OutputAnalyzer testExpectingError(String... args) throws Exception { + OutputAnalyzer analyzer = ProcessTools.executeTestJava(args) .outputTo(System.out) .errorTo(System.out); + assertTrue(analyzer.getExitValue() != 0); + return analyzer; } /** diff -Nru openjdk-11-11~19/test/jdk/tools/launcher/RunpathTest.java openjdk-11-11~24/test/jdk/tools/launcher/RunpathTest.java --- openjdk-11-11~19/test/jdk/tools/launcher/RunpathTest.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/launcher/RunpathTest.java 2018-07-25 15:36:46.000000000 +0000 @@ -57,14 +57,14 @@ final TestResult tr = doExec(elfreaderCmd, "-d", javacmd); if (!tr.matches(expectedRpath)) { System.out.println(tr); - throw new RuntimeException("FAILED: RPATH strings " + + throw new RuntimeException("FAILED: RPATH/RUNPATH strings " + expectedRpath + " not found in " + javaCmd); } - System.out.println(javacmd + " contains expected RPATHS"); + System.out.println(javacmd + " contains expected RPATHS/RUNPATH"); } void testRpath() { - String expectedRpath = ".*RPATH.*\\$ORIGIN/../lib.*"; + String expectedRpath = ".*R(UN)?PATH.*\\$ORIGIN/../lib.*"; elfCheck(javaCmd, expectedRpath); } diff -Nru openjdk-11-11~19/test/jdk/tools/launcher/SourceMode.java openjdk-11-11~24/test/jdk/tools/launcher/SourceMode.java --- openjdk-11-11~19/test/jdk/tools/launcher/SourceMode.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/launcher/SourceMode.java 2018-07-25 15:36:46.000000000 +0000 @@ -21,11 +21,11 @@ * questions. */ -/* +/** * @test * @bug 8192920 8204588 * @summary Test source mode - * @modules jdk.compiler + * @modules jdk.compiler jdk.jlink * @run main SourceMode */ @@ -42,6 +42,7 @@ import java.util.List; import java.util.Map; import java.util.Set; +import java.util.spi.ToolProvider; public class SourceMode extends TestHelper { @@ -49,33 +50,47 @@ new SourceMode().run(args); } - // to reduce the chance of creating shebang lines that are too long, - // we use a relative path to the java command if that is shorter - private final Path shortJavaCmd; + // To reduce the chance of creating shebang lines that are too long, + // use a shorter path for a java command if the standard path is too long. + private final Path shebangJavaCmd; + + // Whether or not to automatically skip the shebang tests + private final boolean skipShebangTest; private final PrintStream log; - private final boolean skipShebangTest; + private static final String thisVersion = System.getProperty("java.specification.version"); - SourceMode() { - Path cwd = Paths.get(System.getProperty("user.dir")); - Path cmd = Paths.get(javaCmd); + SourceMode() throws Exception { + log = System.err; if (isWindows) { // Skip shebang tests on Windows, because that requires Cygwin. - shortJavaCmd = cmd; skipShebangTest = true; + shebangJavaCmd = null; } else { - // Skip shebang tests if the path to the Java launcher is too long, - // because that will cause tests to overflow the mostly undocumented - // limit of 120 characters for a shebang line. - Path p = cwd.relativize(cmd); - shortJavaCmd = (p.toString().length() < cmd.toString().length()) ? p : cmd; - // skipShebangTest = shortJavaCmd.toString().length() > 100; - skipShebangTest = true; + // Try to ensure the path to the Java launcher is reasonably short, + // to work around the mostly undocumented limit of 120 characters + // for a shebang line. + // The value of 120 is the typical kernel compile-time buffer limit. + // The following limit of 80 allows room for arguments to be placed + // after the path to the launcher on the shebang line. + Path cmd = Paths.get(javaCmd); + if (cmd.toString().length() < 80) { + shebangJavaCmd = cmd; + } else { + // Create a small image in the current directory, such that + // the path for the launcher is just "tmpJDK/bin/java". + Path tmpJDK = Paths.get("tmpJDK"); + ToolProvider jlink = ToolProvider.findFirst("jlink") + .orElseThrow(() -> new Exception("cannot find jlink")); + jlink.run(System.out, System.err, + "--add-modules", "jdk.compiler,jdk.zipfs", "--output", tmpJDK.toString()); + shebangJavaCmd = tmpJDK.resolve("bin").resolve("java"); + } + log.println("Using java command: " + shebangJavaCmd); + skipShebangTest = false; } - - log = System.err; } // java Simple.java 1 2 3 @@ -91,12 +106,12 @@ show(tr); } - // java --source 10 simple 1 2 3 + // java --source N simple 1 2 3 @Test void testSimple() throws IOException { starting("testSimple"); Path file = getSimpleFile("simple", false); - TestResult tr = doExec(javaCmd, "--source", "10", file.toString(), "1", "2", "3"); + TestResult tr = doExec(javaCmd, "--source", thisVersion, file.toString(), "1", "2", "3"); if (!tr.isOK()) error(tr, "Bad exit code: " + tr.exitValue); if (!tr.contains("[1, 2, 3]")) @@ -136,13 +151,13 @@ show(tr); } - // java @simple.at (contains --source 10 simple 1 2 3) + // java @simple.at (contains --source N simple 1 2 3) @Test void testSimpleAtFile() throws IOException { starting("testSimpleAtFile"); Path file = getSimpleFile("simple", false); Path atFile = Paths.get("simple.at"); - createFile(atFile, List.of("--source 10 " + file + " 1 2 3")); + createFile(atFile, List.of("--source " + thisVersion + " " + file + " 1 2 3")); TestResult tr = doExec(javaCmd, "@" + atFile); if (!tr.isOK()) error(tr, "Bad exit code: " + tr.exitValue); @@ -248,7 +263,7 @@ show(tr); } - // java --source 10 -jar simple.jar + // java --source N -jar simple.jar @Test void testSourceJarConflict() throws IOException { starting("testSourceJarConflict"); @@ -259,7 +274,7 @@ Path simpleJar = base.resolve("simple.jar"); createJar("cf", simpleJar.toString(), "-C", classes.toString(), "."); TestResult tr = - doExec(javaCmd, "--source", "10", "-jar", simpleJar.toString()); + doExec(javaCmd, "--source", thisVersion, "-jar", simpleJar.toString()); if (tr.isOK()) error(tr, "Command succeeded unexpectedly"); if (!tr.contains("Option -jar is not allowed with --source")) @@ -267,11 +282,11 @@ show(tr); } - // java --source 10 -m jdk.compiler + // java --source N -m jdk.compiler @Test void testSourceModuleConflict() throws IOException { starting("testSourceModuleConflict"); - TestResult tr = doExec(javaCmd, "--source", "10", "-m", "jdk.compiler"); + TestResult tr = doExec(javaCmd, "--source", thisVersion, "-m", "jdk.compiler"); if (tr.isOK()) error(tr, "Command succeeded unexpectedly"); if (!tr.contains("Option -m is not allowed with --source")) @@ -279,11 +294,15 @@ show(tr); } - // #!.../java --source 10 -version + // #!.../java --source N -version @Test void testTerminalOptionInShebang() throws IOException { starting("testTerminalOptionInShebang"); - if (skipShebangTest) { + if (skipShebangTest || isAIX || isMacOSX || isSolaris) { + // On MacOSX, we cannot distinguish between terminal options on the + // shebang line and those on the command line. + // On Solaris, all options after the first on the shebang line are + // ignored. Similar on AIX. log.println("SKIPPED"); return; } @@ -291,7 +310,7 @@ Paths.get("testTerminalOptionInShebang")); Path bad = base.resolve("bad"); createFile(bad, List.of( - "#!" + shortJavaCmd + " --source 10 -version")); + "#!" + shebangJavaCmd + " --source " + thisVersion + " -version")); setExecutable(bad); TestResult tr = doExec(bad.toString()); if (!tr.contains("Option -version is not allowed in this context")) @@ -299,11 +318,15 @@ show(tr); } - // #!.../java --source 10 @bad.at (contains -version) + // #!.../java --source N @bad.at (contains -version) @Test void testTerminalOptionInShebangAtFile() throws IOException { starting("testTerminalOptionInShebangAtFile"); - if (skipShebangTest) { + if (skipShebangTest || isAIX || isMacOSX || isSolaris) { + // On MacOSX, we cannot distinguish between terminal options in a + // shebang @-file and those on the command line. + // On Solaris, all options after the first on the shebang line are + // ignored. Similar on AIX. log.println("SKIPPED"); return; } @@ -313,7 +336,7 @@ createFile(bad_at, List.of("-version")); Path bad = base.resolve("bad"); createFile(bad, List.of( - "#!" + shortJavaCmd + " --source 10 @" + bad_at)); + "#!" + shebangJavaCmd + " --source " + thisVersion + " @" + bad_at)); setExecutable(bad); TestResult tr = doExec(bad.toString()); if (!tr.contains("Option -version in @testBadAtFile/bad.at is " @@ -322,18 +345,22 @@ show(tr); } - // #!.../java --source 10 HelloWorld + // #!.../java --source N HelloWorld @Test void testMainClassInShebang() throws IOException { starting("testMainClassInShebang"); - if (skipShebangTest) { + if (skipShebangTest || isAIX || isMacOSX || isSolaris) { + // On MacOSX, we cannot distinguish between a main class on the + // shebang line and one on the command line. + // On Solaris, all options after the first on the shebang line are + // ignored. Similar on AIX. log.println("SKIPPED"); return; } Path base = Files.createDirectories(Paths.get("testMainClassInShebang")); Path bad = base.resolve("bad"); createFile(bad, List.of( - "#!" + shortJavaCmd + " --source 10 HelloWorld")); + "#!" + shebangJavaCmd + " --source " + thisVersion + " HelloWorld")); setExecutable(bad); TestResult tr = doExec(bad.toString()); if (!tr.contains("Cannot specify main class in this context")) @@ -367,7 +394,7 @@ Path file = Paths.get(name); if (!Files.exists(file)) { createFile(file, List.of( - (shebang ? "#!" + shortJavaCmd + " --source 10" : ""), + (shebang ? "#!" + shebangJavaCmd + " --source=" + thisVersion: ""), "public class Simple {", " public static void main(String[] args) {", " System.out.println(java.util.Arrays.toString(args));", diff -Nru openjdk-11-11~19/test/jdk/tools/pack200/BandIntegrity.java openjdk-11-11~24/test/jdk/tools/pack200/BandIntegrity.java --- openjdk-11-11~19/test/jdk/tools/pack200/BandIntegrity.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/pack200/BandIntegrity.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -22,7 +22,7 @@ */ /* - * @test + * @test 8187645 * @summary test ensures the proper sequencing of bands, dump bands as well. * @compile -XDignore.symbol.file Utils.java BandIntegrity.java * @run main BandIntegrity diff -Nru openjdk-11-11~19/test/jdk/tools/pack200/pack200-verifier/make/build.xml openjdk-11-11~24/test/jdk/tools/pack200/pack200-verifier/make/build.xml --- openjdk-11-11~19/test/jdk/tools/pack200/pack200-verifier/make/build.xml 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/pack200/pack200-verifier/make/build.xml 2018-07-25 15:36:46.000000000 +0000 @@ -22,18 +22,18 @@ - + diff -Nru openjdk-11-11~19/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java openjdk-11-11~24/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java --- openjdk-11-11~19/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jdk/tools/pack200/pack200-verifier/src/xmlkit/ClassReader.java 2018-07-25 15:36:46.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2017, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2010, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -85,6 +85,8 @@ import com.sun.tools.classfile.ModuleResolution_attribute; import com.sun.tools.classfile.ModuleTarget_attribute; import com.sun.tools.classfile.ModulePackages_attribute; +import com.sun.tools.classfile.NestHost_attribute; +import com.sun.tools.classfile.NestMembers_attribute; import com.sun.tools.classfile.Opcode; import com.sun.tools.classfile.RuntimeInvisibleAnnotations_attribute; import com.sun.tools.classfile.RuntimeInvisibleParameterAnnotations_attribute; @@ -1566,6 +1568,30 @@ p.add(e); return null; } + + @Override + public Element visitNestHost(NestHost_attribute attr, Element p) { + String aname = x.getCpString(attr.attribute_name_index); + String hname = x.getCpString(attr.top_index); + Element se = new Element(aname); + se.add(hname); + se.trimToSize(); + p.add(se); + return null; + } + + @Override + public Element visitNestMembers(NestMembers_attribute attr, Element p) { + Element ee = new Element(x.getCpString(attr.attribute_name_index)); + for (int idx : attr.members_indexes) { + Element n = new Element("Item"); + n.setAttr("class", x.getCpString(idx)); + ee.add(n); + } + ee.trimToSize(); + p.add(ee); + return null; + } } class StackMapVisitor implements StackMapTable_attribute.stack_map_frame.Visitor { diff -Nru openjdk-11-11~19/test/jtreg-ext/requires/VMProps.java openjdk-11-11~24/test/jtreg-ext/requires/VMProps.java --- openjdk-11-11~19/test/jtreg-ext/requires/VMProps.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/jtreg-ext/requires/VMProps.java 2018-07-25 15:36:46.000000000 +0000 @@ -73,6 +73,15 @@ map.put("vm.debug", vmDebug()); map.put("vm.jvmci", vmJvmci()); map.put("vm.emulatedClient", vmEmulatedClient()); + // vm.hasSA is "true" if the VM contains the serviceability agent + // and jhsdb. + map.put("vm.hasSA", vmHasSA()); + // vm.hasSAandCanAttach is "true" if the VM contains the serviceability agent + // and jhsdb and it can attach to the VM. + map.put("vm.hasSAandCanAttach", vmHasSAandCanAttach()); + // vm.hasJFR is "true" if JFR is included in the build of the VM and + // so tests can be executed. + map.put("vm.hasJFR", vmHasJFR()); map.put("vm.cpu.features", cpuFeatures()); map.put("vm.rtm.cpu", vmRTMCPU()); map.put("vm.rtm.os", vmRTMOS()); @@ -176,16 +185,13 @@ * @return "true" if Flight Recorder is enabled, "false" if is disabled. */ protected String vmFlightRecorder() { - Boolean isUnlockedCommercialFatures = WB.getBooleanVMFlag("UnlockCommercialFeatures"); Boolean isFlightRecorder = WB.getBooleanVMFlag("FlightRecorder"); String startFROptions = WB.getStringVMFlag("StartFlightRecording"); - if (isUnlockedCommercialFatures != null && isUnlockedCommercialFatures) { - if (isFlightRecorder != null && isFlightRecorder) { - return "true"; - } - if (startFROptions != null && !startFROptions.isEmpty()) { - return "true"; - } + if (isFlightRecorder != null && isFlightRecorder) { + return "true"; + } + if (startFROptions != null && !startFROptions.isEmpty()) { + return "true"; } return "false"; } @@ -248,17 +254,48 @@ * @param flagName - flag name */ private void vmOptFinalFlag(Map map, String flagName) { - String value = WB.getBooleanVMFlag(flagName) ? "true" : "false"; + String value = String.valueOf(WB.getBooleanVMFlag(flagName)); map.put("vm.opt.final." + flagName, value); } /** * Selected sets of final flags. - * @param map -property-value pairs + * @param map - property-value pairs */ protected void vmOptFinalFlags(Map map) { vmOptFinalFlag(map, "ClassUnloading"); vmOptFinalFlag(map, "UseCompressedOops"); + vmOptFinalFlag(map, "EnableJVMCI"); + } + + /** + * @return "true" if VM has a serviceability agent. + */ + protected String vmHasSA() { + return "" + Platform.hasSA(); + } + + /** + * @return "true" if VM has a serviceability agent and it can + * attach to the VM. + */ + protected String vmHasSAandCanAttach() { + try { + return "" + Platform.shouldSAAttach(); + } catch (IOException e) { + System.out.println("Checking whether SA can attach to the VM failed."); + e.printStackTrace(); + // Run the tests anyways. + return "true"; + } + } + + /** + * @return "true" if the VM is compiled with Java Flight Recorder (JFR) + * support. + */ + protected String vmHasJFR() { + return "" + WB.isJFRIncludedInVmBuild(); } /** diff -Nru openjdk-11-11~19/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java openjdk-11-11~24/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java --- openjdk-11-11~19/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/langtools/jdk/javadoc/doclet/testDeprecatedDocs/TestDeprecatedDocs.java 2018-07-25 15:36:46.000000000 +0000 @@ -86,7 +86,7 @@ "
@Deprecated(forRemoval=true)\n"
                 + "public DeprecatedClassByAnnotation()
\n" + "
Deprecated, for removal: This API element is subject to removal in a future version.
", - "
@Deprecated\n"
+                "
@Deprecated\n"
                 + "public void method()
\n" + "
Deprecated.
"); diff -Nru openjdk-11-11~19/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java openjdk-11-11~24/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java --- openjdk-11-11~19/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java 2018-07-25 15:36:46.000000000 +0000 @@ -567,7 +567,7 @@ // Test with -nocomment and -nodeprecated options. The ClassDocs whould // not display definition lists for any member details. checkOutput("pkg1/C1.html", expectFound, - "
public void readObject()\n" +
+                "
public void readObject()\n" +
                 "                throws java.io.IOException
\n" + ""); diff -Nru openjdk-11-11~19/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java openjdk-11-11~24/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java --- openjdk-11-11~19/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java 2018-06-20 17:57:38.000000000 +0000 +++ openjdk-11-11~24/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java 2018-07-25 15:36:46.000000000 +0000 @@ -360,7 +360,7 @@ "
\n" + "

Package

\n", "
\n" - + "

Class/Interface

\n", + + "

Class or Interface

\n", "